diff --git a/dist/README.md b/dist/README.md index 8b4d84cf60e..7969dfb8e83 100644 --- a/dist/README.md +++ b/dist/README.md @@ -43,12 +43,12 @@ The main plotly.js bundles weight in at: | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js | |-----------|---------------|----------------------|---------------------| -| 8.1 MB | 3.4 MB | 1 MB | 8.4 MB | +| 8.2 MB | 3.5 MB | 1 MB | 8.5 MB | #### CDN links -> https://cdn.plot.ly/plotly-2.4.2.js +> https://cdn.plot.ly/plotly-2.5.0.js -> https://cdn.plot.ly/plotly-2.4.2.min.js +> https://cdn.plot.ly/plotly-2.5.0.min.js #### npm packages @@ -91,12 +91,12 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`. | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 2.7 MB | 972.6 kB | 316.4 kB | +| 2.7 MB | 972.9 kB | 316.5 kB | #### CDN links -> https://cdn.plot.ly/plotly-basic-2.4.2.js +> https://cdn.plot.ly/plotly-basic-2.5.0.js -> https://cdn.plot.ly/plotly-basic-2.4.2.min.js +> https://cdn.plot.ly/plotly-basic-2.5.0.min.js #### npm packages @@ -114,12 +114,12 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, ` | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 3.3 MB | 1.2 MB | 387.9 kB | +| 3.3 MB | 1.2 MB | 388 kB | #### CDN links -> https://cdn.plot.ly/plotly-cartesian-2.4.2.js +> https://cdn.plot.ly/plotly-cartesian-2.5.0.js -> https://cdn.plot.ly/plotly-cartesian-2.4.2.min.js +> https://cdn.plot.ly/plotly-cartesian-2.5.0.min.js #### npm packages @@ -137,12 +137,12 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 3 MB | 1.1 MB | 359.2 kB | +| 3 MB | 1.1 MB | 359.3 kB | #### CDN links -> https://cdn.plot.ly/plotly-geo-2.4.2.js +> https://cdn.plot.ly/plotly-geo-2.5.0.js -> https://cdn.plot.ly/plotly-geo-2.4.2.min.js +> https://cdn.plot.ly/plotly-geo-2.5.0.min.js #### npm packages @@ -160,12 +160,12 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 3.7 MB | 1.5 MB | 471.6 kB | +| 3.8 MB | 1.5 MB | 472.2 kB | #### CDN links -> https://cdn.plot.ly/plotly-gl3d-2.4.2.js +> https://cdn.plot.ly/plotly-gl3d-2.5.0.js -> https://cdn.plot.ly/plotly-gl3d-2.4.2.min.js +> https://cdn.plot.ly/plotly-gl3d-2.5.0.min.js #### npm packages @@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 3.8 MB | 1.5 MB | 493.6 kB | +| 3.8 MB | 1.5 MB | 495.5 kB | #### CDN links -> https://cdn.plot.ly/plotly-gl2d-2.4.2.js +> https://cdn.plot.ly/plotly-gl2d-2.5.0.js -> https://cdn.plot.ly/plotly-gl2d-2.4.2.min.js +> https://cdn.plot.ly/plotly-gl2d-2.5.0.min.js #### npm packages @@ -206,12 +206,12 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 4.3 MB | 1.7 MB | 513.4 kB | +| 4.3 MB | 1.7 MB | 513.6 kB | #### CDN links -> https://cdn.plot.ly/plotly-mapbox-2.4.2.js +> https://cdn.plot.ly/plotly-mapbox-2.5.0.js -> https://cdn.plot.ly/plotly-mapbox-2.4.2.min.js +> https://cdn.plot.ly/plotly-mapbox-2.5.0.min.js #### npm packages @@ -229,12 +229,12 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 2.9 MB | 1.1 MB | 348.9 kB | +| 2.9 MB | 1.1 MB | 349.1 kB | #### CDN links -> https://cdn.plot.ly/plotly-finance-2.4.2.js +> https://cdn.plot.ly/plotly-finance-2.5.0.js -> https://cdn.plot.ly/plotly-finance-2.4.2.min.js +> https://cdn.plot.ly/plotly-finance-2.5.0.min.js #### npm packages @@ -246,18 +246,18 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne ### plotly.js strict -The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `candlestick`, `carpet`, `choropleth`, `choroplethmapbox`, `contour`, `contourcarpet`, `densitymapbox`, `funnel`, `funnelarea`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `icicle`, `image`, `indicator`, `ohlc`, `parcats`, `pie`, `sankey`, `scatter`, `scattercarpet`, `scattergeo`, `scattermapbox`, `scatterpolar`, `scatterternary`, `sunburst`, `table`, `treemap`, `violin` and `waterfall`. +The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `candlestick`, `carpet`, `choropleth`, `choroplethmapbox`, `cone`, `contour`, `contourcarpet`, `densitymapbox`, `funnel`, `funnelarea`, `heatmap`, `heatmapgl`, `histogram`, `histogram2d`, `histogram2dcontour`, `icicle`, `image`, `indicator`, `isosurface`, `mesh3d`, `ohlc`, `parcats`, `pie`, `pointcloud`, `sankey`, `scatter`, `scatter`, `scatter3d`, `scattercarpet`, `scattergeo`, `scattermapbox`, `scatterpolar`, `scatterternary`, `streamtube`, `sunburst`, `surface`, `table`, `treemap`, `violin`, `volume` and `waterfall`. #### Stats | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 6.3 MB | 2.5 MB | 764.2 kB | +| 7.7 MB | 3.2 MB | 950.5 kB | #### CDN links -> https://cdn.plot.ly/plotly-strict-2.4.2.js +> https://cdn.plot.ly/plotly-strict-2.5.0.js -> https://cdn.plot.ly/plotly-strict-2.4.2.min.js +> https://cdn.plot.ly/plotly-strict-2.5.0.min.js #### npm packages diff --git a/dist/plotly-basic.js b/dist/plotly-basic.js index fcd00356ac5..1008f870bc8 100644 --- a/dist/plotly-basic.js +++ b/dist/plotly-basic.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic) v2.4.2 +* plotly.js (basic) v2.5.0 * Copyright 2012-2021, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -27894,7 +27894,7 @@ function createHoverText(hoverData, opts) { var ya = c0.ya; var axLetter = hovermode.charAt(0); var t0 = c0[axLetter + 'Label']; - var outerContainerBB = outerContainer.getBoundingClientRect(); + var outerContainerBB = getBoundingClientRect(gd, outerContainer); var outerTop = outerContainerBB.top; var outerWidth = outerContainerBB.width; var outerHeight = outerContainerBB.height; @@ -27969,7 +27969,7 @@ function createHoverText(hoverData, opts) { label.attr('transform', ''); - var tbb = ltext.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, ltext.node()); var lx, ly; if(hovermode === 'x') { @@ -28062,7 +28062,7 @@ function createHoverText(hoverData, opts) { var dummy = Drawing.tester.append('text') .text(s.text()) .call(Drawing.font, commonLabelFont); - var dummyBB = dummy.node().getBoundingClientRect(); + var dummyBB = getBoundingClientRect(gd, dummy.node()); if(Math.round(dummyBB.width) < Math.round(tbb.width)) { s.attr('x', ltx - dummyBB.width); } @@ -28151,7 +28151,7 @@ function createHoverText(hoverData, opts) { // Position the hover var legendContainer = container.select('g.legend'); - var tbb = legendContainer.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, legendContainer.node()); var tWidth = tbb.width + 2 * HOVERTEXTPAD; var tHeight = tbb.height + 2 * HOVERTEXTPAD; var winningPoint = hoverData[0]; @@ -28316,7 +28316,7 @@ function createHoverText(hoverData, opts) { .call(svgTextUtils.positionText, 0, 0) .call(svgTextUtils.convertToTspans, gd); - var t2bb = tx2.node().getBoundingClientRect(); + var t2bb = getBoundingClientRect(gd, tx2.node()); tx2width = t2bb.width + 2 * HOVERTEXTPAD; tx2height = t2bb.height + 2 * HOVERTEXTPAD; } else { @@ -28329,22 +28329,26 @@ function createHoverText(hoverData, opts) { stroke: contrastColor }); - var tbb = tx.node().getBoundingClientRect(); var htx = d.xa._offset + (d.x0 + d.x1) / 2; var hty = d.ya._offset + (d.y0 + d.y1) / 2; var dx = Math.abs(d.x1 - d.x0); var dy = Math.abs(d.y1 - d.y0); - var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width; - var anchorStartOK, anchorEndOK; - d.ty0 = outerTop - tbb.top; - d.bx = tbb.width + 2 * HOVERTEXTPAD; - d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height); + var tbb = getBoundingClientRect(gd, tx.node()); + var tbbWidth = tbb.width / fullLayout._invScaleX; + var tbbHeight = tbb.height / fullLayout._invScaleY; + + d.ty0 = (outerTop - tbb.top) / fullLayout._invScaleY; + d.bx = tbbWidth + 2 * HOVERTEXTPAD; + d.by = Math.max(tbbHeight + 2 * HOVERTEXTPAD, tx2height); d.anchor = 'start'; - d.txwidth = tbb.width; + d.txwidth = tbbWidth; d.tx2width = tx2width; d.offset = 0; + var txTotalWidth = (tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width) * fullLayout._invScaleX; + var anchorStartOK, anchorEndOK; + if(rotateLabels) { d.pos = htx; anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight; @@ -29104,6 +29108,36 @@ function getCoord(axLetter, winningPoint, fullLayout) { function getTopOffset(gd) { return gd.offsetTop + gd.clientTop; } function getLeftOffset(gd) { return gd.offsetLeft + gd.clientLeft; } +function getBoundingClientRect(gd, node) { + var fullLayout = gd._fullLayout; + + var rect = node.getBoundingClientRect(); + + var x0 = rect.x; + var y0 = rect.y; + var x1 = x0 + rect.width; + var y1 = y0 + rect.height; + + var A = Lib.apply3DTransform(fullLayout._invTransform)(x0, y0); + var B = Lib.apply3DTransform(fullLayout._invTransform)(x1, y1); + + var Ax = A[0]; + var Ay = A[1]; + var Bx = B[0]; + var By = B[1]; + + return { + x: Ax, + y: Ay, + width: Bx - Ax, + height: By - Ay, + top: Math.min(Ay, By), + left: Math.min(Ax, Bx), + right: Math.max(Ax, Bx), + bottom: Math.max(Ay, By), + }; +} + },{"../../lib":232,"../../lib/events":225,"../../lib/override_cursor":243,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":316,"../color":102,"../dragelement":121,"../drawing":124,"../legend/defaults":154,"../legend/draw":155,"./constants":136,"./helpers":138,"@plotly/d3":11,"fast-isnumeric":17,"tinycolor2":67}],140:[function(_dereq_,module,exports){ 'use strict'; @@ -82201,7 +82235,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.4.2'; +exports.version = '2.5.0'; },{}]},{},[8])(8) }); diff --git a/dist/plotly-basic.min.js b/dist/plotly-basic.min.js index 9b723114980..c0a3900fcb4 100644 --- a/dist/plotly-basic.min.js +++ b/dist/plotly-basic.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic - minified) v2.4.2 +* plotly.js (basic - minified) v2.5.0 * Copyright 2012-2021, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -21,4 +21,4 @@ object-assign * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,d=i();function f(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return d.epsilon(e)},segments:function(e){var t=o(!0,d,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,d,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,d,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,d,e)},union:function(e,t){return f(e,t,n.selectUnion)},intersect:function(e,t){return f(e,t,n.selectIntersect)},difference:function(e,t){return f(e,t,n.selectDifference)},differenceRev:function(e,t){return f(e,t,n.selectDifferenceRev)},xor:function(e,t){return f(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":58,"./lib/epsilon":59,"./lib/geojson":60,"./lib/intersecter":61,"./lib/segment-chainer":63,"./lib/segment-selector":64}],58:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],59:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],60:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var d=t.linesIntersect(o,l,c,u);if(!1===d){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var f=t.pointsSame(o,c),p=t.pointsSame(l,u);if(f&&p)return n;var h=!f&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(f)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===d.alongA&&(-1===d.alongB?s(e,c):0===d.alongB?s(e,d.pt):1===d.alongB&&s(e,u)),0===d.alongB&&(-1===d.alongA?s(n,o):0===d.alongA?s(n,d.pt):1===d.alongA&&s(n,l));return!1}for(var d=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function g(){if(h){var e=u(f,h);if(e)return e}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!h&&h.seg,!!m&&m.seg);var v,y=g();if(y){var x;if(e)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(y.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(e)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:v,below:v};r&&r.status(f.seg,!!h&&h.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}d.push(f.seg)}i.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":65,timers:66}],67:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,d=!1,f=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:N(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*C(p,255),g:255*C(h,255),b:255*C(m,255)},d=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*C(t,360),r=C(r,100),n=C(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),d=!0,f="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),d=!0,f="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=D(i),{ok:d,format:t.format||f,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));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(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function O(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function N(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),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})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],68:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=f[o-f[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=d[e-d[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=d[o.year-d[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=g.getFullYear(),i.month=1+g.getMonth(),i.day=g.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=f[a.year-f[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=f[i.year-f[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=d[i.year-d[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!g||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":82,"object-assign":55}],71:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":82,"object-assign":55}],72:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":82,"object-assign":55}],73:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":82,"object-assign":55}],74:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":82,"object-assign":55}],75:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":82,"object-assign":55}],76:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":82,"object-assign":55}],77:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),d=e-this.toJD(s,u,1)+1;return this.newDate(s,u,d)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":82,"object-assign":55}],79:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":82,"object-assign":55}],80:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":82,"object-assign":55}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":82,"object-assign":55}],82:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":55}],83:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,d=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){y("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(f,p);h>S;S=this.daysInMonth(f,p))p++,h-=S}return d>-1?this.fromJD(d):this.newDate(f,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":82,"object-assign":55}],84:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],85:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":208,"../../plot_api/plot_template":268,"../../plots/cartesian/constants":286,"../../plots/font_attributes":308,"./arrow_paths":84}],86:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],d=e["_"+i+"padminus"],f={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+f,m=p-f,g=3*e.startarrowsize*e.arrowwidth||0,v=g+f,y=g-f;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,v),ppadminus:Math.max(d,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=l?v+l:v,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,v),ppadminus:Math.max(d,m,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":232,"../../plots/cartesian/axes":279,"./draw":91}],87:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,d=[],f=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),d={},f=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],X=0;X1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===fe;"x"===te?(K=t[te],J=he?ae._offset+ae._length*K:J=T.l+T.w*K):(K=1-t[te],J=he?ae._offset+ae._length*K:J=T.t+T.h*K),$=t.showarrow?.5:K}if(t.showarrow){de.head=J;var me=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ge=s.getRefType(ne);"domain"===ge?("y"===te&&(me=1-me),de.tail=ae._offset+ae._length*me):"paper"===ge?"y"===te?(me=1-me,de.tail=T.t+T.h*me):de.tail=T.l+T.w*me:de.tail=ae._offset+ae.r2p(me),Q=ee}else de.tail=J+me,Q=ee+me;de.text=de.tail+ee;var ve=w["x"===te?"width":"height"];if("paper"===re&&(de.head=o.constrain(de.head,1,ve-1)),"pixel"===ne){var ye=-Math.max(de.tail-3,de.text),xe=Math.min(de.tail+3,de.text)-ve;ye>0?(de.tail+=ye,de.text+=ye):xe>0&&(de.tail-=xe,de.text-=xe)}de.tail+=ue,de.head+=ue}else Q=ee=se*U($,ce),de.text=J+ee;de.text+=ue,ee+=ue,Q+=ue,t["_"+te+"padplus"]=se/2+Q,t["_"+te+"padminus"]=se/2-Q,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)N.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),d)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;q.call(f.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),N.call(u.setTranslate,Math.round(C.x.text-E/2),Math.round(C.y.text-V/2)),I.attr({transform:"rotate("+O+","+C.x.text+","+C.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=C.x.head,d=C.y.head,f=C.x.tail+r,p=C.y.tail+n,m=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(O,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),R=+H.attr("height"),z=m-.5*D,F=z+D,E=b-.5*R,j=E+R,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,d,s+1e6,d+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(f,p,s,d,e[0],e[1],e[2],e[3]);t&&(f=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,q=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+f+","+p+"L"+s+","+d).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(g(G,U,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,W=d;if(t.standoff){var X=Math.sqrt(Math.pow(s-f,2)+Math.pow(d-p,2));Z+=t.standoff*(f-s)/X,W+=t.standoff*(p-d)/X}var J,Q,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:K.node(),gd:e,prepFn:function(){var e=u.getTranslate(N);J=e.x,Q=e.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,Q),a=n[0]+e,i=n[1]+r;N.call(u.setTranslate,a,i),L("x",y(v,e,"x",T,t)),L("y",y(x,r,"y",T,t)),t.axref===t.xref&&L("ax",y(v,e,"ax",T,t)),t.ayref===t.yref&&L("ay",y(x,r,"ay",T,t)),q.attr("transform",l(e,r)),I.attr({transform:"rotate("+O+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:N.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",y(v,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",y(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(v)a=y(v,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=y(x,r,"y",T,t);else{var u=t._ysize/T.h,d=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(d-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),v&&x||(n=h.getCursor(v?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(N,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(N),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*g+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(d=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(d),k=b*Math.sin(d);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(d),L=_*Math.sin(d);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":311,"../annotations/draw":91}],98:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=J*c.roundUp(X/J,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+H,V+F-H],G.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var Q,K=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),m.draw(r,n,d(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+E)*s.w,n=G.title.font.size;e="top"===A?(1-(V+F-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,te(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),d=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),f?(ee=p.bBox(f).height)>h&&(d[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)G.domain[1]-=ee/s.h,d[1]*=-1;else{G.domain[0]+=ee/s.h;var m=g.lineCount(o);d[1]+=(1-m)*h}i.attr("transform",u(d[0],d[1])),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-G.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var y=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(P);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var x=L.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var o=[0===i?L[0]:(P[i]+P[i-1])/2,i===P.length-1?L[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:B,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=D(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?I:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+R).call(p.lineGroupStyle,v.width,S(e),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var _=B+R+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(G),M=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,T):T,layer:$,path:l.makeTickPath(G,_,M),transFn:l.makeTransTickFn(G)}),l.drawLabels(r,G,{vals:T,layer:$,transFn:l.makeTransTickLabelFn(G),labelFns:l.makeLabelFns(G,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));te("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=R+t.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(K.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=U-q;e.select("."+k.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:q-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:B,y:q+t.ypad+("top"===A?ee:0),width:Math.max(R,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var d=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-d,s.t));var f={},m=T[t.yanchor],g=M[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*m,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*m,f.yb=t.y-t.len*g);var v=T[t.xanchor],y=M[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*y;else{var x=l-R;f.l=x*v,f.r=x*y,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*y}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":207,"../../lib":232,"../../lib/extend":226,"../../lib/setcursor":252,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../plots/cartesian/axis_defaults":281,"../../plots/cartesian/layout_attributes":294,"../../plots/cartesian/position_defaults":297,"../../plots/plots":314,"../../registry":316,"../color":102,"../colorscale/helpers":113,"../dragelement":121,"../drawing":124,"../titles":200,"./constants":104,"@plotly/d3":11,tinycolor2:67}],107:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":232}],108:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":103,"./defaults":105,"./draw":106,"./has_colorbar":107}],109:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,d=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(f+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",g=i+"mid",v=(l(f+p),l(f+h),l(f+m),{});v[h]=v[m]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:d||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[h]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":248,"../../lib/sort_object_keys":253,"../colorbar/attributes":103,"./scales.js":117}],110:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,d=i(u),f=!1!==d.auto,p=d.min,h=d.max,m=d.mid,g=function(){return a.aggNums(Math.min,null,s)},v=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=g():f&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===h?h=v():f&&(h=u._colorAx&&n(h)?Math.max(h,v()):v()),f&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",o))}},{"../../lib":232,"./helpers":113,"fast-isnumeric":17}],111:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],119:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":232}],120:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],121:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function d(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,f,p,h,m,g=e.gd,v=1,y=g._context.doubleClickDelay,x=e.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(v=Math.max(v-1,1)),g._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(v,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=d(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},s.coverSlip=u},{"../../lib":232,"../../plots/cartesian/constants":286,"./align":118,"./cursor":119,"./unhover":122,"has-hover":48,"has-passive-events":49,"mouse-event-offset":53}],122:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":224,"../../lib/events":225,"../../lib/throttle":256,"../fx/constants":136}],123:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],124:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),d=a.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,g=e("../../traces/scatter/subtypes"),v=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",d(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},x.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var b=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(e){var t=b[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(e,t){var r=e%100;return x.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,d=A[i],f=new Array(u),p=0;p"+v(e);h._gradientUrlQueryParts[y]=1},x.pattern=function(e,t,r,i,o,l,s,u,d,f,p,h){var m="legend"===t;u&&("overlay"===d?(f=u,p=c.contrast(f)):(f=void 0,p=u));var g,v,y,x,b,_,w,T,M,k,A,L=r._fullLayout,S="p"+L._uid+"-"+i,D={};switch(o){case"/":g=l*Math.sqrt(2),v=l*Math.sqrt(2),_="path",D={d:y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"\\":g=l*Math.sqrt(2),v=l*Math.sqrt(2),_="path",D={d:y="M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"x":g=l*Math.sqrt(2),v=l*Math.sqrt(2),y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2+"M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,x=l-l*Math.sqrt(1-s),_="path",D={d:y,opacity:h,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",D={d:y="M"+(g=l)/2+",0L"+g/2+","+(v=l),opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"-":_="path",_="path",D={d:y="M0,"+(v=l)/2+"L"+(g=l)+","+v/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"+":_="path",y="M"+(g=l)/2+",0L"+g/2+","+(v=l)+"M0,"+v/2+"L"+g+","+v/2,x=l-l*Math.sqrt(1-s),_="path",D={d:y,opacity:h,stroke:p,"stroke-width":x+"px"};break;case".":g=l,v=l,s.pattern_filled";L._patternUrlQueryParts[P]=1},x.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},x.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},x.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var d,f,p,h=!1;if(e.so)p=l.outlierwidth,f=l.outliercolor,d=o.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,h=!0),d="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,d).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var g=o.gradient,v=e.mgt;v?h=!0:v=g&&g.type,a.isArrayOrTypedArray(v)&&(v=v[0],A[v]||(v=0));var y=o.pattern,b=y&&x.getPatternAttr(y.shape,e.i,"");if(v&&"none"!==v){var _=e.mgc;_?h=!0:_=g.color;var T=r.uid;h&&(T+="-"+e.i),x.gradient(t,i,T,v,[[0,_],[1,d]],"fill")}else if(b){var M=x.getPatternAttr(y.bgcolor,e.i,null),k=x.getPatternAttr(y.fgcolor,e.i,null),L=y.fgopacity,S=x.getPatternAttr(y.size,e.i,8),D=x.getPatternAttr(y.solidity,e.i,.3),C=e.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),O=r.uid;C&&(O+="-"+e.i),x.pattern(t,"point",i,O,b,S,D,e.mcc,y.fillmode,M,k,L)}else c.fill(t,d);p&&c.stroke(t,f)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=g.isBubble(e)?v(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,d=l.opacity,f=void 0!==u,p=void 0!==d;(a.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=i.color,g=o.color,v=l.color;(g||v)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?g||t:v||t});var y=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(x.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,d=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,d,s._d3locale,p,e,h)}var m=e.tp||t.textposition,g=D(e,t),v=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,g,v).text(c).call(f.convertToTspans,r).call(S,m,g,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=D(e,t);c.fill(a,i),S(a,o,l,e.mrc2||e.mrc)}))}};function C(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),d=(u*u*i-c*c*l)*a,f=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&d/p),2),n.round(t[1]+(p&&f/p),2)],[n.round(t[0]-(h&&d/h),2),n.round(t[1]-(h&&f/h),2)]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},I=0),r&&(x.savedBBoxes[r]=g),I++,a.extendFlat({},g)},x.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=d(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var N=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(N,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(F);e=1===t&&1===r?[]:[d(o,l),"scale("+t+","+r+")",d(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":138,"../../constants/alignment":207,"../../constants/interactions":211,"../../constants/xmlns_namespaces":213,"../../lib":232,"../../lib/svg_text_utils":255,"../../registry":316,"../../traces/scatter/make_bubble_size_func":373,"../../traces/scatter/subtypes":381,"../color":102,"../colorscale":114,"./symbol_defs":125,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:67}],125:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":11}],126:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],127:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),d=0;d0;t.each((function(t){var d,f=t[0].trace,p=f.error_x||{},h=f.error_y||{};f.ids&&(d=function(e){return e.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,d);if(g.exit().remove(),t.length){p.visible||g.selectAll("path.xerror").remove(),h.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(g,r.layerClipId,e),g.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var d=h.width;i="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(i+="m-"+d+",0h"+2*d),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var f=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var g=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(i+="m0,-"+g+"v"+2*g),!f.size()?f=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(l.duration).ease(l.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":381,"../drawing":124,"@plotly/d3":11,"fast-isnumeric":17}],132:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":102,"@plotly/d3":11}],133:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":226,"../../plots/font_attributes":308,"./layout_attributes":143}],134:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+b[0]._offset,t.pointerY=ie+_[0]._offset,E="xval"in t?v.flat(l,t.xval):v.p2c(b,ae),Y="yval"in t?v.flat(l,t.yval):v.p2c(_,ie),!a(E[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(U=0;U$&&(ee.splice(0,$),ce=ee[0].distance),m&&0!==I&&0===ee.length){K.distance=I,K.index=!1;var d=G._module.hoverPoints(K,J,Q,"closest",{hoverLayer:s._hoverlayer});if(d&&(d=d.filter((function(e){return e.spikeDistance<=I}))),d&&d.length){var f,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var g=h[0];a(g.x0)&&a(g.y0)&&(f=fe(g),(!re.vLinePoint||re.vLinePoint.spikeDistance>f.spikeDistance)&&(re.vLinePoint=f))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(f=fe(x),(!re.hLinePoint||re.hLinePoint.spikeDistance>f.spikeDistance)&&(re.hLinePoint=f))}}}}}function de(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Ce(ee[Ae]);ee=Le,ge()}var Oe=e._hoverdata,Pe=[],Ie=H(e),Re=B(e);for(V=0;V1||ee.length>1)||"closest"===L&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),We=P(ee,{gd:e,hovermode:L,rotateLabels:Ge,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});v.isUnifiedHover(L)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,d=1,f=e.size(),p=new Array(f),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(d=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=v.length-1;l>=0;l--)v[l].dp+=a;for(g.push.apply(g,v),p.splice(o+1,1),c=0,l=g.length-1;l>=0;l--)c+=g[l].dp;for(i=c/g.length,l=g.length-1;l>=0;l--)g[l].dp-=i;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ge?"xa":"ya",s),R(We,Ge,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Xe=g.getComponentMethod("annotations","hasClickToShow")(e,Pe);d(n.select(t.target),Xe?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Oe))return;Oe&&e.emit("plotly_unhover",{event:t,points:Oe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:E,yvals:Y})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),d=Math.max(r,n),f=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(g.traceIs(m,"gl3d")){var v=a._fullLayout[m.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,d+=y,f+=x,h+=x}c.bbox={x0:u+o,x1:d+o,y0:f+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,d=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{},T=t.fontFamily||y.HOVERFONT,M=t.fontSize||y.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,O=i.charAt(0),P=k[O+"Label"],R=m.getBoundingClientRect(),z=R.top,N=R.width,F=R.height,E=void 0!==P&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(E){var j,H,B=!0;for(j=0;ja.width-b?(g=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+y.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+y.width/2)+"v"+x+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,C,O;"right"===D.side?(_="start",C=1,O="",g=S._offset+S._length):(_="end",C=-1,O="-",g=S._offset),v=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+O+A+","+A+"V"+(L+y.height/2)+"h"+O+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+O+A+"V-"+A+"Z");var I,R=y.height/2,N=z-y.top-R,F="clip"+a._uid+"commonlabel"+D._id;if(g=0?ne:ae+le=0?ae:me+le=0?te:re+se=0?re:ge+se=0,"top"!==e.idealAlign&&O||!R?O?(B+=V/2,e.anchor="start"):e.anchor="middle":(B-=V/2,e.anchor="end");else if(e.pos=B,O=H+Y/2+U<=N,R=H-Y/2-U>=0,"left"!==e.idealAlign&&O||!R)if(O)H+=Y/2,e.anchor="start";else{e.anchor="middle";var q=U/2,G=H+q-N,Z=H-q;G>0&&(H-=G),Z<0&&(H+=-Z)}else H-=Y/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(H,B)+(c?s(_):""))})),ve}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var d=e.hovertemplate||!1;if(d){var f=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),s=(s=o.hovertemplateString(d,f,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(O,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],d=c*(A+L),p=d+c*(e.txwidth+L),h=0,m=e.offset,g="middle"===l;g&&(d-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",g?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var v=h+d,y=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),v=g?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),v=g?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(v),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(f.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+d+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+d,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function N(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var g,v,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(g=c.pointerX,v=c.pointerY):(g=n._offset+y.x,v=a._offset+y.y);var x,b,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=g),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:M,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:v,r:T,fill:M}).classed("spikeline",!0)}if(d){var S,D,C=t.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+C.x,D=a._offset+C.y);var O,P,I=i.readability(C.color,h)<1.5?p.contrast(h):C.color,R=n.spikemode,z=n.spikethickness,N=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(O=F,P=D),-1!==R.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),O=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:P,"stroke-width":z,stroke:N,"stroke-dasharray":f.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:N}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}},{"../../lib":232,"../../lib/events":225,"../../lib/override_cursor":243,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":316,"../color":102,"../dragelement":121,"../drawing":124,"../legend/defaults":154,"../legend/draw":155,"./constants":136,"./helpers":138,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:67}],140:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":232,"../color":102,"./helpers":138}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":232,"./layout_attributes":143}],142:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":232,"../dragelement":121,"./attributes":133,"./calc":134,"./click":135,"./constants":136,"./defaults":137,"./helpers":138,"./hover":139,"./layout_attributes":143,"./layout_defaults":144,"./layout_global_defaults":145,"@plotly/d3":11}],143:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":308,"./constants":136}],144:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":232,"./hoverlabel_defaults":140,"./hovermode_defaults":141,"./layout_attributes":143}],145:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":232,"./hoverlabel_defaults":140,"./layout_attributes":143}],146:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),d=u*(1-o),f=0;f1){if(!f&&!p&&!h)"independent"===M("pattern")&&(f=!0);g._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),g._domains={x:u("x",M,w,x,y),y:u("y",M,T,b,v,_)}}else delete t.grid}function M(e,t){return n.coerce(r,g,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,f=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(h){var x=f.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var g=i.newContainer(t,"legend");if(T("uirevision",t.uirevision),!1!==m){T("bgcolor",t.paper_bgcolor),T("bordercolor"),T("borderwidth");var v,y,x,b=a.coerceFont(T,"font",t.font),_="h"===T("orientation");if(_?(v=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),T("traceorder",f),s.isGrouped(t.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",v),T("xanchor"),T("y",y),T("yanchor",x),T("valign"),a.noneOrAll(c,g,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=a.extendFlat({},b,{size:a.bigFont(b.size)});a.coerceFont(T,"title.font",w)}}}function T(e,t){return a.coerce(c,g,o,e,t)}}},{"../../lib":232,"../../plot_api/plot_template":268,"../../plots/layout_attributes":312,"../../registry":316,"./attributes":152,"./helpers":158}],155:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),d=e("../../lib/svg_text_utils"),f=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,g=h.FROM_TL,v=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&f(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&f(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?T(n,h):n);var g=r.itemwidth+2*p.itemGap;d.positionText(m,g,0),f?m.call(d.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),d=u[u.length-1],f=a.keyedContainer(i,"transforms["+d+"].styles","target","value.name");f.set(l.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(m,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),d.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,h=l.size*m;if(o){var g=c.bBox(o);u=g.height,f=g.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var v=e.select(1===n?".legendtitletext":".legendtext"),y=d.lineCount(v),x=v.node();if(u=h*y,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),d.positionText(v,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,f-=r.itemwidth),d.positionText(v,b,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=f)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,d=e._fullLayout,f="legend"+d._uid,h=t._inHover;h?(r=t.layer,f+="-hover"):r=d._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=d.showlegend&&y(e.calcdata,t)}var m=d.hiddenlabels||[];if(!(h||d.showlegend&&l.length))return r.selectAll(".legend").remove(),d._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var T=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),S=a.ensureSingleById(d._topdefs,"clipPath",f,(function(e){e.append("rect")})),D=a.ensureSingle(T,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));D.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(T,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").call(c.font,O.font).text(O.text),k(P,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var I=a.ensureSingle(T,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),R=C.selectAll("g.groups").data(l);R.enter().append("g").attr("class","groups"),R.exit().remove();var z=R.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,d=2*u,f=p.itemGap,h=a.itemwidth+2*f,m=2*(u+f),g=L(a),v=a.y<0||0===a.y&&"top"===g,y=a.y>1||1===a.y&&"bottom"===g,x=a.tracegroupgap;a._maxHeight=Math.max(v||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+f),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=f+h+d,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),M=a.x<0||0===a.x&&"right"===T,k=a.x>1||1===a.x&&"left"===T,S=y||v,D=i.width/2;a._maxWidth=Math.max(M?S&&"left"===T?o.l+o.w:D:k?S&&"right"===T?o.r+o.w:D:o.w,2*h);var C=0,O=0;r.each((function(e){var t=e[0].width+h;C=Math.max(C,t),O+=t})),_=null;var P=0;if(s){var I=0,R=0,z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+f+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),I=Math.max(I,t);var r=e+f;r+u+R>a._maxWidth&&(P=Math.max(P,R),R=0,z+=I+x,I=t),c.setTranslate(this,R,z),R+=r})),a._width=Math.max(P,R)+u,a._height=z+I+m}else{var N=r.size(),F=O+d+(N-1)*f=a._maxWidth&&(P=Math.max(P,B),j=0,H+=E,a._height+=E,E=0),c.setTranslate(this,w[0]+u+j,w[1]+u+H+t/2+f),B=j+r+f,j+=n,E=Math.max(E,t)})),F?(a._width=j+d,a._height=E+m):(a._width=Math.max(P,B)+d,a._height+=E+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Y=e._context.edits,V=Y.legendText||Y.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?h:_||h+e[0].width;l||(a+=f/2),c.setRect(t,0,-r/2,a,r)}))}(e,R,z,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*g[r],r:t._width*v[r],b:t._effHeight*v[n],t:t._effHeight*g[n]})}(e)){var l,u,m,y,x=d._size,b=t.borderwidth,w=x.l+x.w*t.x-g[A(t)]*t._width,M=x.t+x.h*(1-t.y)-g[L(t)]*t._effHeight;if(!h&&d.margin.autoexpand){var k=w,O=M;w=a.constrain(w,0,d.width-t._width),M=a.constrain(M,0,d.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),M!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(T,w,M),I.on(".drag",null),T.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),D.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),S.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(I,0,0,0,0),delete t._scrollY}else{var R,z,N,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);D.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),S.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),U(B,F,H),T.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,N=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(N,R,z),F,H))}));I.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,N=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(N,R,z),F,H))}));C.call(V)}if(e._context.edits.legendPosition)T.classed("cursor-move",!0),s.init({element:T.node(),gd:e,prepFn:function(){var e=c.getTranslate(T);m=e.x,y=e.y},moveFn:function(e,r){var n=m+e,a=y+r;c.setTranslate(T,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,T,a,t,n)}})}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),S.select("rect").attr("y",b+r)}}],e)}(e,t)}},{"../../constants/alignment":207,"../../lib":232,"../../lib/events":225,"../../lib/svg_text_utils":255,"../../plots/plots":314,"../../registry":316,"../color":102,"../dragelement":121,"../drawing":124,"./constants":153,"./get_legend_data":156,"./handle_click":157,"./helpers":158,"./style":160,"@plotly/d3":11}],156:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],d=!1,f={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),d=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var v=t._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,d=u.marker||{},f=d.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,d.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(d),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(d,"")(m)}var v=p||i.mc||d.color,y=d.pattern,x=y&&l.getPatternAttr(y.shape,0,"");if(x){var b=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,M=g(y.size,8,10),k=g(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,y.fillmode,b,_,T)}else a.call(s.fill,v);o&&s.stroke(a,i.mlc||f.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});d(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var d=a.selectAll("g.legendsymbols").data([e]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,d=n.select(this),f=c(a),p=f.colorscale,m=f.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[o]||v[0]:v}d.attr("d",e[0]),u?d.call(s.fill,u):d.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,d=o.showLine,f=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,v=o.anyLine,y=e[0],b=y.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!g?"M5,0":v?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}}),d||f){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(d||f?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(f?"l"+x+",0.0001":"h"+x)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,d=o.showLine,f=o.showMarker,p=e[0],h=p.trace,g=!f&&!c&&!s&&u.hasText(h);function v(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||g||d){var b={},w={};if(f){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",i.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}d&&(w.line={width:v("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),f&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(g?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":232,"../../registry":316,"../../traces/pie/helpers":348,"../../traces/pie/style_one":354,"../../traces/scatter/subtypes":381,"../color":102,"../colorscale/helpers":113,"../drawing":124,"./constants":153,"@plotly/d3":11}],161:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":163}],162:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function d(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},d=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,g=(1-h)/2;for(a=0;a1?(O=["toggleHover"],P=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],P=["resetGeo"]):g?(O=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],P=["resetViewMapbox"]):b?O=["hoverClosestGl2d"]:y?O=["hoverClosestPie"]:M?(O=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):O=["toggleHover"];m&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e0?f+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,d,f=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=d)));return p>=f?[f,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(M=d,S="y0",k=y,D="y1"):(M=y,S="y1",k=d,D="y0");X(n),K(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===I?J:Q,W.altKey=n.altKey},doneFn:function(){if(v(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(v(e))return;$(l)}};function X(r){if(v(e))I=null;else if(N)I="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else R?E("xanchor",r.xanchor=q(x+n)):(E("x0",r.x0=q(c+n)),E("x1",r.x1=q(g+n))),z?E("yanchor",r.yanchor=G(T+a)):(E("y0",r.y0=G(d+a)),E("y1",r.y1=G(y+a)));t.attr("d",_(e,r)),K(l,r)}function Q(n,a){if(F){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(N){if("resize-over-start-point"===I){var u=c+n,f=z?d-a:d+a;E("x0",r.x0=R?u:q(u)),E("y0",r.y0=z?f:G(f))}else if("resize-over-end-point"===I){var p=g+n,h=z?y-a:y+a;E("x1",r.x1=R?p:q(p)),E("y1",r.y1=z?h:G(h))}}else{var v=function(e){return-1!==I.indexOf(e)},b=v("n"),H=v("s"),Y=v("w"),Z=v("e"),W=b?M+a:M,X=H?k+a:k,J=Y?A+n:A,Q=Z?L+n:L;z&&(b&&(W=M-a),H&&(X=k-a)),(!z&&X-W>10||z&&W-X>10)&&(E(S,r[S]=z?W:G(W)),E(D,r[D]=z?X:G(X))),Q-J>10&&(E(C,r[C]=R?J:q(J)),E(O,r[O]=R?Q:q(Q)))}t.attr("d",_(e,r)),K(l,r)}function K(e,t){(R||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),R&&z){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}f.init(W),Z.node().onmousemove=X}(e,R,s,t,r,I):!0===s.editable&&R.style("pointer-events",O||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,g(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,d,f=t.type,p=i.getRefType(t.xref),g=i.getRefType(t.yref),v=i.getFromId(e,t.xref),y=i.getFromId(e,t.yref),x=e._fullLayout._size;if(v?"domain"===p?n=function(e){return v._offset+v._length*e}:(r=m.shapePositionToRange(v),n=function(e){return v._offset+v.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},y?"domain"===g?l=function(e){return y._offset+y._length*(1-e)}:(o=m.shapePositionToRange(y),l=function(e){return y._offset+y.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===f)return v&&"date"===v.type&&(n=m.decodeDate(n)),y&&"date"===y.type&&(l=m.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],d=h.paramIsY[c],f=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):d[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>f&&(e="X"),e}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,d=_-t.y1}else u=l(t.y0),d=l(t.y1);if("line"===f)return"M"+s+","+u+"L"+c+","+d;if("rect"===f)return"M"+s+","+u+"H"+c+"V"+d+"H"+s+"Z";var w=(s+c)/2,T=(u+d)/2,M=Math.abs(w-s),k=Math.abs(T-u),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,g(e)))}t.exports={draw:g,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&d(v),r.attr("d",m(t)),k&&!f)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*d.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+d.stepInset+(r.inputAreaLength-2*d.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-d.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*d.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",d.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,d.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*d.railInset,a=l.ensureSingle(e,"rect",d.railRectClass);a.attr({width:n,height:d.railWidth,rx:d.railRadius,ry:d.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,d.railInset,.5*(r.inputAreaWidth-d.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[d.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(d.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+d.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+d.groupClassName).data(r,v);s.enter().append("g").classed(d.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(v[0],v[1]))}}}return z.call(N),I&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(d.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,v,t,x):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(N)})).on("input",(function(e){this.text(e||" ").call(d.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":207,"../../constants/interactions":211,"../../lib":232,"../../lib/svg_text_utils":255,"../../plots/plots":314,"../../registry":316,"../color":102,"../drawing":124,"@plotly/d3":11,"fast-isnumeric":17}],201:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":226,"../../plot_api/edit_types":261,"../../plot_api/plot_template":268,"../../plots/font_attributes":308,"../../plots/pad_attributes":313,"../color/attributes":101}],202:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],203:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":232,"../../plots/array_container_defaults":274,"./attributes":201,"./constants":202}],204:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,d=e("./constants"),f=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(d.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,d.name,t).applyUpdate("active",o),"buttons"===t.type?v(e,n,null,null,t):"dropdown"===t.type&&(a.attr(d.menuIndexAttrName,"-1"),g(e,n,a,i,t),l||v(e,n,a,i,t))}function g(e,t,r,n,a){var i=l.ensureSingle(t,"g",d.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||d.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,f,p),l.ensureSingle(t,"text",d.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(d.arrowSymbol[a.direction])})).attr({x:s.headerWidth-d.arrowOffsetX+a.pad.l,y:s.headerHeight/2+d.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),v(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function v(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(d.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?d.dropdownButtonClassName:d.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,g=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=v.headerHeight+d.gapButtonHeader:h=v.headerWidth+d.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-d.gapButtonHeader+d.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-d.gapButtonHeader+d.gapButton-v.openWidth);var b={x:v.lx+h+o.pad.l,y:v.ly+g+o.pad.t,yPad:d.gapButton,xPad:d.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(v.openWidth,v.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(v.openHeight,v.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(d.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+d.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+d.headerGroupClassName).data(r,p);s.enter().append("g").classed(d.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",d.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=g+v;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,O=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+m,R=g;I+O>s&&(I=s-O);var z=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),C?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:R,width:O,height:P}),this._vbarYMin=R+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=u-.5,E=C?d+O+.5:d+.5,j=f-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+N).data(M||C?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",N).append("rect"),M||C?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,N,this.gd),this.bg.attr({x:h,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||C){var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),C&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":232,"../color":102,"../drawing":124,"@plotly/d3":11}],207:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],208:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],209:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],210:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],211:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],212:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],213:[function(e,t,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}},{}],214:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],216:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],217:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function d(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,d,f,p,h,m=s([r,n]);function g(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,d=o,f=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return d(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return d(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return d(e,t,r,n,a,i,1)}}},{"./mod":239}],218:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(d(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),v=e.charAt(0);!c||"G"!==v&&"g"!==v||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var C;M=Number(M);try{var O=g.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),C=O.newDate(M,O.toMonthIndex(M,k,P),A)}else C=O.newDate(M,Number(k),A)}catch(e){return u}return C?(C.toJD()-m)*d+L*f+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*d,M=3*f,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/d)+m,S=Math.floor(s(e,d));try{i=g.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=v("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+d&&e<=a-d))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function C(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=g.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var O=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,d),n=w(Math.floor(r/f),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),O[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+C(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return C(t,e,n,a)};var P=3*d;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,d);if(e=Math.round(e-n),r)try{var a=Math.round(e/d)+m,i=g.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*d+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&g.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+d*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,d=n-t,f=o-a,p=c-i,h=u*u+d*d,m=f*f+p*p,g=Math.min(s(u,d,h,a-e,i-t),s(u,d,h,o-e,c-t),s(f,p,m,e-a,t-i),s(f,p,m,r-a,n-i));return Math.sqrt(g)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),d=e.getPointAtLength(o(r,t)),f={x:(4*d.x+s.x+c.x)/6,y:(4*d.y+s.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),d=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,d=r.ys?r.y-s:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+r)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+r))return;p=f(d)}return{min:c,max:d,len:d-c,total:u,isClosed:0===c&&d===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++}return i}},{"./mod":239}],230:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],231:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],232:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,d=t.exports={};d.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var f={};d.warnBadFormat=function(e){var t=String(e);f[t]||(f[t]=1,d.warn('encountered bad format: "'+t+'"'))},d.noFormat=function(e){return String(e)},d.numberFormat=function(e){var t;try{t=i(d.adjustFormat(e))}catch(t){return d.warnBadFormat(e),d.noFormat}return t},d.nestedProperty=e("./nested_property"),d.keyedContainer=e("./keyed_container"),d.relativeAttr=e("./relative_attr"),d.isPlainObject=e("./is_plain_object"),d.toLogRange=e("./to_log_range"),d.relinkPrivateKeys=e("./relink_private");var p=e("./array");d.isTypedArray=p.isTypedArray,d.isArrayOrTypedArray=p.isArrayOrTypedArray,d.isArray1D=p.isArray1D,d.ensureArray=p.ensureArray,d.concat=p.concat,d.maxRowLength=p.maxRowLength,d.minRowLength=p.minRowLength;var h=e("./mod");d.mod=h.mod,d.modHalf=h.modHalf;var m=e("./coerce");d.valObjectMeta=m.valObjectMeta,d.coerce=m.coerce,d.coerce2=m.coerce2,d.coerceFont=m.coerceFont,d.coercePattern=m.coercePattern,d.coerceHoverinfo=m.coerceHoverinfo,d.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,d.validate=m.validate;var g=e("./dates");d.dateTime2ms=g.dateTime2ms,d.isDateTime=g.isDateTime,d.ms2DateTime=g.ms2DateTime,d.ms2DateTimeLocal=g.ms2DateTimeLocal,d.cleanDate=g.cleanDate,d.isJSDate=g.isJSDate,d.formatDate=g.formatDate,d.incrementMonth=g.incrementMonth,d.dateTick0=g.dateTick0,d.dfltRange=g.dfltRange,d.findExactDates=g.findExactDates,d.MIN_MS=g.MIN_MS,d.MAX_MS=g.MAX_MS;var v=e("./search");d.findBin=v.findBin,d.sorterAsc=v.sorterAsc,d.sorterDes=v.sorterDes,d.distinctVals=v.distinctVals,d.roundUp=v.roundUp,d.sort=v.sort,d.findIndexOfMin=v.findIndexOfMin,d.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");d.aggNums=y.aggNums,d.len=y.len,d.mean=y.mean,d.median=y.median,d.midRange=y.midRange,d.variance=y.variance,d.stdev=y.stdev,d.interp=y.interp;var x=e("./matrix");d.init2dArray=x.init2dArray,d.transposeRagged=x.transposeRagged,d.dot=x.dot,d.translationMatrix=x.translationMatrix,d.rotationMatrix=x.rotationMatrix,d.rotationXYMatrix=x.rotationXYMatrix,d.apply3DTransform=x.apply3DTransform,d.apply2DTransform=x.apply2DTransform,d.apply2DTransform2=x.apply2DTransform2,d.convertCssMatrix=x.convertCssMatrix,d.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");d.deg2rad=b.deg2rad,d.rad2deg=b.rad2deg,d.angleDelta=b.angleDelta,d.angleDist=b.angleDist,d.isFullCircle=b.isFullCircle,d.isAngleInsideSector=b.isAngleInsideSector,d.isPtInsideSector=b.isPtInsideSector,d.pathArc=b.pathArc,d.pathSector=b.pathSector,d.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");d.isLeftAnchor=_.isLeftAnchor,d.isCenterAnchor=_.isCenterAnchor,d.isRightAnchor=_.isRightAnchor,d.isTopAnchor=_.isTopAnchor,d.isMiddleAnchor=_.isMiddleAnchor,d.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");d.segmentsIntersect=w.segmentsIntersect,d.segmentDistance=w.segmentDistance,d.getTextLocation=w.getTextLocation,d.clearLocationCache=w.clearLocationCache,d.getVisibleSegment=w.getVisibleSegment,d.findPointOnPath=w.findPointOnPath;var T=e("./extend");d.extendFlat=T.extendFlat,d.extendDeep=T.extendDeep,d.extendDeepAll=T.extendDeepAll,d.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");d.log=M.log,d.warn=M.warn,d.error=M.error;var k=e("./regex");d.counterRegex=k.counter;var A=e("./throttle");d.throttle=A.throttle,d.throttleDone=A.done,d.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},d.noop=e("./noop"),d.identity=e("./identity"),d.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},d.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},d.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(d.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},d.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},d.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},d.syncOrAsync=function(e,t,r){var n;function a(){return d.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},d.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},d.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},d.fillArray=function(e,t,r,n){if(n=n||d.identity,d.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},d.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;d.templateString=function(e,t){var r={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||d.nestedProperty(t,n).get,a=r[n]()),d.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};d.hovertemplateString=function(){return E.apply(z,arguments)};var N={max:10,count:0,name:"texttemplate"};d.texttemplateString=function(){return E.apply(N,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,f,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,g="xother"===l||"yother"===l||p||m||h,v=l;if((p||h)&&(v=v.substring(1)),(m||h)&&(v=v.substring(0,v.length-1)),g){if(void 0===(c=t[v]))return""}else for(f=3;f=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;d.seedPseudoRandom=function(){j=2e9},d.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?d.pseudoRandom():j/4294967296},d.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=d.extractOption(e,t,"htx","hovertext");if(d.isValidTextValue(a))return n(a);var i=d.extractOption(e,t,"tx","text");return d.isValidTextValue(i)?n(i):void 0},d.isValidTextValue=function(e){return e||0===e},d.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,d.strTranslate(a-c*(r+o),i-c*(n+l))+d.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},d.ensureUniformFontSize=function(e,t){var r=d.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},d.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},d.bigFont=function(e){return Math.round(1.2*e)};var H=d.getFirefoxVersion(),B=null!==H&&H<86;d.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":212,"./anchor_utils":216,"./angles":217,"./array":218,"./clean_number":219,"./clear_responsive":221,"./coerce":222,"./dates":223,"./dom":224,"./extend":226,"./filter_unique":227,"./filter_visible":228,"./geometry2d":229,"./identity":230,"./increment":231,"./is_plain_object":233,"./keyed_container":234,"./localize":235,"./loggers":236,"./make_trace_groups":237,"./matrix":238,"./mod":239,"./nested_property":240,"./noop":241,"./notifier":242,"./preserve_drawing_buffer":245,"./push_unique":246,"./regex":248,"./relative_attr":249,"./relink_private":250,"./search":251,"./sort_object_keys":253,"./stats":254,"./throttle":256,"./to_log_range":257,"@plotly/d3":11,"d3-format":13,"d3-time-format":14,"fast-isnumeric":17}],233:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],234:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],f.set(e,null);if(d){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":266,"./notifier":242}],237:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],238:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],240:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,d,f,p,h,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(d,g)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":212,"./matrix":238}],245:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":17,"is-mobile":51}],246:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,d=0,f=t.length,p=0,h=f>1?(t[f-1]-t[0])/(f-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);d90&&a.log("Long binary search..."),d-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],d=u-a;void 0===a?(s.push(u),a=u):d>l&&(i=Math.min(i,d),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":218,"fast-isnumeric":17}],255:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(d,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var c=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:O,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",d=l.select("g");d.attr({fill:u,stroke:u});var f=s(d,"width"),p=s(d,"height"),h=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],g=-(r||s(e,"height"))/4;"y"===O[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-f/2,g-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?l.attr({x:e.attr("x"),y:g-p/2}):"a"===O[0]&&0!==O.indexOf("atitle")?l.attr({x:0,y:g}):l.attr({x:h,y:+e.attr("y")+g-p/2}),m&&m.call(e,c),t(c)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(v),C=0;C|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function C(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],257:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":17}],258:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],259:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],260:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,d=(l.subplotsRegistry.ternary||{}).attrRegex,f=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",d);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",d,y),!0;t.set(y)}return!m&&(f(g,v),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],C=u(v,d).get(),O=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",d,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,_),c(M)?O.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),C&&C.splice(_,0,{})):i.warn("Unrecognized full object edit value",d,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(O[x],1),C&&C.splice(O[x],1);if(D.length?S||t.set(D):t.set(null),m)return!1;if(f(g,v),h!==a){var R;if(-1===P)R=L;else{for(I=Math.max(D.length,I),R=[],x=0;x=P);x++)R.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),O(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in O(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,d,f=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=C(r,e.data.length-1),t)for(var m=0;m-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[f.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||f.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(f.rehover,f.redrag),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,f=F(s._preGUI,c),h=Object.keys(t),m=p.list(e),g=o.extendDeepAll({},t),v={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),Z=I.get();if(void 0!==R){A[P]=R,L[P]="reverse"===E?R:N(Z);var X=d.getLayoutValObject(s,I.parts);if(X&&X.impliedEdits&&null!==R)for(var J in X.impliedEdits)S(o.relativeAttr(P,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(R){S("autosize",null);var Q="height"===P?"width":"height";S(Q,s[Q])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(U))O(j),l(s,B+"._inputRange").set(null);else if(j.match(q)){O(j),l(s,B+"._inputRange").set(null);var K=l(s,B).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else j.match(G)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===R,ee="log"===V.type&&"linear"===R;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,R,S),u.getComponentMethod("images","convertCoords")(e,V,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=X||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[P]=null:b.isRemoveVal(R)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),v[r]||(v[r]={});var se=v[r][n];se||(se=v[r][n]={}),se[oe]=R,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===R||"select"===R)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:X?T.update(k,X):k.calc=!0,I.set(R))}}for(r in v){b.applyContainerArrayChanges(e,f(i,r),v[r],k,f)||(k.plot=!0)}for(var ce in C){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var de in k.calc=!0,ue)C[de]||(p.getFromId(e,de)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:C,undoit:L,redoit:A,eventData:g}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&f.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function X(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),d=u.flags;(s.calc||d.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];d.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),Y(e,d,u)||f.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||d.colorbars)&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.axrange&&V(p,u.rangesAltered),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag),c.add(e,X,[e,l.undoit,u.undoit,l.traces],X,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function d(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,f.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&d()};t()}var h,m,g=0;function v(e){return Array.isArray(a)?g>=a.length?e.transitionOpts=a[g]:e.transitionOpts=a[0]:e.transitionOpts=a,g++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:v(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);y=k}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,g=(u[m]||h[m]||{}).name,v=t[n].name,y=u[g]||h[g];g&&v&&"number"==typeof v&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[g]||h[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[m]={name:m},p.push({frame:f.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=f.modifyFrames,u=f.modifyFrames,d=[e,l],p=[e,i];return c&&c.add(e,s,d,u,p),f.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,d=e,f=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in d(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var d=u.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return v(a,t,l)},r.getLayoutValObject=function(e,t){return v(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:d,applyUpdate:function(t,r){t&&u(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":232,"../plots/attributes":275}],269:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),d=e("../components/modebar"),f=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,g=h.clean,v=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,g=e._fullLayout,v=g._size,x=v.p,_=f.list(e,"",!0);if(g._paperdiv.style({width:e._context.responsive&&g.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":g.width+"px",height:e._context.responsive&&g.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),e._context.setBackground(e,g.paper_bgcolor),r.drawMainTitle(e),d.manage(e),!g._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:v.t+v.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:v.l+v.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(a in g._plots)if((l=g._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,C=l.yaxis.domain,O=l.plotgroup;if(y(D,C,L)){var P=O.node(),I=l.bg=o.ensureSingle(O,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else O.select("rect.bg").remove(),L.push([D,C]),S||(k.push(a),A.push(a))}var R,z,N,F,E,j,H,B,Y,V,U,q,G,Z=g._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){g._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&g(i)&&e(i,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":232,"../plots/attributes":275,"../plots/plots":314,"./plot_config":266,"./plot_schema":267,"./plot_template":268}],271:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,d={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,f,p,h;function m(e){return!(e in t)||o.validate(t[e],d[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],f=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),f=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(d.format.values,", "," or ")+".");var g={};function v(e,r){return o.coerce(t,g,d,e,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},f);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,y,_),n=M._fullLayout.width,d=M._fullLayout.height;function f(){a.purge(M),document.body.removeChild(M)}if("full-json"===y){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),e(T?p:l.encodeJSON(p))}if(f(),"svg"===y)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:d,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":232,"../plots/plots":314,"../snapshot/helpers":320,"../snapshot/svgtoimg":322,"../snapshot/tosvg":324,"../version":389,"./plot_api":265,"fast-isnumeric":17}],272:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var d=Object.keys(e),f=0;fx.length&&a.push(h("unused",i,v.concat(x.length)));var k,A,L,S,D,C=x.length,O=Array.isArray(M);if(O&&(C=Math.min(C,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,v.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(O?Math.min(P,M[A].length):P);k++)L=O?M[A][k]:M,S=y[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,v.concat(A,k),S,D)):a.push(h("value",i,v.concat(A,k),S))}else a.push(h("array",i,v.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var g=m._fullData,v=r.length,y=0;y0&&Math.round(d)===d))return{vals:a};c=d}for(var f=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],g=i(m,f)||0,v=[],y=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);T=o(M,-c,f)}else{for(M=g+(w=Math.round((k-g)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}v[_]=p?T:h?M:(T+M)/2,y[_]=T,x[_]=M}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":212,"../../lib":232,"fast-isnumeric":17}],277:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],278:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,d=c.isLinked;function f(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,d=c.max;if(0===u.length||0===d.length)return i.simpleMap(t.range,t.r2l);var f=u[0].val,g=d[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>C&&(_=x,w=b,C=M/T):M/S>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=M/S));if(f===g){var O=f-1,P=f+1;if(A)if(0===f)a=[0,1];else{var I=(f>0?d:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=f/(1-Math.min(.5,I/S));a=f>0?[0,R]:[R,0]}else a=L?[Math.max(0,O),Math.max(1,P)]:[O,P]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-C*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-C*l(_),w.val+C*s(w)];return v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=i),i>p&&i-o&&(f=i),i>p&&i=P;n--)O(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],d=[];function f(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":124,"../../constants/numerical":212,"../../lib":232,"../../registry":316,"./axis_ids":283,"@plotly/d3":11,"fast-isnumeric":17}],279:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),d=e("../../components/color"),f=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,y=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,D=m.ONEMIN,C=m.ONESEC,O=m.MINUS_SIGN,P=m.BADNUM,I={K:"zeroline"},R={K:"gridline",L:"path"},z={K:"tick",L:"path"},N={K:"tick",L:"text"},F=e("../../constants/alignment"),E=F.MID_SHIFT,j=F.CAP_SHIFT,H=F.LINE_SPACING,B=F.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=e("./set_convert");var V=e("./axis_autotype"),U=e("./axis_ids"),q=U.idSort,G=U.isLinked;Y.id2name=U.id2name,Y.name2id=U.name2id,Y.cleanId=U.cleanId,Y.list=U.list,Y.listIds=U.listIds,Y.getFromId=U.getFromId,Y.getFromTrace=U.getFromTrace;var Z=e("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function W(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}Y.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},Y.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},Y.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==Y.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=Y.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},Y.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:Y.getFromId(t,r).cleanPos)(e)},Y.redrawComponents=function(e,t){t=t||Y.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=Y.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,v,c,i)),g=y,0;g<=u;)g=Y.tickIncrement(g,v,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(g,0,i),size:v,_dataSpan:u-c}},Y.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=Y.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dticki&&d=o:p<=o;p=Y.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(D.length>m||p===C)break;C=p;var O=!1;d&&p!==(0|p)&&(O=!0),D.push({minor:O,value:p})}if(f&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),d=r||u,f=0;d>=y?f=u>=y&&u<=g?u:v:r===b&&d>=_?f=u>=_&&u<=x?u:b:d>=M?f=u>=M&&u<=w?u:T:r===k&&d>=k?f=k:d>=A?f=A:r===L&&d>=L?f=L:r===S&&d>=S&&(f=S),f>=u&&(f=u,l=!0);var p=a+f;if(t.rangebreaks&&f>0){for(var h=0,m=0;m<84;m++){var D=(m+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(f*=h/84)||(e[n].drop=!0),l&&u>k&&(f=u)}(f>0||0===n)&&(e[n].periodX=a+f/2)}}(D,e,e._definedDelta),e.rangebreaks){var I="y"===e._id.charAt(0),R=1;"auto"===e.tickmode&&(R=e.tickfont?e.tickfont.size:12);var z=NaN;for(h=D.length-1;h>-1;h--)if(D[h].drop)D.splice(h,1);else{D[h].value=Ae(D[h].value,e);var N=e.c2p(D[h].value);(I?z>N-R:zu||Eu&&(F.periodX=u),E10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=C&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!de(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}Y.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>v)t/=v,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>T)t/=T,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=Y.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=oe(t,S,ee):i>D?e.dtick=oe(t,D,te):i>C?e.dtick=oe(t,C,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},Y.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,d=e+.01*o,f=l.roundUp(l.mod(d,1),u,r);return Math.floor(d)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=fe(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),p=e.exponentformat;"power"===p||ue(p)&&de(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":O)+f+"",t.fontSize*=1.25):("e"===p||"E"===p)&&f>2?t.text="1"+p+(d>0?"+":O)+f:(t.text=fe(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=fe(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=fe(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=O+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=fe(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var g=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[g(o.x-.5),g(o.x+e.dtick-.5)]}return o},Y.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return Y.hoverLabelText(e,n,r)+" - "+Y.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=Y.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":O+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function de(e){return e>14||e<-15}function fe(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=Y.getTickFormat(t),d=t.separatethousands;if(n){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,O);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?O+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-d:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?d-r.top:0,f),p.reverse()),r.width>0){var g=r.right-(t._offset+t._length);g>0&&(n.xr=1,n.r=g);var v=t._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?d-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-d:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ge(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=f),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Q&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,xe(t),n),i.autoMargin(e,be(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||Q&&"bottom"===t.side||X.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ge(t);else{var l=Le(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,d,p,h,m=Y.getPxPosition(e,t);"x"===i?(d=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,d="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var g=t._selections[t._id+"tick"];if(h={selection:g,side:t.side},g&&g.node()&&g.node().parentNode){var v=f.getTranslate(g.node().parentNode);h.offsetLeft=v.x,h.offsetTop=v.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:d,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(X)}}function K(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ye(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},Y.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=f*j,d+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,d+=3);l&&"top"===c&&(d-=f*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(d=-d);return[s?u:0,l?d:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},Y.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,d=i("inside"),f="inside"===n&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=f?e.ticklen:0;if(d?m*=-1:u&&(m=0),f&&(p+=m,r)){var g=l.deg2rad(r);p=m*Math.cos(g)+1,h=m*Math.sin(g)}e.showticklabels&&(f||e.showline)&&(p+=.2*e.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(d?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===M||d&&"top"===M)?1:-1,d&&(b*=-1),v=h*b,y=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(d?x+=E:x=-90===A&&"bottom"===M?j:90===A&&"top"===M?E:.5,T=E/2*(A/90)),w.xFn=function(e){return e.dx+v+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==d?-n:0};else if("y"===k){if(b=(_=!d&&"left"===M||d&&"right"===M)?1:-1,d&&(b*=-1),v=p,y=h*b,x=0,d||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?j:.5),d){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*j*b,x=0}}w.xFn=function(e){return e.dx+t-(v+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*E},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Y.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(d.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Se(t,[z]),i.attr("transform",r.transFn)},Y.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&Y.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(v,g+1?g:m);var b=null;t._selections&&(t._selections[d]=v);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===g?(b=90,_.push((function(){x(v,g)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(v.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ye(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",d=function(e){return-1!==c.indexOf(e)},h=d("top"),g=d("left"),y=d("right"),_=d("bottom")||g||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var g="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=d(r),a=0,o=0,l={},u=0;u2*a}(a,g)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var d=a("pattern",u);if(d===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(d)for(s=0;s<2;s++)switch(c=o[s],d){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":316,"./constants":286}],284:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function g(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FO&&(O=F);f/=(O-C)/(2*P),C=s.l2r(C),O=s.l2r(O),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,O)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,d={},f={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ve||Ue(),ge)o.indexOf("select")>-1&&L(r,a,J,Q,t.id,Oe),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ve){var l=m?I:P,c="s"===m||"w"===v?0:1,d=l._name+".range["+c+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",g="middle";if(l.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===v&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:g}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>O||o>O?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",q(Te))):l();else if(ne.isSubplotConstrained)if(i>O||o>O){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",q(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":232,"fast-isnumeric":17}],298:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":207}],299:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,d=c.rectMode,f=c.drawMode,p=c.openMode,h=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),g=e("../../components/shapes/draw_newshape/helpers").handleEllipse,v=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),k=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,D=e("./helpers"),C=D.p2r,O=D.axValue,P=D.getTransform;function I(e,t,r,n,a,i,o){var l,s,c,u,d,f,h,g,v,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(f=H(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),f(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=v(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function B(e,t,r){var n,i,o,l;for(n=0;n=0)D._fullLayout._deactivateShape(D);else if(!_){var r=R.clickmode;b.done(me).then((function(){if(b.clear(me),2===e){for(de.remove(),$=0;$-1&&I(t,D,a.xaxes,a.yaxes,a.subplot,a,de),"event"===r&&D.emit("plotly_selected",void 0);l.click(D,t)})).catch(y.error)}},a.doneFn=function(){he.remove(),b.done(me).then((function(){b.clear(me),a.gd.emit("plotly_selected",te),K&&a.selectionDefs&&(K.subtract=ue,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(ge)})).catch(y.error),_&&E(a)}},clearSelect:S,clearSelectionsCache:E,selectOnClick:I}},{"../../components/color":102,"../../components/dragelement/helpers":120,"../../components/drawing":124,"../../components/fx":142,"../../components/fx/helpers":138,"../../components/shapes/draw_newshape/display_outlines":190,"../../components/shapes/draw_newshape/helpers":191,"../../components/shapes/draw_newshape/newshapes":192,"../../lib":232,"../../lib/clear_gl_canvases":220,"../../lib/polygon":244,"../../lib/throttle":256,"../../plot_api/subroutines":269,"../../registry":316,"./axis_ids":283,"./constants":286,"./handle_outline":290,"./helpers":291,polybooljs:57}],300:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*g*Math.abs(n-a))}return m}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function C(t,r,n){return c(t,r,n||e.calendar)}function O(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function N(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?N(t,e._m,e._b):m},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?N(t,e._m2,d):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:d,e.l2c="log"===e.type?A:d,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=C,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return C(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=O,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return O(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=O,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=d,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return O(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var d=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===p;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(f=!f),f&&e._rangebreaks.reverse();var h=f?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function g(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),g=h[1]-h[0],v=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*v/g),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=d?c/p[2]:1,T=f?u/p[3]:1,M=d?p[0]:0,k=f?p[1]:0,A=d?p[0]/p[2]*c:0,L=f?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":124,"../../lib":232,"../../registry":316,"./axes":279,"@plotly/d3":11}],305:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",d=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(f,s,d,n),b.cleanPlot(f,s,d,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),a=Math.round(d*a)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(d),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(d){var g=(r.t+r.b)/d;g>1&&(r.t/=g,r.b/=g)}var v=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;f[t]={l:{val:v,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:x,size:r.t+h}},p[t]=1}else delete f[t],delete p[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),C(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,d=i.r,f=i.t,h=i.b,m=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in m)g[v]||delete m[v];for(var y in m.base={l:{val:0,size:c},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:h}},m){var x=m[y].l||{},_=m[y].b||{},w=x.val,T=x.size,M=_.val,k=_.size;for(var A in m){if(o(T)&&m[A].r){var L=m[A].r.val,S=m[A].r.size;if(L>w){var D=(T*L+(S-r)*w)/(L-w),O=(S*(1-w)+(T-r)*(1-L))/(L-w);D+O>c+d&&(c=D,d=O)}}if(o(k)&&m[A].t){var P=m[A].t.val,I=m[A].t.size;if(P>M){var R=(k*P+(I-n)*M)/(P-M),z=(I*(1-M)+(k-n)*(1-P))/(P-M);R+z>h+f&&(h=R,f=z)}}}}}var N=u.constrain(r-i.l-i.r,2,64),F=u.constrain(n-i.t-i.b,2,64),E=Math.max(0,r-N),j=Math.max(0,n-F);if(E){var H=(c+d)/E;H>1&&(c/=H,d/=H)}if(j){var B=(h+f)/j;B>1&&(h/=B,f/=B)}if(a.l=Math.round(c),a.r=Math.round(d),a.t=Math.round(f),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var d={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(d.layout=c(l),a)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return s&&(d.frames=c(s)),i&&(d.config=c(e._context,!0)),"object"===n?d:JSON.stringify(d)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,d),a=0;a0){for(var n=[],a=0;a-1&&(d[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":102,"../components/drawing":124,"../constants/xmlns_namespaces":213,"../lib":232,"@plotly/d3":11}],325:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rd+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[d+"a"],N=e[f+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(g,F,e),!1!==e.index&&g[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-y.bargroupwidth/2)},C=function(e){return Math.max(A(e),e.p+y.bargroupwidth/2)});var E=g[e.index],j=v.base?E.b+E.s:E.s;e[f+"0"]=e[f+"1"]=N.c2p(E[f],!0),e[f+"LabelVal"]=j;var H=y.extents[y.extents.round(E.p)];e[d+"0"]=z.c2p(x?D(E):H[0],!0),e[d+"1"]=z.c2p(x?C(E):H[1],!0);var B=void 0!==E.orig_p;return e[d+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[d+"LabelVal"],v[d+"hoverformat"]),e.valueLabel=s(N,e[f+"LabelVal"],v[f+"hoverformat"]),e.baseLabel=s(N,E.b,v[f+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return O(k(e),A(e),w)}(E))/2,e[d+"Spike"]=z.c2p(E.p,!0),o(E,v,e),e.hovertemplate=v.hovertemplate,e}}function d(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=d(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:d}},{"../../components/color":102,"../../components/fx":142,"../../constants/numerical":212,"../../lib":232,"../../plots/cartesian/axes":279,"../../registry":316,"./helpers":332}],334:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":293,"../scatter/marker_colorbar":374,"./arrays_to_calcdata":325,"./attributes":326,"./calc":327,"./cross_trace_calc":329,"./defaults":330,"./event_data":331,"./hover":333,"./layout_attributes":335,"./layout_defaults":336,"./plot":337,"./select":338,"./style":340}],335:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],336:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,d={},f=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,d="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,h=a.width,m=a.height,g=Math.abs(t-e),v=Math.abs(n-r),y=g>2*_&&v>2*_?_:0;g-=2*y,v-=2*y;var x=L(s);"auto"!==s||h<=g&&m<=v||!(h>g||m>v)||(h>v||m>g)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=q(E,j,z),j=q(j,E,z),H=q(H,B,!z),B=q(B,H,!z)}var G=k(i.ensureSingle(P,"path"),O,g,v);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!O.uniformtext.mode&&N){var Z=s.makePointStyleFns(d);s.singlePointStyle(c,G,d,Z,e)}!function(e,t,r,n,a,l,c,d,p,g,v){var w,T=t.xaxis,A=t.yaxis,C=e._fullLayout;function O(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,d,f,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,d="x",f=n):(s="x",c=n,d="y",f=a);function m(e){return u(f,f.c2l(e),!0).text}var g=t[r],v={};v.label=g.p,v.labelLabel=v[s+"Label"]=(y=g.p,u(c,c.c2l(y),!0).text);var y;var x=i.castOption(o,g.i,"text");(0===x||x)&&(v.text=x);v.value=g.s,v.valueLabel=v[d+"Label"]=m(g.s);var _={};b(_,o,g.i),p&&(v.delta=+g.rawS||g.s,v.deltaLabel=m(v.delta),v.final=g.v,v.finalLabel=m(v.final),v.initial=v.final-v.delta,v.initialLabel=m(v.initial));h&&(v.value=g.s,v.valueLabel=m(v.value),v.percentInitial=g.begR,v.percentInitialLabel=i.formatPercent(g.begR),v.percentPrevious=g.difR,v.percentPreviousLabel=i.formatPercent(g.difR),v.percentTotal=g.sumR,v.percenTotalLabel=i.formatPercent(g.sumR));var w=i.castOption(o,g.i,"customdata");w&&(v.customdata=w);return i.texttemplateString(l,v,e._d3locale,_,v,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var d,f=a.textinfo,p=e[t],h=f.split("+"),m=[],g=function(e){return-1!==h.indexOf(e)};g("label")&&m.push((v=e[t].p,u(o?n:r,v,!0).text));var v;g("text")&&(0===(d=i.castOption(a,p.i,"text"))||d)&&m.push(d);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(c(b)),g("delta")&&m.push(c(y)),g("final")&&m.push(c(x))}if(s){g("value")&&m.push(c(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(d=i.formatPercent(p.begR),w&&(d+=" of initial"),m.push(d)),g("percent previous")&&(d=i.formatPercent(p.difR),w&&(d+=" of previous"),m.push(d)),g("percent total")&&(d=i.formatPercent(p.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(y,o)}(C,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(P,a);var z="stack"===g.mode||"relative"===g.mode,N=n[a],F=!z||N._outmost;if(!R||"none"===w||(N.isBlank||l===c||d===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=C.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=q*(X/G):X>=G*(W/q);q>0&&G>0&&(J||Q||K)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Z=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=O(r,R,Z)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),q=U.width,G=U.height,V.attr("transform",$),q<=0||G<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,d=a.height,f=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:f>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/d):Math.min(1,f/u));var m=L(c),g=S(a,m),v=(l?g.x:g.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*v):(w=n+A*o,k=-A*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Z.size,f(P.type,ee,C),N.transform=ee,k(V,C,g,v).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,E,j,H,B,g,v),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,C,d.xcalendar,d.ycalendar)}));var H=!1===d.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,g)},toMoveInsideBar:D}},{"../../components/color":102,"../../components/drawing":124,"../../components/fx/helpers":138,"../../lib":232,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":316,"./attributes":326,"./constants":328,"./helpers":332,"./style":340,"./uniform_text":342,"@plotly/d3":11,"fast-isnumeric":17}],338:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,g(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":102,"../../components/drawing":124,"../../lib":232,"../../registry":316,"./attributes":326,"./helpers":332,"./uniform_text":342,"@plotly/d3":11}],341:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":102,"../../components/colorscale/defaults":112,"../../components/colorscale/helpers":113,"../../lib":232}],342:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),d=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),d){t._length=d,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),h=c("texttemplate");if(h||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||f&&"none"!==f){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var g=c("hole");if(c("title.text")){var v=c("title.position",g?"middle center":"top center");g||"middle center"!==v||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":232,"../../plots/domain":307,"../bar/defaults":330,"./attributes":343,"fast-isnumeric":17}],347:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":138}],348:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,e.pts)||e.color,borderColor:g.castOption(_.bordercolor,e.pts),fontFamily:g.castOption(w.family,e.pts),fontSize:g.castOption(w.size,e.pts),fontColor:g.castOption(w.color,e.pts),nameLength:g.castOption(_.namelength,e.pts),textAlign:g.castOption(_.align,e.pts),hovertemplate:g.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[v(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[v(e,d)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[v(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[v(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=g.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=g.castOption(e._input.textfont.color,t.pts));var a=g.castOption(e.insidetextfont.family,t.pts)||g.castOption(e.textfont.family,t.pts)||r.family,i=g.castOption(e.insidetextfont.size,t.pts)||g.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;g-=2)v(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)v(Math.PI*(g+1),"tan")}if(d||p){for(g=4;g>=-4;g-=2)v(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)v(Math.PI*(g+.5),"rad")}}if(l||h||d){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||f)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function C(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=d/e.titleBox.width,n=O(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function O(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:g.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:g.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=g.getFirstFilled(a.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function N(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),I(t,i);var f=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var f=n.select(this),h=t[0],m=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=g.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),f.attr("stroke-linejoin","round"),f.each((function(){var v=n.select(this).selectAll("g.slice").data(t);v.enter().append("g").classed("slice",!0),v.exit().remove();var y=[[[],[]],[[],[]]],_=!1;v.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,y[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),f=u.selectAll("path.surface").data([a]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),m.pull){var v=+g.castOption(m.pull,a.pts)||0;v>0&&(o+=v*a.pxmid[0],c+=v*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===h.vTotal){var M="M"+(o+a.px0[0])+","+(c+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";T?f.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+C(a.px0,a.pxmid,!1,T)+C(a.pxmid,a.px0,!1,T)+"Z"+M):f.attr("d",M)}else{var k=C(a.px0,a.px1,!0,1);if(T){var A=1-T;f.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+C(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+k+"Z")}else f.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+k+"Z")}z(e,a,h);var L=g.castOption(m.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=g.castOption(e.outsidetextfont.color,t.pts)||g.castOption(e.textfont.color,t.pts)||r.color,a=g.castOption(e.outsidetextfont.family,t.pts)||g.castOption(e.textfont.family,t.pts)||r.family,i=g.castOption(e.outsidetextfont.size,t.pts)||g.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):b(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var v,y=l.bBox(u.node());if("outside"===L)v=D(y,a);else if(v=w(y,a,h),"auto"===L&&v.scale<1){var x=s.ensureUniformFontSize(e,m.outsidetextfont);u.call(l.font,x),v=D(y=l.bBox(u.node()),a)}var T=v.textPosAngle,M=void 0===T?a.pxmid:R(h.r,T);if(v.targetX=o+M[0]*v.rCenter+(v.x||0),v.targetY=c+M[1]*v.rCenter+(v.y||0),N(v,y),v.outside){var k=v.targetY;a.yLabelMin=k-y.height/2,a.yLabelMid=k,a.yLabelMax=k+y.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}v.fontSize=f.size,p(m.type,v,r),t[i].transform=v,u.attr("transform",s.getTextTransform(v))}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=s.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,m.title.font).call(d.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):C(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,d,f,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(g.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(m+e.labelExtraY-v)*s>0&&(a=3*l*Math.abs(c-d.indexOf(e)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:v,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],d=u.concat(c),p=[],f=0;fMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(d-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(v,m),_&&m.automargin){var M=l.bBox(f.node()),k=m.domain,A=i.w*(k.x[1]-k.x[0]),L=i.h*(k.y[1]-k.y[0]),S=(.5*A-h.r)/i.w,O=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-O,yt:k.y[1]+O,l:Math.max(h.cx-h.r-M.left,0),r:Math.max(M.right-(h.cx+h.r),0),b:Math.max(M.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-M.top,0),pad:5})}}))}));setTimeout((function(){f.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:N}},{"../../components/color":102,"../../components/drawing":124,"../../components/fx":142,"../../lib":232,"../../lib/svg_text_utils":255,"../../plots/plots":314,"../bar/constants":328,"../bar/uniform_text":342,"./event_data":347,"./helpers":348,"@plotly/d3":11}],353:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":342,"./style_one":354,"@plotly/d3":11}],354:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":102,"./helpers":348}],355:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&C[v].gap;)v--;for(x=C[v].s,m=C.length-1;m>v;m--)C[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],363:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),d=e("./marker_defaults"),f=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var y=s(e,t,g,v);if(y||(t.visible=!1),t.visible){c(e,t,g,v),v("xhoverformat"),v("yhoverformat");var x=u(e,t,g,v),b=!x&&y=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(f.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=R[P][1])>=Z&&(N=R[P-1][0],F=R[P][0],j-E&&(z=N+(F-N)*(Z-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var W=l.defaultLine;return l.opacity(d.fillcolor)?W=d.fillcolor:l.opacity((d.line||{}).color)&&(W=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,d.text&&!Array.isArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}},{"../../components/color":102,"../../components/fx":142,"../../lib":232,"../../registry":316,"./get_trace_color":366}],368:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":293,"./arrays_to_calcdata":355,"./attributes":356,"./calc":357,"./cross_trace_calc":361,"./cross_trace_defaults":362,"./defaults":363,"./format_labels":365,"./hover":367,"./marker_colorbar":374,"./plot":377,"./select":378,"./style":380,"./subtypes":381}],369:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":112,"../../components/colorscale/helpers":113,"../../lib":232}],370:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,d=e("./constants");t.exports=function(e,t){var r,n,i,f,p,h,m,g,v,y,x,b,_,w,T,M,k,A,L=t.xaxis,S=t.yaxis,D="log"===L.type,C="log"===S.type,O=L._length,P=S._length,I=t.connectGaps,R=t.baseTolerance,z=t.shape,N="linear"===z,F=t.fill&&"none"!==t.fill,E=[],j=d.minTolerance,H=e.length,B=new Array(H),Y=0;function V(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(D&&(i=L.c2p(n.x,!0)),i===a)return!1;C&&s===a&&(i*=Math.abs(L._m*P*(L._m>0?o:l)/(S._m*O*(S._m>0?o:l)))),i*=1e3}if(s===a){if(C&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===B[Y-1][0],a=r===B[Y-1][1];if(!n||!a)if(Y>1){var i=t===B[Y-2][0],o=r===B[Y-2][1];n&&(t===te||t===re)&&i?o?Y--:B[Y-1]=e:a&&(r===ne||r===ae)&&o?i?Y--:B[Y-1]=e:B[Y++]=e}else B[Y++]=e}function ue(e){B[Y-1][0]!==e[0]&&B[Y-1][1]!==e[1]&&ce([X,J]),ce(e),Q=null,X=J=0}function de(e){if(k=e[0]/O,A=e[1]/P,Z=e[0]re?re:0,W=e[1]ae?ae:0,Z||W){if(Y)if(Q){var t=$(Q,e);t.length>1&&(ue(t[0]),B[Y++]=t[1])}else K=$(B[Y-1],e)[0],B[Y++]=K;else B[Y++]=[Z||e[0],W||e[1]];var r=B[Y-1];Z&&W&&(r[0]!==Z||r[1]!==W)?(Q&&(X!==Z&&J!==W?ce(X&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[X||Z,J||W]):X&&J&&ce([X,J])),ce([Z,W])):X-Z&&J-W&&ce([Z||X,W||J]),Q=e,X=Z,J=W}else Q&&ue($(Q,e)[0]),B[Y++]=e;var n,a,i,o}for("linear"===z||"spline"===z?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,e)q(h,fe))break;i=h,(_=v[0]*g[0]+v[1]*g[1])>x?(x=_,f=h,m=!1):_=e.length||!h)break;de(h),n=h}}else de(f)}Q&&ce([X||Q[0],J||Q[1]]),E.push(B.slice(0,Y))}return E}},{"../../constants/numerical":212,"../../lib":232,"./constants":360}],371:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],372:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,d=-1,f=0,p=-1;for(i=0;i=0?s=p:(s=p=f,f++),s0?Math.max(r,i):0}}},{"fast-isnumeric":17}],374:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],375:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),d=(e.line||{}).color;(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":102,"../../components/colorscale/defaults":112,"../../components/colorscale/helpers":113,"./subtypes":381}],376:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":212,"../../lib":232}],377:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),d=e("./link_traces"),f=e("../../lib/polygon").tester;function p(e,t,r,d,p,h,m){var g;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),d=n.extent(i.simpleMap(s.range,s.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]})),m=Math.ceil(h.length/p),g=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return v?e.transition():e}var x=r.xaxis,b=r.yaxis,_=d[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,D;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),d[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var O,P,I="",R=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,R=z._polygons);var N,F,E,j,H,B,Y,V="",U="",q=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(d),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(N=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):N=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},q=u(d,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),g=0;g1){var r=n.select(this);if(r.datum(d),e)y(r.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),s.singleLineStyle(d,a)}}}}}var Z=k.selectAll(".js-line").data(q);y(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(S?(S.datum(d),j&&B&&(C?("y"===C?j[1]=B[1]=b.c2p(0,!0):"x"===C&&(j[0]=B[0]=x.c2p(0,!0)),y(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle)):y(S).attr("d",V+"Z").call(s.singleFillStyle))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?y(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle):y(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(X(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?X(S):D&&X(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(d),L.datum(d),function(t,a,i){var o,u=i[0].trace,d=c.hasMarkers(u),f=c.hasText(u),p=ee(u),h=te,m=te;if(d||f){var g=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?Q:J:_&&!w&&(g=K),d&&(h=g),f&&(m=g)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);v&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),d&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,d);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function X(e){y(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function K(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,f,h=!i,m=!!i&&i.duration>0,g=d(e,t,r);((u=a.selectAll("g.trace").data(g,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,g,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,g,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":124,"../../lib":232,"../../lib/polygon":244,"../../registry":316,"./line_points":370,"./link_traces":372,"./subtypes":381,"@plotly/d3":11}],378:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],d=l[0].trace;if(!n.hasMarkers(d)&&!n.hasText(d))return[];if(!1===t)for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return f(e)>l};case">=":return function(e){return f(e)>=l};case"[]":return function(e){var t=f(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=f(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=f(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=f(e);return tl[1]};case"](":return function(e){var t=f(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=f(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(f(e))};case"}{":return function(e){return-1===l.indexOf(f(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),f),x={},b={},_=0;h?(g=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(d))},v=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(g=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},v=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(g);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],60:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var d=t.linesIntersect(o,l,c,u);if(!1===d){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var f=t.pointsSame(o,c),p=t.pointsSame(l,u);if(f&&p)return n;var h=!f&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(f)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===d.alongA&&(-1===d.alongB?s(e,c):0===d.alongB?s(e,d.pt):1===d.alongB&&s(e,u)),0===d.alongB&&(-1===d.alongA?s(n,o):0===d.alongA?s(n,d.pt):1===d.alongA&&s(n,l));return!1}for(var d=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function g(){if(h){var e=u(f,h);if(e)return e}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!h&&h.seg,!!m&&m.seg);var v,y=g();if(y){var x;if(e)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(y.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(e)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:v,below:v};r&&r.status(f.seg,!!h&&h.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}d.push(f.seg)}i.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":65,timers:66}],67:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,d=!1,f=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:N(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*C(p,255),g:255*C(h,255),b:255*C(m,255)},d=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*C(t,360),r=C(r,100),n=C(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),d=!0,f="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),d=!0,f="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=D(i),{ok:d,format:t.format||f,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));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(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function O(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function N(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),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})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],68:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=f[o-f[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=d[e-d[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=d[o.year-d[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=g.getFullYear(),i.month=1+g.getMonth(),i.day=g.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=f[a.year-f[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=f[i.year-f[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=d[i.year-d[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!g||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":82,"object-assign":55}],71:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":82,"object-assign":55}],72:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":82,"object-assign":55}],73:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":82,"object-assign":55}],74:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":82,"object-assign":55}],75:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":82,"object-assign":55}],76:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":82,"object-assign":55}],77:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),d=e-this.toJD(s,u,1)+1;return this.newDate(s,u,d)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":82,"object-assign":55}],79:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":82,"object-assign":55}],80:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":82,"object-assign":55}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":82,"object-assign":55}],82:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":55}],83:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,d=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){y("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(f,p);h>S;S=this.daysInMonth(f,p))p++,h-=S}return d>-1?this.fromJD(d):this.newDate(f,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":82,"object-assign":55}],84:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],85:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":208,"../../plot_api/plot_template":268,"../../plots/cartesian/constants":286,"../../plots/font_attributes":308,"./arrow_paths":84}],86:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],d=e["_"+i+"padminus"],f={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+f,m=p-f,g=3*e.startarrowsize*e.arrowwidth||0,v=g+f,y=g-f;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,v),ppadminus:Math.max(d,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=l?v+l:v,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,v),ppadminus:Math.max(d,m,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":232,"../../plots/cartesian/axes":279,"./draw":91}],87:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,d=[],f=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),d={},f=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],X=0;X1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===fe;"x"===te?(K=t[te],J=he?ae._offset+ae._length*K:J=T.l+T.w*K):(K=1-t[te],J=he?ae._offset+ae._length*K:J=T.t+T.h*K),$=t.showarrow?.5:K}if(t.showarrow){de.head=J;var me=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ge=s.getRefType(ne);"domain"===ge?("y"===te&&(me=1-me),de.tail=ae._offset+ae._length*me):"paper"===ge?"y"===te?(me=1-me,de.tail=T.t+T.h*me):de.tail=T.l+T.w*me:de.tail=ae._offset+ae.r2p(me),Q=ee}else de.tail=J+me,Q=ee+me;de.text=de.tail+ee;var ve=w["x"===te?"width":"height"];if("paper"===re&&(de.head=o.constrain(de.head,1,ve-1)),"pixel"===ne){var ye=-Math.max(de.tail-3,de.text),xe=Math.min(de.tail+3,de.text)-ve;ye>0?(de.tail+=ye,de.text+=ye):xe>0&&(de.tail-=xe,de.text-=xe)}de.tail+=ue,de.head+=ue}else Q=ee=se*U($,ce),de.text=J+ee;de.text+=ue,ee+=ue,Q+=ue,t["_"+te+"padplus"]=se/2+Q,t["_"+te+"padminus"]=se/2-Q,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)N.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),d)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;q.call(f.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),N.call(u.setTranslate,Math.round(C.x.text-E/2),Math.round(C.y.text-V/2)),I.attr({transform:"rotate("+O+","+C.x.text+","+C.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=C.x.head,d=C.y.head,f=C.x.tail+r,p=C.y.tail+n,m=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(O,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),R=+H.attr("height"),z=m-.5*D,F=z+D,E=b-.5*R,j=E+R,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,d,s+1e6,d+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(f,p,s,d,e[0],e[1],e[2],e[3]);t&&(f=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,q=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+f+","+p+"L"+s+","+d).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(g(G,U,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,W=d;if(t.standoff){var X=Math.sqrt(Math.pow(s-f,2)+Math.pow(d-p,2));Z+=t.standoff*(f-s)/X,W+=t.standoff*(p-d)/X}var J,Q,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:K.node(),gd:e,prepFn:function(){var e=u.getTranslate(N);J=e.x,Q=e.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,Q),a=n[0]+e,i=n[1]+r;N.call(u.setTranslate,a,i),L("x",y(v,e,"x",T,t)),L("y",y(x,r,"y",T,t)),t.axref===t.xref&&L("ax",y(v,e,"ax",T,t)),t.ayref===t.yref&&L("ay",y(x,r,"ay",T,t)),q.attr("transform",l(e,r)),I.attr({transform:"rotate("+O+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:N.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",y(v,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",y(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(v)a=y(v,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=y(x,r,"y",T,t);else{var u=t._ysize/T.h,d=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(d-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),v&&x||(n=h.getCursor(v?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(N,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(N),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*g+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(d=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(d),k=b*Math.sin(d);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(d),L=_*Math.sin(d);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":311,"../annotations/draw":91}],98:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=J*c.roundUp(X/J,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+H,V+F-H],G.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var Q,K=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),m.draw(r,n,d(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+E)*s.w,n=G.title.font.size;e="top"===A?(1-(V+F-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,te(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),d=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),f?(ee=p.bBox(f).height)>h&&(d[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)G.domain[1]-=ee/s.h,d[1]*=-1;else{G.domain[0]+=ee/s.h;var m=g.lineCount(o);d[1]+=(1-m)*h}i.attr("transform",u(d[0],d[1])),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-G.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var y=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(P);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var x=L.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var o=[0===i?L[0]:(P[i]+P[i-1])/2,i===P.length-1?L[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:B,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=D(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(v.color&&v.width?I:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+R).call(p.lineGroupStyle,v.width,S(e),v.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var _=B+R+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(G),M=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,T):T,layer:$,path:l.makeTickPath(G,_,M),transFn:l.makeTransTickFn(G)}),l.drawLabels(r,G,{vals:T,layer:$,transFn:l.makeTransTickLabelFn(G),labelFns:l.makeLabelFns(G,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));te("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=R+t.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(K.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=U-q;e.select("."+k.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:q-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:B,y:q+t.ypad+("top"===A?ee:0),width:Math.max(R,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var d=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-d,s.t));var f={},m=T[t.yanchor],g=M[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*m,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*m,f.yb=t.y-t.len*g);var v=T[t.xanchor],y=M[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*y;else{var x=l-R;f.l=x*v,f.r=x*y,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*y}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":207,"../../lib":232,"../../lib/extend":226,"../../lib/setcursor":252,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../plots/cartesian/axis_defaults":281,"../../plots/cartesian/layout_attributes":294,"../../plots/cartesian/position_defaults":297,"../../plots/plots":314,"../../registry":316,"../color":102,"../colorscale/helpers":113,"../dragelement":121,"../drawing":124,"../titles":200,"./constants":104,"@plotly/d3":11,tinycolor2:67}],107:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":232}],108:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":103,"./defaults":105,"./draw":106,"./has_colorbar":107}],109:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,d=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(f+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",g=i+"mid",v=(l(f+p),l(f+h),l(f+m),{});v[h]=v[m]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:d||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[h]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":248,"../../lib/sort_object_keys":253,"../colorbar/attributes":103,"./scales.js":117}],110:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,d=i(u),f=!1!==d.auto,p=d.min,h=d.max,m=d.mid,g=function(){return a.aggNums(Math.min,null,s)},v=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=g():f&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===h?h=v():f&&(h=u._colorAx&&n(h)?Math.max(h,v()):v()),f&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",o))}},{"../../lib":232,"./helpers":113,"fast-isnumeric":17}],111:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],119:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":232}],120:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],121:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function d(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,f,p,h,m,g=e.gd,v=1,y=g._context.doubleClickDelay,x=e.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(v=Math.max(v-1,1)),g._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(v,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=d(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},s.coverSlip=u},{"../../lib":232,"../../plots/cartesian/constants":286,"./align":118,"./cursor":119,"./unhover":122,"has-hover":48,"has-passive-events":49,"mouse-event-offset":53}],122:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":224,"../../lib/events":225,"../../lib/throttle":256,"../fx/constants":136}],123:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],124:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),d=a.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,g=e("../../traces/scatter/subtypes"),v=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",d(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},x.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var b=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(e){var t=b[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(e,t){var r=e%100;return x.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,d=A[i],f=new Array(u),p=0;p"+v(e);h._gradientUrlQueryParts[y]=1},x.pattern=function(e,t,r,i,o,l,s,u,d,f,p,h){var m="legend"===t;u&&("overlay"===d?(f=u,p=c.contrast(f)):(f=void 0,p=u));var g,v,y,x,b,_,w,T,M,k,A,L=r._fullLayout,S="p"+L._uid+"-"+i,D={};switch(o){case"/":g=l*Math.sqrt(2),v=l*Math.sqrt(2),_="path",D={d:y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"\\":g=l*Math.sqrt(2),v=l*Math.sqrt(2),_="path",D={d:y="M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"x":g=l*Math.sqrt(2),v=l*Math.sqrt(2),y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2+"M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,x=l-l*Math.sqrt(1-s),_="path",D={d:y,opacity:h,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",D={d:y="M"+(g=l)/2+",0L"+g/2+","+(v=l),opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"-":_="path",_="path",D={d:y="M0,"+(v=l)/2+"L"+(g=l)+","+v/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"+":_="path",y="M"+(g=l)/2+",0L"+g/2+","+(v=l)+"M0,"+v/2+"L"+g+","+v/2,x=l-l*Math.sqrt(1-s),_="path",D={d:y,opacity:h,stroke:p,"stroke-width":x+"px"};break;case".":g=l,v=l,s.pattern_filled";L._patternUrlQueryParts[P]=1},x.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},x.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},x.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var d,f,p,h=!1;if(e.so)p=l.outlierwidth,f=l.outliercolor,d=o.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,h=!0),d="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,d).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var g=o.gradient,v=e.mgt;v?h=!0:v=g&&g.type,a.isArrayOrTypedArray(v)&&(v=v[0],A[v]||(v=0));var y=o.pattern,b=y&&x.getPatternAttr(y.shape,e.i,"");if(v&&"none"!==v){var _=e.mgc;_?h=!0:_=g.color;var T=r.uid;h&&(T+="-"+e.i),x.gradient(t,i,T,v,[[0,_],[1,d]],"fill")}else if(b){var M=x.getPatternAttr(y.bgcolor,e.i,null),k=x.getPatternAttr(y.fgcolor,e.i,null),L=y.fgopacity,S=x.getPatternAttr(y.size,e.i,8),D=x.getPatternAttr(y.solidity,e.i,.3),C=e.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),O=r.uid;C&&(O+="-"+e.i),x.pattern(t,"point",i,O,b,S,D,e.mcc,y.fillmode,M,k,L)}else c.fill(t,d);p&&c.stroke(t,f)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=g.isBubble(e)?v(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,d=l.opacity,f=void 0!==u,p=void 0!==d;(a.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=i.color,g=o.color,v=l.color;(g||v)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?g||t:v||t});var y=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(x.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,d=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,d,s._d3locale,p,e,h)}var m=e.tp||t.textposition,g=D(e,t),v=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,g,v).text(c).call(f.convertToTspans,r).call(S,m,g,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=D(e,t);c.fill(a,i),S(a,o,l,e.mrc2||e.mrc)}))}};function C(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),d=(u*u*i-c*c*l)*a,f=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&d/p),2),n.round(t[1]+(p&&f/p),2)],[n.round(t[0]-(h&&d/h),2),n.round(t[1]-(h&&f/h),2)]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},I=0),r&&(x.savedBBoxes[r]=g),I++,a.extendFlat({},g)},x.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=d(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var N=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(N,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(F);e=1===t&&1===r?[]:[d(o,l),"scale("+t+","+r+")",d(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":138,"../../constants/alignment":207,"../../constants/interactions":211,"../../constants/xmlns_namespaces":213,"../../lib":232,"../../lib/svg_text_utils":255,"../../registry":316,"../../traces/scatter/make_bubble_size_func":373,"../../traces/scatter/subtypes":381,"../color":102,"../colorscale":114,"./symbol_defs":125,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:67}],125:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":11}],126:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],127:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),d=0;d0;t.each((function(t){var d,f=t[0].trace,p=f.error_x||{},h=f.error_y||{};f.ids&&(d=function(e){return e.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,d);if(g.exit().remove(),t.length){p.visible||g.selectAll("path.xerror").remove(),h.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(g,r.layerClipId,e),g.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var d=h.width;i="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(i+="m-"+d+",0h"+2*d),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var f=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var g=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(i+="m0,-"+g+"v"+2*g),!f.size()?f=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(l.duration).ease(l.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":381,"../drawing":124,"@plotly/d3":11,"fast-isnumeric":17}],132:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":102,"@plotly/d3":11}],133:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":226,"../../plots/font_attributes":308,"./layout_attributes":143}],134:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+b[0]._offset,t.pointerY=ie+_[0]._offset,E="xval"in t?v.flat(l,t.xval):v.p2c(b,ae),Y="yval"in t?v.flat(l,t.yval):v.p2c(_,ie),!a(E[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(U=0;U$&&(ee.splice(0,$),ce=ee[0].distance),m&&0!==I&&0===ee.length){K.distance=I,K.index=!1;var d=G._module.hoverPoints(K,J,Q,"closest",{hoverLayer:s._hoverlayer});if(d&&(d=d.filter((function(e){return e.spikeDistance<=I}))),d&&d.length){var f,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var g=h[0];a(g.x0)&&a(g.y0)&&(f=fe(g),(!re.vLinePoint||re.vLinePoint.spikeDistance>f.spikeDistance)&&(re.vLinePoint=f))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(f=fe(x),(!re.hLinePoint||re.hLinePoint.spikeDistance>f.spikeDistance)&&(re.hLinePoint=f))}}}}}function de(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Ce(ee[Ae]);ee=Le,ge()}var Oe=e._hoverdata,Pe=[],Ie=H(e),Re=B(e);for(V=0;V1||ee.length>1)||"closest"===L&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),We=P(ee,{gd:e,hovermode:L,rotateLabels:Ge,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});v.isUnifiedHover(L)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,d=1,f=e.size(),p=new Array(f),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(d=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=v.length-1;l>=0;l--)v[l].dp+=a;for(g.push.apply(g,v),p.splice(o+1,1),c=0,l=g.length-1;l>=0;l--)c+=g[l].dp;for(i=c/g.length,l=g.length-1;l>=0;l--)g[l].dp-=i;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ge?"xa":"ya",s),R(We,Ge,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Xe=g.getComponentMethod("annotations","hasClickToShow")(e,Pe);d(n.select(t.target),Xe?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Oe))return;Oe&&e.emit("plotly_unhover",{event:t,points:Oe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:E,yvals:Y})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),d=Math.max(r,n),f=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(g.traceIs(m,"gl3d")){var v=a._fullLayout[m.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,d+=y,f+=x,h+=x}c.bbox={x0:u+o,x1:d+o,y0:f+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,d=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{},T=t.fontFamily||y.HOVERFONT,M=t.fontSize||y.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,O=i.charAt(0),P=k[O+"Label"],R=Y(r,m),z=R.top,N=R.width,F=R.height,E=void 0!==P&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(E){var j,H,B=!0;for(j=0;ja.width-b?(g=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+y.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+y.width/2)+"v"+x+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,C,O;"right"===D.side?(_="start",C=1,O="",g=S._offset+S._length):(_="end",C=-1,O="-",g=S._offset),v=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+O+A+","+A+"V"+(L+y.height/2)+"h"+O+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+O+A+"V-"+A+"Z");var I,R=y.height/2,N=z-y.top-R,F="clip"+a._uid+"commonlabel"+D._id;if(g=0?ae:ie+se=0?ie:ge+se=0?re:ne+ce=0?ne:ve+ce=0,"top"!==e.idealAlign&&q||!G?q?(R+=H/2,e.anchor="start"):e.anchor="middle":(R-=H/2,e.anchor="end");else if(e.pos=R,q=O+j/2+Z<=N,G=O-j/2-Z>=0,"left"!==e.idealAlign&&q||!G)if(q)O+=j/2,e.anchor="start";else{e.anchor="middle";var W=Z/2,X=O+W-N,J=O-W;X>0&&(O-=X),J<0&&(O+=-J)}else O-=j/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(O,R)+(c?s(_):""))})),ye}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var d=e.hovertemplate||!1;if(d){var f=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),s=(s=o.hovertemplateString(d,f,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(O,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],d=c*(A+L),p=d+c*(e.txwidth+L),h=0,m=e.offset,g="middle"===l;g&&(d-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",g?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var v=h+d,y=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),v=g?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),v=g?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(v),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(f.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+d+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+d,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function N(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var g,v,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(g=c.pointerX,v=c.pointerY):(g=n._offset+y.x,v=a._offset+y.y);var x,b,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=g),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:M,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:v,r:T,fill:M}).classed("spikeline",!0)}if(d){var S,D,C=t.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+C.x,D=a._offset+C.y);var O,P,I=i.readability(C.color,h)<1.5?p.contrast(h):C.color,R=n.spikemode,z=n.spikethickness,N=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(O=F,P=D),-1!==R.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),O=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:P,"stroke-width":z,stroke:N,"stroke-dasharray":f.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:N}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),d=c[0],f=c[1],p=u[0],h=u[1];return{x:d,y:f,width:p-d,height:h-f,top:Math.min(f,h),left:Math.min(d,p),right:Math.max(d,p),bottom:Math.max(f,h)}}},{"../../lib":232,"../../lib/events":225,"../../lib/override_cursor":243,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":316,"../color":102,"../dragelement":121,"../drawing":124,"../legend/defaults":154,"../legend/draw":155,"./constants":136,"./helpers":138,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:67}],140:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":232,"../color":102,"./helpers":138}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":232,"./layout_attributes":143}],142:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":232,"../dragelement":121,"./attributes":133,"./calc":134,"./click":135,"./constants":136,"./defaults":137,"./helpers":138,"./hover":139,"./layout_attributes":143,"./layout_defaults":144,"./layout_global_defaults":145,"@plotly/d3":11}],143:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":308,"./constants":136}],144:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":232,"./hoverlabel_defaults":140,"./hovermode_defaults":141,"./layout_attributes":143}],145:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":232,"./hoverlabel_defaults":140,"./layout_attributes":143}],146:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),d=u*(1-o),f=0;f1){if(!f&&!p&&!h)"independent"===M("pattern")&&(f=!0);g._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),g._domains={x:u("x",M,w,x,y),y:u("y",M,T,b,v,_)}}else delete t.grid}function M(e,t){return n.coerce(r,g,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,f=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(h){var x=f.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var g=i.newContainer(t,"legend");if(T("uirevision",t.uirevision),!1!==m){T("bgcolor",t.paper_bgcolor),T("bordercolor"),T("borderwidth");var v,y,x,b=a.coerceFont(T,"font",t.font),_="h"===T("orientation");if(_?(v=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),T("traceorder",f),s.isGrouped(t.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",v),T("xanchor"),T("y",y),T("yanchor",x),T("valign"),a.noneOrAll(c,g,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=a.extendFlat({},b,{size:a.bigFont(b.size)});a.coerceFont(T,"title.font",w)}}}function T(e,t){return a.coerce(c,g,o,e,t)}}},{"../../lib":232,"../../plot_api/plot_template":268,"../../plots/layout_attributes":312,"../../registry":316,"./attributes":152,"./helpers":158}],155:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),d=e("../../lib/svg_text_utils"),f=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,g=h.FROM_TL,v=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&f(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&f(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?T(n,h):n);var g=r.itemwidth+2*p.itemGap;d.positionText(m,g,0),f?m.call(d.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),d=u[u.length-1],f=a.keyedContainer(i,"transforms["+d+"].styles","target","value.name");f.set(l.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(m,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),d.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,h=l.size*m;if(o){var g=c.bBox(o);u=g.height,f=g.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var v=e.select(1===n?".legendtitletext":".legendtext"),y=d.lineCount(v),x=v.node();if(u=h*y,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),d.positionText(v,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,f-=r.itemwidth),d.positionText(v,b,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=f)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,d=e._fullLayout,f="legend"+d._uid,h=t._inHover;h?(r=t.layer,f+="-hover"):r=d._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=d.showlegend&&y(e.calcdata,t)}var m=d.hiddenlabels||[];if(!(h||d.showlegend&&l.length))return r.selectAll(".legend").remove(),d._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var T=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),S=a.ensureSingleById(d._topdefs,"clipPath",f,(function(e){e.append("rect")})),D=a.ensureSingle(T,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));D.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(T,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").call(c.font,O.font).text(O.text),k(P,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var I=a.ensureSingle(T,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),R=C.selectAll("g.groups").data(l);R.enter().append("g").attr("class","groups"),R.exit().remove();var z=R.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,d=2*u,f=p.itemGap,h=a.itemwidth+2*f,m=2*(u+f),g=L(a),v=a.y<0||0===a.y&&"top"===g,y=a.y>1||1===a.y&&"bottom"===g,x=a.tracegroupgap;a._maxHeight=Math.max(v||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+f),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=f+h+d,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),M=a.x<0||0===a.x&&"right"===T,k=a.x>1||1===a.x&&"left"===T,S=y||v,D=i.width/2;a._maxWidth=Math.max(M?S&&"left"===T?o.l+o.w:D:k?S&&"right"===T?o.r+o.w:D:o.w,2*h);var C=0,O=0;r.each((function(e){var t=e[0].width+h;C=Math.max(C,t),O+=t})),_=null;var P=0;if(s){var I=0,R=0,z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+f+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),I=Math.max(I,t);var r=e+f;r+u+R>a._maxWidth&&(P=Math.max(P,R),R=0,z+=I+x,I=t),c.setTranslate(this,R,z),R+=r})),a._width=Math.max(P,R)+u,a._height=z+I+m}else{var N=r.size(),F=O+d+(N-1)*f=a._maxWidth&&(P=Math.max(P,B),j=0,H+=E,a._height+=E,E=0),c.setTranslate(this,w[0]+u+j,w[1]+u+H+t/2+f),B=j+r+f,j+=n,E=Math.max(E,t)})),F?(a._width=j+d,a._height=E+m):(a._width=Math.max(P,B)+d,a._height+=E+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Y=e._context.edits,V=Y.legendText||Y.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?h:_||h+e[0].width;l||(a+=f/2),c.setRect(t,0,-r/2,a,r)}))}(e,R,z,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*g[r],r:t._width*v[r],b:t._effHeight*v[n],t:t._effHeight*g[n]})}(e)){var l,u,m,y,x=d._size,b=t.borderwidth,w=x.l+x.w*t.x-g[A(t)]*t._width,M=x.t+x.h*(1-t.y)-g[L(t)]*t._effHeight;if(!h&&d.margin.autoexpand){var k=w,O=M;w=a.constrain(w,0,d.width-t._width),M=a.constrain(M,0,d.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),M!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(T,w,M),I.on(".drag",null),T.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),D.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),S.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(I,0,0,0,0),delete t._scrollY}else{var R,z,N,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);D.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),S.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),U(B,F,H),T.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,N=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(N,R,z),F,H))}));I.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,N=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(N,R,z),F,H))}));C.call(V)}if(e._context.edits.legendPosition)T.classed("cursor-move",!0),s.init({element:T.node(),gd:e,prepFn:function(){var e=c.getTranslate(T);m=e.x,y=e.y},moveFn:function(e,r){var n=m+e,a=y+r;c.setTranslate(T,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,T,a,t,n)}})}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),S.select("rect").attr("y",b+r)}}],e)}(e,t)}},{"../../constants/alignment":207,"../../lib":232,"../../lib/events":225,"../../lib/svg_text_utils":255,"../../plots/plots":314,"../../registry":316,"../color":102,"../dragelement":121,"../drawing":124,"./constants":153,"./get_legend_data":156,"./handle_click":157,"./helpers":158,"./style":160,"@plotly/d3":11}],156:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],d=!1,f={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),d=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var v=t._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,d=u.marker||{},f=d.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,d.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(d),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(d,"")(m)}var v=p||i.mc||d.color,y=d.pattern,x=y&&l.getPatternAttr(y.shape,0,"");if(x){var b=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,M=g(y.size,8,10),k=g(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,y.fillmode,b,_,T)}else a.call(s.fill,v);o&&s.stroke(a,i.mlc||f.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});d(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var d=a.selectAll("g.legendsymbols").data([e]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,d=n.select(this),f=c(a),p=f.colorscale,m=f.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[o]||v[0]:v}d.attr("d",e[0]),u?d.call(s.fill,u):d.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,d=o.showLine,f=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,v=o.anyLine,y=e[0],b=y.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!g?"M5,0":v?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}}),d||f){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(d||f?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(f?"l"+x+",0.0001":"h"+x)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,d=o.showLine,f=o.showMarker,p=e[0],h=p.trace,g=!f&&!c&&!s&&u.hasText(h);function v(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||g||d){var b={},w={};if(f){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",i.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}d&&(w.line={width:v("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),f&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(g?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":232,"../../registry":316,"../../traces/pie/helpers":348,"../../traces/pie/style_one":354,"../../traces/scatter/subtypes":381,"../color":102,"../colorscale/helpers":113,"../drawing":124,"./constants":153,"@plotly/d3":11}],161:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":163}],162:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function d(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},d=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,g=(1-h)/2;for(a=0;a1?(O=["toggleHover"],P=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],P=["resetGeo"]):g?(O=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],P=["resetViewMapbox"]):b?O=["hoverClosestGl2d"]:y?O=["hoverClosestPie"]:M?(O=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):O=["toggleHover"];m&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e0?f+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,d,f=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=d)));return p>=f?[f,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(M=d,S="y0",k=y,D="y1"):(M=y,S="y1",k=d,D="y0");X(n),K(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===I?J:Q,W.altKey=n.altKey},doneFn:function(){if(v(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(v(e))return;$(l)}};function X(r){if(v(e))I=null;else if(N)I="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else R?E("xanchor",r.xanchor=q(x+n)):(E("x0",r.x0=q(c+n)),E("x1",r.x1=q(g+n))),z?E("yanchor",r.yanchor=G(T+a)):(E("y0",r.y0=G(d+a)),E("y1",r.y1=G(y+a)));t.attr("d",_(e,r)),K(l,r)}function Q(n,a){if(F){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(N){if("resize-over-start-point"===I){var u=c+n,f=z?d-a:d+a;E("x0",r.x0=R?u:q(u)),E("y0",r.y0=z?f:G(f))}else if("resize-over-end-point"===I){var p=g+n,h=z?y-a:y+a;E("x1",r.x1=R?p:q(p)),E("y1",r.y1=z?h:G(h))}}else{var v=function(e){return-1!==I.indexOf(e)},b=v("n"),H=v("s"),Y=v("w"),Z=v("e"),W=b?M+a:M,X=H?k+a:k,J=Y?A+n:A,Q=Z?L+n:L;z&&(b&&(W=M-a),H&&(X=k-a)),(!z&&X-W>10||z&&W-X>10)&&(E(S,r[S]=z?W:G(W)),E(D,r[D]=z?X:G(X))),Q-J>10&&(E(C,r[C]=R?J:q(J)),E(O,r[O]=R?Q:q(Q)))}t.attr("d",_(e,r)),K(l,r)}function K(e,t){(R||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),R&&z){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}f.init(W),Z.node().onmousemove=X}(e,R,s,t,r,I):!0===s.editable&&R.style("pointer-events",O||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,g(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,d,f=t.type,p=i.getRefType(t.xref),g=i.getRefType(t.yref),v=i.getFromId(e,t.xref),y=i.getFromId(e,t.yref),x=e._fullLayout._size;if(v?"domain"===p?n=function(e){return v._offset+v._length*e}:(r=m.shapePositionToRange(v),n=function(e){return v._offset+v.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},y?"domain"===g?l=function(e){return y._offset+y._length*(1-e)}:(o=m.shapePositionToRange(y),l=function(e){return y._offset+y.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===f)return v&&"date"===v.type&&(n=m.decodeDate(n)),y&&"date"===y.type&&(l=m.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],d=h.paramIsY[c],f=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):d[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>f&&(e="X"),e}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,d=_-t.y1}else u=l(t.y0),d=l(t.y1);if("line"===f)return"M"+s+","+u+"L"+c+","+d;if("rect"===f)return"M"+s+","+u+"H"+c+"V"+d+"H"+s+"Z";var w=(s+c)/2,T=(u+d)/2,M=Math.abs(w-s),k=Math.abs(T-u),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,g(e)))}t.exports={draw:g,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&d(v),r.attr("d",m(t)),k&&!f)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*d.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+d.stepInset+(r.inputAreaLength-2*d.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-d.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*d.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",d.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,d.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*d.railInset,a=l.ensureSingle(e,"rect",d.railRectClass);a.attr({width:n,height:d.railWidth,rx:d.railRadius,ry:d.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,d.railInset,.5*(r.inputAreaWidth-d.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[d.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(d.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+d.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+d.groupClassName).data(r,v);s.enter().append("g").classed(d.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(v[0],v[1]))}}}return z.call(N),I&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(d.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,v,t,x):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(N)})).on("input",(function(e){this.text(e||" ").call(d.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":207,"../../constants/interactions":211,"../../lib":232,"../../lib/svg_text_utils":255,"../../plots/plots":314,"../../registry":316,"../color":102,"../drawing":124,"@plotly/d3":11,"fast-isnumeric":17}],201:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":226,"../../plot_api/edit_types":261,"../../plot_api/plot_template":268,"../../plots/font_attributes":308,"../../plots/pad_attributes":313,"../color/attributes":101}],202:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],203:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":232,"../../plots/array_container_defaults":274,"./attributes":201,"./constants":202}],204:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,d=e("./constants"),f=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(d.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,d.name,t).applyUpdate("active",o),"buttons"===t.type?v(e,n,null,null,t):"dropdown"===t.type&&(a.attr(d.menuIndexAttrName,"-1"),g(e,n,a,i,t),l||v(e,n,a,i,t))}function g(e,t,r,n,a){var i=l.ensureSingle(t,"g",d.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||d.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,f,p),l.ensureSingle(t,"text",d.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(d.arrowSymbol[a.direction])})).attr({x:s.headerWidth-d.arrowOffsetX+a.pad.l,y:s.headerHeight/2+d.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),v(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function v(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(d.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?d.dropdownButtonClassName:d.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,g=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=v.headerHeight+d.gapButtonHeader:h=v.headerWidth+d.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-d.gapButtonHeader+d.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-d.gapButtonHeader+d.gapButton-v.openWidth);var b={x:v.lx+h+o.pad.l,y:v.ly+g+o.pad.t,yPad:d.gapButton,xPad:d.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(v.openWidth,v.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(v.openHeight,v.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(d.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+d.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+d.headerGroupClassName).data(r,p);s.enter().append("g").classed(d.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",d.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=g+v;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,O=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+m,R=g;I+O>s&&(I=s-O);var z=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),C?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:R,width:O,height:P}),this._vbarYMin=R+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=u-.5,E=C?d+O+.5:d+.5,j=f-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+N).data(M||C?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",N).append("rect"),M||C?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,N,this.gd),this.bg.attr({x:h,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||C){var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),C&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":232,"../color":102,"../drawing":124,"@plotly/d3":11}],207:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],208:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],209:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],210:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],211:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],212:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],213:[function(e,t,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}},{}],214:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],216:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],217:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function d(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,d,f,p,h,m=s([r,n]);function g(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,d=o,f=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return d(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return d(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return d(e,t,r,n,a,i,1)}}},{"./mod":239}],218:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(d(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),v=e.charAt(0);!c||"G"!==v&&"g"!==v||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var C;M=Number(M);try{var O=g.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),C=O.newDate(M,O.toMonthIndex(M,k,P),A)}else C=O.newDate(M,Number(k),A)}catch(e){return u}return C?(C.toJD()-m)*d+L*f+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*d,M=3*f,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/d)+m,S=Math.floor(s(e,d));try{i=g.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=v("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+d&&e<=a-d))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function C(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=g.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var O=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,d),n=w(Math.floor(r/f),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),O[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+C(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return C(t,e,n,a)};var P=3*d;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,d);if(e=Math.round(e-n),r)try{var a=Math.round(e/d)+m,i=g.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*d+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&g.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+d*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,d=n-t,f=o-a,p=c-i,h=u*u+d*d,m=f*f+p*p,g=Math.min(s(u,d,h,a-e,i-t),s(u,d,h,o-e,c-t),s(f,p,m,e-a,t-i),s(f,p,m,r-a,n-i));return Math.sqrt(g)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),d=e.getPointAtLength(o(r,t)),f={x:(4*d.x+s.x+c.x)/6,y:(4*d.y+s.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),d=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,d=r.ys?r.y-s:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+r)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+r))return;p=f(d)}return{min:c,max:d,len:d-c,total:u,isClosed:0===c&&d===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++}return i}},{"./mod":239}],230:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],231:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],232:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,d=t.exports={};d.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var f={};d.warnBadFormat=function(e){var t=String(e);f[t]||(f[t]=1,d.warn('encountered bad format: "'+t+'"'))},d.noFormat=function(e){return String(e)},d.numberFormat=function(e){var t;try{t=i(d.adjustFormat(e))}catch(t){return d.warnBadFormat(e),d.noFormat}return t},d.nestedProperty=e("./nested_property"),d.keyedContainer=e("./keyed_container"),d.relativeAttr=e("./relative_attr"),d.isPlainObject=e("./is_plain_object"),d.toLogRange=e("./to_log_range"),d.relinkPrivateKeys=e("./relink_private");var p=e("./array");d.isTypedArray=p.isTypedArray,d.isArrayOrTypedArray=p.isArrayOrTypedArray,d.isArray1D=p.isArray1D,d.ensureArray=p.ensureArray,d.concat=p.concat,d.maxRowLength=p.maxRowLength,d.minRowLength=p.minRowLength;var h=e("./mod");d.mod=h.mod,d.modHalf=h.modHalf;var m=e("./coerce");d.valObjectMeta=m.valObjectMeta,d.coerce=m.coerce,d.coerce2=m.coerce2,d.coerceFont=m.coerceFont,d.coercePattern=m.coercePattern,d.coerceHoverinfo=m.coerceHoverinfo,d.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,d.validate=m.validate;var g=e("./dates");d.dateTime2ms=g.dateTime2ms,d.isDateTime=g.isDateTime,d.ms2DateTime=g.ms2DateTime,d.ms2DateTimeLocal=g.ms2DateTimeLocal,d.cleanDate=g.cleanDate,d.isJSDate=g.isJSDate,d.formatDate=g.formatDate,d.incrementMonth=g.incrementMonth,d.dateTick0=g.dateTick0,d.dfltRange=g.dfltRange,d.findExactDates=g.findExactDates,d.MIN_MS=g.MIN_MS,d.MAX_MS=g.MAX_MS;var v=e("./search");d.findBin=v.findBin,d.sorterAsc=v.sorterAsc,d.sorterDes=v.sorterDes,d.distinctVals=v.distinctVals,d.roundUp=v.roundUp,d.sort=v.sort,d.findIndexOfMin=v.findIndexOfMin,d.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");d.aggNums=y.aggNums,d.len=y.len,d.mean=y.mean,d.median=y.median,d.midRange=y.midRange,d.variance=y.variance,d.stdev=y.stdev,d.interp=y.interp;var x=e("./matrix");d.init2dArray=x.init2dArray,d.transposeRagged=x.transposeRagged,d.dot=x.dot,d.translationMatrix=x.translationMatrix,d.rotationMatrix=x.rotationMatrix,d.rotationXYMatrix=x.rotationXYMatrix,d.apply3DTransform=x.apply3DTransform,d.apply2DTransform=x.apply2DTransform,d.apply2DTransform2=x.apply2DTransform2,d.convertCssMatrix=x.convertCssMatrix,d.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");d.deg2rad=b.deg2rad,d.rad2deg=b.rad2deg,d.angleDelta=b.angleDelta,d.angleDist=b.angleDist,d.isFullCircle=b.isFullCircle,d.isAngleInsideSector=b.isAngleInsideSector,d.isPtInsideSector=b.isPtInsideSector,d.pathArc=b.pathArc,d.pathSector=b.pathSector,d.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");d.isLeftAnchor=_.isLeftAnchor,d.isCenterAnchor=_.isCenterAnchor,d.isRightAnchor=_.isRightAnchor,d.isTopAnchor=_.isTopAnchor,d.isMiddleAnchor=_.isMiddleAnchor,d.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");d.segmentsIntersect=w.segmentsIntersect,d.segmentDistance=w.segmentDistance,d.getTextLocation=w.getTextLocation,d.clearLocationCache=w.clearLocationCache,d.getVisibleSegment=w.getVisibleSegment,d.findPointOnPath=w.findPointOnPath;var T=e("./extend");d.extendFlat=T.extendFlat,d.extendDeep=T.extendDeep,d.extendDeepAll=T.extendDeepAll,d.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");d.log=M.log,d.warn=M.warn,d.error=M.error;var k=e("./regex");d.counterRegex=k.counter;var A=e("./throttle");d.throttle=A.throttle,d.throttleDone=A.done,d.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},d.noop=e("./noop"),d.identity=e("./identity"),d.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},d.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},d.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(d.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},d.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},d.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},d.syncOrAsync=function(e,t,r){var n;function a(){return d.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},d.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},d.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},d.fillArray=function(e,t,r,n){if(n=n||d.identity,d.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},d.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;d.templateString=function(e,t){var r={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||d.nestedProperty(t,n).get,a=r[n]()),d.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};d.hovertemplateString=function(){return E.apply(z,arguments)};var N={max:10,count:0,name:"texttemplate"};d.texttemplateString=function(){return E.apply(N,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,f,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,g="xother"===l||"yother"===l||p||m||h,v=l;if((p||h)&&(v=v.substring(1)),(m||h)&&(v=v.substring(0,v.length-1)),g){if(void 0===(c=t[v]))return""}else for(f=3;f=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;d.seedPseudoRandom=function(){j=2e9},d.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?d.pseudoRandom():j/4294967296},d.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=d.extractOption(e,t,"htx","hovertext");if(d.isValidTextValue(a))return n(a);var i=d.extractOption(e,t,"tx","text");return d.isValidTextValue(i)?n(i):void 0},d.isValidTextValue=function(e){return e||0===e},d.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,d.strTranslate(a-c*(r+o),i-c*(n+l))+d.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},d.ensureUniformFontSize=function(e,t){var r=d.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},d.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},d.bigFont=function(e){return Math.round(1.2*e)};var H=d.getFirefoxVersion(),B=null!==H&&H<86;d.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":212,"./anchor_utils":216,"./angles":217,"./array":218,"./clean_number":219,"./clear_responsive":221,"./coerce":222,"./dates":223,"./dom":224,"./extend":226,"./filter_unique":227,"./filter_visible":228,"./geometry2d":229,"./identity":230,"./increment":231,"./is_plain_object":233,"./keyed_container":234,"./localize":235,"./loggers":236,"./make_trace_groups":237,"./matrix":238,"./mod":239,"./nested_property":240,"./noop":241,"./notifier":242,"./preserve_drawing_buffer":245,"./push_unique":246,"./regex":248,"./relative_attr":249,"./relink_private":250,"./search":251,"./sort_object_keys":253,"./stats":254,"./throttle":256,"./to_log_range":257,"@plotly/d3":11,"d3-format":13,"d3-time-format":14,"fast-isnumeric":17}],233:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],234:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],f.set(e,null);if(d){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":266,"./notifier":242}],237:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],238:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],240:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,d,f,p,h,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(d,g)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":212,"./matrix":238}],245:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":17,"is-mobile":51}],246:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,d=0,f=t.length,p=0,h=f>1?(t[f-1]-t[0])/(f-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);d90&&a.log("Long binary search..."),d-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],d=u-a;void 0===a?(s.push(u),a=u):d>l&&(i=Math.min(i,d),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":218,"fast-isnumeric":17}],255:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),C=n.select(e.node().parentNode);if(!C.empty()){var O=e.attr("class")?e.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(d,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var c=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:O,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",d=l.select("g");d.attr({fill:u,stroke:u});var f=s(d,"width"),p=s(d,"height"),h=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],g=-(r||s(e,"height"))/4;"y"===O[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-f/2,g-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===O[0]?l.attr({x:e.attr("x"),y:g-p/2}):"a"===O[0]&&0!==O.indexOf("atitle")?l.attr({x:0,y:g}):l.attr({x:h,y:+e.attr("y")+g-p/2}),m&&m.call(e,c),t(c)}))}))):P(),e}function P(){C.empty()||(O=e.attr("class")+"-math",C.select("svg."+O).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(g," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(v),C=0;C|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function C(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(g," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],257:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":17}],258:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],259:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],260:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,d=(l.subplotsRegistry.ternary||{}).attrRegex,f=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",d);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",d,y),!0;t.set(y)}return!m&&(f(g,v),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],C=u(v,d).get(),O=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",d,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,_),c(M)?O.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),C&&C.splice(_,0,{})):i.warn("Unrecognized full object edit value",d,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(O[x],1),C&&C.splice(O[x],1);if(D.length?S||t.set(D):t.set(null),m)return!1;if(f(g,v),h!==a){var R;if(-1===P)R=L;else{for(I=Math.max(D.length,I),R=[],x=0;x=P);x++)R.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),O(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in O(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,d,f=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=C(r,e.data.length-1),t)for(var m=0;m-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[f.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||f.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(f.rehover,f.redrag),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,f=F(s._preGUI,c),h=Object.keys(t),m=p.list(e),g=o.extendDeepAll({},t),v={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),Z=I.get();if(void 0!==R){A[P]=R,L[P]="reverse"===E?R:N(Z);var X=d.getLayoutValObject(s,I.parts);if(X&&X.impliedEdits&&null!==R)for(var J in X.impliedEdits)S(o.relativeAttr(P,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(R){S("autosize",null);var Q="height"===P?"width":"height";S(Q,s[Q])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(U))O(j),l(s,B+"._inputRange").set(null);else if(j.match(q)){O(j),l(s,B+"._inputRange").set(null);var K=l(s,B).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else j.match(G)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===R,ee="log"===V.type&&"linear"===R;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,R,S),u.getComponentMethod("images","convertCoords")(e,V,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=X||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[P]=null:b.isRemoveVal(R)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),v[r]||(v[r]={});var se=v[r][n];se||(se=v[r][n]={}),se[oe]=R,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===R||"select"===R)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:X?T.update(k,X):k.calc=!0,I.set(R))}}for(r in v){b.applyContainerArrayChanges(e,f(i,r),v[r],k,f)||(k.plot=!0)}for(var ce in C){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var de in k.calc=!0,ue)C[de]||(p.getFromId(e,de)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:C,undoit:L,redoit:A,eventData:g}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&f.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function X(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),d=u.flags;(s.calc||d.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];d.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),Y(e,d,u)||f.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||d.colorbars)&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.axrange&&V(p,u.rangesAltered),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag),c.add(e,X,[e,l.undoit,u.undoit,l.traces],X,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function d(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,f.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&d()};t()}var h,m,g=0;function v(e){return Array.isArray(a)?g>=a.length?e.transitionOpts=a[g]:e.transitionOpts=a[0]:e.transitionOpts=a,g++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:v(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);y=k}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,g=(u[m]||h[m]||{}).name,v=t[n].name,y=u[g]||h[g];g&&v&&"number"==typeof v&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[g]||h[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[m]={name:m},p.push({frame:f.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=f.modifyFrames,u=f.modifyFrames,d=[e,l],p=[e,i];return c&&c.add(e,s,d,u,p),f.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,d=e,f=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in d(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var d=u.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return v(a,t,l)},r.getLayoutValObject=function(e,t){return v(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:d,applyUpdate:function(t,r){t&&u(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":232,"../plots/attributes":275}],269:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),d=e("../components/modebar"),f=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,g=h.clean,v=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,g=e._fullLayout,v=g._size,x=v.p,_=f.list(e,"",!0);if(g._paperdiv.style({width:e._context.responsive&&g.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":g.width+"px",height:e._context.responsive&&g.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),e._context.setBackground(e,g.paper_bgcolor),r.drawMainTitle(e),d.manage(e),!g._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:v.t+v.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:v.l+v.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(a in g._plots)if((l=g._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,C=l.yaxis.domain,O=l.plotgroup;if(y(D,C,L)){var P=O.node(),I=l.bg=o.ensureSingle(O,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else O.select("rect.bg").remove(),L.push([D,C]),S||(k.push(a),A.push(a))}var R,z,N,F,E,j,H,B,Y,V,U,q,G,Z=g._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){g._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&g(i)&&e(i,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":232,"../plots/attributes":275,"../plots/plots":314,"./plot_config":266,"./plot_schema":267,"./plot_template":268}],271:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,d={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,f,p,h;function m(e){return!(e in t)||o.validate(t[e],d[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],f=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),f=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(d.format.values,", "," or ")+".");var g={};function v(e,r){return o.coerce(t,g,d,e,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},f);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,y,_),n=M._fullLayout.width,d=M._fullLayout.height;function f(){a.purge(M),document.body.removeChild(M)}if("full-json"===y){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),e(T?p:l.encodeJSON(p))}if(f(),"svg"===y)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:d,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":232,"../plots/plots":314,"../snapshot/helpers":320,"../snapshot/svgtoimg":322,"../snapshot/tosvg":324,"../version":389,"./plot_api":265,"fast-isnumeric":17}],272:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var d=Object.keys(e),f=0;fx.length&&a.push(h("unused",i,v.concat(x.length)));var k,A,L,S,D,C=x.length,O=Array.isArray(M);if(O&&(C=Math.min(C,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,v.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(O?Math.min(P,M[A].length):P);k++)L=O?M[A][k]:M,S=y[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,v.concat(A,k),S,D)):a.push(h("value",i,v.concat(A,k),S))}else a.push(h("array",i,v.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var g=m._fullData,v=r.length,y=0;y0&&Math.round(d)===d))return{vals:a};c=d}for(var f=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],g=i(m,f)||0,v=[],y=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);T=o(M,-c,f)}else{for(M=g+(w=Math.round((k-g)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}v[_]=p?T:h?M:(T+M)/2,y[_]=T,x[_]=M}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":212,"../../lib":232,"fast-isnumeric":17}],277:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],278:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,d=c.isLinked;function f(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,d=c.max;if(0===u.length||0===d.length)return i.simpleMap(t.range,t.r2l);var f=u[0].val,g=d[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>C&&(_=x,w=b,C=M/T):M/S>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=M/S));if(f===g){var O=f-1,P=f+1;if(A)if(0===f)a=[0,1];else{var I=(f>0?d:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=f/(1-Math.min(.5,I/S));a=f>0?[0,R]:[R,0]}else a=L?[Math.max(0,O),Math.max(1,P)]:[O,P]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-C*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-C*l(_),w.val+C*s(w)];return v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=i),i>p&&i-o&&(f=i),i>p&&i=P;n--)O(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],d=[];function f(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":124,"../../constants/numerical":212,"../../lib":232,"../../registry":316,"./axis_ids":283,"@plotly/d3":11,"fast-isnumeric":17}],279:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),d=e("../../components/color"),f=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,y=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,D=m.ONEMIN,C=m.ONESEC,O=m.MINUS_SIGN,P=m.BADNUM,I={K:"zeroline"},R={K:"gridline",L:"path"},z={K:"tick",L:"path"},N={K:"tick",L:"text"},F=e("../../constants/alignment"),E=F.MID_SHIFT,j=F.CAP_SHIFT,H=F.LINE_SPACING,B=F.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=e("./set_convert");var V=e("./axis_autotype"),U=e("./axis_ids"),q=U.idSort,G=U.isLinked;Y.id2name=U.id2name,Y.name2id=U.name2id,Y.cleanId=U.cleanId,Y.list=U.list,Y.listIds=U.listIds,Y.getFromId=U.getFromId,Y.getFromTrace=U.getFromTrace;var Z=e("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function W(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}Y.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},Y.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},Y.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==Y.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=Y.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},Y.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:Y.getFromId(t,r).cleanPos)(e)},Y.redrawComponents=function(e,t){t=t||Y.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=Y.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,v,c,i)),g=y,0;g<=u;)g=Y.tickIncrement(g,v,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(g,0,i),size:v,_dataSpan:u-c}},Y.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=Y.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dticki&&d=o:p<=o;p=Y.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(D.length>m||p===C)break;C=p;var O=!1;d&&p!==(0|p)&&(O=!0),D.push({minor:O,value:p})}if(f&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),d=r||u,f=0;d>=y?f=u>=y&&u<=g?u:v:r===b&&d>=_?f=u>=_&&u<=x?u:b:d>=M?f=u>=M&&u<=w?u:T:r===k&&d>=k?f=k:d>=A?f=A:r===L&&d>=L?f=L:r===S&&d>=S&&(f=S),f>=u&&(f=u,l=!0);var p=a+f;if(t.rangebreaks&&f>0){for(var h=0,m=0;m<84;m++){var D=(m+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(f*=h/84)||(e[n].drop=!0),l&&u>k&&(f=u)}(f>0||0===n)&&(e[n].periodX=a+f/2)}}(D,e,e._definedDelta),e.rangebreaks){var I="y"===e._id.charAt(0),R=1;"auto"===e.tickmode&&(R=e.tickfont?e.tickfont.size:12);var z=NaN;for(h=D.length-1;h>-1;h--)if(D[h].drop)D.splice(h,1);else{D[h].value=Ae(D[h].value,e);var N=e.c2p(D[h].value);(I?z>N-R:zu||Eu&&(F.periodX=u),E10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=C&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!de(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}Y.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>v)t/=v,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>T)t/=T,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=Y.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=oe(t,S,ee):i>D?e.dtick=oe(t,D,te):i>C?e.dtick=oe(t,C,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},Y.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,d=e+.01*o,f=l.roundUp(l.mod(d,1),u,r);return Math.floor(d)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=fe(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),p=e.exponentformat;"power"===p||ue(p)&&de(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":O)+f+"",t.fontSize*=1.25):("e"===p||"E"===p)&&f>2?t.text="1"+p+(d>0?"+":O)+f:(t.text=fe(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=fe(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=fe(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=O+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=fe(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var g=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[g(o.x-.5),g(o.x+e.dtick-.5)]}return o},Y.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return Y.hoverLabelText(e,n,r)+" - "+Y.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=Y.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":O+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function de(e){return e>14||e<-15}function fe(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=Y.getTickFormat(t),d=t.separatethousands;if(n){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,O);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?O+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-d:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?d-r.top:0,f),p.reverse()),r.width>0){var g=r.right-(t._offset+t._length);g>0&&(n.xr=1,n.r=g);var v=t._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?d-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-d:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ge(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=f),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Q&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,xe(t),n),i.autoMargin(e,be(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||Q&&"bottom"===t.side||X.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ge(t);else{var l=Le(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,d,p,h,m=Y.getPxPosition(e,t);"x"===i?(d=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,d="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var g=t._selections[t._id+"tick"];if(h={selection:g,side:t.side},g&&g.node()&&g.node().parentNode){var v=f.getTranslate(g.node().parentNode);h.offsetLeft=v.x,h.offsetTop=v.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:d,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(X)}}function K(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ye(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},Y.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=f*j,d+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,d+=3);l&&"top"===c&&(d-=f*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(d=-d);return[s?u:0,l?d:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},Y.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,d=i("inside"),f="inside"===n&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=f?e.ticklen:0;if(d?m*=-1:u&&(m=0),f&&(p+=m,r)){var g=l.deg2rad(r);p=m*Math.cos(g)+1,h=m*Math.sin(g)}e.showticklabels&&(f||e.showline)&&(p+=.2*e.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(d?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===M||d&&"top"===M)?1:-1,d&&(b*=-1),v=h*b,y=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(d?x+=E:x=-90===A&&"bottom"===M?j:90===A&&"top"===M?E:.5,T=E/2*(A/90)),w.xFn=function(e){return e.dx+v+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==d?-n:0};else if("y"===k){if(b=(_=!d&&"left"===M||d&&"right"===M)?1:-1,d&&(b*=-1),v=p,y=h*b,x=0,d||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?j:.5),d){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*j*b,x=0}}w.xFn=function(e){return e.dx+t-(v+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*E},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Y.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(d.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Se(t,[z]),i.attr("transform",r.transFn)},Y.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&Y.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(v,g+1?g:m);var b=null;t._selections&&(t._selections[d]=v);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===g?(b=90,_.push((function(){x(v,g)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(v.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ye(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",d=function(e){return-1!==c.indexOf(e)},h=d("top"),g=d("left"),y=d("right"),_=d("bottom")||g||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var g="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=d(r),a=0,o=0,l={},u=0;u2*a}(a,g)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var d=a("pattern",u);if(d===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(d)for(s=0;s<2;s++)switch(c=o[s],d){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":316,"./constants":286}],284:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function g(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FO&&(O=F);f/=(O-C)/(2*P),C=s.l2r(C),O=s.l2r(O),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,O)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,d={},f={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ve||Ue(),ge)o.indexOf("select")>-1&&L(r,a,J,Q,t.id,Oe),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ve){var l=m?I:P,c="s"===m||"w"===v?0:1,d=l._name+".range["+c+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",g="middle";if(l.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===v&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:g}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>O||o>O?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",q(Te))):l();else if(ne.isSubplotConstrained)if(i>O||o>O){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",q(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":232,"fast-isnumeric":17}],298:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":207}],299:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,d=c.rectMode,f=c.drawMode,p=c.openMode,h=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),g=e("../../components/shapes/draw_newshape/helpers").handleEllipse,v=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),k=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,D=e("./helpers"),C=D.p2r,O=D.axValue,P=D.getTransform;function I(e,t,r,n,a,i,o){var l,s,c,u,d,f,h,g,v,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(f=H(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),f(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=v(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function B(e,t,r){var n,i,o,l;for(n=0;n=0)D._fullLayout._deactivateShape(D);else if(!_){var r=R.clickmode;b.done(me).then((function(){if(b.clear(me),2===e){for(de.remove(),$=0;$-1&&I(t,D,a.xaxes,a.yaxes,a.subplot,a,de),"event"===r&&D.emit("plotly_selected",void 0);l.click(D,t)})).catch(y.error)}},a.doneFn=function(){he.remove(),b.done(me).then((function(){b.clear(me),a.gd.emit("plotly_selected",te),K&&a.selectionDefs&&(K.subtract=ue,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(ge)})).catch(y.error),_&&E(a)}},clearSelect:S,clearSelectionsCache:E,selectOnClick:I}},{"../../components/color":102,"../../components/dragelement/helpers":120,"../../components/drawing":124,"../../components/fx":142,"../../components/fx/helpers":138,"../../components/shapes/draw_newshape/display_outlines":190,"../../components/shapes/draw_newshape/helpers":191,"../../components/shapes/draw_newshape/newshapes":192,"../../lib":232,"../../lib/clear_gl_canvases":220,"../../lib/polygon":244,"../../lib/throttle":256,"../../plot_api/subroutines":269,"../../registry":316,"./axis_ids":283,"./constants":286,"./handle_outline":290,"./helpers":291,polybooljs:57}],300:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*g*Math.abs(n-a))}return m}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function C(t,r,n){return c(t,r,n||e.calendar)}function O(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function N(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?N(t,e._m,e._b):m},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?N(t,e._m2,d):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:d,e.l2c="log"===e.type?A:d,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=C,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return C(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=O,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return O(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=O,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=d,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return O(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var d=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===p;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(f=!f),f&&e._rangebreaks.reverse();var h=f?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function g(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),g=h[1]-h[0],v=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*v/g),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=d?c/p[2]:1,T=f?u/p[3]:1,M=d?p[0]:0,k=f?p[1]:0,A=d?p[0]/p[2]*c:0,L=f?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":124,"../../lib":232,"../../registry":316,"./axes":279,"@plotly/d3":11}],305:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",d=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(f,s,d,n),b.cleanPlot(f,s,d,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),a=Math.round(d*a)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(d),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(d){var g=(r.t+r.b)/d;g>1&&(r.t/=g,r.b/=g)}var v=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;f[t]={l:{val:v,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:x,size:r.t+h}},p[t]=1}else delete f[t],delete p[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),C(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,d=i.r,f=i.t,h=i.b,m=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in m)g[v]||delete m[v];for(var y in m.base={l:{val:0,size:c},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:h}},m){var x=m[y].l||{},_=m[y].b||{},w=x.val,T=x.size,M=_.val,k=_.size;for(var A in m){if(o(T)&&m[A].r){var L=m[A].r.val,S=m[A].r.size;if(L>w){var D=(T*L+(S-r)*w)/(L-w),O=(S*(1-w)+(T-r)*(1-L))/(L-w);D+O>c+d&&(c=D,d=O)}}if(o(k)&&m[A].t){var P=m[A].t.val,I=m[A].t.size;if(P>M){var R=(k*P+(I-n)*M)/(P-M),z=(I*(1-M)+(k-n)*(1-P))/(P-M);R+z>h+f&&(h=R,f=z)}}}}}var N=u.constrain(r-i.l-i.r,2,64),F=u.constrain(n-i.t-i.b,2,64),E=Math.max(0,r-N),j=Math.max(0,n-F);if(E){var H=(c+d)/E;H>1&&(c/=H,d/=H)}if(j){var B=(h+f)/j;B>1&&(h/=B,f/=B)}if(a.l=Math.round(c),a.r=Math.round(d),a.t=Math.round(f),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var d={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(d.layout=c(l),a)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return s&&(d.frames=c(s)),i&&(d.config=c(e._context,!0)),"object"===n?d:JSON.stringify(d)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,d),a=0;a0){for(var n=[],a=0;a-1&&(d[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":102,"../components/drawing":124,"../constants/xmlns_namespaces":213,"../lib":232,"@plotly/d3":11}],325:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rd+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[d+"a"],N=e[f+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(g,F,e),!1!==e.index&&g[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-y.bargroupwidth/2)},C=function(e){return Math.max(A(e),e.p+y.bargroupwidth/2)});var E=g[e.index],j=v.base?E.b+E.s:E.s;e[f+"0"]=e[f+"1"]=N.c2p(E[f],!0),e[f+"LabelVal"]=j;var H=y.extents[y.extents.round(E.p)];e[d+"0"]=z.c2p(x?D(E):H[0],!0),e[d+"1"]=z.c2p(x?C(E):H[1],!0);var B=void 0!==E.orig_p;return e[d+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[d+"LabelVal"],v[d+"hoverformat"]),e.valueLabel=s(N,e[f+"LabelVal"],v[f+"hoverformat"]),e.baseLabel=s(N,E.b,v[f+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return O(k(e),A(e),w)}(E))/2,e[d+"Spike"]=z.c2p(E.p,!0),o(E,v,e),e.hovertemplate=v.hovertemplate,e}}function d(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=d(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:d}},{"../../components/color":102,"../../components/fx":142,"../../constants/numerical":212,"../../lib":232,"../../plots/cartesian/axes":279,"../../registry":316,"./helpers":332}],334:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":293,"../scatter/marker_colorbar":374,"./arrays_to_calcdata":325,"./attributes":326,"./calc":327,"./cross_trace_calc":329,"./defaults":330,"./event_data":331,"./hover":333,"./layout_attributes":335,"./layout_defaults":336,"./plot":337,"./select":338,"./style":340}],335:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],336:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,d={},f=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,d="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,h=a.width,m=a.height,g=Math.abs(t-e),v=Math.abs(n-r),y=g>2*_&&v>2*_?_:0;g-=2*y,v-=2*y;var x=L(s);"auto"!==s||h<=g&&m<=v||!(h>g||m>v)||(h>v||m>g)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=q(E,j,z),j=q(j,E,z),H=q(H,B,!z),B=q(B,H,!z)}var G=k(i.ensureSingle(P,"path"),O,g,v);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!O.uniformtext.mode&&N){var Z=s.makePointStyleFns(d);s.singlePointStyle(c,G,d,Z,e)}!function(e,t,r,n,a,l,c,d,p,g,v){var w,T=t.xaxis,A=t.yaxis,C=e._fullLayout;function O(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,d,f,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,d="x",f=n):(s="x",c=n,d="y",f=a);function m(e){return u(f,f.c2l(e),!0).text}var g=t[r],v={};v.label=g.p,v.labelLabel=v[s+"Label"]=(y=g.p,u(c,c.c2l(y),!0).text);var y;var x=i.castOption(o,g.i,"text");(0===x||x)&&(v.text=x);v.value=g.s,v.valueLabel=v[d+"Label"]=m(g.s);var _={};b(_,o,g.i),p&&(v.delta=+g.rawS||g.s,v.deltaLabel=m(v.delta),v.final=g.v,v.finalLabel=m(v.final),v.initial=v.final-v.delta,v.initialLabel=m(v.initial));h&&(v.value=g.s,v.valueLabel=m(v.value),v.percentInitial=g.begR,v.percentInitialLabel=i.formatPercent(g.begR),v.percentPrevious=g.difR,v.percentPreviousLabel=i.formatPercent(g.difR),v.percentTotal=g.sumR,v.percenTotalLabel=i.formatPercent(g.sumR));var w=i.castOption(o,g.i,"customdata");w&&(v.customdata=w);return i.texttemplateString(l,v,e._d3locale,_,v,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var d,f=a.textinfo,p=e[t],h=f.split("+"),m=[],g=function(e){return-1!==h.indexOf(e)};g("label")&&m.push((v=e[t].p,u(o?n:r,v,!0).text));var v;g("text")&&(0===(d=i.castOption(a,p.i,"text"))||d)&&m.push(d);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(c(b)),g("delta")&&m.push(c(y)),g("final")&&m.push(c(x))}if(s){g("value")&&m.push(c(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(d=i.formatPercent(p.begR),w&&(d+=" of initial"),m.push(d)),g("percent previous")&&(d=i.formatPercent(p.difR),w&&(d+=" of previous"),m.push(d)),g("percent total")&&(d=i.formatPercent(p.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(y,o)}(C,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(P,a);var z="stack"===g.mode||"relative"===g.mode,N=n[a],F=!z||N._outmost;if(!R||"none"===w||(N.isBlank||l===c||d===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=C.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=q*(X/G):X>=G*(W/q);q>0&&G>0&&(J||Q||K)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Z=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=O(r,R,Z)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),q=U.width,G=U.height,V.attr("transform",$),q<=0||G<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,d=a.height,f=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:f>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/d):Math.min(1,f/u));var m=L(c),g=S(a,m),v=(l?g.x:g.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*v):(w=n+A*o,k=-A*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Z.size,f(P.type,ee,C),N.transform=ee,k(V,C,g,v).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,E,j,H,B,g,v),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,C,d.xcalendar,d.ycalendar)}));var H=!1===d.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,g)},toMoveInsideBar:D}},{"../../components/color":102,"../../components/drawing":124,"../../components/fx/helpers":138,"../../lib":232,"../../lib/svg_text_utils":255,"../../plots/cartesian/axes":279,"../../registry":316,"./attributes":326,"./constants":328,"./helpers":332,"./style":340,"./uniform_text":342,"@plotly/d3":11,"fast-isnumeric":17}],338:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,g(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":102,"../../components/drawing":124,"../../lib":232,"../../registry":316,"./attributes":326,"./helpers":332,"./uniform_text":342,"@plotly/d3":11}],341:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":102,"../../components/colorscale/defaults":112,"../../components/colorscale/helpers":113,"../../lib":232}],342:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),d=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),d){t._length=d,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),h=c("texttemplate");if(h||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||f&&"none"!==f){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var g=c("hole");if(c("title.text")){var v=c("title.position",g?"middle center":"top center");g||"middle center"!==v||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":232,"../../plots/domain":307,"../bar/defaults":330,"./attributes":343,"fast-isnumeric":17}],347:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":138}],348:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,e.pts)||e.color,borderColor:g.castOption(_.bordercolor,e.pts),fontFamily:g.castOption(w.family,e.pts),fontSize:g.castOption(w.size,e.pts),fontColor:g.castOption(w.color,e.pts),nameLength:g.castOption(_.namelength,e.pts),textAlign:g.castOption(_.align,e.pts),hovertemplate:g.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[v(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[v(e,d)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[v(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[v(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=g.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=g.castOption(e._input.textfont.color,t.pts));var a=g.castOption(e.insidetextfont.family,t.pts)||g.castOption(e.textfont.family,t.pts)||r.family,i=g.castOption(e.insidetextfont.size,t.pts)||g.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;g-=2)v(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)v(Math.PI*(g+1),"tan")}if(d||p){for(g=4;g>=-4;g-=2)v(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)v(Math.PI*(g+.5),"rad")}}if(l||h||d){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||f)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function C(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=d/e.titleBox.width,n=O(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function O(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:g.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:g.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=g.getFirstFilled(a.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function N(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),I(t,i);var f=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var f=n.select(this),h=t[0],m=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=g.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),f.attr("stroke-linejoin","round"),f.each((function(){var v=n.select(this).selectAll("g.slice").data(t);v.enter().append("g").classed("slice",!0),v.exit().remove();var y=[[[],[]],[[],[]]],_=!1;v.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,y[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),f=u.selectAll("path.surface").data([a]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),m.pull){var v=+g.castOption(m.pull,a.pts)||0;v>0&&(o+=v*a.pxmid[0],c+=v*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===h.vTotal){var M="M"+(o+a.px0[0])+","+(c+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";T?f.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+C(a.px0,a.pxmid,!1,T)+C(a.pxmid,a.px0,!1,T)+"Z"+M):f.attr("d",M)}else{var k=C(a.px0,a.px1,!0,1);if(T){var A=1-T;f.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+C(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+k+"Z")}else f.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+k+"Z")}z(e,a,h);var L=g.castOption(m.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=g.castOption(e.outsidetextfont.color,t.pts)||g.castOption(e.textfont.color,t.pts)||r.color,a=g.castOption(e.outsidetextfont.family,t.pts)||g.castOption(e.textfont.family,t.pts)||r.family,i=g.castOption(e.outsidetextfont.size,t.pts)||g.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):b(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var v,y=l.bBox(u.node());if("outside"===L)v=D(y,a);else if(v=w(y,a,h),"auto"===L&&v.scale<1){var x=s.ensureUniformFontSize(e,m.outsidetextfont);u.call(l.font,x),v=D(y=l.bBox(u.node()),a)}var T=v.textPosAngle,M=void 0===T?a.pxmid:R(h.r,T);if(v.targetX=o+M[0]*v.rCenter+(v.x||0),v.targetY=c+M[1]*v.rCenter+(v.y||0),N(v,y),v.outside){var k=v.targetY;a.yLabelMin=k-y.height/2,a.yLabelMid=k,a.yLabelMax=k+y.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}v.fontSize=f.size,p(m.type,v,r),t[i].transform=v,u.attr("transform",s.getTextTransform(v))}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=s.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,m.title.font).call(d.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):C(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,d,f,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(g.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(m+e.labelExtraY-v)*s>0&&(a=3*l*Math.abs(c-d.indexOf(e)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:v,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],d=u.concat(c),p=[],f=0;fMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(d-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(v,m),_&&m.automargin){var M=l.bBox(f.node()),k=m.domain,A=i.w*(k.x[1]-k.x[0]),L=i.h*(k.y[1]-k.y[0]),S=(.5*A-h.r)/i.w,O=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-O,yt:k.y[1]+O,l:Math.max(h.cx-h.r-M.left,0),r:Math.max(M.right-(h.cx+h.r),0),b:Math.max(M.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-M.top,0),pad:5})}}))}));setTimeout((function(){f.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:N}},{"../../components/color":102,"../../components/drawing":124,"../../components/fx":142,"../../lib":232,"../../lib/svg_text_utils":255,"../../plots/plots":314,"../bar/constants":328,"../bar/uniform_text":342,"./event_data":347,"./helpers":348,"@plotly/d3":11}],353:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":342,"./style_one":354,"@plotly/d3":11}],354:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":102,"./helpers":348}],355:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&C[v].gap;)v--;for(x=C[v].s,m=C.length-1;m>v;m--)C[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],363:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),d=e("./marker_defaults"),f=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var y=s(e,t,g,v);if(y||(t.visible=!1),t.visible){c(e,t,g,v),v("xhoverformat"),v("yhoverformat");var x=u(e,t,g,v),b=!x&&y=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(f.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=R[P][1])>=Z&&(N=R[P-1][0],F=R[P][0],j-E&&(z=N+(F-N)*(Z-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var W=l.defaultLine;return l.opacity(d.fillcolor)?W=d.fillcolor:l.opacity((d.line||{}).color)&&(W=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,d.text&&!Array.isArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}},{"../../components/color":102,"../../components/fx":142,"../../lib":232,"../../registry":316,"./get_trace_color":366}],368:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":293,"./arrays_to_calcdata":355,"./attributes":356,"./calc":357,"./cross_trace_calc":361,"./cross_trace_defaults":362,"./defaults":363,"./format_labels":365,"./hover":367,"./marker_colorbar":374,"./plot":377,"./select":378,"./style":380,"./subtypes":381}],369:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":112,"../../components/colorscale/helpers":113,"../../lib":232}],370:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,d=e("./constants");t.exports=function(e,t){var r,n,i,f,p,h,m,g,v,y,x,b,_,w,T,M,k,A,L=t.xaxis,S=t.yaxis,D="log"===L.type,C="log"===S.type,O=L._length,P=S._length,I=t.connectGaps,R=t.baseTolerance,z=t.shape,N="linear"===z,F=t.fill&&"none"!==t.fill,E=[],j=d.minTolerance,H=e.length,B=new Array(H),Y=0;function V(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(D&&(i=L.c2p(n.x,!0)),i===a)return!1;C&&s===a&&(i*=Math.abs(L._m*P*(L._m>0?o:l)/(S._m*O*(S._m>0?o:l)))),i*=1e3}if(s===a){if(C&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===B[Y-1][0],a=r===B[Y-1][1];if(!n||!a)if(Y>1){var i=t===B[Y-2][0],o=r===B[Y-2][1];n&&(t===te||t===re)&&i?o?Y--:B[Y-1]=e:a&&(r===ne||r===ae)&&o?i?Y--:B[Y-1]=e:B[Y++]=e}else B[Y++]=e}function ue(e){B[Y-1][0]!==e[0]&&B[Y-1][1]!==e[1]&&ce([X,J]),ce(e),Q=null,X=J=0}function de(e){if(k=e[0]/O,A=e[1]/P,Z=e[0]re?re:0,W=e[1]ae?ae:0,Z||W){if(Y)if(Q){var t=$(Q,e);t.length>1&&(ue(t[0]),B[Y++]=t[1])}else K=$(B[Y-1],e)[0],B[Y++]=K;else B[Y++]=[Z||e[0],W||e[1]];var r=B[Y-1];Z&&W&&(r[0]!==Z||r[1]!==W)?(Q&&(X!==Z&&J!==W?ce(X&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[X||Z,J||W]):X&&J&&ce([X,J])),ce([Z,W])):X-Z&&J-W&&ce([Z||X,W||J]),Q=e,X=Z,J=W}else Q&&ue($(Q,e)[0]),B[Y++]=e;var n,a,i,o}for("linear"===z||"spline"===z?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,e)q(h,fe))break;i=h,(_=v[0]*g[0]+v[1]*g[1])>x?(x=_,f=h,m=!1):_=e.length||!h)break;de(h),n=h}}else de(f)}Q&&ce([X||Q[0],J||Q[1]]),E.push(B.slice(0,Y))}return E}},{"../../constants/numerical":212,"../../lib":232,"./constants":360}],371:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],372:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,d=-1,f=0,p=-1;for(i=0;i=0?s=p:(s=p=f,f++),s0?Math.max(r,i):0}}},{"fast-isnumeric":17}],374:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],375:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),d=(e.line||{}).color;(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":102,"../../components/colorscale/defaults":112,"../../components/colorscale/helpers":113,"./subtypes":381}],376:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":212,"../../lib":232}],377:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),d=e("./link_traces"),f=e("../../lib/polygon").tester;function p(e,t,r,d,p,h,m){var g;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),d=n.extent(i.simpleMap(s.range,s.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]})),m=Math.ceil(h.length/p),g=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return v?e.transition():e}var x=r.xaxis,b=r.yaxis,_=d[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,D;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),d[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var O,P,I="",R=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,R=z._polygons);var N,F,E,j,H,B,Y,V="",U="",q=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(d),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(N=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):N=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},q=u(d,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),g=0;g1){var r=n.select(this);if(r.datum(d),e)y(r.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),s.singleLineStyle(d,a)}}}}}var Z=k.selectAll(".js-line").data(q);y(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(S?(S.datum(d),j&&B&&(C?("y"===C?j[1]=B[1]=b.c2p(0,!0):"x"===C&&(j[0]=B[0]=x.c2p(0,!0)),y(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle)):y(S).attr("d",V+"Z").call(s.singleFillStyle))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?y(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle):y(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(X(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?X(S):D&&X(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(d),L.datum(d),function(t,a,i){var o,u=i[0].trace,d=c.hasMarkers(u),f=c.hasText(u),p=ee(u),h=te,m=te;if(d||f){var g=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?Q:J:_&&!w&&(g=K),d&&(h=g),f&&(m=g)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);v&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),d&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,d);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function X(e){y(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function K(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,f,h=!i,m=!!i&&i.duration>0,g=d(e,t,r);((u=a.selectAll("g.trace").data(g,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,g,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,g,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":124,"../../lib":232,"../../lib/polygon":244,"../../registry":316,"./line_points":370,"./link_traces":372,"./subtypes":381,"@plotly/d3":11}],378:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],d=l[0].trace;if(!n.hasMarkers(d)&&!n.hasText(d))return[];if(!1===t)for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return f(e)>l};case">=":return function(e){return f(e)>=l};case"[]":return function(e){var t=f(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=f(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=f(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=f(e);return tl[1]};case"](":return function(e){var t=f(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=f(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(f(e))};case"}{":return function(e){return-1===l.indexOf(f(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),f),x={},b={},_=0;h?(g=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(d))},v=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(g=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},v=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(g);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],78:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(d)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(d,h);if(e)return e}return!!m&&u(d,m)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(v.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)g=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:g,below:g};r&&r.status(d.seg,!!h&&h.seg,!!m&&m.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));case 5:case 10:case 11:case 12:case 7:default:return null}},i.prototype.scan_ifd=function(e,t,r){var i=this.read_uint16(t);t+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var h=[],m=d,y=0;y0&&(this.ifds_to_read.push({id:l,offset:h[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:e,tag:l,format:s,count:c,entry_offset:t+this.start,data_length:f,data_offset:d+this.start,value:h,is_subifd_link:p}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(e){return-1}}},{}],85:[function(e,t,r){"use strict";var n=e("./common").readUInt16BE,a=e("./common").readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=a(e,t);return e.length>4&15,a=15&e[4],i=e[5]>>4&15,o=n(e,6),s=8,c=0;ct.width||e.width===t.width&&e.height>t.height?e:t})),a=r.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),l=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(l=0===e.value?r[l]:t[l=t[l=r[l]]]),"irot"===e.type)for(var n=0;n1&&(d.variants=f.variants),f.orientation&&(d.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var p=i(e,f.exif_location.offset),h=e.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=l.get_orientation(h);m>0&&(d.orientation=m)}return d}}}}}}},{"../common":83,"../exif_utils":84,"../miaf_utils":85}],87:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("BM");t.exports=function(e){if(!(e.length<26)&&a(e,0,o))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":83}],88:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("GIF87a"),l=n("GIF89a");t.exports=function(e){if(!(e.length<10)&&(a(e,0,o)||a(e,0,l)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":83}],89:[function(e,t,r){"use strict";var n=e("../common").readUInt16LE;t.exports=function(e){var t=n(e,0),r=n(e,2),a=n(e,4);if(0===t&&1===r&&a){for(var i=[],o={width:0,height:0},l=0;lo.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":83}],90:[function(e,t,r){"use strict";var n=e("../common").readUInt16BE,a=e("../common").str2arr,i=e("../common").sliceEq,o=e("../exif_utils"),l=a("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1])for(var t=2;;){if(e.length-t<2)return;if(255!==e[t++])return;for(var r,a,s=e[t++];255===s;)s=e[t++];if(208<=s&&s<=217||1===s)r=0;else{if(!(192<=s&&s<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===s||218===s)return;if(225===s&&r>=10&&i(e,t,l)&&(a=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(e.length-t0&&(c.orientation=a),c}t+=r}}},{"../common":83,"../exif_utils":84}],91:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),l=n("IHDR");t.exports=function(e){if(!(e.length<24)&&a(e,0,o)&&a(e,12,l))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":83}],92:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&a(e,0,o))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":83}],93:[function(e,t,r){"use strict";function n(e){return"number"==typeof e&&isFinite(e)&&e>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,l=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return c.test(e)?e.match(c)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function d(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||u(e,t+8):"VP8L"===p&&h>=9?r=r||f(e,t+8):"VP8X"===p&&h>=10?r=r||d(e,t+8):"EXIF"===p&&(n=l.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":83,"../exif_utils":84}],96:[function(e,t,r){"use strict";t.exports={avif:e("./parse_sync/avif"),bmp:e("./parse_sync/bmp"),gif:e("./parse_sync/gif"),ico:e("./parse_sync/ico"),jpeg:e("./parse_sync/jpeg"),png:e("./parse_sync/png"),psd:e("./parse_sync/psd"),svg:e("./parse_sync/svg"),tiff:e("./parse_sync/tiff"),webp:e("./parse_sync/webp")}},{"./parse_sync/avif":86,"./parse_sync/bmp":87,"./parse_sync/gif":88,"./parse_sync/ico":89,"./parse_sync/jpeg":90,"./parse_sync/png":91,"./parse_sync/psd":92,"./parse_sync/svg":93,"./parse_sync/tiff":94,"./parse_sync/webp":95}],97:[function(e,t,r){"use strict";var n=e("./lib/parsers_sync");t.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o,l;if("string"==typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";l='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(i(t,"type"))}return l+=". Received type ".concat(typeof r)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],102:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var a=e("./_stream_readable"),i=e("./_stream_writable");e("inherits")(c,a);for(var o=n(i.prototype),l=0;l0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)o.endEmitted?w(e,new _):L(e,o,t,!0);else if(o.ended)w(e,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?L(e,o,t,!1):C(e,o)):L(e,o,t,!1)}else n||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(D,e))}function D(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,I(e)}function C(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(E,e,t))}function E(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){c("readable nexttick read 0"),e.read(0)}function z(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(j,t,e))}function j(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,a=t.needReadable;return c("need readable",a),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){w(this,new b("_read()"))},k.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:y;function l(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",l),n.removeListener("end",s),n.removeListener("end",y),n.removeListener("data",d),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function s(){c("onend"),e.end()}a.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",l);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,I(e))}}(n);e.on("drain",u);var f=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==B(a.pipes,e))&&!f&&(c("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",m),y()}function m(){c("onfinish"),e.removeListener("close",h),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",m),e.emit("pipe",n),a.flowing||(c("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,c("on readable",a.length,a.reading),a.length?O(this):a.reading||r.nextTick(R,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(P,this),n},k.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(P,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(z,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){(c("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var a=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,a,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":101,"./_stream_duplex":102,"./internal/streams/destroy":109,"./internal/streams/state":113,"./internal/streams/stream":114,_process:98,buffer:28,inherits:67,"util-deprecate":122}],107:[function(e,t,r){(function(r){(function(){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=e("./end-of-stream"),o=Symbol("lastResolve"),l=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[u]=null,e[o]=null,e[l]=null,t(p(r,!1)))}}function m(e){r.nextTick(h,e)}var y=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a(n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[s]?n(e[s]):t(p(void 0,!0))}))}));var n,a=this[u];if(a)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(a,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),y);t.exports=function(e){var t,r=Object.create(g,(a(t={},d,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,f,{value:function(e,t){var n=r[d].read();n?(r[u]=null,r[o]=null,r[l]=null,e(p(n,!1))):(r[o]=e,r[l]=t)},writable:!0}),t));return r[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[o]=null,r[l]=null,t(e)),void(r[s]=e)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":110,_process:98}],108:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,l=0;i;)t=i.data,r=a,n=l,o.prototype.copy.call(t,r,n),l+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return ea.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return l(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&o.forEach(c),i||(o.forEach(c),a(n))}))}));return t.reduce(u)}},{"../../../errors":101,"./end-of-stream":110}],113:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(a?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},{"../../../errors":101}],114:[function(e,t,r){t.exports=e("events").EventEmitter},{events:27}],115:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=c,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":99}],116:[function(e,t,r){(function(r,n){(function(){var r=e("assert"),a=e("debug")("stream-parser");t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");a("extending Parser into stream"),e._bytes=o,e._skipBytes=l,t&&(e._passthrough=s);t?e._transform=u:e._write=c};function i(e){a("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),a("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function l(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function c(e,t,r){this._parserInit||i(this),a("write(%o bytes)",e.length),"function"==typeof t&&(r=t),d(this,e,null,r)}function u(e,t,r){this._parserInit||i(this),a("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),d(this,e,t,r)}function f(e,t,r,i){if(e._parserBytesLeft-=t.length,a("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var o=e._parserCallback;if(o&&0===e._parserState&&e._parserBuffers.length>1&&(t=n.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),o){var l=[];t&&l.push(t),r&&l.push(r);var s=o.length>l.length;s&&l.push(p(i));var c=o.apply(e,l);if(!s||i===c)return i}}var d=p((function e(t,r,n,a){return t._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return f(t,r,n,a)}:function(){var i=r.slice(0,t._parserBytesLeft);return f(t,i,n,(function(o){return o?a(o):r.length>i.length?function(){return e(t,r.slice(i.length),n,a)}:void 0}))}}));function p(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:98,assert:21,buffer:28,debug:117}],117:[function(e,t,r){(function(n){(function(){function a(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var a=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(a++,"%c"===e&&(i=a))})),e.splice(i,0,n)},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=a,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this)}).call(this,e("_process"))},{"./debug":118,_process:98}],118:[function(e,t,r){var n;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,i=a-(n||a);e.diff=i,e.prev=n,e.curr=a,n=a;for(var o=new Array(arguments.length),l=0;l0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?l(r=e,o,"day")||l(r,i,"hour")||l(r,a,"minute")||l(r,n,"second")||r+" ms":function(e){if(e>=o)return Math.round(e/o)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],120:[function(e,t,r){(function(t,n){(function(){var a=e("process/browser.js").nextTick,i=Function.prototype.apply,o=Array.prototype.slice,l={},s=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":98,timers:120}],121:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*D(p,255),g:255*D(h,255),b:255*D(m,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*D(t,360),r=D(r,100),n=D(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=D(e,360),t=D(t,100),r=D(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=O(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=D(e,255),t=D(t,255),r=D(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=O(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[P(i(e).toString(16)),P(i(t).toString(16)),P(i(r).toString(16)),P(z(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*D(this._r,255))+"%",g:i(100*D(this._g,255))+"%",b:i(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%)":"rgba("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function E(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return E(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),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})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],122:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],123:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":137,"object-assign":73}],126:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":137,"object-assign":73}],127:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":137,"object-assign":73}],128:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":137,"object-assign":73}],129:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":137,"object-assign":73}],130:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":137,"object-assign":73}],131:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":137,"object-assign":73}],132:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":137,"object-assign":73}],134:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":137,"object-assign":73}],135:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":137,"object-assign":73}],136:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":137,"object-assign":73}],137:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":73}],138:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){v("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(d,p);h>S;S=this.daysInMonth(d,p))p++,h-=S}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":137,"object-assign":73}],139:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],140:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":263,"../../plot_api/plot_template":323,"../../plots/cartesian/constants":341,"../../plots/font_attributes":363,"./arrow_paths":139}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,m=p-d,y=3*e.startarrowsize*e.arrowwidth||0,g=y+d,v=y-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(f,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,v=l?v-l:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(f,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":287,"../../plots/cartesian/axes":334,"./draw":146}],142:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],X=0;X1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(Q=t[te],J=he?ae._offset+ae._length*Q:J=T.l+T.w*Q):(Q=1-t[te],J=he?ae._offset+ae._length*Q:J=T.t+T.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){fe.head=J;var me=t["a"+te];if(ee=oe*q(.5,t.xanchor)-le*q(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),fe.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,fe.tail=T.t+T.h*me):fe.tail=T.l+T.w*me:fe.tail=ae._offset+ae.r2p(me),K=ee}else fe.tail=J+me,K=ee+me;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ve=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ve>0?(fe.tail+=ve,fe.text+=ve):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else K=ee=se*q($,ce),fe.text=J+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)I.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,H?O:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;V.call(d.positionText,Te,we).call(u.setClipUrl,H?O:null,e)}U.select("rect").call(u.setRect,j,j,k,z),B.call(u.setRect,N/2,N/2,F-N,Y-N),I.call(u.setTranslate,Math.round(D.x.text-F/2),Math.round(D.y.text-Y/2)),P.attr({transform:"rotate("+C+","+D.x.text+","+D.y.text+")"});var Me,ke=function(r,n){E.selectAll(".annotation-arrow-g").remove();var s=D.x.head,f=D.y.head,d=D.x.tail+r,p=D.y.tail+n,m=D.x.text+r,b=D.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),O=+B.attr("width"),R=+B.attr("height"),z=m-.5*O,N=z+O,F=b-.5*R,j=F+R,H=[[z,F,z,j],[z,j,N,j],[N,j,N,F],[N,F,z,F]].map(k);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var U=t.arrowwidth,Y=t.arrowcolor,q=t.arrowside,V=E.append("g").style({opacity:c.opacity(Y)}).classed("annotation-arrow-g",!0),G=V.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(Y));if(y(G,q,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,W=f;if(t.standoff){var X=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Z+=t.standoff*(d-s)/X,W+=t.standoff*(p-f)/X}var J,K,Q=V.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",U+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);J=e.x,K=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,K),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),L("x",v(g,e,"x",T,t)),L("y",v(x,r,"y",T,t)),t.axref===t.xref&&L("ax",v(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",v(x,r,"ay",T,t)),V.attr("transform",l(e,r)),P.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:I.node(),gd:e,prepFn:function(){Me=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",v(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",v(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=v(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=v(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}P.attr({transform:l(e,r)+Me}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(d=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(f),k=b*Math.sin(f);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),O="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":366,"../annotations/draw":146}],153:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=J*c.roundUp(X/J,[2,5,10]),(Math.abs(D.start)/D.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[Y+B,Y+N-B],G.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var K,Q=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),m.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===A?(1-(Y+N-B))*s.h+s.t+3+.75*n:(1-(Y+B))*s.h+s.t-3-.25*n,te(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),f=[-t.outlinewidth/2,t.outlinewidth/2],d=i.select(".h"+G._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(ee=p.bBox(d).height)>h&&(f[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)G.domain[1]-=ee/s.h,f[1]*=-1;else{G.domain[0]+=ee/s.h;var m=y.lineCount(o);f[1]+=(1-m)*h}i.attr("transform",u(f[0],f[1])),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-G.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var v=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(E);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var x=L.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?L[0]:(E[i]+E[i-1])/2,i===E.length-1?L[1]:(E[i]+E[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:H,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=O(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(g.color&&g.width?P:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+g.width/2%1)+"h"+R).call(p.lineGroupStyle,g.width,S(e),g.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var _=H+R+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(G),M=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,T):T,layer:$,path:l.makeTickPath(G,_,M),transFn:l.makeTransTickFn(G)}),l.drawLabels(r,G,{vals:T,layer:$,transFn:l.makeTransTickLabelFn(G),labelFns:l.makeLabelFns(G,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));te("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=R+t.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(k.jsPlaceholder)){var a,o=Q.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(Q.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-V;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:V-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:V+t.ypad+("top"===A?ee:0),width:Math.max(R,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var f=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-f,s.t));var d={},m=T[t.yanchor],y=M[t.yanchor];"pixels"===t.lenmode?(d.y=t.y,d.t=c*m,d.b=c*y):(d.t=d.b=0,d.yt=t.y+t.len*m,d.yb=t.y-t.len*y);var g=T[t.xanchor],v=M[t.xanchor];if("pixels"===t.thicknessmode)d.x=t.x,d.l=l*g,d.r=l*v;else{var x=l-R;d.l=x*g,d.r=x*v,d.xl=t.x-t.thickness*g,d.xr=t.x+t.thickness*v}i.autoMargin(r,t._id,d)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,c)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":262,"../../lib":287,"../../lib/extend":281,"../../lib/setcursor":307,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../plots/cartesian/axis_defaults":336,"../../plots/cartesian/layout_attributes":349,"../../plots/cartesian/position_defaults":352,"../../plots/plots":369,"../../registry":376,"../color":157,"../colorscale/helpers":168,"../dragelement":176,"../drawing":179,"../titles":255,"./constants":159,"@plotly/d3":20,tinycolor2:121}],162:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":287}],163:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":158,"./defaults":160,"./draw":161,"./has_colorbar":162}],164:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",g=(l(d+p),l(d+h),l(d+m),{});g[h]=g[m]=void 0;var v={};v[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":303,"../../lib/sort_object_keys":308,"../colorbar/attributes":158,"./scales.js":172}],165:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,m=f.mid,y=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():d&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=g():d&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":287,"./helpers":168,"fast-isnumeric":33}],166:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],174:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":287}],175:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],176:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,m,y=e.gd,g=1,v=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(g=Math.max(g-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":287,"../../plots/cartesian/constants":341,"./align":173,"./cursor":174,"./unhover":177,"has-hover":64,"has-passive-events":65,"mouse-event-offset":71}],177:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":279,"../../lib/events":280,"../../lib/throttle":311,"../fx/constants":191}],178:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],179:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},x.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var b=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(e){var t=b[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(e,t){var r=e%100;return x.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=A[i],d=new Array(u),p=0;p"+g(e);h._gradientUrlQueryParts[v]=1},x.pattern=function(e,t,r,i,o,l,s,u,f,d,p,h){var m="legend"===t;u&&("overlay"===f?(d=u,p=c.contrast(d)):(d=void 0,p=u));var y,g,v,x,b,_,w,T,M,k,A,L=r._fullLayout,S="p"+L._uid+"-"+i,O={};switch(o){case"/":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",O={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"\\":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",O={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"x":y=l*Math.sqrt(2),g=l*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,x=l-l*Math.sqrt(1-s),_="path",O={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",O={d:v="M"+(y=l)/2+",0L"+y/2+","+(g=l),opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"-":_="path",_="path",O={d:v="M0,"+(g=l)/2+"L"+(y=l)+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"+":_="path",v="M"+(y=l)/2+",0L"+y/2+","+(g=l)+"M0,"+g/2+"L"+y+","+g/2,x=l-l*Math.sqrt(1-s),_="path",O={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case".":y=l,g=l,s.pattern_filled";L._patternUrlQueryParts[E]=1},x.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},x.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},x.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var f,d,p,h=!1;if(e.so)p=l.outlierwidth,d=l.outliercolor,f=o.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var y=o.gradient,g=e.mgt;g?h=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,b=v&&x.getPatternAttr(v.shape,e.i,"");if(g&&"none"!==g){var _=e.mgc;_?h=!0:_=y.color;var T=r.uid;h&&(T+="-"+e.i),x.gradient(t,i,T,g,[[0,_],[1,f]],"fill")}else if(b){var M=x.getPatternAttr(v.bgcolor,e.i,null),k=x.getPatternAttr(v.fgcolor,e.i,null),L=v.fgopacity,S=x.getPatternAttr(v.size,e.i,8),O=x.getPatternAttr(v.solidity,e.i,.3),D=e.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),C=r.uid;D&&(C+="-"+e.i),x.pattern(t,"point",i,C,b,S,O,e.mcc,v.fillmode,M,k,L)}else c.fill(t,f);p&&c.stroke(t,d)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:m*t});var h=i.color,y=o.color,g=l.color;(y||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:g||t});var v=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(x.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};v(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=O(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,g).text(c).call(d.convertToTspans,r).call(S,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=O(e,t);c.fill(a,i),S(a,o,l,e.mrc2||e.mrc)}))}};function D(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},P=0),r&&(x.savedBBoxes[r]=y),P++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var I=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(I,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var N=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(N);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":193,"../../constants/alignment":262,"../../constants/interactions":266,"../../constants/xmlns_namespaces":268,"../../lib":287,"../../lib/svg_text_utils":310,"../../registry":376,"../../traces/scatter/make_bubble_size_func":514,"../../traces/scatter/subtypes":522,"../color":157,"../colorscale":169,"./symbol_defs":180,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:121}],180:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":20}],181:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],182:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var m=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,f);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":522,"../drawing":179,"@plotly/d3":20,"fast-isnumeric":33}],187:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":157,"@plotly/d3":20}],188:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":281,"../../plots/font_attributes":363,"./layout_attributes":198}],189:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+b[0]._offset,t.pointerY=ie+_[0]._offset,F="xval"in t?g.flat(l,t.xval):g.p2c(b,ae),U="yval"in t?g.flat(l,t.yval):g.p2c(_,ie),!a(F[0])||!a(U[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(q=0;q$&&(ee.splice(0,$),ce=ee[0].distance),m&&0!==P&&0===ee.length){Q.distance=P,Q.index=!1;var f=G._module.hoverPoints(Q,J,K,"closest",{hoverLayer:s._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=P}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var y=h[0];a(y.x0)&&a(y.y0)&&(d=de(y),(!re.vLinePoint||re.vLinePoint.spikeDistance>d.spikeDistance)&&(re.vLinePoint=d))}var v=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(v.length){var x=v[0];a(x.x0)&&a(x.y0)&&(d=de(x),(!re.hLinePoint||re.hLinePoint.spikeDistance>d.spikeDistance)&&(re.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)De(ee[Ae]);ee=Le,ye()}var Ce=e._hoverdata,Ee=[],Pe=B(e),Re=H(e);for(Y=0;Y1||ee.length>1)||"closest"===L&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),We=E(ee,{gd:e,hovermode:L,rotateLabels:Ge,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});g.isUnifiedHover(L)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(y.push.apply(y,g),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ge?"xa":"ya",s),R(We,Ge,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Xe=y.getComponentMethod("annotations","hasClickToShow")(e,Ee);f(n.select(t.target),Xe?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:F,yvals:U})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=E(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,f+=v,d+=x,h+=x}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function E(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{},T=t.fontFamily||v.HOVERFONT,M=t.fontSize||v.HOVERFONTSIZE,k=e[0],S=k.xa,O=k.ya,C=i.charAt(0),E=k[C+"Label"],R=m.getBoundingClientRect(),z=R.top,I=R.width,N=R.height,F=void 0!==E&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(F){var j,B,H=!0;for(j=0;ja.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+v.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+v.width/2)+"v"+x+(2*L+v.height)+"H-"+(L+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,D,C;"right"===O.side?(_="start",D=1,C="",y=S._offset+S._length):(_="end",D=-1,C="-",y=S._offset),g=O._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+v.height/2)+"h"+C+(2*L+v.width)+"V-"+(L+v.height/2)+"H"+C+A+"V-"+A+"Z");var P,R=v.height/2,I=z-v.top-R,N="clip"+a._uid+"commonlabel"+O._id;if(y=0?ne:ae+le=0?ae:me+le=0?te:re+se=0?re:ye+se=0,"top"!==e.idealAlign&&C||!R?C?(H+=Y/2,e.anchor="start"):e.anchor="middle":(H-=Y/2,e.anchor="end");else if(e.pos=H,C=B+U/2+q<=I,R=B-U/2-q>=0,"left"!==e.idealAlign&&C||!R)if(C)B+=U/2,e.anchor="start";else{e.anchor="middle";var V=q/2,G=B+V-I,Z=B-V;G>0&&(B-=G),Z<0&&(B+=-Z)}else B-=U/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(B,H)+(c?s(_):""))})),ge}function P(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var g=h+f,v=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function I(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,g,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,b,_=i.readability(v.color,h)<1.5?p.contrast(h):v.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(f){var S,O,D=t.vLinePoint;n=D&&D.xa,a=D&&D.ya,"cursor"===n.spikesnap?(S=c.pointerX,O=c.pointerY):(S=n._offset+D.x,O=a._offset+D.y);var C,E,P=i.readability(D.color,h)<1.5?p.contrast(h):D.color,R=n.spikemode,z=n.spikethickness,I=n.spikecolor||P,N=m.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(C=N,E=O),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,E=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":z,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?z:-z),r:z,fill:I}).classed("spikeline",!0)}}}function N(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}},{"../../lib":287,"../../lib/events":280,"../../lib/override_cursor":298,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../registry":376,"../color":157,"../dragelement":176,"../drawing":179,"../legend/defaults":209,"../legend/draw":210,"./constants":191,"./helpers":193,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:121}],195:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":287,"../color":157,"./helpers":193}],196:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":287,"./layout_attributes":198}],197:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":287,"../dragelement":176,"./attributes":188,"./calc":189,"./click":190,"./constants":191,"./defaults":192,"./helpers":193,"./hover":194,"./layout_attributes":198,"./layout_defaults":199,"./layout_global_defaults":200,"@plotly/d3":20}],198:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":363,"./constants":191}],199:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":287,"./hoverlabel_defaults":195,"./hovermode_defaults":196,"./layout_attributes":198}],200:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":287,"./hoverlabel_defaults":195,"./layout_attributes":198}],201:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);y._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,T=d?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,v),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var y=i.newContainer(t,"legend");if(T("uirevision",t.uirevision),!1!==m){T("bgcolor",t.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,x,b=a.coerceFont(T,"font",t.font),_="h"===T("orientation");if(_?(g=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(v=1.1,x="bottom"):(v=-.1,x="top")):(g=1.02,v=1,x="auto"),T("traceorder",d),s.isGrouped(t.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",x),T("valign"),a.noneOrAll(c,y,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=a.extendFlat({},b,{size:a.bigFont(b.size)});a.coerceFont(T,"title.font",w)}}}function T(e,t){return a.coerce(c,y,o,e,t)}}},{"../../lib":287,"../../plot_api/plot_template":323,"../../plots/layout_attributes":367,"../../registry":376,"./attributes":207,"./helpers":213}],210:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,g=h.FROM_BR,v=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(d?T(n,h):n);var y=r.itemwidth+2*p.itemGap;f.positionText(m,y,0),d?m.call(f.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(m,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,d=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),v=f.lineCount(g),x=g.node();if(u=h*v,d=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,d-=r.itemwidth),f.positionText(g,b,-h*((v-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=v(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&v(e.calcdata,t)}var m=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var T=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),S=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),O=a.ensureSingle(T,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));O.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var D=a.ensureSingle(T,"g","scrollbox"),C=t.title;if(t._titleWidth=0,t._titleHeight=0,C.text){var E=a.ensureSingle(D,"text","legendtitletext");E.attr("text-anchor","start").call(c.font,C.font).text(C.text),k(E,D,e,t,1)}else D.selectAll(".legendtitletext").remove();var P=a.ensureSingle(T,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),R=D.selectAll("g.groups").data(l);R.enter().append("g").attr("class","groups"),R.exit().remove();var z=R.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.itemGap,h=a.itemwidth+2*d,m=2*(u+d),y=L(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,x=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+d),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=d+h+f,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),M=a.x<0||0===a.x&&"right"===T,k=a.x>1||1===a.x&&"left"===T,S=v||g,O=i.width/2;a._maxWidth=Math.max(M?S&&"left"===T?o.l+o.w:O:k?S&&"right"===T?o.r+o.w:O:o.w,2*h);var D=0,C=0;r.each((function(e){var t=e[0].width+h;D=Math.max(D,t),C+=t})),_=null;var E=0;if(s){var P=0,R=0,z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+d+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),P=Math.max(P,t);var r=e+d;r+u+R>a._maxWidth&&(E=Math.max(E,R),R=0,z+=P+x,P=t),c.setTranslate(this,R,z),R+=r})),a._width=Math.max(E,R)+u,a._height=z+P+m}else{var I=r.size(),N=C+f+(I-1)*d=a._maxWidth&&(E=Math.max(E,H),j=0,B+=F,a._height+=F,F=0),c.setTranslate(this,w[0]+u+j,w[1]+u+B+t/2+d),H=j+r+d,j+=n,F=Math.max(F,t)})),N?(a._width=j+f,a._height=F+m):(a._width=Math.max(E,H)+f,a._height+=F+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var U=e._context.edits,Y=U.legendText||U.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=Y?h:_||h+e[0].width;l||(a+=d/2),c.setRect(t,0,-r/2,a,r)}))}(e,R,z,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*y[n]})}(e)){var l,u,m,v,x=f._size,b=t.borderwidth,w=x.l+x.w*t.x-y[A(t)]*t._width,M=x.t+x.h*(1-t.y)-y[L(t)]*t._effHeight;if(!h&&f.margin.autoexpand){var k=w,C=M;w=a.constrain(w,0,f.width-t._width),M=a.constrain(M,0,f.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),M!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(T,w,M),P.on(".drag",null),T.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var E=t._effHeight;h&&(E=t._height),O.attr({width:t._width-b,height:E-b,x:b/2,y:b/2}),c.setTranslate(D,0,0),S.select("rect").attr({width:t._width-2*b,height:E-2*b,x:b,y:b}),c.setClipUrl(D,d,e),c.setRect(P,0,0,0,0),delete t._scrollY}else{var R,z,I,N=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-N-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);O.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),S.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(D,d,e),q(H,N,B),T.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),N,B),0!==H&&H!==j&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(I,R,z),N,B))}));P.call(U);var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(I,R,z),N,B))}));D.call(Y)}if(e._context.edits.legendPosition)T.classed("cursor-move",!0),s.init({element:T.node(),gd:e,prepFn:function(){var e=c.getTranslate(T);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(T,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,T,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(D,0,-r),c.setRect(P,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),S.select("rect").attr("y",b+r)}}],e)}(e,t)}},{"../../constants/alignment":262,"../../lib":287,"../../lib/events":280,"../../lib/svg_text_utils":310,"../../plots/plots":369,"../../registry":376,"../color":157,"../dragelement":176,"../drawing":179,"./constants":208,"./get_legend_data":211,"./handle_click":212,"./helpers":213,"./style":215,"@plotly/d3":20}],211:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(f,"")(m)}var g=p||i.mc||f.color,v=f.pattern,x=v&&l.getPatternAttr(v.shape,0,"");if(x){var b=l.getPatternAttr(v.bgcolor,0,null),_=l.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,M=y(v.size,8,10),k=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,v.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||d.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});f(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,m=d.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=e[0],b=v.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}}),f||d){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(v,{trace:a})]}var O=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",k+(d?"l"+x+",0.0001":"h"+x)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,y=!d&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||y||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":287,"../../registry":376,"../../traces/pie/helpers":489,"../../traces/pie/style_one":495,"../../traces/scatter/subtypes":522,"../color":157,"../colorscale/helpers":168,"../drawing":179,"./constants":208,"@plotly/d3":20}],216:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":218}],217:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(C=["toggleHover"],E=["resetViews"]):g?(D=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],E=["resetGeo"]):y?(C=["hoverClosest3d"],E=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(D=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],E=["resetViewMapbox"]):b?C=["hoverClosestGl2d"]:v?C=["hoverClosestPie"]:M?(C=["hoverClosestCartesian","hoverCompareCartesian"],E=["resetViewSankey"]):C=["toggleHover"];m&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=N[r+1];else if(e=n.pmax)t=N[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;ov?(M=f,S="y0",k=v,O="y1"):(M=v,S="y1",k=f,O="y0");X(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===P?J:K,W.altKey=n.altKey},doneFn:function(){if(g(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(g(e))return;$(l)}};function X(r){if(g(e))P=null;else if(I)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!N&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),P=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(x+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?F("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else R?F("xanchor",r.xanchor=V(x+n)):(F("x0",r.x0=V(c+n)),F("x1",r.x1=V(y+n))),z?F("yanchor",r.yanchor=G(T+a)):(F("y0",r.y0=G(f+a)),F("y1",r.y1=G(v+a)));t.attr("d",_(e,r)),Q(l,r)}function K(n,a){if(N){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(x+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?F("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else if(I){if("resize-over-start-point"===P){var u=c+n,d=z?f-a:f+a;F("x0",r.x0=R?u:V(u)),F("y0",r.y0=z?d:G(d))}else if("resize-over-end-point"===P){var p=y+n,h=z?v-a:v+a;F("x1",r.x1=R?p:V(p)),F("y1",r.y1=z?h:G(h))}}else{var g=function(e){return-1!==P.indexOf(e)},b=g("n"),B=g("s"),U=g("w"),Z=g("e"),W=b?M+a:M,X=B?k+a:k,J=U?A+n:A,K=Z?L+n:L;z&&(b&&(W=M-a),B&&(X=k-a)),(!z&&X-W>10||z&&W-X>10)&&(F(S,r[S]=z?W:G(W)),F(O,r[O]=z?X:G(X))),K-J>10&&(F(D,r[D]=R?J:V(J)),F(C,r[C]=R?K:V(K)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(R||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Y(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=q(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),R&&z){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),Z.node().onmousemove=X}(e,R,s,t,r,P):!0===s.editable&&R.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!v(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,y(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getRefType(t.xref),y=i.getRefType(t.yref),g=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),x=e._fullLayout._size;if(g?"domain"===p?n=function(e){return g._offset+g._length*e}:(r=m.shapePositionToRange(g),n=function(e){return g._offset+g.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},v?"domain"===y?l=function(e){return v._offset+v._length*(1-e)}:(o=m.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===d)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(l=m.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,f=_-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var w=(s+c)/2,T=(u+f)/2,M=Math.abs(w-s),k=Math.abs(T-u),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){v(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,y(e)))}t.exports={draw:y,drawOne:x,eraseActiveShape:function(e){if(!v(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(g),r.attr("d",m(t)),k&&!d)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,v(),x())}}()}}function E(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function O(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,g);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return z.call(I),P&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":262,"../../constants/interactions":266,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/plots":369,"../../registry":376,"../color":157,"../drawing":179,"@plotly/d3":20,"fast-isnumeric":33}],256:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":281,"../../plot_api/edit_types":316,"../../plot_api/plot_template":323,"../../plots/font_attributes":363,"../../plots/pad_attributes":368,"../color/attributes":156}],257:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],258:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":287,"../../plots/array_container_defaults":329,"./attributes":256,"./constants":257}],259:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||g(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(v,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+y+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(v,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+g;S+A>c&&(S=c-A);var O=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=O.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=g>T,C=l.barWidth+2*l.barPad,E=l.barLength+2*l.barPad,P=h+m,R=y;P+C>s&&(P=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),D?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:R,width:C,height:E}),this._vbarYMin=R+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,N=u-.5,F=D?f+C+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(M||D?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),M||D?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||D){var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(U);var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(Y),D&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":287,"../color":157,"../drawing":179,"@plotly/d3":20}],262:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],263:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],264:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],265:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],266:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],267:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],268:[function(e,t,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}},{}],269:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],271:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],272:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":294}],273:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:v);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),O=Number(T[11]||0);if(c){if(2===M.length)return u;var D;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var E="i"===k.charAt(k.length-1);k=parseInt(k,10),D=C.newDate(M,C.toMonthIndex(M,k,E),A)}else D=C.newDate(M,Number(k),A)}catch(e){return u}return D?(D.toJD()-m)*f+L*d+S*p+O*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var P=new Date(Date.UTC(2e3,k,A,L,S));return P.setUTCFullYear(M),P.getUTCMonth()!==k||P.getUTCDate()!==A?u:P.getTime()+O*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,M=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,v,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+m,S=Math.floor(s(e,f));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,O={1:"1",2:"1",3:"2",4:"2"};function D(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return O[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+D(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return D(t,e,n,a)};var E=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+E);return c.setUTCMonth(c.getUTCMonth()+t)+n-E},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+f*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,m=d*d+p*p,y=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,m,e-a,t-i),s(d,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":294}],285:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],286:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],287:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var m=e("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var y=e("./dates");f.dateTime2ms=y.dateTime2ms,f.isDateTime=y.isDateTime,f.ms2DateTime=y.ms2DateTime,f.ms2DateTimeLocal=y.ms2DateTimeLocal,f.cleanDate=y.cleanDate,f.isJSDate=y.isJSDate,f.formatDate=y.formatDate,f.incrementMonth=y.incrementMonth,f.dateTick0=y.dateTick0,f.dfltRange=y.dfltRange,f.findExactDates=y.findExactDates,f.MIN_MS=y.MIN_MS,f.MAX_MS=y.MAX_MS;var g=e("./search");f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var x=e("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=e("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(z,arguments)};var I={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(I,arguments)};var N=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,g=l;if((p||h)&&(g=g.substring(1)),(m||h)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=t[g]))return""}else for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":267,"./anchor_utils":271,"./angles":272,"./array":273,"./clean_number":274,"./clear_responsive":276,"./coerce":277,"./dates":278,"./dom":279,"./extend":281,"./filter_unique":282,"./filter_visible":283,"./geometry2d":284,"./identity":285,"./increment":286,"./is_plain_object":288,"./keyed_container":289,"./localize":290,"./loggers":291,"./make_trace_groups":292,"./matrix":293,"./mod":294,"./nested_property":295,"./noop":296,"./notifier":297,"./preserve_drawing_buffer":300,"./push_unique":301,"./regex":303,"./relative_attr":304,"./relink_private":305,"./search":306,"./sort_object_keys":308,"./stats":309,"./throttle":311,"./to_log_range":312,"@plotly/d3":20,"d3-format":29,"d3-time-format":30,"fast-isnumeric":33}],288:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],289:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":321,"./notifier":297}],292:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":20}],293:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],295:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(f,y)||c>Math.max(d,g)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":267,"./matrix":293}],300:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":33,"is-mobile":69}],301:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":273,"fast-isnumeric":33}],310:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),D=n.select(e.node().parentNode);if(!D.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return E(),void t();var c=D.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:C,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+e.attr("x")-d*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],y=-(r||s(e,"height"))/4;"y"===C[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-d/2,y-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===C[0]?l.attr({x:e.attr("x"),y:y-p/2}):"a"===C[0]&&0!==C.indexOf("atitle")?l.attr({x:0,y:y}):l.attr({x:h,y:+e.attr("y")+y-p/2}),m&&m.call(e,c),t(c)}))}))):E(),e}function E(){D.empty()||(C=e.attr("class")+"-math",D.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),D=0;D|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function O(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function D(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],312:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":33}],313:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],314:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],315:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",f,v),!0;t.set(v)}return!m&&(d(y,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),O=S||[],D=u(g,f).get(),C=[],E=-1,P=O.length;for(x=0;xO.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?C.push(_):k?("add"===M&&(M={}),O.splice(_,0,M),D&&D.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===E&&(E=_);else for(b=0;b=0;x--)O.splice(C[x],1),D&&D.splice(C[x],1);if(O.length?S||t.set(O):t.set(null),m)return!1;if(d(y,g),h!==a){var R;if(-1===E)R=L;else{for(P=Math.max(O.length,P),R=[],x=0;x=E);x++)R.push(_);for(x=E;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var m=0;m-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&Y(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Y(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,V=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=N(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),g={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof P.parts[z];)z--;var F=P.parts[z],j=P.parts[z-1]+"."+F,H=P.parts.slice(0,z).join("."),U=l(e.layout,H).get(),Y=l(s,H).get(),Z=P.get();if(void 0!==R){A[E]=R,L[E]="reverse"===F?R:I(Z);var X=f.getLayoutValObject(s,P.parts);if(X&&X.impliedEdits&&null!==R)for(var J in X.impliedEdits)S(o.relativeAttr(E,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(E))if(R){S("autosize",null);var K="height"===E?"width":"height";S(K,s[K])}else s[E]=e._initialAutoSize[E];else if("autosize"===E)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(q))C(j),l(s,H+"._inputRange").set(null);else if(j.match(V)){C(j),l(s,H+"._inputRange").set(null);var Q=l(s,H).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(G)&&l(s,H+"._inputDomain").set(null);if("type"===F){O=U;var $="linear"===Y.type&&"log"===R,ee="log"===Y.type&&"linear"===R;if($||ee){if(O&&O.range)if(Y.autorange)$&&(O.range=O.range[1]>O.range[0]?[1,2]:[2,1]);else{var te=O.range[0],re=O.range[1];$?(te<=0&&re<=0&&S(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(H+".range[0]",Math.log(te)/Math.LN10),S(H+".range[1]",Math.log(re)/Math.LN10)):(S(H+".range[0]",Math.pow(10,te)),S(H+".range[1]",Math.pow(10,re)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete s[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,Y,R,S),u.getComponentMethod("images","convertCoords")(e,Y,R,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(M)){var ne=l(s,E).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(E);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=X||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[E]=null:b.isRemoveVal(R)?L[E]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=R,delete t[E]}else"reverse"===F?(U.range?U.range.reverse():(S(H+".autorange",!0),U.range=[1,0]),Y.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===E&&("lasso"===R||"select"===R)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:X?T.update(k,X):k.calc=!0,P.set(R))}}for(r in g){b.applyContainerArrayChanges(e,d(i,r),g[r],k,d)||(k.plot=!0)}for(var ce in D){var ue=(O=p.getFromId(e,ce))&&O._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)D[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:D,undoit:L,redoit:A,eventData:y}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function X(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),U(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&Y(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag),c.add(e,X,[e,l.undoit,u.undoit,l.traces],X,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,m,y=0;function g(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var v=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))v.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);v=k}}v.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,g=t[n].name,v=u[y]||h[y];y&&g&&"number"==typeof g&&v&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[m]={name:m},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":287,"../plots/attributes":330}],324:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,g=y._size,x=g.p,_=d.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var O=l.xaxis.domain,D=l.yaxis.domain,C=l.plotgroup;if(v(O,D,L)){var E=C.node(),P=l.bg=o.ensureSingle(C,"rect","bg");E.insertBefore(P.node(),E.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([O,D]),S||(k.push(a),A.push(a))}var R,z,I,N,F,j,B,H,U,Y,q,V,G,Z=y._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(g)}},{"../lib":287,"../plots/attributes":330,"../plots/plots":369,"./plot_config":321,"./plot_schema":322,"./plot_template":323}],326:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function m(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var y={};function g(e,r){return o.coerce(t,y,f,e,r)}var v=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},d);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function O(){return new Promise((function(e,t){var r=s(M,v,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===v){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===v)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(O).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":287,"../plots/plots":369,"../snapshot/helpers":380,"../snapshot/svgtoimg":382,"../snapshot/tosvg":384,"../version":549,"./plot_api":320,"fast-isnumeric":33}],327:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,O,D=x.length,C=Array.isArray(M);if(C&&(D=Math.min(D,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var E=x[A].length;for(k=0;k<(C?Math.min(E,M[A].length):E);k++)L=C?M[A][k]:M,S=v[A][k],O=x[A][k],n.validate(S,L)?O!==S&&O!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,O)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),v[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,d)||0,g=[],v=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,d);for(;M<=k;)M=o(M,c,d);T=o(M,-c,d)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,v[_]=T,x[_]=M}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":267,"../../lib":287,"fast-isnumeric":33}],332:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],333:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,y=f[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>O?M/T>D&&(_=x,w=b,D=M/T):M/S>D&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},D=M/S));if(d===y){var C=d-1,E=d+1;if(A)if(0===d)a=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=d/(1-Math.min(.5,P/S));a=d>0?[0,R]:[R,0]}else a=L?[Math.max(0,C),Math.max(1,E)]:[C,E]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-D*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),D=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-D*l(_),w.val+D*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),O=k(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=E;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":179,"../../constants/numerical":267,"../../lib":287,"../../registry":376,"./axis_ids":338,"@plotly/d3":20,"fast-isnumeric":33}],334:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,O=m.ONEMIN,D=m.ONESEC,C=m.MINUS_SIGN,E=m.BADNUM,P={K:"zeroline"},R={K:"gridline",L:"path"},z={K:"tick",L:"path"},I={K:"tick",L:"text"},N=e("../../constants/alignment"),F=N.MID_SHIFT,j=N.CAP_SHIFT,B=N.LINE_SPACING,H=N.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var Y=e("./axis_autotype"),q=e("./axis_ids"),V=q.idSort,G=q.isLinked;U.id2name=q.id2name,U.name2id=q.name2id,U.cleanId=q.cleanId,U.list=q.list,U.listIds=q.listIds,U.getFromId=q.getFromId,U.getFromTrace=q.getFromTrace;var Z=e("./autorange");U.getAutoRange=Z.getAutoRange,U.findExtremes=Z.findExtremes;function W(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(v,e,g,c,i)),y=v,0;y<=u;)y=U.tickIncrement(y,g,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(y,0,i),size:g,_dataSpan:u-c}},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dticki&&f=o:p<=o;p=U.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(O.length>m||p===D)break;D=p;var C=!1;f&&p!==(0|p)&&(C=!0),O.push({minor:C,value:p})}if(d&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=v?d=u>=v&&u<=y?u:g:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=M?d=u>=M&&u<=w?u:T:r===k&&f>=k?d=k:f>=A?d=A:r===L&&f>=L?d=L:r===S&&f>=S&&(d=S),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,m=0;m<84;m++){var O=(m+.5)/84;t.maskBreaks(a*(1-O)+O*p)!==E&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(O,e,e._definedDelta),e.rangebreaks){var P="y"===e._id.charAt(0),R=1;"auto"===e.tickmode&&(R=e.tickfont?e.tickfont.size:12);var z=NaN;for(h=O.length-1;h>-1;h--)if(O[h].drop)O.splice(h,1);else{O[h].value=Ae(O[h].value,e);var I=e.c2p(O[h].value);(P?z>I-R:zu||Fu&&(N.periodX=u),F10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=O&&i<=16||t>=S)e._tickround="M";else if(t>=D&&i<=19||t>=O)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!fe(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>g)t/=g,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>T)t/=T,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=U.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=oe(t,S,ee):i>O?e.dtick=oe(t,O,te):i>D?e.dtick=oe(t,D,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=de(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ue(p)&&fe(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":C)+d:(t.text=de(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=de(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=de(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=de(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function fe(e){return e>14||e<-15}function de(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?C+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ye(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}K&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,xe(t),n),i.autoMargin(e,be(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||K&&"bottom"===t.side||X.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ye(t);else{var l=Le(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,m=U.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,f="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var g=d.getTranslate(y.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(X)}}function Q(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ve(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*j,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},U.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=d?e.ticklen:0;if(f?m*=-1:u&&(m=0),d&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,v,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(b*=-1),g=h*b,v=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=F:x=-90===A&&"bottom"===M?j:90===A&&"top"===M?F:.5,T=F/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(b*=-1),g=p,v=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?j:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*j*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*F},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,t.tickcolor).style("stroke-width",d.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Se(t,[z]),i.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&U.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,y+1?y:m);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(g,y)}))):_.push((function(){if(x(g,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ve(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),y=f("left"),v=f("right"),_=f("bottom")||y||h||v?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=v(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=v(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":376,"./constants":341}],339:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rP&&NC&&(C=N);d/=(C-D)/(2*E),D=s.l2r(D),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(e,t,a,i)}function U(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function Y(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){E&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),E=!1)}function V(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(Y(a),2!==e||ge||qe(),ye)o.indexOf("select")>-1&&L(r,a,J,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=m?P:E,c="s"===m||"w"===g?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,Oe.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),Oe.attr("d",V(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,Oe.attr("d",V(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":287,"fast-isnumeric":33}],353:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":262}],354:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),y=e("../../components/shapes/draw_newshape/helpers").handleEllipse,g=e("../../components/shapes/draw_newshape/newshapes"),v=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),k=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,O=e("./helpers"),D=O.p2r,C=O.axValue,E=O.getTransform;function P(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,y,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){N(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=B(_))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function H(e,t,r){var n,i,o,l;for(n=0;n=0)O._fullLayout._deactivateShape(O);else if(!_){var r=R.clickmode;b.done(me).then((function(){if(b.clear(me),2===e){for(fe.remove(),$=0;$-1&&P(t,O,a.xaxes,a.yaxes,a.subplot,a,fe),"event"===r&&O.emit("plotly_selected",void 0);l.click(O,t)})).catch(v.error)}},a.doneFn=function(){he.remove(),b.done(me).then((function(){b.clear(me),a.gd.emit("plotly_selected",te),Q&&a.selectionDefs&&(Q.subtract=ue,a.selectionDefs.push(Q),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(ye)})).catch(v.error),_&&F(a)}},clearSelect:S,clearSelectionsCache:F,selectOnClick:P}},{"../../components/color":157,"../../components/dragelement/helpers":175,"../../components/drawing":179,"../../components/fx":197,"../../components/fx/helpers":193,"../../components/shapes/draw_newshape/display_outlines":245,"../../components/shapes/draw_newshape/helpers":246,"../../components/shapes/draw_newshape/newshapes":247,"../../lib":287,"../../lib/clear_gl_canvases":275,"../../lib/polygon":299,"../../lib/throttle":311,"../../plot_api/subroutines":324,"../../registry":376,"./axis_ids":338,"./constants":341,"./handle_outline":345,"./helpers":346,polybooljs:75}],355:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,g=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function O(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function D(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function E(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=P(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:P(e)}function I(e,t,r){return n.round(r+t*e,2)}function N(e,t,r){return(e-r)/t}var F=function(t){return l(t)?I(t,e._m,e._b):m},j=function(t){return N(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return I(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?I(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return N(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(S(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=O,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,n){return e.l2p(O(t,0,n))},e.p2d=e.p2r=function(e,t,r){return D(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=E,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],g=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(d){var v=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,M=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,O=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,O).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":179,"../../lib":287,"../../registry":376,"./axes":334,"@plotly/d3":20}],360:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(d.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(d,s,f,n),b.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,U=!(!s._has||!s._has("cartesian"))||B;H&&!U?n._bgLayer.remove():U&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(f){var y=(r.t+r.b)/f;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[t]={l:{val:g,size:r.l+h},r:{val:v,size:r.r+h},b:{val:_,size:r.b+h},t:{val:x,size:r.t+h}},p[t]=1}else delete d[t],delete p[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},m){var x=m[v].l||{},_=m[v].b||{},w=x.val,T=x.size,M=_.val,k=_.size;for(var A in m){if(o(T)&&m[A].r){var L=m[A].r.val,S=m[A].r.size;if(L>w){var O=(T*L+(S-r)*w)/(L-w),C=(S*(1-w)+(T-r)*(1-L))/(L-w);O+C>c+f&&(c=O,f=C)}}if(o(k)&&m[A].t){var E=m[A].t.val,P=m[A].t.size;if(E>M){var R=(k*E+(P-n)*M)/(E-M),z=(P*(1-M)+(k-n)*(1-E))/(E-M);R+z>h+d&&(h=R,d=z)}}}}}var I=u.constrain(r-i.l-i.r,2,64),N=u.constrain(n-i.t-i.b,2,64),F=Math.max(0,r-I),j=Math.max(0,n-N);if(F){var B=(c+f)/F;B>1&&(c/=B,f/=B)}if(j){var H=(h+d)/j;H>1&&(h/=H,d/=H)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,f),a=0;a0){for(var n=[],a=0;a=u&&(p.min=0,m.min=0,y.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function h(e,t,r,n){var a=f[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=t._name.charAt(0).toUpperCase(),m="Component "+h,y=o("title.text",m);t._hovertitle=y===m?y:h,i.coerceFont(o,"title.font",{family:r.font.family,size:i.bigFont(r.font.size),color:p}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear",{}),s(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(e,t,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:f,handleDefaults:p,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":157,"../../lib":287,"../../plot_api/plot_template":323,"../cartesian/line_grid_defaults":351,"../cartesian/tick_label_defaults":356,"../cartesian/tick_mark_defaults":357,"../cartesian/tick_value_defaults":358,"../subplot_defaults":370,"./layout_attributes":373}],375:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),l=o.strTranslate,s=o._,c=e("../../components/color"),u=e("../../components/drawing"),f=e("../cartesian/set_convert"),d=e("../../lib/extend").extendFlat,p=e("../plots"),h=e("../cartesian/axes"),m=e("../../components/dragelement"),y=e("../../components/fx"),g=e("../../components/dragelement/helpers"),v=g.freeMode,x=g.rectMode,b=e("../../components/titles"),_=e("../cartesian/select").prepSelect,w=e("../cartesian/select").selectOnClick,T=e("../cartesian/select").clearSelect,M=e("../cartesian/select").clearSelectionsCache,k=e("../cartesian/constants");function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var L=A.prototype;L.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},L.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*b?a=(i=b)*S:i=(a=x)/S,o=g*a/x,s=v*i/b,r=t.l+t.w*m-a/2,n=t.t+t.h*(1-y)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=_,p.xaxis={type:"linear",range:[w+2*M-_,_-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-M],domain:[y-s/2,y+s/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],A=p.aaxis=d({},e.aaxis,{range:[w,_-T-M],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(A,p.graphDiv._fullLayout),A.setScale();var L=p.baxis=d({},e.baxis,{range:[_-w-M,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(L,p.graphDiv._fullLayout),L.setScale();var O=p.caxis=d({},e.caxis,{range:[_-w-T,M],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(O,p.graphDiv._fullLayout),O.setScale();var D="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",D),p.layers.plotbg.select("path").attr("d",D);var C="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",C);var E=l(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",E),p.clipDefRelative.select("path").attr("transform",null);var P=l(r-L._offset,n+i);p.layers.baxis.attr("transform",P),p.layers.bgrid.attr("transform",P);var R=l(r+a/2,n)+"rotate(30)"+l(0,-A._offset);p.layers.aaxis.attr("transform",R),p.layers.agrid.attr("transform",R);var z=l(r+a/2,n)+"rotate(-30)"+l(0,-O._offset);p.layers.caxis.attr("transform",z),p.layers.cgrid.attr("transform",z),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",O.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,O.linecolor||"#000").style("stroke-width",(O.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},L.drawAxes=function(e){var t=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),e){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=b.draw(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(t,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=b.draw(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(t,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(t,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},L.drawAx=function(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,l=this.layers[n],s=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),e.setScale();var u=h.calcTicks(e),f=h.clipEnds(e,u),d=h.makeTransTickFn(e),p=h.getTickSigns(e)[2],m=o.deg2rad(30),y=p*(e.linewidth||1)/2,g=p*e.ticklen,v=this.w,x=this.h,b="b"===a?"M0,"+y+"l"+Math.sin(m)*g+","+Math.cos(m)*g:"M"+y+",0l"+Math.cos(m)*g+","+-Math.sin(m)*g,_={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[a];h.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),h.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),h.drawLabels(r,e,{vals:u,layer:l,transFn:d,labelFns:h.makeLabelFns(e,0,30)})};var O=k.MINZOOM/2+.87,D="m-0.87,.5h"+O+"v3h-"+(O+5.2)+"l"+(O/2+2.6)+",-"+(.87*O+4.5)+"l2.6,1.5l-"+O/2+","+.87*O+"Z",C="m0.87,.5h-"+O+"v3h"+(O+5.2)+"l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-2.6,1.5l"+O/2+","+.87*O+"Z",E="m0,1l"+O/2+","+.87*O+"l2.6,-1.5l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-"+(O/2+2.6)+","+(.87*O+4.5)+"l2.6,1.5l"+O/2+",-"+.87*O+"Z",P=!0;function R(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}L.clearSelect=function(){M(this.dragOptions),T(this.dragOptions.gd)},L.initInteractions=function(){var e,t,r,n,f,d,p,h,g,b,T,M,A=this,L=A.layers.plotbg.select("path").node(),O=A.graphDiv,z=O._fullLayout._zoomlayer;function I(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function N(e,t){var r=O._fullLayout.clickmode;R(O),2===e&&(O.emit("plotly_doubleclick",null),i.call("_guiRelayout",O,I({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,O,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&y.click(O,t,A.id)}function F(e,t){return 1-t/A.h}function j(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function B(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function H(a,i){var o=r+a*e,l=n+i*t,s=Math.max(0,Math.min(1,F(0,n),F(0,l))),c=Math.max(0,Math.min(1,j(r,n),j(o,l))),u=Math.max(0,Math.min(1,B(r,n),B(o,l))),m=(s/2+u)*A.w,y=(1-s/2-c)*A.w,v=(m+y)/2,x=y-m,_=(1-s)*A.h,w=_-x/S;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),M.transition().style("opacity",1).duration(200),b=!0),O.emit("plotly_relayouting",I(p))}function U(){R(O),p!==f&&(i.call("_guiRelayout",O,I(p)),P&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),P=!1))}function Y(e,t){var r=e/A.xaxis._m,n=t/A.yaxis._m,a=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),i=a.indexOf(p.a),s=a.indexOf(p.b),c=a.indexOf(p.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),p={a:a[i],b:a[s],c:a[c]},t=(f.a-p.a)*A.yaxis._m,e=(f.c-p.c-f.b+p.b)*A.xaxis._m);var d=l(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=l(-e,-t);A.clipDefRelative.select("path").attr("transform",h),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),O.emit("plotly_relayouting",I(p))}function q(){i.call("_guiRelayout",O,I(p))}this.dragOptions={element:L,gd:O,plotinfo:{id:A.id,domain:O._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],e=O._fullLayout._invScaleX,t=O._fullLayout._invScaleY;var m=A.dragOptions.dragmode=O._fullLayout.dragmode;v(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=H,A.dragOptions.clickFn=N,A.dragOptions.doneFn=U,function(e,t,i){var s=L.getBoundingClientRect();r=t-s.left,n=i-s.top,O._fullLayout._calcInverseTransform(O);var u=O._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,d=A.aaxis.range[1]-f.a,h=a(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),g="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,T=z.append("path").attr("class","zoombox").attr("transform",l(A.x0,A.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",g),M=z.append("path").attr("class","zoombox-corners").attr("transform",l(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(O)}(0,s,u)):"pan"===m?(A.dragOptions.moveFn=Y,A.dragOptions.clickFn=N,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearSelect(O)):(x(m)||v(m))&&_(i,s,u,A.dragOptions,m)}},L.onmousemove=function(e){y.hover(O,e,A.id),O._fullLayout._lasthover=L,O._fullLayout._hoversubplot=A.id},L.onmouseout=function(e){O._dragging||m.unhover(O,e)},m.init(this.dragOptions)}},{"../../components/color":157,"../../components/dragelement":176,"../../components/dragelement/helpers":175,"../../components/drawing":179,"../../components/fx":197,"../../components/titles":255,"../../lib":287,"../../lib/extend":281,"../../registry":376,"../cartesian/axes":334,"../cartesian/constants":341,"../cartesian/select":354,"../cartesian/set_convert":355,"../plots":369,"@plotly/d3":20,tinycolor2:121}],376:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in g(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":157,"../components/drawing":179,"../constants/xmlns_namespaces":268,"../lib":287,"@plotly/d3":20}],385:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[f+"a"],I=e[d+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var N=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,N,e),!1!==e.index&&y[e.index].p!==c){M||(O=function(e){return Math.min(k(e),e.p-v.bargroupwidth/2)},D=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var F=y[e.index],j=g.base?F.b+F.s:F.s;e[d+"0"]=e[d+"1"]=I.c2p(F[d],!0),e[d+"LabelVal"]=j;var B=v.extents[v.extents.round(F.p)];e[f+"0"]=z.c2p(x?O(F):B[0],!0),e[f+"1"]=z.c2p(x?D(F):B[1],!0);var H=void 0!==F.orig_p;return e[f+"LabelVal"]=H?F.orig_p:F.p,e.labelLabel=s(z,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=s(I,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=s(I,F.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(F)+function(e){return C(k(e),A(e),w)}(F))/2,e[f+"Spike"]=z.c2p(F.p,!0),o(F,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=f(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":157,"../../components/fx":197,"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/axes":334,"../../registry":376,"./helpers":392}],394:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":348,"../scatter/marker_colorbar":515,"./arrays_to_calcdata":385,"./attributes":386,"./calc":387,"./cross_trace_calc":389,"./defaults":390,"./event_data":391,"./hover":393,"./layout_attributes":395,"./layout_defaults":396,"./plot":397,"./select":398,"./style":400}],395:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],396:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function O(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,m=a.height,y=Math.abs(t-e),g=Math.abs(n-r),v=y>2*_&&g>2*_?_:0;y-=2*v,g-=2*v;var x=L(s);"auto"!==s||h<=y&&m<=g||!(h>y||m>g)||(h>g||m>y)&&h.01?q:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?q(e):e>t?Math.ceil(e):Math.floor(e)};F=V(F,j,z),j=V(j,F,z),B=V(B,H,!z),H=V(H,B,!z)}var G=k(i.ensureSingle(E,"path"),C,y,g);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-F)*(H-B))||U&&e._context.staticPlot?"M0,0Z":"M"+F+","+B+"V"+H+"H"+j+"V"+B+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&I){var Z=s.makePointStyleFns(f);s.singlePointStyle(c,G,f,Z,e)}!function(e,t,r,n,a,l,c,f,p,y,g){var w,T=t.xaxis,A=t.yaxis,D=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var E=n[0].trace,P="h"===E.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function m(e){return u(d,d.c2l(e),!0).text}var y=t[r],g={};g.label=y.p,g.labelLabel=g[s+"Label"]=(v=y.p,u(c,c.c2l(v),!0).text);var v;var x=i.castOption(o,y.i,"text");(0===x||x)&&(g.text=x);g.value=y.s,g.valueLabel=g[f+"Label"]=m(y.s);var _={};b(_,o,y.i),p&&(g.delta=+y.rawS||y.s,g.deltaLabel=m(g.delta),g.final=y.v,g.finalLabel=m(g.final),g.initial=g.final-g.delta,g.initialLabel=m(g.initial));h&&(g.value=y.s,g.valueLabel=m(g.value),g.percentInitial=y.begR,g.percentInitialLabel=i.formatPercent(y.begR),g.percentPrevious=y.difR,g.percentPreviousLabel=i.formatPercent(y.difR),g.percentTotal=y.sumR,g.percenTotalLabel=i.formatPercent(y.sumR));var w=i.castOption(o,y.i,"customdata");w&&(g.customdata=w);return i.texttemplateString(l,g,e._d3locale,_,g,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((g=e[t].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&m.push(f);if(l){var v=+p.rawS||p.s,x=p.v,b=x-v;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),y("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),y("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(v,o)}(D,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(E,a);var z="stack"===y.mode||"relative"===y.mode,I=n[a],N=!z||I._outmost;if(!R||"none"===w||(I.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var F=D.font,j=h.getBarColor(n[a],E),B=h.getInsideTextFont(E,a,F,j),H=h.getOutsideTextFont(E,a,F),U=r.datum();P?"log"===T.type&&U.s0<=0&&(l=T.range[0]=V*(X/G):X>=G*(W/V);V>0&&G>0&&(J||K||Q)?w="inside":(w="outside",Y.remove(),Y=null)}else w="inside";if(!Y){Z=i.ensureUniformFontSize(e,"outside"===w?H:B);var $=(Y=C(r,R,Z)).attr("transform");if(Y.attr("transform",""),q=s.bBox(Y.node()),V=q.width,G=q.height,Y.attr("transform",$),V<=0||G<=0)return void Y.remove()}var ee,te,re=E.textangle;"outside"===w?(te="both"===E.constraintext||"outside"===E.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var m=L(c),y=S(a,m),g=(l?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re})):(te="both"===E.constraintext||"inside"===E.constraintext,ee=O(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re,anchor:E.insidetextanchor}));ee.fontSize=Z.size,d(E.type,ee,D),I.transform=ee,k(Y,D,y,g).attr("transform",i.getTextTransform(ee))}(e,t,E,r,p,F,j,B,H,y,g),t.layerClipId&&s.hideOutsideRangePoint(c,E.select("text"),w,D,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,E,t,y)},toMoveInsideBar:O}},{"../../components/color":157,"../../components/drawing":179,"../../components/fx/helpers":193,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../registry":376,"./attributes":386,"./constants":388,"./helpers":392,"./style":400,"./uniform_text":402,"@plotly/d3":20,"fast-isnumeric":33}],398:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":157,"../../components/drawing":179,"../../lib":287,"../../registry":376,"./attributes":386,"./helpers":392,"./uniform_text":402,"@plotly/d3":20}],401:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":157,"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"../../lib":287}],402:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=oS.uf};if(t._hasPreCompStats){var H=t[x],U=function(e){return v.d2c((t[e]||[])[r])},Y=1/0,q=-1/0;for(r=0;r=S.q1&&S.q3>=S.med){var G=U("lowerfence");S.lf=G!==l&&G<=S.q1?G:p(S,D,C);var Z=U("upperfence");S.uf=Z!==l&&Z>=S.q3?Z:h(S,D,C);var W=U("mean");S.mean=W!==l?W:C?o.mean(D,C):(S.q1+S.q3)/2;var X=U("sd");S.sd=W!==l&&X>=0?X:C?o.stdev(D,C,S.mean):S.q3-S.q1,S.lo=m(S),S.uo=y(S);var J=U("notchspan");J=J!==l&&J>0?J:g(S,C),S.ln=S.med-J,S.un=S.med+J;var K=S.lf,Q=S.uf;t.boxpoints&&D.length&&(K=Math.min(K,D[0]),Q=Math.max(Q,D[C-1])),t.notched&&(K=Math.min(K,S.ln),Q=Math.max(Q,S.un)),S.min=K,S.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+S.q1,"median = "+S.med,"q3 = "+S.q3].join("\n")),$=S.med!==l?S.med:S.q1!==l?S.q3!==l?(S.q1+S.q3)/2:S.q1:S.q3!==l?S.q3:0,S.med=$,S.q1=S.q3=$,S.lf=S.uf=$,S.mean=S.sd=$,S.ln=S.un=$,S.min=S.max=$}Y=Math.min(Y,S.min),q=Math.max(q,S.max),S.pts2=O.filter(B),A.push(S)}}t._extremes[v._id]=a.findExtremes(v,[Y,q],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a=0&&ae0){var ue,fe;if((S={}).pos=S[_]=F[r],O=S.pts=ne[r].sort(f),C=(D=S[x]=O.map(d)).length,S.min=D[0],S.max=D[C-1],S.mean=o.mean(D,C),S.sd=o.stdev(D,C,S.mean),S.med=o.interp(D,.5),C%2&&(se||ce))se?(ue=D.slice(0,C/2),fe=D.slice(C/2+1)):ce&&(ue=D.slice(0,C/2+1),fe=D.slice(C/2)),S.q1=o.interp(ue,.5),S.q3=o.interp(fe,.5);else S.q1=o.interp(D,.25),S.q3=o.interp(D,.75);S.lf=p(S,D,C),S.uf=h(S,D,C),S.lo=m(S),S.uo=y(S);var de=g(S,C);S.ln=S.med-de,S.un=S.med+de,ie=Math.min(ie,S.ln),oe=Math.max(oe,S.un),S.pts2=O.filter(B),A.push(S)}t._extremes[v._id]=a.findExtremes(v,t.notched?ee.concat([ie,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(A[0].t={num:T[L],dPos:j,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean?s(e,"mean \xb1 \u03c3:"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},T[L]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(e,t,r){for(var n in c)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[c[n]]=t[n][r[0]][r[1]]):e[c[n]]=t[n][r])}function f(e,t){return e.v-t.v}function d(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function m(e){return 4*e.q1-3*e.q3}function y(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"fast-isnumeric":33}],405:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],m=0;for(l=0;l1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var q=S.pointpos,V=S.jitter,G=S.marker.size/2,Z=0;q+V>=0&&((Z=U*(q+V))>A?(Y=!0,B=G,F=Z):Z>I&&(B=G,F=A)),Z<=A&&(F=A);var W=0;q-V<=0&&((W=-U*(q-V))>L?(Y=!0,H=G,j=W):W>N&&(H=G,j=L)),W<=L&&(j=L)}else F=A,j=L;var X=new Array(c.length);for(s=0;s0?(y="v",g=x>0?Math.min(_,b):Math.min(b)):x>0?(y="h",g=Math.min(_)):g=0;if(g){t._length=g;var L=r("orientation",y);t._hasPreCompStats?"v"===L&&0===x?(r("x0",0),r("dx",1)):"h"===L&&0===v&&(r("y0",0),r("dy",1)):"v"===L&&0===x?r("x0"):"h"===L&&0===v&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function f(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,c,"marker.outliercolor"),l=r("marker.line.outliercolor"),s="outliers";t._hasPreCompStats?s="all":(o||l)&&(s="suspectedoutliers");var u=r(i+"points",s);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function l(r,a){return n.coerce(e,t,c,r,a)}if(u(e,t,l,a),!1!==t.visible){o(e,t,a,l),l("xhoverformat"),l("yhoverformat");var s=t._hasPreCompStats;s&&(l("lowerfence"),l("upperfence")),l("line.color",(e.marker||{}).color||r),l("line.width"),l("fillcolor",i.addOpacity(t.line.color,.5));var d=!1;if(s){var p=l("mean"),h=l("sd");p&&p.length&&(d=!0,h&&h.length&&(d="sd"))}l("boxmean",d),l("whiskerwidth"),l("width"),l("quartilemethod");var m=!1;if(s){var y=l("notchspan");y&&y.length&&(m=!0)}else n.validate(e.notchwidth,c.notchwidth)&&(m=!0);l("notched",m)&&l("notchwidth"),f(e,t,l,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,c,e)}for(var o=0;oe.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,f=i.bPos,d=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=c.c2l(e.pos+f,!0),a=c.l2p(t-o)+d,i=c.l2p(t+l)+d,h=u?(a+i)/2:c.l2p(t)+d,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),g=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+g+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":179,"../../lib":287,"@plotly/d3":20}],413:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,l=[];if(!1===t)for(r=0;ro.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var l=n.x.length,s=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],418:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,l=t.line,s=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:l.color,width:!1!==o.showlines?l.width:0,dash:l.dash},r._levels={start:o.start,end:i(o),size:s}}}},{"../../components/colorscale":169,"./end_plus":426,"./make_color_map":431}],419:[function(e,t,r){"use strict";t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],420:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,l=i.opacity,s=e("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,r,i,s,f){var d,p,h,m=t.contours,y=r("contours.operation");(m._operation=c[y],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,m),"="===y?d=m.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(t.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":157,"../../constants/filter_ops":265,"./label_defaults":430,"fast-isnumeric":33}],421:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function l(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":265,"fast-isnumeric":33}],422:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],423:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,l=function(e){return e.reverse()},s=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return s}},{"../../lib":287,"./constraint_mapping":421,"./end_plus":426}],426:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],427:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1;return[n,i]}(f,r,t),p=[l(e,t,[-d[0],-d[1]])],h=e.z.length,m=e.z[0].length,y=t.slice(),g=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}p.push(l(e,t,d)),t[0]+=d[0],t[1]+=d[1],u=t.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var v=d[0]&&(t[0]<0||t[0]>m-2)||d[1]&&(t[1]<0||t[1]>h-2);if(t[0]===y[0]&&t[1]===y[1]&&d[0]===g[0]&&d[1]===g[1]||r&&v)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,M,k,A,L,S,O,D,C,E,P,R=i(p[0],p[p.length-1],o,s),z=0,I=.2*e.smoothing,N=[],F=0;for(c=1;c=F;c--)if((x=N[c])=F&&x+N[b]A&&L--,e.edgepaths[L]=O.concat(p,S));break}U||(e.edgepaths[A]=p.concat(S))}for(A=0;Ae?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,l,s,c,u,f,d=e[0].z,p=d.length,h=d[0].length,m=2===p||2===h;for(r=0;r=0&&(n=v,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,l>=0)break;f+="L"+n}if(l===e.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.center?n.right-l:l-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(f)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var h=g.EDGECOST*(1/(d-1)+1/(p-1));h+=g.ANGLECOST*c*c;for(var m=l-u,y=s-f,v=l+u,x=s+f,b=0;b2*g.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=g.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),l=e.x,s=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),d=function(e,t){return[l+e*f-t*u,s+e*u+t*f]},p=[d(-i/2,-o/2),d(-i/2,o/2),d(i/2,o/2),d(i/2,-o/2)];r.push({text:t.text,x:l,y:s,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(p)},r.drawLabels=function(e,t,r,i,o){var s=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=e._input.contours;if(u>f&&(r.start=d.start=f,f=r.end=d.end=u,u=r.start),!(r.size>0))c=u===f?1:i(u,f,e.ncontours).dtick,d.size=r.size=c}}},{"../../lib":287,"../../plots/cartesian/axes":334}],435:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,i=r.contours,l=r.line,s=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,d=!u&&"fill"===i.coloring,p=f||d?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(e.level):l.color,l.dash)}));var h=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):l.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),p(e.level+.5*s)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",p(m-.5*s))}})),i(e)}},{"../../components/drawing":179,"../heatmap/style":449,"./make_color_map":431,"@plotly/d3":20}],436:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,r,i,o){var l,s=r("contours.coloring"),c="";"fill"===s&&(l=r("contours.showlines")),!1!==l&&("lines"!==s&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==s&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":167,"./label_defaults":430}],437:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../components/colorscale/attributes"),s=e("../../lib/extend").extendFlat;t.exports=s({z:{valType:"data_array",editType:"calc"},x:s({},n.x,{impliedEdits:{xtype:"array"}}),x0:s({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:s({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:s({},n.y,{impliedEdits:{ytype:"array"}}),y0:s({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:s({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:s({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:s({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:s({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:s({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:s({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:s({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z",1),hovertemplate:o(),showlegend:s({},a.showlegend,{dflt:!1})},{transforms:void 0},l("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":371,"../scatter/attributes":497}],438:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../histogram2d/calc"),s=e("../../components/colorscale/calc"),c=e("./convert_column_xyz"),u=e("./clean_2d_array"),f=e("./interp2d"),d=e("./find_empties"),p=e("./make_bound_array"),h=e("../../constants/numerical").BADNUM;function m(e){for(var t=[],r=e.length,n=0;nz){P("x scale is not linear");break}}if(x.length&&"fast"===C){var I=(x[x.length-1]-x[0])/(x.length-1),N=Math.abs(I/100);for(M=0;MN){P("y scale is not linear");break}}}var F=a.maxRowLength(T),j="scaled"===t.xtype?"":r,B=p(t,j,y,g,F,A),H="scaled"===t.ytype?"":x,U=p(t,H,b,_,T.length,L);D||(t._extremes[A._id]=i.findExtremes(A,B),t._extremes[L._id]=i.findExtremes(L,U));var Y={x:B,y:U,z:T,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(Y.orig_x=v),t.yperiodalignment&&w&&(Y.orig_y=w),j&&j.length===B.length-1&&(Y.xCenter=j),H&&H.length===U.length-1&&(Y.yCenter=H),O&&(Y.xRanges=k.xRanges,Y.yRanges=k.yRanges,Y.pts=k.pts),S||s(e,t,{vals:T,cLetter:"z"}),S&&t.contours&&"heatmap"===t.contours.coloring){var q={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};Y.xfill=p(q,j,y,g,F,A),Y.yfill=p(q,H,b,_,T.length,L)}return[Y]}},{"../../components/colorscale/calc":165,"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"../../registry":376,"../histogram2d/calc":466,"./clean_2d_array":439,"./convert_column_xyz":441,"./find_empties":443,"./interp2d":446,"./make_bound_array":447}],439:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var l,s,c,u,f,d;function p(e){if(n(e))return+e}if(t&&t.transpose){for(l=0,f=0;f=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||m)[2]+(f[[r+1,a]]||m)[2]+(f[[r,a-1]]||m)[2]+(f[[r,a+1]]||m)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort((function(e,t){return t[2]-e[2]}))}},{"../../lib":287}],444:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,l,s){s||(s={});var c,u,f,d,p=s.isContour,h=e.cd[0],m=h.trace,y=e.xa,g=e.ya,v=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,M=m.zhoverformat,k=v,A=x;if(!1!==e.index){try{f=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||d<0||d>b.length)return}else{if(n.inbox(t-v[0],t-v[v.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var L;for(k=[2*v[0]-v[1]],L=1;Lm&&(g=Math.max(g,Math.abs(e[i][o]-h)/(y-m))))}return g}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":287}],447:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,l){var s,c,u,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!p&&"category"!==l.type){var m=t.length;if(!(m<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u0;)d=p.c2p(T[v]),v--;for(d0;)g=h.c2p(M[v]),v--;if(g0&&(i=!0);for(var s=0;si){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],m=r[1],y=Math.min(f(h+d,h+p,n,i),f(m+d,m+p,n,i)),g=Math.min(f(h+c,h+d,n,i),f(m+c,m+d,n,i));if(y>g&&go){var v=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",v);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(F)&&(B=o.tickIncrement(B,b.size,!0,p)),R.start=r.l2r(B),N||a.nestedProperty(t,g+".start").set(R.start)}var H=b.end,U=r.r2l(P.end),Y=void 0!==U;if((b.endFound||Y)&&U!==r.r2l(H)){var q=Y?U:a.aggNums(Math.max,null,h);R.end=r.l2r(q),Y||a.nestedProperty(t,g+".start").set(R.end)}var V="autobin"+l;return!1===t._input[V]&&(t._input[g]=a.extendFlat({},t[g]||{}),delete t._input[V],delete t[V]),[R,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],g=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),v="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[v],b=t[v+"calendar"],_=t.cumulative,w=d(e,t,g,v),T=w[0],M=w[1],k="string"==typeof T.size,A=[],L=k?A:T,S=[],O=[],D=[],C=0,E=t.histnorm,P=t.histfunc,R=-1!==E.indexOf("density");_.enabled&&R&&(E=E.replace(/ ?density$/,""),R=!1);var z,I="max"===P||"min"===P?null:0,N=s.count,F=c[E],j=!1,B=function(e){return g.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==P&&(z=t[x],j="avg"===P,N=s[P]),r=B(T.start),p=B(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,_.direction,_.currentbin);var J=Math.min(m.length,y.length),K=[],Q=0,$=J-1;for(r=0;r=Q;r--)if(y[r]){$=r;break}for(r=Q;r<=$;r++)if(n(m[r])&&n(y[r])){var ee={p:m[r],s:y[r],b:0};_.enabled||(ee.pts=D[r],V?ee.ph0=ee.ph1=D[r].length?M[D[r][0]]:m[r]:(t._computePh=!0,ee.ph0=Y(A[r]),ee.ph1=Y(A[r+1],!0))),K.push(ee)}return 1===K.length&&(K[0].width1=o.tickIncrement(K[0].p,T.size,!1,b)-K[0].p),l(K,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(K,t,W),K},calcAllAutoBins:d}},{"../../lib":287,"../../plots/cartesian/axes":334,"../../registry":376,"../bar/arrays_to_calcdata":385,"./average":453,"./bin_functions":455,"./bin_label_vals":456,"./norm_functions":464,"fast-isnumeric":33}],458:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],459:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,m,y,g=t._histogramBinOpts={},v=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=g[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;hL&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],O=[],D=[],C="string"==typeof w.size,E="string"==typeof k.size,P=[],R=[],z=C?P:w,I=E?R:k,N=0,F=[],j=[],B=t.histnorm,H=t.histfunc,U=-1!==B.indexOf("density"),Y="max"===H||"min"===H?null:0,q=i.count,V=o[B],G=!1,Z=[],W=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==H&&(G="avg"===H,q=i[H]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-a.tickIncrement(K,J,!1,g))/1e6;for(r=K;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u,f=Math.floor((t-o.x0)/l.dx),d=Math.floor(Math.abs(r-o.y0)/l.dy);if(l._hasZ?u=o.z[d][f]:l._hasSource&&(u=l._canvas.el.getContext("2d").getImageData(f,d,1,1).data),u){var p,h=o.hi||l.hoverinfo;if(h){var m=h.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var y,g=i.colormodel[l.colormodel],v=g.colormodel||l.colormodel,x=v.length,b=l._scaler(u),_=g.suffix,w=[];(l.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),e.extraText=v.toUpperCase()+": "+w),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[d])?y=l.hovertext[d][f]:Array.isArray(l.text)&&Array.isArray(l.text[d])&&(y=l.text[d][f]);var T=c.c2p(o.y0+(d+.5)*l.dy),M=o.x0+(f+.5)*l.dx,k=o.y0+(d+.5)*l.dy,A="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{index:[d,f],x0:s.c2p(o.x0+f*l.dx),x1:s.c2p(o.x0+(f+1)*l.dx),y0:T,y1:T,color:b,xVal:M,xLabelVal:M,yVal:k,yLabelVal:k,zLabelVal:A,text:y,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":197,"../../lib":287,"./constants":476}],481:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":348,"./attributes":474,"./calc":475,"./defaults":477,"./event_data":478,"./hover":480,"./plot":482,"./style":483}],482:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.strTranslate,o=e("../../constants/xmlns_namespaces"),l=e("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();t.exports=function(e,t,r,c){var u=t.xaxis,f=t.yaxis,d=!(s||e._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),s=t[0],c=s.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&d)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var h,m,y,g,v,x,b=s.z,_=s.x0,w=s.y0,T=s.w,M=s.h,k=c.dx,A=c.dy;for(x=0;void 0===h&&x0;)m=u.c2p(_+x*k),x--;for(x=0;void 0===g&&x0;)v=f.c2p(w+x*A),x--;if(mE[0];if(P||R){var z=h+L/2,I=g+S/2;D+="transform:"+i(z+"px",I+"px")+"scale("+(P?-1:1)+","+(R?-1:1)+")"+i(-z+"px",-I+"px")+";"}}O.attr("style",D);var N=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=M;var r=t.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e;if(c._hasZ)e=F((function(e,t){return b[t][e]})).toDataURL("image/png");else if(c._hasSource)if(p)e=c.source;else{var t=c._canvas.el.getContext("2d").getImageData(0,0,T,M).data;e=F((function(e,r){var n=4*(r*T+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}O.attr({"xlink:href":e,height:S,width:L,x:h,y:g})}));e._promises.push(N)}function F(e){var t=document.createElement("canvas");t.width=L,t.height=S;var r,n=t.getContext("2d"),i=function(e){return a.constrain(Math.round(u.c2p(_+e*k)-h),0,L)},o=function(e){return a.constrain(Math.round(f.c2p(w+e*A)-g),0,S)},d=l.colormodel[c.colormodel],p=d.colormodel||c.colormodel,m=d.fmt;for(x=0;x0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":287,"../../plots/domain":362,"../bar/defaults":390,"./attributes":484,"fast-isnumeric":33}],488:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":193}],489:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(f||p){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(l||h||f){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||d)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function O(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function D(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=E(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function E(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function I(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),P(t,i);var d=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var d=n.select(this),h=t[0],m=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),d.attr("stroke-linejoin","round"),d.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],_=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),d=u.selectAll("path.surface").data([a]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),m.pull){var g=+y.castOption(m.pull,a.pts)||0;g>0&&(o+=g*a.pxmid[0],c+=g*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===h.vTotal){var M="M"+(o+a.px0[0])+","+(c+a.px0[1])+D(a.px0,a.pxmid,!0,1)+D(a.pxmid,a.px0,!0,1)+"Z";T?d.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+D(a.px0,a.pxmid,!1,T)+D(a.pxmid,a.px0,!1,T)+"Z"+M):d.attr("d",M)}else{var k=D(a.px0,a.px1,!0,1);if(T){var A=1-T;d.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+D(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+k+"Z")}else d.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+k+"Z")}z(e,a,h);var L=y.castOption(m.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):b(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var g,v=l.bBox(u.node());if("outside"===L)g=O(v,a);else if(g=w(v,a,h),"auto"===L&&g.scale<1){var x=s.ensureUniformFontSize(e,m.outsidetextfont);u.call(l.font,x),g=O(v=l.bBox(u.node()),a)}var T=g.textPosAngle,M=void 0===T?a.pxmid:R(h.r,T);if(g.targetX=o+M[0]*g.rCenter+(g.x||0),g.targetY=c+M[1]*g.rCenter+(g.y||0),I(g,v),g.outside){var k=g.targetY;a.yLabelMin=k-v.height/2,a.yLabelMid=k,a.yLabelMax=k+v.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}g.fontSize=d.size,p(m.type,g,r),t[i].transform=g,u.attr("transform",s.getTextTransform(g))}))}function D(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=s.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,m.title.font).call(f.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):D(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),v=p-h;if(v*s>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=v):(m+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,m),_&&m.automargin){var M=l.bBox(d.node()),k=m.domain,A=i.w*(k.x[1]-k.x[0]),L=i.h*(k.y[1]-k.y[0]),S=(.5*A-h.r)/i.w,C=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(h.cx-h.r-M.left,0),r:Math.max(M.right-(h.cx+h.r),0),b:Math.max(M.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-M.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:D,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:I}},{"../../components/color":157,"../../components/drawing":179,"../../components/fx":197,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/plots":369,"../bar/constants":388,"../bar/uniform_text":402,"./event_data":488,"./helpers":489,"@plotly/d3":20}],494:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":402,"./style_one":495,"@plotly/d3":20}],495:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":157,"./helpers":489}],496:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&D[g].gap;)g--;for(x=D[g].s,m=D.length-1;m>g;m--)D[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],504:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,y){function g(r,a){return n.coerce(e,t,i,r,a)}var v=s(e,t,y,g);if(v||(t.visible=!1),t.visible){c(e,t,y,g),g("xhoverformat"),g("yhoverformat");var x=u(e,t,y,g),b=!x&&v=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=R[E][1])>=Z&&(I=R[E-1][0],N=R[E][0],j-F&&(z=I+(N-I)*(Z-F)/(j-F),Y=Math.min(Y,z),q=Math.max(q,z)));Y=Math.max(Y,0),q=Math.min(q,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:Y,x1:q,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":157,"../../components/fx":197,"../../lib":287,"../../registry":376,"./get_trace_color":507}],509:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":348,"./arrays_to_calcdata":496,"./attributes":497,"./calc":498,"./cross_trace_calc":502,"./cross_trace_defaults":503,"./defaults":504,"./format_labels":506,"./hover":508,"./marker_colorbar":515,"./plot":518,"./select":519,"./style":521,"./subtypes":522}],510:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"../../lib":287}],511:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,m,y,g,v,x,b,_,w,T,M,k,A,L=t.xaxis,S=t.yaxis,O="log"===L.type,D="log"===S.type,C=L._length,E=S._length,P=t.connectGaps,R=t.baseTolerance,z=t.shape,I="linear"===z,N=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),U=0;function Y(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(O&&(i=L.c2p(n.x,!0)),i===a)return!1;D&&s===a&&(i*=Math.abs(L._m*E*(L._m>0?o:l)/(S._m*C*(S._m>0?o:l)))),i*=1e3}if(s===a){if(D&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function q(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[U-1][0],a=r===H[U-1][1];if(!n||!a)if(U>1){var i=t===H[U-2][0],o=r===H[U-2][1];n&&(t===te||t===re)&&i?o?U--:H[U-1]=e:a&&(r===ne||r===ae)&&o?i?U--:H[U-1]=e:H[U++]=e}else H[U++]=e}function ue(e){H[U-1][0]!==e[0]&&H[U-1][1]!==e[1]&&ce([X,J]),ce(e),K=null,X=J=0}function fe(e){if(k=e[0]/C,A=e[1]/E,Z=e[0]re?re:0,W=e[1]ae?ae:0,Z||W){if(U)if(K){var t=$(K,e);t.length>1&&(ue(t[0]),H[U++]=t[1])}else Q=$(H[U-1],e)[0],H[U++]=Q;else H[U++]=[Z||e[0],W||e[1]];var r=H[U-1];Z&&W&&(r[0]!==Z||r[1]!==W)?(K&&(X!==Z&&J!==W?ce(X&&J?(n=K,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[X||Z,J||W]):X&&J&&ce([X,J])),ce([Z,W])):X-Z&&J-W&&ce([Z||X,W||J]),K=e,X=Z,J=W}else K&&ue($(K,e)[0]),H[U++]=e;var n,a,i,o}for("linear"===z||"spline"===z?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,e)V(h,de))break;i=h,(_=g[0]*y[0]+g[1]*y[1])>x?(x=_,d=h,m=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}K&&ce([X||K[0],J||K[1]]),F.push(H.slice(0,U))}return F}},{"../../constants/numerical":267,"../../lib":287,"./constants":501}],512:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],513:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":33}],515:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],516:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":157,"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"./subtypes":522}],517:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":267,"../../lib":287}],518:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,O;v(T).style("opacity",_.opacity);var D=_.fill.charAt(_.fill.length-1);"x"!==D&&"y"!==D&&(D=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,E,P="",R=[],z=_._prevtrace;z&&(P=z._prevRevpath||"",O=z._nextFill,R=z._polygons);var I,N,F,j,B,H,U,Y="",q="",V=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(O&&O.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):I=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},V=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(V.length),y=0;y1){var r=n.select(this);if(r.datum(f),e)v(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),s.singleLineStyle(f,a)}}}}}var Z=k.selectAll(".js-line").data(V);v(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),V.length?(S?(S.datum(f),j&&H&&(D?("y"===D?j[1]=H[1]=b.c2p(0,!0):"x"===D&&(j[0]=H[0]=x.c2p(0,!0)),v(S).attr("d","M"+H+"L"+j+"L"+Y.substr(1)).call(s.singleFillStyle)):v(S).attr("d",Y+"Z").call(s.singleFillStyle))):O&&("tonext"===_.fill.substr(0,6)&&Y&&P?("tonext"===_.fill?v(O).attr("d",Y+"Z"+P+"Z").call(s.singleFillStyle):v(O).attr("d",Y+"L"+P.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(X(O),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?X(S):O&&X(O),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,m=te;if(f||d){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?K:J:_&&!w&&(y=Q),f&&(h=y),d&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function X(e){v(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,m=!!i&&i.duration>0,y=f(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":179,"../../lib":287,"../../lib/polygon":299,"../../registry":376,"./line_points":511,"./link_traces":513,"./subtypes":522,"@plotly/d3":20}],519:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(e,t){g.push(e._hovertitle+": "+t)}}},{"../scatter/hover":508}],531:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":372,"../scatter/marker_colorbar":515,"../scatter/select":519,"../scatter/style":521,"./attributes":525,"./calc":526,"./defaults":527,"./event_data":528,"./format_labels":529,"./hover":530,"./plot":532}],532:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},o=t.layers.frontplot.select("g.scatterlayer");n(e,i,r,o)}},{"../scatter/plot":518}],533:[function(e,t,r){"use strict";var n=e("../box/attributes"),a=e("../../lib/extend").extendFlat,i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat;t.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../box/attributes":403}],534:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../box/calc"),o=e("./helpers"),l=e("../../constants/numerical").BADNUM;function s(e,t,r){var a=t.max-t.min;if(!a)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(i,o,t.q3-t.q1),a/100)}function c(e,t,r,n){var i,o=e.spanmode,s=e.span||[],c=[t.min,t.max],u=[t.min-2*n,t.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,e[t.valLetter+"calendar"]);return i===l?u[n]:i}var d={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(d),d.cleanRange(),i}t.exports=function(e,t){var r=i(e,t);if(r[0].t.empty)return r;for(var l=e._fullLayout,u=a.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,m=0;m0){var x,b,_,w,T,M=e.xa,k=e.ya;"h"===p.orientation?(T=t,x="y",_=k,b="x",w=M):(T=r,x="x",_=M,b="y",w=k);var A=d[e.index];if(T>=A.span[0]&&T<=A.span[1]){var L=n.extendFlat({},e),S=w.c2p(T,!0),O=o.getKdeValue(A,p,T),D=o.getPositionOnKdePath(A,p,S),C=_._offset,E=_._length;L[x+"0"]=D[0],L[x+"1"]=D[1],L[b+"0"]=L[b+"1"]=S,L[b+"Label"]=b+": "+a.hoverLabelText(w,T,p[b+"hoverformat"])+", "+d[0].t.labels.kde+" "+O.toFixed(3),L.spikeDistance=v[0].spikeDistance;var P=x+"Spike";L[P]=v[0][P],v[0].spikeDistance=void 0,v[0][P]=void 0,L.hovertemplate=!1,g.push(L),(u={stroke:e.color})[x+"1"]=n.constrain(C+D[0],C,C+E),u[x+"2"]=n.constrain(C+D[1],C,C+E),u[b+"1"]=u[b+"2"]=w._offset+S}}m&&(g=g.concat(v))}-1!==h.indexOf("points")&&(c=i.hoverOnPoints(e,t,r));var R=f.selectAll(".violinline-"+p.uid).data(u?[0]:[]);return R.enter().append("line").classed("violinline-"+p.uid,!0).attr("stroke-width",1.5),R.exit().remove(),R.attr(u),"closest"===l?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":287,"../../plots/cartesian/axes":334,"../box/hover":408,"./helpers":537}],539:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../box/select"),moduleType:"trace",name:"violin",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":348,"../box/defaults":406,"../box/select":413,"../scatter/style":521,"./attributes":533,"./calc":534,"./cross_trace_calc":535,"./defaults":536,"./hover":538,"./layout_attributes":540,"./layout_defaults":541,"./plot":542,"./style":543}],540:[function(e,t,r){"use strict";var n=e("../box/layout_attributes"),a=e("../../lib").extendFlat;t.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":287,"../box/layout_attributes":410}],541:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../box/layout_defaults");t.exports=function(e,t,r){i._supply(e,t,r,(function(r,i){return n.coerce(e,t,a,r,i)}),"violin")}},{"../../lib":287,"../box/layout_defaults":411,"./layout_attributes":540}],542:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../box/plot"),l=e("../scatter/line_points"),s=e("./helpers");t.exports=function(e,t,r,c){var u=e._fullLayout,f=t.xaxis,d=t.yaxis;function p(e){var t=l(e,{xaxis:f,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(t[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(e){var r=n.select(this),i=e[0],l=i.t,c=i.trace;if(!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,m=l.bdPos,y=t[l.valLetter+"axis"],g=t[l.posLetter+"axis"],v="both"===c.side,x=v||"positive"===c.side,b=v||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(e){var t,r,a,i,o,s,f,d,_=n.select(this),w=e.density,T=w.length,M=g.c2l(e.pos+h,!0),k=g.l2p(M);if(c.width)t=l.maxKDE/m;else{var A=u._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?A.maxKDE/m*(A.maxCount/e.pts.length):A.maxKDE/m}if(x){for(f=new Array(T),o=0;oa&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],78:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(d)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(d,h);if(e)return e}return!!m&&u(d,m)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(v.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)g=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:g,below:g};r&&r.status(d.seg,!!h&&h.seg,!!m&&m.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));case 5:case 10:case 11:case 12:case 7:default:return null}},i.prototype.scan_ifd=function(e,t,r){var i=this.read_uint16(t);t+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var h=[],m=d,y=0;y0&&(this.ifds_to_read.push({id:l,offset:h[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:e,tag:l,format:s,count:c,entry_offset:t+this.start,data_length:f,data_offset:d+this.start,value:h,is_subifd_link:p}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(e){return-1}}},{}],85:[function(e,t,r){"use strict";var n=e("./common").readUInt16BE,a=e("./common").readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=a(e,t);return e.length>4&15,a=15&e[4],i=e[5]>>4&15,o=n(e,6),s=8,c=0;ct.width||e.width===t.width&&e.height>t.height?e:t})),a=r.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),l=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(l=0===e.value?r[l]:t[l=t[l=r[l]]]),"irot"===e.type)for(var n=0;n1&&(d.variants=f.variants),f.orientation&&(d.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var p=i(e,f.exif_location.offset),h=e.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=l.get_orientation(h);m>0&&(d.orientation=m)}return d}}}}}}},{"../common":83,"../exif_utils":84,"../miaf_utils":85}],87:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("BM");t.exports=function(e){if(!(e.length<26)&&a(e,0,o))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":83}],88:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("GIF87a"),l=n("GIF89a");t.exports=function(e){if(!(e.length<10)&&(a(e,0,o)||a(e,0,l)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":83}],89:[function(e,t,r){"use strict";var n=e("../common").readUInt16LE;t.exports=function(e){var t=n(e,0),r=n(e,2),a=n(e,4);if(0===t&&1===r&&a){for(var i=[],o={width:0,height:0},l=0;lo.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":83}],90:[function(e,t,r){"use strict";var n=e("../common").readUInt16BE,a=e("../common").str2arr,i=e("../common").sliceEq,o=e("../exif_utils"),l=a("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1])for(var t=2;;){if(e.length-t<2)return;if(255!==e[t++])return;for(var r,a,s=e[t++];255===s;)s=e[t++];if(208<=s&&s<=217||1===s)r=0;else{if(!(192<=s&&s<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===s||218===s)return;if(225===s&&r>=10&&i(e,t,l)&&(a=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(e.length-t0&&(c.orientation=a),c}t+=r}}},{"../common":83,"../exif_utils":84}],91:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),l=n("IHDR");t.exports=function(e){if(!(e.length<24)&&a(e,0,o)&&a(e,12,l))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":83}],92:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&a(e,0,o))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":83}],93:[function(e,t,r){"use strict";function n(e){return"number"==typeof e&&isFinite(e)&&e>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,l=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return c.test(e)?e.match(c)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function d(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||u(e,t+8):"VP8L"===p&&h>=9?r=r||f(e,t+8):"VP8X"===p&&h>=10?r=r||d(e,t+8):"EXIF"===p&&(n=l.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":83,"../exif_utils":84}],96:[function(e,t,r){"use strict";t.exports={avif:e("./parse_sync/avif"),bmp:e("./parse_sync/bmp"),gif:e("./parse_sync/gif"),ico:e("./parse_sync/ico"),jpeg:e("./parse_sync/jpeg"),png:e("./parse_sync/png"),psd:e("./parse_sync/psd"),svg:e("./parse_sync/svg"),tiff:e("./parse_sync/tiff"),webp:e("./parse_sync/webp")}},{"./parse_sync/avif":86,"./parse_sync/bmp":87,"./parse_sync/gif":88,"./parse_sync/ico":89,"./parse_sync/jpeg":90,"./parse_sync/png":91,"./parse_sync/psd":92,"./parse_sync/svg":93,"./parse_sync/tiff":94,"./parse_sync/webp":95}],97:[function(e,t,r){"use strict";var n=e("./lib/parsers_sync");t.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o,l;if("string"==typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";l='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(i(t,"type"))}return l+=". Received type ".concat(typeof r)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],102:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var a=e("./_stream_readable"),i=e("./_stream_writable");e("inherits")(c,a);for(var o=n(i.prototype),l=0;l0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)o.endEmitted?w(e,new _):L(e,o,t,!0);else if(o.ended)w(e,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?L(e,o,t,!1):C(e,o)):L(e,o,t,!1)}else n||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(D,e))}function D(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,I(e)}function C(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(E,e,t))}function E(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){c("readable nexttick read 0"),e.read(0)}function z(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(j,t,e))}function j(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,a=t.needReadable;return c("need readable",a),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){w(this,new b("_read()"))},k.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:y;function l(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",l),n.removeListener("end",s),n.removeListener("end",y),n.removeListener("data",d),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function s(){c("onend"),e.end()}a.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",l);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,I(e))}}(n);e.on("drain",u);var f=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==B(a.pipes,e))&&!f&&(c("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",m),y()}function m(){c("onfinish"),e.removeListener("close",h),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",m),e.emit("pipe",n),a.flowing||(c("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,c("on readable",a.length,a.reading),a.length?O(this):a.reading||r.nextTick(R,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(P,this),n},k.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(P,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(z,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){(c("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var a=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,a,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":101,"./_stream_duplex":102,"./internal/streams/destroy":109,"./internal/streams/state":113,"./internal/streams/stream":114,_process:98,buffer:28,inherits:67,"util-deprecate":122}],107:[function(e,t,r){(function(r){(function(){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=e("./end-of-stream"),o=Symbol("lastResolve"),l=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[u]=null,e[o]=null,e[l]=null,t(p(r,!1)))}}function m(e){r.nextTick(h,e)}var y=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a(n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[s]?n(e[s]):t(p(void 0,!0))}))}));var n,a=this[u];if(a)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(a,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),y);t.exports=function(e){var t,r=Object.create(g,(a(t={},d,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,f,{value:function(e,t){var n=r[d].read();n?(r[u]=null,r[o]=null,r[l]=null,e(p(n,!1))):(r[o]=e,r[l]=t)},writable:!0}),t));return r[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[o]=null,r[l]=null,t(e)),void(r[s]=e)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":110,_process:98}],108:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,l=0;i;)t=i.data,r=a,n=l,o.prototype.copy.call(t,r,n),l+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return ea.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return l(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&o.forEach(c),i||(o.forEach(c),a(n))}))}));return t.reduce(u)}},{"../../../errors":101,"./end-of-stream":110}],113:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(a?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},{"../../../errors":101}],114:[function(e,t,r){t.exports=e("events").EventEmitter},{events:27}],115:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=c,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":99}],116:[function(e,t,r){(function(r,n){(function(){var r=e("assert"),a=e("debug")("stream-parser");t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");a("extending Parser into stream"),e._bytes=o,e._skipBytes=l,t&&(e._passthrough=s);t?e._transform=u:e._write=c};function i(e){a("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),a("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function l(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function c(e,t,r){this._parserInit||i(this),a("write(%o bytes)",e.length),"function"==typeof t&&(r=t),d(this,e,null,r)}function u(e,t,r){this._parserInit||i(this),a("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),d(this,e,t,r)}function f(e,t,r,i){if(e._parserBytesLeft-=t.length,a("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var o=e._parserCallback;if(o&&0===e._parserState&&e._parserBuffers.length>1&&(t=n.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),o){var l=[];t&&l.push(t),r&&l.push(r);var s=o.length>l.length;s&&l.push(p(i));var c=o.apply(e,l);if(!s||i===c)return i}}var d=p((function e(t,r,n,a){return t._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return f(t,r,n,a)}:function(){var i=r.slice(0,t._parserBytesLeft);return f(t,i,n,(function(o){return o?a(o):r.length>i.length?function(){return e(t,r.slice(i.length),n,a)}:void 0}))}}));function p(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:98,assert:21,buffer:28,debug:117}],117:[function(e,t,r){(function(n){(function(){function a(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var a=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(a++,"%c"===e&&(i=a))})),e.splice(i,0,n)},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=a,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this)}).call(this,e("_process"))},{"./debug":118,_process:98}],118:[function(e,t,r){var n;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,i=a-(n||a);e.diff=i,e.prev=n,e.curr=a,n=a;for(var o=new Array(arguments.length),l=0;l0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?l(r=e,o,"day")||l(r,i,"hour")||l(r,a,"minute")||l(r,n,"second")||r+" ms":function(e){if(e>=o)return Math.round(e/o)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],120:[function(e,t,r){(function(t,n){(function(){var a=e("process/browser.js").nextTick,i=Function.prototype.apply,o=Array.prototype.slice,l={},s=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":98,timers:120}],121:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*D(p,255),g:255*D(h,255),b:255*D(m,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*D(t,360),r=D(r,100),n=D(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=D(e,360),t=D(t,100),r=D(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=O(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=D(e,255),t=D(t,255),r=D(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=O(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[P(i(e).toString(16)),P(i(t).toString(16)),P(i(r).toString(16)),P(z(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*D(this._r,255))+"%",g:i(100*D(this._g,255))+"%",b:i(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%)":"rgba("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function E(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return E(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),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})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],122:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],123:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":137,"object-assign":73}],126:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":137,"object-assign":73}],127:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":137,"object-assign":73}],128:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":137,"object-assign":73}],129:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":137,"object-assign":73}],130:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":137,"object-assign":73}],131:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":137,"object-assign":73}],132:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":137,"object-assign":73}],134:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":137,"object-assign":73}],135:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":137,"object-assign":73}],136:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":137,"object-assign":73}],137:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":73}],138:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){v("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(d,p);h>S;S=this.daysInMonth(d,p))p++,h-=S}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":137,"object-assign":73}],139:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],140:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":263,"../../plot_api/plot_template":323,"../../plots/cartesian/constants":341,"../../plots/font_attributes":363,"./arrow_paths":139}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,m=p-d,y=3*e.startarrowsize*e.arrowwidth||0,g=y+d,v=y-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(f,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,v=l?v-l:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(f,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":287,"../../plots/cartesian/axes":334,"./draw":146}],142:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],X=0;X1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(Q=t[te],J=he?ae._offset+ae._length*Q:J=T.l+T.w*Q):(Q=1-t[te],J=he?ae._offset+ae._length*Q:J=T.t+T.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){fe.head=J;var me=t["a"+te];if(ee=oe*q(.5,t.xanchor)-le*q(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),fe.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,fe.tail=T.t+T.h*me):fe.tail=T.l+T.w*me:fe.tail=ae._offset+ae.r2p(me),K=ee}else fe.tail=J+me,K=ee+me;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ve=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ve>0?(fe.tail+=ve,fe.text+=ve):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else K=ee=se*q($,ce),fe.text=J+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)I.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,H?O:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;V.call(d.positionText,Te,we).call(u.setClipUrl,H?O:null,e)}U.select("rect").call(u.setRect,j,j,k,z),B.call(u.setRect,N/2,N/2,F-N,Y-N),I.call(u.setTranslate,Math.round(D.x.text-F/2),Math.round(D.y.text-Y/2)),P.attr({transform:"rotate("+C+","+D.x.text+","+D.y.text+")"});var Me,ke=function(r,n){E.selectAll(".annotation-arrow-g").remove();var s=D.x.head,f=D.y.head,d=D.x.tail+r,p=D.y.tail+n,m=D.x.text+r,b=D.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),O=+B.attr("width"),R=+B.attr("height"),z=m-.5*O,N=z+O,F=b-.5*R,j=F+R,H=[[z,F,z,j],[z,j,N,j],[N,j,N,F],[N,F,z,F]].map(k);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var U=t.arrowwidth,Y=t.arrowcolor,q=t.arrowside,V=E.append("g").style({opacity:c.opacity(Y)}).classed("annotation-arrow-g",!0),G=V.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(Y));if(y(G,q,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,W=f;if(t.standoff){var X=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Z+=t.standoff*(d-s)/X,W+=t.standoff*(p-f)/X}var J,K,Q=V.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",U+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);J=e.x,K=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,K),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),L("x",v(g,e,"x",T,t)),L("y",v(x,r,"y",T,t)),t.axref===t.xref&&L("ax",v(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",v(x,r,"ay",T,t)),V.attr("transform",l(e,r)),P.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:I.node(),gd:e,prepFn:function(){Me=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",v(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",v(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=v(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=v(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}P.attr({transform:l(e,r)+Me}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(d=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(f),k=b*Math.sin(f);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),O="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":366,"../annotations/draw":146}],153:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=J*c.roundUp(X/J,[2,5,10]),(Math.abs(D.start)/D.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[Y+B,Y+N-B],G.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var K,Q=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),m.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===A?(1-(Y+N-B))*s.h+s.t+3+.75*n:(1-(Y+B))*s.h+s.t-3-.25*n,te(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),f=[-t.outlinewidth/2,t.outlinewidth/2],d=i.select(".h"+G._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(ee=p.bBox(d).height)>h&&(f[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)G.domain[1]-=ee/s.h,f[1]*=-1;else{G.domain[0]+=ee/s.h;var m=y.lineCount(o);f[1]+=(1-m)*h}i.attr("transform",u(f[0],f[1])),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-G.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var v=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(E);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var x=L.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?L[0]:(E[i]+E[i-1])/2,i===E.length-1?L[1]:(E[i]+E[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:H,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=O(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(g.color&&g.width?P:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(G.c2p(e))+g.width/2%1)+"h"+R).call(p.lineGroupStyle,g.width,S(e),g.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var _=H+R+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(G),M=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,T):T,layer:$,path:l.makeTickPath(G,_,M),transFn:l.makeTransTickFn(G)}),l.drawLabels(r,G,{vals:T,layer:$,transFn:l.makeTransTickLabelFn(G),labelFns:l.makeLabelFns(G,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));te("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=R+t.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(k.jsPlaceholder)){var a,o=Q.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(Q.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-V;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:V-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:V+t.ypad+("top"===A?ee:0),width:Math.max(R,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var f=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-f,s.t));var d={},m=T[t.yanchor],y=M[t.yanchor];"pixels"===t.lenmode?(d.y=t.y,d.t=c*m,d.b=c*y):(d.t=d.b=0,d.yt=t.y+t.len*m,d.yb=t.y-t.len*y);var g=T[t.xanchor],v=M[t.xanchor];if("pixels"===t.thicknessmode)d.x=t.x,d.l=l*g,d.r=l*v;else{var x=l-R;d.l=x*g,d.r=x*v,d.xl=t.x-t.thickness*g,d.xr=t.x+t.thickness*v}i.autoMargin(r,t._id,d)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,c)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":262,"../../lib":287,"../../lib/extend":281,"../../lib/setcursor":307,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../plots/cartesian/axis_defaults":336,"../../plots/cartesian/layout_attributes":349,"../../plots/cartesian/position_defaults":352,"../../plots/plots":369,"../../registry":376,"../color":157,"../colorscale/helpers":168,"../dragelement":176,"../drawing":179,"../titles":255,"./constants":159,"@plotly/d3":20,tinycolor2:121}],162:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":287}],163:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":158,"./defaults":160,"./draw":161,"./has_colorbar":162}],164:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",g=(l(d+p),l(d+h),l(d+m),{});g[h]=g[m]=void 0;var v={};v[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":303,"../../lib/sort_object_keys":308,"../colorbar/attributes":158,"./scales.js":172}],165:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,m=f.mid,y=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():d&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=g():d&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":287,"./helpers":168,"fast-isnumeric":33}],166:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],174:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":287}],175:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],176:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,m,y=e.gd,g=1,v=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(g=Math.max(g-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":287,"../../plots/cartesian/constants":341,"./align":173,"./cursor":174,"./unhover":177,"has-hover":64,"has-passive-events":65,"mouse-event-offset":71}],177:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":279,"../../lib/events":280,"../../lib/throttle":311,"../fx/constants":191}],178:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],179:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},x.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var b=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(e){var t=b[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(e,t){var r=e%100;return x.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=A[i],d=new Array(u),p=0;p"+g(e);h._gradientUrlQueryParts[v]=1},x.pattern=function(e,t,r,i,o,l,s,u,f,d,p,h){var m="legend"===t;u&&("overlay"===f?(d=u,p=c.contrast(d)):(d=void 0,p=u));var y,g,v,x,b,_,w,T,M,k,A,L=r._fullLayout,S="p"+L._uid+"-"+i,O={};switch(o){case"/":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",O={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"\\":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",O={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"x":y=l*Math.sqrt(2),g=l*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,x=l-l*Math.sqrt(1-s),_="path",O={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",O={d:v="M"+(y=l)/2+",0L"+y/2+","+(g=l),opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"-":_="path",_="path",O={d:v="M0,"+(g=l)/2+"L"+(y=l)+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"+":_="path",v="M"+(y=l)/2+",0L"+y/2+","+(g=l)+"M0,"+g/2+"L"+y+","+g/2,x=l-l*Math.sqrt(1-s),_="path",O={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case".":y=l,g=l,s.pattern_filled";L._patternUrlQueryParts[E]=1},x.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},x.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},x.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var f,d,p,h=!1;if(e.so)p=l.outlierwidth,d=l.outliercolor,f=o.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var y=o.gradient,g=e.mgt;g?h=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,b=v&&x.getPatternAttr(v.shape,e.i,"");if(g&&"none"!==g){var _=e.mgc;_?h=!0:_=y.color;var T=r.uid;h&&(T+="-"+e.i),x.gradient(t,i,T,g,[[0,_],[1,f]],"fill")}else if(b){var M=x.getPatternAttr(v.bgcolor,e.i,null),k=x.getPatternAttr(v.fgcolor,e.i,null),L=v.fgopacity,S=x.getPatternAttr(v.size,e.i,8),O=x.getPatternAttr(v.solidity,e.i,.3),D=e.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),C=r.uid;D&&(C+="-"+e.i),x.pattern(t,"point",i,C,b,S,O,e.mcc,v.fillmode,M,k,L)}else c.fill(t,f);p&&c.stroke(t,d)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:m*t});var h=i.color,y=o.color,g=l.color;(y||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:g||t});var v=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(x.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};v(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=O(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,g).text(c).call(d.convertToTspans,r).call(S,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=O(e,t);c.fill(a,i),S(a,o,l,e.mrc2||e.mrc)}))}};function D(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},P=0),r&&(x.savedBBoxes[r]=y),P++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var I=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(I,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var N=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(N);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":193,"../../constants/alignment":262,"../../constants/interactions":266,"../../constants/xmlns_namespaces":268,"../../lib":287,"../../lib/svg_text_utils":310,"../../registry":376,"../../traces/scatter/make_bubble_size_func":514,"../../traces/scatter/subtypes":522,"../color":157,"../colorscale":169,"./symbol_defs":180,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:121}],180:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":20}],181:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],182:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var m=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,f);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":522,"../drawing":179,"@plotly/d3":20,"fast-isnumeric":33}],187:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":157,"@plotly/d3":20}],188:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":281,"../../plots/font_attributes":363,"./layout_attributes":198}],189:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+b[0]._offset,t.pointerY=ie+_[0]._offset,F="xval"in t?g.flat(l,t.xval):g.p2c(b,ae),U="yval"in t?g.flat(l,t.yval):g.p2c(_,ie),!a(F[0])||!a(U[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(q=0;q$&&(ee.splice(0,$),ce=ee[0].distance),m&&0!==P&&0===ee.length){Q.distance=P,Q.index=!1;var f=G._module.hoverPoints(Q,J,K,"closest",{hoverLayer:s._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=P}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var y=h[0];a(y.x0)&&a(y.y0)&&(d=de(y),(!re.vLinePoint||re.vLinePoint.spikeDistance>d.spikeDistance)&&(re.vLinePoint=d))}var v=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(v.length){var x=v[0];a(x.x0)&&a(x.y0)&&(d=de(x),(!re.hLinePoint||re.hLinePoint.spikeDistance>d.spikeDistance)&&(re.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)De(ee[Ae]);ee=Le,ye()}var Ce=e._hoverdata,Ee=[],Pe=B(e),Re=H(e);for(Y=0;Y1||ee.length>1)||"closest"===L&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),We=E(ee,{gd:e,hovermode:L,rotateLabels:Ge,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});g.isUnifiedHover(L)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(y.push.apply(y,g),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ge?"xa":"ya",s),R(We,Ge,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Xe=y.getComponentMethod("annotations","hasClickToShow")(e,Ee);f(n.select(t.target),Xe?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:F,yvals:U})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=E(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,f+=v,d+=x,h+=x}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function E(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{},T=t.fontFamily||v.HOVERFONT,M=t.fontSize||v.HOVERFONTSIZE,k=e[0],S=k.xa,O=k.ya,C=i.charAt(0),E=k[C+"Label"],R=U(r,m),z=R.top,I=R.width,N=R.height,F=void 0!==E&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(F){var j,B,H=!0;for(j=0;ja.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+v.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+v.width/2)+"v"+x+(2*L+v.height)+"H-"+(L+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,D,C;"right"===O.side?(_="start",D=1,C="",y=S._offset+S._length):(_="end",D=-1,C="-",y=S._offset),g=O._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+v.height/2)+"h"+C+(2*L+v.width)+"V-"+(L+v.height/2)+"H"+C+A+"V-"+A+"Z");var P,R=v.height/2,I=z-v.top-R,N="clip"+a._uid+"commonlabel"+O._id;if(y=0?ae:ie+se=0?ie:ye+se=0?re:ne+ce=0?ne:ge+ce=0,"top"!==e.idealAlign&&V||!G?V?(R+=B/2,e.anchor="start"):e.anchor="middle":(R-=B/2,e.anchor="end");else if(e.pos=R,V=C+j/2+Z<=I,G=C-j/2-Z>=0,"left"!==e.idealAlign&&V||!G)if(V)C+=j/2,e.anchor="start";else{e.anchor="middle";var W=Z/2,X=C+W-I,J=C-W;X>0&&(C-=X),J<0&&(C+=-J)}else C-=j/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,R)+(c?s(_):""))})),ve}function P(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var g=h+f,v=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function I(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,g,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,b,_=i.readability(v.color,h)<1.5?p.contrast(h):v.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(f){var S,O,D=t.vLinePoint;n=D&&D.xa,a=D&&D.ya,"cursor"===n.spikesnap?(S=c.pointerX,O=c.pointerY):(S=n._offset+D.x,O=a._offset+D.y);var C,E,P=i.readability(D.color,h)<1.5?p.contrast(h):D.color,R=n.spikemode,z=n.spikethickness,I=n.spikecolor||P,N=m.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(C=N,E=O),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,E=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":z,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?z:-z),r:z,fill:I}).classed("spikeline",!0)}}}function N(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function U(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":287,"../../lib/events":280,"../../lib/override_cursor":298,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../registry":376,"../color":157,"../dragelement":176,"../drawing":179,"../legend/defaults":209,"../legend/draw":210,"./constants":191,"./helpers":193,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:121}],195:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":287,"../color":157,"./helpers":193}],196:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":287,"./layout_attributes":198}],197:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":287,"../dragelement":176,"./attributes":188,"./calc":189,"./click":190,"./constants":191,"./defaults":192,"./helpers":193,"./hover":194,"./layout_attributes":198,"./layout_defaults":199,"./layout_global_defaults":200,"@plotly/d3":20}],198:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":363,"./constants":191}],199:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":287,"./hoverlabel_defaults":195,"./hovermode_defaults":196,"./layout_attributes":198}],200:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":287,"./hoverlabel_defaults":195,"./layout_attributes":198}],201:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);y._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,T=d?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,v),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var y=i.newContainer(t,"legend");if(T("uirevision",t.uirevision),!1!==m){T("bgcolor",t.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,x,b=a.coerceFont(T,"font",t.font),_="h"===T("orientation");if(_?(g=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(v=1.1,x="bottom"):(v=-.1,x="top")):(g=1.02,v=1,x="auto"),T("traceorder",d),s.isGrouped(t.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",x),T("valign"),a.noneOrAll(c,y,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=a.extendFlat({},b,{size:a.bigFont(b.size)});a.coerceFont(T,"title.font",w)}}}function T(e,t){return a.coerce(c,y,o,e,t)}}},{"../../lib":287,"../../plot_api/plot_template":323,"../../plots/layout_attributes":367,"../../registry":376,"./attributes":207,"./helpers":213}],210:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,g=h.FROM_BR,v=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(d?T(n,h):n);var y=r.itemwidth+2*p.itemGap;f.positionText(m,y,0),d?m.call(f.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(m,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,d=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),v=f.lineCount(g),x=g.node();if(u=h*v,d=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,d-=r.itemwidth),f.positionText(g,b,-h*((v-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=v(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&v(e.calcdata,t)}var m=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var T=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),S=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),O=a.ensureSingle(T,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));O.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var D=a.ensureSingle(T,"g","scrollbox"),C=t.title;if(t._titleWidth=0,t._titleHeight=0,C.text){var E=a.ensureSingle(D,"text","legendtitletext");E.attr("text-anchor","start").call(c.font,C.font).text(C.text),k(E,D,e,t,1)}else D.selectAll(".legendtitletext").remove();var P=a.ensureSingle(T,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),R=D.selectAll("g.groups").data(l);R.enter().append("g").attr("class","groups"),R.exit().remove();var z=R.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.itemGap,h=a.itemwidth+2*d,m=2*(u+d),y=L(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,x=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+d),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=d+h+f,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),M=a.x<0||0===a.x&&"right"===T,k=a.x>1||1===a.x&&"left"===T,S=v||g,O=i.width/2;a._maxWidth=Math.max(M?S&&"left"===T?o.l+o.w:O:k?S&&"right"===T?o.r+o.w:O:o.w,2*h);var D=0,C=0;r.each((function(e){var t=e[0].width+h;D=Math.max(D,t),C+=t})),_=null;var E=0;if(s){var P=0,R=0,z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+d+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),P=Math.max(P,t);var r=e+d;r+u+R>a._maxWidth&&(E=Math.max(E,R),R=0,z+=P+x,P=t),c.setTranslate(this,R,z),R+=r})),a._width=Math.max(E,R)+u,a._height=z+P+m}else{var I=r.size(),N=C+f+(I-1)*d=a._maxWidth&&(E=Math.max(E,H),j=0,B+=F,a._height+=F,F=0),c.setTranslate(this,w[0]+u+j,w[1]+u+B+t/2+d),H=j+r+d,j+=n,F=Math.max(F,t)})),N?(a._width=j+f,a._height=F+m):(a._width=Math.max(E,H)+f,a._height+=F+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var U=e._context.edits,Y=U.legendText||U.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=Y?h:_||h+e[0].width;l||(a+=d/2),c.setRect(t,0,-r/2,a,r)}))}(e,R,z,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*y[n]})}(e)){var l,u,m,v,x=f._size,b=t.borderwidth,w=x.l+x.w*t.x-y[A(t)]*t._width,M=x.t+x.h*(1-t.y)-y[L(t)]*t._effHeight;if(!h&&f.margin.autoexpand){var k=w,C=M;w=a.constrain(w,0,f.width-t._width),M=a.constrain(M,0,f.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),M!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(T,w,M),P.on(".drag",null),T.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var E=t._effHeight;h&&(E=t._height),O.attr({width:t._width-b,height:E-b,x:b/2,y:b/2}),c.setTranslate(D,0,0),S.select("rect").attr({width:t._width-2*b,height:E-2*b,x:b,y:b}),c.setClipUrl(D,d,e),c.setRect(P,0,0,0,0),delete t._scrollY}else{var R,z,I,N=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-N-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);O.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),S.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(D,d,e),q(H,N,B),T.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),N,B),0!==H&&H!==j&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(I,R,z),N,B))}));P.call(U);var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(I,R,z),N,B))}));D.call(Y)}if(e._context.edits.legendPosition)T.classed("cursor-move",!0),s.init({element:T.node(),gd:e,prepFn:function(){var e=c.getTranslate(T);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(T,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,T,a,t,n)}})}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(D,0,-r),c.setRect(P,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),S.select("rect").attr("y",b+r)}}],e)}(e,t)}},{"../../constants/alignment":262,"../../lib":287,"../../lib/events":280,"../../lib/svg_text_utils":310,"../../plots/plots":369,"../../registry":376,"../color":157,"../dragelement":176,"../drawing":179,"./constants":208,"./get_legend_data":211,"./handle_click":212,"./helpers":213,"./style":215,"@plotly/d3":20}],211:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(f,"")(m)}var g=p||i.mc||f.color,v=f.pattern,x=v&&l.getPatternAttr(v.shape,0,"");if(x){var b=l.getPatternAttr(v.bgcolor,0,null),_=l.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,M=y(v.size,8,10),k=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,v.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||d.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});f(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,m=d.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=e[0],b=v.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}}),f||d){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(v,{trace:a})]}var O=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",k+(d?"l"+x+",0.0001":"h"+x)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,y=!d&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||y||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":287,"../../registry":376,"../../traces/pie/helpers":489,"../../traces/pie/style_one":495,"../../traces/scatter/subtypes":522,"../color":157,"../colorscale/helpers":168,"../drawing":179,"./constants":208,"@plotly/d3":20}],216:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":218}],217:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(C=["toggleHover"],E=["resetViews"]):g?(D=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],E=["resetGeo"]):y?(C=["hoverClosest3d"],E=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(D=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],E=["resetViewMapbox"]):b?C=["hoverClosestGl2d"]:v?C=["hoverClosestPie"]:M?(C=["hoverClosestCartesian","hoverCompareCartesian"],E=["resetViewSankey"]):C=["toggleHover"];m&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=N[r+1];else if(e=n.pmax)t=N[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;ov?(M=f,S="y0",k=v,O="y1"):(M=v,S="y1",k=f,O="y0");X(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===P?J:K,W.altKey=n.altKey},doneFn:function(){if(g(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(g(e))return;$(l)}};function X(r){if(g(e))P=null;else if(I)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!N&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),P=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(x+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?F("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else R?F("xanchor",r.xanchor=V(x+n)):(F("x0",r.x0=V(c+n)),F("x1",r.x1=V(y+n))),z?F("yanchor",r.yanchor=G(T+a)):(F("y0",r.y0=G(f+a)),F("y1",r.y1=G(v+a)));t.attr("d",_(e,r)),Q(l,r)}function K(n,a){if(N){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(x+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?F("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else if(I){if("resize-over-start-point"===P){var u=c+n,d=z?f-a:f+a;F("x0",r.x0=R?u:V(u)),F("y0",r.y0=z?d:G(d))}else if("resize-over-end-point"===P){var p=y+n,h=z?v-a:v+a;F("x1",r.x1=R?p:V(p)),F("y1",r.y1=z?h:G(h))}}else{var g=function(e){return-1!==P.indexOf(e)},b=g("n"),B=g("s"),U=g("w"),Z=g("e"),W=b?M+a:M,X=B?k+a:k,J=U?A+n:A,K=Z?L+n:L;z&&(b&&(W=M-a),B&&(X=k-a)),(!z&&X-W>10||z&&W-X>10)&&(F(S,r[S]=z?W:G(W)),F(O,r[O]=z?X:G(X))),K-J>10&&(F(D,r[D]=R?J:V(J)),F(C,r[C]=R?K:V(K)))}t.attr("d",_(e,r)),Q(l,r)}function Q(e,t){(R||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Y(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=q(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),R&&z){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),Z.node().onmousemove=X}(e,R,s,t,r,P):!0===s.editable&&R.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!v(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,y(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getRefType(t.xref),y=i.getRefType(t.yref),g=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),x=e._fullLayout._size;if(g?"domain"===p?n=function(e){return g._offset+g._length*e}:(r=m.shapePositionToRange(g),n=function(e){return g._offset+g.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},v?"domain"===y?l=function(e){return v._offset+v._length*(1-e)}:(o=m.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===d)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(l=m.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,f=_-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var w=(s+c)/2,T=(u+f)/2,M=Math.abs(w-s),k=Math.abs(T-u),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){v(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,y(e)))}t.exports={draw:y,drawOne:x,eraseActiveShape:function(e){if(!v(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(g),r.attr("d",m(t)),k&&!d)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,v(),x())}}()}}function E(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function O(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,g);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return z.call(I),P&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":262,"../../constants/interactions":266,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/plots":369,"../../registry":376,"../color":157,"../drawing":179,"@plotly/d3":20,"fast-isnumeric":33}],256:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":281,"../../plot_api/edit_types":316,"../../plot_api/plot_template":323,"../../plots/font_attributes":363,"../../plots/pad_attributes":368,"../color/attributes":156}],257:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],258:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":287,"../../plots/array_container_defaults":329,"./attributes":256,"./constants":257}],259:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||g(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(v,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+y+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(v,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+g;S+A>c&&(S=c-A);var O=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=O.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=g>T,C=l.barWidth+2*l.barPad,E=l.barLength+2*l.barPad,P=h+m,R=y;P+C>s&&(P=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),D?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:R,width:C,height:E}),this._vbarYMin=R+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,N=u-.5,F=D?f+C+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(M||D?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),M||D?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||D){var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(U);var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(Y),D&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":287,"../color":157,"../drawing":179,"@plotly/d3":20}],262:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],263:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],264:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],265:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],266:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],267:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],268:[function(e,t,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}},{}],269:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],271:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],272:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":294}],273:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:v);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),O=Number(T[11]||0);if(c){if(2===M.length)return u;var D;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var E="i"===k.charAt(k.length-1);k=parseInt(k,10),D=C.newDate(M,C.toMonthIndex(M,k,E),A)}else D=C.newDate(M,Number(k),A)}catch(e){return u}return D?(D.toJD()-m)*f+L*d+S*p+O*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var P=new Date(Date.UTC(2e3,k,A,L,S));return P.setUTCFullYear(M),P.getUTCMonth()!==k||P.getUTCDate()!==A?u:P.getTime()+O*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,M=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,v,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+m,S=Math.floor(s(e,f));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,O={1:"1",2:"1",3:"2",4:"2"};function D(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return O[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+D(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return D(t,e,n,a)};var E=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+E);return c.setUTCMonth(c.getUTCMonth()+t)+n-E},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+f*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,m=d*d+p*p,y=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,m,e-a,t-i),s(d,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":294}],285:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],286:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],287:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var m=e("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var y=e("./dates");f.dateTime2ms=y.dateTime2ms,f.isDateTime=y.isDateTime,f.ms2DateTime=y.ms2DateTime,f.ms2DateTimeLocal=y.ms2DateTimeLocal,f.cleanDate=y.cleanDate,f.isJSDate=y.isJSDate,f.formatDate=y.formatDate,f.incrementMonth=y.incrementMonth,f.dateTick0=y.dateTick0,f.dfltRange=y.dfltRange,f.findExactDates=y.findExactDates,f.MIN_MS=y.MIN_MS,f.MAX_MS=y.MAX_MS;var g=e("./search");f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var x=e("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=e("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(z,arguments)};var I={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(I,arguments)};var N=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,g=l;if((p||h)&&(g=g.substring(1)),(m||h)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=t[g]))return""}else for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":267,"./anchor_utils":271,"./angles":272,"./array":273,"./clean_number":274,"./clear_responsive":276,"./coerce":277,"./dates":278,"./dom":279,"./extend":281,"./filter_unique":282,"./filter_visible":283,"./geometry2d":284,"./identity":285,"./increment":286,"./is_plain_object":288,"./keyed_container":289,"./localize":290,"./loggers":291,"./make_trace_groups":292,"./matrix":293,"./mod":294,"./nested_property":295,"./noop":296,"./notifier":297,"./preserve_drawing_buffer":300,"./push_unique":301,"./regex":303,"./relative_attr":304,"./relink_private":305,"./search":306,"./sort_object_keys":308,"./stats":309,"./throttle":311,"./to_log_range":312,"@plotly/d3":20,"d3-format":29,"d3-time-format":30,"fast-isnumeric":33}],288:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],289:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":321,"./notifier":297}],292:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":20}],293:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],295:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(f,y)||c>Math.max(d,g)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":267,"./matrix":293}],300:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":33,"is-mobile":69}],301:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":273,"fast-isnumeric":33}],310:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),D=n.select(e.node().parentNode);if(!D.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return E(),void t();var c=D.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:C,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+e.attr("x")-d*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],y=-(r||s(e,"height"))/4;"y"===C[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-d/2,y-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===C[0]?l.attr({x:e.attr("x"),y:y-p/2}):"a"===C[0]&&0!==C.indexOf("atitle")?l.attr({x:0,y:y}):l.attr({x:h,y:+e.attr("y")+y-p/2}),m&&m.call(e,c),t(c)}))}))):E(),e}function E(){D.empty()||(C=e.attr("class")+"-math",D.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),D=0;D|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function O(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function D(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],312:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":33}],313:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],314:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],315:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",f,v),!0;t.set(v)}return!m&&(d(y,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),O=S||[],D=u(g,f).get(),C=[],E=-1,P=O.length;for(x=0;xO.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?C.push(_):k?("add"===M&&(M={}),O.splice(_,0,M),D&&D.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===E&&(E=_);else for(b=0;b=0;x--)O.splice(C[x],1),D&&D.splice(C[x],1);if(O.length?S||t.set(O):t.set(null),m)return!1;if(d(y,g),h!==a){var R;if(-1===E)R=L;else{for(P=Math.max(O.length,P),R=[],x=0;x=E);x++)R.push(_);for(x=E;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var m=0;m-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&Y(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Y(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,V=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=N(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),g={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof P.parts[z];)z--;var F=P.parts[z],j=P.parts[z-1]+"."+F,H=P.parts.slice(0,z).join("."),U=l(e.layout,H).get(),Y=l(s,H).get(),Z=P.get();if(void 0!==R){A[E]=R,L[E]="reverse"===F?R:I(Z);var X=f.getLayoutValObject(s,P.parts);if(X&&X.impliedEdits&&null!==R)for(var J in X.impliedEdits)S(o.relativeAttr(E,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(E))if(R){S("autosize",null);var K="height"===E?"width":"height";S(K,s[K])}else s[E]=e._initialAutoSize[E];else if("autosize"===E)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(q))C(j),l(s,H+"._inputRange").set(null);else if(j.match(V)){C(j),l(s,H+"._inputRange").set(null);var Q=l(s,H).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(G)&&l(s,H+"._inputDomain").set(null);if("type"===F){O=U;var $="linear"===Y.type&&"log"===R,ee="log"===Y.type&&"linear"===R;if($||ee){if(O&&O.range)if(Y.autorange)$&&(O.range=O.range[1]>O.range[0]?[1,2]:[2,1]);else{var te=O.range[0],re=O.range[1];$?(te<=0&&re<=0&&S(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(H+".range[0]",Math.log(te)/Math.LN10),S(H+".range[1]",Math.log(re)/Math.LN10)):(S(H+".range[0]",Math.pow(10,te)),S(H+".range[1]",Math.pow(10,re)))}else S(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete s[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,Y,R,S),u.getComponentMethod("images","convertCoords")(e,Y,R,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(M)){var ne=l(s,E).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(E);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=X||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[E]=null:b.isRemoveVal(R)?L[E]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=R,delete t[E]}else"reverse"===F?(U.range?U.range.reverse():(S(H+".autorange",!0),U.range=[1,0]),Y.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===E&&("lasso"===R||"select"===R)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:X?T.update(k,X):k.calc=!0,P.set(R))}}for(r in g){b.applyContainerArrayChanges(e,d(i,r),g[r],k,d)||(k.plot=!0)}for(var ce in D){var ue=(O=p.getFromId(e,ce))&&O._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)D[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:D,undoit:L,redoit:A,eventData:y}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function X(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),U(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&Y(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag),c.add(e,X,[e,l.undoit,u.undoit,l.traces],X,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,m,y=0;function g(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var v=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))v.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);v=k}}v.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,g=t[n].name,v=u[y]||h[y];y&&g&&"number"==typeof g&&v&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[m]={name:m},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":287,"../plots/attributes":330}],324:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,g=y._size,x=g.p,_=d.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var O=l.xaxis.domain,D=l.yaxis.domain,C=l.plotgroup;if(v(O,D,L)){var E=C.node(),P=l.bg=o.ensureSingle(C,"rect","bg");E.insertBefore(P.node(),E.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([O,D]),S||(k.push(a),A.push(a))}var R,z,I,N,F,j,B,H,U,Y,q,V,G,Z=y._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(g)}},{"../lib":287,"../plots/attributes":330,"../plots/plots":369,"./plot_config":321,"./plot_schema":322,"./plot_template":323}],326:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function m(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var y={};function g(e,r){return o.coerce(t,y,f,e,r)}var v=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},d);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function O(){return new Promise((function(e,t){var r=s(M,v,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===v){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===v)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(O).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":287,"../plots/plots":369,"../snapshot/helpers":380,"../snapshot/svgtoimg":382,"../snapshot/tosvg":384,"../version":549,"./plot_api":320,"fast-isnumeric":33}],327:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,O,D=x.length,C=Array.isArray(M);if(C&&(D=Math.min(D,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var E=x[A].length;for(k=0;k<(C?Math.min(E,M[A].length):E);k++)L=C?M[A][k]:M,S=v[A][k],O=x[A][k],n.validate(S,L)?O!==S&&O!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,O)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),v[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,d)||0,g=[],v=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,d);for(;M<=k;)M=o(M,c,d);T=o(M,-c,d)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,v[_]=T,x[_]=M}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":267,"../../lib":287,"fast-isnumeric":33}],332:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],333:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,y=f[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>O?M/T>D&&(_=x,w=b,D=M/T):M/S>D&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},D=M/S));if(d===y){var C=d-1,E=d+1;if(A)if(0===d)a=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=d/(1-Math.min(.5,P/S));a=d>0?[0,R]:[R,0]}else a=L?[Math.max(0,C),Math.max(1,E)]:[C,E]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-D*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),D=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-D*l(_),w.val+D*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),O=k(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=E;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":179,"../../constants/numerical":267,"../../lib":287,"../../registry":376,"./axis_ids":338,"@plotly/d3":20,"fast-isnumeric":33}],334:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,O=m.ONEMIN,D=m.ONESEC,C=m.MINUS_SIGN,E=m.BADNUM,P={K:"zeroline"},R={K:"gridline",L:"path"},z={K:"tick",L:"path"},I={K:"tick",L:"text"},N=e("../../constants/alignment"),F=N.MID_SHIFT,j=N.CAP_SHIFT,B=N.LINE_SPACING,H=N.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var Y=e("./axis_autotype"),q=e("./axis_ids"),V=q.idSort,G=q.isLinked;U.id2name=q.id2name,U.name2id=q.name2id,U.cleanId=q.cleanId,U.list=q.list,U.listIds=q.listIds,U.getFromId=q.getFromId,U.getFromTrace=q.getFromTrace;var Z=e("./autorange");U.getAutoRange=Z.getAutoRange,U.findExtremes=Z.findExtremes;function W(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(v,e,g,c,i)),y=v,0;y<=u;)y=U.tickIncrement(y,g,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(y,0,i),size:g,_dataSpan:u-c}},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dticki&&f=o:p<=o;p=U.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(O.length>m||p===D)break;D=p;var C=!1;f&&p!==(0|p)&&(C=!0),O.push({minor:C,value:p})}if(d&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=v?d=u>=v&&u<=y?u:g:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=M?d=u>=M&&u<=w?u:T:r===k&&f>=k?d=k:f>=A?d=A:r===L&&f>=L?d=L:r===S&&f>=S&&(d=S),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,m=0;m<84;m++){var O=(m+.5)/84;t.maskBreaks(a*(1-O)+O*p)!==E&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(O,e,e._definedDelta),e.rangebreaks){var P="y"===e._id.charAt(0),R=1;"auto"===e.tickmode&&(R=e.tickfont?e.tickfont.size:12);var z=NaN;for(h=O.length-1;h>-1;h--)if(O[h].drop)O.splice(h,1);else{O[h].value=Ae(O[h].value,e);var I=e.c2p(O[h].value);(P?z>I-R:zu||Fu&&(N.periodX=u),F10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=O&&i<=16||t>=S)e._tickround="M";else if(t>=D&&i<=19||t>=O)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!fe(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>g)t/=g,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>T)t/=T,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=U.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=oe(t,S,ee):i>O?e.dtick=oe(t,O,te):i>D?e.dtick=oe(t,D,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=de(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ue(p)&&fe(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":C)+d:(t.text=de(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=de(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=de(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=de(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function fe(e){return e>14||e<-15}function de(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?C+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ye(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}K&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,xe(t),n),i.autoMargin(e,be(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||K&&"bottom"===t.side||X.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ye(t);else{var l=Le(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,m=U.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,f="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var g=d.getTranslate(y.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(X)}}function Q(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ve(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*j,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},U.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=d?e.ticklen:0;if(f?m*=-1:u&&(m=0),d&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,v,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(b*=-1),g=h*b,v=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=F:x=-90===A&&"bottom"===M?j:90===A&&"top"===M?F:.5,T=F/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(b*=-1),g=p,v=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?j:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*j*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*F},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,t.tickcolor).style("stroke-width",d.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Se(t,[z]),i.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&U.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,y+1?y:m);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(g,y)}))):_.push((function(){if(x(g,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ve(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),y=f("left"),v=f("right"),_=f("bottom")||y||h||v?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=v(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=v(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":376,"./constants":341}],339:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rP&&NC&&(C=N);d/=(C-D)/(2*E),D=s.l2r(D),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(e,t,a,i)}function U(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function Y(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){E&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),E=!1)}function V(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(Y(a),2!==e||ge||qe(),ye)o.indexOf("select")>-1&&L(r,a,J,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=m?P:E,c="s"===m||"w"===g?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,Oe.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),Oe.attr("d",V(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,Oe.attr("d",V(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":287,"fast-isnumeric":33}],353:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":262}],354:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),y=e("../../components/shapes/draw_newshape/helpers").handleEllipse,g=e("../../components/shapes/draw_newshape/newshapes"),v=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),k=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,O=e("./helpers"),D=O.p2r,C=O.axValue,E=O.getTransform;function P(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,y,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){N(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=B(_))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function H(e,t,r){var n,i,o,l;for(n=0;n=0)O._fullLayout._deactivateShape(O);else if(!_){var r=R.clickmode;b.done(me).then((function(){if(b.clear(me),2===e){for(fe.remove(),$=0;$-1&&P(t,O,a.xaxes,a.yaxes,a.subplot,a,fe),"event"===r&&O.emit("plotly_selected",void 0);l.click(O,t)})).catch(v.error)}},a.doneFn=function(){he.remove(),b.done(me).then((function(){b.clear(me),a.gd.emit("plotly_selected",te),Q&&a.selectionDefs&&(Q.subtract=ue,a.selectionDefs.push(Q),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(ye)})).catch(v.error),_&&F(a)}},clearSelect:S,clearSelectionsCache:F,selectOnClick:P}},{"../../components/color":157,"../../components/dragelement/helpers":175,"../../components/drawing":179,"../../components/fx":197,"../../components/fx/helpers":193,"../../components/shapes/draw_newshape/display_outlines":245,"../../components/shapes/draw_newshape/helpers":246,"../../components/shapes/draw_newshape/newshapes":247,"../../lib":287,"../../lib/clear_gl_canvases":275,"../../lib/polygon":299,"../../lib/throttle":311,"../../plot_api/subroutines":324,"../../registry":376,"./axis_ids":338,"./constants":341,"./handle_outline":345,"./helpers":346,polybooljs:75}],355:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,g=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function O(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function D(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function E(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=P(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:P(e)}function I(e,t,r){return n.round(r+t*e,2)}function N(e,t,r){return(e-r)/t}var F=function(t){return l(t)?I(t,e._m,e._b):m},j=function(t){return N(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return I(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?I(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return N(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(S(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=O,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,n){return e.l2p(O(t,0,n))},e.p2d=e.p2r=function(e,t,r){return D(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=E,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],g=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(d){var v=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,M=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,O=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,O).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":179,"../../lib":287,"../../registry":376,"./axes":334,"@plotly/d3":20}],360:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(d.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(d,s,f,n),b.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,U=!(!s._has||!s._has("cartesian"))||B;H&&!U?n._bgLayer.remove():U&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(f){var y=(r.t+r.b)/f;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[t]={l:{val:g,size:r.l+h},r:{val:v,size:r.r+h},b:{val:_,size:r.b+h},t:{val:x,size:r.t+h}},p[t]=1}else delete d[t],delete p[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},m){var x=m[v].l||{},_=m[v].b||{},w=x.val,T=x.size,M=_.val,k=_.size;for(var A in m){if(o(T)&&m[A].r){var L=m[A].r.val,S=m[A].r.size;if(L>w){var O=(T*L+(S-r)*w)/(L-w),C=(S*(1-w)+(T-r)*(1-L))/(L-w);O+C>c+f&&(c=O,f=C)}}if(o(k)&&m[A].t){var E=m[A].t.val,P=m[A].t.size;if(E>M){var R=(k*E+(P-n)*M)/(E-M),z=(P*(1-M)+(k-n)*(1-E))/(E-M);R+z>h+d&&(h=R,d=z)}}}}}var I=u.constrain(r-i.l-i.r,2,64),N=u.constrain(n-i.t-i.b,2,64),F=Math.max(0,r-I),j=Math.max(0,n-N);if(F){var B=(c+f)/F;B>1&&(c/=B,f/=B)}if(j){var H=(h+d)/j;H>1&&(h/=H,d/=H)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,f),a=0;a0){for(var n=[],a=0;a=u&&(p.min=0,m.min=0,y.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function h(e,t,r,n){var a=f[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var d=o("color"),p=d!==a.color.dflt?d:r.font.color,h=t._name.charAt(0).toUpperCase(),m="Component "+h,y=o("title.text",m);t._hovertitle=y===m?y:h,i.coerceFont(o,"title.font",{family:r.font.family,size:i.bigFont(r.font.size),color:p}),o("min"),c(e,t,o,"linear"),l(e,t,o,"linear",{}),s(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(e,t,o,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:f,handleDefaults:p,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":157,"../../lib":287,"../../plot_api/plot_template":323,"../cartesian/line_grid_defaults":351,"../cartesian/tick_label_defaults":356,"../cartesian/tick_mark_defaults":357,"../cartesian/tick_value_defaults":358,"../subplot_defaults":370,"./layout_attributes":373}],375:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),l=o.strTranslate,s=o._,c=e("../../components/color"),u=e("../../components/drawing"),f=e("../cartesian/set_convert"),d=e("../../lib/extend").extendFlat,p=e("../plots"),h=e("../cartesian/axes"),m=e("../../components/dragelement"),y=e("../../components/fx"),g=e("../../components/dragelement/helpers"),v=g.freeMode,x=g.rectMode,b=e("../../components/titles"),_=e("../cartesian/select").prepSelect,w=e("../cartesian/select").selectOnClick,T=e("../cartesian/select").clearSelect,M=e("../cartesian/select").clearSelectionsCache,k=e("../cartesian/constants");function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var L=A.prototype;L.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},L.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*b?a=(i=b)*S:i=(a=x)/S,o=g*a/x,s=v*i/b,r=t.l+t.w*m-a/2,n=t.t+t.h*(1-y)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=_,p.xaxis={type:"linear",range:[w+2*M-_,_-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-M],domain:[y-s/2,y+s/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],A=p.aaxis=d({},e.aaxis,{range:[w,_-T-M],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(A,p.graphDiv._fullLayout),A.setScale();var L=p.baxis=d({},e.baxis,{range:[_-w-M,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(L,p.graphDiv._fullLayout),L.setScale();var O=p.caxis=d({},e.caxis,{range:[_-w-T,M],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(O,p.graphDiv._fullLayout),O.setScale();var D="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",D),p.layers.plotbg.select("path").attr("d",D);var C="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",C);var E=l(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",E),p.clipDefRelative.select("path").attr("transform",null);var P=l(r-L._offset,n+i);p.layers.baxis.attr("transform",P),p.layers.bgrid.attr("transform",P);var R=l(r+a/2,n)+"rotate(30)"+l(0,-A._offset);p.layers.aaxis.attr("transform",R),p.layers.agrid.attr("transform",R);var z=l(r+a/2,n)+"rotate(-30)"+l(0,-O._offset);p.layers.caxis.attr("transform",z),p.layers.cgrid.attr("transform",z),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",L.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",O.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,O.linecolor||"#000").style("stroke-width",(O.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},L.drawAxes=function(e){var t=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),e){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=b.draw(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(t,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-l,"text-anchor":"middle"}}),n["b-title"]=b.draw(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(t,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(t,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},L.drawAx=function(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,l=this.layers[n],s=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),e.setScale();var u=h.calcTicks(e),f=h.clipEnds(e,u),d=h.makeTransTickFn(e),p=h.getTickSigns(e)[2],m=o.deg2rad(30),y=p*(e.linewidth||1)/2,g=p*e.ticklen,v=this.w,x=this.h,b="b"===a?"M0,"+y+"l"+Math.sin(m)*g+","+Math.cos(m)*g:"M"+y+",0l"+Math.cos(m)*g+","+-Math.sin(m)*g,_={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[a];h.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),h.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),h.drawLabels(r,e,{vals:u,layer:l,transFn:d,labelFns:h.makeLabelFns(e,0,30)})};var O=k.MINZOOM/2+.87,D="m-0.87,.5h"+O+"v3h-"+(O+5.2)+"l"+(O/2+2.6)+",-"+(.87*O+4.5)+"l2.6,1.5l-"+O/2+","+.87*O+"Z",C="m0.87,.5h-"+O+"v3h"+(O+5.2)+"l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-2.6,1.5l"+O/2+","+.87*O+"Z",E="m0,1l"+O/2+","+.87*O+"l2.6,-1.5l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-"+(O/2+2.6)+","+(.87*O+4.5)+"l2.6,1.5l"+O/2+",-"+.87*O+"Z",P=!0;function R(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}L.clearSelect=function(){M(this.dragOptions),T(this.dragOptions.gd)},L.initInteractions=function(){var e,t,r,n,f,d,p,h,g,b,T,M,A=this,L=A.layers.plotbg.select("path").node(),O=A.graphDiv,z=O._fullLayout._zoomlayer;function I(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function N(e,t){var r=O._fullLayout.clickmode;R(O),2===e&&(O.emit("plotly_doubleclick",null),i.call("_guiRelayout",O,I({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,O,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&y.click(O,t,A.id)}function F(e,t){return 1-t/A.h}function j(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function B(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function H(a,i){var o=r+a*e,l=n+i*t,s=Math.max(0,Math.min(1,F(0,n),F(0,l))),c=Math.max(0,Math.min(1,j(r,n),j(o,l))),u=Math.max(0,Math.min(1,B(r,n),B(o,l))),m=(s/2+u)*A.w,y=(1-s/2-c)*A.w,v=(m+y)/2,x=y-m,_=(1-s)*A.h,w=_-x/S;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),M.transition().style("opacity",1).duration(200),b=!0),O.emit("plotly_relayouting",I(p))}function U(){R(O),p!==f&&(i.call("_guiRelayout",O,I(p)),P&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),P=!1))}function Y(e,t){var r=e/A.xaxis._m,n=t/A.yaxis._m,a=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),i=a.indexOf(p.a),s=a.indexOf(p.b),c=a.indexOf(p.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),p={a:a[i],b:a[s],c:a[c]},t=(f.a-p.a)*A.yaxis._m,e=(f.c-p.c-f.b+p.b)*A.xaxis._m);var d=l(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=l(-e,-t);A.clipDefRelative.select("path").attr("transform",h),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),O.emit("plotly_relayouting",I(p))}function q(){i.call("_guiRelayout",O,I(p))}this.dragOptions={element:L,gd:O,plotinfo:{id:A.id,domain:O._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],e=O._fullLayout._invScaleX,t=O._fullLayout._invScaleY;var m=A.dragOptions.dragmode=O._fullLayout.dragmode;v(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=H,A.dragOptions.clickFn=N,A.dragOptions.doneFn=U,function(e,t,i){var s=L.getBoundingClientRect();r=t-s.left,n=i-s.top,O._fullLayout._calcInverseTransform(O);var u=O._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,d=A.aaxis.range[1]-f.a,h=a(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),g="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,T=z.append("path").attr("class","zoombox").attr("transform",l(A.x0,A.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",g),M=z.append("path").attr("class","zoombox-corners").attr("transform",l(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(O)}(0,s,u)):"pan"===m?(A.dragOptions.moveFn=Y,A.dragOptions.clickFn=N,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearSelect(O)):(x(m)||v(m))&&_(i,s,u,A.dragOptions,m)}},L.onmousemove=function(e){y.hover(O,e,A.id),O._fullLayout._lasthover=L,O._fullLayout._hoversubplot=A.id},L.onmouseout=function(e){O._dragging||m.unhover(O,e)},m.init(this.dragOptions)}},{"../../components/color":157,"../../components/dragelement":176,"../../components/dragelement/helpers":175,"../../components/drawing":179,"../../components/fx":197,"../../components/titles":255,"../../lib":287,"../../lib/extend":281,"../../registry":376,"../cartesian/axes":334,"../cartesian/constants":341,"../cartesian/select":354,"../cartesian/set_convert":355,"../plots":369,"@plotly/d3":20,tinycolor2:121}],376:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in g(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":157,"../components/drawing":179,"../constants/xmlns_namespaces":268,"../lib":287,"@plotly/d3":20}],385:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[f+"a"],I=e[d+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var N=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,N,e),!1!==e.index&&y[e.index].p!==c){M||(O=function(e){return Math.min(k(e),e.p-v.bargroupwidth/2)},D=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var F=y[e.index],j=g.base?F.b+F.s:F.s;e[d+"0"]=e[d+"1"]=I.c2p(F[d],!0),e[d+"LabelVal"]=j;var B=v.extents[v.extents.round(F.p)];e[f+"0"]=z.c2p(x?O(F):B[0],!0),e[f+"1"]=z.c2p(x?D(F):B[1],!0);var H=void 0!==F.orig_p;return e[f+"LabelVal"]=H?F.orig_p:F.p,e.labelLabel=s(z,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=s(I,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=s(I,F.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(F)+function(e){return C(k(e),A(e),w)}(F))/2,e[f+"Spike"]=z.c2p(F.p,!0),o(F,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=f(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":157,"../../components/fx":197,"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/axes":334,"../../registry":376,"./helpers":392}],394:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":348,"../scatter/marker_colorbar":515,"./arrays_to_calcdata":385,"./attributes":386,"./calc":387,"./cross_trace_calc":389,"./defaults":390,"./event_data":391,"./hover":393,"./layout_attributes":395,"./layout_defaults":396,"./plot":397,"./select":398,"./style":400}],395:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],396:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function O(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,m=a.height,y=Math.abs(t-e),g=Math.abs(n-r),v=y>2*_&&g>2*_?_:0;y-=2*v,g-=2*v;var x=L(s);"auto"!==s||h<=y&&m<=g||!(h>y||m>g)||(h>g||m>y)&&h.01?q:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?q(e):e>t?Math.ceil(e):Math.floor(e)};F=V(F,j,z),j=V(j,F,z),B=V(B,H,!z),H=V(H,B,!z)}var G=k(i.ensureSingle(E,"path"),C,y,g);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-F)*(H-B))||U&&e._context.staticPlot?"M0,0Z":"M"+F+","+B+"V"+H+"H"+j+"V"+B+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&I){var Z=s.makePointStyleFns(f);s.singlePointStyle(c,G,f,Z,e)}!function(e,t,r,n,a,l,c,f,p,y,g){var w,T=t.xaxis,A=t.yaxis,D=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var E=n[0].trace,P="h"===E.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function m(e){return u(d,d.c2l(e),!0).text}var y=t[r],g={};g.label=y.p,g.labelLabel=g[s+"Label"]=(v=y.p,u(c,c.c2l(v),!0).text);var v;var x=i.castOption(o,y.i,"text");(0===x||x)&&(g.text=x);g.value=y.s,g.valueLabel=g[f+"Label"]=m(y.s);var _={};b(_,o,y.i),p&&(g.delta=+y.rawS||y.s,g.deltaLabel=m(g.delta),g.final=y.v,g.finalLabel=m(g.final),g.initial=g.final-g.delta,g.initialLabel=m(g.initial));h&&(g.value=y.s,g.valueLabel=m(g.value),g.percentInitial=y.begR,g.percentInitialLabel=i.formatPercent(y.begR),g.percentPrevious=y.difR,g.percentPreviousLabel=i.formatPercent(y.difR),g.percentTotal=y.sumR,g.percenTotalLabel=i.formatPercent(y.sumR));var w=i.castOption(o,y.i,"customdata");w&&(g.customdata=w);return i.texttemplateString(l,g,e._d3locale,_,g,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((g=e[t].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&m.push(f);if(l){var v=+p.rawS||p.s,x=p.v,b=x-v;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),y("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),y("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(v,o)}(D,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(E,a);var z="stack"===y.mode||"relative"===y.mode,I=n[a],N=!z||I._outmost;if(!R||"none"===w||(I.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var F=D.font,j=h.getBarColor(n[a],E),B=h.getInsideTextFont(E,a,F,j),H=h.getOutsideTextFont(E,a,F),U=r.datum();P?"log"===T.type&&U.s0<=0&&(l=T.range[0]=V*(X/G):X>=G*(W/V);V>0&&G>0&&(J||K||Q)?w="inside":(w="outside",Y.remove(),Y=null)}else w="inside";if(!Y){Z=i.ensureUniformFontSize(e,"outside"===w?H:B);var $=(Y=C(r,R,Z)).attr("transform");if(Y.attr("transform",""),q=s.bBox(Y.node()),V=q.width,G=q.height,Y.attr("transform",$),V<=0||G<=0)return void Y.remove()}var ee,te,re=E.textangle;"outside"===w?(te="both"===E.constraintext||"outside"===E.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var m=L(c),y=S(a,m),g=(l?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re})):(te="both"===E.constraintext||"inside"===E.constraintext,ee=O(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re,anchor:E.insidetextanchor}));ee.fontSize=Z.size,d(E.type,ee,D),I.transform=ee,k(Y,D,y,g).attr("transform",i.getTextTransform(ee))}(e,t,E,r,p,F,j,B,H,y,g),t.layerClipId&&s.hideOutsideRangePoint(c,E.select("text"),w,D,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,E,t,y)},toMoveInsideBar:O}},{"../../components/color":157,"../../components/drawing":179,"../../components/fx/helpers":193,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../registry":376,"./attributes":386,"./constants":388,"./helpers":392,"./style":400,"./uniform_text":402,"@plotly/d3":20,"fast-isnumeric":33}],398:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":157,"../../components/drawing":179,"../../lib":287,"../../registry":376,"./attributes":386,"./helpers":392,"./uniform_text":402,"@plotly/d3":20}],401:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":157,"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"../../lib":287}],402:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=oS.uf};if(t._hasPreCompStats){var H=t[x],U=function(e){return v.d2c((t[e]||[])[r])},Y=1/0,q=-1/0;for(r=0;r=S.q1&&S.q3>=S.med){var G=U("lowerfence");S.lf=G!==l&&G<=S.q1?G:p(S,D,C);var Z=U("upperfence");S.uf=Z!==l&&Z>=S.q3?Z:h(S,D,C);var W=U("mean");S.mean=W!==l?W:C?o.mean(D,C):(S.q1+S.q3)/2;var X=U("sd");S.sd=W!==l&&X>=0?X:C?o.stdev(D,C,S.mean):S.q3-S.q1,S.lo=m(S),S.uo=y(S);var J=U("notchspan");J=J!==l&&J>0?J:g(S,C),S.ln=S.med-J,S.un=S.med+J;var K=S.lf,Q=S.uf;t.boxpoints&&D.length&&(K=Math.min(K,D[0]),Q=Math.max(Q,D[C-1])),t.notched&&(K=Math.min(K,S.ln),Q=Math.max(Q,S.un)),S.min=K,S.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+S.q1,"median = "+S.med,"q3 = "+S.q3].join("\n")),$=S.med!==l?S.med:S.q1!==l?S.q3!==l?(S.q1+S.q3)/2:S.q1:S.q3!==l?S.q3:0,S.med=$,S.q1=S.q3=$,S.lf=S.uf=$,S.mean=S.sd=$,S.ln=S.un=$,S.min=S.max=$}Y=Math.min(Y,S.min),q=Math.max(q,S.max),S.pts2=O.filter(B),A.push(S)}}t._extremes[v._id]=a.findExtremes(v,[Y,q],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a=0&&ae0){var ue,fe;if((S={}).pos=S[_]=F[r],O=S.pts=ne[r].sort(f),C=(D=S[x]=O.map(d)).length,S.min=D[0],S.max=D[C-1],S.mean=o.mean(D,C),S.sd=o.stdev(D,C,S.mean),S.med=o.interp(D,.5),C%2&&(se||ce))se?(ue=D.slice(0,C/2),fe=D.slice(C/2+1)):ce&&(ue=D.slice(0,C/2+1),fe=D.slice(C/2)),S.q1=o.interp(ue,.5),S.q3=o.interp(fe,.5);else S.q1=o.interp(D,.25),S.q3=o.interp(D,.75);S.lf=p(S,D,C),S.uf=h(S,D,C),S.lo=m(S),S.uo=y(S);var de=g(S,C);S.ln=S.med-de,S.un=S.med+de,ie=Math.min(ie,S.ln),oe=Math.max(oe,S.un),S.pts2=O.filter(B),A.push(S)}t._extremes[v._id]=a.findExtremes(v,t.notched?ee.concat([ie,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(A[0].t={num:T[L],dPos:j,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean?s(e,"mean \xb1 \u03c3:"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},T[L]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(e,t,r){for(var n in c)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[c[n]]=t[n][r[0]][r[1]]):e[c[n]]=t[n][r])}function f(e,t){return e.v-t.v}function d(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function m(e){return 4*e.q1-3*e.q3}function y(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"fast-isnumeric":33}],405:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],m=0;for(l=0;l1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var q=S.pointpos,V=S.jitter,G=S.marker.size/2,Z=0;q+V>=0&&((Z=U*(q+V))>A?(Y=!0,B=G,F=Z):Z>I&&(B=G,F=A)),Z<=A&&(F=A);var W=0;q-V<=0&&((W=-U*(q-V))>L?(Y=!0,H=G,j=W):W>N&&(H=G,j=L)),W<=L&&(j=L)}else F=A,j=L;var X=new Array(c.length);for(s=0;s0?(y="v",g=x>0?Math.min(_,b):Math.min(b)):x>0?(y="h",g=Math.min(_)):g=0;if(g){t._length=g;var L=r("orientation",y);t._hasPreCompStats?"v"===L&&0===x?(r("x0",0),r("dx",1)):"h"===L&&0===v&&(r("y0",0),r("dy",1)):"v"===L&&0===x?r("x0"):"h"===L&&0===v&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function f(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,c,"marker.outliercolor"),l=r("marker.line.outliercolor"),s="outliers";t._hasPreCompStats?s="all":(o||l)&&(s="suspectedoutliers");var u=r(i+"points",s);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function l(r,a){return n.coerce(e,t,c,r,a)}if(u(e,t,l,a),!1!==t.visible){o(e,t,a,l),l("xhoverformat"),l("yhoverformat");var s=t._hasPreCompStats;s&&(l("lowerfence"),l("upperfence")),l("line.color",(e.marker||{}).color||r),l("line.width"),l("fillcolor",i.addOpacity(t.line.color,.5));var d=!1;if(s){var p=l("mean"),h=l("sd");p&&p.length&&(d=!0,h&&h.length&&(d="sd"))}l("boxmean",d),l("whiskerwidth"),l("width"),l("quartilemethod");var m=!1;if(s){var y=l("notchspan");y&&y.length&&(m=!0)}else n.validate(e.notchwidth,c.notchwidth)&&(m=!0);l("notched",m)&&l("notchwidth"),f(e,t,l,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,c,e)}for(var o=0;oe.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,f=i.bPos,d=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=c.c2l(e.pos+f,!0),a=c.l2p(t-o)+d,i=c.l2p(t+l)+d,h=u?(a+i)/2:c.l2p(t)+d,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),g=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+g+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":179,"../../lib":287,"@plotly/d3":20}],413:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,l=[];if(!1===t)for(r=0;ro.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var l=n.x.length,s=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],418:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,l=t.line,s=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:l.color,width:!1!==o.showlines?l.width:0,dash:l.dash},r._levels={start:o.start,end:i(o),size:s}}}},{"../../components/colorscale":169,"./end_plus":426,"./make_color_map":431}],419:[function(e,t,r){"use strict";t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],420:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,l=i.opacity,s=e("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,r,i,s,f){var d,p,h,m=t.contours,y=r("contours.operation");(m._operation=c[y],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,m),"="===y?d=m.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(t.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":157,"../../constants/filter_ops":265,"./label_defaults":430,"fast-isnumeric":33}],421:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function l(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":265,"fast-isnumeric":33}],422:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],423:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,l=function(e){return e.reverse()},s=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return s}},{"../../lib":287,"./constraint_mapping":421,"./end_plus":426}],426:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],427:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1;return[n,i]}(f,r,t),p=[l(e,t,[-d[0],-d[1]])],h=e.z.length,m=e.z[0].length,y=t.slice(),g=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}p.push(l(e,t,d)),t[0]+=d[0],t[1]+=d[1],u=t.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var v=d[0]&&(t[0]<0||t[0]>m-2)||d[1]&&(t[1]<0||t[1]>h-2);if(t[0]===y[0]&&t[1]===y[1]&&d[0]===g[0]&&d[1]===g[1]||r&&v)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,M,k,A,L,S,O,D,C,E,P,R=i(p[0],p[p.length-1],o,s),z=0,I=.2*e.smoothing,N=[],F=0;for(c=1;c=F;c--)if((x=N[c])=F&&x+N[b]A&&L--,e.edgepaths[L]=O.concat(p,S));break}U||(e.edgepaths[A]=p.concat(S))}for(A=0;Ae?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,l,s,c,u,f,d=e[0].z,p=d.length,h=d[0].length,m=2===p||2===h;for(r=0;r=0&&(n=v,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,l>=0)break;f+="L"+n}if(l===e.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.center?n.right-l:l-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(f)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var h=g.EDGECOST*(1/(d-1)+1/(p-1));h+=g.ANGLECOST*c*c;for(var m=l-u,y=s-f,v=l+u,x=s+f,b=0;b2*g.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=g.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),l=e.x,s=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),d=function(e,t){return[l+e*f-t*u,s+e*u+t*f]},p=[d(-i/2,-o/2),d(-i/2,o/2),d(i/2,o/2),d(i/2,-o/2)];r.push({text:t.text,x:l,y:s,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(p)},r.drawLabels=function(e,t,r,i,o){var s=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=e._input.contours;if(u>f&&(r.start=d.start=f,f=r.end=d.end=u,u=r.start),!(r.size>0))c=u===f?1:i(u,f,e.ncontours).dtick,d.size=r.size=c}}},{"../../lib":287,"../../plots/cartesian/axes":334}],435:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[0].trace,i=r.contours,l=r.line,s=i.size||1,c=i.start,u="constraint"===i.type,f=!u&&"lines"===i.coloring,d=!u&&"fill"===i.coloring,p=f||d?o(r):null;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(e.level):l.color,l.dash)}));var h=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):l.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),p(e.level+.5*s)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",p(m-.5*s))}})),i(e)}},{"../../components/drawing":179,"../heatmap/style":449,"./make_color_map":431,"@plotly/d3":20}],436:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,r,i,o){var l,s=r("contours.coloring"),c="";"fill"===s&&(l=r("contours.showlines")),!1!==l&&("lines"!==s&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==s&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":167,"./label_defaults":430}],437:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../components/colorscale/attributes"),s=e("../../lib/extend").extendFlat;t.exports=s({z:{valType:"data_array",editType:"calc"},x:s({},n.x,{impliedEdits:{xtype:"array"}}),x0:s({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:s({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:s({},n.y,{impliedEdits:{ytype:"array"}}),y0:s({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:s({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:s({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:s({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:s({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:s({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:s({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:s({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z",1),hovertemplate:o(),showlegend:s({},a.showlegend,{dflt:!1})},{transforms:void 0},l("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":371,"../scatter/attributes":497}],438:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../histogram2d/calc"),s=e("../../components/colorscale/calc"),c=e("./convert_column_xyz"),u=e("./clean_2d_array"),f=e("./interp2d"),d=e("./find_empties"),p=e("./make_bound_array"),h=e("../../constants/numerical").BADNUM;function m(e){for(var t=[],r=e.length,n=0;nz){P("x scale is not linear");break}}if(x.length&&"fast"===C){var I=(x[x.length-1]-x[0])/(x.length-1),N=Math.abs(I/100);for(M=0;MN){P("y scale is not linear");break}}}var F=a.maxRowLength(T),j="scaled"===t.xtype?"":r,B=p(t,j,y,g,F,A),H="scaled"===t.ytype?"":x,U=p(t,H,b,_,T.length,L);D||(t._extremes[A._id]=i.findExtremes(A,B),t._extremes[L._id]=i.findExtremes(L,U));var Y={x:B,y:U,z:T,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(Y.orig_x=v),t.yperiodalignment&&w&&(Y.orig_y=w),j&&j.length===B.length-1&&(Y.xCenter=j),H&&H.length===U.length-1&&(Y.yCenter=H),O&&(Y.xRanges=k.xRanges,Y.yRanges=k.yRanges,Y.pts=k.pts),S||s(e,t,{vals:T,cLetter:"z"}),S&&t.contours&&"heatmap"===t.contours.coloring){var q={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};Y.xfill=p(q,j,y,g,F,A),Y.yfill=p(q,H,b,_,T.length,L)}return[Y]}},{"../../components/colorscale/calc":165,"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"../../registry":376,"../histogram2d/calc":466,"./clean_2d_array":439,"./convert_column_xyz":441,"./find_empties":443,"./interp2d":446,"./make_bound_array":447}],439:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var l,s,c,u,f,d;function p(e){if(n(e))return+e}if(t&&t.transpose){for(l=0,f=0;f=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||m)[2]+(f[[r+1,a]]||m)[2]+(f[[r,a-1]]||m)[2]+(f[[r,a+1]]||m)[2])/20)&&(s[i]=[r,a,l],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in s)f[i]=s[i],u.push(s[i])}return u.sort((function(e,t){return t[2]-e[2]}))}},{"../../lib":287}],444:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,l,s){s||(s={});var c,u,f,d,p=s.isContour,h=e.cd[0],m=h.trace,y=e.xa,g=e.ya,v=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,M=m.zhoverformat,k=v,A=x;if(!1!==e.index){try{f=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||d<0||d>b.length)return}else{if(n.inbox(t-v[0],t-v[v.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var L;for(k=[2*v[0]-v[1]],L=1;Lm&&(g=Math.max(g,Math.abs(e[i][o]-h)/(y-m))))}return g}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":287}],447:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,l){var s,c,u,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!p&&"category"!==l.type){var m=t.length;if(!(m<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u0;)d=p.c2p(T[v]),v--;for(d0;)g=h.c2p(M[v]),v--;if(g0&&(i=!0);for(var s=0;si){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],m=r[1],y=Math.min(f(h+d,h+p,n,i),f(m+d,m+p,n,i)),g=Math.min(f(h+c,h+d,n,i),f(m+c,m+d,n,i));if(y>g&&go){var v=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",v);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(F)&&(B=o.tickIncrement(B,b.size,!0,p)),R.start=r.l2r(B),N||a.nestedProperty(t,g+".start").set(R.start)}var H=b.end,U=r.r2l(P.end),Y=void 0!==U;if((b.endFound||Y)&&U!==r.r2l(H)){var q=Y?U:a.aggNums(Math.max,null,h);R.end=r.l2r(q),Y||a.nestedProperty(t,g+".start").set(R.end)}var V="autobin"+l;return!1===t._input[V]&&(t._input[g]=a.extendFlat({},t[g]||{}),delete t._input[V],delete t[V]),[R,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],g=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),v="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[v],b=t[v+"calendar"],_=t.cumulative,w=d(e,t,g,v),T=w[0],M=w[1],k="string"==typeof T.size,A=[],L=k?A:T,S=[],O=[],D=[],C=0,E=t.histnorm,P=t.histfunc,R=-1!==E.indexOf("density");_.enabled&&R&&(E=E.replace(/ ?density$/,""),R=!1);var z,I="max"===P||"min"===P?null:0,N=s.count,F=c[E],j=!1,B=function(e){return g.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==P&&(z=t[x],j="avg"===P,N=s[P]),r=B(T.start),p=B(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,_.direction,_.currentbin);var J=Math.min(m.length,y.length),K=[],Q=0,$=J-1;for(r=0;r=Q;r--)if(y[r]){$=r;break}for(r=Q;r<=$;r++)if(n(m[r])&&n(y[r])){var ee={p:m[r],s:y[r],b:0};_.enabled||(ee.pts=D[r],V?ee.ph0=ee.ph1=D[r].length?M[D[r][0]]:m[r]:(t._computePh=!0,ee.ph0=Y(A[r]),ee.ph1=Y(A[r+1],!0))),K.push(ee)}return 1===K.length&&(K[0].width1=o.tickIncrement(K[0].p,T.size,!1,b)-K[0].p),l(K,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(K,t,W),K},calcAllAutoBins:d}},{"../../lib":287,"../../plots/cartesian/axes":334,"../../registry":376,"../bar/arrays_to_calcdata":385,"./average":453,"./bin_functions":455,"./bin_label_vals":456,"./norm_functions":464,"fast-isnumeric":33}],458:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],459:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,m,y,g=t._histogramBinOpts={},v=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=g[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;hL&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],O=[],D=[],C="string"==typeof w.size,E="string"==typeof k.size,P=[],R=[],z=C?P:w,I=E?R:k,N=0,F=[],j=[],B=t.histnorm,H=t.histfunc,U=-1!==B.indexOf("density"),Y="max"===H||"min"===H?null:0,q=i.count,V=o[B],G=!1,Z=[],W=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==H&&(G="avg"===H,q=i[H]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-a.tickIncrement(K,J,!1,g))/1e6;for(r=K;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u,f=Math.floor((t-o.x0)/l.dx),d=Math.floor(Math.abs(r-o.y0)/l.dy);if(l._hasZ?u=o.z[d][f]:l._hasSource&&(u=l._canvas.el.getContext("2d").getImageData(f,d,1,1).data),u){var p,h=o.hi||l.hoverinfo;if(h){var m=h.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var y,g=i.colormodel[l.colormodel],v=g.colormodel||l.colormodel,x=v.length,b=l._scaler(u),_=g.suffix,w=[];(l.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),e.extraText=v.toUpperCase()+": "+w),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[d])?y=l.hovertext[d][f]:Array.isArray(l.text)&&Array.isArray(l.text[d])&&(y=l.text[d][f]);var T=c.c2p(o.y0+(d+.5)*l.dy),M=o.x0+(f+.5)*l.dx,k=o.y0+(d+.5)*l.dy,A="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{index:[d,f],x0:s.c2p(o.x0+f*l.dx),x1:s.c2p(o.x0+(f+1)*l.dx),y0:T,y1:T,color:b,xVal:M,xLabelVal:M,yVal:k,yLabelVal:k,zLabelVal:A,text:y,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":197,"../../lib":287,"./constants":476}],481:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":348,"./attributes":474,"./calc":475,"./defaults":477,"./event_data":478,"./hover":480,"./plot":482,"./style":483}],482:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.strTranslate,o=e("../../constants/xmlns_namespaces"),l=e("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();t.exports=function(e,t,r,c){var u=t.xaxis,f=t.yaxis,d=!(s||e._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),s=t[0],c=s.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&d)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var h,m,y,g,v,x,b=s.z,_=s.x0,w=s.y0,T=s.w,M=s.h,k=c.dx,A=c.dy;for(x=0;void 0===h&&x0;)m=u.c2p(_+x*k),x--;for(x=0;void 0===g&&x0;)v=f.c2p(w+x*A),x--;if(mE[0];if(P||R){var z=h+L/2,I=g+S/2;D+="transform:"+i(z+"px",I+"px")+"scale("+(P?-1:1)+","+(R?-1:1)+")"+i(-z+"px",-I+"px")+";"}}O.attr("style",D);var N=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=M;var r=t.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e;if(c._hasZ)e=F((function(e,t){return b[t][e]})).toDataURL("image/png");else if(c._hasSource)if(p)e=c.source;else{var t=c._canvas.el.getContext("2d").getImageData(0,0,T,M).data;e=F((function(e,r){var n=4*(r*T+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}O.attr({"xlink:href":e,height:S,width:L,x:h,y:g})}));e._promises.push(N)}function F(e){var t=document.createElement("canvas");t.width=L,t.height=S;var r,n=t.getContext("2d"),i=function(e){return a.constrain(Math.round(u.c2p(_+e*k)-h),0,L)},o=function(e){return a.constrain(Math.round(f.c2p(w+e*A)-g),0,S)},d=l.colormodel[c.colormodel],p=d.colormodel||c.colormodel,m=d.fmt;for(x=0;x0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":287,"../../plots/domain":362,"../bar/defaults":390,"./attributes":484,"fast-isnumeric":33}],488:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":193}],489:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(f||p){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(l||h||f){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||d)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function O(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function D(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=E(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function E(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function I(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),P(t,i);var d=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var d=n.select(this),h=t[0],m=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),d.attr("stroke-linejoin","round"),d.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],_=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),d=u.selectAll("path.surface").data([a]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),m.pull){var g=+y.castOption(m.pull,a.pts)||0;g>0&&(o+=g*a.pxmid[0],c+=g*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===h.vTotal){var M="M"+(o+a.px0[0])+","+(c+a.px0[1])+D(a.px0,a.pxmid,!0,1)+D(a.pxmid,a.px0,!0,1)+"Z";T?d.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+D(a.px0,a.pxmid,!1,T)+D(a.pxmid,a.px0,!1,T)+"Z"+M):d.attr("d",M)}else{var k=D(a.px0,a.px1,!0,1);if(T){var A=1-T;d.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+D(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+k+"Z")}else d.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+k+"Z")}z(e,a,h);var L=y.castOption(m.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):b(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var g,v=l.bBox(u.node());if("outside"===L)g=O(v,a);else if(g=w(v,a,h),"auto"===L&&g.scale<1){var x=s.ensureUniformFontSize(e,m.outsidetextfont);u.call(l.font,x),g=O(v=l.bBox(u.node()),a)}var T=g.textPosAngle,M=void 0===T?a.pxmid:R(h.r,T);if(g.targetX=o+M[0]*g.rCenter+(g.x||0),g.targetY=c+M[1]*g.rCenter+(g.y||0),I(g,v),g.outside){var k=g.targetY;a.yLabelMin=k-v.height/2,a.yLabelMid=k,a.yLabelMax=k+v.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}g.fontSize=d.size,p(m.type,g,r),t[i].transform=g,u.attr("transform",s.getTextTransform(g))}))}function D(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=s.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,m.title.font).call(f.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):D(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),v=p-h;if(v*s>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=v):(m+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,m),_&&m.automargin){var M=l.bBox(d.node()),k=m.domain,A=i.w*(k.x[1]-k.x[0]),L=i.h*(k.y[1]-k.y[0]),S=(.5*A-h.r)/i.w,C=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(h.cx-h.r-M.left,0),r:Math.max(M.right-(h.cx+h.r),0),b:Math.max(M.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-M.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:D,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:I}},{"../../components/color":157,"../../components/drawing":179,"../../components/fx":197,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/plots":369,"../bar/constants":388,"../bar/uniform_text":402,"./event_data":488,"./helpers":489,"@plotly/d3":20}],494:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":402,"./style_one":495,"@plotly/d3":20}],495:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":157,"./helpers":489}],496:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&D[g].gap;)g--;for(x=D[g].s,m=D.length-1;m>g;m--)D[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],504:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,y){function g(r,a){return n.coerce(e,t,i,r,a)}var v=s(e,t,y,g);if(v||(t.visible=!1),t.visible){c(e,t,y,g),g("xhoverformat"),g("yhoverformat");var x=u(e,t,y,g),b=!x&&v=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=R[E][1])>=Z&&(I=R[E-1][0],N=R[E][0],j-F&&(z=I+(N-I)*(Z-F)/(j-F),Y=Math.min(Y,z),q=Math.max(q,z)));Y=Math.max(Y,0),q=Math.min(q,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:Y,x1:q,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":157,"../../components/fx":197,"../../lib":287,"../../registry":376,"./get_trace_color":507}],509:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":348,"./arrays_to_calcdata":496,"./attributes":497,"./calc":498,"./cross_trace_calc":502,"./cross_trace_defaults":503,"./defaults":504,"./format_labels":506,"./hover":508,"./marker_colorbar":515,"./plot":518,"./select":519,"./style":521,"./subtypes":522}],510:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"../../lib":287}],511:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,m,y,g,v,x,b,_,w,T,M,k,A,L=t.xaxis,S=t.yaxis,O="log"===L.type,D="log"===S.type,C=L._length,E=S._length,P=t.connectGaps,R=t.baseTolerance,z=t.shape,I="linear"===z,N=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),U=0;function Y(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(O&&(i=L.c2p(n.x,!0)),i===a)return!1;D&&s===a&&(i*=Math.abs(L._m*E*(L._m>0?o:l)/(S._m*C*(S._m>0?o:l)))),i*=1e3}if(s===a){if(D&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function q(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[U-1][0],a=r===H[U-1][1];if(!n||!a)if(U>1){var i=t===H[U-2][0],o=r===H[U-2][1];n&&(t===te||t===re)&&i?o?U--:H[U-1]=e:a&&(r===ne||r===ae)&&o?i?U--:H[U-1]=e:H[U++]=e}else H[U++]=e}function ue(e){H[U-1][0]!==e[0]&&H[U-1][1]!==e[1]&&ce([X,J]),ce(e),K=null,X=J=0}function fe(e){if(k=e[0]/C,A=e[1]/E,Z=e[0]re?re:0,W=e[1]ae?ae:0,Z||W){if(U)if(K){var t=$(K,e);t.length>1&&(ue(t[0]),H[U++]=t[1])}else Q=$(H[U-1],e)[0],H[U++]=Q;else H[U++]=[Z||e[0],W||e[1]];var r=H[U-1];Z&&W&&(r[0]!==Z||r[1]!==W)?(K&&(X!==Z&&J!==W?ce(X&&J?(n=K,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[X||Z,J||W]):X&&J&&ce([X,J])),ce([Z,W])):X-Z&&J-W&&ce([Z||X,W||J]),K=e,X=Z,J=W}else K&&ue($(K,e)[0]),H[U++]=e;var n,a,i,o}for("linear"===z||"spline"===z?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,e)V(h,de))break;i=h,(_=g[0]*y[0]+g[1]*y[1])>x?(x=_,d=h,m=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}K&&ce([X||K[0],J||K[1]]),F.push(H.slice(0,U))}return F}},{"../../constants/numerical":267,"../../lib":287,"./constants":501}],512:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],513:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":33}],515:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],516:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":157,"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"./subtypes":522}],517:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":267,"../../lib":287}],518:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,O;v(T).style("opacity",_.opacity);var D=_.fill.charAt(_.fill.length-1);"x"!==D&&"y"!==D&&(D=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,E,P="",R=[],z=_._prevtrace;z&&(P=z._prevRevpath||"",O=z._nextFill,R=z._polygons);var I,N,F,j,B,H,U,Y="",q="",V=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(O&&O.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):I=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},V=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(V.length),y=0;y1){var r=n.select(this);if(r.datum(f),e)v(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),s.singleLineStyle(f,a)}}}}}var Z=k.selectAll(".js-line").data(V);v(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),V.length?(S?(S.datum(f),j&&H&&(D?("y"===D?j[1]=H[1]=b.c2p(0,!0):"x"===D&&(j[0]=H[0]=x.c2p(0,!0)),v(S).attr("d","M"+H+"L"+j+"L"+Y.substr(1)).call(s.singleFillStyle)):v(S).attr("d",Y+"Z").call(s.singleFillStyle))):O&&("tonext"===_.fill.substr(0,6)&&Y&&P?("tonext"===_.fill?v(O).attr("d",Y+"Z"+P+"Z").call(s.singleFillStyle):v(O).attr("d",Y+"L"+P.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(X(O),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?X(S):O&&X(O),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,m=te;if(f||d){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?K:J:_&&!w&&(y=Q),f&&(h=y),d&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function X(e){v(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,m=!!i&&i.duration>0,y=f(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":179,"../../lib":287,"../../lib/polygon":299,"../../registry":376,"./line_points":511,"./link_traces":513,"./subtypes":522,"@plotly/d3":20}],519:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(e,t){g.push(e._hovertitle+": "+t)}}},{"../scatter/hover":508}],531:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":372,"../scatter/marker_colorbar":515,"../scatter/select":519,"../scatter/style":521,"./attributes":525,"./calc":526,"./defaults":527,"./event_data":528,"./format_labels":529,"./hover":530,"./plot":532}],532:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},o=t.layers.frontplot.select("g.scatterlayer");n(e,i,r,o)}},{"../scatter/plot":518}],533:[function(e,t,r){"use strict";var n=e("../box/attributes"),a=e("../../lib/extend").extendFlat,i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat;t.exports={y:n.y,x:n.x,x0:n.x0,y0:n.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:a({},n.name,{}),orientation:a({},n.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,points:a({},n.boxpoints,{}),jitter:a({},n.jitter,{}),pointpos:a({},n.pointpos,{}),width:a({},n.width,{}),marker:n.marker,text:n.text,hovertext:n.hovertext,hovertemplate:n.hovertemplate,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"}}},{"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../box/attributes":403}],534:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../box/calc"),o=e("./helpers"),l=e("../../constants/numerical").BADNUM;function s(e,t,r){var a=t.max-t.min;if(!a)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,a/1e4);var i=r.length,o=n.stdev(r,i-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(i,o,t.q3-t.q1),a/100)}function c(e,t,r,n){var i,o=e.spanmode,s=e.span||[],c=[t.min,t.max],u=[t.min-2*n,t.max+2*n];function f(n){var a=s[n],i="multicategory"===r.type?r.r2c(a):r.d2c(a,0,e[t.valLetter+"calendar"]);return i===l?u[n]:i}var d={type:"linear",range:i="soft"===o?u:"hard"===o?c:[f(0),f(1)]};return a.setConvert(d),d.cleanRange(),i}t.exports=function(e,t){var r=i(e,t);if(r[0].t.empty)return r;for(var l=e._fullLayout,u=a.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),f=1/0,d=-1/0,p=0,h=0,m=0;m0){var x,b,_,w,T,M=e.xa,k=e.ya;"h"===p.orientation?(T=t,x="y",_=k,b="x",w=M):(T=r,x="x",_=M,b="y",w=k);var A=d[e.index];if(T>=A.span[0]&&T<=A.span[1]){var L=n.extendFlat({},e),S=w.c2p(T,!0),O=o.getKdeValue(A,p,T),D=o.getPositionOnKdePath(A,p,S),C=_._offset,E=_._length;L[x+"0"]=D[0],L[x+"1"]=D[1],L[b+"0"]=L[b+"1"]=S,L[b+"Label"]=b+": "+a.hoverLabelText(w,T,p[b+"hoverformat"])+", "+d[0].t.labels.kde+" "+O.toFixed(3),L.spikeDistance=v[0].spikeDistance;var P=x+"Spike";L[P]=v[0][P],v[0].spikeDistance=void 0,v[0][P]=void 0,L.hovertemplate=!1,g.push(L),(u={stroke:e.color})[x+"1"]=n.constrain(C+D[0],C,C+E),u[x+"2"]=n.constrain(C+D[1],C,C+E),u[b+"1"]=u[b+"2"]=w._offset+S}}m&&(g=g.concat(v))}-1!==h.indexOf("points")&&(c=i.hoverOnPoints(e,t,r));var R=f.selectAll(".violinline-"+p.uid).data(u?[0]:[]);return R.enter().append("line").classed("violinline-"+p.uid,!0).attr("stroke-width",1.5),R.exit().remove(),R.attr(u),"closest"===l?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":287,"../../plots/cartesian/axes":334,"../box/hover":408,"./helpers":537}],539:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../box/select"),moduleType:"trace",name:"violin",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":348,"../box/defaults":406,"../box/select":413,"../scatter/style":521,"./attributes":533,"./calc":534,"./cross_trace_calc":535,"./defaults":536,"./hover":538,"./layout_attributes":540,"./layout_defaults":541,"./plot":542,"./style":543}],540:[function(e,t,r){"use strict";var n=e("../box/layout_attributes"),a=e("../../lib").extendFlat;t.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":287,"../box/layout_attributes":410}],541:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../box/layout_defaults");t.exports=function(e,t,r){i._supply(e,t,r,(function(r,i){return n.coerce(e,t,a,r,i)}),"violin")}},{"../../lib":287,"../box/layout_defaults":411,"./layout_attributes":540}],542:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../box/plot"),l=e("../scatter/line_points"),s=e("./helpers");t.exports=function(e,t,r,c){var u=e._fullLayout,f=t.xaxis,d=t.yaxis;function p(e){var t=l(e,{xaxis:f,yaxis:d,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(t[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(e){var r=n.select(this),i=e[0],l=i.t,c=i.trace;if(!0!==c.visible||l.empty)r.remove();else{var h=l.bPos,m=l.bdPos,y=t[l.valLetter+"axis"],g=t[l.posLetter+"axis"],v="both"===c.side,x=v||"positive"===c.side,b=v||"negative"===c.side,_=r.selectAll("path.violin").data(a.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(e){var t,r,a,i,o,s,f,d,_=n.select(this),w=e.density,T=w.length,M=g.c2l(e.pos+h,!0),k=g.l2p(M);if(c.width)t=l.maxKDE/m;else{var A=u._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?A.maxKDE/m*(A.maxCount/e.pts.length):A.maxKDE/m}if(x){for(f=new Array(T),o=0;oa&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],69:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var d=t.linesIntersect(o,l,c,u);if(!1===d){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var f=t.pointsSame(o,c),p=t.pointsSame(l,u);if(f&&p)return n;var h=!f&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(f)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===d.alongA&&(-1===d.alongB?s(e,c):0===d.alongB?s(e,d.pt):1===d.alongB&&s(e,u)),0===d.alongB&&(-1===d.alongA?s(n,o):0===d.alongA?s(n,d.pt):1===d.alongA&&s(n,l));return!1}for(var d=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(f,h);if(e)return e}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!h&&h.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(e)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(v.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(e)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)g=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:g,below:g};r&&r.status(f.seg,!!h&&h.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}d.push(f.seg)}i.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":74,timers:75}],76:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,d=!1,f=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:R(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(m,255)},d=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=N(t.s),c=N(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),d=!0,f="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=N(t.s),u=N(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),d=!0,f="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=D(i),{ok:d,format:t.format||f,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:N(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),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})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],77:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=f[o-f[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=d[e-d[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=d[o.year-d[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=f[a.year-f[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=f[i.year-f[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=d[i.year-d[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":91,"object-assign":64}],80:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":91,"object-assign":64}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":91,"object-assign":64}],82:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":91,"object-assign":64}],83:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":91,"object-assign":64}],84:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":91,"object-assign":64}],85:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":91,"object-assign":64}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),d=e-this.toJD(s,u,1)+1;return this.newDate(s,u,d)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":91,"object-assign":64}],88:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":91,"object-assign":64}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":91,"object-assign":64}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":91,"object-assign":64}],91:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":64}],92:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,d=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){v("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(f,p);h>S;S=this.daysInMonth(f,p))p++,h-=S}return d>-1?this.fromJD(d):this.newDate(f,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":91,"object-assign":64}],93:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],94:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":217,"../../plot_api/plot_template":278,"../../plots/cartesian/constants":296,"../../plots/font_attributes":318,"./arrow_paths":93}],95:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],d=e["_"+i+"padminus"],f={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+f,m=p-f,y=3*e.startarrowsize*e.arrowwidth||0,g=y+f,v=y-f;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(d,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,v=l?v-l:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(d,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":242,"../../plots/cartesian/axes":289,"./draw":100}],96:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,d=[],f=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),d={},f=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,X=["x","y"],W=0;W1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===fe;"x"===te?(K=t[te],J=he?ae._offset+ae._length*K:J=T.l+T.w*K):(K=1-t[te],J=he?ae._offset+ae._length*K:J=T.t+T.h*K),$=t.showarrow?.5:K}if(t.showarrow){de.head=J;var me=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),de.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,de.tail=T.t+T.h*me):de.tail=T.l+T.w*me:de.tail=ae._offset+ae.r2p(me),Q=ee}else de.tail=J+me,Q=ee+me;de.text=de.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(de.head=o.constrain(de.head,1,ge-1)),"pixel"===ne){var ve=-Math.max(de.tail-3,de.text),xe=Math.min(de.tail+3,de.text)-ge;ve>0?(de.tail+=ve,de.text+=ve):xe>0&&(de.tail-=xe,de.text-=xe)}de.tail+=ue,de.head+=ue}else Q=ee=se*U($,ce),de.text=J+ee;de.text+=ue,ee+=ue,Q+=ue,t["_"+te+"padplus"]=se/2+Q,t["_"+te+"padminus"]=se/2-Q,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)R.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),d)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;q.call(f.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),R.call(u.setTranslate,Math.round(O.x.text-E/2),Math.round(O.y.text-V/2)),I.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,d=O.y.head,f=O.x.tail+r,p=O.y.tail+n,m=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),N=+H.attr("height"),z=m-.5*D,F=z+D,E=b-.5*N,j=E+N,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,d,s+1e6,d+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(f,p,s,d,e[0],e[1],e[2],e[3]);t&&(f=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,q=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+f+","+p+"L"+s+","+d).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(y(G,U,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,X=d;if(t.standoff){var W=Math.sqrt(Math.pow(s-f,2)+Math.pow(d-p,2));Z+=t.standoff*(f-s)/W,X+=t.standoff*(p-d)/W}var J,Q,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-X),transform:l(Z,X)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:K.node(),gd:e,prepFn:function(){var e=u.getTranslate(R);J=e.x,Q=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,Q),a=n[0]+e,i=n[1]+r;R.call(u.setTranslate,a,i),L("x",v(g,e,"x",T,t)),L("y",v(x,r,"y",T,t)),t.axref===t.xref&&L("ax",v(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",v(x,r,"ay",T,t)),q.attr("transform",l(e,r)),I.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),N)h.init({element:R.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",v(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",v(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=v(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=v(x,r,"y",T,t);else{var u=t._ysize/T.h,d=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(d-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(R,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(R),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(d=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void N();if(b){if(b*b>w*w+T*T)return void N();var M=b*Math.cos(d),k=b*Math.sin(d);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void N();var A=_*Math.cos(d),L=_*Math.sin(d);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":321,"../annotations/draw":100}],107:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Z*=J*c.roundUp(W/J,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+H,V+F-H],G.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var Q,K=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),m.draw(r,n,d(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+E)*s.w,n=G.title.font.size;e="top"===A?(1-(V+F-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,te(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),d=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),f?(ee=p.bBox(f).height)>h&&(d[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)G.domain[1]-=ee/s.h,d[1]*=-1;else{G.domain[0]+=ee/s.h;var m=y.lineCount(o);d[1]+=(1-m)*h}i.attr("transform",u(d[0],d[1])),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-G.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var v=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(P);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var x=L.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?L[0]:(P[i]+P[i-1])/2,i===P.length-1?L[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:B,width:Math.max(N,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=D(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(g.color&&g.width?I:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(e))+g.width/2%1)+"h"+N).call(p.lineGroupStyle,g.width,S(e),g.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var _=B+N+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(G),M=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,T):T,layer:$,path:l.makeTickPath(G,_,M),transFn:l.makeTransTickFn(G)}),l.drawLabels(r,G,{vals:T,layer:$,transFn:l.makeTransTickLabelFn(G),labelFns:l.makeLabelFns(G,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));te("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=N+t.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(K.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=U-q;e.select("."+k.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:q-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:B,y:q+t.ypad+("top"===A?ee:0),width:Math.max(N,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var d=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-d,s.t));var f={},m=T[t.yanchor],y=M[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*m,f.b=c*y):(f.t=f.b=0,f.yt=t.y+t.len*m,f.yb=t.y-t.len*y);var g=T[t.xanchor],v=M[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*g,f.r=l*v;else{var x=l-N;f.l=x*g,f.r=x*v,f.xl=t.x-t.thickness*g,f.xr=t.x+t.thickness*v}i.autoMargin(r,t._id,f)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":216,"../../lib":242,"../../lib/extend":236,"../../lib/setcursor":262,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../plots/cartesian/axis_defaults":291,"../../plots/cartesian/layout_attributes":304,"../../plots/cartesian/position_defaults":307,"../../plots/plots":324,"../../registry":326,"../color":111,"../colorscale/helpers":122,"../dragelement":130,"../drawing":133,"../titles":209,"./constants":113,"@plotly/d3":18,tinycolor2:76}],116:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":242}],117:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":112,"./defaults":114,"./draw":115,"./has_colorbar":116}],118:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,d=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(f+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",g=(l(f+p),l(f+h),l(f+m),{});g[h]=g[m]=void 0;var v={};v[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:d||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":258,"../../lib/sort_object_keys":263,"../colorbar/attributes":112,"./scales.js":126}],119:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,d=i(u),f=!1!==d.auto,p=d.min,h=d.max,m=d.mid,y=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():f&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=g():f&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),f&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",o))}},{"../../lib":242,"./helpers":122,"fast-isnumeric":26}],120:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],128:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":242}],129:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],130:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function d(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,f,p,h,m,y=e.gd,g=1,v=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(g=Math.max(g-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=d(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":242,"../../plots/cartesian/constants":296,"./align":127,"./cursor":128,"./unhover":131,"has-hover":57,"has-passive-events":58,"mouse-event-offset":62}],131:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":234,"../../lib/events":235,"../../lib/throttle":266,"../fx/constants":145}],132:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],133:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),d=a.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",d(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},x.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var b=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(e){var t=b[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(e,t){var r=e%100;return x.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,d=A[i],f=new Array(u),p=0;p"+g(e);h._gradientUrlQueryParts[v]=1},x.pattern=function(e,t,r,i,o,l,s,u,d,f,p,h){var m="legend"===t;u&&("overlay"===d?(f=u,p=c.contrast(f)):(f=void 0,p=u));var y,g,v,x,b,_,w,T,M,k,A,L=r._fullLayout,S="p"+L._uid+"-"+i,D={};switch(o){case"/":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",D={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"\\":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",D={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"x":y=l*Math.sqrt(2),g=l*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,x=l-l*Math.sqrt(1-s),_="path",D={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",D={d:v="M"+(y=l)/2+",0L"+y/2+","+(g=l),opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"-":_="path",_="path",D={d:v="M0,"+(g=l)/2+"L"+(y=l)+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"+":_="path",v="M"+(y=l)/2+",0L"+y/2+","+(g=l)+"M0,"+g/2+"L"+y+","+g/2,x=l-l*Math.sqrt(1-s),_="path",D={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case".":y=l,g=l,s.pattern_filled";L._patternUrlQueryParts[P]=1},x.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},x.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},x.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var d,f,p,h=!1;if(e.so)p=l.outlierwidth,f=l.outliercolor,d=o.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,h=!0),d="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,d).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var y=o.gradient,g=e.mgt;g?h=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,b=v&&x.getPatternAttr(v.shape,e.i,"");if(g&&"none"!==g){var _=e.mgc;_?h=!0:_=y.color;var T=r.uid;h&&(T+="-"+e.i),x.gradient(t,i,T,g,[[0,_],[1,d]],"fill")}else if(b){var M=x.getPatternAttr(v.bgcolor,e.i,null),k=x.getPatternAttr(v.fgcolor,e.i,null),L=v.fgopacity,S=x.getPatternAttr(v.size,e.i,8),D=x.getPatternAttr(v.solidity,e.i,.3),O=e.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),C=r.uid;O&&(C+="-"+e.i),x.pattern(t,"point",i,C,b,S,D,e.mcc,v.fillmode,M,k,L)}else c.fill(t,d);p&&c.stroke(t,f)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,d=l.opacity,f=void 0!==u,p=void 0!==d;(a.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=i.color,y=o.color,g=l.color;(y||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:g||t});var v=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(x.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,d=u?u(e,t,s):{},p={};v(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,d,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=D(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,g).text(c).call(f.convertToTspans,r).call(S,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=D(e,t);c.fill(a,i),S(a,o,l,e.mrc2||e.mrc)}))}};function O(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),d=(u*u*i-c*c*l)*a,f=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&d/p),2),n.round(t[1]+(p&&f/p),2)],[n.round(t[0]-(h&&d/h),2),n.round(t[1]-(h&&f/h),2)]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},I=0),r&&(x.savedBBoxes[r]=y),I++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=d(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var R=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(R,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(F);e=1===t&&1===r?[]:[d(o,l),"scale("+t+","+r+")",d(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":147,"../../constants/alignment":216,"../../constants/interactions":221,"../../constants/xmlns_namespaces":223,"../../lib":242,"../../lib/svg_text_utils":265,"../../registry":326,"../../traces/scatter/make_bubble_size_func":444,"../../traces/scatter/subtypes":452,"../color":111,"../colorscale":123,"./symbol_defs":134,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:76}],134:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":18}],135:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],136:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),d=0;d0;t.each((function(t){var d,f=t[0].trace,p=f.error_x||{},h=f.error_y||{};f.ids&&(d=function(e){return e.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var d=h.width;i="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(i+="m-"+d+",0h"+2*d),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var f=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!f.size()?f=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(l.duration).ease(l.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":452,"../drawing":133,"@plotly/d3":18,"fast-isnumeric":26}],141:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":111,"@plotly/d3":18}],142:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":236,"../../plots/font_attributes":318,"./layout_attributes":152}],143:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+b[0]._offset,t.pointerY=ie+_[0]._offset,E="xval"in t?g.flat(l,t.xval):g.p2c(b,ae),Y="yval"in t?g.flat(l,t.yval):g.p2c(_,ie),!a(E[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(U=0;U$&&(ee.splice(0,$),ce=ee[0].distance),m&&0!==I&&0===ee.length){K.distance=I,K.index=!1;var d=G._module.hoverPoints(K,J,Q,"closest",{hoverLayer:s._hoverlayer});if(d&&(d=d.filter((function(e){return e.spikeDistance<=I}))),d&&d.length){var f,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var y=h[0];a(y.x0)&&a(y.y0)&&(f=fe(y),(!re.vLinePoint||re.vLinePoint.spikeDistance>f.spikeDistance)&&(re.vLinePoint=f))}var v=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(v.length){var x=v[0];a(x.x0)&&a(x.y0)&&(f=fe(x),(!re.hLinePoint||re.hLinePoint.spikeDistance>f.spikeDistance)&&(re.hLinePoint=f))}}}}}function de(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Oe(ee[Ae]);ee=Le,ye()}var Ce=e._hoverdata,Pe=[],Ie=H(e),Ne=B(e);for(V=0;V1||ee.length>1)||"closest"===L&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),Xe=P(ee,{gd:e,hovermode:L,rotateLabels:Ge,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});g.isUnifiedHover(L)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,d=1,f=e.size(),p=new Array(f),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(d=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(y.push.apply(y,g),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xe,Ge?"xa":"ya",s),N(Xe,Ge,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var We=y.getComponentMethod("annotations","hasClickToShow")(e,Pe);d(n.select(t.target),We?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:E,yvals:Y})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),d=Math.max(r,n),f=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,d+=v,f+=x,h+=x}c.bbox={x0:u+o,x1:d+o,y0:f+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,d=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{},T=t.fontFamily||v.HOVERFONT,M=t.fontSize||v.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,C=i.charAt(0),P=k[C+"Label"],N=m.getBoundingClientRect(),z=N.top,R=N.width,F=N.height,E=void 0!==P&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(E){var j,H,B=!0;for(j=0;ja.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+v.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+v.width/2)+"v"+x+(2*L+v.height)+"H-"+(L+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,O,C;"right"===D.side?(_="start",O=1,C="",y=S._offset+S._length):(_="end",O=-1,C="-",y=S._offset),g=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+v.height/2)+"h"+C+(2*L+v.width)+"V-"+(L+v.height/2)+"H"+C+A+"V-"+A+"Z");var I,N=v.height/2,R=z-v.top-N,F="clip"+a._uid+"commonlabel"+D._id;if(y=0?ne:ae+le=0?ae:me+le=0?te:re+se=0?re:ye+se=0,"top"!==e.idealAlign&&C||!N?C?(B+=V/2,e.anchor="start"):e.anchor="middle":(B-=V/2,e.anchor="end");else if(e.pos=B,C=H+Y/2+U<=R,N=H-Y/2-U>=0,"left"!==e.idealAlign&&C||!N)if(C)H+=Y/2,e.anchor="start";else{e.anchor="middle";var q=U/2,G=H+q-R,Z=H-q;G>0&&(H-=G),Z<0&&(H+=-Z)}else H-=Y/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(H,B)+(c?s(_):""))})),ge}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var d=e.hovertemplate||!1;if(d){var f=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),s=(s=o.hovertemplateString(d,f,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function N(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],d=c*(A+L),p=d+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(d-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var g=h+d,v=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(f.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+d+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+d,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function R(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,g,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,b,_=i.readability(v.color,h)<1.5?p.contrast(h):v.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(d){var S,D,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+O.x,D=a._offset+O.y);var C,P,I=i.readability(O.color,h)<1.5?p.contrast(h):O.color,N=n.spikemode,z=n.spikethickness,R=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==N.indexOf("toaxis")||-1!==N.indexOf("across")){if(-1!==N.indexOf("toaxis")&&(C=F,P=D),-1!==N.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==N.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:R}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}},{"../../lib":242,"../../lib/events":235,"../../lib/override_cursor":253,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../registry":326,"../color":111,"../dragelement":130,"../drawing":133,"../legend/defaults":163,"../legend/draw":164,"./constants":145,"./helpers":147,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:76}],149:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":242,"../color":111,"./helpers":147}],150:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":242,"./layout_attributes":152}],151:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":242,"../dragelement":130,"./attributes":142,"./calc":143,"./click":144,"./constants":145,"./defaults":146,"./helpers":147,"./hover":148,"./layout_attributes":152,"./layout_defaults":153,"./layout_global_defaults":154,"@plotly/d3":18}],152:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":318,"./constants":145}],153:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":242,"./hoverlabel_defaults":149,"./hovermode_defaults":150,"./layout_attributes":152}],154:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":242,"./hoverlabel_defaults":149,"./layout_attributes":152}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),d=u*(1-o),f=0;f1){if(!f&&!p&&!h)"independent"===M("pattern")&&(f=!0);y._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,v),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,f=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(h){var x=f.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var y=i.newContainer(t,"legend");if(T("uirevision",t.uirevision),!1!==m){T("bgcolor",t.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,x,b=a.coerceFont(T,"font",t.font),_="h"===T("orientation");if(_?(g=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(v=1.1,x="bottom"):(v=-.1,x="top")):(g=1.02,v=1,x="auto"),T("traceorder",f),s.isGrouped(t.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",x),T("valign"),a.noneOrAll(c,y,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=a.extendFlat({},b,{size:a.bigFont(b.size)});a.coerceFont(T,"title.font",w)}}}function T(e,t){return a.coerce(c,y,o,e,t)}}},{"../../lib":242,"../../plot_api/plot_template":278,"../../plots/layout_attributes":322,"../../registry":326,"./attributes":161,"./helpers":167}],164:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),d=e("../../lib/svg_text_utils"),f=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,g=h.FROM_BR,v=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&f(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&f(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?T(n,h):n);var y=r.itemwidth+2*p.itemGap;d.positionText(m,y,0),f?m.call(d.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),d=u[u.length-1],f=a.keyedContainer(i,"transforms["+d+"].styles","target","value.name");f.set(l.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(m,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),d.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,f=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),v=d.lineCount(g),x=g.node();if(u=h*v,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),d.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,f-=r.itemwidth),d.positionText(g,b,-h*((v-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=f)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,d=e._fullLayout,f="legend"+d._uid,h=t._inHover;h?(r=t.layer,f+="-hover"):r=d._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=v(t.entries,t)}else{if(!e.calcdata)return;l=d.showlegend&&v(e.calcdata,t)}var m=d.hiddenlabels||[];if(!(h||d.showlegend&&l.length))return r.selectAll(".legend").remove(),d._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var T=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),S=a.ensureSingleById(d._topdefs,"clipPath",f,(function(e){e.append("rect")})),D=a.ensureSingle(T,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));D.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var O=a.ensureSingle(T,"g","scrollbox"),C=t.title;if(t._titleWidth=0,t._titleHeight=0,C.text){var P=a.ensureSingle(O,"text","legendtitletext");P.attr("text-anchor","start").call(c.font,C.font).text(C.text),k(P,O,e,t,1)}else O.selectAll(".legendtitletext").remove();var I=a.ensureSingle(T,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),N=O.selectAll("g.groups").data(l);N.enter().append("g").attr("class","groups"),N.exit().remove();var z=N.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,d=2*u,f=p.itemGap,h=a.itemwidth+2*f,m=2*(u+f),y=L(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,x=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+f),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=f+h+d,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),M=a.x<0||0===a.x&&"right"===T,k=a.x>1||1===a.x&&"left"===T,S=v||g,D=i.width/2;a._maxWidth=Math.max(M?S&&"left"===T?o.l+o.w:D:k?S&&"right"===T?o.r+o.w:D:o.w,2*h);var O=0,C=0;r.each((function(e){var t=e[0].width+h;O=Math.max(O,t),C+=t})),_=null;var P=0;if(s){var I=0,N=0,z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+f+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),I=Math.max(I,t);var r=e+f;r+u+N>a._maxWidth&&(P=Math.max(P,N),N=0,z+=I+x,I=t),c.setTranslate(this,N,z),N+=r})),a._width=Math.max(P,N)+u,a._height=z+I+m}else{var R=r.size(),F=C+d+(R-1)*f=a._maxWidth&&(P=Math.max(P,B),j=0,H+=E,a._height+=E,E=0),c.setTranslate(this,w[0]+u+j,w[1]+u+H+t/2+f),B=j+r+f,j+=n,E=Math.max(E,t)})),F?(a._width=j+d,a._height=E+m):(a._width=Math.max(P,B)+d,a._height+=E+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Y=e._context.edits,V=Y.legendText||Y.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?h:_||h+e[0].width;l||(a+=f/2),c.setRect(t,0,-r/2,a,r)}))}(e,N,z,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*y[n]})}(e)){var l,u,m,v,x=d._size,b=t.borderwidth,w=x.l+x.w*t.x-y[A(t)]*t._width,M=x.t+x.h*(1-t.y)-y[L(t)]*t._effHeight;if(!h&&d.margin.autoexpand){var k=w,C=M;w=a.constrain(w,0,d.width-t._width),M=a.constrain(M,0,d.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),M!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(T,w,M),I.on(".drag",null),T.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),D.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(O,0,0),S.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(O,f,e),c.setRect(I,0,0,0,0),delete t._scrollY}else{var N,z,R,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);D.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),S.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(O,f,e),U(B,F,H),T.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;N="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,R=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(R,N,z),F,H))}));I.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(N=e.changedTouches[0].clientY,R=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(R,N,z),F,H))}));O.call(V)}if(e._context.edits.legendPosition)T.classed("cursor-move",!0),s.init({element:T.node(),gd:e,prepFn:function(){var e=c.getTranslate(T);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(T,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,T,a,t,n)}})}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(O,0,-r),c.setRect(I,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),S.select("rect").attr("y",b+r)}}],e)}(e,t)}},{"../../constants/alignment":216,"../../lib":242,"../../lib/events":235,"../../lib/svg_text_utils":265,"../../plots/plots":324,"../../registry":326,"../color":111,"../dragelement":130,"../drawing":133,"./constants":162,"./get_legend_data":165,"./handle_click":166,"./helpers":167,"./style":169,"@plotly/d3":18}],165:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],d=!1,f={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),d=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,d=u.marker||{},f=d.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,d.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(d),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(d,"")(m)}var g=p||i.mc||d.color,v=d.pattern,x=v&&l.getPatternAttr(v.shape,0,"");if(x){var b=l.getPatternAttr(v.bgcolor,0,null),_=l.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,M=y(v.size,8,10),k=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,v.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||f.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});d(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var d=a.selectAll("g.legendsymbols").data([e]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,d=n.select(this),f=c(a),p=f.colorscale,m=f.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}d.attr("d",e[0]),u?d.call(s.fill,u):d.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,d=o.showLine,f=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=e[0],b=v.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}}),d||f){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(v,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(d||f?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(f?"l"+x+",0.0001":"h"+x)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,d=o.showLine,f=o.showMarker,p=e[0],h=p.trace,y=!f&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||y||d){var b={},w={};if(f){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}d&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),f&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":242,"../../registry":326,"../../traces/pie/helpers":419,"../../traces/pie/style_one":425,"../../traces/scatter/subtypes":452,"../color":111,"../colorscale/helpers":122,"../drawing":133,"./constants":162,"@plotly/d3":18}],170:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":172}],171:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function d(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},d=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(C=["toggleHover"],P=["resetViews"]):g?(O=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],P=["resetGeo"]):y?(C=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],P=["resetViewMapbox"]):b?C=["hoverClosestGl2d"]:v?C=["hoverClosestPie"]:M?(C=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):C=["toggleHover"];m&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e0?f+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,d,f=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=d)));return p>=f?[f,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;ov?(M=d,S="y0",k=v,D="y1"):(M=v,S="y1",k=d,D="y0");W(n),K(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),X.moveFn="move"===I?J:Q,X.altKey=n.altKey},doneFn:function(){if(g(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(g(e))return;$(l)}};function W(r){if(g(e))I=null;else if(R)I="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else N?E("xanchor",r.xanchor=q(x+n)):(E("x0",r.x0=q(c+n)),E("x1",r.x1=q(y+n))),z?E("yanchor",r.yanchor=G(T+a)):(E("y0",r.y0=G(d+a)),E("y1",r.y1=G(v+a)));t.attr("d",_(e,r)),K(l,r)}function Q(n,a){if(F){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(R){if("resize-over-start-point"===I){var u=c+n,f=z?d-a:d+a;E("x0",r.x0=N?u:q(u)),E("y0",r.y0=z?f:G(f))}else if("resize-over-end-point"===I){var p=y+n,h=z?v-a:v+a;E("x1",r.x1=N?p:q(p)),E("y1",r.y1=z?h:G(h))}}else{var g=function(e){return-1!==I.indexOf(e)},b=g("n"),H=g("s"),Y=g("w"),Z=g("e"),X=b?M+a:M,W=H?k+a:k,J=Y?A+n:A,Q=Z?L+n:L;z&&(b&&(X=M-a),H&&(W=k-a)),(!z&&W-X>10||z&&X-W>10)&&(E(S,r[S]=z?X:G(X)),E(D,r[D]=z?W:G(W))),Q-J>10&&(E(O,r[O]=N?J:q(J)),E(C,r[C]=N?Q:q(Q)))}t.attr("d",_(e,r)),K(l,r)}function K(e,t){(N||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(N?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),N&&z){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(N){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}f.init(X),Z.node().onmousemove=W}(e,N,s,t,r,I):!0===s.editable&&N.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");N.node().addEventListener("click",(function(){return function(e,t){if(!v(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,y(e)}}(e,N)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,d,f=t.type,p=i.getRefType(t.xref),y=i.getRefType(t.yref),g=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),x=e._fullLayout._size;if(g?"domain"===p?n=function(e){return g._offset+g._length*e}:(r=m.shapePositionToRange(g),n=function(e){return g._offset+g.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},v?"domain"===y?l=function(e){return v._offset+v._length*(1-e)}:(o=m.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===f)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(l=m.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],d=h.paramIsY[c],f=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):d[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>f&&(e="X"),e}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,d=_-t.y1}else u=l(t.y0),d=l(t.y1);if("line"===f)return"M"+s+","+u+"L"+c+","+d;if("rect"===f)return"M"+s+","+u+"H"+c+"V"+d+"H"+s+"Z";var w=(s+c)/2,T=(u+d)/2,M=Math.abs(w-s),k=Math.abs(T-u),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){v(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,y(e)))}t.exports={draw:y,drawOne:x,eraseActiveShape:function(e){if(!v(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&d(g),r.attr("d",m(t)),k&&!f)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,v(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*d.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+d.stepInset+(r.inputAreaLength-2*d.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-d.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*d.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",d.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,d.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(e,t){var r=t._dims,n=r.inputAreaLength-2*d.railInset,a=l.ensureSingle(e,"rect",d.railRectClass);a.attr({width:n,height:d.railWidth,rx:d.railRadius,ry:d.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,d.railInset,.5*(r.inputAreaWidth-d.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[d.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}if(i.enter().append("g").classed(d.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+d.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+d.groupClassName).data(r,g);s.enter().append("g").classed(d.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return z.call(R),I&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(d.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(e){this.text(e||" ").call(d.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":216,"../../constants/interactions":221,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/plots":324,"../../registry":326,"../color":111,"../drawing":133,"@plotly/d3":18,"fast-isnumeric":26}],210:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":236,"../../plot_api/edit_types":271,"../../plot_api/plot_template":278,"../../plots/font_attributes":318,"../../plots/pad_attributes":323,"../color/attributes":110}],211:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],212:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":242,"../../plots/array_container_defaults":284,"./attributes":210,"./constants":211}],213:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,d=e("./constants"),f=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(d.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,d.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(d.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||g(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",d.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||d.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(v,a,u,e).call(A,a,f,p),l.ensureSingle(t,"text",d.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(d.arrowSymbol[a.direction])})).attr({x:s.headerWidth-d.arrowOffsetX+a.pad.l,y:s.headerHeight/2+d.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(d.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?d.dropdownButtonClassName:d.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+d.gapButtonHeader:h=g.headerWidth+d.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-d.gapButtonHeader+d.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-d.gapButtonHeader+d.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+y+o.pad.t,yPad:d.gapButton,xPad:d.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(v,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(d.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+d.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+d.headerGroupClassName).data(r,p);s.enter().append("g").classed(d.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",d.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+g;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=g>T,C=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+m,N=y;I+C>s&&(I=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:N,width:C,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,E=O?d+C+.5:d+.5,j=f-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+R).data(M||O?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",R).append("rect"),M||O?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":242,"../color":111,"../drawing":133,"@plotly/d3":18}],216:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],217:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],218:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],219:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],220:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],221:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],222:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],223:[function(e,t,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}},{}],224:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],226:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],227:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function d(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,d,f,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,d=o,f=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return d(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return d(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return d(e,t,r,n,a,i,1)}}},{"./mod":249}],228:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(d(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:v);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),O=C.newDate(M,C.toMonthIndex(M,k,P),A)}else O=C.newDate(M,Number(k),A)}catch(e){return u}return O?(O.toJD()-m)*d+L*f+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*d,M=3*f,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,v,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/d)+m,S=Math.floor(s(e,d));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+d&&e<=a-d))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function O(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,d),n=w(Math.floor(r/f),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+O(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return O(t,e,n,a)};var P=3*d;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,d);if(e=Math.round(e-n),r)try{var a=Math.round(e/d)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*d+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+d*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,d=n-t,f=o-a,p=c-i,h=u*u+d*d,m=f*f+p*p,y=Math.min(s(u,d,h,a-e,i-t),s(u,d,h,o-e,c-t),s(f,p,m,e-a,t-i),s(f,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),d=e.getPointAtLength(o(r,t)),f={x:(4*d.x+s.x+c.x)/6,y:(4*d.y+s.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),d=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,d=r.ys?r.y-s:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+r)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+r))return;p=f(d)}return{min:c,max:d,len:d-c,total:u,isClosed:0===c&&d===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++}return i}},{"./mod":249}],240:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],241:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],242:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,d=t.exports={};d.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var f={};d.warnBadFormat=function(e){var t=String(e);f[t]||(f[t]=1,d.warn('encountered bad format: "'+t+'"'))},d.noFormat=function(e){return String(e)},d.numberFormat=function(e){var t;try{t=i(d.adjustFormat(e))}catch(t){return d.warnBadFormat(e),d.noFormat}return t},d.nestedProperty=e("./nested_property"),d.keyedContainer=e("./keyed_container"),d.relativeAttr=e("./relative_attr"),d.isPlainObject=e("./is_plain_object"),d.toLogRange=e("./to_log_range"),d.relinkPrivateKeys=e("./relink_private");var p=e("./array");d.isTypedArray=p.isTypedArray,d.isArrayOrTypedArray=p.isArrayOrTypedArray,d.isArray1D=p.isArray1D,d.ensureArray=p.ensureArray,d.concat=p.concat,d.maxRowLength=p.maxRowLength,d.minRowLength=p.minRowLength;var h=e("./mod");d.mod=h.mod,d.modHalf=h.modHalf;var m=e("./coerce");d.valObjectMeta=m.valObjectMeta,d.coerce=m.coerce,d.coerce2=m.coerce2,d.coerceFont=m.coerceFont,d.coercePattern=m.coercePattern,d.coerceHoverinfo=m.coerceHoverinfo,d.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,d.validate=m.validate;var y=e("./dates");d.dateTime2ms=y.dateTime2ms,d.isDateTime=y.isDateTime,d.ms2DateTime=y.ms2DateTime,d.ms2DateTimeLocal=y.ms2DateTimeLocal,d.cleanDate=y.cleanDate,d.isJSDate=y.isJSDate,d.formatDate=y.formatDate,d.incrementMonth=y.incrementMonth,d.dateTick0=y.dateTick0,d.dfltRange=y.dfltRange,d.findExactDates=y.findExactDates,d.MIN_MS=y.MIN_MS,d.MAX_MS=y.MAX_MS;var g=e("./search");d.findBin=g.findBin,d.sorterAsc=g.sorterAsc,d.sorterDes=g.sorterDes,d.distinctVals=g.distinctVals,d.roundUp=g.roundUp,d.sort=g.sort,d.findIndexOfMin=g.findIndexOfMin,d.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");d.aggNums=v.aggNums,d.len=v.len,d.mean=v.mean,d.median=v.median,d.midRange=v.midRange,d.variance=v.variance,d.stdev=v.stdev,d.interp=v.interp;var x=e("./matrix");d.init2dArray=x.init2dArray,d.transposeRagged=x.transposeRagged,d.dot=x.dot,d.translationMatrix=x.translationMatrix,d.rotationMatrix=x.rotationMatrix,d.rotationXYMatrix=x.rotationXYMatrix,d.apply3DTransform=x.apply3DTransform,d.apply2DTransform=x.apply2DTransform,d.apply2DTransform2=x.apply2DTransform2,d.convertCssMatrix=x.convertCssMatrix,d.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");d.deg2rad=b.deg2rad,d.rad2deg=b.rad2deg,d.angleDelta=b.angleDelta,d.angleDist=b.angleDist,d.isFullCircle=b.isFullCircle,d.isAngleInsideSector=b.isAngleInsideSector,d.isPtInsideSector=b.isPtInsideSector,d.pathArc=b.pathArc,d.pathSector=b.pathSector,d.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");d.isLeftAnchor=_.isLeftAnchor,d.isCenterAnchor=_.isCenterAnchor,d.isRightAnchor=_.isRightAnchor,d.isTopAnchor=_.isTopAnchor,d.isMiddleAnchor=_.isMiddleAnchor,d.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");d.segmentsIntersect=w.segmentsIntersect,d.segmentDistance=w.segmentDistance,d.getTextLocation=w.getTextLocation,d.clearLocationCache=w.clearLocationCache,d.getVisibleSegment=w.getVisibleSegment,d.findPointOnPath=w.findPointOnPath;var T=e("./extend");d.extendFlat=T.extendFlat,d.extendDeep=T.extendDeep,d.extendDeepAll=T.extendDeepAll,d.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");d.log=M.log,d.warn=M.warn,d.error=M.error;var k=e("./regex");d.counterRegex=k.counter;var A=e("./throttle");d.throttle=A.throttle,d.throttleDone=A.done,d.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},d.noop=e("./noop"),d.identity=e("./identity"),d.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},d.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},d.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(d.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},d.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},d.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},d.syncOrAsync=function(e,t,r){var n;function a(){return d.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},d.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},d.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},d.fillArray=function(e,t,r,n){if(n=n||d.identity,d.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},d.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var N=/^\w*$/;d.templateString=function(e,t){var r={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,n){var a;return N.test(n)?a=t[n]:(r[n]=r[n]||d.nestedProperty(t,n).get,a=r[n]()),d.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};d.hovertemplateString=function(){return E.apply(z,arguments)};var R={max:10,count:0,name:"texttemplate"};d.texttemplateString=function(){return E.apply(R,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,f,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,g=l;if((p||h)&&(g=g.substring(1)),(m||h)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=t[g]))return""}else for(f=3;f=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;d.seedPseudoRandom=function(){j=2e9},d.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?d.pseudoRandom():j/4294967296},d.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=d.extractOption(e,t,"htx","hovertext");if(d.isValidTextValue(a))return n(a);var i=d.extractOption(e,t,"tx","text");return d.isValidTextValue(i)?n(i):void 0},d.isValidTextValue=function(e){return e||0===e},d.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,d.strTranslate(a-c*(r+o),i-c*(n+l))+d.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},d.ensureUniformFontSize=function(e,t){var r=d.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},d.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},d.bigFont=function(e){return Math.round(1.2*e)};var H=d.getFirefoxVersion(),B=null!==H&&H<86;d.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":222,"./anchor_utils":226,"./angles":227,"./array":228,"./clean_number":229,"./clear_responsive":231,"./coerce":232,"./dates":233,"./dom":234,"./extend":236,"./filter_unique":237,"./filter_visible":238,"./geometry2d":239,"./identity":240,"./increment":241,"./is_plain_object":243,"./keyed_container":244,"./localize":245,"./loggers":246,"./make_trace_groups":247,"./matrix":248,"./mod":249,"./nested_property":250,"./noop":251,"./notifier":252,"./preserve_drawing_buffer":255,"./push_unique":256,"./regex":258,"./relative_attr":259,"./relink_private":260,"./search":261,"./sort_object_keys":263,"./stats":264,"./throttle":266,"./to_log_range":267,"@plotly/d3":18,"d3-format":21,"d3-time-format":23,"fast-isnumeric":26}],243:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],244:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],f.set(e,null);if(d){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":276,"./notifier":252}],247:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":18}],248:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],250:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,d,f,p,h,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(d,y)||c>Math.max(f,g)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":222,"./matrix":248}],255:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":26,"is-mobile":60}],256:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,d=0,f=t.length,p=0,h=f>1?(t[f-1]-t[0])/(f-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);d90&&a.log("Long binary search..."),d-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],d=u-a;void 0===a?(s.push(u),a=u):d>l&&(i=Math.min(i,d),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":228,"fast-isnumeric":26}],265:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),O=n.select(e.node().parentNode);if(!O.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(d,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var c=O.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:C,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",d=l.select("g");d.attr({fill:u,stroke:u});var f=s(d,"width"),p=s(d,"height"),h=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],y=-(r||s(e,"height"))/4;"y"===C[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-f/2,y-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===C[0]?l.attr({x:e.attr("x"),y:y-p/2}):"a"===C[0]&&0!==C.indexOf("atitle")?l.attr({x:0,y:y}):l.attr({x:h,y:+e.attr("y")+y-p/2}),m&&m.call(e,c),t(c)}))}))):P(),e}function P(){O.empty()||(C=e.attr("class")+"-math",O.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function O(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],267:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":26}],268:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],269:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],270:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,d=(l.subplotsRegistry.ternary||{}).attrRegex,f=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",d);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",d,v),!0;t.set(v)}return!m&&(f(y,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],O=u(g,d).get(),C=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",d,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,_),c(M)?C.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",d,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(C[x],1),O&&O.splice(C[x],1);if(D.length?S||t.set(D):t.set(null),m)return!1;if(f(y,g),h!==a){var N;if(-1===P)N=L;else{for(I=Math.max(D.length,I),N=[],x=0;x=P);x++)N.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,d,f=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=O(r,e.data.length-1),t)for(var m=0;m-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[f.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||f.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(f.rehover,f.redrag),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,f=F(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),g={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),Z=I.get();if(void 0!==N){A[P]=N,L[P]="reverse"===E?N:R(Z);var W=d.getLayoutValObject(s,I.parts);if(W&&W.impliedEdits&&null!==N)for(var J in W.impliedEdits)S(o.relativeAttr(P,J),W.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(N){S("autosize",null);var Q="height"===P?"width":"height";S(Q,s[Q])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",N?null:s.width),S("height",N?null:s.height);else if(j.match(U))C(j),l(s,B+"._inputRange").set(null);else if(j.match(q)){C(j),l(s,B+"._inputRange").set(null);var K=l(s,B).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else j.match(G)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===N,ee="log"===V.type&&"linear"===N;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,N,S),u.getComponentMethod("images","convertCoords")(e,V,N,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(N||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=W||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(N)?L[P]=null:b.isRemoveVal(N)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=N,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===N||"select"===N)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:W?T.update(k,W):k.calc=!0,I.set(N))}}for(r in g){b.applyContainerArrayChanges(e,f(i,r),g[r],k,f)||(k.plot=!0)}for(var ce in O){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var de in k.calc=!0,ue)O[de]||(p.getFromId(e,de)._constraintShrinkable=!0)}return(X(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:L,redoit:A,eventData:y}}function X(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&f.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function W(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),d=u.flags;(s.calc||d.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];d.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),Y(e,d,u)||f.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||d.colorbars)&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.axrange&&V(p,u.rangesAltered),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag),c.add(e,W,[e,l.undoit,u.undoit,l.traces],W,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function d(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,f.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&d()};t()}var h,m,y=0;function g(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var v=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))v.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);v=k}}v.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,g=t[n].name,v=u[y]||h[y];y&&g&&"number"==typeof g&&v&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[m]={name:m},p.push({frame:f.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=f.modifyFrames,u=f.modifyFrames,d=[e,l],p=[e,i];return c&&c.add(e,s,d,u,p),f.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,d=e,f=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in d(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var d=u.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:d,applyUpdate:function(t,r){t&&u(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":242,"../plots/attributes":285}],279:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),d=e("../components/modebar"),f=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,g=y._size,x=g.p,_=f.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),d.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,O=l.yaxis.domain,C=l.plotgroup;if(v(D,O,L)){var P=C.node(),I=l.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([D,O]),S||(k.push(a),A.push(a))}var N,z,R,F,E,j,H,B,Y,V,U,q,G,Z=y._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:f},""),u.length)return u.map(g)}},{"../lib":242,"../plots/attributes":285,"../plots/plots":324,"./plot_config":276,"./plot_schema":277,"./plot_template":278}],281:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,d={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,f,p,h;function m(e){return!(e in t)||o.validate(t[e],d[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],f=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),f=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(d.format.values,", "," or ")+".");var y={};function g(e,r){return o.coerce(t,y,d,e,r)}var v=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},f);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,v,_),n=M._fullLayout.width,d=M._fullLayout.height;function f(){a.purge(M),document.body.removeChild(M)}if("full-json"===v){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),e(T?p:l.encodeJSON(p))}if(f(),"svg"===v)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:v,width:n,height:d,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":242,"../plots/plots":324,"../snapshot/helpers":330,"../snapshot/svgtoimg":332,"../snapshot/tosvg":334,"../version":472,"./plot_api":275,"fast-isnumeric":26}],282:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var d=Object.keys(e),f=0;fx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,D,O=x.length,C=Array.isArray(M);if(C&&(O=Math.min(O,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(C?Math.min(P,M[A].length):P);k++)L=C?M[A][k]:M,S=v[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,D)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),v[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(d)===d))return{vals:a};c=d}for(var f=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,f)||0,g=[],v=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);T=o(M,-c,f)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,v[_]=T,x[_]=M}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":222,"../../lib":242,"fast-isnumeric":26}],287:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],288:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,d=c.isLinked;function f(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,d=c.max;if(0===u.length||0===d.length)return i.simpleMap(t.range,t.r2l);var f=u[0].val,y=d[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>O&&(_=x,w=b,O=M/T):M/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=M/S));if(f===y){var C=f-1,P=f+1;if(A)if(0===f)a=[0,1];else{var I=(f>0?d:u).reduce((function(e,t){return Math.max(e,s(t))}),0),N=f/(1-Math.min(.5,I/S));a=f>0?[0,N]:[N,0]}else a=L?[Math.max(0,C),Math.max(1,P)]:[C,P]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-O*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-O*l(_),w.val+O*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=i),i>p&&i-o&&(f=i),i>p&&i=P;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],d=[];function f(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":133,"../../constants/numerical":222,"../../lib":242,"../../registry":326,"./axis_ids":293,"@plotly/d3":18,"fast-isnumeric":26}],289:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),d=e("../../components/color"),f=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,D=m.ONEMIN,O=m.ONESEC,C=m.MINUS_SIGN,P=m.BADNUM,I={K:"zeroline"},N={K:"gridline",L:"path"},z={K:"tick",L:"path"},R={K:"tick",L:"text"},F=e("../../constants/alignment"),E=F.MID_SHIFT,j=F.CAP_SHIFT,H=F.LINE_SPACING,B=F.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=e("./set_convert");var V=e("./axis_autotype"),U=e("./axis_ids"),q=U.idSort,G=U.isLinked;Y.id2name=U.id2name,Y.name2id=U.name2id,Y.cleanId=U.cleanId,Y.list=U.list,Y.listIds=U.listIds,Y.getFromId=U.getFromId,Y.getFromTrace=U.getFromTrace;var Z=e("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}Y.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},Y.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},Y.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==Y.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=Y.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},Y.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:Y.getFromId(t,r).cleanPos)(e)},Y.redrawComponents=function(e,t){t=t||Y.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=Y.tickIncrement(e,r);if(s<=n)return s}return e}(v,e,g,c,i)),y=v,0;y<=u;)y=Y.tickIncrement(y,g,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(y,0,i),size:g,_dataSpan:u-c}},Y.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=Y.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dticki&&d=o:p<=o;p=Y.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(D.length>m||p===O)break;O=p;var C=!1;d&&p!==(0|p)&&(C=!0),D.push({minor:C,value:p})}if(f&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),d=r||u,f=0;d>=v?f=u>=v&&u<=y?u:g:r===b&&d>=_?f=u>=_&&u<=x?u:b:d>=M?f=u>=M&&u<=w?u:T:r===k&&d>=k?f=k:d>=A?f=A:r===L&&d>=L?f=L:r===S&&d>=S&&(f=S),f>=u&&(f=u,l=!0);var p=a+f;if(t.rangebreaks&&f>0){for(var h=0,m=0;m<84;m++){var D=(m+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(f*=h/84)||(e[n].drop=!0),l&&u>k&&(f=u)}(f>0||0===n)&&(e[n].periodX=a+f/2)}}(D,e,e._definedDelta),e.rangebreaks){var I="y"===e._id.charAt(0),N=1;"auto"===e.tickmode&&(N=e.tickfont?e.tickfont.size:12);var z=NaN;for(h=D.length-1;h>-1;h--)if(D[h].drop)D.splice(h,1);else{D[h].value=Ae(D[h].value,e);var R=e.c2p(D[h].value);(I?z>R-N:zu||Eu&&(F.periodX=u),E10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!de(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}Y.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>g)t/=g,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>T)t/=T,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=Y.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=oe(t,S,ee):i>D?e.dtick=oe(t,D,te):i>O?e.dtick=oe(t,O,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},Y.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,d=e+.01*o,f=l.roundUp(l.mod(d,1),u,r);return Math.floor(d)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=fe(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),p=e.exponentformat;"power"===p||ue(p)&&de(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":C)+f+"",t.fontSize*=1.25):("e"===p||"E"===p)&&f>2?t.text="1"+p+(d>0?"+":C)+f:(t.text=fe(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=fe(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=fe(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=fe(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},Y.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return Y.hoverLabelText(e,n,r)+" - "+Y.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=Y.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function de(e){return e>14||e<-15}function fe(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=Y.getTickFormat(t),d=t.separatethousands;if(n){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?C+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-d:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?d-r.top:0,f),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?d-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-d:0,f),p.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ye(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=f),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Q&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,xe(t),n),i.autoMargin(e,be(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||Q&&"bottom"===t.side||W.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ye(t);else{var l=Le(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,d,p,h,m=Y.getPxPosition(e,t);"x"===i?(d=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,d="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var g=f.getTranslate(y.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:d,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(W)}}function K(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ve(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},Y.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=f*j,d+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,d+=3);l&&"top"===c&&(d-=f*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(d=-d);return[s?u:0,l?d:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},Y.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,d=i("inside"),f="inside"===n&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=f?e.ticklen:0;if(d?m*=-1:u&&(m=0),f&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(f||e.showline)&&(p+=.2*e.tickfont.size);var g,v,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(d?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===M||d&&"top"===M)?1:-1,d&&(b*=-1),g=h*b,v=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(d?x+=E:x=-90===A&&"bottom"===M?j:90===A&&"top"===M?E:.5,T=E/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==d?-n:0};else if("y"===k){if(b=(_=!d&&"left"===M||d&&"right"===M)?1:-1,d&&(b*=-1),g=p,v=h*b,x=0,d||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?j:.5),d){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*j*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*E},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Y.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(d.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Se(t,[z]),i.attr("transform",r.transFn)},Y.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&Y.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,y+1?y:m);var b=null;t._selections&&(t._selections[d]=g);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(g,y)}))):_.push((function(){if(x(g,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ve(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",d=function(e){return-1!==c.indexOf(e)},h=d("top"),y=d("left"),v=d("right"),_=d("bottom")||y||h||v?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=d(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=v(o[s])){u=h;break}var d=a("pattern",u);if(d===h)for(s=0;s<2;s++)(c=v(o[s]))&&(t.bounds[s]=o[s]=c-1);if(d)for(s=0;s<2;s++)switch(c=o[s],d){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":326,"./constants":296}],294:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FC&&(C=F);f/=(C-O)/(2*P),O=s.l2r(O),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,d={},f={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ge||Ue(),ye)o.indexOf("select")>-1&&L(r,a,J,Q,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=m?I:P,c="s"===m||"w"===g?0:1,d=l._name+".range["+c+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Ne(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",q(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",q(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":242,"fast-isnumeric":26}],308:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":216}],309:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,d=c.rectMode,f=c.drawMode,p=c.openMode,h=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),y=e("../../components/shapes/draw_newshape/helpers").handleEllipse,g=e("../../components/shapes/draw_newshape/newshapes"),v=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),k=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,D=e("./helpers"),O=D.p2r,C=D.axValue,P=D.getTransform;function I(e,t,r,n,a,i,o){var l,s,c,u,d,f,h,y,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(f=H(_))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),f(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function B(e,t,r){var n,i,o,l;for(n=0;n=0)D._fullLayout._deactivateShape(D);else if(!_){var r=N.clickmode;b.done(me).then((function(){if(b.clear(me),2===e){for(de.remove(),$=0;$-1&&I(t,D,a.xaxes,a.yaxes,a.subplot,a,de),"event"===r&&D.emit("plotly_selected",void 0);l.click(D,t)})).catch(v.error)}},a.doneFn=function(){he.remove(),b.done(me).then((function(){b.clear(me),a.gd.emit("plotly_selected",te),K&&a.selectionDefs&&(K.subtract=ue,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(ye)})).catch(v.error),_&&E(a)}},clearSelect:S,clearSelectionsCache:E,selectOnClick:I}},{"../../components/color":111,"../../components/dragelement/helpers":129,"../../components/drawing":133,"../../components/fx":151,"../../components/fx/helpers":147,"../../components/shapes/draw_newshape/display_outlines":199,"../../components/shapes/draw_newshape/helpers":200,"../../components/shapes/draw_newshape/newshapes":201,"../../lib":242,"../../lib/clear_gl_canvases":230,"../../lib/polygon":254,"../../lib/throttle":266,"../../plot_api/subroutines":279,"../../registry":326,"./axis_ids":293,"./constants":296,"./handle_outline":300,"./helpers":301,polybooljs:66}],310:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,g=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function O(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function N(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function R(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?R(t,e._m,e._b):m},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return R(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?R(t,e._m2,d):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:d,e.l2c="log"===e.type?A:d,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return O(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=d,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var d=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===p;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(f=!f),f&&e._rangebreaks.reverse();var h=f?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],g=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var v=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=d?c/p[2]:1,T=f?u/p[3]:1,M=d?p[0]:0,k=f?p[1]:0,A=d?p[0]/p[2]*c:0,L=f?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":133,"../../lib":242,"../../registry":326,"./axes":289,"@plotly/d3":18}],315:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",d=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&N.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&N.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(f,s,d,n),b.cleanPlot(f,s,d,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),a=Math.round(d*a)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(d),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;f[t]={l:{val:g,size:r.l+h},r:{val:v,size:r.r+h},b:{val:_,size:r.b+h},t:{val:x,size:r.t+h}},p[t]=1}else delete f[t],delete p[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,d=i.r,f=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:h}},m){var x=m[v].l||{},_=m[v].b||{},w=x.val,T=x.size,M=_.val,k=_.size;for(var A in m){if(o(T)&&m[A].r){var L=m[A].r.val,S=m[A].r.size;if(L>w){var D=(T*L+(S-r)*w)/(L-w),C=(S*(1-w)+(T-r)*(1-L))/(L-w);D+C>c+d&&(c=D,d=C)}}if(o(k)&&m[A].t){var P=m[A].t.val,I=m[A].t.size;if(P>M){var N=(k*P+(I-n)*M)/(P-M),z=(I*(1-M)+(k-n)*(1-P))/(P-M);N+z>h+f&&(h=N,f=z)}}}}}var R=u.constrain(r-i.l-i.r,2,64),F=u.constrain(n-i.t-i.b,2,64),E=Math.max(0,r-R),j=Math.max(0,n-F);if(E){var H=(c+d)/E;H>1&&(c/=H,d/=H)}if(j){var B=(h+f)/j;B>1&&(h/=B,f/=B)}if(a.l=Math.round(c),a.r=Math.round(d),a.t=Math.round(f),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var d={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(d.layout=c(l),a)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return s&&(d.frames=c(s)),i&&(d.config=c(e._context,!0)),"object"===n?d:JSON.stringify(d)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(N(o,c,d),a=0;a0){for(var n=[],a=0;a-1&&(d[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":111,"../components/drawing":133,"../constants/xmlns_namespaces":223,"../lib":242,"@plotly/d3":18}],335:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rd+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function N(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[d+"a"],R=e[f+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,F,e),!1!==e.index&&y[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-v.bargroupwidth/2)},O=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var E=y[e.index],j=g.base?E.b+E.s:E.s;e[f+"0"]=e[f+"1"]=R.c2p(E[f],!0),e[f+"LabelVal"]=j;var H=v.extents[v.extents.round(E.p)];e[d+"0"]=z.c2p(x?D(E):H[0],!0),e[d+"1"]=z.c2p(x?O(E):H[1],!0);var B=void 0!==E.orig_p;return e[d+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[d+"LabelVal"],g[d+"hoverformat"]),e.valueLabel=s(R,e[f+"LabelVal"],g[f+"hoverformat"]),e.baseLabel=s(R,E.b,g[f+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return C(k(e),A(e),w)}(E))/2,e[d+"Spike"]=z.c2p(E.p,!0),o(E,g,e),e.hovertemplate=g.hovertemplate,e}}function d(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=d(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:d}},{"../../components/color":111,"../../components/fx":151,"../../constants/numerical":222,"../../lib":242,"../../plots/cartesian/axes":289,"../../registry":326,"./helpers":342}],344:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":303,"../scatter/marker_colorbar":445,"./arrays_to_calcdata":335,"./attributes":336,"./calc":337,"./cross_trace_calc":339,"./defaults":340,"./event_data":341,"./hover":343,"./layout_attributes":345,"./layout_defaults":346,"./plot":347,"./select":348,"./style":350}],345:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],346:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,d={},f=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,d="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,h=a.width,m=a.height,y=Math.abs(t-e),g=Math.abs(n-r),v=y>2*_&&g>2*_?_:0;y-=2*v,g-=2*v;var x=L(s);"auto"!==s||h<=y&&m<=g||!(h>y||m>g)||(h>g||m>y)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=q(E,j,z),j=q(j,E,z),H=q(H,B,!z),B=q(B,H,!z)}var G=k(i.ensureSingle(P,"path"),C,y,g);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&R){var Z=s.makePointStyleFns(d);s.singlePointStyle(c,G,d,Z,e)}!function(e,t,r,n,a,l,c,d,p,y,g){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,N=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,d,f,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,d="x",f=n):(s="x",c=n,d="y",f=a);function m(e){return u(f,f.c2l(e),!0).text}var y=t[r],g={};g.label=y.p,g.labelLabel=g[s+"Label"]=(v=y.p,u(c,c.c2l(v),!0).text);var v;var x=i.castOption(o,y.i,"text");(0===x||x)&&(g.text=x);g.value=y.s,g.valueLabel=g[d+"Label"]=m(y.s);var _={};b(_,o,y.i),p&&(g.delta=+y.rawS||y.s,g.deltaLabel=m(g.delta),g.final=y.v,g.finalLabel=m(g.final),g.initial=g.final-g.delta,g.initialLabel=m(g.initial));h&&(g.value=y.s,g.valueLabel=m(g.value),g.percentInitial=y.begR,g.percentInitialLabel=i.formatPercent(y.begR),g.percentPrevious=y.difR,g.percentPreviousLabel=i.formatPercent(y.difR),g.percentTotal=y.sumR,g.percenTotalLabel=i.formatPercent(y.sumR));var w=i.castOption(o,y.i,"customdata");w&&(g.customdata=w);return i.texttemplateString(l,g,e._d3locale,_,g,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var d,f=a.textinfo,p=e[t],h=f.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((g=e[t].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(d=i.castOption(a,p.i,"text"))||d)&&m.push(d);if(l){var v=+p.rawS||p.s,x=p.v,b=x-v;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(d=i.formatPercent(p.begR),w&&(d+=" of initial"),m.push(d)),y("percent previous")&&(d=i.formatPercent(p.difR),w&&(d+=" of previous"),m.push(d)),y("percent total")&&(d=i.formatPercent(p.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(v,o)}(O,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(P,a);var z="stack"===y.mode||"relative"===y.mode,R=n[a],F=!z||R._outmost;if(!N||"none"===w||(R.isBlank||l===c||d===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=O.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=q*(W/G):W>=G*(X/q);q>0&&G>0&&(J||Q||K)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Z=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=C(r,N,Z)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),q=U.width,G=U.height,V.attr("transform",$),q<=0||G<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,d=a.height,f=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:f>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/d):Math.min(1,f/u));var m=L(c),y=S(a,m),g=(l?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Z.size,f(P.type,ee,O),R.transform=ee,k(V,O,y,g).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,E,j,H,B,y,g),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,d.xcalendar,d.ycalendar)}));var H=!1===d.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,y)},toMoveInsideBar:D}},{"../../components/color":111,"../../components/drawing":133,"../../components/fx/helpers":147,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../registry":326,"./attributes":336,"./constants":338,"./helpers":342,"./style":350,"./uniform_text":352,"@plotly/d3":18,"fast-isnumeric":26}],348:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":111,"../../components/drawing":133,"../../lib":242,"../../registry":326,"./attributes":336,"./helpers":342,"./uniform_text":352,"@plotly/d3":18}],351:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":111,"../../components/colorscale/defaults":121,"../../components/colorscale/helpers":122,"../../lib":242}],352:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o1,b=1-d[e+"gap"],_=1-d[e+"groupgap"];for(l=0;l0){var U=S.pointpos,q=S.jitter,G=S.marker.size/2,Z=0;U+q>=0&&((Z=Y*(U+q))>A?(V=!0,H=G,E=Z):Z>R&&(H=G,E=A)),Z<=A&&(E=A);var X=0;U-q<=0&&((X=-Y*(U-q))>L?(V=!0,B=G,j=X):X>F&&(B=G,j=L)),X<=L&&(j=L)}else E=A,j=L;var W=new Array(c.length);for(s=0;se.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,d=i.bPos,f=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=c.c2l(e.pos+d,!0),a=c.l2p(t-o)+f,i=c.l2p(t+l)+f,h=u?(a+i)/2:c.l2p(t)+f,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),g=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+g+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],d=i.t,f=i.trace;(d.wdPos=d.bdPos*f.whiskerwidth,!0!==f.visible||d.empty)?a.remove():("h"===f.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},f,d),l(a,{x:c,y:u},f,d),s(a,{pos:t,val:r},f,d))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":133,"../../lib":242,"@plotly/d3":18}],358:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":111,"../../components/drawing":133,"@plotly/d3":18}],359:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../ohlc/attributes"),o=e("../box/attributes");function l(e){return{line:{color:n({},o.line.color,{dflt:e}),width:o.line.width,editType:"style"},fillcolor:o.fillcolor,editType:"style"}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},o.line.width,{}),editType:"style"},increasing:l(i.increasing.line.color.dflt),decreasing:l(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:n({},o.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel}},{"../../lib":242,"../../plots/cartesian/axis_format_attributes":292,"../box/attributes":353,"../ohlc/attributes":405}],360:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../ohlc/calc").calcCommon;function l(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,s=a.getFromId(e,t.xaxis),c=a.getFromId(e,t.yaxis),u=s.makeCalcdata(t,"x"),d=i(t,s,"x",u).vals,f=o(e,t,u,d,c,l);return f.length?(n.extendFlat(f[0].t,{num:r._numBoxes,dPos:n.distinctVals(d).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,f):[{t:{empty:!0}}]}},{"../../lib":242,"../../plots/cartesian/align_period":286,"../../plots/cartesian/axes":289,"../ohlc/calc":406}],361:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("../scatter/period_defaults"),l=e("./attributes");function s(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function c(r,a){return n.coerce(e,t,l,r,a)}i(e,t,c,a)?(o(e,t,a,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(e,t,c,"increasing"),s(e,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":111,"../../lib":242,"../ohlc/ohlc_defaults":410,"../scatter/period_defaults":447,"./attributes":359}],362:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":303,"../box/cross_trace_calc":354,"../box/layout_attributes":355,"../box/layout_defaults":356,"../box/plot":357,"../box/style":358,"../ohlc/hover":408,"../ohlc/select":412,"./attributes":359,"./calc":360,"./defaults":361}],363:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r"),s.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(u,f),[s]}}},{"../../components/color":111,"../../lib":242,"../bar/hover":343}],371:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"../bar/select":348,"./attributes":364,"./calc":365,"./cross_trace_calc":367,"./defaults":368,"./event_data":369,"./hover":370,"./layout_attributes":372,"./layout_defaults":373,"./plot":374,"./style":375}],372:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],373:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":111,"../../components/drawing":133,"../../constants/interactions":221,"../bar/style":350,"../bar/uniform_text":352,"@plotly/d3":18}],376:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":236,"../../plots/attributes":285,"../../plots/domain":317,"../../plots/template_attributes":325,"../pie/attributes":414}],377:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":324}],378:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":416}],379:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),d=c("values"),f=l(u,d),p=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,m=c("text"),y=c("texttemplate");if(y||(h=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||h&&"none"!==h){var g=c("textposition");o(e,t,s,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":242,"../../plots/domain":317,"../bar/defaults":340,"../pie/defaults":417,"./attributes":376}],380:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":425,"./attributes":376,"./base_plot":377,"./calc":378,"./defaults":379,"./layout_attributes":381,"./layout_defaults":382,"./plot":383,"./style":384}],381:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":421}],382:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":242,"./layout_attributes":381}],383:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../lib"),o=i.strScale,l=i.strTranslate,s=e("../../lib/svg_text_utils"),c=e("../bar/plot").toMoveInsideBar,u=e("../bar/uniform_text"),d=u.recordMinTextSize,f=u.clearMinTextSize,p=e("../pie/helpers"),h=e("../pie/plot"),m=h.attachFxHandlers,y=h.determineInsideTextFont,g=h.layoutAreas,v=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._fullLayout;f("funnelarea",r),v(t,e),g(t,r._size),i.makeTraceGroups(r._funnelarealayer,t,"trace").each((function(t){var u=n.select(this),f=t[0],h=f.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var d,f,p=[];for(p.push(u()),d=e.length-1;d>-1;d--)if(!(f=e[d]).hidden){var h=f.v/s;c+=h,p.push(u())}var m=1/0,y=-1/0;for(d=0;d-1;d--)if(!(f=e[d]).hidden){var k=p[M+=1][0],A=p[M][1];f.TL=[-k,A],f.TR=[k,A],f.BL=w,f.BR=T,f.pxmid=(L=f.TR,S=f.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=f.TL,T=f.TR}var L,S}(t),u.each((function(){var u=n.select(this).selectAll("g.slice").data(t);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,l){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=h.index;var u=f.cx,g=f.cy,v=n.select(this),x=v.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),v.call(m,e,t);var w="M"+(u+o.TR[0])+","+(g+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";x.attr("d",w),b(e,o,f);var T=p.castOption(h.textposition,o.pts),M=v.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each((function(){var f=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,y(h,o,r.font));f.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,p).call(s.convertToTspans,e);var m,v,x,b=a.bBox(f.node()),_=Math.min(o.BL[1],o.BR[1])+g,w=Math.max(o.TL[1],o.TR[1])+g;v=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(m=c(v,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,d(h.type,m,r),t[l].transform=m,f.attr("transform",i.getTextTransform(m))}))}}));var g=n.select(this).selectAll("g.titletext").data(h.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),c=h.title.text;h._meta&&(c=i.templateString(c,h._meta)),t.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,h.title.font).call(s.convertToTspans,e);var u=x(f,r._size);t.attr("transform",l(u.x,u.y)+o(Math.min(1,u.scale))+l(u.tx,u.ty))}))}))}))}},{"../../components/drawing":133,"../../lib":242,"../../lib/svg_text_utils":265,"../bar/plot":347,"../bar/uniform_text":352,"../pie/helpers":419,"../pie/plot":423,"@plotly/d3":18}],384:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":352,"../pie/style_one":425,"@plotly/d3":18}],385:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("./bin_attributes"),l=e("./constants"),s=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:a("x"),yhoverformat:a("y"),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:o("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:o("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:l.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":236,"../../plots/cartesian/axis_format_attributes":292,"../../plots/template_attributes":325,"../bar/attributes":336,"./bin_attributes":387,"./constants":391}],386:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;ai){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,f=-.1*t,p=e-f,h=r[0],m=r[1],y=Math.min(d(h+f,h+p,n,i),d(m+f,m+p,n,i)),g=Math.min(d(h+c,h+f,n,i),d(m+c,m+f,n,i));if(y>g&&go){var v=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",v);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(E)&&(H=o.tickIncrement(H,b.size,!0,p)),N.start=r.l2r(H),F||a.nestedProperty(t,g+".start").set(N.start)}var B=b.end,Y=r.r2l(I.end),V=void 0!==Y;if((b.endFound||V)&&Y!==r.r2l(B)){var U=V?Y:a.aggNums(Math.max,null,h);N.end=r.l2r(U),V||a.nestedProperty(t,g+".start").set(N.end)}var q="autobin"+l;return!1===t._input[q]&&(t._input[g]=a.extendFlat({},t[g]||{}),delete t._input[q],delete t[q]),[N,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],g=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),v="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[v],b=t[v+"calendar"],_=t.cumulative,w=f(e,t,g,v),T=w[0],M=w[1],k="string"==typeof T.size,A=[],L=k?A:T,S=[],D=[],O=[],C=0,P=t.histnorm,I=t.histfunc,N=-1!==P.indexOf("density");_.enabled&&N&&(P=P.replace(/ ?density$/,""),N=!1);var z,R="max"===I||"min"===I?null:0,F=s.count,E=c[P],j=!1,H=function(e){return g.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==I&&(z=t[x],j="avg"===I,F=s[I]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,_.direction,_.currentbin);var J=Math.min(m.length,y.length),Q=[],K=0,$=J-1;for(r=0;r=K;r--)if(y[r]){$=r;break}for(r=K;r<=$;r++)if(n(m[r])&&n(y[r])){var ee={p:m[r],s:y[r],b:0};_.enabled||(ee.pts=O[r],q?ee.ph0=ee.ph1=O[r].length?M[O[r][0]]:m[r]:(t._computePh=!0,ee.ph0=V(A[r]),ee.ph1=V(A[r+1],!0))),Q.push(ee)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,T.size,!1,b)-Q[0].p),l(Q,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(Q,t,X),Q},calcAllAutoBins:f}},{"../../lib":242,"../../plots/cartesian/axes":289,"../../registry":326,"../bar/arrays_to_calcdata":335,"./average":386,"./bin_functions":388,"./bin_label_vals":389,"./norm_functions":397,"fast-isnumeric":26}],391:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],392:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,d,f,p,h,m,y,g=t._histogramBinOpts={},v=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=g[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h0}function T(e){e.each((function(e){v.stroke(n.select(this),e.line.color)})).each((function(e){v.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function M(e,t,r){var n=e._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),i={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return o.coerce(a,i,g,e,t)}return m(a,i,s,l,n),y(a,i,s,l),i}function k(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function A(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(p.convertToTspans,a).call(d.font,t),d.bBox(o.node())}function L(e,t,r,n,a,i){var l="_cache"+t;e[l]&&e[l].key===a||(e[l]={key:a,value:r});var s=o.aggNums(i,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,m){var y,g=e._fullLayout;w(r)&&m&&(y=m()),o.makeTraceGroups(g._indicatorlayer,t,"trace").each((function(t){var m,S,D,O,C,P=t[0].trace,I=n.select(this),N=P._hasGauge,z=P._isAngular,R=P._isBullet,F=P.domain,E={w:g._size.w*(F.x[1]-F.x[0]),h:g._size.h*(F.y[1]-F.y[0]),l:g._size.l+g._size.w*F.x[0],r:g._size.r+g._size.w*(1-F.x[1]),t:g._size.t+g._size.h*(1-F.y[1]),b:g._size.b+g._size.h*F.y[0]},j=E.l+E.w/2,H=E.t+E.h/2,B=Math.min(E.w/2,E.h),Y=f.innerRadius*B,V=P.align||"center";if(S=H,N){if(z&&(m=j,S=H+B/2,D=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*Y)}),R){var U=f.bulletPadding,q=1-f.bulletNumberDomainSize+U;m=E.l+(q+(1-q)*b[V])*E.w,D=function(e){return k(e,(f.bulletNumberDomainSize-U)*E.w,E.h)}}}else m=E.l+b[V]*E.w,D=function(e){return k(e,E.w,E.h)};!function(e,t,r,a){var c,u,f,m=r[0].trace,y=a.numbersX,g=a.numbersY,T=m.align||"center",k=x[T],S=a.transitionOpts,D=a.onComplete,O=o.ensureSingle(t,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var P=O.selectAll("text").data(C);function I(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(_)||r(a).slice(-1).match(_))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=M(e,{tickformat:i});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var N,z=m.mode+m.align;m._hasDelta&&(N=function(){var t=M(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=function(e){return m.delta.relative?e.relativeDelta:e.delta},l=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+t(e)},s=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=o(r[0]));var c=O.select("text.delta");function f(){c.text(l(o(r[0]),a)).call(v.fill,s(r[0])).call(p.convertToTspans,e)}return c.call(d.font,m.delta.font).call(v.fill,s({delta:m._deltaLastValue})),w(S)?c.transition().duration(S.duration).ease(S.easing).tween("text",(function(){var e=n.select(this),t=o(r[0]),c=m._deltaLastValue,u=I(m.delta.valueformat,a,c,t),d=i(c,t);return m._deltaLastValue=t,function(t){e.text(l(d(t),u)),e.call(v.fill,s({delta:d(t)}))}})).each("end",(function(){f(),D&&D()})).each("interrupt",(function(){f(),D&&D()})):f(),u=A(l(o(r[0]),a),m.delta.font,k,e),c}(),z+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,z+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=u);m._hasNumber&&(!function(){var t=M(e,{tickformat:m.number.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=m.number.suffix,l=m.number.prefix,s=O.select("text.number");function u(){var t="number"==typeof r[0].y?l+a(r[0].y)+o:"-";s.text(t).call(d.font,m.number.font).call(p.convertToTspans,e)}w(S)?s.transition().duration(S.duration).ease(S.easing).each("end",(function(){u(),D&&D()})).each("interrupt",(function(){u(),D&&D()})).attrTween("text",(function(){var e=n.select(this),t=i(r[0].lastY,r[0].y);m._lastValue=r[0].y;var s=I(m.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(l+s(t(r))+o)}})):u(),c=A(l+a(r[0].y)+o,m.number.font,k,e)}(),z+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c);if(m._hasDelta&&m._hasNumber){var R,F,E=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(u.left+u.right)/2,(u.top+u.bottom)/2],H=.75*m.delta.font.size;"left"===m.delta.position&&(R=L(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+H),z,Math.min),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=L(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+H,z,Math.max),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),N.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&O.attr("transform",(function(){var e=a.numbersScaler(f);z+=e[2];var t,r=L(m,"numbersScale",1,e[0],z,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?g-r*f.bottom:g-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+t;var n=f[T];"center"===T&&(n=(f.left+f.right)/2);var i=y-r*n;return i=L(m,"numbersTranslate",0,i,z,Math.max),s(i,t)+l(r)}))}(e,I,t,{numbersX:m,numbersY:S,numbersScaler:D,transitionOpts:r,onComplete:y}),N&&(O={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},C={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var G=I.selectAll("g.angular").data(z?t:[]);G.exit().remove();var Z=I.selectAll("g.angularaxis").data(z?t:[]);Z.exit().remove(),z&&function(e,t,r,i){var o,l,d,f,p=r[0].trace,m=i.size,y=i.radius,g=i.innerRadius,v=i.gaugeBg,x=i.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+y/2],_=i.gauge,k=i.layer,A=i.transitionOpts,L=i.onComplete,S=Math.PI/2;function D(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-S;return r<-S?-S:r>S?S:r}function O(e){return n.svg.arc().innerRadius((g+y)/2-e/2*(y-g)).outerRadius((g+y)/2+e/2*(y-g)).startAngle(-S)}function C(e){e.attr("d",(function(e){return O(e.thickness).startAngle(D(e.range[0])).endAngle(D(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(o=M(e,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},I={},N=h.makeLabelFns(o,0).labelStandoff;I.xFn=function(e){var t=P(e);return Math.cos(t)*N},I.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(N+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*u)},I.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var z=function(e){return s(b[0]+y*Math.cos(e),b[1]-y*Math.sin(e))};d=function(e){return z(P(e))};if(l=h.calcTicks(o),f=h.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:l,layer:k,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(e){var t=P(e);return z(t)+"rotate("+-c(t)+")"}}),h.drawLabels(e,o,{vals:l,layer:k,transFn:d,labelFns:I})}var F=[v].concat(p.gauge.steps),E=_.selectAll("g.bg-arc").data(F);E.enter().append("g").classed("bg-arc",!0).append("path"),E.select("path").call(C).call(T),E.exit().remove();var j=O(p.gauge.bar.thickness),H=_.selectAll("g.value-arc").data([p.gauge.bar]);H.enter().append("g").classed("value-arc",!0).append("path");var B=H.select("path");w(A)?(B.transition().duration(A.duration).ease(A.easing).each("end",(function(){L&&L()})).each("interrupt",(function(){L&&L()})).attrTween("d",(Y=j,V=D(r[0].lastY),U=D(r[0].y),function(){var e=a(V,U);return function(t){return Y.endAngle(e(t))()}})),p._lastValue=r[0].y):B.attr("d","number"==typeof r[0].y?j.endAngle(D(r[0].y)):"M0,0Z");var Y,V,U;B.call(T),H.exit().remove(),F=[];var q=p.gauge.threshold.value;(q||0===q)&&F.push({range:[q,q],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var G=_.selectAll("g.threshold-arc").data(F);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(C).call(T),G.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(C).call(T),Z.exit().remove()}(e,0,t,{radius:B,innerRadius:Y,gauge:G,layer:Z,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var X=I.selectAll("g.bullet").data(R?t:[]);X.exit().remove();var W=I.selectAll("g.bulletaxis").data(R?t:[]);W.exit().remove(),R&&function(e,t,r,n){var a,i,o,l,c,u=r[0].trace,d=n.gauge,p=n.layer,m=n.gaugeBg,y=n.gaugeOutline,g=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform",s(g.l,g.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=g.h,A=u.gauge.bar.thickness*k,L=x.x[0],S=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-f.bulletNumberDomainSize:1);(a=M(e,u.gauge.axis))._id="xbulletaxis",a.domain=[L,S],a.setScale(),i=h.calcTicks(a),o=h.makeTransTickFn(a),l=h.getTickSigns(a)[2],c=g.t+g.h,a.visible&&(h.drawTicks(e,a,{vals:"inside"===a.ticks?h.clipEnds(a,i):i,layer:p,path:h.makeTickPath(a,c,l),transFn:o}),h.drawLabels(e,a,{vals:i,layer:p,transFn:o,labelFns:h.makeLabelFns(a,c)}));function D(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*k})).attr("height",(function(e){return e.thickness*k}))}var O=[m].concat(u.gauge.steps),C=d.selectAll("g.bg-bullet").data(O);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(D).call(T),C.exit().remove();var P=d.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(k-A)/2).call(T),w(b)?P.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var I=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),N=d.selectAll("g.threshold-bullet").data(I);N.enter().append("g").classed("threshold-bullet",!0).append("line"),N.select("line").attr("x1",a.c2p(u.gauge.threshold.value)).attr("x2",a.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*k).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),N.exit().remove();var z=d.selectAll("g.gauge-outline").data([y]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(D).call(T),z.exit().remove()}(e,0,t,{gauge:X,layer:W,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var J=I.selectAll("text.title").data(t);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[P.title.align]})).text(P.title.text).call(d.font,P.title.font).call(p.convertToTspans,e),J.attr("transform",(function(){var e,t=E.l+E.w*b[P.title.align],r=f.titlePadding,n=d.bBox(J.node());if(N){if(z)if(P.gauge.axis.visible)e=d.bBox(Z.node()).top-r-n.bottom;else e=E.t+E.h/2-B/2-n.bottom-r;R&&(e=S-(n.top+n.bottom)/2,t=E.l-f.bulletPadding*E.w)}else e=P._numbersTop-r-n.bottom;return s(t,e)}))}))}},{"../../components/color":111,"../../components/drawing":133,"../../constants/alignment":216,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../plots/cartesian/axis_defaults":291,"../../plots/cartesian/layout_attributes":304,"../../plots/cartesian/position_defaults":307,"./constants":401,"@plotly/d3":18,"d3-interpolate":22}],405:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../components/drawing/attributes").dash,l=e("../../components/fx/attributes"),s=e("../../constants/delta.js"),c=s.INCREASING.COLOR,u=s.DECREASING.COLOR,d=a.line;function f(e){return{line:{color:n({},d.color,{dflt:e}),width:d.width,dash:o,editType:"style"},editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},d.width,{}),dash:n({},o,{}),editType:"style"},increasing:f(c),decreasing:f(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},l.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":132,"../../components/fx/attributes":142,"../../constants/delta.js":218,"../../lib":242,"../../plots/cartesian/axis_format_attributes":292,"../scatter/attributes":427}],406:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../../constants/numerical").BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function c(e,t,r,o,s,c){for(var u=s.makeCalcdata(t,"open"),d=s.makeCalcdata(t,"high"),f=s.makeCalcdata(t,"low"),p=s.makeCalcdata(t,"close"),h=Array.isArray(t.text),m=Array.isArray(t.hovertext),y=!0,g=null,v=!!t.xperiodalignment,x=[],b=0;bg):y=k>w,g=k;var A=c(w,T,M,k);A.pos=_,A.yc=(w+k)/2,A.i=b,A.dir=y?"increasing":"decreasing",A.x=A.pos,A.y=[M,T],v&&(A.orig_p=r[b]),h&&(A.tx=t.text[b]),m&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[s._id]=i.findExtremes(s,n.concat(f,d),{padded:!0}),x.length&&(x[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),l=function(e,t,r){var a=r._minDiff;if(!a){var i,l=e._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat):((v=a.extendFlat({},f)).y0=v.y1=_,v.yLabelVal=b,v.yLabel=c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat),v.name="",d.push(v),y[b]=v)}return d}function f(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,d=i[0].t,f=u(e,t,r,a);if(!f)return[];var p=i[f.index],h=f.index=p.i,m=p.dir;function y(e){return d.labels[e]+n.hoverLabelText(o,s[e][h],s.yhoverformat)}var g=p.hi||s.hoverinfo,v=g.split("+"),x="all"===g,b=x||-1!==v.indexOf("y"),_=x||-1!==v.indexOf("text"),w=b?[y("open"),y("high"),y("low"),y("close")+" "+c[m]]:[];return _&&l(p,s,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?d(e,t,r,n):f(e,t,r,n)},hoverSplit:d,hoverOnPoints:f}},{"../../components/color":111,"../../components/fx":151,"../../constants/delta.js":218,"../../lib":242,"../../plots/cartesian/axes":289}],409:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":303,"./attributes":405,"./calc":406,"./defaults":407,"./hover":408,"./plot":411,"./select":412,"./style":413}],410:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var d=Math.min(l.length,s.length,c.length,u.length);return o&&(d=Math.min(d,a.minRowLength(o))),t._length=d,d}}},{"../../lib":242,"../../registry":326}],411:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.yaxis,l=t.xaxis,s=!!l.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var c=i.tickLen,u=t.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=l.c2p(e.pos-c,!0),r=l.c2p(e.pos+c,!0),n=s?(t+r)/2:l.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},{"../../lib":242,"@plotly/d3":18}],412:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),d=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),d){t._length=d,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),h=c("texttemplate");if(h||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||f&&"none"!==f){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":242,"../../plots/domain":317,"../bar/defaults":340,"./attributes":414,"fast-isnumeric":26}],418:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":147}],419:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,d)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(d||p){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(l||h||d){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||f)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=d/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function R(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),I(t,i);var f=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var f=n.select(this),h=t[0],m=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),f.attr("stroke-linejoin","round"),f.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],_=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),f=u.selectAll("path.surface").data([a]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),m.pull){var g=+y.castOption(m.pull,a.pts)||0;g>0&&(o+=g*a.pxmid[0],c+=g*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===h.vTotal){var M="M"+(o+a.px0[0])+","+(c+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?f.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+M):f.attr("d",M)}else{var k=O(a.px0,a.px1,!0,1);if(T){var A=1-T;f.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+k+"Z")}else f.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+k+"Z")}z(e,a,h);var L=y.castOption(m.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):b(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var g,v=l.bBox(u.node());if("outside"===L)g=D(v,a);else if(g=w(v,a,h),"auto"===L&&g.scale<1){var x=s.ensureUniformFontSize(e,m.outsidetextfont);u.call(l.font,x),g=D(v=l.bBox(u.node()),a)}var T=g.textPosAngle,M=void 0===T?a.pxmid:N(h.r,T);if(g.targetX=o+M[0]*g.rCenter+(g.x||0),g.targetY=c+M[1]*g.rCenter+(g.y||0),R(g,v),g.outside){var k=g.targetY;a.yLabelMin=k-v.height/2,a.yLabelMid=k,a.yLabelMax=k+v.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}g.fontSize=f.size,p(m.type,g,r),t[i].transform=g,u.attr("transform",s.getTextTransform(g))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=s.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,m.title.font).call(d.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):O(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,d,f,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),v=p-h;if(v*s>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=v):(m+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-d.indexOf(e)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],d=u.concat(c),p=[],f=0;fMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(d-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,m),_&&m.automargin){var M=l.bBox(f.node()),k=m.domain,A=i.w*(k.x[1]-k.x[0]),L=i.h*(k.y[1]-k.y[0]),S=(.5*A-h.r)/i.w,C=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(h.cx-h.r-M.left,0),r:Math.max(M.right-(h.cx+h.r),0),b:Math.max(M.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-M.top,0),pad:5})}}))}));setTimeout((function(){f.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:R}},{"../../components/color":111,"../../components/drawing":133,"../../components/fx":151,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/plots":324,"../bar/constants":338,"../bar/uniform_text":352,"./event_data":418,"./helpers":419,"@plotly/d3":18}],424:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":352,"./style_one":425,"@plotly/d3":18}],425:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":111,"./helpers":419}],426:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&O[g].gap;)g--;for(x=O[g].s,m=O.length-1;m>g;m--)O[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],434:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),d=e("./marker_defaults"),f=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,y){function g(r,a){return n.coerce(e,t,i,r,a)}var v=s(e,t,y,g);if(v||(t.visible=!1),t.visible){c(e,t,y,g),g("xhoverformat"),g("yhoverformat");var x=u(e,t,y,g),b=!x&&v=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(f.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=N[P][1])>=Z&&(R=N[P-1][0],F=N[P][0],j-E&&(z=R+(F-R)*(Z-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var X=l.defaultLine;return l.opacity(d.fillcolor)?X=d.fillcolor:l.opacity((d.line||{}).color)&&(X=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:Z,y1:Z,color:X,hovertemplate:!1}),delete e.index,d.text&&!Array.isArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}},{"../../components/color":111,"../../components/fx":151,"../../lib":242,"../../registry":326,"./get_trace_color":437}],439:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"./arrays_to_calcdata":426,"./attributes":427,"./calc":428,"./cross_trace_calc":432,"./cross_trace_defaults":433,"./defaults":434,"./format_labels":436,"./hover":438,"./marker_colorbar":445,"./plot":448,"./select":449,"./style":451,"./subtypes":452}],440:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":121,"../../components/colorscale/helpers":122,"../../lib":242}],441:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,d=e("./constants");t.exports=function(e,t){var r,n,i,f,p,h,m,y,g,v,x,b,_,w,T,M,k,A,L=t.xaxis,S=t.yaxis,D="log"===L.type,O="log"===S.type,C=L._length,P=S._length,I=t.connectGaps,N=t.baseTolerance,z=t.shape,R="linear"===z,F=t.fill&&"none"!==t.fill,E=[],j=d.minTolerance,H=e.length,B=new Array(H),Y=0;function V(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(D&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*P*(L._m>0?o:l)/(S._m*C*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===B[Y-1][0],a=r===B[Y-1][1];if(!n||!a)if(Y>1){var i=t===B[Y-2][0],o=r===B[Y-2][1];n&&(t===te||t===re)&&i?o?Y--:B[Y-1]=e:a&&(r===ne||r===ae)&&o?i?Y--:B[Y-1]=e:B[Y++]=e}else B[Y++]=e}function ue(e){B[Y-1][0]!==e[0]&&B[Y-1][1]!==e[1]&&ce([W,J]),ce(e),Q=null,W=J=0}function de(e){if(k=e[0]/C,A=e[1]/P,Z=e[0]re?re:0,X=e[1]ae?ae:0,Z||X){if(Y)if(Q){var t=$(Q,e);t.length>1&&(ue(t[0]),B[Y++]=t[1])}else K=$(B[Y-1],e)[0],B[Y++]=K;else B[Y++]=[Z||e[0],X||e[1]];var r=B[Y-1];Z&&X&&(r[0]!==Z||r[1]!==X)?(Q&&(W!==Z&&J!==X?ce(W&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Z,J||X]):W&&J&&ce([W,J])),ce([Z,X])):W-Z&&J-X&&ce([Z||W,X||J]),Q=e,W=Z,J=X}else Q&&ue($(Q,e)[0]),B[Y++]=e;var n,a,i,o}for("linear"===z||"spline"===z?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,e)q(h,fe))break;i=h,(_=g[0]*y[0]+g[1]*y[1])>x?(x=_,f=h,m=!1):_=e.length||!h)break;de(h),n=h}}else de(f)}Q&&ce([W||Q[0],J||Q[1]]),E.push(B.slice(0,Y))}return E}},{"../../constants/numerical":222,"../../lib":242,"./constants":431}],442:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],443:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,d=-1,f=0,p=-1;for(i=0;i=0?s=p:(s=p=f,f++),s0?Math.max(r,i):0}}},{"fast-isnumeric":26}],445:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],446:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),d=(e.line||{}).color;(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":111,"../../components/colorscale/defaults":121,"../../components/colorscale/helpers":122,"./subtypes":452}],447:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":222,"../../lib":242}],448:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),d=e("./link_traces"),f=e("../../lib/polygon").tester;function p(e,t,r,d,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),d=n.extent(i.simpleMap(s.range,s.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=d[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,D;v(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),d[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,P,I="",N=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,N=z._polygons);var R,F,E,j,H,B,Y,V="",U="",q=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(d),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},q=u(d,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),y=0;y1){var r=n.select(this);if(r.datum(d),e)v(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),s.singleLineStyle(d,a)}}}}}var Z=k.selectAll(".js-line").data(q);v(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(S?(S.datum(d),j&&B&&(O?("y"===O?j[1]=B[1]=b.c2p(0,!0):"x"===O&&(j[0]=B[0]=x.c2p(0,!0)),v(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle)):v(S).attr("d",V+"Z").call(s.singleFillStyle))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?v(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle):v(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(N)):(W(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?W(S):D&&W(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(d),L.datum(d),function(t,a,i){var o,u=i[0].trace,d=c.hasMarkers(u),f=c.hasText(u),p=ee(u),h=te,m=te;if(d||f){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?Q:J:_&&!w&&(y=K),d&&(h=y),f&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),d&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,d);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){v(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function K(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,f,h=!i,m=!!i&&i.duration>0,y=d(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":133,"../../lib":242,"../../lib/polygon":254,"../../registry":326,"./line_points":441,"./link_traces":443,"./subtypes":452,"@plotly/d3":18}],449:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],d=l[0].trace;if(!n.hasMarkers(d)&&!n.hasText(d))return[];if(!1===t)for(r=0;r")),u.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,y),[u]}function M(e){return n(m,e,f[h+"hoverformat"])}}},{"../../components/color":111,"../../constants/delta.js":218,"../../plots/cartesian/axes":289,"../bar/hover":343}],462:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"../bar/select":348,"./attributes":455,"./calc":456,"./cross_trace_calc":458,"./defaults":459,"./event_data":460,"./hover":461,"./layout_attributes":463,"./layout_defaults":464,"./plot":465,"./style":466}],463:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],464:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l0&&(y+=f?"M"+d[0]+","+h[1]+"V"+h[0]:"M"+d[1]+","+h[0]+"H"+d[0]),"between"!==p&&(r.isSum||l path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":111,"../../components/drawing":133,"../../constants/interactions":221,"../bar/style":350,"../bar/uniform_text":352,"@plotly/d3":18}],467:[function(e,t,r){"use strict";var n=e("../plots/cartesian/axes"),a=e("../lib"),i=e("../plot_api/plot_schema"),o=e("./helpers").pointsAccessorFunction,l=e("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var s=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=s.aggregations;function u(e,t,r,i){if(i.enabled){for(var o=i.target,s=a.nestedProperty(t,o),c=s.get(),u=function(e,t){var r=e.func,n=t.d2c,i=t.c2d;switch(r){case"count":return d;case"first":return f;case"last":return p;case"sum":return function(e,t){for(var r=0,a=0;aa&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return f(e)>l};case">=":return function(e){return f(e)>=l};case"[]":return function(e){var t=f(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=f(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=f(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=f(e);return tl[1]};case"](":return function(e){var t=f(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=f(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(f(e))};case"}{":return function(e){return-1===l.indexOf(f(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),f),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(d))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],69:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var d=t.linesIntersect(o,l,c,u);if(!1===d){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var f=t.pointsSame(o,c),p=t.pointsSame(l,u);if(f&&p)return n;var h=!f&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(f)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===d.alongA&&(-1===d.alongB?s(e,c):0===d.alongB?s(e,d.pt):1===d.alongB&&s(e,u)),0===d.alongB&&(-1===d.alongA?s(n,o):0===d.alongA?s(n,d.pt):1===d.alongA&&s(n,l));return!1}for(var d=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(f,h);if(e)return e}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!h&&h.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(e)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(v.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(e)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)g=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:g,below:g};r&&r.status(f.seg,!!h&&h.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}d.push(f.seg)}i.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":74,timers:75}],76:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,d=!1,f=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:R(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(m,255)},d=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=N(t.s),c=N(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),d=!0,f="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=N(t.s),u=N(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),d=!0,f="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=D(i),{ok:d,format:t.format||f,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:N(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),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})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],77:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=f[o-f[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=d[e-d[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=d[o.year-d[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=f[a.year-f[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=f[i.year-f[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=d[i.year-d[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":91,"object-assign":64}],80:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":91,"object-assign":64}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":91,"object-assign":64}],82:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":91,"object-assign":64}],83:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":91,"object-assign":64}],84:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":91,"object-assign":64}],85:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":91,"object-assign":64}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),d=e-this.toJD(s,u,1)+1;return this.newDate(s,u,d)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":91,"object-assign":64}],88:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":91,"object-assign":64}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":91,"object-assign":64}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":91,"object-assign":64}],91:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":64}],92:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,d=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){v("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(f,p);h>S;S=this.daysInMonth(f,p))p++,h-=S}return d>-1?this.fromJD(d):this.newDate(f,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":91,"object-assign":64}],93:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],94:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":217,"../../plot_api/plot_template":278,"../../plots/cartesian/constants":296,"../../plots/font_attributes":318,"./arrow_paths":93}],95:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],d=e["_"+i+"padminus"],f={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+f,m=p-f,y=3*e.startarrowsize*e.arrowwidth||0,g=y+f,v=y-f;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(d,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,v=l?v-l:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(d,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":242,"../../plots/cartesian/axes":289,"./draw":100}],96:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,d=[],f=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),d={},f=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,X=["x","y"],W=0;W1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===fe;"x"===te?(K=t[te],J=he?ae._offset+ae._length*K:J=T.l+T.w*K):(K=1-t[te],J=he?ae._offset+ae._length*K:J=T.t+T.h*K),$=t.showarrow?.5:K}if(t.showarrow){de.head=J;var me=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),de.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,de.tail=T.t+T.h*me):de.tail=T.l+T.w*me:de.tail=ae._offset+ae.r2p(me),Q=ee}else de.tail=J+me,Q=ee+me;de.text=de.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(de.head=o.constrain(de.head,1,ge-1)),"pixel"===ne){var ve=-Math.max(de.tail-3,de.text),xe=Math.min(de.tail+3,de.text)-ge;ve>0?(de.tail+=ve,de.text+=ve):xe>0&&(de.tail-=xe,de.text-=xe)}de.tail+=ue,de.head+=ue}else Q=ee=se*U($,ce),de.text=J+ee;de.text+=ue,ee+=ue,Q+=ue,t["_"+te+"padplus"]=se/2+Q,t["_"+te+"padminus"]=se/2-Q,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)R.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),d)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;q.call(f.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),R.call(u.setTranslate,Math.round(O.x.text-E/2),Math.round(O.y.text-V/2)),I.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,d=O.y.head,f=O.x.tail+r,p=O.y.tail+n,m=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),N=+H.attr("height"),z=m-.5*D,F=z+D,E=b-.5*N,j=E+N,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,d,s+1e6,d+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(f,p,s,d,e[0],e[1],e[2],e[3]);t&&(f=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,q=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+f+","+p+"L"+s+","+d).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(y(G,U,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,X=d;if(t.standoff){var W=Math.sqrt(Math.pow(s-f,2)+Math.pow(d-p,2));Z+=t.standoff*(f-s)/W,X+=t.standoff*(p-d)/W}var J,Q,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-X),transform:l(Z,X)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:K.node(),gd:e,prepFn:function(){var e=u.getTranslate(R);J=e.x,Q=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,Q),a=n[0]+e,i=n[1]+r;R.call(u.setTranslate,a,i),L("x",v(g,e,"x",T,t)),L("y",v(x,r,"y",T,t)),t.axref===t.xref&&L("ax",v(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",v(x,r,"ay",T,t)),q.attr("transform",l(e,r)),I.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),N)h.init({element:R.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",v(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",v(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=v(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=v(x,r,"y",T,t);else{var u=t._ysize/T.h,d=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(d-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(R,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(R),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(d=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void N();if(b){if(b*b>w*w+T*T)return void N();var M=b*Math.cos(d),k=b*Math.sin(d);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void N();var A=_*Math.cos(d),L=_*Math.sin(d);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":321,"../annotations/draw":100}],107:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Z*=J*c.roundUp(W/J,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[V+H,V+F-H],G.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var Q,K=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),m.draw(r,n,d(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+E)*s.w,n=G.title.font.size;e="top"===A?(1-(V+F-H))*s.h+s.t+3+.75*n:(1-(V+H))*s.h+s.t-3-.25*n,te(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),d=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),f?(ee=p.bBox(f).height)>h&&(d[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)G.domain[1]-=ee/s.h,d[1]*=-1;else{G.domain[0]+=ee/s.h;var m=y.lineCount(o);d[1]+=(1-m)*h}i.attr("transform",u(d[0],d[1])),G.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-G.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var v=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(P);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var x=L.map(G.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?L[0]:(P[i]+P[i-1])/2,i===P.length-1?L[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:B,width:Math.max(N,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=D(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(g.color&&g.width?I:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(e))+g.width/2%1)+"h"+N).call(p.lineGroupStyle,g.width,S(e),g.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var _=B+N+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(G),M=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,T):T,layer:$,path:l.makeTickPath(G,_,M),transFn:l.makeTransTickFn(G)}),l.drawLabels(r,G,{vals:T,layer:$,transFn:l.makeTransTickLabelFn(G),labelFns:l.makeLabelFns(G,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));te("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=N+t.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(K.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=U-q;e.select("."+k.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:q-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:B,y:q+t.ypad+("top"===A?ee:0),width:Math.max(N,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var d=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-d,s.t));var f={},m=T[t.yanchor],y=M[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*m,f.b=c*y):(f.t=f.b=0,f.yt=t.y+t.len*m,f.yb=t.y-t.len*y);var g=T[t.xanchor],v=M[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*g,f.r=l*v;else{var x=l-N;f.l=x*g,f.r=x*v,f.xl=t.x-t.thickness*g,f.xr=t.x+t.thickness*v}i.autoMargin(r,t._id,f)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":216,"../../lib":242,"../../lib/extend":236,"../../lib/setcursor":262,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../plots/cartesian/axis_defaults":291,"../../plots/cartesian/layout_attributes":304,"../../plots/cartesian/position_defaults":307,"../../plots/plots":324,"../../registry":326,"../color":111,"../colorscale/helpers":122,"../dragelement":130,"../drawing":133,"../titles":209,"./constants":113,"@plotly/d3":18,tinycolor2:76}],116:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":242}],117:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":112,"./defaults":114,"./draw":115,"./has_colorbar":116}],118:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,d=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(f+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",g=(l(f+p),l(f+h),l(f+m),{});g[h]=g[m]=void 0;var v={};v[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:d||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":258,"../../lib/sort_object_keys":263,"../colorbar/attributes":112,"./scales.js":126}],119:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,d=i(u),f=!1!==d.auto,p=d.min,h=d.max,m=d.mid,y=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():f&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=g():f&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),f&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",o))}},{"../../lib":242,"./helpers":122,"fast-isnumeric":26}],120:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],128:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":242}],129:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],130:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function d(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,f,p,h,m,y=e.gd,g=1,v=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(g=Math.max(g-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=d(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":242,"../../plots/cartesian/constants":296,"./align":127,"./cursor":128,"./unhover":131,"has-hover":57,"has-passive-events":58,"mouse-event-offset":62}],131:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":234,"../../lib/events":235,"../../lib/throttle":266,"../fx/constants":145}],132:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],133:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),d=a.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",d(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},x.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var b=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(e){var t=b[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(e,t){var r=e%100;return x.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var T={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,d=A[i],f=new Array(u),p=0;p"+g(e);h._gradientUrlQueryParts[v]=1},x.pattern=function(e,t,r,i,o,l,s,u,d,f,p,h){var m="legend"===t;u&&("overlay"===d?(f=u,p=c.contrast(f)):(f=void 0,p=u));var y,g,v,x,b,_,w,T,M,k,A,L=r._fullLayout,S="p"+L._uid+"-"+i,D={};switch(o){case"/":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",D={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"\\":y=l*Math.sqrt(2),g=l*Math.sqrt(2),_="path",D={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"x":y=l*Math.sqrt(2),g=l*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,x=l-l*Math.sqrt(1-s),_="path",D={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",D={d:v="M"+(y=l)/2+",0L"+y/2+","+(g=l),opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"-":_="path",_="path",D={d:v="M0,"+(g=l)/2+"L"+(y=l)+","+g/2,opacity:h,stroke:p,"stroke-width":(x=s*l)+"px"};break;case"+":_="path",v="M"+(y=l)/2+",0L"+y/2+","+(g=l)+"M0,"+g/2+"L"+y+","+g/2,x=l-l*Math.sqrt(1-s),_="path",D={d:v,opacity:h,stroke:p,"stroke-width":x+"px"};break;case".":y=l,g=l,s.pattern_filled";L._patternUrlQueryParts[P]=1},x.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},x.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},x.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var d,f,p,h=!1;if(e.so)p=l.outlierwidth,f=l.outliercolor,d=o.outliercolor;else{var m=(l||{}).width;p=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,h=!0),d="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,d).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var y=o.gradient,g=e.mgt;g?h=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,b=v&&x.getPatternAttr(v.shape,e.i,"");if(g&&"none"!==g){var _=e.mgc;_?h=!0:_=y.color;var T=r.uid;h&&(T+="-"+e.i),x.gradient(t,i,T,g,[[0,_],[1,d]],"fill")}else if(b){var M=x.getPatternAttr(v.bgcolor,e.i,null),k=x.getPatternAttr(v.fgcolor,e.i,null),L=v.fgopacity,S=x.getPatternAttr(v.size,e.i,8),D=x.getPatternAttr(v.solidity,e.i,.3),O=e.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),C=r.uid;O&&(C+="-"+e.i),x.pattern(t,"point",i,C,b,S,D,e.mcc,v.fillmode,M,k,L)}else c.fill(t,d);p&&c.stroke(t,f)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,d=l.opacity,f=void 0!==u,p=void 0!==d;(a.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=i.color,y=o.color,g=l.color;(y||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:g||t});var v=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(x.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,d=u?u(e,t,s):{},p={};v(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,d,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=D(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,g).text(c).call(f.convertToTspans,r).call(S,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=D(e,t);c.fill(a,i),S(a,o,l,e.mrc2||e.mrc)}))}};function O(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),d=(u*u*i-c*c*l)*a,f=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&d/p),2),n.round(t[1]+(p&&f/p),2)],[n.round(t[0]-(h&&d/h),2),n.round(t[1]-(h&&f/h),2)]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},I=0),r&&(x.savedBBoxes[r]=y),I++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",z(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=d(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var R=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(R,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(F);e=1===t&&1===r?[]:[d(o,l),"scale("+t+","+r+")",d(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":147,"../../constants/alignment":216,"../../constants/interactions":221,"../../constants/xmlns_namespaces":223,"../../lib":242,"../../lib/svg_text_utils":265,"../../registry":326,"../../traces/scatter/make_bubble_size_func":444,"../../traces/scatter/subtypes":452,"../color":111,"../colorscale":123,"./symbol_defs":134,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:76}],134:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":18}],135:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],136:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),d=0;d0;t.each((function(t){var d,f=t[0].trace,p=f.error_x||{},h=f.error_y||{};f.ids&&(d=function(e){return e.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var d=h.width;i="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(i+="m-"+d+",0h"+2*d),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var f=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!f.size()?f=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(l.duration).ease(l.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":452,"../drawing":133,"@plotly/d3":18,"fast-isnumeric":26}],141:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":111,"@plotly/d3":18}],142:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":236,"../../plots/font_attributes":318,"./layout_attributes":152}],143:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexb[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+b[0]._offset,t.pointerY=ie+_[0]._offset,E="xval"in t?g.flat(l,t.xval):g.p2c(b,ae),Y="yval"in t?g.flat(l,t.yval):g.p2c(_,ie),!a(E[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(U=0;U$&&(ee.splice(0,$),ce=ee[0].distance),m&&0!==I&&0===ee.length){K.distance=I,K.index=!1;var d=G._module.hoverPoints(K,J,Q,"closest",{hoverLayer:s._hoverlayer});if(d&&(d=d.filter((function(e){return e.spikeDistance<=I}))),d&&d.length){var f,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var y=h[0];a(y.x0)&&a(y.y0)&&(f=fe(y),(!re.vLinePoint||re.vLinePoint.spikeDistance>f.spikeDistance)&&(re.vLinePoint=f))}var v=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(v.length){var x=v[0];a(x.x0)&&a(x.y0)&&(f=fe(x),(!re.hLinePoint||re.hLinePoint.spikeDistance>f.spikeDistance)&&(re.hLinePoint=f))}}}}}function de(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Oe(ee[Ae]);ee=Le,ye()}var Ce=e._hoverdata,Pe=[],Ie=H(e),Ne=B(e);for(V=0;V1||ee.length>1)||"closest"===L&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),Xe=P(ee,{gd:e,hovermode:L,rotateLabels:Ge,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});g.isUnifiedHover(L)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,d=1,f=e.size(),p=new Array(f),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(d=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(y.push.apply(y,g),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xe,Ge?"xa":"ya",s),N(Xe,Ge,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var We=y.getComponentMethod("annotations","hasClickToShow")(e,Pe);d(n.select(t.target),We?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:E,yvals:Y})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),d=Math.max(r,n),f=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,d+=v,f+=x,h+=x}c.bbox={x0:u+o,x1:d+o,y0:f+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,d=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{},T=t.fontFamily||v.HOVERFONT,M=t.fontSize||v.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,C=i.charAt(0),P=k[C+"Label"],N=Y(r,m),z=N.top,R=N.width,F=N.height,E=void 0!==P&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(E){var j,H,B=!0;for(j=0;ja.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+v.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+v.width/2)+"v"+x+(2*L+v.height)+"H-"+(L+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,O,C;"right"===D.side?(_="start",O=1,C="",y=S._offset+S._length):(_="end",O=-1,C="-",y=S._offset),g=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+v.height/2)+"h"+C+(2*L+v.width)+"V-"+(L+v.height/2)+"H"+C+A+"V-"+A+"Z");var I,N=v.height/2,R=z-v.top-N,F="clip"+a._uid+"commonlabel"+D._id;if(y=0?ae:ie+se=0?ie:ye+se=0?re:ne+ce=0?ne:ge+ce=0,"top"!==e.idealAlign&&q||!G?q?(N+=H/2,e.anchor="start"):e.anchor="middle":(N-=H/2,e.anchor="end");else if(e.pos=N,q=C+j/2+Z<=R,G=C-j/2-Z>=0,"left"!==e.idealAlign&&q||!G)if(q)C+=j/2,e.anchor="start";else{e.anchor="middle";var X=Z/2,W=C+X-R,J=C-X;W>0&&(C-=W),J<0&&(C+=-J)}else C-=j/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,N)+(c?s(_):""))})),ve}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var d=e.hovertemplate||!1;if(d){var f=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),s=(s=o.hovertemplateString(d,f,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function N(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],d=c*(A+L),p=d+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(d-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var g=h+d,v=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(f.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+d+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+d,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function R(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,g,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,b,_=i.readability(v.color,h)<1.5?p.contrast(h):v.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(d){var S,D,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+O.x,D=a._offset+O.y);var C,P,I=i.readability(O.color,h)<1.5?p.contrast(h):O.color,N=n.spikemode,z=n.spikethickness,R=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==N.indexOf("toaxis")||-1!==N.indexOf("across")){if(-1!==N.indexOf("toaxis")&&(C=F,P=D),-1!==N.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==N.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:R}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),d=c[0],f=c[1],p=u[0],h=u[1];return{x:d,y:f,width:p-d,height:h-f,top:Math.min(f,h),left:Math.min(d,p),right:Math.max(d,p),bottom:Math.max(f,h)}}},{"../../lib":242,"../../lib/events":235,"../../lib/override_cursor":253,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../registry":326,"../color":111,"../dragelement":130,"../drawing":133,"../legend/defaults":163,"../legend/draw":164,"./constants":145,"./helpers":147,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:76}],149:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":242,"../color":111,"./helpers":147}],150:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":242,"./layout_attributes":152}],151:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":242,"../dragelement":130,"./attributes":142,"./calc":143,"./click":144,"./constants":145,"./defaults":146,"./helpers":147,"./hover":148,"./layout_attributes":152,"./layout_defaults":153,"./layout_global_defaults":154,"@plotly/d3":18}],152:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":318,"./constants":145}],153:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":242,"./hoverlabel_defaults":149,"./hovermode_defaults":150,"./layout_attributes":152}],154:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":242,"./hoverlabel_defaults":149,"./layout_attributes":152}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),d=u*(1-o),f=0;f1){if(!f&&!p&&!h)"independent"===M("pattern")&&(f=!0);y._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,v),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,f=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(h){var x=f.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var y=i.newContainer(t,"legend");if(T("uirevision",t.uirevision),!1!==m){T("bgcolor",t.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,x,b=a.coerceFont(T,"font",t.font),_="h"===T("orientation");if(_?(g=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(v=1.1,x="bottom"):(v=-.1,x="top")):(g=1.02,v=1,x="auto"),T("traceorder",f),s.isGrouped(t.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",x),T("valign"),a.noneOrAll(c,y,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=a.extendFlat({},b,{size:a.bigFont(b.size)});a.coerceFont(T,"title.font",w)}}}function T(e,t){return a.coerce(c,y,o,e,t)}}},{"../../lib":242,"../../plot_api/plot_template":278,"../../plots/layout_attributes":322,"../../registry":326,"./attributes":161,"./helpers":167}],164:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),d=e("../../lib/svg_text_utils"),f=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,g=h.FROM_BR,v=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&f(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&f(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?T(n,h):n);var y=r.itemwidth+2*p.itemGap;d.positionText(m,y,0),f?m.call(d.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(T(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),d=u[u.length-1],f=a.keyedContainer(i,"transforms["+d+"].styles","target","value.name");f.set(l.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(m,e,t,r)}function T(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),d.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,f=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),v=d.lineCount(g),x=g.node();if(u=h*v,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),d.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,f-=r.itemwidth),d.positionText(g,b,-h*((v-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=f)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,d=e._fullLayout,f="legend"+d._uid,h=t._inHover;h?(r=t.layer,f+="-hover"):r=d._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=v(t.entries,t)}else{if(!e.calcdata)return;l=d.showlegend&&v(e.calcdata,t)}var m=d.hiddenlabels||[];if(!(h||d.showlegend&&l.length))return r.selectAll(".legend").remove(),d._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var T=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),S=a.ensureSingleById(d._topdefs,"clipPath",f,(function(e){e.append("rect")})),D=a.ensureSingle(T,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));D.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var O=a.ensureSingle(T,"g","scrollbox"),C=t.title;if(t._titleWidth=0,t._titleHeight=0,C.text){var P=a.ensureSingle(O,"text","legendtitletext");P.attr("text-anchor","start").call(c.font,C.font).text(C.text),k(P,O,e,t,1)}else O.selectAll(".legendtitletext").remove();var I=a.ensureSingle(T,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),N=O.selectAll("g.groups").data(l);N.enter().append("g").attr("class","groups"),N.exit().remove();var z=N.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(M,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,d=2*u,f=p.itemGap,h=a.itemwidth+2*f,m=2*(u+f),y=L(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,x=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+f),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=f+h+d,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),M=a.x<0||0===a.x&&"right"===T,k=a.x>1||1===a.x&&"left"===T,S=v||g,D=i.width/2;a._maxWidth=Math.max(M?S&&"left"===T?o.l+o.w:D:k?S&&"right"===T?o.r+o.w:D:o.w,2*h);var O=0,C=0;r.each((function(e){var t=e[0].width+h;O=Math.max(O,t),C+=t})),_=null;var P=0;if(s){var I=0,N=0,z=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+f+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),I=Math.max(I,t);var r=e+f;r+u+N>a._maxWidth&&(P=Math.max(P,N),N=0,z+=I+x,I=t),c.setTranslate(this,N,z),N+=r})),a._width=Math.max(P,N)+u,a._height=z+I+m}else{var R=r.size(),F=C+d+(R-1)*f=a._maxWidth&&(P=Math.max(P,B),j=0,H+=E,a._height+=E,E=0),c.setTranslate(this,w[0]+u+j,w[1]+u+H+t/2+f),B=j+r+f,j+=n,E=Math.max(E,t)})),F?(a._width=j+d,a._height=E+m):(a._width=Math.max(P,B)+d,a._height+=E+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Y=e._context.edits,V=Y.legendText||Y.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?h:_||h+e[0].width;l||(a+=f/2),c.setRect(t,0,-r/2,a,r)}))}(e,N,z,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*y[n]})}(e)){var l,u,m,v,x=d._size,b=t.borderwidth,w=x.l+x.w*t.x-y[A(t)]*t._width,M=x.t+x.h*(1-t.y)-y[L(t)]*t._effHeight;if(!h&&d.margin.autoexpand){var k=w,C=M;w=a.constrain(w,0,d.width-t._width),M=a.constrain(M,0,d.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),M!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(T,w,M),I.on(".drag",null),T.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),D.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(O,0,0),S.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(O,f,e),c.setRect(I,0,0,0,0),delete t._scrollY}else{var N,z,R,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);D.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),S.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(O,f,e),U(B,F,H),T.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;N="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,R=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(R,N,z),F,H))}));I.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(N=e.changedTouches[0].clientY,R=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(R,N,z),F,H))}));O.call(V)}if(e._context.edits.legendPosition)T.classed("cursor-move",!0),s.init({element:T.node(),gd:e,prepFn:function(){var e=c.getTranslate(T);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(T,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,T,a,t,n)}})}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(O,0,-r),c.setRect(I,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),S.select("rect").attr("y",b+r)}}],e)}(e,t)}},{"../../constants/alignment":216,"../../lib":242,"../../lib/events":235,"../../lib/svg_text_utils":265,"../../plots/plots":324,"../../registry":326,"../color":111,"../dragelement":130,"../drawing":133,"./constants":162,"./get_legend_data":165,"./handle_click":166,"./helpers":167,"./style":169,"@plotly/d3":18}],165:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],d=!1,f={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),d=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,d=u.marker||{},f=d.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,d.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(d),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(d,"")(m)}var g=p||i.mc||d.color,v=d.pattern,x=v&&l.getPatternAttr(v.shape,0,"");if(x){var b=l.getPatternAttr(v.bgcolor,0,null),_=l.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,M=y(v.size,8,10),k=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,v.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||f.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});d(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var d=a.selectAll("g.legendsymbols").data([e]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,d=n.select(this),f=c(a),p=f.colorscale,m=f.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}d.attr("d",e[0]),u?d.call(s.fill,u):d.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,d=o.showLine,f=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=e[0],b=v.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}}),d||f){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(v,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(d||f?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(f?"l"+x+",0.0001":"h"+x)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,d=o.showLine,f=o.showMarker,p=e[0],h=p.trace,y=!f&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||y||d){var b={},w={};if(f){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}d&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),f&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":242,"../../registry":326,"../../traces/pie/helpers":419,"../../traces/pie/style_one":425,"../../traces/scatter/subtypes":452,"../color":111,"../colorscale/helpers":122,"../drawing":133,"./constants":162,"@plotly/d3":18}],170:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":172}],171:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function d(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},d=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(C=["toggleHover"],P=["resetViews"]):g?(O=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],P=["resetGeo"]):y?(C=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],P=["resetViewMapbox"]):b?C=["hoverClosestGl2d"]:v?C=["hoverClosestPie"]:M?(C=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):C=["toggleHover"];m&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e0?f+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,d,f=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=d)));return p>=f?[f,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;ov?(M=d,S="y0",k=v,D="y1"):(M=v,S="y1",k=d,D="y0");W(n),K(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),X.moveFn="move"===I?J:Q,X.altKey=n.altKey},doneFn:function(){if(g(e))return;p(t),$(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(g(e))return;$(l)}};function W(r){if(g(e))I=null;else if(R)I="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else N?E("xanchor",r.xanchor=q(x+n)):(E("x0",r.x0=q(c+n)),E("x1",r.x1=q(y+n))),z?E("yanchor",r.yanchor=G(T+a)):(E("y0",r.y0=G(d+a)),E("y1",r.y1=G(v+a)));t.attr("d",_(e,r)),K(l,r)}function Q(n,a){if(F){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(R){if("resize-over-start-point"===I){var u=c+n,f=z?d-a:d+a;E("x0",r.x0=N?u:q(u)),E("y0",r.y0=z?f:G(f))}else if("resize-over-end-point"===I){var p=y+n,h=z?v-a:v+a;E("x1",r.x1=N?p:q(p)),E("y1",r.y1=z?h:G(h))}}else{var g=function(e){return-1!==I.indexOf(e)},b=g("n"),H=g("s"),Y=g("w"),Z=g("e"),X=b?M+a:M,W=H?k+a:k,J=Y?A+n:A,Q=Z?L+n:L;z&&(b&&(X=M-a),H&&(W=k-a)),(!z&&W-X>10||z&&X-W>10)&&(E(S,r[S]=z?X:G(X)),E(D,r[D]=z?W:G(W))),Q-J>10&&(E(O,r[O]=N?J:q(J)),E(C,r[C]=N?Q:q(Q)))}t.attr("d",_(e,r)),K(l,r)}function K(e,t){(N||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(N?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),N&&z){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(N){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}f.init(X),Z.node().onmousemove=W}(e,N,s,t,r,I):!0===s.editable&&N.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");N.node().addEventListener("click",(function(){return function(e,t){if(!v(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,y(e)}}(e,N)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,d,f=t.type,p=i.getRefType(t.xref),y=i.getRefType(t.yref),g=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),x=e._fullLayout._size;if(g?"domain"===p?n=function(e){return g._offset+g._length*e}:(r=m.shapePositionToRange(g),n=function(e){return g._offset+g.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},v?"domain"===y?l=function(e){return v._offset+v._length*(1-e)}:(o=m.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===f)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(l=m.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],d=h.paramIsY[c],f=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):d[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>f&&(e="X"),e}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,d=_-t.y1}else u=l(t.y0),d=l(t.y1);if("line"===f)return"M"+s+","+u+"L"+c+","+d;if("rect"===f)return"M"+s+","+u+"H"+c+"V"+d+"H"+s+"Z";var w=(s+c)/2,T=(u+d)/2,M=Math.abs(w-s),k=Math.abs(T-u),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){v(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,y(e)))}t.exports={draw:y,drawOne:x,eraseActiveShape:function(e){if(!v(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&d(g),r.attr("d",m(t)),k&&!f)&&(M=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,v(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*d.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+d.stepInset+(r.inputAreaLength-2*d.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-d.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*d.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",d.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,d.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(e,t){var r=t._dims,n=r.inputAreaLength-2*d.railInset,a=l.ensureSingle(e,"rect",d.railRectClass);a.attr({width:n,height:d.railWidth,rx:d.railRadius,ry:d.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,d.railInset,.5*(r.inputAreaWidth-d.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[d.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}if(i.enter().append("g").classed(d.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+d.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+d.groupClassName).data(r,g);s.enter().append("g").classed(d.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return z.call(R),I&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(d.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(e){this.text(e||" ").call(d.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":216,"../../constants/interactions":221,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/plots":324,"../../registry":326,"../color":111,"../drawing":133,"@plotly/d3":18,"fast-isnumeric":26}],210:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":236,"../../plot_api/edit_types":271,"../../plot_api/plot_template":278,"../../plots/font_attributes":318,"../../plots/pad_attributes":323,"../color/attributes":110}],211:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],212:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":242,"../../plots/array_container_defaults":284,"./attributes":210,"./constants":211}],213:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,d=e("./constants"),f=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(d.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,d.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(d.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||g(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",d.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||d.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(v,a,u,e).call(A,a,f,p),l.ensureSingle(t,"text",d.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(d.arrowSymbol[a.direction])})).attr({x:s.headerWidth-d.arrowOffsetX+a.pad.l,y:s.headerHeight/2+d.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(d.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?d.dropdownButtonClassName:d.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+d.gapButtonHeader:h=g.headerWidth+d.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-d.gapButtonHeader+d.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-d.gapButtonHeader+d.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+y+o.pad.t,yPad:d.gapButton,xPad:d.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(v,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(d.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+d.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+d.headerGroupClassName).data(r,p);s.enter().append("g").classed(d.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",d.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+g;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=g>T,C=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+m,N=y;I+C>s&&(I=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:N,width:C,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,E=O?d+C+.5:d+.5,j=f-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+R).data(M||O?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",R).append("rect"),M||O?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":242,"../color":111,"../drawing":133,"@plotly/d3":18}],216:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],217:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],218:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],219:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],220:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],221:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],222:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],223:[function(e,t,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}},{}],224:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],226:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],227:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function d(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,d,f,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,d=o,f=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return d(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return d(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return d(e,t,r,n,a,i,1)}}},{"./mod":249}],228:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(d(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:v);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),O=C.newDate(M,C.toMonthIndex(M,k,P),A)}else O=C.newDate(M,Number(k),A)}catch(e){return u}return O?(O.toJD()-m)*d+L*f+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*d,M=3*f,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,v,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/d)+m,S=Math.floor(s(e,d));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+d&&e<=a-d))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function O(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,d),n=w(Math.floor(r/f),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+O(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return O(t,e,n,a)};var P=3*d;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,d);if(e=Math.round(e-n),r)try{var a=Math.round(e/d)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*d+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+d*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,d=n-t,f=o-a,p=c-i,h=u*u+d*d,m=f*f+p*p,y=Math.min(s(u,d,h,a-e,i-t),s(u,d,h,o-e,c-t),s(f,p,m,e-a,t-i),s(f,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),d=e.getPointAtLength(o(r,t)),f={x:(4*d.x+s.x+c.x)/6,y:(4*d.y+s.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),d=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,d=r.ys?r.y-s:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+r)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+r))return;p=f(d)}return{min:c,max:d,len:d-c,total:u,isClosed:0===c&&d===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++}return i}},{"./mod":249}],240:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],241:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],242:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,d=t.exports={};d.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var f={};d.warnBadFormat=function(e){var t=String(e);f[t]||(f[t]=1,d.warn('encountered bad format: "'+t+'"'))},d.noFormat=function(e){return String(e)},d.numberFormat=function(e){var t;try{t=i(d.adjustFormat(e))}catch(t){return d.warnBadFormat(e),d.noFormat}return t},d.nestedProperty=e("./nested_property"),d.keyedContainer=e("./keyed_container"),d.relativeAttr=e("./relative_attr"),d.isPlainObject=e("./is_plain_object"),d.toLogRange=e("./to_log_range"),d.relinkPrivateKeys=e("./relink_private");var p=e("./array");d.isTypedArray=p.isTypedArray,d.isArrayOrTypedArray=p.isArrayOrTypedArray,d.isArray1D=p.isArray1D,d.ensureArray=p.ensureArray,d.concat=p.concat,d.maxRowLength=p.maxRowLength,d.minRowLength=p.minRowLength;var h=e("./mod");d.mod=h.mod,d.modHalf=h.modHalf;var m=e("./coerce");d.valObjectMeta=m.valObjectMeta,d.coerce=m.coerce,d.coerce2=m.coerce2,d.coerceFont=m.coerceFont,d.coercePattern=m.coercePattern,d.coerceHoverinfo=m.coerceHoverinfo,d.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,d.validate=m.validate;var y=e("./dates");d.dateTime2ms=y.dateTime2ms,d.isDateTime=y.isDateTime,d.ms2DateTime=y.ms2DateTime,d.ms2DateTimeLocal=y.ms2DateTimeLocal,d.cleanDate=y.cleanDate,d.isJSDate=y.isJSDate,d.formatDate=y.formatDate,d.incrementMonth=y.incrementMonth,d.dateTick0=y.dateTick0,d.dfltRange=y.dfltRange,d.findExactDates=y.findExactDates,d.MIN_MS=y.MIN_MS,d.MAX_MS=y.MAX_MS;var g=e("./search");d.findBin=g.findBin,d.sorterAsc=g.sorterAsc,d.sorterDes=g.sorterDes,d.distinctVals=g.distinctVals,d.roundUp=g.roundUp,d.sort=g.sort,d.findIndexOfMin=g.findIndexOfMin,d.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");d.aggNums=v.aggNums,d.len=v.len,d.mean=v.mean,d.median=v.median,d.midRange=v.midRange,d.variance=v.variance,d.stdev=v.stdev,d.interp=v.interp;var x=e("./matrix");d.init2dArray=x.init2dArray,d.transposeRagged=x.transposeRagged,d.dot=x.dot,d.translationMatrix=x.translationMatrix,d.rotationMatrix=x.rotationMatrix,d.rotationXYMatrix=x.rotationXYMatrix,d.apply3DTransform=x.apply3DTransform,d.apply2DTransform=x.apply2DTransform,d.apply2DTransform2=x.apply2DTransform2,d.convertCssMatrix=x.convertCssMatrix,d.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");d.deg2rad=b.deg2rad,d.rad2deg=b.rad2deg,d.angleDelta=b.angleDelta,d.angleDist=b.angleDist,d.isFullCircle=b.isFullCircle,d.isAngleInsideSector=b.isAngleInsideSector,d.isPtInsideSector=b.isPtInsideSector,d.pathArc=b.pathArc,d.pathSector=b.pathSector,d.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");d.isLeftAnchor=_.isLeftAnchor,d.isCenterAnchor=_.isCenterAnchor,d.isRightAnchor=_.isRightAnchor,d.isTopAnchor=_.isTopAnchor,d.isMiddleAnchor=_.isMiddleAnchor,d.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");d.segmentsIntersect=w.segmentsIntersect,d.segmentDistance=w.segmentDistance,d.getTextLocation=w.getTextLocation,d.clearLocationCache=w.clearLocationCache,d.getVisibleSegment=w.getVisibleSegment,d.findPointOnPath=w.findPointOnPath;var T=e("./extend");d.extendFlat=T.extendFlat,d.extendDeep=T.extendDeep,d.extendDeepAll=T.extendDeepAll,d.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");d.log=M.log,d.warn=M.warn,d.error=M.error;var k=e("./regex");d.counterRegex=k.counter;var A=e("./throttle");d.throttle=A.throttle,d.throttleDone=A.done,d.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},d.noop=e("./noop"),d.identity=e("./identity"),d.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},d.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},d.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(d.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},d.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},d.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},d.syncOrAsync=function(e,t,r){var n;function a(){return d.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},d.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},d.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},d.fillArray=function(e,t,r,n){if(n=n||d.identity,d.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},d.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var N=/^\w*$/;d.templateString=function(e,t){var r={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,n){var a;return N.test(n)?a=t[n]:(r[n]=r[n]||d.nestedProperty(t,n).get,a=r[n]()),d.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};d.hovertemplateString=function(){return E.apply(z,arguments)};var R={max:10,count:0,name:"texttemplate"};d.texttemplateString=function(){return E.apply(R,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,f,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,g=l;if((p||h)&&(g=g.substring(1)),(m||h)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=t[g]))return""}else for(f=3;f=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;d.seedPseudoRandom=function(){j=2e9},d.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?d.pseudoRandom():j/4294967296},d.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=d.extractOption(e,t,"htx","hovertext");if(d.isValidTextValue(a))return n(a);var i=d.extractOption(e,t,"tx","text");return d.isValidTextValue(i)?n(i):void 0},d.isValidTextValue=function(e){return e||0===e},d.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,d.strTranslate(a-c*(r+o),i-c*(n+l))+d.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},d.ensureUniformFontSize=function(e,t){var r=d.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},d.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},d.bigFont=function(e){return Math.round(1.2*e)};var H=d.getFirefoxVersion(),B=null!==H&&H<86;d.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":222,"./anchor_utils":226,"./angles":227,"./array":228,"./clean_number":229,"./clear_responsive":231,"./coerce":232,"./dates":233,"./dom":234,"./extend":236,"./filter_unique":237,"./filter_visible":238,"./geometry2d":239,"./identity":240,"./increment":241,"./is_plain_object":243,"./keyed_container":244,"./localize":245,"./loggers":246,"./make_trace_groups":247,"./matrix":248,"./mod":249,"./nested_property":250,"./noop":251,"./notifier":252,"./preserve_drawing_buffer":255,"./push_unique":256,"./regex":258,"./relative_attr":259,"./relink_private":260,"./search":261,"./sort_object_keys":263,"./stats":264,"./throttle":266,"./to_log_range":267,"@plotly/d3":18,"d3-format":21,"d3-time-format":23,"fast-isnumeric":26}],243:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],244:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],f.set(e,null);if(d){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":276,"./notifier":252}],247:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":18}],248:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],250:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,d,f,p,h,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(d,y)||c>Math.max(f,g)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":222,"./matrix":248}],255:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":26,"is-mobile":60}],256:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,d=0,f=t.length,p=0,h=f>1?(t[f-1]-t[0])/(f-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);d90&&a.log("Long binary search..."),d-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],d=u-a;void 0===a?(s.push(u),a=u):d>l&&(i=Math.min(i,d),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":228,"fast-isnumeric":26}],265:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),O=n.select(e.node().parentNode);if(!O.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(d,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var c=O.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:C,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",d=l.select("g");d.attr({fill:u,stroke:u});var f=s(d,"width"),p=s(d,"height"),h=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],y=-(r||s(e,"height"))/4;"y"===C[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-f/2,y-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===C[0]?l.attr({x:e.attr("x"),y:y-p/2}):"a"===C[0]&&0!==C.indexOf("atitle")?l.attr({x:0,y:y}):l.attr({x:h,y:+e.attr("y")+y-p/2}),m&&m.call(e,c),t(c)}))}))):P(),e}function P(){O.empty()||(C=e.attr("class")+"-math",O.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function O(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],267:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":26}],268:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],269:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],270:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,d=(l.subplotsRegistry.ternary||{}).attrRegex,f=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",d);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",d,v),!0;t.set(v)}return!m&&(f(y,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],O=u(g,d).get(),C=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",d,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,_),c(M)?C.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",d,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(C[x],1),O&&O.splice(C[x],1);if(D.length?S||t.set(D):t.set(null),m)return!1;if(f(y,g),h!==a){var N;if(-1===P)N=L;else{for(I=Math.max(D.length,I),N=[],x=0;x=P);x++)N.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,d,f=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=O(r,e.data.length-1),t)for(var m=0;m-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[f.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||f.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(f.rehover,f.redrag),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,f=F(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),g={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),Z=I.get();if(void 0!==N){A[P]=N,L[P]="reverse"===E?N:R(Z);var W=d.getLayoutValObject(s,I.parts);if(W&&W.impliedEdits&&null!==N)for(var J in W.impliedEdits)S(o.relativeAttr(P,J),W.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(N){S("autosize",null);var Q="height"===P?"width":"height";S(Q,s[Q])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",N?null:s.width),S("height",N?null:s.height);else if(j.match(U))C(j),l(s,B+"._inputRange").set(null);else if(j.match(q)){C(j),l(s,B+"._inputRange").set(null);var K=l(s,B).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else j.match(G)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===N,ee="log"===V.type&&"linear"===N;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,N,S),u.getComponentMethod("images","convertCoords")(e,V,N,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(N||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=W||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(N)?L[P]=null:b.isRemoveVal(N)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=N,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===N||"select"===N)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:W?T.update(k,W):k.calc=!0,I.set(N))}}for(r in g){b.applyContainerArrayChanges(e,f(i,r),g[r],k,f)||(k.plot=!0)}for(var ce in O){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var de in k.calc=!0,ue)O[de]||(p.getFromId(e,de)._constraintShrinkable=!0)}return(X(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:L,redoit:A,eventData:y}}function X(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&f.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function W(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),d=u.flags;(s.calc||d.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];d.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),Y(e,d,u)||f.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||d.colorbars)&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.axrange&&V(p,u.rangesAltered),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag),c.add(e,W,[e,l.undoit,u.undoit,l.traces],W,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function d(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,f.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&d()};t()}var h,m,y=0;function g(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var v=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))v.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);v=k}}v.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,g=t[n].name,v=u[y]||h[y];y&&g&&"number"==typeof g&&v&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[m]={name:m},p.push({frame:f.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=f.modifyFrames,u=f.modifyFrames,d=[e,l],p=[e,i];return c&&c.add(e,s,d,u,p),f.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,d=e,f=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in d(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var d=u.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:d,applyUpdate:function(t,r){t&&u(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":242,"../plots/attributes":285}],279:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),d=e("../components/modebar"),f=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,g=y._size,x=g.p,_=f.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),d.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,O=l.yaxis.domain,C=l.plotgroup;if(v(D,O,L)){var P=C.node(),I=l.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([D,O]),S||(k.push(a),A.push(a))}var N,z,R,F,E,j,H,B,Y,V,U,q,G,Z=y._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:f},""),u.length)return u.map(g)}},{"../lib":242,"../plots/attributes":285,"../plots/plots":324,"./plot_config":276,"./plot_schema":277,"./plot_template":278}],281:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,d={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,f,p,h;function m(e){return!(e in t)||o.validate(t[e],d[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],f=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),f=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(d.format.values,", "," or ")+".");var y={};function g(e,r){return o.coerce(t,y,d,e,r)}var v=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},f);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,v,_),n=M._fullLayout.width,d=M._fullLayout.height;function f(){a.purge(M),document.body.removeChild(M)}if("full-json"===v){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),e(T?p:l.encodeJSON(p))}if(f(),"svg"===v)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:v,width:n,height:d,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":242,"../plots/plots":324,"../snapshot/helpers":330,"../snapshot/svgtoimg":332,"../snapshot/tosvg":334,"../version":472,"./plot_api":275,"fast-isnumeric":26}],282:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var d=Object.keys(e),f=0;fx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,D,O=x.length,C=Array.isArray(M);if(C&&(O=Math.min(O,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(C?Math.min(P,M[A].length):P);k++)L=C?M[A][k]:M,S=v[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,D)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),v[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(d)===d))return{vals:a};c=d}for(var f=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,f)||0,g=[],v=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);T=o(M,-c,f)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,v[_]=T,x[_]=M}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":222,"../../lib":242,"fast-isnumeric":26}],287:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],288:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,d=c.isLinked;function f(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,d=c.max;if(0===u.length||0===d.length)return i.simpleMap(t.range,t.r2l);var f=u[0].val,y=d[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>O&&(_=x,w=b,O=M/T):M/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=M/S));if(f===y){var C=f-1,P=f+1;if(A)if(0===f)a=[0,1];else{var I=(f>0?d:u).reduce((function(e,t){return Math.max(e,s(t))}),0),N=f/(1-Math.min(.5,I/S));a=f>0?[0,N]:[N,0]}else a=L?[Math.max(0,C),Math.max(1,P)]:[C,P]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-O*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-O*l(_),w.val+O*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=i),i>p&&i-o&&(f=i),i>p&&i=P;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],d=[];function f(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":133,"../../constants/numerical":222,"../../lib":242,"../../registry":326,"./axis_ids":293,"@plotly/d3":18,"fast-isnumeric":26}],289:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),d=e("../../components/color"),f=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,D=m.ONEMIN,O=m.ONESEC,C=m.MINUS_SIGN,P=m.BADNUM,I={K:"zeroline"},N={K:"gridline",L:"path"},z={K:"tick",L:"path"},R={K:"tick",L:"text"},F=e("../../constants/alignment"),E=F.MID_SHIFT,j=F.CAP_SHIFT,H=F.LINE_SPACING,B=F.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=e("./set_convert");var V=e("./axis_autotype"),U=e("./axis_ids"),q=U.idSort,G=U.isLinked;Y.id2name=U.id2name,Y.name2id=U.name2id,Y.cleanId=U.cleanId,Y.list=U.list,Y.listIds=U.listIds,Y.getFromId=U.getFromId,Y.getFromTrace=U.getFromTrace;var Z=e("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}Y.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},Y.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},Y.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==Y.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=Y.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},Y.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:Y.getFromId(t,r).cleanPos)(e)},Y.redrawComponents=function(e,t){t=t||Y.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=Y.tickIncrement(e,r);if(s<=n)return s}return e}(v,e,g,c,i)),y=v,0;y<=u;)y=Y.tickIncrement(y,g,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(y,0,i),size:g,_dataSpan:u-c}},Y.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=Y.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dticki&&d=o:p<=o;p=Y.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(D.length>m||p===O)break;O=p;var C=!1;d&&p!==(0|p)&&(C=!0),D.push({minor:C,value:p})}if(f&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),d=r||u,f=0;d>=v?f=u>=v&&u<=y?u:g:r===b&&d>=_?f=u>=_&&u<=x?u:b:d>=M?f=u>=M&&u<=w?u:T:r===k&&d>=k?f=k:d>=A?f=A:r===L&&d>=L?f=L:r===S&&d>=S&&(f=S),f>=u&&(f=u,l=!0);var p=a+f;if(t.rangebreaks&&f>0){for(var h=0,m=0;m<84;m++){var D=(m+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(f*=h/84)||(e[n].drop=!0),l&&u>k&&(f=u)}(f>0||0===n)&&(e[n].periodX=a+f/2)}}(D,e,e._definedDelta),e.rangebreaks){var I="y"===e._id.charAt(0),N=1;"auto"===e.tickmode&&(N=e.tickfont?e.tickfont.size:12);var z=NaN;for(h=D.length-1;h>-1;h--)if(D[h].drop)D.splice(h,1);else{D[h].value=Ae(D[h].value,e);var R=e.c2p(D[h].value);(I?z>R-N:zu||Eu&&(F.periodX=u),E10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!de(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}Y.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>g)t/=g,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>T)t/=T,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=Y.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=oe(t,S,ee):i>D?e.dtick=oe(t,D,te):i>O?e.dtick=oe(t,O,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},Y.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,d=e+.01*o,f=l.roundUp(l.mod(d,1),u,r);return Math.floor(d)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=fe(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),p=e.exponentformat;"power"===p||ue(p)&&de(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":C)+f+"",t.fontSize*=1.25):("e"===p||"E"===p)&&f>2?t.text="1"+p+(d>0?"+":C)+f:(t.text=fe(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=fe(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=fe(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=fe(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},Y.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return Y.hoverLabelText(e,n,r)+" - "+Y.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=Y.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function de(e){return e>14||e<-15}function fe(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=Y.getTickFormat(t),d=t.separatethousands;if(n){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?C+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-d:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?d-r.top:0,f),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?d-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-d:0,f),p.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ye(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=f),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Q&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,xe(t),n),i.autoMargin(e,be(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||Q&&"bottom"===t.side||W.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ye(t);else{var l=Le(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,d,p,h,m=Y.getPxPosition(e,t);"x"===i?(d=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,d="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var g=f.getTranslate(y.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:d,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(W)}}function K(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ve(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},Y.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=f*j,d+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,d+=3);l&&"top"===c&&(d-=f*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(d=-d);return[s?u:0,l?d:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},Y.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,d=i("inside"),f="inside"===n&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=f?e.ticklen:0;if(d?m*=-1:u&&(m=0),f&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(f||e.showline)&&(p+=.2*e.tickfont.size);var g,v,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(d?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===M||d&&"top"===M)?1:-1,d&&(b*=-1),g=h*b,v=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(d?x+=E:x=-90===A&&"bottom"===M?j:90===A&&"top"===M?E:.5,T=E/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==d?-n:0};else if("y"===k){if(b=(_=!d&&"left"===M||d&&"right"===M)?1:-1,d&&(b*=-1),g=p,v=h*b,x=0,d||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?j:.5),d){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*j*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*E},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Y.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],me);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(d.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Se(t,[z]),i.attr("transform",r.transFn)},Y.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&Y.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,y+1?y:m);var b=null;t._selections&&(t._selections[d]=g);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(g,y)}))):_.push((function(){if(x(g,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ve(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",d=function(e){return-1!==c.indexOf(e)},h=d("top"),y=d("left"),v=d("right"),_=d("bottom")||y||h||v?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=d(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=v(o[s])){u=h;break}var d=a("pattern",u);if(d===h)for(s=0;s<2;s++)(c=v(o[s]))&&(t.bounds[s]=o[s]=c-1);if(d)for(s=0;s<2;s++)switch(c=o[s],d){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":326,"./constants":296}],294:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FC&&(C=F);f/=(C-O)/(2*P),O=s.l2r(O),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,d={},f={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ge||Ue(),ye)o.indexOf("select")>-1&&L(r,a,J,Q,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=m?I:P,c="s"===m||"w"===g?0:1,d=l._name+".range["+c+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Ne(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",q(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",q(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":242,"fast-isnumeric":26}],308:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":216}],309:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,d=c.rectMode,f=c.drawMode,p=c.openMode,h=c.selectMode,m=e("../../components/shapes/draw_newshape/display_outlines"),y=e("../../components/shapes/draw_newshape/helpers").handleEllipse,g=e("../../components/shapes/draw_newshape/newshapes"),v=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,M=e("./constants"),k=M.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,D=e("./helpers"),O=D.p2r,C=D.axValue,P=D.getTransform;function I(e,t,r,n,a,i,o){var l,s,c,u,d,f,h,y,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){F(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(f=H(_))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),f(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function B(e,t,r){var n,i,o,l;for(n=0;n=0)D._fullLayout._deactivateShape(D);else if(!_){var r=N.clickmode;b.done(me).then((function(){if(b.clear(me),2===e){for(de.remove(),$=0;$-1&&I(t,D,a.xaxes,a.yaxes,a.subplot,a,de),"event"===r&&D.emit("plotly_selected",void 0);l.click(D,t)})).catch(v.error)}},a.doneFn=function(){he.remove(),b.done(me).then((function(){b.clear(me),a.gd.emit("plotly_selected",te),K&&a.selectionDefs&&(K.subtract=ue,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(ye)})).catch(v.error),_&&E(a)}},clearSelect:S,clearSelectionsCache:E,selectOnClick:I}},{"../../components/color":111,"../../components/dragelement/helpers":129,"../../components/drawing":133,"../../components/fx":151,"../../components/fx/helpers":147,"../../components/shapes/draw_newshape/display_outlines":199,"../../components/shapes/draw_newshape/helpers":200,"../../components/shapes/draw_newshape/newshapes":201,"../../lib":242,"../../lib/clear_gl_canvases":230,"../../lib/polygon":254,"../../lib/throttle":266,"../../plot_api/subroutines":279,"../../registry":326,"./axis_ids":293,"./constants":296,"./handle_outline":300,"./helpers":301,polybooljs:66}],310:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,g=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function O(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function N(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function R(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?R(t,e._m,e._b):m},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return R(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?R(t,e._m2,d):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:d,e.l2c="log"===e.type?A:d,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return O(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=d,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var d=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===p;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(f=!f),f&&e._rangebreaks.reverse();var h=f?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],g=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var v=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=d?c/p[2]:1,T=f?u/p[3]:1,M=d?p[0]:0,k=f?p[1]:0,A=d?p[0]/p[2]*c:0,L=f?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":133,"../../lib":242,"../../registry":326,"./axes":289,"@plotly/d3":18}],315:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",d=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&N.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&N.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(f,s,d,n),b.cleanPlot(f,s,d,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),a=Math.round(d*a)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(d),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;f[t]={l:{val:g,size:r.l+h},r:{val:v,size:r.r+h},b:{val:_,size:r.b+h},t:{val:x,size:r.t+h}},p[t]=1}else delete f[t],delete p[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,d=i.r,f=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:h}},m){var x=m[v].l||{},_=m[v].b||{},w=x.val,T=x.size,M=_.val,k=_.size;for(var A in m){if(o(T)&&m[A].r){var L=m[A].r.val,S=m[A].r.size;if(L>w){var D=(T*L+(S-r)*w)/(L-w),C=(S*(1-w)+(T-r)*(1-L))/(L-w);D+C>c+d&&(c=D,d=C)}}if(o(k)&&m[A].t){var P=m[A].t.val,I=m[A].t.size;if(P>M){var N=(k*P+(I-n)*M)/(P-M),z=(I*(1-M)+(k-n)*(1-P))/(P-M);N+z>h+f&&(h=N,f=z)}}}}}var R=u.constrain(r-i.l-i.r,2,64),F=u.constrain(n-i.t-i.b,2,64),E=Math.max(0,r-R),j=Math.max(0,n-F);if(E){var H=(c+d)/E;H>1&&(c/=H,d/=H)}if(j){var B=(h+f)/j;B>1&&(h/=B,f/=B)}if(a.l=Math.round(c),a.r=Math.round(d),a.t=Math.round(f),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var d={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(d.layout=c(l),a)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return s&&(d.frames=c(s)),i&&(d.config=c(e._context,!0)),"object"===n?d:JSON.stringify(d)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(N(o,c,d),a=0;a0){for(var n=[],a=0;a-1&&(d[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":111,"../components/drawing":133,"../constants/xmlns_namespaces":223,"../lib":242,"@plotly/d3":18}],335:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rd+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function N(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[d+"a"],R=e[f+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,F,e),!1!==e.index&&y[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-v.bargroupwidth/2)},O=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var E=y[e.index],j=g.base?E.b+E.s:E.s;e[f+"0"]=e[f+"1"]=R.c2p(E[f],!0),e[f+"LabelVal"]=j;var H=v.extents[v.extents.round(E.p)];e[d+"0"]=z.c2p(x?D(E):H[0],!0),e[d+"1"]=z.c2p(x?O(E):H[1],!0);var B=void 0!==E.orig_p;return e[d+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[d+"LabelVal"],g[d+"hoverformat"]),e.valueLabel=s(R,e[f+"LabelVal"],g[f+"hoverformat"]),e.baseLabel=s(R,E.b,g[f+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return C(k(e),A(e),w)}(E))/2,e[d+"Spike"]=z.c2p(E.p,!0),o(E,g,e),e.hovertemplate=g.hovertemplate,e}}function d(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=d(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:d}},{"../../components/color":111,"../../components/fx":151,"../../constants/numerical":222,"../../lib":242,"../../plots/cartesian/axes":289,"../../registry":326,"./helpers":342}],344:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":303,"../scatter/marker_colorbar":445,"./arrays_to_calcdata":335,"./attributes":336,"./calc":337,"./cross_trace_calc":339,"./defaults":340,"./event_data":341,"./hover":343,"./layout_attributes":345,"./layout_defaults":346,"./plot":347,"./select":348,"./style":350}],345:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],346:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,d={},f=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,d="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,h=a.width,m=a.height,y=Math.abs(t-e),g=Math.abs(n-r),v=y>2*_&&g>2*_?_:0;y-=2*v,g-=2*v;var x=L(s);"auto"!==s||h<=y&&m<=g||!(h>y||m>g)||(h>g||m>y)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=q(E,j,z),j=q(j,E,z),H=q(H,B,!z),B=q(B,H,!z)}var G=k(i.ensureSingle(P,"path"),C,y,g);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&R){var Z=s.makePointStyleFns(d);s.singlePointStyle(c,G,d,Z,e)}!function(e,t,r,n,a,l,c,d,p,y,g){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,N=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,d,f,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,d="x",f=n):(s="x",c=n,d="y",f=a);function m(e){return u(f,f.c2l(e),!0).text}var y=t[r],g={};g.label=y.p,g.labelLabel=g[s+"Label"]=(v=y.p,u(c,c.c2l(v),!0).text);var v;var x=i.castOption(o,y.i,"text");(0===x||x)&&(g.text=x);g.value=y.s,g.valueLabel=g[d+"Label"]=m(y.s);var _={};b(_,o,y.i),p&&(g.delta=+y.rawS||y.s,g.deltaLabel=m(g.delta),g.final=y.v,g.finalLabel=m(g.final),g.initial=g.final-g.delta,g.initialLabel=m(g.initial));h&&(g.value=y.s,g.valueLabel=m(g.value),g.percentInitial=y.begR,g.percentInitialLabel=i.formatPercent(y.begR),g.percentPrevious=y.difR,g.percentPreviousLabel=i.formatPercent(y.difR),g.percentTotal=y.sumR,g.percenTotalLabel=i.formatPercent(y.sumR));var w=i.castOption(o,y.i,"customdata");w&&(g.customdata=w);return i.texttemplateString(l,g,e._d3locale,_,g,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var d,f=a.textinfo,p=e[t],h=f.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((g=e[t].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(d=i.castOption(a,p.i,"text"))||d)&&m.push(d);if(l){var v=+p.rawS||p.s,x=p.v,b=x-v;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(d=i.formatPercent(p.begR),w&&(d+=" of initial"),m.push(d)),y("percent previous")&&(d=i.formatPercent(p.difR),w&&(d+=" of previous"),m.push(d)),y("percent total")&&(d=i.formatPercent(p.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(v,o)}(O,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(P,a);var z="stack"===y.mode||"relative"===y.mode,R=n[a],F=!z||R._outmost;if(!N||"none"===w||(R.isBlank||l===c||d===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=O.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=q*(W/G):W>=G*(X/q);q>0&&G>0&&(J||Q||K)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Z=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=C(r,N,Z)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),q=U.width,G=U.height,V.attr("transform",$),q<=0||G<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,d=a.height,f=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:f>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/d):Math.min(1,f/u));var m=L(c),y=S(a,m),g=(l?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Z.size,f(P.type,ee,O),R.transform=ee,k(V,O,y,g).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,E,j,H,B,y,g),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,d.xcalendar,d.ycalendar)}));var H=!1===d.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,y)},toMoveInsideBar:D}},{"../../components/color":111,"../../components/drawing":133,"../../components/fx/helpers":147,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../registry":326,"./attributes":336,"./constants":338,"./helpers":342,"./style":350,"./uniform_text":352,"@plotly/d3":18,"fast-isnumeric":26}],348:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":111,"../../components/drawing":133,"../../lib":242,"../../registry":326,"./attributes":336,"./helpers":342,"./uniform_text":352,"@plotly/d3":18}],351:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":111,"../../components/colorscale/defaults":121,"../../components/colorscale/helpers":122,"../../lib":242}],352:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o1,b=1-d[e+"gap"],_=1-d[e+"groupgap"];for(l=0;l0){var U=S.pointpos,q=S.jitter,G=S.marker.size/2,Z=0;U+q>=0&&((Z=Y*(U+q))>A?(V=!0,H=G,E=Z):Z>R&&(H=G,E=A)),Z<=A&&(E=A);var X=0;U-q<=0&&((X=-Y*(U-q))>L?(V=!0,B=G,j=X):X>F&&(B=G,j=L)),X<=L&&(j=L)}else E=A,j=L;var W=new Array(c.length);for(s=0;se.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,d=i.bPos,f=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=c.c2l(e.pos+d,!0),a=c.l2p(t-o)+f,i=c.l2p(t+l)+f,h=u?(a+i)/2:c.l2p(t)+f,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),g=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+g+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],d=i.t,f=i.trace;(d.wdPos=d.bdPos*f.whiskerwidth,!0!==f.visible||d.empty)?a.remove():("h"===f.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},f,d),l(a,{x:c,y:u},f,d),s(a,{pos:t,val:r},f,d))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":133,"../../lib":242,"@plotly/d3":18}],358:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":111,"../../components/drawing":133,"@plotly/d3":18}],359:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../ohlc/attributes"),o=e("../box/attributes");function l(e){return{line:{color:n({},o.line.color,{dflt:e}),width:o.line.width,editType:"style"},fillcolor:o.fillcolor,editType:"style"}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},o.line.width,{}),editType:"style"},increasing:l(i.increasing.line.color.dflt),decreasing:l(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:n({},o.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel}},{"../../lib":242,"../../plots/cartesian/axis_format_attributes":292,"../box/attributes":353,"../ohlc/attributes":405}],360:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../ohlc/calc").calcCommon;function l(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,s=a.getFromId(e,t.xaxis),c=a.getFromId(e,t.yaxis),u=s.makeCalcdata(t,"x"),d=i(t,s,"x",u).vals,f=o(e,t,u,d,c,l);return f.length?(n.extendFlat(f[0].t,{num:r._numBoxes,dPos:n.distinctVals(d).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,f):[{t:{empty:!0}}]}},{"../../lib":242,"../../plots/cartesian/align_period":286,"../../plots/cartesian/axes":289,"../ohlc/calc":406}],361:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("../scatter/period_defaults"),l=e("./attributes");function s(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function c(r,a){return n.coerce(e,t,l,r,a)}i(e,t,c,a)?(o(e,t,a,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(e,t,c,"increasing"),s(e,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":111,"../../lib":242,"../ohlc/ohlc_defaults":410,"../scatter/period_defaults":447,"./attributes":359}],362:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":303,"../box/cross_trace_calc":354,"../box/layout_attributes":355,"../box/layout_defaults":356,"../box/plot":357,"../box/style":358,"../ohlc/hover":408,"../ohlc/select":412,"./attributes":359,"./calc":360,"./defaults":361}],363:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r"),s.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(u,f),[s]}}},{"../../components/color":111,"../../lib":242,"../bar/hover":343}],371:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"../bar/select":348,"./attributes":364,"./calc":365,"./cross_trace_calc":367,"./defaults":368,"./event_data":369,"./hover":370,"./layout_attributes":372,"./layout_defaults":373,"./plot":374,"./style":375}],372:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],373:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":111,"../../components/drawing":133,"../../constants/interactions":221,"../bar/style":350,"../bar/uniform_text":352,"@plotly/d3":18}],376:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":236,"../../plots/attributes":285,"../../plots/domain":317,"../../plots/template_attributes":325,"../pie/attributes":414}],377:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":324}],378:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":416}],379:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),d=c("values"),f=l(u,d),p=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,m=c("text"),y=c("texttemplate");if(y||(h=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||h&&"none"!==h){var g=c("textposition");o(e,t,s,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":242,"../../plots/domain":317,"../bar/defaults":340,"../pie/defaults":417,"./attributes":376}],380:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":425,"./attributes":376,"./base_plot":377,"./calc":378,"./defaults":379,"./layout_attributes":381,"./layout_defaults":382,"./plot":383,"./style":384}],381:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":421}],382:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":242,"./layout_attributes":381}],383:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../lib"),o=i.strScale,l=i.strTranslate,s=e("../../lib/svg_text_utils"),c=e("../bar/plot").toMoveInsideBar,u=e("../bar/uniform_text"),d=u.recordMinTextSize,f=u.clearMinTextSize,p=e("../pie/helpers"),h=e("../pie/plot"),m=h.attachFxHandlers,y=h.determineInsideTextFont,g=h.layoutAreas,v=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._fullLayout;f("funnelarea",r),v(t,e),g(t,r._size),i.makeTraceGroups(r._funnelarealayer,t,"trace").each((function(t){var u=n.select(this),f=t[0],h=f.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var d,f,p=[];for(p.push(u()),d=e.length-1;d>-1;d--)if(!(f=e[d]).hidden){var h=f.v/s;c+=h,p.push(u())}var m=1/0,y=-1/0;for(d=0;d-1;d--)if(!(f=e[d]).hidden){var k=p[M+=1][0],A=p[M][1];f.TL=[-k,A],f.TR=[k,A],f.BL=w,f.BR=T,f.pxmid=(L=f.TR,S=f.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=f.TL,T=f.TR}var L,S}(t),u.each((function(){var u=n.select(this).selectAll("g.slice").data(t);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,l){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=h.index;var u=f.cx,g=f.cy,v=n.select(this),x=v.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),v.call(m,e,t);var w="M"+(u+o.TR[0])+","+(g+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";x.attr("d",w),b(e,o,f);var T=p.castOption(h.textposition,o.pts),M=v.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each((function(){var f=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,y(h,o,r.font));f.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,p).call(s.convertToTspans,e);var m,v,x,b=a.bBox(f.node()),_=Math.min(o.BL[1],o.BR[1])+g,w=Math.max(o.TL[1],o.TR[1])+g;v=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(m=c(v,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,d(h.type,m,r),t[l].transform=m,f.attr("transform",i.getTextTransform(m))}))}}));var g=n.select(this).selectAll("g.titletext").data(h.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),c=h.title.text;h._meta&&(c=i.templateString(c,h._meta)),t.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,h.title.font).call(s.convertToTspans,e);var u=x(f,r._size);t.attr("transform",l(u.x,u.y)+o(Math.min(1,u.scale))+l(u.tx,u.ty))}))}))}))}},{"../../components/drawing":133,"../../lib":242,"../../lib/svg_text_utils":265,"../bar/plot":347,"../bar/uniform_text":352,"../pie/helpers":419,"../pie/plot":423,"@plotly/d3":18}],384:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":352,"../pie/style_one":425,"@plotly/d3":18}],385:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("./bin_attributes"),l=e("./constants"),s=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:a("x"),yhoverformat:a("y"),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:o("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:o("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:l.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":236,"../../plots/cartesian/axis_format_attributes":292,"../../plots/template_attributes":325,"../bar/attributes":336,"./bin_attributes":387,"./constants":391}],386:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;ai){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,f=-.1*t,p=e-f,h=r[0],m=r[1],y=Math.min(d(h+f,h+p,n,i),d(m+f,m+p,n,i)),g=Math.min(d(h+c,h+f,n,i),d(m+c,m+f,n,i));if(y>g&&go){var v=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",v);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(E)&&(H=o.tickIncrement(H,b.size,!0,p)),N.start=r.l2r(H),F||a.nestedProperty(t,g+".start").set(N.start)}var B=b.end,Y=r.r2l(I.end),V=void 0!==Y;if((b.endFound||V)&&Y!==r.r2l(B)){var U=V?Y:a.aggNums(Math.max,null,h);N.end=r.l2r(U),V||a.nestedProperty(t,g+".start").set(N.end)}var q="autobin"+l;return!1===t._input[q]&&(t._input[g]=a.extendFlat({},t[g]||{}),delete t._input[q],delete t[q]),[N,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],g=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),v="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[v],b=t[v+"calendar"],_=t.cumulative,w=f(e,t,g,v),T=w[0],M=w[1],k="string"==typeof T.size,A=[],L=k?A:T,S=[],D=[],O=[],C=0,P=t.histnorm,I=t.histfunc,N=-1!==P.indexOf("density");_.enabled&&N&&(P=P.replace(/ ?density$/,""),N=!1);var z,R="max"===I||"min"===I?null:0,F=s.count,E=c[P],j=!1,H=function(e){return g.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==I&&(z=t[x],j="avg"===I,F=s[I]),r=H(T.start),p=H(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,_.direction,_.currentbin);var J=Math.min(m.length,y.length),Q=[],K=0,$=J-1;for(r=0;r=K;r--)if(y[r]){$=r;break}for(r=K;r<=$;r++)if(n(m[r])&&n(y[r])){var ee={p:m[r],s:y[r],b:0};_.enabled||(ee.pts=O[r],q?ee.ph0=ee.ph1=O[r].length?M[O[r][0]]:m[r]:(t._computePh=!0,ee.ph0=V(A[r]),ee.ph1=V(A[r+1],!0))),Q.push(ee)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,T.size,!1,b)-Q[0].p),l(Q,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(Q,t,X),Q},calcAllAutoBins:f}},{"../../lib":242,"../../plots/cartesian/axes":289,"../../registry":326,"../bar/arrays_to_calcdata":335,"./average":386,"./bin_functions":388,"./bin_label_vals":389,"./norm_functions":397,"fast-isnumeric":26}],391:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],392:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,d,f,p,h,m,y,g=t._histogramBinOpts={},v=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=g[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h0}function T(e){e.each((function(e){v.stroke(n.select(this),e.line.color)})).each((function(e){v.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function M(e,t,r){var n=e._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),i={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return o.coerce(a,i,g,e,t)}return m(a,i,s,l,n),y(a,i,s,l),i}function k(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function A(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(p.convertToTspans,a).call(d.font,t),d.bBox(o.node())}function L(e,t,r,n,a,i){var l="_cache"+t;e[l]&&e[l].key===a||(e[l]={key:a,value:r});var s=o.aggNums(i,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,m){var y,g=e._fullLayout;w(r)&&m&&(y=m()),o.makeTraceGroups(g._indicatorlayer,t,"trace").each((function(t){var m,S,D,O,C,P=t[0].trace,I=n.select(this),N=P._hasGauge,z=P._isAngular,R=P._isBullet,F=P.domain,E={w:g._size.w*(F.x[1]-F.x[0]),h:g._size.h*(F.y[1]-F.y[0]),l:g._size.l+g._size.w*F.x[0],r:g._size.r+g._size.w*(1-F.x[1]),t:g._size.t+g._size.h*(1-F.y[1]),b:g._size.b+g._size.h*F.y[0]},j=E.l+E.w/2,H=E.t+E.h/2,B=Math.min(E.w/2,E.h),Y=f.innerRadius*B,V=P.align||"center";if(S=H,N){if(z&&(m=j,S=H+B/2,D=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*Y)}),R){var U=f.bulletPadding,q=1-f.bulletNumberDomainSize+U;m=E.l+(q+(1-q)*b[V])*E.w,D=function(e){return k(e,(f.bulletNumberDomainSize-U)*E.w,E.h)}}}else m=E.l+b[V]*E.w,D=function(e){return k(e,E.w,E.h)};!function(e,t,r,a){var c,u,f,m=r[0].trace,y=a.numbersX,g=a.numbersY,T=m.align||"center",k=x[T],S=a.transitionOpts,D=a.onComplete,O=o.ensureSingle(t,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var P=O.selectAll("text").data(C);function I(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(_)||r(a).slice(-1).match(_))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=M(e,{tickformat:i});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var N,z=m.mode+m.align;m._hasDelta&&(N=function(){var t=M(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=function(e){return m.delta.relative?e.relativeDelta:e.delta},l=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+t(e)},s=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=o(r[0]));var c=O.select("text.delta");function f(){c.text(l(o(r[0]),a)).call(v.fill,s(r[0])).call(p.convertToTspans,e)}return c.call(d.font,m.delta.font).call(v.fill,s({delta:m._deltaLastValue})),w(S)?c.transition().duration(S.duration).ease(S.easing).tween("text",(function(){var e=n.select(this),t=o(r[0]),c=m._deltaLastValue,u=I(m.delta.valueformat,a,c,t),d=i(c,t);return m._deltaLastValue=t,function(t){e.text(l(d(t),u)),e.call(v.fill,s({delta:d(t)}))}})).each("end",(function(){f(),D&&D()})).each("interrupt",(function(){f(),D&&D()})):f(),u=A(l(o(r[0]),a),m.delta.font,k,e),c}(),z+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,z+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=u);m._hasNumber&&(!function(){var t=M(e,{tickformat:m.number.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=m.number.suffix,l=m.number.prefix,s=O.select("text.number");function u(){var t="number"==typeof r[0].y?l+a(r[0].y)+o:"-";s.text(t).call(d.font,m.number.font).call(p.convertToTspans,e)}w(S)?s.transition().duration(S.duration).ease(S.easing).each("end",(function(){u(),D&&D()})).each("interrupt",(function(){u(),D&&D()})).attrTween("text",(function(){var e=n.select(this),t=i(r[0].lastY,r[0].y);m._lastValue=r[0].y;var s=I(m.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(l+s(t(r))+o)}})):u(),c=A(l+a(r[0].y)+o,m.number.font,k,e)}(),z+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c);if(m._hasDelta&&m._hasNumber){var R,F,E=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(u.left+u.right)/2,(u.top+u.bottom)/2],H=.75*m.delta.font.size;"left"===m.delta.position&&(R=L(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+H),z,Math.min),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=L(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+H,z,Math.max),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),N.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&O.attr("transform",(function(){var e=a.numbersScaler(f);z+=e[2];var t,r=L(m,"numbersScale",1,e[0],z,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?g-r*f.bottom:g-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+t;var n=f[T];"center"===T&&(n=(f.left+f.right)/2);var i=y-r*n;return i=L(m,"numbersTranslate",0,i,z,Math.max),s(i,t)+l(r)}))}(e,I,t,{numbersX:m,numbersY:S,numbersScaler:D,transitionOpts:r,onComplete:y}),N&&(O={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},C={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var G=I.selectAll("g.angular").data(z?t:[]);G.exit().remove();var Z=I.selectAll("g.angularaxis").data(z?t:[]);Z.exit().remove(),z&&function(e,t,r,i){var o,l,d,f,p=r[0].trace,m=i.size,y=i.radius,g=i.innerRadius,v=i.gaugeBg,x=i.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+y/2],_=i.gauge,k=i.layer,A=i.transitionOpts,L=i.onComplete,S=Math.PI/2;function D(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-S;return r<-S?-S:r>S?S:r}function O(e){return n.svg.arc().innerRadius((g+y)/2-e/2*(y-g)).outerRadius((g+y)/2+e/2*(y-g)).startAngle(-S)}function C(e){e.attr("d",(function(e){return O(e.thickness).startAngle(D(e.range[0])).endAngle(D(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(o=M(e,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},I={},N=h.makeLabelFns(o,0).labelStandoff;I.xFn=function(e){var t=P(e);return Math.cos(t)*N},I.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(N+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*u)},I.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var z=function(e){return s(b[0]+y*Math.cos(e),b[1]-y*Math.sin(e))};d=function(e){return z(P(e))};if(l=h.calcTicks(o),f=h.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:l,layer:k,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(e){var t=P(e);return z(t)+"rotate("+-c(t)+")"}}),h.drawLabels(e,o,{vals:l,layer:k,transFn:d,labelFns:I})}var F=[v].concat(p.gauge.steps),E=_.selectAll("g.bg-arc").data(F);E.enter().append("g").classed("bg-arc",!0).append("path"),E.select("path").call(C).call(T),E.exit().remove();var j=O(p.gauge.bar.thickness),H=_.selectAll("g.value-arc").data([p.gauge.bar]);H.enter().append("g").classed("value-arc",!0).append("path");var B=H.select("path");w(A)?(B.transition().duration(A.duration).ease(A.easing).each("end",(function(){L&&L()})).each("interrupt",(function(){L&&L()})).attrTween("d",(Y=j,V=D(r[0].lastY),U=D(r[0].y),function(){var e=a(V,U);return function(t){return Y.endAngle(e(t))()}})),p._lastValue=r[0].y):B.attr("d","number"==typeof r[0].y?j.endAngle(D(r[0].y)):"M0,0Z");var Y,V,U;B.call(T),H.exit().remove(),F=[];var q=p.gauge.threshold.value;(q||0===q)&&F.push({range:[q,q],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var G=_.selectAll("g.threshold-arc").data(F);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(C).call(T),G.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(C).call(T),Z.exit().remove()}(e,0,t,{radius:B,innerRadius:Y,gauge:G,layer:Z,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var X=I.selectAll("g.bullet").data(R?t:[]);X.exit().remove();var W=I.selectAll("g.bulletaxis").data(R?t:[]);W.exit().remove(),R&&function(e,t,r,n){var a,i,o,l,c,u=r[0].trace,d=n.gauge,p=n.layer,m=n.gaugeBg,y=n.gaugeOutline,g=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform",s(g.l,g.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=g.h,A=u.gauge.bar.thickness*k,L=x.x[0],S=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-f.bulletNumberDomainSize:1);(a=M(e,u.gauge.axis))._id="xbulletaxis",a.domain=[L,S],a.setScale(),i=h.calcTicks(a),o=h.makeTransTickFn(a),l=h.getTickSigns(a)[2],c=g.t+g.h,a.visible&&(h.drawTicks(e,a,{vals:"inside"===a.ticks?h.clipEnds(a,i):i,layer:p,path:h.makeTickPath(a,c,l),transFn:o}),h.drawLabels(e,a,{vals:i,layer:p,transFn:o,labelFns:h.makeLabelFns(a,c)}));function D(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*k})).attr("height",(function(e){return e.thickness*k}))}var O=[m].concat(u.gauge.steps),C=d.selectAll("g.bg-bullet").data(O);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(D).call(T),C.exit().remove();var P=d.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(k-A)/2).call(T),w(b)?P.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var I=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),N=d.selectAll("g.threshold-bullet").data(I);N.enter().append("g").classed("threshold-bullet",!0).append("line"),N.select("line").attr("x1",a.c2p(u.gauge.threshold.value)).attr("x2",a.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*k).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),N.exit().remove();var z=d.selectAll("g.gauge-outline").data([y]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(D).call(T),z.exit().remove()}(e,0,t,{gauge:X,layer:W,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var J=I.selectAll("text.title").data(t);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[P.title.align]})).text(P.title.text).call(d.font,P.title.font).call(p.convertToTspans,e),J.attr("transform",(function(){var e,t=E.l+E.w*b[P.title.align],r=f.titlePadding,n=d.bBox(J.node());if(N){if(z)if(P.gauge.axis.visible)e=d.bBox(Z.node()).top-r-n.bottom;else e=E.t+E.h/2-B/2-n.bottom-r;R&&(e=S-(n.top+n.bottom)/2,t=E.l-f.bulletPadding*E.w)}else e=P._numbersTop-r-n.bottom;return s(t,e)}))}))}},{"../../components/color":111,"../../components/drawing":133,"../../constants/alignment":216,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/cartesian/axes":289,"../../plots/cartesian/axis_defaults":291,"../../plots/cartesian/layout_attributes":304,"../../plots/cartesian/position_defaults":307,"./constants":401,"@plotly/d3":18,"d3-interpolate":22}],405:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../components/drawing/attributes").dash,l=e("../../components/fx/attributes"),s=e("../../constants/delta.js"),c=s.INCREASING.COLOR,u=s.DECREASING.COLOR,d=a.line;function f(e){return{line:{color:n({},d.color,{dflt:e}),width:d.width,dash:o,editType:"style"},editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},d.width,{}),dash:n({},o,{}),editType:"style"},increasing:f(c),decreasing:f(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},l.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":132,"../../components/fx/attributes":142,"../../constants/delta.js":218,"../../lib":242,"../../plots/cartesian/axis_format_attributes":292,"../scatter/attributes":427}],406:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../../constants/numerical").BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function c(e,t,r,o,s,c){for(var u=s.makeCalcdata(t,"open"),d=s.makeCalcdata(t,"high"),f=s.makeCalcdata(t,"low"),p=s.makeCalcdata(t,"close"),h=Array.isArray(t.text),m=Array.isArray(t.hovertext),y=!0,g=null,v=!!t.xperiodalignment,x=[],b=0;bg):y=k>w,g=k;var A=c(w,T,M,k);A.pos=_,A.yc=(w+k)/2,A.i=b,A.dir=y?"increasing":"decreasing",A.x=A.pos,A.y=[M,T],v&&(A.orig_p=r[b]),h&&(A.tx=t.text[b]),m&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[s._id]=i.findExtremes(s,n.concat(f,d),{padded:!0}),x.length&&(x[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),l=function(e,t,r){var a=r._minDiff;if(!a){var i,l=e._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat):((v=a.extendFlat({},f)).y0=v.y1=_,v.yLabelVal=b,v.yLabel=c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat),v.name="",d.push(v),y[b]=v)}return d}function f(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,d=i[0].t,f=u(e,t,r,a);if(!f)return[];var p=i[f.index],h=f.index=p.i,m=p.dir;function y(e){return d.labels[e]+n.hoverLabelText(o,s[e][h],s.yhoverformat)}var g=p.hi||s.hoverinfo,v=g.split("+"),x="all"===g,b=x||-1!==v.indexOf("y"),_=x||-1!==v.indexOf("text"),w=b?[y("open"),y("high"),y("low"),y("close")+" "+c[m]]:[];return _&&l(p,s,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?d(e,t,r,n):f(e,t,r,n)},hoverSplit:d,hoverOnPoints:f}},{"../../components/color":111,"../../components/fx":151,"../../constants/delta.js":218,"../../lib":242,"../../plots/cartesian/axes":289}],409:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":303,"./attributes":405,"./calc":406,"./defaults":407,"./hover":408,"./plot":411,"./select":412,"./style":413}],410:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var d=Math.min(l.length,s.length,c.length,u.length);return o&&(d=Math.min(d,a.minRowLength(o))),t._length=d,d}}},{"../../lib":242,"../../registry":326}],411:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.yaxis,l=t.xaxis,s=!!l.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var c=i.tickLen,u=t.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=l.c2p(e.pos-c,!0),r=l.c2p(e.pos+c,!0),n=s?(t+r)/2:l.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},{"../../lib":242,"@plotly/d3":18}],412:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),d=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),d){t._length=d,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),h=c("texttemplate");if(h||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||f&&"none"!==f){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":242,"../../plots/domain":317,"../bar/defaults":340,"./attributes":414,"fast-isnumeric":26}],418:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":147}],419:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,d)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(d||p){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(l||h||d){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||f)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=d/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function R(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),I(t,i);var f=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var f=n.select(this),h=t[0],m=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),f.attr("stroke-linejoin","round"),f.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],_=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),f=u.selectAll("path.surface").data([a]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),m.pull){var g=+y.castOption(m.pull,a.pts)||0;g>0&&(o+=g*a.pxmid[0],c+=g*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===h.vTotal){var M="M"+(o+a.px0[0])+","+(c+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?f.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+M):f.attr("d",M)}else{var k=O(a.px0,a.px1,!0,1);if(T){var A=1-T;f.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+k+"Z")}else f.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+k+"Z")}z(e,a,h);var L=y.castOption(m.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):b(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var g,v=l.bBox(u.node());if("outside"===L)g=D(v,a);else if(g=w(v,a,h),"auto"===L&&g.scale<1){var x=s.ensureUniformFontSize(e,m.outsidetextfont);u.call(l.font,x),g=D(v=l.bBox(u.node()),a)}var T=g.textPosAngle,M=void 0===T?a.pxmid:N(h.r,T);if(g.targetX=o+M[0]*g.rCenter+(g.x||0),g.targetY=c+M[1]*g.rCenter+(g.y||0),R(g,v),g.outside){var k=g.targetY;a.yLabelMin=k-v.height/2,a.yLabelMid=k,a.yLabelMax=k+v.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}g.fontSize=f.size,p(m.type,g,r),t[i].transform=g,u.attr("transform",s.getTextTransform(g))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=s.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,m.title.font).call(d.convertToTspans,e),t="middle center"===m.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):O(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,d,f,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),v=p-h;if(v*s>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=v):(m+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-d.indexOf(e)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],d=u.concat(c),p=[],f=0;fMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(d-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,m),_&&m.automargin){var M=l.bBox(f.node()),k=m.domain,A=i.w*(k.x[1]-k.x[0]),L=i.h*(k.y[1]-k.y[0]),S=(.5*A-h.r)/i.w,C=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+m.uid+".automargin",{xl:k.x[0]-S,xr:k.x[1]+S,yb:k.y[0]-C,yt:k.y[1]+C,l:Math.max(h.cx-h.r-M.left,0),r:Math.max(M.right-(h.cx+h.r),0),b:Math.max(M.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-M.top,0),pad:5})}}))}));setTimeout((function(){f.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:R}},{"../../components/color":111,"../../components/drawing":133,"../../components/fx":151,"../../lib":242,"../../lib/svg_text_utils":265,"../../plots/plots":324,"../bar/constants":338,"../bar/uniform_text":352,"./event_data":418,"./helpers":419,"@plotly/d3":18}],424:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":352,"./style_one":425,"@plotly/d3":18}],425:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":111,"./helpers":419}],426:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&O[g].gap;)g--;for(x=O[g].s,m=O.length-1;m>g;m--)O[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],434:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),d=e("./marker_defaults"),f=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults");t.exports=function(e,t,r,y){function g(r,a){return n.coerce(e,t,i,r,a)}var v=s(e,t,y,g);if(v||(t.visible=!1),t.visible){c(e,t,y,g),g("xhoverformat"),g("yhoverformat");var x=u(e,t,y,g),b=!x&&v=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(f.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=N[P][1])>=Z&&(R=N[P-1][0],F=N[P][0],j-E&&(z=R+(F-R)*(Z-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var X=l.defaultLine;return l.opacity(d.fillcolor)?X=d.fillcolor:l.opacity((d.line||{}).color)&&(X=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:Z,y1:Z,color:X,hovertemplate:!1}),delete e.index,d.text&&!Array.isArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}},{"../../components/color":111,"../../components/fx":151,"../../lib":242,"../../registry":326,"./get_trace_color":437}],439:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"./arrays_to_calcdata":426,"./attributes":427,"./calc":428,"./cross_trace_calc":432,"./cross_trace_defaults":433,"./defaults":434,"./format_labels":436,"./hover":438,"./marker_colorbar":445,"./plot":448,"./select":449,"./style":451,"./subtypes":452}],440:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":121,"../../components/colorscale/helpers":122,"../../lib":242}],441:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,d=e("./constants");t.exports=function(e,t){var r,n,i,f,p,h,m,y,g,v,x,b,_,w,T,M,k,A,L=t.xaxis,S=t.yaxis,D="log"===L.type,O="log"===S.type,C=L._length,P=S._length,I=t.connectGaps,N=t.baseTolerance,z=t.shape,R="linear"===z,F=t.fill&&"none"!==t.fill,E=[],j=d.minTolerance,H=e.length,B=new Array(H),Y=0;function V(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(D&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*P*(L._m>0?o:l)/(S._m*C*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===B[Y-1][0],a=r===B[Y-1][1];if(!n||!a)if(Y>1){var i=t===B[Y-2][0],o=r===B[Y-2][1];n&&(t===te||t===re)&&i?o?Y--:B[Y-1]=e:a&&(r===ne||r===ae)&&o?i?Y--:B[Y-1]=e:B[Y++]=e}else B[Y++]=e}function ue(e){B[Y-1][0]!==e[0]&&B[Y-1][1]!==e[1]&&ce([W,J]),ce(e),Q=null,W=J=0}function de(e){if(k=e[0]/C,A=e[1]/P,Z=e[0]re?re:0,X=e[1]ae?ae:0,Z||X){if(Y)if(Q){var t=$(Q,e);t.length>1&&(ue(t[0]),B[Y++]=t[1])}else K=$(B[Y-1],e)[0],B[Y++]=K;else B[Y++]=[Z||e[0],X||e[1]];var r=B[Y-1];Z&&X&&(r[0]!==Z||r[1]!==X)?(Q&&(W!==Z&&J!==X?ce(W&&J?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Z,J||X]):W&&J&&ce([W,J])),ce([Z,X])):W-Z&&J-X&&ce([Z||W,X||J]),Q=e,W=Z,J=X}else Q&&ue($(Q,e)[0]),B[Y++]=e;var n,a,i,o}for("linear"===z||"spline"===z?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,e)q(h,fe))break;i=h,(_=g[0]*y[0]+g[1]*y[1])>x?(x=_,f=h,m=!1):_=e.length||!h)break;de(h),n=h}}else de(f)}Q&&ce([W||Q[0],J||Q[1]]),E.push(B.slice(0,Y))}return E}},{"../../constants/numerical":222,"../../lib":242,"./constants":431}],442:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],443:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,d=-1,f=0,p=-1;for(i=0;i=0?s=p:(s=p=f,f++),s0?Math.max(r,i):0}}},{"fast-isnumeric":26}],445:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],446:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),d=(e.line||{}).color;(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":111,"../../components/colorscale/defaults":121,"../../components/colorscale/helpers":122,"./subtypes":452}],447:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":222,"../../lib":242}],448:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),d=e("./link_traces"),f=e("../../lib/polygon").tester;function p(e,t,r,d,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),d=n.extent(i.simpleMap(s.range,s.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=d[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,D;v(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),d[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,P,I="",N=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,N=z._polygons);var R,F,E,j,H,B,Y,V="",U="",q=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(d),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},q=u(d,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),y=0;y1){var r=n.select(this);if(r.datum(d),e)v(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),s.singleLineStyle(d,a)}}}}}var Z=k.selectAll(".js-line").data(q);v(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(S?(S.datum(d),j&&B&&(O?("y"===O?j[1]=B[1]=b.c2p(0,!0):"x"===O&&(j[0]=B[0]=x.c2p(0,!0)),v(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle)):v(S).attr("d",V+"Z").call(s.singleFillStyle))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?v(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle):v(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(N)):(W(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?W(S):D&&W(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(d),L.datum(d),function(t,a,i){var o,u=i[0].trace,d=c.hasMarkers(u),f=c.hasText(u),p=ee(u),h=te,m=te;if(d||f){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?Q:J:_&&!w&&(y=K),d&&(h=y),f&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),d&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,d);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){v(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function K(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,f,h=!i,m=!!i&&i.duration>0,y=d(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":133,"../../lib":242,"../../lib/polygon":254,"../../registry":326,"./line_points":441,"./link_traces":443,"./subtypes":452,"@plotly/d3":18}],449:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],d=l[0].trace;if(!n.hasMarkers(d)&&!n.hasText(d))return[];if(!1===t)for(r=0;r")),u.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,y),[u]}function M(e){return n(m,e,f[h+"hoverformat"])}}},{"../../components/color":111,"../../constants/delta.js":218,"../../plots/cartesian/axes":289,"../bar/hover":343}],462:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"../bar/select":348,"./attributes":455,"./calc":456,"./cross_trace_calc":458,"./defaults":459,"./event_data":460,"./hover":461,"./layout_attributes":463,"./layout_defaults":464,"./plot":465,"./style":466}],463:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],464:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l0&&(y+=f?"M"+d[0]+","+h[1]+"V"+h[0]:"M"+d[1]+","+h[0]+"H"+d[0]),"between"!==p&&(r.isSum||l path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":111,"../../components/drawing":133,"../../constants/interactions":221,"../bar/style":350,"../bar/uniform_text":352,"@plotly/d3":18}],467:[function(e,t,r){"use strict";var n=e("../plots/cartesian/axes"),a=e("../lib"),i=e("../plot_api/plot_schema"),o=e("./helpers").pointsAccessorFunction,l=e("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var s=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=s.aggregations;function u(e,t,r,i){if(i.enabled){for(var o=i.target,s=a.nestedProperty(t,o),c=s.get(),u=function(e,t){var r=e.func,n=t.d2c,i=t.c2d;switch(r){case"count":return d;case"first":return f;case"last":return p;case"sum":return function(e,t){for(var r=0,a=0;aa&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return f(e)>l};case">=":return function(e){return f(e)>=l};case"[]":return function(e){var t=f(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=f(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=f(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=f(e);return tl[1]};case"](":return function(e){var t=f(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=f(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(f(e))};case"}{":return function(e){return-1===l.indexOf(f(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),f),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(d))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],73:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(e)(b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=b?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(x.prev)&&l.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":78,timers:79}],80:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(S[e])e=S[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,g=t.b,a={r:255*D(p,255),g:255*D(h,255),b:255*D(g,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=E(t.s),c=E(t.v),a=function(t,r,n){t=6*D(t,360),r=D(r,100),n=D(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=E(t.s),u=E(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=D(e,360),t=D(t,100),r=D(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=D(e,255),t=D(t,255),r=D(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[R(i(e).toString(16)),R(i(t).toString(16)),R(i(r).toString(16)),R(N(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*D(this._r,255))+"%",g:i(100*D(this._g,255))+"%",b:i(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%)":"rgba("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.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"},L=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function O(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function N(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return O(e)/255}var z,F,j,B=(F="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",j="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),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})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],81:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):n((e=e||self).topojson=e.topojson||{})}(this,(function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(r=n=0);var s=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+l;so&&(o=e[0]),e[1]l&&(l=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,s=e.length;++ro&&(o=t[0]),t[1]l&&(l=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,l]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i1)n=s(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,l,c=1,u=s(a[0]);cu&&(l=a[0],a[0]=a[c],a[c]=l,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");var r,a=(s=e.bbox||n(e))[0],i=s[1],o=s[2],l=s[3];t={scale:[o-a?(o-a)/(r-1):1,l-i?(l-i)/(r-1):1],translate:[a,i]}}var s,c,u=f(t),d=e.objects,p={};function h(e){return u(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in d)p[c]=g(d[c]);return{type:"Topology",bbox:s,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(g>>5&15)-1,(31&g)+l);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var g=h&1<<12-p?30:29;if(s>13;!v||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":96,"object-assign":68}],85:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":96,"object-assign":68}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":96,"object-assign":68}],87:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":96,"object-assign":68}],88:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":96,"object-assign":68}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":96,"object-assign":68}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":96,"object-assign":68}],91:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":96,"object-assign":68}],93:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":96,"object-assign":68}],94:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":96,"object-assign":68}],95:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":96,"object-assign":68}],96:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":68}],97:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},b=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},x=this,_=function(){if("function"==typeof s){y("m");var e=s.call(x,t.substring(k));return k+=e.length,e}return b("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=g;for(var L=this.daysInMonth(d,p);h>L;L=this.daysInMonth(d,p))p++,h-=L}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":96,"object-assign":68}],98:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],99:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":222,"../../plot_api/plot_template":285,"../../plots/cartesian/constants":303,"../../plots/font_attributes":325,"./arrow_paths":98}],100:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var b=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),x=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":248,"../../plots/cartesian/axes":296,"./draw":105}],101:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),X=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(K=t[te],X=he?ae._offset+ae._length*K:X=M.l+M.w*K):(K=1-t[te],X=he?ae._offset+ae._length*K:X=M.t+M.h*K),$=t.showarrow?.5:K}if(t.showarrow){fe.head=X;var ge=t["a"+te];if(ee=oe*G(.5,t.xanchor)-le*G(.5,t.yanchor),ne===re){var ve=s.getRefType(ne);"domain"===ve?("y"===te&&(ge=1-ge),fe.tail=ae._offset+ae._length*ge):"paper"===ve?"y"===te?(ge=1-ge,fe.tail=M.t+M.h*ge):fe.tail=M.l+M.w*ge:fe.tail=ae._offset+ae.r2p(ge),Q=ee}else fe.tail=X+ge,Q=ee+ge;fe.text=fe.tail+ee;var me=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,me-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),be=Math.min(fe.tail+3,fe.text)-me;ye>0?(fe.tail+=ye,fe.text+=ye):be>0&&(fe.tail-=be,fe.text-=be)}fe.tail+=ue,fe.head+=ue}else Q=ee=se*G($,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,Q+=ue,t["_"+te+"padplus"]=se/2+Q,t["_"+te+"padminus"]=se/2-Q,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)I.remove();else{var xe=0,_e=0;if("left"!==t.align&&(xe=(k-x)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(N-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+xe-1,y:j+_e}).call(u.setClipUrl,H?C:null,e);else{var we=j+_e-g.top,Me=j+xe-g.left;q.call(d.positionText,Me,we).call(u.setClipUrl,H?C:null,e)}Y.select("rect").call(u.setRect,j,j,k,N),B.call(u.setRect,z/2,z/2,F-z,U-z),I.call(u.setTranslate,Math.round(D.x.text-F/2),Math.round(D.y.text-U/2)),R.attr({transform:"rotate("+P+","+D.x.text+","+D.y.text+")"});var Te,ke=function(r,n){O.selectAll(".annotation-arrow-g").remove();var s=D.x.head,f=D.y.head,d=D.x.tail+r,p=D.y.tail+n,g=D.x.text+r,x=D.y.text+n,_=o.rotationXYMatrix(P,g,x),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),C=+B.attr("width"),E=+B.attr("height"),N=g-.5*C,z=N+C,F=x-.5*E,j=F+E,H=[[N,F,N,j],[N,j,z,j],[z,j,z,F],[z,F,N,F]].map(k);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var Y=t.arrowwidth,U=t.arrowcolor,G=t.arrowside,q=O.append("g").style({opacity:c.opacity(U)}).classed("annotation-arrow-g",!0),V=q.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",Y+"px").call(c.stroke,c.rgb(U));if(v(V,G,t),T.annotationPosition&&V.node().parentNode&&!i){var Z=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Z+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,Q,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:K.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);X=e.x,Q=e.y,m&&m.autorange&&A(m._name+".autorange",!0),b&&b.autorange&&A(b._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,Q),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),S("x",y(m,e,"x",M,t)),S("y",y(b,r,"y",M,t)),t.axref===t.xref&&S("ax",y(m,e,"ax",M,t)),t.ayref===t.yref&&S("ay",y(b,r,"ay",M,t)),q.attr("transform",l(e,r)),R.attr({transform:"rotate("+P+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),E)h.init({element:I.node(),gd:e,prepFn:function(){Te=R.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",y(m,e,"ax",M,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",y(b,r,"ay",M.w,t)):S("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(m)a=y(m,e,"x",M,t);else{var s=t._xsize/M.w,c=t.x+(t._xshift-t.xshift)/M.w-s/2;a=h.align(c+e/M.w,s,0,1,t.xanchor)}if(b)o=y(b,r,"y",M,t);else{var u=t._ysize/M.h,f=t.y-(t._yshift+t.yshift)/M.h-u/2;o=h.align(f-r/M.h,u,0,1,t.yanchor)}S("x",a),S("y",o),m&&b||(n=h.getCursor(m?.5:a,b?.5:o,t.xanchor,t.yanchor))}R.attr({transform:l(e,r)+Te}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",V(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=t.indexOf("end")>=0,x=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,M=o.y-u.y;if(d=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void E();if(x){if(x*x>w*w+M*M)return void E();var T=x*Math.cos(f),k=x*Math.sin(f);u.x+=T,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+M*M)return void E();var A=_*Math.cos(f),S=_*Math.sin(f);o.x-=A,o.y-=S,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var L=p.getTotalLength(),C="";if(L1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":334,"../annotations/draw":105}],112:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var X=Math.pow(10,Math.floor(Math.log(J)/Math.LN10));Z*=X*c.roundUp(J/X,[2,5,10]),(Math.abs(D.start)/D.size+1e-6)%1<2e-6&&(V.tick0=0)}V.dtick=Z}V.domain=[U+B,U+z-B],V.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var Q,K=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:V,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+F)*s.w,n=V.title.font.size;e="top"===A?(1-(U+z-B))*s.h+s.t+3+.75*n:(1-(U+B))*s.h+s.t-3-.25*n,te(V._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),f=[-t.outlinewidth/2,t.outlinewidth/2],d=i.select(".h"+V._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(ee=p.bBox(d).height)>h&&(f[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)V.domain[1]-=ee/s.h,f[1]*=-1;else{V.domain[0]+=ee/s.h;var g=v.lineCount(o);f[1]+=(1-g)*h}i.attr("transform",u(f[0],f[1])),V.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-V.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var y=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(O);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var b=S.map(V.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var o=[0===i?S[0]:(O[i]+O[i-1])/2,i===O.length-1?S[1]:(O[i]+O[i+1])/2].map(V.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var l=n.select(this).attr({x:H,width:Math.max(E,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=C(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+k.cblines).selectAll("path."+k.cbline).data(m.color&&m.width?R:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(V.c2p(e))+m.width/2%1)+"h"+E).call(p.lineGroupStyle,m.width,L(e),m.dash)})),$.selectAll("g."+V._id+"tick,path").remove();var _=H+E+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),M=l.calcTicks(V),T=l.getTickSigns(V)[2];return l.drawTicks(r,V,{vals:"inside"===V.ticks?l.clipEnds(V,M):M,layer:$,path:l.makeTickPath(V,_,T),transFn:l.makeTransTickFn(V)}),l.drawLabels(r,V,{vals:M,layer:$,transFn:l.makeTransTickLabelFn(V),labelFns:l.makeLabelFns(V,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=V.title.font.size,t=V._offset+V._length/2,a=s.l+(V.position||0)*s.w+("right"===V.side?10+e*(V.showticklabels?1:.5):-10-e*(V.showticklabels?.5:0));te("h"+V._id+"title",{avoid:{selection:n.select(r).selectAll("g."+V._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=E+t.outlinewidth/2;if(-1===V.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+V._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(K.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=G-q;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:q-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:q+t.ypad+("top"===A?ee:0),width:Math.max(E,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var f=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-f,s.t));var d={},g=M[t.yanchor],v=T[t.yanchor];"pixels"===t.lenmode?(d.y=t.y,d.t=c*g,d.b=c*v):(d.t=d.b=0,d.yt=t.y+t.len*g,d.yb=t.y-t.len*v);var m=M[t.xanchor],y=T[t.xanchor];if("pixels"===t.thicknessmode)d.x=t.x,d.l=l*m,d.r=l*y;else{var b=l-E;d.l=b*m,d.r=b*y,d.xl=t.x-t.thickness*m,d.xr=t.x+t.thickness*y}i.autoMargin(r,t._id,d)}],r)}(r,t,e);m&&m.then&&(e._promises||[]).push(m),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,c)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":221,"../../lib":248,"../../lib/extend":240,"../../lib/setcursor":268,"../../lib/svg_text_utils":271,"../../plots/cartesian/axes":296,"../../plots/cartesian/axis_defaults":298,"../../plots/cartesian/layout_attributes":311,"../../plots/cartesian/position_defaults":314,"../../plots/plots":337,"../../registry":340,"../color":116,"../colorscale/helpers":127,"../dragelement":135,"../drawing":138,"../titles":214,"./constants":118,"@plotly/d3":11,tinycolor2:80}],121:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":248}],122:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":117,"./defaults":119,"./draw":120,"./has_colorbar":121}],123:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",g=i+"max",v=i+"mid",m=(l(d+p),l(d+h),l(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(b.color.anim=!0)),b[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),t.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":264,"../../lib/sort_object_keys":269,"../colorbar/attributes":117,"./scales.js":131}],124:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":248,"./helpers":127,"fast-isnumeric":30}],125:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],133:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":248}],134:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],135:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,b=e.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":248,"../../plots/cartesian/constants":303,"./align":132,"./cursor":133,"./unhover":136,"has-hover":61,"has-passive-events":62,"mouse-event-offset":66}],136:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":238,"../../lib/events":239,"../../lib/throttle":272,"../fx/constants":150}],137:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],138:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,g=e("../../constants/interactions").DESELECTDIM,v=e("../../traces/scatter/subtypes"),m=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,b=t.exports={};b.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},b.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},b.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},b.setRect=function(e,t,r,n,a){e.call(b.setPosition,t,r).call(b.setSize,n,a)},b.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},b.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);b.translatePoint(e,a,t,r)}))},b.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},b.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){b.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},b.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},b.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),b.dashLine(t,l,o)},b.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(b.dashLine,l,o)}))},b.dashLine=function(e,t,r){r=+r||0,t=b.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},b.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},b.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},b.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var x=e("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(e){var t=x[e],r=t.n;b.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),b.symbolNames[r]=e,b.symbolFuncs[r]=t.f,t.needLine&&(b.symbolNeedLines[r]=!0),t.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(e,t){var r=e%100;return b.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=b.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=A[i],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},b.pattern=function(e,t,r,i,o,l,s,u,f,d,p,h){var g="legend"===t;u&&("overlay"===f?(d=u,p=c.contrast(d)):(d=void 0,p=u));var v,m,y,b,x,_,w,M,T,k,A,S=r._fullLayout,L="p"+S._uid+"-"+i,C={};switch(o){case"/":v=l*Math.sqrt(2),m=l*Math.sqrt(2),_="path",C={d:y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2,opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"\\":v=l*Math.sqrt(2),m=l*Math.sqrt(2),_="path",C={d:y="M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"x":v=l*Math.sqrt(2),m=l*Math.sqrt(2),y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2+"M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,b=l-l*Math.sqrt(1-s),_="path",C={d:y,opacity:h,stroke:p,"stroke-width":b+"px"};break;case"|":_="path",_="path",C={d:y="M"+(v=l)/2+",0L"+v/2+","+(m=l),opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"-":_="path",_="path",C={d:y="M0,"+(m=l)/2+"L"+(v=l)+","+m/2,opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"+":_="path",y="M"+(v=l)/2+",0L"+v/2+","+(m=l)+"M0,"+m/2+"L"+v+","+m/2,b=l-l*Math.sqrt(1-s),_="path",C={d:y,opacity:h,stroke:p,"stroke-width":b+"px"};break;case".":v=l,m=l,s.pattern_filled";S._patternUrlQueryParts[O]=1},b.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},b.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},b.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var f,d,p,h=!1;if(e.so)p=l.outlierwidth,d=l.outliercolor,f=o.outliercolor;else{var g=(l||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=o.gradient,m=e.mgt;m?h=!0:m=v&&v.type,a.isArrayOrTypedArray(m)&&(m=m[0],A[m]||(m=0));var y=o.pattern,x=y&&b.getPatternAttr(y.shape,e.i,"");if(m&&"none"!==m){var _=e.mgc;_?h=!0:_=v.color;var M=r.uid;h&&(M+="-"+e.i),b.gradient(t,i,M,m,[[0,_],[1,f]],"fill")}else if(x){var T=b.getPatternAttr(y.bgcolor,e.i,null),k=b.getPatternAttr(y.fgcolor,e.i,null),S=y.fgopacity,L=b.getPatternAttr(y.size,e.i,8),C=b.getPatternAttr(y.solidity,e.i,.3),D=e.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),P=r.uid;D&&(P+="-"+e.i),b.pattern(t,"point",i,P,x,L,C,e.mcc,y.fillmode,T,k,S)}else c.fill(t,f);p&&c.stroke(t,d)}},b.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=b.tryColorscale(r,""),t.lineScale=b.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=v.isBubble(e)?m(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,b.makeSelectedPointStyleFns(e)),t},b.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:g*t});var h=i.color,v=o.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?v||t:m||t});var y=i.size,b=o.size,x=l.size,_=void 0!==b,w=void 0!==x;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?b/2:t:w?x/2:t}),t},b.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,g))},t},b.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(b.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}b.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=b.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var g=e.tp||t.textposition,v=C(e,t),m=i?i(e):e.tc||t.textfont.color;o.call(b.font,e.tf||t.textfont.family,v,m).text(c).call(d.convertToTspans,r).call(L,g,v,e.mrc)}else o.remove()}))}},b.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=C(e,t);c.fill(a,i),L(a,o,l,e.mrc2||e.mrc)}))}};function D(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}b.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},R=0),r&&(b.savedBBoxes[r]=v),R++,a.extendFlat({},v)},b.setClipUrl=function(e,t,r){e.attr("clip-path",N(t,r))},b.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},b.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},b.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},b.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var I=/\s*sc.*/;b.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(I,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var z=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(z);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":152,"../../constants/alignment":221,"../../constants/interactions":225,"../../constants/xmlns_namespaces":227,"../../lib":248,"../../lib/svg_text_utils":271,"../../registry":340,"../../traces/scatter/make_bubble_size_func":379,"../../traces/scatter/subtypes":387,"../color":116,"../colorscale":128,"./symbol_defs":139,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:80}],139:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":11}],140:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],141:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":387,"../drawing":138,"@plotly/d3":11,"fast-isnumeric":30}],146:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":116,"@plotly/d3":11}],147:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":240,"../../plots/font_attributes":325,"./layout_attributes":157}],148:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexx[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+x[0]._offset,t.pointerY=ie+_[0]._offset,F="xval"in t?m.flat(l,t.xval):m.p2c(x,ae),Y="yval"in t?m.flat(l,t.yval):m.p2c(_,ie),!a(F[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(G=0;G$&&(ee.splice(0,$),ce=ee[0].distance),g&&0!==R&&0===ee.length){K.distance=R,K.index=!1;var f=V._module.hoverPoints(K,X,Q,"closest",{hoverLayer:s._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=R}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(d=de(v),(!re.vLinePoint||re.vLinePoint.spikeDistance>d.spikeDistance)&&(re.vLinePoint=d))}var y=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(d=de(b),(!re.hLinePoint||re.hLinePoint.spikeDistance>d.spikeDistance)&&(re.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Me-1;Ae--)De(ee[Ae]);ee=Se,ve()}var Pe=e._hoverdata,Oe=[],Re=B(e),Ee=H(e);for(U=0;U1||ee.length>1)||"closest"===S&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),We=O(ee,{gd:e,hovermode:S,rotateLabels:Ve,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});m.isUnifiedHover(S)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?M:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var x=p[o];for(l=x.length-1;l>=0;l--){var _=x[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ve?"xa":"ya",s),E(We,Ve,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Je=v.getComponentMethod("annotations","hasClickToShow")(e,Oe);f(n.select(t.target),Je?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Pe))return;Pe&&e.emit("plotly_unhover",{event:t,points:Pe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:x,yaxes:_,xvals:F,yvals:Y})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=O(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),g=e.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,d+=b,h+=b}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function O(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,g=t.outerContainer,w=t.commonLabelOpts||{},M=t.fontFamily||y.HOVERFONT,T=t.fontSize||y.HOVERFONTSIZE,k=e[0],L=k.xa,C=k.ya,P=i.charAt(0),O=k[P+"Label"],E=g.getBoundingClientRect(),N=E.top,I=E.width,z=E.height,F=void 0!==O&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(F){var j,B,H=!0;for(j=0;ja.width-x?(v=a.width-x,t.attr("d","M"+(x-A)+",0L"+x+","+b+A+"v"+b+(2*S+y.height)+"H-"+x+"V"+b+A+"H"+(x-2*A)+"Z")):t.attr("d","M0,0L"+A+","+b+A+"H"+(S+y.width/2)+"v"+b+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+b+A+"H-"+A+"Z")}else{var _,D,P;"right"===C.side?(_="start",D=1,P="",v=L._offset+L._length):(_="end",D=-1,P="-",v=L._offset),m=C._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+P+A+","+A+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+A+"V-"+A+"Z");var R,E=y.height/2,I=N-y.top-E,z="clip"+a._uid+"commonlabel"+C._id;if(v=0?ne:ae+le=0?ae:ge+le=0?te:re+se=0?re:ve+se=0,"top"!==e.idealAlign&&P||!E?P?(H+=U/2,e.anchor="start"):e.anchor="middle":(H-=U/2,e.anchor="end");else if(e.pos=H,P=B+Y/2+G<=I,E=B-Y/2-G>=0,"left"!==e.idealAlign&&P||!E)if(P)B+=Y/2,e.anchor="start";else{e.anchor="middle";var q=G/2,V=B+q-I,Z=B-q;V>0&&(B-=V),Z<0&&(B+=-Z)}else B-=Y/2,e.anchor="end";w.attr("text-anchor",e.anchor),L&&k.attr("text-anchor",e.anchor),t.attr("transform",l(B,H)+(c?s(_):""))})),me}function R(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(P,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function E(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+S),p=f+c*(e.txwidth+S),h=0,g=e.offset,v="middle"===l;v&&(f-=e.tx2width/2,p+=e.txwidth/2+S),t&&(g*=-k,h=e.offset*T),r.select("path").attr("d",v?"M-"+i(e.bx/2+e.tx2width/2)+","+o(g-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+e.ty0-e.by/2+S,b=e.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==l?(a.attr("text-anchor","start"),m=v?-e.bx/2-e.tx2width/2+S:-e.bx-S):"right"===b&&"end"!==l&&(a.attr("text-anchor","end"),m=v?e.bx/2-e.tx2width/2-S:e.bx+S)),a.call(u.positionText,i(m),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*S+h),o(g+e.ty0-e.by/2+S)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(g-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function N(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:g.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:g.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=g.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+g.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=g.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+g.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function I(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,M=a.spikethickness,T=a.spikecolor||_,k=g.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=k,x=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),b=s.l+A*s.w,x=s.l+S*s.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":d.dashStyle(a.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var L,C,D=t.vLinePoint;n=D&&D.xa,a=D&&D.ya,"cursor"===n.spikesnap?(L=c.pointerX,C=c.pointerY):(L=n._offset+D.x,C=a._offset+D.y);var P,O,R=i.readability(D.color,h)<1.5?p.contrast(h):D.color,E=n.spikemode,N=n.spikethickness,I=n.spikecolor||R,z=g.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=z,O=C),-1!==E.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),P=s.t+(1-j)*s.h,O=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:P,y2:O,"stroke-width":N,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,N)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:P,y2:O,"stroke-width":N+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:z-("top"!==n.side?N:-N),r:N,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}},{"../../lib":248,"../../lib/events":239,"../../lib/override_cursor":259,"../../lib/svg_text_utils":271,"../../plots/cartesian/axes":296,"../../registry":340,"../color":116,"../dragelement":135,"../drawing":138,"../legend/defaults":168,"../legend/draw":169,"./constants":150,"./helpers":152,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:80}],154:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":248,"../color":116,"./helpers":152}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":248,"./layout_attributes":157}],156:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":248,"../dragelement":135,"./attributes":147,"./calc":148,"./click":149,"./constants":150,"./defaults":151,"./helpers":152,"./hover":153,"./layout_attributes":157,"./layout_defaults":158,"./layout_global_defaults":159,"@plotly/d3":11}],157:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":325,"./constants":150}],158:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":248,"./hoverlabel_defaults":154,"./hovermode_defaults":155,"./layout_attributes":157}],159:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":248,"./hoverlabel_defaults":154,"./layout_attributes":157}],160:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===T("pattern")&&(d=!0);v._hasSubplotGrid=d;var b,x,_="top to bottom"===T("roworder"),w=d?.2:.1,M=d?.3:.1;g&&t._splomGridDflt&&(b=t._splomGridDflt.xside,x=t._splomGridDflt.yside),v._domains={x:u("x",T,w,b,y),y:u("y",T,M,x,m,_)}}else delete t.grid}function T(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var b=d.subplots||[];s=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(M("uirevision",t.uirevision),!1!==g){M("bgcolor",t.paper_bgcolor),M("bordercolor"),M("borderwidth");var m,y,b,x=a.coerceFont(M,"font",t.font),_="h"===M("orientation");if(_?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),M("traceorder",d),s.isGrouped(t.legend)&&M("tracegroupgap"),M("itemsizing"),M("itemwidth"),M("itemclick"),M("itemdoubleclick"),M("groupclick"),M("x",m),M("xanchor"),M("y",y),M("yanchor",b),M("valign"),a.noneOrAll(c,v,["x","y"]),M("title.text")){M("title.side",_?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(M,"title.font",w)}}}function M(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":248,"../../plot_api/plot_template":285,"../../plots/layout_attributes":335,"../../registry":340,"./attributes":166,"./helpers":172}],169:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),b=e("./style"),x=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").call(c.font,i).text(d?M(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(g,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*g;if(o){var v=c.bBox(o);u=v.height,d=v.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var m=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=h*y,d=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(m,s+p.titlePad,s+h);else{var x=2*p.itemGap+r.itemwidth;a.groupTitle&&(x=p.itemGap,d-=r.itemwidth),f.positionText(m,x,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&y(e.calcdata,t)}var g=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),L=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),C=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));C.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var D=a.ensureSingle(M,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var O=a.ensureSingle(D,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,P.font).text(P.text),k(O,D,e,t,1)}else D.selectAll(".legendtitletext").remove();var R=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),E=D.selectAll("g.groups").data(l);E.enter().append("g").attr("class","groups"),E.exit().remove();var N=E.selectAll("g.traces").data(a.identity);N.enter().append("g").attr("class","traces"),N.exit().remove(),N.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==g.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(b,e,t).each((function(){h||n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=x.isVertical(a),s=x.isGrouped(a),u=a.borderwidth,f=2*u,d=p.itemGap,h=a.itemwidth+2*d,g=2*(u+d),v=S(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v,b=a.tracegroupgap;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+d),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=d+h+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var M=A(a),T=a.x<0||0===a.x&&"right"===M,k=a.x>1||1===a.x&&"left"===M,L=y||m,C=i.width/2;a._maxWidth=Math.max(T?L&&"left"===M?o.l+o.w:C:k?L&&"right"===M?o.r+o.w:C:o.w,2*h);var D=0,P=0;r.each((function(e){var t=e[0].width+h;D=Math.max(D,t),P+=t})),_=null;var O=0;if(s){var R=0,E=0,N=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+d+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),R=Math.max(R,t);var r=e+d;r+u+E>a._maxWidth&&(O=Math.max(O,E),E=0,N+=R+b,R=t),c.setTranslate(this,E,N),E+=r})),a._width=Math.max(O,E)+u,a._height=N+R+g}else{var I=r.size(),z=P+f+(I-1)*d=a._maxWidth&&(O=Math.max(O,H),j=0,B+=F,a._height+=F,F=0),c.setTranslate(this,w[0]+u+j,w[1]+u+B+t/2+d),H=j+r+d,j+=n,F=Math.max(F,t)})),z?(a._width=j+f,a._height=F+g):(a._width=Math.max(O,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Y=e._context.edits,U=Y.legendText||Y.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=U?h:_||h+e[0].width;l||(a+=d/2),c.setRect(t,0,-r/2,a,r)}))}(e,E,N,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var l,u,g,y,b=f._size,x=t.borderwidth,w=b.l+b.w*t.x-v[A(t)]*t._width,T=b.t+b.h*(1-t.y)-v[S(t)]*t._effHeight;if(!h&&f.margin.autoexpand){var k=w,P=T;w=a.constrain(w,0,f.width-t._width),T=a.constrain(T,0,f.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==P&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(M,w,T),R.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;h&&(O=t._height),C.attr({width:t._width-x,height:O-x,x:x/2,y:x/2}),c.setTranslate(D,0,0),L.select("rect").attr({width:t._width-2*x,height:O-2*x,x:x,y:x}),c.setClipUrl(D,d,e),c.setRect(R,0,0,0,0),delete t._scrollY}else{var E,N,I,z=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-z-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);C.attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-x,x:x/2,y:x/2}),L.select("rect").attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*x,x:x,y:x+H}),c.setClipUrl(D,d,e),G(H,z,B),M.on("wheel",(function(){G(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),z,B),0!==H&&H!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;E="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(N="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,G(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(I,E,N),z,B))}));R.call(Y);var U=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(E=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(N=e.changedTouches[0].clientY,G(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(I,E,N),z,B))}));D.call(U)}if(e._context.edits.legendPosition)M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);g=e.x,y=e.y},moveFn:function(e,r){var n=g+e,a=y+r;c.setTranslate(M,n,a),l=s.align(n,0,b.l,b.l+b.w,t.xanchor),u=s.align(a,0,b.t+b.h,b.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,M,a,t,n)}})}function G(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(D,0,-r),c.setRect(R,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),L.select("rect").attr("y",x+r)}}],e)}(e,t)}},{"../../constants/alignment":221,"../../lib":248,"../../lib/events":239,"../../lib/svg_text_utils":271,"../../plots/plots":337,"../../registry":340,"../color":116,"../dragelement":135,"../drawing":138,"./constants":167,"./get_legend_data":170,"./handle_click":171,"./helpers":172,"./style":174,"@plotly/d3":11}],170:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function g(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(T=k)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var m=t._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*p.itemGap)/2,_=o(x,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function M(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),g=h.mid;void 0===g&&(g=(h.max+h.min)/2),p=l.tryColorscale(f,"")(g)}var m=p||i.mc||f.color,y=f.pattern,b=y&&l.getPatternAttr(y.shape,0,"");if(b){var x=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=v(y.size,8,10),k=v(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,b,T,k,p,y.fillmode,x,_,M)}else a.call(s.fill,m);o&&s.stroke(a,i.mlc||d.color)}))}function T(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var g=i.minExtend(o,{trace:h});f(c,g,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;u=0===o?p[g?v-1:0][1]:1===o?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,M(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){M(e,this,"funnel")})).each((function(e){M(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){T(e,this,"funnelarea")})).each((function(e){T(e,this,"pie")})).each((function(e){var r,a,o=g(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=e[0],x=y.trace,_=c(x),M=_.colorscale,T=_.reversescale,k=u.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",k+"h"+b+"v6h-"+b+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+x.uid;l.gradient(e,t,r,h(T),M,"fill")}}),f||d){var L=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:L}}),r=[i.minExtend(y,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",k+(d?"l"+b+",0.0001":"h"+b)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+x.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(T),M,"stroke")}})})).each((function(e){var r,a,o=g(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,v=!d&&!c&&!s&&u.hasText(h);function m(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||v||f){var x={},w={};if(d){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",i.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(p,x)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var T=n.select(this).select("g.legendpoints"),k=T.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=T.selectAll("g.pointtext").data(v?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":248,"../../registry":340,"../../traces/pie/helpers":359,"../../traces/pie/style_one":360,"../../traces/scatter/subtypes":387,"../color":116,"../colorscale/helpers":127,"../drawing":138,"./constants":167,"@plotly/d3":11}],175:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":177}],176:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(P=["toggleHover"],O=["resetViews"]):m?(D=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],O=["resetGeo"]):v?(P=["hoverClosest3d"],O=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(D=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],O=["resetViewMapbox"]):x?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:T?(P=["hoverClosestCartesian","hoverCompareCartesian"],O=["resetViewSankey"]):P=["toggleHover"];g&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=z[r+1];else if(e=n.pmax)t=z[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(T=f,L="y0",k=y,C="y1"):(T=y,L="y1",k=f,C="y0");J(n),K(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===R?X:Q,W.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),$(l),x(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;$(l)}};function J(r){if(m(e))R=null;else if(I)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!z&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),R=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(U(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(G(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else E?F("xanchor",r.xanchor=q(b+n)):(F("x0",r.x0=q(c+n)),F("x1",r.x1=q(v+n))),N?F("yanchor",r.yanchor=V(M+a)):(F("y0",r.y0=V(f+a)),F("y1",r.y1=V(y+a)));t.attr("d",_(e,r)),K(l,r)}function Q(n,a){if(z){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(U(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(G(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else if(I){if("resize-over-start-point"===R){var u=c+n,d=N?f-a:f+a;F("x0",r.x0=E?u:q(u)),F("y0",r.y0=N?d:V(d))}else if("resize-over-end-point"===R){var p=v+n,h=N?y-a:y+a;F("x1",r.x1=E?p:q(p)),F("y1",r.y1=N?h:V(h))}}else{var m=function(e){return-1!==R.indexOf(e)},x=m("n"),B=m("s"),Y=m("w"),Z=m("e"),W=x?T+a:T,J=B?k+a:k,X=Y?A+n:A,Q=Z?S+n:S;N&&(x&&(W=T-a),B&&(J=k-a)),(!N&&J-W>10||N&&W-J>10)&&(F(L,r[L]=N?W:V(W)),F(C,r[C]=N?J:V(J))),Q-X>10&&(F(D,r[D]=E?X:q(X)),F(P,r[P]=E?Q:q(Q)))}t.attr("d",_(e,r)),K(l,r)}function K(e,t){(E||N)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=U(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=G(N?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&N){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),Z.node().onmousemove=J}(e,E,s,t,r,R):!0===s.editable&&E.style("pointer-events",P||c.opacity(S)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void M(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=M,v(e)}}(e,E)}))}}function x(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getRefType(t.xref),v=i.getRefType(t.yref),m=i.getFromId(e,t.xref),y=i.getFromId(e,t.yref),b=e._fullLayout._size;if(m?"domain"===p?n=function(e){return m._offset+m._length*e}:(r=g.shapePositionToRange(m),n=function(e){return m._offset+m.r2p(r(e,!0))}):n=function(e){return b.l+b.w*e},y?"domain"===v?l=function(e){return y._offset+y._length*(1-e)}:(o=g.shapePositionToRange(y),l=function(e){return y._offset+y.r2p(o(e,!0))}):l=function(e){return b.t+b.h*(1-e)},"path"===d)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var x=n(t.xanchor);s=x+t.x0,c=x+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,f=_-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var w=(s+c)/2,M=(u+f)/2,T=Math.abs(w-s),k=Math.abs(M-u),A="A"+T+","+k,S=w+T+","+M;return"M"+S+A+" 0 1,1 "+(w+","+(M-k))+A+" 0 0,1 "+S+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function M(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:b,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),k&&!d)&&(T=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===M&&(e[0][0]="M"),t[w]=e,y(),b())}}()}}function O(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function L(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,v(t))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,m);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[x.side];t.attr("transform",s(m[0],m[1]))}}}return N.call(I),R&&(L?N.on(".opacity",null):(k=0,A=!0,N.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),N.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==b?o.call("_guiRestyle",e,m,t,b):o.call("_guiRelayout",e,m,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),N.classed("js-placeholder",A),M}}},{"../../constants/alignment":221,"../../constants/interactions":225,"../../lib":248,"../../lib/svg_text_utils":271,"../../plots/plots":337,"../../registry":340,"../color":116,"../drawing":138,"@plotly/d3":11,"fast-isnumeric":30}],215:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":240,"../../plot_api/edit_types":278,"../../plot_api/plot_template":285,"../../plots/font_attributes":325,"../../plots/pad_attributes":336,"../color/attributes":115}],216:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],217:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":248,"../../plots/array_container_defaults":291,"./attributes":215,"./constants":216}],218:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,x),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(M,o),u.call(_,o)}))})),u.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,S=h,L=v+m;L+A>c&&(L=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:S,y:L,width:k,height:A}),this._hbarXMin=S+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=m>M,P=l.barWidth+2*l.barPad,O=l.barLength+2*l.barPad,R=h+g,E=v;R+P>s&&(R=s-P);var N=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),D?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:R,y:E,width:P,height:O}),this._vbarYMin=E+O/2,this._vbarTranslateMax=M-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,z=u-.5,F=D?f+P+.5:f+.5,j=d-.5,B=T?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(T||D?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),T||D?(this._clipRect=H.select("rect").attr({x:Math.floor(z),y:Math.floor(j),width:Math.ceil(F)-Math.floor(z),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||D){var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(U),D&&this.vbar.on(".drag",null).call(U)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":248,"../color":116,"../drawing":138,"@plotly/d3":11}],221:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],222:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],223:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],224:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],225:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],226:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],227:[function(e,t,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}},{}],228:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],230:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],231:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":255}],232:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),M=e.match(w?b:y);if(!M)return u;var T=M[1],k=M[3]||"1",A=Number(M[5]||1),S=Number(M[7]||0),L=Number(M[9]||0),C=Number(M[11]||0);if(c){if(2===T.length)return u;var D;T=Number(T);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var O="i"===k.charAt(k.length-1);k=parseInt(k,10),D=P.newDate(T,P.toMonthIndex(T,k,O),A)}else D=P.newDate(T,Number(k),A)}catch(e){return u}return D?(D.toJD()-g)*f+S*d+L*p+C*h:u}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),k-=1;var R=new Date(Date.UTC(2e3,k,A,S,L));return R.setUTCFullYear(T),R.getUTCMonth()!==k||R.getUTCDate()!==A?u:R.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var M=90*f,T=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,b,x=Math.floor(10*s(e+.05,1)),w=Math.round(e-x/10);if(_(r)){var S=Math.floor(w/f)+g,L=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var S=/%\d?f/g,L=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function D(e,t,r,n){e=e.replace(S,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(L,(function(){return C[r("%q")(a)]})),_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),P[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+D(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return D(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":255}],246:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],247:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],248:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var g=e("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=e("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=e("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=e("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=e("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=e("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=e("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var S=e("./dom");function L(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var E=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return E.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var N={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(N,arguments)};var I={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(I,arguments)};var z=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,g="xother_"===l||"yother_"===l,v="xother"===l||"yother"===l||p||g||h,m=l;if((p||h)&&(m=m.substring(1)),(g||h)&&(m=m.substring(0,m.length-1)),v){if(void 0===(c=t[m]))return""}else for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":226,"./anchor_utils":230,"./angles":231,"./array":232,"./clean_number":233,"./clear_responsive":235,"./coerce":236,"./dates":237,"./dom":238,"./extend":240,"./filter_unique":241,"./filter_visible":242,"./geometry2d":245,"./identity":246,"./increment":247,"./is_plain_object":249,"./keyed_container":250,"./localize":251,"./loggers":252,"./make_trace_groups":253,"./matrix":254,"./mod":255,"./nested_property":256,"./noop":257,"./notifier":258,"./preserve_drawing_buffer":261,"./push_unique":262,"./regex":264,"./relative_attr":265,"./relink_private":266,"./search":267,"./sort_object_keys":269,"./stats":270,"./throttle":272,"./to_log_range":273,"@plotly/d3":11,"d3-format":24,"d3-time-format":27,"fast-isnumeric":30}],249:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],250:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":283,"./notifier":258}],253:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],254:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],256:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":226,"./matrix":254}],261:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":30,"is-mobile":64}],262:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":232,"fast-isnumeric":30}],271:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,g){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),D=n.select(e.node().parentNode);if(!D.empty()){var P=e.attr("class")?e.attr("class").split(" ")[0]:"text";return P+="-math",D.selectAll("svg."+P).remove(),D.selectAll("g."+P+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,a,o){D.selectAll("svg."+P).remove(),D.selectAll("g."+P+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return O(),void t();var c=D.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.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 u=e.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+e.attr("x")-d*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],v=-(r||s(e,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-d/2,v-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===P[0]?l.attr({x:e.attr("x"),y:v-p/2}):"a"===P[0]&&0!==P.indexOf("atitle")?l.attr({x:0,y:v}):l.attr({x:h,y:+e.attr("y")+v-p/2}),g&&g.call(e,c),t(c)}))}))):O(),e}function O(){D.empty()||(P=e.attr("class")+"-math",D.select("svg."+P).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}b.test(t)?u():(r=e,s=[{node:e}]);for(var S=t.split(m),D=0;D|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(m),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(S,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function C(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?t:""}function D(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(v," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(m),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],273:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":30}],274:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":327,"topojson-client":81}],275:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],276:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],277:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=x(t);r;){if(r in e)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var b,x,_,w,M,T,k,A,S=Object.keys(r).map(Number).sort(o),L=t.get(),C=L||[],D=u(m,f).get(),P=[],O=-1,R=C.length;for(b=0;bC.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?P.push(_):k?("add"===T&&(T={}),C.splice(_,0,T),D&&D.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===O&&(O=_);else for(x=0;x=0;b--)C.splice(P[b],1),D&&D.splice(P[b],1);if(C.length?L||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===O)E=S;else{for(R=Math.max(C.length,R),E=[],b=0;b=O);b++)E.push(_);for(b=O;b=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),P(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in P(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&U(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function U(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var G=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,V=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=z(s._preGUI,c),h=Object.keys(t),g=p.list(e),v=o.extendDeepAll({},t),m={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof R.parts[N];)N--;var F=R.parts[N],j=R.parts[N-1]+"."+F,H=R.parts.slice(0,N).join("."),Y=l(e.layout,H).get(),U=l(s,H).get(),Z=R.get();if(void 0!==E){A[O]=E,S[O]="reverse"===F?E:I(Z);var J=f.getLayoutValObject(s,R.parts);if(J&&J.impliedEdits&&null!==E)for(var X in J.impliedEdits)L(o.relativeAttr(O,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(O))if(E){L("autosize",null);var Q="height"===O?"width":"height";L(Q,s[Q])}else s[O]=e._initialAutoSize[O];else if("autosize"===O)L("width",E?null:s.width),L("height",E?null:s.height);else if(j.match(G))P(j),l(s,H+"._inputRange").set(null);else if(j.match(q)){P(j),l(s,H+"._inputRange").set(null);var K=l(s,H).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else j.match(V)&&l(s,H+"._inputDomain").set(null);if("type"===F){C=Y;var $="linear"===U.type&&"log"===E,ee="log"===U.type&&"linear"===E;if($||ee){if(C&&C.range)if(U.autorange)$&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var te=C.range[0],re=C.range[1];$?(te<=0&&re<=0&&L(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),L(H+".range[0]",Math.log(te)/Math.LN10),L(H+".range[1]",Math.log(re)/Math.LN10)):(L(H+".range[0]",Math.pow(10,te)),L(H+".range[1]",Math.pow(10,re)))}else L(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete s[R.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,U,E,L),u.getComponentMethod("images","convertCoords")(e,U,E,L)}else L(H+".autorange",!0),L(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(T)){var ne=l(s,O).get(),ae=(E||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,L),u.getComponentMethod("images","convertCoords")(e,ne,ae,L)}var ie=x.containerArrayMatch(O);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(x.isAddVal(E)?S[O]=null:x.isRemoveVal(E)?S[O]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(k,le),m[r]||(m[r]={});var se=m[r][n];se||(se=m[r][n]={}),se[oe]=E,delete t[O]}else"reverse"===F?(Y.range?Y.range.reverse():(L(H+".autorange",!0),Y.range=[1,0]),U.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===O&&("lasso"===E||"select"===E)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:J?M.update(k,J):k.calc=!0,R.set(E))}}for(r in m){x.applyContainerArrayChanges(e,d(i,r),m[r],k,d)||(k.plot=!0)}for(var ce in D){var ue=(C=p.getFromId(e,ce))&&C._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)D[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:D,undoit:S,redoit:A,eventData:v}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),Y(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&U(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],b=null==t,x=Array.isArray(t);if(!b&&!x&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(b||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&TT)&&k.push(g);y=k}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function b(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,t,l)},r.getLayoutValObject=function(e,t){return m(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":248,"../plots/attributes":292}],286:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function b(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,b=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function M(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-b-n:t._offset+t._length+b+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+b+n:t._offset-b-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var T=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=M(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?M(u,T,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],S=[],L=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,D=l.yaxis.domain,P=l.plotgroup;if(y(C,D,S)){var O=P.node(),R=l.bg=o.ensureSingle(P,"rect","bg");O.insertBefore(R.node(),O.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),S.push([C,D]),L||(k.push(a),A.push(a))}var E,N,I,z,F,j,B,H,Y,U,G,q,V,Z=v._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tM?u.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":248,"../plots/attributes":292,"../plots/plots":337,"./plot_config":283,"./plot_schema":284,"./plot_template":285}],288:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var k=o.extendFlat({},d);b?k.width=b:null===t.width&&n(h.width)&&(k.width=h.width),x?k.height=x:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=l.getRedrawFunc(T);function L(){return new Promise((function(e){setTimeout(e,l.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(M?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(M?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(T,r,k,A).then(S).then(L).then(C).then((function(t){e(function(e){return M?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":248,"../plots/plots":337,"../snapshot/helpers":344,"../snapshot/svgtoimg":346,"../snapshot/tosvg":348,"../version":405,"./plot_api":282,"fast-isnumeric":30}],289:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;db.length&&a.push(h("unused",i,m.concat(b.length)));var k,A,S,L,C,D=b.length,P=Array.isArray(T);if(P&&(D=Math.min(D,T.length)),2===x.dimensions)for(A=0;Ab[A].length&&a.push(h("unused",i,m.concat(A,b[A].length)));var O=b[A].length;for(k=0;k<(P?Math.min(O,T[A].length):O);k++)S=P?T[A][k]:T,L=y[A][k],C=b[A][k],n.validate(L,S)?C!==L&&C!==+L&&a.push(h("dynamic",i,m.concat(A,k),L,C)):a.push(h("value",i,m.concat(A,k),L))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,g=e[r+"period0"],v=i(g,d)||0,m=[],y=[],b=[],x=a.length,_=0;_k;)T=o(T,-c,d);for(;T<=k;)T=o(T,c,d);M=o(T,-c,d)}else{for(T=v+(w=Math.round((k-v)/u))*u;T>k;)T-=u;for(;T<=k;)T+=u;M=T-u}m[_]=p?M:h?T:(M+T)/2,y[_]=M,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":226,"../../lib":248,"fast-isnumeric":30}],294:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],295:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=g(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,v=f[0].val;for(r=1;r0&&((M=L-l(b)-s(x))>C?T/M>D&&(_=b,w=x,D=T/M):T/L>D&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},D=T/L));if(d===v){var P=d-1,O=d+1;if(A)if(0===d)a=[0,1];else{var R=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),E=d/(1-Math.min(.5,R/L));a=d>0?[0,E]:[E,0]}else a=S?[Math.max(0,P),Math.max(1,O)]:[P,O]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-D*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),D=(w.val-_.val-p(t,b.val,x.val))/(L-l(_)-s(w)),a=[_.val-D*l(_),w.val+D*s(w)];return m&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!M){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=O;n--)P(n);return{min:h,max:g,opts:r}},concatExtremes:g};function g(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function b(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":138,"../../constants/numerical":226,"../../lib":248,"../../registry":340,"./axis_ids":300,"@plotly/d3":11,"fast-isnumeric":30}],296:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),g=e("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,M=g.ONEAVGMONTH,T=g.ONEMINMONTH,k=g.ONEWEEK,A=g.ONEDAY,S=A/2,L=g.ONEHOUR,C=g.ONEMIN,D=g.ONESEC,P=g.MINUS_SIGN,O=g.BADNUM,R={K:"zeroline"},E={K:"gridline",L:"path"},N={K:"tick",L:"path"},I={K:"tick",L:"text"},z=e("../../constants/alignment"),F=z.MID_SHIFT,j=z.CAP_SHIFT,B=z.LINE_SPACING,H=z.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=e("./set_convert");var U=e("./axis_autotype"),G=e("./axis_ids"),q=G.idSort,V=G.isLinked;Y.id2name=G.id2name,Y.name2id=G.name2id,Y.cleanId=G.cleanId,Y.list=G.list,Y.listIds=G.listIds,Y.getFromId=G.getFromId,Y.getFromTrace=G.getFromTrace;var Z=e("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function W(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}Y.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},Y.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},Y.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==Y.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=Y.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},Y.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:Y.getFromId(t,r).cleanPos)(e)},Y.redrawComponents=function(e,t){t=t||Y.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*A:e-=S;var s=Y.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,m,c,i)),v=y,0;v<=u;)v=Y.tickIncrement(v,m,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(v,0,i),size:m,_dataSpan:u-c}},Y.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=Y.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=L,o&&!n&&e.dticki&&f=o:p<=o;p=Y.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(C.length>g||p===D)break;D=p;var P=!1;f&&p!==(0|p)&&(P=!0),C.push({minor:P,value:p})}if(d&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===x&&f>=_?d=u>=_&&u<=b?u:x:f>=T?d=u>=T&&u<=w?u:M:r===k&&f>=k?d=k:f>=A?d=A:r===S&&f>=S?d=S:r===L&&f>=L&&(d=L),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var C=(g+.5)/84;t.maskBreaks(a*(1-C)+C*p)!==O&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(C,e,e._definedDelta),e.rangebreaks){var R="y"===e._id.charAt(0),E=1;"auto"===e.tickmode&&(E=e.tickfont?e.tickfont.size:12);var N=NaN;for(h=C.length-1;h>-1;h--)if(C[h].drop)C.splice(h,1);else{C[h].value=Ae(C[h].value,e);var I=e.c2p(C[h].value);(R?N>I-E:Nu||Fu&&(z.periodX=u),F10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=C&&i<=16||t>=L)e._tickround="M";else if(t>=D&&i<=19||t>=C)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!fe(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}Y.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>m)t/=m,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>M)t/=M,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=Y.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>L?e.dtick=oe(t,L,ee):i>C?e.dtick=oe(t,C,te):i>D?e.dtick=oe(t,D,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},Y.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=de(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ue(p)&&fe(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":P)+d:(t.text=de(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=de(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=de(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=P+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=de(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},Y.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return Y.hoverLabelText(e,n,r)+" - "+Y.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=Y.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":P+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function fe(e){return e>14||e<-15}function de(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=Y.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,P);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?P+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var b=t._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ve(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Q&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,be(t),n),i.autoMargin(e,xe(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||Q&&"bottom"===t.side||J.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ve(t);else{var l=Se(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,g=Y.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?g-r:g+r):(p=t._offset+t._length/2,f="right"===t.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(h={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(J)}}function K(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ye(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},Y.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*j,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},Y.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,g=d?e.ticklen:0;if(f?g*=-1:u&&(g=0),d&&(p+=g,r)){var v=l.deg2rad(r);p=g*Math.cos(v)+1,h=g*Math.sin(v)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var m,y,b,x,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},M=0,T=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=h*x,y=t+p*x,b=_?1:-.2,90===Math.abs(A)&&(f?b+=F:b=-90===A&&"bottom"===T?j:90===A&&"top"===T?F:.5,M=F/2*(A/90)),w.xFn=function(e){return e.dx+m+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*b},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*x<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=p,y=h*x,b=0,f||90!==Math.abs(A)||(b=-90===A&&"left"===T||90===A&&"right"===T?j:.5),f){var S=a(A)?+A:0;if(0!==S){var L=l.deg2rad(S);M=Math.abs(Math.sin(L))*j*x,b=0}}w.xFn=function(e){return e.dx+t-(m+e.fontSize*b)*x+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*F},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Y.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],ge);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,t.tickcolor).style("stroke-width",d.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Le(t,[N]),i.attr("transform",r.transFn)},Y.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&Y.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;t._selections&&(t._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),p.length&&"x"===u&&!a(g)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(m.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ye(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var v="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,v)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":340,"./constants":303}],301:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function v(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*b)||M)for(r=0;rR&&zP&&(P=z);d/=(P-D)/(2*O),D=s.l2r(D),P=s.l2r(P),s.range=s._input.range=S=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function U(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function G(e){O&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,P)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function V(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(U(a),2!==e||me||Ge(),ve)o.indexOf("select")>-1&&S(r,a,X,Q,t.id,Pe),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&me){var l=g?R:O,c="s"===g||"w"===m?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",v="middle";if(l.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===l.side&&(h="right")):"e"===m&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(xe).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:v}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Ee(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Se="",Me.r=Me.l,Me.t=Me.b,Ce.attr("d","M0,0Z")}if(Me.l=Math.min(_e,n),Me.r=Math.max(_e,n),Me.t=Math.min(we,a),Me.b=Math.max(we,a),re.isSubplotConstrained)i>P||o>P?(Se="xy",i/ee>o/te?(o=i*te/ee,we>a?Me.t=we-o:Me.b=we+o):(i=o*ee/te,_e>n?Me.l=_e-i:Me.r=_e+i),Ce.attr("d",q(Me))):l();else if(ne.isSubplotConstrained)if(i>P||o>P){Se="xy";var s=Math.min(Me.l/ee,(te-Me.b)/te),c=Math.max(Me.r/ee,(te-Me.t)/te);Me.l=s*ee,Me.r=c*ee,Me.b=(1-s)*te,Me.t=(1-c)*te,Ce.attr("d",q(Me))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;ug[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":248,"fast-isnumeric":30}],315:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":221}],316:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),b=e("../../lib/polygon"),x=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),M=e("../../plot_api/subroutines").redrawReglTraces,T=e("./constants"),k=T.MINSELECT,A=b.filter,S=b.tester,L=e("./handle_outline").clearSelect,C=e("./helpers"),D=C.p2r,P=C.axValue,O=C.getTransform;function R(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,b=t._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){z(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function H(e,t,r){var n,i,o,l;for(n=0;n=0)C._fullLayout._deactivateShape(C);else if(!_){var r=E.clickmode;x.done(ge).then((function(){if(x.clear(ge),2===e){for(fe.remove(),$=0;$-1&&R(t,C,a.xaxes,a.yaxes,a.subplot,a,fe),"event"===r&&C.emit("plotly_selected",void 0);l.click(C,t)})).catch(y.error)}},a.doneFn=function(){he.remove(),x.done(ge).then((function(){x.clear(ge),a.gd.emit("plotly_selected",te),K&&a.selectionDefs&&(K.subtract=ue,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(ve)})).catch(y.error),_&&F(a)}},clearSelect:L,clearSelectionsCache:F,selectOnClick:R}},{"../../components/color":116,"../../components/dragelement/helpers":134,"../../components/drawing":138,"../../components/fx":156,"../../components/fx/helpers":152,"../../components/shapes/draw_newshape/display_outlines":204,"../../components/shapes/draw_newshape/helpers":205,"../../components/shapes/draw_newshape/newshapes":206,"../../lib":248,"../../lib/clear_gl_canvases":234,"../../lib/polygon":260,"../../lib/throttle":272,"../../plot_api/subroutines":286,"../../registry":340,"./axis_ids":300,"./constants":303,"./handle_outline":307,"./helpers":308,polybooljs:70}],317:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,g=p.BADNUM,v=p.LOG_CLIP,m=p.ONEWEEK,y=p.ONEDAY,b=p.ONEHOUR,x=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),M=e("./constants"),T=M.HOUR_PATTERN,k=M.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function S(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function L(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function C(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===g){if(!l(t))return g;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function D(t,r,n){return c(t,r,n||e.calendar)}function P(t){return e._categories[Math.round(t)]}function O(t){if(S(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return g}function R(t){if(e._categoriesMap)return e._categoriesMap[t]}function E(e){var t=R(e);return void 0!==t?t:l(e)?+e:void 0}function N(e){return l(e)?+e:R(e)}function I(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var F=function(t){return l(t)?I(t,e._m,e._b):g},j=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return g;var r=e._rangebreaks.length;if(!r)return I(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?I(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?L:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(L(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return L(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=L,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=C,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,n){return e.l2p(C(t,0,n))},e.p2d=e.p2r=function(e,t,r){return D(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,g,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=O,e.r2d=e.c2d=e.l2d=P,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return P(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=P,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=E(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=R,e.l2r=e.c2r=f,e.r2l=E,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return P(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),b=i.simpleMap(t.yr1,s.r2l),x=y[1]-y[0],_=b[1]-b[0];p[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/x),s.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*b[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,M=d?u/p[3]:1,T=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,S=d?p[1]/p[3]*u:0,L=a._offset-A,C=s._offset-S;n.clipRect.call(o.setTranslate,T,k).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,L,C).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}l.redrawComponents(e)}},{"../../components/drawing":138,"../../lib":248,"../../registry":340,"./axes":296,"@plotly/d3":11}],322:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(d.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new A(e)},S.plot=function(e,t,r){var n=this,a=t[this.id],i=[],o=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){o=!0;break}for(var s=0;s0&&i._module.calcGeoJSON(a,t)}if(!this.updateProjection(e,t)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),h.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this.render()}},S.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],s=t._size,u=n.domain,f=n.projection,d=n.lonaxis,p=n.lataxis,h=d._ax,g=p._ax,m=this.projection=function(e){var t=e.projection,r=t.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var s=(a[n]||l[n])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],d=function(e){return e?s:[]},p=0;pu*Math.PI/180}return!1},s.getPath=function(){return i().projection(s)},s.getBounds=function(e){return s.getPath().bounds(e)},s.precision(w.precision),e._isSatellite&&s.tilt(t.tilt).distance(t.distance);u&&s.clipAngle(u-w.clipPad);return s}(n),y=[[s.l+s.w*u.x[0],s.t+s.h*(1-u.y[1])],[s.l+s.w*u.x[1],s.t+s.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=d.range||[],M=p.range||[];if(n.fitbounds){h._length=y[1][0]-y[0][0],g._length=y[1][1]-y[0][1],h.range=v(r,h),g.range=v(r,g);var T=(h.range[0]+h.range[1])/2,k=(g.range[0]+g.range[1])/2;if(n._isScoped)b={lon:T,lat:k};else if(n._isClipped){b={lon:T,lat:k},x={lon:T,lat:k,roll:x.roll};var A=f.type,S=w.lonaxisSpan[A]/2||180,C=w.lataxisSpan[A]/2||90;_=[T-S,T+S],M=[k-C,k+C]}else b={lon:T,lat:k},x={lon:T,lat:x.lat,roll:x.roll}}m.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var D=L(_,M);m.fitExtent(y,D);var P=this.bounds=m.getBounds(D),O=this.fitScale=m.scale(),R=m.translate();if(n.fitbounds){var E=m.getBounds(L(h.range,g.range)),N=Math.min((P[1][0]-P[0][0])/(E[1][0]-E[0][0]),(P[1][1]-P[0][1])/(E[1][1]-E[0][1]));isFinite(N)?m.scale(N*O):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else m.scale(f.scale*O);var I=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(m.translate([R[0]+(I[0]-R[0]),R[1]+(I[1]-R[1])]).clipExtent(P),n._isAlbersUsa){var z=m([b.lon,b.lat]),F=m.translate();m.translate([F[0]-(z[0]-F[0]),F[1]-(z[1]-F[1])])}},S.updateBaseLayers=function(e,t){var r=this,a=r.topojson,i=r.layers,o=r.basePaths;function l(e){return"lonaxis"===e||"lataxis"===e}function s(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return s(e)||c(e)?t["show"+e]:!l(e)||t[e].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(e){delete i[e],delete o[e],n.select(this).remove()})),p.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=i[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):l(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):s(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],i=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):s(r)||c(r)?n.datum(k(a,a.objects[r])):l(r)&&n.datum(function(e,t,r){var n,a,i,o=t[e],l=w.scopeDefaults[t.scope];"lonaxis"===e?(n=l.lonaxisRange,a=l.lataxisRange,i=function(e,t){return[e,t]}):"lataxis"===e&&(n=l.lataxisRange,a=l.lonaxisRange,i=function(e,t){return[t,e]});var s={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};g.setConvert(s,r);var c=g.calcTicks(s);t.isScoped||"lonaxis"!==e||c.pop();for(var u=c.length,f=new Array(u),d=0;d-1&&x(n.event,a,[r.xaxis],[r.yaxis],r.id,f),l.indexOf("event")>-1&&p.click(a,n.event))}))}function d(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},S.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(d.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},g.setConvert(e.mockAxis,r)},S.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},c.extendFlat(this.viewInitial,t)},S.render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?u(r[0],r[1]):null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":116,"../../components/dragelement":135,"../../components/drawing":138,"../../components/fx":156,"../../lib":248,"../../lib/geo_location_utils":243,"../../lib/topojson_utils":274,"../../registry":340,"../cartesian/autorange":295,"../cartesian/axes":296,"../cartesian/select":316,"../plots":337,"./constants":327,"./zoom":332,"@plotly/d3":11,"d3-geo":26,"d3-geo-projection":25,"topojson-client":81}],329:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,l=0;l0&&P<0&&(P+=360);var O,R,E,N=(D+P)/2;if(!p){var I=h?f.projRotate:[N,0,0];O=r("projection.rotation.lon",I[0]),r("projection.rotation.lat",I[1]),r("projection.rotation.roll",I[2]),r("showcoastlines",!h&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}(p?(R=-96.6,E=38.7):(R=h?N:O,E=(C[0]+C[1])/2),r("center.lon",R),r("center.lat",E),g&&(r("projection.tilt"),r("projection.distance")),v)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),h||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):m?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":248,"../get_data":333,"../subplot_defaults":338,"./constants":327,"./layout_attributes":330}],332:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(s)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render();var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t);function m(e){return t.invert(e)}function y(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",(function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=m(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?m(d)&&(h=m(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=m(r=d),g=!0,e.render();var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(e,t,y)})),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,v=(Math.atan2(d,u)-Math.atan2(c,a))*l,m=(Math.atan2(d,u)-Math.atan2(c,-a))*l;return x(r[0],r[1],i,v)<=x(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function x(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function M(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*l,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*l,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*l]}function T(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){x.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},x.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&E.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&E.length>15&&0===s.shapes.length&&0===s.images.length,x.linkSubplots(d,s,f,n),x.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||B;H&&!Y?n._bgLayer.remove():Y&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=x.layoutAttributes.width.min,p=x.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[t]={l:{val:m,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:b,size:r.t+h}},p[t]=1}else delete d[t],delete p[t];if(!n._replotting)return x.doAutoMargin(e)}},x.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,g=t._pushmargin,v=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,M=b.size,T=_.val,k=_.size;for(var A in g){if(o(M)&&g[A].r){var S=g[A].r.val,L=g[A].r.size;if(S>w){var C=(M*S+(L-r)*w)/(S-w),P=(L*(1-w)+(M-r)*(1-S))/(S-w);C+P>c+f&&(c=C,f=P)}}if(o(k)&&g[A].t){var O=g[A].t.val,R=g[A].t.size;if(O>T){var E=(k*O+(R-n)*T)/(O-T),N=(R*(1-T)+(k-n)*(1-O))/(O-T);E+N>h+d&&(h=E,d=N)}}}}}var I=u.constrain(r-i.l-i.r,2,64),z=u.constrain(n-i.t-i.b,2,64),F=Math.max(0,r-I),j=Math.max(0,n-z);if(F){var B=(c+f)/F;B>1&&(c/=B,f/=B)}if(j){var H=(h+d)/j;H>1&&(h/=H,d/=H)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(v).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}x.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},x.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(E(o,c,f),a=0;a0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(M),M=(M=M.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(M=(M=(M=M.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),M}},{"../components/color":116,"../components/drawing":138,"../constants/xmlns_namespaces":227,"../lib":248,"@plotly/d3":11}],349:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":115,"../../components/colorscale/attributes":123,"../../lib/extend":240,"../../plots/attributes":292,"../../plots/template_attributes":339,"../scattergeo/attributes":390}],350:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o),[e]}},{"../../lib":248,"../../plots/cartesian/axes":296,"./attributes":349}],354:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":329,"../heatmap/colorbar":358,"./attributes":349,"./calc":350,"./defaults":351,"./event_data":352,"./hover":353,"./plot":355,"./select":356,"./style":357}],355:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;ps&&D[m].gap;)m--;for(b=D[m].s,g=D.length-1;g>m;g--)D[g].s=b;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],369:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),g=e("./fillcolor_defaults");t.exports=function(e,t,r,v){function m(r,a){return n.coerce(e,t,i,r,a)}var y=s(e,t,v,m);if(y||(t.visible=!1),t.visible){c(e,t,v,m),m("xhoverformat"),m("yhoverformat");var b=u(e,t,v,m),x=!b&&y=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&g<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-g);return iZ!=(j=E[O][1])>=Z&&(I=E[O-1][0],z=E[O][0],j-F&&(N=I+(z-I)*(Z-F)/(j-F),U=Math.min(U,N),G=Math.max(G,N)));U=Math.max(U,0),G=Math.min(G,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:U,x1:G,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":116,"../../components/fx":156,"../../lib":248,"../../registry":340,"./get_trace_color":372}],374:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":310,"./arrays_to_calcdata":361,"./attributes":362,"./calc":363,"./cross_trace_calc":367,"./cross_trace_defaults":368,"./defaults":369,"./format_labels":371,"./hover":373,"./marker_colorbar":380,"./plot":383,"./select":384,"./style":386,"./subtypes":387}],375:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":126,"../../components/colorscale/helpers":127,"../../lib":248}],376:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,b,x,_,w,M,T,k,A,S=t.xaxis,L=t.yaxis,C="log"===S.type,D="log"===L.type,P=S._length,O=L._length,R=t.connectGaps,E=t.baseTolerance,N=t.shape,I="linear"===N,z=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),Y=0;function U(r){var n=e[r];if(!n)return!1;var i=t.linearized?S.l2p(n.x):S.c2p(n.x),s=t.linearized?L.l2p(n.y):L.c2p(n.y);if(i===a){if(C&&(i=S.c2p(n.x,!0)),i===a)return!1;D&&s===a&&(i*=Math.abs(S._m*O*(S._m>0?o:l)/(L._m*P*(L._m>0?o:l)))),i*=1e3}if(s===a){if(D&&(s=L.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function G(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[Y-1][0],a=r===H[Y-1][1];if(!n||!a)if(Y>1){var i=t===H[Y-2][0],o=r===H[Y-2][1];n&&(t===te||t===re)&&i?o?Y--:H[Y-1]=e:a&&(r===ne||r===ae)&&o?i?Y--:H[Y-1]=e:H[Y++]=e}else H[Y++]=e}function ue(e){H[Y-1][0]!==e[0]&&H[Y-1][1]!==e[1]&&ce([J,X]),ce(e),Q=null,J=X=0}function fe(e){if(k=e[0]/P,A=e[1]/O,Z=e[0]re?re:0,W=e[1]ae?ae:0,Z||W){if(Y)if(Q){var t=$(Q,e);t.length>1&&(ue(t[0]),H[Y++]=t[1])}else K=$(H[Y-1],e)[0],H[Y++]=K;else H[Y++]=[Z||e[0],W||e[1]];var r=H[Y-1];Z&&W&&(r[0]!==Z||r[1]!==W)?(Q&&(J!==Z&&X!==W?ce(J&&X?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[J||Z,X||W]):J&&X&&ce([J,X])),ce([Z,W])):J-Z&&X-W&&ce([Z||J,W||X]),Q=e,J=Z,X=W}else Q&&ue($(Q,e)[0]),H[Y++]=e;var n,a,i,o}for("linear"===N||"spline"===N?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&V(o,e)q(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}Q&&ce([J||Q[0],X||Q[1]]),F.push(H.slice(0,Y))}return F}},{"../../constants/numerical":226,"../../lib":248,"./constants":366}],377:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],378:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":30}],380:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],381:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":116,"../../components/colorscale/defaults":126,"../../components/colorscale/helpers":127,"./subtypes":387}],382:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":226,"../../lib":248}],383:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(h),T=o(M,"g","errorbars"),k=o(M,"g","lines"),A=o(M,"g","points"),S=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(e,T,r,g),!0===_.visible){var L,C;y(M).style("opacity",_.opacity);var D=_.fill.charAt(_.fill.length-1);"x"!==D&&"y"!==D&&(D=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var P,O,R="",E=[],N=_._prevtrace;N&&(R=N._prevRevpath||"",C=N._nextFill,E=N._polygons);var I,z,F,j,B,H,Y,U="",G="",q=[],V=i.noop;if(L=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),z=s.steps(w.shape.split("").reverse().join(""))):I=z="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return z(e.reverse())},q=u(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var Z=k.selectAll(".js-line").data(q);y(Z.exit()).style("opacity",0).remove(),Z.each(V(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(V(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(L?(L.datum(f),j&&H&&(D?("y"===D?j[1]=H[1]=x.c2p(0,!0):"x"===D&&(j[0]=H[0]=b.c2p(0,!0)),y(L).attr("d","M"+H+"L"+j+"L"+U.substr(1)).call(s.singleFillStyle)):y(L).attr("d",U+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&U&&R?("tonext"===_.fill?y(C).attr("d",U+"Z"+R+"Z").call(s.singleFillStyle):y(C).attr("d",U+"L"+R.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(J(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=Y):(L?J(L):C&&J(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),S.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?Q:X:_&&!w&&(v=K),f&&(h=v),d&&(g=v)}var M,T=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,e).call(s.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,b,x)?(s.singlePointStyle(t,i,u,M,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,b,x,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,b,x)?r.layerClipId&&s.hideOutsideRangePoint(e,t,b,x,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=b.c2p(e.x),r=x.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,S,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(S,W,e)}function J(e){y(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function K(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":138,"../../lib":248,"../../lib/polygon":260,"../../registry":340,"./line_points":376,"./link_traces":378,"./subtypes":387,"@plotly/d3":11}],384:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":156,"../../constants/numerical":226,"../../lib":248,"../scatter/get_trace_color":372,"./attributes":390}],396:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":329,"../scatter/marker_colorbar":380,"../scatter/style":386,"./attributes":390,"./calc":391,"./defaults":392,"./event_data":393,"./format_labels":394,"./hover":395,"./plot":397,"./select":398,"./style":399}],397:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),b={},x={},_=0;h?(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},m=function(e,t){var r=b[e.astr][t];e.get()[t]=r}):(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set([])},m=function(e,t){var r=b[e.astr][t];e.get().push(r)}),T(v);for(var w=o(t.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],73:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(e)(b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=b?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(x.prev)&&l.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":78,timers:79}],80:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(S[e])e=S[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,g=t.b,a={r:255*D(p,255),g:255*D(h,255),b:255*D(g,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=E(t.s),c=E(t.v),a=function(t,r,n){t=6*D(t,360),r=D(r,100),n=D(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=E(t.s),u=E(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=D(e,360),t=D(t,100),r=D(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=D(e,255),t=D(t,255),r=D(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[R(i(e).toString(16)),R(i(t).toString(16)),R(i(r).toString(16)),R(N(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*D(this._r,255))+"%",g:i(100*D(this._g,255))+"%",b:i(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%)":"rgba("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.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"},L=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function O(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function N(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return O(e)/255}var z,F,j,B=(F="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",j="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),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})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],81:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):n((e=e||self).topojson=e.topojson||{})}(this,(function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(r=n=0);var s=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+l;so&&(o=e[0]),e[1]l&&(l=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,s=e.length;++ro&&(o=t[0]),t[1]l&&(l=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,l]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i1)n=s(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,l,c=1,u=s(a[0]);cu&&(l=a[0],a[0]=a[c],a[c]=l,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");var r,a=(s=e.bbox||n(e))[0],i=s[1],o=s[2],l=s[3];t={scale:[o-a?(o-a)/(r-1):1,l-i?(l-i)/(r-1):1],translate:[a,i]}}var s,c,u=f(t),d=e.objects,p={};function h(e){return u(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in d)p[c]=g(d[c]);return{type:"Topology",bbox:s,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(g>>5&15)-1,(31&g)+l);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var g=h&1<<12-p?30:29;if(s>13;!v||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":96,"object-assign":68}],85:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":96,"object-assign":68}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":96,"object-assign":68}],87:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":96,"object-assign":68}],88:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":96,"object-assign":68}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.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(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":96,"object-assign":68}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":96,"object-assign":68}],91:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":96,"object-assign":68}],93:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":96,"object-assign":68}],94:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":96,"object-assign":68}],95:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":96,"object-assign":68}],96:[function(e,t,r){var n=e("object-assign");function a(){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(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,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(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.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(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":68}],97:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},b=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},x=this,_=function(){if("function"==typeof s){y("m");var e=s.call(x,t.substring(k));return k+=e.length,e}return b("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=g;for(var L=this.daysInMonth(d,p);h>L;L=this.daysInMonth(d,p))p++,h-=L}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":96,"object-assign":68}],98:[function(e,t,r){"use strict";t.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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],99:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":222,"../../plot_api/plot_template":285,"../../plots/cartesian/constants":303,"../../plots/font_attributes":325,"./arrow_paths":98}],100:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var b=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),x=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":248,"../../plots/cartesian/axes":296,"./draw":105}],101:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),X=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(K=t[te],X=he?ae._offset+ae._length*K:X=M.l+M.w*K):(K=1-t[te],X=he?ae._offset+ae._length*K:X=M.t+M.h*K),$=t.showarrow?.5:K}if(t.showarrow){fe.head=X;var ge=t["a"+te];if(ee=oe*G(.5,t.xanchor)-le*G(.5,t.yanchor),ne===re){var ve=s.getRefType(ne);"domain"===ve?("y"===te&&(ge=1-ge),fe.tail=ae._offset+ae._length*ge):"paper"===ve?"y"===te?(ge=1-ge,fe.tail=M.t+M.h*ge):fe.tail=M.l+M.w*ge:fe.tail=ae._offset+ae.r2p(ge),Q=ee}else fe.tail=X+ge,Q=ee+ge;fe.text=fe.tail+ee;var me=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,me-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),be=Math.min(fe.tail+3,fe.text)-me;ye>0?(fe.tail+=ye,fe.text+=ye):be>0&&(fe.tail-=be,fe.text-=be)}fe.tail+=ue,fe.head+=ue}else Q=ee=se*G($,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,Q+=ue,t["_"+te+"padplus"]=se/2+Q,t["_"+te+"padminus"]=se/2-Q,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)I.remove();else{var xe=0,_e=0;if("left"!==t.align&&(xe=(k-x)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(N-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+xe-1,y:j+_e}).call(u.setClipUrl,H?C:null,e);else{var we=j+_e-g.top,Me=j+xe-g.left;q.call(d.positionText,Me,we).call(u.setClipUrl,H?C:null,e)}Y.select("rect").call(u.setRect,j,j,k,N),B.call(u.setRect,z/2,z/2,F-z,U-z),I.call(u.setTranslate,Math.round(D.x.text-F/2),Math.round(D.y.text-U/2)),R.attr({transform:"rotate("+P+","+D.x.text+","+D.y.text+")"});var Te,ke=function(r,n){O.selectAll(".annotation-arrow-g").remove();var s=D.x.head,f=D.y.head,d=D.x.tail+r,p=D.y.tail+n,g=D.x.text+r,x=D.y.text+n,_=o.rotationXYMatrix(P,g,x),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),C=+B.attr("width"),E=+B.attr("height"),N=g-.5*C,z=N+C,F=x-.5*E,j=F+E,H=[[N,F,N,j],[N,j,z,j],[z,j,z,F],[z,F,N,F]].map(k);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var Y=t.arrowwidth,U=t.arrowcolor,G=t.arrowside,q=O.append("g").style({opacity:c.opacity(U)}).classed("annotation-arrow-g",!0),V=q.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",Y+"px").call(c.stroke,c.rgb(U));if(v(V,G,t),T.annotationPosition&&V.node().parentNode&&!i){var Z=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Z+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,Q,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:K.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);X=e.x,Q=e.y,m&&m.autorange&&A(m._name+".autorange",!0),b&&b.autorange&&A(b._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,Q),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),S("x",y(m,e,"x",M,t)),S("y",y(b,r,"y",M,t)),t.axref===t.xref&&S("ax",y(m,e,"ax",M,t)),t.ayref===t.yref&&S("ay",y(b,r,"ay",M,t)),q.attr("transform",l(e,r)),R.attr({transform:"rotate("+P+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),E)h.init({element:I.node(),gd:e,prepFn:function(){Te=R.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",y(m,e,"ax",M,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",y(b,r,"ay",M.w,t)):S("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(m)a=y(m,e,"x",M,t);else{var s=t._xsize/M.w,c=t.x+(t._xshift-t.xshift)/M.w-s/2;a=h.align(c+e/M.w,s,0,1,t.xanchor)}if(b)o=y(b,r,"y",M,t);else{var u=t._ysize/M.h,f=t.y-(t._yshift+t.yshift)/M.h-u/2;o=h.align(f-r/M.h,u,0,1,t.yanchor)}S("x",a),S("y",o),m&&b||(n=h.getCursor(m?.5:a,b?.5:o,t.xanchor,t.yanchor))}R.attr({transform:l(e,r)+Te}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",V(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=t.indexOf("end")>=0,x=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,M=o.y-u.y;if(d=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void E();if(x){if(x*x>w*w+M*M)return void E();var T=x*Math.cos(f),k=x*Math.sin(f);u.x+=T,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+M*M)return void E();var A=_*Math.cos(f),S=_*Math.sin(f);o.x-=A,o.y-=S,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var L=p.getTotalLength(),C="";if(L1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":334,"../annotations/draw":105}],112:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var X=Math.pow(10,Math.floor(Math.log(J)/Math.LN10));Z*=X*c.roundUp(J/X,[2,5,10]),(Math.abs(D.start)/D.size+1e-6)%1<2e-6&&(V.tick0=0)}V.dtick=Z}V.domain=[U+B,U+z-B],V.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var Q,K=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),$=e.select("."+k.cbaxis),ee=0;function te(n,a){var i={propContainer:V,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+F)*s.w,n=V.title.font.size;e="top"===A?(1-(U+z-B))*s.h+s.t+3+.75*n:(1-(U+B))*s.h+s.t-3-.25*n,te(V._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+k.cbtitle),o=i.select("text"),f=[-t.outlinewidth/2,t.outlinewidth/2],d=i.select(".h"+V._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(ee=p.bBox(d).height)>h&&(f[1]-=(ee-h)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)V.domain[1]-=ee/s.h,f[1]*=-1;else{V.domain[0]+=ee/s.h;var g=v.lineCount(o);f[1]+=(1-g)*h}i.attr("transform",u(f[0],f[1])),V.setScale()}}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",u(0,Math.round(s.h*(1-V.domain[1])))),$.attr("transform",u(0,Math.round(-s.t)));var y=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(O);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var b=S.map(V.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var o=[0===i?S[0]:(O[i]+O[i-1])/2,i===O.length-1?S[1]:(O[i]+O[i+1])/2].map(V.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var l=n.select(this).attr({x:H,width:Math.max(E,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=C(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var x=e.select("."+k.cblines).selectAll("path."+k.cbline).data(m.color&&m.width?R:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(e){n.select(this).attr("d","M"+H+","+(Math.round(V.c2p(e))+m.width/2%1)+"h"+E).call(p.lineGroupStyle,m.width,L(e),m.dash)})),$.selectAll("g."+V._id+"tick,path").remove();var _=H+E+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),M=l.calcTicks(V),T=l.getTickSigns(V)[2];return l.drawTicks(r,V,{vals:"inside"===V.ticks?l.clipEnds(V,M):M,layer:$,path:l.makeTickPath(V,_,T),transFn:l.makeTransTickFn(V)}),l.drawLabels(r,V,{vals:M,layer:$,transFn:l.makeTransTickLabelFn(V),labelFns:l.makeLabelFns(V,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=V.title.font.size,t=V._offset+V._length/2,a=s.l+(V.position||0)*s.w+("right"===V.side?10+e*(V.showticklabels?1:.5):-10-e*(V.showticklabels?.5:0));te("h"+V._id+"title",{avoid:{selection:n.select(r).selectAll("g."+V._id+"tick"),side:A,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=E+t.outlinewidth/2;if(-1===V.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+V._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(K.node()).right-H-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=G-q;e.select("."+k.cbbg).attr({x:H-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:q-j,width:Math.max(l,2),height:Math.max(c+2*j,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+k.cboutline).attr({x:H,y:q+t.ypad+("top"===A?ee:0),width:Math.max(E,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var f=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-f,s.t));var d={},g=M[t.yanchor],v=T[t.yanchor];"pixels"===t.lenmode?(d.y=t.y,d.t=c*g,d.b=c*v):(d.t=d.b=0,d.yt=t.y+t.len*g,d.yb=t.y-t.len*v);var m=M[t.xanchor],y=T[t.xanchor];if("pixels"===t.thicknessmode)d.x=t.x,d.l=l*m,d.r=l*y;else{var b=l-E;d.l=b*m,d.r=b*y,d.xl=t.x-t.thickness*m,d.xr=t.x+t.thickness*y}i.autoMargin(r,t._id,d)}],r)}(r,t,e);m&&m.then&&(e._promises||[]).push(m),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,c)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":221,"../../lib":248,"../../lib/extend":240,"../../lib/setcursor":268,"../../lib/svg_text_utils":271,"../../plots/cartesian/axes":296,"../../plots/cartesian/axis_defaults":298,"../../plots/cartesian/layout_attributes":311,"../../plots/cartesian/position_defaults":314,"../../plots/plots":337,"../../registry":340,"../color":116,"../colorscale/helpers":127,"../dragelement":135,"../drawing":138,"../titles":214,"./constants":118,"@plotly/d3":11,tinycolor2:80}],121:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":248}],122:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":117,"./defaults":119,"./draw":120,"./has_colorbar":121}],123:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",g=i+"max",v=i+"mid",m=(l(d+p),l(d+h),l(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(b.color.anim=!0)),b[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),t.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":264,"../../lib/sort_object_keys":269,"../colorbar/attributes":117,"./scales.js":131}],124:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":248,"./helpers":127,"fast-isnumeric":30}],125:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],133:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":248}],134:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],135:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,b=e.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":248,"../../plots/cartesian/constants":303,"./align":132,"./cursor":133,"./unhover":136,"has-hover":61,"has-passive-events":62,"mouse-event-offset":66}],136:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":238,"../../lib/events":239,"../../lib/throttle":272,"../fx/constants":150}],137:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],138:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,g=e("../../constants/interactions").DESELECTDIM,v=e("../../traces/scatter/subtypes"),m=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,b=t.exports={};b.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},b.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},b.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},b.setRect=function(e,t,r,n,a){e.call(b.setPosition,t,r).call(b.setSize,n,a)},b.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},b.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);b.translatePoint(e,a,t,r)}))},b.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},b.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){b.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},b.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},b.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),b.dashLine(t,l,o)},b.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(b.dashLine,l,o)}))},b.dashLine=function(e,t,r){r=+r||0,t=b.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},b.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},b.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(c.fill,t)},b.fillGroupStyle=function(e){e.style("stroke-width",0).each((function(e){var t=n.select(this);e[0].trace&&t.call(c.fill,e[0].trace.fillcolor)}))};var x=e("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(e){var t=x[e],r=t.n;b.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),b.symbolNames[r]=e,b.symbolFuncs[r]=t.f,t.needLine&&(b.symbolNeedLines[r]=!0),t.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(e,t){var r=e%100;return b.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=b.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=_||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=A[i],d=new Array(u),p=0;p"+m(e);h._gradientUrlQueryParts[y]=1},b.pattern=function(e,t,r,i,o,l,s,u,f,d,p,h){var g="legend"===t;u&&("overlay"===f?(d=u,p=c.contrast(d)):(d=void 0,p=u));var v,m,y,b,x,_,w,M,T,k,A,S=r._fullLayout,L="p"+S._uid+"-"+i,C={};switch(o){case"/":v=l*Math.sqrt(2),m=l*Math.sqrt(2),_="path",C={d:y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2,opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"\\":v=l*Math.sqrt(2),m=l*Math.sqrt(2),_="path",C={d:y="M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"x":v=l*Math.sqrt(2),m=l*Math.sqrt(2),y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2+"M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,b=l-l*Math.sqrt(1-s),_="path",C={d:y,opacity:h,stroke:p,"stroke-width":b+"px"};break;case"|":_="path",_="path",C={d:y="M"+(v=l)/2+",0L"+v/2+","+(m=l),opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"-":_="path",_="path",C={d:y="M0,"+(m=l)/2+"L"+(v=l)+","+m/2,opacity:h,stroke:p,"stroke-width":(b=s*l)+"px"};break;case"+":_="path",y="M"+(v=l)/2+",0L"+v/2+","+(m=l)+"M0,"+m/2+"L"+v+","+m/2,b=l-l*Math.sqrt(1-s),_="path",C={d:y,opacity:h,stroke:p,"stroke-width":b+"px"};break;case".":v=l,m=l,s.pattern_filled";S._patternUrlQueryParts[O]=1},b.initGradients=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},b.initPatterns=function(e){var t=e._fullLayout;a.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),t._patternUrlQueryParts={}},b.getPatternAttr=function(e,t,r){return e&&a.isArrayOrTypedArray(e)?t=100,t.attr("d",w(u,s))}var f,d,p,h=!1;if(e.so)p=l.outlierwidth,d=l.outliercolor,f=o.outliercolor;else{var g=(l||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=o.gradient,m=e.mgt;m?h=!0:m=v&&v.type,a.isArrayOrTypedArray(m)&&(m=m[0],A[m]||(m=0));var y=o.pattern,x=y&&b.getPatternAttr(y.shape,e.i,"");if(m&&"none"!==m){var _=e.mgc;_?h=!0:_=v.color;var M=r.uid;h&&(M+="-"+e.i),b.gradient(t,i,M,m,[[0,_],[1,f]],"fill")}else if(x){var T=b.getPatternAttr(y.bgcolor,e.i,null),k=b.getPatternAttr(y.fgcolor,e.i,null),S=y.fgopacity,L=b.getPatternAttr(y.size,e.i,8),C=b.getPatternAttr(y.solidity,e.i,.3),D=e.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),P=r.uid;D&&(P+="-"+e.i),b.pattern(t,"point",i,P,x,L,C,e.mcc,y.fillmode,T,k,S)}else c.fill(t,f);p&&c.stroke(t,d)}},b.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=b.tryColorscale(r,""),t.lineScale=b.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=v.isBubble(e)?m(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,b.makeSelectedPointStyleFns(e)),t},b.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:g*t});var h=i.color,v=o.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?v||t:m||t});var y=i.size,b=o.size,x=l.size,_=void 0!==b,w=void 0!==x;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?b/2:t:w?x/2:t}),t},b.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,g))},t},b.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",w(b.symbolNumber(n),i)),t.mrc2=i})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}b.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=b.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var g=e.tp||t.textposition,v=C(e,t),m=i?i(e):e.tc||t.textfont.color;o.call(b.font,e.tf||t.textfont.family,v,m).text(c).call(d.convertToTspans,r).call(L,g,v,e.mrc)}else o.remove()}))}},b.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=C(e,t);c.fill(a,i),L(a,o,l,e.mrc2||e.mrc)}))}};function D(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(l*l+s*s,.25),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}b.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},R=0),r&&(b.savedBBoxes[r]=v),R++,a.extendFlat({},v)},b.setClipUrl=function(e,t,r){e.attr("clip-path",N(t,r))},b.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},b.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},b.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},b.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var I=/\s*sc.*/;b.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(I,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var z=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(z);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":152,"../../constants/alignment":221,"../../constants/interactions":225,"../../constants/xmlns_namespaces":227,"../../lib":248,"../../lib/svg_text_utils":271,"../../registry":340,"../../traces/scatter/make_bubble_size_func":379,"../../traces/scatter/subtypes":387,"../color":116,"../colorscale":128,"./symbol_defs":139,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:80}],139:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":11}],140:[function(e,t,r){"use strict";t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],141:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":387,"../drawing":138,"@plotly/d3":11,"fast-isnumeric":30}],146:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":116,"@plotly/d3":11}],147:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":240,"../../plots/font_attributes":325,"./layout_attributes":157}],148:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.indexx[0]._length||ie<0||ie>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ae+x[0]._offset,t.pointerY=ie+_[0]._offset,F="xval"in t?m.flat(l,t.xval):m.p2c(x,ae),Y="yval"in t?m.flat(l,t.yval):m.p2c(_,ie),!a(F[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(G=0;G$&&(ee.splice(0,$),ce=ee[0].distance),g&&0!==R&&0===ee.length){K.distance=R,K.index=!1;var f=V._module.hoverPoints(K,X,Q,"closest",{hoverLayer:s._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=R}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(d=de(v),(!re.vLinePoint||re.vLinePoint.spikeDistance>d.spikeDistance)&&(re.vLinePoint=d))}var y=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(d=de(b),(!re.hLinePoint||re.hLinePoint.spikeDistance>d.spikeDistance)&&(re.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Me-1;Ae--)De(ee[Ae]);ee=Se,ve()}var Pe=e._hoverdata,Oe=[],Re=B(e),Ee=H(e);for(U=0;U1||ee.length>1)||"closest"===S&&ne&&ee.length>1,Ze=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),We=O(ee,{gd:e,hovermode:S,rotateLabels:Ve,bgColor:Ze,container:s._hoverlayer,outerContainer:s._paper.node(),commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance});m.isUnifiedHover(S)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?M:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var x=p[o];for(l=x.length-1;l>=0;l--){var _=x[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ve?"xa":"ya",s),E(We,Ve,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Je=v.getComponentMethod("annotations","hasClickToShow")(e,Oe);f(n.select(t.target),Je?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Pe))return;Pe&&e.emit("plotly_unhover",{event:t,points:Pe});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:x,yaxes:_,xvals:F,yvals:Y})}(e,t,r,i)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=O(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),g=e.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,d+=b,h+=b}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function O(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,g=t.outerContainer,w=t.commonLabelOpts||{},M=t.fontFamily||y.HOVERFONT,T=t.fontSize||y.HOVERFONTSIZE,k=e[0],L=k.xa,C=k.ya,P=i.charAt(0),O=k[P+"Label"],E=Y(r,g),N=E.top,I=E.width,z=E.height,F=void 0!==O&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(F){var j,B,H=!0;for(j=0;ja.width-x?(v=a.width-x,t.attr("d","M"+(x-A)+",0L"+x+","+b+A+"v"+b+(2*S+y.height)+"H-"+x+"V"+b+A+"H"+(x-2*A)+"Z")):t.attr("d","M0,0L"+A+","+b+A+"H"+(S+y.width/2)+"v"+b+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+b+A+"H-"+A+"Z")}else{var _,D,P;"right"===C.side?(_="start",D=1,P="",v=L._offset+L._length):(_="end",D=-1,P="-",v=L._offset),m=C._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+P+A+","+A+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+A+"V-"+A+"Z");var R,E=y.height/2,I=N-y.top-E,z="clip"+a._uid+"commonlabel"+C._id;if(v=0?ae:ie+se=0?ie:ve+se=0?re:ne+ce=0?ne:me+ce=0,"top"!==e.idealAlign&&q||!V?q?(E+=B/2,e.anchor="start"):e.anchor="middle":(E-=B/2,e.anchor="end");else if(e.pos=E,q=P+j/2+Z<=I,V=P-j/2-Z>=0,"left"!==e.idealAlign&&q||!V)if(q)P+=j/2,e.anchor="start";else{e.anchor="middle";var W=Z/2,J=P+W-I,X=P-W;J>0&&(P-=J),X<0&&(P+=-X)}else P-=j/2,e.anchor="end";w.attr("text-anchor",e.anchor),L&&k.attr("text-anchor",e.anchor),t.attr("transform",l(P,E)+(c?s(_):""))})),ye}function R(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(P,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function E(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+S),p=f+c*(e.txwidth+S),h=0,g=e.offset,v="middle"===l;v&&(f-=e.tx2width/2,p+=e.txwidth/2+S),t&&(g*=-k,h=e.offset*T),r.select("path").attr("d",v?"M-"+i(e.bx/2+e.tx2width/2)+","+o(g-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+e.ty0-e.by/2+S,b=e.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==l?(a.attr("text-anchor","start"),m=v?-e.bx/2-e.tx2width/2+S:-e.bx-S):"right"===b&&"end"!==l&&(a.attr("text-anchor","end"),m=v?e.bx/2-e.tx2width/2-S:e.bx+S)),a.call(u.positionText,i(m),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*S+h),o(g+e.ty0-e.by/2+S)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(g-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function N(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:g.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:g.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=g.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+g.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=g.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+g.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function I(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,M=a.spikethickness,T=a.spikecolor||_,k=g.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=k,x=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),b=s.l+A*s.w,x=s.l+S*s.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":d.dashStyle(a.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var L,C,D=t.vLinePoint;n=D&&D.xa,a=D&&D.ya,"cursor"===n.spikesnap?(L=c.pointerX,C=c.pointerY):(L=n._offset+D.x,C=a._offset+D.y);var P,O,R=i.readability(D.color,h)<1.5?p.contrast(h):D.color,E=n.spikemode,N=n.spikethickness,I=n.spikecolor||R,z=g.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(P=z,O=C),-1!==E.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),P=s.t+(1-j)*s.h,O=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:P,y2:O,"stroke-width":N,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,N)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:P,y2:O,"stroke-width":N+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:z-("top"!==n.side?N:-N),r:N,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":248,"../../lib/events":239,"../../lib/override_cursor":259,"../../lib/svg_text_utils":271,"../../plots/cartesian/axes":296,"../../registry":340,"../color":116,"../dragelement":135,"../drawing":138,"../legend/defaults":168,"../legend/draw":169,"./constants":150,"./helpers":152,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:80}],154:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":248,"../color":116,"./helpers":152}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":248,"./layout_attributes":157}],156:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":248,"../dragelement":135,"./attributes":147,"./calc":148,"./click":149,"./constants":150,"./defaults":151,"./helpers":152,"./hover":153,"./layout_attributes":157,"./layout_defaults":158,"./layout_global_defaults":159,"@plotly/d3":11}],157:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":325,"./constants":150}],158:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r)}},{"../../lib":248,"./hoverlabel_defaults":154,"./hovermode_defaults":155,"./layout_attributes":157}],159:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":248,"./hoverlabel_defaults":154,"./layout_attributes":157}],160:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===T("pattern")&&(d=!0);v._hasSubplotGrid=d;var b,x,_="top to bottom"===T("roworder"),w=d?.2:.1,M=d?.3:.1;g&&t._splomGridDflt&&(b=t._splomGridDflt.xside,x=t._splomGridDflt.yside),v._domains={x:u("x",T,w,b,y),y:u("y",T,M,x,m,_)}}else delete t.grid}function T(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var b=d.subplots||[];s=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(M("uirevision",t.uirevision),!1!==g){M("bgcolor",t.paper_bgcolor),M("bordercolor"),M("borderwidth");var m,y,b,x=a.coerceFont(M,"font",t.font),_="h"===M("orientation");if(_?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),M("traceorder",d),s.isGrouped(t.legend)&&M("tracegroupgap"),M("itemsizing"),M("itemwidth"),M("itemclick"),M("itemdoubleclick"),M("groupclick"),M("x",m),M("xanchor"),M("y",y),M("yanchor",b),M("valign"),a.noneOrAll(c,v,["x","y"]),M("title.text")){M("title.side",_?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(M,"title.font",w)}}}function M(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":248,"../../plot_api/plot_template":285,"../../plots/layout_attributes":335,"../../registry":340,"./attributes":166,"./helpers":172}],169:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),b=e("./style"),x=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").call(c.font,i).text(d?M(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(k,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(k,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):k(g,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})))}function k(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*g;if(o){var v=c.bBox(o);u=v.height,d=v.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var m=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=h*y,d=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(m,s+p.titlePad,s+h);else{var x=2*p.itemGap+r.itemwidth;a.groupTitle&&(x=p.itemGap,d-=r.itemwidth),f.positionText(m,x,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&y(e.calcdata,t)}var g=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),L=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),C=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));C.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var D=a.ensureSingle(M,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var O=a.ensureSingle(D,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,P.font).text(P.text),k(O,D,e,t,1)}else D.selectAll(".legendtitletext").remove();var R=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),E=D.selectAll("g.groups").data(l);E.enter().append("g").attr("class","groups"),E.exit().remove();var N=E.selectAll("g.traces").data(a.identity);N.enter().append("g").attr("class","traces"),N.exit().remove(),N.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==g.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(w,e,t)})).call(b,e,t).each((function(){h||n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=x.isVertical(a),s=x.isGrouped(a),u=a.borderwidth,f=2*u,d=p.itemGap,h=a.itemwidth+2*d,g=2*(u+d),v=S(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v,b=a.tracegroupgap;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+t/2+d),a._height+=t,a._width=Math.max(a._width,e[0].width)})),_=h+a._width,a._width+=d+h+f,a._height+=g,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var M=A(a),T=a.x<0||0===a.x&&"right"===M,k=a.x>1||1===a.x&&"left"===M,L=y||m,C=i.width/2;a._maxWidth=Math.max(T?L&&"left"===M?o.l+o.w:C:k?L&&"right"===M?o.r+o.w:C:o.w,2*h);var D=0,P=0;r.each((function(e){var t=e[0].width+h;D=Math.max(D,t),P+=t})),_=null;var O=0;if(s){var R=0,E=0,N=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+d+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),R=Math.max(R,t);var r=e+d;r+u+E>a._maxWidth&&(O=Math.max(O,E),E=0,N+=R+b,R=t),c.setTranslate(this,E,N),E+=r})),a._width=Math.max(O,E)+u,a._height=N+R+g}else{var I=r.size(),z=P+f+(I-1)*d=a._maxWidth&&(O=Math.max(O,H),j=0,B+=F,a._height+=F,F=0),c.setTranslate(this,w[0]+u+j,w[1]+u+B+t/2+d),H=j+r+d,j+=n,F=Math.max(F,t)})),z?(a._width=j+f,a._height=F+g):(a._width=Math.max(O,H)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Y=e._context.edits,U=Y.legendText||Y.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=U?h:_||h+e[0].width;l||(a+=d/2),c.setRect(t,0,-r/2,a,r)}))}(e,E,N,t)},function(){if(h||!function(e){var t=e._fullLayout.legend,r=A(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var l,u,g,y,b=f._size,x=t.borderwidth,w=b.l+b.w*t.x-v[A(t)]*t._width,T=b.t+b.h*(1-t.y)-v[S(t)]*t._effHeight;if(!h&&f.margin.autoexpand){var k=w,P=T;w=a.constrain(w,0,f.width-t._width),T=a.constrain(T,0,f.height-t._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==P&&a.log("Constrain legend.y to make legend fit inside graph")}if(h||c.setTranslate(M,w,T),R.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;h&&(O=t._height),C.attr({width:t._width-x,height:O-x,x:x/2,y:x/2}),c.setTranslate(D,0,0),L.select("rect").attr({width:t._width-2*x,height:O-2*x,x:x,y:x}),c.setClipUrl(D,d,e),c.setRect(R,0,0,0,0),delete t._scrollY}else{var E,N,I,z=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-z-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);C.attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-x,x:x/2,y:x/2}),L.select("rect").attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*x,x:x,y:x+H}),c.setClipUrl(D,d,e),G(H,z,B),M.on("wheel",(function(){G(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),z,B),0!==H&&H!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;E="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(N="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,G(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(I,E,N),z,B))}));R.call(Y);var U=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(E=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(N=e.changedTouches[0].clientY,G(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(I,E,N),z,B))}));D.call(U)}if(e._context.edits.legendPosition)M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);g=e.x,y=e.y},moveFn:function(e,r){var n=g+e,a=y+r;c.setTranslate(M,n,a),l=s.align(n,0,b.l,b.l+b.w,t.xanchor),u=s.align(a,0,b.t+b.h,b.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&_(e,M,a,t,n)}})}function G(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(D,0,-r),c.setRect(R,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),L.select("rect").attr("y",x+r)}}],e)}(e,t)}},{"../../constants/alignment":221,"../../lib":248,"../../lib/events":239,"../../lib/svg_text_utils":271,"../../plots/plots":337,"../../registry":340,"../color":116,"../dragelement":135,"../drawing":138,"./constants":167,"./get_legend_data":170,"./handle_click":171,"./helpers":172,"./style":174,"@plotly/d3":11}],170:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function g(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(T=k)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var m=t._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*p.itemGap)/2,_=o(x,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function M(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),g=h.mid;void 0===g&&(g=(h.max+h.min)/2),p=l.tryColorscale(f,"")(g)}var m=p||i.mc||f.color,y=f.pattern,b=y&&l.getPatternAttr(y.shape,0,"");if(b){var x=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=v(y.size,8,10),k=v(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,b,T,k,p,y.fillmode,x,_,M)}else a.call(s.fill,m);o&&s.stroke(a,i.mlc||d.color)}))}function T(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var g=i.minExtend(o,{trace:h});f(c,g,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;u=0===o?p[g?v-1:0][1]:1===o?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,M(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){M(e,this,"funnel")})).each((function(e){M(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){T(e,this,"funnelarea")})).each((function(e){T(e,this,"pie")})).each((function(e){var r,a,o=g(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=e[0],x=y.trace,_=c(x),M=_.colorscale,T=_.reversescale,k=u.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",k+"h"+b+"v6h-"+b+"z").call(s?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+x.uid;l.gradient(e,t,r,h(T),M,"fill")}}),f||d){var L=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:L}}),r=[i.minExtend(y,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",k+(d?"l"+b+",0.0001":"h"+b)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+x.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(T),M,"stroke")}})})).each((function(e){var r,a,o=g(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,v=!d&&!c&&!s&&u.hasText(h);function m(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||v||f){var x={},w={};if(d){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",i.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(p,x)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var T=n.select(this).select("g.legendpoints"),k=T.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=T.selectAll("g.pointtext").data(v?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.stroke(a,i.line.color)}))})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":248,"../../registry":340,"../../traces/pie/helpers":359,"../../traces/pie/style_one":360,"../../traces/scatter/subtypes":387,"../color":116,"../colorscale/helpers":127,"../drawing":138,"./constants":167,"@plotly/d3":11}],175:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":177}],176:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(P=["toggleHover"],O=["resetViews"]):m?(D=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],O=["resetGeo"]):v?(P=["hoverClosest3d"],O=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(D=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],O=["resetViewMapbox"]):x?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:T?(P=["hoverClosestCartesian","hoverCompareCartesian"],O=["resetViewSankey"]):P=["toggleHover"];g&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=z[r+1];else if(e=n.pmax)t=z[r+1];else if(e0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;oy?(T=f,L="y0",k=y,C="y1"):(T=y,L="y1",k=f,C="y0");J(n),K(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===R?X:Q,W.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),$(l),x(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;$(l)}};function J(r){if(m(e))R=null;else if(I)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!z&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),R=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(U(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(G(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else E?F("xanchor",r.xanchor=q(b+n)):(F("x0",r.x0=q(c+n)),F("x1",r.x1=q(v+n))),N?F("yanchor",r.yanchor=V(M+a)):(F("y0",r.y0=V(f+a)),F("y1",r.y1=V(y+a)));t.attr("d",_(e,r)),K(l,r)}function Q(n,a){if(z){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(U(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(G(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else if(I){if("resize-over-start-point"===R){var u=c+n,d=N?f-a:f+a;F("x0",r.x0=E?u:q(u)),F("y0",r.y0=N?d:V(d))}else if("resize-over-end-point"===R){var p=v+n,h=N?y-a:y+a;F("x1",r.x1=E?p:q(p)),F("y1",r.y1=N?h:V(h))}}else{var m=function(e){return-1!==R.indexOf(e)},x=m("n"),B=m("s"),Y=m("w"),Z=m("e"),W=x?T+a:T,J=B?k+a:k,X=Y?A+n:A,Q=Z?S+n:S;N&&(x&&(W=T-a),B&&(J=k-a)),(!N&&J-W>10||N&&W-J>10)&&(F(L,r[L]=N?W:V(W)),F(C,r[C]=N?J:V(J))),Q-X>10&&(F(D,r[D]=E?X:q(X)),F(P,r[P]=E?Q:q(Q)))}t.attr("d",_(e,r)),K(l,r)}function K(e,t){(E||N)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=U(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=G(N?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&N){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),Z.node().onmousemove=J}(e,E,s,t,r,R):!0===s.editable&&E.style("pointer-events",P||c.opacity(S)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void M(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=M,v(e)}}(e,E)}))}}function x(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getRefType(t.xref),v=i.getRefType(t.yref),m=i.getFromId(e,t.xref),y=i.getFromId(e,t.yref),b=e._fullLayout._size;if(m?"domain"===p?n=function(e){return m._offset+m._length*e}:(r=g.shapePositionToRange(m),n=function(e){return m._offset+m.r2p(r(e,!0))}):n=function(e){return b.l+b.w*e},y?"domain"===v?l=function(e){return y._offset+y._length*(1-e)}:(o=g.shapePositionToRange(y),l=function(e){return y._offset+y.r2p(o(e,!0))}):l=function(e){return b.t+b.h*(1-e)},"path"===d)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(l=g.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var x=n(t.xanchor);s=x+t.x0,c=x+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,f=_-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var w=(s+c)/2,M=(u+f)/2,T=Math.abs(w-s),k=Math.abs(M-u),A="A"+T+","+k,S=w+T+","+M;return"M"+S+A+" 0 1,1 "+(w+","+(M-k))+A+" 0 0,1 "+S+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function M(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:b,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t=0&&f(m),r.attr("d",g(t)),k&&!d)&&(T=function(e,t){for(var r=0;r1&&(2!==e.length||"Z"!==e[1][0])&&(0===M&&(e[0][0]="M"),t[w]=e,y(),b())}}()}}function O(e,r){!function(e,r){if(t.length)for(var n=0;n0&&s0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function L(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,v(t))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,m);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[x.side];t.attr("transform",s(m[0],m[1]))}}}return N.call(I),R&&(L?N.on(".opacity",null):(k=0,A=!0,N.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),N.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==b?o.call("_guiRestyle",e,m,t,b):o.call("_guiRelayout",e,m,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),N.classed("js-placeholder",A),M}}},{"../../constants/alignment":221,"../../constants/interactions":225,"../../lib":248,"../../lib/svg_text_utils":271,"../../plots/plots":337,"../../registry":340,"../color":116,"../drawing":138,"@plotly/d3":11,"fast-isnumeric":30}],215:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("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:c,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:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":240,"../../plot_api/edit_types":278,"../../plot_api/plot_template":285,"../../plots/font_attributes":325,"../../plots/pad_attributes":336,"../color/attributes":115}],216:[function(e,t,r){"use strict";t.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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],217:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":248,"../../plots/array_container_defaults":291,"./attributes":215,"./constants":216}],218:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,x),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(M,o),u.call(_,o)}))})),u.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,S=h,L=v+m;L+A>c&&(L=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:S,y:L,width:k,height:A}),this._hbarXMin=S+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=m>M,P=l.barWidth+2*l.barPad,O=l.barLength+2*l.barPad,R=h+g,E=v;R+P>s&&(R=s-P);var N=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),D?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:R,y:E,width:P,height:O}),this._vbarYMin=E+O/2,this._vbarTranslateMax=M-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,z=u-.5,F=D?f+P+.5:f+.5,j=d-.5,B=T?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(T||D?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),T||D?(this._clipRect=H.select("rect").attr({x:Math.floor(z),y:Math.floor(j),width:Math.ceil(F)-Math.floor(z),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||D){var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(U),D&&this.vbar.on(".drag",null).call(U)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":248,"../color":116,"../drawing":138,"@plotly/d3":11}],221:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],222:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],223:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],224:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],225:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],226:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],227:[function(e,t,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}},{}],228:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;lplotly-logomark"}}},{}],230:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],231:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":255}],232:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),M=e.match(w?b:y);if(!M)return u;var T=M[1],k=M[3]||"1",A=Number(M[5]||1),S=Number(M[7]||0),L=Number(M[9]||0),C=Number(M[11]||0);if(c){if(2===T.length)return u;var D;T=Number(T);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var O="i"===k.charAt(k.length-1);k=parseInt(k,10),D=P.newDate(T,P.toMonthIndex(T,k,O),A)}else D=P.newDate(T,Number(k),A)}catch(e){return u}return D?(D.toJD()-g)*f+S*d+L*p+C*h:u}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),k-=1;var R=new Date(Date.UTC(2e3,k,A,S,L));return R.setUTCFullYear(T),R.getUTCMonth()!==k||R.getUTCDate()!==A?u:R.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var M=90*f,T=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,b,x=Math.floor(10*s(e+.05,1)),w=Math.round(e-x/10);if(_(r)){var S=Math.floor(w/f)+g,L=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var S=/%\d?f/g,L=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function D(e,t,r,n){e=e.replace(S,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(L,(function(){return C[r("%q")(a)]})),_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),P[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+D(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return D(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":255}],246:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],247:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],248:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var g=e("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=e("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=e("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=e("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=e("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=e("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=e("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var S=e("./dom");function L(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var E=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return E.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var N={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(N,arguments)};var I={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(I,arguments)};var z=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,g="xother_"===l||"yother_"===l,v="xother"===l||"yother"===l||p||g||h,m=l;if((p||h)&&(m=m.substring(1)),(g||h)&&(m=m.substring(0,m.length-1)),v){if(void 0===(c=t[m]))return""}else for(d=3;d=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":226,"./anchor_utils":230,"./angles":231,"./array":232,"./clean_number":233,"./clear_responsive":235,"./coerce":236,"./dates":237,"./dom":238,"./extend":240,"./filter_unique":241,"./filter_visible":242,"./geometry2d":245,"./identity":246,"./increment":247,"./is_plain_object":249,"./keyed_container":250,"./localize":251,"./loggers":252,"./make_trace_groups":253,"./matrix":254,"./mod":255,"./nested_property":256,"./noop":257,"./notifier":258,"./preserve_drawing_buffer":261,"./push_unique":262,"./regex":264,"./relative_attr":265,"./relink_private":266,"./search":267,"./sort_object_keys":269,"./stats":270,"./throttle":272,"./to_log_range":273,"@plotly/d3":11,"d3-format":24,"d3-time-format":27,"fast-isnumeric":30}],249:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],250:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":283,"./notifier":258}],253:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],254:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],256:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":226,"./matrix":254}],261:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":30,"is-mobile":64}],262:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":232,"fast-isnumeric":30}],271:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,g){var A=e.text(),S=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),D=n.select(e.node().parentNode);if(!D.empty()){var P=e.attr("class")?e.attr("class").split(" ")[0]:"text";return P+="-math",D.selectAll("svg."+P).remove(),D.selectAll("g."+P+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(s.node())}),(function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,a,o){D.selectAll("svg."+P).remove(),D.selectAll("g."+P+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return O(),void t();var c=D.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.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 u=e.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+e.attr("x")-d*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],v=-(r||s(e,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-d/2,v-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===P[0]?l.attr({x:e.attr("x"),y:v-p/2}):"a"===P[0]&&0!==P.indexOf("atitle")?l.attr({x:0,y:v}):l.attr({x:h,y:+e.attr("y")+v-p/2}),g&&g.call(e,c),t(c)}))}))):O(),e}function O(){D.empty()||(P=e.attr("class")+"-math",D.select("svg."+P).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}b.test(t)?u():(r=e,s=[{node:e}]);for(var S=t.split(m),D=0;D|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(m),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(S,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function C(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?t:""}function D(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(v," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(m),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],273:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":30}],274:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":327,"topojson-client":81}],275:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],276:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],277:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=x(t);r;){if(r in e)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var b,x,_,w,M,T,k,A,S=Object.keys(r).map(Number).sort(o),L=t.get(),C=L||[],D=u(m,f).get(),P=[],O=-1,R=C.length;for(b=0;bC.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?P.push(_):k?("add"===T&&(T={}),C.splice(_,0,T),D&&D.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===O&&(O=_);else for(x=0;x=0;b--)C.splice(P[b],1),D&&D.splice(P[b],1);if(C.length?L||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===O)E=S;else{for(R=Math.max(C.length,R),E=[],b=0;b=O);b++)E.push(_);for(b=O;b=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),P(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in P(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&U(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,l.range&&(s.range=l.range.slice()),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function U(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=p.getFromId(e,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(e,r,{skipTitle:n})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var G=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,V=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=z(s._preGUI,c),h=Object.keys(t),g=p.list(e),v=o.extendDeepAll({},t),m={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof R.parts[N];)N--;var F=R.parts[N],j=R.parts[N-1]+"."+F,H=R.parts.slice(0,N).join("."),Y=l(e.layout,H).get(),U=l(s,H).get(),Z=R.get();if(void 0!==E){A[O]=E,S[O]="reverse"===F?E:I(Z);var J=f.getLayoutValObject(s,R.parts);if(J&&J.impliedEdits&&null!==E)for(var X in J.impliedEdits)L(o.relativeAttr(O,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(O))if(E){L("autosize",null);var Q="height"===O?"width":"height";L(Q,s[Q])}else s[O]=e._initialAutoSize[O];else if("autosize"===O)L("width",E?null:s.width),L("height",E?null:s.height);else if(j.match(G))P(j),l(s,H+"._inputRange").set(null);else if(j.match(q)){P(j),l(s,H+"._inputRange").set(null);var K=l(s,H).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else j.match(V)&&l(s,H+"._inputDomain").set(null);if("type"===F){C=Y;var $="linear"===U.type&&"log"===E,ee="log"===U.type&&"linear"===E;if($||ee){if(C&&C.range)if(U.autorange)$&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var te=C.range[0],re=C.range[1];$?(te<=0&&re<=0&&L(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),L(H+".range[0]",Math.log(te)/Math.LN10),L(H+".range[1]",Math.log(re)/Math.LN10)):(L(H+".range[0]",Math.pow(10,te)),L(H+".range[1]",Math.pow(10,re)))}else L(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete s[R.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,U,E,L),u.getComponentMethod("images","convertCoords")(e,U,E,L)}else L(H+".autorange",!0),L(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(T)){var ne=l(s,O).get(),ae=(E||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,L),u.getComponentMethod("images","convertCoords")(e,ne,ae,L)}var ie=x.containerArrayMatch(O);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(x.isAddVal(E)?S[O]=null:x.isRemoveVal(E)?S[O]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(k,le),m[r]||(m[r]={});var se=m[r][n];se||(se=m[r][n]={}),se[oe]=E,delete t[O]}else"reverse"===F?(Y.range?Y.range.reverse():(L(H+".autorange",!0),Y.range=[1,0]),U.autorange?k.calc=!0:k.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===O&&("lasso"===E||"select"===E)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:J?M.update(k,J):k.calc=!0,R.set(E))}}for(r in m){x.applyContainerArrayChanges(e,d(i,r),m[r],k,d)||(k.plot=!0)}for(var ce in D){var ue=(C=p.getFromId(e,ce))&&C._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)D[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:D,undoit:S,redoit:A,eventData:v}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),Y(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&U(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],b=null==t,x=Array.isArray(t);if(!b&&!x&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(b||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&TT)&&k.push(g);y=k}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function b(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,t,l)},r.getLayoutValObject=function(e,t){return m(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":248,"../plots/attributes":292}],286:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function b(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,b=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function M(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-b-n:t._offset+t._length+b+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+b+n:t._offset-b-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var T=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=M(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?M(u,T,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],S=[],L=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,D=l.yaxis.domain,P=l.plotgroup;if(y(C,D,S)){var O=P.node(),R=l.bg=o.ensureSingle(P,"rect","bg");O.insertBefore(R.node(),O.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),S.push([C,D]),L||(k.push(a),A.push(a))}var E,N,I,z,F,j,B,H,Y,U,G,q,V,Z=v._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tM?u.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":248,"../plots/attributes":292,"../plots/plots":337,"./plot_config":283,"./plot_schema":284,"./plot_template":285}],288:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var k=o.extendFlat({},d);b?k.width=b:null===t.width&&n(h.width)&&(k.width=h.width),x?k.height=x:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=l.getRedrawFunc(T);function L(){return new Promise((function(e){setTimeout(e,l.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(M?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(M?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(T,r,k,A).then(S).then(L).then(C).then((function(t){e(function(e){return M?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":248,"../plots/plots":337,"../snapshot/helpers":344,"../snapshot/svgtoimg":346,"../snapshot/tosvg":348,"../version":405,"./plot_api":282,"fast-isnumeric":30}],289:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;db.length&&a.push(h("unused",i,m.concat(b.length)));var k,A,S,L,C,D=b.length,P=Array.isArray(T);if(P&&(D=Math.min(D,T.length)),2===x.dimensions)for(A=0;Ab[A].length&&a.push(h("unused",i,m.concat(A,b[A].length)));var O=b[A].length;for(k=0;k<(P?Math.min(O,T[A].length):O);k++)S=P?T[A][k]:T,L=y[A][k],C=b[A][k],n.validate(L,S)?C!==L&&C!==+L&&a.push(h("dynamic",i,m.concat(A,k),L,C)):a.push(h("value",i,m.concat(A,k),L))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,g=e[r+"period0"],v=i(g,d)||0,m=[],y=[],b=[],x=a.length,_=0;_k;)T=o(T,-c,d);for(;T<=k;)T=o(T,c,d);M=o(T,-c,d)}else{for(T=v+(w=Math.round((k-v)/u))*u;T>k;)T-=u;for(;T<=k;)T+=u;M=T-u}m[_]=p?M:h?T:(M+T)/2,y[_]=M,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":226,"../../lib":248,"fast-isnumeric":30}],294:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],295:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=g(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,v=f[0].val;for(r=1;r0&&((M=L-l(b)-s(x))>C?T/M>D&&(_=b,w=x,D=T/M):T/L>D&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},D=T/L));if(d===v){var P=d-1,O=d+1;if(A)if(0===d)a=[0,1];else{var R=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),E=d/(1-Math.min(.5,R/L));a=d>0?[0,E]:[E,0]}else a=S?[Math.max(0,P),Math.max(1,O)]:[P,O]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-D*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),D=(w.val-_.val-p(t,b.val,x.val))/(L-l(_)-s(w)),a=[_.val-D*l(_),w.val+D*s(w)];return m&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!M){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=O;n--)P(n);return{min:h,max:g,opts:r}},concatExtremes:g};function g(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function b(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":138,"../../constants/numerical":226,"../../lib":248,"../../registry":340,"./axis_ids":300,"@plotly/d3":11,"fast-isnumeric":30}],296:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),g=e("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,M=g.ONEAVGMONTH,T=g.ONEMINMONTH,k=g.ONEWEEK,A=g.ONEDAY,S=A/2,L=g.ONEHOUR,C=g.ONEMIN,D=g.ONESEC,P=g.MINUS_SIGN,O=g.BADNUM,R={K:"zeroline"},E={K:"gridline",L:"path"},N={K:"tick",L:"path"},I={K:"tick",L:"text"},z=e("../../constants/alignment"),F=z.MID_SHIFT,j=z.CAP_SHIFT,B=z.LINE_SPACING,H=z.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=e("./set_convert");var U=e("./axis_autotype"),G=e("./axis_ids"),q=G.idSort,V=G.isLinked;Y.id2name=G.id2name,Y.name2id=G.name2id,Y.cleanId=G.cleanId,Y.list=G.list,Y.listIds=G.listIds,Y.getFromId=G.getFromId,Y.getFromTrace=G.getFromTrace;var Z=e("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function W(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}Y.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},Y.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},Y.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==Y.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=Y.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},Y.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:Y.getFromId(t,r).cleanPos)(e)},Y.redrawComponents=function(e,t){t=t||Y.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*A:e-=S;var s=Y.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,m,c,i)),v=y,0;v<=u;)v=Y.tickIncrement(v,m,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(v,0,i),size:m,_dataSpan:u-c}},Y.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=Y.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=L,o&&!n&&e.dticki&&f=o:p<=o;p=Y.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p=u)break}if(C.length>g||p===D)break;D=p;var P=!1;f&&p!==(0|p)&&(P=!0),C.push({minor:P,value:p})}if(d&&function(e,t,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===x&&f>=_?d=u>=_&&u<=b?u:x:f>=T?d=u>=T&&u<=w?u:M:r===k&&f>=k?d=k:f>=A?d=A:r===S&&f>=S?d=S:r===L&&f>=L&&(d=L),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var C=(g+.5)/84;t.maskBreaks(a*(1-C)+C*p)!==O&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(C,e,e._definedDelta),e.rangebreaks){var R="y"===e._id.charAt(0),E=1;"auto"===e.tickmode&&(E=e.tickfont?e.tickfont.size:12);var N=NaN;for(h=C.length-1;h>-1;h--)if(C[h].drop)C.splice(h,1);else{C[h].value=Ae(C[h].value,e);var I=e.c2p(C[h].value);(R?N>I-E:Nu||Fu&&(z.periodX=u),F10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=C&&i<=16||t>=L)e._tickround="M";else if(t>=D&&i<=19||t>=C)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ue(e.exponentformat)&&!fe(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function se(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}Y.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var i=2*t;if(i>m)t/=m,r=n(10),e.dtick="M"+12*oe(t,r,$);else if(i>M)t/=M,e.dtick="M"+oe(t,1,ee);else if(i>A){e.dtick=oe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:re);var o=Y.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>L?e.dtick=oe(t,L,ee):i>C?e.dtick=oe(t,C,te):i>D?e.dtick=oe(t,D,te):(r=n(10),e.dtick=oe(t,r,$))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+oe(t,r,$)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ke(e)?(e.tick0=0,r=1,e.dtick=oe(t,r,ie)):(e.tick0=0,r=n(10),e.dtick=oe(t,r,$));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},Y.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ae:ne,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=de(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ue(p)&&fe(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":P)+d:(t.text=de(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ke(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=de(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=de(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=P+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=de(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},Y.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return Y.hoverLabelText(e,n,r)+" - "+Y.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=Y.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":P+o:o};var ce=["f","p","n","\u03bc","m","","k","M","G","T"];function ue(e){return"SI"===e||"B"===e}function fe(e){return e>14||e<-15}function de(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=Y.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};le(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,P);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ue(s)&&(e+=ce[c/3+5]));return i?P+e:e}function pe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var b=t._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=ve(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}Q&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,be(t),n),i.autoMargin(e,xe(t),a),i.autoMargin(e,_e(t),l)})),r.skipTitle||Q&&"bottom"===t.side||J.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+ve(t);else{var l=Se(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,g=Y.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?g-r:g+r):(p=t._offset+t._length/2,f="right"===t.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(h={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(J)}}function K(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ye(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},Y.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*j,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-j));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(he(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(he(t)))}},Y.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,g=d?e.ticklen:0;if(f?g*=-1:u&&(g=0),d&&(p+=g,r)){var v=l.deg2rad(r);p=g*Math.cos(v)+1,h=g*Math.sin(v)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var m,y,b,x,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},M=0,T=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=h*x,y=t+p*x,b=_?1:-.2,90===Math.abs(A)&&(f?b+=F:b=-90===A&&"bottom"===T?j:90===A&&"top"===T?F:.5,M=F/2*(A/90)),w.xFn=function(e){return e.dx+m+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*b},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*x<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=p,y=h*x,b=0,f||90!==Math.abs(A)||(b=-90===A&&"left"===T||90===A&&"right"===T?j:.5),f){var S=a(A)?+A:0;if(0!==S){var L=l.deg2rad(S);M=Math.abs(Math.sin(L))*j*x,b=0}}w.xFn=function(e){return e.dx+t-(m+e.fontSize*b)*x+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*F},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Y.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],ge);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,t.tickcolor).style("stroke-width",d.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path).style("display",null),Le(t,[N]),i.attr("transform",r.transFn)},Y.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&Y.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;lp||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;t._selections&&(t._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),p.length&&"x"===u&&!a(g)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(m.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ye(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var v="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,v)?"category":function(e,t){for(var r=e.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":340,"./constants":303}],301:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function v(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*b)||M)for(r=0;rR&&zP&&(P=z);d/=(P-D)/(2*O),D=s.l2r(D),P=s.l2r(P),s.range=s._input.range=S=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function U(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function G(e){O&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,P)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function V(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(U(a),2!==e||me||Ge(),ve)o.indexOf("select")>-1&&S(r,a,X,Q,t.id,Pe),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&me){var l=g?R:O,c="s"===g||"w"===m?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",v="middle";if(l.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===l.side&&(h="right")):"e"===m&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(xe).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:v}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Ee(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Se="",Me.r=Me.l,Me.t=Me.b,Ce.attr("d","M0,0Z")}if(Me.l=Math.min(_e,n),Me.r=Math.max(_e,n),Me.t=Math.min(we,a),Me.b=Math.max(we,a),re.isSubplotConstrained)i>P||o>P?(Se="xy",i/ee>o/te?(o=i*te/ee,we>a?Me.t=we-o:Me.b=we+o):(i=o*ee/te,_e>n?Me.l=_e-i:Me.r=_e+i),Ce.attr("d",q(Me))):l();else if(ne.isSubplotConstrained)if(i>P||o>P){Se="xy";var s=Math.min(Me.l/ee,(te-Me.b)/te),c=Math.max(Me.r/ee,(te-Me.t)/te);Me.l=s*ee,Me.r=c*ee,Me.b=(1-s)*te,Me.t=(1-c)*te,Ce.attr("d",q(Me))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;ug[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":248,"fast-isnumeric":30}],315:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":221}],316:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),b=e("../../lib/polygon"),x=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),M=e("../../plot_api/subroutines").redrawReglTraces,T=e("./constants"),k=T.MINSELECT,A=b.filter,S=b.tester,L=e("./handle_outline").clearSelect,C=e("./helpers"),D=C.p2r,P=C.axValue,O=C.getTransform;function R(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,b=t._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){z(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function j(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function H(e,t,r){var n,i,o,l;for(n=0;n=0)C._fullLayout._deactivateShape(C);else if(!_){var r=E.clickmode;x.done(ge).then((function(){if(x.clear(ge),2===e){for(fe.remove(),$=0;$-1&&R(t,C,a.xaxes,a.yaxes,a.subplot,a,fe),"event"===r&&C.emit("plotly_selected",void 0);l.click(C,t)})).catch(y.error)}},a.doneFn=function(){he.remove(),x.done(ge).then((function(){x.clear(ge),a.gd.emit("plotly_selected",te),K&&a.selectionDefs&&(K.subtract=ue,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(ve)})).catch(y.error),_&&F(a)}},clearSelect:L,clearSelectionsCache:F,selectOnClick:R}},{"../../components/color":116,"../../components/dragelement/helpers":134,"../../components/drawing":138,"../../components/fx":156,"../../components/fx/helpers":152,"../../components/shapes/draw_newshape/display_outlines":204,"../../components/shapes/draw_newshape/helpers":205,"../../components/shapes/draw_newshape/newshapes":206,"../../lib":248,"../../lib/clear_gl_canvases":234,"../../lib/polygon":260,"../../lib/throttle":272,"../../plot_api/subroutines":286,"../../registry":340,"./axis_ids":300,"./constants":303,"./handle_outline":307,"./helpers":308,polybooljs:70}],317:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,g=p.BADNUM,v=p.LOG_CLIP,m=p.ONEWEEK,y=p.ONEDAY,b=p.ONEHOUR,x=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),M=e("./constants"),T=M.HOUR_PATTERN,k=M.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function S(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function L(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function C(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===g){if(!l(t))return g;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function D(t,r,n){return c(t,r,n||e.calendar)}function P(t){return e._categories[Math.round(t)]}function O(t){if(S(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return g}function R(t){if(e._categoriesMap)return e._categoriesMap[t]}function E(e){var t=R(e);return void 0!==t?t:l(e)?+e:void 0}function N(e){return l(e)?+e:R(e)}function I(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var F=function(t){return l(t)?I(t,e._m,e._b):g},j=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return g;var r=e._rangebreaks.length;if(!r)return I(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?I(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?L:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(L(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return L(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=L,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=C,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,n){return e.l2p(C(t,0,n))},e.p2d=e.p2r=function(e,t,r){return D(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,g,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=O,e.r2d=e.c2d=e.l2d=P,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return P(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=P,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=E(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=R,e.l2r=e.c2r=f,e.r2l=E,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return P(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),b=i.simpleMap(t.yr1,s.r2l),x=y[1]-y[0],_=b[1]-b[0];p[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/x),s.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*b[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,M=d?u/p[3]:1,T=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,S=d?p[1]/p[3]*u:0,L=a._offset-A,C=s._offset-S;n.clipRect.call(o.setTranslate,T,k).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,L,C).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}l.redrawComponents(e)}},{"../../components/drawing":138,"../../lib":248,"../../registry":340,"./axes":296,"@plotly/d3":11}],322:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(d.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new A(e)},S.plot=function(e,t,r){var n=this,a=t[this.id],i=[],o=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){o=!0;break}for(var s=0;s0&&i._module.calcGeoJSON(a,t)}if(!this.updateProjection(e,t)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(t,r),this.updateDims(t,r),this.updateFx(t,r),h.generalUpdatePerTraceModule(this.graphDiv,this,e,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this.render()}},S.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],s=t._size,u=n.domain,f=n.projection,d=n.lonaxis,p=n.lataxis,h=d._ax,g=p._ax,m=this.projection=function(e){var t=e.projection,r=t.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var s=(a[n]||l[n])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],d=function(e){return e?s:[]},p=0;pu*Math.PI/180}return!1},s.getPath=function(){return i().projection(s)},s.getBounds=function(e){return s.getPath().bounds(e)},s.precision(w.precision),e._isSatellite&&s.tilt(t.tilt).distance(t.distance);u&&s.clipAngle(u-w.clipPad);return s}(n),y=[[s.l+s.w*u.x[0],s.t+s.h*(1-u.y[1])],[s.l+s.w*u.x[1],s.t+s.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=d.range||[],M=p.range||[];if(n.fitbounds){h._length=y[1][0]-y[0][0],g._length=y[1][1]-y[0][1],h.range=v(r,h),g.range=v(r,g);var T=(h.range[0]+h.range[1])/2,k=(g.range[0]+g.range[1])/2;if(n._isScoped)b={lon:T,lat:k};else if(n._isClipped){b={lon:T,lat:k},x={lon:T,lat:k,roll:x.roll};var A=f.type,S=w.lonaxisSpan[A]/2||180,C=w.lataxisSpan[A]/2||90;_=[T-S,T+S],M=[k-C,k+C]}else b={lon:T,lat:k},x={lon:T,lat:x.lat,roll:x.roll}}m.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var D=L(_,M);m.fitExtent(y,D);var P=this.bounds=m.getBounds(D),O=this.fitScale=m.scale(),R=m.translate();if(n.fitbounds){var E=m.getBounds(L(h.range,g.range)),N=Math.min((P[1][0]-P[0][0])/(E[1][0]-E[0][0]),(P[1][1]-P[0][1])/(E[1][1]-E[0][1]));isFinite(N)?m.scale(N*O):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else m.scale(f.scale*O);var I=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(m.translate([R[0]+(I[0]-R[0]),R[1]+(I[1]-R[1])]).clipExtent(P),n._isAlbersUsa){var z=m([b.lon,b.lat]),F=m.translate();m.translate([F[0]-(z[0]-F[0]),F[1]-(z[1]-F[1])])}},S.updateBaseLayers=function(e,t){var r=this,a=r.topojson,i=r.layers,o=r.basePaths;function l(e){return"lonaxis"===e||"lataxis"===e}function s(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return s(e)||c(e)?t["show"+e]:!l(e)||t[e].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(e){delete i[e],delete o[e],n.select(this).remove()})),p.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=i[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):l(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):s(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],i=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):s(r)||c(r)?n.datum(k(a,a.objects[r])):l(r)&&n.datum(function(e,t,r){var n,a,i,o=t[e],l=w.scopeDefaults[t.scope];"lonaxis"===e?(n=l.lonaxisRange,a=l.lataxisRange,i=function(e,t){return[e,t]}):"lataxis"===e&&(n=l.lataxisRange,a=l.lonaxisRange,i=function(e,t){return[t,e]});var s={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};g.setConvert(s,r);var c=g.calcTicks(s);t.isScoped||"lonaxis"!==e||c.pop();for(var u=c.length,f=new Array(u),d=0;d-1&&x(n.event,a,[r.xaxis],[r.yaxis],r.id,f),l.indexOf("event")>-1&&p.click(a,n.event))}))}function d(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},S.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(d.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},g.setConvert(e.mockAxis,r)},S.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},c.extendFlat(this.viewInitial,t)},S.render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?u(r[0],r[1]):null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":116,"../../components/dragelement":135,"../../components/drawing":138,"../../components/fx":156,"../../lib":248,"../../lib/geo_location_utils":243,"../../lib/topojson_utils":274,"../../registry":340,"../cartesian/autorange":295,"../cartesian/axes":296,"../cartesian/select":316,"../plots":337,"./constants":327,"./zoom":332,"@plotly/d3":11,"d3-geo":26,"d3-geo-projection":25,"topojson-client":81}],329:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,l=0;l0&&P<0&&(P+=360);var O,R,E,N=(D+P)/2;if(!p){var I=h?f.projRotate:[N,0,0];O=r("projection.rotation.lon",I[0]),r("projection.rotation.lat",I[1]),r("projection.rotation.roll",I[2]),r("showcoastlines",!h&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}(p?(R=-96.6,E=38.7):(R=h?N:O,E=(C[0]+C[1])/2),r("center.lon",R),r("center.lat",E),g&&(r("projection.tilt"),r("projection.distance")),v)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),h||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):m?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":248,"../get_data":333,"../subplot_defaults":338,"./constants":327,"./layout_attributes":330}],332:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(s)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render();var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t);function m(e){return t.invert(e)}function y(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",(function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=m(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?m(d)&&(h=m(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=m(r=d),g=!0,e.render();var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(e,t,y)})),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,v=(Math.atan2(d,u)-Math.atan2(c,a))*l,m=(Math.atan2(d,u)-Math.atan2(c,-a))*l;return x(r[0],r[1],i,v)<=x(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function x(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function M(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*l,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*l,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*l]}function T(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){x.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},x.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&E.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&E.length>15&&0===s.shapes.length&&0===s.images.length,x.linkSubplots(d,s,f,n),x.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||B;H&&!Y?n._bgLayer.remove():Y&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=x.layoutAttributes.width.min,p=x.layoutAttributes.height.min;n1,g=!t.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[t]={l:{val:m,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:b,size:r.t+h}},p[t]=1}else delete d[t],delete p[t];if(!n._replotting)return x.doAutoMargin(e)}},x.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,g=t._pushmargin,v=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,M=b.size,T=_.val,k=_.size;for(var A in g){if(o(M)&&g[A].r){var S=g[A].r.val,L=g[A].r.size;if(S>w){var C=(M*S+(L-r)*w)/(S-w),P=(L*(1-w)+(M-r)*(1-S))/(S-w);C+P>c+f&&(c=C,f=P)}}if(o(k)&&g[A].t){var O=g[A].t.val,R=g[A].t.size;if(O>T){var E=(k*O+(R-n)*T)/(O-T),N=(R*(1-T)+(k-n)*(1-O))/(O-T);E+N>h+d&&(h=E,d=N)}}}}}var I=u.constrain(r-i.l-i.r,2,64),z=u.constrain(n-i.t-i.b,2,64),F=Math.max(0,r-I),j=Math.max(0,n-z);if(F){var B=(c+f)/F;B>1&&(c/=B,f/=B)}if(j){var H=(h+d)/j;H>1&&(h/=H,d/=H)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(v).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}x.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},x.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(E(o,c,f),a=0;a0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(M),M=(M=M.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(M=(M=(M=M.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),M}},{"../components/color":116,"../components/drawing":138,"../constants/xmlns_namespaces":227,"../lib":248,"@plotly/d3":11}],349:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":115,"../../components/colorscale/attributes":123,"../../lib/extend":240,"../../plots/attributes":292,"../../plots/template_attributes":339,"../scattergeo/attributes":390}],350:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o),[e]}},{"../../lib":248,"../../plots/cartesian/axes":296,"./attributes":349}],354:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":329,"../heatmap/colorbar":358,"./attributes":349,"./calc":350,"./defaults":351,"./event_data":352,"./hover":353,"./plot":355,"./select":356,"./style":357}],355:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;ps&&D[m].gap;)m--;for(b=D[m].s,g=D.length-1;g>m;g--)D[g].s=b;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],369:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),g=e("./fillcolor_defaults");t.exports=function(e,t,r,v){function m(r,a){return n.coerce(e,t,i,r,a)}var y=s(e,t,v,m);if(y||(t.visible=!1),t.visible){c(e,t,v,m),m("xhoverformat"),m("yhoverformat");var b=u(e,t,v,m),x=!b&&y=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&g<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-g);return iZ!=(j=E[O][1])>=Z&&(I=E[O-1][0],z=E[O][0],j-F&&(N=I+(z-I)*(Z-F)/(j-F),U=Math.min(U,N),G=Math.max(G,N)));U=Math.max(U,0),G=Math.min(G,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:U,x1:G,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":116,"../../components/fx":156,"../../lib":248,"../../registry":340,"./get_trace_color":372}],374:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":310,"./arrays_to_calcdata":361,"./attributes":362,"./calc":363,"./cross_trace_calc":367,"./cross_trace_defaults":368,"./defaults":369,"./format_labels":371,"./hover":373,"./marker_colorbar":380,"./plot":383,"./select":384,"./style":386,"./subtypes":387}],375:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":126,"../../components/colorscale/helpers":127,"../../lib":248}],376:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,b,x,_,w,M,T,k,A,S=t.xaxis,L=t.yaxis,C="log"===S.type,D="log"===L.type,P=S._length,O=L._length,R=t.connectGaps,E=t.baseTolerance,N=t.shape,I="linear"===N,z=t.fill&&"none"!==t.fill,F=[],j=f.minTolerance,B=e.length,H=new Array(B),Y=0;function U(r){var n=e[r];if(!n)return!1;var i=t.linearized?S.l2p(n.x):S.c2p(n.x),s=t.linearized?L.l2p(n.y):L.c2p(n.y);if(i===a){if(C&&(i=S.c2p(n.x,!0)),i===a)return!1;D&&s===a&&(i*=Math.abs(S._m*O*(S._m>0?o:l)/(L._m*P*(L._m>0?o:l)))),i*=1e3}if(s===a){if(D&&(s=L.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function G(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&cre||e[1]ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[Y-1][0],a=r===H[Y-1][1];if(!n||!a)if(Y>1){var i=t===H[Y-2][0],o=r===H[Y-2][1];n&&(t===te||t===re)&&i?o?Y--:H[Y-1]=e:a&&(r===ne||r===ae)&&o?i?Y--:H[Y-1]=e:H[Y++]=e}else H[Y++]=e}function ue(e){H[Y-1][0]!==e[0]&&H[Y-1][1]!==e[1]&&ce([J,X]),ce(e),Q=null,J=X=0}function fe(e){if(k=e[0]/P,A=e[1]/O,Z=e[0]re?re:0,W=e[1]ae?ae:0,Z||W){if(Y)if(Q){var t=$(Q,e);t.length>1&&(ue(t[0]),H[Y++]=t[1])}else K=$(H[Y-1],e)[0],H[Y++]=K;else H[Y++]=[Z||e[0],W||e[1]];var r=H[Y-1];Z&&W&&(r[0]!==Z||r[1]!==W)?(Q&&(J!==Z&&X!==W?ce(J&&X?(n=Q,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[J||Z,X||W]):J&&X&&ce([J,X])),ce([Z,W])):J-Z&&X-W&&ce([Z||J,W||X]),Q=e,J=Z,X=W}else Q&&ue($(Q,e)[0]),H[Y++]=e;var n,a,i,o}for("linear"===N||"spline"===N?$=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&V(o,e)q(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,d=h,g=!1):_=e.length||!h)break;fe(h),n=h}}else fe(d)}Q&&ce([J||Q[0],X||Q[1]]),F.push(H.slice(0,Y))}return F}},{"../../constants/numerical":226,"../../lib":248,"./constants":366}],377:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],378:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":30}],380:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],381:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":116,"../../components/colorscale/defaults":126,"../../components/colorscale/helpers":127,"./subtypes":387}],382:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":226,"../../lib":248}],383:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(h),T=o(M,"g","errorbars"),k=o(M,"g","lines"),A=o(M,"g","points"),S=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(e,T,r,g),!0===_.visible){var L,C;y(M).style("opacity",_.opacity);var D=_.fill.charAt(_.fill.length-1);"x"!==D&&"y"!==D&&(D=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var P,O,R="",E=[],N=_._prevtrace;N&&(R=N._prevRevpath||"",C=N._nextFill,E=N._polygons);var I,z,F,j,B,H,Y,U="",G="",q=[],V=i.noop;if(L=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),z=s.steps(w.shape.split("").reverse().join(""))):I=z="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return z(e.reverse())},q=u(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var Z=k.selectAll(".js-line").data(q);y(Z.exit()).style("opacity",0).remove(),Z.each(V(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(V(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(L?(L.datum(f),j&&H&&(D?("y"===D?j[1]=H[1]=x.c2p(0,!0):"x"===D&&(j[0]=H[0]=b.c2p(0,!0)),y(L).attr("d","M"+H+"L"+j+"L"+U.substr(1)).call(s.singleFillStyle)):y(L).attr("d",U+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&U&&R?("tonext"===_.fill?y(C).attr("d",U+"Z"+R+"Z").call(s.singleFillStyle):y(C).attr("d",U+"L"+R.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(E)):(J(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=Y):(L?J(L):C&&J(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),S.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?Q:X:_&&!w&&(v=K),f&&(h=v),d&&(g=v)}var M,T=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,e).call(s.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,b,x)?(s.singlePointStyle(t,i,u,M,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,b,x,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,b,x)?r.layerClipId&&s.hideOutsideRangePoint(e,t,b,x,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=b.c2p(e.x),r=x.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,S,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(S,W,e)}function J(e){y(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function Q(e){return e.filter((function(e){return e.vis}))}function K(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":138,"../../lib":248,"../../lib/polygon":260,"../../registry":340,"./line_points":376,"./link_traces":378,"./subtypes":387,"@plotly/d3":11}],384:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":156,"../../constants/numerical":226,"../../lib":248,"../scatter/get_trace_color":372,"./attributes":390}],396:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":329,"../scatter/marker_colorbar":380,"../scatter/style":386,"./attributes":390,"./calc":391,"./defaults":392,"./event_data":393,"./format_labels":394,"./hover":395,"./plot":397,"./select":398,"./style":399}],397:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),b={},x={},_=0;h?(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},m=function(e,t){var r=b[e.astr][t];e.get()[t]=r}):(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set([])},m=function(e,t){var r=b[e.astr][t];e.get().push(r)}),T(v);for(var w=o(t.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i be - bs) { + return bruteForceRedFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlueFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } } + return bruteForceFull } -function bruteForcePlanner(full) { - var funcName = 'bruteForce' + (full ? 'Full' : 'Partial') - var prefix = [] - var fargs = ARGS.slice() - if(!full) { - fargs.splice(3, 0, FLIP) +function partial() { + function bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - - var code = ['function ' + funcName + '(' + fargs.join() + '){'] - - function invoke(redMajor, flip) { - var res = generateBruteForce(redMajor, flip, full) - prefix.push(res.code) - code.push('return ' + res.name + '(' + ARGS.join() + ');') + function bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } } - - code.push('if(' + RED_END + '-' + RED_START + '>' + - BLUE_END + '-' + BLUE_START + '){') - - if(full) { - invoke(true, false) - code.push('}else{') - invoke(false, false) - } else { - code.push('if(' + FLIP + '){') - invoke(true, true) - code.push('}else{') - invoke(true, false) - code.push('}}else{if(' + FLIP + '){') - invoke(false, true) - code.push('}else{') - invoke(false, false) - code.push('}') + function bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - code.push('}}return ' + funcName) - - var codeStr = prefix.join('') + code.join('') - var proc = new Function(codeStr) - return proc() + function bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } + } + function bruteForcePartial(d, ax, vv, fp, rs, re, rb, ri, bs, be, bb, bi) { + if (re - rs > be - bs) { + if (fp) { + return bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + else { + if (fp) { + return bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + } + return bruteForcePartial } +function bruteForcePlanner(isFull) { + return isFull ? full() : partial() + +} exports.partial = bruteForcePlanner(false) exports.full = bruteForcePlanner(true) @@ -13287,32 +13281,26 @@ var genPartition = _dereq_('./partition') //Twiddle parameters var BRUTE_FORCE_CUTOFF = 128 //Cut off for brute force search var SCAN_CUTOFF = (1<<22) //Cut off for two way scan -var SCAN_COMPLETE_CUTOFF = (1<<22) +var SCAN_COMPLETE_CUTOFF = (1<<22) //Partition functions var partitionInteriorContainsInterval = genPartition( - '!(lo>=p0)&&!(p1>=hi)', - ['p0', 'p1']) + '!(lo>=p0)&&!(p1>=hi)') var partitionStartEqual = genPartition( - 'lo===p0', - ['p0']) + 'lo===p0') var partitionStartLessThan = genPartition( - 'lo mid point // var blue0 = findMedian( - d, axis, + d, axis, blueStart, blueEnd, blue, blueIndex) var mid = blue[elemSize * blue0 + axis] var blue1 = partitionStartEqual( @@ -13765,14 +13753,14 @@ function boxIntersectIter( } } } -},{"./brute":50,"./median":52,"./partition":53,"./sweep":55,"bit-twiddle":46,"typedarray-pool":340}],52:[function(_dereq_,module,exports){ +},{"./brute":50,"./median":52,"./partition":53,"./sweep":55,"bit-twiddle":46,"typedarray-pool":329}],52:[function(_dereq_,module,exports){ 'use strict' module.exports = findMedian var genPartition = _dereq_('./partition') -var partitionStartLessThan = genPartition('lostart && boxes[ptr+axis] > x; + for(var j=i, ptr=elemSize*(i-1); + j>start && boxes[ptr+axis] > x; --j, ptr-=elemSize) { //Swap var aPtr = ptr @@ -13813,14 +13801,14 @@ function findMedian(d, axis, start, end, boxes, ids) { var elemSize = 2*d var pivot = mid var value = boxes[elemSize*mid+axis] - + while(lo < hi) { if(hi - lo < PARTITION_THRESHOLD) { insertionSort(d, axis, lo, hi, boxes, ids) value = boxes[elemSize*mid+axis] break } - + //Select pivot using median-of-3 var count = hi - lo var pivot0 = (Math.random()*count+lo)|0 @@ -13867,7 +13855,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Partition using pivot pivot = partitionStartLessThan( - d, axis, + d, axis, lo, hi-1, boxes, ids, value) @@ -13886,7 +13874,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Swap pivot to last pivot if(mid < pivot) { hi = pivot-1 - while(lo < hi && + while(lo < hi && boxes[elemSize*(hi-1)+axis] === value) { hi -= 1 } @@ -13904,7 +13892,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Make sure pivot is at start return partitionStartLessThan( - d, axis, + d, axis, start, mid, boxes, ids, boxes[elemSize*mid+axis]) } @@ -13913,22 +13901,115 @@ function findMedian(d, axis, start, end, boxes, ids) { module.exports = genPartition -var code = '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' +var P2F = { + 'lo===p0': lo_equal_p0, + 'lo=p0)&&!(p1>=hi)': lo_lessThan_p0_and_p1_lessThan_hi +} -function genPartition(predicate, args) { - var fargs ='abcdef'.split('').concat(args) - var reads = [] - if(predicate.indexOf('lo') >= 0) { - reads.push('lo=e[k+n]') +function genPartition(predicate) { + return P2F[predicate] +} + +// lo===p0 +function lo_equal_p0(a, b, c, d, e, f, p0) { + 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 lo = e[k + n]; + if (lo === p0) 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 +} + +// lo p; ++p, k += j) { + var lo = e[k + n]; + if (lo < p0) 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 +} + +// lo<=p0 +function lo_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} + +// hi<=p0 +function hi_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 + } } - if(predicate.indexOf('hi') >= 0) { - reads.push('hi=e[k+o]') + return m +} + +// lo<=p0&&p0<=hi +function lo_lassOrEqual_p0_and_p0_lessOrEqual_hi(a, b, c, d, e, f, p0) { + 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 lo = e[k + n], hi = e[k + o]; + if (lo <= p0 && p0 <= hi) 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 +} + +// lo p; ++p, k += j) { + var lo = e[k + n], hi = e[k + o]; + if (lo < p0 && p0 <= hi) 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 +} + +// !(lo>=p0)&&!(p1>=hi) +function lo_lessThan_p0_and_p1_lessThan_hi(a, b, c, d, e, f, p0, p1) { + 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 lo = e[k + n], hi = e[k + o]; + if (!(lo >= p0) && !(p1 >= hi)) 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 + } } - fargs.push( - code.replace('_', reads.join()) - .replace('$', predicate)) - return Function.apply(void 0, fargs) + return m } + },{}],54:[function(_dereq_,module,exports){ 'use strict'; @@ -14601,7 +14682,7 @@ red_loop: } } } -},{"./sort":54,"bit-twiddle":46,"typedarray-pool":340}],56:[function(_dereq_,module,exports){ +},{"./sort":54,"bit-twiddle":46,"typedarray-pool":329}],56:[function(_dereq_,module,exports){ },{}],57:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. @@ -16862,7 +16943,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,_dereq_("buffer").Buffer) -},{"base64-js":28,"buffer":58,"ieee754":240}],59:[function(_dereq_,module,exports){ +},{"base64-js":28,"buffer":58,"ieee754":236}],59:[function(_dereq_,module,exports){ 'use strict' var monotoneTriangulate = _dereq_('./lib/monotone') @@ -17063,7 +17144,7 @@ function delaunayRefine(points, triangulation) { } } -},{"binary-search-bounds":45,"robust-in-sphere":299}],61:[function(_dereq_,module,exports){ +},{"binary-search-bounds":45,"robust-in-sphere":290}],61:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -17434,7 +17515,7 @@ function monotoneTriangulate(points, edges) { return cells } -},{"binary-search-bounds":45,"robust-orientation":300}],63:[function(_dereq_,module,exports){ +},{"binary-search-bounds":45,"robust-orientation":291}],63:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -17932,7 +18013,7 @@ function cleanPSLG (points, edges, colors) { return modified } -},{"./lib/rat-seg-intersect":66,"big-rat":32,"big-rat/cmp":30,"big-rat/to-float":44,"box-intersect":49,"nextafter":262,"rat-vec":290,"robust-segment-intersect":303,"union-find":341}],66:[function(_dereq_,module,exports){ +},{"./lib/rat-seg-intersect":66,"big-rat":32,"big-rat/cmp":30,"big-rat/to-float":44,"box-intersect":49,"nextafter":256,"rat-vec":281,"robust-segment-intersect":294,"union-find":330}],66:[function(_dereq_,module,exports){ 'use strict' module.exports = solveIntersection @@ -17976,7 +18057,7 @@ function solveIntersection (a, b, c, d) { return r } -},{"big-rat/div":31,"big-rat/mul":41,"big-rat/sign":42,"big-rat/sub":43,"rat-vec/add":289,"rat-vec/muls":291,"rat-vec/sub":292}],67:[function(_dereq_,module,exports){ +},{"big-rat/div":31,"big-rat/mul":41,"big-rat/sign":42,"big-rat/sub":43,"rat-vec/add":280,"rat-vec/muls":282,"rat-vec/sub":283}],67:[function(_dereq_,module,exports){ /** @module color-id */ 'use strict' @@ -18252,7 +18333,7 @@ function isInt(color) { return false } -},{"clamp":64,"color-rgba":71,"dtype":98}],70:[function(_dereq_,module,exports){ +},{"clamp":64,"color-rgba":71,"dtype":95}],70:[function(_dereq_,module,exports){ (function (global){(function (){ /** * @module color-parse @@ -18431,7 +18512,7 @@ function parse (cstr) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"color-name":68,"defined":94,"is-plain-obj":250}],71:[function(_dereq_,module,exports){ +},{"color-name":68,"defined":91,"is-plain-obj":244}],71:[function(_dereq_,module,exports){ /** @module color-rgba */ 'use strict' @@ -18673,7 +18754,7 @@ function compareAngle(a, b, c, d) { } } } -},{"robust-orientation":300,"robust-product":301,"robust-sum":305,"signum":306,"two-sum":328}],75:[function(_dereq_,module,exports){ +},{"robust-orientation":291,"robust-product":292,"robust-sum":296,"signum":297,"two-sum":317}],75:[function(_dereq_,module,exports){ module.exports=[ "xx-small", "x-small", @@ -18853,7 +18934,7 @@ function parseLineHeight(value) { return value } -},{"./lib/util":80,"css-font-stretch-keywords":76,"css-font-style-keywords":77,"css-font-weight-keywords":78,"css-global-keywords":83,"css-system-font-keywords":84,"string-split-by":315,"unquote":343}],82:[function(_dereq_,module,exports){ +},{"./lib/util":80,"css-font-stretch-keywords":76,"css-font-style-keywords":77,"css-font-weight-keywords":78,"css-global-keywords":83,"css-system-font-keywords":84,"string-split-by":305,"unquote":332}],82:[function(_dereq_,module,exports){ 'use strict' var pick = _dereq_('pick-by-alias') @@ -18957,7 +19038,7 @@ function a2o (a) { return o } -},{"./lib/util":80,"css-font-stretch-keywords":76,"css-font-style-keywords":77,"css-font-weight-keywords":78,"css-global-keywords":83,"css-system-font-keywords":84,"pick-by-alias":273}],83:[function(_dereq_,module,exports){ +},{"./lib/util":80,"css-font-stretch-keywords":76,"css-font-style-keywords":77,"css-font-weight-keywords":78,"css-global-keywords":83,"css-system-font-keywords":84,"pick-by-alias":265}],83:[function(_dereq_,module,exports){ module.exports=[ "inherit", "initial", @@ -18975,565 +19056,6 @@ module.exports=[ ] },{}],85:[function(_dereq_,module,exports){ -"use strict" - -var createThunk = _dereq_("./lib/thunk.js") - -function Procedure() { - 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 = false -} - -function compileCwise(user_args) { - //Create procedure - var proc = new Procedure() - - //Parse blocks - proc.pre = user_args.pre - proc.body = user_args.body - proc.post = user_args.post - - //Parse arguments - var proc_args = user_args.args.slice(0) - proc.argTypes = proc_args - for(var i=0; i0) { - throw new Error("cwise: pre() block may not reference array args") - } - if(i < proc.post.args.length && proc.post.args[i].count>0) { - throw new Error("cwise: post() block may not reference array args") - } - } else if(arg_type === "scalar") { - proc.scalarArgs.push(i) - proc.shimArgs.push("scalar" + i) - } else if(arg_type === "index") { - proc.indexArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].count > 0) { - throw new Error("cwise: pre() block may not reference array index") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array index") - } - if(i < proc.post.args.length && proc.post.args[i].count > 0) { - throw new Error("cwise: post() block may not reference array index") - } - } else if(arg_type === "shape") { - proc.shapeArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].lvalue) { - throw new Error("cwise: pre() block may not write to array shape") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array shape") - } - if(i < proc.post.args.length && proc.post.args[i].lvalue) { - throw new Error("cwise: post() block may not write to array shape") - } - } else if(typeof arg_type === "object" && arg_type.offset) { - proc.argTypes[i] = "offset" - proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset }) - proc.offsetArgIndex.push(i) - } else { - throw new Error("cwise: Unknown argument type " + proc_args[i]) - } - } - - //Make sure at least one array argument was specified - if(proc.arrayArgs.length <= 0) { - throw new Error("cwise: No array arguments specified") - } - - //Make sure arguments are correct - if(proc.pre.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in pre() block") - } - if(proc.body.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in body() block") - } - if(proc.post.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in post() block") - } - - //Check debug flag - proc.debug = !!user_args.printCode || !!user_args.debug - - //Retrieve name - proc.funcName = user_args.funcName || "cwise" - - //Read in block size - proc.blockSize = user_args.blockSize || 64 - - return createThunk(proc) -} - -module.exports = compileCwise - -},{"./lib/thunk.js":87}],86:[function(_dereq_,module,exports){ -"use strict" - -var uniq = _dereq_("uniq") - -// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index) -// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments. -function innerFill(order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , has_index = proc.indexArgs.length>0 - , code = [] - , vars = [] - , idx=0, pidx=0, i, j - for(i=0; i 0) { - code.push("var " + vars.join(",")) - } - //Scan loop - for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards - idx = order[i] - code.push(["for(i",i,"=0;i",i," 0) { - code.push(["index[",pidx,"]-=s",pidx].join("")) - } - code.push(["++index[",idx,"]"].join("")) - } - code.push("}") - } - return code.join("\n") -} - -// Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block. -// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary. -// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used. -function outerFill(matched, order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , blockSize = proc.blockSize - , has_index = proc.indexArgs.length > 0 - , code = [] - for(var i=0; i0;){"].join("")) // Iterate back to front - code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j). - code.push(["s",order[i],"=j",i].join("")) - code.push(["j",i,"=0"].join("")) - code.push(["}else{s",order[i],"=",blockSize].join("")) - code.push(["j",i,"-=",blockSize,"}"].join("")) - if(has_index) { - code.push(["index[",order[i],"]=j",i].join("")) - } - } - for(var i=0; i 0) { - allEqual = allEqual && summary[i] === summary[i-1] - } - } - if(allEqual) { - return summary[0] - } - return summary.join("") -} - -//Generates a cwise operator -function generateCWiseOp(proc, typesig) { - - //Compute dimension - // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg. - var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0 - var orders = new Array(proc.arrayArgs.length) - var dtypes = new Array(proc.arrayArgs.length) - for(var i=0; i 0) { - vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example) - } - if(proc.indexArgs.length > 0) { - // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes. - var zeros = new Array(dimension) - for(var i=0; i 0) { - code.push("var " + vars.join(",")) - } - for(var i=0; i 3) { - code.push(processBlock(proc.pre, proc, dtypes)) - } - - //Process body - var body = processBlock(proc.body, proc, dtypes) - var matched = countMatches(loopOrders) - if(matched < dimension) { - code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example. - } else { - code.push(innerFill(loopOrders[0], proc, body)) - } - - //Inline epilog - if(proc.post.body.length > 3) { - code.push(processBlock(proc.post, proc, dtypes)) - } - - if(proc.debug) { - console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------") - } - - var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("") - var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join("")) - return f() -} -module.exports = generateCWiseOp - -},{"uniq":342}],87:[function(_dereq_,module,exports){ -"use strict" - -// The function below is called when constructing a cwise function object, and does the following: -// A function object is constructed which accepts as argument a compilation function and returns another function. -// It is this other function that is eventually returned by createThunk, and this function is the one that actually -// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed. -// The compilation passed to the first function object is used for compiling new functions. -// Once this function object is created, it is called with compile as argument, where the first argument of compile -// is bound to "proc" (essentially containing a preprocessed version of the user arguments to cwise). -// So createThunk roughly works like this: -// function createThunk(proc) { -// var thunk = function(compileBound) { -// var CACHED = {} -// return function(arrays and scalars) { -// if (dtype and order of arrays in CACHED) { -// var func = CACHED[dtype and order of arrays] -// } else { -// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays) -// } -// return func(arrays and scalars) -// } -// } -// return thunk(compile.bind1(proc)) -// } - -var compile = _dereq_("./compile.js") - -function createThunk(proc) { - var code = ["'use strict'", "var CACHED={}"] - var vars = [] - var thunkName = proc.funcName + "_cwise_thunk" - - //Build thunk - code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join("")) - var typesig = [] - var string_typesig = [] - var proc_args = [["array",proc.arrayArgs[0],".shape.slice(", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS). - Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(","+proc.arrayBlockIndices[0]+")"):")"].join("")] - var shapeLengthConditions = [], shapeConditions = [] - // Process array arguments - for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices) - shapeLengthConditions.push("array" + proc.arrayArgs[0] + ".shape.length===array" + j + ".shape.length+" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i]))) - shapeConditions.push("array" + proc.arrayArgs[0] + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[0]) + "]===array" + j + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[i]) + "]") - } - } - // Check for shape equality - if (proc.arrayArgs.length > 1) { - code.push("if (!(" + shapeLengthConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same dimensionality!')") - code.push("for(var shapeIndex=array" + proc.arrayArgs[0] + ".shape.length-" + Math.abs(proc.arrayBlockIndices[0]) + "; shapeIndex-->0;) {") - code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')") - code.push("}") - } - // Process scalar arguments - for(var i=0; i 0 ? 1 : -1; }; -},{}],112:[function(_dereq_,module,exports){ +},{}],109:[function(_dereq_,module,exports){ "use strict"; var sign = _dereq_("../math/sign") @@ -22275,7 +21797,7 @@ module.exports = function (value) { return sign(value) * floor(abs(value)); }; -},{"../math/sign":109}],113:[function(_dereq_,module,exports){ +},{"../math/sign":106}],110:[function(_dereq_,module,exports){ "use strict"; var toInteger = _dereq_("./to-integer") @@ -22283,7 +21805,7 @@ var toInteger = _dereq_("./to-integer") module.exports = function (value) { return max(0, toInteger(value)); }; -},{"./to-integer":112}],114:[function(_dereq_,module,exports){ +},{"./to-integer":109}],111:[function(_dereq_,module,exports){ // Internal method, used by iteration functions. // Calls a function for each key-value pair found in object // Optionally takes compareFn to iterate object in specific order @@ -22315,12 +21837,12 @@ module.exports = function (method, defVal) { }; }; -},{"./valid-callable":131,"./valid-value":133}],115:[function(_dereq_,module,exports){ +},{"./valid-callable":128,"./valid-value":130}],112:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.assign : _dereq_("./shim"); -},{"./is-implemented":116,"./shim":117}],116:[function(_dereq_,module,exports){ +},{"./is-implemented":113,"./shim":114}],113:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -22331,7 +21853,7 @@ module.exports = function () { return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; }; -},{}],117:[function(_dereq_,module,exports){ +},{}],114:[function(_dereq_,module,exports){ "use strict"; var keys = _dereq_("../keys") @@ -22356,7 +21878,7 @@ module.exports = function (dest, src/*, …srcn*/) { return dest; }; -},{"../keys":123,"../valid-value":133}],118:[function(_dereq_,module,exports){ +},{"../keys":120,"../valid-value":130}],115:[function(_dereq_,module,exports){ "use strict"; var aFrom = _dereq_("../array/from") @@ -22377,7 +21899,7 @@ module.exports = function (obj/*, propertyNames, options*/) { return result; }; -},{"../array/from":103,"./assign":115,"./valid-value":133}],119:[function(_dereq_,module,exports){ +},{"../array/from":100,"./assign":112,"./valid-value":130}],116:[function(_dereq_,module,exports){ // Workaround for http://code.google.com/p/v8/issues/detail?id=2804 "use strict"; @@ -22422,12 +21944,12 @@ module.exports = (function () { }; })(); -},{"./set-prototype-of/is-implemented":129,"./set-prototype-of/shim":130}],120:[function(_dereq_,module,exports){ +},{"./set-prototype-of/is-implemented":126,"./set-prototype-of/shim":127}],117:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./_iterate")("forEach"); -},{"./_iterate":114}],121:[function(_dereq_,module,exports){ +},{"./_iterate":111}],118:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -22436,19 +21958,19 @@ var map = { function: true, object: true }; module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; }; -},{"./is-value":122}],122:[function(_dereq_,module,exports){ +},{"./is-value":119}],119:[function(_dereq_,module,exports){ "use strict"; var _undefined = _dereq_("../function/noop")(); // Support ES3 engines module.exports = function (val) { return val !== _undefined && val !== null; }; -},{"../function/noop":108}],123:[function(_dereq_,module,exports){ +},{"../function/noop":105}],120:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.keys : _dereq_("./shim"); -},{"./is-implemented":124,"./shim":125}],124:[function(_dereq_,module,exports){ +},{"./is-implemented":121,"./shim":122}],121:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -22460,7 +21982,7 @@ module.exports = function () { } }; -},{}],125:[function(_dereq_,module,exports){ +},{}],122:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("../is-value"); @@ -22469,7 +21991,7 @@ var keys = Object.keys; module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; -},{"../is-value":122}],126:[function(_dereq_,module,exports){ +},{"../is-value":119}],123:[function(_dereq_,module,exports){ "use strict"; var callable = _dereq_("./valid-callable") @@ -22485,7 +22007,7 @@ module.exports = function (obj, cb/*, thisArg*/) { return result; }; -},{"./for-each":120,"./valid-callable":131}],127:[function(_dereq_,module,exports){ +},{"./for-each":117,"./valid-callable":128}],124:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -22507,12 +22029,12 @@ module.exports = function (opts1/*, …options*/) { return result; }; -},{"./is-value":122}],128:[function(_dereq_,module,exports){ +},{"./is-value":119}],125:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.setPrototypeOf : _dereq_("./shim"); -},{"./is-implemented":129,"./shim":130}],129:[function(_dereq_,module,exports){ +},{"./is-implemented":126,"./shim":127}],126:[function(_dereq_,module,exports){ "use strict"; var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; @@ -22523,7 +22045,7 @@ module.exports = function (/* CustomCreate*/) { return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; }; -},{}],130:[function(_dereq_,module,exports){ +},{}],127:[function(_dereq_,module,exports){ /* eslint no-proto: "off" */ // Big thanks to @WebReflection for sorting this out @@ -22606,7 +22128,7 @@ module.exports = (function (status) { _dereq_("../create"); -},{"../create":119,"../is-object":121,"../valid-value":133}],131:[function(_dereq_,module,exports){ +},{"../create":116,"../is-object":118,"../valid-value":130}],128:[function(_dereq_,module,exports){ "use strict"; module.exports = function (fn) { @@ -22614,7 +22136,7 @@ module.exports = function (fn) { return fn; }; -},{}],132:[function(_dereq_,module,exports){ +},{}],129:[function(_dereq_,module,exports){ "use strict"; var isObject = _dereq_("./is-object"); @@ -22624,7 +22146,7 @@ module.exports = function (value) { return value; }; -},{"./is-object":121}],133:[function(_dereq_,module,exports){ +},{"./is-object":118}],130:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -22634,12 +22156,12 @@ module.exports = function (value) { return value; }; -},{"./is-value":122}],134:[function(_dereq_,module,exports){ +},{"./is-value":119}],131:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? String.prototype.contains : _dereq_("./shim"); -},{"./is-implemented":135,"./shim":136}],135:[function(_dereq_,module,exports){ +},{"./is-implemented":132,"./shim":133}],132:[function(_dereq_,module,exports){ "use strict"; var str = "razdwatrzy"; @@ -22649,7 +22171,7 @@ module.exports = function () { return str.contains("dwa") === true && str.contains("foo") === false; }; -},{}],136:[function(_dereq_,module,exports){ +},{}],133:[function(_dereq_,module,exports){ "use strict"; var indexOf = String.prototype.indexOf; @@ -22658,7 +22180,7 @@ module.exports = function (searchString/*, position*/) { return indexOf.call(this, searchString, arguments[1]) > -1; }; -},{}],137:[function(_dereq_,module,exports){ +},{}],134:[function(_dereq_,module,exports){ "use strict"; var objToString = Object.prototype.toString, id = objToString.call(""); @@ -22673,7 +22195,7 @@ module.exports = function (value) { ); }; -},{}],138:[function(_dereq_,module,exports){ +},{}],135:[function(_dereq_,module,exports){ "use strict"; var generated = Object.create(null), random = Math.random; @@ -22686,7 +22208,7 @@ module.exports = function () { return str; }; -},{}],139:[function(_dereq_,module,exports){ +},{}],136:[function(_dereq_,module,exports){ "use strict"; var setPrototypeOf = _dereq_("es5-ext/object/set-prototype-of") @@ -22720,7 +22242,7 @@ ArrayIterator.prototype = Object.create(Iterator.prototype, { }); defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); -},{"./":142,"d":89,"es5-ext/object/set-prototype-of":128,"es5-ext/string/#/contains":134,"es6-symbol":146}],140:[function(_dereq_,module,exports){ +},{"./":139,"d":86,"es5-ext/object/set-prototype-of":125,"es5-ext/string/#/contains":131,"es6-symbol":143}],137:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -22769,7 +22291,7 @@ module.exports = function (iterable, cb /*, thisArg*/) { } }; -},{"./get":141,"es5-ext/function/is-arguments":106,"es5-ext/object/valid-callable":131,"es5-ext/string/is-string":137}],141:[function(_dereq_,module,exports){ +},{"./get":138,"es5-ext/function/is-arguments":103,"es5-ext/object/valid-callable":128,"es5-ext/string/is-string":134}],138:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -22786,7 +22308,7 @@ module.exports = function (obj) { return new ArrayIterator(obj); }; -},{"./array":139,"./string":144,"./valid-iterable":145,"es5-ext/function/is-arguments":106,"es5-ext/string/is-string":137,"es6-symbol":146}],142:[function(_dereq_,module,exports){ +},{"./array":136,"./string":141,"./valid-iterable":142,"es5-ext/function/is-arguments":103,"es5-ext/string/is-string":134,"es6-symbol":143}],139:[function(_dereq_,module,exports){ "use strict"; var clear = _dereq_("es5-ext/array/#/clear") @@ -22894,7 +22416,7 @@ defineProperty( }) ); -},{"d":89,"d/auto-bind":88,"es5-ext/array/#/clear":102,"es5-ext/object/assign":115,"es5-ext/object/valid-callable":131,"es5-ext/object/valid-value":133,"es6-symbol":146}],143:[function(_dereq_,module,exports){ +},{"d":86,"d/auto-bind":85,"es5-ext/array/#/clear":99,"es5-ext/object/assign":112,"es5-ext/object/valid-callable":128,"es5-ext/object/valid-value":130,"es6-symbol":143}],140:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -22912,7 +22434,7 @@ module.exports = function (value) { return typeof value[iteratorSymbol] === "function"; }; -},{"es5-ext/function/is-arguments":106,"es5-ext/object/is-value":122,"es5-ext/string/is-string":137,"es6-symbol":146}],144:[function(_dereq_,module,exports){ +},{"es5-ext/function/is-arguments":103,"es5-ext/object/is-value":119,"es5-ext/string/is-string":134,"es6-symbol":143}],141:[function(_dereq_,module,exports){ // Thanks @mathiasbynens // http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols @@ -22953,7 +22475,7 @@ StringIterator.prototype = Object.create(Iterator.prototype, { }); defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); -},{"./":142,"d":89,"es5-ext/object/set-prototype-of":128,"es6-symbol":146}],145:[function(_dereq_,module,exports){ +},{"./":139,"d":86,"es5-ext/object/set-prototype-of":125,"es6-symbol":143}],142:[function(_dereq_,module,exports){ "use strict"; var isIterable = _dereq_("./is-iterable"); @@ -22963,14 +22485,14 @@ module.exports = function (value) { return value; }; -},{"./is-iterable":143}],146:[function(_dereq_,module,exports){ +},{"./is-iterable":140}],143:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? _dereq_("ext/global-this").Symbol : _dereq_("./polyfill"); -},{"./is-implemented":147,"./polyfill":152,"ext/global-this":159}],147:[function(_dereq_,module,exports){ +},{"./is-implemented":144,"./polyfill":149,"ext/global-this":156}],144:[function(_dereq_,module,exports){ "use strict"; var global = _dereq_("ext/global-this") @@ -22992,7 +22514,7 @@ module.exports = function () { return true; }; -},{"ext/global-this":159}],148:[function(_dereq_,module,exports){ +},{"ext/global-this":156}],145:[function(_dereq_,module,exports){ "use strict"; module.exports = function (value) { @@ -23003,7 +22525,7 @@ module.exports = function (value) { return value[value.constructor.toStringTag] === "Symbol"; }; -},{}],149:[function(_dereq_,module,exports){ +},{}],146:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d"); @@ -23034,7 +22556,7 @@ module.exports = function (desc) { return name; }; -},{"d":89}],150:[function(_dereq_,module,exports){ +},{"d":86}],147:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d") @@ -23070,7 +22592,7 @@ module.exports = function (SymbolPolyfill) { }); }; -},{"d":89,"ext/global-this":159}],151:[function(_dereq_,module,exports){ +},{"d":86,"ext/global-this":156}],148:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d") @@ -23095,7 +22617,7 @@ module.exports = function (SymbolPolyfill) { }); }; -},{"../../../validate-symbol":153,"d":89}],152:[function(_dereq_,module,exports){ +},{"../../../validate-symbol":150,"d":86}],149:[function(_dereq_,module,exports){ // ES2015 Symbol polyfill for environments that do not (or partially) support it "use strict"; @@ -23184,7 +22706,7 @@ defineProperty( d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]) ); -},{"./lib/private/generate-name":149,"./lib/private/setup/standard-symbols":150,"./lib/private/setup/symbol-registry":151,"./validate-symbol":153,"d":89,"ext/global-this":159}],153:[function(_dereq_,module,exports){ +},{"./lib/private/generate-name":146,"./lib/private/setup/standard-symbols":147,"./lib/private/setup/symbol-registry":148,"./validate-symbol":150,"d":86,"ext/global-this":156}],150:[function(_dereq_,module,exports){ "use strict"; var isSymbol = _dereq_("./is-symbol"); @@ -23194,12 +22716,12 @@ module.exports = function (value) { return value; }; -},{"./is-symbol":148}],154:[function(_dereq_,module,exports){ +},{"./is-symbol":145}],151:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? WeakMap : _dereq_("./polyfill"); -},{"./is-implemented":155,"./polyfill":157}],155:[function(_dereq_,module,exports){ +},{"./is-implemented":152,"./polyfill":154}],152:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -23222,7 +22744,7 @@ module.exports = function () { return true; }; -},{}],156:[function(_dereq_,module,exports){ +},{}],153:[function(_dereq_,module,exports){ // Exports true if environment provides native `WeakMap` implementation, whatever that is. "use strict"; @@ -23232,7 +22754,7 @@ module.exports = (function () { return Object.prototype.toString.call(new WeakMap()) === "[object WeakMap]"; }()); -},{}],157:[function(_dereq_,module,exports){ +},{}],154:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("es5-ext/object/is-value") @@ -23299,7 +22821,7 @@ Object.defineProperties(WeakMapPoly.prototype, { }); defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d("c", "WeakMap")); -},{"./is-native-implemented":156,"d":89,"es5-ext/object/is-value":122,"es5-ext/object/set-prototype-of":128,"es5-ext/object/valid-object":132,"es5-ext/object/valid-value":133,"es5-ext/string/random-uniq":138,"es6-iterator/for-of":140,"es6-iterator/get":141,"es6-symbol":146}],158:[function(_dereq_,module,exports){ +},{"./is-native-implemented":153,"d":86,"es5-ext/object/is-value":119,"es5-ext/object/set-prototype-of":125,"es5-ext/object/valid-object":129,"es5-ext/object/valid-value":130,"es5-ext/string/random-uniq":135,"es6-iterator/for-of":137,"es6-iterator/get":138,"es6-symbol":143}],155:[function(_dereq_,module,exports){ var naiveFallback = function () { if (typeof self === "object" && self) return self; if (typeof window === "object" && window) return window; @@ -23332,12 +22854,12 @@ module.exports = (function () { } })(); -},{}],159:[function(_dereq_,module,exports){ +},{}],156:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? globalThis : _dereq_("./implementation"); -},{"./implementation":158,"./is-implemented":160}],160:[function(_dereq_,module,exports){ +},{"./implementation":155,"./is-implemented":157}],157:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -23346,7 +22868,7 @@ module.exports = function () { return globalThis.Array === Array; }; -},{}],161:[function(_dereq_,module,exports){ +},{}],158:[function(_dereq_,module,exports){ /** * inspired by is-number * but significantly simplified and sped up by ignoring number and string constructors @@ -23372,7 +22894,7 @@ module.exports = function(n) { return n - n < 1; }; -},{"is-string-blank":251}],162:[function(_dereq_,module,exports){ +},{"is-string-blank":245}],159:[function(_dereq_,module,exports){ /*eslint new-cap:0*/ var dtype = _dereq_('dtype') @@ -23432,7 +22954,7 @@ function flattenVertexData (data, output, offset) { return output } -},{"dtype":98}],163:[function(_dereq_,module,exports){ +},{"dtype":95}],160:[function(_dereq_,module,exports){ 'use strict' var stringifyFont = _dereq_('css-font/stringify') @@ -23491,7 +23013,7 @@ function atlas(options) { return canvas } -},{"css-font/stringify":82}],164:[function(_dereq_,module,exports){ +},{"css-font/stringify":82}],161:[function(_dereq_,module,exports){ 'use strict' module.exports = measure @@ -23678,7 +23200,7 @@ function firstBottom(iData) { } } -},{}],165:[function(_dereq_,module,exports){ +},{}],162:[function(_dereq_,module,exports){ "use strict" module.exports = createRBTree @@ -24675,76 +24197,7 @@ function defaultCompare(a, b) { function createRBTree(compare) { return new RedBlackTree(compare || defaultCompare, null) } -},{}],166:[function(_dereq_,module,exports){ -// transliterated from the python snippet here: -// http://en.wikipedia.org/wiki/Lanczos_approximation - -var g = 7; -var p = [ - 0.99999999999980993, - 676.5203681218851, - -1259.1392167224028, - 771.32342877765313, - -176.61502916214059, - 12.507343278686905, - -0.13857109526572012, - 9.9843695780195716e-6, - 1.5056327351493116e-7 -]; - -var g_ln = 607/128; -var p_ln = [ - 0.99999999999999709182, - 57.156235665862923517, - -59.597960355475491248, - 14.136097974741747174, - -0.49191381609762019978, - 0.33994649984811888699e-4, - 0.46523628927048575665e-4, - -0.98374475304879564677e-4, - 0.15808870322491248884e-3, - -0.21026444172410488319e-3, - 0.21743961811521264320e-3, - -0.16431810653676389022e-3, - 0.84418223983852743293e-4, - -0.26190838401581408670e-4, - 0.36899182659531622704e-5 -]; - -// Spouge approximation (suitable for large arguments) -function lngamma(z) { - - if(z < 0) return Number('0/0'); - var x = p_ln[0]; - for(var i = p_ln.length - 1; i > 0; --i) x += p_ln[i] / (z + i); - var t = z + g_ln + 0.5; - return .5*Math.log(2*Math.PI)+(z+.5)*Math.log(t)-t+Math.log(x)-Math.log(z); -} - -module.exports = function gamma (z) { - if (z < 0.5) { - return Math.PI / (Math.sin(Math.PI * z) * gamma(1 - z)); - } - else if(z > 100) return Math.exp(lngamma(z)); - else { - z -= 1; - var x = p[0]; - for (var i = 1; i < g + 2; i++) { - x += p[i] / (z + i); - } - var t = z + g + 0.5; - - return Math.sqrt(2 * Math.PI) - * Math.pow(t, z + 0.5) - * Math.exp(-t) - * x - ; - } -}; - -module.exports.log = lngamma; - -},{}],167:[function(_dereq_,module,exports){ +},{}],163:[function(_dereq_,module,exports){ module.exports = getCanvasContext function getCanvasContext (type, opts) { if (typeof type !== 'string') { @@ -24784,7 +24237,7 @@ function getCanvasContext (type, opts) { return (gl || null) // ensure null on fail } -},{}],168:[function(_dereq_,module,exports){ +},{}],164:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") @@ -24938,7 +24391,7 @@ function createBuffer(gl, data, type, usage) { module.exports = createBuffer -},{"ndarray":261,"ndarray-ops":260,"typedarray-pool":340}],169:[function(_dereq_,module,exports){ +},{"ndarray":255,"ndarray-ops":254,"typedarray-pool":329}],165:[function(_dereq_,module,exports){ module.exports = { 0: 'NONE', 1: 'ONE', @@ -25238,14 +24691,14 @@ module.exports = { 37444: 'BROWSER_DEFAULT_WEBGL' } -},{}],170:[function(_dereq_,module,exports){ +},{}],166:[function(_dereq_,module,exports){ var gl10 = _dereq_('./1.0/numbers') module.exports = function lookupConstant (number) { return gl10[number] } -},{"./1.0/numbers":169}],171:[function(_dereq_,module,exports){ +},{"./1.0/numbers":165}],167:[function(_dereq_,module,exports){ 'use strict' var createTexture = _dereq_('gl-texture2d') @@ -25712,7 +25165,7 @@ function createFBO(gl, width, height, options) { WEBGL_draw_buffers) } -},{"gl-texture2d":227}],172:[function(_dereq_,module,exports){ +},{"gl-texture2d":223}],168:[function(_dereq_,module,exports){ var sprintf = _dereq_('sprintf-js').sprintf; var glConstants = _dereq_('gl-constants/lookup'); @@ -25767,7 +25220,7 @@ function formatCompilerError(errLog, src, type) { } -},{"add-line-numbers":18,"gl-constants/lookup":170,"glsl-shader-name":229,"sprintf-js":314}],173:[function(_dereq_,module,exports){ +},{"add-line-numbers":18,"gl-constants/lookup":166,"glsl-shader-name":225,"sprintf-js":304}],169:[function(_dereq_,module,exports){ 'use strict' module.exports = createHeatmap2D @@ -26119,7 +25572,7 @@ function createHeatmap2D (plot, options) { return heatmap } -},{"./lib/shaders":174,"binary-search-bounds":45,"gl-buffer":168,"gl-shader":218,"iota-array":244,"typedarray-pool":340}],174:[function(_dereq_,module,exports){ +},{"./lib/shaders":170,"binary-search-bounds":45,"gl-buffer":164,"gl-shader":214,"iota-array":238,"typedarray-pool":329}],170:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -26131,7 +25584,7 @@ module.exports = { pickVertex: glslify(["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"]) } -},{"glslify":237}],175:[function(_dereq_,module,exports){ +},{"glslify":233}],171:[function(_dereq_,module,exports){ module.exports = adjoint; /** @@ -26165,7 +25618,7 @@ function adjoint(out, a) { out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); return out; }; -},{}],176:[function(_dereq_,module,exports){ +},{}],172:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -26194,7 +25647,7 @@ function clone(a) { out[15] = a[15]; return out; }; -},{}],177:[function(_dereq_,module,exports){ +},{}],173:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -26223,7 +25676,7 @@ function copy(out, a) { out[15] = a[15]; return out; }; -},{}],178:[function(_dereq_,module,exports){ +},{}],174:[function(_dereq_,module,exports){ module.exports = create; /** @@ -26251,7 +25704,7 @@ function create() { out[15] = 1; return out; }; -},{}],179:[function(_dereq_,module,exports){ +},{}],175:[function(_dereq_,module,exports){ module.exports = determinant; /** @@ -26282,7 +25735,7 @@ function determinant(a) { // Calculate the determinant return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; }; -},{}],180:[function(_dereq_,module,exports){ +},{}],176:[function(_dereq_,module,exports){ module.exports = fromQuat; /** @@ -26330,7 +25783,7 @@ function fromQuat(out, q) { return out; }; -},{}],181:[function(_dereq_,module,exports){ +},{}],177:[function(_dereq_,module,exports){ module.exports = fromRotation /** @@ -26385,7 +25838,7 @@ function fromRotation(out, rad, axis) { return out } -},{}],182:[function(_dereq_,module,exports){ +},{}],178:[function(_dereq_,module,exports){ module.exports = fromRotationTranslation; /** @@ -26439,7 +25892,7 @@ function fromRotationTranslation(out, q, v) { return out; }; -},{}],183:[function(_dereq_,module,exports){ +},{}],179:[function(_dereq_,module,exports){ module.exports = fromScaling /** @@ -26473,7 +25926,7 @@ function fromScaling(out, v) { return out } -},{}],184:[function(_dereq_,module,exports){ +},{}],180:[function(_dereq_,module,exports){ module.exports = fromTranslation /** @@ -26507,7 +25960,7 @@ function fromTranslation(out, v) { return out } -},{}],185:[function(_dereq_,module,exports){ +},{}],181:[function(_dereq_,module,exports){ module.exports = fromXRotation /** @@ -26544,7 +25997,7 @@ function fromXRotation(out, rad) { out[15] = 1 return out } -},{}],186:[function(_dereq_,module,exports){ +},{}],182:[function(_dereq_,module,exports){ module.exports = fromYRotation /** @@ -26581,7 +26034,7 @@ function fromYRotation(out, rad) { out[15] = 1 return out } -},{}],187:[function(_dereq_,module,exports){ +},{}],183:[function(_dereq_,module,exports){ module.exports = fromZRotation /** @@ -26618,7 +26071,7 @@ function fromZRotation(out, rad) { out[15] = 1 return out } -},{}],188:[function(_dereq_,module,exports){ +},{}],184:[function(_dereq_,module,exports){ module.exports = frustum; /** @@ -26655,7 +26108,7 @@ function frustum(out, left, right, bottom, top, near, far) { out[15] = 0; return out; }; -},{}],189:[function(_dereq_,module,exports){ +},{}],185:[function(_dereq_,module,exports){ module.exports = identity; /** @@ -26683,7 +26136,7 @@ function identity(out) { out[15] = 1; return out; }; -},{}],190:[function(_dereq_,module,exports){ +},{}],186:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create') , clone: _dereq_('./clone') @@ -26716,7 +26169,7 @@ module.exports = { , str: _dereq_('./str') } -},{"./adjoint":175,"./clone":176,"./copy":177,"./create":178,"./determinant":179,"./fromQuat":180,"./fromRotation":181,"./fromRotationTranslation":182,"./fromScaling":183,"./fromTranslation":184,"./fromXRotation":185,"./fromYRotation":186,"./fromZRotation":187,"./frustum":188,"./identity":189,"./invert":191,"./lookAt":192,"./multiply":193,"./ortho":194,"./perspective":195,"./perspectiveFromFieldOfView":196,"./rotate":197,"./rotateX":198,"./rotateY":199,"./rotateZ":200,"./scale":201,"./str":202,"./translate":203,"./transpose":204}],191:[function(_dereq_,module,exports){ +},{"./adjoint":171,"./clone":172,"./copy":173,"./create":174,"./determinant":175,"./fromQuat":176,"./fromRotation":177,"./fromRotationTranslation":178,"./fromScaling":179,"./fromTranslation":180,"./fromXRotation":181,"./fromYRotation":182,"./fromZRotation":183,"./frustum":184,"./identity":185,"./invert":187,"./lookAt":188,"./multiply":189,"./ortho":190,"./perspective":191,"./perspectiveFromFieldOfView":192,"./rotate":193,"./rotateX":194,"./rotateY":195,"./rotateZ":196,"./scale":197,"./str":198,"./translate":199,"./transpose":200}],187:[function(_dereq_,module,exports){ module.exports = invert; /** @@ -26772,7 +26225,7 @@ function invert(out, a) { return out; }; -},{}],192:[function(_dereq_,module,exports){ +},{}],188:[function(_dereq_,module,exports){ var identity = _dereq_('./identity'); module.exports = lookAt; @@ -26863,7 +26316,7 @@ function lookAt(out, eye, center, up) { return out; }; -},{"./identity":189}],193:[function(_dereq_,module,exports){ +},{"./identity":185}],189:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -26906,7 +26359,7 @@ function multiply(out, a, b) { out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; return out; }; -},{}],194:[function(_dereq_,module,exports){ +},{}],190:[function(_dereq_,module,exports){ module.exports = ortho; /** @@ -26943,7 +26396,7 @@ function ortho(out, left, right, bottom, top, near, far) { out[15] = 1; return out; }; -},{}],195:[function(_dereq_,module,exports){ +},{}],191:[function(_dereq_,module,exports){ module.exports = perspective; /** @@ -26977,7 +26430,7 @@ function perspective(out, fovy, aspect, near, far) { out[15] = 0; return out; }; -},{}],196:[function(_dereq_,module,exports){ +},{}],192:[function(_dereq_,module,exports){ module.exports = perspectiveFromFieldOfView; /** @@ -27019,7 +26472,7 @@ function perspectiveFromFieldOfView(out, fov, near, far) { } -},{}],197:[function(_dereq_,module,exports){ +},{}],193:[function(_dereq_,module,exports){ module.exports = rotate; /** @@ -27084,7 +26537,7 @@ function rotate(out, a, rad, axis) { } return out; }; -},{}],198:[function(_dereq_,module,exports){ +},{}],194:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -27129,7 +26582,7 @@ function rotateX(out, a, rad) { out[11] = a23 * c - a13 * s; return out; }; -},{}],199:[function(_dereq_,module,exports){ +},{}],195:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -27174,7 +26627,7 @@ function rotateY(out, a, rad) { out[11] = a03 * s + a23 * c; return out; }; -},{}],200:[function(_dereq_,module,exports){ +},{}],196:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -27219,7 +26672,7 @@ function rotateZ(out, a, rad) { out[7] = a13 * c - a03 * s; return out; }; -},{}],201:[function(_dereq_,module,exports){ +},{}],197:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -27251,7 +26704,7 @@ function scale(out, a, v) { out[15] = a[15]; return out; }; -},{}],202:[function(_dereq_,module,exports){ +},{}],198:[function(_dereq_,module,exports){ module.exports = str; /** @@ -27266,7 +26719,7 @@ function str(a) { a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; }; -},{}],203:[function(_dereq_,module,exports){ +},{}],199:[function(_dereq_,module,exports){ module.exports = translate; /** @@ -27305,7 +26758,7 @@ function translate(out, a, v) { return out; }; -},{}],204:[function(_dereq_,module,exports){ +},{}],200:[function(_dereq_,module,exports){ module.exports = transpose; /** @@ -27355,7 +26808,7 @@ function transpose(out, a) { return out; }; -},{}],205:[function(_dereq_,module,exports){ +},{}],201:[function(_dereq_,module,exports){ 'use strict' module.exports = createBoxes @@ -27418,7 +26871,7 @@ function createBoxes(plot) { return new Boxes(plot, vbo, shader) } -},{"./shaders":208,"gl-buffer":168,"gl-shader":218}],206:[function(_dereq_,module,exports){ +},{"./shaders":204,"gl-buffer":164,"gl-shader":214}],202:[function(_dereq_,module,exports){ 'use strict' module.exports = createGrid @@ -27665,7 +27118,7 @@ function createGrid(plot) { return grid } -},{"./shaders":208,"binary-search-bounds":45,"gl-buffer":168,"gl-shader":218}],207:[function(_dereq_,module,exports){ +},{"./shaders":204,"binary-search-bounds":45,"gl-buffer":164,"gl-shader":214}],203:[function(_dereq_,module,exports){ 'use strict' module.exports = createLines @@ -27730,7 +27183,7 @@ function createLines(plot) { return lines } -},{"./shaders":208,"gl-buffer":168,"gl-shader":218}],208:[function(_dereq_,module,exports){ +},{"./shaders":204,"gl-buffer":164,"gl-shader":214}],204:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -27748,7 +27201,7 @@ module.exports = { tickVert: glslify(["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"]) } -},{"glslify":210}],209:[function(_dereq_,module,exports){ +},{"glslify":206}],205:[function(_dereq_,module,exports){ 'use strict' module.exports = createTextElements @@ -28026,7 +27479,7 @@ function createTextElements(plot) { return text } -},{"./shaders":208,"binary-search-bounds":45,"gl-buffer":168,"gl-shader":218,"text-cache":321}],210:[function(_dereq_,module,exports){ +},{"./shaders":204,"binary-search-bounds":45,"gl-buffer":164,"gl-shader":214,"text-cache":311}],206:[function(_dereq_,module,exports){ module.exports = function(strings) { if (typeof strings === 'string') strings = [strings] var exprs = [].slice.call(arguments,1) @@ -28038,7 +27491,7 @@ module.exports = function(strings) { return parts.join('') } -},{}],211:[function(_dereq_,module,exports){ +},{}],207:[function(_dereq_,module,exports){ 'use strict' module.exports = createGLPlot2D @@ -28621,7 +28074,7 @@ function createGLPlot2D(options) { return plot } -},{"./lib/box":205,"./lib/grid":206,"./lib/line":207,"./lib/text":209,"gl-select-static":217}],212:[function(_dereq_,module,exports){ +},{"./lib/box":201,"./lib/grid":202,"./lib/line":203,"./lib/text":205,"gl-select-static":213}],208:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') exports.pointVertex = glslify(["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}"]) @@ -28629,7 +28082,7 @@ exports.pointFragment = glslify(["precision mediump float;\n#define GLSLIFY exports.pickVertex = glslify(["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"]) exports.pickFragment = glslify(["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"]) -},{"glslify":237}],213:[function(_dereq_,module,exports){ +},{"glslify":233}],209:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -28849,7 +28302,7 @@ function createPointcloud2D(plot, options) { return result } -},{"./lib/shader":212,"gl-buffer":168,"gl-shader":218,"typedarray-pool":340}],214:[function(_dereq_,module,exports){ +},{"./lib/shader":208,"gl-buffer":164,"gl-shader":214,"typedarray-pool":329}],210:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -28857,9 +28310,9 @@ var glslify = _dereq_('glslify') exports.boxVertex = glslify(["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"]) exports.boxFragment = glslify(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"]) -},{"glslify":215}],215:[function(_dereq_,module,exports){ -arguments[4][210][0].apply(exports,arguments) -},{"dup":210}],216:[function(_dereq_,module,exports){ +},{"glslify":211}],211:[function(_dereq_,module,exports){ +arguments[4][206][0].apply(exports,arguments) +},{"dup":206}],212:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -28985,7 +28438,7 @@ function createSelectBox(plot, options) { return selectBox } -},{"./lib/shaders":214,"gl-buffer":168,"gl-shader":218}],217:[function(_dereq_,module,exports){ +},{"./lib/shaders":210,"gl-buffer":164,"gl-shader":214}],213:[function(_dereq_,module,exports){ 'use strict' module.exports = createSelectBuffer @@ -29170,7 +28623,7 @@ function createSelectBuffer(gl, shape) { return new SelectBuffer(gl, fbo, buffer) } -},{"bit-twiddle":46,"gl-fbo":171,"ndarray":261,"typedarray-pool":340}],218:[function(_dereq_,module,exports){ +},{"bit-twiddle":46,"gl-fbo":167,"ndarray":255,"typedarray-pool":329}],214:[function(_dereq_,module,exports){ 'use strict' var createUniformWrapper = _dereq_('./lib/create-uniforms') @@ -29436,7 +28889,7 @@ function createShader( module.exports = createShader -},{"./lib/GLError":219,"./lib/create-attributes":220,"./lib/create-uniforms":221,"./lib/reflect":222,"./lib/runtime-reflect":223,"./lib/shader-cache":224}],219:[function(_dereq_,module,exports){ +},{"./lib/GLError":215,"./lib/create-attributes":216,"./lib/create-uniforms":217,"./lib/reflect":218,"./lib/runtime-reflect":219,"./lib/shader-cache":220}],215:[function(_dereq_,module,exports){ function GLError (rawError, shortMessage, longMessage) { this.shortMessage = shortMessage || '' this.longMessage = longMessage || '' @@ -29451,7 +28904,7 @@ GLError.prototype.name = 'GLError' GLError.prototype.constructor = GLError module.exports = GLError -},{}],220:[function(_dereq_,module,exports){ +},{}],216:[function(_dereq_,module,exports){ 'use strict' module.exports = createAttributeWrapper @@ -29512,6 +28965,40 @@ Object.defineProperty(proto, 'location', { } }) +var allFns = [ + function (gl, v, x0) { + if (x0.length === undefined) { + return gl.vertexAttrib1f(v, x0) + } else { + return gl.vertexAttrib1fv(v, x0) + } + }, + + function (gl, v, x0, x1) { + if (x0.length === undefined) { + return gl.vertexAttrib2f(v, x0, x1) + } else { + return gl.vertexAttrib2fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2) { + if (x0.length === undefined) { + return gl.vertexAttrib3f(v, x0, x1, x2) + } else { + return gl.vertexAttrib3fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2, x3) { + if (x0.length === undefined) { + return gl.vertexAttrib4f(v, x0, x1, x2, x3) + } else { + return gl.vertexAttrib4fv(v, x0) + } + } +] + //Adds a vector attribute to obj function addVectorAttribute( gl @@ -29522,21 +29009,7 @@ function addVectorAttribute( , obj , name) { - //Construct constant function - var constFuncArgs = [ 'gl', 'v' ] - var varNames = [] - for(var i=0; i 4) { - throw new GLError('', 'Invalid data type') + function makeSetter(type) { + return function updateProperty(obj){ + var indices = enumerateIndices('', type) + for(var i=0; i 4) { - throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + type) + var vidx = t.indexOf('vec') + if(0 <= vidx && vidx <= 1 && t.length === 4 + vidx) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type') + } + switch(t.charAt(0)) { + case 'b': + case 'i': + gl['uniform' + d + 'iv'](locations[idx], objPath) + break + case 'v': + gl['uniform' + d + 'fv'](locations[idx], objPath) + break + default: + throw new GLError('', 'Unrecognized data type for vector ' + name + ': ' + t) + } + } else if(t.indexOf('mat') === 0 && t.length === 4) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + t) + } + gl['uniformMatrix' + d + 'fv'](locations[idx], false, objPath) + break + } else { + throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + t) + } } - return 'gl.uniformMatrix' + d + 'fv(locations[' + index + '],false,obj' + path + ')' - } else { - throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + type) } - break + } } } @@ -29810,21 +29317,6 @@ function createUniformWrapper(gl, wrapper, uniforms, locations) { return indices } - function makeSetter(type) { - var code = [ 'return function updateProperty(obj){' ] - var indices = enumerateIndices('', type) - for(var i=0; i>=' @@ -32551,7 +32042,7 @@ module.exports = [ , '}' ] -},{}],236:[function(_dereq_,module,exports){ +},{}],232:[function(_dereq_,module,exports){ var tokenize = _dereq_('./index') module.exports = tokenizeString @@ -32566,9 +32057,9 @@ function tokenizeString(str, opt) { return tokens } -},{"./index":230}],237:[function(_dereq_,module,exports){ -arguments[4][210][0].apply(exports,arguments) -},{"dup":210}],238:[function(_dereq_,module,exports){ +},{"./index":226}],233:[function(_dereq_,module,exports){ +arguments[4][206][0].apply(exports,arguments) +},{"dup":206}],234:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict' @@ -32585,7 +32076,7 @@ else { module.exports = hasHover }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"is-browser":245}],239:[function(_dereq_,module,exports){ +},{"is-browser":239}],235:[function(_dereq_,module,exports){ 'use strict' var isBrowser = _dereq_('is-browser') @@ -32611,7 +32102,7 @@ function detect() { module.exports = isBrowser && detect() -},{"is-browser":245}],240:[function(_dereq_,module,exports){ +},{"is-browser":239}],236:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -32697,7 +32188,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],241:[function(_dereq_,module,exports){ +},{}],237:[function(_dereq_,module,exports){ "use strict" var bounds = _dereq_("binary-search-bounds") @@ -33064,81 +32555,7 @@ function createWrapper(intervals) { return new IntervalTree(createIntervalTree(intervals)) } -},{"binary-search-bounds":242}],242:[function(_dereq_,module,exports){ -"use strict" - -function compileSearch(funcName, predicate, reversed, extraArgs, useNdarray, earlyOut) { - var code = [ - "function ", funcName, "(a,l,h,", extraArgs.join(","), "){", -earlyOut ? "" : "var i=", (reversed ? "l-1" : "h+1"), -";while(l<=h){\ -var m=(l+h)>>>1,x=a", useNdarray ? ".get(m)" : "[m]"] - if(earlyOut) { - if(predicate.indexOf("c") < 0) { - code.push(";if(x===y){return m}else if(x<=y){") - } else { - code.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){") - } - } else { - code.push(";if(", predicate, "){i=m;") - } - if(reversed) { - code.push("l=m+1}else{h=m-1}") - } else { - code.push("h=m-1}else{l=m+1}") - } - code.push("}") - if(earlyOut) { - code.push("return -1};") - } else { - code.push("return i};") - } - return code.join("") -} - -function compileBoundsSearch(predicate, reversed, suffix, earlyOut) { - var result = new Function([ - compileSearch("A", "x" + predicate + "y", reversed, ["y"], false, earlyOut), - compileSearch("B", "x" + predicate + "y", reversed, ["y"], true, earlyOut), - compileSearch("P", "c(x,y)" + predicate + "0", reversed, ["y", "c"], false, earlyOut), - compileSearch("Q", "c(x,y)" + predicate + "0", reversed, ["y", "c"], true, earlyOut), -"function dispatchBsearch", suffix, "(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", suffix].join("")) - return result() -} - -module.exports = { - ge: compileBoundsSearch(">=", false, "GE"), - gt: compileBoundsSearch(">", false, "GT"), - lt: compileBoundsSearch("<", true, "LT"), - le: compileBoundsSearch("<=", true, "LE"), - eq: compileBoundsSearch("-", true, "EQ", true) -} - -},{}],243:[function(_dereq_,module,exports){ -"use strict" - -function invertPermutation(pi, result) { - result = result || new Array(pi.length) - for(var i=0; i 0) { - stepVal.push(stride(i, order[j-1]) + "*" + shape(order[j-1]) ) - } - vars.push(step(i,order[j]) + "=(" + stepVal.join("-") + ")|0") - } - } - //Create index variables - for(var i=0; i=0; --i) { - sizeVariable.push(shape(order[i])) - } - //Previous phases and vertex_ids - vars.push(POOL_SIZE + "=(" + sizeVariable.join("*") + ")|0", - PHASES + "=mallocUint32(" + POOL_SIZE + ")", - VERTEX_IDS + "=mallocUint32(" + POOL_SIZE + ")", - POINTER + "=0") - //Create cube variables for phases - vars.push(pcube(0) + "=0") - for(var j=1; j<(1< 0) { + i1 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } } - } - cubeStep.push(shape(order[k])) - } - var signFlag = "" - if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) { - signFlag = "-" - } - var jperm = permBitmask(dimension, j, order) - vars.push(pdelta(jperm) + "=(-" + cubeDelta.join("-") + ")|0", - qcube(jperm) + "=(" + signFlag + cubeDelta.join("-") + ")|0", - pcube(jperm) + "=0") - } - vars.push(vert(0) + "=0", TEMPORARY + "=0") - - function forLoopBegin(i, start) { - code.push("for(", index(order[i]), "=", start, ";", - index(order[i]), "<", shape(order[i]), ";", - "++", index(order[i]), "){") - } - - function forLoopEnd(i) { - for(var j=0; j=0; --i) { - forLoopBegin(i, 0) - } - var phaseFuncArgs = [] - for(var i=0; i 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } + } + if (i1 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_1 } - vertexArgs.push(cube(i,j)) } + freeUint32(V) + freeUint32(P) } - for(var i=0; i<(1<0; k=(k-1)&subset) { - faceArgs.push(VERTEX_IDS + "[" + POINTER + "+" + pdelta(k) + "]") - } - faceArgs.push(vert(0)) - for(var k=0; k 0) { + i0 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + if (s1 > 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 } } - if(j&1) { - faceArgs.push(corner, edge) - } else { - faceArgs.push(edge, corner) - } - for(var k=0; k 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + } + } + if (i0 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_0 } - code.push("if(", corner, "!==", edge, "){", - "face(", faceArgs.join(), ")}") } + freeUint32(V) + freeUint32(P) } - - //Increment pointer, close off if statement - code.push("}", - POINTER, "+=1;") - } + }, +} - function flip() { - for(var j=1; j<(1<0){", - index(order[i]), "=1;") - createLoop(i-1, mask|(1< 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] * Y0 + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + }, + 'float32,1,0,float32,1,0': function () { + return function assign_cwise_loop_1s0m2f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + }, + 'float32,1,0,float32,0,1': function () { + return function assign_cwise_loop_1s0m0f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[1] | 0; j0 > 0;) { + if (j0 < 64) { + s1 = j0 + j0 = 0 + } else { + s1 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + p0 = (offset0 + j0 * t0p1 + j1 * t0p0) + p1 = (offset1 + j0 * t1p1 + j1 * t1p0) + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + } + } + }, + 'uint8,2,0,1,uint8,1,2,0': function () { + return function assign_cwise_loop_2s0s1m0u8(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[2] | 0; j0 > 0;) { + if (j0 < 64) { + s2 = j0 + j0 = 0 + } else { + s2 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j0 * t0p2 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j0 * t1p2 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + } + }, + 'uint8,2,0,1,array,2,0,1': function () { + return function assign_cwise_loop_2s0s1m3u8a(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + }, +} -var EmptyProc = { - body: "", - args: [], - thisVars: [], - localVars: [] +//Generates a cwise operator +function generateCWiseOp(proc, typesig) { + var key = typesig.join(',') + var f = CACHED_CWiseOp[key] + return f() } -function fixup(x) { - if(!x) { - return EmptyProc - } - for(var i=0; i>", - rrshift: ">>>" } ;(function(){ for(var id in assign_ops) { - var op = assign_ops[id] - exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a","b","c"], - body: "a=b"+op+"c"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array","array"], - body: {args:["a","b"], - body:"a"+op+"=b"}, - rvalue: true, - funcName: id+"eq" - }) - exports[id+"s"] = makeOp({ - args: ["array", "array", "scalar"], - body: {args:["a","b","s"], - body:"a=b"+op+"s"}, - funcName: id+"s" - }) - exports[id+"seq"] = makeOp({ - args: ["array","scalar"], - body: {args:["a","s"], - body:"a"+op+"=s"}, - rvalue: true, - funcName: id+"seq" - }) - } -})(); - -var unary_ops = { - not: "!", - bnot: "~", - neg: "-", - recip: "1.0/" -} -;(function(){ - for(var id in unary_ops) { - var op = unary_ops[id] - exports[id] = makeOp({ - args: ["array", "array"], - body: {args:["a","b"], - body:"a="+op+"b"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array"], - body: {args:["a"], - body:"a="+op+"a"}, - rvalue: true, - count: 2, - funcName: id+"eq" - }) - } -})(); - -var binary_ops = { - and: "&&", - or: "||", - eq: "===", - neq: "!==", - lt: "<", - gt: ">", - leq: "<=", - geq: ">=" -} -;(function() { - for(var id in binary_ops) { - var op = binary_ops[id] exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a", "b", "c"], - body:"a=b"+op+"c"}, funcName: id }) exports[id+"s"] = makeOp({ - args: ["array","array","scalar"], - body: {args:["a", "b", "s"], - body:"a=b"+op+"s"}, funcName: id+"s" }) - exports[id+"eq"] = makeOp({ - args: ["array", "array"], - body: {args:["a", "b"], - body:"a=a"+op+"b"}, - rvalue:true, - count:2, - funcName: id+"eq" - }) exports[id+"seq"] = makeOp({ - args: ["array", "scalar"], - body: {args:["a","s"], - body:"a=a"+op+"s"}, - rvalue:true, - count:2, funcName: id+"seq" }) } })(); -var math_unary = [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan" -] -;(function() { - for(var i=0; ithis_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" -}) - -exports.norm1 = compile({ - args:["array"], - pre: {args:[], localVars:[], thisVars:["this_s"], body:"this_s=0"}, - body: {args:[{name:"a", lvalue:false, rvalue:true, 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" -}) - -exports.sup = compile({ - 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":false,"rvalue":true,"count":2} ], - thisVars: [ "this_h" ], - localVars: [] }, - post: - { body: "return this_h", - args: [], - thisVars: [ "this_h" ], - localVars: [] } - }) - -exports.inf = compile({ - args: [ "array" ], - pre: - { body: "this_h=Infinity", - args: [], - thisVars: [ "this_h" ], - localVars: [] }, - body: - { body: "if(_inline_1_arg0_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:false,rvalue:true,count:2}, - {name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:2}], - thisVars:["this_i","this_v"], - localVars:["_inline_1_k"]}, - post:{ - body:"{return this_i}", - args:[], - thisVars:["this_i"], - localVars:[]} -}) - -exports.random = makeOp({ - args: ["array"], - pre: {args:[], body:"this_f=Math.random", thisVars:["this_f"]}, - body: {args: ["a"], body:"a=this_f()", thisVars:["this_f"]}, - funcName: "random" -}) - exports.assign = makeOp({ - args:["array", "array"], - body: {args:["a", "b"], body:"a=b"}, funcName: "assign" }) -exports.assigns = makeOp({ - args:["array", "scalar"], - body: {args:["a", "b"], body:"a=b"}, - funcName: "assigns" }) - - -exports.equals = compile({ - args:["array", "array"], - pre: EmptyProc, - body: {args:[{name:"x", lvalue:false, rvalue:true, count:1}, - {name:"y", lvalue:false, rvalue:true, count:1}], - body: "if(x!==y){return false}", - localVars: [], - thisVars: []}, - post: {args:[], localVars:[], thisVars:[], body:"return true"}, - funcName: "equals" -}) - - - -},{"cwise-compiler":85}],261:[function(_dereq_,module,exports){ -var iota = _dereq_("iota-array") +},{}],255:[function(_dereq_,module,exports){ var isBuffer = _dereq_("is-buffer") var hasTypedArrays = ((typeof Float64Array) !== "undefined") @@ -34909,234 +34220,883 @@ function order() { return result } -function compileConstructor(dtype, dimension) { - var className = ["View", dimension, "d", dtype].join("") - if(dimension < 0) { - className = "View_Nil" + dtype - } - var useGetters = (dtype === "generic") - - if(dimension === -1) { - //Special case for trivial arrays - var code = - "function "+className+"(a){this.data=a;};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"(this.data);};\ -proto.get=proto.set=function(){};\ -proto.pick=function(){return null};\ -return function construct_"+className+"(a){return new "+className+"(a);}" - var procedure = new Function(code) - return procedure() - } else if(dimension === 0) { - //Special case for 0d arrays - var code = - "function "+className+"(a,d) {\ -this.data = a;\ -this.offset = d\ -};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"_copy() {\ -return new "+className+"(this.data,this.offset)\ -};\ -proto.pick=function "+className+"_pick(){\ -return TrivialArray(this.data);\ -};\ -proto.valueOf=proto.get=function "+className+"_get(){\ -return "+(useGetters ? "this.data.get(this.offset)" : "this.data[this.offset]")+ -"};\ -proto.set=function "+className+"_set(v){\ -return "+(useGetters ? "this.data.set(this.offset,v)" : "this.data[this.offset]=v")+"\ -};\ -return function construct_"+className+"(a,b,c,d){return new "+className+"(a,d)}" - var procedure = new Function("TrivialArray", code) - return procedure(CACHED_CONSTRUCTORS[dtype][0]) - } - - var code = ["'use strict'"] - - //Create constructor for view - var indices = iota(dimension) - var args = indices.map(function(i) { return "i"+i }) - var index_str = "this.offset+" + indices.map(function(i) { - return "this.stride[" + i + "]*i" + i - }).join("+") - var shapeArg = indices.map(function(i) { - return "b"+i - }).join(",") - var strideArg = indices.map(function(i) { - return "c"+i - }).join(",") - code.push( - "function "+className+"(a," + shapeArg + "," + strideArg + ",d){this.data=a", - "this.shape=[" + shapeArg + "]", - "this.stride=[" + strideArg + "]", - "this.offset=d|0}", - "var proto="+className+".prototype", - "proto.dtype='"+dtype+"'", - "proto.dimension="+dimension) - - //view.size: - code.push("Object.defineProperty(proto,'size',{get:function "+className+"_size(){\ -return "+indices.map(function(i) { return "this.shape["+i+"]" }).join("*"), -"}})") - - //view.order: - if(dimension === 1) { - code.push("proto.order=[0]") - } else { - code.push("Object.defineProperty(proto,'order',{get:") - if(dimension < 4) { - code.push("function "+className+"_order(){") - if(dimension === 2) { - code.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})") - } else if(dimension === 3) { - code.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];\ -}}})") - } - } else { - code.push("ORDER})") +var allFns = { + // Special case for trivial arrays + T: function (dtype) { + function View(a) { + this.data = a } - } + var proto = View.prototype + proto.dtype = dtype + 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 View(this.data) + } + proto.get = proto.set = function () {} + proto.pick = function () { + return null + } + return function construct(a) { + return new View(a) + } + }, - //view.set(i0, ..., v): - code.push( -"proto.set=function "+className+"_set("+args.join(",")+",v){") - if(useGetters) { - code.push("return this.data.set("+index_str+",v)}") - } else { - code.push("return this.data["+index_str+"]=v}") - } + // Special case for 0d arrays + 0: function (dtype, TrivialArray) { + function View(a, d) { + this.data = a + this.offset = d + } + var proto = View.prototype + proto.dtype = dtype + 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 copy() { + return new View(this.data, this.offset) + } + proto.pick = function pick() { + return TrivialArray(this.data) + } + proto.valueOf = proto.get = function get() { + return dtype === "generic" ? this.data.get(this.offset) : this.data[this.offset] + } + proto.set = function set(v) { + return dtype === "generic" ? this.data.set(this.offset, v) : (this.data[this.offset] = v) + } + return function construct(a, b, c, d) { + return new View(a, d) + } + }, - //view.get(i0, ...): - code.push("proto.get=function "+className+"_get("+args.join(",")+"){") - if(useGetters) { - code.push("return this.data.get("+index_str+")}") - } else { - code.push("return this.data["+index_str+"]}") - } - - //view.index: - code.push( - "proto.index=function "+className+"_index(", args.join(), "){return "+index_str+"}") - - //view.hi(): - code.push("proto.hi=function "+className+"_hi("+args.join(",")+"){return new "+className+"(this.data,"+ - indices.map(function(i) { - return ["(typeof i",i,"!=='number'||i",i,"<0)?this.shape[", i, "]:i", i,"|0"].join("") - }).join(",")+","+ - indices.map(function(i) { - return "this.stride["+i + "]" - }).join(",")+",this.offset)}") - - //view.lo(): - var a_vars = indices.map(function(i) { return "a"+i+"=this.shape["+i+"]" }) - var c_vars = indices.map(function(i) { return "c"+i+"=this.stride["+i+"]" }) - code.push("proto.lo=function "+className+"_lo("+args.join(",")+"){var b=this.offset,d=0,"+a_vars.join(",")+","+c_vars.join(",")) - for(var i=0; i=0){\ -d=i"+i+"|0;\ -b+=c"+i+"*d;\ -a"+i+"-=d}") - } - code.push("return new "+className+"(this.data,"+ - indices.map(function(i) { - return "a"+i - }).join(",")+","+ - indices.map(function(i) { - return "c"+i - }).join(",")+",b)}") - - //view.step(): - code.push("proto.step=function "+className+"_step("+args.join(",")+"){var "+ - indices.map(function(i) { - return "a"+i+"=this.shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "b"+i+"=this.stride["+i+"]" - }).join(",")+",c=this.offset,d=0,ceil=Math.ceil") - for(var i=0; i= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + return new View(this.data, a0, c0, b) + } + proto.step = function step(i0) { + var a0 = this.shape[0], + b0 = this.stride[0], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + return new View(this.data, a0, b0, c) + } + proto.transpose = function transpose(i0) { + i0 = i0 === undefined ? 0 : i0 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], b[i0], this.offset) + } + proto.pick = function pick(i0) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], stride[0], offset) + } + }, + 2: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, c0, c1, d) { + this.data = a + this.shape = [b0, b1] + this.stride = [c0, c1] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 2 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + return Math.abs(this.stride[0]) > Math.abs(this.stride[1]) ? [1, 0] : [0, 1] + }, + }) + proto.set = function set(i0, i1, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] = v) + } + proto.get = function get(i0, i1) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] + } + proto.index = function index(i0, i1) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + } + proto.hi = function hi(i0, i1) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + this.stride[0], + this.stride[1], + this.offset + ) + } + proto.lo = function lo(i0, i1) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + c0 = this.stride[0], + c1 = this.stride[1] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + return new View(this.data, a0, a1, c0, c1, b) + } + proto.step = function step(i0, i1) { + var a0 = this.shape[0], + a1 = this.shape[1], + b0 = this.stride[0], + b1 = this.stride[1], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + return new View(this.data, a0, a1, b0, b1, c) + } + proto.transpose = function transpose(i0, i1) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], b[i0], b[i1], this.offset) + } + proto.pick = function pick(i0, i1) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], stride[0], stride[1], offset) + } + }, + 3: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, c0, c1, c2, d) { + this.data = a + this.shape = [b0, b1, b2] + this.stride = [c0, c1, c2] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 3 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + 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] + } + }, + }) + proto.set = function set(i0, i1, i2, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] = v) + } + proto.get = function get(i0, i1, i2) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] + } + proto.index = function index(i0, i1, i2) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + } + proto.hi = function hi(i0, i1, i2) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + return new View(this.data, a0, a1, a2, c0, c1, c2, b) + } + proto.step = function step(i0, i1, i2) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + return new View(this.data, a0, a1, a2, b0, b1, b2, c) + } + proto.transpose = function transpose(i0, i1, i2) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], b[i0], b[i1], b[i2], this.offset) + } + proto.pick = function pick(i0, i1, i2) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], stride[0], stride[1], stride[2], offset) + } + }, + 4: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, c0, c1, c2, c3, d) { + this.data = a + this.shape = [b0, b1, b2, b3] + this.stride = [c0, c1, c2, c3] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 4 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] = v) + } + proto.get = function get(i0, i1, i2, i3) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] + } + proto.index = function index(i0, i1, i2, i3) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3 + } + proto.hi = function hi(i0, i1, i2, i3) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + return new View(this.data, a0, a1, a2, a3, c0, c1, c2, c3, b) + } + proto.step = function step(i0, i1, i2, i3) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + return new View(this.data, a0, a1, a2, a3, b0, b1, b2, b3, c) + } + proto.transpose = function transpose(i0, i1, i2, i3) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], b[i0], b[i1], b[i2], b[i3], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], shape[3], stride[0], stride[1], stride[2], stride[3], offset) + } + }, + 5: function anonymous(dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, b4, c0, c1, c2, c3, c4, d) { + this.data = a + this.shape = [b0, b1, b2, b3, b4] + this.stride = [c0, c1, c2, c3, c4] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 5 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] * this.shape[4] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, i4, v) { + return dtype === "generic" + ? this.data.set( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4, + v + ) + : (this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] = v) + } + proto.get = function get(i0, i1, i2, i3, i4) { + return dtype === "generic" + ? this.data.get( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + : this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] + } + proto.index = function index(i0, i1, i2, i3, i4) { + return ( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + } + proto.hi = function hi(i0, i1, i2, i3, i4) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + typeof i4 !== "number" || i4 < 0 ? this.shape[4] : i4 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.stride[4], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3, i4) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3], + c4 = this.stride[4] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + if (typeof i4 === "number" && i4 >= 0) { + d = i4 | 0 + b += c4 * d + a4 -= d + } + return new View(this.data, a0, a1, a2, a3, a4, c0, c1, c2, c3, c4, b) + } + proto.step = function step(i0, i1, i2, i3, i4) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + b4 = this.stride[4], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + if (typeof i4 === "number") { + d = i4 | 0 + if (d < 0) { + c += b4 * (a4 - 1) + a4 = ceil(-a4 / d) + } else { + a4 = ceil(a4 / d) + } + b4 *= d + } + return new View(this.data, a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, c) + } + proto.transpose = function transpose(i0, i1, i2, i3, i4) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + i4 = i4 === undefined ? 4 : i4 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], a[i4], b[i0], b[i1], b[i2], b[i3], b[i4], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3, i4) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + if (typeof i4 === "number" && i4 >= 0) { + c = (c + this.stride[4] * i4) | 0 + } else { + a.push(this.shape[4]) + b.push(this.stride[4]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View( + data, + shape[0], + shape[1], + shape[2], + shape[3], + shape[4], + stride[0], + stride[1], + stride[2], + stride[3], + stride[4], + offset + ) + } + }, +} - //view.pick(): - code.push("proto.pick=function "+className+"_pick("+args+"){var a=[],b=[],c=this.offset") - for(var i=0; i=0){c=(c+this.stride["+i+"]*i"+i+")|0}else{a.push(this.shape["+i+"]);b.push(this.stride["+i+"])}") - } - code.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}") - //Add return statement - code.push("return function construct_"+className+"(data,shape,stride,offset){return new "+className+"(data,"+ - indices.map(function(i) { - return "shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "stride["+i+"]" - }).join(",")+",offset)}") +function compileConstructor(inType, inDimension) { + var dKey = inDimension === -1 ? 'T' : String(inDimension) - //Compile procedure - var procedure = new Function("CTOR_LIST", "ORDER", code.join("\n")) - return procedure(CACHED_CONSTRUCTORS[dtype], order) + var procedure = allFns[dKey] + if(inDimension === -1) { + return procedure(inType) + } else if(inDimension === 0) { + return procedure(inType, CACHED_CONSTRUCTORS[inType][0]) + } + return procedure(inType, CACHED_CONSTRUCTORS[inType], order) } function arrayDType(data) { @@ -35155,14 +35115,14 @@ function arrayDType(data) { return "int16" case "[object Int32Array]": return "int32" + case "[object Uint8ClampedArray]": + return "uint8_clamped" case "[object Uint8Array]": return "uint8" case "[object Uint16Array]": return "uint16" case "[object Uint32Array]": return "uint32" - case "[object Uint8ClampedArray]": - return "uint8_clamped" case "[object BigInt64Array]": return "bigint64" case "[object BigUint64Array]": @@ -35176,20 +35136,22 @@ function arrayDType(data) { } var CACHED_CONSTRUCTORS = { + "generic":[], + "buffer":[], + "array":[], + + // typed arrays "float32":[], "float64":[], "int8":[], "int16":[], "int32":[], + "uint8_clamped":[], "uint8":[], "uint16":[], "uint32":[], - "array":[], - "uint8_clamped":[], "bigint64": [], - "biguint64": [], - "buffer":[], - "generic":[] + "biguint64": [] } ;(function() { @@ -35224,10 +35186,10 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { } } } - var dtype = arrayDType(data) - var ctor_list = CACHED_CONSTRUCTORS[dtype] + var inType = arrayDType(data) + var ctor_list = CACHED_CONSTRUCTORS[inType] while(ctor_list.length <= d+1) { - ctor_list.push(compileConstructor(dtype, ctor_list.length-1)) + ctor_list.push(compileConstructor(inType, ctor_list.length-1)) } var ctor = ctor_list[d+1] return ctor(data, shape, stride, offset) @@ -35235,7 +35197,7 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { module.exports = wrappedNDArrayCtor -},{"iota-array":244,"is-buffer":246}],262:[function(_dereq_,module,exports){ +},{"is-buffer":240}],256:[function(_dereq_,module,exports){ "use strict" var doubleBits = _dereq_("double-bits") @@ -35278,7 +35240,7 @@ function nextafter(x, y) { } return doubleBits.pack(lo, hi) } -},{"double-bits":96}],263:[function(_dereq_,module,exports){ +},{"double-bits":93}],257:[function(_dereq_,module,exports){ var π = Math.PI var _120 = radians(120) @@ -35480,7 +35442,7 @@ function radians(degress){ return degress * (π / 180) } -},{}],264:[function(_dereq_,module,exports){ +},{}],258:[function(_dereq_,module,exports){ /* object-assign (c) Sindre Sorhus @@ -35572,7 +35534,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],265:[function(_dereq_,module,exports){ +},{}],259:[function(_dereq_,module,exports){ /*! * pad-left * @@ -35588,7 +35550,7 @@ module.exports = function padLeft(str, num, ch) { ch = typeof ch !== 'undefined' ? (ch + '') : ' '; return repeat(ch, num) + str; }; -},{"repeat-string":298}],266:[function(_dereq_,module,exports){ +},{"repeat-string":289}],260:[function(_dereq_,module,exports){ 'use strict' /** @@ -35725,7 +35687,7 @@ parenthesis.stringify = stringify module.exports = parenthesis -},{}],267:[function(_dereq_,module,exports){ +},{}],261:[function(_dereq_,module,exports){ 'use strict' var pick = _dereq_('pick-by-alias') @@ -35812,7 +35774,7 @@ function parseRect (arg) { return rect } -},{"pick-by-alias":273}],268:[function(_dereq_,module,exports){ +},{"pick-by-alias":265}],262:[function(_dereq_,module,exports){ module.exports = parse @@ -35871,7 +35833,7 @@ function parseValues(args) { return numbers ? numbers.map(Number) : [] } -},{}],269:[function(_dereq_,module,exports){ +},{}],263:[function(_dereq_,module,exports){ module.exports = function parseUnit(str, out) { if (!out) out = [ 0, '' ] @@ -35882,7 +35844,7 @@ module.exports = function parseUnit(str, out) { out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' return out } -},{}],270:[function(_dereq_,module,exports){ +},{}],264:[function(_dereq_,module,exports){ (function (process){(function (){ // Generated by CoffeeScript 1.12.2 (function() { @@ -35922,146 +35884,7 @@ module.exports = function parseUnit(str, out) { }).call(this)}).call(this,_dereq_('_process')) -},{"_process":287}],271:[function(_dereq_,module,exports){ -"use strict" - -module.exports = permutationSign - -var BRUTE_FORCE_CUTOFF = 32 - -var pool = _dereq_("typedarray-pool") - -function permutationSign(p) { - var n = p.length - if(n < BRUTE_FORCE_CUTOFF) { - //Use quadratic algorithm for small n - var sgn = 1 - for(var i=0; i0; --i) { - t = pinv[i] - s = p[i] - p[i] = p[t] - p[t] = s - pinv[i] = pinv[s] - pinv[s] = t - r = (r + s) * i - } - pool.freeUint32(pinv) - pool.freeUint32(p) - return r -} - -function unrank(n, r, p) { - switch(n) { - case 0: - if(p) { return p } - return [] - case 1: - if(p) { - p[0] = 0 - return p - } else { - return [0] - } - case 2: - if(p) { - if(r) { - p[0] = 0 - p[1] = 1 - } else { - p[0] = 1 - p[1] = 0 - } - return p - } else { - return r ? [0,1] : [1,0] - } - default: - break - } - p = p || new Array(n) - var s, t, i, nf=1 - p[0] = 0 - for(i=1; i0; --i) { - s = (r / nf)|0 - r = (r - s * nf)|0 - nf = (nf / i)|0 - t = p[i]|0 - p[i] = p[s]|0 - p[s] = t|0 - } - return p -} - -exports.rank = rank -exports.unrank = unrank - -},{"invert-permutation":243,"typedarray-pool":340}],273:[function(_dereq_,module,exports){ +},{"_process":278}],265:[function(_dereq_,module,exports){ 'use strict' @@ -36140,7 +35963,7 @@ function toList(arg) { return arg } -},{}],274:[function(_dereq_,module,exports){ +},{}],266:[function(_dereq_,module,exports){ "use strict" module.exports = planarDual @@ -36271,7 +36094,7 @@ function planarDual(cells, positions) { //Combine paths and loops together return cycles } -},{"compare-angle":74}],275:[function(_dereq_,module,exports){ +},{"compare-angle":74}],267:[function(_dereq_,module,exports){ 'use strict' module.exports = trimLeaves @@ -36327,7 +36150,7 @@ function trimLeaves(edges, positions) { return [ nedges, npositions ] } -},{"edges-to-adjacency-list":101}],276:[function(_dereq_,module,exports){ +},{"edges-to-adjacency-list":98}],268:[function(_dereq_,module,exports){ 'use strict' module.exports = planarGraphToPolyline @@ -36532,9 +36355,7 @@ function planarGraphToPolyline(edges, positions) { return result } -},{"./lib/trim-leaves":275,"edges-to-adjacency-list":101,"planar-dual":274,"point-in-big-polygon":278,"robust-sum":305,"two-product":327,"uniq":342}],277:[function(_dereq_,module,exports){ -arguments[4][242][0].apply(exports,arguments) -},{"dup":242}],278:[function(_dereq_,module,exports){ +},{"./lib/trim-leaves":267,"edges-to-adjacency-list":98,"planar-dual":266,"point-in-big-polygon":269,"robust-sum":296,"two-product":316,"uniq":331}],269:[function(_dereq_,module,exports){ module.exports = preprocessPolygon var orient = _dereq_('robust-orientation')[3] @@ -36686,7 +36507,7 @@ function preprocessPolygon(loops) { testSlab) } } -},{"binary-search-bounds":277,"interval-tree-1d":241,"robust-orientation":300,"slab-decomposition":313}],279:[function(_dereq_,module,exports){ +},{"binary-search-bounds":45,"interval-tree-1d":237,"robust-orientation":291,"slab-decomposition":303}],270:[function(_dereq_,module,exports){ /* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT @@ -36814,7 +36635,7 @@ if (typeof window === 'object') module.exports = PolyBool; -},{"./lib/build-log":280,"./lib/epsilon":281,"./lib/geojson":282,"./lib/intersecter":283,"./lib/segment-chainer":285,"./lib/segment-selector":286}],280:[function(_dereq_,module,exports){ +},{"./lib/build-log":271,"./lib/epsilon":272,"./lib/geojson":273,"./lib/intersecter":274,"./lib/segment-chainer":276,"./lib/segment-selector":277}],271:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -36929,7 +36750,7 @@ function BuildLog(){ module.exports = BuildLog; -},{}],281:[function(_dereq_,module,exports){ +},{}],272:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -37101,7 +36922,7 @@ function Epsilon(eps){ module.exports = Epsilon; -},{}],282:[function(_dereq_,module,exports){ +},{}],273:[function(_dereq_,module,exports){ // (c) Copyright 2017, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -37291,7 +37112,7 @@ var GeoJSON = { module.exports = GeoJSON; -},{}],283:[function(_dereq_,module,exports){ +},{}],274:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -37798,7 +37619,7 @@ function Intersecter(selfIntersection, eps, buildLog){ module.exports = Intersecter; -},{"./linked-list":284}],284:[function(_dereq_,module,exports){ +},{"./linked-list":275}],275:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -37881,7 +37702,7 @@ var LinkedList = { module.exports = LinkedList; -},{}],285:[function(_dereq_,module,exports){ +},{}],276:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -38135,7 +37956,7 @@ function SegmentChainer(segments, eps, buildLog){ module.exports = SegmentChainer; -},{}],286:[function(_dereq_,module,exports){ +},{}],277:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -38303,7 +38124,7 @@ var SegmentSelector = { module.exports = SegmentSelector; -},{}],287:[function(_dereq_,module,exports){ +},{}],278:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -38489,7 +38310,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],288:[function(_dereq_,module,exports){ +},{}],279:[function(_dereq_,module,exports){ (function (global){(function (){ var now = _dereq_('performance-now') , root = typeof window === 'undefined' ? global : window @@ -38568,7 +38389,7 @@ module.exports.polyfill = function(object) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"performance-now":270}],289:[function(_dereq_,module,exports){ +},{"performance-now":264}],280:[function(_dereq_,module,exports){ 'use strict' var bnadd = _dereq_('big-rat/add') @@ -38584,7 +38405,7 @@ function add (a, b) { return r } -},{"big-rat/add":29}],290:[function(_dereq_,module,exports){ +},{"big-rat/add":29}],281:[function(_dereq_,module,exports){ 'use strict' module.exports = float2rat @@ -38599,7 +38420,7 @@ function float2rat(v) { return result } -},{"big-rat":32}],291:[function(_dereq_,module,exports){ +},{"big-rat":32}],282:[function(_dereq_,module,exports){ 'use strict' var rat = _dereq_('big-rat') @@ -38617,7 +38438,7 @@ function muls(a, x) { return r } -},{"big-rat":32,"big-rat/mul":41}],292:[function(_dereq_,module,exports){ +},{"big-rat":32,"big-rat/mul":41}],283:[function(_dereq_,module,exports){ 'use strict' var bnsub = _dereq_('big-rat/sub') @@ -38633,7 +38454,7 @@ function sub(a, b) { return r } -},{"big-rat/sub":43}],293:[function(_dereq_,module,exports){ +},{"big-rat/sub":43}],284:[function(_dereq_,module,exports){ 'use strict' var getBounds = _dereq_('array-bounds') @@ -39122,7 +38943,7 @@ function Error2D (regl, options) { } } -},{"array-bounds":19,"color-normalize":69,"flatten-vertex-data":162,"object-assign":264,"pick-by-alias":273,"to-float32":324,"update-diff":344}],294:[function(_dereq_,module,exports){ +},{"array-bounds":19,"color-normalize":69,"flatten-vertex-data":159,"object-assign":258,"pick-by-alias":265,"to-float32":314,"update-diff":333}],285:[function(_dereq_,module,exports){ 'use strict' @@ -39904,7 +39725,7 @@ Line2D.prototype.destroy = function () { return this } -},{"array-bounds":19,"array-find-index":20,"array-normalize":21,"color-normalize":69,"earcut":100,"es6-weak-map":154,"flatten-vertex-data":162,"glslify":237,"object-assign":264,"parse-rect":267,"pick-by-alias":273,"to-float32":324}],295:[function(_dereq_,module,exports){ +},{"array-bounds":19,"array-find-index":20,"array-normalize":21,"color-normalize":69,"earcut":97,"es6-weak-map":151,"flatten-vertex-data":159,"glslify":233,"object-assign":258,"parse-rect":261,"pick-by-alias":265,"to-float32":314}],286:[function(_dereq_,module,exports){ 'use strict'; function _slicedToArray(arr, i) { @@ -40893,7 +40714,7 @@ var reglScatter2d = function reglScatter2d(regl, options) { module.exports = reglScatter2d; -},{"@plotly/point-cluster":15,"array-bounds":19,"color-id":67,"color-normalize":69,"flatten-vertex-data":162,"glslify":237,"is-iexplorer":247,"object-assign":264,"parse-rect":267,"pick-by-alias":273,"to-float32":324,"update-diff":344}],296:[function(_dereq_,module,exports){ +},{"@plotly/point-cluster":15,"array-bounds":19,"color-id":67,"color-normalize":69,"flatten-vertex-data":159,"glslify":233,"is-iexplorer":241,"object-assign":258,"parse-rect":261,"pick-by-alias":265,"to-float32":314,"update-diff":333}],287:[function(_dereq_,module,exports){ 'use strict' @@ -41315,7 +41136,7 @@ function getPad (arg) { } } -},{"array-bounds":19,"array-range":22,"flatten-vertex-data":162,"parse-rect":267,"pick-by-alias":273,"raf":288,"regl-scatter2d":295}],297:[function(_dereq_,module,exports){ +},{"array-bounds":19,"array-range":22,"flatten-vertex-data":159,"parse-rect":261,"pick-by-alias":265,"raf":279,"regl-scatter2d":286}],288:[function(_dereq_,module,exports){ (function(Z,ka){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ka():"function"===typeof define&&define.amd?define(ka):Z.createREGL=ka()})(this,function(){function Z(a,b){this.id=Db++;this.type=a;this.data=b}function ka(a){if(0===a.length)return[];var b=a.charAt(0),c=a.charAt(a.length-1);if(1 * @@ -41560,7 +41381,7 @@ function repeat(str, num) { return res; } -},{}],299:[function(_dereq_,module,exports){ +},{}],290:[function(_dereq_,module,exports){ "use strict" var twoProduct = _dereq_("two-product") @@ -41570,122 +41391,147 @@ var robustScale = _dereq_("robust-scale") var NUM_EXPAND = 6 -function cofactor(m, c) { - var result = new Array(m.length-1) - for(var i=1; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function makeProduct(a, b) { - if(a.charAt(0) === "m") { - if(b.charAt(0) === "w") { - var toks = a.split("[") - return ["w", b.substr(1), "m", toks[0].substr(1)].join("") - } else { - return ["prod(", a, ",", b, ")"].join("") - } - } else { - return makeProduct(b, a) - } -} - -function sign(s) { - if(s & 1 !== 0) { - return "-" - } - return "" -} - -function determinant(m) { - if(m.length === 2) { - return [["diff(", makeProduct(m[0][0], m[1][1]), ",", makeProduct(m[1][0], m[0][1]), ")"].join("")] - } else { - var expr = [] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") +function orientation_4(sum, prod, scale, sub) { + return function orientation4Exact(m0, m1, m2, m3) { + var p = sum(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m3[2]))), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m3[2])))) + var n = sum(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m3[2]))), sum(scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m2[2])))) + var d = sub(p, n) + return d[d.length - 1] } } -function determinant(m) { - if(m.length === 2) { - return [["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { return 1 } return 0.0 } -},{}],307:[function(_dereq_,module,exports){ +},{}],298:[function(_dereq_,module,exports){ arguments[4][46][0].apply(exports,arguments) -},{"dup":46}],308:[function(_dereq_,module,exports){ +},{"dup":46}],299:[function(_dereq_,module,exports){ "use strict"; "use restrict"; var bits = _dereq_("bit-twiddle") @@ -42716,7 +42539,7 @@ function connectedComponents(cells, vertex_count) { } exports.connectedComponents = connectedComponents -},{"bit-twiddle":307,"union-find":309}],309:[function(_dereq_,module,exports){ +},{"bit-twiddle":298,"union-find":300}],300:[function(_dereq_,module,exports){ "use strict"; "use restrict"; module.exports = UnionFind; @@ -42773,7 +42596,7 @@ UnionFind.prototype.link = function(x, y) { } -},{}],310:[function(_dereq_,module,exports){ +},{}],301:[function(_dereq_,module,exports){ "use strict" module.exports = simplifyPolygon @@ -43045,7 +42868,7 @@ function simplifyPolygon(cells, positions, minArea) { edges: ncells } } -},{"robust-orientation":300,"simplicial-complex":308}],311:[function(_dereq_,module,exports){ +},{"robust-orientation":291,"simplicial-complex":299}],302:[function(_dereq_,module,exports){ "use strict" module.exports = orderSegments @@ -43141,9 +42964,7 @@ function orderSegments(b, a) { } return ar[0] - br[0] } -},{"robust-orientation":300}],312:[function(_dereq_,module,exports){ -arguments[4][242][0].apply(exports,arguments) -},{"dup":242}],313:[function(_dereq_,module,exports){ +},{"robust-orientation":291}],303:[function(_dereq_,module,exports){ "use strict" module.exports = createSlabDecomposition @@ -43374,7 +43195,7 @@ function createSlabDecomposition(segments) { } return new SlabDecomposition(slabs, lines, horizontal) } -},{"./lib/order-segments":311,"binary-search-bounds":312,"functional-red-black-tree":165,"robust-orientation":300}],314:[function(_dereq_,module,exports){ +},{"./lib/order-segments":302,"binary-search-bounds":45,"functional-red-black-tree":162,"robust-orientation":291}],304:[function(_dereq_,module,exports){ /* global window, exports, define */ !function() { @@ -43607,7 +43428,7 @@ function createSlabDecomposition(segments) { /* eslint-enable quote-props */ }(); // eslint-disable-line -},{}],315:[function(_dereq_,module,exports){ +},{}],305:[function(_dereq_,module,exports){ 'use strict' var paren = _dereq_('parenthesis') @@ -43665,180 +43486,1570 @@ module.exports = function splitBy (string, separator, o) { return parts } -},{"parenthesis":266}],316:[function(_dereq_,module,exports){ +},{"parenthesis":260}],306:[function(_dereq_,module,exports){ "use strict" module.exports = surfaceNets var generateContourExtractor = _dereq_("ndarray-extract-contour") -var triangulateCube = _dereq_("triangulate-hypercube") var zeroCrossings = _dereq_("zero-crossings") -function buildSurfaceNets(order, dtype) { - var dimension = order.length - var code = ["'use strict';"] - var funcName = "surfaceNets" + order.join("_") + "d" + dtype - - //Contour extraction function - code.push( - "var contour=genContour({", - "order:[", order.join(), "],", - "scalarArguments: 3,", - "phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },") - if(dtype === "generic") { - code.push("getters:[0],") - } - - //Generate vertex function - var cubeArgs = [] - var extraArgs = [] - for(var i=0; i>>7){") - } - for(var i=0; i<1<<(1< 128) { - if((i%128)===0) { - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - var efName = "vExtra" + extraFuncs.length - code.push("case ", (i>>>7), ":", efName, "(m&0x7f,", extraArgs.join(), ");break;") - currentFunc = [ - "function ", efName, "(m,", extraArgs.join(), "){switch(m){" - ] - extraFuncs.push(currentFunc) - } - } - currentFunc.push("case ", (i&0x7f), ":") - var crossings = new Array(dimension) - var denoms = new Array(dimension) - var crossingCount = new Array(dimension) - var bias = new Array(dimension) - var totalCrossings = 0 - for(var j=0; j j) { - continue +var F1_6 = 1 / 6 +var F5_6 = 5 / 6 +var F7_18 = 7 / 18 +var F1_14 = 1 / 14 +var F3_14 = 3 / 14 +var F5_14 = 5 / 14 +var F9_14 = 9 / 14 +var F11_18 = 11 / 18 + +var allFns = { + "2d": function (genContour, order, dtype) { + var contour = genContour({ + order: order, + scalarArguments: 3, + getters: dtype === "generic" ? [0] : undefined, + phase: function phaseFunc(p, a, b, c) { + return (p > c) | 0; + }, + vertex: function vertexFunc(d0, d1, v0, v1, v2, v3, p0, p1, p2, p3, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3)) | 0; + if (m === 0 || m === 15) { + return; } - if(!(i&(1< c) | 0; + }, + vertex: function vertexFunc(d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3) + (p4 << 4) + (p5 << 5) + (p6 << 6) + (p7 << 7)) | 0; + if (m === 0 || m === 255) { + return; + } + switch (m >>> 7) { + case 0: + vExtra0(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + case 1: + vExtra1(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; } + }, + cell: function cellFunc(v0, v1, v2, v3, c0, c1, p0, p1, a, b, c) { + if (p0) { + b.push([v3, v2, v0], [v0, v1, v3]); + } else { + b.push([v0, v2, v3], [v3, v1, v0]); + } + }, + }); + return function (array, level) { + var verts = [], + cells = []; + contour(array, verts, cells, level); + return { positions: verts, cells: cells }; + }; + function vExtra0(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; + case 1: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 3: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 4: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 5: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 6: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 7: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 8: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 9: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 10: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 11: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 12: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 13: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 14: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 15: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (v4 + v0 + v5 + v1 + v6 + v2 + v7 + v3 - 8 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 16: + a.push([ + d0 - F1_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 17: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 18: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 19: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 20: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 21: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 22: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 23: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 24: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 25: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 26: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 28: + a.push([ + d0 - F5_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 30: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v4 - v0 + v1 - v5 + v2 - v6 + v3 - v7), + ]); + break; + case 31: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 32: + a.push([ + d0 - F5_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 33: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 34: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 35: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 36: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 37: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 38: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 40: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 41: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 42: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 43: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 44: + a.push([ + d0 - F9_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 45: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 46: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 47: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 48: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 49: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 50: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 51: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (v2 + v0 + v3 + v1 + v6 + v4 + v7 + v5 - 8 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5]); + break; + case 52: + a.push([ + d0 - F5_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 54: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v2 - v0 + v1 - v3 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 55: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 56: + a.push([ + d0 - F9_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 57: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 58: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 59: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 60: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + v7 + v5)) / (v2 - v0 + v3 - v1 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + v7 + v3)) / (v4 - v0 + v5 - v1 + v2 - v6 + v3 - v7)]); + break; + case 61: + a.push([ + d0 - F9_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 62: + a.push([ + d0 - F5_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 63: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 64: + a.push([ + d0 - F1_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 65: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 66: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 67: + a.push([ + d0 - F5_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 68: + a.push([d0 - 0.25 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 69: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 70: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 71: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 72: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 73: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 75: + a.push([ + d0 - 0.375 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 76: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 77: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 78: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 79: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 80: + a.push([d0 - 0.25 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 81: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 82: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 83: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 84: + a.push([d0 - 0.3 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 85: + a.push([d0 - 0.5 - (0.5 * (v1 + v0 + v3 + v2 + v5 + v4 + v7 + v6 - 8 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5]); + break; + case 86: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v1 - v0 + v2 - v3 + v4 - v5 + v6 - v7), + d1 - 0.375 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 87: + a.push([d0 - 0.7 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 88: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v3 - v2 + v4 - v5 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 90: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + v7 + v6)) / (v1 - v0 + v3 - v2 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + v7 + v3)) / (v4 - v0 + v1 - v5 + v6 - v2 + v3 - v7)]); + break; + case 91: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 92: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 93: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 94: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 95: + a.push([d0 - 0.75 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 96: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 97: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 99: + a.push([ + d0 - 0.375 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.375 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 102: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + v7 + v6)) / (v1 - v0 + v2 - v3 + v5 - v4 + v6 - v7), d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + v7 + v5)) / (v2 - v0 + v1 - v3 + v6 - v4 + v5 - v7), d2 - 0.5]); + break; + case 103: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 104: + a.push([ + d0 - F11_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 105: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + v7 + v6)) / (v0 - v1 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + v7 + v5)) / (v0 - v2 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + v7 + v3)) / (v0 - v4 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 106: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + v7 + v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.625 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 107: + a.push([ + d0 - F7_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 108: + a.push([ + d0 - 0.625 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + v7 + v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 109: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 110: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 111: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 112: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 113: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 114: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 115: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 116: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 117: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 119: + a.push([d0 - 0.75 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 120: + a.push([ + d0 - 0.625 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + v7 + v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 121: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 122: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 123: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 124: + a.push([ + d0 - F9_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 126: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 127: + a.push([ + d0 - F5_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; } } - var vertexStr = [] - for(var k=0; k 0) { - cStr = "+" + crossingCount[k] + "*c" - } - var weight = 0.5 * (crossings[k].length / totalCrossings) - var shift = 0.5 + 0.5 * (bias[k] / totalCrossings) - vertexStr.push("d" + k + "-" + shift + "-" + weight + "*(" + crossings[k].join("+") + cStr + ")/(" + denoms[k].join("+") + ")") - + function vExtra1(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([ + d0 - F5_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 1: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 3: + a.push([ + d0 - F9_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 4: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 5: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 6: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 7: + a.push([ + d0 - 0.625 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + v6 + v2 + -v7 - v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 8: + a.push([d0 - 0.75 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 9: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 10: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 11: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 12: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 13: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 14: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 15: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 16: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 17: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 18: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 19: + a.push([ + d0 - 0.625 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + v6 + v4 + -v7 - v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 20: + a.push([ + d0 - F7_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 21: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + v5 + v4 + -v7 - v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.625 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 22: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 + -v7 - v6)) / (v1 - v0 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 + -v7 - v5)) / (v2 - v0 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 + -v7 - v3)) / (v4 - v0 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 23: + a.push([ + d0 - F11_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 24: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 25: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + -v7 - v6)) / (v0 - v1 + v3 - v2 + v4 - v5 + v7 - v6), d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + -v7 - v5)) / (v0 - v2 + v3 - v1 + v4 - v6 + v7 - v5), d2 - 0.5]); + break; + case 26: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.375 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 28: + a.push([ + d0 - 0.375 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 30: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 31: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 32: + a.push([d0 - 0.75 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 33: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 34: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 35: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 36: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 37: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + -v7 - v6)) / (v0 - v1 + v2 - v3 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + -v7 - v3)) / (v0 - v4 + v5 - v1 + v2 - v6 + v7 - v3)]); + break; + case 38: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v2 - v3 + v5 - v4 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 40: + a.push([d0 - 0.7 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 41: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v0 - v1 + v3 - v2 + v5 - v4 + v7 - v6), + d1 - 0.375 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 42: + a.push([d0 - 0.5 - (0.5 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 8 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5]); + break; + case 43: + a.push([d0 - 0.3 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 44: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 45: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 46: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 47: + a.push([d0 - 0.25 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 48: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 49: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 50: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 51: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 52: + a.push([ + d0 - 0.375 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 54: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 55: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 56: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 57: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 58: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 59: + a.push([d0 - 0.25 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 60: + a.push([ + d0 - F5_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 61: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 62: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 63: + a.push([ + d0 - F1_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 64: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 65: + a.push([ + d0 - F5_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 66: + a.push([ + d0 - F9_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 67: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + -v7 - v5)) / (v0 - v2 + v1 - v3 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + -v7 - v3)) / (v0 - v4 + v1 - v5 + v6 - v2 + v7 - v3)]); + break; + case 68: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 69: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 70: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 71: + a.push([ + d0 - F9_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 72: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 73: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v0 - v2 + v3 - v1 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 75: + a.push([ + d0 - F5_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 76: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 8 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5]); + break; + case 77: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 78: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 79: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 80: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 81: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 82: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 83: + a.push([ + d0 - F9_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 84: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 85: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 86: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 87: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 88: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 90: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 91: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 92: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 93: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 94: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 95: + a.push([ + d0 - F5_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 96: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 97: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v0 - v4 + v5 - v1 + v6 - v2 + v7 - v3), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 99: + a.push([ + d0 - F5_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 102: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 103: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 104: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 105: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 106: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 107: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 108: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 109: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 110: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 111: + a.push([ + d0 - F1_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 112: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 8 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 113: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 114: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 115: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 116: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 117: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 119: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 120: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 121: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 122: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 123: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 124: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 126: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 127: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; } } - currentFunc.push("a.push([", vertexStr.join(), "]);", - "break;") - } - code.push("}},") - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - - //Create face function - var faceArgs = [] - for(var i=0; i<(1<<(dimension-1)); ++i) { - faceArgs.push("v" + i) - } - faceArgs.push("c0", "c1", "p0", "p1", "a", "b", "c") - code.push("cell:function cellFunc(", faceArgs.join(), "){") - - var facets = triangulateCube(dimension-1) - code.push("if(p0){b.push(", - facets.map(function(f) { - return "[" + f.map(function(v) { - return "v" + v - }) + "]" - }).join(), ")}else{b.push(", - facets.map(function(f) { - var e = f.slice() - e.reverse() - return "[" + e.map(function(v) { - return "v" + v - }) + "]" - }).join(), - ")}}});function ", funcName, "(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ", funcName, ";") - - for(var i=0; i= 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": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg1_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg2_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg3_", - "lvalue": false, - "rvalue": true, - "count": 2 - }, { - "name": "_inline_1_arg4_", - "lvalue": false, - "rvalue": true, - "count": 1 - }], - "thisVars": [], - "localVars": ["_inline_1_da", "_inline_1_db"] - }, +},{"./main":354,"object-assign":258}],356:[function(_dereq_,module,exports){ +"use strict" + +function CWiseOp() { + return function(SS, a0, t0, p0, Y0, Y1) { + var s0 = SS[0], + t0p0 = t0[0], + index = [0], + q0 = t0p0 + p0 |= 0 + var i0 = 0, + d0s0 = t0p0 + for (i0 = 0; i0 < s0; ++i0) { + { + var da = a0[p0] - Y1 + var db = a0[p0 + q0] - Y1 + if (da >= 0 !== db >= 0) { + Y0.push(index[0] + 0.5 + (0.5 * (da + db)) / (da - db)) + } + } + p0 += d0s0 + ++index[0] + } + } +} + +//Generates a cwise operator +function generateCWiseOp() { + return CWiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {} + return function zeroCrossings_cwise_thunk(array0, scalar2, scalar3) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar2, scalar3) + } +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ funcName: 'zeroCrossings' }) -},{"cwise-compiler":85}],368:[function(_dereq_,module,exports){ +},{}],357:[function(_dereq_,module,exports){ "use strict" module.exports = findZeroCrossings @@ -52328,7 +53516,7 @@ function findZeroCrossings(array, level) { core(array.hi(array.shape[0]-1), cross, level) return cross } -},{"./lib/zc-core":367}],369:[function(_dereq_,module,exports){ +},{"./lib/zc-core":356}],358:[function(_dereq_,module,exports){ 'use strict'; /** @@ -52391,7 +53579,7 @@ module.exports = [ } ]; -},{}],370:[function(_dereq_,module,exports){ +},{}],359:[function(_dereq_,module,exports){ 'use strict'; var ARROWPATHS = _dereq_('./arrow_paths'); @@ -52679,7 +53867,7 @@ module.exports = templatedArray('annotation', { } }); -},{"../../constants/axis_placeable_objects":493,"../../plot_api/plot_template":558,"../../plots/cartesian/constants":576,"../../plots/font_attributes":598,"./arrow_paths":369}],371:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":482,"../../plot_api/plot_template":547,"../../plots/cartesian/constants":565,"../../plots/font_attributes":587,"./arrow_paths":358}],360:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -52761,7 +53949,7 @@ function calcAxisExpansion(ann, ax) { ann._extremes[axId] = extremes; } -},{"../../lib":519,"../../plots/cartesian/axes":569,"./draw":376}],372:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/axes":558,"./draw":365}],361:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -52891,7 +54079,7 @@ function clickData2r(d, ax) { return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d); } -},{"../../lib":519,"../../plot_api/plot_template":558,"../../registry":610}],373:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../../registry":599}],362:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -52962,7 +54150,7 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo coerce('captureevents', !!hoverText); }; -},{"../../lib":519,"../color":387}],374:[function(_dereq_,module,exports){ +},{"../../lib":508,"../color":376}],363:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -53016,7 +54204,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":547,"fast-isnumeric":161}],375:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":536,"fast-isnumeric":158}],364:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -53115,7 +54303,7 @@ function handleAnnotationDefaults(annIn, annOut, fullLayout) { } } -},{"../../lib":519,"../../plots/array_container_defaults":564,"../../plots/cartesian/axes":569,"./attributes":370,"./common_defaults":373}],376:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"../../plots/cartesian/axes":558,"./attributes":359,"./common_defaults":362}],365:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -53868,7 +55056,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) { } else annText.call(textLayout); } -},{"../../lib":519,"../../lib/setcursor":540,"../../lib/svg_text_utils":545,"../../plot_api/plot_template":558,"../../plots/cartesian/axes":569,"../../plots/plots":608,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"../fx":427,"./draw_arrow_head":377,"@plotly/d3":14}],377:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../lib/setcursor":529,"../../lib/svg_text_utils":534,"../../plot_api/plot_template":547,"../../plots/cartesian/axes":558,"../../plots/plots":597,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"../fx":416,"./draw_arrow_head":366,"@plotly/d3":14}],366:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -54015,7 +55203,7 @@ module.exports = function drawArrowHead(el3, ends, options) { if(doEnd) drawhead(headStyle, end, endRot, scale); }; -},{"../../lib":519,"../color":387,"./arrow_paths":369,"@plotly/d3":14}],378:[function(_dereq_,module,exports){ +},{"../../lib":508,"../color":376,"./arrow_paths":358,"@plotly/d3":14}],367:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -54040,7 +55228,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":582,"./attributes":370,"./calc_autorange":371,"./click":372,"./convert_coords":374,"./defaults":375,"./draw":376}],379:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":571,"./attributes":359,"./calc_autorange":360,"./click":361,"./convert_coords":363,"./defaults":364,"./draw":365}],368:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -54109,7 +55297,7 @@ module.exports = overrideAll(templatedArray('annotation', { // zref: 'z' }), 'calc', 'from-root'); -},{"../../plot_api/edit_types":551,"../../plot_api/plot_template":558,"../annotations/attributes":370}],380:[function(_dereq_,module,exports){ +},{"../../plot_api/edit_types":540,"../../plot_api/plot_template":547,"../annotations/attributes":359}],369:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -54166,7 +55354,7 @@ function mockAnnAxes(ann, scene) { }; } -},{"../../lib":519,"../../plots/cartesian/axes":569}],381:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/axes":558}],370:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -54234,7 +55422,7 @@ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) { } } -},{"../../lib":519,"../../plots/array_container_defaults":564,"../../plots/cartesian/axes":569,"../annotations/common_defaults":373,"./attributes":379}],382:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"../../plots/cartesian/axes":558,"../annotations/common_defaults":362,"./attributes":368}],371:[function(_dereq_,module,exports){ 'use strict'; var drawRaw = _dereq_('../annotations/draw').drawRaw; @@ -54278,7 +55466,7 @@ module.exports = function draw(scene) { } }; -},{"../../plots/gl3d/project":605,"../annotations/draw":376}],383:[function(_dereq_,module,exports){ +},{"../../plots/gl3d/project":594,"../annotations/draw":365}],372:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -54318,7 +55506,7 @@ function includeGL3D(layoutIn, layoutOut) { } } -},{"../../lib":519,"../../registry":610,"./attributes":379,"./convert":380,"./defaults":381,"./draw":382}],384:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"./attributes":368,"./convert":369,"./defaults":370,"./draw":371}],373:[function(_dereq_,module,exports){ 'use strict'; // a trimmed down version of: @@ -54343,7 +55531,7 @@ _dereq_('world-calendars/dist/calendars/taiwan'); _dereq_('world-calendars/dist/calendars/thai'); _dereq_('world-calendars/dist/calendars/ummalqura'); -},{"world-calendars/dist/calendars/chinese":351,"world-calendars/dist/calendars/coptic":352,"world-calendars/dist/calendars/discworld":353,"world-calendars/dist/calendars/ethiopian":354,"world-calendars/dist/calendars/hebrew":355,"world-calendars/dist/calendars/islamic":356,"world-calendars/dist/calendars/julian":357,"world-calendars/dist/calendars/mayan":358,"world-calendars/dist/calendars/nanakshahi":359,"world-calendars/dist/calendars/nepali":360,"world-calendars/dist/calendars/persian":361,"world-calendars/dist/calendars/taiwan":362,"world-calendars/dist/calendars/thai":363,"world-calendars/dist/calendars/ummalqura":364,"world-calendars/dist/main":365,"world-calendars/dist/plus":366}],385:[function(_dereq_,module,exports){ +},{"world-calendars/dist/calendars/chinese":340,"world-calendars/dist/calendars/coptic":341,"world-calendars/dist/calendars/discworld":342,"world-calendars/dist/calendars/ethiopian":343,"world-calendars/dist/calendars/hebrew":344,"world-calendars/dist/calendars/islamic":345,"world-calendars/dist/calendars/julian":346,"world-calendars/dist/calendars/mayan":347,"world-calendars/dist/calendars/nanakshahi":348,"world-calendars/dist/calendars/nepali":349,"world-calendars/dist/calendars/persian":350,"world-calendars/dist/calendars/taiwan":351,"world-calendars/dist/calendars/thai":352,"world-calendars/dist/calendars/ummalqura":353,"world-calendars/dist/main":354,"world-calendars/dist/plus":355}],374:[function(_dereq_,module,exports){ 'use strict'; var calendars = _dereq_('./calendars'); @@ -54609,7 +55797,7 @@ module.exports = { worldCalFmt: worldCalFmt }; -},{"../../constants/numerical":497,"../../lib":519,"./calendars":384}],386:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"./calendars":373}],375:[function(_dereq_,module,exports){ 'use strict'; @@ -54641,7 +55829,7 @@ exports.borderLine = '#BEC8D9'; // gives back exactly lightLine if the other colors are defaults. exports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4); -},{}],387:[function(_dereq_,module,exports){ +},{}],376:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -54807,7 +55995,7 @@ function cleanOne(val) { return 'rgb(' + rgbStr + ')'; } -},{"../../lib/array":503,"./attributes":386,"fast-isnumeric":161,"tinycolor2":323}],388:[function(_dereq_,module,exports){ +},{"../../lib/array":492,"./attributes":375,"fast-isnumeric":158,"tinycolor2":313}],377:[function(_dereq_,module,exports){ 'use strict'; var axesAttrs = _dereq_('../../plots/cartesian/layout_attributes'); @@ -54954,7 +56142,7 @@ module.exports = overrideAll({ } }, 'colorbars', 'from-root'); -},{"../../lib/extend":511,"../../plot_api/edit_types":551,"../../plots/cartesian/layout_attributes":584,"../../plots/font_attributes":598}],389:[function(_dereq_,module,exports){ +},{"../../lib/extend":500,"../../plot_api/edit_types":540,"../../plots/cartesian/layout_attributes":573,"../../plots/font_attributes":587}],378:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -54974,7 +56162,7 @@ module.exports = { } }; -},{}],390:[function(_dereq_,module,exports){ +},{}],379:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -55044,7 +56232,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) { coerce('title.side'); }; -},{"../../lib":519,"../../plot_api/plot_template":558,"../../plots/cartesian/tick_label_defaults":591,"../../plots/cartesian/tick_mark_defaults":592,"../../plots/cartesian/tick_value_defaults":593,"./attributes":388}],391:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../../plots/cartesian/tick_label_defaults":580,"../../plots/cartesian/tick_mark_defaults":581,"../../plots/cartesian/tick_value_defaults":582,"./attributes":377}],380:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -55771,7 +56959,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":492,"../../lib":519,"../../lib/extend":511,"../../lib/setcursor":540,"../../lib/svg_text_utils":545,"../../plots/cartesian/axes":569,"../../plots/cartesian/axis_defaults":571,"../../plots/cartesian/layout_attributes":584,"../../plots/cartesian/position_defaults":587,"../../plots/plots":608,"../../registry":610,"../color":387,"../colorscale/helpers":398,"../dragelement":406,"../drawing":409,"../titles":485,"./constants":389,"@plotly/d3":14,"tinycolor2":323}],392:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../lib":508,"../../lib/extend":500,"../../lib/setcursor":529,"../../lib/svg_text_utils":534,"../../plots/cartesian/axes":558,"../../plots/cartesian/axis_defaults":560,"../../plots/cartesian/layout_attributes":573,"../../plots/cartesian/position_defaults":576,"../../plots/plots":597,"../../registry":599,"../color":376,"../colorscale/helpers":387,"../dragelement":395,"../drawing":398,"../titles":474,"./constants":378,"@plotly/d3":14,"tinycolor2":313}],381:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -55781,7 +56969,7 @@ module.exports = function hasColorbar(container) { return Lib.isPlainObject(container.colorbar); }; -},{"../../lib":519}],393:[function(_dereq_,module,exports){ +},{"../../lib":508}],382:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -55795,7 +56983,7 @@ module.exports = { hasColorbar: _dereq_('./has_colorbar') }; -},{"./attributes":388,"./defaults":390,"./draw":391,"./has_colorbar":392}],394:[function(_dereq_,module,exports){ +},{"./attributes":377,"./defaults":379,"./draw":380,"./has_colorbar":381}],383:[function(_dereq_,module,exports){ 'use strict'; var colorbarAttrs = _dereq_('../colorbar/attributes'); @@ -55976,7 +57164,7 @@ module.exports = function colorScaleAttrs(context, opts) { return attrs; }; -},{"../../lib/regex":536,"../../lib/sort_object_keys":542,"../colorbar/attributes":388,"./scales.js":402}],395:[function(_dereq_,module,exports){ +},{"../../lib/regex":525,"../../lib/sort_object_keys":531,"../colorbar/attributes":377,"./scales.js":391}],384:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -56047,7 +57235,7 @@ module.exports = function calc(gd, trace, opts) { } }; -},{"../../lib":519,"./helpers":398,"fast-isnumeric":161}],396:[function(_dereq_,module,exports){ +},{"../../lib":508,"./helpers":387,"fast-isnumeric":158}],385:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -56116,7 +57304,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":519,"./helpers":398}],397:[function(_dereq_,module,exports){ +},{"../../lib":508,"./helpers":387}],386:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -56233,7 +57421,7 @@ module.exports = function colorScaleDefaults(parentContIn, parentContOut, layout } }; -},{"../../lib":519,"../../registry":610,"../colorbar/defaults":390,"../colorbar/has_colorbar":392,"./scales":402,"fast-isnumeric":161}],398:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"../colorbar/defaults":379,"../colorbar/has_colorbar":381,"./scales":391,"fast-isnumeric":158}],387:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -56465,7 +57653,7 @@ module.exports = { makeColorScaleFuncFromTrace: makeColorScaleFuncFromTrace }; -},{"../../lib":519,"../color":387,"./scales":402,"@plotly/d3":14,"fast-isnumeric":161,"tinycolor2":323}],399:[function(_dereq_,module,exports){ +},{"../../lib":508,"../color":376,"./scales":391,"@plotly/d3":14,"fast-isnumeric":158,"tinycolor2":313}],388:[function(_dereq_,module,exports){ 'use strict'; var scales = _dereq_('./scales'); @@ -56499,7 +57687,7 @@ module.exports = { makeColorScaleFuncFromTrace: helpers.makeColorScaleFuncFromTrace }; -},{"./attributes":394,"./calc":395,"./cross_trace_defaults":396,"./defaults":397,"./helpers":398,"./layout_attributes":400,"./layout_defaults":401,"./scales":402}],400:[function(_dereq_,module,exports){ +},{"./attributes":383,"./calc":384,"./cross_trace_defaults":385,"./defaults":386,"./helpers":387,"./layout_attributes":389,"./layout_defaults":390,"./scales":391}],389:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -56545,7 +57733,7 @@ module.exports = { })) }; -},{"../../lib/extend":511,"./attributes":394,"./scales":402}],401:[function(_dereq_,module,exports){ +},{"../../lib/extend":500,"./attributes":383,"./scales":391}],390:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -56588,7 +57776,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { } }; -},{"../../lib":519,"../../plot_api/plot_template":558,"./defaults":397,"./layout_attributes":400}],402:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"./defaults":386,"./layout_attributes":389}],391:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -56784,7 +57972,7 @@ module.exports = { isValid: isValidScale }; -},{"tinycolor2":323}],403:[function(_dereq_,module,exports){ +},{"tinycolor2":313}],392:[function(_dereq_,module,exports){ 'use strict'; @@ -56808,7 +57996,7 @@ module.exports = function align(v, dv, v0, v1, anchor) { return vc; }; -},{}],404:[function(_dereq_,module,exports){ +},{}],393:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -56837,7 +58025,7 @@ module.exports = function getCursor(x, y, xanchor, yanchor) { return cursorset[y][x]; }; -},{"../../lib":519}],405:[function(_dereq_,module,exports){ +},{"../../lib":508}],394:[function(_dereq_,module,exports){ 'use strict'; exports.selectMode = function(dragmode) { @@ -56888,7 +58076,7 @@ exports.selectingOrDrawing = function(dragmode) { ); }; -},{}],406:[function(_dereq_,module,exports){ +},{}],395:[function(_dereq_,module,exports){ 'use strict'; var mouseOffset = _dereq_('mouse-event-offset'); @@ -57172,7 +58360,7 @@ function pointerOffset(e) { ); } -},{"../../lib":519,"../../plots/cartesian/constants":576,"./align":403,"./cursor":404,"./unhover":407,"has-hover":238,"has-passive-events":239,"mouse-event-offset":255}],407:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/constants":565,"./align":392,"./cursor":393,"./unhover":396,"has-hover":234,"has-passive-events":235,"mouse-event-offset":249}],396:[function(_dereq_,module,exports){ 'use strict'; var Events = _dereq_('../../lib/events'); @@ -57219,7 +58407,7 @@ unhover.raw = function raw(gd, evt) { } }; -},{"../../lib/dom":509,"../../lib/events":510,"../../lib/throttle":546,"../fx/constants":421}],408:[function(_dereq_,module,exports){ +},{"../../lib/dom":498,"../../lib/events":499,"../../lib/throttle":535,"../fx/constants":410}],397:[function(_dereq_,module,exports){ 'use strict'; exports.dash = { @@ -57281,7 +58469,7 @@ exports.pattern = { editType: 'style', }; -},{}],409:[function(_dereq_,module,exports){ +},{}],398:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -58725,7 +59913,7 @@ drawing.setTextPointsScale = function(selection, xScale, yScale) { }); }; -},{"../../components/fx/helpers":423,"../../constants/alignment":492,"../../constants/interactions":496,"../../constants/xmlns_namespaces":498,"../../lib":519,"../../lib/svg_text_utils":545,"../../registry":610,"../../traces/scatter/make_bubble_size_func":675,"../../traces/scatter/subtypes":683,"../color":387,"../colorscale":399,"./symbol_defs":410,"@plotly/d3":14,"fast-isnumeric":161,"tinycolor2":323}],410:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":412,"../../constants/alignment":481,"../../constants/interactions":485,"../../constants/xmlns_namespaces":487,"../../lib":508,"../../lib/svg_text_utils":534,"../../registry":599,"../../traces/scatter/make_bubble_size_func":664,"../../traces/scatter/subtypes":672,"../color":376,"../colorscale":388,"./symbol_defs":399,"@plotly/d3":14,"fast-isnumeric":158,"tinycolor2":313}],399:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -59280,7 +60468,7 @@ module.exports = { } }; -},{"@plotly/d3":14}],411:[function(_dereq_,module,exports){ +},{"@plotly/d3":14}],400:[function(_dereq_,module,exports){ 'use strict'; @@ -59363,7 +60551,7 @@ module.exports = { } }; -},{}],412:[function(_dereq_,module,exports){ +},{}],401:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -59441,7 +60629,7 @@ function calcOneAxis(calcTrace, trace, axis, coord) { baseExtremes.max = baseExtremes.max.concat(extremes.max); } -},{"../../lib":519,"../../plots/cartesian/axes":569,"../../registry":610,"./compute_error":413,"fast-isnumeric":161}],413:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/axes":558,"../../registry":599,"./compute_error":402,"fast-isnumeric":158}],402:[function(_dereq_,module,exports){ 'use strict'; @@ -59533,7 +60721,7 @@ function makeComputeErrorValue(type, value) { } } -},{}],414:[function(_dereq_,module,exports){ +},{}],403:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -59600,7 +60788,7 @@ module.exports = function(traceIn, traceOut, defaultColor, opts) { } }; -},{"../../lib":519,"../../plot_api/plot_template":558,"../../registry":610,"./attributes":411,"fast-isnumeric":161}],415:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../../registry":599,"./attributes":400,"fast-isnumeric":158}],404:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -59661,7 +60849,7 @@ function hoverInfo(calcPoint, trace, hoverPoint) { } } -},{"../../lib":519,"../../plot_api/edit_types":551,"./attributes":411,"./calc":412,"./compute_error":413,"./defaults":414,"./plot":416,"./style":417}],416:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/edit_types":540,"./attributes":400,"./calc":401,"./compute_error":402,"./defaults":403,"./plot":405,"./style":406}],405:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -59824,7 +61012,7 @@ function errorCoords(d, xa, ya) { return out; } -},{"../../traces/scatter/subtypes":683,"../drawing":409,"@plotly/d3":14,"fast-isnumeric":161}],417:[function(_dereq_,module,exports){ +},{"../../traces/scatter/subtypes":672,"../drawing":398,"@plotly/d3":14,"fast-isnumeric":158}],406:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -59852,7 +61040,7 @@ module.exports = function style(traces) { }); }; -},{"../color":387,"@plotly/d3":14}],418:[function(_dereq_,module,exports){ +},{"../color":376,"@plotly/d3":14}],407:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -59877,7 +61065,7 @@ module.exports = { } }; -},{"../../lib/extend":511,"../../plots/font_attributes":598,"./layout_attributes":428}],419:[function(_dereq_,module,exports){ +},{"../../lib/extend":500,"../../plots/font_attributes":587,"./layout_attributes":417}],408:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -59928,7 +61116,7 @@ function paste(traceAttr, cd, cdAttr, fn) { } } -},{"../../lib":519,"../../registry":610}],420:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599}],409:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -59957,7 +61145,7 @@ module.exports = function click(gd, evt, subplot) { } }; -},{"../../registry":610,"./hover":424}],421:[function(_dereq_,module,exports){ +},{"../../registry":599,"./hover":413}],410:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -59981,7 +61169,7 @@ module.exports = { HOVERID: '-hover' }; -},{}],422:[function(_dereq_,module,exports){ +},{}],411:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -59999,7 +61187,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleHoverLabelDefaults(traceIn, traceOut, coerce, opts); }; -},{"../../lib":519,"./attributes":418,"./hoverlabel_defaults":425}],423:[function(_dereq_,module,exports){ +},{"../../lib":508,"./attributes":407,"./hoverlabel_defaults":414}],412:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -60253,7 +61441,7 @@ exports.isXYhover = function(hovermode) { return !!xyHoverMode[hovermode]; }; -},{"../../lib":519}],424:[function(_dereq_,module,exports){ +},{"../../lib":508}],413:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -61147,7 +62335,7 @@ function createHoverText(hoverData, opts) { var ya = c0.ya; var axLetter = hovermode.charAt(0); var t0 = c0[axLetter + 'Label']; - var outerContainerBB = outerContainer.getBoundingClientRect(); + var outerContainerBB = getBoundingClientRect(gd, outerContainer); var outerTop = outerContainerBB.top; var outerWidth = outerContainerBB.width; var outerHeight = outerContainerBB.height; @@ -61222,7 +62410,7 @@ function createHoverText(hoverData, opts) { label.attr('transform', ''); - var tbb = ltext.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, ltext.node()); var lx, ly; if(hovermode === 'x') { @@ -61315,7 +62503,7 @@ function createHoverText(hoverData, opts) { var dummy = Drawing.tester.append('text') .text(s.text()) .call(Drawing.font, commonLabelFont); - var dummyBB = dummy.node().getBoundingClientRect(); + var dummyBB = getBoundingClientRect(gd, dummy.node()); if(Math.round(dummyBB.width) < Math.round(tbb.width)) { s.attr('x', ltx - dummyBB.width); } @@ -61404,7 +62592,7 @@ function createHoverText(hoverData, opts) { // Position the hover var legendContainer = container.select('g.legend'); - var tbb = legendContainer.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, legendContainer.node()); var tWidth = tbb.width + 2 * HOVERTEXTPAD; var tHeight = tbb.height + 2 * HOVERTEXTPAD; var winningPoint = hoverData[0]; @@ -61569,7 +62757,7 @@ function createHoverText(hoverData, opts) { .call(svgTextUtils.positionText, 0, 0) .call(svgTextUtils.convertToTspans, gd); - var t2bb = tx2.node().getBoundingClientRect(); + var t2bb = getBoundingClientRect(gd, tx2.node()); tx2width = t2bb.width + 2 * HOVERTEXTPAD; tx2height = t2bb.height + 2 * HOVERTEXTPAD; } else { @@ -61582,22 +62770,26 @@ function createHoverText(hoverData, opts) { stroke: contrastColor }); - var tbb = tx.node().getBoundingClientRect(); var htx = d.xa._offset + (d.x0 + d.x1) / 2; var hty = d.ya._offset + (d.y0 + d.y1) / 2; var dx = Math.abs(d.x1 - d.x0); var dy = Math.abs(d.y1 - d.y0); - var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width; - var anchorStartOK, anchorEndOK; - d.ty0 = outerTop - tbb.top; - d.bx = tbb.width + 2 * HOVERTEXTPAD; - d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height); + var tbb = getBoundingClientRect(gd, tx.node()); + var tbbWidth = tbb.width / fullLayout._invScaleX; + var tbbHeight = tbb.height / fullLayout._invScaleY; + + d.ty0 = (outerTop - tbb.top) / fullLayout._invScaleY; + d.bx = tbbWidth + 2 * HOVERTEXTPAD; + d.by = Math.max(tbbHeight + 2 * HOVERTEXTPAD, tx2height); d.anchor = 'start'; - d.txwidth = tbb.width; + d.txwidth = tbbWidth; d.tx2width = tx2width; d.offset = 0; + var txTotalWidth = (tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width) * fullLayout._invScaleX; + var anchorStartOK, anchorEndOK; + if(rotateLabels) { d.pos = htx; anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight; @@ -62357,7 +63549,37 @@ function getCoord(axLetter, winningPoint, fullLayout) { function getTopOffset(gd) { return gd.offsetTop + gd.clientTop; } function getLeftOffset(gd) { return gd.offsetLeft + gd.clientLeft; } -},{"../../lib":519,"../../lib/events":510,"../../lib/override_cursor":530,"../../lib/svg_text_utils":545,"../../plots/cartesian/axes":569,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"../legend/defaults":439,"../legend/draw":440,"./constants":421,"./helpers":423,"@plotly/d3":14,"fast-isnumeric":161,"tinycolor2":323}],425:[function(_dereq_,module,exports){ +function getBoundingClientRect(gd, node) { + var fullLayout = gd._fullLayout; + + var rect = node.getBoundingClientRect(); + + var x0 = rect.x; + var y0 = rect.y; + var x1 = x0 + rect.width; + var y1 = y0 + rect.height; + + var A = Lib.apply3DTransform(fullLayout._invTransform)(x0, y0); + var B = Lib.apply3DTransform(fullLayout._invTransform)(x1, y1); + + var Ax = A[0]; + var Ay = A[1]; + var Bx = B[0]; + var By = B[1]; + + return { + x: Ax, + y: Ay, + width: Bx - Ax, + height: By - Ay, + top: Math.min(Ay, By), + left: Math.min(Ax, Bx), + right: Math.max(Ax, Bx), + bottom: Math.max(Ay, By), + }; +} + +},{"../../lib":508,"../../lib/events":499,"../../lib/override_cursor":519,"../../lib/svg_text_utils":534,"../../plots/cartesian/axes":558,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"../legend/defaults":428,"../legend/draw":429,"./constants":410,"./helpers":412,"@plotly/d3":14,"fast-isnumeric":158,"tinycolor2":313}],414:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -62395,7 +63617,7 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts coerce('hoverlabel.align', opts.align); }; -},{"../../lib":519,"../color":387,"./helpers":423}],426:[function(_dereq_,module,exports){ +},{"../../lib":508,"../color":376,"./helpers":412}],415:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -62413,7 +63635,7 @@ module.exports = function handleHoverModeDefaults(layoutIn, layoutOut) { return coerce('hovermode'); }; -},{"../../lib":519,"./layout_attributes":428}],427:[function(_dereq_,module,exports){ +},{"../../lib":508,"./layout_attributes":417}],416:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -62484,7 +63706,7 @@ function castHoverinfo(trace, fullLayout, ptNumber) { return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce); } -},{"../../lib":519,"../dragelement":406,"./attributes":418,"./calc":419,"./click":420,"./constants":421,"./defaults":422,"./helpers":423,"./hover":424,"./layout_attributes":428,"./layout_defaults":429,"./layout_global_defaults":430,"@plotly/d3":14}],428:[function(_dereq_,module,exports){ +},{"../../lib":508,"../dragelement":395,"./attributes":407,"./calc":408,"./click":409,"./constants":410,"./defaults":411,"./helpers":412,"./hover":413,"./layout_attributes":417,"./layout_defaults":418,"./layout_global_defaults":419,"@plotly/d3":14}],417:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -62572,7 +63794,7 @@ module.exports = { } }; -},{"../../plots/font_attributes":598,"./constants":421}],429:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":587,"./constants":410}],418:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -62611,7 +63833,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":519,"./hoverlabel_defaults":425,"./hovermode_defaults":426,"./layout_attributes":428}],430:[function(_dereq_,module,exports){ +},{"../../lib":508,"./hoverlabel_defaults":414,"./hovermode_defaults":415,"./layout_attributes":417}],419:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -62626,7 +63848,7 @@ module.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":519,"./hoverlabel_defaults":425,"./layout_attributes":428}],431:[function(_dereq_,module,exports){ +},{"../../lib":508,"./hoverlabel_defaults":414,"./layout_attributes":417}],420:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -62969,7 +64191,7 @@ module.exports = { contentDefaults: contentDefaults }; -},{"../../lib":519,"../../lib/regex":536,"../../plot_api/plot_template":558,"../../plots/cartesian/constants":576,"../../plots/domain":597}],432:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../lib/regex":525,"../../plot_api/plot_template":547,"../../plots/cartesian/constants":565,"../../plots/domain":586}],421:[function(_dereq_,module,exports){ 'use strict'; var cartesianConstants = _dereq_('../../plots/cartesian/constants'); @@ -63071,7 +64293,7 @@ module.exports = templatedArray('image', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":493,"../../plot_api/plot_template":558,"../../plots/cartesian/constants":576}],433:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":482,"../../plot_api/plot_template":547,"../../plots/cartesian/constants":565}],422:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -63143,7 +64365,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":547,"fast-isnumeric":161}],434:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":536,"fast-isnumeric":158}],423:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -63200,7 +64422,7 @@ function imageDefaults(imageIn, imageOut, fullLayout) { return imageOut; } -},{"../../lib":519,"../../plots/array_container_defaults":564,"../../plots/cartesian/axes":569,"./attributes":432}],435:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"../../plots/cartesian/axes":558,"./attributes":421}],424:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -63450,7 +64672,7 @@ module.exports = function draw(gd) { } }; -},{"../../constants/xmlns_namespaces":498,"../../plots/cartesian/axes":569,"../../plots/cartesian/axis_ids":573,"../drawing":409,"@plotly/d3":14}],436:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":487,"../../plots/cartesian/axes":558,"../../plots/cartesian/axis_ids":562,"../drawing":398,"@plotly/d3":14}],425:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -63466,7 +64688,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":582,"./attributes":432,"./convert_coords":433,"./defaults":434,"./draw":435}],437:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":571,"./attributes":421,"./convert_coords":422,"./defaults":423,"./draw":424}],426:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -63592,7 +64814,7 @@ module.exports = { editType: 'legend' }; -},{"../../plots/font_attributes":598,"../color/attributes":386}],438:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":587,"../color/attributes":375}],427:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -63608,7 +64830,7 @@ module.exports = { itemGap: 5 }; -},{}],439:[function(_dereq_,module,exports){ +},{}],428:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -63741,7 +64963,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":519,"../../plot_api/plot_template":558,"../../plots/layout_attributes":606,"../../registry":610,"./attributes":437,"./helpers":443}],440:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../../plots/layout_attributes":595,"../../registry":599,"./attributes":426,"./helpers":432}],429:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -64566,7 +65788,7 @@ function getYanchor(legendObj) { 'top'; } -},{"../../constants/alignment":492,"../../lib":519,"../../lib/events":510,"../../lib/svg_text_utils":545,"../../plots/plots":608,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"./constants":438,"./get_legend_data":441,"./handle_click":442,"./helpers":443,"./style":445,"@plotly/d3":14}],441:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../lib":508,"../../lib/events":499,"../../lib/svg_text_utils":534,"../../plots/plots":597,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"./constants":427,"./get_legend_data":430,"./handle_click":431,"./helpers":432,"./style":434,"@plotly/d3":14}],430:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -64742,7 +65964,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../registry":610,"./helpers":443}],442:[function(_dereq_,module,exports){ +},{"../../registry":599,"./helpers":432}],431:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -64984,7 +66206,7 @@ module.exports = function handleClick(g, gd, numClicks) { } }; -},{"../../lib":519,"../../registry":610}],443:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599}],432:[function(_dereq_,module,exports){ 'use strict'; exports.isGrouped = function isGrouped(legendLayout) { @@ -64999,7 +66221,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{}],444:[function(_dereq_,module,exports){ +},{}],433:[function(_dereq_,module,exports){ 'use strict'; @@ -65014,7 +66236,7 @@ module.exports = { style: _dereq_('./style') }; -},{"./attributes":437,"./defaults":439,"./draw":440,"./style":445}],445:[function(_dereq_,module,exports){ +},{"./attributes":426,"./defaults":428,"./draw":429,"./style":434}],434:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -65701,7 +66923,7 @@ function dimAttr(v, dflt, max) { return v; } -},{"../../lib":519,"../../registry":610,"../../traces/pie/helpers":651,"../../traces/pie/style_one":652,"../../traces/scatter/subtypes":683,"../color":387,"../colorscale/helpers":398,"../drawing":409,"./constants":438,"@plotly/d3":14}],446:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"../../traces/pie/helpers":640,"../../traces/pie/style_one":641,"../../traces/scatter/subtypes":672,"../color":376,"../colorscale/helpers":387,"../drawing":398,"./constants":427,"@plotly/d3":14}],435:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -65745,7 +66967,7 @@ module.exports = { } }; -},{"./constants":448}],447:[function(_dereq_,module,exports){ +},{"./constants":437}],436:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -66497,7 +67719,7 @@ function resetView(gd, subplotType) { Registry.call('_guiRelayout', gd, aObj); } -},{"../../fonts/ploticon":500,"../../lib":519,"../../plots/cartesian/axis_ids":573,"../../plots/plots":608,"../../registry":610,"../shapes/draw":471}],448:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":489,"../../lib":508,"../../plots/cartesian/axis_ids":562,"../../plots/plots":597,"../../registry":599,"../shapes/draw":460}],437:[function(_dereq_,module,exports){ 'use strict'; var modeBarButtons = _dereq_('./buttons'); @@ -66540,7 +67762,7 @@ module.exports = { foreButtons: foreButtons }; -},{"./buttons":447}],449:[function(_dereq_,module,exports){ +},{"./buttons":436}],438:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -66566,7 +67788,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('remove'); }; -},{"../../lib":519,"../../plot_api/plot_template":558,"../color":387,"./attributes":446}],450:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../color":376,"./attributes":435}],439:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -66579,7 +67801,7 @@ module.exports = { manage: _dereq_('./manage') }; -},{"./attributes":446,"./defaults":449,"./manage":451}],451:[function(_dereq_,module,exports){ +},{"./attributes":435,"./defaults":438,"./manage":440}],440:[function(_dereq_,module,exports){ 'use strict'; var axisIds = _dereq_('../../plots/cartesian/axis_ids'); @@ -66934,7 +68156,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plots/cartesian/axis_ids":573,"../../registry":610,"../../traces/scatter/subtypes":683,"../fx/helpers":423,"./buttons":447,"./constants":448,"./modebar":452}],452:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axis_ids":562,"../../registry":599,"../../traces/scatter/subtypes":672,"../fx/helpers":412,"./buttons":436,"./constants":437,"./modebar":441}],441:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -67271,7 +68493,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../fonts/ploticon":500,"../../lib":519,"@plotly/d3":14,"fast-isnumeric":161}],453:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":489,"../../lib":508,"@plotly/d3":14,"fast-isnumeric":158}],442:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -67369,7 +68591,7 @@ module.exports = { editType: 'plot' }; -},{"../../plot_api/plot_template":558,"../../plots/font_attributes":598,"../color/attributes":386}],454:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":547,"../../plots/font_attributes":587,"../color/attributes":375}],443:[function(_dereq_,module,exports){ 'use strict'; @@ -67390,7 +68612,7 @@ module.exports = { darkAmount: 10 }; -},{}],455:[function(_dereq_,module,exports){ +},{}],444:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67474,7 +68696,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":519,"../../plot_api/plot_template":558,"../../plots/array_container_defaults":564,"../color":387,"./attributes":453,"./constants":454}],456:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../../plots/array_container_defaults":553,"../color":376,"./attributes":442,"./constants":443}],445:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -67721,7 +68943,7 @@ function reposition(gd, buttons, opts, axName, selector) { selector.attr('transform', strTranslate(lx, ly)); } -},{"../../constants/alignment":492,"../../lib":519,"../../lib/svg_text_utils":545,"../../plots/cartesian/axis_ids":573,"../../plots/plots":608,"../../registry":610,"../color":387,"../drawing":409,"./constants":454,"./get_update_object":457,"@plotly/d3":14}],457:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../lib":508,"../../lib/svg_text_utils":534,"../../plots/cartesian/axis_ids":562,"../../plots/plots":597,"../../registry":599,"../color":376,"../drawing":398,"./constants":443,"./get_update_object":446,"@plotly/d3":14}],446:[function(_dereq_,module,exports){ 'use strict'; var d3Time = _dereq_('d3-time'); @@ -67770,7 +68992,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"../../lib":519,"d3-time":93}],458:[function(_dereq_,module,exports){ +},{"../../lib":508,"d3-time":90}],447:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -67789,7 +69011,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":453,"./defaults":455,"./draw":456}],459:[function(_dereq_,module,exports){ +},{"./attributes":442,"./defaults":444,"./draw":445}],448:[function(_dereq_,module,exports){ 'use strict'; var colorAttributes = _dereq_('../color/attributes'); @@ -67841,7 +69063,7 @@ module.exports = { editType: 'calc' }; -},{"../color/attributes":386}],460:[function(_dereq_,module,exports){ +},{"../color/attributes":375}],449:[function(_dereq_,module,exports){ 'use strict'; var listAxes = _dereq_('../../plots/cartesian/axis_ids').list; @@ -67867,7 +69089,7 @@ module.exports = function calcAutorange(gd) { } }; -},{"../../plots/cartesian/autorange":568,"../../plots/cartesian/axis_ids":573,"./constants":461}],461:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/autorange":557,"../../plots/cartesian/axis_ids":562,"./constants":450}],450:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -67915,7 +69137,7 @@ module.exports = { extraPad: 15 }; -},{}],462:[function(_dereq_,module,exports){ +},{}],451:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67993,7 +69215,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName) { containerOut._input = containerIn; }; -},{"../../lib":519,"../../plot_api/plot_template":558,"../../plots/cartesian/axis_ids":573,"./attributes":459,"./oppaxis_attributes":466}],463:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plot_api/plot_template":547,"../../plots/cartesian/axis_ids":562,"./attributes":448,"./oppaxis_attributes":455}],452:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -68629,7 +69851,7 @@ function drawGrabbers(rangeSlider, gd, axisOpts, opts) { grabAreaMax.attr('height', opts._height); } -},{"../../lib":519,"../../lib/setcursor":540,"../../plots/cartesian":583,"../../plots/cartesian/axis_ids":573,"../../plots/plots":608,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"../titles":485,"./constants":461,"@plotly/d3":14}],464:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../lib/setcursor":529,"../../plots/cartesian":572,"../../plots/cartesian/axis_ids":562,"../../plots/plots":597,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"../titles":474,"./constants":450,"@plotly/d3":14}],453:[function(_dereq_,module,exports){ 'use strict'; var axisIDs = _dereq_('../../plots/cartesian/axis_ids'); @@ -68696,7 +69918,7 @@ exports.autoMarginOpts = function(gd, ax) { }; }; -},{"../../constants/alignment":492,"../../lib/svg_text_utils":545,"../../plots/cartesian/axis_ids":573,"./constants":461}],465:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../lib/svg_text_utils":534,"../../plots/cartesian/axis_ids":562,"./constants":450}],454:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -68727,7 +69949,7 @@ module.exports = { autoMarginOpts: helpers.autoMarginOpts }; -},{"../../lib":519,"./attributes":459,"./calc_autorange":460,"./defaults":462,"./draw":463,"./helpers":464,"./oppaxis_attributes":466}],466:[function(_dereq_,module,exports){ +},{"../../lib":508,"./attributes":448,"./calc_autorange":449,"./defaults":451,"./draw":452,"./helpers":453,"./oppaxis_attributes":455}],455:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -68753,7 +69975,7 @@ module.exports = { editType: 'calc' }; -},{}],467:[function(_dereq_,module,exports){ +},{}],456:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -68863,7 +70085,7 @@ module.exports = templatedArray('shape', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":493,"../../lib/extend":511,"../../plot_api/plot_template":558,"../../traces/scatter/attributes":658,"../annotations/attributes":370,"../drawing/attributes":408}],468:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":482,"../../lib/extend":500,"../../plot_api/plot_template":547,"../../traces/scatter/attributes":647,"../annotations/attributes":359,"../drawing/attributes":397}],457:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -68975,7 +70197,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":519,"../../plots/cartesian/axes":569,"./constants":469,"./helpers":478}],469:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/axes":558,"./constants":458,"./helpers":467}],458:[function(_dereq_,module,exports){ 'use strict'; @@ -69030,7 +70252,7 @@ module.exports = { } }; -},{}],470:[function(_dereq_,module,exports){ +},{}],459:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -69152,7 +70374,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) { } } -},{"../../lib":519,"../../plots/array_container_defaults":564,"../../plots/cartesian/axes":569,"./attributes":467,"./helpers":478}],471:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"../../plots/cartesian/axes":558,"./attributes":456,"./helpers":467}],460:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -69917,7 +71139,7 @@ function eraseActiveShape(gd) { } } -},{"../../lib":519,"../../lib/setcursor":540,"../../plot_api/plot_template":558,"../../plots/cartesian/axes":569,"../../plots/cartesian/handle_outline":580,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"./constants":469,"./draw_newshape/display_outlines":475,"./draw_newshape/helpers":476,"./helpers":478}],472:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../lib/setcursor":529,"../../plot_api/plot_template":547,"../../plots/cartesian/axes":558,"../../plots/cartesian/handle_outline":569,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"./constants":458,"./draw_newshape/display_outlines":464,"./draw_newshape/helpers":465,"./helpers":467}],461:[function(_dereq_,module,exports){ 'use strict'; var dash = _dereq_('../../drawing/attributes').dash; @@ -69993,7 +71215,7 @@ module.exports = { } }; -},{"../../../lib/extend":511,"../../drawing/attributes":408}],473:[function(_dereq_,module,exports){ +},{"../../../lib/extend":500,"../../drawing/attributes":397}],462:[function(_dereq_,module,exports){ 'use strict'; var CIRCLE_SIDES = 32; // should be divisible by 4 @@ -70009,7 +71231,7 @@ module.exports = { SQRT2: Math.sqrt(2) }; -},{}],474:[function(_dereq_,module,exports){ +},{}],463:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../color'); @@ -70032,7 +71254,7 @@ module.exports = function supplyDrawNewShapeDefaults(layoutIn, layoutOut, coerce coerce('activeshape.opacity'); }; -},{"../../color":387}],475:[function(_dereq_,module,exports){ +},{"../../color":376}],464:[function(_dereq_,module,exports){ 'use strict'; var dragElement = _dereq_('../../dragelement'); @@ -70318,7 +71540,7 @@ function recordPositions(polygonsOut, polygonsIn) { return polygonsOut; } -},{"../../../plots/cartesian/handle_outline":580,"../../../registry":610,"../../dragelement":406,"../../dragelement/helpers":405,"./constants":473,"./helpers":476,"./newshapes":477}],476:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":569,"../../../registry":599,"../../dragelement":395,"../../dragelement/helpers":394,"./constants":462,"./helpers":465,"./newshapes":466}],465:[function(_dereq_,module,exports){ 'use strict'; var parseSvgPath = _dereq_('parse-svg-path'); @@ -70647,7 +71869,7 @@ exports.ellipseOver = function(pos) { }; }; -},{"../../../plots/cartesian/helpers":581,"./constants":473,"parse-svg-path":268}],477:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/helpers":570,"./constants":462,"parse-svg-path":262}],466:[function(_dereq_,module,exports){ 'use strict'; var dragHelpers = _dereq_('../../dragelement/helpers'); @@ -70897,7 +72119,7 @@ function fixDatesForPaths(polygons, xaxis, yaxis) { return polygons; } -},{"../../../plots/cartesian/handle_outline":580,"../../../plots/cartesian/helpers":581,"../../dragelement/helpers":405,"./constants":473,"./helpers":476}],478:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":569,"../../../plots/cartesian/helpers":570,"../../dragelement/helpers":394,"./constants":462,"./helpers":465}],467:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -71046,7 +72268,7 @@ exports.makeOptionsAndPlotinfo = function(gd, index) { }; }; -},{"../../lib":519,"./constants":469}],479:[function(_dereq_,module,exports){ +},{"../../lib":508,"./constants":458}],468:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -71065,7 +72287,7 @@ module.exports = { drawOne: drawModule.drawOne }; -},{"../../plots/cartesian/include_components":582,"./attributes":467,"./calc_autorange":468,"./defaults":470,"./draw":471,"./draw_newshape/defaults":474}],480:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":571,"./attributes":456,"./calc_autorange":457,"./defaults":459,"./draw":460,"./draw_newshape/defaults":463}],469:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -71239,7 +72461,7 @@ module.exports = overrideAll(templatedArray('slider', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":511,"../../plot_api/edit_types":551,"../../plot_api/plot_template":558,"../../plots/animation_attributes":563,"../../plots/font_attributes":598,"../../plots/pad_attributes":607,"./constants":481}],481:[function(_dereq_,module,exports){ +},{"../../lib/extend":500,"../../plot_api/edit_types":540,"../../plot_api/plot_template":547,"../../plots/animation_attributes":552,"../../plots/font_attributes":587,"../../plots/pad_attributes":596,"./constants":470}],470:[function(_dereq_,module,exports){ 'use strict'; @@ -71324,7 +72546,7 @@ module.exports = { currentValueInset: 0, }; -},{}],482:[function(_dereq_,module,exports){ +},{}],471:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -71431,7 +72653,7 @@ function stepDefaults(valueIn, valueOut) { } } -},{"../../lib":519,"../../plots/array_container_defaults":564,"./attributes":480,"./constants":481}],483:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"./attributes":469,"./constants":470}],472:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -72065,7 +73287,7 @@ function drawRail(sliderGroup, sliderOpts) { ); } -},{"../../constants/alignment":492,"../../lib":519,"../../lib/svg_text_utils":545,"../../plot_api/plot_template":558,"../../plots/plots":608,"../color":387,"../drawing":409,"./constants":481,"@plotly/d3":14}],484:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../lib":508,"../../lib/svg_text_utils":534,"../../plot_api/plot_template":547,"../../plots/plots":597,"../color":376,"../drawing":398,"./constants":470,"@plotly/d3":14}],473:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -72080,7 +73302,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":480,"./constants":481,"./defaults":482,"./draw":483}],485:[function(_dereq_,module,exports){ +},{"./attributes":469,"./constants":470,"./defaults":471,"./draw":472}],474:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -72339,7 +73561,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":492,"../../constants/interactions":496,"../../lib":519,"../../lib/svg_text_utils":545,"../../plots/plots":608,"../../registry":610,"../color":387,"../drawing":409,"@plotly/d3":14,"fast-isnumeric":161}],486:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../constants/interactions":485,"../../lib":508,"../../lib/svg_text_utils":534,"../../plots/plots":597,"../../registry":599,"../color":376,"../drawing":398,"@plotly/d3":14,"fast-isnumeric":158}],475:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -72462,7 +73684,7 @@ module.exports = overrideAll(templatedArray('updatemenu', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":511,"../../plot_api/edit_types":551,"../../plot_api/plot_template":558,"../../plots/font_attributes":598,"../../plots/pad_attributes":607,"../color/attributes":386}],487:[function(_dereq_,module,exports){ +},{"../../lib/extend":500,"../../plot_api/edit_types":540,"../../plot_api/plot_template":547,"../../plots/font_attributes":587,"../../plots/pad_attributes":596,"../color/attributes":375}],476:[function(_dereq_,module,exports){ 'use strict'; @@ -72534,7 +73756,7 @@ module.exports = { } }; -},{}],488:[function(_dereq_,module,exports){ +},{}],477:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -72609,7 +73831,7 @@ function buttonDefaults(buttonIn, buttonOut) { } } -},{"../../lib":519,"../../plots/array_container_defaults":564,"./attributes":486,"./constants":487}],489:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"./attributes":475,"./constants":476}],478:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -73251,9 +74473,9 @@ function removeAllButtons(gButton, newMenuIndexAttr) { .selectAll('g.' + constants.dropdownButtonClassName).remove(); } -},{"../../constants/alignment":492,"../../lib":519,"../../lib/svg_text_utils":545,"../../plot_api/plot_template":558,"../../plots/plots":608,"../color":387,"../drawing":409,"./constants":487,"./scrollbox":491,"@plotly/d3":14}],490:[function(_dereq_,module,exports){ -arguments[4][484][0].apply(exports,arguments) -},{"./attributes":486,"./constants":487,"./defaults":488,"./draw":489,"dup":484}],491:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../lib":508,"../../lib/svg_text_utils":534,"../../plot_api/plot_template":547,"../../plots/plots":597,"../color":376,"../drawing":398,"./constants":476,"./scrollbox":480,"@plotly/d3":14}],479:[function(_dereq_,module,exports){ +arguments[4][473][0].apply(exports,arguments) +},{"./attributes":475,"./constants":476,"./defaults":477,"./draw":478,"dup":473}],480:[function(_dereq_,module,exports){ 'use strict'; module.exports = ScrollBox; @@ -73710,7 +74932,7 @@ ScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) } }; -},{"../../lib":519,"../color":387,"../drawing":409,"@plotly/d3":14}],492:[function(_dereq_,module,exports){ +},{"../../lib":508,"../color":376,"../drawing":398,"@plotly/d3":14}],481:[function(_dereq_,module,exports){ 'use strict'; // fraction of some size to get to a named position @@ -73767,7 +74989,7 @@ module.exports = { } }; -},{}],493:[function(_dereq_,module,exports){ +},{}],482:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -73790,7 +75012,7 @@ module.exports = { } }; -},{}],494:[function(_dereq_,module,exports){ +},{}],483:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -73798,7 +75020,7 @@ module.exports = { DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format' }; -},{}],495:[function(_dereq_,module,exports){ +},{}],484:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -73828,7 +75050,7 @@ module.exports = { } }; -},{}],496:[function(_dereq_,module,exports){ +},{}],485:[function(_dereq_,module,exports){ 'use strict'; @@ -73843,7 +75065,7 @@ module.exports = { DESELECTDIM: 0.2 }; -},{}],497:[function(_dereq_,module,exports){ +},{}],486:[function(_dereq_,module,exports){ 'use strict'; @@ -73908,7 +75130,7 @@ module.exports = { MINUS_SIGN: '\u2212' }; -},{}],498:[function(_dereq_,module,exports){ +},{}],487:[function(_dereq_,module,exports){ 'use strict'; @@ -73923,7 +75145,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],499:[function(_dereq_,module,exports){ +},{}],488:[function(_dereq_,module,exports){ 'use strict'; exports.version = _dereq_('./version').version; @@ -74007,7 +75229,7 @@ exports.Fx = { exports.Snapshot = _dereq_('./snapshot'); exports.PlotSchema = _dereq_('./plot_api/plot_schema'); -},{"../build/plotcss":1,"./components/annotations":378,"./components/annotations3d":383,"./components/colorbar":393,"./components/colorscale":399,"./components/errorbars":415,"./components/fx":427,"./components/grid":431,"./components/images":436,"./components/legend":444,"./components/modebar":450,"./components/rangeselector":458,"./components/rangeslider":465,"./components/shapes":479,"./components/sliders":484,"./components/updatemenus":490,"./fonts/ploticon":500,"./locale-en":549,"./locale-en-us":548,"./plot_api":553,"./plot_api/plot_schema":557,"./plots/plots":608,"./registry":610,"./snapshot":615,"./traces/scatter":670,"./version":716,"native-promise-only":258}],500:[function(_dereq_,module,exports){ +},{"../build/plotcss":1,"./components/annotations":367,"./components/annotations3d":372,"./components/colorbar":382,"./components/colorscale":388,"./components/errorbars":404,"./components/fx":416,"./components/grid":420,"./components/images":425,"./components/legend":433,"./components/modebar":439,"./components/rangeselector":447,"./components/rangeslider":454,"./components/shapes":468,"./components/sliders":473,"./components/updatemenus":479,"./fonts/ploticon":489,"./locale-en":538,"./locale-en-us":537,"./plot_api":542,"./plot_api/plot_schema":546,"./plots/plots":597,"./registry":599,"./snapshot":604,"./traces/scatter":659,"./version":705,"native-promise-only":252}],489:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -74179,7 +75401,7 @@ module.exports = { } }; -},{}],501:[function(_dereq_,module,exports){ +},{}],490:[function(_dereq_,module,exports){ 'use strict'; @@ -74234,7 +75456,7 @@ exports.isBottomAnchor = function isBottomAnchor(opts) { ); }; -},{}],502:[function(_dereq_,module,exports){ +},{}],491:[function(_dereq_,module,exports){ 'use strict'; var modModule = _dereq_('./mod'); @@ -74467,7 +75689,7 @@ module.exports = { pathAnnulus: pathAnnulus }; -},{"./mod":526}],503:[function(_dereq_,module,exports){ +},{"./mod":515}],492:[function(_dereq_,module,exports){ 'use strict'; var isArray = Array.isArray; @@ -74609,7 +75831,7 @@ function _rowLength(z, fn, len0) { return 0; } -},{}],504:[function(_dereq_,module,exports){ +},{}],493:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -74633,7 +75855,7 @@ module.exports = function cleanNumber(v) { return BADNUM; }; -},{"../constants/numerical":497,"fast-isnumeric":161}],505:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"fast-isnumeric":158}],494:[function(_dereq_,module,exports){ 'use strict'; /** @@ -74653,7 +75875,7 @@ module.exports = function clearGlCanvases(gd) { } }; -},{}],506:[function(_dereq_,module,exports){ +},{}],495:[function(_dereq_,module,exports){ 'use strict'; /** @@ -74668,7 +75890,7 @@ module.exports = function clearResponsive(gd) { } }; -},{}],507:[function(_dereq_,module,exports){ +},{}],496:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -75113,7 +76335,7 @@ function validate(value, opts) { } exports.validate = validate; -},{"../components/color":387,"../components/colorscale/scales":402,"../constants/interactions":496,"../plots/attributes":565,"./array":503,"./mod":526,"./nested_property":527,"./regex":536,"fast-isnumeric":161,"tinycolor2":323}],508:[function(_dereq_,module,exports){ +},{"../components/color":376,"../components/colorscale/scales":391,"../constants/interactions":485,"../plots/attributes":554,"./array":492,"./mod":515,"./nested_property":516,"./regex":525,"fast-isnumeric":158,"tinycolor2":313}],497:[function(_dereq_,module,exports){ 'use strict'; var timeFormat = _dereq_('d3-time-format').timeFormat; @@ -75717,7 +76939,7 @@ exports.findExactDates = function(data, calendar) { }; }; -},{"../constants/numerical":497,"../registry":610,"./loggers":523,"./mod":526,"d3-time-format":91,"fast-isnumeric":161}],509:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"../registry":599,"./loggers":512,"./mod":515,"d3-time-format":88,"fast-isnumeric":158}],498:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -75887,7 +77109,7 @@ module.exports = { equalDomRects: equalDomRects }; -},{"./loggers":523,"./matrix":525,"@plotly/d3":14,"gl-mat4":190}],510:[function(_dereq_,module,exports){ +},{"./loggers":512,"./matrix":514,"@plotly/d3":14,"gl-mat4":186}],499:[function(_dereq_,module,exports){ 'use strict'; /* global jQuery:false */ @@ -76051,7 +77273,7 @@ var Events = { module.exports = Events; -},{"events":57}],511:[function(_dereq_,module,exports){ +},{"events":57}],500:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('./is_plain_object.js'); @@ -76156,7 +77378,7 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { return target; } -},{"./is_plain_object.js":520}],512:[function(_dereq_,module,exports){ +},{"./is_plain_object.js":509}],501:[function(_dereq_,module,exports){ 'use strict'; @@ -76198,7 +77420,7 @@ module.exports = function filterUnique(array) { return out; }; -},{}],513:[function(_dereq_,module,exports){ +},{}],502:[function(_dereq_,module,exports){ 'use strict'; /** Filter out object items with visible !== true @@ -76238,7 +77460,7 @@ function isCalcData(cont) { ); } -},{}],514:[function(_dereq_,module,exports){ +},{}],503:[function(_dereq_,module,exports){ 'use strict'; var mod = _dereq_('./mod').mod; @@ -76474,7 +77696,7 @@ exports.findPointOnPath = function findPointOnPath(path, val, coord, opts) { return pt; }; -},{"./mod":526}],515:[function(_dereq_,module,exports){ +},{"./mod":515}],504:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -76567,7 +77789,7 @@ module.exports = { parseColorScale: parseColorScale }; -},{"../components/color/attributes":386,"../components/colorscale":399,"./array":503,"color-normalize":69,"fast-isnumeric":161,"tinycolor2":323}],516:[function(_dereq_,module,exports){ +},{"../components/color/attributes":375,"../components/colorscale":388,"./array":492,"color-normalize":69,"fast-isnumeric":158,"tinycolor2":313}],505:[function(_dereq_,module,exports){ 'use strict'; var identity = _dereq_('./identity'); @@ -76595,7 +77817,7 @@ module.exports = { unwrap: function(d) {return d[0];} }; -},{"./identity":517}],517:[function(_dereq_,module,exports){ +},{"./identity":506}],506:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -76603,7 +77825,7 @@ module.exports = { module.exports = function identity(d) { return d; }; -},{}],518:[function(_dereq_,module,exports){ +},{}],507:[function(_dereq_,module,exports){ 'use strict'; module.exports = function incrementNumeric(x, delta) { @@ -76636,7 +77858,7 @@ module.exports = function incrementNumeric(x, delta) { return newX; }; -},{}],519:[function(_dereq_,module,exports){ +},{}],508:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -78024,7 +79246,7 @@ lib.getPositionFromD3Event = function() { } }; -},{"../constants/numerical":497,"./anchor_utils":501,"./angles":502,"./array":503,"./clean_number":504,"./clear_responsive":506,"./coerce":507,"./dates":508,"./dom":509,"./extend":511,"./filter_unique":512,"./filter_visible":513,"./geometry2d":514,"./identity":517,"./increment":518,"./is_plain_object":520,"./keyed_container":521,"./localize":522,"./loggers":523,"./make_trace_groups":524,"./matrix":525,"./mod":526,"./nested_property":527,"./noop":528,"./notifier":529,"./preserve_drawing_buffer":533,"./push_unique":534,"./regex":536,"./relative_attr":537,"./relink_private":538,"./search":539,"./sort_object_keys":542,"./stats":543,"./throttle":546,"./to_log_range":547,"@plotly/d3":14,"d3-format":90,"d3-time-format":91,"fast-isnumeric":161}],520:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"./anchor_utils":490,"./angles":491,"./array":492,"./clean_number":493,"./clear_responsive":495,"./coerce":496,"./dates":497,"./dom":498,"./extend":500,"./filter_unique":501,"./filter_visible":502,"./geometry2d":503,"./identity":506,"./increment":507,"./is_plain_object":509,"./keyed_container":510,"./localize":511,"./loggers":512,"./make_trace_groups":513,"./matrix":514,"./mod":515,"./nested_property":516,"./noop":517,"./notifier":518,"./preserve_drawing_buffer":522,"./push_unique":523,"./regex":525,"./relative_attr":526,"./relink_private":527,"./search":528,"./sort_object_keys":531,"./stats":532,"./throttle":535,"./to_log_range":536,"@plotly/d3":14,"d3-format":87,"d3-time-format":88,"fast-isnumeric":158}],509:[function(_dereq_,module,exports){ 'use strict'; // more info: http://stackoverflow.com/questions/18531624/isplainobject-thing @@ -78043,7 +79265,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],521:[function(_dereq_,module,exports){ +},{}],510:[function(_dereq_,module,exports){ 'use strict'; var nestedProperty = _dereq_('./nested_property'); @@ -78228,7 +79450,7 @@ module.exports = function keyedContainer(baseObj, path, keyName, valueName) { return obj; }; -},{"./nested_property":527}],522:[function(_dereq_,module,exports){ +},{"./nested_property":516}],511:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -78275,7 +79497,7 @@ module.exports = function localize(gd, s) { return s; }; -},{"../registry":610}],523:[function(_dereq_,module,exports){ +},{"../registry":599}],512:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-console */ @@ -78352,7 +79574,7 @@ loggers.error = function() { } }; -},{"../plot_api/plot_config":556,"./notifier":529}],524:[function(_dereq_,module,exports){ +},{"../plot_api/plot_config":545,"./notifier":518}],513:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -78387,7 +79609,7 @@ module.exports = function makeTraceGroups(traceLayer, cdModule, cls) { return traces; }; -},{"@plotly/d3":14}],525:[function(_dereq_,module,exports){ +},{"@plotly/d3":14}],514:[function(_dereq_,module,exports){ 'use strict'; var mat4X4 = _dereq_('gl-mat4'); @@ -78530,7 +79752,7 @@ exports.inverseTransformMatrix = function(m) { ]; }; -},{"gl-mat4":190}],526:[function(_dereq_,module,exports){ +},{"gl-mat4":186}],515:[function(_dereq_,module,exports){ 'use strict'; /** @@ -78557,7 +79779,7 @@ module.exports = { modHalf: modHalf }; -},{}],527:[function(_dereq_,module,exports){ +},{}],516:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -78794,7 +80016,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"./array":503,"fast-isnumeric":161}],528:[function(_dereq_,module,exports){ +},{"./array":492,"fast-isnumeric":158}],517:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -78802,7 +80024,7 @@ function badContainer(container, propStr, propParts) { module.exports = function noop() {}; -},{}],529:[function(_dereq_,module,exports){ +},{}],518:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -78881,7 +80103,7 @@ module.exports = function(text, displayLength) { }); }; -},{"@plotly/d3":14,"fast-isnumeric":161}],530:[function(_dereq_,module,exports){ +},{"@plotly/d3":14,"fast-isnumeric":158}],519:[function(_dereq_,module,exports){ 'use strict'; var setCursor = _dereq_('./setcursor'); @@ -78920,7 +80142,7 @@ module.exports = function overrideCursor(el3, csr) { } }; -},{"./setcursor":540}],531:[function(_dereq_,module,exports){ +},{"./setcursor":529}],520:[function(_dereq_,module,exports){ 'use strict'; var dot = _dereq_('./matrix').dot; @@ -79163,7 +80385,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"../constants/numerical":497,"./matrix":525}],532:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"./matrix":514}],521:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict'; @@ -79229,7 +80451,7 @@ module.exports = function prepareRegl(gd, extensions) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./show_no_webgl_msg":541,"regl":297}],533:[function(_dereq_,module,exports){ +},{"./show_no_webgl_msg":530,"regl":288}],522:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -79291,7 +80513,7 @@ function getUserAgent() { return ua; } -},{"fast-isnumeric":161,"is-mobile":248}],534:[function(_dereq_,module,exports){ +},{"fast-isnumeric":158,"is-mobile":242}],523:[function(_dereq_,module,exports){ 'use strict'; /** @@ -79321,7 +80543,7 @@ module.exports = function pushUnique(array, item) { return array; }; -},{}],535:[function(_dereq_,module,exports){ +},{}],524:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -79513,7 +80735,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../lib":519,"../plot_api/plot_config":556}],536:[function(_dereq_,module,exports){ +},{"../lib":508,"../plot_api/plot_config":545}],525:[function(_dereq_,module,exports){ 'use strict'; /* @@ -79535,7 +80757,7 @@ exports.counter = function(head, tail, openEnded, matchBeginning) { return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail); }; -},{}],537:[function(_dereq_,module,exports){ +},{}],526:[function(_dereq_,module,exports){ 'use strict'; // ASCEND: chop off the last nesting level - either [] or . - to ascend @@ -79579,7 +80801,7 @@ module.exports = function(baseAttr, relativeAttr) { return baseAttr + relativeAttr; }; -},{}],538:[function(_dereq_,module,exports){ +},{}],527:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; @@ -79627,7 +80849,7 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { } }; -},{"./array":503,"./is_plain_object":520}],539:[function(_dereq_,module,exports){ +},{"./array":492,"./is_plain_object":509}],528:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -79819,7 +81041,7 @@ exports.findIndexOfMin = function(arr, fn) { return ind; }; -},{"../constants/numerical":497,"./identity":517,"./loggers":523,"fast-isnumeric":161}],540:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"./identity":506,"./loggers":512,"fast-isnumeric":158}],529:[function(_dereq_,module,exports){ 'use strict'; // works with our CSS cursor classes (see css/_cursor.scss) @@ -79833,7 +81055,7 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],541:[function(_dereq_,module,exports){ +},{}],530:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../components/color'); @@ -79888,14 +81110,14 @@ module.exports = function showNoWebGlMsg(scene) { return false; }; -},{"../components/color":387}],542:[function(_dereq_,module,exports){ +},{"../components/color":376}],531:[function(_dereq_,module,exports){ 'use strict'; module.exports = function sortObjectKeys(obj) { return Object.keys(obj).sort(); }; -},{}],543:[function(_dereq_,module,exports){ +},{}],532:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -79996,7 +81218,7 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"./array":503,"fast-isnumeric":161}],544:[function(_dereq_,module,exports){ +},{"./array":492,"fast-isnumeric":158}],533:[function(_dereq_,module,exports){ 'use strict'; var rgba = _dereq_('color-normalize'); @@ -80008,7 +81230,7 @@ function str2RgbaArray(color) { module.exports = str2RgbaArray; -},{"color-normalize":69}],545:[function(_dereq_,module,exports){ +},{"color-normalize":69}],534:[function(_dereq_,module,exports){ 'use strict'; /* global MathJax:false */ @@ -80917,7 +82139,7 @@ exports.makeEditable = function(context, options) { return d3.rebind(context, dispatch, 'on'); }; -},{"../constants/alignment":492,"../constants/xmlns_namespaces":498,"../lib":519,"@plotly/d3":14}],546:[function(_dereq_,module,exports){ +},{"../constants/alignment":481,"../constants/xmlns_namespaces":487,"../lib":508,"@plotly/d3":14}],535:[function(_dereq_,module,exports){ 'use strict'; var timerCache = {}; @@ -81012,7 +82234,7 @@ function _clearTimeout(cache) { } } -},{}],547:[function(_dereq_,module,exports){ +},{}],536:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -81032,7 +82254,7 @@ module.exports = function toLogRange(val, range) { return newVal; }; -},{"fast-isnumeric":161}],548:[function(_dereq_,module,exports){ +},{"fast-isnumeric":158}],537:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -81046,7 +82268,7 @@ module.exports = { } }; -},{}],549:[function(_dereq_,module,exports){ +},{}],538:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -81081,7 +82303,7 @@ module.exports = { } }; -},{}],550:[function(_dereq_,module,exports){ +},{}],539:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -81130,7 +82352,7 @@ module.exports = function containerArrayMatch(astr) { return {array: arrayStr, index: Number(match[1]), property: match[3] || ''}; }; -},{"../registry":610}],551:[function(_dereq_,module,exports){ +},{"../registry":599}],540:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -81245,7 +82467,7 @@ function overrideOne(attr, editTypeOverride, overrideContainers, key) { } } -},{"../lib":519}],552:[function(_dereq_,module,exports){ +},{"../lib":508}],541:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -81939,7 +83161,7 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) { } }; -},{"../components/color":387,"../lib":519,"../plots/cartesian/axis_ids":573,"../plots/plots":608,"../registry":610,"fast-isnumeric":161,"gl-mat4/fromQuat":180}],553:[function(_dereq_,module,exports){ +},{"../components/color":376,"../lib":508,"../plots/cartesian/axis_ids":562,"../plots/plots":597,"../registry":599,"fast-isnumeric":158,"gl-mat4/fromQuat":176}],542:[function(_dereq_,module,exports){ 'use strict'; var main = _dereq_('./plot_api'); @@ -81974,7 +83196,7 @@ var templateApi = _dereq_('./template_api'); exports.makeTemplate = templateApi.makeTemplate; exports.validateTemplate = templateApi.validateTemplate; -},{"../snapshot/download":612,"./plot_api":555,"./template_api":560,"./to_image":561,"./validate":562}],554:[function(_dereq_,module,exports){ +},{"../snapshot/download":601,"./plot_api":544,"./template_api":549,"./to_image":550,"./validate":551}],543:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('../lib/is_plain_object'); @@ -82178,7 +83400,7 @@ exports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, return true; }; -},{"../lib/is_plain_object":520,"../lib/loggers":523,"../lib/noop":528,"../lib/search":539,"../registry":610,"./container_array_match":550}],555:[function(_dereq_,module,exports){ +},{"../lib/is_plain_object":509,"../lib/loggers":512,"../lib/noop":517,"../lib/search":528,"../registry":599,"./container_array_match":539}],544:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -85992,7 +87214,7 @@ exports._guiUpdate = guiEdit(update); exports._storeDirectGUIEdit = _storeDirectGUIEdit; -},{"../components/color":387,"../components/drawing":409,"../constants/xmlns_namespaces":498,"../lib":519,"../lib/events":510,"../lib/queue":535,"../plots/cartesian/axes":569,"../plots/cartesian/constants":576,"../plots/cartesian/graph_interact":579,"../plots/cartesian/select":589,"../plots/plots":608,"../registry":610,"./edit_types":551,"./helpers":552,"./manage_arrays":554,"./plot_config":556,"./plot_schema":557,"./subroutines":559,"@plotly/d3":14,"fast-isnumeric":161,"has-hover":238}],556:[function(_dereq_,module,exports){ +},{"../components/color":376,"../components/drawing":398,"../constants/xmlns_namespaces":487,"../lib":508,"../lib/events":499,"../lib/queue":524,"../plots/cartesian/axes":558,"../plots/cartesian/constants":565,"../plots/cartesian/graph_interact":568,"../plots/cartesian/select":578,"../plots/plots":597,"../registry":599,"./edit_types":540,"./helpers":541,"./manage_arrays":543,"./plot_config":545,"./plot_schema":546,"./subroutines":548,"@plotly/d3":14,"fast-isnumeric":158,"has-hover":234}],545:[function(_dereq_,module,exports){ 'use strict'; /** @@ -86253,7 +87475,7 @@ module.exports = { dfltConfig: dfltConfig }; -},{}],557:[function(_dereq_,module,exports){ +},{}],546:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -86918,7 +88140,7 @@ function insertAttrs(baseAttrs, newAttrs, astr) { np.set(extendDeepAll(np.get() || {}, newAttrs)); } -},{"../lib":519,"../plots/animation_attributes":563,"../plots/attributes":565,"../plots/frame_attributes":599,"../plots/layout_attributes":606,"../registry":610,"./edit_types":551,"./plot_config":556}],558:[function(_dereq_,module,exports){ +},{"../lib":508,"../plots/animation_attributes":552,"../plots/attributes":554,"../plots/frame_attributes":588,"../plots/layout_attributes":595,"../registry":599,"./edit_types":540,"./plot_config":545}],547:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -87217,7 +88439,7 @@ exports.arrayEditor = function(parentIn, containerStr, itemOut) { }; }; -},{"../lib":519,"../plots/attributes":565}],559:[function(_dereq_,module,exports){ +},{"../lib":508,"../plots/attributes":554}],548:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -87933,7 +89155,7 @@ exports.drawMarginPushers = function(gd) { Registry.getComponentMethod('colorbar', 'draw')(gd); }; -},{"../components/color":387,"../components/drawing":409,"../components/modebar":450,"../components/titles":485,"../constants/alignment":492,"../lib":519,"../lib/clear_gl_canvases":505,"../plots/cartesian/autorange":568,"../plots/cartesian/axes":569,"../plots/cartesian/constraints":577,"../plots/plots":608,"../registry":610,"@plotly/d3":14}],560:[function(_dereq_,module,exports){ +},{"../components/color":376,"../components/drawing":398,"../components/modebar":439,"../components/titles":474,"../constants/alignment":481,"../lib":508,"../lib/clear_gl_canvases":494,"../plots/cartesian/autorange":557,"../plots/cartesian/axes":558,"../plots/cartesian/constraints":566,"../plots/plots":597,"../registry":599,"@plotly/d3":14}],549:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -88386,7 +89608,7 @@ function format(opts) { return opts; } -},{"../lib":519,"../plots/attributes":565,"../plots/plots":608,"./plot_config":556,"./plot_schema":557,"./plot_template":558}],561:[function(_dereq_,module,exports){ +},{"../lib":508,"../plots/attributes":554,"../plots/plots":597,"./plot_config":545,"./plot_schema":546,"./plot_template":547}],550:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -88593,7 +89815,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":519,"../plots/plots":608,"../snapshot/helpers":614,"../snapshot/svgtoimg":616,"../snapshot/tosvg":618,"../version":716,"./plot_api":555,"fast-isnumeric":161}],562:[function(_dereq_,module,exports){ +},{"../lib":508,"../plots/plots":597,"../snapshot/helpers":603,"../snapshot/svgtoimg":605,"../snapshot/tosvg":607,"../version":705,"./plot_api":544,"fast-isnumeric":158}],551:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -89016,7 +90238,7 @@ function convertPathToAttributeString(path) { return astr; } -},{"../lib":519,"../plots/plots":608,"./plot_config":556,"./plot_schema":557}],563:[function(_dereq_,module,exports){ +},{"../lib":508,"../plots/plots":597,"./plot_config":545,"./plot_schema":546}],552:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -89104,7 +90326,7 @@ module.exports = { } }; -},{}],564:[function(_dereq_,module,exports){ +},{}],553:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -89191,7 +90413,7 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut return contOut; }; -},{"../lib":519,"../plot_api/plot_template":558}],565:[function(_dereq_,module,exports){ +},{"../lib":508,"../plot_api/plot_template":547}],554:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -89313,7 +90535,7 @@ module.exports = { } }; -},{"../components/fx/attributes":418,"./font_attributes":598}],566:[function(_dereq_,module,exports){ +},{"../components/fx/attributes":407,"./font_attributes":587}],555:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -89408,7 +90630,7 @@ module.exports = function alignPeriod(trace, ax, axLetter, vals) { }; }; -},{"../../constants/numerical":497,"../../lib":519,"fast-isnumeric":161}],567:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"fast-isnumeric":158}],556:[function(_dereq_,module,exports){ 'use strict'; @@ -89425,7 +90647,7 @@ module.exports = { } }; -},{}],568:[function(_dereq_,module,exports){ +},{}],557:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -90052,7 +91274,7 @@ function goodNumber(v) { function lessOrEqual(v0, v1) { return v0 <= v1; } function greaterOrEqual(v0, v1) { return v0 >= v1; } -},{"../../components/drawing":409,"../../constants/numerical":497,"../../lib":519,"../../registry":610,"./axis_ids":573,"@plotly/d3":14,"fast-isnumeric":161}],569:[function(_dereq_,module,exports){ +},{"../../components/drawing":398,"../../constants/numerical":486,"../../lib":508,"../../registry":599,"./axis_ids":562,"@plotly/d3":14,"fast-isnumeric":158}],558:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -93894,7 +95116,7 @@ function hideCounterAxisInsideTickLabels(ax, opts) { } } -},{"../../components/color":387,"../../components/drawing":409,"../../components/titles":485,"../../constants/alignment":492,"../../constants/numerical":497,"../../lib":519,"../../lib/svg_text_utils":545,"../../plots/plots":608,"../../registry":610,"./autorange":568,"./axis_autotype":570,"./axis_ids":573,"./clean_ticks":575,"./layout_attributes":584,"./set_convert":590,"@plotly/d3":14,"fast-isnumeric":161}],570:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../components/drawing":398,"../../components/titles":474,"../../constants/alignment":481,"../../constants/numerical":486,"../../lib":508,"../../lib/svg_text_utils":534,"../../plots/plots":597,"../../registry":599,"./autorange":557,"./axis_autotype":559,"./axis_ids":562,"./clean_ticks":564,"./layout_attributes":573,"./set_convert":579,"@plotly/d3":14,"fast-isnumeric":158}],559:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -94016,7 +95238,7 @@ function multiCategory(a) { return isArrayOrTypedArray(a[0]) && isArrayOrTypedArray(a[1]); } -},{"../../constants/numerical":497,"../../lib":519,"fast-isnumeric":161}],571:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"fast-isnumeric":158}],560:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -94328,7 +95550,7 @@ function indexOfDay(v) { ]; } -},{"../../lib":519,"../../registry":610,"../array_container_defaults":564,"./category_order_defaults":574,"./constants":576,"./layout_attributes":584,"./line_grid_defaults":586,"./set_convert":590,"./tick_label_defaults":591,"./tick_mark_defaults":592,"./tick_value_defaults":593,"fast-isnumeric":161}],572:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"../array_container_defaults":553,"./category_order_defaults":563,"./constants":565,"./layout_attributes":573,"./line_grid_defaults":575,"./set_convert":579,"./tick_label_defaults":580,"./tick_mark_defaults":581,"./tick_value_defaults":582,"fast-isnumeric":158}],561:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../../constants/docs'); @@ -94377,7 +95599,7 @@ module.exports = { descriptionWithDates: descriptionWithDates }; -},{"../../constants/docs":494}],573:[function(_dereq_,module,exports){ +},{"../../constants/docs":483}],562:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -94525,7 +95747,7 @@ exports.isLinked = function(fullLayout, axId) { ); }; -},{"../../registry":610,"./constants":576}],574:[function(_dereq_,module,exports){ +},{"../../registry":599,"./constants":565}],563:[function(_dereq_,module,exports){ 'use strict'; function findCategories(ax, opts) { @@ -94611,7 +95833,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],575:[function(_dereq_,module,exports){ +},{}],564:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -94695,7 +95917,7 @@ exports.tick0 = function(tick0, axType, calendar, dtick) { return isNumeric(tick0) ? Number(tick0) : 0; }; -},{"../../constants/numerical":497,"../../lib":519,"fast-isnumeric":161}],576:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"fast-isnumeric":158}],565:[function(_dereq_,module,exports){ 'use strict'; var counterRegex = _dereq_('../../lib/regex').counter; @@ -94779,7 +96001,7 @@ module.exports = { } }; -},{"../../lib/regex":536}],577:[function(_dereq_,module,exports){ +},{"../../lib/regex":525}],566:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -95422,7 +96644,7 @@ function updateDomain(ax, factor) { ax.setScale(); } -},{"../../constants/alignment":492,"../../constants/numerical":497,"../../lib":519,"./autorange":568,"./axis_ids":573,"./layout_attributes":584,"./scale_zoom":588,"./set_convert":590}],578:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481,"../../constants/numerical":486,"../../lib":508,"./autorange":557,"./axis_ids":562,"./layout_attributes":573,"./scale_zoom":577,"./set_convert":579}],567:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -96754,7 +97976,7 @@ module.exports = { attachWheelEventHandler: attachWheelEventHandler }; -},{"../../components/color":387,"../../components/dragelement":406,"../../components/dragelement/helpers":405,"../../components/drawing":409,"../../components/fx":427,"../../constants/alignment":492,"../../lib":519,"../../lib/clear_gl_canvases":505,"../../lib/setcursor":540,"../../lib/svg_text_utils":545,"../../plot_api/subroutines":559,"../../registry":610,"../plots":608,"./axes":569,"./axis_ids":573,"./constants":576,"./scale_zoom":588,"./select":589,"@plotly/d3":14,"has-passive-events":239,"tinycolor2":323}],579:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../components/dragelement":395,"../../components/dragelement/helpers":394,"../../components/drawing":398,"../../components/fx":416,"../../constants/alignment":481,"../../lib":508,"../../lib/clear_gl_canvases":494,"../../lib/setcursor":529,"../../lib/svg_text_utils":534,"../../plot_api/subroutines":548,"../../registry":599,"../plots":597,"./axes":558,"./axis_ids":562,"./constants":565,"./scale_zoom":577,"./select":578,"@plotly/d3":14,"has-passive-events":235,"tinycolor2":313}],568:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -96913,7 +98135,7 @@ exports.updateFx = function(gd) { setCursor(fullLayout._draggers, cursor); }; -},{"../../components/dragelement":406,"../../components/fx":427,"../../lib/setcursor":540,"./constants":576,"./dragbox":578,"@plotly/d3":14}],580:[function(_dereq_,module,exports){ +},{"../../components/dragelement":395,"../../components/fx":416,"../../lib/setcursor":529,"./constants":565,"./dragbox":567,"@plotly/d3":14}],569:[function(_dereq_,module,exports){ 'use strict'; function clearOutlineControllers(gd) { @@ -96940,7 +98162,7 @@ module.exports = { clearSelect: clearSelect }; -},{}],581:[function(_dereq_,module,exports){ +},{}],570:[function(_dereq_,module,exports){ 'use strict'; var strTranslate = _dereq_('../../lib').strTranslate; @@ -96988,7 +98210,7 @@ module.exports = { getTransform: getTransform }; -},{"../../lib":519}],582:[function(_dereq_,module,exports){ +},{"../../lib":508}],571:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -97057,7 +98279,7 @@ module.exports = function makeIncludeComponents(containerArrayName) { }; }; -},{"../../lib":519,"../../registry":610,"./axis_ids":573}],583:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"./axis_ids":562}],572:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -97666,7 +98888,7 @@ exports.toSVG = function(gd) { exports.updateFx = _dereq_('./graph_interact').updateFx; -},{"../../components/drawing":409,"../../constants/xmlns_namespaces":498,"../../lib":519,"../../registry":610,"../get_data":600,"../plots":608,"./attributes":567,"./axis_ids":573,"./constants":576,"./graph_interact":579,"./layout_attributes":584,"./layout_defaults":585,"./transition_axes":594,"@plotly/d3":14}],584:[function(_dereq_,module,exports){ +},{"../../components/drawing":398,"../../constants/xmlns_namespaces":487,"../../lib":508,"../../registry":599,"../get_data":589,"../plots":597,"./attributes":556,"./axis_ids":562,"./constants":565,"./graph_interact":568,"./layout_attributes":573,"./layout_defaults":574,"./transition_axes":583,"@plotly/d3":14}],573:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../font_attributes'); @@ -98227,7 +99449,7 @@ module.exports = { } }; -},{"../../components/color/attributes":386,"../../components/drawing/attributes":408,"../../constants/numerical":497,"../../lib/extend":511,"../../plot_api/plot_template":558,"../../plots/cartesian/axis_format_attributes":572,"../font_attributes":598,"./constants":576}],585:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":375,"../../components/drawing/attributes":397,"../../constants/numerical":486,"../../lib/extend":500,"../../plot_api/plot_template":547,"../../plots/cartesian/axis_format_attributes":561,"../font_attributes":587,"./constants":565}],574:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -98605,7 +99827,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":387,"../../components/fx/helpers":423,"../../components/fx/hovermode_defaults":426,"../../lib":519,"../../plot_api/plot_template":558,"../../registry":610,"../layout_attributes":606,"./axis_defaults":571,"./axis_ids":573,"./constants":576,"./constraints":577,"./layout_attributes":584,"./position_defaults":587,"./type_defaults":595}],586:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../components/fx/helpers":412,"../../components/fx/hovermode_defaults":415,"../../lib":508,"../../plot_api/plot_template":547,"../../registry":599,"../layout_attributes":595,"./axis_defaults":560,"./axis_ids":562,"./constants":565,"./constraints":566,"./layout_attributes":573,"./position_defaults":576,"./type_defaults":584}],575:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -98662,7 +99884,7 @@ module.exports = function handleLineGridDefaults(containerIn, containerOut, coer } }; -},{"../../components/color/attributes":386,"../../lib":519,"tinycolor2":323}],587:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":375,"../../lib":508,"tinycolor2":313}],576:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -98741,7 +99963,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":519,"fast-isnumeric":161}],588:[function(_dereq_,module,exports){ +},{"../../lib":508,"fast-isnumeric":158}],577:[function(_dereq_,module,exports){ 'use strict'; var FROM_BL = _dereq_('../../constants/alignment').FROM_BL; @@ -98761,7 +99983,7 @@ module.exports = function scaleZoom(ax, factor, centerFraction) { ax.setScale(); }; -},{"../../constants/alignment":492}],589:[function(_dereq_,module,exports){ +},{"../../constants/alignment":481}],578:[function(_dereq_,module,exports){ 'use strict'; var polybool = _dereq_('polybooljs'); @@ -99695,7 +100917,7 @@ module.exports = { selectOnClick: selectOnClick }; -},{"../../components/color":387,"../../components/dragelement/helpers":405,"../../components/drawing":409,"../../components/fx":427,"../../components/fx/helpers":423,"../../components/shapes/draw_newshape/display_outlines":475,"../../components/shapes/draw_newshape/helpers":476,"../../components/shapes/draw_newshape/newshapes":477,"../../lib":519,"../../lib/clear_gl_canvases":505,"../../lib/polygon":531,"../../lib/throttle":546,"../../plot_api/subroutines":559,"../../registry":610,"./axis_ids":573,"./constants":576,"./handle_outline":580,"./helpers":581,"polybooljs":279}],590:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../components/dragelement/helpers":394,"../../components/drawing":398,"../../components/fx":416,"../../components/fx/helpers":412,"../../components/shapes/draw_newshape/display_outlines":464,"../../components/shapes/draw_newshape/helpers":465,"../../components/shapes/draw_newshape/newshapes":466,"../../lib":508,"../../lib/clear_gl_canvases":494,"../../lib/polygon":520,"../../lib/throttle":535,"../../plot_api/subroutines":548,"../../registry":599,"./axis_ids":562,"./constants":565,"./handle_outline":569,"./helpers":570,"polybooljs":270}],579:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -100659,7 +101881,7 @@ module.exports = function setConvert(ax, fullLayout) { delete ax._forceTick0; }; -},{"../../constants/numerical":497,"../../lib":519,"./axis_ids":573,"./constants":576,"@plotly/d3":14,"d3-time-format":91,"fast-isnumeric":161}],591:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"./axis_ids":562,"./constants":565,"@plotly/d3":14,"d3-time-format":88,"fast-isnumeric":158}],580:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -100777,7 +101999,7 @@ function tickformatstopDefaults(valueIn, valueOut) { } } -},{"../../components/color":387,"../../lib":519,"../array_container_defaults":564,"./layout_attributes":584}],592:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../lib":508,"../array_container_defaults":553,"./layout_attributes":573}],581:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -100801,7 +102023,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":519,"./layout_attributes":584}],593:[function(_dereq_,module,exports){ +},{"../../lib":508,"./layout_attributes":573}],582:[function(_dereq_,module,exports){ 'use strict'; var cleanTicks = _dereq_('./clean_ticks'); @@ -100840,7 +102062,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"../../lib":519,"./clean_ticks":575}],594:[function(_dereq_,module,exports){ +},{"../../lib":508,"./clean_ticks":564}],583:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -101045,7 +102267,7 @@ module.exports = function transitionAxes(gd, edits, transitionOpts, makeOnComple return Promise.resolve(); }; -},{"../../components/drawing":409,"../../lib":519,"../../registry":610,"./axes":569,"@plotly/d3":14}],595:[function(_dereq_,module,exports){ +},{"../../components/drawing":398,"../../lib":508,"../../registry":599,"./axes":558,"@plotly/d3":14}],584:[function(_dereq_,module,exports){ 'use strict'; var traceIs = _dereq_('../../registry').traceIs; @@ -101177,7 +102399,7 @@ function isBoxWithoutPositionCoords(trace, axLetter) { ); } -},{"../../registry":610,"./axis_autotype":570}],596:[function(_dereq_,module,exports){ +},{"../../registry":599,"./axis_autotype":559}],585:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -101596,7 +102818,7 @@ function crawl(attrs, callback, path, depth) { }); } -},{"../lib":519,"../registry":610}],597:[function(_dereq_,module,exports){ +},{"../lib":508,"../registry":599}],586:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../lib/extend').extendFlat; @@ -101693,7 +102915,7 @@ exports.defaults = function(containerOut, layout, coerce, dfltDomains) { if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice(); }; -},{"../lib/extend":511}],598:[function(_dereq_,module,exports){ +},{"../lib/extend":500}],587:[function(_dereq_,module,exports){ 'use strict'; /* @@ -101745,7 +102967,7 @@ module.exports = function(opts) { return attrs; }; -},{}],599:[function(_dereq_,module,exports){ +},{}],588:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -101771,7 +102993,7 @@ module.exports = { } }; -},{}],600:[function(_dereq_,module,exports){ +},{}],589:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -101892,7 +103114,7 @@ exports.getSubplotData = function getSubplotData(data, type, subplotId) { return subplotData; }; -},{"../registry":610,"./cartesian/constants":576}],601:[function(_dereq_,module,exports){ +},{"../registry":599,"./cartesian/constants":565}],590:[function(_dereq_,module,exports){ 'use strict'; var mouseChange = _dereq_('mouse-change'); @@ -102178,7 +103400,7 @@ function createCamera(scene) { return result; } -},{"../cartesian/constants":576,"has-passive-events":239,"mouse-change":254,"mouse-event-offset":255,"mouse-wheel":257}],602:[function(_dereq_,module,exports){ +},{"../cartesian/constants":565,"has-passive-events":235,"mouse-change":248,"mouse-event-offset":249,"mouse-wheel":251}],591:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../cartesian/axes'); @@ -102412,7 +103634,7 @@ function createAxes2D(scene) { module.exports = createAxes2D; -},{"../../lib/str2rgbarray":544,"../cartesian/axes":569}],603:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":533,"../cartesian/axes":558}],592:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -102554,7 +103776,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/fx/layout_attributes":428,"../../constants/xmlns_namespaces":498,"../../plot_api/edit_types":551,"../cartesian":583,"../cartesian/attributes":567,"../cartesian/constants":576,"../get_data":600,"../layout_attributes":606,"./scene2d":604}],604:[function(_dereq_,module,exports){ +},{"../../components/fx/layout_attributes":417,"../../constants/xmlns_namespaces":487,"../../plot_api/edit_types":540,"../cartesian":572,"../cartesian/attributes":556,"../cartesian/constants":565,"../get_data":589,"../layout_attributes":595,"./scene2d":593}],593:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -103266,7 +104488,7 @@ proto.hoverFormatter = function(axisName, val) { return Axes.tickText(axis, axis.c2l(val), 'hover').text; }; -},{"../../components/dragelement/helpers":405,"../../components/fx":427,"../../lib/show_no_webgl_msg":541,"../../plots/cartesian/axes":569,"../../registry":610,"../cartesian/autorange":568,"../cartesian/constants":576,"../cartesian/constraints":577,"./camera":601,"./convert":602,"gl-plot2d":211,"gl-select-box":216,"gl-spikes2d":225,"webgl-context":350}],605:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":394,"../../components/fx":416,"../../lib/show_no_webgl_msg":530,"../../plots/cartesian/axes":558,"../../registry":599,"../cartesian/autorange":557,"../cartesian/constants":565,"../cartesian/constraints":566,"./camera":590,"./convert":591,"gl-plot2d":207,"gl-select-box":212,"gl-spikes2d":221,"webgl-context":339}],594:[function(_dereq_,module,exports){ 'use strict'; function xformMatrix(m, v) { @@ -103291,7 +104513,7 @@ function project(camera, v) { module.exports = project; -},{}],606:[function(_dereq_,module,exports){ +},{}],595:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -103518,7 +104740,7 @@ module.exports = { } }; -},{"../components/color/attributes":386,"../components/shapes/draw_newshape/attributes":472,"../lib/extend":511,"./animation_attributes":563,"./font_attributes":598,"./pad_attributes":607}],607:[function(_dereq_,module,exports){ +},{"../components/color/attributes":375,"../components/shapes/draw_newshape/attributes":461,"../lib/extend":500,"./animation_attributes":552,"./font_attributes":587,"./pad_attributes":596}],596:[function(_dereq_,module,exports){ 'use strict'; /** @@ -103557,7 +104779,7 @@ module.exports = function(opts) { }; }; -},{}],608:[function(_dereq_,module,exports){ +},{}],597:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -106983,7 +108205,7 @@ plots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullD } }; -},{"../components/color":387,"../constants/numerical":497,"../lib":519,"../plot_api/plot_schema":557,"../plot_api/plot_template":558,"../plots/get_data":600,"../registry":610,"./animation_attributes":563,"./attributes":565,"./cartesian/axis_ids":573,"./cartesian/handle_outline":580,"./command":596,"./font_attributes":598,"./frame_attributes":599,"./layout_attributes":606,"@plotly/d3":14,"d3-format":90,"d3-time-format":91,"fast-isnumeric":161}],609:[function(_dereq_,module,exports){ +},{"../components/color":376,"../constants/numerical":486,"../lib":508,"../plot_api/plot_schema":546,"../plot_api/plot_template":547,"../plots/get_data":589,"../registry":599,"./animation_attributes":552,"./attributes":554,"./cartesian/axis_ids":562,"./cartesian/handle_outline":569,"./command":585,"./font_attributes":587,"./frame_attributes":588,"./layout_attributes":595,"@plotly/d3":14,"d3-format":87,"d3-time-format":88,"fast-isnumeric":158}],598:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../constants/docs'); @@ -107064,7 +108286,7 @@ exports.texttemplateAttrs = function(opts, extra) { return texttemplate; }; -},{"../constants/docs":494}],610:[function(_dereq_,module,exports){ +},{"../constants/docs":483}],599:[function(_dereq_,module,exports){ 'use strict'; var Loggers = _dereq_('./lib/loggers'); @@ -107522,7 +108744,7 @@ function getTraceType(traceType) { return traceType; } -},{"./lib/dom":509,"./lib/extend":511,"./lib/is_plain_object":520,"./lib/loggers":523,"./lib/noop":528,"./lib/push_unique":534,"./plots/attributes":565,"./plots/layout_attributes":606}],611:[function(_dereq_,module,exports){ +},{"./lib/dom":498,"./lib/extend":500,"./lib/is_plain_object":509,"./lib/loggers":512,"./lib/noop":517,"./lib/push_unique":523,"./plots/attributes":554,"./plots/layout_attributes":595}],600:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -107682,7 +108904,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../lib":519,"../registry":610}],612:[function(_dereq_,module,exports){ +},{"../lib":508,"../registry":599}],601:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -107746,7 +108968,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":519,"../plot_api/to_image":561,"./filesaver":613,"./helpers":614}],613:[function(_dereq_,module,exports){ +},{"../lib":508,"../plot_api/to_image":550,"./filesaver":602,"./helpers":603}],602:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -107814,7 +109036,7 @@ function fileSaver(url, name, format) { module.exports = fileSaver; -},{"../lib":519,"./helpers":614}],614:[function(_dereq_,module,exports){ +},{"../lib":508,"./helpers":603}],603:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -107883,7 +109105,7 @@ exports.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; exports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\'svg\'} instead.'; -},{"../registry":610}],615:[function(_dereq_,module,exports){ +},{"../registry":599}],604:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -107900,7 +109122,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":611,"./download":612,"./helpers":614,"./svgtoimg":616,"./toimage":617,"./tosvg":618}],616:[function(_dereq_,module,exports){ +},{"./cloneplot":600,"./download":601,"./helpers":603,"./svgtoimg":605,"./toimage":606,"./tosvg":607}],605:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -108019,7 +109241,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":519,"./helpers":614,"events":57}],617:[function(_dereq_,module,exports){ +},{"../lib":508,"./helpers":603,"events":57}],606:[function(_dereq_,module,exports){ 'use strict'; var EventEmitter = _dereq_('events').EventEmitter; @@ -108088,7 +109310,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":519,"../registry":610,"./cloneplot":611,"./helpers":614,"./svgtoimg":616,"./tosvg":618,"events":57}],618:[function(_dereq_,module,exports){ +},{"../lib":508,"../registry":599,"./cloneplot":600,"./helpers":603,"./svgtoimg":605,"./tosvg":607,"events":57}],607:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -108273,7 +109495,7 @@ module.exports = function toSVG(gd, format, scale) { return s; }; -},{"../components/color":387,"../components/drawing":409,"../constants/xmlns_namespaces":498,"../lib":519,"@plotly/d3":14}],619:[function(_dereq_,module,exports){ +},{"../components/color":376,"../components/drawing":398,"../constants/xmlns_namespaces":487,"../lib":508,"@plotly/d3":14}],608:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -108298,7 +109520,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":519}],620:[function(_dereq_,module,exports){ +},{"../../lib":508}],609:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -108390,7 +109612,7 @@ module.exports = extendFlat({ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":394,"../../lib/extend":511,"../../plots/attributes":565,"../../plots/cartesian/axis_format_attributes":572,"../../plots/template_attributes":609,"../scatter/attributes":658}],621:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":383,"../../lib/extend":500,"../../plots/attributes":554,"../../plots/cartesian/axis_format_attributes":561,"../../plots/template_attributes":598,"../scatter/attributes":647}],610:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -108591,7 +109813,7 @@ function dropZonBreaks(x, y, z) { return newZ; } -},{"../../components/colorscale/calc":395,"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/align_period":566,"../../plots/cartesian/axes":569,"../../registry":610,"../histogram2d/calc":638,"./clean_2d_array":622,"./convert_column_xyz":624,"./find_empties":625,"./interp2d":626,"./make_bound_array":627}],622:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":384,"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/align_period":555,"../../plots/cartesian/axes":558,"../../registry":599,"../histogram2d/calc":627,"./clean_2d_array":611,"./convert_column_xyz":613,"./find_empties":614,"./interp2d":615,"./make_bound_array":616}],611:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -108660,7 +109882,7 @@ module.exports = function clean2dArray(zOld, trace, xa, ya) { return zNew; }; -},{"../../constants/numerical":497,"../../lib":519,"fast-isnumeric":161}],623:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"fast-isnumeric":158}],612:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -108668,7 +109890,7 @@ module.exports = { max: 'zmax' }; -},{}],624:[function(_dereq_,module,exports){ +},{}],613:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -108749,7 +109971,7 @@ module.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name, trace._after2before = after2before; }; -},{"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/align_period":566}],625:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/align_period":555}],614:[function(_dereq_,module,exports){ 'use strict'; var maxRowLength = _dereq_('../../lib').maxRowLength; @@ -108846,7 +110068,7 @@ module.exports = function findEmpties(z) { return empties.sort(function(a, b) { return b[2] - a[2]; }); }; -},{"../../lib":519}],626:[function(_dereq_,module,exports){ +},{"../../lib":508}],615:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -108971,7 +110193,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../lib":519}],627:[function(_dereq_,module,exports){ +},{"../../lib":508}],616:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -109051,7 +110273,7 @@ module.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks, return arrayOut; }; -},{"../../lib":519,"../../registry":610}],628:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599}],617:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -109142,7 +110364,7 @@ function isValidZ(z) { return (allRowsAreArrays && oneRowIsFilled && hasOneNumber); } -},{"../../lib":519,"../../registry":610,"fast-isnumeric":161}],629:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"fast-isnumeric":158}],618:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -109180,7 +110402,7 @@ extendFlat( module.exports = overrideAll(attrs, 'calc', 'nested'); -},{"../../components/colorscale/attributes":394,"../../lib/extend":511,"../../plot_api/edit_types":551,"../heatmap/attributes":620}],630:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":383,"../../lib/extend":500,"../../plot_api/edit_types":540,"../heatmap/attributes":609}],619:[function(_dereq_,module,exports){ 'use strict'; var createHeatmap2D = _dereq_('gl-heatmap2d'); @@ -109323,7 +110545,7 @@ function createHeatmap(scene, fullTrace, calcTrace) { module.exports = createHeatmap; -},{"../../lib/str2rgbarray":544,"../../plots/cartesian/axes":569,"gl-heatmap2d":173}],631:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":533,"../../plots/cartesian/axes":558,"gl-heatmap2d":169}],620:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -109350,7 +110572,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":397,"../../lib":519,"../heatmap/xyz_defaults":628,"./attributes":629}],632:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":386,"../../lib":508,"../heatmap/xyz_defaults":617,"./attributes":618}],621:[function(_dereq_,module,exports){ 'use strict'; var deprecationWarning = [ @@ -109376,7 +110598,7 @@ module.exports = { } }; -},{"../../plots/gl2d":603,"../heatmap/calc":621,"../heatmap/colorbar":623,"./attributes":629,"./convert":630,"./defaults":631}],633:[function(_dereq_,module,exports){ +},{"../../plots/gl2d":592,"../heatmap/calc":610,"../heatmap/colorbar":612,"./attributes":618,"./convert":619,"./defaults":620}],622:[function(_dereq_,module,exports){ 'use strict'; @@ -109392,7 +110614,7 @@ module.exports = function doAvg(size, counts) { return total; }; -},{}],634:[function(_dereq_,module,exports){ +},{}],623:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -109457,7 +110679,7 @@ module.exports = { } }; -},{"fast-isnumeric":161}],635:[function(_dereq_,module,exports){ +},{"fast-isnumeric":158}],624:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -109624,7 +110846,7 @@ function dateParts(v, pa, calendar) { return parts; } -},{"../../constants/numerical":497,"../../plots/cartesian/axes":569}],636:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../plots/cartesian/axes":558}],625:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -110195,7 +111417,7 @@ module.exports = { calcAllAutoBins: calcAllAutoBins }; -},{"../../lib":519,"../../plots/cartesian/axes":569,"../../registry":610,"../bar/arrays_to_calcdata":619,"./average":633,"./bin_functions":634,"./bin_label_vals":635,"./norm_functions":637,"fast-isnumeric":161}],637:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/axes":558,"../../registry":599,"../bar/arrays_to_calcdata":608,"./average":622,"./bin_functions":623,"./bin_label_vals":624,"./norm_functions":626,"fast-isnumeric":158}],626:[function(_dereq_,module,exports){ 'use strict'; @@ -110221,7 +111443,7 @@ module.exports = { } }; -},{}],638:[function(_dereq_,module,exports){ +},{}],627:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -110432,7 +111654,7 @@ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) { return out; } -},{"../../lib":519,"../../plots/cartesian/axes":569,"../histogram/average":633,"../histogram/bin_functions":634,"../histogram/bin_label_vals":635,"../histogram/calc":636,"../histogram/norm_functions":637}],639:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/cartesian/axes":558,"../histogram/average":622,"../histogram/bin_functions":623,"../histogram/bin_label_vals":624,"../histogram/calc":625,"../histogram/norm_functions":626}],628:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -110531,7 +111753,7 @@ module.exports = { ) }; -},{"../../components/colorscale/attributes":394,"../../lib/extend":511,"../../plot_api/plot_template":558,"../../plots/cartesian/layout_attributes":584,"../../plots/domain":597,"../../plots/font_attributes":598}],640:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":383,"../../lib/extend":500,"../../plot_api/plot_template":547,"../../plots/cartesian/layout_attributes":573,"../../plots/domain":586,"../../plots/font_attributes":587}],629:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -111068,7 +112290,7 @@ module.exports = { cleanRanges: cleanRanges }; -},{"../../lib":519,"../../lib/gup":516,"./constants":643,"@plotly/d3":14}],641:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../lib/gup":505,"./constants":632,"@plotly/d3":14}],630:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -111127,7 +112349,7 @@ exports.toSVG = function(gd) { }, 60); }; -},{"../../constants/xmlns_namespaces":498,"../../plots/get_data":600,"./plot":650,"@plotly/d3":14}],642:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":487,"../../plots/get_data":589,"./plot":639,"@plotly/d3":14}],631:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -111163,7 +112385,7 @@ function constHalf(len) { return out; } -},{"../../components/colorscale":399,"../../lib":519,"../../lib/gup":516}],643:[function(_dereq_,module,exports){ +},{"../../components/colorscale":388,"../../lib":508,"../../lib/gup":505}],632:[function(_dereq_,module,exports){ 'use strict'; @@ -111216,7 +112438,7 @@ module.exports = { } }; -},{}],644:[function(_dereq_,module,exports){ +},{}],633:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -111328,7 +112550,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('labelside'); }; -},{"../../components/colorscale/defaults":397,"../../components/colorscale/helpers":398,"../../lib":519,"../../plots/array_container_defaults":564,"../../plots/cartesian/axes":569,"../../plots/domain":597,"./attributes":639,"./axisbrush":640,"./constants":643,"./merge_length":648}],645:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"../../lib":508,"../../plots/array_container_defaults":553,"../../plots/cartesian/axes":558,"../../plots/domain":586,"./attributes":628,"./axisbrush":629,"./constants":632,"./merge_length":637}],634:[function(_dereq_,module,exports){ 'use strict'; var isTypedArray = _dereq_('../../lib').isTypedArray; @@ -111345,7 +112567,7 @@ exports.isVisible = function(dimension) { return dimension.visible || !('visible' in dimension); }; -},{"../../lib":519}],646:[function(_dereq_,module,exports){ +},{"../../lib":508}],635:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -111367,7 +112589,7 @@ module.exports = { } }; -},{"./attributes":639,"./base_plot":641,"./calc":642,"./defaults":644,"./plot":650}],647:[function(_dereq_,module,exports){ +},{"./attributes":628,"./base_plot":630,"./calc":631,"./defaults":633,"./plot":639}],636:[function(_dereq_,module,exports){ 'use strict'; var glslify = _dereq_('glslify'); @@ -111911,7 +113133,7 @@ module.exports = function(canvasGL, d) { }; }; -},{"../../lib":519,"./constants":643,"glslify":237}],648:[function(_dereq_,module,exports){ +},{"../../lib":508,"./constants":632,"glslify":233}],637:[function(_dereq_,module,exports){ 'use strict'; /** @@ -111941,7 +113163,7 @@ module.exports = function(traceOut, dimensions, dataAttr, len) { return len; }; -},{}],649:[function(_dereq_,module,exports){ +},{}],638:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -112702,7 +113924,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) { brush.ensureAxisBrush(axisOverlays, paperColor); }; -},{"../../components/colorscale":399,"../../components/drawing":409,"../../lib":519,"../../lib/gup":516,"../../lib/svg_text_utils":545,"../../plots/cartesian/axes":569,"./axisbrush":640,"./constants":643,"./helpers":645,"./lines":647,"@plotly/d3":14,"color-rgba":71}],650:[function(_dereq_,module,exports){ +},{"../../components/colorscale":388,"../../components/drawing":398,"../../lib":508,"../../lib/gup":505,"../../lib/svg_text_utils":534,"../../plots/cartesian/axes":558,"./axisbrush":629,"./constants":632,"./helpers":634,"./lines":636,"@plotly/d3":14,"color-rgba":71}],639:[function(_dereq_,module,exports){ 'use strict'; var parcoords = _dereq_('./parcoords'); @@ -112849,7 +114071,7 @@ module.exports = function plot(gd, cdModule) { ); }; -},{"../../lib/prepare_regl":532,"./helpers":645,"./parcoords":649}],651:[function(_dereq_,module,exports){ +},{"../../lib/prepare_regl":521,"./helpers":634,"./parcoords":638}],640:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -112889,7 +114111,7 @@ exports.getRotationAngle = function(rotation) { return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180; }; -},{"../../lib":519}],652:[function(_dereq_,module,exports){ +},{"../../lib":508}],641:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -112905,7 +114127,7 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":387,"./helpers":651}],653:[function(_dereq_,module,exports){ +},{"../../components/color":376,"./helpers":640}],642:[function(_dereq_,module,exports){ 'use strict'; var scatterglAttrs = _dereq_('../scatter/attributes'); @@ -112989,7 +114211,7 @@ module.exports = { transforms: undefined }; -},{"../scatter/attributes":658}],654:[function(_dereq_,module,exports){ +},{"../scatter/attributes":647}],643:[function(_dereq_,module,exports){ 'use strict'; var createPointCloudRenderer = _dereq_('gl-pointcloud2d'); @@ -113183,7 +114405,7 @@ function createPointcloud(scene, data) { module.exports = createPointcloud; -},{"../../lib/str2rgbarray":544,"../../plots/cartesian/autorange":568,"../scatter/get_trace_color":668,"gl-pointcloud2d":213}],655:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":533,"../../plots/cartesian/autorange":557,"../scatter/get_trace_color":657,"gl-pointcloud2d":209}],644:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -113222,7 +114444,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor) { traceOut._length = null; }; -},{"../../lib":519,"./attributes":653}],656:[function(_dereq_,module,exports){ +},{"../../lib":508,"./attributes":642}],645:[function(_dereq_,module,exports){ 'use strict'; var deprecationWarning = [ @@ -113246,7 +114468,7 @@ module.exports = { } }; -},{"../../plots/gl2d":603,"../scatter3d/calc":686,"./attributes":653,"./convert":654,"./defaults":655}],657:[function(_dereq_,module,exports){ +},{"../../plots/gl2d":592,"../scatter3d/calc":675,"./attributes":642,"./convert":643,"./defaults":644}],646:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -113289,7 +114511,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":519}],658:[function(_dereq_,module,exports){ +},{"../../lib":508}],647:[function(_dereq_,module,exports){ 'use strict'; var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; @@ -113639,7 +114861,7 @@ module.exports = { }), }; -},{"../../components/colorscale/attributes":394,"../../components/drawing":409,"../../components/drawing/attributes":408,"../../lib/extend":511,"../../plots/cartesian/axis_format_attributes":572,"../../plots/font_attributes":598,"../../plots/template_attributes":609,"./constants":662}],659:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":383,"../../components/drawing":398,"../../components/drawing/attributes":397,"../../lib/extend":500,"../../plots/cartesian/axis_format_attributes":561,"../../plots/font_attributes":587,"../../plots/template_attributes":598,"./constants":651}],648:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -113936,7 +115158,7 @@ module.exports = { getStackOpts: getStackOpts }; -},{"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/align_period":566,"../../plots/cartesian/axes":569,"./arrays_to_calcdata":657,"./calc_selection":660,"./colorscale_calc":661,"./subtypes":683,"fast-isnumeric":161}],660:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/align_period":555,"../../plots/cartesian/axes":558,"./arrays_to_calcdata":646,"./calc_selection":649,"./colorscale_calc":650,"./subtypes":672,"fast-isnumeric":158}],649:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -113947,7 +115169,7 @@ module.exports = function calcSelection(cd, trace) { } }; -},{"../../lib":519}],661:[function(_dereq_,module,exports){ +},{"../../lib":508}],650:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -113982,7 +115204,7 @@ module.exports = function calcMarkerColorscale(gd, trace) { } }; -},{"../../components/colorscale/calc":395,"../../components/colorscale/helpers":398,"./subtypes":683}],662:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":384,"../../components/colorscale/helpers":387,"./subtypes":672}],651:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -114002,7 +115224,7 @@ module.exports = { eventDataKeys: [] }; -},{}],663:[function(_dereq_,module,exports){ +},{}],652:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('./calc'); @@ -114174,7 +115396,7 @@ function getInterp(calcTrace, index, position, posAttr) { return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]); } -},{"./calc":659}],664:[function(_dereq_,module,exports){ +},{"./calc":648}],653:[function(_dereq_,module,exports){ 'use strict'; @@ -114204,7 +115426,7 @@ module.exports = function crossTraceDefaults(fullData) { } }; -},{}],665:[function(_dereq_,module,exports){ +},{}],654:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -114291,7 +115513,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":519,"../../registry":610,"./attributes":658,"./constants":662,"./fillcolor_defaults":666,"./line_defaults":671,"./line_shape_defaults":673,"./marker_defaults":677,"./period_defaults":678,"./stack_defaults":681,"./subtypes":683,"./text_defaults":684,"./xy_defaults":685}],666:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"./attributes":647,"./constants":651,"./fillcolor_defaults":655,"./line_defaults":660,"./line_shape_defaults":662,"./marker_defaults":666,"./period_defaults":667,"./stack_defaults":670,"./subtypes":672,"./text_defaults":673,"./xy_defaults":674}],655:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -114319,7 +115541,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":387,"../../lib":519}],667:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../lib":508}],656:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -114337,7 +115559,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":569}],668:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":558}],657:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -114377,7 +115599,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":387,"./subtypes":683}],669:[function(_dereq_,module,exports){ +},{"../../components/color":376,"./subtypes":672}],658:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -114588,7 +115810,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { } }; -},{"../../components/color":387,"../../components/fx":427,"../../lib":519,"../../registry":610,"./get_trace_color":668}],670:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../components/fx":416,"../../lib":508,"../../registry":599,"./get_trace_color":657}],659:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -114625,7 +115847,7 @@ module.exports = { } }; -},{"../../plots/cartesian":583,"./arrays_to_calcdata":657,"./attributes":658,"./calc":659,"./cross_trace_calc":663,"./cross_trace_defaults":664,"./defaults":665,"./format_labels":667,"./hover":669,"./marker_colorbar":676,"./plot":679,"./select":680,"./style":682,"./subtypes":683}],671:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":572,"./arrays_to_calcdata":646,"./attributes":647,"./calc":648,"./cross_trace_calc":652,"./cross_trace_defaults":653,"./defaults":654,"./format_labels":656,"./hover":658,"./marker_colorbar":665,"./plot":668,"./select":669,"./style":671,"./subtypes":672}],660:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -114648,7 +115870,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, if(!(opts || {}).noDash) coerce('line.dash'); }; -},{"../../components/colorscale/defaults":397,"../../components/colorscale/helpers":398,"../../lib":519}],672:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"../../lib":508}],661:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -115100,7 +116322,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../constants/numerical":497,"../../lib":519,"./constants":662}],673:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"./constants":651}],662:[function(_dereq_,module,exports){ 'use strict'; @@ -115110,7 +116332,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],674:[function(_dereq_,module,exports){ +},{}],663:[function(_dereq_,module,exports){ 'use strict'; var LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1}; @@ -115192,7 +116414,7 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) { return cdscatterSorted; }; -},{}],675:[function(_dereq_,module,exports){ +},{}],664:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -115228,7 +116450,7 @@ module.exports = function makeBubbleSizeFn(trace, factor) { }; }; -},{"fast-isnumeric":161}],676:[function(_dereq_,module,exports){ +},{"fast-isnumeric":158}],665:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -115237,7 +116459,7 @@ module.exports = { max: 'cmax' }; -},{}],677:[function(_dereq_,module,exports){ +},{}],666:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -115310,7 +116532,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":387,"../../components/colorscale/defaults":397,"../../components/colorscale/helpers":398,"./subtypes":683}],678:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"./subtypes":672}],667:[function(_dereq_,module,exports){ 'use strict'; var dateTick0 = _dereq_('../../lib').dateTick0; @@ -115349,7 +116571,7 @@ module.exports = function handlePeriodDefaults(traceIn, traceOut, layout, coerce } }; -},{"../../constants/numerical":497,"../../lib":519}],679:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508}],668:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -115901,7 +117123,7 @@ function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) { }); } -},{"../../components/drawing":409,"../../lib":519,"../../lib/polygon":531,"../../registry":610,"./line_points":672,"./link_traces":674,"./subtypes":683,"@plotly/d3":14}],680:[function(_dereq_,module,exports){ +},{"../../components/drawing":398,"../../lib":508,"../../lib/polygon":520,"../../registry":599,"./line_points":661,"./link_traces":663,"./subtypes":672,"@plotly/d3":14}],669:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -115946,7 +117168,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"./subtypes":683}],681:[function(_dereq_,module,exports){ +},{"./subtypes":672}],670:[function(_dereq_,module,exports){ 'use strict'; var perStackAttrs = ['orientation', 'groupnorm', 'stackgaps']; @@ -116043,7 +117265,7 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) } }; -},{}],682:[function(_dereq_,module,exports){ +},{}],671:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -116105,7 +117327,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/drawing":409,"../../registry":610,"@plotly/d3":14}],683:[function(_dereq_,module,exports){ +},{"../../components/drawing":398,"../../registry":599,"@plotly/d3":14}],672:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -116135,7 +117357,7 @@ module.exports = { } }; -},{"../../lib":519}],684:[function(_dereq_,module,exports){ +},{"../../lib":508}],673:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -116156,7 +117378,7 @@ module.exports = function(traceIn, traceOut, layout, coerce, opts) { } }; -},{"../../lib":519}],685:[function(_dereq_,module,exports){ +},{"../../lib":508}],674:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -116192,7 +117414,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) { return len; }; -},{"../../lib":519,"../../registry":610}],686:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599}],675:[function(_dereq_,module,exports){ 'use strict'; var arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata'); @@ -116212,7 +117434,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":657,"../scatter/colorscale_calc":661}],687:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":646,"../scatter/colorscale_calc":650}],676:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -116307,7 +117529,7 @@ attrs.x.editType = attrs.y.editType = attrs.x0.editType = attrs.y0.editType = 'c attrs.hovertemplate = scatterAttrs.hovertemplate; attrs.texttemplate = scatterAttrs.texttemplate; -},{"../../components/colorscale/attributes":394,"../../lib/extend":511,"../../lib/sort_object_keys":542,"../../plot_api/edit_types":551,"../../plots/attributes":565,"../../plots/cartesian/axis_format_attributes":572,"../scatter/attributes":658,"./constants":689}],688:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":383,"../../lib/extend":500,"../../lib/sort_object_keys":531,"../../plot_api/edit_types":540,"../../plots/attributes":554,"../../plots/cartesian/axis_format_attributes":561,"../scatter/attributes":647,"./constants":678}],677:[function(_dereq_,module,exports){ 'use strict'; var cluster = _dereq_('@plotly/point-cluster'); @@ -116493,7 +117715,7 @@ function sceneOptions(gd, subplot, trace, positions, x, y) { return opts; } -},{"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/align_period":566,"../../plots/cartesian/autorange":568,"../../plots/cartesian/axis_ids":573,"../scatter/calc":659,"../scatter/colorscale_calc":661,"./constants":689,"./convert":690,"./scene_update":698,"@plotly/point-cluster":15}],689:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/align_period":555,"../../plots/cartesian/autorange":557,"../../plots/cartesian/axis_ids":562,"../scatter/calc":648,"../scatter/colorscale_calc":650,"./constants":678,"./convert":679,"./scene_update":687,"@plotly/point-cluster":15}],678:[function(_dereq_,module,exports){ 'use strict'; var SYMBOL_SIZE = 20; @@ -116518,7 +117740,7 @@ module.exports = { } }; -},{}],690:[function(_dereq_,module,exports){ +},{}],679:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -117165,7 +118387,7 @@ module.exports = { textPosition: convertTextPosition }; -},{"../../components/drawing":409,"../../components/fx/helpers":423,"../../constants/interactions":496,"../../lib":519,"../../lib/gl_format_color":515,"../../plots/cartesian/axis_ids":573,"../../registry":610,"../scatter/make_bubble_size_func":675,"../scatter/subtypes":683,"./constants":689,"./helpers":694,"color-normalize":69,"fast-isnumeric":161,"svg-path-sdf":320}],691:[function(_dereq_,module,exports){ +},{"../../components/drawing":398,"../../components/fx/helpers":412,"../../constants/interactions":485,"../../lib":508,"../../lib/gl_format_color":504,"../../plots/cartesian/axis_ids":562,"../../registry":599,"../scatter/make_bubble_size_func":664,"../scatter/subtypes":672,"./constants":678,"./helpers":683,"color-normalize":69,"fast-isnumeric":158,"svg-path-sdf":310}],680:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -117238,7 +118460,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":519,"../../registry":610,"../scatter/constants":662,"../scatter/fillcolor_defaults":666,"../scatter/line_defaults":671,"../scatter/marker_defaults":677,"../scatter/period_defaults":678,"../scatter/subtypes":683,"../scatter/text_defaults":684,"../scatter/xy_defaults":685,"./attributes":687,"./helpers":694}],692:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"../scatter/constants":651,"../scatter/fillcolor_defaults":655,"../scatter/line_defaults":660,"../scatter/marker_defaults":666,"../scatter/period_defaults":667,"../scatter/subtypes":672,"../scatter/text_defaults":673,"../scatter/xy_defaults":674,"./attributes":676,"./helpers":683}],681:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -117286,7 +118508,7 @@ module.exports = { styleTextSelection: styleTextSelection }; -},{"../../components/color":387,"../../constants/interactions":496,"../../lib":519}],693:[function(_dereq_,module,exports){ +},{"../../components/color":376,"../../constants/interactions":485,"../../lib":508}],682:[function(_dereq_,module,exports){ 'use strict'; var scatterFormatLabels = _dereq_('../scatter/format_labels'); @@ -117298,7 +118520,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return scatterFormatLabels(cdi, trace, fullLayout); }; -},{"../scatter/format_labels":667}],694:[function(_dereq_,module,exports){ +},{"../scatter/format_labels":656}],683:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -117315,7 +118537,7 @@ exports.isDotSymbol = function(symbol) { symbol > 200; }; -},{"./constants":689}],695:[function(_dereq_,module,exports){ +},{"./constants":678}],684:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -117535,7 +118757,7 @@ module.exports = { calcHover: calcHover }; -},{"../../lib":519,"../../registry":610,"../scatter/get_trace_color":668}],696:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../registry":599,"../scatter/get_trace_color":657}],685:[function(_dereq_,module,exports){ 'use strict'; var hover = _dereq_('./hover'); @@ -117560,7 +118782,7 @@ module.exports = { } }; -},{"../../plots/cartesian":583,"../scatter/cross_trace_defaults":664,"../scatter/marker_colorbar":676,"./attributes":687,"./calc":688,"./defaults":691,"./format_labels":693,"./hover":695,"./plot":697,"./select":699}],697:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":572,"../scatter/cross_trace_defaults":653,"../scatter/marker_colorbar":665,"./attributes":676,"./calc":677,"./defaults":680,"./format_labels":682,"./hover":684,"./plot":686,"./select":688}],686:[function(_dereq_,module,exports){ 'use strict'; var createScatter = _dereq_('regl-scatter2d'); @@ -117933,7 +119155,7 @@ module.exports = function plot(gd, subplot, cdata) { } }; -},{"../../components/dragelement/helpers":405,"../../lib":519,"../../lib/prepare_regl":532,"../scatter/link_traces":674,"../scatter/subtypes":683,"./edit_style":692,"gl-text":226,"regl-error2d":293,"regl-line2d":294,"regl-scatter2d":295}],698:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":394,"../../lib":508,"../../lib/prepare_regl":521,"../scatter/link_traces":663,"../scatter/subtypes":672,"./edit_style":681,"gl-text":222,"regl-error2d":284,"regl-line2d":285,"regl-scatter2d":286}],687:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -118083,7 +119305,7 @@ module.exports = function sceneUpdate(gd, subplot) { return scene; }; -},{"../../lib":519}],699:[function(_dereq_,module,exports){ +},{"../../lib":508}],688:[function(_dereq_,module,exports){ 'use strict'; var subTypes = _dereq_('../scatter/subtypes'); @@ -118156,7 +119378,7 @@ module.exports = function select(searchInfo, selectionTester) { return selection; }; -},{"../scatter/subtypes":683,"./edit_style":692}],700:[function(_dereq_,module,exports){ +},{"../scatter/subtypes":672,"./edit_style":681}],689:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -118299,7 +119521,7 @@ module.exports = { opacity: scatterGlAttrs.opacity }; -},{"../../components/colorscale/attributes":394,"../../lib/extend":511,"../../plot_api/plot_template":558,"../../plots/cartesian/axis_format_attributes":572,"../../plots/cartesian/constants":576,"../../plots/template_attributes":609,"../scatter/attributes":658,"../scattergl/attributes":687}],701:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":383,"../../lib/extend":500,"../../plot_api/plot_template":547,"../../plots/cartesian/axis_format_attributes":561,"../../plots/cartesian/constants":565,"../../plots/template_attributes":598,"../scatter/attributes":647,"../scattergl/attributes":676}],690:[function(_dereq_,module,exports){ 'use strict'; var createLine = _dereq_('regl-line2d'); @@ -118524,7 +119746,7 @@ module.exports = { toSVG: Cartesian.toSVG }; -},{"../../lib/prepare_regl":532,"../../plots/cartesian":583,"../../plots/cartesian/axes":569,"../../plots/cartesian/axis_ids":573,"../../plots/get_data":600,"../../registry":610,"regl-line2d":294}],702:[function(_dereq_,module,exports){ +},{"../../lib/prepare_regl":521,"../../plots/cartesian":572,"../../plots/cartesian/axes":558,"../../plots/cartesian/axis_ids":562,"../../plots/get_data":589,"../../registry":599,"regl-line2d":285}],691:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -118627,7 +119849,7 @@ module.exports = function calc(gd, trace) { return [{x: false, y: false, t: {}, trace: trace}]; }; -},{"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/axis_ids":573,"../scatter/calc":659,"../scatter/colorscale_calc":661,"../scattergl/constants":689,"../scattergl/convert":690,"./scene_update":709}],703:[function(_dereq_,module,exports){ +},{"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/axis_ids":562,"../scatter/calc":648,"../scatter/colorscale_calc":650,"../scattergl/constants":678,"../scattergl/convert":679,"./scene_update":698}],692:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -118798,7 +120020,7 @@ function handleAxisDefaults(traceIn, traceOut, layout, coerce) { } } -},{"../../lib":519,"../../plots/array_container_defaults":564,"../parcoords/merge_length":648,"../scatter/marker_defaults":677,"../scatter/subtypes":683,"../scattergl/helpers":694,"./attributes":700}],704:[function(_dereq_,module,exports){ +},{"../../lib":508,"../../plots/array_container_defaults":553,"../parcoords/merge_length":637,"../scatter/marker_defaults":666,"../scatter/subtypes":672,"../scattergl/helpers":683,"./attributes":689}],693:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -118822,7 +120044,7 @@ module.exports = function editStyle(gd, cd0) { } }; -},{"../../lib":519,"../scatter/colorscale_calc":661,"../scattergl/convert":690}],705:[function(_dereq_,module,exports){ +},{"../../lib":508,"../scatter/colorscale_calc":650,"../scattergl/convert":679}],694:[function(_dereq_,module,exports){ 'use strict'; exports.getDimIndex = function getDimIndex(trace, ax) { @@ -118838,7 +120060,7 @@ exports.getDimIndex = function getDimIndex(trace, ax) { return false; }; -},{}],706:[function(_dereq_,module,exports){ +},{}],695:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -118891,7 +120113,7 @@ module.exports = { hoverPoints: hoverPoints }; -},{"../scattergl/hover":695,"./helpers":705}],707:[function(_dereq_,module,exports){ +},{"../scattergl/hover":684,"./helpers":694}],696:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -118922,7 +120144,7 @@ module.exports = { // register it here Registry.register(Grid); -},{"../../components/grid":431,"../../registry":610,"../scatter/marker_colorbar":676,"./attributes":700,"./base_plot":701,"./calc":702,"./defaults":703,"./edit_style":704,"./hover":706,"./plot":708,"./select":710}],708:[function(_dereq_,module,exports){ +},{"../../components/grid":420,"../../registry":599,"../scatter/marker_colorbar":665,"./attributes":689,"./base_plot":690,"./calc":691,"./defaults":692,"./edit_style":693,"./hover":695,"./plot":697,"./select":699}],697:[function(_dereq_,module,exports){ 'use strict'; var createMatrix = _dereq_('regl-splom'); @@ -119065,7 +120287,7 @@ function plotOne(gd, cd0) { } } -},{"../../components/dragelement/helpers":405,"../../lib":519,"../../plots/cartesian/axis_ids":573,"regl-splom":296}],709:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":394,"../../lib":508,"../../plots/cartesian/axis_ids":562,"regl-splom":287}],698:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -119129,7 +120351,7 @@ module.exports = function sceneUpdate(gd, trace) { return scene; }; -},{"../../lib":519}],710:[function(_dereq_,module,exports){ +},{"../../lib":508}],699:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -119196,7 +120418,7 @@ module.exports = function select(searchInfo, selectionTester) { return selection; }; -},{"../../lib":519,"../scatter/subtypes":683,"./helpers":705}],711:[function(_dereq_,module,exports){ +},{"../../lib":508,"../scatter/subtypes":672,"./helpers":694}],700:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../plots/cartesian/axes'); @@ -119600,7 +120822,7 @@ function last(array, indices) { return array[indices[indices.length - 1]]; } -},{"../constants/numerical":497,"../lib":519,"../plot_api/plot_schema":557,"../plots/cartesian/axes":569,"./helpers":714}],712:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"../lib":508,"../plot_api/plot_schema":546,"../plots/cartesian/axes":558,"./helpers":703}],701:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -119860,7 +121082,7 @@ function getFilterFunc(opts, d2c, targetCalendar) { } } -},{"../constants/filter_ops":495,"../lib":519,"../plots/cartesian/axes":569,"../registry":610,"./helpers":714}],713:[function(_dereq_,module,exports){ +},{"../constants/filter_ops":484,"../lib":508,"../plots/cartesian/axes":558,"../registry":599,"./helpers":703}],702:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -120104,7 +121326,7 @@ function transformOne(trace, state) { return newData; } -},{"../lib":519,"../plot_api/plot_schema":557,"../plots/plots":608,"./helpers":714}],714:[function(_dereq_,module,exports){ +},{"../lib":508,"../plot_api/plot_schema":546,"../plots/plots":597,"./helpers":703}],703:[function(_dereq_,module,exports){ 'use strict'; exports.pointsAccessorFunction = function(transforms, opts) { @@ -120122,7 +121344,7 @@ exports.pointsAccessorFunction = function(transforms, opts) { return originalPointsAccessor; }; -},{}],715:[function(_dereq_,module,exports){ +},{}],704:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -120260,11 +121482,11 @@ function getSortFunc(opts, d2c) { } } -},{"../constants/numerical":497,"../lib":519,"../plots/cartesian/axes":569,"./helpers":714}],716:[function(_dereq_,module,exports){ +},{"../constants/numerical":486,"../lib":508,"../plots/cartesian/axes":558,"./helpers":703}],705:[function(_dereq_,module,exports){ 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.4.2'; +exports.version = '2.5.0'; },{}]},{},[8])(8) }); diff --git a/dist/plotly-gl2d.min.js b/dist/plotly-gl2d.min.js index 4d2537e8bc1..694942f0512 100644 --- a/dist/plotly-gl2d.min.js +++ b/dist/plotly-gl2d.min.js @@ -1,58 +1,58 @@ /** -* plotly.js (gl2d - minified) v2.4.2 +* plotly.js (gl2d - minified) v2.5.0 * Copyright 2012-2021, 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{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(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){return a(e[o][1][t]||t)}),c,c.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":519}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":711}],3:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":385}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":499}],5:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":712}],6:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":713}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":632}],8:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./calendars":3,"./core":4,"./filter":5,"./groupby":6,"./heatmapgl":7,"./parcoords":9,"./pointcloud":10,"./scattergl":11,"./sort":12,"./splom":13}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":646}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":656}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":696}],12:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":715}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":707}],14:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},a=self.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=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}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,f=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(h);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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,a=[],i=b(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,f,h=-1,d=i.length,p=a[s++],g=new _;++h=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return U(t,q),t}var V=function(t,e){return e.querySelector(t)},Y=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},Y=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var q=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return V(t,this)}}function X(t){return"function"==typeof t?t:function(){return Y(t,this)}}q.select=function(t){var e,r,n,a,i=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},q.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},q.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},q.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=gt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?I:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=q.append,ht.empty=q.empty,ht.node=q.node,ht.call=q.call,ht.size=q.size,ht.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?St:t<-1?-St:Math.asin(t)}function Dt(t){return((t=Math.exp(t))+1/t)/2}var Rt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,f=l-i,h=c*c+f*f;if(h<1e-12)n=Math.log(u/o)/Rt,r=function(t){return[a+t*c,i+t*f,o*Math.exp(Rt*t*n)]};else{var d=Math.sqrt(h),p=(u*u-o*o+4*h)/(2*o*2*d),g=(u*u-o*o-4*h)/(2*u*2*d),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Rt,r=function(t){var e,r=t*n,s=Dt(v),l=o/(2*d)*(s*(e=Rt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+l*c,i+l*f,o*s/Dt(Rt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,f,h={x:0,y:0,k:1},d=[960,500],p=Ft,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,L).on(Pt+".zoom",R).on("dblclick.zoom",I).on(x,D)}function A(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function T(t){h.k=Math.max(p[0],Math.min(p[1],t))}function M(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function k(e,n,a,i){e.__chart__={x:h.x,y:h.y,k:h.k},T(Math.pow(2,i)),M(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function E(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function L(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,l).on(b,u),i=A(t.mouse(e)),s=xt(e);function l(){n=1,M(t.mouse(e),i),C(r)}function u(){a.on(y,null).on(b,null),s(n),O(r)}Pa.call(e),S(r)}function D(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),d=xt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=A(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=d[0];var b=d[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);Pa.call(r);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new Kt(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Yt?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new zt(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new zt(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Ht=Ut.prototype=new Nt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Ut?Vt(t.h,t.c,t.l):ie((t=Kt(t)).r,t.g,t.b):new Yt(t,e,r)}Ht.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Ht.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Ht.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Gt=18,qt=Yt.prototype=new Nt;function Wt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new Kt(Qt(3.2404542*(a=.95047*Zt(a))-1.5371385*(n=1*Zt(n))-.4985314*(i=1.08883*Zt(i))),Qt(-.969266*a+1.8760108*n+.041556*i),Qt(.0556434*a-.2040259*n+1.0572252*i))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ot,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Zt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Qt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Kt(t,e,r){return this instanceof Kt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Kt?new Kt(t.r,t.g,t.b):ne(""+t,Kt,jt):new Kt(t,e,r)}function $t(t){return new Kt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}qt.brighter=function(t){return new Yt(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},qt.darker=function(t){return new Yt(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},qt.rgb=function(){return Wt(this.l,this.a,this.b)},t.rgb=Kt;var ee=Kt.prototype=new Nt;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new zt(n,a,l)}function ie(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Yt(116*a-16,500*(n-a),200*(a-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ue,t.xhr=ce(O),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=fe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(ye,e)),pe=0):(pe=1,ve(ye))}function be(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function xe(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function Te(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){me.apply(this,arguments)},t.timer.flush=function(){be(),xe()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ue(e),i=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nTt)s=s.L;else{if(!((a=i-He(s,o))>Tt)){n>-Tt?(e=s.P,r=s):a>-Tt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ne(t);if(Le.insert(e,l),e||r){if(e===r)return We(e),r=Ne(e.site),Le.insert(l,r),l.edge=r.edge=Je(e.site,l.site),qe(e),void qe(r);if(r){We(e),We(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};Ke(r.edge,u,p,x),l.edge=Je(u,t,null,x),r.edge=Je(t,p,null,x),qe(e),qe(r)}else l.edge=Je(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/i-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+a-i/2)))/f+n:(n+s)/2}function He(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ve(t){this.site=t,this.edges=[]}function Ye(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function qe(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,f=2*(l*(v=i.y-s)-u*c);if(!(f>=-1e-12)){var h=l*l+u*u,d=c*c+v*v,p=(v*h-u*d)/f,g=(l*d-c*h)/f,v=g+s,m=Pe.pop()||new Ge;m.arc=t,m.site=a,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=Re._;b;)if(m.y=s)return;if(h>p){if(i){if(i.y>=u)return}else i={x:v,y:l};r={x:v,y:u}}else{if(i){if(i.y1)if(h>p){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=a-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=d,d<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=i-u,d||!(e<0)){if(e/=d,d<0){if(e>f)return;e>c&&(c=e)}else if(d>0){if(e0&&(t.a={x:l+c*h,y:u+c*d}),f<1&&(t.b={x:l+f*h,y:u+f*d}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)Tt||y(a-r)>Tt)&&(s.splice(o,0,new $e(Qe(i.site,c,y(n-f)Tt?{x:f,y:y(e-f)Tt?{x:y(r-p)Tt?{x:h,y:y(e-h)Tt?{x:y(r-d)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Tt)*Tt,y:Math.round(a(t,e)/Tt)*Tt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(Ye),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ci||f>o||h=_)<<1|e>=x,A=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:pr(r,n)})),i=mr.lastIndex;return ig&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-d,A=v-p;function T(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)M(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,M(t,c,l,u,a,i,o,s),M(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,s)}function M(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?a=l:o=l,f?i=u:s=u,T(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>A?v=p+w:g=d+A;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(k,t,+m(t,++f),+b(t,f),d,p,g,v)},visit:function(t){cr(t,k,d,p,g,v)},find:function(t){return fr(k,t[0],t[1],d,p,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function br(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function Tr(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Er(t){return t*t*t}function Sr(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 Cr(t){return 1-Math.cos(t*St)}function Or(t){return Math.pow(2,10*(t-1))}function Lr(t){return 1-Math.sqrt(1-t*t)}function Dr(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 Rr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Ir(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=Fr(a),s=Pr(a,i),l=Fr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=_r.get(n)||xr,Ar((a=wr.get(a)||O)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Vt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Wt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Rr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Ir(e?e.matrix:Nr)})(e)},Ir.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Nr={a:1,b:0,c:0,d:1,e:0,f:0};function zr(t){return t.length?t.pop()+",":""}function Br(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(zr(r)+"rotate(",null,")")-2,x:pr(t,e)})):e&&r.push(zr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(zr(r)+"skewX(",null,")")-2,x:pr(t,e)}):e&&r.push(zr(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(zr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(zr(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=me(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(a[n])}function $r(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return $r(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Kr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function pn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function vn(t,e){return mn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function yn(e){return[t.min(e),t.max(e)]}function bn(t,e){return t.value-e.value}function xn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function An(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Tn),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(kn(r,n,a=e[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,p)-1]).y+=g,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ue(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return mn(e,t)}:ue(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+c(t.value)})),$r(s,An),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;$r(s,(function(t){t.r+=f})),$r(s,An),$r(s,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++od.x&&(d=t),t.depth>p.depth&&(p=t)}));var g=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+g),m=n[1]/(p.depth||1);Kr(c,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,f=s.m,h=l.m;s=Cn(s),i=Sn(i),s&&i;)l=Sn(l),(o=Cn(o)).a=t,(a=s.z+f-i.z-u+r(s._,i._))>0&&(On(Ln(s,t,n),t,a),u+=a,c+=a),f+=s.m,u+=i.m,h+=l.m,c+=o.m;s&&!Cn(o)&&(o.t=s,o.m+=f-c),i&&!Sn(l)&&(l.t=i,l.m+=u-h,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Qr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=En,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;$r(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return $r(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Qr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=Dn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=d(s,g))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,g,i,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(p(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function p(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Fn,s=a?Ur:jr;return i=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Rr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Yn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Hn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Nn(a.map(i),n?Math:Gn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=In(a),e=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=r%1?2:r;if(isFinite(c-u)){if(n){for(;u0;h--)e.push(o(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=qn(r),i=qn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Yn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Hn(n,t))},o.exponent=function(t){return arguments.length?(a=qn(r=t),i=qn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tf?0:1;if(u=Et)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,A,T,M,k=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Kn?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(E*=-1),u&&(E=Lt(v/u*Math.sin(m))),s&&(k=Lt(v/s*Math.sin(m)))),u){y=u*Math.cos(c+E),b=u*Math.sin(c+E),x=u*Math.cos(f-E),_=u*Math.sin(f-E);var C=Math.abs(f-c-2*E)<=Mt?0:1;if(E&&aa(y,b,x,_)===d^C){var O=(c+f)/2;y=u*Math.cos(O),b=u*Math.sin(O),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-k),A=s*Math.sin(f-k),T=s*Math.cos(c+k),M=s*Math.sin(c+k);var L=Math.abs(c-f+2*k)<=Mt?0:1;if(k&&aa(w,A,T,M)===1-d^L){var D=(c+f)/2;w=s*Math.cos(D),A=s*Math.sin(D),T=M=null}}else w=A=0;if(h>Tt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,A=(-x*v-m*_)/y,T=(x*m+v*_)/y,M=(-x*v+m*_)/y,k=w-p,E=A-g,S=T-p,C=M-g;return k*k+E*E>S*S+C*C&&(w=T,A=M),[[w-l,A-u],[w*r/b,A*r/b]]}function oa(){return!0}function sa(t){var e=_e,r=we,n=oa,a=ua,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,f=i.length,h=ue(e),d=ue(r);function p(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":fa,"step-after":ha,basis:ga,"basis-open":function(t){if(t.length<4)return ua(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(va(ba,i)+","+va(ba,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ua(t){return t.length>1?t.join("L"):t+"Z"}function ca(t){return t.join("L")+"Z"}function fa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;uMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ue(t),i):r},i.source=function(e){return arguments.length?(t=ue(e),i):t},i.target=function(t){return arguments.length?(e=ue(t),i):e},i.startAngle=function(t){return arguments.length?(n=ue(t),i):n},i.endAngle=function(t){return arguments.length?(a=ue(t),i):a},i},t.svg.diagonal=function(){var t=Ta,e=Ma,r=Ea;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Ea,n=e.projection;return e.projection=function(t){return arguments.length?n(Sa(r=t)):r},e},t.svg.symbol=function(){var t=Oa,e=Ca;function r(r,n){return(Da.get(t.call(this,r,n))||La)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var Da=t.map({circle:La,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*Ia)),r=e*Ia;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/Ra),r=e*Ra/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ra),r=e*Ra/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Da.keys();var Ra=Math.sqrt(3),Ia=Math.tan(30*Ct);q.transition=function(t){for(var e,r,n=za||++Ua,a=Ya(t),i=[],o=Ba||{time:Date.now(),ease:Sr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(i=a.time,o=me((function(t){var e=f.delay;if(o.t=e+i,e<=t)return h(t-e);o.c=h}),0,i),f=c[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}ja.call=q.call,ja.empty=q.empty,ja.node=q.node,ja.size=q.size,t.transition=function(e,r){return e&&e.transition?za?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ja,ja.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,A=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),M=xt(m),k=t.mouse(m),E=t.select(o(m)).on("keydown.brush",O).on("keyup.brush",L);if(t.event.changedTouches?E.on("touchmove.brush",D).on("touchend.brush",I):E.on("mousemove.brush",D).on("mouseup.brush",I),x.interrupt().selectAll("*").interrupt(),T)k[0]=s[0]-k[0],k[1]=l[0]-k[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[s[1-S]-k[0],l[1-C]-k[1]],k[0]=s[S],k[1]=l[C]}else t.event.altKey&&(f=k.slice());function O(){32==t.event.keyCode&&(T||(f=null,k[0]-=s[1],k[1]-=l[1],T=2),N())}function L(){32==t.event.keyCode&&2==T&&(k[0]+=s[1],k[1]+=l[1],T=0,N())}function D(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),k[0]=s[+(e[0]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?p=new(f(e.dtype))(v):e.dtype&&(p=e.dtype,Array.isArray(p)&&(p.length=v));for(var m=0;mr||s>1073741824){for(var h=0;he+n||w>r+n||A=M||i===o)){var s=y[a];void 0===o&&(o=s.length);for(var l=i;l=p&&c<=v&&f>=g&&f<=m&&E.push(u)}var h=b[a],d=h[4*i+0],x=h[4*i+1],k=h[4*i+2],S=h[4*i+3],L=O(h,i+1),D=.5*n,R=a+1;C(e,r,D,R,d,x||k||S||L),C(e,r+D,D,R,x,k||S||L),C(e+D,r,D,R,k,S||L),C(e+D,r+D,D,R,S,L)}}function O(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}return C(0,0,1,0,0,1),E},p;function S(t,e,r,a,i){for(var o=[],s=0;sa&&(a=t[o]),t[o]:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":508}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":700}],3:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":374}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":488}],5:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":701}],6:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":702}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":621}],8:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./calendars":3,"./core":4,"./filter":5,"./groupby":6,"./heatmapgl":7,"./parcoords":9,"./pointcloud":10,"./scattergl":11,"./sort":12,"./splom":13}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":635}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":645}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":685}],12:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":704}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":696}],14:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},a=self.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=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}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,f=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(h);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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,a=[],i=b(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,f,h=-1,d=i.length,p=a[s++],g=new _;++h=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return U(t,q),t}var V=function(t,e){return e.querySelector(t)},Y=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},Y=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var q=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return V(t,this)}}function X(t){return"function"==typeof t?t:function(){return Y(t,this)}}q.select=function(t){var e,r,n,a,i=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},q.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},q.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},q.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=gt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?I:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=q.append,ht.empty=q.empty,ht.node=q.node,ht.call=q.call,ht.size=q.size,ht.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?St:t<-1?-St:Math.asin(t)}function Dt(t){return((t=Math.exp(t))+1/t)/2}var Rt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,f=l-i,h=c*c+f*f;if(h<1e-12)n=Math.log(u/o)/Rt,r=function(t){return[a+t*c,i+t*f,o*Math.exp(Rt*t*n)]};else{var d=Math.sqrt(h),p=(u*u-o*o+4*h)/(2*o*2*d),g=(u*u-o*o-4*h)/(2*u*2*d),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Rt,r=function(t){var e,r=t*n,s=Dt(v),l=o/(2*d)*(s*(e=Rt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+l*c,i+l*f,o*s/Dt(Rt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,f,h={x:0,y:0,k:1},d=[960,500],p=Ft,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,L).on(Pt+".zoom",R).on("dblclick.zoom",I).on(x,D)}function A(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function T(t){h.k=Math.max(p[0],Math.min(p[1],t))}function k(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function M(e,n,a,i){e.__chart__={x:h.x,y:h.y,k:h.k},T(Math.pow(2,i)),k(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function E(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function O(t){--v||(t({type:"zoomend"}),r=null)}function L(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,l).on(b,u),i=A(t.mouse(e)),s=xt(e);function l(){n=1,k(t.mouse(e),i),C(r)}function u(){a.on(y,null).on(b,null),s(n),O(r)}Pa.call(e),S(r)}function D(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),d=xt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=A(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=d[0];var b=d[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);Pa.call(r);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new Kt(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Yt?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new zt(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new zt(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Ht=Ut.prototype=new Nt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Ut?Vt(t.h,t.c,t.l):ie((t=Kt(t)).r,t.g,t.b):new Yt(t,e,r)}Ht.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Ht.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Ht.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Gt=18,qt=Yt.prototype=new Nt;function Wt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new Kt(Qt(3.2404542*(a=.95047*Zt(a))-1.5371385*(n=1*Zt(n))-.4985314*(i=1.08883*Zt(i))),Qt(-.969266*a+1.8760108*n+.041556*i),Qt(.0556434*a-.2040259*n+1.0572252*i))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ot,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Zt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Qt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Kt(t,e,r){return this instanceof Kt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Kt?new Kt(t.r,t.g,t.b):ne(""+t,Kt,jt):new Kt(t,e,r)}function $t(t){return new Kt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}qt.brighter=function(t){return new Yt(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},qt.darker=function(t){return new Yt(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},qt.rgb=function(){return Wt(this.l,this.a,this.b)},t.rgb=Kt;var ee=Kt.prototype=new Nt;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new zt(n,a,l)}function ie(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Yt(116*a-16,500*(n-a),200*(a-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ue,t.xhr=ce(O),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=fe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(ye,e)),pe=0):(pe=1,ve(ye))}function be(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function xe(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function Te(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){me.apply(this,arguments)},t.timer.flush=function(){be(),xe()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ue(e),i=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nTt)s=s.L;else{if(!((a=i-He(s,o))>Tt)){n>-Tt?(e=s.P,r=s):a>-Tt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ne(t);if(Le.insert(e,l),e||r){if(e===r)return We(e),r=Ne(e.site),Le.insert(l,r),l.edge=r.edge=Je(e.site,l.site),qe(e),void qe(r);if(r){We(e),We(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};Ke(r.edge,u,p,x),l.edge=Je(u,t,null,x),r.edge=Je(t,p,null,x),qe(e),qe(r)}else l.edge=Je(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/i-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+a-i/2)))/f+n:(n+s)/2}function He(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ve(t){this.site=t,this.edges=[]}function Ye(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function qe(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,f=2*(l*(v=i.y-s)-u*c);if(!(f>=-1e-12)){var h=l*l+u*u,d=c*c+v*v,p=(v*h-u*d)/f,g=(l*d-c*h)/f,v=g+s,m=Pe.pop()||new Ge;m.arc=t,m.site=a,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=Re._;b;)if(m.y=s)return;if(h>p){if(i){if(i.y>=u)return}else i={x:v,y:l};r={x:v,y:u}}else{if(i){if(i.y1)if(h>p){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=a-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=d,d<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=i-u,d||!(e<0)){if(e/=d,d<0){if(e>f)return;e>c&&(c=e)}else if(d>0){if(e0&&(t.a={x:l+c*h,y:u+c*d}),f<1&&(t.b={x:l+f*h,y:u+f*d}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)Tt||y(a-r)>Tt)&&(s.splice(o,0,new $e(Qe(i.site,c,y(n-f)Tt?{x:f,y:y(e-f)Tt?{x:y(r-p)Tt?{x:h,y:y(e-h)Tt?{x:y(r-d)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Tt)*Tt,y:Math.round(a(t,e)/Tt)*Tt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(Ye),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ci||f>o||h=_)<<1|e>=x,A=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:pr(r,n)})),i=mr.lastIndex;return ig&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-d,A=v-p;function T(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)k(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,k(t,c,l,u,a,i,o,s),k(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else k(t,e,r,n,a,i,o,s)}function k(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?a=l:o=l,f?i=u:s=u,T(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>A?v=p+w:g=d+A;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(M,t,+m(t,++f),+b(t,f),d,p,g,v)},visit:function(t){cr(t,M,d,p,g,v)},find:function(t){return fr(M,t[0],t[1],d,p,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function br(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function Tr(t){return function(e){return 1-t(1-e)}}function kr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Mr(t){return t*t}function Er(t){return t*t*t}function Sr(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 Cr(t){return 1-Math.cos(t*St)}function Or(t){return Math.pow(2,10*(t-1))}function Lr(t){return 1-Math.sqrt(1-t*t)}function Dr(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 Rr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Ir(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=Fr(a),s=Pr(a,i),l=Fr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=_r.get(n)||xr,Ar((a=wr.get(a)||O)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Vt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Wt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Rr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Ir(e?e.matrix:Nr)})(e)},Ir.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Nr={a:1,b:0,c:0,d:1,e:0,f:0};function zr(t){return t.length?t.pop()+",":""}function Br(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(zr(r)+"rotate(",null,")")-2,x:pr(t,e)})):e&&r.push(zr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(zr(r)+"skewX(",null,")")-2,x:pr(t,e)}):e&&r.push(zr(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(zr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(zr(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=me(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(a[n])}function $r(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return $r(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Kr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function pn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function vn(t,e){return mn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function yn(e){return[t.min(e),t.max(e)]}function bn(t,e){return t.value-e.value}function xn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function An(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Tn),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(Mn(r,n,a=e[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,p)-1]).y+=g,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ue(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return mn(e,t)}:ue(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+c(t.value)})),$r(s,An),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;$r(s,(function(t){t.r+=f})),$r(s,An),$r(s,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++od.x&&(d=t),t.depth>p.depth&&(p=t)}));var g=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+g),m=n[1]/(p.depth||1);Kr(c,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,f=s.m,h=l.m;s=Cn(s),i=Sn(i),s&&i;)l=Sn(l),(o=Cn(o)).a=t,(a=s.z+f-i.z-u+r(s._,i._))>0&&(On(Ln(s,t,n),t,a),u+=a,c+=a),f+=s.m,u+=i.m,h+=l.m,c+=o.m;s&&!Cn(o)&&(o.t=s,o.m+=f-c),i&&!Sn(l)&&(l.t=i,l.m+=u-h,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Qr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=En,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;$r(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return $r(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Qr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=Dn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=d(s,g))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,g,i,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(p(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function p(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Fn,s=a?Ur:jr;return i=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Rr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Yn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Hn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Nn(a.map(i),n?Math:Gn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=In(a),e=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=r%1?2:r;if(isFinite(c-u)){if(n){for(;u0;h--)e.push(o(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=qn(r),i=qn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Yn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Hn(n,t))},o.exponent=function(t){return arguments.length?(a=qn(r=t),i=qn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tf?0:1;if(u=Et)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,A,T,k,M=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Kn?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(E*=-1),u&&(E=Lt(v/u*Math.sin(m))),s&&(M=Lt(v/s*Math.sin(m)))),u){y=u*Math.cos(c+E),b=u*Math.sin(c+E),x=u*Math.cos(f-E),_=u*Math.sin(f-E);var C=Math.abs(f-c-2*E)<=kt?0:1;if(E&&aa(y,b,x,_)===d^C){var O=(c+f)/2;y=u*Math.cos(O),b=u*Math.sin(O),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-M),A=s*Math.sin(f-M),T=s*Math.cos(c+M),k=s*Math.sin(c+M);var L=Math.abs(c-f+2*M)<=kt?0:1;if(M&&aa(w,A,T,k)===1-d^L){var D=(c+f)/2;w=s*Math.cos(D),A=s*Math.sin(D),T=k=null}}else w=A=0;if(h>Tt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,A=(-x*v-m*_)/y,T=(x*m+v*_)/y,k=(-x*v+m*_)/y,M=w-p,E=A-g,S=T-p,C=k-g;return M*M+E*E>S*S+C*C&&(w=T,A=k),[[w-l,A-u],[w*r/b,A*r/b]]}function oa(){return!0}function sa(t){var e=_e,r=we,n=oa,a=ua,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,f=i.length,h=ue(e),d=ue(r);function p(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":fa,"step-after":ha,basis:ga,"basis-open":function(t){if(t.length<4)return ua(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(va(ba,i)+","+va(ba,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ua(t){return t.length>1?t.join("L"):t+"Z"}function ca(t){return t.join("L")+"Z"}function fa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;ukt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ue(t),i):r},i.source=function(e){return arguments.length?(t=ue(e),i):t},i.target=function(t){return arguments.length?(e=ue(t),i):e},i.startAngle=function(t){return arguments.length?(n=ue(t),i):n},i.endAngle=function(t){return arguments.length?(a=ue(t),i):a},i},t.svg.diagonal=function(){var t=Ta,e=ka,r=Ea;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Ea,n=e.projection;return e.projection=function(t){return arguments.length?n(Sa(r=t)):r},e},t.svg.symbol=function(){var t=Oa,e=Ca;function r(r,n){return(Da.get(t.call(this,r,n))||La)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var Da=t.map({circle:La,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*Ia)),r=e*Ia;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/Ra),r=e*Ra/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ra),r=e*Ra/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Da.keys();var Ra=Math.sqrt(3),Ia=Math.tan(30*Ct);q.transition=function(t){for(var e,r,n=za||++Ua,a=Ya(t),i=[],o=Ba||{time:Date.now(),ease:Sr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(i=a.time,o=me((function(t){var e=f.delay;if(o.t=e+i,e<=t)return h(t-e);o.c=h}),0,i),f=c[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}ja.call=q.call,ja.empty=q.empty,ja.node=q.node,ja.size=q.size,t.transition=function(e,r){return e&&e.transition?za?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ja,ja.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,A=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),k=xt(m),M=t.mouse(m),E=t.select(o(m)).on("keydown.brush",O).on("keyup.brush",L);if(t.event.changedTouches?E.on("touchmove.brush",D).on("touchend.brush",I):E.on("mousemove.brush",D).on("mouseup.brush",I),x.interrupt().selectAll("*").interrupt(),T)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[s[1-S]-M[0],l[1-C]-M[1]],M[0]=s[S],M[1]=l[C]}else t.event.altKey&&(f=M.slice());function O(){32==t.event.keyCode&&(T||(f=null,M[0]-=s[1],M[1]-=l[1],T=2),N())}function L(){32==t.event.keyCode&&2==T&&(M[0]+=s[1],M[1]+=l[1],T=0,N())}function D(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?p=new(f(e.dtype))(v):e.dtype&&(p=e.dtype,Array.isArray(p)&&(p.length=v));for(var m=0;mr||s>1073741824){for(var h=0;he+n||w>r+n||A=k||i===o)){var s=y[a];void 0===o&&(o=s.length);for(var l=i;l=p&&c<=v&&f>=g&&f<=m&&E.push(u)}var h=b[a],d=h[4*i+0],x=h[4*i+1],M=h[4*i+2],S=h[4*i+3],L=O(h,i+1),D=.5*n,R=a+1;C(e,r,D,R,d,x||M||S||L),C(e,r+D,D,R,x,M||S||L),C(e+D,r,D,R,M,S||L),C(e+D,r+D,D,R,S,L)}}function O(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}return C(0,0,1,0,0,1),E},p;function S(t,e,r,a,i){for(var o=[],s=0;sa&&(a=t[o]),t[o] * @license MIT - */function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var a;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!a&&m(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&_(a,r)||s)&&m(a,r,"Got unwanted exception"+n),t&&a&&r&&!_(a,r)||!t&&a)throw a}h.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=function(t){return g(v(t.actual),128)+" "+t.operator+" "+g(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=p(e),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=m,h.ok=y,h.equal=function(t,e,r){t!=e&&m(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){b(t,e,!1)||m(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){b(t,e,!0)||m(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){b(t,e,!1)&&m(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){w(!0,t,e,r)},h.doesNotThrow=function(t,e,r){w(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var A=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":264,"util/":26}],24:[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}},{}],25:[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}},{}],26:[function(t,e,r){(function(e,n){(function(){var a=/%[sdj%]/g;r.format=function(t){if(!m(t)){for(var e=[],r=0;r=i)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}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(n,t);return m(a)||(a=c(t,a,n)),a}var i=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(A(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var u,x="",T=!1,M=["{","}"];(d(e)&&(T=!0,M=["[","]"]),A(e))&&(x=" [Function"+(e.name?": "+e.name:"")+"]");return b(e)&&(x=" "+RegExp.prototype.toString.call(e)),_(e)&&(x=" "+Date.prototype.toUTCString.call(e)),w(e)&&(x=" "+f(e)),0!==o.length||T&&0!=e.length?n<0?b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=T?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,x,M)):M[0]+x+M[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),S(n,a)||(o="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=i?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")),y(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).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){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return"number"==typeof t}function m(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function w(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=p,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=v,r.isString=m,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=b,r.isObject=x,r.isDate=_,r.isError=w,r.isFunction=A,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",E(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":25,_process:287,inherits:24}],27:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],28:[function(t,e,r){"use strict";r.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=u(t),o=n[0],s=n[1],l=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[c++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var a,i,o=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],29:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":39}],30:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],31:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":39}],32:[function(t,e,r){"use strict";var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(a(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))u=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=i(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(a(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=i(r)}else c=i(1);f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f));return s(u,c)}},{"./div":31,"./is-rat":33,"./lib/is-bn":37,"./lib/num-to-bn":38,"./lib/rationalize":39,"./lib/str-to-bn":40}],33:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":37}],34:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":48}],35:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i20)return 52;return r+32}},{"bit-twiddle":46,"double-bits":96}],37:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":48}],38:[function(t,e,r){"use strict";var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":48,"double-bits":96}],39:[function(t,e,r){"use strict";var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":34,"./num-to-bn":38}],40:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":48}],41:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":39}],42:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":34}],43:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":39}],44:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":35,"./lib/ctz":36}],45:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(i=o,a=o-1):n=o+1}return i}function a(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(i=o,a=o-1):n=o+1}return i}function i(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(i=o,n=o+1):a=o-1}return i}function o(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(i=o,n=o+1):a=o-1}return i}function s(t,e,r,n,a){for(;n<=a;){var i=n+a>>>1,o=t[i],s=void 0!==r?r(o,e):o-e;if(0===s)return i;s<=0?n=i+1:a=i-1}return-1}function l(t,e,r,n,a,i){return"function"==typeof r?i(t,e,r,void 0===n?0:0|n,void 0===a?t.length-1:0|a):i(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,a,i){return l(t,e,r,a,i,n)},gt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},lt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},le:function(t,e,r,n,a){return l(t,e,r,n,a,o)},eq:function(t,e,r,n,a){return l(t,e,r,n,a,s)}}},{}],46:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],47:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,u,c,f,h,d,p,g,v=null==e.cutoff?.25:e.cutoff,m=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,c=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext("2d"),r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,c=4):window.ImageData&&t instanceof window.ImageData&&(d=t,r=t.width,o=t.height,l=d.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),p=0,g=u.length;p=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);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=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(a=0|t.words[p])*(i=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(i),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=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=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;it.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==i&&o>26,this.words[o]=67108863&e;if(0===i&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],A=8191&w,T=w>>>13,M=0|o[5],k=8191&M,E=M>>>13,S=0|o[6],C=8191&S,O=S>>>13,L=0|o[7],D=8191&L,R=L>>>13,I=0|o[8],P=8191&I,F=I>>>13,N=0|o[9],z=8191&N,B=N>>>13,j=0|s[0],U=8191&j,H=j>>>13,V=0|s[1],Y=8191&V,G=V>>>13,q=0|s[2],W=8191&q,X=q>>>13,Z=0|s[3],J=8191&Z,Q=Z>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(a=(a=Math.imul(f,H))+Math.imul(h,U)|0))<<13)|0;u=((i=Math.imul(h,H))+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),a=(a=Math.imul(p,H))+Math.imul(g,U)|0,i=Math.imul(g,H);var mt=(u+(n=n+Math.imul(f,Y)|0)|0)+((8191&(a=(a=a+Math.imul(f,G)|0)+Math.imul(h,Y)|0))<<13)|0;u=((i=i+Math.imul(h,G)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),a=(a=Math.imul(m,H))+Math.imul(y,U)|0,i=Math.imul(y,H),n=n+Math.imul(p,Y)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,G)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(a=(a=a+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;u=((i=i+Math.imul(h,X)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),a=(a=Math.imul(x,H))+Math.imul(_,U)|0,i=Math.imul(_,H),n=n+Math.imul(m,Y)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,a=(a=a+Math.imul(p,X)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,X)|0;var bt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(a=(a=a+Math.imul(f,Q)|0)+Math.imul(h,J)|0))<<13)|0;u=((i=i+Math.imul(h,Q)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),a=(a=Math.imul(A,H))+Math.imul(T,U)|0,i=Math.imul(T,H),n=n+Math.imul(x,Y)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Q)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,Q)|0;var xt=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(a=(a=a+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;u=((i=i+Math.imul(h,tt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,U),a=(a=Math.imul(k,H))+Math.imul(E,U)|0,i=Math.imul(E,H),n=n+Math.imul(A,Y)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,G)|0,n=n+Math.imul(x,W)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,Q)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Q)|0,n=n+Math.imul(p,$)|0,a=(a=a+Math.imul(p,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(a=(a=a+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((i=i+Math.imul(h,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,U),a=(a=Math.imul(C,H))+Math.imul(O,U)|0,i=Math.imul(O,H),n=n+Math.imul(k,Y)|0,a=(a=a+Math.imul(k,G)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,tt)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,a=(a=a+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,it)|0)|0)+((8191&(a=(a=a+Math.imul(f,ot)|0)+Math.imul(h,it)|0))<<13)|0;u=((i=i+Math.imul(h,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),a=(a=Math.imul(D,H))+Math.imul(R,U)|0,i=Math.imul(R,H),n=n+Math.imul(C,Y)|0,a=(a=a+Math.imul(C,G)|0)+Math.imul(O,Y)|0,i=i+Math.imul(O,G)|0,n=n+Math.imul(k,W)|0,a=(a=a+Math.imul(k,X)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,Q)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Q)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,a=(a=a+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,n=n+Math.imul(p,it)|0,a=(a=a+Math.imul(p,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var At=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(a=(a=a+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((i=i+Math.imul(h,ut)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(P,U),a=(a=Math.imul(P,H))+Math.imul(F,U)|0,i=Math.imul(F,H),n=n+Math.imul(D,Y)|0,a=(a=a+Math.imul(D,G)|0)+Math.imul(R,Y)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(C,W)|0,a=(a=a+Math.imul(C,X)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,X)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,Q)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,Q)|0,n=n+Math.imul(A,$)|0,a=(a=a+Math.imul(A,tt)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(x,rt)|0,a=(a=a+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(m,it)|0,a=(a=a+Math.imul(m,ot)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,a=(a=a+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0;var Tt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(a=(a=a+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((i=i+Math.imul(h,ht)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,U),a=(a=Math.imul(z,H))+Math.imul(B,U)|0,i=Math.imul(B,H),n=n+Math.imul(P,Y)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(F,Y)|0,i=i+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,a=(a=a+Math.imul(D,X)|0)+Math.imul(R,W)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(C,J)|0,a=(a=a+Math.imul(C,Q)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,tt)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,tt)|0,n=n+Math.imul(A,rt)|0,a=(a=a+Math.imul(A,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(x,it)|0,a=(a=a+Math.imul(x,ot)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,a=(a=a+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,a=(a=a+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,ht)|0;var Mt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(a=(a=a+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((i=i+Math.imul(h,gt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(z,Y),a=(a=Math.imul(z,G))+Math.imul(B,Y)|0,i=Math.imul(B,G),n=n+Math.imul(P,W)|0,a=(a=a+Math.imul(P,X)|0)+Math.imul(F,W)|0,i=i+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,a=(a=a+Math.imul(D,Q)|0)+Math.imul(R,J)|0,i=i+Math.imul(R,Q)|0,n=n+Math.imul(C,$)|0,a=(a=a+Math.imul(C,tt)|0)+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,a=(a=a+Math.imul(k,nt)|0)+Math.imul(E,rt)|0,i=i+Math.imul(E,nt)|0,n=n+Math.imul(A,it)|0,a=(a=a+Math.imul(A,ot)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,ot)|0,n=n+Math.imul(x,lt)|0,a=(a=a+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,a=(a=a+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,i=i+Math.imul(y,ht)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(a=(a=a+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,W),a=(a=Math.imul(z,X))+Math.imul(B,W)|0,i=Math.imul(B,X),n=n+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Q)|0)+Math.imul(F,J)|0,i=i+Math.imul(F,Q)|0,n=n+Math.imul(D,$)|0,a=(a=a+Math.imul(D,tt)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(C,rt)|0,a=(a=a+Math.imul(C,nt)|0)+Math.imul(O,rt)|0,i=i+Math.imul(O,nt)|0,n=n+Math.imul(k,it)|0,a=(a=a+Math.imul(k,ot)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,ot)|0,n=n+Math.imul(A,lt)|0,a=(a=a+Math.imul(A,ut)|0)+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,n=n+Math.imul(x,ft)|0,a=(a=a+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,ht)|0;var Et=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(a=(a=a+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,J),a=(a=Math.imul(z,Q))+Math.imul(B,J)|0,i=Math.imul(B,Q),n=n+Math.imul(P,$)|0,a=(a=a+Math.imul(P,tt)|0)+Math.imul(F,$)|0,i=i+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,a=(a=a+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(C,it)|0,a=(a=a+Math.imul(C,ot)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,ot)|0,n=n+Math.imul(k,lt)|0,a=(a=a+Math.imul(k,ut)|0)+Math.imul(E,lt)|0,i=i+Math.imul(E,ut)|0,n=n+Math.imul(A,ft)|0,a=(a=a+Math.imul(A,ht)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,ht)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(a=(a=a+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(z,$),a=(a=Math.imul(z,tt))+Math.imul(B,$)|0,i=Math.imul(B,tt),n=n+Math.imul(P,rt)|0,a=(a=a+Math.imul(P,nt)|0)+Math.imul(F,rt)|0,i=i+Math.imul(F,nt)|0,n=n+Math.imul(D,it)|0,a=(a=a+Math.imul(D,ot)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,ot)|0,n=n+Math.imul(C,lt)|0,a=(a=a+Math.imul(C,ut)|0)+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,n=n+Math.imul(k,ft)|0,a=(a=a+Math.imul(k,ht)|0)+Math.imul(E,ft)|0,i=i+Math.imul(E,ht)|0;var Ct=(u+(n=n+Math.imul(A,pt)|0)|0)+((8191&(a=(a=a+Math.imul(A,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((i=i+Math.imul(T,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(z,rt),a=(a=Math.imul(z,nt))+Math.imul(B,rt)|0,i=Math.imul(B,nt),n=n+Math.imul(P,it)|0,a=(a=a+Math.imul(P,ot)|0)+Math.imul(F,it)|0,i=i+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,a=(a=a+Math.imul(D,ut)|0)+Math.imul(R,lt)|0,i=i+Math.imul(R,ut)|0,n=n+Math.imul(C,ft)|0,a=(a=a+Math.imul(C,ht)|0)+Math.imul(O,ft)|0,i=i+Math.imul(O,ht)|0;var Ot=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(a=(a=a+Math.imul(k,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((i=i+Math.imul(E,gt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,it),a=(a=Math.imul(z,ot))+Math.imul(B,it)|0,i=Math.imul(B,ot),n=n+Math.imul(P,lt)|0,a=(a=a+Math.imul(P,ut)|0)+Math.imul(F,lt)|0,i=i+Math.imul(F,ut)|0,n=n+Math.imul(D,ft)|0,a=(a=a+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,i=i+Math.imul(R,ht)|0;var Lt=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(a=(a=a+Math.imul(C,gt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((i=i+Math.imul(O,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,lt),a=(a=Math.imul(z,ut))+Math.imul(B,lt)|0,i=Math.imul(B,ut),n=n+Math.imul(P,ft)|0,a=(a=a+Math.imul(P,ht)|0)+Math.imul(F,ft)|0,i=i+Math.imul(F,ht)|0;var Dt=(u+(n=n+Math.imul(D,pt)|0)|0)+((8191&(a=(a=a+Math.imul(D,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((i=i+Math.imul(R,gt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ft),a=(a=Math.imul(z,ht))+Math.imul(B,ft)|0,i=Math.imul(B,ht);var Rt=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(a=(a=a+Math.imul(P,gt)|0)+Math.imul(F,pt)|0))<<13)|0;u=((i=i+Math.imul(F,gt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(n=Math.imul(z,pt))|0)+((8191&(a=(a=Math.imul(z,gt))+Math.imul(B,pt)|0))<<13)|0;return u=((i=Math.imul(B,gt))+(a>>>13)|0)+(It>>>26)|0,It&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=At,l[8]=Tt,l[9]=Mt,l[10]=kt,l[11]=Et,l[12]=St,l[13]=Ct,l[14]=Ot,l[15]=Lt,l[16]=Dt,l[17]=Rt,l[18]=It,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=h),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=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.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=a);u--){var f=0|this.words[u];this.words[u]=c<<26-i|f>>>i,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var a=67108863^67108863>>>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(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(a,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new 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);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(f)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(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){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:at.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){na&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},a(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,a),h=this.pow(t,a.addn(1).iushrn(1)),d=this.pow(t,a),p=o;0!==d.cmp(s);){for(var g=d,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new A(t)},a(A,w),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())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).iushrn(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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:56}],49:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 1:return f(t);case 2:return"function"==typeof e?u(t,t,e,!0):h(t,e);case 3:return u(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,a=t("typedarray-pool"),i=t("./lib/sweep"),o=t("./lib/intersect");function s(t,e){for(var r=0;r>>1;if(!(c<=0)){var f,h=a.mallocDouble(2*c*s),d=a.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)i.init(s),f=i.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=a.mallocDouble(2*c*u),g=a.mallocInt32(u);(u=l(e,c,p,g))>0&&(i.init(s+u),f=1===c?i.sweepBipartite(c,r,0,s,h,d,0,u,p,g):o(c,r,n,s,h,d,u,p,g),a.free(p),a.free(g))}a.free(h),a.free(d)}return f}}}function c(t,e){n.push([t,e])}function f(t){return n=[],u(t,t,c,!0),n}function h(t,e){return n=[],u(t,e,c,!1),n}},{"./lib/intersect":51,"./lib/sweep":55,"typedarray-pool":340}],50:[function(t,e,r){"use strict";var n=["d","ax","vv","rs","re","rb","ri","bs","be","bb","bi"];function a(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],a=n.slice();t||a.splice(3,0,"fp");var i=["function "+e+"("+a.join()+"){"];function o(e,a){var o=function(t,e,r){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",a,"(",n.join(),"){","var ","es","=2*","d",";"],o="for(var i=rs,rp=es*rs;ibe-bs){"),t?(o(!0,!1),i.push("}else{"),o(!1,!1)):(i.push("if(fp){"),o(!0,!0),i.push("}else{"),o(!0,!1),i.push("}}else{if(fp){"),o(!1,!0),i.push("}else{"),o(!1,!1),i.push("}")),i.push("}}return "+e);var s=r.join("")+i.join("");return new Function(s)()}r.partial=a(!1),r.full=a(!0)},{}],51:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,c,w,A,T,M){!function(t,e){var r=8*a.log2(e+1)*(t+1)|0,i=a.nextPow2(6*r);m.length0;){var C=6*(E-=1),O=m[C],L=m[C+1],D=m[C+2],R=m[C+3],I=m[C+4],P=m[C+5],F=2*E,N=y[F],z=y[F+1],B=1&P,j=!!(16&P),U=c,H=w,V=T,Y=M;if(B&&(U=T,H=M,V=c,Y=w),!(2&P&&(D=d(t,O,L,D,U,H,z),L>=D)||4&P&&(L=p(t,O,L,D,U,H,N))>=D)){var G=D-L,q=I-R;if(j){if(t*G*(G+q)<1<<22){if(void 0!==(k=l.scanComplete(t,O,e,L,D,U,H,R,I,V,Y)))return k;continue}}else{if(t*Math.min(G,q)<128){if(void 0!==(k=o(t,O,e,B,L,D,U,H,R,I,V,Y)))return k;continue}if(t*G*q<1<<22){if(void 0!==(k=l.scanBipartite(t,O,e,B,L,D,U,H,R,I,V,Y)))return k;continue}}var W=f(t,O,L,D,U,H,N,z);if(L=p0)&&!(p1>=hi)",["p0","p1"]),h=c("lo===p0",["p0"]),d=c("lo>>1,f=2*t,h=c,d=o[f*c+e];for(;l=y?(h=m,d=y):v>=x?(h=g,d=v):(h=b,d=x):y>=x?(h=m,d=y):x>=v?(h=g,d=v):(h=b,d=x);for(var _=f*(u-1),w=f*h,A=0;Ar&&a[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;p=0&&n.push("lo=e[k+n]");t.indexOf("hi")>=0&&n.push("hi=e[k+o]");return r.push("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".replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}},{}],54:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,c){var f=(r-e+1)/6|0,h=e+f,d=r-f,p=e+r>>1,g=p-f,v=p+f,m=h,y=g,b=p,x=v,_=d,w=e+1,A=r-1,T=0;l(m,y,c)&&(T=m,m=y,y=T);l(x,_,c)&&(T=x,x=_,_=T);l(m,b,c)&&(T=m,m=b,b=T);l(y,b,c)&&(T=y,y=b,b=T);l(m,x,c)&&(T=m,m=x,x=T);l(b,x,c)&&(T=b,b=x,x=T);l(y,_,c)&&(T=y,y=_,_=T);l(y,b,c)&&(T=y,y=b,b=T);l(x,_,c)&&(T=x,x=_,_=T);for(var M=c[2*y],k=c[2*y+1],E=c[2*x],S=c[2*x+1],C=2*m,O=2*b,L=2*_,D=2*h,R=2*p,I=2*d,P=0;P<2;++P){var F=c[C+P],N=c[O+P],z=c[L+P];c[D+P]=F,c[R+P]=N,c[I+P]=z}i(g,e,c),i(v,r,c);for(var B=w;B<=A;++B)if(u(B,M,k,c))B!==w&&a(B,w,c),++w;else if(!u(B,E,S,c))for(;;){if(u(A,E,S,c)){u(A,M,k,c)?(o(B,w,A,c),++w,--A):(a(B,A,c),--A);break}if(--At;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function u(t,e,r,n){var a=n[t*=2];return a>>1;i(h,k);var E=0,S=0;for(w=0;w=1<<28)d(l,u,S--,C=C-(1<<28)|0);else if(C>=0)d(o,s,E--,C);else if(C<=-(1<<28)){C=-C-(1<<28)|0;for(var O=0;O>>1;i(h,S);var C=0,O=0,L=0;for(T=0;T>1==h[2*T+3]>>1&&(R=2,T+=1),D<0){for(var I=-(D>>1)-1,P=0;P>1)-1;0===R?d(o,s,C--,I):1===R?d(l,u,O--,I):2===R&&d(c,f,L--,I)}}},scanBipartite:function(t,e,r,n,a,l,u,c,f,g,v,m){var y=0,b=2*t,x=e,_=e+t,w=1,A=1;n?A=1<<28:w=1<<28;for(var T=a;T>>1;i(h,S);var C=0;for(T=0;T=1<<28?(L=!n,M-=1<<28):(L=!!n,M-=1),L)p(o,s,C++,M);else{var D=m[M],R=b*M,I=v[R+e+1],P=v[R+e+1+t];t:for(var F=0;F>>1;i(h,w);var A=0;for(y=0;y=1<<28)o[A++]=b-(1<<28);else{var M=d[b-=1],k=g*b,E=f[k+e+1],S=f[k+e+1+t];t:for(var C=0;C=0;--C)if(o[C]===b){for(R=C+1;R0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=v(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],58:[function(t,e,r){(function(e){(function(){ + */function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var a;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!a&&m(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&_(a,r)||s)&&m(a,r,"Got unwanted exception"+n),t&&a&&r&&!_(a,r)||!t&&a)throw a}h.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=function(t){return g(v(t.actual),128)+" "+t.operator+" "+g(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=p(e),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=m,h.ok=y,h.equal=function(t,e,r){t!=e&&m(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){b(t,e,!1)||m(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){b(t,e,!0)||m(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){b(t,e,!1)&&m(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){w(!0,t,e,r)},h.doesNotThrow=function(t,e,r){w(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var A=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":258,"util/":26}],24:[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}},{}],25:[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}},{}],26:[function(t,e,r){(function(e,n){(function(){var a=/%[sdj%]/g;r.format=function(t){if(!m(t)){for(var e=[],r=0;r=i)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}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(n,t);return m(a)||(a=c(t,a,n)),a}var i=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(A(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var u,x="",T=!1,k=["{","}"];(d(e)&&(T=!0,k=["[","]"]),A(e))&&(x=" [Function"+(e.name?": "+e.name:"")+"]");return b(e)&&(x=" "+RegExp.prototype.toString.call(e)),_(e)&&(x=" "+Date.prototype.toUTCString.call(e)),w(e)&&(x=" "+f(e)),0!==o.length||T&&0!=e.length?n<0?b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=T?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,x,k)):k[0]+x+k[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),S(n,a)||(o="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=i?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")),y(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).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){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return"number"==typeof t}function m(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function w(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=p,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=v,r.isString=m,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=b,r.isObject=x,r.isDate=_,r.isError=w,r.isFunction=A,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",E(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":25,_process:278,inherits:24}],27:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],28:[function(t,e,r){"use strict";r.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=u(t),o=n[0],s=n[1],l=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[c++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var a,i,o=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],29:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":39}],30:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],31:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":39}],32:[function(t,e,r){"use strict";var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(a(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))u=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=i(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(a(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=i(r)}else c=i(1);f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f));return s(u,c)}},{"./div":31,"./is-rat":33,"./lib/is-bn":37,"./lib/num-to-bn":38,"./lib/rationalize":39,"./lib/str-to-bn":40}],33:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":37}],34:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":48}],35:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i20)return 52;return r+32}},{"bit-twiddle":46,"double-bits":93}],37:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":48}],38:[function(t,e,r){"use strict";var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":48,"double-bits":93}],39:[function(t,e,r){"use strict";var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":34,"./num-to-bn":38}],40:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":48}],41:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":39}],42:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":34}],43:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":39}],44:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":35,"./lib/ctz":36}],45:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(i=o,a=o-1):n=o+1}return i}function a(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(i=o,a=o-1):n=o+1}return i}function i(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(i=o,n=o+1):a=o-1}return i}function o(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(i=o,n=o+1):a=o-1}return i}function s(t,e,r,n,a){for(;n<=a;){var i=n+a>>>1,o=t[i],s=void 0!==r?r(o,e):o-e;if(0===s)return i;s<=0?n=i+1:a=i-1}return-1}function l(t,e,r,n,a,i){return"function"==typeof r?i(t,e,r,void 0===n?0:0|n,void 0===a?t.length-1:0|a):i(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,a,i){return l(t,e,r,a,i,n)},gt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},lt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},le:function(t,e,r,n,a){return l(t,e,r,n,a,o)},eq:function(t,e,r,n,a){return l(t,e,r,n,a,s)}}},{}],46:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],47:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,u,c,f,h,d,p,g,v=null==e.cutoff?.25:e.cutoff,m=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,c=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext("2d"),r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,d=f.getImageData(0,0,r,o),l=d.data,c=4):window.ImageData&&t instanceof window.ImageData&&(d=t,r=t.width,o=t.height,l=d.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),p=0,g=u.length;p=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);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=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(a=0|t.words[p])*(i=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(i),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=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=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;it.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==i&&o>26,this.words[o]=67108863&e;if(0===i&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],A=8191&w,T=w>>>13,k=0|o[5],M=8191&k,E=k>>>13,S=0|o[6],C=8191&S,O=S>>>13,L=0|o[7],D=8191&L,R=L>>>13,I=0|o[8],P=8191&I,F=I>>>13,N=0|o[9],z=8191&N,B=N>>>13,j=0|s[0],U=8191&j,H=j>>>13,V=0|s[1],Y=8191&V,G=V>>>13,q=0|s[2],W=8191&q,X=q>>>13,Z=0|s[3],J=8191&Z,Q=Z>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(a=(a=Math.imul(f,H))+Math.imul(h,U)|0))<<13)|0;u=((i=Math.imul(h,H))+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),a=(a=Math.imul(p,H))+Math.imul(g,U)|0,i=Math.imul(g,H);var mt=(u+(n=n+Math.imul(f,Y)|0)|0)+((8191&(a=(a=a+Math.imul(f,G)|0)+Math.imul(h,Y)|0))<<13)|0;u=((i=i+Math.imul(h,G)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),a=(a=Math.imul(m,H))+Math.imul(y,U)|0,i=Math.imul(y,H),n=n+Math.imul(p,Y)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,G)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(a=(a=a+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;u=((i=i+Math.imul(h,X)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),a=(a=Math.imul(x,H))+Math.imul(_,U)|0,i=Math.imul(_,H),n=n+Math.imul(m,Y)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,a=(a=a+Math.imul(p,X)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,X)|0;var bt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(a=(a=a+Math.imul(f,Q)|0)+Math.imul(h,J)|0))<<13)|0;u=((i=i+Math.imul(h,Q)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),a=(a=Math.imul(A,H))+Math.imul(T,U)|0,i=Math.imul(T,H),n=n+Math.imul(x,Y)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Q)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,Q)|0;var xt=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(a=(a=a+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;u=((i=i+Math.imul(h,tt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(M,U),a=(a=Math.imul(M,H))+Math.imul(E,U)|0,i=Math.imul(E,H),n=n+Math.imul(A,Y)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,G)|0,n=n+Math.imul(x,W)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,Q)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Q)|0,n=n+Math.imul(p,$)|0,a=(a=a+Math.imul(p,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(a=(a=a+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((i=i+Math.imul(h,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,U),a=(a=Math.imul(C,H))+Math.imul(O,U)|0,i=Math.imul(O,H),n=n+Math.imul(M,Y)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,tt)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,a=(a=a+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,it)|0)|0)+((8191&(a=(a=a+Math.imul(f,ot)|0)+Math.imul(h,it)|0))<<13)|0;u=((i=i+Math.imul(h,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),a=(a=Math.imul(D,H))+Math.imul(R,U)|0,i=Math.imul(R,H),n=n+Math.imul(C,Y)|0,a=(a=a+Math.imul(C,G)|0)+Math.imul(O,Y)|0,i=i+Math.imul(O,G)|0,n=n+Math.imul(M,W)|0,a=(a=a+Math.imul(M,X)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,Q)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Q)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,a=(a=a+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,n=n+Math.imul(p,it)|0,a=(a=a+Math.imul(p,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var At=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(a=(a=a+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((i=i+Math.imul(h,ut)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(P,U),a=(a=Math.imul(P,H))+Math.imul(F,U)|0,i=Math.imul(F,H),n=n+Math.imul(D,Y)|0,a=(a=a+Math.imul(D,G)|0)+Math.imul(R,Y)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(C,W)|0,a=(a=a+Math.imul(C,X)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,X)|0,n=n+Math.imul(M,J)|0,a=(a=a+Math.imul(M,Q)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,Q)|0,n=n+Math.imul(A,$)|0,a=(a=a+Math.imul(A,tt)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(x,rt)|0,a=(a=a+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(m,it)|0,a=(a=a+Math.imul(m,ot)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,a=(a=a+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0;var Tt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(a=(a=a+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((i=i+Math.imul(h,ht)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,U),a=(a=Math.imul(z,H))+Math.imul(B,U)|0,i=Math.imul(B,H),n=n+Math.imul(P,Y)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(F,Y)|0,i=i+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,a=(a=a+Math.imul(D,X)|0)+Math.imul(R,W)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(C,J)|0,a=(a=a+Math.imul(C,Q)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,Q)|0,n=n+Math.imul(M,$)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,tt)|0,n=n+Math.imul(A,rt)|0,a=(a=a+Math.imul(A,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(x,it)|0,a=(a=a+Math.imul(x,ot)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,a=(a=a+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,a=(a=a+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,ht)|0;var kt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(a=(a=a+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((i=i+Math.imul(h,gt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,Y),a=(a=Math.imul(z,G))+Math.imul(B,Y)|0,i=Math.imul(B,G),n=n+Math.imul(P,W)|0,a=(a=a+Math.imul(P,X)|0)+Math.imul(F,W)|0,i=i+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,a=(a=a+Math.imul(D,Q)|0)+Math.imul(R,J)|0,i=i+Math.imul(R,Q)|0,n=n+Math.imul(C,$)|0,a=(a=a+Math.imul(C,tt)|0)+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,n=n+Math.imul(M,rt)|0,a=(a=a+Math.imul(M,nt)|0)+Math.imul(E,rt)|0,i=i+Math.imul(E,nt)|0,n=n+Math.imul(A,it)|0,a=(a=a+Math.imul(A,ot)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,ot)|0,n=n+Math.imul(x,lt)|0,a=(a=a+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,a=(a=a+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,i=i+Math.imul(y,ht)|0;var Mt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(a=(a=a+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(z,W),a=(a=Math.imul(z,X))+Math.imul(B,W)|0,i=Math.imul(B,X),n=n+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Q)|0)+Math.imul(F,J)|0,i=i+Math.imul(F,Q)|0,n=n+Math.imul(D,$)|0,a=(a=a+Math.imul(D,tt)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(C,rt)|0,a=(a=a+Math.imul(C,nt)|0)+Math.imul(O,rt)|0,i=i+Math.imul(O,nt)|0,n=n+Math.imul(M,it)|0,a=(a=a+Math.imul(M,ot)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,ot)|0,n=n+Math.imul(A,lt)|0,a=(a=a+Math.imul(A,ut)|0)+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,n=n+Math.imul(x,ft)|0,a=(a=a+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,ht)|0;var Et=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(a=(a=a+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,J),a=(a=Math.imul(z,Q))+Math.imul(B,J)|0,i=Math.imul(B,Q),n=n+Math.imul(P,$)|0,a=(a=a+Math.imul(P,tt)|0)+Math.imul(F,$)|0,i=i+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,a=(a=a+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(C,it)|0,a=(a=a+Math.imul(C,ot)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,ot)|0,n=n+Math.imul(M,lt)|0,a=(a=a+Math.imul(M,ut)|0)+Math.imul(E,lt)|0,i=i+Math.imul(E,ut)|0,n=n+Math.imul(A,ft)|0,a=(a=a+Math.imul(A,ht)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,ht)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(a=(a=a+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(z,$),a=(a=Math.imul(z,tt))+Math.imul(B,$)|0,i=Math.imul(B,tt),n=n+Math.imul(P,rt)|0,a=(a=a+Math.imul(P,nt)|0)+Math.imul(F,rt)|0,i=i+Math.imul(F,nt)|0,n=n+Math.imul(D,it)|0,a=(a=a+Math.imul(D,ot)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,ot)|0,n=n+Math.imul(C,lt)|0,a=(a=a+Math.imul(C,ut)|0)+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,n=n+Math.imul(M,ft)|0,a=(a=a+Math.imul(M,ht)|0)+Math.imul(E,ft)|0,i=i+Math.imul(E,ht)|0;var Ct=(u+(n=n+Math.imul(A,pt)|0)|0)+((8191&(a=(a=a+Math.imul(A,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((i=i+Math.imul(T,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(z,rt),a=(a=Math.imul(z,nt))+Math.imul(B,rt)|0,i=Math.imul(B,nt),n=n+Math.imul(P,it)|0,a=(a=a+Math.imul(P,ot)|0)+Math.imul(F,it)|0,i=i+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,a=(a=a+Math.imul(D,ut)|0)+Math.imul(R,lt)|0,i=i+Math.imul(R,ut)|0,n=n+Math.imul(C,ft)|0,a=(a=a+Math.imul(C,ht)|0)+Math.imul(O,ft)|0,i=i+Math.imul(O,ht)|0;var Ot=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(a=(a=a+Math.imul(M,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((i=i+Math.imul(E,gt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,it),a=(a=Math.imul(z,ot))+Math.imul(B,it)|0,i=Math.imul(B,ot),n=n+Math.imul(P,lt)|0,a=(a=a+Math.imul(P,ut)|0)+Math.imul(F,lt)|0,i=i+Math.imul(F,ut)|0,n=n+Math.imul(D,ft)|0,a=(a=a+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,i=i+Math.imul(R,ht)|0;var Lt=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(a=(a=a+Math.imul(C,gt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((i=i+Math.imul(O,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,lt),a=(a=Math.imul(z,ut))+Math.imul(B,lt)|0,i=Math.imul(B,ut),n=n+Math.imul(P,ft)|0,a=(a=a+Math.imul(P,ht)|0)+Math.imul(F,ft)|0,i=i+Math.imul(F,ht)|0;var Dt=(u+(n=n+Math.imul(D,pt)|0)|0)+((8191&(a=(a=a+Math.imul(D,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((i=i+Math.imul(R,gt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ft),a=(a=Math.imul(z,ht))+Math.imul(B,ft)|0,i=Math.imul(B,ht);var Rt=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(a=(a=a+Math.imul(P,gt)|0)+Math.imul(F,pt)|0))<<13)|0;u=((i=i+Math.imul(F,gt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(n=Math.imul(z,pt))|0)+((8191&(a=(a=Math.imul(z,gt))+Math.imul(B,pt)|0))<<13)|0;return u=((i=Math.imul(B,gt))+(a>>>13)|0)+(It>>>26)|0,It&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=At,l[8]=Tt,l[9]=kt,l[10]=Mt,l[11]=Et,l[12]=St,l[13]=Ct,l[14]=Ot,l[15]=Lt,l[16]=Dt,l[17]=Rt,l[18]=It,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=h),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=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.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=a);u--){var f=0|this.words[u];this.words[u]=c<<26-i|f>>>i,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var a=67108863^67108863>>>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(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(a,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new 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);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(f)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(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){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:at.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){na&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},a(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,a),h=this.pow(t,a.addn(1).iushrn(1)),d=this.pow(t,a),p=o;0!==d.cmp(s);){for(var g=d,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new A(t)},a(A,w),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())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).iushrn(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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:56}],49:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 1:return f(t);case 2:return"function"==typeof e?u(t,t,e,!0):h(t,e);case 3:return u(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,a=t("typedarray-pool"),i=t("./lib/sweep"),o=t("./lib/intersect");function s(t,e){for(var r=0;r>>1;if(!(c<=0)){var f,h=a.mallocDouble(2*c*s),d=a.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)i.init(s),f=i.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=a.mallocDouble(2*c*u),g=a.mallocInt32(u);(u=l(e,c,p,g))>0&&(i.init(s+u),f=1===c?i.sweepBipartite(c,r,0,s,h,d,0,u,p,g):o(c,r,n,s,h,d,u,p,g),a.free(p),a.free(g))}a.free(h),a.free(d)}return f}}}function c(t,e){n.push([t,e])}function f(t){return n=[],u(t,t,c,!0),n}function h(t,e){return n=[],u(t,e,c,!1),n}},{"./lib/intersect":51,"./lib/sweep":55,"typedarray-pool":329}],50:[function(t,e,r){"use strict";function n(t){return t?function(t,e,r,n,a,i,o,s,l,u,c){return a-n>l-s?function(t,e,r,n,a,i,o,s,l,u,c){for(var f=2*t,h=n,d=f*n;hu-l?n?function(t,e,r,n,a,i,o,s,l,u,c){for(var f=2*t,h=n,d=f*n;h0;){var C=6*(E-=1),O=m[C],L=m[C+1],D=m[C+2],R=m[C+3],I=m[C+4],P=m[C+5],F=2*E,N=y[F],z=y[F+1],B=1&P,j=!!(16&P),U=c,H=w,V=T,Y=k;if(B&&(U=T,H=k,V=c,Y=w),!(2&P&&(D=d(t,O,L,D,U,H,z),L>=D)||4&P&&(L=p(t,O,L,D,U,H,N))>=D)){var G=D-L,q=I-R;if(j){if(t*G*(G+q)<1<<22){if(void 0!==(M=l.scanComplete(t,O,e,L,D,U,H,R,I,V,Y)))return M;continue}}else{if(t*Math.min(G,q)<128){if(void 0!==(M=o(t,O,e,B,L,D,U,H,R,I,V,Y)))return M;continue}if(t*G*q<1<<22){if(void 0!==(M=l.scanBipartite(t,O,e,B,L,D,U,H,R,I,V,Y)))return M;continue}}var W=f(t,O,L,D,U,H,N,z);if(L=p0)&&!(p1>=hi)"),h=c("lo===p0"),d=c("lo>>1,f=2*t,h=c,d=o[f*c+e];for(;l=y?(h=m,d=y):v>=x?(h=g,d=v):(h=b,d=x):y>=x?(h=m,d=y):x>=v?(h=g,d=v):(h=b,d=x);for(var _=f*(u-1),w=f*h,A=0;Ar&&a[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;ph;++h,l+=s){if(a[l+f]===o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"loh;++h,l+=s){if(a[l+f]d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"lo<=p0":function(t,e,r,n,a,i,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s){if(a[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"hi<=p0":function(t,e,r,n,a,i,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s){if(a[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"lod;++d,l+=s){var p=a[l+f],g=a[l+h];if(pv;++v){var m=a[l+v];a[l+v]=a[u],a[u++]=m}var y=i[d];i[d]=i[c],i[c++]=y}}return c},"lo<=p0&&p0<=hi":function(t,e,r,n,a,i,o){for(var s=2*t,l=s*r,u=l,c=r,f=e,h=t+e,d=r;n>d;++d,l+=s){var p=a[l+f],g=a[l+h];if(p<=o&&o<=g)if(c===d)c+=1,u+=s;else{for(var v=0;s>v;++v){var m=a[l+v];a[l+v]=a[u],a[u++]=m}var y=i[d];i[d]=i[c],i[c++]=y}}return c},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,a,i,o,s){for(var l=2*t,u=l*r,c=u,f=r,h=e,d=t+e,p=r;n>p;++p,u+=l){var g=a[u+h],v=a[u+d];if(!(g>=o||s>=v))if(f===p)f+=1,c+=l;else{for(var m=0;l>m;++m){var y=a[u+m];a[u+m]=a[c],a[c++]=y}var b=i[p];i[p]=i[f],i[f++]=b}}return f}}},{}],54:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,c){var f=(r-e+1)/6|0,h=e+f,d=r-f,p=e+r>>1,g=p-f,v=p+f,m=h,y=g,b=p,x=v,_=d,w=e+1,A=r-1,T=0;l(m,y,c)&&(T=m,m=y,y=T);l(x,_,c)&&(T=x,x=_,_=T);l(m,b,c)&&(T=m,m=b,b=T);l(y,b,c)&&(T=y,y=b,b=T);l(m,x,c)&&(T=m,m=x,x=T);l(b,x,c)&&(T=b,b=x,x=T);l(y,_,c)&&(T=y,y=_,_=T);l(y,b,c)&&(T=y,y=b,b=T);l(x,_,c)&&(T=x,x=_,_=T);for(var k=c[2*y],M=c[2*y+1],E=c[2*x],S=c[2*x+1],C=2*m,O=2*b,L=2*_,D=2*h,R=2*p,I=2*d,P=0;P<2;++P){var F=c[C+P],N=c[O+P],z=c[L+P];c[D+P]=F,c[R+P]=N,c[I+P]=z}i(g,e,c),i(v,r,c);for(var B=w;B<=A;++B)if(u(B,k,M,c))B!==w&&a(B,w,c),++w;else if(!u(B,E,S,c))for(;;){if(u(A,E,S,c)){u(A,k,M,c)?(o(B,w,A,c),++w,--A):(a(B,A,c),--A);break}if(--At;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function u(t,e,r,n){var a=n[t*=2];return a>>1;i(h,M);var E=0,S=0;for(w=0;w=1<<28)d(l,u,S--,C=C-(1<<28)|0);else if(C>=0)d(o,s,E--,C);else if(C<=-(1<<28)){C=-C-(1<<28)|0;for(var O=0;O>>1;i(h,S);var C=0,O=0,L=0;for(T=0;T>1==h[2*T+3]>>1&&(R=2,T+=1),D<0){for(var I=-(D>>1)-1,P=0;P>1)-1;0===R?d(o,s,C--,I):1===R?d(l,u,O--,I):2===R&&d(c,f,L--,I)}}},scanBipartite:function(t,e,r,n,a,l,u,c,f,g,v,m){var y=0,b=2*t,x=e,_=e+t,w=1,A=1;n?A=1<<28:w=1<<28;for(var T=a;T>>1;i(h,S);var C=0;for(T=0;T=1<<28?(L=!n,k-=1<<28):(L=!!n,k-=1),L)p(o,s,C++,k);else{var D=m[k],R=b*k,I=v[R+e+1],P=v[R+e+1+t];t:for(var F=0;F>>1;i(h,w);var A=0;for(y=0;y=1<<28)o[A++]=b-(1<<28);else{var k=d[b-=1],M=g*b,E=f[M+e+1],S=f[M+e+1+t];t:for(var C=0;C=0;--C)if(o[C]===b){for(R=C+1;R0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=v(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],58:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},r.INSPECT_MAX_BYTES=50;function a(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(a)return n?-1:P(t).length;e=(""+e).toLowerCase(),a=!0}}function h(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;ha&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:u>223?3:u>191?2:1;if(a+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(z(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function D(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function F(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":28,buffer:58,ieee754:240}],59:[function(t,e,r){"use strict";var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),d=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(c||f!==h||d){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var d=r.pop(),p=(s=r.pop(),c=-1,f=-1,l=o[s],1);p=0||(e.flip(s,d),a(t,e,r,c,s,f),a(t,e,r,s,f,c),a(t,e,r,f,d,c),a(t,e,r,d,c,f)))}}},{"binary-search-bounds":45,"robust-in-sphere":299}],61:[function(t,e,r){"use strict";var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-a){u[d]=a;c[d];for(var p=0;p<3;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=a))}}}var v=l;l=s,s=v,l.length=0,a=-a}var m=function(t,e,r){for(var n=0,a=0;a1&&a(r[h[d-2]],r[h[d-1]],i)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=f.upperIds;for(d=p.length;d>1&&a(r[p[d-2]],r[p[d-1]],i)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function c(t,e){var r;return(r=t.a[0]p[0]&&a.push(new o(p,d,2,l),new o(d,p,1,l))}a.sort(s);for(var g=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),v=[new i([g,1],[g,0],-1,[],[],[],[])],m=[],y=(l=0,a.length);l=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;nr?r:t:te?e:t}},{}],65:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;ie[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--i){var b=e[c=(E=n[i])[0]],x=b[0],_=b[1],w=t[x],A=t[_];if((w[0]-A[0]||w[1]-A[1])<0){var T=x;x=_,_=T}b[0]=x;var M,k=b[1]=E[1];for(a&&(M=b[2]);i>0&&n[i-1][0]===c;){var E,S=(E=n[--i])[1];a?e.push([k,S,M]):e.push([k,S]),k=S}a?e.push([k,_,M]):e.push([k,_])}return h}(t,e,h,v,r));return m(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":66,"big-rat":32,"big-rat/cmp":30,"big-rat/to-float":44,"box-intersect":49,nextafter:262,"rat-vec":290,"robust-segment-intersect":303,"union-find":341}],66:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),f=s(n,r),h=c(i,f);if(0===o(h))return null;var d=s(t,r),p=c(f,d),g=a(p,h),v=u(i,g);return l(t,v)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":31,"big-rat/mul":41,"big-rat/sign":42,"big-rat/sub":43,"rat-vec/add":289,"rat-vec/muls":291,"rat-vec/sub":292}],67:[function(t,e,r){"use strict";var n=t("clamp");function a(t,e){null==e&&(e=!0);var r=t[0],a=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,a*=255,i*=255,o*=255),16777216*(r=255&n(r,0,255))+((a=255&n(a,0,255))<<16)+((i=255&n(i,0,255))<<8)+(o=255&n(o,0,255))}e.exports=a,e.exports.to=a,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,a=(65280&t)>>>8,i=255&t;return!1===e?[r,n,a,i]:[r/255,n/255,a/255,i/255]}},{clamp:64}],68:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],69:[function(t,e,r){"use strict";var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:64,"color-rgba":71,dtype:98}],70:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=(d=t.slice(1)).length;u=1,c<=4?(l=[parseInt(d[0]+d[0],16),parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16)],4===c&&(u=parseInt(d[3]+d[3],16)/255)):(l=[parseInt(d[0]+d[1],16),parseInt(d[2]+d[3],16),parseInt(d[4]+d[5],16)],8===c&&(u=parseInt(d[6]+d[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f,d=f.replace(/a$/,"");s=d;c="cmyk"===d?4:"gray"===d?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===d?255*parseFloat(t)/100:parseFloat(t);if("h"===d[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===d&&l.push(1),u=h||void 0===l[c]?1:l[c],l=l.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var p=i(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),u=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":68,defined:94,"is-plain-obj":250}],71:[function(t,e,r){"use strict";var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:64,"color-parse":70,"color-space/hsl":72}],72:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[u]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":73}],73:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],74:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){var o=n(e,r,i);if(0===o){var s=a(n(t,e,r)),u=a(n(t,e,i));if(s===u){if(0===s){var c=l(t,e,r),f=l(t,e,i);return c===f?0:c?1:-1}return 0}return 0===u?s>0||l(t,e,i)?-1:1:0===s?u>0||l(t,e,r)?1:-1:a(u-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,i)>0?1:-1:h<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),u=i(r[1],-e[1]),c=s(o(n,l),o(a,u));return c[c.length-1]>=0}},{"robust-orientation":300,"robust-product":301,"robust-sum":305,signum:306,"two-sum":328}],75:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],76:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],77:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],78:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],79:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":81,"./stringify":82}],80:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":75}],81:[function(t,e,r){"use strict";var n=t("unquote"),a=t("css-global-keywords"),i=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),u=t("string-split-by"),c=t("./lib/util").isSize;e.exports=h;var f=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=u(t,/\s+/);e=h.shift();){if(-1!==a.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(c(e)){var p=u(e,"/");if(r.size=p[0],null!=p[1]?r.lineHeight=d(p[1]):"/"===h[0]&&(h.shift(),r.lineHeight=d(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=u(h.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function d(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":80,"css-font-stretch-keywords":76,"css-font-style-keywords":77,"css-font-weight-keywords":78,"css-global-keywords":83,"css-system-font-keywords":84,"string-split-by":315,unquote:343}],82:[function(t,e,r){"use strict";var n=t("pick-by-alias"),a=t("./lib/util").isSize,i=g(t("css-global-keywords")),o=g(t("css-system-font-keywords")),s=g(t("css-font-weight-keywords")),l=g(t("css-font-style-keywords")),u=g(t("css-font-stretch-keywords")),c={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",d="serif";function p(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r0)throw new Error("cwise: pre() block may not reference array args");if(i0)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),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.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,n(e)}},{"./lib/thunk.js":87}],86:[function(t,e,r){"use strict";var n=t("uniq");function a(t,e,r){var n,a,i=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=i-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,a=[],i=[],o=0;o0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),u=0;u0&&b.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(u=0;u0&&y.push("var "+b.join(",")),u=0;u3&&y.push(i(t.pre,t,l));var T=i(t.body,t,l),M=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].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(c=0;c3&&y.push(i(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var k=[t.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",M,o(l)].join("");return new Function(["function ",k,"(",m.join(","),"){",y.join("\n"),"} return ",k].join(""))()}},{uniq:342}],87:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],a=t.funcName+"_cwise_thunk";e.push(["return function ",a,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],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;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".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"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;c1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?u:(e=f.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",d=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",v=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,u=t.symbol,f=t.zero,y=t.width,b=t.comma,x=t.precision,_=t.trim,w=t.type;"n"===w?(b=!0,w="g"):l[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var A="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===u?c:/[%p]/.test(w)?g:"",M=l[w],k=/[defgprs%]/.test(w);function E(t){var i,s,l,u=A,c=T;if("c"===w)c=M(t)+c,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:M(Math.abs(t),x),_&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==a&&(g=!1),u=(g?"("===a?a:v:"-"===a||"("===a?"":a)+u,c=("s"===w?h[8+n/3]:"")+c+(g&&"("===a?")":""),k)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){c=(46===l?d+t.slice(i+1):t.slice(i))+c,t=t.slice(0,i);break}}b&&!f&&(t=o(t,1/0));var E=u.length+t.length+c.length,S=E>1)+u+t+c+S.slice(E);break;default:t=S+u+t+c}return p(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),E.toString=function(){return t+""},E}return{format:y,formatPrefix:function(t,e){var n=y(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=h[8+a/3];return function(t){return n(o*t)+s}}}}function p(e){return c=d(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}p({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=p,t.formatLocale=d,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],91:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,f=t.shortDays,h=t.months,yt=t.shortMonths,bt=d(u),xt=p(u),_t=d(c),wt=p(c),At=d(f),Tt=p(f),Mt=d(h),kt=p(h),Et=d(yt),St=p(yt),Ct={a:function(t){return f[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:P,e:P,f:j,H:F,I:N,j:z,L:B,m:U,M:H,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:V,u:Y,U:G,V:q,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:Q,"%":gt},Ot={a:function(t){return f[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:$,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:st,U:lt,V:ut,w:ct,W:ft,x:null,X:null,y:ht,Y:dt,Z:pt,"%":gt},Lt={a:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.w=Tt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Et.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=kt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return It(t,i,e,r)},d:M,e:M,f:L,H:E,I:E,j:k,L:O,m:T,M:S,p:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:A,Q:R,s:I,S:C,u:v,U:m,V:y,w:g,W:b,x:function(t,e,r){return It(t,o,e,r)},X:function(t,e,r){return It(t,l,e,r)},y:_,Y:x,Z:w,"%":D};function Dt(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function It(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Lt[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ct.x=Dt(o,Ct),Ct.X=Dt(l,Ct),Ct.c=Dt(i,Ct),Ot.x=Dt(o,Ot),Ot.X=Dt(l,Ot),Ot.c=Dt(i,Ot),{format:function(t){var e=Dt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=Rt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Dt(t+="",Ot);return e.toString=function(){return t},e},utcParse:function(t){var e=Rt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function D(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function R(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function P(t,e){return f(t.getDate(),e,2)}function F(t,e){return f(t.getHours(),e,2)}function N(t,e){return f(t.getHours()%12||12,e,2)}function z(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return B(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function H(t,e){return f(t.getMinutes(),e,2)}function V(t,e){return f(t.getSeconds(),e,2)}function Y(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function q(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function Q(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function K(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function dt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function pt(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=bt,t.isoParse=xt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":92}],92:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),d=h.range;function p(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=p(0),v=p(1),m=p(2),y=p(3),b=p(4),x=p(5),_=p(6),w=g.range,A=v.range,T=m.range,M=y.range,k=b.range,E=x.range,S=_.range,C=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=C.range,L=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));L.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var D=L.range,R=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),I=R.range,P=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),F=P.range,N=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),z=N.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=B(0),U=B(1),H=B(2),V=B(3),Y=B(4),G=B(5),q=B(6),W=j.range,X=U.range,Z=H.range,J=V.range,Q=Y.range,K=G.range,$=q.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=d,t.timeFriday=x,t.timeFridays=E,t.timeHour=c,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=v,t.timeMondays=A,t.timeMonth=C,t.timeMonths=O,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=b,t.timeThursdays=k,t.timeTuesday=m,t.timeTuesdays=T,t.timeWednesday=y,t.timeWednesdays=M,t.timeWeek=g,t.timeWeeks=w,t.timeYear=L,t.timeYears=D,t.utcDay=N,t.utcDays=z,t.utcFriday=G,t.utcFridays=K,t.utcHour=P,t.utcHours=F,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=R,t.utcMinutes=I,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=q,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=Y,t.utcThursdays=Q,t.utcTuesday=H,t.utcTuesdays=Z,t.utcWednesday=V,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],93:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{dup:92}],94:[function(t,e,r){e.exports=function(){for(var t=0;ts*l){var d=(h-f)/s;i[c]=1e3*d}}return i}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),a=t[0];a>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:58}],97:[function(t,e,r){var n=t("abs-svg-path"),a=t("normalize-svg-path"),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),a(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":17,"normalize-svg-path":263}],98:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],99:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=u=t[1];for(var x=r;xl&&(l=c),d>u&&(u=d);p=0!==(p=Math.max(l-n,u-s))?1/p:0}return o(y,b,r,n,s,p),b}function a(t,e,r,n,a){var i,o;if(a===S(t,e,r,n)>0)for(i=e;i=e;i-=n)o=M(i,t[i],t[i+1],o);return o&&b(o,o.next)&&(k(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!b(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(k(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,a,f,h){if(t){!h&&f&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=p(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,f);for(var d,g,v=t;t.prev!==t.next;)if(d=t.prev,g=t.next,f?l(t,n,a,f):s(t))e.push(d.i/r),e.push(t.i/r),e.push(g.i/r),k(t),t=g.next,v=g.next;else if((t=g)===v){h?1===h?o(t=u(i(t),e,r),e,r,n,a,f,2):2===h&&c(t,e,r,n,a,f):o(i(t),e,r,n,a,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function l(t,e,r,n){var a=t.prev,i=t,o=t.next;if(y(a,i,o)>=0)return!1;for(var s=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(s,l,e,r,n),h=p(u,c,e,r,n),d=t.prevZ,g=t.nextZ;d&&d.z>=f&&g&&g.z<=h;){if(d!==t.prev&&d!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,g!==t.prev&&g!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;g&&g.z<=h;){if(g!==t.prev&&g!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!b(a,o)&&x(a,n,n.next,o)&&A(a,o)&&A(o,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(o.i/r),k(n),k(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,a,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var c=T(l,u);return l=i(l,l.next),c=i(c,c.next),o(l,e,r,n,a,s),void o(c,e,r,n,a,s)}u=u.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&a!==n.x&&v(ir.x||n.x===r.x&&d(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=T(e,t);i(e,e.next),i(r,r.next)}}function d(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(A(t,e)&&A(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||b(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var a=w(y(t,e,r)),i=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return a!==i&&o!==s||(!(0!==a||!_(t,r,e))||(!(0!==i||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function A(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new E(t.i,t.x,t.y),n=new E(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function M(t,e,r,n){var a=new E(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function k(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 E(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 S(t,e,r,n){for(var a=0,i=e,o=r-n;i0&&(n+=t[a-1].length,r.holes.push(n))}return r}},{}],101:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var a=0;a=55296&&y<=56319&&(w+=t[++r]),w=A?h.call(A,T,w,g):w,e?(d.value=w,p(v,g,d)):v[g]=w,++g;m=g}if(void 0===m)for(m=o(t.length),e&&(v=new e(m)),r=0;r0?1:-1}},{}],112:[function(t,e,r){"use strict";var n=t("../math/sign"),a=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*i(a(t)):t}},{"../math/sign":109}],113:[function(t,e,r){"use strict";var n=t("./to-integer"),a=Math.max;e.exports=function(t){return a(0,n(t))}},{"./to-integer":112}],114:[function(t,e,r){"use strict";var n=t("./valid-callable"),a=t("./valid-value"),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,u){var c,f=arguments[2],h=arguments[3];return r=Object(a(r)),n(u),c=s(r),h&&c.sort("function"==typeof h?i.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),o.call(t,c,(function(t,n){return l.call(r,t)?o.call(u,f,r[t],t,r,n):e}))}}},{"./valid-callable":131,"./valid-value":133}],115:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":116,"./shim":117}],116:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],117:[function(t,e,r){"use strict";var n=t("../keys"),a=t("../valid-value"),i=Math.max;e.exports=function(t,e){var r,o,s,l=i(arguments.length,2);for(t=Object(a(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],137:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===a)||!1}},{}],138:[function(t,e,r){"use strict";var n=Object.create(null),a=Math.random;e.exports=function(){var t;do{t=a().toString(36).slice(2)}while(n[t]);return t}},{}],139:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),u=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",u(this,"__kind__",o("",e))},a&&a(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":142,d:89,"es5-ext/object/set-prototype-of":128,"es5-ext/string/#/contains":134,"es6-symbol":146}],140:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/valid-callable"),i=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var r,c,f,h,d,p,g,v,m=arguments[2];if(s(t)||n(t)?r="array":i(t)?r="string":t=o(t),a(e),f=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(l.call(e,m,c.value,f),h)return;c=t.next()}else for(p=t.length,d=0;d=55296&&v<=56319&&(g+=t[++d]),l.call(e,m,g,f),!h);++d);else u.call(t,(function(t){return l.call(e,m,t,f),h}))}},{"./get":141,"es5-ext/function/is-arguments":106,"es5-ext/object/valid-callable":131,"es5-ext/string/is-string":137}],141:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/string/is-string"),i=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new i(t):a(t)?new o(t):new i(t)}},{"./array":139,"./string":144,"./valid-iterable":145,"es5-ext/function/is-arguments":106,"es5-ext/string/is-string":137,"es6-symbol":146}],142:[function(t,e,r){"use strict";var n,a=t("es5-ext/array/#/clear"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),u=t("d/auto-bind"),c=t("es6-symbol"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,i({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,c.iterator,l((function(){return this})))},{d:89,"d/auto-bind":88,"es5-ext/array/#/clear":102,"es5-ext/object/assign":115,"es5-ext/object/valid-callable":131,"es5-ext/object/valid-value":133,"es6-symbol":146}],143:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/is-value"),i=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!a(t)&&(!!s(t)||(!!i(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":106,"es5-ext/object/is-value":122,"es5-ext/string/is-string":137,"es6-symbol":146}],144:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",i("",t.length))},a&&a(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,i("c","String Iterator"))},{"./":142,d:89,"es5-ext/object/set-prototype-of":128,"es6-symbol":146}],145:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":143}],146:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":147,"./polyfill":152,"ext/global-this":159}],147:[function(t,e,r){"use strict";var n=t("ext/global-this"),a={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!a[typeof e.iterator]&&(!!a[typeof e.toPrimitive]&&!!a[typeof e.toStringTag])}},{"ext/global-this":159}],148:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],149:[function(t,e,r){"use strict";var n=t("d"),a=Object.create,i=Object.defineProperty,o=Object.prototype,s=a(null);e.exports=function(t){for(var e,r,a=0;s[t+(a||"")];)++a;return s[t+=a||""]=!0,i(o,e="@@"+t,n.gs(null,(function(t){r||(r=!0,i(this,e,n(t)),r=!1)}))),e}},{d:89}],150:[function(t,e,r){"use strict";var n=t("d"),a=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",a&&a.hasInstance||t("hasInstance")),isConcatSpreadable:n("",a&&a.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",a&&a.iterator||t("iterator")),match:n("",a&&a.match||t("match")),replace:n("",a&&a.replace||t("replace")),search:n("",a&&a.search||t("search")),species:n("",a&&a.species||t("species")),split:n("",a&&a.split||t("split")),toPrimitive:n("",a&&a.toPrimitive||t("toPrimitive")),toStringTag:n("",a&&a.toStringTag||t("toStringTag")),unscopables:n("",a&&a.unscopables||t("unscopables"))})}},{d:89,"ext/global-this":159}],151:[function(t,e,r){"use strict";var n=t("d"),a=t("../../../validate-symbol"),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in a(t),i)if(i[e]===t)return e}))})}},{"../../../validate-symbol":153,d:89}],152:[function(t,e,r){"use strict";var n,a,i,o=t("d"),s=t("./validate-symbol"),l=t("ext/global-this").Symbol,u=t("./lib/private/generate-name"),c=t("./lib/private/setup/standard-symbols"),f=t("./lib/private/setup/symbol-registry"),h=Object.create,d=Object.defineProperties,p=Object.defineProperty;if("function"==typeof l)try{String(l()),i=!0}catch(t){}else l=null;a=function(t){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?l(e):(r=h(a.prototype),e=void 0===e?"":String(e),d(r,{__description__:o("",e),__name__:o("",u(e))}))},c(n),f(n),d(a.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),d(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),p(n.prototype,n.toPrimitive,o("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),p(n.prototype,n.toStringTag,o("c","Symbol")),p(a.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),p(a.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":149,"./lib/private/setup/standard-symbols":150,"./lib/private/setup/symbol-registry":151,"./validate-symbol":153,d:89,"ext/global-this":159}],153:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":148}],154:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":155,"./polyfill":157}],155:[function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},{}],156:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],157:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/is-value"),i=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),u=t("d"),c=t("es6-iterator/get"),f=t("es6-iterator/for-of"),h=t("es6-symbol").toStringTag,d=t("./is-native-implemented"),p=Array.isArray,g=Object.defineProperty,v=Object.prototype.hasOwnProperty,m=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=d&&i&&WeakMap!==n?i(new WeakMap,m(this)):this,a(e)&&(p(e)||(e=c(e))),g(t,"__weakMapData__",u("c","$weakMap$"+l())),e?(f(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},d&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u((function(t){return!!v.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:u((function(t){if(v.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:u((function(t){return v.call(o(t),this.__weakMapData__)})),set:u((function(t,e){return g(o(t),this.__weakMapData__,u("c",e)),this})),toString:u((function(){return"[object WeakMap]"}))}),g(n.prototype,h,u("c","WeakMap"))},{"./is-native-implemented":156,d:89,"es5-ext/object/is-value":122,"es5-ext/object/set-prototype-of":128,"es5-ext/object/valid-object":132,"es5-ext/object/valid-value":133,"es5-ext/string/random-uniq":138,"es6-iterator/for-of":140,"es6-iterator/get":141,"es6-symbol":146}],158:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],159:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":158,"./is-implemented":160}],160:[function(t,e,r){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],161:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":251}],162:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var a,i,o,s,l=t[0].length,u=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(u+r));var c=e.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(a=0,o=r;ae[0]-o[0]/2&&(h=o[0]/2,d+=o[1]);return r}},{"css-font/stringify":82}],164:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",u=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return a(n.cache[r],u);var c=e.canvas||n.canvas,f=c.getContext("2d"),h={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},d=Math.ceil(1.5*s);c.height=d,c.width=.5*d,f.font=t;var p={top:0};f.clearRect(0,0,d,d),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var g=i(f.getImageData(0,0,d,d));f.clearRect(0,0,d,d),f.textBaseline="bottom",f.fillText("H",0,d);var v=i(f.getImageData(0,0,d,d));p.lineHeight=p.bottom=d-v+g,f.clearRect(0,0,d,d),f.textBaseline="alphabetic",f.fillText("H",0,d);var m=d-i(f.getImageData(0,0,d,d))-1+g;p.baseline=p.alphabetic=m,f.clearRect(0,0,d,d),f.textBaseline="middle",f.fillText("H",0,.5*d);var y=i(f.getImageData(0,0,d,d));p.median=p.middle=d-y-1+g-.5*d,f.clearRect(0,0,d,d),f.textBaseline="hanging",f.fillText("H",0,.5*d);var b=i(f.getImageData(0,0,d,d));p.hanging=d-b-1+g-.5*d,f.clearRect(0,0,d,d),f.textBaseline="ideographic",f.fillText("H",0,d);var x=i(f.getImageData(0,0,d,d));if(p.ideographic=d-x-1+g,h.upper&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.upper,0,0),p.upper=i(f.getImageData(0,0,d,d)),p.capHeight=p.baseline-p.upper),h.lower&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.lower,0,0),p.lower=i(f.getImageData(0,0,d,d)),p.xHeight=p.baseline-p.lower),h.tittle&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.tittle,0,0),p.tittle=i(f.getImageData(0,0,d,d))),h.ascent&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.ascent,0,0),p.ascent=i(f.getImageData(0,0,d,d))),h.descent&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.descent,0,0),p.descent=o(f.getImageData(0,0,d,d))),h.overshoot){f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.overshoot,0,0);var _=o(f.getImageData(0,0,d,d));p.overshoot=_-m}for(var w in p)p[w]/=s;return p.em=s,n.cache[r]=p,a(p,u)}function a(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],165:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(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}var l=s.prototype;function u(t,e){var r;if(e.left&&(r=u(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?u(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left)if(a=c(t,e,r,n.left))return a;if(a=r(n.key,n.value))return a}if(n.right)return c(t,e,r,n.right)}function f(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=f(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return f(t,e,r,n,a.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){a=l[f];u[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];a=l[f];if(1===h._color||1===a._color)break;var d=l[f-2];if(d.left===h)if(h.left===a){if(!(p=d.right)||0!==p._color){if(d._color=0,d.left=h.right,h._color=1,h.right=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).left===d?g.left=h:g.right=h;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else{if(!(p=d.right)||0!==p._color){if(h.right=a.left,d._color=0,d.left=a.right,a._color=1,a.left=h,a.right=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).left===d?g.left=a:g.right=a;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else if(h.right===a){if(!(p=d.left)||0!==p._color){if(d._color=0,d.right=h.left,h._color=1,h.left=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).right===d?g.right=h:g.left=h;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}else{var p;if(!(p=d.left)||0!==p._color){var g;if(h.left=a.right,d._color=0,d.right=a.left,a._color=1,a.right=h,a.left=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).right===d?g.right=a:g.left=a;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return u(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.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.right._count)break;e=e.right}return new h(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new h(this,n);r=a<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 d=h.prototype;function p(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 g(t,e){return te?1:0}Object.defineProperty(d,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(d,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),d.clone=function(){return new h(this.tree,this._stack.slice())},d.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var u=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var c=e[u-1];e.push(new n(r._color,c.key,c.value,r.left,r.right,r._count)),e[u-1].key=r.key,e[u-1].value=r.value;for(l=e.length-2;l>=u;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[u-1].left=e[u]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(u=t[l-2]).left===r?u.left=n:u.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).left===r?u.left=s:u.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),t[l-1]=n,t[l]=r,l+11)(u=t[l-2]).right===r?u.right=n:u.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).right===r?u.right=s:u.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var u;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(d,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(d,"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}),d.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(d,"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}}),d.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),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},d.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(d,"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}})},{}],166:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function i(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+607/128+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}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(i(e));e-=1;for(var r=n[0],a=1;a<9;a++)r+=n[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=i},{}],167:[function(t,e,r){e.exports=function(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,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;or)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function c(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:261,"ndarray-ops":260,"typedarray-pool":340}],169:[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"}},{}],170:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":169}],171:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;ic||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,g,v,u)};var a,i,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function p(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=d(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=d(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,a,i,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(m=0;ma||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=u(n),o=0;o>8*d&255;this.pickOffset=r,a.bind();var p=a.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var g=a.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,a=this.shape[0]*this.shape[1];if(r=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),o=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var u,c,f,d,p=t.colorLevels||[0],g=t.colorValues||[0,0,0,1],v=p.length,m=this.bounds;l?(u=m[0]=r[0],c=m[1]=o[0],f=m[2]=r[r.length-1],d=m[3]=o[o.length-1]):(u=m[0]=r[0]+(r[1]-r[0])/2,c=m[1]=o[0]+(o[1]-o[0])/2,f=m[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,d=m[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-u),b=1/(d-c),x=e[0],_=e[1];this.shape=[x,_];var w=(l?(x-1)*(_-1):x*_)*(h.length>>>1);this.numVertices=w;for(var A=i.mallocUint8(4*w),T=i.mallocFloat32(2*w),M=i.mallocUint8(2*w),k=i.mallocUint32(w),E=0,S=l?x-1:x,C=l?_-1:_,O=0;Oa[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=v[t],r.uniforms.angle=m[t],i.drawArrays(i.TRIANGLES,a[T],a[M]-a[T]))),y[t]&&A&&(c[1^t]-=k*d*b[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=x[t],r.uniforms.angle=_[t],i.drawArrays(i.TRIANGLES,w,A)),c[1^t]=k*s[2+(1^t)]-1,p[t+2]&&(c[1^t]+=k*d*g[t+2],Ta[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=v[t+2],r.uniforms.angle=m[t+2],i.drawArrays(i.TRIANGLES,a[T],a[M]-a[T]))),y[t+2]&&A&&(c[1^t]+=k*d*b[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=x[t+2],r.uniforms.angle=_[t+2],i.drawArrays(i.TRIANGLES,w,A))}),g.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=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-i[c])/(i[2+c]-i[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),g.bind=(h=[0,0],d=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,a=t.screenBox,i=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,u=.5*(n[o+2]+n[o]),c=n[o+2]-n[o],f=i[o],g=i[o+2]-f,v=a[o],m=a[o+2]-v;d[o]=2*l/c*g/m,h[o]=2*(s-u)/c*g/m}p[1]=2*t.pixelRatio/(a[3]-a[1]),p[0]=p[1]*(a[3]-a[1])/(a[2]-a[0]),e.uniforms.dataScale=d,e.uniforms.dataShift=h,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,a,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var g=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(g,e[1],g,e[3],d[p],h[p]):o.drawLine(e[0],g,e[2],g,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.removeObject=function(t){for(var e=this.objects,r=0;r 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=n(["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=n(["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"])},{glslify:237}],213:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=a,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}e.exports=function(t,e){var r=t.gl,i=a(r),l=a(r),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(t,i,l,u,c);return f.update(e),t.addObject(f),f};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,a=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=a?s:i.mallocFloat32(s.length),u=o?t.idToIndex:i.mallocInt32(n);if(a||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&i<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,a),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/i,l[4]=2/o,l[6]=-2*a[0]/i-1,l[7]=-2*a[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":212,"gl-buffer":168,"gl-shader":218,"typedarray-pool":340}],214:[function(t,e,r){"use strict";var n=t("glslify");r.boxVertex=n(["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=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},{glslify:215}],215:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{dup:210}],216:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("./lib/shaders");function o(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}e.exports=function(t,e){var r=t.gl,s=a(r,[0,0,0,1,1,0,1,1]),l=n(r,i.boxVertex,i.boxFragment),u=new o(t,s,l);return u.update(e),t.addOverlay(u),u};var s=o.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,f=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],h=(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(f=Math.max(f,u[0]),h=Math.max(h,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d0){var m=r*c;o.drawBox(f-m,h-m,d+m,h+m,i),o.drawBox(f-m,p-m,d+m,p+m,i),o.drawBox(f-m,h-m,f+m,p+m,i),o.drawBox(d-m,h-m,d+m,p+m,i)}}}},s.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()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":214,"gl-buffer":168,"gl-shader":218}],217:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],i=e[1],o=n(t,r,i,{}),s=a.mallocUint8(r*i*4);return new l(t,o,s)};var n=t("gl-fbo"),a=t("typedarray-pool"),i=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function l(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)}}var u=l.prototype;Object.defineProperty(u,"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){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;ir)for(t=r;te)for(t=e;t=0){for(var A=0|w.type.charAt(w.type.length-1),T=new Array(A),M=0;M=0;)k+=1;_[y]=k}var E=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,d[0],a,p,i,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d,a,p,i,f)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;function o(t,e,r,n,i,o,s){for(var l=["gl","v"],u=[],c=0;c4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new a("","Unknown uniform data type for "+name+": "+r)}if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","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 a("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],a=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var a in r){var i=r[a],o=e;parseInt(a)+""===a?o+="["+a+"]":o+="."+a,"object"==typeof i?n.push.apply(n,t(o,i)):n.push([o,i])}return n}("",e),i=0;i4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var d}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l1)for(var l=0;l halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},A.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=a(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),A.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=A.baseFontSize+"px sans-serif");var r,i=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(A.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var a=n.stringify({size:A.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=d(t.size),l=Math.round(s[0]*p(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&a==e.font[r].baseString||(i=!0,e.font[r]=A.fonts[a],e.font[r]))){var u=t.family.join(", "),c=[t.style];t.style!=t.variant&&c.push(t.variant),t.variant!=t.weight&&c.push(t.weight),_&&t.weight!=t.stretch&&c.push(t.stretch),e.font[r]={baseString:a,family:u,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:m(u,{origin:"top",fontSize:A.baseFontSize,fontStyle:c.join(" ")})},A.fonts[a]=e.font[r]}})),(i||o)&&this.font.forEach((function(r,a){var i=n.stringify({size:e.fontSize[a],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[a]=e.shader.atlas[i],!e.fontAtlas[a]){var o=r.metrics;e.shader.atlas[i]=e.fontAtlas[a]={fontString:i,step:2*Math.ceil(e.fontSize[a]*o.bottom*.5),em:e.fontSize[a],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h2){for(var w=!t.position[0].length,T=c.mallocFloat(2*this.count),M=0,k=0;M1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,a=0;return a+=.5*n.bottom,a+="number"==typeof t?t-n.baseline:-n[t],A.normalViewport||(a*=-1),a}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var Y;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;Y=c.mallocUint8(G);for(var q=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var Q=0;Q1?this.counts[Q]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Q]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*Q,4*Q+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Q]:this.opacity,baseline:null!=this.baselineOffset[Q]?this.baselineOffset[Q]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[Q]?this.alignOffset[Q]:this.alignOffset[0]:0,atlas:this.fontAtlas[Q]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*Q,2*Q+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},A.prototype.destroy=function(){},A.prototype.kerning=!0,A.prototype.position={constant:new Float32Array(2)},A.prototype.translate=null,A.prototype.scale=null,A.prototype.font=null,A.prototype.text="",A.prototype.positionOffset=[0,0],A.prototype.opacity=1,A.prototype.color=new Uint8Array([0,0,0,255]),A.prototype.alignOffset=[0,0],A.normalViewport=!1,A.maxAtlasSize=1024,A.atlasCanvas=document.createElement("canvas"),A.atlasContext=A.atlasCanvas.getContext("2d",{alpha:!1}),A.baseFontSize=64,A.fonts={},e.exports=A},{"bit-twiddle":46,"color-normalize":69,"css-font":79,"detect-kerning":95,"es6-weak-map":154,"flatten-vertex-data":162,"font-atlas":163,"font-measure":164,"gl-util/context":228,"is-plain-obj":250,"object-assign":264,"parse-rect":267,"parse-unit":269,"pick-by-alias":273,regl:297,"to-px":325,"typedarray-pool":340}],227:[function(t,e,r){"use strict";var n=t("ndarray"),a=t("ndarray-ops"),i=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||u(t);if("number"==typeof arguments[1])return m(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return m(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=c(e)?e:e.raw;if(r)return y(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return b(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function c(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}var f=function(t,e){a.muls(t,e,255)};function h(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)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 d(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,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}var p=d.prototype;function g(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 v(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 m(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new d(t,o,e,r,n,a)}function y(t,e,r,n,a,i){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new d(t,o,r,n,a,i)}function b(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var c,h,p=0;if(2===o.length)p=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=t.ALPHA;else if(2===o[2])p=t.LUMINANCE_ALPHA;else if(3===o[2])p=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)c=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];h=i.malloc(m,r);var b=n(h,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?a.assign(b,e):f(b,e),c=h.subarray(0,m)}var x=v(t);return t.texImage2D(t.TEXTURE_2D,0,p,o[0],o[1],0,p,u,c),l||i.free(h),new d(t,x,o[0],o[1],p,u)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.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},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.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)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,c){var h=c.dtype,d=c.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,v=0,m=g(d,c.stride.slice());"float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,m=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,m=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],c=n(c.data,d,[c.stride[0],c.stride[1],1],c.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=c.size,b=u.indexOf(o)<0;b&&u.push(o);if(p===l&&m)0===c.offset&&c.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data.subarray(c.offset,c.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data.subarray(c.offset,c.offset+y));else{var x;x=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,c):a.assign(_,c),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:261,"ndarray-ops":260,"typedarray-pool":340}],228:[function(t,e,r){(function(r){(function(){"use strict";var n=t("pick-by-alias");function a(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},i(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),a(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),a(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":273}],229:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return M(r),m+=r.length,(d=d.slice(r.length)).length}}function D(){return/[^a-fA-F0-9]/.test(e)?(M(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function R(){return"."===e||/[eE]/.test(e)?(d.push(e),h=5,r=e,c+1):"x"===e&&1===d.length&&"0"===d[0]?(h=11,d.push(e),r=e,c+1):/[^\d]/.test(e)?(M(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function I(){return"f"===e&&(d.push(e),r=e,c+=1),/[eE]/.test(e)?(d.push(e),r=e,c+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(M(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function P(){if(/[^\d\w_]/.test(e)){var t=d.join("");return h=T[t]?8:A[t]?7:6,M(d.join("")),h=999,c}return d.push(e),r=e,c+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":232,"./lib/builtins-300es":231,"./lib/literals":234,"./lib/literals-300es":233,"./lib/operators":235}],231:[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":232}],232:[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"]},{}],233:[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","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":234}],234:[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","uint","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"]},{}],235:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],236:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return a=(a=a.concat(r(t))).concat(r(null))}},{"./index":230}],237:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{dup:210}],238:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":245}],239:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":245}],240:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,f=r?a-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),i-=u}return(d?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=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+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,a),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+d]=255&s,d+=p,s/=256,a-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],241:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new m(null);return new m(v(t))};var i=a.prototype;function o(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 s(t,e){var r=v(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function h(t,e){for(var r=0;r>1],i=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=v([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=v([t]);else{var r=n.ge(this.leftPoints,t,p),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,p);ithis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},i.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=m.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":242}],242:[function(t,e,r){"use strict";function n(t,e,r,n,a,i){var o=["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",a?".get(m)":"[m]"];return i?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("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],!1,a),n("B","x"+t+"y",e,["y"],!0,a),n("P","c(x,y)"+t+"0",e,["y","c"],!1,a),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,a),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],243:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(a)return n?-1:P(t).length;e=(""+e).toLowerCase(),a=!0}}function h(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;ha&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:u>223?3:u>191?2:1;if(a+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(z(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function D(t,e,r,a,i){return e=+e,r>>>=0,i||O(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function F(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":28,buffer:58,ieee754:236}],59:[function(t,e,r){"use strict";var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),d=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(c||f!==h||d){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var d=r.pop(),p=(s=r.pop(),c=-1,f=-1,l=o[s],1);p=0||(e.flip(s,d),a(t,e,r,c,s,f),a(t,e,r,s,f,c),a(t,e,r,f,d,c),a(t,e,r,d,c,f)))}}},{"binary-search-bounds":45,"robust-in-sphere":290}],61:[function(t,e,r){"use strict";var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-a){u[d]=a;c[d];for(var p=0;p<3;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=a))}}}var v=l;l=s,s=v,l.length=0,a=-a}var m=function(t,e,r){for(var n=0,a=0;a1&&a(r[h[d-2]],r[h[d-1]],i)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=f.upperIds;for(d=p.length;d>1&&a(r[p[d-2]],r[p[d-1]],i)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function c(t,e){var r;return(r=t.a[0]p[0]&&a.push(new o(p,d,2,l),new o(d,p,1,l))}a.sort(s);for(var g=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),v=[new i([g,1],[g,0],-1,[],[],[],[])],m=[],y=(l=0,a.length);l=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;nr?r:t:te?e:t}},{}],65:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;ie[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--i){var b=e[c=(E=n[i])[0]],x=b[0],_=b[1],w=t[x],A=t[_];if((w[0]-A[0]||w[1]-A[1])<0){var T=x;x=_,_=T}b[0]=x;var k,M=b[1]=E[1];for(a&&(k=b[2]);i>0&&n[i-1][0]===c;){var E,S=(E=n[--i])[1];a?e.push([M,S,k]):e.push([M,S]),M=S}a?e.push([M,_,k]):e.push([M,_])}return h}(t,e,h,v,r));return m(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":66,"big-rat":32,"big-rat/cmp":30,"big-rat/to-float":44,"box-intersect":49,nextafter:256,"rat-vec":281,"robust-segment-intersect":294,"union-find":330}],66:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),f=s(n,r),h=c(i,f);if(0===o(h))return null;var d=s(t,r),p=c(f,d),g=a(p,h),v=u(i,g);return l(t,v)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":31,"big-rat/mul":41,"big-rat/sign":42,"big-rat/sub":43,"rat-vec/add":280,"rat-vec/muls":282,"rat-vec/sub":283}],67:[function(t,e,r){"use strict";var n=t("clamp");function a(t,e){null==e&&(e=!0);var r=t[0],a=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,a*=255,i*=255,o*=255),16777216*(r=255&n(r,0,255))+((a=255&n(a,0,255))<<16)+((i=255&n(i,0,255))<<8)+(o=255&n(o,0,255))}e.exports=a,e.exports.to=a,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,a=(65280&t)>>>8,i=255&t;return!1===e?[r,n,a,i]:[r/255,n/255,a/255,i/255]}},{clamp:64}],68:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],69:[function(t,e,r){"use strict";var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:64,"color-rgba":71,dtype:95}],70:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=(d=t.slice(1)).length;u=1,c<=4?(l=[parseInt(d[0]+d[0],16),parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16)],4===c&&(u=parseInt(d[3]+d[3],16)/255)):(l=[parseInt(d[0]+d[1],16),parseInt(d[2]+d[3],16),parseInt(d[4]+d[5],16)],8===c&&(u=parseInt(d[6]+d[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f,d=f.replace(/a$/,"");s=d;c="cmyk"===d?4:"gray"===d?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===d?255*parseFloat(t)/100:parseFloat(t);if("h"===d[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===d&&l.push(1),u=h||void 0===l[c]?1:l[c],l=l.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var p=i(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),u=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":68,defined:91,"is-plain-obj":244}],71:[function(t,e,r){"use strict";var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:64,"color-parse":70,"color-space/hsl":72}],72:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[u]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":73}],73:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],74:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){var o=n(e,r,i);if(0===o){var s=a(n(t,e,r)),u=a(n(t,e,i));if(s===u){if(0===s){var c=l(t,e,r),f=l(t,e,i);return c===f?0:c?1:-1}return 0}return 0===u?s>0||l(t,e,i)?-1:1:0===s?u>0||l(t,e,r)?1:-1:a(u-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,i)>0?1:-1:h<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),u=i(r[1],-e[1]),c=s(o(n,l),o(a,u));return c[c.length-1]>=0}},{"robust-orientation":291,"robust-product":292,"robust-sum":296,signum:297,"two-sum":317}],75:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],76:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],77:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],78:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],79:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":81,"./stringify":82}],80:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":75}],81:[function(t,e,r){"use strict";var n=t("unquote"),a=t("css-global-keywords"),i=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),u=t("string-split-by"),c=t("./lib/util").isSize;e.exports=h;var f=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=u(t,/\s+/);e=h.shift();){if(-1!==a.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(c(e)){var p=u(e,"/");if(r.size=p[0],null!=p[1]?r.lineHeight=d(p[1]):"/"===h[0]&&(h.shift(),r.lineHeight=d(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=u(h.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function d(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":80,"css-font-stretch-keywords":76,"css-font-style-keywords":77,"css-font-weight-keywords":78,"css-global-keywords":83,"css-system-font-keywords":84,"string-split-by":305,unquote:332}],82:[function(t,e,r){"use strict";var n=t("pick-by-alias"),a=t("./lib/util").isSize,i=g(t("css-global-keywords")),o=g(t("css-system-font-keywords")),s=g(t("css-font-weight-keywords")),l=g(t("css-font-style-keywords")),u=g(t("css-font-stretch-keywords")),c={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",d="serif";function p(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?u:(e=f.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",d=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",v=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,u=t.symbol,f=t.zero,y=t.width,b=t.comma,x=t.precision,_=t.trim,w=t.type;"n"===w?(b=!0,w="g"):l[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var A="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===u?c:/[%p]/.test(w)?g:"",k=l[w],M=/[defgprs%]/.test(w);function E(t){var i,s,l,u=A,c=T;if("c"===w)c=k(t)+c,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:k(Math.abs(t),x),_&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==a&&(g=!1),u=(g?"("===a?a:v:"-"===a||"("===a?"":a)+u,c=("s"===w?h[8+n/3]:"")+c+(g&&"("===a?")":""),M)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){c=(46===l?d+t.slice(i+1):t.slice(i))+c,t=t.slice(0,i);break}}b&&!f&&(t=o(t,1/0));var E=u.length+t.length+c.length,S=E>1)+u+t+c+S.slice(E);break;default:t=S+u+t+c}return p(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),E.toString=function(){return t+""},E}return{format:y,formatPrefix:function(t,e){var n=y(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=h[8+a/3];return function(t){return n(o*t)+s}}}}function p(e){return c=d(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}p({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=p,t.formatLocale=d,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],88:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,f=t.shortDays,h=t.months,yt=t.shortMonths,bt=d(u),xt=p(u),_t=d(c),wt=p(c),At=d(f),Tt=p(f),kt=d(h),Mt=p(h),Et=d(yt),St=p(yt),Ct={a:function(t){return f[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:P,e:P,f:j,H:F,I:N,j:z,L:B,m:U,M:H,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:V,u:Y,U:G,V:q,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:Q,"%":gt},Ot={a:function(t){return f[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:$,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:st,U:lt,V:ut,w:ct,W:ft,x:null,X:null,y:ht,Y:dt,Z:pt,"%":gt},Lt={a:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.w=Tt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Et.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=kt.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return It(t,i,e,r)},d:k,e:k,f:L,H:E,I:E,j:M,L:O,m:T,M:S,p:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:A,Q:R,s:I,S:C,u:v,U:m,V:y,w:g,W:b,x:function(t,e,r){return It(t,o,e,r)},X:function(t,e,r){return It(t,l,e,r)},y:_,Y:x,Z:w,"%":D};function Dt(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function It(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Lt[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ct.x=Dt(o,Ct),Ct.X=Dt(l,Ct),Ct.c=Dt(i,Ct),Ot.x=Dt(o,Ot),Ot.X=Dt(l,Ot),Ot.c=Dt(i,Ot),{format:function(t){var e=Dt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=Rt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Dt(t+="",Ot);return e.toString=function(){return t},e},utcParse:function(t){var e=Rt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function D(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function R(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function P(t,e){return f(t.getDate(),e,2)}function F(t,e){return f(t.getHours(),e,2)}function N(t,e){return f(t.getHours()%12||12,e,2)}function z(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return B(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function H(t,e){return f(t.getMinutes(),e,2)}function V(t,e){return f(t.getSeconds(),e,2)}function Y(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function q(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function Q(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function K(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function dt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function pt(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=bt,t.isoParse=xt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":89}],89:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),d=h.range;function p(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=p(0),v=p(1),m=p(2),y=p(3),b=p(4),x=p(5),_=p(6),w=g.range,A=v.range,T=m.range,k=y.range,M=b.range,E=x.range,S=_.range,C=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=C.range,L=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));L.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var D=L.range,R=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),I=R.range,P=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),F=P.range,N=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),z=N.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=B(0),U=B(1),H=B(2),V=B(3),Y=B(4),G=B(5),q=B(6),W=j.range,X=U.range,Z=H.range,J=V.range,Q=Y.range,K=G.range,$=q.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=d,t.timeFriday=x,t.timeFridays=E,t.timeHour=c,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=v,t.timeMondays=A,t.timeMonth=C,t.timeMonths=O,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=b,t.timeThursdays=M,t.timeTuesday=m,t.timeTuesdays=T,t.timeWednesday=y,t.timeWednesdays=k,t.timeWeek=g,t.timeWeeks=w,t.timeYear=L,t.timeYears=D,t.utcDay=N,t.utcDays=z,t.utcFriday=G,t.utcFridays=K,t.utcHour=P,t.utcHours=F,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=R,t.utcMinutes=I,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=q,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=Y,t.utcThursdays=Q,t.utcTuesday=H,t.utcTuesdays=Z,t.utcWednesday=V,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],90:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{dup:89}],91:[function(t,e,r){e.exports=function(){for(var t=0;ts*l){var d=(h-f)/s;i[c]=1e3*d}}return i}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),a=t[0];a>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:58}],94:[function(t,e,r){var n=t("abs-svg-path"),a=t("normalize-svg-path"),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),a(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":17,"normalize-svg-path":257}],95:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],96:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=u=t[1];for(var x=r;xl&&(l=c),d>u&&(u=d);p=0!==(p=Math.max(l-n,u-s))?1/p:0}return o(y,b,r,n,s,p),b}function a(t,e,r,n,a){var i,o;if(a===S(t,e,r,n)>0)for(i=e;i=e;i-=n)o=k(i,t[i],t[i+1],o);return o&&b(o,o.next)&&(M(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!b(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,a,f,h){if(t){!h&&f&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=p(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,f);for(var d,g,v=t;t.prev!==t.next;)if(d=t.prev,g=t.next,f?l(t,n,a,f):s(t))e.push(d.i/r),e.push(t.i/r),e.push(g.i/r),M(t),t=g.next,v=g.next;else if((t=g)===v){h?1===h?o(t=u(i(t),e,r),e,r,n,a,f,2):2===h&&c(t,e,r,n,a,f):o(i(t),e,r,n,a,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function l(t,e,r,n){var a=t.prev,i=t,o=t.next;if(y(a,i,o)>=0)return!1;for(var s=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(s,l,e,r,n),h=p(u,c,e,r,n),d=t.prevZ,g=t.nextZ;d&&d.z>=f&&g&&g.z<=h;){if(d!==t.prev&&d!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,g!==t.prev&&g!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;g&&g.z<=h;){if(g!==t.prev&&g!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!b(a,o)&&x(a,n,n.next,o)&&A(a,o)&&A(o,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(o.i/r),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,a,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var c=T(l,u);return l=i(l,l.next),c=i(c,c.next),o(l,e,r,n,a,s),void o(c,e,r,n,a,s)}u=u.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&a!==n.x&&v(ir.x||n.x===r.x&&d(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=T(e,t);i(e,e.next),i(r,r.next)}}function d(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(A(t,e)&&A(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||b(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var a=w(y(t,e,r)),i=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return a!==i&&o!==s||(!(0!==a||!_(t,r,e))||(!(0!==i||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function A(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new E(t.i,t.x,t.y),n=new E(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function k(t,e,r,n){var a=new E(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function M(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 E(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 S(t,e,r,n){for(var a=0,i=e,o=r-n;i0&&(n+=t[a-1].length,r.holes.push(n))}return r}},{}],98:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var a=0;a=55296&&y<=56319&&(w+=t[++r]),w=A?h.call(A,T,w,g):w,e?(d.value=w,p(v,g,d)):v[g]=w,++g;m=g}if(void 0===m)for(m=o(t.length),e&&(v=new e(m)),r=0;r0?1:-1}},{}],109:[function(t,e,r){"use strict";var n=t("../math/sign"),a=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*i(a(t)):t}},{"../math/sign":106}],110:[function(t,e,r){"use strict";var n=t("./to-integer"),a=Math.max;e.exports=function(t){return a(0,n(t))}},{"./to-integer":109}],111:[function(t,e,r){"use strict";var n=t("./valid-callable"),a=t("./valid-value"),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,u){var c,f=arguments[2],h=arguments[3];return r=Object(a(r)),n(u),c=s(r),h&&c.sort("function"==typeof h?i.call(h,r):void 0),"function"!=typeof t&&(t=c[t]),o.call(t,c,(function(t,n){return l.call(r,t)?o.call(u,f,r[t],t,r,n):e}))}}},{"./valid-callable":128,"./valid-value":130}],112:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":113,"./shim":114}],113:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],114:[function(t,e,r){"use strict";var n=t("../keys"),a=t("../valid-value"),i=Math.max;e.exports=function(t,e){var r,o,s,l=i(arguments.length,2);for(t=Object(a(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],134:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===a)||!1}},{}],135:[function(t,e,r){"use strict";var n=Object.create(null),a=Math.random;e.exports=function(){var t;do{t=a().toString(36).slice(2)}while(n[t]);return t}},{}],136:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),u=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",u(this,"__kind__",o("",e))},a&&a(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":139,d:86,"es5-ext/object/set-prototype-of":125,"es5-ext/string/#/contains":131,"es6-symbol":143}],137:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/valid-callable"),i=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var r,c,f,h,d,p,g,v,m=arguments[2];if(s(t)||n(t)?r="array":i(t)?r="string":t=o(t),a(e),f=function(){h=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(l.call(e,m,c.value,f),h)return;c=t.next()}else for(p=t.length,d=0;d=55296&&v<=56319&&(g+=t[++d]),l.call(e,m,g,f),!h);++d);else u.call(t,(function(t){return l.call(e,m,t,f),h}))}},{"./get":138,"es5-ext/function/is-arguments":103,"es5-ext/object/valid-callable":128,"es5-ext/string/is-string":134}],138:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/string/is-string"),i=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new i(t):a(t)?new o(t):new i(t)}},{"./array":136,"./string":141,"./valid-iterable":142,"es5-ext/function/is-arguments":103,"es5-ext/string/is-string":134,"es6-symbol":143}],139:[function(t,e,r){"use strict";var n,a=t("es5-ext/array/#/clear"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),u=t("d/auto-bind"),c=t("es6-symbol"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,i({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,c.iterator,l((function(){return this})))},{d:86,"d/auto-bind":85,"es5-ext/array/#/clear":99,"es5-ext/object/assign":112,"es5-ext/object/valid-callable":128,"es5-ext/object/valid-value":130,"es6-symbol":143}],140:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/is-value"),i=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!a(t)&&(!!s(t)||(!!i(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":103,"es5-ext/object/is-value":119,"es5-ext/string/is-string":134,"es6-symbol":143}],141:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",i("",t.length))},a&&a(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,i("c","String Iterator"))},{"./":139,d:86,"es5-ext/object/set-prototype-of":125,"es6-symbol":143}],142:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":140}],143:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":144,"./polyfill":149,"ext/global-this":156}],144:[function(t,e,r){"use strict";var n=t("ext/global-this"),a={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!a[typeof e.iterator]&&(!!a[typeof e.toPrimitive]&&!!a[typeof e.toStringTag])}},{"ext/global-this":156}],145:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],146:[function(t,e,r){"use strict";var n=t("d"),a=Object.create,i=Object.defineProperty,o=Object.prototype,s=a(null);e.exports=function(t){for(var e,r,a=0;s[t+(a||"")];)++a;return s[t+=a||""]=!0,i(o,e="@@"+t,n.gs(null,(function(t){r||(r=!0,i(this,e,n(t)),r=!1)}))),e}},{d:86}],147:[function(t,e,r){"use strict";var n=t("d"),a=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",a&&a.hasInstance||t("hasInstance")),isConcatSpreadable:n("",a&&a.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",a&&a.iterator||t("iterator")),match:n("",a&&a.match||t("match")),replace:n("",a&&a.replace||t("replace")),search:n("",a&&a.search||t("search")),species:n("",a&&a.species||t("species")),split:n("",a&&a.split||t("split")),toPrimitive:n("",a&&a.toPrimitive||t("toPrimitive")),toStringTag:n("",a&&a.toStringTag||t("toStringTag")),unscopables:n("",a&&a.unscopables||t("unscopables"))})}},{d:86,"ext/global-this":156}],148:[function(t,e,r){"use strict";var n=t("d"),a=t("../../../validate-symbol"),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in a(t),i)if(i[e]===t)return e}))})}},{"../../../validate-symbol":150,d:86}],149:[function(t,e,r){"use strict";var n,a,i,o=t("d"),s=t("./validate-symbol"),l=t("ext/global-this").Symbol,u=t("./lib/private/generate-name"),c=t("./lib/private/setup/standard-symbols"),f=t("./lib/private/setup/symbol-registry"),h=Object.create,d=Object.defineProperties,p=Object.defineProperty;if("function"==typeof l)try{String(l()),i=!0}catch(t){}else l=null;a=function(t){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?l(e):(r=h(a.prototype),e=void 0===e?"":String(e),d(r,{__description__:o("",e),__name__:o("",u(e))}))},c(n),f(n),d(a.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),d(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),p(n.prototype,n.toPrimitive,o("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),p(n.prototype,n.toStringTag,o("c","Symbol")),p(a.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),p(a.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":146,"./lib/private/setup/standard-symbols":147,"./lib/private/setup/symbol-registry":148,"./validate-symbol":150,d:86,"ext/global-this":156}],150:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":145}],151:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":152,"./polyfill":154}],152:[function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},{}],153:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],154:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/is-value"),i=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),u=t("d"),c=t("es6-iterator/get"),f=t("es6-iterator/for-of"),h=t("es6-symbol").toStringTag,d=t("./is-native-implemented"),p=Array.isArray,g=Object.defineProperty,v=Object.prototype.hasOwnProperty,m=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=d&&i&&WeakMap!==n?i(new WeakMap,m(this)):this,a(e)&&(p(e)||(e=c(e))),g(t,"__weakMapData__",u("c","$weakMap$"+l())),e?(f(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},d&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u((function(t){return!!v.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:u((function(t){if(v.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:u((function(t){return v.call(o(t),this.__weakMapData__)})),set:u((function(t,e){return g(o(t),this.__weakMapData__,u("c",e)),this})),toString:u((function(){return"[object WeakMap]"}))}),g(n.prototype,h,u("c","WeakMap"))},{"./is-native-implemented":153,d:86,"es5-ext/object/is-value":119,"es5-ext/object/set-prototype-of":125,"es5-ext/object/valid-object":129,"es5-ext/object/valid-value":130,"es5-ext/string/random-uniq":135,"es6-iterator/for-of":137,"es6-iterator/get":138,"es6-symbol":143}],155:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],156:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":155,"./is-implemented":157}],157:[function(t,e,r){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],158:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":245}],159:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var a,i,o,s,l=t[0].length,u=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(u+r));var c=e.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(a=0,o=r;ae[0]-o[0]/2&&(h=o[0]/2,d+=o[1]);return r}},{"css-font/stringify":82}],161:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",u=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return a(n.cache[r],u);var c=e.canvas||n.canvas,f=c.getContext("2d"),h={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},d=Math.ceil(1.5*s);c.height=d,c.width=.5*d,f.font=t;var p={top:0};f.clearRect(0,0,d,d),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var g=i(f.getImageData(0,0,d,d));f.clearRect(0,0,d,d),f.textBaseline="bottom",f.fillText("H",0,d);var v=i(f.getImageData(0,0,d,d));p.lineHeight=p.bottom=d-v+g,f.clearRect(0,0,d,d),f.textBaseline="alphabetic",f.fillText("H",0,d);var m=d-i(f.getImageData(0,0,d,d))-1+g;p.baseline=p.alphabetic=m,f.clearRect(0,0,d,d),f.textBaseline="middle",f.fillText("H",0,.5*d);var y=i(f.getImageData(0,0,d,d));p.median=p.middle=d-y-1+g-.5*d,f.clearRect(0,0,d,d),f.textBaseline="hanging",f.fillText("H",0,.5*d);var b=i(f.getImageData(0,0,d,d));p.hanging=d-b-1+g-.5*d,f.clearRect(0,0,d,d),f.textBaseline="ideographic",f.fillText("H",0,d);var x=i(f.getImageData(0,0,d,d));if(p.ideographic=d-x-1+g,h.upper&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.upper,0,0),p.upper=i(f.getImageData(0,0,d,d)),p.capHeight=p.baseline-p.upper),h.lower&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.lower,0,0),p.lower=i(f.getImageData(0,0,d,d)),p.xHeight=p.baseline-p.lower),h.tittle&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.tittle,0,0),p.tittle=i(f.getImageData(0,0,d,d))),h.ascent&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.ascent,0,0),p.ascent=i(f.getImageData(0,0,d,d))),h.descent&&(f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.descent,0,0),p.descent=o(f.getImageData(0,0,d,d))),h.overshoot){f.clearRect(0,0,d,d),f.textBaseline="top",f.fillText(h.overshoot,0,0);var _=o(f.getImageData(0,0,d,d));p.overshoot=_-m}for(var w in p)p[w]/=s;return p.em=s,n.cache[r]=p,a(p,u)}function a(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],162:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(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}var l=s.prototype;function u(t,e){var r;if(e.left&&(r=u(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?u(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left)if(a=c(t,e,r,n.left))return a;if(a=r(n.key,n.value))return a}if(n.right)return c(t,e,r,n.right)}function f(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=f(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return f(t,e,r,n,a.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){a=l[f];u[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];a=l[f];if(1===h._color||1===a._color)break;var d=l[f-2];if(d.left===h)if(h.left===a){if(!(p=d.right)||0!==p._color){if(d._color=0,d.left=h.right,h._color=1,h.right=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).left===d?g.left=h:g.right=h;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else{if(!(p=d.right)||0!==p._color){if(h.right=a.left,d._color=0,d.left=a.right,a._color=1,a.left=h,a.right=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).left===d?g.left=a:g.right=a;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else if(h.right===a){if(!(p=d.left)||0!==p._color){if(d._color=0,d.right=h.left,h._color=1,h.left=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).right===d?g.right=h:g.left=h;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}else{var p;if(!(p=d.left)||0!==p._color){var g;if(h.left=a.right,d._color=0,d.right=a.left,a._color=1,a.right=h,a.left=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).right===d?g.right=a:g.left=a;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return u(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.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.right._count)break;e=e.right}return new h(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new h(this,n);r=a<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 d=h.prototype;function p(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 g(t,e){return te?1:0}Object.defineProperty(d,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(d,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),d.clone=function(){return new h(this.tree,this._stack.slice())},d.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var u=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var c=e[u-1];e.push(new n(r._color,c.key,c.value,r.left,r.right,r._count)),e[u-1].key=r.key,e[u-1].value=r.value;for(l=e.length-2;l>=u;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[u-1].left=e[u]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(u=t[l-2]).left===r?u.left=n:u.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).left===r?u.left=s:u.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),t[l-1]=n,t[l]=r,l+11)(u=t[l-2]).right===r?u.right=n:u.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).right===r?u.right=s:u.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var u;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(d,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(d,"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}),d.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(d,"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}}),d.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),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},d.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(d,"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}})},{}],163:[function(t,e,r){e.exports=function(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,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;or)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function c(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:255,"ndarray-ops":254,"typedarray-pool":329}],165:[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"}},{}],166:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":165}],167:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;ic||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,g,v,u)};var a,i,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function p(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=d(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=d(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,a,i,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(m=0;ma||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=u(n),o=0;o>8*d&255;this.pickOffset=r,a.bind();var p=a.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var g=a.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,a=this.shape[0]*this.shape[1];if(r=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),o=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var u,c,f,d,p=t.colorLevels||[0],g=t.colorValues||[0,0,0,1],v=p.length,m=this.bounds;l?(u=m[0]=r[0],c=m[1]=o[0],f=m[2]=r[r.length-1],d=m[3]=o[o.length-1]):(u=m[0]=r[0]+(r[1]-r[0])/2,c=m[1]=o[0]+(o[1]-o[0])/2,f=m[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,d=m[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-u),b=1/(d-c),x=e[0],_=e[1];this.shape=[x,_];var w=(l?(x-1)*(_-1):x*_)*(h.length>>>1);this.numVertices=w;for(var A=i.mallocUint8(4*w),T=i.mallocFloat32(2*w),k=i.mallocUint8(2*w),M=i.mallocUint32(w),E=0,S=l?x-1:x,C=l?_-1:_,O=0;Oa[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=v[t],r.uniforms.angle=m[t],i.drawArrays(i.TRIANGLES,a[T],a[k]-a[T]))),y[t]&&A&&(c[1^t]-=M*d*b[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=x[t],r.uniforms.angle=_[t],i.drawArrays(i.TRIANGLES,w,A)),c[1^t]=M*s[2+(1^t)]-1,p[t+2]&&(c[1^t]+=M*d*g[t+2],Ta[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=v[t+2],r.uniforms.angle=m[t+2],i.drawArrays(i.TRIANGLES,a[T],a[k]-a[T]))),y[t+2]&&A&&(c[1^t]+=M*d*b[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=x[t+2],r.uniforms.angle=_[t+2],i.drawArrays(i.TRIANGLES,w,A))}),g.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=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-i[c])/(i[2+c]-i[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),g.bind=(h=[0,0],d=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,a=t.screenBox,i=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,u=.5*(n[o+2]+n[o]),c=n[o+2]-n[o],f=i[o],g=i[o+2]-f,v=a[o],m=a[o+2]-v;d[o]=2*l/c*g/m,h[o]=2*(s-u)/c*g/m}p[1]=2*t.pixelRatio/(a[3]-a[1]),p[0]=p[1]*(a[3]-a[1])/(a[2]-a[0]),e.uniforms.dataScale=d,e.uniforms.dataShift=h,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,a,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var g=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(g,e[1],g,e[3],d[p],h[p]):o.drawLine(e[0],g,e[2],g,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.removeObject=function(t){for(var e=this.objects,r=0;r 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=n(["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=n(["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"])},{glslify:233}],209:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=a,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}e.exports=function(t,e){var r=t.gl,i=a(r),l=a(r),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(t,i,l,u,c);return f.update(e),t.addObject(f),f};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,a=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=a?s:i.mallocFloat32(s.length),u=o?t.idToIndex:i.mallocInt32(n);if(a||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&i<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,a),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/i,l[4]=2/o,l[6]=-2*a[0]/i-1,l[7]=-2*a[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":208,"gl-buffer":164,"gl-shader":214,"typedarray-pool":329}],210:[function(t,e,r){"use strict";var n=t("glslify");r.boxVertex=n(["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=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},{glslify:211}],211:[function(t,e,r){arguments[4][206][0].apply(r,arguments)},{dup:206}],212:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("./lib/shaders");function o(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}e.exports=function(t,e){var r=t.gl,s=a(r,[0,0,0,1,1,0,1,1]),l=n(r,i.boxVertex,i.boxFragment),u=new o(t,s,l);return u.update(e),t.addOverlay(u),u};var s=o.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,f=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],h=(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(f=Math.max(f,u[0]),h=Math.max(h,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d0){var m=r*c;o.drawBox(f-m,h-m,d+m,h+m,i),o.drawBox(f-m,p-m,d+m,p+m,i),o.drawBox(f-m,h-m,f+m,p+m,i),o.drawBox(d-m,h-m,d+m,p+m,i)}}}},s.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()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":210,"gl-buffer":164,"gl-shader":214}],213:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],i=e[1],o=n(t,r,i,{}),s=a.mallocUint8(r*i*4);return new l(t,o,s)};var n=t("gl-fbo"),a=t("typedarray-pool"),i=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function l(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)}}var u=l.prototype;Object.defineProperty(u,"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){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;ir)for(t=r;te)for(t=e;t=0){for(var A=0|w.type.charAt(w.type.length-1),T=new Array(A),k=0;k=0;)M+=1;_[y]=M}var E=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d[0],a,p,i,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,d,a,p,i,f)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;i.pointer=function(t,e,r,n){var a=this._gl,i=this._locations[this._index];a.vertexAttribPointer(i,this._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(i)},i.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(i,"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}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,a){return void 0===r.length?t.vertexAttrib3f(e,r,n,a):t.vertexAttrib3fv(e,r)},function(t,e,r,n,a,i){return void 0===r.length?t.vertexAttrib4f(e,r,n,a,i):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,i,s,l){var u=o[i],c=new a(t,e,r,n,i,u);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),u(t,n[r],e),e},get:function(){return c},enumerable:!0})}function l(t,e,r,n,a,i,o){for(var l=new Array(a),u=new Array(a),c=0;c4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+m);t["uniformMatrix"+v+"fv"](s[c],!1,f);break}throw new a("","Unknown uniform data type for "+name+": "+m)}if((v=m.charCodeAt(m.length-1)-48)<2||v>4)throw new a("","Invalid data type");switch(m.charAt(0)){case"b":case"i":t["uniform"+v+"iv"](s[c],f);break;case"v":t["uniform"+v+"fv"](s[c],f);break;default:throw new a("","Unrecognized data type for vector "+name+": "+m)}}}}}}function u(t,e,n){if("object"==typeof n){var u=c(n);Object.defineProperty(t,e,{get:i(u),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(f=n,function(t,e,r){return t.getUniform(e.program,r[f])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var f}function c(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l1)for(var l=0;l halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},A.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=a(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),A.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=A.baseFontSize+"px sans-serif");var r,i=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(A.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var a=n.stringify({size:A.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=d(t.size),l=Math.round(s[0]*p(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&a==e.font[r].baseString||(i=!0,e.font[r]=A.fonts[a],e.font[r]))){var u=t.family.join(", "),c=[t.style];t.style!=t.variant&&c.push(t.variant),t.variant!=t.weight&&c.push(t.weight),_&&t.weight!=t.stretch&&c.push(t.stretch),e.font[r]={baseString:a,family:u,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:m(u,{origin:"top",fontSize:A.baseFontSize,fontStyle:c.join(" ")})},A.fonts[a]=e.font[r]}})),(i||o)&&this.font.forEach((function(r,a){var i=n.stringify({size:e.fontSize[a],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[a]=e.shader.atlas[i],!e.fontAtlas[a]){var o=r.metrics;e.shader.atlas[i]=e.fontAtlas[a]={fontString:i,step:2*Math.ceil(e.fontSize[a]*o.bottom*.5),em:e.fontSize[a],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h2){for(var w=!t.position[0].length,T=c.mallocFloat(2*this.count),k=0,M=0;k1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,a=0;return a+=.5*n.bottom,a+="number"==typeof t?t-n.baseline:-n[t],A.normalViewport||(a*=-1),a}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var Y;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;Y=c.mallocUint8(G);for(var q=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var Q=0;Q1?this.counts[Q]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Q]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*Q,4*Q+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Q]:this.opacity,baseline:null!=this.baselineOffset[Q]?this.baselineOffset[Q]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[Q]?this.alignOffset[Q]:this.alignOffset[0]:0,atlas:this.fontAtlas[Q]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*Q,2*Q+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},A.prototype.destroy=function(){},A.prototype.kerning=!0,A.prototype.position={constant:new Float32Array(2)},A.prototype.translate=null,A.prototype.scale=null,A.prototype.font=null,A.prototype.text="",A.prototype.positionOffset=[0,0],A.prototype.opacity=1,A.prototype.color=new Uint8Array([0,0,0,255]),A.prototype.alignOffset=[0,0],A.normalViewport=!1,A.maxAtlasSize=1024,A.atlasCanvas=document.createElement("canvas"),A.atlasContext=A.atlasCanvas.getContext("2d",{alpha:!1}),A.baseFontSize=64,A.fonts={},e.exports=A},{"bit-twiddle":46,"color-normalize":69,"css-font":79,"detect-kerning":92,"es6-weak-map":151,"flatten-vertex-data":159,"font-atlas":160,"font-measure":161,"gl-util/context":224,"is-plain-obj":244,"object-assign":258,"parse-rect":261,"parse-unit":263,"pick-by-alias":265,regl:288,"to-px":315,"typedarray-pool":329}],223:[function(t,e,r){"use strict";var n=t("ndarray"),a=t("ndarray-ops"),i=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||u(t);if("number"==typeof arguments[1])return m(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return m(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=c(e)?e:e.raw;if(r)return y(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return b(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function c(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}var f=function(t,e){a.muls(t,e,255)};function h(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)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 d(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,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}var p=d.prototype;function g(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 v(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 m(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new d(t,o,e,r,n,a)}function y(t,e,r,n,a,i){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new d(t,o,r,n,a,i)}function b(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var c,h,p=0;if(2===o.length)p=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=t.ALPHA;else if(2===o[2])p=t.LUMINANCE_ALPHA;else if(3===o[2])p=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)c=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];h=i.malloc(m,r);var b=n(h,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?a.assign(b,e):f(b,e),c=h.subarray(0,m)}var x=v(t);return t.texImage2D(t.TEXTURE_2D,0,p,o[0],o[1],0,p,u,c),l||i.free(h),new d(t,x,o[0],o[1],p,u)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.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},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.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)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,c){var h=c.dtype,d=c.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,v=0,m=g(d,c.stride.slice());"float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,m=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,m=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],c=n(c.data,d,[c.stride[0],c.stride[1],1],c.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=c.size,b=u.indexOf(o)<0;b&&u.push(o);if(p===l&&m)0===c.offset&&c.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data.subarray(c.offset,c.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data.subarray(c.offset,c.offset+y));else{var x;x=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,c):a.assign(_,c),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:255,"ndarray-ops":254,"typedarray-pool":329}],224:[function(t,e,r){(function(r){(function(){"use strict";var n=t("pick-by-alias");function a(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},i(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),a(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),a(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":265}],225:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return k(r),m+=r.length,(d=d.slice(r.length)).length}}function D(){return/[^a-fA-F0-9]/.test(e)?(k(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function R(){return"."===e||/[eE]/.test(e)?(d.push(e),h=5,r=e,c+1):"x"===e&&1===d.length&&"0"===d[0]?(h=11,d.push(e),r=e,c+1):/[^\d]/.test(e)?(k(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function I(){return"f"===e&&(d.push(e),r=e,c+=1),/[eE]/.test(e)?(d.push(e),r=e,c+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(k(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function P(){if(/[^\d\w_]/.test(e)){var t=d.join("");return h=T[t]?8:A[t]?7:6,k(d.join("")),h=999,c}return d.push(e),r=e,c+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":228,"./lib/builtins-300es":227,"./lib/literals":230,"./lib/literals-300es":229,"./lib/operators":231}],227:[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":228}],228:[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"]},{}],229:[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","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":230}],230:[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","uint","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"]},{}],231:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],232:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return a=(a=a.concat(r(t))).concat(r(null))}},{"./index":226}],233:[function(t,e,r){arguments[4][206][0].apply(r,arguments)},{dup:206}],234:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":239}],235:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":239}],236:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,f=r?a-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),i-=u}return(d?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=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+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,a),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+d]=255&s,d+=p,s/=256,a-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],237:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new m(null);return new m(v(t))};var i=a.prototype;function o(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 s(t,e){var r=v(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function h(t,e){for(var r=0;r>1],i=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=v([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=v([t]);else{var r=n.ge(this.leftPoints,t,p),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,p);ithis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},i.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=m.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":45}],238:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r * @license MIT */ -e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],247:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],248:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],249:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],250:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],251:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],252:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],253:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],254:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==a||c!==i||l(s))&&(r=0|t,a=u||0,i=c||0,e&&e(r,a,i,o))}function c(t){u(0,t)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,a,i,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":256}],255:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],256:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],243:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],244:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],245:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],246:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],247:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],248:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==a||c!==i||l(s))&&(r=0|t,a=u||0,i=c||0,e&&e(r,a,i,o))}function c(t){u(0,t)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,a,i,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":250}],249:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],250:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<0&&o(l,r))}catch(t){f.call(new d(r),t)}}}function f(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function h(t,e,r,n){for(var a=0;a 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 w=t.getters||[],A=new Array(x),T=0;T=0?A[T]=!0:A[T]=!1;return function(t,e,r,x,_,w){var A=w.length,T=_.length;if(T<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var M="extractContour"+_.join("_"),k=[],E=[],S=[],C=0;C0&&R.push(l(C,_[O-1])+"*"+s(_[O-1])),E.push(p(C,_[O])+"=("+R.join("-")+")|0")}for(C=0;C=0;--C)I.push(s(_[C]));E.push("Q=("+I.join("*")+")|0","P=mallocUint32(Q)","V=mallocUint32(Q)","X=0"),E.push(g(0)+"=0");for(O=1;O<1<0;_=_-1&p)b.push("V[X+"+m(_)+"]");b.push(y(0));for(_=0;_=0;--e)B(e,0);var r=[];for(e=0;e0){",d(_[e]),"=1;"),t(e-1,r|1<<_[e]);for(var n=0;n>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_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=n({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=n({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=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_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=o({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=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:a,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":85}],261:[function(t,e,r){var n=t("iota-array"),a=t("is-buffer"),i="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.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];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),a?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+r+"_get("+l.join(",")+"){"),a?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),i.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+o.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var d=o.map((function(t){return"a"+t+"=this.shape["+t+"]"})),p=o.map((function(t){return"c"+t+"=this.stride["+t+"]"}));i.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");i.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"c"+t})).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+o.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map((function(t){return"shape["+t+"]"})).join(",")+","+o.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",i.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n){n=0;for(s=0;st==t>0?i===-1>>>0?(r+=1,i=0):i+=1:0===i?(i=-1>>>0,r-=1):i-=1;return n.pack(i,r)}},{"double-bits":96}],263:[function(t,e,r){var n=Math.PI,a=u(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}function s(t,e,r,i,o,u,c,f,h,d){if(d)A=d[0],T=d[1],_=d[2],w=d[3];else{var p=l(t,e,-o);t=p.x,e=p.y;var g=(t-(f=(p=l(f,h,-o)).x))/2,v=(e-(h=p.y))/2,m=g*g/(r*r)+v*v/(i*i);m>1&&(r*=m=Math.sqrt(m),i*=m);var y=r*r,b=i*i,x=(u==c?-1:1)*Math.sqrt(Math.abs((y*b-y*v*v-b*g*g)/(y*v*v+b*g*g)));x==1/0&&(x=1);var _=x*r*v/i+(t+f)/2,w=x*-i*g/r+(e+h)/2,A=Math.asin(((e-w)/i).toFixed(9)),T=Math.asin(((h-w)/i).toFixed(9));(A=t<_?n-A:A)<0&&(A=2*n+A),(T=f<_?n-T:T)<0&&(T=2*n+T),c&&A>T&&(A-=2*n),!c&&T>A&&(T-=2*n)}if(Math.abs(T-A)>a){var M=T,k=f,E=h;T=A+a*(c&&T>A?1:-1);var S=s(f=_+r*Math.cos(T),h=w+i*Math.sin(T),r,i,o,0,c,k,E,[T,M,_,w])}var C=Math.tan((T-A)/4),O=4/3*r*C,L=4/3*i*C,D=[2*t-(t+O*Math.sin(A)),2*e-(e-L*Math.cos(A)),f+O*Math.sin(T),h-L*Math.cos(T),f,h];if(d)return D;S&&(D=D.concat(S));for(var R=0;R7&&(r.push(m.splice(0,7)),m.unshift("C"));break;case"S":var b=d,x=p;"C"!=e&&"S"!=e||(b+=b-n,x+=x-a),m=["C",b,x,m[1],m[2],m[3],m[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),m=o(d,p,f,h,m[1],m[2]);break;case"Q":f=m[1],h=m[2],m=o(d,p,m[1],m[2],m[3],m[4]);break;case"L":m=i(d,p,m[1],m[2]);break;case"H":m=i(d,p,m[1],p);break;case"V":m=i(d,p,d,m[1]);break;case"Z":m=i(d,p,l,c)}e=y,d=m[m.length-2],p=m[m.length-1],m.length>4?(n=m[m.length-4],a=m[m.length-3]):(n=d,a=p),r.push(m)}return r}},{}],264:[function(t,e,r){ +!function(t,r,n){r[t]=r[t]||n(),void 0!==e&&e.exports&&(e.exports=r[t])}("Promise",void 0!==t?t:this,(function(){"use strict";var t,e,n,a=Object.prototype.toString,i=void 0!==r?function(t){return r(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function o(t,r){n.add(t,r),e||(e=i(n.drain))}function s(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function l(){for(var t=0;t0&&o(l,r))}catch(t){f.call(new d(r),t)}}}function f(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function h(t,e,r,n){for(var a=0;a 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 s=t.getters||[],l=new Array(i),u=0;u=0?l[u]=!0:l[u]=!1;return function(t,e,r,i,o,s){var l=[s,o].join(",");return(0,a[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var a={"false,0,1":function(t,e,r,n,a){return function(i,o,s,l){var u,c=0|i.shape[0],f=0|i.shape[1],h=i.data,d=0|i.offset,p=0|i.stride[0],g=0|i.stride[1],v=d,m=0|-p,y=0,b=0|-g,x=0,_=-p-g|0,w=0,A=0|p,T=g-p*c|0,k=0,M=0,E=0,S=2*c|0,C=n(S),O=n(S),L=0,D=0,R=-1,I=-1,P=0,F=0|-c,N=0|c,z=0,B=-c-1|0,j=c-1|0,U=0,H=0,V=0;for(k=0;k0){if(M=1,C[L++]=r(h[v],o,s,l),v+=A,c>0)for(k=1,u=h[v],D=C[L]=r(u,o,s,l),P=C[L+R],z=C[L+F],U=C[L+B],D===P&&D===z&&D===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(k,M,u,y,x,w,D,P,z,U,o,s,l),H=O[L]=E++),L+=1,v+=A,k=2;k0)for(k=1,u=h[v],D=C[L]=r(u,o,s,l),P=C[L+R],z=C[L+F],U=C[L+B],D===P&&D===z&&D===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(k,M,u,y,x,w,D,P,z,U,o,s,l),H=O[L]=E++,U!==z&&e(O[L+F],H,x,w,z,U,o,s,l)),L+=1,v+=A,k=2;k0){if(k=1,C[L++]=r(h[v],o,s,l),v+=A,f>0)for(M=1,u=h[v],D=C[L]=r(u,o,s,l),z=C[L+F],P=C[L+R],U=C[L+B],D===z&&D===P&&D===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(k,M,u,y,x,w,D,z,P,U,o,s,l),H=O[L]=E++),L+=1,v+=A,M=2;M0)for(M=1,u=h[v],D=C[L]=r(u,o,s,l),z=C[L+F],P=C[L+R],U=C[L+B],D===z&&D===P&&D===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(k,M,u,y,x,w,D,z,P,U,o,s,l),H=O[L]=E++,U!==z&&e(O[L+F],H,w,y,U,z,o,s,l)),L+=1,v+=A,M=2;M0;){b<64?(l=b,b=0):(l=64,b-=64);for(var x=0|t[1];x>0;){x<64?(u=x,x=0):(u=64,x-=64),n=m+b*f+x*h,o=y+b*p+x*g;var _=0,w=0,A=0,T=d,k=f-c*d,M=h-l*f,E=v,S=p-c*v,C=g-l*p;for(A=0;A0;){g<64?(l=g,g=0):(l=64,g-=64);for(var v=0|t[0];v>0;){v<64?(s=v,v=0):(s=64,v-=64),n=d+g*c+v*u,o=p+g*h+v*f;var m=0,y=0,b=c,x=u-l*c,_=h,w=f-l*h;for(y=0;y0;){y<64?(u=y,y=0):(u=64,y-=64);for(var b=0|t[0];b>0;){b<64?(s=b,b=0):(s=64,b-=64);for(var x=0|t[1];x>0;){x<64?(l=x,x=0):(l=64,x-=64),n=v+y*h+b*c+x*f,o=m+y*g+b*d+x*p;var _=0,w=0,A=0,T=h,k=c-u*h,M=f-s*c,E=g,S=d-u*g,C=p-s*d;for(A=0;A=0&&(e+=i*(r=0|t),a-=r),new n(this.data,a,i,e)},a.step=function(t){var e=this.shape[0],r=this.stride[0],a=this.offset,i=0,o=Math.ceil;return"number"==typeof t&&((i=0|t)<0?(a+=r*(e-1),e=o(-e/i)):e=o(e/i),r*=i),new n(this.data,e,r,a)},a.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},a.pick=function(t){var r=[],n=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,a)},function(t,e,r,a){return new n(t,e[0],r[0],a)}},2:function(t,e,r){function n(t,e,r,n,a,i){this.data=t,this.shape=[e,r],this.stride=[n,a],this.offset=0|i}var a=n.prototype;return a.dtype=t,a.dimension=2,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(a,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),a.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},a.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},a.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},a.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},a.lo=function(t,e){var r=this.offset,a=0,i=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(a=0|t),i-=a),"number"==typeof e&&e>=0&&(r+=l*(a=0|e),o-=a),new n(this.data,i,o,s,l,r)},a.step=function(t,e){var r=this.shape[0],a=this.shape[1],i=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=i*(r-1),r=u(-r/l)):r=u(r/l),i*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(a-1),a=u(-a/l)):a=u(a/l),o*=l),new n(this.data,r,a,i,o,s)},a.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,a=this.stride;return new n(this.data,r[t],r[e],a[t],a[e],this.offset)},a.pick=function(t,r){var n=[],a=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(n.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?i=i+this.stride[1]*r|0:(n.push(this.shape[1]),a.push(this.stride[1])),(0,e[n.length+1])(this.data,n,a,i)},function(t,e,r,a){return new n(t,e[0],e[1],r[0],r[1],a)}},3:function(t,e,r){function n(t,e,r,n,a,i,o,s){this.data=t,this.shape=[e,r,n],this.stride=[a,i,o],this.offset=0|s}var a=n.prototype;return a.dtype=t,a.dimension=3,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(a,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),a.set=function(e,r,n,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=a},a.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},a.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},a.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},a.lo=function(t,e,r){var a=this.offset,i=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],f=this.stride[2];return"number"==typeof t&&t>=0&&(a+=u*(i=0|t),o-=i),"number"==typeof e&&e>=0&&(a+=c*(i=0|e),s-=i),"number"==typeof r&&r>=0&&(a+=f*(i=0|r),l-=i),new n(this.data,o,s,l,u,c,f,a)},a.step=function(t,e,r){var a=this.shape[0],i=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,f=0,h=Math.ceil;return"number"==typeof t&&((f=0|t)<0?(c+=s*(a-1),a=h(-a/f)):a=h(a/f),s*=f),"number"==typeof e&&((f=0|e)<0?(c+=l*(i-1),i=h(-i/f)):i=h(i/f),l*=f),"number"==typeof r&&((f=0|r)<0?(c+=u*(o-1),o=h(-o/f)):o=h(o/f),u*=f),new n(this.data,a,i,o,s,l,u,c)},a.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var a=this.shape,i=this.stride;return new n(this.data,a[t],a[e],a[r],i[t],i[e],i[r],this.offset)},a.pick=function(t,r,n){var a=[],i=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(a.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(a.push(this.shape[1]),i.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(a.push(this.shape[2]),i.push(this.stride[2])),(0,e[a.length+1])(this.data,a,i,o)},function(t,e,r,a){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],a)}},4:function(t,e,r){function n(t,e,r,n,a,i,o,s,l,u){this.data=t,this.shape=[e,r,n,a],this.stride=[i,o,s,l],this.offset=0|u}var a=n.prototype;return a.dtype=t,a.dimension=4,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(a,"order",{get:r}),a.set=function(e,r,n,a,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a]=i},a.get=function(e,r,n,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a]},a.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},a.hi=function(t,e,r,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof a||a<0?this.shape[3]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},a.lo=function(t,e,r,a){var i=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3];return"number"==typeof t&&t>=0&&(i+=f*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(i+=h*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(i+=d*(o=0|r),u-=o),"number"==typeof a&&a>=0&&(i+=p*(o=0|a),c-=o),new n(this.data,s,l,u,c,f,h,d,p,i)},a.step=function(t,e,r,a){var i=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],f=this.stride[2],h=this.stride[3],d=this.offset,p=0,g=Math.ceil;return"number"==typeof t&&((p=0|t)<0?(d+=u*(i-1),i=g(-i/p)):i=g(i/p),u*=p),"number"==typeof e&&((p=0|e)<0?(d+=c*(o-1),o=g(-o/p)):o=g(o/p),c*=p),"number"==typeof r&&((p=0|r)<0?(d+=f*(s-1),s=g(-s/p)):s=g(s/p),f*=p),"number"==typeof a&&((p=0|a)<0?(d+=h*(l-1),l=g(-l/p)):l=g(l/p),h*=p),new n(this.data,i,o,s,l,u,c,f,h,d)},a.transpose=function(t,e,r,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,a=void 0===a?3:0|a;var i=this.shape,o=this.stride;return new n(this.data,i[t],i[e],i[r],i[a],o[t],o[e],o[r],o[a],this.offset)},a.pick=function(t,r,n,a){var i=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(i.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(i.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(i.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof a&&a>=0?s=s+this.stride[3]*a|0:(i.push(this.shape[3]),o.push(this.stride[3])),(0,e[i.length+1])(this.data,i,o,s)},function(t,e,r,a){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],a)}},5:function(t,e,r){function n(t,e,r,n,a,i,o,s,l,u,c,f){this.data=t,this.shape=[e,r,n,a,i],this.stride=[o,s,l,u,c],this.offset=0|f}var a=n.prototype;return a.dtype=t,a.dimension=5,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(a,"order",{get:r}),a.set=function(e,r,n,a,i,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i]=o},a.get=function(e,r,n,a,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i]},a.index=function(t,e,r,n,a){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*a},a.hi=function(t,e,r,a,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof a||a<0?this.shape[3]:0|a,"number"!=typeof i||i<0?this.shape[4]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},a.lo=function(t,e,r,a,i){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],f=this.shape[3],h=this.shape[4],d=this.stride[0],p=this.stride[1],g=this.stride[2],v=this.stride[3],m=this.stride[4];return"number"==typeof t&&t>=0&&(o+=d*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=p*(s=0|e),u-=s),"number"==typeof r&&r>=0&&(o+=g*(s=0|r),c-=s),"number"==typeof a&&a>=0&&(o+=v*(s=0|a),f-=s),"number"==typeof i&&i>=0&&(o+=m*(s=0|i),h-=s),new n(this.data,l,u,c,f,h,d,p,g,v,m,o)},a.step=function(t,e,r,a,i){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3],g=this.stride[4],v=this.offset,m=0,y=Math.ceil;return"number"==typeof t&&((m=0|t)<0?(v+=f*(o-1),o=y(-o/m)):o=y(o/m),f*=m),"number"==typeof e&&((m=0|e)<0?(v+=h*(s-1),s=y(-s/m)):s=y(s/m),h*=m),"number"==typeof r&&((m=0|r)<0?(v+=d*(l-1),l=y(-l/m)):l=y(l/m),d*=m),"number"==typeof a&&((m=0|a)<0?(v+=p*(u-1),u=y(-u/m)):u=y(u/m),p*=m),"number"==typeof i&&((m=0|i)<0?(v+=g*(c-1),c=y(-c/m)):c=y(c/m),g*=m),new n(this.data,o,s,l,u,c,f,h,d,p,g,v)},a.transpose=function(t,e,r,a,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,a=void 0===a?3:0|a,i=void 0===i?4:0|i;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[a],o[i],s[t],s[e],s[r],s[a],s[i],this.offset)},a.pick=function(t,r,n,a,i){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof a&&a>=0?l=l+this.stride[3]*a|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof i&&i>=0?l=l+this.stride[4]*i|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,a){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],a)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,u[t][0]):n(t,u[t],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(t,e,r,i){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===i){i=0;for(s=0;st==t>0?i===-1>>>0?(r+=1,i=0):i+=1:0===i?(i=-1>>>0,r-=1):i-=1;return n.pack(i,r)}},{"double-bits":93}],257:[function(t,e,r){var n=Math.PI,a=u(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}function s(t,e,r,i,o,u,c,f,h,d){if(d)A=d[0],T=d[1],_=d[2],w=d[3];else{var p=l(t,e,-o);t=p.x,e=p.y;var g=(t-(f=(p=l(f,h,-o)).x))/2,v=(e-(h=p.y))/2,m=g*g/(r*r)+v*v/(i*i);m>1&&(r*=m=Math.sqrt(m),i*=m);var y=r*r,b=i*i,x=(u==c?-1:1)*Math.sqrt(Math.abs((y*b-y*v*v-b*g*g)/(y*v*v+b*g*g)));x==1/0&&(x=1);var _=x*r*v/i+(t+f)/2,w=x*-i*g/r+(e+h)/2,A=Math.asin(((e-w)/i).toFixed(9)),T=Math.asin(((h-w)/i).toFixed(9));(A=t<_?n-A:A)<0&&(A=2*n+A),(T=f<_?n-T:T)<0&&(T=2*n+T),c&&A>T&&(A-=2*n),!c&&T>A&&(T-=2*n)}if(Math.abs(T-A)>a){var k=T,M=f,E=h;T=A+a*(c&&T>A?1:-1);var S=s(f=_+r*Math.cos(T),h=w+i*Math.sin(T),r,i,o,0,c,M,E,[T,k,_,w])}var C=Math.tan((T-A)/4),O=4/3*r*C,L=4/3*i*C,D=[2*t-(t+O*Math.sin(A)),2*e-(e-L*Math.cos(A)),f+O*Math.sin(T),h-L*Math.cos(T),f,h];if(d)return D;S&&(D=D.concat(S));for(var R=0;R7&&(r.push(m.splice(0,7)),m.unshift("C"));break;case"S":var b=d,x=p;"C"!=e&&"S"!=e||(b+=b-n,x+=x-a),m=["C",b,x,m[1],m[2],m[3],m[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),m=o(d,p,f,h,m[1],m[2]);break;case"Q":f=m[1],h=m[2],m=o(d,p,m[1],m[2],m[3],m[4]);break;case"L":m=i(d,p,m[1],m[2]);break;case"H":m=i(d,p,m[1],p);break;case"V":m=i(d,p,d,m[1]);break;case"Z":m=i(d,p,l,c)}e=y,d=m[m.length-2],p=m[m.length-1],m.length>4?(n=m[m.length-4],a=m[m.length-3]):(n=d,a=p),r.push(m)}return r}},{}],258:[function(t,e,r){ /* object-assign (c) Sindre Sorhus @license MIT */ -"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){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;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),u=1;u * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT license. */ -"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":298}],266:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],a=e.escape||"___",i=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function i(e,i,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),a+s+a}r.forEach((function(t,n){for(var a,o=0;t!=a;)if(a=t,t=t.replace(e,i),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+a+r+"\\"+a+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+a+"([0-9]+)\\"+a);return i?r:function t(e,r,n){for(var a,i=[],s=0;a=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");i.push(e.slice(0,a.index)),i.push(t(r[a[1]],r)),e=e.slice(a.index+a[0].length)}return i.push(e),i}(r[0],r)}function a(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",a=t[0];if(!a)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;a!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=a,a=a.replace(i,s)}return a}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?a(t,e):n(t,e)}i.parse=n,i.stringify=a,e.exports=i},{}],267:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;arguments.length>1&&(t=arguments);"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]);t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{"pick-by-alias":273}],268:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length0;--o)i=l[o],r=s[o],s[o]=s[i],s[i]=r,l[o]=l[r],l[r]=i,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(t,e,r){switch(t){case 0:return 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]}var n,a,i,o=1;for((r=r||new Array(t))[0]=0,i=1;i0;--i)e=e-(n=e/o|0)*o|0,o=o/i|0,a=0|r[i],r[i]=0|r[n],r[n]=0|a;return r}},{"invert-permutation":243,"typedarray-pool":340}],273:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,o={};if("string"==typeof e&&(e=a(e)),Array.isArray(e)){var s={};for(i=0;i0){o=i[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=i[f][r],d=0;d0&&(o=p,s=g,l=f)}return a||o&&u(o,l),s}function f(t,r){var a=i[r][t][0],o=[t];u(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(i[0][t].length+i[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){i[0][o].length;var g=f(o,d);h(0,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":74}],275:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),a=new Array(e.length),i=new Array(e.length),o=[],s=0;s0;){var u=o.pop();a[u]=!1;var c=r[u];for(s=0;s0}))).length,v=new Array(g),m=new Array(g);for(d=0;d0;){var z=F.pop(),B=S[z];l(B,(function(t,e){return t-e}));var j,U=B.length,H=N[z];if(0===H){var V=p[z];j=[V]}for(d=0;d=0))if(N[Y]=1^H,F.push(Y),0===H)P(V=p[Y])||(V.reverse(),j.push(V))}0===H&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),a=t("planar-dual"),i=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,i=i.right}else if(u>0)i=i.left;else{if(!(u<0))return 0;s=1,i=i.right}}return s}}(m.slabs,m.coordinates);return 0===i.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(i),y)};var n=t("robust-orientation")[3],a=t("slab-decomposition"),i=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+a+r+"\\"+a+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+a+"([0-9]+)\\"+a);return i?r:function t(e,r,n){for(var a,i=[],s=0;a=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");i.push(e.slice(0,a.index)),i.push(t(r[a[1]],r)),e=e.slice(a.index+a[0].length)}return i.push(e),i}(r[0],r)}function a(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",a=t[0];if(!a)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;a!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=a,a=a.replace(i,s)}return a}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?a(t,e):n(t,e)}i.parse=n,i.stringify=a,e.exports=i},{}],261:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;arguments.length>1&&(t=arguments);"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]);t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{"pick-by-alias":265}],262:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length0){o=i[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=i[f][r],d=0;d0&&(o=p,s=g,l=f)}return a||o&&u(o,l),s}function f(t,r){var a=i[r][t][0],o=[t];u(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(i[0][t].length+i[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){i[0][o].length;var g=f(o,d);h(0,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":74}],267:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),a=new Array(e.length),i=new Array(e.length),o=[],s=0;s0;){var u=o.pop();a[u]=!1;var c=r[u];for(s=0;s0}))).length,v=new Array(g),m=new Array(g);for(d=0;d0;){var z=F.pop(),B=S[z];l(B,(function(t,e){return t-e}));var j,U=B.length,H=N[z];if(0===H){var V=p[z];j=[V]}for(d=0;d=0))if(N[Y]=1^H,F.push(Y),0===H)P(V=p[Y])||(V.reverse(),j.push(V))}0===H&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),a=t("planar-dual"),i=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,i=i.right}else if(u>0)i=i.left;else{if(!(u<0))return 0;s=1,i=i.right}}return s}}(m.slabs,m.coordinates);return 0===i.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(i),y)};var n=t("robust-orientation")[3],a=t("slab-decomposition"),i=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],282:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),g=!d&&e.pointBetween(s,u,c);if(h)return g?l(n,s):l(t,c),n;p&&(d||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=c(h,p);if(t)return t}return!!g&&c(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:a,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,u){var c=b[u];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(b[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),i(c,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var i=0;i 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},m.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},m.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},m.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>m.precisionThreshold||e.scale[1]*e.viewport.height>m.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=m.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},m.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var p=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),p||(e.passes[f]=p={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},m.defaults,t)),null!=t.thickness&&(p.thickness=parseFloat(t.thickness)),null!=t.opacity&&(p.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(p.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(p.overlay=!!t.overlay,f=P}));(D=D.slice(0,F)).push(P)}for(var N=function(t){var e=T.slice(2*I,2*D[t]).concat(P?T.slice(2*P):[]),r=(p.hole||[]).map((function(e){return e-P+(D[t]-I)})),n=u(e,r);n=n.map((function(e){return e+I+(e+It.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform bool constPointSize;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),v&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var d=m.float32(t);return a({data:d,usage:"dynamic"}),i({data:m.fract32(t,d),usage:"dynamic"}),s({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var a=r.activation;if(a.forEach((function(t){return t&&t.destroy&&t.destroy()})),a.length=0,e&&"number"!=typeof e[0]){for(var i=[],s=0,l=Math.min(e.length,r.count);s=0)return i;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===a.length?a[0]:a},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var a=.25*(t=t.slice()).length%e;a2?(s[0],s[2],n=s[1],a=s[3]):s.length?(n=s[0],a=s[1]):(s.x,n=s.y,s.x+s.width,a=s.y+s.height),l.length>2?(i=l[0],o=l[2],l[1],l[3]):l.length?(i=l[0],o=l[1]):(i=l.x,l.y,o=l.x+l.width,l.y+l.height),[i,n,o,a]}function d(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=c,c.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},c.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nT))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=i(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(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)||W(t.data))}function u(t,e,r,n,a,i){for(var o=0;o(a=s)&&(a=n.buffer.byteLength,5123===f?a>>=1:5125===f&&(a>>=2)),n.vertCount=a,a=o,0>o&&(a=4,1===(o=n.buffer.dimension)&&(a=0),2===o&&(a=1),3===o&&(a=4)),n.primType=a}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},u=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.uint32=5125),a.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)u(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,a=-1,o=0,h=0;Array.isArray(t)||W(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=K[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(a=0|t.count),"type"in t&&(h=c[t.type]),"length"in t?o=0|t.length:(o=a,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),i(f,e,r,n,a,o,h)}else u(),f.primType=4,f.vertCount=0,f.type=5121;return s}var u=r.create(null,34963,!0),f=new a(u._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return u.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new a(r.create(null,34963,!0,!1)._buffer)),i(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof a?t._elements:null},clear:function(){X(s).forEach(o)}}}function g(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,a=(i<<1>>>24)-127,i=i>>13&1023;e[r]=-24>a?n:-14>a?n+(i+1024>>-14-a):15>=a,r.height>>=a,d(r,n[a]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function O(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&N(this)}}),o.profile&&(i.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=a.texInfo;L.call(r);var i=C();return"number"==typeof t?k(i,0|t,"number"==typeof e?0|e:0|t):t?(D(r,t),E(i,t)):k(i,1,1),r.genMipmaps&&(i.mipmask=(i.width<<1)-1),a.mipmask=i.mipmask,u(a,i),a.internalformat=i.internalformat,n.width=i.width,n.height=i.height,P(a),S(i,3553),R(r,3553),F(),O(i),o.profile&&(a.stats.size=A(a.internalformat,a.type,i.width,i.height,r.genMipmaps,!1)),n.format=tt[a.internalformat],n.type=et[a.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=at[r.wrapS],n.wrapT=at[r.wrapT],n}var a=new I(3553);return yt[a.id]=a,i.textureCount++,n(e,r),n.subimage=function(t,e,r,i){e|=0,r|=0,i|=0;var o=m();return u(o,a),o.width=0,o.height=0,d(o,t),o.width=o.width||(a.width>>i)-e,o.height=o.height||(a.height>>i)-r,P(a),p(o,3553,e,r,i),F(),T(o),n},n.resize=function(e,r){var i=0|e,s=0|r||i;if(i===a.width&&s===a.height)return n;n.width=a.width=i,n.height=a.height=s,P(a);for(var l=0;a.mipmask>>l;++l){var u=i>>l,c=s>>l;if(!u||!c)break;t.texImage2D(3553,l,a.format,u,c,0,a.format,a.type,null)}return F(),o.profile&&(a.stats.size=A(a.internalformat,a.type,i,s,!1,!1)),n},n._reglType="texture2d",n._texture=a,o.profile&&(n.stats=a.stats),n.destroy=function(){a.decRef()},n},createCube:function(e,r,n,a,s,l){function f(t,e,r,n,a,i){var s,l=h.texInfo;for(L.call(l),s=0;6>s;++s)g[s]=C();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(g[0],t),E(g[1],e),E(g[2],r),E(g[3],n),E(g[4],a),E(g[5],i);else if(D(l,t),c(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)u(g[s],h),E(g[s],t[s]);else for(s=0;6>s;++s)E(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)k(g[s],t,t);for(u(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),s=0;6>s;++s)S(g[s],34069+s);for(R(l,34067),F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=at[l.wrapS],f.wrapT=at[l.wrapT],s=0;6>s;++s)O(g[s]);return f}var h=new I(34067);yt[h.id]=h,i.cubeCount++;var g=Array(6);return f(e,r,n,a,s,l),f.subimage=function(t,e,r,n,a){r|=0,n|=0,a|=0;var i=m();return u(i,h),i.width=0,i.height=0,d(i,e),i.width=i.width||(h.width>>a)-r,i.height=i.height||(h.height>>a)-n,P(h),p(i,34069+t,r,n,a),F(),T(i),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);R(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ea;++a){for(u=0;ut;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){X(T).forEach(v)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,X(T).forEach((function(e){e.framebuffer=t.createFramebuffer(),m(e)}))}})}function k(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function E(t,e,r,n,a,i,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var u=r.maxAttributes,c=Array(u);for(r=0;r=h.byteLength?u.subdata(h):(u.destroy(),r.buffers[s]=null)),r.buffers[s]||(u=r.buffers[s]=a.create(c,34962,!1,!0)),f.buffer=a.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else a.getBuffer(c)?(f.buffer=a.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):a.getBuffer(c.buffer)?(f.buffer=a.getBuffer(c.buffer),f.size=0|(+c.size||f.buffer.dimension),f.normalized=!!c.normalized||!1,f.type="type"in c?Q[c.type]:f.buffer.dtype,f.offset=0|(c.offset||0),f.stride=0|(c.stride||0),f.divisor=0|(c.divisor||0),f.state=1):"x"in c&&(f.x=+c.x||0,f.y=+c.y||0,f.z=+c.z||0,f.w=+c.w||0,f.state=2)}for(u=0;ut&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);X(u).forEach(e),u={},X(c).forEach(e),c={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,a,i){var o=f[n];o||(o=f[n]={});var d=o[e];if(d&&(d.refCount++,!i))return d;var p=new s(n,e);return r.shaderCount++,l(p,a,i),d||(o[e]=p),h.push(p),j(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=h.indexOf(p);h.splice(e,1),r.shaderCount--}0>=o[p.vertId].refCount&&(t.deleteShader(c[p.vertId]),delete c[p.vertId],delete f[p.fragId][p.vertId]),Object.keys(f[p.fragId]).length||(t.deleteShader(u[p.fragId]),delete u[p.fragId],delete f[p.fragId])}})},restore:function(){u={},c={};for(var t=0;t"+e+"?"+a+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",a,".buffer)){",c,"=",i,".createStream(",34962,",",a,".buffer);","}else{",c,"=",i,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",c,".dtype;",l.normalized,"=!!",a,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",i,".destroyStream(",c,");","}"),l}))})),o}function M(t,e,n,a,o){function s(t){var e=u[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,g,v,s],");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[p,v,m,g+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[p,g,v]+");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,f=u.draw,h=n.draw,d=function(){var a=h.elements,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i),h.elementsActive&&i("if("+a+")"+c+".bindBuffer(34963,"+a+".buffer.buffer);")):(a=i.def(),i(a,"=",f,".","elements",";","if(",a,"){",c,".bindBuffer(",34963,",",a,".buffer.buffer);}","else if(",u.vao,".currentVAO){",a,"=",t.shared.elements+".getElements("+u.vao,".currentVAO.elements);",nt?"":"if("+a+")"+c+".bindBuffer(34963,"+a+".buffer.buffer);","}")),a}(),p=a("primitive"),g=a("offset"),v=function(){var a=h.count,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(f,".","count"),a}();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");tt&&(s=a("instances"),l=t.instancing);var m=d+".type",y=h.elements&&P(h.elements)&&!h.vaoActive;tt&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),i(),r("}else if(",s,"<0){"),o(),r("}")):i():o()}function G(t,e,r,n,a){return a=(e=x()).proc("body",a),tt&&(e.instancing=a.def(e.shared.extensions,".angle_instanced_arrays")),t(e,a,r,n),e.compile().body}function q(t,e,r,n){z(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,r,n.attributes,(function(){return!0}))),V(t,e,r,n.uniforms,(function(){return!0}),!1),Y(t,e,e,r)}function W(t,e,r,n){function a(){return!0}t.batchId="a1",z(t,e),U(t,e,r,n.attributes,a),V(t,e,r,n.uniforms,a,!1),Y(t,e,e,r)}function X(t,e,r,n){function a(t){return t.contextDep&&o||t.propDep}function i(t){return!a(t)}z(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&k(t,c,r.context),r.needsFramebuffer&&E(t,c,r.framebuffer),C(t,c,r.state,a),r.profile&&a(r.profile)&&B(t,c,r,!1,!0),n?(r.useVAO?r.drawVAO?a(r.drawVAO)?c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),U(t,u,r,n.attributes,i),U(t,c,r,n.attributes,a)),V(t,u,r,n.uniforms,i,!1),V(t,c,r,n.uniforms,a,!0),Y(t,u,c,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,c),l=c.def(n,".id"),u=c.def(e,"[",l,"]"),c(t.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",e,"[",l,"]=",t.link((function(e){return G(W,t,r,e,2)})),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function Z(t,r){function n(e){var n=r.shader[e];n&&a.set(i.shader,"."+e,n.append(t,a))}var a=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;k(t,a,r.context),r.framebuffer&&r.framebuffer.append(t,a),R(Object.keys(r.state)).forEach((function(e){var n=r.state[e].append(t,a);v(n)?n.forEach((function(r,n){a.set(t.next[e],"["+n+"]",r)})):a.set(i.next,"."+e,n)})),B(t,a,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&a.set(i.draw,"."+e,""+n.append(t,a))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,a);Array.isArray(o)&&(o="["+o.join()+"]"),a.set(i.uniforms,"["+e.id(n)+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,a),i=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){a.set(i,"."+t,n[t])}))})),r.scopeVAO&&a.set(i.vao,".targetVAO",r.scopeVAO.append(t,a)),n("vert"),n("frag"),0=--this.refCount&&o(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach((function(e){t+=c[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,i=0,c=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(i=e.shape)[0],i=0|i[1]):("radius"in e&&(n=i=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(i=0|e.height)),"format"in e&&(c=s[e.format])):"number"==typeof e?(n=0|e,i="number"==typeof r?0|r:n):e||(n=i=1),n!==u.width||i!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=i,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,i),a.profile&&(u.stats.size=mt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new i(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,i=0|r||n;return n===u.width&&i===u.height||(o.width=u.width=n,o.height=u.height=i,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,i),a.profile&&(u.stats.size=mt[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,a.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){X(c).forEach(o)},restore:function(){X(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},bt=[];bt[6408]=4,bt[6407]=3;var xt=[];xt[5121]=1,xt[5126]=4,xt[36193]=2;var _t=["x","y","z","w"],wt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),At={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},Tt={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},Mt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},kt={cw:2304,ccw:2305},Et=new I(!1,!1,!1,(function(){}));return function(t){function e(){if(0===J.length)w&&w.update(),tt=null;else{tt=V.next(e),f();for(var t=J.length-1;0<=t;--t){var r=J[t];r&&r(L,null,0)}v.flush(),w&&w.update()}}function r(){!tt&&0=J.length&&n()}}}}function c(){var t=X.viewport,e=X.scissor_box;t[0]=t[1]=e[0]=e[1]=0,L.viewportWidth=L.framebufferWidth=L.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,L.viewportHeight=L.framebufferHeight=L.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){L.tick+=1,L.time=g(),c(),W.procs.poll()}function h(){N.refresh(),c(),W.procs.refresh(),w&&w.update()}function g(){return(Y()-A)/1e3}if(!(t=a(t)))return null;var v=t.gl,m=v.getContextAttributes();v.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},a=0;ae;++e)et(j({framebuffer:t.framebuffer.faces[e]},t),l);else et(t,l);else l(0,t)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:s({}),buffer:function(t){return R.create(t,34962,!1,!1)},elements:function(t){return I.create(t,!1)},texture:N.create2D,cube:N.createCube,renderbuffer:U.create,framebuffer:G.create,framebufferCube:G.createCube,vao:P.createVAO,attributes:m,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=Q;break;case"restore":r=K;break;case"destroy":r=$}return r.push(e),{cancel:function(){for(var t=0;t=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],273:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),g=!d&&e.pointBetween(s,u,c);if(h)return g?l(n,s):l(t,c),n;p&&(d||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=c(h,p);if(t)return t}return!!g&&c(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:a,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,u){var c=b[u];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(b[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),i(c,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var i=0;i 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},m.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},m.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},m.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>m.precisionThreshold||e.scale[1]*e.viewport.height>m.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=m.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},m.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var p=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),p||(e.passes[f]=p={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},m.defaults,t)),null!=t.thickness&&(p.thickness=parseFloat(t.thickness)),null!=t.opacity&&(p.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(p.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(p.overlay=!!t.overlay,f=P}));(D=D.slice(0,F)).push(P)}for(var N=function(t){var e=T.slice(2*I,2*D[t]).concat(P?T.slice(2*P):[]),r=(p.hole||[]).map((function(e){return e-P+(D[t]-I)})),n=u(e,r);n=n.map((function(e){return e+I+(e+It.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform bool constPointSize;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),v&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var d=m.float32(t);return a({data:d,usage:"dynamic"}),i({data:m.fract32(t,d),usage:"dynamic"}),s({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var a=r.activation;if(a.forEach((function(t){return t&&t.destroy&&t.destroy()})),a.length=0,e&&"number"!=typeof e[0]){for(var i=[],s=0,l=Math.min(e.length,r.count);s=0)return i;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===a.length?a[0]:a},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var a=.25*(t=t.slice()).length%e;a2?(s[0],s[2],n=s[1],a=s[3]):s.length?(n=s[0],a=s[1]):(s.x,n=s.y,s.x+s.width,a=s.y+s.height),l.length>2?(i=l[0],o=l[2],l[1],l[3]):l.length?(i=l[0],o=l[1]):(i=l.x,l.y,o=l.x+l.width,l.y+l.height),[i,n,o,a]}function d(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=c,c.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},c.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nT))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=i(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(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)||W(t.data))}function u(t,e,r,n,a,i){for(var o=0;o(a=s)&&(a=n.buffer.byteLength,5123===f?a>>=1:5125===f&&(a>>=2)),n.vertCount=a,a=o,0>o&&(a=4,1===(o=n.buffer.dimension)&&(a=0),2===o&&(a=1),3===o&&(a=4)),n.primType=a}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},u=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.uint32=5125),a.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)u(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,a=-1,o=0,h=0;Array.isArray(t)||W(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=K[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(a=0|t.count),"type"in t&&(h=c[t.type]),"length"in t?o=0|t.length:(o=a,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),i(f,e,r,n,a,o,h)}else u(),f.primType=4,f.vertCount=0,f.type=5121;return s}var u=r.create(null,34963,!0),f=new a(u._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return u.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new a(r.create(null,34963,!0,!1)._buffer)),i(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof a?t._elements:null},clear:function(){X(s).forEach(o)}}}function g(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,a=(i<<1>>>24)-127,i=i>>13&1023;e[r]=-24>a?n:-14>a?n+(i+1024>>-14-a):15>=a,r.height>>=a,d(r,n[a]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function O(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&N(this)}}),o.profile&&(i.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=a.texInfo;L.call(r);var i=C();return"number"==typeof t?M(i,0|t,"number"==typeof e?0|e:0|t):t?(D(r,t),E(i,t)):M(i,1,1),r.genMipmaps&&(i.mipmask=(i.width<<1)-1),a.mipmask=i.mipmask,u(a,i),a.internalformat=i.internalformat,n.width=i.width,n.height=i.height,P(a),S(i,3553),R(r,3553),F(),O(i),o.profile&&(a.stats.size=A(a.internalformat,a.type,i.width,i.height,r.genMipmaps,!1)),n.format=tt[a.internalformat],n.type=et[a.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=at[r.wrapS],n.wrapT=at[r.wrapT],n}var a=new I(3553);return yt[a.id]=a,i.textureCount++,n(e,r),n.subimage=function(t,e,r,i){e|=0,r|=0,i|=0;var o=m();return u(o,a),o.width=0,o.height=0,d(o,t),o.width=o.width||(a.width>>i)-e,o.height=o.height||(a.height>>i)-r,P(a),p(o,3553,e,r,i),F(),T(o),n},n.resize=function(e,r){var i=0|e,s=0|r||i;if(i===a.width&&s===a.height)return n;n.width=a.width=i,n.height=a.height=s,P(a);for(var l=0;a.mipmask>>l;++l){var u=i>>l,c=s>>l;if(!u||!c)break;t.texImage2D(3553,l,a.format,u,c,0,a.format,a.type,null)}return F(),o.profile&&(a.stats.size=A(a.internalformat,a.type,i,s,!1,!1)),n},n._reglType="texture2d",n._texture=a,o.profile&&(n.stats=a.stats),n.destroy=function(){a.decRef()},n},createCube:function(e,r,n,a,s,l){function f(t,e,r,n,a,i){var s,l=h.texInfo;for(L.call(l),s=0;6>s;++s)g[s]=C();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(g[0],t),E(g[1],e),E(g[2],r),E(g[3],n),E(g[4],a),E(g[5],i);else if(D(l,t),c(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)u(g[s],h),E(g[s],t[s]);else for(s=0;6>s;++s)E(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(g[s],t,t);for(u(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),s=0;6>s;++s)S(g[s],34069+s);for(R(l,34067),F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=at[l.wrapS],f.wrapT=at[l.wrapT],s=0;6>s;++s)O(g[s]);return f}var h=new I(34067);yt[h.id]=h,i.cubeCount++;var g=Array(6);return f(e,r,n,a,s,l),f.subimage=function(t,e,r,n,a){r|=0,n|=0,a|=0;var i=m();return u(i,h),i.width=0,i.height=0,d(i,e),i.width=i.width||(h.width>>a)-r,i.height=i.height||(h.height>>a)-n,P(h),p(i,34069+t,r,n,a),F(),T(i),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);R(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ea;++a){for(u=0;ut;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){X(T).forEach(v)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,X(T).forEach((function(e){e.framebuffer=t.createFramebuffer(),m(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function E(t,e,r,n,a,i,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var u=r.maxAttributes,c=Array(u);for(r=0;r=h.byteLength?u.subdata(h):(u.destroy(),r.buffers[s]=null)),r.buffers[s]||(u=r.buffers[s]=a.create(c,34962,!1,!0)),f.buffer=a.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else a.getBuffer(c)?(f.buffer=a.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):a.getBuffer(c.buffer)?(f.buffer=a.getBuffer(c.buffer),f.size=0|(+c.size||f.buffer.dimension),f.normalized=!!c.normalized||!1,f.type="type"in c?Q[c.type]:f.buffer.dtype,f.offset=0|(c.offset||0),f.stride=0|(c.stride||0),f.divisor=0|(c.divisor||0),f.state=1):"x"in c&&(f.x=+c.x||0,f.y=+c.y||0,f.z=+c.z||0,f.w=+c.w||0,f.state=2)}for(u=0;ut&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);X(u).forEach(e),u={},X(c).forEach(e),c={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,a,i){var o=f[n];o||(o=f[n]={});var d=o[e];if(d&&(d.refCount++,!i))return d;var p=new s(n,e);return r.shaderCount++,l(p,a,i),d||(o[e]=p),h.push(p),j(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=h.indexOf(p);h.splice(e,1),r.shaderCount--}0>=o[p.vertId].refCount&&(t.deleteShader(c[p.vertId]),delete c[p.vertId],delete f[p.fragId][p.vertId]),Object.keys(f[p.fragId]).length||(t.deleteShader(u[p.fragId]),delete u[p.fragId],delete f[p.fragId])}})},restore:function(){u={},c={};for(var t=0;t"+e+"?"+a+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",a,".buffer)){",c,"=",i,".createStream(",34962,",",a,".buffer);","}else{",c,"=",i,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",c,".dtype;",l.normalized,"=!!",a,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",i,".destroyStream(",c,");","}"),l}))})),o}function k(t,e,n,a,o){function s(t){var e=u[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,g,v,s],");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[p,v,m,g+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[p,g,v]+");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,f=u.draw,h=n.draw,d=function(){var a=h.elements,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i),h.elementsActive&&i("if("+a+")"+c+".bindBuffer(34963,"+a+".buffer.buffer);")):(a=i.def(),i(a,"=",f,".","elements",";","if(",a,"){",c,".bindBuffer(",34963,",",a,".buffer.buffer);}","else if(",u.vao,".currentVAO){",a,"=",t.shared.elements+".getElements("+u.vao,".currentVAO.elements);",nt?"":"if("+a+")"+c+".bindBuffer(34963,"+a+".buffer.buffer);","}")),a}(),p=a("primitive"),g=a("offset"),v=function(){var a=h.count,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(f,".","count"),a}();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");tt&&(s=a("instances"),l=t.instancing);var m=d+".type",y=h.elements&&P(h.elements)&&!h.vaoActive;tt&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),i(),r("}else if(",s,"<0){"),o(),r("}")):i():o()}function G(t,e,r,n,a){return a=(e=x()).proc("body",a),tt&&(e.instancing=a.def(e.shared.extensions,".angle_instanced_arrays")),t(e,a,r,n),e.compile().body}function q(t,e,r,n){z(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,r,n.attributes,(function(){return!0}))),V(t,e,r,n.uniforms,(function(){return!0}),!1),Y(t,e,e,r)}function W(t,e,r,n){function a(){return!0}t.batchId="a1",z(t,e),U(t,e,r,n.attributes,a),V(t,e,r,n.uniforms,a,!1),Y(t,e,e,r)}function X(t,e,r,n){function a(t){return t.contextDep&&o||t.propDep}function i(t){return!a(t)}z(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&M(t,c,r.context),r.needsFramebuffer&&E(t,c,r.framebuffer),C(t,c,r.state,a),r.profile&&a(r.profile)&&B(t,c,r,!1,!0),n?(r.useVAO?r.drawVAO?a(r.drawVAO)?c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),U(t,u,r,n.attributes,i),U(t,c,r,n.attributes,a)),V(t,u,r,n.uniforms,i,!1),V(t,c,r,n.uniforms,a,!0),Y(t,u,c,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,c),l=c.def(n,".id"),u=c.def(e,"[",l,"]"),c(t.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",e,"[",l,"]=",t.link((function(e){return G(W,t,r,e,2)})),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function Z(t,r){function n(e){var n=r.shader[e];n&&a.set(i.shader,"."+e,n.append(t,a))}var a=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;M(t,a,r.context),r.framebuffer&&r.framebuffer.append(t,a),R(Object.keys(r.state)).forEach((function(e){var n=r.state[e].append(t,a);v(n)?n.forEach((function(r,n){a.set(t.next[e],"["+n+"]",r)})):a.set(i.next,"."+e,n)})),B(t,a,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&a.set(i.draw,"."+e,""+n.append(t,a))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,a);Array.isArray(o)&&(o="["+o.join()+"]"),a.set(i.uniforms,"["+e.id(n)+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,a),i=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){a.set(i,"."+t,n[t])}))})),r.scopeVAO&&a.set(i.vao,".targetVAO",r.scopeVAO.append(t,a)),n("vert"),n("frag"),0=--this.refCount&&o(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach((function(e){t+=c[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,i=0,c=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(i=e.shape)[0],i=0|i[1]):("radius"in e&&(n=i=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(i=0|e.height)),"format"in e&&(c=s[e.format])):"number"==typeof e?(n=0|e,i="number"==typeof r?0|r:n):e||(n=i=1),n!==u.width||i!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=i,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,i),a.profile&&(u.stats.size=mt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new i(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,i=0|r||n;return n===u.width&&i===u.height||(o.width=u.width=n,o.height=u.height=i,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,i),a.profile&&(u.stats.size=mt[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,a.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){X(c).forEach(o)},restore:function(){X(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},bt=[];bt[6408]=4,bt[6407]=3;var xt=[];xt[5121]=1,xt[5126]=4,xt[36193]=2;var _t=["x","y","z","w"],wt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),At={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},Tt={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},kt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Mt={cw:2304,ccw:2305},Et=new I(!1,!1,!1,(function(){}));return function(t){function e(){if(0===J.length)w&&w.update(),tt=null;else{tt=V.next(e),f();for(var t=J.length-1;0<=t;--t){var r=J[t];r&&r(L,null,0)}v.flush(),w&&w.update()}}function r(){!tt&&0=J.length&&n()}}}}function c(){var t=X.viewport,e=X.scissor_box;t[0]=t[1]=e[0]=e[1]=0,L.viewportWidth=L.framebufferWidth=L.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,L.viewportHeight=L.framebufferHeight=L.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){L.tick+=1,L.time=g(),c(),W.procs.poll()}function h(){N.refresh(),c(),W.procs.refresh(),w&&w.update()}function g(){return(Y()-A)/1e3}if(!(t=a(t)))return null;var v=t.gl,m=v.getContextAttributes();v.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},a=0;ae;++e)et(j({framebuffer:t.framebuffer.faces[e]},t),l);else et(t,l);else l(0,t)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:s({}),buffer:function(t){return R.create(t,34962,!1,!1)},elements:function(t){return I.create(t,!1)},texture:N.create2D,cube:N.createCube,renderbuffer:U.create,framebuffer:G.create,framebufferCube:G.createCube,vao:P.createVAO,attributes:m,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=Q;break;case"restore":r=K;break;case"destroy":r=$}return r.push(e),{cancel:function(){for(var t=0;t * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ -"use strict";var n,a="";e.exports=function(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(n!==t||void 0===n)n=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=(a+=t).substr(0,r)}},{}],299:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-subtract"),o=t("robust-scale");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=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],f=e[2]-n[2],d=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=5;)d.push(c(d.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],307:[function(t,e,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],308:[function(t,e,r){"use strict";var n=t("bit-twiddle"),a=t("union-find");function i(t,e){var r=t.length,n=t.length-e.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||a(t[0],t[1])-a(e[0],e[1]);case 3:var i=t[0]+t[1],o=e[0]+e[1];if(s=i+t[2]-(o+e[2]))return s;var s,l=a(t[0],t[1]),u=a(e[0],e[1]);return(s=a(l,t[2])-a(u,e[2]))||a(l+t[2],i)-a(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;h>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=T[0];return v(0,k-1),k-=1,b(0),t}return-1}function w(t,e){var r=T[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((k+=1)-1))}function A(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),M[e]>=0&&w(M[e],g(e)),M[r]>=0&&w(M[r],g(r))}}var T=[],M=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;A(E)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=M[e],a=M[r];n!==a&&O.push([n,a])}})),a.unique(a.normalize(O)),{positions:S,edges:O}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":300,"simplicial-complex":308}],311:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(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=n(s,o,i),u=n(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]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return a;d=f[h]}}if(d.start)if(s){var p=i(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=d.index)}else a=d.index;else d.y!==t[1]&&(a=d.index)}}}return a}},{"./lib/order-segments":311,"binary-search-bounds":312,"functional-red-black-tree":165,"robust-orientation":300}],314:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+a+l:"0"===u?h+l+a:l+h+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],315:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;i.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(M="+"+v[x]+"*c");var k=p[x].length/y*.5,E=.5+m[x]/y*.5;T.push("d"+x+"-"+E+"-"+k+"*("+p[x].join("+")+M+")/("+g[x].join("+")+")")}h.push("a.push([",T.join(),"]);","break;")}i.push("}},"),f.length>0&&h.push("}}");var S=[];for(u=0;u<1<1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,u=t.cy,c=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===c||0===f)return[];var b=Math.sin(d*a/360),x=Math.cos(d*a/360),_=x*(e-l)/2+b*(r-u)/2,w=-b*(e-l)/2+x*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var T=function(t,e,r,n,i,o,l,u,c,f,h,d){var p=Math.pow(i,2),g=Math.pow(o,2),v=Math.pow(h,2),m=Math.pow(d,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===u?-1:1))*i/o*d,x=y*-o/i*h,_=f*b-c*x+(t+r)/2,w=c*b+f*x+(e+n)/2,A=(h-b)/i,T=(d-x)/o,M=(-h-b)/i,k=(-d-x)/o,E=s(1,0,A,T),S=s(A,T,M,k);return 0===u&&S>0&&(S-=a),1===u&&S<0&&(S+=a),[_,w,E,S]}(e,r,l,u,c,f,g,m,b,x,_,w),M=n(T,4),k=M[0],E=M[1],S=M[2],C=M[3],O=Math.abs(C)/(a/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);C/=L;for(var D=0;De[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":17,assert:23,"is-svg-path":252,"normalize-svg-path":319,"parse-svg-path":268}],319:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,h=0,d=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":317}],320:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=u.width=e.w||e.width||200,f=u.height=e.h||e.height||200);var h=Math.min(r,f),d=e.stroke||0,p=e.viewbox||e.viewBox||a(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d));if(c.translate(.5*r,.5*f),c.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);c.fill(m),d&&c.stroke(m)}else{var y=i(t);o(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":47,"draw-svg-path":97,"is-svg-path":252,"parse-svg-path":268,"svg-path-bounds":318}],321:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(f+=.02);var d=new Float32Array(c),p=0,g=-.5*f;for(h=0;h=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":287,timers:322}],323:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(E[t])t=E[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:F(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,g=e.b,a={r:255*O(d,255),g:255*O(p,255),b:255*O(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=I(e.s),u=I(e.v),a=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=I(e.s),c=I(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var d,p,g;return i=C(i),{ok:f,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16)),R(P(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:I(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.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"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var N,z,B,j=(z="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",B="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+B),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],324:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=a(t));for(var r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":331}],333:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":339}],334:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":330,"./is":335}],335:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":329}],336:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":333}],337:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":333,"../value/is":339}],338:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":330,"./is":339}],339:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],340:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,u=e.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=a([32,0])),u.BIGUINT64||(u.BIGUINT64=a([32,0])),u.BIGINT64||(u.BIGINT64=a([32,0])),u.BUFFER||(u.BUFFER=a([32,0]));var c=u.DATA,f=u.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);c[r].push(t)}}function d(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function A(t){return s?new BigUint64Array(d(8*t),0,t):null}function T(t){return l?new BigInt64Array(d(8*t),0,t):null}function M(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return A(t);case"buffer":return k(t);case"data":case"dataview":return M(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=T,r.mallocDataView=M,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":46,buffer:58,dup:99}],341:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",E())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],d=c>>13;u=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(g>>5&15)-1,(31&g)+s);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var d,p=f[i.year-f[0]];for(d=0;d<13;d++){var g=p&1<<12-d?30:29;if(l>13;!v||d=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":365,"object-assign":264}],354:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":365,"object-assign":264}],355:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":365,"object-assign":264}],356:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":365,"object-assign":264}],357:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":365,"object-assign":264}],358:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":365,"object-assign":264}],359:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":365,"object-assign":264}],360:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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),f=t-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":365,"object-assign":264}],362:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":365,"object-assign":264}],363:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":365,"object-assign":264}],364:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":365,"object-assign":264}],365:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":264}],366:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var a=""+e;if(d(t,n))for(;a.length1},b=function(t,r){var n=y(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(M).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(M));return M+=t.length,t}return b("m")},w=function(t,r,n,i){for(var o=y(t,i)?n:r,s=0;s-1){d=1,p=g;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":365,"object-assign":264}],367:[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":85}],368:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":367}],369:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],370:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":493,"../../plot_api/plot_template":558,"../../plots/cartesian/constants":576,"../../plots/font_attributes":598,"./arrow_paths":369}],371:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":519,"../../plots/cartesian/axes":569,"./draw":376}],372:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=at.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(K=e[et],J=pt?at._offset+at._length*K:J=A.l+A.w*K):(K=1-e[et],J=pt?at._offset+at._length*K:J=A.t+A.h*K),$=e.showarrow?.5:K}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*Y(.5,e.xanchor)-st*Y(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=A.t+A.h*gt):ft.tail=A.l+A.w*gt:ft.tail=at._offset+at.r2p(gt),Q=tt}else ft.tail=J+gt,Q=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ct,ft.head+=ct}else Q=tt=lt*Y($,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,Q+=ct,e["_"+et+"padplus"]=lt/2+Q,e["_"+et+"padminus"]=lt/2-Q,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)F.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(M-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(P-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(c.setClipUrl,U?C:null,t);else{var wt=B+_t-g.top,At=B+xt-g.left;G.call(h.positionText,At,wt).call(c.setClipUrl,U?C:null,t)}H.select("rect").call(c.setRect,B,B,M,P),j.call(c.setRect,N/2,N/2,z-N,V-N),F.call(c.setTranslate,Math.round(O.x.text-z/2),Math.round(O.y.text-V/2)),R.attr({transform:"rotate("+L+","+O.x.text+","+O.y.text+")"});var Tt,Mt=function(r,n){D.selectAll(".annotation-arrow-g").remove();var l=O.x.head,f=O.y.head,h=O.x.tail+r,d=O.y.tail+n,g=O.x.text+r,x=O.y.text+n,_=o.rotationXYMatrix(L,g,x),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),C=+j.attr("width"),I=+j.attr("height"),P=g-.5*C,N=P+C,z=x-.5*I,B=z+I,U=[[P,z,P,B],[P,B,N,B],[N,B,N,z],[N,z,P,z]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,V=e.arrowcolor,Y=e.arrowside,G=D.append("g").style({opacity:u.opacity(V)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(u.stroke,u.rgb(V));if(v(q,Y,e),T.annotationPosition&&q.node().parentNode&&!i){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,Q,K=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:K.node(),gd:t,prepFn:function(){var t=c.getTranslate(F);J=t.x,Q=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,Q),a=n[0]+t,i=n[1]+r;F.call(c.setTranslate,a,i),E("x",y(m,t,"x",A,e)),E("y",y(b,r,"y",A,e)),e.axref===e.xref&&E("ax",y(m,t,"ax",A,e)),e.ayref===e.yref&&E("ay",y(b,r,"ay",A,e)),G.attr("transform",s(t,r)),R.attr({transform:"rotate("+L+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),I)p.init({element:F.node(),gd:t,prepFn:function(){Tt=R.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?E("ax",y(m,t,"ax",A,e)):E("ax",e.ax+t),e.ayref===e.yref?E("ay",y(b,r,"ay",A.w,e)):E("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",A,e);else{var l=e._xsize/A.w,u=e.x+(e._xshift-e.xshift)/A.w-l/2;a=p.align(u+t/A.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",A,e);else{var c=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-c/2;o=p.align(f-r/A.h,c,0,1,e.yanchor)}E("x",a),E("y",o),m&&b||(n=p.getCursor(m?.5:a,b?.5:o,e.xanchor,e.yanchor))}R.attr({transform:s(t,r)+Tt}),d(F,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(F),a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===d.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,A=o.y-c.y;if(h=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var T=x*Math.cos(f),M=x*Math.sin(f);c.x+=T,c.y+=M,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+A*A)return void I();var k=_*Math.cos(f),E=_*Math.sin(f);o.x-=k,o.y-=E,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),C="";if(S1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":605,"../annotations/draw":376}],383:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*u.roundUp(Z/J,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(q.tick0=0)}q.dtick=W}q.domain=[V+j,V+N-j],q.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var Q,K=t.select("."+M.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+M.cbaxis),tt=0;function et(n,a){var i={propContainer:q,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k)){var t,r=l.l+(e.x+z)*l.w,n=q.title.font.size;t="top"===k?(1-(V+N-j))*l.h+l.t+3+.75*n:(1-(V+j))*l.h+l.t-3-.25*n,et(q._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(k)){var i=t.select("."+M.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+q._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*w),h?(tt=d.bBox(h).height)>p&&(f[1]-=(tt-p)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=d.bBox(o.node()).height),tt){if(tt+=5,"top"===k)q.domain[1]-=tt/l.h,f[1]*=-1;else{q.domain[0]+=tt/l.h;var g=v.lineCount(o);f[1]+=(1-g)*p}i.attr("transform",c(f[0],f[1])),q.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",c(0,Math.round(l.h*(1-q.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var y=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(D);y.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),y.exit().remove();var b=E.map(q.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?E[0]:(D[i]+D[i-1])/2,i===D.length-1?E[1]:(D[i]+D[i+1])/2].map(q.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var s=n.select(this).attr({x:U,width:Math.max(I,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)d.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=C(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+M.cblines).selectAll("path."+M.cbline).data(m.color&&m.width?R:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(q.c2p(t))+m.width/2%1)+"h"+I).call(d.lineGroupStyle,m.width,S(t),m.dash)})),$.selectAll("g."+q._id+"tick,path").remove();var _=U+I+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(q),T=s.getTickSigns(q)[2];return s.drawTicks(r,q,{vals:"inside"===q.ticks?s.clipEnds(q,A):A,layer:$,path:s.makeTickPath(q,_,T),transFn:s.makeTransTickFn(q)}),s.drawLabels(r,q,{vals:A,layer:$,transFn:s.makeTransTickLabelFn(q),labelFns:s.makeLabelFns(q,_)})},function(){if(-1===["top","bottom"].indexOf(k)){var t=q.title.font.size,e=q._offset+q._length/2,a=l.l+(q.position||0)*l.w+("right"===q.side?10+t*(q.showticklabels?1:.5):-10-t*(q.showticklabels?.5:0));et("h"+q._id+"title",{avoid:{selection:n.select(r).selectAll("g."+q._id+"tick"),side:k,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=I+e.outlinewidth/2;if(-1===q.ticklabelposition.indexOf("inside")&&(n+=d.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(M.jsPlaceholder)){var a,o=K.select(".h"+q._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(k)?d.bBox(o).width:d.bBox(K.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=Y-G;t.select("."+M.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:U,y:G+e.ypad+("top"===k?tt:0),width:Math.max(I,2),height:Math.max(u-2*e.ypad-tt,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-f,l.t));var h={},g=A[e.yanchor],v=T[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*g,h.b=u*v):(h.t=h.b=0,h.yt=e.y+e.len*g,h.yb=e.y-e.len*v);var m=A[e.xanchor],y=T[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*m,h.r=s*y;else{var b=s-I;h.l=b*m,h.r=b*y,h.xl=e.x-e.thickness*m,h.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,h)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":492,"../../lib":519,"../../lib/extend":511,"../../lib/setcursor":540,"../../lib/svg_text_utils":545,"../../plots/cartesian/axes":569,"../../plots/cartesian/axis_defaults":571,"../../plots/cartesian/layout_attributes":584,"../../plots/cartesian/position_defaults":587,"../../plots/plots":608,"../../registry":610,"../color":387,"../colorscale/helpers":398,"../dragelement":406,"../drawing":409,"../titles":485,"./constants":389,"@plotly/d3":14,tinycolor2:323}],392:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":519}],393:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":388,"./defaults":390,"./draw":391,"./has_colorbar":392}],394:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var d=i+"auto",p=i+"min",g=i+"max",v=i+"mid",m=(s(h+d),s(h+p),s(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":536,"../../lib/sort_object_keys":542,"../colorbar/attributes":388,"./scales.js":402}],395:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":519,"./helpers":398,"fast-isnumeric":161}],396:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],404:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":519}],405:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],406:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":519,"../../plots/cartesian/constants":576,"./align":403,"./cursor":404,"./unhover":407,"has-hover":238,"has-passive-events":239,"mouse-event-offset":255}],407:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":509,"../../lib/events":510,"../../lib/throttle":546,"../fx/constants":421}],408:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],409:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),f=a.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};b.font=function(t,e,r,n){a.isPlainObject(e)&&(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(u.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,a){t.call(b.setPosition,e,r).call(b.setSize,n,a)},b.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",f(a,i)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);b.translatePoint(t,a,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";u.stroke(e,n||i.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(u.stroke,r||i.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},b.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(u.fill,e)},b.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(u.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(t,e){var r=t%100;return b.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(t))t=+t;else 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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},M=i("~f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:A},horizontalreversed:{node:"linearGradient",attrs:A,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=k[i],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},b.pattern=function(t,e,r,i,o,s,l,c,f,h,d,p){var g="legend"===e;c&&("overlay"===f?(h=c,d=u.contrast(h)):(h=void 0,d=c));var v,m,y,b,x,_,w,A,T,M,k,E=r._fullLayout,S="p"+E._uid+"-"+i,C={};switch(o){case"/":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",C={d:y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"\\":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",C={d:y="M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"x":v=s*Math.sqrt(2),m=s*Math.sqrt(2),y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2+"M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,b=s-s*Math.sqrt(1-l),_="path",C={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case"|":_="path",_="path",C={d:y="M"+(v=s)/2+",0L"+v/2+","+(m=s),opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"-":_="path",_="path",C={d:y="M0,"+(m=s)/2+"L"+(v=s)+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"+":_="path",y="M"+(v=s)/2+",0L"+v/2+","+(m=s)+"M0,"+m/2+"L"+v+","+m/2,b=s-s*Math.sqrt(1-l),_="path",C={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case".":v=s,m=s,l.pattern_filled";E._patternUrlQueryParts[D]=1},b.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},b.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},b.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(c,l))}var f,h,d,p=!1;if(t.so)d=s.outlierwidth,h=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=u.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=o.gradient,m=t.mgt;m?p=!0:m=v&&v.type,a.isArrayOrTypedArray(m)&&(m=m[0],k[m]||(m=0));var y=o.pattern,x=y&&b.getPatternAttr(y.shape,t.i,"");if(m&&"none"!==m){var _=t.mgc;_?p=!0:_=v.color;var A=r.uid;p&&(A+="-"+t.i),b.gradient(e,i,A,m,[[0,_],[1,f]],"fill")}else if(x){var T=b.getPatternAttr(y.bgcolor,t.i,null),M=b.getPatternAttr(y.fgcolor,t.i,null),E=y.fgopacity,S=b.getPatternAttr(y.size,t.i,8),C=b.getPatternAttr(y.solidity,t.i,.3),O=t.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),L=r.uid;O&&(L+="-"+t.i),b.pattern(e,"point",i,L,x,S,C,t.mcc,y.fillmode,T,M,E)}else u.fill(e,f);d&&u.stroke(e,h)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,f=s.opacity,h=void 0!==c,d=void 0!==f;(a.isArrayOrTypedArray(u)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?f:g*e});var p=i.color,v=o.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?v||e:m||e});var y=i.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,g))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(b.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};u=a.texttemplateString(u,f,l._d3locale,d,t,p)}var g=t.tp||e.textposition,v=C(t,e),m=i?i(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,v,m).text(u).call(h.convertToTspans,r).call(S,g,v,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=C(t,e);u.fill(a,i),S(a,o,s,t.mrc2||t.mrc)}))}};function O(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},R=0),r&&(b.savedBBoxes[r]=v),R++,a.extendFlat({},v)},b.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},b.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(e,r)).trim(),t[a]("transform",i),i},b.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var F=/\s*sc.*/;b.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(F,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var N=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(N);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":423,"../../constants/alignment":492,"../../constants/interactions":496,"../../constants/xmlns_namespaces":498,"../../lib":519,"../../lib/svg_text_utils":545,"../../registry":610,"../../traces/scatter/make_bubble_size_func":675,"../../traces/scatter/subtypes":683,"../color":387,"../colorscale":399,"./symbol_defs":410,"@plotly/d3":14,"fast-isnumeric":161,tinycolor2:323}],410:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":14}],411:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],412:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(d.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(d.copy_ystyle?p:d).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":683,"../drawing":409,"@plotly/d3":14,"fast-isnumeric":161}],417:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":387,"@plotly/d3":14}],418:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":511,"../../plots/font_attributes":598,"./layout_attributes":428}],419:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||it<0||it>_[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+x[0]._offset,e.pointerY=it+_[0]._offset,z="xval"in e?m.flat(s,e.xval):m.p2c(x,at),H="yval"in e?m.flat(s,e.yval):m.p2c(_,it),!a(z[0])||!a(H[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(Y=0;Y$&&(tt.splice(0,$),ut=tt[0].distance),g&&0!==R&&0===tt.length){K.distance=R,K.index=!1;var f=q._module.hoverPoints(K,J,Q,"closest",{hoverLayer:l._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=R}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(h=ht(v),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(h=ht(b),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)At-1;kt--)Ot(tt[kt]);tt=Et,vt()}var Lt=t._hoverdata,Dt=[],Rt=j(t),It=U(t);for(V=0;V1||tt.length>1)||"closest"===E&&nt&&tt.length>1,Wt=d.combine(l.plot_bgcolor||d.background,l.paper_bgcolor),Xt=D(tt,{gd:t,hovermode:E,rotateLabels:qt,bgColor:Wt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});m.isUnifiedHover(E)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:0,pmax:a?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",l),I(Xt,qt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Zt=v.getComponentMethod("annotations","hasClickToShow")(t,Dt);f(n.select(e.target),Zt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Lt))return;Lt&&t.emit("plotly_unhover",{event:e,points:Lt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:_,xvals:z,yvals:H})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=D(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),g=t.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;c+=y,f+=y,h+=b,p+=b}u.bbox={x0:c+o,x1:f+o,y0:h+i,y1:p+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||d.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function D(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,w=e.commonLabelOpts||{},A=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,M=t[0],S=M.xa,C=M.ya,L=i.charAt(0),D=M[L+"Label"],I=g.getBoundingClientRect(),P=I.top,F=I.width,N=I.height,z=void 0!==D&&M.distance<=e.hoverdistance&&("x"===i||"y"===i);if(z){var B,j,U=!0;for(B=0;Ba.width-x?(v=a.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*E+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(E+y.width/2)+"v"+b+(2*E+y.height)+"H-"+(E+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,O,L;"right"===C.side?(_="start",O=1,L="",v=S._offset+S._length):(_="end",O=-1,L="-",v=S._offset),m=C._offset+(M.y0+M.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+L+k+","+k+"V"+(E+y.height/2)+"h"+L+(2*E+y.width)+"V-"+(E+y.height/2)+"H"+L+k+"V-"+k+"Z");var R,I=y.height/2,F=P-y.top-I,N="clip"+a._uid+"commonlabel"+C._id;if(v=0?nt:at+st=0?at:gt+st=0?et:rt+lt=0?rt:vt+lt=0,"top"!==t.idealAlign&&L||!I?L?(U+=V/2,t.anchor="start"):t.anchor="middle":(U-=V/2,t.anchor="end");else if(t.pos=U,L=j+H/2+Y<=F,I=j-H/2-Y>=0,"left"!==t.idealAlign&&L||!I)if(L)j+=H/2,t.anchor="start";else{t.anchor="middle";var G=Y/2,q=j+G-F,W=j-G;q>0&&(j-=q),W<0&&(j+=-W)}else j-=H/2,t.anchor="end";w.attr("text-anchor",t.anchor),S&&M.attr("text-anchor",t.anchor),e.attr("transform",s(j,U)+(u?l(_):""))})),mt}function R(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=z(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(L,(function(e,r){return s=z(r,t.nameLength),""}))}return[l,s]}function I(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],f=u*(k+E),d=f+u*(t.txwidth+E),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,d+=t.txwidth/2+E),e&&(g*=-M,p=t.offset*T),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*k+p)+","+o(k+g)+"v"+o(t.by/2-k)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*k+p)+"V"+o(g-k)+"Z");var m=p+f,y=g+t.ty0-t.by/2+E,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===b&&"end"!==s&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-E:t.bx+E)),a.call(c.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(c.positionText,i(d+u*E+p),o(g+t.ty0-t.by/2+E)),r.select("rect").call(h.setRect,i(d+(u-1)*t.tx2width/2+p),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function F(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,p)<1.5?d.contrast(p):y.color,w=a.spikemode,A=a.spikethickness,T=a.spikecolor||_,M=g.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=M,x=v),-1!==w.indexOf("across")){var k=a._counterDomainMin,E=a._counterDomainMax;"free"===a.anchor&&(k=Math.min(k,a.position),E=Math.max(E,a.position)),b=l.l+k*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?A:-A),cy:m,r:A,fill:T}).classed("spikeline",!0)}if(f){var S,C,O=e.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=u.pointerX,C=u.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var L,D,R=i.readability(O.color,p)<1.5?d.contrast(p):O.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,N=g.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(L=N,D=C),-1!==I.indexOf("across")){var z=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(z=Math.min(z,n.position),B=Math.max(B,n.position)),L=l.t+(1-B)*l.h,D=l.t+(1-z)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:L,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":h.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:L,y2:D,"stroke-width":P+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function N(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function z(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}},{"../../lib":519,"../../lib/events":510,"../../lib/override_cursor":530,"../../lib/svg_text_utils":545,"../../plots/cartesian/axes":569,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"../legend/defaults":439,"../legend/draw":440,"./constants":421,"./helpers":423,"@plotly/d3":14,"fast-isnumeric":161,tinycolor2:323}],425:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":519,"../color":387,"./helpers":423}],426:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":519,"./layout_attributes":428}],427:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":519,"../dragelement":406,"./attributes":418,"./calc":419,"./click":420,"./constants":421,"./defaults":422,"./helpers":423,"./hover":424,"./layout_attributes":428,"./layout_defaults":429,"./layout_global_defaults":430,"@plotly/d3":14}],428:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":598,"./constants":421}],429:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":519,"./hoverlabel_defaults":425,"./hovermode_defaults":426,"./layout_attributes":428}],430:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":519,"./hoverlabel_defaults":425,"./layout_attributes":428}],431:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),f=c*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===T("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===T("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",T,w,b,y),y:c("y",T,A,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(A("uirevision",e.uirevision),!1!==g){A("bgcolor",e.paper_bgcolor),A("bordercolor"),A("borderwidth");var m,y,b,x=a.coerceFont(A,"font",e.font),_="h"===A("orientation");if(_?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),A("traceorder",h),l.isGrouped(e.legend)&&A("tracegroupgap"),A("itemsizing"),A("itemwidth"),A("itemclick"),A("itemdoubleclick"),A("groupclick"),A("x",m),A("xanchor"),A("y",y),A("yanchor",b),A("valign"),a.noneOrAll(u,v,["x","y"]),A("title.text")){A("title.side",_?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(A,"title.font",w)}}}function A(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":519,"../../plot_api/plot_template":558,"../../plots/layout_attributes":606,"../../registry":610,"./attributes":437,"./helpers":443}],440:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(u.font,i).text(h?A(n,p):n);var v=r.itemwidth+2*d.itemGap;f.positionText(g,v,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(A(n,p)).call(M,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),f=c[c.length-1],h=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):M(g,t,e,r)}function A(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function M(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,p=s.size*g;if(o){var v=u.bBox(o);c=v.height,h=v.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(c=p*y,h=b?u.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;a.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=p,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function k(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function E(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var A=a.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),S=a.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),C=a.ensureSingle(A,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var O=a.ensureSingle(A,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var D=a.ensureSingle(O,"text","legendtitletext");D.attr("text-anchor","start").call(u.font,L.font).text(L.text),M(D,O,t,e,1)}else O.selectAll(".legendtitletext").remove();var R=a.ensureSingle(A,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),I=O.selectAll("g.groups").data(s);I.enter().append("g").attr("class","groups"),I.exit().remove();var P=I.selectAll("g.traces").data(a.identity);P.enter().append("g").attr("class","traces"),P.exit().remove(),P.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(T,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,h=d.itemGap,p=a.itemwidth+2*h,g=2*(c+h),v=E(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v,b=a.tracegroupgap;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+w[0],c+w[1]+a._height+e/2+h),a._height+=e,a._width=Math.max(a._width,t[0].width)})),_=p+a._width,a._width+=h+p+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=k(a),T=a.x<0||0===a.x&&"right"===A,M=a.x>1||1===a.x&&"left"===A,S=y||m,C=i.width/2;a._maxWidth=Math.max(T?S&&"left"===A?o.l+o.w:C:M?S&&"right"===A?o.r+o.w:C:o.w,2*p);var O=0,L=0;r.each((function(t){var e=t[0].width+p;O=Math.max(O,e),L+=e})),_=null;var D=0;if(l){var R=0,I=0,P=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,w[0],w[1]+c+h+n/2+e),e+=n,t=Math.max(t,p+r[0].width)})),R=Math.max(R,e);var r=t+h;r+c+I>a._maxWidth&&(D=Math.max(D,I),I=0,P+=R+b,R=e),u.setTranslate(this,I,P),I+=r})),a._width=Math.max(D,I)+c,a._height=P+R+g}else{var F=r.size(),N=L+f+(F-1)*h=a._maxWidth&&(D=Math.max(D,U),B=0,j+=z,a._height+=z,z=0),u.setTranslate(this,w[0]+c+B,w[1]+c+j+e/2+h),U=B+r+h,B+=n,z=Math.max(z,e)})),N?(a._width=B+f,a._height=z+g):(a._width=Math.max(D,U)+f,a._height+=z+g)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(c+d.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(c+d.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,V=H.legendText||H.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?p:_||p+t[0].width;s||(a+=h/2),u.setRect(e,0,-r/2,a,r)}))}(t,I,P,e)},function(){if(p||!function(t){var e=t._fullLayout.legend,r=k(e),n=E(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var s,c,g,y,b=f._size,x=e.borderwidth,w=b.l+b.w*e.x-v[k(e)]*e._width,T=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(!p&&f.margin.autoexpand){var M=w,L=T;w=a.constrain(w,0,f.width-e._width),T=a.constrain(T,0,f.height-e._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(p||u.setTranslate(A,w,T),R.on(".drag",null),A.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var D=e._effHeight;p&&(D=e._height),C.attr({width:e._width-x,height:D-x,x:x/2,y:x/2}),u.setTranslate(O,0,0),S.select("rect").attr({width:e._width-2*x,height:D-2*x,x:x,y:x}),u.setClipUrl(O,h,t),u.setRect(R,0,0,0,0),delete e._scrollY}else{var I,P,F,N=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),z=e._effHeight-N-2*d.scrollBarMargin,B=e._height-e._effHeight,j=z/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),S.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(O,h,t),Y(U,N,j),A.on("wheel",(function(){Y(U=a.constrain(e._scrollY+n.event.deltaY/z*B,0,B),N,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;I="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(P="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Y(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,B)}(F,I,P),N,j))}));R.call(H);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(I=t.changedTouches[0].clientY,F=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(P=t.changedTouches[0].clientY,Y(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,B)}(F,I,P),N,j))}));O.call(V)}if(t._context.edits.legendPosition)A.classed("cursor-move",!0),l.init({element:A.node(),gd:t,prepFn:function(){var t=u.getTranslate(A);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,a=y+r;u.setTranslate(A,n,a),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),c=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,A,a,e,n)}})}function Y(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(O,0,-r),u.setRect(R,e._width,d.scrollBarMargin+r*a,d.scrollBarWidth,n),S.select("rect").attr("y",x+r)}}],t)}(t,e)}},{"../../constants/alignment":492,"../../lib":519,"../../lib/events":510,"../../lib/svg_text_utils":545,"../../plots/plots":608,"../../registry":610,"../color":387,"../dragelement":406,"../drawing":409,"./constants":438,"./get_legend_data":441,"./handle_click":442,"./helpers":443,"./style":445,"@plotly/d3":14}],441:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],f=!1,h={},d=0,p=0;function g(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),f=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+d;c.push(n),u[n]=[r],d++}}for(r=0;rM&&(T=M)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return y?n:Math.min(a,r)};function A(t,i,o){var c=t[0].trace,f=c.marker||{},h=f.line||{},d=o?c.visible&&c.type===o:a.traceIs(c,"bar"),p=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var d=i.mcc;if(!r._inHover&&"mc"in i){var p=u(f),g=p.mid;void 0===g&&(g=(p.max+p.min)/2),d=s.tryColorscale(f,"")(g)}var m=d||i.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),A=y.fgopacity,T=v(y.size,8,10),M=v(y.solidity,.5,1),k="legend-"+c.uid;a.call(s.pattern,"legend",e,k,b,T,M,d,y.fillmode,x,_,A)}else a.call(l.fill,m);o&&l.stroke(a,i.mlc||h.color)}))}function T(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.size()){var c=(s.marker||{}).line,d=w(h(c.width,o.pts),c,5,2),p=i.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=c.color;var g=i.minExtend(o,{trace:p});f(u,g,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,f=n.select(this),h=u(a),d=h.colorscale,g=h.reversescale;if(d){if(!r){var v=d.length;c=0===o?d[g?v-1:0][1]:1===o?d[g?0:v-1][1]:d[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),c?f.call(l.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,p(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,A(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){A(t,this,"funnel")})).each((function(t){A(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,a,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=u(x),A=_.colorscale,T=_.reversescale,M=c.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),E=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",M+"h"+b+"v6h-"+b+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+x.uid;s.gradient(t,e,r,p(T),A,"fill")}}),f||h){var S=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var C=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",M+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),A,"stroke")}})})).each((function(t){var r,a,o=g(t),l=o.anyFill,u=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,v=!h&&!u&&!l&&c.hasText(p);function m(t,e,r,n){var a=i.nestedProperty(p,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||v||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=m("marker.size",i.mean,[2,16],12);x.ms=A,w.marker.size=A}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(d,x)],(a=i.minExtend(p,w)).selectedpoints=null,a.texttemplate=null}var T=n.select(this).select("g.legendpoints"),M=T.selectAll("path.scatterpts").data(h?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),M.exit().remove(),M.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var k=T.selectAll("g.pointtext").data(v?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":519,"../../registry":610,"../../traces/pie/helpers":651,"../../traces/pie/style_one":652,"../../traces/scatter/subtypes":683,"../color":387,"../colorscale/helpers":398,"../drawing":409,"./constants":438,"@plotly/d3":14}],446:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":448}],447:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(L=["toggleHover"],D=["resetViews"]):m?(O=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],D=["resetGeo"]):v?(L=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],L=["toggleHover"],D=["resetViewMapbox"]):x?L=["hoverClosestGl2d"]:y?L=["hoverClosestPie"]:T?(L=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):L=["toggleHover"];g&&(L=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(T=f,S="y0",M=y,C="y1"):(T=y,S="y1",M=f,C="y0");Z(n),K(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===R?J:Q,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;$(s)}};function Z(r){if(m(t))R=null;else if(F)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";d(e,l),R=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;I?z("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?z("yanchor",r.yanchor=q(A+a)):(l=function(t){return q(Y(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),z("path",r.path=w(D,o,l))}else I?z("xanchor",r.xanchor=G(b+n)):(z("x0",r.x0=G(u+n)),z("x1",r.x1=G(v+n))),P?z("yanchor",r.yanchor=q(A+a)):(z("y0",r.y0=q(f+a)),z("y1",r.y1=q(y+a)));e.attr("d",_(t,r)),K(s,r)}function Q(n,a){if(N){var i=function(t){return t},o=i,l=i;I?z("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?z("yanchor",r.yanchor=q(A+a)):(l=function(t){return q(Y(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),z("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var c=u+n,h=P?f-a:f+a;z("x0",r.x0=I?c:G(c)),z("y0",r.y0=P?h:q(h))}else if("resize-over-end-point"===R){var d=v+n,p=P?y-a:y+a;z("x1",r.x1=I?d:G(d)),z("y1",r.y1=P?p:q(p))}}else{var m=function(t){return-1!==R.indexOf(t)},x=m("n"),j=m("s"),H=m("w"),W=m("e"),X=x?T+a:T,Z=j?M+a:M,J=H?k+n:k,Q=W?E+n:E;P&&(x&&(X=T-a),j&&(Z=M-a)),(!P&&Z-X>10||P&&X-Z>10)&&(z(S,r[S]=P?X:q(X)),z(C,r[C]=P?Z:q(Z))),Q-J>10&&(z(O,r[O]=I?J:G(J)),z(L,r[L]=I?Q:G(Q)))}e.attr("d",_(t,r)),K(s,r)}function K(t,e){(I||P)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(I?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=Y(P?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",L||u.opacity(E)*k<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,v(t)}}(t,I)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),b=t._fullLayout._size;if(m?"domain"===d?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return b.l+b.w*t},y?"domain"===v?s=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return b.t+b.h*(1-t)},"path"===h)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var w=(l+u)/2,A=(c+f)/2,T=Math.abs(w-l),M=Math.abs(A-c),k="A"+T+","+M,E=w+T+","+A;return"M"+E+k+" 0 1,1 "+(w+","+(A-M))+k+" 0 0,1 "+E+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),M&&!h)&&(T=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===A&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function D(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=s.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return P.call(F),R&&(S?P.on(".opacity",null):(M=0,k=!0,P.text(y).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)}))),P.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),P.classed("js-placeholder",k),A}}},{"../../constants/alignment":492,"../../constants/interactions":496,"../../lib":519,"../../lib/svg_text_utils":545,"../../plots/plots":608,"../../registry":610,"../color":387,"../drawing":409,"@plotly/d3":14,"fast-isnumeric":161}],486:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:u,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":511,"../../plot_api/edit_types":551,"../../plot_api/plot_template":558,"../../plots/font_attributes":598,"../../plots/pad_attributes":607,"../color/attributes":386}],487:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],488:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":519,"../../plots/array_container_defaults":564,"./attributes":486,"./constants":487}],489:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(k,a,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(E,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(A,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(A,o),c.call(_,o)}))})),c.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,d=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,M=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,E=p,S=v+m;S+k>u&&(S=u-k);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),T?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:M,height:k}),this._hbarXMin=E+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>A,L=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+L>l&&(R=l-L);var P=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),O?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:L,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,N=c-.5,z=O?f+L+.5:f+.5,B=h-.5,j=T?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+F).data(T||O?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),T||O?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(B),width:Math.ceil(z)-Math.floor(N),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":519,"../color":387,"../drawing":409,"@plotly/d3":14}],492:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],493:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],494:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],495:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],496:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],497:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],498:[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}},{}],499:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],501:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],502:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":526}],503:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),A=t.match(w?b:y);if(!A)return c;var T=A[1],M=A[3]||"1",k=Number(A[5]||1),E=Number(A[7]||0),S=Number(A[9]||0),C=Number(A[11]||0);if(u){if(2===T.length)return c;var O;T=Number(T);try{var L=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=L.newDate(T,L.toMonthIndex(T,M,D),k)}else O=L.newDate(T,Number(M),k)}catch(t){return c}return O?(O.toJD()-g)*f+E*h+S*d+C*p:c}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),M-=1;var R=new Date(Date.UTC(2e3,M,k,E,S));return R.setUTCFullYear(T),R.getUTCMonth()!==M||R.getUTCDate()!==k?c:R.getTime()+C*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var A=90*f,T=3*h,M=5*d;function k(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g,S=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function O(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return C[r("%q")(a)]})),_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),L[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+O(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return O(e,t,n,a)};var D=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+D);return u.setUTCMonth(u.getUTCMonth()+e)+n-D},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,h=o-a,d=u-i,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(h,d,g,t-a,e-i),l(h,d,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=a:h=a,f++}return i}},{"./mod":526}],515:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],519:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=i(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=t("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var A=t("./extend");f.extendFlat=A.extendFlat,f.extendDeep=A.extendDeep,f.extendDeepAll=A.extendDeepAll,f.extendDeepNoArrays=A.extendDeepNoArrays;var T=t("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var M=t("./regex");f.counterRegex=M.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var E=t("./dom");function S(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},f.syncOrAsync=function(t,e,r){var n;function a(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var a;return I.test(n)?a=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var P={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return z.apply(P,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return z.apply(F,arguments)};var N=/^[:|\|]/;function z(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,v="xother"===s||"yother"===s||d||g||p,m=s;if((d||p)&&(m=m.substring(1)),(g||p)&&(m=m.substring(0,m.length-1)),v){if(void 0===(u=e[m]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(t,e,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(a-u*(r+o),i-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":497,"./anchor_utils":501,"./angles":502,"./array":503,"./clean_number":504,"./clear_responsive":506,"./coerce":507,"./dates":508,"./dom":509,"./extend":511,"./filter_unique":512,"./filter_visible":513,"./geometry2d":514,"./identity":517,"./increment":518,"./is_plain_object":520,"./keyed_container":521,"./localize":522,"./loggers":523,"./make_trace_groups":524,"./matrix":525,"./mod":526,"./nested_property":527,"./noop":528,"./notifier":529,"./preserve_drawing_buffer":533,"./push_unique":534,"./regex":536,"./relative_attr":537,"./relink_private":538,"./search":539,"./sort_object_keys":542,"./stats":543,"./throttle":546,"./to_log_range":547,"@plotly/d3":14,"d3-format":90,"d3-time-format":91,"fast-isnumeric":161}],520:[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).hasOwnProperty("hasOwnProperty")}},{}],521:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":556,"./notifier":529}],524:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":14}],525:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],527:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":497,"./matrix":525}],532:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":541,regl:297}],533:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":161,"is-mobile":248}],534:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-a;void 0===a?(l.push(c),a=c):f>s&&(i=Math.min(i,f),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":503,"fast-isnumeric":161}],544:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":69}],545:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var k=t.text(),E=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&k.match(u),O=n.select(t.node().parentNode);if(!O.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),E?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(E[2],o,(function(n,a,o){O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var u=O.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:L,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",f=s.select("g");f.attr({fill:c,stroke:c});var h=l(f,"width"),d=l(f,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],v=-(r||l(t,"height"))/4;"y"===L[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-h/2,v-d/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===L[0]?s.attr({x:t.attr("x"),y:v-d/2}):"a"===L[0]&&0!==L.indexOf("atitle")?s.attr({x:0,y:v}):s.attr({x:p,y:+t.attr("y")+v-d/2}),g&&g.call(t,u),e(u)}))}))):D(),t}function D(){O.empty()||(L=t.attr("class")+"-math",O.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var E=e.split(m),O=0;O|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var k={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(E,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):k[e])||t}))}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?e:""}function O(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],547:[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":161}],548:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],549:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],550:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,T,M,k,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=c(m,f).get(),L=[],D=-1,R=C.length;for(b=0;bC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)A.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?L.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(x=0;x=0;b--)C.splice(L[b],1),O&&O.splice(L[b],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(h(v,m),p!==a){var I;if(-1===D)I=E;else{for(R=Math.max(C.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),L(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&L(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in L(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=O(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&V(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=d.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function V(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=d.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),p=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var z=R.parts[P],B=R.parts[P-1]+"."+z,U=R.parts.slice(0,P).join("."),H=s(t.layout,U).get(),V=s(l,U).get(),W=R.get();if(void 0!==I){k[D]=I,E[D]="reverse"===z?I:F(W);var Z=f.getLayoutValObject(l,R.parts);if(Z&&Z.impliedEdits&&null!==I)for(var J in Z.impliedEdits)S(o.relativeAttr(D,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(D))if(I){S("autosize",null);var Q="height"===D?"width":"height";S(Q,l[Q])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",I?null:l.width),S("height",I?null:l.height);else if(B.match(Y))L(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){L(B),s(l,U+"._inputRange").set(null);var K=s(l,U).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===z){C=H;var $="linear"===V.type&&"log"===I,tt="log"===V.type&&"linear"===I;if($||tt){if(C&&C.range)if(V.autorange)$&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var et=C.range[0],rt=C.range[1];$?(et<=0&&rt<=0&&S(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(U+".range[0]",Math.log(et)/Math.LN10),S(U+".range[1]",Math.log(rt)/Math.LN10)):(S(U+".range[0]",Math.pow(10,et)),S(U+".range[1]",Math.pow(10,rt)))}else S(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,V,I,S),c.getComponentMethod("images","convertCoords")(t,V,I,S)}else S(U+".autorange",!0),S(U+".range",null);s(l,U+"._inputRange").set(null)}else if(z.match(T)){var nt=s(l,D).get(),at=(I||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,S),c.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=x.containerArrayMatch(D);if(it){r=it.array,n=it.index;var ot=it.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(I)?E[D]=null:x.isRemoveVal(I)?E[D]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(M,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=I,delete e[D]}else"reverse"===z?(H.range?H.range.reverse():(S(U+".autorange",!0),H.range=[1,0]),V.autorange?M.calc=!0:M.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?M.plot=!0:Z?A.update(M,Z):M.calc=!0,R.set(I))}}for(r in m){x.applyContainerArrayChanges(t,h(i,r),m[r],M,h)||(M.plot=!0)}for(var ut in O){var ct=(C=d.getFromId(t,ut))&&C._constraintGroup;if(ct)for(var ft in M.calc=!0,ct)O[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:O,undoit:E,redoit:k,eventData:v}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,a){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=_.coerceTraceIndices(t,a),s=B(t,o.extendFlat({},e),i),l=s.flags,c=W(t,o.extendFlat({},n)),f=c.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,i,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,c)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&V(d,c.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag),u.add(t,Z,[t,s.undoit,c.undoit,s.traces],Z,[t,s.redoit,c.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&M.push(g);y=M}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,i];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":519,"../plots/attributes":565}],559:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=A(c,T,c.side),c._mainMirrorPosition=c.mirror&&T?A(c,T,d.OPPOSITE_SIDE[c.side]):null}var M=[],k=[],E=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,O=s.yaxis.domain,L=s.plotgroup;if(y(C,O,E)){var D=L.node(),R=s.bg=o.ensureSingle(L,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),k.push(a)}else L.select("rect.bg").remove(),E.push([C,O]),S||(M.push(a),k.push(a))}var I,P,F,N,z,B,j,U,H,V,Y,G,q,W=v._bgLayer.selectAll(".bg").data(M);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?c.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":519,"../plots/attributes":565,"../plots/plots":608,"./plot_config":556,"./plot_schema":557,"./plot_template":558}],561:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var M=o.extendFlat({},h);b?M.width=b:null===e.width&&n(p.width)&&(M.width=p.width),x?M.height=x:null===e.height&&n(p.height)&&(M.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=i.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(A?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(T,r,M,k).then(E).then(S).then(C).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":519,"../plots/plots":608,"../snapshot/helpers":614,"../snapshot/svgtoimg":616,"../snapshot/tosvg":618,"../version":716,"./plot_api":555,"fast-isnumeric":161}],562:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&a.push(p("unused",i,m.concat(b.length)));var M,k,E,S,C,O=b.length,L=Array.isArray(T);if(L&&(O=Math.min(O,T.length)),2===x.dimensions)for(k=0;kb[k].length&&a.push(p("unused",i,m.concat(k,b[k].length)));var D=b[k].length;for(M=0;M<(L?Math.min(D,T[k].length):D);M++)E=L?T[k][M]:T,S=y[k][M],C=b[k][M],n.validate(S,E)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(k,M),S,C)):a.push(p("value",i,m.concat(k,M),S))}else a.push(p("array",i,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};u=f}for(var h=e.calendar,d="start"===l,p="end"===l,g=t[r+"period0"],v=i(g,h)||0,m=[],y=[],b=[],x=a.length,_=0;_M;)T=o(T,-u,h);for(;T<=M;)T=o(T,u,h);A=o(T,-u,h)}else{for(T=v+(w=Math.round((M-v)/c))*c;T>M;)T-=c;for(;T<=M;)T+=c;A=T-c}m[_]=d?A:p?T:(A+T)/2,y[_]=A,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":497,"../../lib":519,"fast-isnumeric":161}],567:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],568:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,f=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),u=g(t,e),c=u.min,f=u.max;if(0===c.length||0===f.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,v=f[0].val;for(r=1;r0&&((A=S-s(b)-l(x))>C?T/A>O&&(_=b,w=x,O=T/A):T/S>O&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},O=T/S));if(h===v){var L=h-1,D=h+1;if(k)if(0===h)a=[0,1];else{var R=(h>0?f:c).reduce((function(t,e){return Math.max(t,l(e))}),0),I=h/(1-Math.min(.5,R/S));a=h>0?[0,I]:[I,0]}else a=E?[Math.max(0,L),Math.max(1,D)]:[L,D]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):E&&(_.val-O*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-d(e,b.val,x.val))/(S-s(_)-l(w)),a=[_.val-O*s(_),w.val+O*l(w)];return m&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),E=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!A){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=i),i>d&&i-o&&(h=i),i>d&&i=D;n--)L(n);return{min:p,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],f=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function b(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":409,"../../constants/numerical":497,"../../lib":519,"../../registry":610,"./axis_ids":573,"@plotly/d3":14,"fast-isnumeric":161}],569:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,A=g.ONEAVGMONTH,T=g.ONEMINMONTH,M=g.ONEWEEK,k=g.ONEDAY,E=k/2,S=g.ONEHOUR,C=g.ONEMIN,O=g.ONESEC,L=g.MINUS_SIGN,D=g.BADNUM,R={K:"zeroline"},I={K:"gridline",L:"path"},P={K:"tick",L:"path"},F={K:"tick",L:"text"},N=t("../../constants/alignment"),z=N.MID_SHIFT,B=N.CAP_SHIFT,j=N.LINE_SPACING,U=N.OPPOSITE_SIDE,H=e.exports={};H.setConvert=t("./set_convert");var V=t("./axis_autotype"),Y=t("./axis_ids"),G=Y.idSort,q=Y.isLinked;H.id2name=Y.id2name,H.name2id=Y.name2id,H.cleanId=Y.cleanId,H.list=Y.list,H.listIds=Y.listIds,H.getFromId=Y.getFromId,H.getFromTrace=Y.getFromTrace;var W=t("./autorange");H.getAutoRange=W.getAutoRange,H.findExtremes=W.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}H.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},H.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},H.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==H.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=H.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},H.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:H.getFromId(e,r).cleanPos)(t)},H.redrawComponents=function(t,e){e=e||H.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},H.saveRangeInitial=function(t,e){for(var r=H.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=H.tickIncrement(t,"M6","reverse")+1.5*k:i.exactMonths>.8?t=H.tickIncrement(t,"M1","reverse")+15.5*k:t-=E;var l=H.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,u,i)),v=y,0;v<=c;)v=H.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:c-u}},H.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,H.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=H.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dticki&&f=o:d<=o;d=H.tickIncrement(d,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(d=c)break}if(C.length>g||d===O)break;O=d;var L=!1;f&&d!==(0|d)&&(L=!0),C.push({minor:L,value:d})}if(h&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),f=r||c,h=0;f>=y?h=c>=y&&c<=v?c:m:r===x&&f>=_?h=c>=_&&c<=b?c:x:f>=T?h=c>=T&&c<=w?c:A:r===M&&f>=M?h=M:f>=k?h=k:r===E&&f>=E?h=E:r===S&&f>=S&&(h=S),h>=c&&(h=c,s=!0);var d=a+h;if(e.rangebreaks&&h>0){for(var p=0,g=0;g<84;g++){var C=(g+.5)/84;e.maskBreaks(a*(1-C)+C*d)!==D&&p++}(h*=p/84)||(t[n].drop=!0),s&&c>M&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var R="y"===t._id.charAt(0),I=1;"auto"===t.tickmode&&(I=t.tickfont?t.tickfont.size:12);var P=NaN;for(p=C.length-1;p>-1;p--)if(C[p].drop)C.splice(p,1);else{C[p].value=kt(C[p].value,t);var F=t.c2p(C[p].value);(R?P>F-I:Pc||zc&&(N.periodX=c),z10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&i<=10||e>=15*k)t._tickround="d";else if(e>=C&&i<=16||e>=S)t._tickround="M";else if(e>=O&&i<=19||e>=C)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ct(t.exponentformat)&&!ft(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}H.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(i>A)e/=A,t.dtick="M"+ot(e,1,tt);else if(i>k){t.dtick=ot(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=H.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>S?t.dtick=ot(e,S,tt):i>C?t.dtick=ot(e,C,et):i>O?t.dtick=ot(e,O,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Mt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},H.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?at:nt,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},H.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=ht(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||ct(d)&&ft(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":L)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":L)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):Mt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=L+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ht(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},H.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return H.hoverLabelText(t,n,r)+" - "+H.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=H.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":L+o:o};var ut=["f","p","n","\u03bc","m","","k","M","G","T"];function ct(t){return"SI"===t||"B"===t}function ft(t){return t>14||t<-15}function ht(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=H.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,L);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":ct(l)&&(t+=ut[u/3+5]));return i?L+t:t}function dt(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==u._dfltTitle[p]&&(n[l]+=vt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}Q&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,bt(e),n),i.autoMargin(t,xt(e),a),i.autoMargin(t,_t(e),s)})),r.skipTitle||Q&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+vt(e);else{var s=Et(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,f,d,p,g=H.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,d="top"===e.side?g-r:g+r):(d=e._offset+e._length/2,f="right"===e.side?g+r:g-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=h.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:p,transform:u,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function K(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=yt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},H.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},H.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},H.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*B,f+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,f+=3);s&&"top"===u&&(f-=h*(1-B));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(f=-f);return[l?c:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(pt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(pt(e)))}},H.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},H.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,f=i("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,g=h?t.ticklen:0;if(f?g*=-1:c&&(g=0),h&&(d+=g,r)){var v=s.deg2rad(r);d=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},A=0,T=t.side,M=t._id.charAt(0),k=t.tickangle;if("x"===M)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=z:b=-90===k&&"bottom"===T?B:90===k&&"top"===T?z:.5,A=z/2*(k/90)),w.xFn=function(t){return t.dx+m+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===M){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===T||90===k&&"right"===T?B:.5),f){var E=a(k)?+k:0;if(0!==E){var S=s.deg2rad(E);A=Math.abs(Math.sin(S))*B*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*z},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},H.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],gt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),St(e,[P]),i.attr("transform",r.transFn)},H.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&H.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sd||i.leftd||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),d.length&&"x"===c&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=yt(this),o=h.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",f=function(t){return-1!==u.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,s={},c=0;c2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":610,"./constants":576}],574:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*b)||A)for(r=0;rR&&NL&&(L=N);h/=(L-O)/(2*D),O=l.l2r(O),L=l.l2r(L),l.range=l._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,a,i)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){D&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),D=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,i){for(var o,s,l,u,c=!1,f={},h={},d=(i||{}).xaHash,p=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==t||mt||Yt(),vt)o.indexOf("select")>-1&&E(r,a,J,Q,e.id,Lt),o.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&mt){var s=g?R:D,u="s"===g||"w"===m?0:1,f=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),p="left",v="middle";if(s.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:v}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,f,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),a=Math.max(0,Math.min(et,pt*r+wt)),i=Math.abs(n-_t),o=Math.abs(a-wt);function s(){Et="",At.r=At.l,At.t=At.b,Ct.attr("d","M0,0Z")}if(At.l=Math.min(_t,n),At.r=Math.max(_t,n),At.t=Math.min(wt,a),At.b=Math.max(wt,a),rt.isSubplotConstrained)i>L||o>L?(Et="xy",i/tt>o/et?(o=i*et/tt,wt>a?At.t=wt-o:At.b=wt+o):(i=o*tt/et,_t>n?At.l=_t-i:At.r=_t+i),Ct.attr("d",G(At))):s();else if(nt.isSubplotConstrained)if(i>L||o>L){Et="xy";var l=Math.min(At.l/tt,(et-At.b)/et),u=Math.max(At.r/tt,(et-At.t)/et);At.l=l*tt,At.r=u*tt,At.b=(1-l)*et,At.t=(1-u)*et,Ct.attr("d",G(At))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cg[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":519,"fast-isnumeric":161}],588:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":492}],589:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),A=t("../../plot_api/subroutines").redrawReglTraces,T=t("./constants"),M=T.MINSELECT,k=b.filter,E=b.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),O=C.p2r,L=C.axValue,D=C.getTransform;function R(t,e,r,n,a,i,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){N(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)C._fullLayout._deactivateShape(C);else if(!_){var r=I.clickmode;x.done(gt).then((function(){if(x.clear(gt),2===t){for(ft.remove(),$=0;$-1&&R(e,C,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&C.emit("plotly_selected",void 0);s.click(C,e)})).catch(y.error)}},a.doneFn=function(){pt.remove(),x.done(gt).then((function(){x.clear(gt),a.gd.emit("plotly_selected",et),K&&a.selectionDefs&&(K.subtract=ct,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&z(a)}},clearSelect:S,clearSelectionsCache:z,selectOnClick:R}},{"../../components/color":387,"../../components/dragelement/helpers":405,"../../components/drawing":409,"../../components/fx":427,"../../components/fx/helpers":423,"../../components/shapes/draw_newshape/display_outlines":475,"../../components/shapes/draw_newshape/helpers":476,"../../components/shapes/draw_newshape/newshapes":477,"../../lib":519,"../../lib/clear_gl_canvases":505,"../../lib/polygon":531,"../../lib/throttle":546,"../../plot_api/subroutines":559,"../../registry":610,"./axis_ids":573,"./constants":576,"./handle_outline":580,"./helpers":581,polybooljs:279}],590:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,f=i.ensureNumber,h=i.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,g=d.BADNUM,v=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),A=t("./constants"),T=A.HOUR_PATTERN,M=A.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function E(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(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],a=t.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function C(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function O(e,r,n){return u(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function D(e){if(E(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return g}function R(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=R(t);return void 0!==e?e:s(t)?+t:void 0}function P(t){return s(t)?+t:R(t)}function F(t,e,r){return n.round(r+e*t,2)}function N(t,e,r){return(t-r)/e}var z=function(e){return s(e)?F(e,t._m,t._b):g},B=function(e){return N(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;z=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?F(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return N(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return N(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?k:f,t.l2p=z,t.p2l=B,t.c2p="log"===t.type?function(t,e){return z(S(t,e))}:z,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=C,t.c2d=t.c2r=t.l2d=t.l2r=O,t.d2p=t.r2p=function(e,r,n){return t.l2p(C(e,0,n))},t.p2d=t.p2r=function(t,e,r){return O(B(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=D,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=R,t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(a=0;ap&&(o[n]=p),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),f="y"===d;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/d[2]:1,A=h?c/d[3]:1,T=f?d[0]:0,M=h?d[1]:0,k=f?d[0]/d[2]*u:0,E=h?d[1]/d[3]*c:0,S=a._offset-k,C=l._offset-E;n.clipRect.call(o.setTranslate,T,M).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":409,"../../lib":519,"../../registry":610,"./axes":569,"@plotly/d3":14}],595:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var d=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(i=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],i||s?(i&&(v(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=a),Math.abs(u.dragStart[0]-n)=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&I.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:m,size:r.l+p},r:{val:y,size:r.r+p},b:{val:_,size:r.b+p},t:{val:b,size:r.t+p}},d[e]=1}else delete h[e],delete d[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),O(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,f=i.r,h=i.t,p=i.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,A=b.size,T=_.val,M=_.size;for(var k in g){if(o(A)&&g[k].r){var E=g[k].r.val,S=g[k].r.size;if(E>w){var C=(A*E+(S-r)*w)/(E-w),L=(S*(1-w)+(A-r)*(1-E))/(E-w);C+L>u+f&&(u=C,f=L)}}if(o(M)&&g[k].t){var D=g[k].t.val,R=g[k].t.size;if(D>T){var I=(M*D+(R-n)*T)/(D-T),P=(R*(1-T)+(M-n)*(1-D))/(D-T);I+P>p+h&&(p=I,h=P)}}}}}var F=c.constrain(r-i.l-i.r,2,64),N=c.constrain(n-i.t-i.b,2,64),z=Math.max(0,r-F),B=Math.max(0,n-N);if(z){var j=(u+f)/z;j>1&&(u/=j,f/=j)}if(B){var U=(p+h)/B;U>1&&(p/=U,h/=U)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(h),a.b=Math.round(p),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var H=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=u(s),a)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=u(l)),i&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(I(o,u,f),a=0;a0){for(var n=[],a=0;a-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},{"../components/color":387,"../components/drawing":409,"../constants/xmlns_namespaces":498,"../lib":519,"@plotly/d3":14}],619:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rP){R("x scale is not linear");break}}if(b.length&&"fast"===L){var F=(b[b.length-1]-b[0])/(b.length-1),N=Math.abs(F/100);for(T=0;TN){R("y scale is not linear");break}}}var z=a.maxRowLength(A),B="scaled"===e.xtype?"":r,j=d(e,B,v,m,z,k),U="scaled"===e.ytype?"":b,H=d(e,U,x,_,A.length,E);O||(e._extremes[k._id]=i.findExtremes(k,j),e._extremes[E._id]=i.findExtremes(E,H));var V={x:j,y:H,z:A,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(V.orig_x=y),e.yperiodalignment&&w&&(V.orig_y=w),B&&B.length===j.length-1&&(V.xCenter=B),U&&U.length===H.length-1&&(V.yCenter=U),C&&(V.xRanges=M.xRanges,V.yRanges=M.yRanges,V.pts=M.pts),S||l(t,e,{vals:A,cLetter:"z"}),S&&e.contours&&"heatmap"===e.contours.coloring){var Y={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};V.xfill=d(Y,B,v,m,z,k),V.yfill=d(Y,U,x,_,A.length,E)}return[V]}},{"../../components/colorscale/calc":395,"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/align_period":566,"../../plots/cartesian/axes":569,"../../registry":610,"../histogram2d/calc":638,"./clean_2d_array":622,"./convert_column_xyz":624,"./find_empties":625,"./interp2d":626,"./make_bound_array":627}],622:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,f,h;function d(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(i=h[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":519}],626:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":519}],627:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,u,c,f=[],h=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!d&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||p)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]u?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,i,s){if(n&&t>o){var l=p(e,i,s),u=p(r,i,s),c=t===a?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,u=-1.1*e,h=-.1*e,d=t-h,p=r[0],g=r[1],v=Math.min(f(p+h,p+d,n,i),f(g+h,g+d,n,i)),m=Math.min(f(p+u,p+h,n,i),f(g+u,g+h,n,i));if(v>m&&mo){var y=s===a?1:6,b=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,i);if(ur.r2l(z)&&(j=o.tickIncrement(j,x.size,!0,d)),I.start=r.l2r(j),N||a.nestedProperty(e,m+".start").set(I.start)}var U=x.end,H=r.r2l(R.end),V=void 0!==H;if((x.endFound||V)&&H!==r.r2l(U)){var Y=V?H:a.aggNums(Math.max,null,p);I.end=r.l2r(Y),V||a.nestedProperty(e,m+".start").set(I.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[I,p]}e.exports={calc:function(t,e){var r,i,d,p,g=[],v=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",b={x:"y",y:"x"}[y],x=e[y+"calendar"],_=e.cumulative,w=h(t,e,m,y),A=w[0],T=w[1],M="string"==typeof A.size,k=[],E=M?k:A,S=[],C=[],O=[],L=0,D=e.histnorm,R=e.histfunc,I=-1!==D.indexOf("density");_.enabled&&I&&(D=D.replace(/ ?density$/,""),I=!1);var P,F="max"===R||"min"===R?null:0,N=l.count,z=u[D],B=!1,j=function(t){return m.r2c(t,0,x)};for(a.isArrayOrTypedArray(e[b])&&"count"!==R&&(P=e[b],B="avg"===R,N=l[R]),r=j(A.start),d=j(A.end)+(r-o.tickIncrement(r,A.size,!1,x))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var J=Math.min(g.length,v.length),Q=[],K=0,$=J-1;for(r=0;r=K;r--)if(v[r]){$=r;break}for(r=K;r<=$;r++)if(n(g[r])&&n(v[r])){var tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=O[r],G?tt.ph0=tt.ph1=O[r].length?T[O[r][0]]:g[r]:(e._computePh=!0,tt.ph0=V(k[r]),tt.ph1=V(k[r+1],!0))),Q.push(tt)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,A.size,!1,x)-Q[0].p),s(Q,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(Q,e,X),Q},calcAllAutoBins:h}},{"../../lib":519,"../../plots/cartesian/axes":569,"../../registry":610,"../bar/arrays_to_calcdata":619,"./average":633,"./bin_functions":634,"./bin_label_vals":635,"./norm_functions":637,"fast-isnumeric":161}],637:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;aE&&A.splice(E,A.length-E),k.length>E&&k.splice(E,k.length-E);var S=[],C=[],O=[],L="string"==typeof w.size,D="string"==typeof M.size,R=[],I=[],P=L?R:w,F=D?I:M,N=0,z=[],B=[],j=e.histnorm,U=e.histfunc,H=-1!==j.indexOf("density"),V="max"===U||"min"===U?null:0,Y=i.count,G=o[j],q=!1,W=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(q="avg"===U,Y=i[U]);var J=w.size,Q=b(w.start),K=b(w.end)+(Q-a.tickIncrement(Q,J,!1,m))/1e6;for(r=Q;r=0&&d=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],u=l,f=i;a*fe){h=r;break}}if(i=c,isNaN(i)&&(i=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-u[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[i],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function T(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&k(r)):k(r),i.brushCallback(e),x(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(u?[i.newExtent]:[]),i.extent.length||k(r),i.brushCallback(e),u?x(t.parentNode,s):(s(),x(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function M(t,e){return t[0]-e[0]}function k(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function E(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(M)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=E(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t,e){var r=t.selectAll("."+n.cn.axisBrush).data(o,i);r.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e){var r=t.selectAll(".background").data(o);r.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events","auto").attr("transform",l(0,n.verticalPadding)),r.call(T).attr("height",(function(t){return t.height-n.verticalPadding}));var a=t.selectAll(".highlight-shadow").data(o);a.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(b);var i=t.selectAll(".highlight").data(o);i.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),i.attr("y1",(function(t){return t.height})).call(b)}(r,e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?E(t.sort(M)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[d(0,r,t[0],[]),d(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":519,"../../lib/gup":516,"./constants":643,"@plotly/d3":14}],641:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":498,"../../plots/get_data":600,"./plot":650,"@plotly/d3":14}],642:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:d}),v=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",m),n.coerceFont(c,"tickfont",m),n.coerceFont(c,"rangefont",m),c("labelangle"),c("labelside")}},{"../../components/colorscale/defaults":397,"../../components/colorscale/helpers":398,"../../lib":519,"../../plots/array_container_defaults":564,"../../plots/cartesian/axes":569,"../../plots/domain":597,"./attributes":639,"./axisbrush":640,"./constants":643,"./merge_length":648}],645:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":519}],646:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":639,"./base_plot":641,"./calc":642,"./defaults":644,"./plot":650}],647:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*u,i.offset=2*l*n,e(i),l*n+u>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;ic&&(c=t[a].dim1.canvasX,o=a);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&no._length&&(E=E.slice(0,o._length));var C,O=o.tickvals;function L(t,e){return{val:t,text:C[e]}}function D(t,e){return t.val-e.val}if(Array.isArray(O)&&O.length){C=o.ticktext,Array.isArray(C)&&C.length?C.length>O.length?C=C.slice(0,O.length):O.length>C.length&&(O=O.slice(0,C.length)):C=O.map(i(o.tickformat));for(var R=1;R=r||l>=a)return;var u=t.lineLayer.readPixel(s,a-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==z&&(c?i.hover(h):i.unhover&&i.unhover(h),z=f)}})),N.style("opacity",(function(t){return t.pick?0:1})),h.style("background","rgba(255, 255, 255, 0)");var B=h.selectAll("."+y.cn.parcoords).data(F,p);B.exit().remove(),B.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),B.attr("transform",(function(t){return u(t.model.translateX,t.model.translateY)}));var j=B.selectAll("."+y.cn.parcoordsControlView).data(g,p);j.enter().append("g").classed(y.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return u(t.model.pad.l,t.model.pad.t)}));var U=j.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),p);U.enter().append("g").classed(y.cn.yAxis,!0),j.each((function(t){R(U,t,_)})),N.each((function(t){if(t.viewModel){!t.lineLayer||i?t.lineLayer=x(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||i;t.lineLayer.render(t.viewModel.panels,e)}})),U.attr("transform",(function(t){return u(t.xScale(t.xIndex),0)})),U.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;E.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,U.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})),R(U,e,_),U.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return u(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",u(t.x,0)),U.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!S(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,R(U,e,_),n.select(this).attr("transform",(function(t){return u(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!S(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),E.linePickActive(!0),i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),U.exit().remove();var H=U.selectAll("."+y.cn.axisOverlays).data(g,p);H.enter().append("g").classed(y.cn.axisOverlays,!0),H.selectAll("."+y.cn.axis).remove();var V=H.selectAll("."+y.cn.axis).data(g,p);V.enter().append("g").classed(y.cn.axis,!0),V.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return m.isOrdinal(t)?e:I(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(V.selectAll("text"),t.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("text-shadow",c.makeTextShadow(A)).style("cursor","default");var Y=H.selectAll("."+y.cn.axisHeading).data(g,p);Y.enter().append("g").classed(y.cn.axisHeading,!0);var G=Y.selectAll("."+y.cn.axisTitle).data(g,p);G.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),G.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),c.convertToTspans(r,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":u(0,2*r+t.model.height))+l(e.degrees)+u(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var q=H.selectAll("."+y.cn.axisExtent).data(g,p);q.enter().append("g").classed(y.cn.axisExtent,!0);var W=q.selectAll("."+y.cn.axisExtentTop).data(g,p);W.enter().append("g").classed(y.cn.axisExtentTop,!0),W.attr("transform",u(0,-y.axisExtentOffset));var X=W.selectAll("."+y.cn.axisExtentTopText).data(g,p);X.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(L),X.text((function(t){return P(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var Z=q.selectAll("."+y.cn.axisExtentBottom).data(g,p);Z.enter().append("g").classed(y.cn.axisExtentBottom,!0),Z.attr("transform",(function(t){return u(0,t.model.height+y.axisExtentOffset)}));var J=Z.selectAll("."+y.cn.axisExtentBottomText).data(g,p);J.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),J.text((function(t){return P(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),b.ensureAxisBrush(H,A)}},{"../../components/colorscale":399,"../../components/drawing":409,"../../lib":519,"../../lib/gup":516,"../../lib/svg_text_utils":545,"../../plots/cartesian/axes":569,"./axisbrush":640,"./constants":643,"./helpers":645,"./lines":647,"@plotly/d3":14,"color-rgba":71}],650:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},u={},c={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var a=c[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===f[s]){var h=i.constraintrange;f[s]=h||null}var d=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,d.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete d.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[c[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[c[e]]])}})}}},{"../../lib/prepare_regl":532,"./helpers":645,"./parcoords":649}],651:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(d)r=d;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),v=a(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=u.length<100||c.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;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);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=i(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=i(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":544,"../../plots/cartesian/autorange":568,"../scatter/get_trace_color":668,"gl-pointcloud2d":213}],655:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":519,"./attributes":653}],656:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":603,"../scatter3d/calc":686,"./attributes":653,"./convert":654,"./defaults":655}],657:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rl&&O[m].gap;)m--;for(b=O[m].s,g=O.length-1;g>m;g--)O[g].s=b;for(;lk[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],665:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=l(t,e,v,m);if(y||(e.visible=!1),e.visible){u(t,e,v,m),m("xhoverformat"),m("yhoverformat");var b=c(t,e,v,m),x=!b&&y=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-p);return i=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(d.c2p(t.y)-g);return iW!=(B=I[D][1])>=W&&(F=I[D-1][0],N=I[D][0],B-z&&(P=F+(N-F)*(W-z)/(B-z),V=Math.min(V,P),Y=Math.max(Y,P)));V=Math.max(V,0),Y=Math.min(Y,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:Y,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":387,"../../components/fx":427,"../../lib":519,"../../registry":610,"./get_trace_color":668}],670:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":583,"./arrays_to_calcdata":657,"./attributes":658,"./calc":659,"./cross_trace_calc":663,"./cross_trace_defaults":664,"./defaults":665,"./format_labels":667,"./hover":669,"./marker_colorbar":676,"./plot":679,"./select":680,"./style":682,"./subtypes":683}],671:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":397,"../../components/colorscale/helpers":398,"../../lib":519}],672:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,h,d,p,g,v,m,y,b,x,_,w,A,T,M,k,E=e.xaxis,S=e.yaxis,C="log"===E.type,O="log"===S.type,L=E._length,D=S._length,R=e.connectGaps,I=e.baseTolerance,P=e.shape,F="linear"===P,N=e.fill&&"none"!==e.fill,z=[],B=f.minTolerance,j=t.length,U=new Array(j),H=0;function V(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;O&&l===a&&(i*=Math.abs(E._m*D*(E._m>0?o:s)/(S._m*L*(S._m>0?o:s)))),i*=1e3}if(l===a){if(O&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function Y(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[H-1][0],a=r===U[H-1][1];if(!n||!a)if(H>1){var i=e===U[H-2][0],o=r===U[H-2][1];n&&(e===et||e===rt)&&i?o?H--:U[H-1]=t:a&&(r===nt||r===at)&&o?i?H--:U[H-1]=t:U[H++]=t}else U[H++]=t}function ct(t){U[H-1][0]!==t[0]&&U[H-1][1]!==t[1]&&ut([Z,J]),ut(t),Q=null,Z=J=0}function ft(t){if(M=t[0]/L,k=t[1]/D,W=t[0]rt?rt:0,X=t[1]at?at:0,W||X){if(H)if(Q){var e=$(Q,t);e.length>1&&(ct(e[0]),U[H++]=e[1])}else K=$(U[H-1],t)[0],U[H++]=K;else U[H++]=[W||t[0],X||t[1]];var r=U[H-1];W&&X&&(r[0]!==W||r[1]!==X)?(Q&&(Z!==W&&J!==X?ut(Z&&J?(n=Q,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||X]):Z&&J&&ut([Z,J])),ut([W,X])):Z-W&&J-X&&ut([W||Z,X||J]),Q=t,Z=W,J=X}else Q&&ct($(Q,t)[0]),U[H++]=t;var n,a,i,o}for("linear"===P||"spline"===P?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&q(o,t)G(p,ht))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}Q&&ut([Z||Q[0],J||Q[1]]),z.push(U.slice(0,H))}return z}},{"../../constants/numerical":497,"../../lib":519,"./constants":662}],673:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],674:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(i=0;i=0?l=d:(l=d=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":161}],676:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],677:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(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")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":387,"../../components/colorscale/defaults":397,"../../components/colorscale/helpers":398,"./subtypes":683}],678:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":497,"../../lib":519}],679:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),T=o(A,"g","errorbars"),M=o(A,"g","lines"),k=o(A,"g","points"),E=o(A,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,C;y(A).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var L,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var F,N,z,B,j,U,H,V="",Y="",G=[],q=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):F=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},z=function(t){return N(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",L).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",L),l.singleLineStyle(f,a)}}}}}var W=M.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(S?(S.datum(f),B&&U&&(O?("y"===O?B[1]=U[1]=x.c2p(0,!0):"x"===O&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+V.substr(1)).call(l.singleFillStyle)):y(S).attr("d",V+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&V&&R?("tonext"===_.fill?y(C).attr("d",V+"Z"+R+"Z").call(l.singleFillStyle):y(C).attr("d",V+"L"+R.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(I)):(Z(C),_._polygons=null)),_._prevRevpath=Y,_._prevPolygons=H):(S?Z(S):C&&Z(C),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),E.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?Q:J:_&&!w&&(v=K),f&&(p=v),h&&(g=v)}var A,T=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,E,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(E,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function Q(t){return t.filter((function(t){return t.vis}))}function K(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":409,"../../lib":519,"../../lib/polygon":531,"../../registry":610,"./line_points":672,"./link_traces":674,"./subtypes":683,"@plotly/d3":14}],680:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=v,w=2*x,A={},T=l.makeCalcdata(e,"x"),M=y.makeCalcdata(e,"y"),k=s(e,l,"x",T),E=s(e,y,"y",M),S=k.vals,C=E.vals;e._x=S,e._y=C,e.xperiodalignment&&(e._origX=T,e._xStarts=k.starts,e._xEnds=k.ends),e.yperiodalignment&&(e._origY=M,e._yStarts=E.starts,e._yEnds=E.ends);var O=new Array(w),L=new Array(x);for(r=0;r1&&a.extendFlat(s.line,d.linePositions(t,r,n));if(s.errorX||s.errorY){var l=d.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},d.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},d.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},d.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,O,S,C),I=p(t,b);return f(o,e),_?R.marker&&(D=R.marker.sizeAvg||Math.max(R.marker.size,3)):D=u(e,x),c(t,e,l,y,S,C,D),R.errorX&&m(e,l,R.errorX),R.errorY&&m(e,y,R.errorY),R.fill&&!I.fill2d&&(I.fill2d=!0),R.marker&&!I.scatter2d&&(I.scatter2d=!0),R.line&&!I.line2d&&(I.line2d=!0),!R.errorX&&!R.errorY||I.error2d||(I.error2d=!0),R.text&&!I.glText&&(I.glText=!0),R.marker&&(R.marker.snap=x),I.lineOptions.push(R.line),I.errorXOptions.push(R.errorX),I.errorYOptions.push(R.errorY),I.fillOptions.push(R.fill),I.markerOptions.push(R.marker),I.markerSelectedOptions.push(R.markerSel),I.markerUnselectedOptions.push(R.markerUnsel),I.textOptions.push(R.text),I.textSelectedOptions.push(R.textSel),I.textUnselectedOptions.push(R.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),A._scene=I,A.index=I.count,A.x=S,A.y=C,A.positions=O,I.count++,[{x:!1,y:!1,t:A,trace:e}]}},{"../../constants/numerical":497,"../../lib":519,"../../plots/cartesian/align_period":566,"../../plots/cartesian/autorange":568,"../../plots/cartesian/axis_ids":573,"../scatter/calc":659,"../scatter/colorscale_calc":661,"./constants":689,"./convert":690,"./scene_update":698,"@plotly/point-cluster":15}],689:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],690:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../plots/cartesian/axis_ids"),c=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),d=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,h=o.family,d={},p=t._context.plotGlPixelRatio,g=e.texttemplate;if(g){d.text=[];var v=a._d3locale,y=Array.isArray(g),b=y?Math.min(g.length,i):i,x=y?function(t){return g[t]}:function(){return g};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],d=n[1];for(a=0;a1?l[a]:l[0]:l,p=Array.isArray(u)?u.length>1?u[a]:u[0]:u,g=v[d],m=v[p],y=c?c/.8+1:0,b=-m*y-.5*m;o.offset[a]=[g*y/h,b/h]}}return o}}},{"../../components/drawing":409,"../../components/fx/helpers":423,"../../constants/interactions":496,"../../lib":519,"../../lib/gl_format_color":515,"../../plots/cartesian/axis_ids":573,"../../registry":610,"../scatter/make_bubble_size_func":675,"../scatter/subtypes":683,"./constants":689,"./helpers":694,"color-normalize":69,"fast-isnumeric":161,"svg-path-sdf":320}],691:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),u=t("../scatter/xy_defaults"),c=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),d=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,o,r,a)}var m=!!t.marker&&i.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),b=u(t,e,g,v);if(b){c(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":689}],695:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var d=o.textfont;d&&(h.ts=a.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.tc=Array.isArray(d.color)?d.color[f]:d.color,h.tf=Array.isArray(d.family)?d.family[f]:d.family);var p=o.marker;p&&(h.ms=a.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.mo=a.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,h.mx=a.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,h.mc=a.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=a.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(h.mgt=Array.isArray(v.type)?v.type[f]:v.type,h.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(h.x,!0),y=l.c2p(h.y,!0),b=h.mrc||1,x=o.hoverlabel;x&&(h.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,h.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,h.hts=a.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,h.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,h.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,h.hnl=a.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=h;var T=o._origX,M=o._origY,k=a.extendFlat({},t,{color:i(o,h),x0:m-b,x1:m+b,xLabelVal:T?T[f]:h.x,y0:y-b,y1:y+b,yLabelVal:M?M[f]:h.y,cd:A,distance:u,spikeDistance:c,hovertemplate:h.ht});return h.htx?k.text=h.htx:h.tx?k.text=h.tx:o.text&&(k.text=o.text),a.fillText(h,o,k),n.getComponentMethod("errorbars","hoverInfo")(h,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,u,c,f,h,d,p,g=t.cd,v=g[0].t,m=g[0].trace,y=t.xa,b=t.ya,x=v.x,_=v.y,w=y.c2p(e),A=b.c2p(r),T=t.distance;if(v.tree){var M=y.p2c(w-T),k=y.p2c(w+T),E=b.p2c(A-T),S=b.p2c(A+T);a="x"===n?v.tree.range(Math.min(M,k),Math.min(b._rl[0],b._rl[1]),Math.max(M,k),Math.max(b._rl[0],b._rl[1])):v.tree.range(Math.min(M,k),Math.min(E,S),Math.max(M,k),Math.max(E,S))}else a=v.ids;var C=T;if("x"===n){var O=!!m.xperiodalignment,L=!!m.yperiodalignment;for(c=0;c=Math.min(D,R)&&w<=Math.max(D,R)?0:1/0}if(f=Math.min(I,P)&&A<=Math.max(I,P)?0:1/0}p=Math.sqrt(f*f+h*h),s=a[c]}}}else for(c=a.length-1;c>-1;c--)l=x[i=a[c]],u=_[i],f=y.c2p(l)-w,h=b.c2p(u)-A,(d=Math.sqrt(f*f+h*h))m.glText.length){var w=x-m.glText.length;for(p=0;pr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),m.line2d.update(m.lineOptions)),m.error2d){var T=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(T)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,x),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var f,h,d=[],p=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[h+1]);)h-=2;0!==p[f+1]&&(d=[p[f],0]),d=d.concat(p.slice(f,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[h]);)h-=2;0!==p[f]&&(d=[0,p[f+1]]),d=d.concat(p.slice(f,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],a=0,t.splitNull=!0,i=0;i-1;for(p=0;ph?x.sizeAvg||Math.max(x.size,3):i(e,b),d=0;di&&l||a-1,L=!0;if(o(b)||!!d.selectedpoints||O){var D=d._length;if(d.selectedpoints){g.selectBatch=d.selectedpoints;var R=d.selectedpoints,I={};for(l=0;la&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),b={},x={},_=0;p?(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),T(v);for(var w=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],290:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-subtract"),o=t("robust-scale");function s(t){return(3===t?l:4===t?u:5===t?c:f)(a,i,n,o)}function l(t,e,r,n){return function(a,i,o){var s=r(a[0],a[0]),l=n(s,i[0]),u=n(s,o[0]),c=r(i[0],i[0]),f=n(c,a[0]),h=n(c,o[0]),d=r(o[0],o[0]),p=n(d,a[0]),g=n(d,i[0]),v=t(e(g,h),e(f,l)),m=e(p,u),y=e(v,m);return y[y.length-1]}}function u(t,e,r,n){return function(a,i,o,s){var l=t(r(a[0],a[0]),r(a[1],a[1])),u=n(l,i[0]),c=n(l,o[0]),f=n(l,s[0]),h=t(r(i[0],i[0]),r(i[1],i[1])),d=n(h,a[0]),p=n(h,o[0]),g=n(h,s[0]),v=t(r(o[0],o[0]),r(o[1],o[1])),m=n(v,a[0]),y=n(v,i[0]),b=n(v,s[0]),x=t(r(s[0],s[0]),r(s[1],s[1])),_=n(x,a[0]),w=n(x,i[0]),A=n(x,o[0]),T=t(t(n(e(A,b),i[1]),t(n(e(w,g),-o[1]),n(e(y,p),s[1]))),t(n(e(w,g),a[1]),t(n(e(_,f),-i[1]),n(e(d,u),s[1])))),k=t(t(n(e(A,b),a[1]),t(n(e(_,f),-o[1]),n(e(m,c),s[1]))),t(n(e(y,p),a[1]),t(n(e(m,c),-i[1]),n(e(d,u),o[1])))),M=e(T,k);return M[M.length-1]}}function c(t,e,r,n){return function(a,i,o,s,l){var u=t(r(a[0],a[0]),t(r(a[1],a[1]),r(a[2],a[2]))),c=n(u,i[0]),f=n(u,o[0]),h=n(u,s[0]),d=n(u,l[0]),p=t(r(i[0],i[0]),t(r(i[1],i[1]),r(i[2],i[2]))),g=n(p,a[0]),v=n(p,o[0]),m=n(p,s[0]),y=n(p,l[0]),b=t(r(o[0],o[0]),t(r(o[1],o[1]),r(o[2],o[2]))),x=n(b,a[0]),_=n(b,i[0]),w=n(b,s[0]),A=n(b,l[0]),T=t(r(s[0],s[0]),t(r(s[1],s[1]),r(s[2],s[2]))),k=n(T,a[0]),M=n(T,i[0]),E=n(T,o[0]),S=n(T,l[0]),C=t(r(l[0],l[0]),t(r(l[1],l[1]),r(l[2],l[2]))),O=n(C,a[0]),L=n(C,i[0]),D=n(C,o[0]),R=n(C,s[0]),I=t(t(t(n(t(n(e(R,S),o[1]),t(n(e(D,A),-s[1]),n(e(E,w),l[1]))),i[2]),t(n(t(n(e(R,S),i[1]),t(n(e(L,y),-s[1]),n(e(M,m),l[1]))),-o[2]),n(t(n(e(D,A),i[1]),t(n(e(L,y),-o[1]),n(e(_,v),l[1]))),s[2]))),t(n(t(n(e(E,w),i[1]),t(n(e(M,m),-o[1]),n(e(_,v),s[1]))),-l[2]),t(n(t(n(e(R,S),i[1]),t(n(e(L,y),-s[1]),n(e(M,m),l[1]))),a[2]),n(t(n(e(R,S),a[1]),t(n(e(O,d),-s[1]),n(e(k,h),l[1]))),-i[2])))),t(t(n(t(n(e(L,y),a[1]),t(n(e(O,d),-i[1]),n(e(g,c),l[1]))),s[2]),t(n(t(n(e(M,m),a[1]),t(n(e(k,h),-i[1]),n(e(g,c),s[1]))),-l[2]),n(t(n(e(E,w),i[1]),t(n(e(M,m),-o[1]),n(e(_,v),s[1]))),a[2]))),t(n(t(n(e(E,w),a[1]),t(n(e(k,h),-o[1]),n(e(x,f),s[1]))),-i[2]),t(n(t(n(e(M,m),a[1]),t(n(e(k,h),-i[1]),n(e(g,c),s[1]))),o[2]),n(t(n(e(_,v),a[1]),t(n(e(x,f),-i[1]),n(e(g,c),o[1]))),-s[2]))))),P=t(t(t(n(t(n(e(R,S),o[1]),t(n(e(D,A),-s[1]),n(e(E,w),l[1]))),a[2]),n(t(n(e(R,S),a[1]),t(n(e(O,d),-s[1]),n(e(k,h),l[1]))),-o[2])),t(n(t(n(e(D,A),a[1]),t(n(e(O,d),-o[1]),n(e(x,f),l[1]))),s[2]),n(t(n(e(E,w),a[1]),t(n(e(k,h),-o[1]),n(e(x,f),s[1]))),-l[2]))),t(t(n(t(n(e(D,A),i[1]),t(n(e(L,y),-o[1]),n(e(_,v),l[1]))),a[2]),n(t(n(e(D,A),a[1]),t(n(e(O,d),-o[1]),n(e(x,f),l[1]))),-i[2])),t(n(t(n(e(L,y),a[1]),t(n(e(O,d),-i[1]),n(e(g,c),l[1]))),o[2]),n(t(n(e(_,v),a[1]),t(n(e(x,f),-i[1]),n(e(g,c),o[1]))),-l[2])))),F=e(I,P);return F[F.length-1]}}function f(t,e,r,n){return function(a,i,o,s,l,u){var c=t(t(r(a[0],a[0]),r(a[1],a[1])),t(r(a[2],a[2]),r(a[3],a[3]))),f=n(c,i[0]),h=n(c,o[0]),d=n(c,s[0]),p=n(c,l[0]),g=n(c,u[0]),v=t(t(r(i[0],i[0]),r(i[1],i[1])),t(r(i[2],i[2]),r(i[3],i[3]))),m=n(v,a[0]),y=n(v,o[0]),b=n(v,s[0]),x=n(v,l[0]),_=n(v,u[0]),w=t(t(r(o[0],o[0]),r(o[1],o[1])),t(r(o[2],o[2]),r(o[3],o[3]))),A=n(w,a[0]),T=n(w,i[0]),k=n(w,s[0]),M=n(w,l[0]),E=n(w,u[0]),S=t(t(r(s[0],s[0]),r(s[1],s[1])),t(r(s[2],s[2]),r(s[3],s[3]))),C=n(S,a[0]),O=n(S,i[0]),L=n(S,o[0]),D=n(S,l[0]),R=n(S,u[0]),I=t(t(r(l[0],l[0]),r(l[1],l[1])),t(r(l[2],l[2]),r(l[3],l[3]))),P=n(I,a[0]),F=n(I,i[0]),N=n(I,o[0]),z=n(I,s[0]),B=n(I,u[0]),j=t(t(r(u[0],u[0]),r(u[1],u[1])),t(r(u[2],u[2]),r(u[3],u[3]))),U=n(j,a[0]),H=n(j,i[0]),V=n(j,o[0]),Y=n(j,s[0]),G=n(j,l[0]),q=t(t(t(n(t(t(n(t(n(e(G,B),s[1]),t(n(e(Y,R),-l[1]),n(e(z,D),u[1]))),o[2]),n(t(n(e(G,B),o[1]),t(n(e(V,E),-l[1]),n(e(N,M),u[1]))),-s[2])),t(n(t(n(e(Y,R),o[1]),t(n(e(V,E),-s[1]),n(e(L,k),u[1]))),l[2]),n(t(n(e(z,D),o[1]),t(n(e(N,M),-s[1]),n(e(L,k),l[1]))),-u[2]))),i[3]),t(n(t(t(n(t(n(e(G,B),s[1]),t(n(e(Y,R),-l[1]),n(e(z,D),u[1]))),i[2]),n(t(n(e(G,B),i[1]),t(n(e(H,_),-l[1]),n(e(F,x),u[1]))),-s[2])),t(n(t(n(e(Y,R),i[1]),t(n(e(H,_),-s[1]),n(e(O,b),u[1]))),l[2]),n(t(n(e(z,D),i[1]),t(n(e(F,x),-s[1]),n(e(O,b),l[1]))),-u[2]))),-o[3]),n(t(t(n(t(n(e(G,B),o[1]),t(n(e(V,E),-l[1]),n(e(N,M),u[1]))),i[2]),n(t(n(e(G,B),i[1]),t(n(e(H,_),-l[1]),n(e(F,x),u[1]))),-o[2])),t(n(t(n(e(V,E),i[1]),t(n(e(H,_),-o[1]),n(e(T,y),u[1]))),l[2]),n(t(n(e(N,M),i[1]),t(n(e(F,x),-o[1]),n(e(T,y),l[1]))),-u[2]))),s[3]))),t(t(n(t(t(n(t(n(e(Y,R),o[1]),t(n(e(V,E),-s[1]),n(e(L,k),u[1]))),i[2]),n(t(n(e(Y,R),i[1]),t(n(e(H,_),-s[1]),n(e(O,b),u[1]))),-o[2])),t(n(t(n(e(V,E),i[1]),t(n(e(H,_),-o[1]),n(e(T,y),u[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(O,b),-o[1]),n(e(T,y),s[1]))),-u[2]))),-l[3]),n(t(t(n(t(n(e(z,D),o[1]),t(n(e(N,M),-s[1]),n(e(L,k),l[1]))),i[2]),n(t(n(e(z,D),i[1]),t(n(e(F,x),-s[1]),n(e(O,b),l[1]))),-o[2])),t(n(t(n(e(N,M),i[1]),t(n(e(F,x),-o[1]),n(e(T,y),l[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(O,b),-o[1]),n(e(T,y),s[1]))),-l[2]))),u[3])),t(n(t(t(n(t(n(e(G,B),s[1]),t(n(e(Y,R),-l[1]),n(e(z,D),u[1]))),i[2]),n(t(n(e(G,B),i[1]),t(n(e(H,_),-l[1]),n(e(F,x),u[1]))),-s[2])),t(n(t(n(e(Y,R),i[1]),t(n(e(H,_),-s[1]),n(e(O,b),u[1]))),l[2]),n(t(n(e(z,D),i[1]),t(n(e(F,x),-s[1]),n(e(O,b),l[1]))),-u[2]))),a[3]),n(t(t(n(t(n(e(G,B),s[1]),t(n(e(Y,R),-l[1]),n(e(z,D),u[1]))),a[2]),n(t(n(e(G,B),a[1]),t(n(e(U,g),-l[1]),n(e(P,p),u[1]))),-s[2])),t(n(t(n(e(Y,R),a[1]),t(n(e(U,g),-s[1]),n(e(C,d),u[1]))),l[2]),n(t(n(e(z,D),a[1]),t(n(e(P,p),-s[1]),n(e(C,d),l[1]))),-u[2]))),-i[3])))),t(t(t(n(t(t(n(t(n(e(G,B),i[1]),t(n(e(H,_),-l[1]),n(e(F,x),u[1]))),a[2]),n(t(n(e(G,B),a[1]),t(n(e(U,g),-l[1]),n(e(P,p),u[1]))),-i[2])),t(n(t(n(e(H,_),a[1]),t(n(e(U,g),-i[1]),n(e(m,f),u[1]))),l[2]),n(t(n(e(F,x),a[1]),t(n(e(P,p),-i[1]),n(e(m,f),l[1]))),-u[2]))),s[3]),n(t(t(n(t(n(e(Y,R),i[1]),t(n(e(H,_),-s[1]),n(e(O,b),u[1]))),a[2]),n(t(n(e(Y,R),a[1]),t(n(e(U,g),-s[1]),n(e(C,d),u[1]))),-i[2])),t(n(t(n(e(H,_),a[1]),t(n(e(U,g),-i[1]),n(e(m,f),u[1]))),s[2]),n(t(n(e(O,b),a[1]),t(n(e(C,d),-i[1]),n(e(m,f),s[1]))),-u[2]))),-l[3])),t(n(t(t(n(t(n(e(z,D),i[1]),t(n(e(F,x),-s[1]),n(e(O,b),l[1]))),a[2]),n(t(n(e(z,D),a[1]),t(n(e(P,p),-s[1]),n(e(C,d),l[1]))),-i[2])),t(n(t(n(e(F,x),a[1]),t(n(e(P,p),-i[1]),n(e(m,f),l[1]))),s[2]),n(t(n(e(O,b),a[1]),t(n(e(C,d),-i[1]),n(e(m,f),s[1]))),-l[2]))),u[3]),n(t(t(n(t(n(e(Y,R),o[1]),t(n(e(V,E),-s[1]),n(e(L,k),u[1]))),i[2]),n(t(n(e(Y,R),i[1]),t(n(e(H,_),-s[1]),n(e(O,b),u[1]))),-o[2])),t(n(t(n(e(V,E),i[1]),t(n(e(H,_),-o[1]),n(e(T,y),u[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(O,b),-o[1]),n(e(T,y),s[1]))),-u[2]))),a[3]))),t(t(n(t(t(n(t(n(e(Y,R),o[1]),t(n(e(V,E),-s[1]),n(e(L,k),u[1]))),a[2]),n(t(n(e(Y,R),a[1]),t(n(e(U,g),-s[1]),n(e(C,d),u[1]))),-o[2])),t(n(t(n(e(V,E),a[1]),t(n(e(U,g),-o[1]),n(e(A,h),u[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(C,d),-o[1]),n(e(A,h),s[1]))),-u[2]))),-i[3]),n(t(t(n(t(n(e(Y,R),i[1]),t(n(e(H,_),-s[1]),n(e(O,b),u[1]))),a[2]),n(t(n(e(Y,R),a[1]),t(n(e(U,g),-s[1]),n(e(C,d),u[1]))),-i[2])),t(n(t(n(e(H,_),a[1]),t(n(e(U,g),-i[1]),n(e(m,f),u[1]))),s[2]),n(t(n(e(O,b),a[1]),t(n(e(C,d),-i[1]),n(e(m,f),s[1]))),-u[2]))),o[3])),t(n(t(t(n(t(n(e(V,E),i[1]),t(n(e(H,_),-o[1]),n(e(T,y),u[1]))),a[2]),n(t(n(e(V,E),a[1]),t(n(e(U,g),-o[1]),n(e(A,h),u[1]))),-i[2])),t(n(t(n(e(H,_),a[1]),t(n(e(U,g),-i[1]),n(e(m,f),u[1]))),o[2]),n(t(n(e(T,y),a[1]),t(n(e(A,h),-i[1]),n(e(m,f),o[1]))),-u[2]))),-s[3]),n(t(t(n(t(n(e(L,k),i[1]),t(n(e(O,b),-o[1]),n(e(T,y),s[1]))),a[2]),n(t(n(e(L,k),a[1]),t(n(e(C,d),-o[1]),n(e(A,h),s[1]))),-i[2])),t(n(t(n(e(O,b),a[1]),t(n(e(C,d),-i[1]),n(e(m,f),s[1]))),o[2]),n(t(n(e(T,y),a[1]),t(n(e(A,h),-i[1]),n(e(m,f),o[1]))),-s[2]))),u[3]))))),W=t(t(t(n(t(t(n(t(n(e(G,B),s[1]),t(n(e(Y,R),-l[1]),n(e(z,D),u[1]))),o[2]),n(t(n(e(G,B),o[1]),t(n(e(V,E),-l[1]),n(e(N,M),u[1]))),-s[2])),t(n(t(n(e(Y,R),o[1]),t(n(e(V,E),-s[1]),n(e(L,k),u[1]))),l[2]),n(t(n(e(z,D),o[1]),t(n(e(N,M),-s[1]),n(e(L,k),l[1]))),-u[2]))),a[3]),t(n(t(t(n(t(n(e(G,B),s[1]),t(n(e(Y,R),-l[1]),n(e(z,D),u[1]))),a[2]),n(t(n(e(G,B),a[1]),t(n(e(U,g),-l[1]),n(e(P,p),u[1]))),-s[2])),t(n(t(n(e(Y,R),a[1]),t(n(e(U,g),-s[1]),n(e(C,d),u[1]))),l[2]),n(t(n(e(z,D),a[1]),t(n(e(P,p),-s[1]),n(e(C,d),l[1]))),-u[2]))),-o[3]),n(t(t(n(t(n(e(G,B),o[1]),t(n(e(V,E),-l[1]),n(e(N,M),u[1]))),a[2]),n(t(n(e(G,B),a[1]),t(n(e(U,g),-l[1]),n(e(P,p),u[1]))),-o[2])),t(n(t(n(e(V,E),a[1]),t(n(e(U,g),-o[1]),n(e(A,h),u[1]))),l[2]),n(t(n(e(N,M),a[1]),t(n(e(P,p),-o[1]),n(e(A,h),l[1]))),-u[2]))),s[3]))),t(t(n(t(t(n(t(n(e(Y,R),o[1]),t(n(e(V,E),-s[1]),n(e(L,k),u[1]))),a[2]),n(t(n(e(Y,R),a[1]),t(n(e(U,g),-s[1]),n(e(C,d),u[1]))),-o[2])),t(n(t(n(e(V,E),a[1]),t(n(e(U,g),-o[1]),n(e(A,h),u[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(C,d),-o[1]),n(e(A,h),s[1]))),-u[2]))),-l[3]),n(t(t(n(t(n(e(z,D),o[1]),t(n(e(N,M),-s[1]),n(e(L,k),l[1]))),a[2]),n(t(n(e(z,D),a[1]),t(n(e(P,p),-s[1]),n(e(C,d),l[1]))),-o[2])),t(n(t(n(e(N,M),a[1]),t(n(e(P,p),-o[1]),n(e(A,h),l[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(C,d),-o[1]),n(e(A,h),s[1]))),-l[2]))),u[3])),t(n(t(t(n(t(n(e(G,B),o[1]),t(n(e(V,E),-l[1]),n(e(N,M),u[1]))),i[2]),n(t(n(e(G,B),i[1]),t(n(e(H,_),-l[1]),n(e(F,x),u[1]))),-o[2])),t(n(t(n(e(V,E),i[1]),t(n(e(H,_),-o[1]),n(e(T,y),u[1]))),l[2]),n(t(n(e(N,M),i[1]),t(n(e(F,x),-o[1]),n(e(T,y),l[1]))),-u[2]))),a[3]),n(t(t(n(t(n(e(G,B),o[1]),t(n(e(V,E),-l[1]),n(e(N,M),u[1]))),a[2]),n(t(n(e(G,B),a[1]),t(n(e(U,g),-l[1]),n(e(P,p),u[1]))),-o[2])),t(n(t(n(e(V,E),a[1]),t(n(e(U,g),-o[1]),n(e(A,h),u[1]))),l[2]),n(t(n(e(N,M),a[1]),t(n(e(P,p),-o[1]),n(e(A,h),l[1]))),-u[2]))),-i[3])))),t(t(t(n(t(t(n(t(n(e(G,B),i[1]),t(n(e(H,_),-l[1]),n(e(F,x),u[1]))),a[2]),n(t(n(e(G,B),a[1]),t(n(e(U,g),-l[1]),n(e(P,p),u[1]))),-i[2])),t(n(t(n(e(H,_),a[1]),t(n(e(U,g),-i[1]),n(e(m,f),u[1]))),l[2]),n(t(n(e(F,x),a[1]),t(n(e(P,p),-i[1]),n(e(m,f),l[1]))),-u[2]))),o[3]),n(t(t(n(t(n(e(V,E),i[1]),t(n(e(H,_),-o[1]),n(e(T,y),u[1]))),a[2]),n(t(n(e(V,E),a[1]),t(n(e(U,g),-o[1]),n(e(A,h),u[1]))),-i[2])),t(n(t(n(e(H,_),a[1]),t(n(e(U,g),-i[1]),n(e(m,f),u[1]))),o[2]),n(t(n(e(T,y),a[1]),t(n(e(A,h),-i[1]),n(e(m,f),o[1]))),-u[2]))),-l[3])),t(n(t(t(n(t(n(e(N,M),i[1]),t(n(e(F,x),-o[1]),n(e(T,y),l[1]))),a[2]),n(t(n(e(N,M),a[1]),t(n(e(P,p),-o[1]),n(e(A,h),l[1]))),-i[2])),t(n(t(n(e(F,x),a[1]),t(n(e(P,p),-i[1]),n(e(m,f),l[1]))),o[2]),n(t(n(e(T,y),a[1]),t(n(e(A,h),-i[1]),n(e(m,f),o[1]))),-l[2]))),u[3]),n(t(t(n(t(n(e(z,D),o[1]),t(n(e(N,M),-s[1]),n(e(L,k),l[1]))),i[2]),n(t(n(e(z,D),i[1]),t(n(e(F,x),-s[1]),n(e(O,b),l[1]))),-o[2])),t(n(t(n(e(N,M),i[1]),t(n(e(F,x),-o[1]),n(e(T,y),l[1]))),s[2]),n(t(n(e(L,k),i[1]),t(n(e(O,b),-o[1]),n(e(T,y),s[1]))),-l[2]))),a[3]))),t(t(n(t(t(n(t(n(e(z,D),o[1]),t(n(e(N,M),-s[1]),n(e(L,k),l[1]))),a[2]),n(t(n(e(z,D),a[1]),t(n(e(P,p),-s[1]),n(e(C,d),l[1]))),-o[2])),t(n(t(n(e(N,M),a[1]),t(n(e(P,p),-o[1]),n(e(A,h),l[1]))),s[2]),n(t(n(e(L,k),a[1]),t(n(e(C,d),-o[1]),n(e(A,h),s[1]))),-l[2]))),-i[3]),n(t(t(n(t(n(e(z,D),i[1]),t(n(e(F,x),-s[1]),n(e(O,b),l[1]))),a[2]),n(t(n(e(z,D),a[1]),t(n(e(P,p),-s[1]),n(e(C,d),l[1]))),-i[2])),t(n(t(n(e(F,x),a[1]),t(n(e(P,p),-i[1]),n(e(m,f),l[1]))),s[2]),n(t(n(e(O,b),a[1]),t(n(e(C,d),-i[1]),n(e(m,f),s[1]))),-l[2]))),o[3])),t(n(t(t(n(t(n(e(N,M),i[1]),t(n(e(F,x),-o[1]),n(e(T,y),l[1]))),a[2]),n(t(n(e(N,M),a[1]),t(n(e(P,p),-o[1]),n(e(A,h),l[1]))),-i[2])),t(n(t(n(e(F,x),a[1]),t(n(e(P,p),-i[1]),n(e(m,f),l[1]))),o[2]),n(t(n(e(T,y),a[1]),t(n(e(A,h),-i[1]),n(e(m,f),o[1]))),-l[2]))),-s[3]),n(t(t(n(t(n(e(L,k),i[1]),t(n(e(O,b),-o[1]),n(e(T,y),s[1]))),a[2]),n(t(n(e(L,k),a[1]),t(n(e(C,d),-o[1]),n(e(A,h),s[1]))),-i[2])),t(n(t(n(e(O,b),a[1]),t(n(e(C,d),-i[1]),n(e(m,f),s[1]))),o[2]),n(t(n(e(T,y),a[1]),t(n(e(A,h),-i[1]),n(e(m,f),o[1]))),-s[2]))),l[3]))))),X=e(q,W);return X[X.length-1]}}var h=[function(){return 0},function(){return 0},function(){return 0}];function d(t){var e=h[t.length];return e||(e=h[t.length]=s(t.length)),e.apply(void 0,t)}function p(t,e,r,n,a,i,o,s){return function(e,r,l,u,c,f){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return a(e,r,l);case 4:return i(e,r,l,u);case 5:return o(e,r,l,u,c);case 6:return s(e,r,l,u,c,f)}for(var h=new Array(arguments.length),d=0;d0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=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],f=e[2]-n[2],d=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}function g(t,e,r,n,a,i,o){return function(e,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return a(e,r,s);case 4:return i(e,r,s,l);case 5:return o(e,r,s,l,u)}for(var c=new Array(arguments.length),f=0;f0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],298:[function(t,e,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],299:[function(t,e,r){"use strict";var n=t("bit-twiddle"),a=t("union-find");function i(t,e){var r=t.length,n=t.length-e.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||a(t[0],t[1])-a(e[0],e[1]);case 3:var i=t[0]+t[1],o=e[0]+e[1];if(s=i+t[2]-(o+e[2]))return s;var s,l=a(t[0],t[1]),u=a(e[0],e[1]);return(s=a(l,t[2])-a(u,e[2]))||a(l+t[2],i)-a(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;h>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=T[0];return v(0,M-1),M-=1,b(0),t}return-1}function w(t,e){var r=T[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((M+=1)-1))}function A(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),k[e]>=0&&w(k[e],g(e)),k[r]>=0&&w(k[r],g(r))}}var T=[],k=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;A(E)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=k[e],a=k[r];n!==a&&O.push([n,a])}})),a.unique(a.normalize(O)),{positions:S,edges:O}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":291,"simplicial-complex":299}],302:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(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=n(s,o,i),u=n(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]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return a;d=f[h]}}if(d.start)if(s){var p=i(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=d.index)}else a=d.index;else d.y!==t[1]&&(a=d.index)}}}return a}},{"./lib/order-segments":302,"binary-search-bounds":45,"functional-red-black-tree":162,"robust-orientation":291}],304:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+a+l:"0"===u?h+l+a:l+h+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],305:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;sn|0},vertex:function(t,e,r,n,a,i,o,s,l,u,c,f,h){var d=(o<<0)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==d&&15!==d)switch(d){case 0:c.push([t-.5,e-.5]);break;case 1:c.push([t-.25-.25*(n+r-2*h)/(r-n),e-.25-.25*(a+r-2*h)/(r-a)]);break;case 2:c.push([t-.75-.25*(-n-r+2*h)/(n-r),e-.25-.25*(i+n-2*h)/(n-i)]);break;case 3:c.push([t-.5,e-.5-.5*(a+r+i+n-4*h)/(r-a+n-i)]);break;case 4:c.push([t-.25-.25*(i+a-2*h)/(a-i),e-.75-.25*(-a-r+2*h)/(a-r)]);break;case 5:c.push([t-.5-.5*(n+r+i+a-4*h)/(r-n+a-i),e-.5]);break;case 6:c.push([t-.5-.25*(-n-r+i+a)/(n-r+a-i),e-.5-.25*(-a-r+i+n)/(a-r+n-i)]);break;case 7:c.push([t-.75-.25*(i+a-2*h)/(a-i),e-.75-.25*(i+n-2*h)/(n-i)]);break;case 8:c.push([t-.75-.25*(-i-a+2*h)/(i-a),e-.75-.25*(-i-n+2*h)/(i-n)]);break;case 9:c.push([t-.5-.25*(n+r+-i-a)/(r-n+i-a),e-.5-.25*(a+r+-i-n)/(r-a+i-n)]);break;case 10:c.push([t-.5-.5*(-n-r-i-a+4*h)/(n-r+i-a),e-.5]);break;case 11:c.push([t-.25-.25*(-i-a+2*h)/(i-a),e-.75-.25*(a+r-2*h)/(r-a)]);break;case 12:c.push([t-.5,e-.5-.5*(-a-r-i-n+4*h)/(a-r+i-n)]);break;case 13:c.push([t-.75-.25*(n+r-2*h)/(r-n),e-.25-.25*(-i-n+2*h)/(i-n)]);break;case 14:c.push([t-.25-.25*(-n-r+2*h)/(n-r),e-.25-.25*(-a-r+2*h)/(a-r)]);break;case 15:c.push([t-.5,e-.5])}},cell:function(t,e,r,n,a,i,o,s,l){a?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],a=[];return n(t,r,a,e),{positions:r,cells:a}}},"3d":function(t,e,r){var n=t({order:e,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(t,e,r,n){return t>n|0},vertex:function(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_){var w=(f<<0)+(h<<1)+(d<<2)+(p<<3)+(g<<4)+(v<<5)+(m<<6)+(y<<7)|0;if(0!==w&&255!==w)switch(w>>>7){case 0:!function(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_){switch(t){case 0:x.push([e-.5,r-.5,n-.5]);break;case 1:x.push([e-1/6-1/6*(i+a-2*_)/(a-i),r-1/6-1/6*(o+a-2*_)/(a-o),n-1/6-1/6*(l+a-2*_)/(a-l)]);break;case 2:x.push([e-5/6-1/6*(-i-a+2*_)/(i-a),r-1/6-1/6*(s+i-2*_)/(i-s),n-1/6-1/6*(u+i-2*_)/(i-u)]);break;case 3:x.push([e-.5,r-.25-.25*(o+a+s+i-4*_)/(a-o+i-s),n-.25-.25*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 4:x.push([e-1/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(-o-a+2*_)/(o-a),n-1/6-1/6*(c+o-2*_)/(o-c)]);break;case 5:x.push([e-.25-.25*(i+a+s+o-4*_)/(a-i+o-s),r-.5,n-.25-.25*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 6:x.push([e-.5-1/6*(-i-a+s+o)/(i-a+o-s),r-.5-1/6*(-o-a+s+i)/(o-a+i-s),n-1/6-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 7:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(s+i-2*_)/(i-s),n-.3-.3*(l+a+u+i+c+o-6*_)/(a-l+i-u+o-c)]);break;case 8:x.push([e-5/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(-s-i+2*_)/(s-i),n-1/6-1/6*(f+s-2*_)/(s-f)]);break;case 9:x.push([e-.5-1/6*(i+a+-s-o)/(a-i+s-o),r-.5-1/6*(o+a+-s-i)/(a-o+s-i),n-1/6-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 10:x.push([e-.75-.25*(-i-a-s-o+4*_)/(i-a+s-o),r-.5,n-.25-.25*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 11:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(o+a-2*_)/(a-o),n-.3-.3*(l+a+u+i+f+s-6*_)/(a-l+i-u+s-f)]);break;case 12:x.push([e-.5,r-.75-.25*(-o-a-s-i+4*_)/(o-a+s-i),n-.25-.25*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 13:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.5-.1*(-s-i+2*_)/(s-i),n-.3-.3*(l+a+c+o+f+s-6*_)/(a-l+o-c+s-f)]);break;case 14:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.5-.1*(-o-a+2*_)/(o-a),n-.3-.3*(u+i+c+o+f+s-6*_)/(i-u+o-c+s-f)]);break;case 15:x.push([e-.5,r-.5,n-.5-.5*(l+a+u+i+c+o+f+s-8*_)/(a-l+i-u+o-c+s-f)]);break;case 16:x.push([e-1/6-1/6*(u+l-2*_)/(l-u),r-1/6-1/6*(c+l-2*_)/(l-c),n-5/6-1/6*(-l-a+2*_)/(l-a)]);break;case 17:x.push([e-.25-.25*(i+a+u+l-4*_)/(a-i+l-u),r-.25-.25*(o+a+c+l-4*_)/(a-o+l-c),n-.5]);break;case 18:x.push([e-.5-1/6*(-i-a+u+l)/(i-a+l-u),r-1/6-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(-l-a+u+i)/(l-a+i-u)]);break;case 19:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.3-.3*(o+a+s+i+c+l-6*_)/(a-o+i-s+l-c),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 20:x.push([e-1/6-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(-o-a+c+l)/(o-a+l-c),n-.5-1/6*(-l-a+c+o)/(l-a+o-c)]);break;case 21:x.push([e-.3-.3*(i+a+s+o+u+l-6*_)/(a-i+o-s+l-u),r-.5-.1*(c+l-2*_)/(l-c),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 22:x.push([e-7/18-1/6*(-i-a+s+o+u+l-2*_)/(i-a+o-s+l-u),r-7/18-1/6*(-o-a+s+i+c+l-2*_)/(o-a+i-s+l-c),n-7/18-1/6*(-l-a+u+i+c+o-2*_)/(l-a+i-u+o-c)]);break;case 23:x.push([e-.5-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 24:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 25:x.push([e-.5-3/14*(i+a+-s-o+u+l-2*_)/(a-i+s-o+l-u),r-.5-3/14*(o+a+-s-i+c+l-2*_)/(a-o+s-i+l-c),n-5/14-1/14*(f+s-2*_)/(s-f)]);break;case 26:x.push([e-.5-3/14*(-i-a-s-o+u+l+2*_)/(i-a+s-o+l-u),r-5/14-1/14*(c+l-2*_)/(l-c),n-.5-3/14*(-l-a+u+i+f+s-2*_)/(l-a+i-u+s-f)]);break;case 27:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(o+a+c+l-4*_)/(a-o+l-c),n-.5-1/6*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 28:x.push([e-5/14-1/14*(u+l-2*_)/(l-u),r-.5-3/14*(-o-a-s-i+c+l+2*_)/(o-a+s-i+l-c),n-.5-3/14*(-l-a+c+o+f+s-2*_)/(l-a+o-c+s-f)]);break;case 29:x.push([e-.5-1/6*(i+a+u+l-4*_)/(a-i+l-u),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 30:x.push([e-.375-.125*(-i-a+u+l)/(i-a+l-u),r-.375-.125*(-o-a+c+l)/(o-a+l-c),n-.5-.25*(-l-a+u+i+c+o+f+s-4*_)/(l-a+i-u+o-c+s-f)]);break;case 31:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.5-.1*(c+l-2*_)/(l-c),n-.7-.3*(u+i+c+o+f+s-6*_)/(i-u+o-c+s-f)]);break;case 32:x.push([e-5/6-1/6*(-u-l+2*_)/(u-l),r-1/6-1/6*(f+u-2*_)/(u-f),n-5/6-1/6*(-u-i+2*_)/(u-i)]);break;case 33:x.push([e-.5-1/6*(i+a+-u-l)/(a-i+u-l),r-1/6-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(l+a+-u-i)/(a-l+u-i)]);break;case 34:x.push([e-.75-.25*(-i-a-u-l+4*_)/(i-a+u-l),r-.25-.25*(s+i+f+u-4*_)/(i-s+u-f),n-.5]);break;case 35:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.3-.3*(o+a+s+i+f+u-6*_)/(a-o+i-s+u-f),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 36:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 37:x.push([e-.5-3/14*(i+a+s+o+-u-l-2*_)/(a-i+o-s+u-l),r-5/14-1/14*(f+u-2*_)/(u-f),n-.5-3/14*(l+a+-u-i+c+o-2*_)/(a-l+u-i+o-c)]);break;case 38:x.push([e-.5-3/14*(-i-a+s+o+-u-l+2*_)/(i-a+o-s+u-l),r-.5-3/14*(-o-a+s+i+f+u-2*_)/(o-a+i-s+u-f),n-5/14-1/14*(c+o-2*_)/(o-c)]);break;case 39:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(s+i+f+u-4*_)/(i-s+u-f),n-.5-1/6*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 40:x.push([e-5/6-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(-s-i+f+u)/(s-i+u-f),n-.5-1/6*(-u-i+f+s)/(u-i+s-f)]);break;case 41:x.push([e-11/18-1/6*(i+a+-s-o-u-l+2*_)/(a-i+s-o+u-l),r-7/18-1/6*(o+a+-s-i+f+u-2*_)/(a-o+s-i+u-f),n-7/18-1/6*(l+a+-u-i+f+s-2*_)/(a-l+u-i+s-f)]);break;case 42:x.push([e-.7-.3*(-i-a-s-o-u-l+6*_)/(i-a+s-o+u-l),r-.5-.1*(f+u-2*_)/(u-f),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 43:x.push([e-.5-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 44:x.push([e-9/14-1/14*(-u-l+2*_)/(u-l),r-.5-3/14*(-o-a-s-i+f+u+2*_)/(o-a+s-i+u-f),n-.5-3/14*(-u-i+c+o+f+s-2*_)/(u-i+o-c+s-f)]);break;case 45:x.push([e-.625-.125*(i+a+-u-l)/(a-i+u-l),r-.375-.125*(-s-i+f+u)/(s-i+u-f),n-.5-.25*(l+a+-u-i+c+o+f+s-4*_)/(a-l+u-i+o-c+s-f)]);break;case 46:x.push([e-.5-1/6*(-i-a-u-l+4*_)/(i-a+u-l),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 47:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.5-.1*(f+u-2*_)/(u-f),n-.7-.3*(l+a+c+o+f+s-6*_)/(a-l+o-c+s-f)]);break;case 48:x.push([e-.5,r-.25-.25*(c+l+f+u-4*_)/(l-c+u-f),n-.75-.25*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 49:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.3-.3*(o+a+c+l+f+u-6*_)/(a-o+l-c+u-f),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 50:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.3-.3*(s+i+c+l+f+u-6*_)/(i-s+l-c+u-f),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 51:x.push([e-.5,r-.5-.5*(o+a+s+i+c+l+f+u-8*_)/(a-o+i-s+l-c+u-f),n-.5]);break;case 52:x.push([e-5/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(-o-a+c+l+f+u-2*_)/(o-a+l-c+u-f),n-.5-3/14*(-l-a-u-i+c+o+2*_)/(l-a+u-i+o-c)]);break;case 53:x.push([e-.5-1/6*(i+a+s+o-4*_)/(a-i+o-s),r-.5-1/6*(c+l+f+u-4*_)/(l-c+u-f),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 54:x.push([e-.375-.125*(-i-a+s+o)/(i-a+o-s),r-.5-.25*(-o-a+s+i+c+l+f+u-4*_)/(o-a+i-s+l-c+u-f),n-.375-.125*(-l-a+c+o)/(l-a+o-c)]);break;case 55:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(s+i+c+l+f+u-6*_)/(i-s+l-c+u-f),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 56:x.push([e-9/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(-s-i+c+l+f+u-2*_)/(s-i+l-c+u-f),n-.5-3/14*(-l-a-u-i+f+s+2*_)/(l-a+u-i+s-f)]);break;case 57:x.push([e-.625-.125*(i+a+-s-o)/(a-i+s-o),r-.5-.25*(o+a+-s-i+c+l+f+u-4*_)/(a-o+s-i+l-c+u-f),n-.375-.125*(-u-i+f+s)/(u-i+s-f)]);break;case 58:x.push([e-.5-1/6*(-i-a-s-o+4*_)/(i-a+s-o),r-.5-1/6*(c+l+f+u-4*_)/(l-c+u-f),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 59:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(o+a+c+l+f+u-6*_)/(a-o+l-c+u-f),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 60:x.push([e-.5,r-.5-.25*(-o-a-s-i+c+l+f+u)/(o-a+s-i+l-c+u-f),n-.5-.25*(-l-a-u-i+c+o+f+s)/(l-a+u-i+o-c+s-f)]);break;case 61:x.push([e-9/14-1/14*(i+a-2*_)/(a-i),r-.5-3/14*(-s-i+c+l+f+u-2*_)/(s-i+l-c+u-f),n-.5-3/14*(-u-i+c+o+f+s-2*_)/(u-i+o-c+s-f)]);break;case 62:x.push([e-5/14-1/14*(-i-a+2*_)/(i-a),r-.5-3/14*(-o-a+c+l+f+u-2*_)/(o-a+l-c+u-f),n-.5-3/14*(-l-a+c+o+f+s-2*_)/(l-a+o-c+s-f)]);break;case 63:x.push([e-.5,r-.75-.25*(c+l+f+u-4*_)/(l-c+u-f),n-.75-.25*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 64:x.push([e-1/6-1/6*(f+c-2*_)/(c-f),r-5/6-1/6*(-c-l+2*_)/(c-l),n-5/6-1/6*(-c-o+2*_)/(c-o)]);break;case 65:x.push([e-1/6-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(o+a+-c-l)/(a-o+c-l),n-.5-1/6*(l+a+-c-o)/(a-l+c-o)]);break;case 66:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 67:x.push([e-5/14-1/14*(f+c-2*_)/(c-f),r-.5-3/14*(o+a+s+i+-c-l-2*_)/(a-o+i-s+c-l),n-.5-3/14*(l+a+u+i+-c-o-2*_)/(a-l+i-u+c-o)]);break;case 68:x.push([e-.25-.25*(s+o+f+c-4*_)/(o-s+c-f),r-.75-.25*(-o-a-c-l+4*_)/(o-a+c-l),n-.5]);break;case 69:x.push([e-.3-.3*(i+a+s+o+f+c-6*_)/(a-i+o-s+c-f),r-.5-.1*(-c-l+2*_)/(c-l),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 70:x.push([e-.5-3/14*(-i-a+s+o+f+c-2*_)/(i-a+o-s+c-f),r-.5-3/14*(-o-a+s+i+-c-l+2*_)/(o-a+i-s+c-l),n-5/14-1/14*(u+i-2*_)/(i-u)]);break;case 71:x.push([e-.5-1/6*(s+o+f+c-4*_)/(o-s+c-f),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 72:x.push([e-.5-1/6*(-s-o+f+c)/(s-o+c-f),r-5/6-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(-c-o+f+s)/(c-o+s-f)]);break;case 73:x.push([e-7/18-1/6*(i+a+-s-o+f+c-2*_)/(a-i+s-o+c-f),r-11/18-1/6*(o+a+-s-i-c-l+2*_)/(a-o+s-i+c-l),n-7/18-1/6*(l+a+-c-o+f+s-2*_)/(a-l+c-o+s-f)]);break;case 74:x.push([e-.5-3/14*(-i-a-s-o+f+c+2*_)/(i-a+s-o+c-f),r-9/14-1/14*(-c-l+2*_)/(c-l),n-.5-3/14*(u+i+-c-o+f+s-2*_)/(i-u+c-o+s-f)]);break;case 75:x.push([e-.375-.125*(-s-o+f+c)/(s-o+c-f),r-.625-.125*(o+a+-c-l)/(a-o+c-l),n-.5-.25*(l+a+u+i+-c-o+f+s-4*_)/(a-l+i-u+c-o+s-f)]);break;case 76:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.7-.3*(-o-a-s-i-c-l+6*_)/(o-a+s-i+c-l),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 77:x.push([e-.5-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 78:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(-o-a-c-l+4*_)/(o-a+c-l),n-.5-1/6*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 79:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.5-.1*(-c-l+2*_)/(c-l),n-.7-.3*(l+a+u+i+f+s-6*_)/(a-l+i-u+s-f)]);break;case 80:x.push([e-.25-.25*(u+l+f+c-4*_)/(l-u+c-f),r-.5,n-.75-.25*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 81:x.push([e-.3-.3*(i+a+u+l+f+c-6*_)/(a-i+l-u+c-f),r-.5-.1*(o+a-2*_)/(a-o),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 82:x.push([e-.5-3/14*(-i-a+u+l+f+c-2*_)/(i-a+l-u+c-f),r-5/14-1/14*(s+i-2*_)/(i-s),n-.5-3/14*(-l-a+u+i+-c-o+2*_)/(l-a+i-u+c-o)]);break;case 83:x.push([e-.5-1/6*(u+l+f+c-4*_)/(l-u+c-f),r-.5-1/6*(o+a+s+i-4*_)/(a-o+i-s),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 84:x.push([e-.3-.3*(s+o+u+l+f+c-6*_)/(o-s+l-u+c-f),r-.5-.1*(-o-a+2*_)/(o-a),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 85:x.push([e-.5-.5*(i+a+s+o+u+l+f+c-8*_)/(a-i+o-s+l-u+c-f),r-.5,n-.5]);break;case 86:x.push([e-.5-.25*(-i-a+s+o+u+l+f+c-4*_)/(i-a+o-s+l-u+c-f),r-.375-.125*(-o-a+s+i)/(o-a+i-s),n-.375-.125*(-l-a+u+i)/(l-a+i-u)]);break;case 87:x.push([e-.7-.3*(s+o+u+l+f+c-6*_)/(o-s+l-u+c-f),r-.5-.1*(s+i-2*_)/(i-s),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 88:x.push([e-.5-3/14*(-s-o+u+l+f+c-2*_)/(s-o+l-u+c-f),r-9/14-1/14*(-s-i+2*_)/(s-i),n-.5-3/14*(-l-a-c-o+f+s+2*_)/(l-a+c-o+s-f)]);break;case 89:x.push([e-.5-.25*(i+a+-s-o+u+l+f+c-4*_)/(a-i+s-o+l-u+c-f),r-.625-.125*(o+a+-s-i)/(a-o+s-i),n-.375-.125*(-c-o+f+s)/(c-o+s-f)]);break;case 90:x.push([e-.5-.25*(-i-a-s-o+u+l+f+c)/(i-a+s-o+l-u+c-f),r-.5,n-.5-.25*(-l-a+u+i+-c-o+f+s)/(l-a+i-u+c-o+s-f)]);break;case 91:x.push([e-.5-3/14*(-s-o+u+l+f+c-2*_)/(s-o+l-u+c-f),r-9/14-1/14*(o+a-2*_)/(a-o),n-.5-3/14*(u+i+-c-o+f+s-2*_)/(i-u+c-o+s-f)]);break;case 92:x.push([e-.5-1/6*(u+l+f+c-4*_)/(l-u+c-f),r-.5-1/6*(-o-a-s-i+4*_)/(o-a+s-i),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 93:x.push([e-.7-.3*(i+a+u+l+f+c-6*_)/(a-i+l-u+c-f),r-.5-.1*(-s-i+2*_)/(s-i),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 94:x.push([e-.5-3/14*(-i-a+u+l+f+c-2*_)/(i-a+l-u+c-f),r-5/14-1/14*(-o-a+2*_)/(o-a),n-.5-3/14*(-l-a+u+i+f+s-2*_)/(l-a+i-u+s-f)]);break;case 95:x.push([e-.75-.25*(u+l+f+c-4*_)/(l-u+c-f),r-.5,n-.75-.25*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 96:x.push([e-.5-1/6*(-u-l+f+c)/(u-l+c-f),r-.5-1/6*(-c-l+f+u)/(c-l+u-f),n-5/6-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 97:x.push([e-7/18-1/6*(i+a+-u-l+f+c-2*_)/(a-i+u-l+c-f),r-7/18-1/6*(o+a+-c-l+f+u-2*_)/(a-o+c-l+u-f),n-11/18-1/6*(l+a+-u-i-c-o+2*_)/(a-l+u-i+c-o)]);break;case 98:x.push([e-.5-3/14*(-i-a-u-l+f+c+2*_)/(i-a+u-l+c-f),r-.5-3/14*(s+i+-c-l+f+u-2*_)/(i-s+c-l+u-f),n-9/14-1/14*(-c-o+2*_)/(c-o)]);break;case 99:x.push([e-.375-.125*(-u-l+f+c)/(u-l+c-f),r-.5-.25*(o+a+s+i+-c-l+f+u-4*_)/(a-o+i-s+c-l+u-f),n-.625-.125*(l+a+-c-o)/(a-l+c-o)]);break;case 100:x.push([e-.5-3/14*(s+o+-u-l+f+c-2*_)/(o-s+u-l+c-f),r-.5-3/14*(-o-a-c-l+f+u+2*_)/(o-a+c-l+u-f),n-9/14-1/14*(-u-i+2*_)/(u-i)]);break;case 101:x.push([e-.5-.25*(i+a+s+o+-u-l+f+c-4*_)/(a-i+o-s+u-l+c-f),r-.375-.125*(-c-l+f+u)/(c-l+u-f),n-.625-.125*(l+a+-u-i)/(a-l+u-i)]);break;case 102:x.push([e-.5-.25*(-i-a+s+o+-u-l+f+c)/(i-a+o-s+u-l+c-f),r-.5-.25*(-o-a+s+i+-c-l+f+u)/(o-a+i-s+c-l+u-f),n-.5]);break;case 103:x.push([e-.5-3/14*(s+o+-u-l+f+c-2*_)/(o-s+u-l+c-f),r-.5-3/14*(s+i+-c-l+f+u-2*_)/(i-s+c-l+u-f),n-9/14-1/14*(l+a-2*_)/(a-l)]);break;case 104:x.push([e-11/18-1/6*(-s-o-u-l+f+c+2*_)/(s-o+u-l+c-f),r-11/18-1/6*(-s-i-c-l+f+u+2*_)/(s-i+c-l+u-f),n-11/18-1/6*(-u-i-c-o+f+s+2*_)/(u-i+c-o+s-f)]);break;case 105:x.push([e-.5-1/6*(i+a+-s-o-u-l+f+c)/(a-i+s-o+u-l+c-f),r-.5-1/6*(o+a+-s-i-c-l+f+u)/(a-o+s-i+c-l+u-f),n-.5-1/6*(l+a+-u-i-c-o+f+s)/(a-l+u-i+c-o+s-f)]);break;case 106:x.push([e-.5-.25*(-i-a-s-o-u-l+f+c+4*_)/(i-a+s-o+u-l+c-f),r-.625-.125*(-c-l+f+u)/(c-l+u-f),n-.625-.125*(-c-o+f+s)/(c-o+s-f)]);break;case 107:x.push([e-7/18-1/6*(-s-o-u-l+f+c+2*_)/(s-o+u-l+c-f),r-11/18-1/6*(o+a+-c-l+f+u-2*_)/(a-o+c-l+u-f),n-11/18-1/6*(l+a+-c-o+f+s-2*_)/(a-l+c-o+s-f)]);break;case 108:x.push([e-.625-.125*(-u-l+f+c)/(u-l+c-f),r-.5-.25*(-o-a-s-i-c-l+f+u+4*_)/(o-a+s-i+c-l+u-f),n-.625-.125*(-u-i+f+s)/(u-i+s-f)]);break;case 109:x.push([e-11/18-1/6*(i+a+-u-l+f+c-2*_)/(a-i+u-l+c-f),r-7/18-1/6*(-s-i-c-l+f+u+2*_)/(s-i+c-l+u-f),n-11/18-1/6*(l+a+-u-i+f+s-2*_)/(a-l+u-i+s-f)]);break;case 110:x.push([e-.5-3/14*(-i-a-u-l+f+c+2*_)/(i-a+u-l+c-f),r-.5-3/14*(-o-a-c-l+f+u+2*_)/(o-a+c-l+u-f),n-9/14-1/14*(f+s-2*_)/(s-f)]);break;case 111:x.push([e-.5-1/6*(-u-l+f+c)/(u-l+c-f),r-.5-1/6*(-c-l+f+u)/(c-l+u-f),n-5/6-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 112:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.5-.1*(f+u-2*_)/(u-f),n-.7-.3*(-l-a-u-i-c-o+6*_)/(l-a+u-i+c-o)]);break;case 113:x.push([e-.5-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 114:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(s+i+f+u-4*_)/(i-s+u-f),n-.5-1/6*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 115:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.7-.3*(o+a+s+i+f+u-6*_)/(a-o+i-s+u-f),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 116:x.push([e-.5-1/6*(s+o+f+c-4*_)/(o-s+c-f),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 117:x.push([e-.7-.3*(i+a+s+o+f+c-6*_)/(a-i+o-s+c-f),r-.5-.1*(f+u-2*_)/(u-f),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 118:x.push([e-.5-3/14*(-i-a+s+o+f+c-2*_)/(i-a+o-s+c-f),r-.5-3/14*(-o-a+s+i+f+u-2*_)/(o-a+i-s+u-f),n-5/14-1/14*(-l-a+2*_)/(l-a)]);break;case 119:x.push([e-.75-.25*(s+o+f+c-4*_)/(o-s+c-f),r-.75-.25*(s+i+f+u-4*_)/(i-s+u-f),n-.5]);break;case 120:x.push([e-.625-.125*(-s-o+f+c)/(s-o+c-f),r-.625-.125*(-s-i+f+u)/(s-i+u-f),n-.5-.25*(-l-a-u-i-c-o+f+s+4*_)/(l-a+u-i+c-o+s-f)]);break;case 121:x.push([e-11/18-1/6*(i+a+-s-o+f+c-2*_)/(a-i+s-o+c-f),r-11/18-1/6*(o+a+-s-i+f+u-2*_)/(a-o+s-i+u-f),n-7/18-1/6*(-u-i-c-o+f+s+2*_)/(u-i+c-o+s-f)]);break;case 122:x.push([e-.5-3/14*(-i-a-s-o+f+c+2*_)/(i-a+s-o+c-f),r-9/14-1/14*(f+u-2*_)/(u-f),n-.5-3/14*(-l-a-c-o+f+s+2*_)/(l-a+c-o+s-f)]);break;case 123:x.push([e-.5-1/6*(-s-o+f+c)/(s-o+c-f),r-5/6-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(-c-o+f+s)/(c-o+s-f)]);break;case 124:x.push([e-9/14-1/14*(f+c-2*_)/(c-f),r-.5-3/14*(-o-a-s-i+f+u+2*_)/(o-a+s-i+u-f),n-.5-3/14*(-l-a-u-i+f+s+2*_)/(l-a+u-i+s-f)]);break;case 125:x.push([e-5/6-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(-s-i+f+u)/(s-i+u-f),n-.5-1/6*(-u-i+f+s)/(u-i+s-f)]);break;case 126:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 127:x.push([e-5/6-1/6*(f+c-2*_)/(c-f),r-5/6-1/6*(f+u-2*_)/(u-f),n-5/6-1/6*(f+s-2*_)/(s-f)])}}(127&w,t,e,r,n,a,i,o,s,l,u,c,0,0,0,0,0,0,0,0,b,_);break;case 1:!function(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_){switch(t){case 0:x.push([e-5/6-1/6*(-f-c+2*_)/(f-c),r-5/6-1/6*(-f-u+2*_)/(f-u),n-5/6-1/6*(-f-s+2*_)/(f-s)]);break;case 1:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 2:x.push([e-5/6-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(s+i+-f-u)/(i-s+f-u),n-.5-1/6*(u+i+-f-s)/(i-u+f-s)]);break;case 3:x.push([e-9/14-1/14*(-f-c+2*_)/(f-c),r-.5-3/14*(o+a+s+i+-f-u-2*_)/(a-o+i-s+f-u),n-.5-3/14*(l+a+u+i+-f-s-2*_)/(a-l+i-u+f-s)]);break;case 4:x.push([e-.5-1/6*(s+o+-f-c)/(o-s+f-c),r-5/6-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(c+o+-f-s)/(o-c+f-s)]);break;case 5:x.push([e-.5-3/14*(i+a+s+o+-f-c-2*_)/(a-i+o-s+f-c),r-9/14-1/14*(-f-u+2*_)/(f-u),n-.5-3/14*(l+a+c+o+-f-s-2*_)/(a-l+o-c+f-s)]);break;case 6:x.push([e-11/18-1/6*(-i-a+s+o+-f-c+2*_)/(i-a+o-s+f-c),r-11/18-1/6*(-o-a+s+i+-f-u+2*_)/(o-a+i-s+f-u),n-7/18-1/6*(u+i+c+o+-f-s-2*_)/(i-u+o-c+f-s)]);break;case 7:x.push([e-.625-.125*(s+o+-f-c)/(o-s+f-c),r-.625-.125*(s+i+-f-u)/(i-s+f-u),n-.5-.25*(l+a+u+i+c+o+-f-s-4*_)/(a-l+i-u+o-c+f-s)]);break;case 8:x.push([e-.75-.25*(-s-o-f-c+4*_)/(s-o+f-c),r-.75-.25*(-s-i-f-u+4*_)/(s-i+f-u),n-.5]);break;case 9:x.push([e-.5-3/14*(i+a+-s-o-f-c+2*_)/(a-i+s-o+f-c),r-.5-3/14*(o+a+-s-i-f-u+2*_)/(a-o+s-i+f-u),n-5/14-1/14*(l+a-2*_)/(a-l)]);break;case 10:x.push([e-.7-.3*(-i-a-s-o-f-c+6*_)/(i-a+s-o+f-c),r-.5-.1*(-f-u+2*_)/(f-u),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 11:x.push([e-.5-1/6*(-s-o-f-c+4*_)/(s-o+f-c),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 12:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.7-.3*(-o-a-s-i-f-u+6*_)/(o-a+s-i+f-u),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 13:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(-s-i-f-u+4*_)/(s-i+f-u),n-.5-1/6*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 14:x.push([e-.5-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 15:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.5-.1*(-f-u+2*_)/(f-u),n-.7-.3*(l+a+u+i+c+o-6*_)/(a-l+i-u+o-c)]);break;case 16:x.push([e-.5-1/6*(u+l+-f-c)/(l-u+f-c),r-.5-1/6*(c+l+-f-u)/(l-c+f-u),n-5/6-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 17:x.push([e-.5-3/14*(i+a+u+l+-f-c-2*_)/(a-i+l-u+f-c),r-.5-3/14*(o+a+c+l+-f-u-2*_)/(a-o+l-c+f-u),n-9/14-1/14*(-f-s+2*_)/(f-s)]);break;case 18:x.push([e-11/18-1/6*(-i-a+u+l+-f-c+2*_)/(i-a+l-u+f-c),r-7/18-1/6*(s+i+c+l+-f-u-2*_)/(i-s+l-c+f-u),n-11/18-1/6*(-l-a+u+i+-f-s+2*_)/(l-a+i-u+f-s)]);break;case 19:x.push([e-.625-.125*(u+l+-f-c)/(l-u+f-c),r-.5-.25*(o+a+s+i+c+l+-f-u-4*_)/(a-o+i-s+l-c+f-u),n-.625-.125*(u+i+-f-s)/(i-u+f-s)]);break;case 20:x.push([e-7/18-1/6*(s+o+u+l+-f-c-2*_)/(o-s+l-u+f-c),r-11/18-1/6*(-o-a+c+l+-f-u+2*_)/(o-a+l-c+f-u),n-11/18-1/6*(-l-a+c+o+-f-s+2*_)/(l-a+o-c+f-s)]);break;case 21:x.push([e-.5-.25*(i+a+s+o+u+l+-f-c-4*_)/(a-i+o-s+l-u+f-c),r-.625-.125*(c+l+-f-u)/(l-c+f-u),n-.625-.125*(c+o+-f-s)/(o-c+f-s)]);break;case 22:x.push([e-.5-1/6*(-i-a+s+o+u+l+-f-c)/(i-a+o-s+l-u+f-c),r-.5-1/6*(-o-a+s+i+c+l+-f-u)/(o-a+i-s+l-c+f-u),n-.5-1/6*(-l-a+u+i+c+o+-f-s)/(l-a+i-u+o-c+f-s)]);break;case 23:x.push([e-11/18-1/6*(s+o+u+l+-f-c-2*_)/(o-s+l-u+f-c),r-11/18-1/6*(s+i+c+l+-f-u-2*_)/(i-s+l-c+f-u),n-11/18-1/6*(u+i+c+o+-f-s-2*_)/(i-u+o-c+f-s)]);break;case 24:x.push([e-.5-3/14*(-s-o+u+l+-f-c+2*_)/(s-o+l-u+f-c),r-.5-3/14*(-s-i+c+l+-f-u+2*_)/(s-i+l-c+f-u),n-9/14-1/14*(-l-a+2*_)/(l-a)]);break;case 25:x.push([e-.5-.25*(i+a+-s-o+u+l+-f-c)/(a-i+s-o+l-u+f-c),r-.5-.25*(o+a+-s-i+c+l+-f-u)/(a-o+s-i+l-c+f-u),n-.5]);break;case 26:x.push([e-.5-.25*(-i-a-s-o+u+l+-f-c+4*_)/(i-a+s-o+l-u+f-c),r-.375-.125*(c+l+-f-u)/(l-c+f-u),n-.625-.125*(-l-a+u+i)/(l-a+i-u)]);break;case 27:x.push([e-.5-3/14*(-s-o+u+l+-f-c+2*_)/(s-o+l-u+f-c),r-.5-3/14*(o+a+c+l+-f-u-2*_)/(a-o+l-c+f-u),n-9/14-1/14*(u+i-2*_)/(i-u)]);break;case 28:x.push([e-.375-.125*(u+l+-f-c)/(l-u+f-c),r-.5-.25*(-o-a-s-i+c+l+-f-u+4*_)/(o-a+s-i+l-c+f-u),n-.625-.125*(-l-a+c+o)/(l-a+o-c)]);break;case 29:x.push([e-.5-3/14*(i+a+u+l+-f-c-2*_)/(a-i+l-u+f-c),r-.5-3/14*(-s-i+c+l+-f-u+2*_)/(s-i+l-c+f-u),n-9/14-1/14*(c+o-2*_)/(o-c)]);break;case 30:x.push([e-7/18-1/6*(-i-a+u+l+-f-c+2*_)/(i-a+l-u+f-c),r-7/18-1/6*(-o-a+c+l+-f-u+2*_)/(o-a+l-c+f-u),n-11/18-1/6*(-l-a+u+i+c+o-2*_)/(l-a+i-u+o-c)]);break;case 31:x.push([e-.5-1/6*(u+l+-f-c)/(l-u+f-c),r-.5-1/6*(c+l+-f-u)/(l-c+f-u),n-5/6-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 32:x.push([e-.75-.25*(-u-l-f-c+4*_)/(u-l+f-c),r-.5,n-.75-.25*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 33:x.push([e-.5-3/14*(i+a+-u-l-f-c+2*_)/(a-i+u-l+f-c),r-5/14-1/14*(o+a-2*_)/(a-o),n-.5-3/14*(l+a+-u-i-f-s+2*_)/(a-l+u-i+f-s)]);break;case 34:x.push([e-.7-.3*(-i-a-u-l-f-c+6*_)/(i-a+u-l+f-c),r-.5-.1*(s+i-2*_)/(i-s),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 35:x.push([e-.5-1/6*(-u-l-f-c+4*_)/(u-l+f-c),r-.5-1/6*(o+a+s+i-4*_)/(a-o+i-s),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 36:x.push([e-.5-3/14*(s+o+-u-l-f-c+2*_)/(o-s+u-l+f-c),r-9/14-1/14*(-o-a+2*_)/(o-a),n-.5-3/14*(-u-i+c+o+-f-s+2*_)/(u-i+o-c+f-s)]);break;case 37:x.push([e-.5-.25*(i+a+s+o+-u-l-f-c)/(a-i+o-s+u-l+f-c),r-.5,n-.5-.25*(l+a+-u-i+c+o+-f-s)/(a-l+u-i+o-c+f-s)]);break;case 38:x.push([e-.5-.25*(-i-a+s+o+-u-l-f-c+4*_)/(i-a+o-s+u-l+f-c),r-.625-.125*(-o-a+s+i)/(o-a+i-s),n-.375-.125*(c+o+-f-s)/(o-c+f-s)]);break;case 39:x.push([e-.5-3/14*(s+o+-u-l-f-c+2*_)/(o-s+u-l+f-c),r-9/14-1/14*(s+i-2*_)/(i-s),n-.5-3/14*(l+a+c+o+-f-s-2*_)/(a-l+o-c+f-s)]);break;case 40:x.push([e-.7-.3*(-s-o-u-l-f-c+6*_)/(s-o+u-l+f-c),r-.5-.1*(-s-i+2*_)/(s-i),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 41:x.push([e-.5-.25*(i+a+-s-o-u-l-f-c+4*_)/(a-i+s-o+u-l+f-c),r-.375-.125*(o+a+-s-i)/(a-o+s-i),n-.375-.125*(l+a+-u-i)/(a-l+u-i)]);break;case 42:x.push([e-.5-.5*(-i-a-s-o-u-l-f-c+8*_)/(i-a+s-o+u-l+f-c),r-.5,n-.5]);break;case 43:x.push([e-.3-.3*(-s-o-u-l-f-c+6*_)/(s-o+u-l+f-c),r-.5-.1*(o+a-2*_)/(a-o),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 44:x.push([e-.5-1/6*(-u-l-f-c+4*_)/(u-l+f-c),r-.5-1/6*(-o-a-s-i+4*_)/(o-a+s-i),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 45:x.push([e-.5-3/14*(i+a+-u-l-f-c+2*_)/(a-i+u-l+f-c),r-5/14-1/14*(-s-i+2*_)/(s-i),n-.5-3/14*(l+a+-u-i+c+o-2*_)/(a-l+u-i+o-c)]);break;case 46:x.push([e-.3-.3*(-i-a-u-l-f-c+6*_)/(i-a+u-l+f-c),r-.5-.1*(-o-a+2*_)/(o-a),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 47:x.push([e-.25-.25*(-u-l-f-c+4*_)/(u-l+f-c),r-.5,n-.75-.25*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 48:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.5-.1*(c+l-2*_)/(l-c),n-.7-.3*(-l-a-u-i-f-s+6*_)/(l-a+u-i+f-s)]);break;case 49:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(o+a+c+l-4*_)/(a-o+l-c),n-.5-1/6*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 50:x.push([e-.5-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 51:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.7-.3*(o+a+s+i+c+l-6*_)/(a-o+i-s+l-c),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 52:x.push([e-.375-.125*(s+o+-f-c)/(o-s+f-c),r-.625-.125*(-o-a+c+l)/(o-a+l-c),n-.5-.25*(-l-a-u-i+c+o+-f-s+4*_)/(l-a+u-i+o-c+f-s)]);break;case 53:x.push([e-.5-3/14*(i+a+s+o+-f-c-2*_)/(a-i+o-s+f-c),r-9/14-1/14*(c+l-2*_)/(l-c),n-.5-3/14*(-u-i+c+o+-f-s+2*_)/(u-i+o-c+f-s)]);break;case 54:x.push([e-7/18-1/6*(-i-a+s+o+-f-c+2*_)/(i-a+o-s+f-c),r-11/18-1/6*(-o-a+s+i+c+l-2*_)/(o-a+i-s+l-c),n-7/18-1/6*(-l-a+c+o+-f-s+2*_)/(l-a+o-c+f-s)]);break;case 55:x.push([e-.5-1/6*(s+o+-f-c)/(o-s+f-c),r-5/6-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(c+o+-f-s)/(o-c+f-s)]);break;case 56:x.push([e-.5-1/6*(-s-o-f-c+4*_)/(s-o+f-c),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 57:x.push([e-.5-3/14*(i+a+-s-o-f-c+2*_)/(a-i+s-o+f-c),r-.5-3/14*(o+a+-s-i+c+l-2*_)/(a-o+s-i+l-c),n-5/14-1/14*(-u-i+2*_)/(u-i)]);break;case 58:x.push([e-.3-.3*(-i-a-s-o-f-c+6*_)/(i-a+s-o+f-c),r-.5-.1*(c+l-2*_)/(l-c),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 59:x.push([e-.25-.25*(-s-o-f-c+4*_)/(s-o+f-c),r-.75-.25*(o+a+c+l-4*_)/(a-o+l-c),n-.5]);break;case 60:x.push([e-5/14-1/14*(-f-c+2*_)/(f-c),r-.5-3/14*(-o-a-s-i+c+l+2*_)/(o-a+s-i+l-c),n-.5-3/14*(-l-a-u-i+c+o+2*_)/(l-a+u-i+o-c)]);break;case 61:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 62:x.push([e-1/6-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(-o-a+c+l)/(o-a+l-c),n-.5-1/6*(-l-a+c+o)/(l-a+o-c)]);break;case 63:x.push([e-1/6-1/6*(-f-c+2*_)/(f-c),r-5/6-1/6*(c+l-2*_)/(l-c),n-5/6-1/6*(c+o-2*_)/(o-c)]);break;case 64:x.push([e-.5,r-.75-.25*(-c-l-f-u+4*_)/(c-l+f-u),n-.75-.25*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 65:x.push([e-5/14-1/14*(i+a-2*_)/(a-i),r-.5-3/14*(o+a+-c-l-f-u+2*_)/(a-o+c-l+f-u),n-.5-3/14*(l+a+-c-o-f-s+2*_)/(a-l+c-o+f-s)]);break;case 66:x.push([e-9/14-1/14*(-i-a+2*_)/(i-a),r-.5-3/14*(s+i+-c-l-f-u+2*_)/(i-s+c-l+f-u),n-.5-3/14*(u+i+-c-o-f-s+2*_)/(i-u+c-o+f-s)]);break;case 67:x.push([e-.5,r-.5-.25*(o+a+s+i+-c-l-f-u)/(a-o+i-s+c-l+f-u),n-.5-.25*(l+a+u+i+-c-o-f-s)/(a-l+i-u+c-o+f-s)]);break;case 68:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(-o-a-c-l-f-u+6*_)/(o-a+c-l+f-u),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 69:x.push([e-.5-1/6*(i+a+s+o-4*_)/(a-i+o-s),r-.5-1/6*(-c-l-f-u+4*_)/(c-l+f-u),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 70:x.push([e-.625-.125*(-i-a+s+o)/(i-a+o-s),r-.5-.25*(-o-a+s+i+-c-l-f-u+4*_)/(o-a+i-s+c-l+f-u),n-.375-.125*(u+i+-f-s)/(i-u+f-s)]);break;case 71:x.push([e-9/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(s+i+-c-l-f-u+2*_)/(i-s+c-l+f-u),n-.5-3/14*(l+a+u+i+-f-s-2*_)/(a-l+i-u+f-s)]);break;case 72:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(-s-i-c-l-f-u+6*_)/(s-i+c-l+f-u),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 73:x.push([e-.375-.125*(i+a+-s-o)/(a-i+s-o),r-.5-.25*(o+a+-s-i-c-l-f-u+4*_)/(a-o+s-i+c-l+f-u),n-.375-.125*(l+a+-c-o)/(a-l+c-o)]);break;case 74:x.push([e-.5-1/6*(-i-a-s-o+4*_)/(i-a+s-o),r-.5-1/6*(-c-l-f-u+4*_)/(c-l+f-u),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 75:x.push([e-5/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(o+a+-c-l-f-u+2*_)/(a-o+c-l+f-u),n-.5-3/14*(l+a+u+i+-c-o-2*_)/(a-l+i-u+c-o)]);break;case 76:x.push([e-.5,r-.5-.5*(-o-a-s-i-c-l-f-u+8*_)/(o-a+s-i+c-l+f-u),n-.5]);break;case 77:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.3-.3*(-s-i-c-l-f-u+6*_)/(s-i+c-l+f-u),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 78:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.3-.3*(-o-a-c-l-f-u+6*_)/(o-a+c-l+f-u),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 79:x.push([e-.5,r-.25-.25*(-c-l-f-u+4*_)/(c-l+f-u),n-.75-.25*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 80:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.5-.1*(-f-u+2*_)/(f-u),n-.7-.3*(-l-a-c-o-f-s+6*_)/(l-a+c-o+f-s)]);break;case 81:x.push([e-.5-1/6*(i+a+u+l-4*_)/(a-i+l-u),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 82:x.push([e-.625-.125*(-i-a+u+l)/(i-a+l-u),r-.375-.125*(s+i+-f-u)/(i-s+f-u),n-.5-.25*(-l-a+u+i+-c-o-f-s+4*_)/(l-a+i-u+c-o+f-s)]);break;case 83:x.push([e-9/14-1/14*(u+l-2*_)/(l-u),r-.5-3/14*(o+a+s+i+-f-u-2*_)/(a-o+i-s+f-u),n-.5-3/14*(u+i+-c-o-f-s+2*_)/(i-u+c-o+f-s)]);break;case 84:x.push([e-.5-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 85:x.push([e-.7-.3*(i+a+s+o+u+l-6*_)/(a-i+o-s+l-u),r-.5-.1*(-f-u+2*_)/(f-u),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 86:x.push([e-11/18-1/6*(-i-a+s+o+u+l-2*_)/(i-a+o-s+l-u),r-7/18-1/6*(-o-a+s+i+-f-u+2*_)/(o-a+i-s+f-u),n-7/18-1/6*(-l-a+u+i+-f-s+2*_)/(l-a+i-u+f-s)]);break;case 87:x.push([e-5/6-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(s+i+-f-u)/(i-s+f-u),n-.5-1/6*(u+i+-f-s)/(i-u+f-s)]);break;case 88:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(-s-i-f-u+4*_)/(s-i+f-u),n-.5-1/6*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 89:x.push([e-.5-3/14*(i+a+-s-o+u+l-2*_)/(a-i+s-o+l-u),r-.5-3/14*(o+a+-s-i-f-u+2*_)/(a-o+s-i+f-u),n-5/14-1/14*(-c-o+2*_)/(c-o)]);break;case 90:x.push([e-.5-3/14*(-i-a-s-o+u+l+2*_)/(i-a+s-o+l-u),r-5/14-1/14*(-f-u+2*_)/(f-u),n-.5-3/14*(-l-a+u+i+-c-o+2*_)/(l-a+i-u+c-o)]);break;case 91:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 92:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.3-.3*(-o-a-s-i-f-u+6*_)/(o-a+s-i+f-u),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 93:x.push([e-.75-.25*(i+a+u+l-4*_)/(a-i+l-u),r-.25-.25*(-s-i-f-u+4*_)/(s-i+f-u),n-.5]);break;case 94:x.push([e-.5-1/6*(-i-a+u+l)/(i-a+l-u),r-1/6-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(-l-a+u+i)/(l-a+i-u)]);break;case 95:x.push([e-5/6-1/6*(u+l-2*_)/(l-u),r-1/6-1/6*(-f-u+2*_)/(f-u),n-5/6-1/6*(u+i-2*_)/(i-u)]);break;case 96:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.5-.1*(-c-l+2*_)/(c-l),n-.7-.3*(-u-i-c-o-f-s+6*_)/(u-i+c-o+f-s)]);break;case 97:x.push([e-.375-.125*(i+a+-u-l)/(a-i+u-l),r-.375-.125*(o+a+-c-l)/(a-o+c-l),n-.5-.25*(l+a+-u-i-c-o-f-s+4*_)/(a-l+u-i+c-o+f-s)]);break;case 98:x.push([e-.5-1/6*(-i-a-u-l+4*_)/(i-a+u-l),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 99:x.push([e-5/14-1/14*(-u-l+2*_)/(u-l),r-.5-3/14*(o+a+s+i+-c-l-2*_)/(a-o+i-s+c-l),n-.5-3/14*(l+a+-c-o-f-s+2*_)/(a-l+c-o+f-s)]);break;case 100:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(-o-a-c-l+4*_)/(o-a+c-l),n-.5-1/6*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 101:x.push([e-.5-3/14*(i+a+s+o+-u-l-2*_)/(a-i+o-s+u-l),r-5/14-1/14*(-c-l+2*_)/(c-l),n-.5-3/14*(l+a+-u-i-f-s+2*_)/(a-l+u-i+f-s)]);break;case 102:x.push([e-.5-3/14*(-i-a+s+o+-u-l+2*_)/(i-a+o-s+u-l),r-.5-3/14*(-o-a+s+i+-c-l+2*_)/(o-a+i-s+c-l),n-5/14-1/14*(-f-s+2*_)/(f-s)]);break;case 103:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 104:x.push([e-.5-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 105:x.push([e-7/18-1/6*(i+a+-s-o-u-l+2*_)/(a-i+s-o+u-l),r-7/18-1/6*(o+a+-s-i-c-l+2*_)/(a-o+s-i+c-l),n-7/18-1/6*(l+a+-u-i-c-o+2*_)/(a-l+u-i+c-o)]);break;case 106:x.push([e-.3-.3*(-i-a-s-o-u-l+6*_)/(i-a+s-o+u-l),r-.5-.1*(-c-l+2*_)/(c-l),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 107:x.push([e-1/6-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(o+a+-c-l)/(a-o+c-l),n-.5-1/6*(l+a+-c-o)/(a-l+c-o)]);break;case 108:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.3-.3*(-o-a-s-i-c-l+6*_)/(o-a+s-i+c-l),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 109:x.push([e-.5-1/6*(i+a+-u-l)/(a-i+u-l),r-1/6-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(l+a+-u-i)/(a-l+u-i)]);break;case 110:x.push([e-.25-.25*(-i-a-u-l+4*_)/(i-a+u-l),r-.25-.25*(-o-a-c-l+4*_)/(o-a+c-l),n-.5]);break;case 111:x.push([e-1/6-1/6*(-u-l+2*_)/(u-l),r-1/6-1/6*(-c-l+2*_)/(c-l),n-5/6-1/6*(l+a-2*_)/(a-l)]);break;case 112:x.push([e-.5,r-.5,n-.5-.5*(-l-a-u-i-c-o-f-s+8*_)/(l-a+u-i+c-o+f-s)]);break;case 113:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.5-.1*(o+a-2*_)/(a-o),n-.3-.3*(-u-i-c-o-f-s+6*_)/(u-i+c-o+f-s)]);break;case 114:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.5-.1*(s+i-2*_)/(i-s),n-.3-.3*(-l-a-c-o-f-s+6*_)/(l-a+c-o+f-s)]);break;case 115:x.push([e-.5,r-.75-.25*(o+a+s+i-4*_)/(a-o+i-s),n-.25-.25*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 116:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(-o-a+2*_)/(o-a),n-.3-.3*(-l-a-u-i-f-s+6*_)/(l-a+u-i+f-s)]);break;case 117:x.push([e-.75-.25*(i+a+s+o-4*_)/(a-i+o-s),r-.5,n-.25-.25*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 118:x.push([e-.5-1/6*(-i-a+s+o)/(i-a+o-s),r-.5-1/6*(-o-a+s+i)/(o-a+i-s),n-1/6-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 119:x.push([e-5/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(s+i-2*_)/(i-s),n-1/6-1/6*(-f-s+2*_)/(f-s)]);break;case 120:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(-s-i+2*_)/(s-i),n-.3-.3*(-l-a-u-i-c-o+6*_)/(l-a+u-i+c-o)]);break;case 121:x.push([e-.5-1/6*(i+a+-s-o)/(a-i+s-o),r-.5-1/6*(o+a+-s-i)/(a-o+s-i),n-1/6-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 122:x.push([e-.25-.25*(-i-a-s-o+4*_)/(i-a+s-o),r-.5,n-.25-.25*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 123:x.push([e-1/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(o+a-2*_)/(a-o),n-1/6-1/6*(-c-o+2*_)/(c-o)]);break;case 124:x.push([e-.5,r-.25-.25*(-o-a-s-i+4*_)/(o-a+s-i),n-.25-.25*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 125:x.push([e-5/6-1/6*(i+a-2*_)/(a-i),r-1/6-1/6*(-s-i+2*_)/(s-i),n-1/6-1/6*(-u-i+2*_)/(u-i)]);break;case 126:x.push([e-1/6-1/6*(-i-a+2*_)/(i-a),r-1/6-1/6*(-o-a+2*_)/(o-a),n-1/6-1/6*(-l-a+2*_)/(l-a)]);break;case 127:x.push([e-.5,r-.5,n-.5])}}(127&w,t,e,r,n,a,i,o,s,l,u,c,0,0,0,0,0,0,0,0,b,_)}},cell:function(t,e,r,n,a,i,o,s,l,u,c){o?u.push([n,r,t],[t,e,n]):u.push([t,r,n],[n,e,t])}});return function(t,e){var r=[],a=[];return n(t,r,a,e),{positions:r,cells:a}}}};var o={}},{"ndarray-extract-contour":253,"zero-crossings":357}],307:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=2*Math.PI,i=function(t,e,r,n,a,i,o){var s=t.x,l=t.y;return{x:n*(s*=e)-a*(l*=r)+i,y:a*s+n*l+o}},o=function(t,e){var r=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(t),a=Math.sin(t),i=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-a*r,y:a+n*r},{x:i+o*r,y:o-i*r},{x:i,y:o}]},s=function(t,e,r,n){var a=t*r+e*n;return a>1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,u=t.cy,c=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===c||0===f)return[];var b=Math.sin(d*a/360),x=Math.cos(d*a/360),_=x*(e-l)/2+b*(r-u)/2,w=-b*(e-l)/2+x*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var T=function(t,e,r,n,i,o,l,u,c,f,h,d){var p=Math.pow(i,2),g=Math.pow(o,2),v=Math.pow(h,2),m=Math.pow(d,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===u?-1:1))*i/o*d,x=y*-o/i*h,_=f*b-c*x+(t+r)/2,w=c*b+f*x+(e+n)/2,A=(h-b)/i,T=(d-x)/o,k=(-h-b)/i,M=(-d-x)/o,E=s(1,0,A,T),S=s(A,T,k,M);return 0===u&&S>0&&(S-=a),1===u&&S<0&&(S+=a),[_,w,E,S]}(e,r,l,u,c,f,g,m,b,x,_,w),k=n(T,4),M=k[0],E=k[1],S=k[2],C=k[3],O=Math.abs(C)/(a/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);C/=L;for(var D=0;De[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":17,assert:23,"is-svg-path":246,"normalize-svg-path":309,"parse-svg-path":262}],309:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,h=0,d=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":307}],310:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=u.width=e.w||e.width||200,f=u.height=e.h||e.height||200);var h=Math.min(r,f),d=e.stroke||0,p=e.viewbox||e.viewBox||a(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d));if(c.translate(.5*r,.5*f),c.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);c.fill(m),d&&c.stroke(m)}else{var y=i(t);o(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":47,"draw-svg-path":94,"is-svg-path":246,"parse-svg-path":262,"svg-path-bounds":308}],311:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(f+=.02);var d=new Float32Array(c),p=0,g=-.5*f;for(h=0;h=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":278,timers:312}],313:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(E[t])t=E[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:F(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,g=e.b,a={r:255*O(d,255),g:255*O(p,255),b:255*O(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=I(e.s),u=I(e.v),a=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=I(e.s),c=I(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=O(t,360),e=O(e,100),r=O(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var d,p,g;return i=C(i),{ok:f,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16)),R(P(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:I(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.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"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function O(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var N,z,B,j=(z="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",B="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+B),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],314:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=a(t));for(var r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":320}],322:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":328}],323:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":319,"./is":324}],324:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":318}],325:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":322}],326:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":322,"../value/is":328}],327:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":319,"./is":328}],328:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],329:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,u=e.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=a([32,0])),u.BIGUINT64||(u.BIGUINT64=a([32,0])),u.BIGINT64||(u.BIGINT64=a([32,0])),u.BUFFER||(u.BUFFER=a([32,0]));var c=u.DATA,f=u.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);c[r].push(t)}}function d(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function A(t){return s?new BigUint64Array(d(8*t),0,t):null}function T(t){return l?new BigInt64Array(d(8*t),0,t):null}function k(t){return new DataView(d(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return A(t);case"buffer":return M(t);case"data":case"dataview":return k(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=T,r.mallocDataView=k,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":46,buffer:58,dup:96}],330:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",E())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],d=c>>13;u=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(g>>5&15)-1,(31&g)+s);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var d,p=f[i.year-f[0]];for(d=0;d<13;d++){var g=p&1<<12-d?30:29;if(l>13;!v||d=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":354,"object-assign":258}],343:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":354,"object-assign":258}],344:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":354,"object-assign":258}],345:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":354,"object-assign":258}],346:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":354,"object-assign":258}],347:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":354,"object-assign":258}],348:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":354,"object-assign":258}],349:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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),f=t-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":354,"object-assign":258}],351:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":354,"object-assign":258}],352:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":354,"object-assign":258}],353:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":354,"object-assign":258}],354:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":258}],355:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var a=""+e;if(d(t,n))for(;a.length1},b=function(t,r){var n=y(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(k).match(o);if(!s)throw(a.local.missingNumberAt||a.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,i){for(var o=y(t,i)?n:r,s=0;s-1){d=1,p=g;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":354,"object-assign":258}],356:[function(t,e,r){"use strict";var n,a=function(){return function(t,e,r,n,a,i){var o=t[0],s=r[0],l=[0],u=s;n|=0;var c=0,f=s;for(c=0;c=0!=d>=0&&a.push(l[0]+.5+.5*(h+d)/(h-d)),n+=f,++l[0]}}};e.exports=(n={funcName:{funcName:"zeroCrossings"}.funcName},function(t){var e={};return function(r,n,a){var i=r.dtype,o=r.order,s=[i,o.join()].join(),l=e[s];return l||(e[s]=l=t([i,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,a)}}(a.bind(void 0,n)))},{}],357:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":356}],358:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],359:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":482,"../../plot_api/plot_template":547,"../../plots/cartesian/constants":565,"../../plots/font_attributes":587,"./arrow_paths":358}],360:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":508,"../../plots/cartesian/axes":558,"./draw":365}],361:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=at.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(K=e[et],J=pt?at._offset+at._length*K:J=A.l+A.w*K):(K=1-e[et],J=pt?at._offset+at._length*K:J=A.t+A.h*K),$=e.showarrow?.5:K}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*Y(.5,e.xanchor)-st*Y(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=A.t+A.h*gt):ft.tail=A.l+A.w*gt:ft.tail=at._offset+at.r2p(gt),Q=tt}else ft.tail=J+gt,Q=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ct,ft.head+=ct}else Q=tt=lt*Y($,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,Q+=ct,e["_"+et+"padplus"]=lt/2+Q,e["_"+et+"padminus"]=lt/2-Q,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)F.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(k-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(P-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(c.setClipUrl,U?C:null,t);else{var wt=B+_t-g.top,At=B+xt-g.left;G.call(h.positionText,At,wt).call(c.setClipUrl,U?C:null,t)}H.select("rect").call(c.setRect,B,B,k,P),j.call(c.setRect,N/2,N/2,z-N,V-N),F.call(c.setTranslate,Math.round(O.x.text-z/2),Math.round(O.y.text-V/2)),R.attr({transform:"rotate("+L+","+O.x.text+","+O.y.text+")"});var Tt,kt=function(r,n){D.selectAll(".annotation-arrow-g").remove();var l=O.x.head,f=O.y.head,h=O.x.tail+r,d=O.y.tail+n,g=O.x.text+r,x=O.y.text+n,_=o.rotationXYMatrix(L,g,x),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),C=+j.attr("width"),I=+j.attr("height"),P=g-.5*C,N=P+C,z=x-.5*I,B=z+I,U=[[P,z,P,B],[P,B,N,B],[N,B,N,z],[N,z,P,z]].map(k);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,V=e.arrowcolor,Y=e.arrowside,G=D.append("g").style({opacity:u.opacity(V)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(u.stroke,u.rgb(V));if(v(q,Y,e),T.annotationPosition&&q.node().parentNode&&!i){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,Q,K=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:K.node(),gd:t,prepFn:function(){var t=c.getTranslate(F);J=t.x,Q=t.y,m&&m.autorange&&M(m._name+".autorange",!0),b&&b.autorange&&M(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,Q),a=n[0]+t,i=n[1]+r;F.call(c.setTranslate,a,i),E("x",y(m,t,"x",A,e)),E("y",y(b,r,"y",A,e)),e.axref===e.xref&&E("ax",y(m,t,"ax",A,e)),e.ayref===e.yref&&E("ay",y(b,r,"ay",A,e)),G.attr("transform",s(t,r)),R.attr({transform:"rotate("+L+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&kt(0,0),I)p.init({element:F.node(),gd:t,prepFn:function(){Tt=R.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?E("ax",y(m,t,"ax",A,e)):E("ax",e.ax+t),e.ayref===e.yref?E("ay",y(b,r,"ay",A.w,e)):E("ay",e.ay+r),kt(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",A,e);else{var l=e._xsize/A.w,u=e.x+(e._xshift-e.xshift)/A.w-l/2;a=p.align(u+t/A.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",A,e);else{var c=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-c/2;o=p.align(f-r/A.h,c,0,1,e.yanchor)}E("x",a),E("y",o),m&&b||(n=p.getCursor(m?.5:a,b?.5:o,e.xanchor,e.yanchor))}R.attr({transform:s(t,r)+Tt}),d(F,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(F),a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===d.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,A=o.y-c.y;if(h=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var T=x*Math.cos(f),k=x*Math.sin(f);c.x+=T,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+A*A)return void I();var M=_*Math.cos(f),E=_*Math.sin(f);o.x-=M,o.y-=E,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),C="";if(S1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":594,"../annotations/draw":365}],372:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*u.roundUp(Z/J,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(q.tick0=0)}q.dtick=W}q.domain=[V+j,V+N-j],q.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var Q,K=t.select("."+k.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+k.cbaxis),tt=0;function et(n,a){var i={propContainer:q,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var t,r=l.l+(e.x+z)*l.w,n=q.title.font.size;t="top"===M?(1-(V+N-j))*l.h+l.t+3+.75*n:(1-(V+j))*l.h+l.t-3-.25*n,et(q._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=t.select("."+k.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+q._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*w),h?(tt=d.bBox(h).height)>p&&(f[1]-=(tt-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(tt=d.bBox(o.node()).height),tt){if(tt+=5,"top"===M)q.domain[1]-=tt/l.h,f[1]*=-1;else{q.domain[0]+=tt/l.h;var g=v.lineCount(o);f[1]+=(1-g)*p}i.attr("transform",c(f[0],f[1])),q.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",c(0,Math.round(l.h*(1-q.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var y=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(D);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var b=E.map(q.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?E[0]:(D[i]+D[i-1])/2,i===D.length-1?E[1]:(D[i]+D[i+1])/2].map(q.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var s=n.select(this).attr({x:U,width:Math.max(I,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)d.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=C(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+k.cblines).selectAll("path."+k.cbline).data(m.color&&m.width?R:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(q.c2p(t))+m.width/2%1)+"h"+I).call(d.lineGroupStyle,m.width,S(t),m.dash)})),$.selectAll("g."+q._id+"tick,path").remove();var _=U+I+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(q),T=s.getTickSigns(q)[2];return s.drawTicks(r,q,{vals:"inside"===q.ticks?s.clipEnds(q,A):A,layer:$,path:s.makeTickPath(q,_,T),transFn:s.makeTransTickFn(q)}),s.drawLabels(r,q,{vals:A,layer:$,transFn:s.makeTransTickLabelFn(q),labelFns:s.makeLabelFns(q,_)})},function(){if(-1===["top","bottom"].indexOf(M)){var t=q.title.font.size,e=q._offset+q._length/2,a=l.l+(q.position||0)*l.w+("right"===q.side?10+t*(q.showticklabels?1:.5):-10-t*(q.showticklabels?.5:0));et("h"+q._id+"title",{avoid:{selection:n.select(r).selectAll("g."+q._id+"tick"),side:M,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=I+e.outlinewidth/2;if(-1===q.ticklabelposition.indexOf("inside")&&(n+=d.bBox($.node()).width),(Q=K.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=K.select(".h"+q._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(K.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=Y-G;t.select("."+k.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:U,y:G+e.ypad+("top"===M?tt:0),width:Math.max(I,2),height:Math.max(u-2*e.ypad-tt,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-f,l.t));var h={},g=A[e.yanchor],v=T[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*g,h.b=u*v):(h.t=h.b=0,h.yt=e.y+e.len*g,h.yb=e.y-e.len*v);var m=A[e.xanchor],y=T[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*m,h.r=s*y;else{var b=s-I;h.l=b*m,h.r=b*y,h.xl=e.x-e.thickness*m,h.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,h)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":481,"../../lib":508,"../../lib/extend":500,"../../lib/setcursor":529,"../../lib/svg_text_utils":534,"../../plots/cartesian/axes":558,"../../plots/cartesian/axis_defaults":560,"../../plots/cartesian/layout_attributes":573,"../../plots/cartesian/position_defaults":576,"../../plots/plots":597,"../../registry":599,"../color":376,"../colorscale/helpers":387,"../dragelement":395,"../drawing":398,"../titles":474,"./constants":378,"@plotly/d3":14,tinycolor2:313}],381:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":508}],382:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":377,"./defaults":379,"./draw":380,"./has_colorbar":381}],383:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var d=i+"auto",p=i+"min",g=i+"max",v=i+"mid",m=(s(h+d),s(h+p),s(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":525,"../../lib/sort_object_keys":531,"../colorbar/attributes":377,"./scales.js":391}],384:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":508,"./helpers":387,"fast-isnumeric":158}],385:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],393:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":508}],394:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],395:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":508,"../../plots/cartesian/constants":565,"./align":392,"./cursor":393,"./unhover":396,"has-hover":234,"has-passive-events":235,"mouse-event-offset":249}],396:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":498,"../../lib/events":499,"../../lib/throttle":535,"../fx/constants":410}],397:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],398:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),f=a.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};b.font=function(t,e,r,n){a.isPlainObject(e)&&(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(u.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,a){t.call(b.setPosition,e,r).call(b.setSize,n,a)},b.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",f(a,i)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);b.translatePoint(t,a,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";u.stroke(e,n||i.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(u.stroke,r||i.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},b.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(u.fill,e)},b.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(u.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(t,e){var r=t%100;return b.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(t))t=+t;else 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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=i("~f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:A},horizontalreversed:{node:"linearGradient",attrs:A,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=M[i],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},b.pattern=function(t,e,r,i,o,s,l,c,f,h,d,p){var g="legend"===e;c&&("overlay"===f?(h=c,d=u.contrast(h)):(h=void 0,d=c));var v,m,y,b,x,_,w,A,T,k,M,E=r._fullLayout,S="p"+E._uid+"-"+i,C={};switch(o){case"/":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",C={d:y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"\\":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",C={d:y="M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"x":v=s*Math.sqrt(2),m=s*Math.sqrt(2),y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2+"M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,b=s-s*Math.sqrt(1-l),_="path",C={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case"|":_="path",_="path",C={d:y="M"+(v=s)/2+",0L"+v/2+","+(m=s),opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"-":_="path",_="path",C={d:y="M0,"+(m=s)/2+"L"+(v=s)+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"+":_="path",y="M"+(v=s)/2+",0L"+v/2+","+(m=s)+"M0,"+m/2+"L"+v+","+m/2,b=s-s*Math.sqrt(1-l),_="path",C={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case".":v=s,m=s,l.pattern_filled";E._patternUrlQueryParts[D]=1},b.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},b.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},b.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(c,l))}var f,h,d,p=!1;if(t.so)d=s.outlierwidth,h=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=u.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=o.gradient,m=t.mgt;m?p=!0:m=v&&v.type,a.isArrayOrTypedArray(m)&&(m=m[0],M[m]||(m=0));var y=o.pattern,x=y&&b.getPatternAttr(y.shape,t.i,"");if(m&&"none"!==m){var _=t.mgc;_?p=!0:_=v.color;var A=r.uid;p&&(A+="-"+t.i),b.gradient(e,i,A,m,[[0,_],[1,f]],"fill")}else if(x){var T=b.getPatternAttr(y.bgcolor,t.i,null),k=b.getPatternAttr(y.fgcolor,t.i,null),E=y.fgopacity,S=b.getPatternAttr(y.size,t.i,8),C=b.getPatternAttr(y.solidity,t.i,.3),O=t.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),L=r.uid;O&&(L+="-"+t.i),b.pattern(e,"point",i,L,x,S,C,t.mcc,y.fillmode,T,k,E)}else u.fill(e,f);d&&u.stroke(e,h)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,f=s.opacity,h=void 0!==c,d=void 0!==f;(a.isArrayOrTypedArray(u)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?f:g*e});var p=i.color,v=o.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?v||e:m||e});var y=i.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,g))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(b.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};u=a.texttemplateString(u,f,l._d3locale,d,t,p)}var g=t.tp||e.textposition,v=C(t,e),m=i?i(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,v,m).text(u).call(h.convertToTspans,r).call(S,g,v,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=C(t,e);u.fill(a,i),S(a,o,s,t.mrc2||t.mrc)}))}};function O(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},R=0),r&&(b.savedBBoxes[r]=v),R++,a.extendFlat({},v)},b.setClipUrl=function(t,e,r){t.attr("clip-path",P(e,r))},b.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(e,r)).trim(),t[a]("transform",i),i},b.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var F=/\s*sc.*/;b.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(F,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var N=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(N);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":412,"../../constants/alignment":481,"../../constants/interactions":485,"../../constants/xmlns_namespaces":487,"../../lib":508,"../../lib/svg_text_utils":534,"../../registry":599,"../../traces/scatter/make_bubble_size_func":664,"../../traces/scatter/subtypes":672,"../color":376,"../colorscale":388,"./symbol_defs":399,"@plotly/d3":14,"fast-isnumeric":158,tinycolor2:313}],399:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":14}],400:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],401:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(d.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(d.copy_ystyle?p:d).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":672,"../drawing":398,"@plotly/d3":14,"fast-isnumeric":158}],406:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":376,"@plotly/d3":14}],407:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":500,"../../plots/font_attributes":587,"./layout_attributes":417}],408:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||it<0||it>_[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+x[0]._offset,e.pointerY=it+_[0]._offset,z="xval"in e?m.flat(s,e.xval):m.p2c(x,at),H="yval"in e?m.flat(s,e.yval):m.p2c(_,it),!a(z[0])||!a(H[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(Y=0;Y$&&(tt.splice(0,$),ut=tt[0].distance),g&&0!==R&&0===tt.length){K.distance=R,K.index=!1;var f=q._module.hoverPoints(K,J,Q,"closest",{hoverLayer:l._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=R}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(h=ht(v),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(h=ht(b),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)At-1;Mt--)Ot(tt[Mt]);tt=Et,vt()}var Lt=t._hoverdata,Dt=[],Rt=j(t),It=U(t);for(V=0;V1||tt.length>1)||"closest"===E&&nt&&tt.length>1,Wt=d.combine(l.plot_bgcolor||d.background,l.paper_bgcolor),Xt=D(tt,{gd:t,hovermode:E,rotateLabels:qt,bgColor:Wt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});m.isUnifiedHover(E)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:0,pmax:a?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",l),I(Xt,qt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Zt=v.getComponentMethod("annotations","hasClickToShow")(t,Dt);f(n.select(e.target),Zt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Lt))return;Lt&&t.emit("plotly_unhover",{event:e,points:Lt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:_,xvals:z,yvals:H})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=D(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),g=t.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;c+=y,f+=y,h+=b,p+=b}u.bbox={x0:c+o,x1:f+o,y0:h+i,y1:p+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||d.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function D(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,w=e.commonLabelOpts||{},A=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,k=t[0],S=k.xa,C=k.ya,L=i.charAt(0),D=k[L+"Label"],I=H(r,g),P=I.top,F=I.width,N=I.height,z=void 0!==D&&k.distance<=e.hoverdistance&&("x"===i||"y"===i);if(z){var B,j,U=!0;for(B=0;Ba.width-x?(v=a.width-x,e.attr("d","M"+(x-M)+",0L"+x+","+b+M+"v"+b+(2*E+y.height)+"H-"+x+"V"+b+M+"H"+(x-2*M)+"Z")):e.attr("d","M0,0L"+M+","+b+M+"H"+(E+y.width/2)+"v"+b+(2*E+y.height)+"H-"+(E+y.width/2)+"V"+b+M+"H-"+M+"Z")}else{var _,O,L;"right"===C.side?(_="start",O=1,L="",v=S._offset+S._length):(_="end",O=-1,L="-",v=S._offset),m=C._offset+(k.y0+k.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+L+M+","+M+"V"+(E+y.height/2)+"h"+L+(2*E+y.width)+"V-"+(E+y.height/2)+"H"+L+M+"V-"+M+"Z");var R,I=y.height/2,F=P-y.top-I,N="clip"+a._uid+"commonlabel"+C._id;if(v=0?at:it+lt=0?it:vt+lt=0?rt:nt+ut=0?nt:mt+ut=0,"top"!==t.idealAlign&&G||!q?G?(I+=j/2,t.anchor="start"):t.anchor="middle":(I-=j/2,t.anchor="end");else if(t.pos=I,G=L+B/2+W<=F,q=L-B/2-W>=0,"left"!==t.idealAlign&&G||!q)if(G)L+=B/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=L+X-F,J=L-X;Z>0&&(L-=Z),J<0&&(L+=-J)}else L-=B/2,t.anchor="end";w.attr("text-anchor",t.anchor),S&&k.attr("text-anchor",t.anchor),e.attr("transform",s(L,I)+(u?l(_):""))})),yt}function R(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=z(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(L,(function(e,r){return s=z(r,t.nameLength),""}))}return[l,s]}function I(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],f=u*(M+E),d=f+u*(t.txwidth+E),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,d+=t.txwidth/2+E),e&&(g*=-k,p=t.offset*T),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*M+p)+","+o(M+g)+"v"+o(t.by/2-M)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*M+p)+"V"+o(g-M)+"Z");var m=p+f,y=g+t.ty0-t.by/2+E,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===b&&"end"!==s&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-E:t.bx+E)),a.call(c.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(c.positionText,i(d+u*E+p),o(g+t.ty0-t.by/2+E)),r.select("rect").call(h.setRect,i(d+(u-1)*t.tx2width/2+p),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function F(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,p)<1.5?d.contrast(p):y.color,w=a.spikemode,A=a.spikethickness,T=a.spikecolor||_,k=g.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=k,x=v),-1!==w.indexOf("across")){var M=a._counterDomainMin,E=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),E=Math.max(E,a.position)),b=l.l+M*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?A:-A),cy:m,r:A,fill:T}).classed("spikeline",!0)}if(f){var S,C,O=e.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=u.pointerX,C=u.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var L,D,R=i.readability(O.color,p)<1.5?d.contrast(p):O.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,N=g.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(L=N,D=C),-1!==I.indexOf("across")){var z=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(z=Math.min(z,n.position),B=Math.max(B,n.position)),L=l.t+(1-B)*l.h,D=l.t+(1-z)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:L,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":h.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:L,y2:D,"stroke-width":P+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function N(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function z(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.x,i=n.y,s=a+n.width,l=i+n.height,u=o.apply3DTransform(r._invTransform)(a,i),c=o.apply3DTransform(r._invTransform)(s,l),f=u[0],h=u[1],d=c[0],p=c[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},{"../../lib":508,"../../lib/events":499,"../../lib/override_cursor":519,"../../lib/svg_text_utils":534,"../../plots/cartesian/axes":558,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"../legend/defaults":428,"../legend/draw":429,"./constants":410,"./helpers":412,"@plotly/d3":14,"fast-isnumeric":158,tinycolor2:313}],414:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":508,"../color":376,"./helpers":412}],415:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":508,"./layout_attributes":417}],416:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":508,"../dragelement":395,"./attributes":407,"./calc":408,"./click":409,"./constants":410,"./defaults":411,"./helpers":412,"./hover":413,"./layout_attributes":417,"./layout_defaults":418,"./layout_global_defaults":419,"@plotly/d3":14}],417:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":587,"./constants":410}],418:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":508,"./hoverlabel_defaults":414,"./hovermode_defaults":415,"./layout_attributes":417}],419:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":508,"./hoverlabel_defaults":414,"./layout_attributes":417}],420:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),f=c*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===T("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===T("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",T,w,b,y),y:c("y",T,A,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(A("uirevision",e.uirevision),!1!==g){A("bgcolor",e.paper_bgcolor),A("bordercolor"),A("borderwidth");var m,y,b,x=a.coerceFont(A,"font",e.font),_="h"===A("orientation");if(_?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),A("traceorder",h),l.isGrouped(e.legend)&&A("tracegroupgap"),A("itemsizing"),A("itemwidth"),A("itemclick"),A("itemdoubleclick"),A("groupclick"),A("x",m),A("xanchor"),A("y",y),A("yanchor",b),A("valign"),a.noneOrAll(u,v,["x","y"]),A("title.text")){A("title.side",_?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(A,"title.font",w)}}}function A(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":508,"../../plot_api/plot_template":547,"../../plots/layout_attributes":595,"../../registry":599,"./attributes":426,"./helpers":432}],429:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(u.font,i).text(h?A(n,p):n);var v=r.itemwidth+2*d.itemGap;f.positionText(g,v,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(k,t,e,r).on("edit",(function(n){this.text(A(n,p)).call(k,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),f=c[c.length-1],h=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):k(g,t,e,r)}function A(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function k(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,p=s.size*g;if(o){var v=u.bBox(o);c=v.height,h=v.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(c=p*y,h=b?u.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;a.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=p,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function M(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function E(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var A=a.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),S=a.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),C=a.ensureSingle(A,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var O=a.ensureSingle(A,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var D=a.ensureSingle(O,"text","legendtitletext");D.attr("text-anchor","start").call(u.font,L.font).text(L.text),k(D,O,t,e,1)}else O.selectAll(".legendtitletext").remove();var R=a.ensureSingle(A,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),I=O.selectAll("g.groups").data(s);I.enter().append("g").attr("class","groups"),I.exit().remove();var P=I.selectAll("g.traces").data(a.identity);P.enter().append("g").attr("class","traces"),P.exit().remove(),P.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(T,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,h=d.itemGap,p=a.itemwidth+2*h,g=2*(c+h),v=E(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v,b=a.tracegroupgap;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+w[0],c+w[1]+a._height+e/2+h),a._height+=e,a._width=Math.max(a._width,t[0].width)})),_=p+a._width,a._width+=h+p+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=M(a),T=a.x<0||0===a.x&&"right"===A,k=a.x>1||1===a.x&&"left"===A,S=y||m,C=i.width/2;a._maxWidth=Math.max(T?S&&"left"===A?o.l+o.w:C:k?S&&"right"===A?o.r+o.w:C:o.w,2*p);var O=0,L=0;r.each((function(t){var e=t[0].width+p;O=Math.max(O,e),L+=e})),_=null;var D=0;if(l){var R=0,I=0,P=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,w[0],w[1]+c+h+n/2+e),e+=n,t=Math.max(t,p+r[0].width)})),R=Math.max(R,e);var r=t+h;r+c+I>a._maxWidth&&(D=Math.max(D,I),I=0,P+=R+b,R=e),u.setTranslate(this,I,P),I+=r})),a._width=Math.max(D,I)+c,a._height=P+R+g}else{var F=r.size(),N=L+f+(F-1)*h=a._maxWidth&&(D=Math.max(D,U),B=0,j+=z,a._height+=z,z=0),u.setTranslate(this,w[0]+c+B,w[1]+c+j+e/2+h),U=B+r+h,B+=n,z=Math.max(z,e)})),N?(a._width=B+f,a._height=z+g):(a._width=Math.max(D,U)+f,a._height+=z+g)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(c+d.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(c+d.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,V=H.legendText||H.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?p:_||p+t[0].width;s||(a+=h/2),u.setRect(e,0,-r/2,a,r)}))}(t,I,P,e)},function(){if(p||!function(t){var e=t._fullLayout.legend,r=M(e),n=E(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var s,c,g,y,b=f._size,x=e.borderwidth,w=b.l+b.w*e.x-v[M(e)]*e._width,T=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(!p&&f.margin.autoexpand){var k=w,L=T;w=a.constrain(w,0,f.width-e._width),T=a.constrain(T,0,f.height-e._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(p||u.setTranslate(A,w,T),R.on(".drag",null),A.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var D=e._effHeight;p&&(D=e._height),C.attr({width:e._width-x,height:D-x,x:x/2,y:x/2}),u.setTranslate(O,0,0),S.select("rect").attr({width:e._width-2*x,height:D-2*x,x:x,y:x}),u.setClipUrl(O,h,t),u.setRect(R,0,0,0,0),delete e._scrollY}else{var I,P,F,N=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),z=e._effHeight-N-2*d.scrollBarMargin,B=e._height-e._effHeight,j=z/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),S.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(O,h,t),Y(U,N,j),A.on("wheel",(function(){Y(U=a.constrain(e._scrollY+n.event.deltaY/z*B,0,B),N,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;I="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(P="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Y(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,B)}(F,I,P),N,j))}));R.call(H);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(I=t.changedTouches[0].clientY,F=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(P=t.changedTouches[0].clientY,Y(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,B)}(F,I,P),N,j))}));O.call(V)}if(t._context.edits.legendPosition)A.classed("cursor-move",!0),l.init({element:A.node(),gd:t,prepFn:function(){var t=u.getTranslate(A);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,a=y+r;u.setTranslate(A,n,a),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),c=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,A,a,e,n)}})}function Y(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(O,0,-r),u.setRect(R,e._width,d.scrollBarMargin+r*a,d.scrollBarWidth,n),S.select("rect").attr("y",x+r)}}],t)}(t,e)}},{"../../constants/alignment":481,"../../lib":508,"../../lib/events":499,"../../lib/svg_text_utils":534,"../../plots/plots":597,"../../registry":599,"../color":376,"../dragelement":395,"../drawing":398,"./constants":427,"./get_legend_data":430,"./handle_click":431,"./helpers":432,"./style":434,"@plotly/d3":14}],430:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],f=!1,h={},d=0,p=0;function g(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),f=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+d;c.push(n),u[n]=[r],d++}}for(r=0;rk&&(T=k)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var M=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return y?n:Math.min(a,r)};function A(t,i,o){var c=t[0].trace,f=c.marker||{},h=f.line||{},d=o?c.visible&&c.type===o:a.traceIs(c,"bar"),p=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var d=i.mcc;if(!r._inHover&&"mc"in i){var p=u(f),g=p.mid;void 0===g&&(g=(p.max+p.min)/2),d=s.tryColorscale(f,"")(g)}var m=d||i.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),A=y.fgopacity,T=v(y.size,8,10),k=v(y.solidity,.5,1),M="legend-"+c.uid;a.call(s.pattern,"legend",e,M,b,T,k,d,y.fillmode,x,_,A)}else a.call(l.fill,m);o&&l.stroke(a,i.mlc||h.color)}))}function T(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.size()){var c=(s.marker||{}).line,d=w(h(c.width,o.pts),c,5,2),p=i.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=c.color;var g=i.minExtend(o,{trace:p});f(u,g,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,f=n.select(this),h=u(a),d=h.colorscale,g=h.reversescale;if(d){if(!r){var v=d.length;c=0===o?d[g?v-1:0][1]:1===o?d[g?0:v-1][1]:d[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),c?f.call(l.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,p(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,A(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){A(t,this,"funnel")})).each((function(t){A(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,a,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=u(x),A=_.colorscale,T=_.reversescale,k=c.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",M=n.select(this),E=M.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",k+"h"+b+"v6h-"+b+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+x.uid;s.gradient(t,e,r,p(T),A,"fill")}}),f||h){var S=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(f||h?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",k+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),A,"stroke")}})})).each((function(t){var r,a,o=g(t),l=o.anyFill,u=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,v=!h&&!u&&!l&&c.hasText(p);function m(t,e,r,n){var a=i.nestedProperty(p,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||v||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=m("marker.size",i.mean,[2,16],12);x.ms=A,w.marker.size=A}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(d,x)],(a=i.minExtend(p,w)).selectedpoints=null,a.texttemplate=null}var T=n.select(this).select("g.legendpoints"),k=T.selectAll("path.scatterpts").data(h?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var M=T.selectAll("g.pointtext").data(v?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":508,"../../registry":599,"../../traces/pie/helpers":640,"../../traces/pie/style_one":641,"../../traces/scatter/subtypes":672,"../color":376,"../colorscale/helpers":387,"../drawing":398,"./constants":427,"@plotly/d3":14}],435:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":437}],436:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(L=["toggleHover"],D=["resetViews"]):m?(O=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],D=["resetGeo"]):v?(L=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],L=["toggleHover"],D=["resetViewMapbox"]):x?L=["hoverClosestGl2d"]:y?L=["hoverClosestPie"]:T?(L=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):L=["toggleHover"];g&&(L=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(T=f,S="y0",k=y,C="y1"):(T=y,S="y1",k=f,C="y0");Z(n),K(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===R?J:Q,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;$(s)}};function Z(r){if(m(t))R=null;else if(F)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";d(e,l),R=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;I?z("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?z("yanchor",r.yanchor=q(A+a)):(l=function(t){return q(Y(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),z("path",r.path=w(D,o,l))}else I?z("xanchor",r.xanchor=G(b+n)):(z("x0",r.x0=G(u+n)),z("x1",r.x1=G(v+n))),P?z("yanchor",r.yanchor=q(A+a)):(z("y0",r.y0=q(f+a)),z("y1",r.y1=q(y+a)));e.attr("d",_(t,r)),K(s,r)}function Q(n,a){if(N){var i=function(t){return t},o=i,l=i;I?z("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?z("yanchor",r.yanchor=q(A+a)):(l=function(t){return q(Y(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),z("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var c=u+n,h=P?f-a:f+a;z("x0",r.x0=I?c:G(c)),z("y0",r.y0=P?h:q(h))}else if("resize-over-end-point"===R){var d=v+n,p=P?y-a:y+a;z("x1",r.x1=I?d:G(d)),z("y1",r.y1=P?p:q(p))}}else{var m=function(t){return-1!==R.indexOf(t)},x=m("n"),j=m("s"),H=m("w"),W=m("e"),X=x?T+a:T,Z=j?k+a:k,J=H?M+n:M,Q=W?E+n:E;P&&(x&&(X=T-a),j&&(Z=k-a)),(!P&&Z-X>10||P&&X-Z>10)&&(z(S,r[S]=P?X:q(X)),z(C,r[C]=P?Z:q(Z))),Q-J>10&&(z(O,r[O]=I?J:G(J)),z(L,r[L]=I?Q:G(Q)))}e.attr("d",_(t,r)),K(s,r)}function K(t,e){(I||P)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(I?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=Y(P?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",L||u.opacity(E)*M<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,v(t)}}(t,I)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),b=t._fullLayout._size;if(m?"domain"===d?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return b.l+b.w*t},y?"domain"===v?s=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return b.t+b.h*(1-t)},"path"===h)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var w=(l+u)/2,A=(c+f)/2,T=Math.abs(w-l),k=Math.abs(A-c),M="A"+T+","+k,E=w+T+","+A;return"M"+E+M+" 0 1,1 "+(w+","+(A-k))+M+" 0 0,1 "+E+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),k&&!h)&&(T=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===A&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function D(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=s.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return P.call(F),R&&(S?P.on(".opacity",null):(k=0,M=!0,P.text(y).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)}))),P.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),P.classed("js-placeholder",M),A}}},{"../../constants/alignment":481,"../../constants/interactions":485,"../../lib":508,"../../lib/svg_text_utils":534,"../../plots/plots":597,"../../registry":599,"../color":376,"../drawing":398,"@plotly/d3":14,"fast-isnumeric":158}],475:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:u,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":500,"../../plot_api/edit_types":540,"../../plot_api/plot_template":547,"../../plots/font_attributes":587,"../../plots/pad_attributes":596,"../color/attributes":375}],476:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],477:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":508,"../../plots/array_container_defaults":553,"./attributes":475,"./constants":476}],478:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(M,a,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(E,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(A,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(A,o),c.call(_,o)}))})),c.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,d=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,k=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,E=p,S=v+m;S+M>u&&(S=u-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),T?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:k,height:M}),this._hbarXMin=E+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>A,L=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+L>l&&(R=l-L);var P=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),O?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:L,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,N=c-.5,z=O?f+L+.5:f+.5,B=h-.5,j=T?d+M+.5:d+.5,U=o._topdefs.selectAll("#"+F).data(T||O?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),T||O?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(B),width:Math.ceil(z)-Math.floor(N),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":508,"../color":376,"../drawing":398,"@plotly/d3":14}],481:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],482:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],483:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],484:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],485:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],486:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],487:[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}},{}],488:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],490:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],491:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":515}],492:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),A=t.match(w?b:y);if(!A)return c;var T=A[1],k=A[3]||"1",M=Number(A[5]||1),E=Number(A[7]||0),S=Number(A[9]||0),C=Number(A[11]||0);if(u){if(2===T.length)return c;var O;T=Number(T);try{var L=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===k.charAt(k.length-1);k=parseInt(k,10),O=L.newDate(T,L.toMonthIndex(T,k,D),M)}else O=L.newDate(T,Number(k),M)}catch(t){return c}return O?(O.toJD()-g)*f+E*h+S*d+C*p:c}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),k-=1;var R=new Date(Date.UTC(2e3,k,M,E,S));return R.setUTCFullYear(T),R.getUTCMonth()!==k||R.getUTCDate()!==M?c:R.getTime()+C*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var A=90*f,T=3*h,k=5*d;function M(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g,S=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function O(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return C[r("%q")(a)]})),_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),L[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+O(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return O(e,t,n,a)};var D=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+D);return u.setUTCMonth(u.getUTCMonth()+e)+n-D},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,h=o-a,d=u-i,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(h,d,g,t-a,e-i),l(h,d,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=a:h=a,f++}return i}},{"./mod":515}],504:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],508:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=i(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=t("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var A=t("./extend");f.extendFlat=A.extendFlat,f.extendDeep=A.extendDeep,f.extendDeepAll=A.extendDeepAll,f.extendDeepNoArrays=A.extendDeepNoArrays;var T=t("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var k=t("./regex");f.counterRegex=k.counter;var M=t("./throttle");f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var E=t("./dom");function S(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},f.syncOrAsync=function(t,e,r){var n;function a(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var a;return I.test(n)?a=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var P={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return z.apply(P,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return z.apply(F,arguments)};var N=/^[:|\|]/;function z(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,v="xother"===s||"yother"===s||d||g||p,m=s;if((d||p)&&(m=m.substring(1)),(g||p)&&(m=m.substring(0,m.length-1)),v){if(void 0===(u=e[m]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(t,e,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(a-u*(r+o),i-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":486,"./anchor_utils":490,"./angles":491,"./array":492,"./clean_number":493,"./clear_responsive":495,"./coerce":496,"./dates":497,"./dom":498,"./extend":500,"./filter_unique":501,"./filter_visible":502,"./geometry2d":503,"./identity":506,"./increment":507,"./is_plain_object":509,"./keyed_container":510,"./localize":511,"./loggers":512,"./make_trace_groups":513,"./matrix":514,"./mod":515,"./nested_property":516,"./noop":517,"./notifier":518,"./preserve_drawing_buffer":522,"./push_unique":523,"./regex":525,"./relative_attr":526,"./relink_private":527,"./search":528,"./sort_object_keys":531,"./stats":532,"./throttle":535,"./to_log_range":536,"@plotly/d3":14,"d3-format":87,"d3-time-format":88,"fast-isnumeric":158}],509:[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).hasOwnProperty("hasOwnProperty")}},{}],510:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":545,"./notifier":518}],513:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":14}],514:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],516:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":486,"./matrix":514}],521:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":530,regl:288}],522:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":158,"is-mobile":242}],523:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-a;void 0===a?(l.push(c),a=c):f>s&&(i=Math.min(i,f),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":492,"fast-isnumeric":158}],533:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":69}],534:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var M=t.text(),E=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(u),O=n.select(t.node().parentNode);if(!O.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),E?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(E[2],o,(function(n,a,o){O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var u=O.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:L,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",f=s.select("g");f.attr({fill:c,stroke:c});var h=l(f,"width"),d=l(f,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],v=-(r||l(t,"height"))/4;"y"===L[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-h/2,v-d/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===L[0]?s.attr({x:t.attr("x"),y:v-d/2}):"a"===L[0]&&0!==L.indexOf("atitle")?s.attr({x:0,y:v}):s.attr({x:p,y:+t.attr("y")+v-d/2}),g&&g.call(t,u),e(u)}))}))):D(),t}function D(){O.empty()||(L=t.attr("class")+"-math",O.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var E=e.split(m),O=0;O|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(E,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t}))}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?e:""}function O(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],536:[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":158}],537:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],538:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],539:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,T,k,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=c(m,f).get(),L=[],D=-1,R=C.length;for(b=0;bC.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==T)A.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?L.push(_):k?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(x=0;x=0;b--)C.splice(L[b],1),O&&O.splice(L[b],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(h(v,m),p!==a){var I;if(-1===D)I=E;else{for(R=Math.max(C.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),L(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&L(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in L(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=O(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&V(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(h.rehover,h.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=d.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function V(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=d.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),p=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var z=R.parts[P],B=R.parts[P-1]+"."+z,U=R.parts.slice(0,P).join("."),H=s(t.layout,U).get(),V=s(l,U).get(),W=R.get();if(void 0!==I){M[D]=I,E[D]="reverse"===z?I:F(W);var Z=f.getLayoutValObject(l,R.parts);if(Z&&Z.impliedEdits&&null!==I)for(var J in Z.impliedEdits)S(o.relativeAttr(D,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(D))if(I){S("autosize",null);var Q="height"===D?"width":"height";S(Q,l[Q])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",I?null:l.width),S("height",I?null:l.height);else if(B.match(Y))L(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){L(B),s(l,U+"._inputRange").set(null);var K=s(l,U).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===z){C=H;var $="linear"===V.type&&"log"===I,tt="log"===V.type&&"linear"===I;if($||tt){if(C&&C.range)if(V.autorange)$&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var et=C.range[0],rt=C.range[1];$?(et<=0&&rt<=0&&S(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(U+".range[0]",Math.log(et)/Math.LN10),S(U+".range[1]",Math.log(rt)/Math.LN10)):(S(U+".range[0]",Math.pow(10,et)),S(U+".range[1]",Math.pow(10,rt)))}else S(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,V,I,S),c.getComponentMethod("images","convertCoords")(t,V,I,S)}else S(U+".autorange",!0),S(U+".range",null);s(l,U+"._inputRange").set(null)}else if(z.match(T)){var nt=s(l,D).get(),at=(I||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,S),c.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=x.containerArrayMatch(D);if(it){r=it.array,n=it.index;var ot=it.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(I)?E[D]=null:x.isRemoveVal(I)?E[D]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(k,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=I,delete e[D]}else"reverse"===z?(H.range?H.range.reverse():(S(U+".autorange",!0),H.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?k.plot=!0:Z?A.update(k,Z):k.calc=!0,R.set(I))}}for(r in m){x.applyContainerArrayChanges(t,h(i,r),m[r],k,h)||(k.plot=!0)}for(var ut in O){var ct=(C=d.getFromId(t,ut))&&C._constraintGroup;if(ct)for(var ft in k.calc=!0,ct)O[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:E,redoit:M,eventData:v}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,a){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=_.coerceTraceIndices(t,a),s=B(t,o.extendFlat({},e),i),l=s.flags,c=W(t,o.extendFlat({},n)),f=c.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,i,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,c)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&V(d,c.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(M)),d.push(h.rehover,h.redrag),u.add(t,Z,[t,s.undoit,c.undoit,s.traces],Z,[t,s.redoit,c.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var Q=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],K=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&k.push(g);y=k}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,i];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":508,"../plots/attributes":554}],548:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=A(c,T,c.side),c._mainMirrorPosition=c.mirror&&T?A(c,T,d.OPPOSITE_SIDE[c.side]):null}var k=[],M=[],E=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,O=s.yaxis.domain,L=s.plotgroup;if(y(C,O,E)){var D=L.node(),R=s.bg=o.ensureSingle(L,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),M.push(a)}else L.select("rect.bg").remove(),E.push([C,O]),S||(k.push(a),M.push(a))}var I,P,F,N,z,B,j,U,H,V,Y,G,q,W=v._bgLayer.selectAll(".bg").data(k);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?c.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":508,"../plots/attributes":554,"../plots/plots":597,"./plot_config":545,"./plot_schema":546,"./plot_template":547}],550:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var k=o.extendFlat({},h);b?k.width=b:null===e.width&&n(p.width)&&(k.width=p.width),x?k.height=x:null===e.height&&n(p.height)&&(k.height=p.height);var M=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=i.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(A?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(T,r,k,M).then(E).then(S).then(C).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":508,"../plots/plots":597,"../snapshot/helpers":603,"../snapshot/svgtoimg":605,"../snapshot/tosvg":607,"../version":705,"./plot_api":544,"fast-isnumeric":158}],551:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&a.push(p("unused",i,m.concat(b.length)));var k,M,E,S,C,O=b.length,L=Array.isArray(T);if(L&&(O=Math.min(O,T.length)),2===x.dimensions)for(M=0;Mb[M].length&&a.push(p("unused",i,m.concat(M,b[M].length)));var D=b[M].length;for(k=0;k<(L?Math.min(D,T[M].length):D);k++)E=L?T[M][k]:T,S=y[M][k],C=b[M][k],n.validate(S,E)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(M,k),S,C)):a.push(p("value",i,m.concat(M,k),S))}else a.push(p("array",i,m.concat(M),y[M]));else for(M=0;M1&&d.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};u=f}for(var h=e.calendar,d="start"===l,p="end"===l,g=t[r+"period0"],v=i(g,h)||0,m=[],y=[],b=[],x=a.length,_=0;_k;)T=o(T,-u,h);for(;T<=k;)T=o(T,u,h);A=o(T,-u,h)}else{for(T=v+(w=Math.round((k-v)/c))*c;T>k;)T-=c;for(;T<=k;)T+=c;A=T-c}m[_]=d?A:p?T:(A+T)/2,y[_]=A,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":486,"../../lib":508,"fast-isnumeric":158}],556:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],557:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,f=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),u=g(t,e),c=u.min,f=u.max;if(0===c.length||0===f.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,v=f[0].val;for(r=1;r0&&((A=S-s(b)-l(x))>C?T/A>O&&(_=b,w=x,O=T/A):T/S>O&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},O=T/S));if(h===v){var L=h-1,D=h+1;if(M)if(0===h)a=[0,1];else{var R=(h>0?f:c).reduce((function(t,e){return Math.max(t,l(e))}),0),I=h/(1-Math.min(.5,R/S));a=h>0?[0,I]:[I,0]}else a=E?[Math.max(0,L),Math.max(1,D)]:[L,D]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):E&&(_.val-O*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-d(e,b.val,x.val))/(S-s(_)-l(w)),a=[_.val-O*s(_),w.val+O*l(w)];return m&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),E=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!A){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=i),i>d&&i-o&&(h=i),i>d&&i=D;n--)L(n);return{min:p,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],f=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function b(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":398,"../../constants/numerical":486,"../../lib":508,"../../registry":599,"./axis_ids":562,"@plotly/d3":14,"fast-isnumeric":158}],558:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,A=g.ONEAVGMONTH,T=g.ONEMINMONTH,k=g.ONEWEEK,M=g.ONEDAY,E=M/2,S=g.ONEHOUR,C=g.ONEMIN,O=g.ONESEC,L=g.MINUS_SIGN,D=g.BADNUM,R={K:"zeroline"},I={K:"gridline",L:"path"},P={K:"tick",L:"path"},F={K:"tick",L:"text"},N=t("../../constants/alignment"),z=N.MID_SHIFT,B=N.CAP_SHIFT,j=N.LINE_SPACING,U=N.OPPOSITE_SIDE,H=e.exports={};H.setConvert=t("./set_convert");var V=t("./axis_autotype"),Y=t("./axis_ids"),G=Y.idSort,q=Y.isLinked;H.id2name=Y.id2name,H.name2id=Y.name2id,H.cleanId=Y.cleanId,H.list=Y.list,H.listIds=Y.listIds,H.getFromId=Y.getFromId,H.getFromTrace=Y.getFromTrace;var W=t("./autorange");H.getAutoRange=W.getAutoRange,H.findExtremes=W.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}H.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},H.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},H.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==H.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=H.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},H.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:H.getFromId(e,r).cleanPos)(t)},H.redrawComponents=function(t,e){e=e||H.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},H.saveRangeInitial=function(t,e){for(var r=H.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=H.tickIncrement(t,"M6","reverse")+1.5*M:i.exactMonths>.8?t=H.tickIncrement(t,"M1","reverse")+15.5*M:t-=E;var l=H.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,u,i)),v=y,0;v<=c;)v=H.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:c-u}},H.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,H.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=H.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dticki&&f=o:d<=o;d=H.tickIncrement(d,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(d=c)break}if(C.length>g||d===O)break;O=d;var L=!1;f&&d!==(0|d)&&(L=!0),C.push({minor:L,value:d})}if(h&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),f=r||c,h=0;f>=y?h=c>=y&&c<=v?c:m:r===x&&f>=_?h=c>=_&&c<=b?c:x:f>=T?h=c>=T&&c<=w?c:A:r===k&&f>=k?h=k:f>=M?h=M:r===E&&f>=E?h=E:r===S&&f>=S&&(h=S),h>=c&&(h=c,s=!0);var d=a+h;if(e.rangebreaks&&h>0){for(var p=0,g=0;g<84;g++){var C=(g+.5)/84;e.maskBreaks(a*(1-C)+C*d)!==D&&p++}(h*=p/84)||(t[n].drop=!0),s&&c>k&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var R="y"===t._id.charAt(0),I=1;"auto"===t.tickmode&&(I=t.tickfont?t.tickfont.size:12);var P=NaN;for(p=C.length-1;p>-1;p--)if(C[p].drop)C.splice(p,1);else{C[p].value=Mt(C[p].value,t);var F=t.c2p(C[p].value);(R?P>F-I:Pc||zc&&(N.periodX=c),z10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&i<=10||e>=15*M)t._tickround="d";else if(e>=C&&i<=16||e>=S)t._tickround="M";else if(e>=O&&i<=19||e>=C)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ct(t.exponentformat)&&!ft(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}H.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(i>A)e/=A,t.dtick="M"+ot(e,1,tt);else if(i>M){t.dtick=ot(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=H.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>S?t.dtick=ot(e,S,tt):i>C?t.dtick=ot(e,C,et):i>O?t.dtick=ot(e,O,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):kt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},H.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?at:nt,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},H.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=ht(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||ct(d)&&ft(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":L)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":L)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):kt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=L+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ht(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},H.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return H.hoverLabelText(t,n,r)+" - "+H.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=H.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":L+o:o};var ut=["f","p","n","\u03bc","m","","k","M","G","T"];function ct(t){return"SI"===t||"B"===t}function ft(t){return t>14||t<-15}function ht(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=H.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,L);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":ct(l)&&(t+=ut[u/3+5]));return i?L+t:t}function dt(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==u._dfltTitle[p]&&(n[l]+=vt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}Q&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,bt(e),n),i.autoMargin(t,xt(e),a),i.autoMargin(t,_t(e),s)})),r.skipTitle||Q&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+vt(e);else{var s=Et(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,f,d,p,g=H.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,d="top"===e.side?g-r:g+r):(d=e._offset+e._length/2,f="right"===e.side?g+r:g-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=h.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:p,transform:u,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function K(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=yt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},H.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},H.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},H.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*B,f+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,f+=3);s&&"top"===u&&(f-=h*(1-B));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(f=-f);return[l?c:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(pt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(pt(e)))}},H.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},H.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,f=i("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,g=h?t.ticklen:0;if(f?g*=-1:c&&(g=0),h&&(d+=g,r)){var v=s.deg2rad(r);d=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},A=0,T=t.side,k=t._id.charAt(0),M=t.tickangle;if("x"===k)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(M)&&(f?b+=z:b=-90===M&&"bottom"===T?B:90===M&&"top"===T?z:.5,A=z/2*(M/90)),w.xFn=function(t){return t.dx+m+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===k){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(M)||(b=-90===M&&"left"===T||90===M&&"right"===T?B:.5),f){var E=a(M)?+M:0;if(0!==E){var S=s.deg2rad(E);A=Math.abs(Math.sin(S))*B*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*z},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},H.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],gt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),St(e,[P]),i.attr("transform",r.transFn)},H.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&H.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sd||i.leftd||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),d.length&&"x"===c&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=yt(this),o=h.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",f=function(t){return-1!==u.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,s={},c=0;c2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":599,"./constants":565}],563:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*b)||A)for(r=0;rR&&NL&&(L=N);h/=(L-O)/(2*D),O=l.l2r(O),L=l.l2r(L),l.range=l._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,a,i)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){D&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),D=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,i){for(var o,s,l,u,c=!1,f={},h={},d=(i||{}).xaHash,p=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==t||mt||Yt(),vt)o.indexOf("select")>-1&&E(r,a,J,Q,e.id,Lt),o.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&mt){var s=g?R:D,u="s"===g||"w"===m?0:1,f=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),p="left",v="middle";if(s.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:v}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,f,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),a=Math.max(0,Math.min(et,pt*r+wt)),i=Math.abs(n-_t),o=Math.abs(a-wt);function s(){Et="",At.r=At.l,At.t=At.b,Ct.attr("d","M0,0Z")}if(At.l=Math.min(_t,n),At.r=Math.max(_t,n),At.t=Math.min(wt,a),At.b=Math.max(wt,a),rt.isSubplotConstrained)i>L||o>L?(Et="xy",i/tt>o/et?(o=i*et/tt,wt>a?At.t=wt-o:At.b=wt+o):(i=o*tt/et,_t>n?At.l=_t-i:At.r=_t+i),Ct.attr("d",G(At))):s();else if(nt.isSubplotConstrained)if(i>L||o>L){Et="xy";var l=Math.min(At.l/tt,(et-At.b)/et),u=Math.max(At.r/tt,(et-At.t)/et);At.l=l*tt,At.r=u*tt,At.b=(1-l)*et,At.t=(1-u)*et,Ct.attr("d",G(At))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cg[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":508,"fast-isnumeric":158}],577:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":481}],578:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),A=t("../../plot_api/subroutines").redrawReglTraces,T=t("./constants"),k=T.MINSELECT,M=b.filter,E=b.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),O=C.p2r,L=C.axValue,D=C.getTransform;function R(t,e,r,n,a,i,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){N(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)C._fullLayout._deactivateShape(C);else if(!_){var r=I.clickmode;x.done(gt).then((function(){if(x.clear(gt),2===t){for(ft.remove(),$=0;$-1&&R(e,C,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&C.emit("plotly_selected",void 0);s.click(C,e)})).catch(y.error)}},a.doneFn=function(){pt.remove(),x.done(gt).then((function(){x.clear(gt),a.gd.emit("plotly_selected",et),K&&a.selectionDefs&&(K.subtract=ct,a.selectionDefs.push(K),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&z(a)}},clearSelect:S,clearSelectionsCache:z,selectOnClick:R}},{"../../components/color":376,"../../components/dragelement/helpers":394,"../../components/drawing":398,"../../components/fx":416,"../../components/fx/helpers":412,"../../components/shapes/draw_newshape/display_outlines":464,"../../components/shapes/draw_newshape/helpers":465,"../../components/shapes/draw_newshape/newshapes":466,"../../lib":508,"../../lib/clear_gl_canvases":494,"../../lib/polygon":520,"../../lib/throttle":535,"../../plot_api/subroutines":548,"../../registry":599,"./axis_ids":562,"./constants":565,"./handle_outline":569,"./helpers":570,polybooljs:270}],579:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,f=i.ensureNumber,h=i.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,g=d.BADNUM,v=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),A=t("./constants"),T=A.HOUR_PATTERN,k=A.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function E(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(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],a=t.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function C(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function O(e,r,n){return u(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function D(e){if(E(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return g}function R(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=R(t);return void 0!==e?e:s(t)?+t:void 0}function P(t){return s(t)?+t:R(t)}function F(t,e,r){return n.round(r+e*t,2)}function N(t,e,r){return(t-r)/e}var z=function(e){return s(e)?F(e,t._m,t._b):g},B=function(e){return N(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;z=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?F(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return N(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return N(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?M:f,t.l2p=z,t.p2l=B,t.c2p="log"===t.type?function(t,e){return z(S(t,e))}:z,t.p2c="log"===t.type?function(t){return M(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=C,t.c2d=t.c2r=t.l2d=t.l2r=O,t.d2p=t.r2p=function(e,r,n){return t.l2p(C(e,0,n))},t.p2d=t.p2r=function(t,e,r){return O(B(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=D,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=R,t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(a=0;ap&&(o[n]=p),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),f="y"===d;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/d[2]:1,A=h?c/d[3]:1,T=f?d[0]:0,k=h?d[1]:0,M=f?d[0]/d[2]*u:0,E=h?d[1]/d[3]*c:0,S=a._offset-M,C=l._offset-E;n.clipRect.call(o.setTranslate,T,k).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":398,"../../lib":508,"../../registry":599,"./axes":558,"@plotly/d3":14}],584:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var d=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(i=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],i||s?(i&&(v(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=a),Math.abs(u.dragStart[0]-n)=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&I.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:m,size:r.l+p},r:{val:y,size:r.r+p},b:{val:_,size:r.b+p},t:{val:b,size:r.t+p}},d[e]=1}else delete h[e],delete d[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),O(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,f=i.r,h=i.t,p=i.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,A=b.size,T=_.val,k=_.size;for(var M in g){if(o(A)&&g[M].r){var E=g[M].r.val,S=g[M].r.size;if(E>w){var C=(A*E+(S-r)*w)/(E-w),L=(S*(1-w)+(A-r)*(1-E))/(E-w);C+L>u+f&&(u=C,f=L)}}if(o(k)&&g[M].t){var D=g[M].t.val,R=g[M].t.size;if(D>T){var I=(k*D+(R-n)*T)/(D-T),P=(R*(1-T)+(k-n)*(1-D))/(D-T);I+P>p+h&&(p=I,h=P)}}}}}var F=c.constrain(r-i.l-i.r,2,64),N=c.constrain(n-i.t-i.b,2,64),z=Math.max(0,r-F),B=Math.max(0,n-N);if(z){var j=(u+f)/z;j>1&&(u/=j,f/=j)}if(B){var U=(p+h)/B;U>1&&(p/=U,h/=U)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(h),a.b=Math.round(p),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var H=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=u(s),a)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=u(l)),i&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(I(o,u,f),a=0;a0){for(var n=[],a=0;a-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},{"../components/color":376,"../components/drawing":398,"../constants/xmlns_namespaces":487,"../lib":508,"@plotly/d3":14}],608:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rP){R("x scale is not linear");break}}if(b.length&&"fast"===L){var F=(b[b.length-1]-b[0])/(b.length-1),N=Math.abs(F/100);for(T=0;TN){R("y scale is not linear");break}}}var z=a.maxRowLength(A),B="scaled"===e.xtype?"":r,j=d(e,B,v,m,z,M),U="scaled"===e.ytype?"":b,H=d(e,U,x,_,A.length,E);O||(e._extremes[M._id]=i.findExtremes(M,j),e._extremes[E._id]=i.findExtremes(E,H));var V={x:j,y:H,z:A,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(V.orig_x=y),e.yperiodalignment&&w&&(V.orig_y=w),B&&B.length===j.length-1&&(V.xCenter=B),U&&U.length===H.length-1&&(V.yCenter=U),C&&(V.xRanges=k.xRanges,V.yRanges=k.yRanges,V.pts=k.pts),S||l(t,e,{vals:A,cLetter:"z"}),S&&e.contours&&"heatmap"===e.contours.coloring){var Y={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};V.xfill=d(Y,B,v,m,z,M),V.yfill=d(Y,U,x,_,A.length,E)}return[V]}},{"../../components/colorscale/calc":384,"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/align_period":555,"../../plots/cartesian/axes":558,"../../registry":599,"../histogram2d/calc":627,"./clean_2d_array":611,"./convert_column_xyz":613,"./find_empties":614,"./interp2d":615,"./make_bound_array":616}],611:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,f,h;function d(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(i=h[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":508}],615:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":508}],616:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,u,c,f=[],h=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!d&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||p)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]u?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,i,s){if(n&&t>o){var l=p(e,i,s),u=p(r,i,s),c=t===a?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,u=-1.1*e,h=-.1*e,d=t-h,p=r[0],g=r[1],v=Math.min(f(p+h,p+d,n,i),f(g+h,g+d,n,i)),m=Math.min(f(p+u,p+h,n,i),f(g+u,g+h,n,i));if(v>m&&mo){var y=s===a?1:6,b=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,i);if(ur.r2l(z)&&(j=o.tickIncrement(j,x.size,!0,d)),I.start=r.l2r(j),N||a.nestedProperty(e,m+".start").set(I.start)}var U=x.end,H=r.r2l(R.end),V=void 0!==H;if((x.endFound||V)&&H!==r.r2l(U)){var Y=V?H:a.aggNums(Math.max,null,p);I.end=r.l2r(Y),V||a.nestedProperty(e,m+".start").set(I.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[I,p]}e.exports={calc:function(t,e){var r,i,d,p,g=[],v=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",b={x:"y",y:"x"}[y],x=e[y+"calendar"],_=e.cumulative,w=h(t,e,m,y),A=w[0],T=w[1],k="string"==typeof A.size,M=[],E=k?M:A,S=[],C=[],O=[],L=0,D=e.histnorm,R=e.histfunc,I=-1!==D.indexOf("density");_.enabled&&I&&(D=D.replace(/ ?density$/,""),I=!1);var P,F="max"===R||"min"===R?null:0,N=l.count,z=u[D],B=!1,j=function(t){return m.r2c(t,0,x)};for(a.isArrayOrTypedArray(e[b])&&"count"!==R&&(P=e[b],B="avg"===R,N=l[R]),r=j(A.start),d=j(A.end)+(r-o.tickIncrement(r,A.size,!1,x))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var J=Math.min(g.length,v.length),Q=[],K=0,$=J-1;for(r=0;r=K;r--)if(v[r]){$=r;break}for(r=K;r<=$;r++)if(n(g[r])&&n(v[r])){var tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=O[r],G?tt.ph0=tt.ph1=O[r].length?T[O[r][0]]:g[r]:(e._computePh=!0,tt.ph0=V(M[r]),tt.ph1=V(M[r+1],!0))),Q.push(tt)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,A.size,!1,x)-Q[0].p),s(Q,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(Q,e,X),Q},calcAllAutoBins:h}},{"../../lib":508,"../../plots/cartesian/axes":558,"../../registry":599,"../bar/arrays_to_calcdata":608,"./average":622,"./bin_functions":623,"./bin_label_vals":624,"./norm_functions":626,"fast-isnumeric":158}],626:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;aE&&A.splice(E,A.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],O=[],L="string"==typeof w.size,D="string"==typeof k.size,R=[],I=[],P=L?R:w,F=D?I:k,N=0,z=[],B=[],j=e.histnorm,U=e.histfunc,H=-1!==j.indexOf("density"),V="max"===U||"min"===U?null:0,Y=i.count,G=o[j],q=!1,W=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(q="avg"===U,Y=i[U]);var J=w.size,Q=b(w.start),K=b(w.end)+(Q-a.tickIncrement(Q,J,!1,m))/1e6;for(r=Q;r=0&&d=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],u=l,f=i;a*fe){h=r;break}}if(i=c,isNaN(i)&&(i=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-u[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[i],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function T(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&M(r)):M(r),i.brushCallback(e),x(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(u?[i.newExtent]:[]),i.extent.length||M(r),i.brushCallback(e),u?x(t.parentNode,s):(s(),x(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function E(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=E(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t,e){var r=t.selectAll("."+n.cn.axisBrush).data(o,i);r.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e){var r=t.selectAll(".background").data(o);r.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events","auto").attr("transform",l(0,n.verticalPadding)),r.call(T).attr("height",(function(t){return t.height-n.verticalPadding}));var a=t.selectAll(".highlight-shadow").data(o);a.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(b);var i=t.selectAll(".highlight").data(o);i.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),i.attr("y1",(function(t){return t.height})).call(b)}(r,e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?E(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[d(0,r,t[0],[]),d(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":508,"../../lib/gup":505,"./constants":632,"@plotly/d3":14}],630:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":487,"../../plots/get_data":589,"./plot":639,"@plotly/d3":14}],631:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:d}),v=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",m),n.coerceFont(c,"tickfont",m),n.coerceFont(c,"rangefont",m),c("labelangle"),c("labelside")}},{"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"../../lib":508,"../../plots/array_container_defaults":553,"../../plots/cartesian/axes":558,"../../plots/domain":586,"./attributes":628,"./axisbrush":629,"./constants":632,"./merge_length":637}],634:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":508}],635:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":628,"./base_plot":630,"./calc":631,"./defaults":633,"./plot":639}],636:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*u,i.offset=2*l*n,e(i),l*n+u>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;ic&&(c=t[a].dim1.canvasX,o=a);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&no._length&&(E=E.slice(0,o._length));var C,O=o.tickvals;function L(t,e){return{val:t,text:C[e]}}function D(t,e){return t.val-e.val}if(Array.isArray(O)&&O.length){C=o.ticktext,Array.isArray(C)&&C.length?C.length>O.length?C=C.slice(0,O.length):O.length>C.length&&(O=O.slice(0,C.length)):C=O.map(i(o.tickformat));for(var R=1;R=r||l>=a)return;var u=t.lineLayer.readPixel(s,a-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==z&&(c?i.hover(h):i.unhover&&i.unhover(h),z=f)}})),N.style("opacity",(function(t){return t.pick?0:1})),h.style("background","rgba(255, 255, 255, 0)");var B=h.selectAll("."+y.cn.parcoords).data(F,p);B.exit().remove(),B.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),B.attr("transform",(function(t){return u(t.model.translateX,t.model.translateY)}));var j=B.selectAll("."+y.cn.parcoordsControlView).data(g,p);j.enter().append("g").classed(y.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return u(t.model.pad.l,t.model.pad.t)}));var U=j.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),p);U.enter().append("g").classed(y.cn.yAxis,!0),j.each((function(t){R(U,t,_)})),N.each((function(t){if(t.viewModel){!t.lineLayer||i?t.lineLayer=x(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||i;t.lineLayer.render(t.viewModel.panels,e)}})),U.attr("transform",(function(t){return u(t.xScale(t.xIndex),0)})),U.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;E.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,U.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})),R(U,e,_),U.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return u(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",u(t.x,0)),U.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!S(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,R(U,e,_),n.select(this).attr("transform",(function(t){return u(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!S(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),E.linePickActive(!0),i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),U.exit().remove();var H=U.selectAll("."+y.cn.axisOverlays).data(g,p);H.enter().append("g").classed(y.cn.axisOverlays,!0),H.selectAll("."+y.cn.axis).remove();var V=H.selectAll("."+y.cn.axis).data(g,p);V.enter().append("g").classed(y.cn.axis,!0),V.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return m.isOrdinal(t)?e:I(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(V.selectAll("text"),t.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("text-shadow",c.makeTextShadow(A)).style("cursor","default");var Y=H.selectAll("."+y.cn.axisHeading).data(g,p);Y.enter().append("g").classed(y.cn.axisHeading,!0);var G=Y.selectAll("."+y.cn.axisTitle).data(g,p);G.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),G.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),c.convertToTspans(r,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":u(0,2*r+t.model.height))+l(e.degrees)+u(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var q=H.selectAll("."+y.cn.axisExtent).data(g,p);q.enter().append("g").classed(y.cn.axisExtent,!0);var W=q.selectAll("."+y.cn.axisExtentTop).data(g,p);W.enter().append("g").classed(y.cn.axisExtentTop,!0),W.attr("transform",u(0,-y.axisExtentOffset));var X=W.selectAll("."+y.cn.axisExtentTopText).data(g,p);X.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(L),X.text((function(t){return P(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var Z=q.selectAll("."+y.cn.axisExtentBottom).data(g,p);Z.enter().append("g").classed(y.cn.axisExtentBottom,!0),Z.attr("transform",(function(t){return u(0,t.model.height+y.axisExtentOffset)}));var J=Z.selectAll("."+y.cn.axisExtentBottomText).data(g,p);J.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),J.text((function(t){return P(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),b.ensureAxisBrush(H,A)}},{"../../components/colorscale":388,"../../components/drawing":398,"../../lib":508,"../../lib/gup":505,"../../lib/svg_text_utils":534,"../../plots/cartesian/axes":558,"./axisbrush":629,"./constants":632,"./helpers":634,"./lines":636,"@plotly/d3":14,"color-rgba":71}],639:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},u={},c={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var a=c[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===f[s]){var h=i.constraintrange;f[s]=h||null}var d=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,d.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete d.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[c[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[c[e]]])}})}}},{"../../lib/prepare_regl":521,"./helpers":634,"./parcoords":638}],640:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(d)r=d;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),v=a(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=u.length<100||c.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;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);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=i(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=i(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":533,"../../plots/cartesian/autorange":557,"../scatter/get_trace_color":657,"gl-pointcloud2d":209}],644:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":508,"./attributes":642}],645:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":592,"../scatter3d/calc":675,"./attributes":642,"./convert":643,"./defaults":644}],646:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rl&&O[m].gap;)m--;for(b=O[m].s,g=O.length-1;g>m;g--)O[g].s=b;for(;lM[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],654:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=l(t,e,v,m);if(y||(e.visible=!1),e.visible){u(t,e,v,m),m("xhoverformat"),m("yhoverformat");var b=c(t,e,v,m),x=!b&&y=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-p);return i=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(d.c2p(t.y)-g);return iW!=(B=I[D][1])>=W&&(F=I[D-1][0],N=I[D][0],B-z&&(P=F+(N-F)*(W-z)/(B-z),V=Math.min(V,P),Y=Math.max(Y,P)));V=Math.max(V,0),Y=Math.min(Y,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:Y,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":376,"../../components/fx":416,"../../lib":508,"../../registry":599,"./get_trace_color":657}],659:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":572,"./arrays_to_calcdata":646,"./attributes":647,"./calc":648,"./cross_trace_calc":652,"./cross_trace_defaults":653,"./defaults":654,"./format_labels":656,"./hover":658,"./marker_colorbar":665,"./plot":668,"./select":669,"./style":671,"./subtypes":672}],660:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"../../lib":508}],661:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,h,d,p,g,v,m,y,b,x,_,w,A,T,k,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,O="log"===S.type,L=E._length,D=S._length,R=e.connectGaps,I=e.baseTolerance,P=e.shape,F="linear"===P,N=e.fill&&"none"!==e.fill,z=[],B=f.minTolerance,j=t.length,U=new Array(j),H=0;function V(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;O&&l===a&&(i*=Math.abs(E._m*D*(E._m>0?o:s)/(S._m*L*(S._m>0?o:s)))),i*=1e3}if(l===a){if(O&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function Y(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[H-1][0],a=r===U[H-1][1];if(!n||!a)if(H>1){var i=e===U[H-2][0],o=r===U[H-2][1];n&&(e===et||e===rt)&&i?o?H--:U[H-1]=t:a&&(r===nt||r===at)&&o?i?H--:U[H-1]=t:U[H++]=t}else U[H++]=t}function ct(t){U[H-1][0]!==t[0]&&U[H-1][1]!==t[1]&&ut([Z,J]),ut(t),Q=null,Z=J=0}function ft(t){if(k=t[0]/L,M=t[1]/D,W=t[0]rt?rt:0,X=t[1]at?at:0,W||X){if(H)if(Q){var e=$(Q,t);e.length>1&&(ct(e[0]),U[H++]=e[1])}else K=$(U[H-1],t)[0],U[H++]=K;else U[H++]=[W||t[0],X||t[1]];var r=U[H-1];W&&X&&(r[0]!==W||r[1]!==X)?(Q&&(Z!==W&&J!==X?ut(Z&&J?(n=Q,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||X]):Z&&J&&ut([Z,J])),ut([W,X])):Z-W&&J-X&&ut([W||Z,X||J]),Q=t,Z=W,J=X}else Q&&ct($(Q,t)[0]),U[H++]=t;var n,a,i,o}for("linear"===P||"spline"===P?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&q(o,t)G(p,ht))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}Q&&ut([Z||Q[0],J||Q[1]]),z.push(U.slice(0,H))}return z}},{"../../constants/numerical":486,"../../lib":508,"./constants":651}],662:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],663:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(i=0;i=0?l=d:(l=d=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":158}],665:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],666:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(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")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":376,"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"./subtypes":672}],667:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":486,"../../lib":508}],668:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),T=o(A,"g","errorbars"),k=o(A,"g","lines"),M=o(A,"g","points"),E=o(A,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,C;y(A).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var L,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var F,N,z,B,j,U,H,V="",Y="",G=[],q=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):F=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},z=function(t){return N(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",L).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",L),l.singleLineStyle(f,a)}}}}}var W=k.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(S?(S.datum(f),B&&U&&(O?("y"===O?B[1]=U[1]=x.c2p(0,!0):"x"===O&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+V.substr(1)).call(l.singleFillStyle)):y(S).attr("d",V+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&V&&R?("tonext"===_.fill?y(C).attr("d",V+"Z"+R+"Z").call(l.singleFillStyle):y(C).attr("d",V+"L"+R.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(I)):(Z(C),_._polygons=null)),_._prevRevpath=Y,_._prevPolygons=H):(S?Z(S):C&&Z(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?Q:J:_&&!w&&(v=K),f&&(p=v),h&&(g=v)}var A,T=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,E,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,X,t),l.setClipUrl(E,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function Q(t){return t.filter((function(t){return t.vis}))}function K(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":398,"../../lib":508,"../../lib/polygon":520,"../../registry":599,"./line_points":661,"./link_traces":663,"./subtypes":672,"@plotly/d3":14}],669:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=v,w=2*x,A={},T=l.makeCalcdata(e,"x"),k=y.makeCalcdata(e,"y"),M=s(e,l,"x",T),E=s(e,y,"y",k),S=M.vals,C=E.vals;e._x=S,e._y=C,e.xperiodalignment&&(e._origX=T,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=k,e._yStarts=E.starts,e._yEnds=E.ends);var O=new Array(w),L=new Array(x);for(r=0;r1&&a.extendFlat(s.line,d.linePositions(t,r,n));if(s.errorX||s.errorY){var l=d.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},d.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},d.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},d.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,O,S,C),I=p(t,b);return f(o,e),_?R.marker&&(D=R.marker.sizeAvg||Math.max(R.marker.size,3)):D=u(e,x),c(t,e,l,y,S,C,D),R.errorX&&m(e,l,R.errorX),R.errorY&&m(e,y,R.errorY),R.fill&&!I.fill2d&&(I.fill2d=!0),R.marker&&!I.scatter2d&&(I.scatter2d=!0),R.line&&!I.line2d&&(I.line2d=!0),!R.errorX&&!R.errorY||I.error2d||(I.error2d=!0),R.text&&!I.glText&&(I.glText=!0),R.marker&&(R.marker.snap=x),I.lineOptions.push(R.line),I.errorXOptions.push(R.errorX),I.errorYOptions.push(R.errorY),I.fillOptions.push(R.fill),I.markerOptions.push(R.marker),I.markerSelectedOptions.push(R.markerSel),I.markerUnselectedOptions.push(R.markerUnsel),I.textOptions.push(R.text),I.textSelectedOptions.push(R.textSel),I.textUnselectedOptions.push(R.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),A._scene=I,A.index=I.count,A.x=S,A.y=C,A.positions=O,I.count++,[{x:!1,y:!1,t:A,trace:e}]}},{"../../constants/numerical":486,"../../lib":508,"../../plots/cartesian/align_period":555,"../../plots/cartesian/autorange":557,"../../plots/cartesian/axis_ids":562,"../scatter/calc":648,"../scatter/colorscale_calc":650,"./constants":678,"./convert":679,"./scene_update":687,"@plotly/point-cluster":15}],678:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],679:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../plots/cartesian/axis_ids"),c=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),d=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,h=o.family,d={},p=t._context.plotGlPixelRatio,g=e.texttemplate;if(g){d.text=[];var v=a._d3locale,y=Array.isArray(g),b=y?Math.min(g.length,i):i,x=y?function(t){return g[t]}:function(){return g};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var h=n[0],d=n[1];for(a=0;a1?l[a]:l[0]:l,p=Array.isArray(u)?u.length>1?u[a]:u[0]:u,g=v[d],m=v[p],y=c?c/.8+1:0,b=-m*y-.5*m;o.offset[a]=[g*y/h,b/h]}}return o}}},{"../../components/drawing":398,"../../components/fx/helpers":412,"../../constants/interactions":485,"../../lib":508,"../../lib/gl_format_color":504,"../../plots/cartesian/axis_ids":562,"../../registry":599,"../scatter/make_bubble_size_func":664,"../scatter/subtypes":672,"./constants":678,"./helpers":683,"color-normalize":69,"fast-isnumeric":158,"svg-path-sdf":310}],680:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),u=t("../scatter/xy_defaults"),c=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),d=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,o,r,a)}var m=!!t.marker&&i.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),b=u(t,e,g,v);if(b){c(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":678}],684:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var d=o.textfont;d&&(h.ts=a.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.tc=Array.isArray(d.color)?d.color[f]:d.color,h.tf=Array.isArray(d.family)?d.family[f]:d.family);var p=o.marker;p&&(h.ms=a.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.mo=a.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,h.mx=a.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,h.mc=a.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=a.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(h.mgt=Array.isArray(v.type)?v.type[f]:v.type,h.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(h.x,!0),y=l.c2p(h.y,!0),b=h.mrc||1,x=o.hoverlabel;x&&(h.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,h.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,h.hts=a.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,h.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,h.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,h.hnl=a.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=h;var T=o._origX,k=o._origY,M=a.extendFlat({},t,{color:i(o,h),x0:m-b,x1:m+b,xLabelVal:T?T[f]:h.x,y0:y-b,y1:y+b,yLabelVal:k?k[f]:h.y,cd:A,distance:u,spikeDistance:c,hovertemplate:h.ht});return h.htx?M.text=h.htx:h.tx?M.text=h.tx:o.text&&(M.text=o.text),a.fillText(h,o,M),n.getComponentMethod("errorbars","hoverInfo")(h,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,u,c,f,h,d,p,g=t.cd,v=g[0].t,m=g[0].trace,y=t.xa,b=t.ya,x=v.x,_=v.y,w=y.c2p(e),A=b.c2p(r),T=t.distance;if(v.tree){var k=y.p2c(w-T),M=y.p2c(w+T),E=b.p2c(A-T),S=b.p2c(A+T);a="x"===n?v.tree.range(Math.min(k,M),Math.min(b._rl[0],b._rl[1]),Math.max(k,M),Math.max(b._rl[0],b._rl[1])):v.tree.range(Math.min(k,M),Math.min(E,S),Math.max(k,M),Math.max(E,S))}else a=v.ids;var C=T;if("x"===n){var O=!!m.xperiodalignment,L=!!m.yperiodalignment;for(c=0;c=Math.min(D,R)&&w<=Math.max(D,R)?0:1/0}if(f=Math.min(I,P)&&A<=Math.max(I,P)?0:1/0}p=Math.sqrt(f*f+h*h),s=a[c]}}}else for(c=a.length-1;c>-1;c--)l=x[i=a[c]],u=_[i],f=y.c2p(l)-w,h=b.c2p(u)-A,(d=Math.sqrt(f*f+h*h))m.glText.length){var w=x-m.glText.length;for(p=0;pr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),m.line2d.update(m.lineOptions)),m.error2d){var T=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(T)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,x),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var f,h,d=[],p=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[h+1]);)h-=2;0!==p[f+1]&&(d=[p[f],0]),d=d.concat(p.slice(f,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[h]);)h-=2;0!==p[f]&&(d=[0,p[f+1]]),d=d.concat(p.slice(f,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],a=0,t.splitNull=!0,i=0;i-1;for(p=0;ph?x.sizeAvg||Math.max(x.size,3):i(e,b),d=0;di&&l||a-1,L=!0;if(o(b)||!!d.selectedpoints||O){var D=d._length;if(d.selectedpoints){g.selectBatch=d.selectedpoints;var R=d.selectedpoints,I={};for(l=0;la&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),b={},x={},_=0;p?(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),T(v);for(var w=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i be - bs) { + return bruteForceRedFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlueFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } } + return bruteForceFull } -function bruteForcePlanner(full) { - var funcName = 'bruteForce' + (full ? 'Full' : 'Partial') - var prefix = [] - var fargs = ARGS.slice() - if(!full) { - fargs.splice(3, 0, FLIP) +function partial() { + function bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - - var code = ['function ' + funcName + '(' + fargs.join() + '){'] - - function invoke(redMajor, flip) { - var res = generateBruteForce(redMajor, flip, full) - prefix.push(res.code) - code.push('return ' + res.name + '(' + ARGS.join() + ');') + function bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } } - - code.push('if(' + RED_END + '-' + RED_START + '>' + - BLUE_END + '-' + BLUE_START + '){') - - if(full) { - invoke(true, false) - code.push('}else{') - invoke(false, false) - } else { - code.push('if(' + FLIP + '){') - invoke(true, true) - code.push('}else{') - invoke(true, false) - code.push('}}else{if(' + FLIP + '){') - invoke(false, true) - code.push('}else{') - invoke(false, false) - code.push('}') + function bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - code.push('}}return ' + funcName) - - var codeStr = prefix.join('') + code.join('') - var proc = new Function(codeStr) - return proc() + function bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } + } + function bruteForcePartial(d, ax, vv, fp, rs, re, rb, ri, bs, be, bb, bi) { + if (re - rs > be - bs) { + if (fp) { + return bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + else { + if (fp) { + return bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + } + return bruteForcePartial } +function bruteForcePlanner(isFull) { + return isFull ? full() : partial() + +} exports.partial = bruteForcePlanner(false) exports.full = bruteForcePlanner(true) @@ -11794,32 +11821,26 @@ var genPartition = _dereq_('./partition') //Twiddle parameters var BRUTE_FORCE_CUTOFF = 128 //Cut off for brute force search var SCAN_CUTOFF = (1<<22) //Cut off for two way scan -var SCAN_COMPLETE_CUTOFF = (1<<22) +var SCAN_COMPLETE_CUTOFF = (1<<22) //Partition functions var partitionInteriorContainsInterval = genPartition( - '!(lo>=p0)&&!(p1>=hi)', - ['p0', 'p1']) + '!(lo>=p0)&&!(p1>=hi)') var partitionStartEqual = genPartition( - 'lo===p0', - ['p0']) + 'lo===p0') var partitionStartLessThan = genPartition( - 'lo mid point // var blue0 = findMedian( - d, axis, + d, axis, blueStart, blueEnd, blue, blueIndex) var mid = blue[elemSize * blue0 + axis] var blue1 = partitionStartEqual( @@ -12272,14 +12293,14 @@ function boxIntersectIter( } } } -},{"./brute":47,"./median":49,"./partition":50,"./sweep":52,"bit-twiddle":43,"typedarray-pool":372}],49:[function(_dereq_,module,exports){ +},{"./brute":47,"./median":49,"./partition":50,"./sweep":52,"bit-twiddle":43,"typedarray-pool":355}],49:[function(_dereq_,module,exports){ 'use strict' module.exports = findMedian var genPartition = _dereq_('./partition') -var partitionStartLessThan = genPartition('lostart && boxes[ptr+axis] > x; + for(var j=i, ptr=elemSize*(i-1); + j>start && boxes[ptr+axis] > x; --j, ptr-=elemSize) { //Swap var aPtr = ptr @@ -12320,14 +12341,14 @@ function findMedian(d, axis, start, end, boxes, ids) { var elemSize = 2*d var pivot = mid var value = boxes[elemSize*mid+axis] - + while(lo < hi) { if(hi - lo < PARTITION_THRESHOLD) { insertionSort(d, axis, lo, hi, boxes, ids) value = boxes[elemSize*mid+axis] break } - + //Select pivot using median-of-3 var count = hi - lo var pivot0 = (Math.random()*count+lo)|0 @@ -12374,7 +12395,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Partition using pivot pivot = partitionStartLessThan( - d, axis, + d, axis, lo, hi-1, boxes, ids, value) @@ -12393,7 +12414,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Swap pivot to last pivot if(mid < pivot) { hi = pivot-1 - while(lo < hi && + while(lo < hi && boxes[elemSize*(hi-1)+axis] === value) { hi -= 1 } @@ -12411,7 +12432,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Make sure pivot is at start return partitionStartLessThan( - d, axis, + d, axis, start, mid, boxes, ids, boxes[elemSize*mid+axis]) } @@ -12420,22 +12441,115 @@ function findMedian(d, axis, start, end, boxes, ids) { module.exports = genPartition -var code = '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' +var P2F = { + 'lo===p0': lo_equal_p0, + 'lo=p0)&&!(p1>=hi)': lo_lessThan_p0_and_p1_lessThan_hi +} + +function genPartition(predicate) { + return P2F[predicate] +} -function genPartition(predicate, args) { - var fargs ='abcdef'.split('').concat(args) - var reads = [] - if(predicate.indexOf('lo') >= 0) { - reads.push('lo=e[k+n]') +// lo===p0 +function lo_equal_p0(a, b, c, d, e, f, p0) { + 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 lo = e[k + n]; + if (lo === p0) 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 + } } - if(predicate.indexOf('hi') >= 0) { - reads.push('hi=e[k+o]') + return m +} + +// lo p; ++p, k += j) { + var lo = e[k + n]; + if (lo < p0) 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 + } } - fargs.push( - code.replace('_', reads.join()) - .replace('$', predicate)) - return Function.apply(void 0, fargs) + return m +} + +// lo<=p0 +function lo_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 } + +// hi<=p0 +function hi_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} + +// lo<=p0&&p0<=hi +function lo_lassOrEqual_p0_and_p0_lessOrEqual_hi(a, b, c, d, e, f, p0) { + 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 lo = e[k + n], hi = e[k + o]; + if (lo <= p0 && p0 <= hi) 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 +} + +// lo p; ++p, k += j) { + var lo = e[k + n], hi = e[k + o]; + if (lo < p0 && p0 <= hi) 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 +} + +// !(lo>=p0)&&!(p1>=hi) +function lo_lessThan_p0_and_p1_lessThan_hi(a, b, c, d, e, f, p0, p1) { + 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 lo = e[k + n], hi = e[k + o]; + if (!(lo >= p0) && !(p1 >= hi)) 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 +} + },{}],51:[function(_dereq_,module,exports){ 'use strict'; @@ -13108,7 +13222,7 @@ red_loop: } } } -},{"./sort":51,"bit-twiddle":43,"typedarray-pool":372}],53:[function(_dereq_,module,exports){ +},{"./sort":51,"bit-twiddle":43,"typedarray-pool":355}],53:[function(_dereq_,module,exports){ },{}],54:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. @@ -15369,7 +15483,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,_dereq_("buffer").Buffer) -},{"base64-js":25,"buffer":55,"ieee754":273}],56:[function(_dereq_,module,exports){ +},{"base64-js":25,"buffer":55,"ieee754":265}],56:[function(_dereq_,module,exports){ 'use strict' var monotoneTriangulate = _dereq_('./lib/monotone') @@ -15570,7 +15684,7 @@ function delaunayRefine(points, triangulation) { } } -},{"binary-search-bounds":42,"robust-in-sphere":342}],58:[function(_dereq_,module,exports){ +},{"binary-search-bounds":42,"robust-in-sphere":327}],58:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -15941,7 +16055,7 @@ function monotoneTriangulate(points, edges) { return cells } -},{"binary-search-bounds":42,"robust-orientation":344}],60:[function(_dereq_,module,exports){ +},{"binary-search-bounds":42,"robust-orientation":329}],60:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -16135,7 +16249,7 @@ function circumcenter(points) { circumcenter.barycenetric = barycentricCircumcenter module.exports = circumcenter -},{"dup":94,"robust-linear-solve":343}],63:[function(_dereq_,module,exports){ +},{"dup":91,"robust-linear-solve":328}],63:[function(_dereq_,module,exports){ module.exports = circumradius var circumcenter = _dereq_('circumcenter') @@ -16543,7 +16657,7 @@ function cleanPSLG (points, edges, colors) { return modified } -},{"./lib/rat-seg-intersect":66,"big-rat":29,"big-rat/cmp":27,"big-rat/to-float":41,"box-intersect":46,"nextafter":306,"rat-vec":333,"robust-segment-intersect":347,"union-find":373}],66:[function(_dereq_,module,exports){ +},{"./lib/rat-seg-intersect":66,"big-rat":29,"big-rat/cmp":27,"big-rat/to-float":41,"box-intersect":46,"nextafter":294,"rat-vec":318,"robust-segment-intersect":332,"union-find":356}],66:[function(_dereq_,module,exports){ 'use strict' module.exports = solveIntersection @@ -16587,7 +16701,7 @@ function solveIntersection (a, b, c, d) { return r } -},{"big-rat/div":28,"big-rat/mul":38,"big-rat/sign":39,"big-rat/sub":40,"rat-vec/add":332,"rat-vec/muls":334,"rat-vec/sub":335}],67:[function(_dereq_,module,exports){ +},{"big-rat/div":28,"big-rat/mul":38,"big-rat/sign":39,"big-rat/sub":40,"rat-vec/add":317,"rat-vec/muls":319,"rat-vec/sub":320}],67:[function(_dereq_,module,exports){ 'use strict' module.exports = { @@ -16814,7 +16928,7 @@ function isInt(color) { return false } -},{"clamp":64,"color-rgba":70,"dtype":93}],69:[function(_dereq_,module,exports){ +},{"clamp":64,"color-rgba":70,"dtype":90}],69:[function(_dereq_,module,exports){ (function (global){(function (){ /** * @module color-parse @@ -16993,7 +17107,7 @@ function parse (cstr) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"color-name":67,"defined":90,"is-plain-obj":282}],70:[function(_dereq_,module,exports){ +},{"color-name":67,"defined":87,"is-plain-obj":271}],70:[function(_dereq_,module,exports){ /** @module color-rgba */ 'use strict' @@ -17385,7 +17499,7 @@ function rgbaStr (rgba) { return 'rgba(' + rgba.join(',') + ')'; } -},{"./colorScale":73,"lerp":284}],75:[function(_dereq_,module,exports){ +},{"./colorScale":73,"lerp":273}],75:[function(_dereq_,module,exports){ "use strict" module.exports = compareAngle @@ -17471,7 +17585,7 @@ function compareAngle(a, b, c, d) { } } } -},{"robust-orientation":344,"robust-product":345,"robust-sum":349,"signum":350,"two-sum":371}],76:[function(_dereq_,module,exports){ +},{"robust-orientation":329,"robust-product":330,"robust-sum":334,"signum":335,"two-sum":354}],76:[function(_dereq_,module,exports){ module.exports = compareCells var min = Math.min @@ -17612,7 +17726,7 @@ function convexHull2D(points) { return edges } -},{"monotone-convex-hull-2d":291}],81:[function(_dereq_,module,exports){ +},{"monotone-convex-hull-2d":279}],81:[function(_dereq_,module,exports){ 'use strict' module.exports = convexHullnD @@ -17673,7 +17787,7 @@ function convexHullnD(points, d) { return invPermute(nhull, ah) } } -},{"affine-hull":20,"incremental-convex-hull":274}],82:[function(_dereq_,module,exports){ +},{"affine-hull":20,"incremental-convex-hull":266}],82:[function(_dereq_,module,exports){ "use strict" function dcubicHermite(p0, v0, p1, v1, t, f) { @@ -17714,565 +17828,6 @@ function cubicHermite(p0, v0, p1, v1, t, f) { module.exports = cubicHermite module.exports.derivative = dcubicHermite },{}],83:[function(_dereq_,module,exports){ -"use strict" - -var createThunk = _dereq_("./lib/thunk.js") - -function Procedure() { - 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 = false -} - -function compileCwise(user_args) { - //Create procedure - var proc = new Procedure() - - //Parse blocks - proc.pre = user_args.pre - proc.body = user_args.body - proc.post = user_args.post - - //Parse arguments - var proc_args = user_args.args.slice(0) - proc.argTypes = proc_args - for(var i=0; i0) { - throw new Error("cwise: pre() block may not reference array args") - } - if(i < proc.post.args.length && proc.post.args[i].count>0) { - throw new Error("cwise: post() block may not reference array args") - } - } else if(arg_type === "scalar") { - proc.scalarArgs.push(i) - proc.shimArgs.push("scalar" + i) - } else if(arg_type === "index") { - proc.indexArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].count > 0) { - throw new Error("cwise: pre() block may not reference array index") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array index") - } - if(i < proc.post.args.length && proc.post.args[i].count > 0) { - throw new Error("cwise: post() block may not reference array index") - } - } else if(arg_type === "shape") { - proc.shapeArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].lvalue) { - throw new Error("cwise: pre() block may not write to array shape") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array shape") - } - if(i < proc.post.args.length && proc.post.args[i].lvalue) { - throw new Error("cwise: post() block may not write to array shape") - } - } else if(typeof arg_type === "object" && arg_type.offset) { - proc.argTypes[i] = "offset" - proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset }) - proc.offsetArgIndex.push(i) - } else { - throw new Error("cwise: Unknown argument type " + proc_args[i]) - } - } - - //Make sure at least one array argument was specified - if(proc.arrayArgs.length <= 0) { - throw new Error("cwise: No array arguments specified") - } - - //Make sure arguments are correct - if(proc.pre.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in pre() block") - } - if(proc.body.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in body() block") - } - if(proc.post.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in post() block") - } - - //Check debug flag - proc.debug = !!user_args.printCode || !!user_args.debug - - //Retrieve name - proc.funcName = user_args.funcName || "cwise" - - //Read in block size - proc.blockSize = user_args.blockSize || 64 - - return createThunk(proc) -} - -module.exports = compileCwise - -},{"./lib/thunk.js":85}],84:[function(_dereq_,module,exports){ -"use strict" - -var uniq = _dereq_("uniq") - -// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index) -// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments. -function innerFill(order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , has_index = proc.indexArgs.length>0 - , code = [] - , vars = [] - , idx=0, pidx=0, i, j - for(i=0; i 0) { - code.push("var " + vars.join(",")) - } - //Scan loop - for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards - idx = order[i] - code.push(["for(i",i,"=0;i",i," 0) { - code.push(["index[",pidx,"]-=s",pidx].join("")) - } - code.push(["++index[",idx,"]"].join("")) - } - code.push("}") - } - return code.join("\n") -} - -// Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block. -// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary. -// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used. -function outerFill(matched, order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , blockSize = proc.blockSize - , has_index = proc.indexArgs.length > 0 - , code = [] - for(var i=0; i0;){"].join("")) // Iterate back to front - code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j). - code.push(["s",order[i],"=j",i].join("")) - code.push(["j",i,"=0"].join("")) - code.push(["}else{s",order[i],"=",blockSize].join("")) - code.push(["j",i,"-=",blockSize,"}"].join("")) - if(has_index) { - code.push(["index[",order[i],"]=j",i].join("")) - } - } - for(var i=0; i 0) { - allEqual = allEqual && summary[i] === summary[i-1] - } - } - if(allEqual) { - return summary[0] - } - return summary.join("") -} - -//Generates a cwise operator -function generateCWiseOp(proc, typesig) { - - //Compute dimension - // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg. - var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0 - var orders = new Array(proc.arrayArgs.length) - var dtypes = new Array(proc.arrayArgs.length) - for(var i=0; i 0) { - vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example) - } - if(proc.indexArgs.length > 0) { - // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes. - var zeros = new Array(dimension) - for(var i=0; i 0) { - code.push("var " + vars.join(",")) - } - for(var i=0; i 3) { - code.push(processBlock(proc.pre, proc, dtypes)) - } - - //Process body - var body = processBlock(proc.body, proc, dtypes) - var matched = countMatches(loopOrders) - if(matched < dimension) { - code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example. - } else { - code.push(innerFill(loopOrders[0], proc, body)) - } - - //Inline epilog - if(proc.post.body.length > 3) { - code.push(processBlock(proc.post, proc, dtypes)) - } - - if(proc.debug) { - console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------") - } - - var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("") - var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join("")) - return f() -} -module.exports = generateCWiseOp - -},{"uniq":374}],85:[function(_dereq_,module,exports){ -"use strict" - -// The function below is called when constructing a cwise function object, and does the following: -// A function object is constructed which accepts as argument a compilation function and returns another function. -// It is this other function that is eventually returned by createThunk, and this function is the one that actually -// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed. -// The compilation passed to the first function object is used for compiling new functions. -// Once this function object is created, it is called with compile as argument, where the first argument of compile -// is bound to "proc" (essentially containing a preprocessed version of the user arguments to cwise). -// So createThunk roughly works like this: -// function createThunk(proc) { -// var thunk = function(compileBound) { -// var CACHED = {} -// return function(arrays and scalars) { -// if (dtype and order of arrays in CACHED) { -// var func = CACHED[dtype and order of arrays] -// } else { -// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays) -// } -// return func(arrays and scalars) -// } -// } -// return thunk(compile.bind1(proc)) -// } - -var compile = _dereq_("./compile.js") - -function createThunk(proc) { - var code = ["'use strict'", "var CACHED={}"] - var vars = [] - var thunkName = proc.funcName + "_cwise_thunk" - - //Build thunk - code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join("")) - var typesig = [] - var string_typesig = [] - var proc_args = [["array",proc.arrayArgs[0],".shape.slice(", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS). - Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(","+proc.arrayBlockIndices[0]+")"):")"].join("")] - var shapeLengthConditions = [], shapeConditions = [] - // Process array arguments - for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices) - shapeLengthConditions.push("array" + proc.arrayArgs[0] + ".shape.length===array" + j + ".shape.length+" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i]))) - shapeConditions.push("array" + proc.arrayArgs[0] + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[0]) + "]===array" + j + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[i]) + "]") - } - } - // Check for shape equality - if (proc.arrayArgs.length > 1) { - code.push("if (!(" + shapeLengthConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same dimensionality!')") - code.push("for(var shapeIndex=array" + proc.arrayArgs[0] + ".shape.length-" + Math.abs(proc.arrayBlockIndices[0]) + "; shapeIndex-->0;) {") - code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')") - code.push("}") - } - // Process scalar arguments - for(var i=0; i * but significantly simplified and sped up by ignoring number and string constructors @@ -20129,7 +19684,7 @@ module.exports = function(n) { return n - n < 1; }; -},{"is-string-blank":283}],98:[function(_dereq_,module,exports){ +},{"is-string-blank":272}],95:[function(_dereq_,module,exports){ 'use strict' module.exports = createFilteredVector @@ -20422,69 +19977,7 @@ function createFilteredVector(initState, initVelocity, initTime) { } } -},{"binary-search-bounds":99,"cubic-hermite":82}],99:[function(_dereq_,module,exports){ -"use strict" - -function compileSearch(funcName, predicate, reversed, extraArgs, useNdarray, earlyOut) { - var code = [ - "function ", funcName, "(a,l,h,", extraArgs.join(","), "){", -earlyOut ? "" : "var i=", (reversed ? "l-1" : "h+1"), -";while(l<=h){\ -var m=(l+h)>>>1,x=a", useNdarray ? ".get(m)" : "[m]"] - if(earlyOut) { - if(predicate.indexOf("c") < 0) { - code.push(";if(x===y){return m}else if(x<=y){") - } else { - code.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){") - } - } else { - code.push(";if(", predicate, "){i=m;") - } - if(reversed) { - code.push("l=m+1}else{h=m-1}") - } else { - code.push("h=m-1}else{l=m+1}") - } - code.push("}") - if(earlyOut) { - code.push("return -1};") - } else { - code.push("return i};") - } - return code.join("") -} - -function compileBoundsSearch(predicate, reversed, suffix, earlyOut) { - var result = new Function([ - compileSearch("A", "x" + predicate + "y", reversed, ["y"], false, earlyOut), - compileSearch("B", "x" + predicate + "y", reversed, ["y"], true, earlyOut), - compileSearch("P", "c(x,y)" + predicate + "0", reversed, ["y", "c"], false, earlyOut), - compileSearch("Q", "c(x,y)" + predicate + "0", reversed, ["y", "c"], true, earlyOut), -"function dispatchBsearch", suffix, "(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", suffix].join("")) - return result() -} - -module.exports = { - ge: compileBoundsSearch(">=", false, "GE"), - gt: compileBoundsSearch(">", false, "GT"), - lt: compileBoundsSearch("<", true, "LT"), - le: compileBoundsSearch("<=", true, "LE"), - eq: compileBoundsSearch("-", true, "EQ", true) -} - -},{}],100:[function(_dereq_,module,exports){ +},{"binary-search-bounds":42,"cubic-hermite":82}],96:[function(_dereq_,module,exports){ "use strict" module.exports = createRBTree @@ -21481,76 +20974,7 @@ function defaultCompare(a, b) { function createRBTree(compare) { return new RedBlackTree(compare || defaultCompare, null) } -},{}],101:[function(_dereq_,module,exports){ -// transliterated from the python snippet here: -// http://en.wikipedia.org/wiki/Lanczos_approximation - -var g = 7; -var p = [ - 0.99999999999980993, - 676.5203681218851, - -1259.1392167224028, - 771.32342877765313, - -176.61502916214059, - 12.507343278686905, - -0.13857109526572012, - 9.9843695780195716e-6, - 1.5056327351493116e-7 -]; - -var g_ln = 607/128; -var p_ln = [ - 0.99999999999999709182, - 57.156235665862923517, - -59.597960355475491248, - 14.136097974741747174, - -0.49191381609762019978, - 0.33994649984811888699e-4, - 0.46523628927048575665e-4, - -0.98374475304879564677e-4, - 0.15808870322491248884e-3, - -0.21026444172410488319e-3, - 0.21743961811521264320e-3, - -0.16431810653676389022e-3, - 0.84418223983852743293e-4, - -0.26190838401581408670e-4, - 0.36899182659531622704e-5 -]; - -// Spouge approximation (suitable for large arguments) -function lngamma(z) { - - if(z < 0) return Number('0/0'); - var x = p_ln[0]; - for(var i = p_ln.length - 1; i > 0; --i) x += p_ln[i] / (z + i); - var t = z + g_ln + 0.5; - return .5*Math.log(2*Math.PI)+(z+.5)*Math.log(t)-t+Math.log(x)-Math.log(z); -} - -module.exports = function gamma (z) { - if (z < 0.5) { - return Math.PI / (Math.sin(Math.PI * z) * gamma(1 - z)); - } - else if(z > 100) return Math.exp(lngamma(z)); - else { - z -= 1; - var x = p[0]; - for (var i = 1; i < g + 2; i++) { - x += p[i] / (z + i); - } - var t = z + g + 0.5; - - return Math.sqrt(2 * Math.PI) - * Math.pow(t, z + 0.5) - * Math.exp(-t) - * x - ; - } -}; - -module.exports.log = lngamma; - -},{}],102:[function(_dereq_,module,exports){ +},{}],97:[function(_dereq_,module,exports){ module.exports = getCanvasContext function getCanvasContext (type, opts) { if (typeof type !== 'string') { @@ -21590,7 +21014,7 @@ function getCanvasContext (type, opts) { return (gl || null) // ensure null on fail } -},{}],103:[function(_dereq_,module,exports){ +},{}],98:[function(_dereq_,module,exports){ 'use strict' module.exports = createAxes @@ -22198,7 +21622,7 @@ function createAxes(gl, options) { return axes } -},{"./lib/background.js":104,"./lib/cube.js":105,"./lib/lines.js":106,"./lib/text.js":108,"./lib/ticks.js":109}],104:[function(_dereq_,module,exports){ +},{"./lib/background.js":99,"./lib/cube.js":100,"./lib/lines.js":101,"./lib/text.js":103,"./lib/ticks.js":104}],99:[function(_dereq_,module,exports){ 'use strict' module.exports = createBackgroundCube @@ -22311,7 +21735,7 @@ function createBackgroundCube(gl) { return new BackgroundCube(gl, buffer, vao, shader) } -},{"./shaders":107,"gl-buffer":112,"gl-vao":189}],105:[function(_dereq_,module,exports){ +},{"./shaders":102,"gl-buffer":106,"gl-vao":181}],100:[function(_dereq_,module,exports){ "use strict" module.exports = getCubeEdges @@ -22553,7 +21977,7 @@ function getCubeEdges(model, view, projection, bounds, ortho) { //Return result return CUBE_RESULT } -},{"bit-twiddle":43,"gl-mat4/multiply":144,"robust-orientation":344,"split-polygon":362}],106:[function(_dereq_,module,exports){ +},{"bit-twiddle":43,"gl-mat4/multiply":138,"robust-orientation":329,"split-polygon":346}],101:[function(_dereq_,module,exports){ 'use strict' module.exports = createLines @@ -22763,7 +22187,7 @@ function createLines(gl, bounds, ticks) { return new Lines(gl, vertBuf, vao, shader, tickCount, tickOffset, gridCount, gridOffset) } -},{"./shaders":107,"gl-buffer":112,"gl-vao":189}],107:[function(_dereq_,module,exports){ +},{"./shaders":102,"gl-buffer":106,"gl-vao":181}],102:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -22794,7 +22218,7 @@ exports.bg = function(gl) { ]) } -},{"gl-shader":170,"glslify":110}],108:[function(_dereq_,module,exports){ +},{"gl-shader":163,"glslify":262}],103:[function(_dereq_,module,exports){ (function (process){(function (){ "use strict" @@ -23016,7 +22440,7 @@ function createTextSprites( } }).call(this)}).call(this,_dereq_('_process')) -},{"./shaders":107,"_process":330,"gl-buffer":112,"gl-vao":189,"vectorize-text":375}],109:[function(_dereq_,module,exports){ +},{"./shaders":102,"_process":315,"gl-buffer":106,"gl-vao":181,"vectorize-text":358}],104:[function(_dereq_,module,exports){ 'use strict' exports.create = defaultTicks @@ -23097,19 +22521,7 @@ function ticksEqual(ticksA, ticksB) { } return true } -},{}],110:[function(_dereq_,module,exports){ -module.exports = function(strings) { - if (typeof strings === 'string') strings = [strings] - var exprs = [].slice.call(arguments,1) - var parts = [] - for (var i = 0; i < strings.length-1; i++) { - parts.push(strings[i], exprs[i] || '') - } - parts.push(strings[i]) - return parts.join('') -} - -},{}],111:[function(_dereq_,module,exports){ +},{}],105:[function(_dereq_,module,exports){ "use strict" module.exports = axesProperties @@ -23253,7 +22665,7 @@ i_loop: return ranges } -},{"./lib/cube.js":105,"extract-frustum-planes":96,"gl-mat4/multiply":144,"gl-mat4/transpose":155,"gl-vec4/transformMat4":260,"split-polygon":362}],112:[function(_dereq_,module,exports){ +},{"./lib/cube.js":100,"extract-frustum-planes":93,"gl-mat4/multiply":138,"gl-mat4/transpose":149,"gl-vec4/transformMat4":252,"split-polygon":346}],106:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") @@ -23407,7 +22819,7 @@ function createBuffer(gl, data, type, usage) { module.exports = createBuffer -},{"ndarray":305,"ndarray-ops":300,"typedarray-pool":372}],113:[function(_dereq_,module,exports){ +},{"ndarray":293,"ndarray-ops":288,"typedarray-pool":355}],107:[function(_dereq_,module,exports){ "use strict"; var vec3 = _dereq_('gl-vec3'); @@ -23545,7 +22957,7 @@ module.exports.createConeMesh = function(gl, params) { }); } -},{"./create_mesh":114,"./lib/shaders":115,"gl-vec3":208}],114:[function(_dereq_,module,exports){ +},{"./create_mesh":108,"./lib/shaders":109,"gl-vec3":200}],108:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -24120,7 +23532,7 @@ function createVectorMesh(gl, params, opts) { module.exports = createVectorMesh -},{"colormap":74,"gl-buffer":112,"gl-mat4/invert":142,"gl-mat4/multiply":144,"gl-shader":170,"gl-texture2d":185,"gl-vao":189,"ndarray":305}],115:[function(_dereq_,module,exports){ +},{"colormap":74,"gl-buffer":106,"gl-mat4/invert":136,"gl-mat4/multiply":138,"gl-shader":163,"gl-texture2d":177,"gl-vao":181,"ndarray":293}],109:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var triVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) @@ -24148,7 +23560,7 @@ exports.pickShader = { ] } -},{"glslify":270}],116:[function(_dereq_,module,exports){ +},{"glslify":262}],110:[function(_dereq_,module,exports){ module.exports = { 0: 'NONE', 1: 'ONE', @@ -24448,14 +23860,14 @@ module.exports = { 37444: 'BROWSER_DEFAULT_WEBGL' } -},{}],117:[function(_dereq_,module,exports){ +},{}],111:[function(_dereq_,module,exports){ var gl10 = _dereq_('./1.0/numbers') module.exports = function lookupConstant (number) { return gl10[number] } -},{"./1.0/numbers":116}],118:[function(_dereq_,module,exports){ +},{"./1.0/numbers":110}],112:[function(_dereq_,module,exports){ 'use strict' module.exports = createErrorBars @@ -24706,9 +24118,19 @@ function createErrorBars(options) { return result } -},{"./shaders/index":120,"gl-buffer":112,"gl-vao":189}],119:[function(_dereq_,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"dup":110}],120:[function(_dereq_,module,exports){ +},{"./shaders/index":114,"gl-buffer":106,"gl-vao":181}],113:[function(_dereq_,module,exports){ +module.exports = function(strings) { + if (typeof strings === 'string') strings = [strings] + var exprs = [].slice.call(arguments,1) + var parts = [] + for (var i = 0; i < strings.length-1; i++) { + parts.push(strings[i], exprs[i] || '') + } + parts.push(strings[i]) + return parts.join('') +} + +},{}],114:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -24725,7 +24147,7 @@ module.exports = function(gl) { ]) } -},{"gl-shader":170,"glslify":119}],121:[function(_dereq_,module,exports){ +},{"gl-shader":163,"glslify":113}],115:[function(_dereq_,module,exports){ 'use strict' var createTexture = _dereq_('gl-texture2d') @@ -25192,7 +24614,7 @@ function createFBO(gl, width, height, options) { WEBGL_draw_buffers) } -},{"gl-texture2d":185}],122:[function(_dereq_,module,exports){ +},{"gl-texture2d":177}],116:[function(_dereq_,module,exports){ var sprintf = _dereq_('sprintf-js').sprintf; var glConstants = _dereq_('gl-constants/lookup'); @@ -25247,7 +24669,7 @@ function formatCompilerError(errLog, src, type) { } -},{"add-line-numbers":19,"gl-constants/lookup":117,"glsl-shader-name":262,"sprintf-js":363}],123:[function(_dereq_,module,exports){ +},{"add-line-numbers":19,"gl-constants/lookup":111,"glsl-shader-name":254,"sprintf-js":347}],117:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var createShader = _dereq_('gl-shader') @@ -25271,7 +24693,7 @@ exports.createPickShader = function(gl) { return createShader(gl, vertSrc, pickFrag, null, ATTRIBUTES) } -},{"gl-shader":170,"glslify":125}],124:[function(_dereq_,module,exports){ +},{"gl-shader":163,"glslify":119}],118:[function(_dereq_,module,exports){ 'use strict' module.exports = createLinePlot @@ -25672,9 +25094,9 @@ function createLinePlot (options) { return linePlot } -},{"./lib/shaders":123,"binary-search-bounds":42,"gl-buffer":112,"gl-texture2d":185,"gl-vao":189,"ndarray":305}],125:[function(_dereq_,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"dup":110}],126:[function(_dereq_,module,exports){ +},{"./lib/shaders":117,"binary-search-bounds":42,"gl-buffer":106,"gl-texture2d":177,"gl-vao":181,"ndarray":293}],119:[function(_dereq_,module,exports){ +arguments[4][113][0].apply(exports,arguments) +},{"dup":113}],120:[function(_dereq_,module,exports){ module.exports = adjoint; /** @@ -25708,7 +25130,7 @@ function adjoint(out, a) { out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); return out; }; -},{}],127:[function(_dereq_,module,exports){ +},{}],121:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -25737,7 +25159,7 @@ function clone(a) { out[15] = a[15]; return out; }; -},{}],128:[function(_dereq_,module,exports){ +},{}],122:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -25766,7 +25188,7 @@ function copy(out, a) { out[15] = a[15]; return out; }; -},{}],129:[function(_dereq_,module,exports){ +},{}],123:[function(_dereq_,module,exports){ module.exports = create; /** @@ -25794,7 +25216,7 @@ function create() { out[15] = 1; return out; }; -},{}],130:[function(_dereq_,module,exports){ +},{}],124:[function(_dereq_,module,exports){ module.exports = determinant; /** @@ -25825,7 +25247,7 @@ function determinant(a) { // Calculate the determinant return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; }; -},{}],131:[function(_dereq_,module,exports){ +},{}],125:[function(_dereq_,module,exports){ module.exports = fromQuat; /** @@ -25873,7 +25295,7 @@ function fromQuat(out, q) { return out; }; -},{}],132:[function(_dereq_,module,exports){ +},{}],126:[function(_dereq_,module,exports){ module.exports = fromRotation /** @@ -25928,7 +25350,7 @@ function fromRotation(out, rad, axis) { return out } -},{}],133:[function(_dereq_,module,exports){ +},{}],127:[function(_dereq_,module,exports){ module.exports = fromRotationTranslation; /** @@ -25982,7 +25404,7 @@ function fromRotationTranslation(out, q, v) { return out; }; -},{}],134:[function(_dereq_,module,exports){ +},{}],128:[function(_dereq_,module,exports){ module.exports = fromScaling /** @@ -26016,7 +25438,7 @@ function fromScaling(out, v) { return out } -},{}],135:[function(_dereq_,module,exports){ +},{}],129:[function(_dereq_,module,exports){ module.exports = fromTranslation /** @@ -26050,7 +25472,7 @@ function fromTranslation(out, v) { return out } -},{}],136:[function(_dereq_,module,exports){ +},{}],130:[function(_dereq_,module,exports){ module.exports = fromXRotation /** @@ -26087,7 +25509,7 @@ function fromXRotation(out, rad) { out[15] = 1 return out } -},{}],137:[function(_dereq_,module,exports){ +},{}],131:[function(_dereq_,module,exports){ module.exports = fromYRotation /** @@ -26124,7 +25546,7 @@ function fromYRotation(out, rad) { out[15] = 1 return out } -},{}],138:[function(_dereq_,module,exports){ +},{}],132:[function(_dereq_,module,exports){ module.exports = fromZRotation /** @@ -26161,7 +25583,7 @@ function fromZRotation(out, rad) { out[15] = 1 return out } -},{}],139:[function(_dereq_,module,exports){ +},{}],133:[function(_dereq_,module,exports){ module.exports = frustum; /** @@ -26198,7 +25620,7 @@ function frustum(out, left, right, bottom, top, near, far) { out[15] = 0; return out; }; -},{}],140:[function(_dereq_,module,exports){ +},{}],134:[function(_dereq_,module,exports){ module.exports = identity; /** @@ -26226,7 +25648,7 @@ function identity(out) { out[15] = 1; return out; }; -},{}],141:[function(_dereq_,module,exports){ +},{}],135:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create') , clone: _dereq_('./clone') @@ -26259,7 +25681,7 @@ module.exports = { , str: _dereq_('./str') } -},{"./adjoint":126,"./clone":127,"./copy":128,"./create":129,"./determinant":130,"./fromQuat":131,"./fromRotation":132,"./fromRotationTranslation":133,"./fromScaling":134,"./fromTranslation":135,"./fromXRotation":136,"./fromYRotation":137,"./fromZRotation":138,"./frustum":139,"./identity":140,"./invert":142,"./lookAt":143,"./multiply":144,"./ortho":145,"./perspective":146,"./perspectiveFromFieldOfView":147,"./rotate":148,"./rotateX":149,"./rotateY":150,"./rotateZ":151,"./scale":152,"./str":153,"./translate":154,"./transpose":155}],142:[function(_dereq_,module,exports){ +},{"./adjoint":120,"./clone":121,"./copy":122,"./create":123,"./determinant":124,"./fromQuat":125,"./fromRotation":126,"./fromRotationTranslation":127,"./fromScaling":128,"./fromTranslation":129,"./fromXRotation":130,"./fromYRotation":131,"./fromZRotation":132,"./frustum":133,"./identity":134,"./invert":136,"./lookAt":137,"./multiply":138,"./ortho":139,"./perspective":140,"./perspectiveFromFieldOfView":141,"./rotate":142,"./rotateX":143,"./rotateY":144,"./rotateZ":145,"./scale":146,"./str":147,"./translate":148,"./transpose":149}],136:[function(_dereq_,module,exports){ module.exports = invert; /** @@ -26315,7 +25737,7 @@ function invert(out, a) { return out; }; -},{}],143:[function(_dereq_,module,exports){ +},{}],137:[function(_dereq_,module,exports){ var identity = _dereq_('./identity'); module.exports = lookAt; @@ -26406,7 +25828,7 @@ function lookAt(out, eye, center, up) { return out; }; -},{"./identity":140}],144:[function(_dereq_,module,exports){ +},{"./identity":134}],138:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -26449,7 +25871,7 @@ function multiply(out, a, b) { out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; return out; }; -},{}],145:[function(_dereq_,module,exports){ +},{}],139:[function(_dereq_,module,exports){ module.exports = ortho; /** @@ -26486,7 +25908,7 @@ function ortho(out, left, right, bottom, top, near, far) { out[15] = 1; return out; }; -},{}],146:[function(_dereq_,module,exports){ +},{}],140:[function(_dereq_,module,exports){ module.exports = perspective; /** @@ -26520,7 +25942,7 @@ function perspective(out, fovy, aspect, near, far) { out[15] = 0; return out; }; -},{}],147:[function(_dereq_,module,exports){ +},{}],141:[function(_dereq_,module,exports){ module.exports = perspectiveFromFieldOfView; /** @@ -26562,7 +25984,7 @@ function perspectiveFromFieldOfView(out, fov, near, far) { } -},{}],148:[function(_dereq_,module,exports){ +},{}],142:[function(_dereq_,module,exports){ module.exports = rotate; /** @@ -26627,7 +26049,7 @@ function rotate(out, a, rad, axis) { } return out; }; -},{}],149:[function(_dereq_,module,exports){ +},{}],143:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -26672,7 +26094,7 @@ function rotateX(out, a, rad) { out[11] = a23 * c - a13 * s; return out; }; -},{}],150:[function(_dereq_,module,exports){ +},{}],144:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -26717,7 +26139,7 @@ function rotateY(out, a, rad) { out[11] = a03 * s + a23 * c; return out; }; -},{}],151:[function(_dereq_,module,exports){ +},{}],145:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -26762,7 +26184,7 @@ function rotateZ(out, a, rad) { out[7] = a13 * c - a03 * s; return out; }; -},{}],152:[function(_dereq_,module,exports){ +},{}],146:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -26794,7 +26216,7 @@ function scale(out, a, v) { out[15] = a[15]; return out; }; -},{}],153:[function(_dereq_,module,exports){ +},{}],147:[function(_dereq_,module,exports){ module.exports = str; /** @@ -26809,7 +26231,7 @@ function str(a) { a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; }; -},{}],154:[function(_dereq_,module,exports){ +},{}],148:[function(_dereq_,module,exports){ module.exports = translate; /** @@ -26848,7 +26270,7 @@ function translate(out, a, v) { return out; }; -},{}],155:[function(_dereq_,module,exports){ +},{}],149:[function(_dereq_,module,exports){ module.exports = transpose; /** @@ -26898,7 +26320,7 @@ function transpose(out, a) { return out; }; -},{}],156:[function(_dereq_,module,exports){ +},{}],150:[function(_dereq_,module,exports){ 'use strict' var barycentric = _dereq_('barycentric') @@ -26996,7 +26418,7 @@ function closestPointToPickLocation(simplex, pixelCoord, model, view, projection } return [closestIndex, interpolate(simplex, weights), weights] } -},{"barycentric":24,"polytope-closest-point/lib/closest_point_2d.js":329}],157:[function(_dereq_,module,exports){ +},{"barycentric":24,"polytope-closest-point/lib/closest_point_2d.js":314}],151:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var triVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]) @@ -27065,7 +26487,7 @@ exports.contourShader = { ] } -},{"glslify":270}],158:[function(_dereq_,module,exports){ +},{"glslify":262}],152:[function(_dereq_,module,exports){ 'use strict' var DEFAULT_VERTEX_NORMALS_EPSILON = 1e-6; // may be too large if triangles are very small @@ -28176,7 +27598,7 @@ function createSimplicialMesh(gl, params) { module.exports = createSimplicialMesh -},{"./lib/closest-point":156,"./lib/shaders":157,"colormap":74,"gl-buffer":112,"gl-mat4/invert":142,"gl-mat4/multiply":144,"gl-shader":170,"gl-texture2d":185,"gl-vao":189,"ndarray":305,"normals":307,"simplicial-complex-contour":352,"typedarray-pool":372}],159:[function(_dereq_,module,exports){ +},{"./lib/closest-point":150,"./lib/shaders":151,"colormap":74,"gl-buffer":106,"gl-mat4/invert":136,"gl-mat4/multiply":138,"gl-shader":163,"gl-texture2d":177,"gl-vao":181,"ndarray":293,"normals":295,"simplicial-complex-contour":337,"typedarray-pool":355}],153:[function(_dereq_,module,exports){ 'use strict' module.exports = createCamera @@ -28457,7 +27879,7 @@ function createCamera(element, options) { return camera } -},{"3d-view":16,"has-passive-events":272,"mouse-change":292,"mouse-event-offset":293,"mouse-wheel":295,"right-now":338}],160:[function(_dereq_,module,exports){ +},{"3d-view":16,"has-passive-events":264,"mouse-change":280,"mouse-event-offset":281,"mouse-wheel":283,"right-now":323}],154:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var createShader = _dereq_('gl-shader') @@ -28468,9 +27890,7 @@ module.exports = function(gl) { return createShader(gl, vertSrc, fragSrc, null, [ { name: 'position', type: 'vec2'}]) } -},{"gl-shader":170,"glslify":161}],161:[function(_dereq_,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"dup":110}],162:[function(_dereq_,module,exports){ +},{"gl-shader":163,"glslify":262}],155:[function(_dereq_,module,exports){ 'use strict' var createCamera = _dereq_('./camera.js') @@ -29325,7 +28745,7 @@ function calcCameraParams(scene, isOrtho) { } } -},{"./camera.js":159,"./lib/shader":160,"a-big-triangle":18,"gl-axes3d":103,"gl-axes3d/properties":111,"gl-fbo":121,"gl-mat4/ortho":145,"gl-mat4/perspective":146,"gl-select-static":169,"gl-spikes3d":179,"is-mobile":281,"mouse-change":292}],163:[function(_dereq_,module,exports){ +},{"./camera.js":153,"./lib/shader":154,"a-big-triangle":18,"gl-axes3d":98,"gl-axes3d/properties":105,"gl-fbo":115,"gl-mat4/ortho":139,"gl-mat4/perspective":140,"gl-select-static":162,"gl-spikes3d":171,"is-mobile":270,"mouse-change":280}],156:[function(_dereq_,module,exports){ module.exports = slerp /** @@ -29378,14 +28798,14 @@ function slerp (out, a, b, t) { return out } -},{}],164:[function(_dereq_,module,exports){ +},{}],157:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(a){ return (!a && a !== 0) ? '' : a.toString(); } -},{}],165:[function(_dereq_,module,exports){ +},{}],158:[function(_dereq_,module,exports){ "use strict" var vectorizeText = _dereq_("vectorize-text") @@ -29454,7 +28874,7 @@ function getGlyph(symbol, font, pixelRatio) { //Save cached symbol return fontCache[symbol] = [triSymbol, lineSymbol, bounds] } -},{"vectorize-text":375}],166:[function(_dereq_,module,exports){ +},{"vectorize-text":358}],159:[function(_dereq_,module,exports){ var createShaderWrapper = _dereq_('gl-shader') var glslify = _dereq_('glslify') @@ -29531,9 +28951,9 @@ exports.createPickProject = function(gl) { return createShader(gl, pickProject) } -},{"gl-shader":170,"glslify":167}],167:[function(_dereq_,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"dup":110}],168:[function(_dereq_,module,exports){ +},{"gl-shader":163,"glslify":160}],160:[function(_dereq_,module,exports){ +arguments[4][113][0].apply(exports,arguments) +},{"dup":113}],161:[function(_dereq_,module,exports){ 'use strict' var isAllBlank = _dereq_('is-string-blank') @@ -30405,7 +29825,7 @@ function createPointCloud(options) { return pointCloud } -},{"./lib/get-simple-string":164,"./lib/glyphs":165,"./lib/shaders":166,"gl-buffer":112,"gl-mat4/multiply":144,"gl-vao":189,"is-string-blank":283,"typedarray-pool":372}],169:[function(_dereq_,module,exports){ +},{"./lib/get-simple-string":157,"./lib/glyphs":158,"./lib/shaders":159,"gl-buffer":106,"gl-mat4/multiply":138,"gl-vao":181,"is-string-blank":272,"typedarray-pool":355}],162:[function(_dereq_,module,exports){ 'use strict' module.exports = createSelectBuffer @@ -30590,7 +30010,7 @@ function createSelectBuffer(gl, shape) { return new SelectBuffer(gl, fbo, buffer) } -},{"bit-twiddle":43,"gl-fbo":121,"ndarray":305,"typedarray-pool":372}],170:[function(_dereq_,module,exports){ +},{"bit-twiddle":43,"gl-fbo":115,"ndarray":293,"typedarray-pool":355}],163:[function(_dereq_,module,exports){ 'use strict' var createUniformWrapper = _dereq_('./lib/create-uniforms') @@ -30856,7 +30276,7 @@ function createShader( module.exports = createShader -},{"./lib/GLError":171,"./lib/create-attributes":172,"./lib/create-uniforms":173,"./lib/reflect":174,"./lib/runtime-reflect":175,"./lib/shader-cache":176}],171:[function(_dereq_,module,exports){ +},{"./lib/GLError":164,"./lib/create-attributes":165,"./lib/create-uniforms":166,"./lib/reflect":167,"./lib/runtime-reflect":168,"./lib/shader-cache":169}],164:[function(_dereq_,module,exports){ function GLError (rawError, shortMessage, longMessage) { this.shortMessage = shortMessage || '' this.longMessage = longMessage || '' @@ -30871,7 +30291,7 @@ GLError.prototype.name = 'GLError' GLError.prototype.constructor = GLError module.exports = GLError -},{}],172:[function(_dereq_,module,exports){ +},{}],165:[function(_dereq_,module,exports){ 'use strict' module.exports = createAttributeWrapper @@ -30932,6 +30352,40 @@ Object.defineProperty(proto, 'location', { } }) +var allFns = [ + function (gl, v, x0) { + if (x0.length === undefined) { + return gl.vertexAttrib1f(v, x0) + } else { + return gl.vertexAttrib1fv(v, x0) + } + }, + + function (gl, v, x0, x1) { + if (x0.length === undefined) { + return gl.vertexAttrib2f(v, x0, x1) + } else { + return gl.vertexAttrib2fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2) { + if (x0.length === undefined) { + return gl.vertexAttrib3f(v, x0, x1, x2) + } else { + return gl.vertexAttrib3fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2, x3) { + if (x0.length === undefined) { + return gl.vertexAttrib4f(v, x0, x1, x2, x3) + } else { + return gl.vertexAttrib4fv(v, x0) + } + } +] + //Adds a vector attribute to obj function addVectorAttribute( gl @@ -30942,21 +30396,7 @@ function addVectorAttribute( , obj , name) { - //Construct constant function - var constFuncArgs = [ 'gl', 'v' ] - var varNames = [] - for(var i=0; i 4) { - throw new GLError('', 'Invalid data type') + function makeSetter(type) { + return function updateProperty(obj){ + var indices = enumerateIndices('', type) + for(var i=0; i 4) { - throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + type) + var vidx = t.indexOf('vec') + if(0 <= vidx && vidx <= 1 && t.length === 4 + vidx) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type') + } + switch(t.charAt(0)) { + case 'b': + case 'i': + gl['uniform' + d + 'iv'](locations[idx], objPath) + break + case 'v': + gl['uniform' + d + 'fv'](locations[idx], objPath) + break + default: + throw new GLError('', 'Unrecognized data type for vector ' + name + ': ' + t) + } + } else if(t.indexOf('mat') === 0 && t.length === 4) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + t) + } + gl['uniformMatrix' + d + 'fv'](locations[idx], false, objPath) + break + } else { + throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + t) + } } - return 'gl.uniformMatrix' + d + 'fv(locations[' + index + '],false,obj' + path + ')' - } else { - throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + type) } - break + } } } @@ -31230,21 +30704,6 @@ function createUniformWrapper(gl, wrapper, uniforms, locations) { return indices } - function makeSetter(type) { - var code = [ 'return function updateProperty(obj){' ] - var indices = enumerateIndices('', type) - for(var i=0; i 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) @@ -31848,9 +31304,9 @@ exports.pickShader = { ] } -},{"glslify":181}],181:[function(_dereq_,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"dup":110}],182:[function(_dereq_,module,exports){ +},{"glslify":173}],173:[function(_dereq_,module,exports){ +arguments[4][113][0].apply(exports,arguments) +},{"dup":113}],174:[function(_dereq_,module,exports){ "use strict"; var vec3 = _dereq_('gl-vec3'); @@ -32410,7 +31866,7 @@ module.exports.createTubeMesh = function(gl, params) { }); } -},{"./lib/shaders":180,"gl-cone3d":113,"gl-vec3":208,"gl-vec4":244}],183:[function(_dereq_,module,exports){ +},{"./lib/shaders":172,"gl-cone3d":107,"gl-vec3":200,"gl-vec4":236}],175:[function(_dereq_,module,exports){ var createShader = _dereq_('gl-shader') var glslify = _dereq_('glslify') @@ -32460,7 +31916,7 @@ exports.createPickContourShader = function (gl) { return shader } -},{"gl-shader":170,"glslify":270}],184:[function(_dereq_,module,exports){ +},{"gl-shader":163,"glslify":262}],176:[function(_dereq_,module,exports){ 'use strict' module.exports = createSurfacePlot @@ -33842,7 +33298,7 @@ function createSurfacePlot (params) { return surface } -},{"./lib/shaders":183,"binary-search-bounds":42,"bit-twiddle":43,"colormap":74,"gl-buffer":112,"gl-mat4/invert":142,"gl-mat4/multiply":144,"gl-texture2d":185,"gl-vao":189,"ndarray":305,"ndarray-gradient":298,"ndarray-ops":300,"ndarray-pack":301,"surface-nets":364,"typedarray-pool":372}],185:[function(_dereq_,module,exports){ +},{"./lib/shaders":175,"binary-search-bounds":42,"bit-twiddle":43,"colormap":74,"gl-buffer":106,"gl-mat4/invert":136,"gl-mat4/multiply":138,"gl-texture2d":177,"gl-vao":181,"ndarray":293,"ndarray-gradient":286,"ndarray-ops":288,"ndarray-pack":289,"surface-nets":348,"typedarray-pool":355}],177:[function(_dereq_,module,exports){ 'use strict' var ndarray = _dereq_('ndarray') @@ -34405,7 +33861,7 @@ function createTexture2D(gl) { throw new Error('gl-texture2d: Invalid arguments for texture2d constructor') } -},{"ndarray":305,"ndarray-ops":300,"typedarray-pool":372}],186:[function(_dereq_,module,exports){ +},{"ndarray":293,"ndarray-ops":288,"typedarray-pool":355}],178:[function(_dereq_,module,exports){ "use strict" function doBind(gl, elements, attributes) { @@ -34460,7 +33916,7 @@ function doBind(gl, elements, attributes) { } module.exports = doBind -},{}],187:[function(_dereq_,module,exports){ +},{}],179:[function(_dereq_,module,exports){ "use strict" var bindAttribs = _dereq_("./do-bind.js") @@ -34500,7 +33956,7 @@ function createVAOEmulated(gl) { } module.exports = createVAOEmulated -},{"./do-bind.js":186}],188:[function(_dereq_,module,exports){ +},{"./do-bind.js":178}],180:[function(_dereq_,module,exports){ "use strict" var bindAttribs = _dereq_("./do-bind.js") @@ -34588,7 +34044,7 @@ function createVAONative(gl, ext) { } module.exports = createVAONative -},{"./do-bind.js":186}],189:[function(_dereq_,module,exports){ +},{"./do-bind.js":178}],181:[function(_dereq_,module,exports){ "use strict" var createVAONative = _dereq_("./lib/vao-native.js") @@ -34617,7 +34073,7 @@ function createVAO(gl, attributes, elements, elementsType) { module.exports = createVAO -},{"./lib/vao-emulated.js":187,"./lib/vao-native.js":188}],190:[function(_dereq_,module,exports){ +},{"./lib/vao-emulated.js":179,"./lib/vao-native.js":180}],182:[function(_dereq_,module,exports){ module.exports = add; /** @@ -34634,7 +34090,7 @@ function add(out, a, b) { out[2] = a[2] + b[2] return out } -},{}],191:[function(_dereq_,module,exports){ +},{}],183:[function(_dereq_,module,exports){ module.exports = angle var fromValues = _dereq_('./fromValues') @@ -34663,7 +34119,7 @@ function angle(a, b) { } } -},{"./dot":201,"./fromValues":207,"./normalize":218}],192:[function(_dereq_,module,exports){ +},{"./dot":193,"./fromValues":199,"./normalize":210}],184:[function(_dereq_,module,exports){ module.exports = ceil /** @@ -34680,7 +34136,7 @@ function ceil(out, a) { return out } -},{}],193:[function(_dereq_,module,exports){ +},{}],185:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -34696,7 +34152,7 @@ function clone(a) { out[2] = a[2] return out } -},{}],194:[function(_dereq_,module,exports){ +},{}],186:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -34712,7 +34168,7 @@ function copy(out, a) { out[2] = a[2] return out } -},{}],195:[function(_dereq_,module,exports){ +},{}],187:[function(_dereq_,module,exports){ module.exports = create; /** @@ -34727,7 +34183,7 @@ function create() { out[2] = 0 return out } -},{}],196:[function(_dereq_,module,exports){ +},{}],188:[function(_dereq_,module,exports){ module.exports = cross; /** @@ -34747,10 +34203,10 @@ function cross(out, a, b) { out[2] = ax * by - ay * bx return out } -},{}],197:[function(_dereq_,module,exports){ +},{}],189:[function(_dereq_,module,exports){ module.exports = _dereq_('./distance') -},{"./distance":198}],198:[function(_dereq_,module,exports){ +},{"./distance":190}],190:[function(_dereq_,module,exports){ module.exports = distance; /** @@ -34766,10 +34222,10 @@ function distance(a, b) { z = b[2] - a[2] return Math.sqrt(x*x + y*y + z*z) } -},{}],199:[function(_dereq_,module,exports){ +},{}],191:[function(_dereq_,module,exports){ module.exports = _dereq_('./divide') -},{"./divide":200}],200:[function(_dereq_,module,exports){ +},{"./divide":192}],192:[function(_dereq_,module,exports){ module.exports = divide; /** @@ -34786,7 +34242,7 @@ function divide(out, a, b) { out[2] = a[2] / b[2] return out } -},{}],201:[function(_dereq_,module,exports){ +},{}],193:[function(_dereq_,module,exports){ module.exports = dot; /** @@ -34799,10 +34255,10 @@ module.exports = dot; function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] } -},{}],202:[function(_dereq_,module,exports){ +},{}],194:[function(_dereq_,module,exports){ module.exports = 0.000001 -},{}],203:[function(_dereq_,module,exports){ +},{}],195:[function(_dereq_,module,exports){ module.exports = equals var EPSILON = _dereq_('./epsilon') @@ -34826,7 +34282,7 @@ function equals(a, b) { Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))) } -},{"./epsilon":202}],204:[function(_dereq_,module,exports){ +},{"./epsilon":194}],196:[function(_dereq_,module,exports){ module.exports = exactEquals /** @@ -34840,7 +34296,7 @@ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] } -},{}],205:[function(_dereq_,module,exports){ +},{}],197:[function(_dereq_,module,exports){ module.exports = floor /** @@ -34857,7 +34313,7 @@ function floor(out, a) { return out } -},{}],206:[function(_dereq_,module,exports){ +},{}],198:[function(_dereq_,module,exports){ module.exports = forEach; var vec = _dereq_('./create')() @@ -34902,7 +34358,7 @@ function forEach(a, stride, offset, count, fn, arg) { return a } -},{"./create":195}],207:[function(_dereq_,module,exports){ +},{"./create":187}],199:[function(_dereq_,module,exports){ module.exports = fromValues; /** @@ -34920,7 +34376,7 @@ function fromValues(x, y, z) { out[2] = z return out } -},{}],208:[function(_dereq_,module,exports){ +},{}],200:[function(_dereq_,module,exports){ module.exports = { EPSILON: _dereq_('./epsilon') , create: _dereq_('./create') @@ -34969,7 +34425,7 @@ module.exports = { , forEach: _dereq_('./forEach') } -},{"./add":190,"./angle":191,"./ceil":192,"./clone":193,"./copy":194,"./create":195,"./cross":196,"./dist":197,"./distance":198,"./div":199,"./divide":200,"./dot":201,"./epsilon":202,"./equals":203,"./exactEquals":204,"./floor":205,"./forEach":206,"./fromValues":207,"./inverse":209,"./len":210,"./length":211,"./lerp":212,"./max":213,"./min":214,"./mul":215,"./multiply":216,"./negate":217,"./normalize":218,"./random":219,"./rotateX":220,"./rotateY":221,"./rotateZ":222,"./round":223,"./scale":224,"./scaleAndAdd":225,"./set":226,"./sqrDist":227,"./sqrLen":228,"./squaredDistance":229,"./squaredLength":230,"./sub":231,"./subtract":232,"./transformMat3":233,"./transformMat4":234,"./transformQuat":235}],209:[function(_dereq_,module,exports){ +},{"./add":182,"./angle":183,"./ceil":184,"./clone":185,"./copy":186,"./create":187,"./cross":188,"./dist":189,"./distance":190,"./div":191,"./divide":192,"./dot":193,"./epsilon":194,"./equals":195,"./exactEquals":196,"./floor":197,"./forEach":198,"./fromValues":199,"./inverse":201,"./len":202,"./length":203,"./lerp":204,"./max":205,"./min":206,"./mul":207,"./multiply":208,"./negate":209,"./normalize":210,"./random":211,"./rotateX":212,"./rotateY":213,"./rotateZ":214,"./round":215,"./scale":216,"./scaleAndAdd":217,"./set":218,"./sqrDist":219,"./sqrLen":220,"./squaredDistance":221,"./squaredLength":222,"./sub":223,"./subtract":224,"./transformMat3":225,"./transformMat4":226,"./transformQuat":227}],201:[function(_dereq_,module,exports){ module.exports = inverse; /** @@ -34985,10 +34441,10 @@ function inverse(out, a) { out[2] = 1.0 / a[2] return out } -},{}],210:[function(_dereq_,module,exports){ +},{}],202:[function(_dereq_,module,exports){ module.exports = _dereq_('./length') -},{"./length":211}],211:[function(_dereq_,module,exports){ +},{"./length":203}],203:[function(_dereq_,module,exports){ module.exports = length; /** @@ -35003,7 +34459,7 @@ function length(a) { z = a[2] return Math.sqrt(x*x + y*y + z*z) } -},{}],212:[function(_dereq_,module,exports){ +},{}],204:[function(_dereq_,module,exports){ module.exports = lerp; /** @@ -35024,7 +34480,7 @@ function lerp(out, a, b, t) { out[2] = az + t * (b[2] - az) return out } -},{}],213:[function(_dereq_,module,exports){ +},{}],205:[function(_dereq_,module,exports){ module.exports = max; /** @@ -35041,7 +34497,7 @@ function max(out, a, b) { out[2] = Math.max(a[2], b[2]) return out } -},{}],214:[function(_dereq_,module,exports){ +},{}],206:[function(_dereq_,module,exports){ module.exports = min; /** @@ -35058,10 +34514,10 @@ function min(out, a, b) { out[2] = Math.min(a[2], b[2]) return out } -},{}],215:[function(_dereq_,module,exports){ +},{}],207:[function(_dereq_,module,exports){ module.exports = _dereq_('./multiply') -},{"./multiply":216}],216:[function(_dereq_,module,exports){ +},{"./multiply":208}],208:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -35078,7 +34534,7 @@ function multiply(out, a, b) { out[2] = a[2] * b[2] return out } -},{}],217:[function(_dereq_,module,exports){ +},{}],209:[function(_dereq_,module,exports){ module.exports = negate; /** @@ -35094,7 +34550,7 @@ function negate(out, a) { out[2] = -a[2] return out } -},{}],218:[function(_dereq_,module,exports){ +},{}],210:[function(_dereq_,module,exports){ module.exports = normalize; /** @@ -35118,7 +34574,7 @@ function normalize(out, a) { } return out } -},{}],219:[function(_dereq_,module,exports){ +},{}],211:[function(_dereq_,module,exports){ module.exports = random; /** @@ -35140,7 +34596,7 @@ function random(out, scale) { out[2] = z * scale return out } -},{}],220:[function(_dereq_,module,exports){ +},{}],212:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -35170,7 +34626,7 @@ function rotateX(out, a, b, c){ return out } -},{}],221:[function(_dereq_,module,exports){ +},{}],213:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -35200,7 +34656,7 @@ function rotateY(out, a, b, c){ return out } -},{}],222:[function(_dereq_,module,exports){ +},{}],214:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -35230,7 +34686,7 @@ function rotateZ(out, a, b, c){ return out } -},{}],223:[function(_dereq_,module,exports){ +},{}],215:[function(_dereq_,module,exports){ module.exports = round /** @@ -35247,7 +34703,7 @@ function round(out, a) { return out } -},{}],224:[function(_dereq_,module,exports){ +},{}],216:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -35264,7 +34720,7 @@ function scale(out, a, b) { out[2] = a[2] * b return out } -},{}],225:[function(_dereq_,module,exports){ +},{}],217:[function(_dereq_,module,exports){ module.exports = scaleAndAdd; /** @@ -35282,7 +34738,7 @@ function scaleAndAdd(out, a, b, scale) { out[2] = a[2] + (b[2] * scale) return out } -},{}],226:[function(_dereq_,module,exports){ +},{}],218:[function(_dereq_,module,exports){ module.exports = set; /** @@ -35300,13 +34756,13 @@ function set(out, x, y, z) { out[2] = z return out } -},{}],227:[function(_dereq_,module,exports){ +},{}],219:[function(_dereq_,module,exports){ module.exports = _dereq_('./squaredDistance') -},{"./squaredDistance":229}],228:[function(_dereq_,module,exports){ +},{"./squaredDistance":221}],220:[function(_dereq_,module,exports){ module.exports = _dereq_('./squaredLength') -},{"./squaredLength":230}],229:[function(_dereq_,module,exports){ +},{"./squaredLength":222}],221:[function(_dereq_,module,exports){ module.exports = squaredDistance; /** @@ -35322,7 +34778,7 @@ function squaredDistance(a, b) { z = b[2] - a[2] return x*x + y*y + z*z } -},{}],230:[function(_dereq_,module,exports){ +},{}],222:[function(_dereq_,module,exports){ module.exports = squaredLength; /** @@ -35337,10 +34793,10 @@ function squaredLength(a) { z = a[2] return x*x + y*y + z*z } -},{}],231:[function(_dereq_,module,exports){ +},{}],223:[function(_dereq_,module,exports){ module.exports = _dereq_('./subtract') -},{"./subtract":232}],232:[function(_dereq_,module,exports){ +},{"./subtract":224}],224:[function(_dereq_,module,exports){ module.exports = subtract; /** @@ -35357,7 +34813,7 @@ function subtract(out, a, b) { out[2] = a[2] - b[2] return out } -},{}],233:[function(_dereq_,module,exports){ +},{}],225:[function(_dereq_,module,exports){ module.exports = transformMat3; /** @@ -35375,7 +34831,7 @@ function transformMat3(out, a, m) { out[2] = x * m[2] + y * m[5] + z * m[8] return out } -},{}],234:[function(_dereq_,module,exports){ +},{}],226:[function(_dereq_,module,exports){ module.exports = transformMat4; /** @@ -35396,7 +34852,7 @@ function transformMat4(out, a, m) { out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w return out } -},{}],235:[function(_dereq_,module,exports){ +},{}],227:[function(_dereq_,module,exports){ module.exports = transformQuat; /** @@ -35425,7 +34881,7 @@ function transformQuat(out, a, q) { out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx return out } -},{}],236:[function(_dereq_,module,exports){ +},{}],228:[function(_dereq_,module,exports){ module.exports = add /** @@ -35444,7 +34900,7 @@ function add (out, a, b) { return out } -},{}],237:[function(_dereq_,module,exports){ +},{}],229:[function(_dereq_,module,exports){ module.exports = clone /** @@ -35462,7 +34918,7 @@ function clone (a) { return out } -},{}],238:[function(_dereq_,module,exports){ +},{}],230:[function(_dereq_,module,exports){ module.exports = copy /** @@ -35480,7 +34936,7 @@ function copy (out, a) { return out } -},{}],239:[function(_dereq_,module,exports){ +},{}],231:[function(_dereq_,module,exports){ module.exports = create /** @@ -35497,7 +34953,7 @@ function create () { return out } -},{}],240:[function(_dereq_,module,exports){ +},{}],232:[function(_dereq_,module,exports){ module.exports = distance /** @@ -35515,7 +34971,7 @@ function distance (a, b) { return Math.sqrt(x * x + y * y + z * z + w * w) } -},{}],241:[function(_dereq_,module,exports){ +},{}],233:[function(_dereq_,module,exports){ module.exports = divide /** @@ -35534,7 +34990,7 @@ function divide (out, a, b) { return out } -},{}],242:[function(_dereq_,module,exports){ +},{}],234:[function(_dereq_,module,exports){ module.exports = dot /** @@ -35548,7 +35004,7 @@ function dot (a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3] } -},{}],243:[function(_dereq_,module,exports){ +},{}],235:[function(_dereq_,module,exports){ module.exports = fromValues /** @@ -35569,7 +35025,7 @@ function fromValues (x, y, z, w) { return out } -},{}],244:[function(_dereq_,module,exports){ +},{}],236:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create'), clone: _dereq_('./clone'), @@ -35598,7 +35054,7 @@ module.exports = { transformQuat: _dereq_('./transformQuat') } -},{"./add":236,"./clone":237,"./copy":238,"./create":239,"./distance":240,"./divide":241,"./dot":242,"./fromValues":243,"./inverse":245,"./length":246,"./lerp":247,"./max":248,"./min":249,"./multiply":250,"./negate":251,"./normalize":252,"./random":253,"./scale":254,"./scaleAndAdd":255,"./set":256,"./squaredDistance":257,"./squaredLength":258,"./subtract":259,"./transformMat4":260,"./transformQuat":261}],245:[function(_dereq_,module,exports){ +},{"./add":228,"./clone":229,"./copy":230,"./create":231,"./distance":232,"./divide":233,"./dot":234,"./fromValues":235,"./inverse":237,"./length":238,"./lerp":239,"./max":240,"./min":241,"./multiply":242,"./negate":243,"./normalize":244,"./random":245,"./scale":246,"./scaleAndAdd":247,"./set":248,"./squaredDistance":249,"./squaredLength":250,"./subtract":251,"./transformMat4":252,"./transformQuat":253}],237:[function(_dereq_,module,exports){ module.exports = inverse /** @@ -35616,7 +35072,7 @@ function inverse (out, a) { return out } -},{}],246:[function(_dereq_,module,exports){ +},{}],238:[function(_dereq_,module,exports){ module.exports = length /** @@ -35633,7 +35089,7 @@ function length (a) { return Math.sqrt(x * x + y * y + z * z + w * w) } -},{}],247:[function(_dereq_,module,exports){ +},{}],239:[function(_dereq_,module,exports){ module.exports = lerp /** @@ -35657,7 +35113,7 @@ function lerp (out, a, b, t) { return out } -},{}],248:[function(_dereq_,module,exports){ +},{}],240:[function(_dereq_,module,exports){ module.exports = max /** @@ -35676,7 +35132,7 @@ function max (out, a, b) { return out } -},{}],249:[function(_dereq_,module,exports){ +},{}],241:[function(_dereq_,module,exports){ module.exports = min /** @@ -35695,7 +35151,7 @@ function min (out, a, b) { return out } -},{}],250:[function(_dereq_,module,exports){ +},{}],242:[function(_dereq_,module,exports){ module.exports = multiply /** @@ -35714,7 +35170,7 @@ function multiply (out, a, b) { return out } -},{}],251:[function(_dereq_,module,exports){ +},{}],243:[function(_dereq_,module,exports){ module.exports = negate /** @@ -35732,7 +35188,7 @@ function negate (out, a) { return out } -},{}],252:[function(_dereq_,module,exports){ +},{}],244:[function(_dereq_,module,exports){ module.exports = normalize /** @@ -35758,7 +35214,7 @@ function normalize (out, a) { return out } -},{}],253:[function(_dereq_,module,exports){ +},{}],245:[function(_dereq_,module,exports){ var vecNormalize = _dereq_('./normalize') var vecScale = _dereq_('./scale') @@ -35784,7 +35240,7 @@ function random (out, scale) { return out } -},{"./normalize":252,"./scale":254}],254:[function(_dereq_,module,exports){ +},{"./normalize":244,"./scale":246}],246:[function(_dereq_,module,exports){ module.exports = scale /** @@ -35803,7 +35259,7 @@ function scale (out, a, b) { return out } -},{}],255:[function(_dereq_,module,exports){ +},{}],247:[function(_dereq_,module,exports){ module.exports = scaleAndAdd /** @@ -35823,7 +35279,7 @@ function scaleAndAdd (out, a, b, scale) { return out } -},{}],256:[function(_dereq_,module,exports){ +},{}],248:[function(_dereq_,module,exports){ module.exports = set /** @@ -35844,7 +35300,7 @@ function set (out, x, y, z, w) { return out } -},{}],257:[function(_dereq_,module,exports){ +},{}],249:[function(_dereq_,module,exports){ module.exports = squaredDistance /** @@ -35862,7 +35318,7 @@ function squaredDistance (a, b) { return x * x + y * y + z * z + w * w } -},{}],258:[function(_dereq_,module,exports){ +},{}],250:[function(_dereq_,module,exports){ module.exports = squaredLength /** @@ -35879,7 +35335,7 @@ function squaredLength (a) { return x * x + y * y + z * z + w * w } -},{}],259:[function(_dereq_,module,exports){ +},{}],251:[function(_dereq_,module,exports){ module.exports = subtract /** @@ -35898,7 +35354,7 @@ function subtract (out, a, b) { return out } -},{}],260:[function(_dereq_,module,exports){ +},{}],252:[function(_dereq_,module,exports){ module.exports = transformMat4 /** @@ -35918,7 +35374,7 @@ function transformMat4 (out, a, m) { return out } -},{}],261:[function(_dereq_,module,exports){ +},{}],253:[function(_dereq_,module,exports){ module.exports = transformQuat /** @@ -35947,7 +35403,7 @@ function transformQuat (out, a, q) { return out } -},{}],262:[function(_dereq_,module,exports){ +},{}],254:[function(_dereq_,module,exports){ var tokenize = _dereq_('glsl-tokenizer') var atob = _dereq_('atob-lite') @@ -35972,7 +35428,7 @@ function getName(src) { } } -},{"atob-lite":23,"glsl-tokenizer":269}],263:[function(_dereq_,module,exports){ +},{"atob-lite":23,"glsl-tokenizer":261}],255:[function(_dereq_,module,exports){ module.exports = tokenize var literals100 = _dereq_('./lib/literals') @@ -36349,7 +35805,7 @@ function tokenize(opt) { } } -},{"./lib/builtins":265,"./lib/builtins-300es":264,"./lib/literals":267,"./lib/literals-300es":266,"./lib/operators":268}],264:[function(_dereq_,module,exports){ +},{"./lib/builtins":257,"./lib/builtins-300es":256,"./lib/literals":259,"./lib/literals-300es":258,"./lib/operators":260}],256:[function(_dereq_,module,exports){ // 300es builtins/reserved words that were previously valid in v100 var v100 = _dereq_('./builtins') @@ -36420,7 +35876,7 @@ module.exports = v100.concat([ , 'textureProjGradOffset' ]) -},{"./builtins":265}],265:[function(_dereq_,module,exports){ +},{"./builtins":257}],257:[function(_dereq_,module,exports){ module.exports = [ // Keep this list sorted 'abs' @@ -36572,7 +36028,7 @@ module.exports = [ , 'textureCubeGradEXT' ] -},{}],266:[function(_dereq_,module,exports){ +},{}],258:[function(_dereq_,module,exports){ var v100 = _dereq_('./literals') module.exports = v100.slice().concat([ @@ -36661,7 +36117,7 @@ module.exports = v100.slice().concat([ , 'usampler2DMSArray' ]) -},{"./literals":267}],267:[function(_dereq_,module,exports){ +},{"./literals":259}],259:[function(_dereq_,module,exports){ module.exports = [ // current 'precision' @@ -36757,7 +36213,7 @@ module.exports = [ , 'using' ] -},{}],268:[function(_dereq_,module,exports){ +},{}],260:[function(_dereq_,module,exports){ module.exports = [ '<<=' , '>>=' @@ -36806,7 +36262,7 @@ module.exports = [ , '}' ] -},{}],269:[function(_dereq_,module,exports){ +},{}],261:[function(_dereq_,module,exports){ var tokenize = _dereq_('./index') module.exports = tokenizeString @@ -36821,9 +36277,9 @@ function tokenizeString(str, opt) { return tokens } -},{"./index":263}],270:[function(_dereq_,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"dup":110}],271:[function(_dereq_,module,exports){ +},{"./index":255}],262:[function(_dereq_,module,exports){ +arguments[4][113][0].apply(exports,arguments) +},{"dup":113}],263:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict' @@ -36840,7 +36296,7 @@ else { module.exports = hasHover }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"is-browser":279}],272:[function(_dereq_,module,exports){ +},{"is-browser":268}],264:[function(_dereq_,module,exports){ 'use strict' var isBrowser = _dereq_('is-browser') @@ -36866,7 +36322,7 @@ function detect() { module.exports = isBrowser && detect() -},{"is-browser":279}],273:[function(_dereq_,module,exports){ +},{"is-browser":268}],265:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -36952,7 +36408,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],274:[function(_dereq_,module,exports){ +},{}],266:[function(_dereq_,module,exports){ "use strict" //High level idea: @@ -36964,10 +36420,6 @@ module.exports = incrementalConvexHull var orient = _dereq_("robust-orientation") var compareCell = _dereq_("simplicial-complex").compareCells -function compareInt(a, b) { - return a - b -} - function Simplex(vertices, adjacent, boundary) { this.vertices = vertices this.adjacent = adjacent @@ -36994,21 +36446,19 @@ function compareGlue(a, b) { return compareCell(a.vertices, b.vertices) } -function bakeOrient(d) { - var code = ["function orient(){var tuple=this.tuple;return test("] - for(var i=0; i<=d; ++i) { - if(i > 0) { - code.push(",") - } - code.push("tuple[", i, "]") +function wrapper(test) { + return function() { + var tuple = this.tuple + return test.apply(this, tuple) } - code.push(")}return orient") - var proc = new Function("test", code.join("")) +} + +function bakeOrient(d) { var test = orient[d+1] if(!test) { test = orient } - return proc(test) + return wrapper(test) } var BAKED = [] @@ -37047,7 +36497,6 @@ proto.handleBoundaryDegeneracy = function(cell, point) { cell.lastVisited = -n while(toVisit.length > 0) { cell = toVisit.pop() - var cellVerts = cell.vertices var cellAdj = cell.adjacent for(var i=0; i<=d; ++i) { var neighbor = cellAdj[i] @@ -37170,7 +36619,7 @@ proto.addPeaks = function(point, cell) { var nv = neighbor.vertices //Test if neighbor is a peak - if(neighbor.lastVisited !== -n) { + if(neighbor.lastVisited !== -n) { //Compute orientation of p relative to each boundary peak var indexOfNeg1 = 0 for(var j=0; j<=d; ++j) { @@ -37395,11 +36844,11 @@ function incrementalConvexHull(points, randomSearch) { for(var i=d+1; i 0) { - stepVal.push(stride(i, order[j-1]) + "*" + shape(order[j-1]) ) - } - vars.push(step(i,order[j]) + "=(" + stepVal.join("-") + ")|0") - } - } - //Create index variables - for(var i=0; i=0; --i) { - sizeVariable.push(shape(order[i])) - } - //Previous phases and vertex_ids - vars.push(POOL_SIZE + "=(" + sizeVariable.join("*") + ")|0", - PHASES + "=mallocUint32(" + POOL_SIZE + ")", - VERTEX_IDS + "=mallocUint32(" + POOL_SIZE + ")", - POINTER + "=0") - //Create cube variables for phases - vars.push(pcube(0) + "=0") - for(var j=1; j<(1< 0) { + i1 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } } - } - cubeStep.push(shape(order[k])) - } - var signFlag = "" - if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) { - signFlag = "-" - } - var jperm = permBitmask(dimension, j, order) - vars.push(pdelta(jperm) + "=(-" + cubeDelta.join("-") + ")|0", - qcube(jperm) + "=(" + signFlag + cubeDelta.join("-") + ")|0", - pcube(jperm) + "=0") - } - vars.push(vert(0) + "=0", TEMPORARY + "=0") - - function forLoopBegin(i, start) { - code.push("for(", index(order[i]), "=", start, ";", - index(order[i]), "<", shape(order[i]), ";", - "++", index(order[i]), "){") - } - - function forLoopEnd(i) { - for(var j=0; j=0; --i) { - forLoopBegin(i, 0) - } - var phaseFuncArgs = [] - for(var i=0; i 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } + } + if (i1 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_1 } - vertexArgs.push(cube(i,j)) } + freeUint32(V) + freeUint32(P) } - for(var i=0; i<(1<0; k=(k-1)&subset) { - faceArgs.push(VERTEX_IDS + "[" + POINTER + "+" + pdelta(k) + "]") - } - faceArgs.push(vert(0)) - for(var k=0; k 0) { + i0 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + if (s1 > 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 } } - if(j&1) { - faceArgs.push(corner, edge) - } else { - faceArgs.push(edge, corner) - } - for(var k=0; k 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + } + } + if (i0 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_0 } - code.push("if(", corner, "!==", edge, "){", - "face(", faceArgs.join(), ")}") } + freeUint32(V) + freeUint32(P) } - - //Increment pointer, close off if statement - code.push("}", - POINTER, "+=1;") - } + }, +} - function flip() { - for(var j=1; j<(1<0){", - index(order[i]), "=1;") - createLoop(i-1, mask|(1<= 0) { - pickStr.push('0') - } else if(facet.indexOf(-(i+1)) >= 0) { - pickStr.push('s['+i+']-1') - } else { - pickStr.push('-1') - loStr.push('1') - hiStr.push('s['+i+']-2') - } +function CACHED_link(diff, zero, grad1, grad2) { + return function(dst, src) { + var s = src.shape.slice() + if (1 && s[0] > 2 && s[1] > 2) { + grad2( + src + .pick(-1, -1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 0) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2) + ) } - var boundStr = '.lo(' + loStr.join() + ').hi(' + hiStr.join() + ')' - if(loStr.length === 0) { - boundStr = '' + if (1 && s[1] > 2) { + grad1( + src + .pick(0, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(0, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(0, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) } - - if(cod > 0) { - code.push('if(1') - for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { - continue - } - code.push('&&s[', i, ']>2') - } - code.push('){grad', cod, '(src.pick(', pickStr.join(), ')', boundStr) - for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { - continue - } - code.push(',dst.pick(', pickStr.join(), ',', i, ')', boundStr) - } - code.push(');') + if (1 && s[1] > 2) { + grad1( + src + .pick(s[0] - 1, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(s[0] - 1, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(s[0] - 1, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) } - - for(var i=0; i1){dst.set(', - pickStr.join(), ',', bnd, ',0.5*(src.get(', - cPickStr.join(), ')-src.get(', - dPickStr.join(), ')))}else{dst.set(', - pickStr.join(), ',', bnd, ',0)};') - } else { - code.push('if(s[', bnd, ']>1){diff(', outStr, - ',src.pick(', cPickStr.join(), ')', boundStr, - ',src.pick(', dPickStr.join(), ')', boundStr, - ');}else{zero(', outStr, ');};') - } - break - - case 'mirror': - if(cod === 0) { - code.push('dst.set(', pickStr.join(), ',', bnd, ',0);') - } else { - code.push('zero(', outStr, ');') - } - break - - case 'wrap': - var aPickStr = pickStr.slice() - var bPickStr = pickStr.slice() - if(facet[i] < 0) { - aPickStr[bnd] = 's[' + bnd + ']-2' - bPickStr[bnd] = '0' - - } else { - aPickStr[bnd] = 's[' + bnd + ']-1' - bPickStr[bnd] = '1' - } - if(cod === 0) { - code.push('if(s[', bnd, ']>2){dst.set(', - pickStr.join(), ',', bnd, ',0.5*(src.get(', - aPickStr.join(), ')-src.get(', - bPickStr.join(), ')))}else{dst.set(', - pickStr.join(), ',', bnd, ',0)};') - } else { - code.push('if(s[', bnd, ']>2){diff(', outStr, - ',src.pick(', aPickStr.join(), ')', boundStr, - ',src.pick(', bPickStr.join(), ')', boundStr, - ');}else{zero(', outStr, ');};') - } - break - - default: - throw new Error('ndarray-gradient: Invalid boundary condition') - } + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, 0) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, 0, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, 0, 1) + .lo(1) + .hi(s[0] - 2) + ) } - - if(cod > 0) { - code.push('};') + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, s[1] - 1) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, s[1] - 1, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, s[1] - 1, 1) + .lo(1) + .hi(s[0] - 2) + ) } + dst.set(0, 0, 0, 0) + dst.set(0, 0, 1, 0) + dst.set(s[0] - 1, 0, 0, 0) + dst.set(s[0] - 1, 0, 1, 0) + dst.set(0, s[1] - 1, 0, 0) + dst.set(0, s[1] - 1, 1, 0) + dst.set(s[0] - 1, s[1] - 1, 0, 0) + dst.set(s[0] - 1, s[1] - 1, 1, 0) + return dst } +} - //Enumerate ridges, facets, etc. of hypercube - for(var i=0; i<(1< 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] * Y0 + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + }, + 'float32,1,0,float32,1,0': function () { + return function assign_cwise_loop_1s0m2f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + }, + 'float32,1,0,float32,0,1': function () { + return function assign_cwise_loop_1s0m0f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[1] | 0; j0 > 0;) { + if (j0 < 64) { + s1 = j0 + j0 = 0 + } else { + s1 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + p0 = (offset0 + j0 * t0p1 + j1 * t0p0) + p1 = (offset1 + j0 * t1p1 + j1 * t1p0) + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + } + } + }, + 'uint8,2,0,1,uint8,1,2,0': function () { + return function assign_cwise_loop_2s0s1m0u8(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[2] | 0; j0 > 0;) { + if (j0 < 64) { + s2 = j0 + j0 = 0 + } else { + s2 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j0 * t0p2 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j0 * t1p2 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + } + }, + 'uint8,2,0,1,array,2,0,1': function () { + return function assign_cwise_loop_2s0s1m3u8a(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + }, +} -var EmptyProc = { - body: "", - args: [], - thisVars: [], - localVars: [] +//Generates a cwise operator +function generateCWiseOp(proc, typesig) { + var key = typesig.join(',') + var f = CACHED_CWiseOp[key] + return f() } -function fixup(x) { - if(!x) { - return EmptyProc - } - for(var i=0; i>", - rrshift: ">>>" } ;(function(){ for(var id in assign_ops) { - var op = assign_ops[id] exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a","b","c"], - body: "a=b"+op+"c"}, funcName: id }) - exports[id+"eq"] = makeOp({ - args: ["array","array"], - body: {args:["a","b"], - body:"a"+op+"=b"}, - rvalue: true, - funcName: id+"eq" - }) exports[id+"s"] = makeOp({ - args: ["array", "array", "scalar"], - body: {args:["a","b","s"], - body:"a=b"+op+"s"}, funcName: id+"s" }) exports[id+"seq"] = makeOp({ - args: ["array","scalar"], - body: {args:["a","s"], - body:"a"+op+"=s"}, - rvalue: true, funcName: id+"seq" }) } })(); -var unary_ops = { - not: "!", - bnot: "~", - neg: "-", - recip: "1.0/" -} -;(function(){ - for(var id in unary_ops) { - var op = unary_ops[id] - exports[id] = makeOp({ - args: ["array", "array"], - body: {args:["a","b"], - body:"a="+op+"b"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array"], - body: {args:["a"], - body:"a="+op+"a"}, - rvalue: true, - count: 2, - funcName: id+"eq" - }) - } -})(); - -var binary_ops = { - and: "&&", - or: "||", - eq: "===", - neq: "!==", - lt: "<", - gt: ">", - leq: "<=", - geq: ">=" -} -;(function() { - for(var id in binary_ops) { - var op = binary_ops[id] - exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a", "b", "c"], - body:"a=b"+op+"c"}, - funcName: id - }) - exports[id+"s"] = makeOp({ - args: ["array","array","scalar"], - body: {args:["a", "b", "s"], - body:"a=b"+op+"s"}, - funcName: id+"s" - }) - exports[id+"eq"] = makeOp({ - args: ["array", "array"], - body: {args:["a", "b"], - body:"a=a"+op+"b"}, - rvalue:true, - count:2, - funcName: id+"eq" - }) - exports[id+"seq"] = makeOp({ - args: ["array", "scalar"], - body: {args:["a","s"], - body:"a=a"+op+"s"}, - rvalue:true, - count:2, - funcName: id+"seq" - }) - } -})(); - -var math_unary = [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan" -] -;(function() { - for(var i=0; ithis_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" -}) - -exports.norm1 = compile({ - args:["array"], - pre: {args:[], localVars:[], thisVars:["this_s"], body:"this_s=0"}, - body: {args:[{name:"a", lvalue:false, rvalue:true, 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" -}) - -exports.sup = compile({ - 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":false,"rvalue":true,"count":2} ], - thisVars: [ "this_h" ], - localVars: [] }, - post: - { body: "return this_h", - args: [], - thisVars: [ "this_h" ], - localVars: [] } - }) - -exports.inf = compile({ - args: [ "array" ], - pre: - { body: "this_h=Infinity", - args: [], - thisVars: [ "this_h" ], - localVars: [] }, - body: - { body: "if(_inline_1_arg0_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:false,rvalue:true,count:2}, - {name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:2}], - thisVars:["this_i","this_v"], - localVars:["_inline_1_k"]}, - post:{ - body:"{return this_i}", - args:[], - thisVars:["this_i"], - localVars:[]} -}) - -exports.random = makeOp({ - args: ["array"], - pre: {args:[], body:"this_f=Math.random", thisVars:["this_f"]}, - body: {args: ["a"], body:"a=this_f()", thisVars:["this_f"]}, - funcName: "random" -}) - exports.assign = makeOp({ - args:["array", "array"], - body: {args:["a", "b"], body:"a=b"}, funcName: "assign" }) -exports.assigns = makeOp({ - args:["array", "scalar"], - body: {args:["a", "b"], body:"a=b"}, - funcName: "assigns" }) - - -exports.equals = compile({ - args:["array", "array"], - pre: EmptyProc, - body: {args:[{name:"x", lvalue:false, rvalue:true, count:1}, - {name:"y", lvalue:false, rvalue:true, count:1}], - body: "if(x!==y){return false}", - localVars: [], - thisVars: []}, - post: {args:[], localVars:[], thisVars:[], body:"return true"}, - funcName: "equals" -}) - - - -},{"cwise-compiler":83}],301:[function(_dereq_,module,exports){ +},{}],289:[function(_dereq_,module,exports){ "use strict" var ndarray = _dereq_("ndarray") @@ -40584,739 +39807,849 @@ module.exports = function convert(arr, result) { return result } -},{"./doConvert.js":302,"ndarray":305}],302:[function(_dereq_,module,exports){ -module.exports=_dereq_('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":true,"rvalue":false,"count":1},{"name":"_inline_1_arg1_","lvalue":false,"rvalue":true,"count":1},{"name":"_inline_1_arg2_","lvalue":false,"rvalue":true,"count":4}],"thisVars":[],"localVars":["_inline_1_i","_inline_1_v"]},"post":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"funcName":"convert","blockSize":64}) +},{"./doConvert.js":290,"ndarray":293}],290:[function(_dereq_,module,exports){ +"use strict" + +function CwiseOp() { + return function (SS, a0, t0, p0, Y0) { + var s0 = SS[0], + s1 = SS[1], + s2 = SS[2], + t0p0 = t0[0], + t0p1 = t0[1], + t0p2 = t0[2], + index = [0, 0, 0]; + p0 |= 0; + var i0 = 0, + i1 = 0, + i2 = 0, + d0s0 = t0p2, + d0s1 = t0p1 - s2 * t0p2, + d0s2 = t0p0 - s1 * t0p1; + for (i2 = 0; i2 < s0; ++i2) { + for (i1 = 0; i1 < s1; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + { + var _inline_1_v = Y0, + _inline_1_i; + for ( + _inline_1_i = 0; + _inline_1_i < index.length - 1; + ++_inline_1_i + ) { + _inline_1_v = _inline_1_v[index[_inline_1_i]]; + } + a0[p0] = _inline_1_v[index[index.length - 1]]; + } + p0 += d0s0; + ++index[2]; + } + p0 += d0s1; + index[2] -= s2; + ++index[1]; + } + p0 += d0s2; + index[1] -= s1; + ++index[0]; + } + }; +} -},{"cwise-compiler":83}],303:[function(_dereq_,module,exports){ +//Generates a cwise operator +function generateCWiseOp() { + return CwiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {}; + return function convert_cwise_thunk(array0, scalar1) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type]; + if (!proc) { + CACHED[type] = proc = compile([t0, r0]); + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + scalar1 + ); + }; +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ + funcName: "convert" +}); + +},{}],291:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") -var INSERTION_SORT_THRESHOLD = 32 - function getMallocFree(dtype) { switch(dtype) { - case "uint8": - return [pool.mallocUint8, pool.freeUint8] - case "uint16": - return [pool.mallocUint16, pool.freeUint16] case "uint32": return [pool.mallocUint32, pool.freeUint32] - case "int8": - return [pool.mallocInt8, pool.freeInt8] - case "int16": - return [pool.mallocInt16, pool.freeInt16] - case "int32": - return [pool.mallocInt32, pool.freeInt32] - case "float32": - return [pool.mallocFloat, pool.freeFloat] - case "float64": - return [pool.mallocDouble, pool.freeDouble] default: return null } } -function shapeArgs(dimension) { - var args = [] - for(var i=0; i left) { + dptr = 0 + sptr = cptr - s0 + __l: for (i1 = 0; i1 < n1; ++i1) { + a = data[sptr] + b = scratch[dptr] + if (a < b) { + break __g + } + if (a > b) { + break __l + } + sptr += e1 + dptr += f1 + } + dptr = cptr + sptr = cptr - s0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = data[sptr] + dptr += d1 + sptr += d1 + } + cptr -= s0 + } + dptr = cptr + sptr = 0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = scratch[sptr++] + dptr += d1 + } + } + free(scratch) + } + }, } function createInsertionSort(order, dtype) { - - var code = ["'use strict'"] - var funcName = ["ndarrayInsertionSort", order.join("d"), dtype].join("") - var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) var allocator = getMallocFree(dtype) - - var vars = [ "i,j,cptr,ptr=left*s0+offset" ] - - if(order.length > 1) { - var scratch_shape = [] - for(var i=1; i 1) { - - //Copy data into scratch - code.push("dptr=0;sptr=ptr") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j,"left){", - "dptr=0", - "sptr=cptr-s0") - for(var i=1; ib){break __l}"].join("")) - for(var i=order.length-1; i>=1; --i) { - code.push( - "sptr+=e"+i, - "dptr+=f"+i, - "}") - } - - //Copy data back - code.push("dptr=cptr;sptr=cptr-s0") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j,"=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j,"left)&&("+dataRead("cptr-s0")+">scratch)){", - dataWrite("cptr", dataRead("cptr-s0")), - "cptr-=s0", - "}", - dataWrite("cptr", "scratch")) - } - - //Close outer loop body - code.push("}") - if(order.length > 1 && allocator) { - code.push("free(scratch)") - } - code.push("} return " + funcName) - - //Compile and link function if(allocator) { - var result = new Function("malloc", "free", code.join("\n")) return result(allocator[0], allocator[1]) } else { - var result = new Function(code.join("\n")) return result() } } -function createQuickSort(order, dtype, insertionSort) { - var code = [ "'use strict'" ] - var funcName = ["ndarrayQuickSort", order.join("d"), dtype].join("") - var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) - var allocator = getMallocFree(dtype) - var labelCounter=0 - - code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - - var vars = [ - "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(order.length > 1) { - var ele_size = [] - for(var i=1; i=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j," 1) { - for(var i=0; i> 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, + i1, + b_ptr0, + b_ptr1, + b_ptr2, + b_ptr3, + b_ptr4, + b_ptr5, + b_ptr6, + b_ptr7, + ptr3, + ptr4, + ptr5, + ptr6, + ptr7, + pivot_ptr, + ptr_shift, + elementSize = n1, + pivot1 = malloc(elementSize), + pivot2 = malloc(elementSize) + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + ptr_shift = offset + __l1: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el2 + el2 = tmp0 + break __l1 + } + if (comp < 0) { + break __l1 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l2: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l2 + } + if (comp < 0) { + break __l2 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l3: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el3 + el3 = tmp0 + break __l3 + } + if (comp < 0) { + break __l3 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l4: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l4 + } + if (comp < 0) { + break __l4 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l5: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el4 + el4 = tmp0 + break __l5 + } + if (comp < 0) { + break __l5 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el3 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l6: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el3 + el3 = el4 + el4 = tmp0 + break __l6 + } + if (comp < 0) { + break __l6 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l7: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el5 + el5 = tmp0 + break __l7 + } + if (comp < 0) { + break __l7 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l8: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l8 + } + if (comp < 0) { + break __l8 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l9: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l9 + } + if (comp < 0) { + break __l9 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + b_ptr2 = s0 * el3 + b_ptr3 = s0 * el4 + b_ptr4 = s0 * el5 + b_ptr5 = s0 * index1 + b_ptr6 = s0 * index3 + b_ptr7 = s0 * index5 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + ptr3 = b_ptr3 + ptr_shift + ptr4 = b_ptr4 + ptr_shift + ptr5 = b_ptr5 + ptr_shift + ptr6 = b_ptr6 + ptr_shift + ptr7 = b_ptr7 + ptr_shift + pivot1[pivot_ptr] = data[ptr1] + pivot2[pivot_ptr] = data[ptr3] + pivots_are_equal = pivots_are_equal && pivot1[pivot_ptr] === pivot2[pivot_ptr] + x = data[ptr0] + y = data[ptr2] + z = data[ptr4] + data[ptr5] = x + data[ptr6] = y + data[ptr7] = z + ++pivot_ptr + ptr_shift += d1 + } + b_ptr0 = s0 * index2 + b_ptr1 = s0 * left + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + b_ptr0 = s0 * index4 + b_ptr1 = s0 * right + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + if (pivots_are_equal) { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l10: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l10 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + continue + } + if (comp < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l11: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l11 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + great-- + } else if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + break + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + break + } + } + } + } + } else { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l12: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l12 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l13: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l13 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 > 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l14: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l14 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l15: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l15 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } } - if(ptrs.length>1) { - code.push("ptr_shift+=d"+j) + b_ptr0 = s0 * left + b_ptr1 = s0 * (less - 1) + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + data[ptr1] = pivot1[pivot_ptr] + ++pivot_ptr + ptr_shift += d1 + } + b_ptr0 = s0 * right + b_ptr1 = s0 * (great + 1) + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + data[ptr1] = pivot2[pivot_ptr] + ++pivot_ptr + ptr_shift += d1 + } + if (less - 2 - left <= 32) { + insertionSort(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - code.push("ptr0+=d"+j) + ndarrayQuickSort1d0uint32(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) } - code.push("}") - } - } - - function lexicoLoop(label, ptrs, usePivot, body) { - if(ptrs.length === 1) { - code.push("ptr0="+toPointer(ptrs[0])) - } else { - for(var i=0; i 1) { - for(var i=0; i=1; --i) { - if(usePivot) { - code.push("pivot_ptr+=f"+i) + if (less < index1 && great > index5) { + __l16: while (true) { + ptr0 = offset + less * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot1[pivot_ptr]) { + break __l16 + } + ++pivot_ptr + ptr0 += d1 + } + ++less + } + __l17: while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot2[pivot_ptr]) { + break __l17 + } + ++pivot_ptr + ptr0 += d1 + } + --great + } + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l18: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l18 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 === 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l19: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l19 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 === 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l20: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l20 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l21: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l21 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } } - if(ptrs.length > 1) { - code.push("ptr_shift+=e"+i) + free(pivot1) + free(pivot2) + if (great - less <= 32) { + insertionSort(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - code.push("ptr0+=e"+i) + ndarrayQuickSort1d0uint32(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) } - code.push("}") } - } - - function cleanUp() { - if(order.length > 1 && allocator) { - code.push("free(pivot1)", "free(pivot2)") - } - } - - function compareSwap(a_id, b_id) { - var a = "el"+a_id - var b = "el"+b_id - if(order.length > 1) { - var lbl = "__l" + (++labelCounter) - lexicoLoop(lbl, [a, b], false, [ - "comp=",dataRead("ptr0"),"-",dataRead("ptr1"),"\n", - "if(comp>0){tmp0=", a, ";",a,"=",b,";", b,"=tmp0;break ", lbl,"}\n", - "if(comp<0){break ", lbl, "}" - ].join("")) - } else { - code.push(["if(", dataRead(toPointer(a)), ">", dataRead(toPointer(b)), "){tmp0=", a, ";",a,"=",b,";", b,"=tmp0}"].join("")) - } - } - - compareSwap(1, 2) - compareSwap(4, 5) - compareSwap(1, 3) - compareSwap(2, 3) - compareSwap(1, 4) - compareSwap(3, 4) - compareSwap(2, 5) - compareSwap(2, 3) - compareSwap(4, 5) - - if(order.length > 1) { - cacheLoop(["el1", "el2", "el3", "el4", "el5", "index1", "index3", "index5"], true, [ - "pivot1[pivot_ptr]=",dataRead("ptr1"),"\n", - "pivot2[pivot_ptr]=",dataRead("ptr3"),"\n", - "pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n", - "x=",dataRead("ptr0"),"\n", - "y=",dataRead("ptr2"),"\n", - "z=",dataRead("ptr4"),"\n", - dataWrite("ptr5", "x"),"\n", - dataWrite("ptr6", "y"),"\n", - dataWrite("ptr7", "z") - ].join("")) - } else { - code.push([ - "pivot1=", dataRead(toPointer("el2")), "\n", - "pivot2=", dataRead(toPointer("el4")), "\n", - "pivots_are_equal=pivot1===pivot2\n", - "x=", dataRead(toPointer("el1")), "\n", - "y=", dataRead(toPointer("el3")), "\n", - "z=", dataRead(toPointer("el5")), "\n", - dataWrite(toPointer("index1"), "x"), "\n", - dataWrite(toPointer("index3"), "y"), "\n", - dataWrite(toPointer("index5"), "z") - ].join("")) - } - - - function moveElement(dst, src) { - if(order.length > 1) { - cacheLoop([dst, src], false, - dataWrite("ptr0", dataRead("ptr1")) - ) - } else { - code.push(dataWrite(toPointer(dst), dataRead(toPointer(src)))) - } - } - - moveElement("index2", "left") - moveElement("index4", "right") - - function comparePivot(result, ptr, n) { - if(order.length > 1) { - var lbl = "__l" + (++labelCounter) - lexicoLoop(lbl, [ptr], true, [ - result,"=",dataRead("ptr0"),"-pivot",n,"[pivot_ptr]\n", - "if(",result,"!==0){break ", lbl, "}" - ].join("")) - } else { - code.push([result,"=", dataRead(toPointer(ptr)), "-pivot", n].join("")) - } - } - - function swapElements(a, b) { - if(order.length > 1) { - cacheLoop([a,b],false,[ - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", "tmp") - ].join("")) - } else { - code.push([ - "ptr0=",toPointer(a),"\n", - "ptr1=",toPointer(b),"\n", - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", "tmp") - ].join("")) - } - } - - function tripleSwap(k, less, great) { - if(order.length > 1) { - cacheLoop([k,less,great], false, [ - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", dataRead("ptr2")),"\n", - dataWrite("ptr2", "tmp") - ].join("")) - code.push("++"+less, "--"+great) - } else { - code.push([ - "ptr0=",toPointer(k),"\n", - "ptr1=",toPointer(less),"\n", - "ptr2=",toPointer(great),"\n", - "++",less,"\n", - "--",great,"\n", - "tmp=", dataRead("ptr0"), "\n", - dataWrite("ptr0", dataRead("ptr1")), "\n", - dataWrite("ptr1", dataRead("ptr2")), "\n", - dataWrite("ptr2", "tmp") - ].join("")) - } - } - - function swapAndDecrement(k, great) { - swapElements(k, great) - code.push("--"+great) - } - - code.push("if(pivots_are_equal){") - //Pivots are equal case - code.push("for(k=less;k<=great;++k){") - comparePivot("comp", "k", 1) - code.push("if(comp===0){continue}") - code.push("if(comp<0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - code.push("while(true){") - comparePivot("comp", "great", 1) - code.push("if(comp>0){") - code.push("great--") - code.push("}else if(comp<0){") - tripleSwap("k", "less", "great") - code.push("break") - code.push("}else{") - swapAndDecrement("k", "great") - code.push("break") - code.push("}") - code.push("}") - code.push("}") - code.push("}") - code.push("}else{") - //Pivots not equal case - code.push("for(k=less;k<=great;++k){") - comparePivot("comp_pivot1", "k", 1) - code.push("if(comp_pivot1<0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - comparePivot("comp_pivot2", "k", 2) - code.push("if(comp_pivot2>0){") - code.push("while(true){") - comparePivot("comp", "great", 2) - code.push("if(comp>0){") - code.push("if(--great1) { - cacheLoop([mem_dest, pivot_dest], true, [ - dataWrite("ptr0", dataRead("ptr1")), "\n", - dataWrite("ptr1", ["pivot",pivot,"[pivot_ptr]"].join("")) - ].join("")) - } else { - code.push( - dataWrite(toPointer(mem_dest), dataRead(toPointer(pivot_dest))), - dataWrite(toPointer(pivot_dest), "pivot"+pivot)) - } - } - - storePivot("left", "(less-1)", 1) - storePivot("right", "(great+1)", 2) - - //Recursive sort call - function doSort(left, right) { - code.push([ - "if((",right,"-",left,")<=",INSERTION_SORT_THRESHOLD,"){\n", - "insertionSort(", left, ",", right, ",data,offset,", shapeArgs(order.length).join(","), ")\n", - "}else{\n", - funcName, "(", left, ",", right, ",data,offset,", shapeArgs(order.length).join(","), ")\n", - "}" - ].join("")) - } - doSort("left", "(less-2)") - doSort("(great+2)", "right") - - //If pivots are equal, then early out - code.push("if(pivots_are_equal){") - cleanUp() - code.push("return") - code.push("}") - - function walkPointer(ptr, pivot, body) { - if(order.length > 1) { - code.push(["__l",++labelCounter,":while(true){"].join("")) - cacheLoop([ptr], true, [ - "if(", dataRead("ptr0"), "!==pivot", pivot, "[pivot_ptr]){break __l", labelCounter, "}" - ].join("")) - code.push(body, "}") - } else { - code.push(["while(", dataRead(toPointer(ptr)), "===pivot", pivot, "){", body, "}"].join("")) - } - } - - //Check bounds - code.push("if(lessindex5){") - - walkPointer("less", 1, "++less") - walkPointer("great", 2, "--great") - - code.push("for(k=less;k<=great;++k){") - comparePivot("comp_pivot1", "k", 1) - code.push("if(comp_pivot1===0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - comparePivot("comp_pivot2", "k", 2) - code.push("if(comp_pivot2===0){") - code.push("while(true){") - comparePivot("comp", "great", 2) - code.push("if(comp===0){") - code.push("if(--great 1 && allocator) { - var compiled = new Function("insertionSort", "malloc", "free", code.join("\n")) - return compiled(insertionSort, allocator[0], allocator[1]) - } - var compiled = new Function("insertionSort", code.join("\n")) - return compiled(insertionSort) + }, } -function compileSort(order, dtype) { - var code = ["'use strict'"] - var funcName = ["ndarraySortWrapper", order.join("d"), dtype].join("") - var funcArgs = [ "array" ] - - code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - - //Unpack local variables from array - var vars = ["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"] - for(var i=0; i 0) { - vars.push(["d",j,"=s",j,"-d",p,"*n",p].join("")) - } else { - vars.push(["d",j,"=s",j].join("")) - } - p = j - } - var k = order.length-1-i - if(k !== 0) { - if(q > 0) { - vars.push(["e",k,"=s",k,"-e",q,"*n",q, - ",f",k,"=",scratch_stride[k],"-f",q,"*n",q].join("")) +function createQuickSort(order, dtype, insertionSort) { + var allocator = getMallocFree(dtype) + var key = [dtype, order].join(',') + var result = CACHED_quickSort[key] + + if(order.length > 1 && allocator) { + return result(insertionSort, allocator[0], allocator[1]) + } else { + return result(insertionSort) + } +} + +var CACHED_sort = { + "uint32,1,0": function (insertionSort, quickSort) { + return function (array) { + var data = array.data, + offset = array.offset | 0, + shape = array.shape, + stride = array.stride, + s0 = stride[0] | 0, + n0 = shape[0] | 0, + s1 = stride[1] | 0, + n1 = shape[1] | 0, + d1 = s1, + e1 = s1, + f1 = 1 + if (n0 <= 32) { + insertionSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - vars.push(["e",k,"=s",k,",f",k,"=",scratch_stride[k]].join("")) + quickSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) } - q = k } - } - - //Declare local variables - code.push("var " + vars.join(",")) - - //Create arguments for subroutine - var sortArgs = ["0", "n0-1", "data", "offset"].concat(shapeArgs(order.length)) - - //Call main sorting routine - code.push([ - "if(n0<=",INSERTION_SORT_THRESHOLD,"){", - "insertionSort(", sortArgs.join(","), ")}else{", - "quickSort(", sortArgs.join(","), - ")}" - ].join("")) - - //Return - code.push("}return " + funcName) - - //Link everything together - var result = new Function("insertionSort", "quickSort", code.join("\n")) + }, +} + +function compileSort(order, dtype) { + var key = [dtype, order].join(',') + var result = CACHED_sort[key] + var insertionSort = createInsertionSort(order, dtype) var quickSort = createQuickSort(order, dtype, insertionSort) return result(insertionSort, quickSort) } module.exports = compileSort -},{"typedarray-pool":372}],304:[function(_dereq_,module,exports){ +},{"typedarray-pool":355}],292:[function(_dereq_,module,exports){ "use strict" var compile = _dereq_("./lib/compile_sort.js") @@ -41336,8 +40669,7 @@ function sort(array) { } module.exports = sort -},{"./lib/compile_sort.js":303}],305:[function(_dereq_,module,exports){ -var iota = _dereq_("iota-array") +},{"./lib/compile_sort.js":291}],293:[function(_dereq_,module,exports){ var isBuffer = _dereq_("is-buffer") var hasTypedArrays = ((typeof Float64Array) !== "undefined") @@ -41361,234 +40693,883 @@ function order() { return result } -function compileConstructor(dtype, dimension) { - var className = ["View", dimension, "d", dtype].join("") - if(dimension < 0) { - className = "View_Nil" + dtype - } - var useGetters = (dtype === "generic") - - if(dimension === -1) { - //Special case for trivial arrays - var code = - "function "+className+"(a){this.data=a;};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"(this.data);};\ -proto.get=proto.set=function(){};\ -proto.pick=function(){return null};\ -return function construct_"+className+"(a){return new "+className+"(a);}" - var procedure = new Function(code) - return procedure() - } else if(dimension === 0) { - //Special case for 0d arrays - var code = - "function "+className+"(a,d) {\ -this.data = a;\ -this.offset = d\ -};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"_copy() {\ -return new "+className+"(this.data,this.offset)\ -};\ -proto.pick=function "+className+"_pick(){\ -return TrivialArray(this.data);\ -};\ -proto.valueOf=proto.get=function "+className+"_get(){\ -return "+(useGetters ? "this.data.get(this.offset)" : "this.data[this.offset]")+ -"};\ -proto.set=function "+className+"_set(v){\ -return "+(useGetters ? "this.data.set(this.offset,v)" : "this.data[this.offset]=v")+"\ -};\ -return function construct_"+className+"(a,b,c,d){return new "+className+"(a,d)}" - var procedure = new Function("TrivialArray", code) - return procedure(CACHED_CONSTRUCTORS[dtype][0]) - } - - var code = ["'use strict'"] - - //Create constructor for view - var indices = iota(dimension) - var args = indices.map(function(i) { return "i"+i }) - var index_str = "this.offset+" + indices.map(function(i) { - return "this.stride[" + i + "]*i" + i - }).join("+") - var shapeArg = indices.map(function(i) { - return "b"+i - }).join(",") - var strideArg = indices.map(function(i) { - return "c"+i - }).join(",") - code.push( - "function "+className+"(a," + shapeArg + "," + strideArg + ",d){this.data=a", - "this.shape=[" + shapeArg + "]", - "this.stride=[" + strideArg + "]", - "this.offset=d|0}", - "var proto="+className+".prototype", - "proto.dtype='"+dtype+"'", - "proto.dimension="+dimension) - - //view.size: - code.push("Object.defineProperty(proto,'size',{get:function "+className+"_size(){\ -return "+indices.map(function(i) { return "this.shape["+i+"]" }).join("*"), -"}})") - - //view.order: - if(dimension === 1) { - code.push("proto.order=[0]") - } else { - code.push("Object.defineProperty(proto,'order',{get:") - if(dimension < 4) { - code.push("function "+className+"_order(){") - if(dimension === 2) { - code.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})") - } else if(dimension === 3) { - code.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];\ -}}})") - } - } else { - code.push("ORDER})") +var allFns = { + // Special case for trivial arrays + T: function (dtype) { + function View(a) { + this.data = a } - } + var proto = View.prototype + proto.dtype = dtype + 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 View(this.data) + } + proto.get = proto.set = function () {} + proto.pick = function () { + return null + } + return function construct(a) { + return new View(a) + } + }, - //view.set(i0, ..., v): - code.push( -"proto.set=function "+className+"_set("+args.join(",")+",v){") - if(useGetters) { - code.push("return this.data.set("+index_str+",v)}") - } else { - code.push("return this.data["+index_str+"]=v}") - } + // Special case for 0d arrays + 0: function (dtype, TrivialArray) { + function View(a, d) { + this.data = a + this.offset = d + } + var proto = View.prototype + proto.dtype = dtype + 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 copy() { + return new View(this.data, this.offset) + } + proto.pick = function pick() { + return TrivialArray(this.data) + } + proto.valueOf = proto.get = function get() { + return dtype === "generic" ? this.data.get(this.offset) : this.data[this.offset] + } + proto.set = function set(v) { + return dtype === "generic" ? this.data.set(this.offset, v) : (this.data[this.offset] = v) + } + return function construct(a, b, c, d) { + return new View(a, d) + } + }, - //view.get(i0, ...): - code.push("proto.get=function "+className+"_get("+args.join(",")+"){") - if(useGetters) { - code.push("return this.data.get("+index_str+")}") - } else { - code.push("return this.data["+index_str+"]}") - } - - //view.index: - code.push( - "proto.index=function "+className+"_index(", args.join(), "){return "+index_str+"}") - - //view.hi(): - code.push("proto.hi=function "+className+"_hi("+args.join(",")+"){return new "+className+"(this.data,"+ - indices.map(function(i) { - return ["(typeof i",i,"!=='number'||i",i,"<0)?this.shape[", i, "]:i", i,"|0"].join("") - }).join(",")+","+ - indices.map(function(i) { - return "this.stride["+i + "]" - }).join(",")+",this.offset)}") - - //view.lo(): - var a_vars = indices.map(function(i) { return "a"+i+"=this.shape["+i+"]" }) - var c_vars = indices.map(function(i) { return "c"+i+"=this.stride["+i+"]" }) - code.push("proto.lo=function "+className+"_lo("+args.join(",")+"){var b=this.offset,d=0,"+a_vars.join(",")+","+c_vars.join(",")) - for(var i=0; i=0){\ -d=i"+i+"|0;\ -b+=c"+i+"*d;\ -a"+i+"-=d}") - } - code.push("return new "+className+"(this.data,"+ - indices.map(function(i) { - return "a"+i - }).join(",")+","+ - indices.map(function(i) { - return "c"+i - }).join(",")+",b)}") - - //view.step(): - code.push("proto.step=function "+className+"_step("+args.join(",")+"){var "+ - indices.map(function(i) { - return "a"+i+"=this.shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "b"+i+"=this.stride["+i+"]" - }).join(",")+",c=this.offset,d=0,ceil=Math.ceil") - for(var i=0; i= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + return new View(this.data, a0, c0, b) + } + proto.step = function step(i0) { + var a0 = this.shape[0], + b0 = this.stride[0], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + return new View(this.data, a0, b0, c) + } + proto.transpose = function transpose(i0) { + i0 = i0 === undefined ? 0 : i0 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], b[i0], this.offset) + } + proto.pick = function pick(i0) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], stride[0], offset) + } + }, + 2: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, c0, c1, d) { + this.data = a + this.shape = [b0, b1] + this.stride = [c0, c1] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 2 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + return Math.abs(this.stride[0]) > Math.abs(this.stride[1]) ? [1, 0] : [0, 1] + }, + }) + proto.set = function set(i0, i1, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] = v) + } + proto.get = function get(i0, i1) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] + } + proto.index = function index(i0, i1) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + } + proto.hi = function hi(i0, i1) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + this.stride[0], + this.stride[1], + this.offset + ) + } + proto.lo = function lo(i0, i1) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + c0 = this.stride[0], + c1 = this.stride[1] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + return new View(this.data, a0, a1, c0, c1, b) + } + proto.step = function step(i0, i1) { + var a0 = this.shape[0], + a1 = this.shape[1], + b0 = this.stride[0], + b1 = this.stride[1], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + return new View(this.data, a0, a1, b0, b1, c) + } + proto.transpose = function transpose(i0, i1) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], b[i0], b[i1], this.offset) + } + proto.pick = function pick(i0, i1) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], stride[0], stride[1], offset) + } + }, + 3: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, c0, c1, c2, d) { + this.data = a + this.shape = [b0, b1, b2] + this.stride = [c0, c1, c2] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 3 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + 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] + } + }, + }) + proto.set = function set(i0, i1, i2, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] = v) + } + proto.get = function get(i0, i1, i2) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] + } + proto.index = function index(i0, i1, i2) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + } + proto.hi = function hi(i0, i1, i2) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + return new View(this.data, a0, a1, a2, c0, c1, c2, b) + } + proto.step = function step(i0, i1, i2) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + return new View(this.data, a0, a1, a2, b0, b1, b2, c) + } + proto.transpose = function transpose(i0, i1, i2) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], b[i0], b[i1], b[i2], this.offset) + } + proto.pick = function pick(i0, i1, i2) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], stride[0], stride[1], stride[2], offset) + } + }, + 4: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, c0, c1, c2, c3, d) { + this.data = a + this.shape = [b0, b1, b2, b3] + this.stride = [c0, c1, c2, c3] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 4 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] = v) + } + proto.get = function get(i0, i1, i2, i3) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] + } + proto.index = function index(i0, i1, i2, i3) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3 + } + proto.hi = function hi(i0, i1, i2, i3) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + return new View(this.data, a0, a1, a2, a3, c0, c1, c2, c3, b) + } + proto.step = function step(i0, i1, i2, i3) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + return new View(this.data, a0, a1, a2, a3, b0, b1, b2, b3, c) + } + proto.transpose = function transpose(i0, i1, i2, i3) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], b[i0], b[i1], b[i2], b[i3], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], shape[3], stride[0], stride[1], stride[2], stride[3], offset) + } + }, + 5: function anonymous(dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, b4, c0, c1, c2, c3, c4, d) { + this.data = a + this.shape = [b0, b1, b2, b3, b4] + this.stride = [c0, c1, c2, c3, c4] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 5 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] * this.shape[4] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, i4, v) { + return dtype === "generic" + ? this.data.set( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4, + v + ) + : (this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] = v) + } + proto.get = function get(i0, i1, i2, i3, i4) { + return dtype === "generic" + ? this.data.get( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + : this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] + } + proto.index = function index(i0, i1, i2, i3, i4) { + return ( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + } + proto.hi = function hi(i0, i1, i2, i3, i4) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + typeof i4 !== "number" || i4 < 0 ? this.shape[4] : i4 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.stride[4], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3, i4) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3], + c4 = this.stride[4] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + if (typeof i4 === "number" && i4 >= 0) { + d = i4 | 0 + b += c4 * d + a4 -= d + } + return new View(this.data, a0, a1, a2, a3, a4, c0, c1, c2, c3, c4, b) + } + proto.step = function step(i0, i1, i2, i3, i4) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + b4 = this.stride[4], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + if (typeof i4 === "number") { + d = i4 | 0 + if (d < 0) { + c += b4 * (a4 - 1) + a4 = ceil(-a4 / d) + } else { + a4 = ceil(a4 / d) + } + b4 *= d + } + return new View(this.data, a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, c) + } + proto.transpose = function transpose(i0, i1, i2, i3, i4) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + i4 = i4 === undefined ? 4 : i4 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], a[i4], b[i0], b[i1], b[i2], b[i3], b[i4], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3, i4) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + if (typeof i4 === "number" && i4 >= 0) { + c = (c + this.stride[4] * i4) | 0 + } else { + a.push(this.shape[4]) + b.push(this.stride[4]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View( + data, + shape[0], + shape[1], + shape[2], + shape[3], + shape[4], + stride[0], + stride[1], + stride[2], + stride[3], + stride[4], + offset + ) + } + }, +} - //view.pick(): - code.push("proto.pick=function "+className+"_pick("+args+"){var a=[],b=[],c=this.offset") - for(var i=0; i=0){c=(c+this.stride["+i+"]*i"+i+")|0}else{a.push(this.shape["+i+"]);b.push(this.stride["+i+"])}") - } - code.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}") - //Add return statement - code.push("return function construct_"+className+"(data,shape,stride,offset){return new "+className+"(data,"+ - indices.map(function(i) { - return "shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "stride["+i+"]" - }).join(",")+",offset)}") +function compileConstructor(inType, inDimension) { + var dKey = inDimension === -1 ? 'T' : String(inDimension) - //Compile procedure - var procedure = new Function("CTOR_LIST", "ORDER", code.join("\n")) - return procedure(CACHED_CONSTRUCTORS[dtype], order) + var procedure = allFns[dKey] + if(inDimension === -1) { + return procedure(inType) + } else if(inDimension === 0) { + return procedure(inType, CACHED_CONSTRUCTORS[inType][0]) + } + return procedure(inType, CACHED_CONSTRUCTORS[inType], order) } function arrayDType(data) { @@ -41607,14 +41588,14 @@ function arrayDType(data) { return "int16" case "[object Int32Array]": return "int32" + case "[object Uint8ClampedArray]": + return "uint8_clamped" case "[object Uint8Array]": return "uint8" case "[object Uint16Array]": return "uint16" case "[object Uint32Array]": return "uint32" - case "[object Uint8ClampedArray]": - return "uint8_clamped" case "[object BigInt64Array]": return "bigint64" case "[object BigUint64Array]": @@ -41628,20 +41609,22 @@ function arrayDType(data) { } var CACHED_CONSTRUCTORS = { + "generic":[], + "buffer":[], + "array":[], + + // typed arrays "float32":[], "float64":[], "int8":[], "int16":[], "int32":[], + "uint8_clamped":[], "uint8":[], "uint16":[], "uint32":[], - "array":[], - "uint8_clamped":[], "bigint64": [], - "biguint64": [], - "buffer":[], - "generic":[] + "biguint64": [] } ;(function() { @@ -41676,10 +41659,10 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { } } } - var dtype = arrayDType(data) - var ctor_list = CACHED_CONSTRUCTORS[dtype] + var inType = arrayDType(data) + var ctor_list = CACHED_CONSTRUCTORS[inType] while(ctor_list.length <= d+1) { - ctor_list.push(compileConstructor(dtype, ctor_list.length-1)) + ctor_list.push(compileConstructor(inType, ctor_list.length-1)) } var ctor = ctor_list[d+1] return ctor(data, shape, stride, offset) @@ -41687,7 +41670,7 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { module.exports = wrappedNDArrayCtor -},{"iota-array":278,"is-buffer":280}],306:[function(_dereq_,module,exports){ +},{"is-buffer":269}],294:[function(_dereq_,module,exports){ "use strict" var doubleBits = _dereq_("double-bits") @@ -41730,7 +41713,7 @@ function nextafter(x, y) { } return doubleBits.pack(lo, hi) } -},{"double-bits":92}],307:[function(_dereq_,module,exports){ +},{"double-bits":89}],295:[function(_dereq_,module,exports){ var DEFAULT_NORMALS_EPSILON = 1e-6; var DEFAULT_FACE_EPSILON = 1e-6; @@ -41855,7 +41838,7 @@ exports.faceNormals = function(faces, positions, specifiedEpsilon) { -},{}],308:[function(_dereq_,module,exports){ +},{}],296:[function(_dereq_,module,exports){ /* object-assign (c) Sindre Sorhus @@ -41947,7 +41930,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],309:[function(_dereq_,module,exports){ +},{}],297:[function(_dereq_,module,exports){ 'use strict' module.exports = quatFromFrame @@ -41989,7 +41972,7 @@ function quatFromFrame( } return out } -},{}],310:[function(_dereq_,module,exports){ +},{}],298:[function(_dereq_,module,exports){ 'use strict' module.exports = createOrbitController @@ -42383,7 +42366,7 @@ function createOrbitController(options) { return result } -},{"./lib/quatFromFrame":309,"filtered-vector":98,"gl-mat4/fromQuat":131,"gl-mat4/invert":142,"gl-mat4/lookAt":143}],311:[function(_dereq_,module,exports){ +},{"./lib/quatFromFrame":297,"filtered-vector":95,"gl-mat4/fromQuat":125,"gl-mat4/invert":136,"gl-mat4/lookAt":137}],299:[function(_dereq_,module,exports){ /*! * pad-left * @@ -42399,7 +42382,7 @@ module.exports = function padLeft(str, num, ch) { ch = typeof ch !== 'undefined' ? (ch + '') : ' '; return repeat(ch, num) + str; }; -},{"repeat-string":337}],312:[function(_dereq_,module,exports){ +},{"repeat-string":322}],300:[function(_dereq_,module,exports){ module.exports = parse @@ -42458,7 +42441,7 @@ function parseValues(args) { return numbers ? numbers.map(Number) : [] } -},{}],313:[function(_dereq_,module,exports){ +},{}],301:[function(_dereq_,module,exports){ module.exports = function parseUnit(str, out) { if (!out) out = [ 0, '' ] @@ -42469,146 +42452,7 @@ module.exports = function parseUnit(str, out) { out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' return out } -},{}],314:[function(_dereq_,module,exports){ -"use strict" - -module.exports = permutationSign - -var BRUTE_FORCE_CUTOFF = 32 - -var pool = _dereq_("typedarray-pool") - -function permutationSign(p) { - var n = p.length - if(n < BRUTE_FORCE_CUTOFF) { - //Use quadratic algorithm for small n - var sgn = 1 - for(var i=0; i0; --i) { - t = pinv[i] - s = p[i] - p[i] = p[t] - p[t] = s - pinv[i] = pinv[s] - pinv[s] = t - r = (r + s) * i - } - pool.freeUint32(pinv) - pool.freeUint32(p) - return r -} - -function unrank(n, r, p) { - switch(n) { - case 0: - if(p) { return p } - return [] - case 1: - if(p) { - p[0] = 0 - return p - } else { - return [0] - } - case 2: - if(p) { - if(r) { - p[0] = 0 - p[1] = 1 - } else { - p[0] = 1 - p[1] = 0 - } - return p - } else { - return r ? [0,1] : [1,0] - } - default: - break - } - p = p || new Array(n) - var s, t, i, nf=1 - p[0] = 0 - for(i=1; i0; --i) { - s = (r / nf)|0 - r = (r - s * nf)|0 - nf = (nf / i)|0 - t = p[i]|0 - p[i] = p[s]|0 - p[s] = t|0 - } - return p -} - -exports.rank = rank -exports.unrank = unrank - -},{"invert-permutation":277,"typedarray-pool":372}],316:[function(_dereq_,module,exports){ +},{}],302:[function(_dereq_,module,exports){ "use strict" module.exports = planarDual @@ -42739,7 +42583,7 @@ function planarDual(cells, positions) { //Combine paths and loops together return cycles } -},{"compare-angle":75}],317:[function(_dereq_,module,exports){ +},{"compare-angle":75}],303:[function(_dereq_,module,exports){ 'use strict' module.exports = trimLeaves @@ -42795,7 +42639,7 @@ function trimLeaves(edges, positions) { return [ nedges, npositions ] } -},{"edges-to-adjacency-list":95}],318:[function(_dereq_,module,exports){ +},{"edges-to-adjacency-list":92}],304:[function(_dereq_,module,exports){ 'use strict' module.exports = planarGraphToPolyline @@ -43000,9 +42844,7 @@ function planarGraphToPolyline(edges, positions) { return result } -},{"./lib/trim-leaves":317,"edges-to-adjacency-list":95,"planar-dual":316,"point-in-big-polygon":320,"robust-sum":349,"two-product":370,"uniq":374}],319:[function(_dereq_,module,exports){ -arguments[4][99][0].apply(exports,arguments) -},{"dup":99}],320:[function(_dereq_,module,exports){ +},{"./lib/trim-leaves":303,"edges-to-adjacency-list":92,"planar-dual":302,"point-in-big-polygon":305,"robust-sum":334,"two-product":353,"uniq":357}],305:[function(_dereq_,module,exports){ module.exports = preprocessPolygon var orient = _dereq_('robust-orientation')[3] @@ -43154,7 +42996,7 @@ function preprocessPolygon(loops) { testSlab) } } -},{"binary-search-bounds":319,"interval-tree-1d":275,"robust-orientation":344,"slab-decomposition":361}],321:[function(_dereq_,module,exports){ +},{"binary-search-bounds":42,"interval-tree-1d":267,"robust-orientation":329,"slab-decomposition":345}],306:[function(_dereq_,module,exports){ /* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT @@ -43282,7 +43124,7 @@ if (typeof window === 'object') module.exports = PolyBool; -},{"./lib/build-log":322,"./lib/epsilon":323,"./lib/geojson":324,"./lib/intersecter":325,"./lib/segment-chainer":327,"./lib/segment-selector":328}],322:[function(_dereq_,module,exports){ +},{"./lib/build-log":307,"./lib/epsilon":308,"./lib/geojson":309,"./lib/intersecter":310,"./lib/segment-chainer":312,"./lib/segment-selector":313}],307:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -43397,7 +43239,7 @@ function BuildLog(){ module.exports = BuildLog; -},{}],323:[function(_dereq_,module,exports){ +},{}],308:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -43569,7 +43411,7 @@ function Epsilon(eps){ module.exports = Epsilon; -},{}],324:[function(_dereq_,module,exports){ +},{}],309:[function(_dereq_,module,exports){ // (c) Copyright 2017, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -43759,7 +43601,7 @@ var GeoJSON = { module.exports = GeoJSON; -},{}],325:[function(_dereq_,module,exports){ +},{}],310:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -44266,7 +44108,7 @@ function Intersecter(selfIntersection, eps, buildLog){ module.exports = Intersecter; -},{"./linked-list":326}],326:[function(_dereq_,module,exports){ +},{"./linked-list":311}],311:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -44349,7 +44191,7 @@ var LinkedList = { module.exports = LinkedList; -},{}],327:[function(_dereq_,module,exports){ +},{}],312:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -44603,7 +44445,7 @@ function SegmentChainer(segments, eps, buildLog){ module.exports = SegmentChainer; -},{}],328:[function(_dereq_,module,exports){ +},{}],313:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -44771,7 +44613,7 @@ var SegmentSelector = { module.exports = SegmentSelector; -},{}],329:[function(_dereq_,module,exports){ +},{}],314:[function(_dereq_,module,exports){ //Optimized version for triangle closest point // Based on Eberly's WildMagick codes // http://www.geometrictools.com/LibMathematics/Distance/Distance.html @@ -44969,7 +44811,7 @@ function closestPoint2d(V0, V1, V2, point, result) { module.exports = closestPoint2d; -},{}],330:[function(_dereq_,module,exports){ +},{}],315:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -45155,9 +44997,9 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],331:[function(_dereq_,module,exports){ +},{}],316:[function(_dereq_,module,exports){ module.exports = _dereq_('gl-quat/slerp') -},{"gl-quat/slerp":163}],332:[function(_dereq_,module,exports){ +},{"gl-quat/slerp":156}],317:[function(_dereq_,module,exports){ 'use strict' var bnadd = _dereq_('big-rat/add') @@ -45173,7 +45015,7 @@ function add (a, b) { return r } -},{"big-rat/add":26}],333:[function(_dereq_,module,exports){ +},{"big-rat/add":26}],318:[function(_dereq_,module,exports){ 'use strict' module.exports = float2rat @@ -45188,7 +45030,7 @@ function float2rat(v) { return result } -},{"big-rat":29}],334:[function(_dereq_,module,exports){ +},{"big-rat":29}],319:[function(_dereq_,module,exports){ 'use strict' var rat = _dereq_('big-rat') @@ -45206,7 +45048,7 @@ function muls(a, x) { return r } -},{"big-rat":29,"big-rat/mul":38}],335:[function(_dereq_,module,exports){ +},{"big-rat":29,"big-rat/mul":38}],320:[function(_dereq_,module,exports){ 'use strict' var bnsub = _dereq_('big-rat/sub') @@ -45222,7 +45064,7 @@ function sub(a, b) { return r } -},{"big-rat/sub":40}],336:[function(_dereq_,module,exports){ +},{"big-rat/sub":40}],321:[function(_dereq_,module,exports){ 'use strict' var compareCell = _dereq_('compare-cell') @@ -45255,7 +45097,7 @@ function reduceCellComplex(cells) { return cells } -},{"cell-orientation":61,"compare-cell":76,"compare-oriented-cell":77}],337:[function(_dereq_,module,exports){ +},{"cell-orientation":61,"compare-cell":76,"compare-oriented-cell":77}],322:[function(_dereq_,module,exports){ /*! * repeat-string * @@ -45327,7 +45169,7 @@ function repeat(str, num) { return res; } -},{}],338:[function(_dereq_,module,exports){ +},{}],323:[function(_dereq_,module,exports){ (function (global){(function (){ module.exports = global.performance && @@ -45338,7 +45180,7 @@ module.exports = } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],339:[function(_dereq_,module,exports){ +},{}],324:[function(_dereq_,module,exports){ "use strict" module.exports = compressExpansion @@ -45373,7 +45215,7 @@ function compressExpansion(e) { e.length = top return e } -},{}],340:[function(_dereq_,module,exports){ +},{}],325:[function(_dereq_,module,exports){ "use strict" var twoProduct = _dereq_("two-product") @@ -45383,67 +45225,37 @@ var compress = _dereq_("robust-compress") var NUM_EXPANDED = 6 -function cofactor(m, c) { - var result = new Array(m.length-1) - for(var i=1; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function determinant(m) { - if(m.length === 2) { - return ["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("") - } else { - var expr = [] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function makeProduct(a, b) { - if(a.charAt(0) === "m") { - if(b.charAt(0) === "w") { - var toks = a.split("[") - return ["w", b.substr(1), "m", toks[0].substr(1)].join("") - } else { - return ["prod(", a, ",", b, ")"].join("") - } - } else { - return makeProduct(b, a) - } -} - -function sign(s) { - if(s & 1 !== 0) { - return "-" - } - return "" -} - -function determinant(m) { - if(m.length === 2) { - return [["diff(", makeProduct(m[0][0], m[1][1]), ",", makeProduct(m[1][0], m[0][1]), ")"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { - code.push(",") - } - code.push("[") - for(var k=0; k 0) { - code.push(",") - } - if(k === i) { - code.push("+b[", j, "]") - } else { - code.push("+A[", j, "][", k, "]") - } - } - code.push("]") - } - code.push("]),") - } - code.push("det(A)]}return ", funcName) - var proc = new Function("det", code.join("")) + var fn = + n === 2 ? solve2d : + n === 3 ? solve3d : + n === 4 ? solve4d : + n === 5 ? solve5d : solve6d + if(n < 6) { - return proc(determinant[n]) + return fn(determinant[n]) } - return proc(determinant) + return fn(determinant) } function robustLinearSolve0d() { - return [ 0 ] + return [ [ 0 ] ] } function robustLinearSolve1d(A, b) { return [ [ b[0] ], [ A[0][0] ] ] } +function solve2d(det) { + return function robustLinearSolve2d(A, b) { + return [det([[+b[0], +A[0][1]], [+b[1], +A[1][1]]]), det([[+A[0][0], +b[0]], [+A[1][0], +b[1]]]), det(A)] + } +} + +function solve3d(det) { + return function robustLinearSolve3d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2]], [+b[1], +A[1][1], +A[1][2]], [+b[2], +A[2][1], +A[2][2]]]), det([[+A[0][0], +b[0], +A[0][2]], [+A[1][0], +b[1], +A[1][2]], [+A[2][0], +b[2], +A[2][2]]]), det([[+A[0][0], +A[0][1], +b[0]], [+A[1][0], +A[1][1], +b[1]], [+A[2][0], +A[2][1], +b[2]]]), det(A)] + } +} + +function solve4d(det) { + return function robustLinearSolve4d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3]], [+b[1], +A[1][1], +A[1][2], +A[1][3]], [+b[2], +A[2][1], +A[2][2], +A[2][3]], [+b[3], +A[3][1], +A[3][2], +A[3][3]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3]], [+A[1][0], +b[1], +A[1][2], +A[1][3]], [+A[2][0], +b[2], +A[2][2], +A[2][3]], [+A[3][0], +b[3], +A[3][2], +A[3][3]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3]], [+A[1][0], +A[1][1], +b[1], +A[1][3]], [+A[2][0], +A[2][1], +b[2], +A[2][3]], [+A[3][0], +A[3][1], +b[3], +A[3][3]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +b[3]]]), det(A)] + } +} + +function solve5d(det) { + return function robustLinearSolve5d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3], +A[0][4]], [+b[1], +A[1][1], +A[1][2], +A[1][3], +A[1][4]], [+b[2], +A[2][1], +A[2][2], +A[2][3], +A[2][4]], [+b[3], +A[3][1], +A[3][2], +A[3][3], +A[3][4]], [+b[4], +A[4][1], +A[4][2], +A[4][3], +A[4][4]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3], +A[0][4]], [+A[1][0], +b[1], +A[1][2], +A[1][3], +A[1][4]], [+A[2][0], +b[2], +A[2][2], +A[2][3], +A[2][4]], [+A[3][0], +b[3], +A[3][2], +A[3][3], +A[3][4]], [+A[4][0], +b[4], +A[4][2], +A[4][3], +A[4][4]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3], +A[0][4]], [+A[1][0], +A[1][1], +b[1], +A[1][3], +A[1][4]], [+A[2][0], +A[2][1], +b[2], +A[2][3], +A[2][4]], [+A[3][0], +A[3][1], +b[3], +A[3][3], +A[3][4]], [+A[4][0], +A[4][1], +b[4], +A[4][3], +A[4][4]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0], +A[0][4]], [+A[1][0], +A[1][1], +A[1][2], +b[1], +A[1][4]], [+A[2][0], +A[2][1], +A[2][2], +b[2], +A[2][4]], [+A[3][0], +A[3][1], +A[3][2], +b[3], +A[3][4]], [+A[4][0], +A[4][1], +A[4][2], +b[4], +A[4][4]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +b[3]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +b[4]]]), det(A)] + } +} + +function solve6d(det) { + return function robustLinearSolve6d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3], +A[0][4], +A[0][5]], [+b[1], +A[1][1], +A[1][2], +A[1][3], +A[1][4], +A[1][5]], [+b[2], +A[2][1], +A[2][2], +A[2][3], +A[2][4], +A[2][5]], [+b[3], +A[3][1], +A[3][2], +A[3][3], +A[3][4], +A[3][5]], [+b[4], +A[4][1], +A[4][2], +A[4][3], +A[4][4], +A[4][5]], [+b[5], +A[5][1], +A[5][2], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3], +A[0][4], +A[0][5]], [+A[1][0], +b[1], +A[1][2], +A[1][3], +A[1][4], +A[1][5]], [+A[2][0], +b[2], +A[2][2], +A[2][3], +A[2][4], +A[2][5]], [+A[3][0], +b[3], +A[3][2], +A[3][3], +A[3][4], +A[3][5]], [+A[4][0], +b[4], +A[4][2], +A[4][3], +A[4][4], +A[4][5]], [+A[5][0], +b[5], +A[5][2], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3], +A[0][4], +A[0][5]], [+A[1][0], +A[1][1], +b[1], +A[1][3], +A[1][4], +A[1][5]], [+A[2][0], +A[2][1], +b[2], +A[2][3], +A[2][4], +A[2][5]], [+A[3][0], +A[3][1], +b[3], +A[3][3], +A[3][4], +A[3][5]], [+A[4][0], +A[4][1], +b[4], +A[4][3], +A[4][4], +A[4][5]], [+A[5][0], +A[5][1], +b[5], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0], +A[0][4], +A[0][5]], [+A[1][0], +A[1][1], +A[1][2], +b[1], +A[1][4], +A[1][5]], [+A[2][0], +A[2][1], +A[2][2], +b[2], +A[2][4], +A[2][5]], [+A[3][0], +A[3][1], +A[3][2], +b[3], +A[3][4], +A[3][5]], [+A[4][0], +A[4][1], +A[4][2], +b[4], +A[4][4], +A[4][5]], [+A[5][0], +A[5][1], +A[5][2], +b[5], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +b[0], +A[0][5]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +b[1], +A[1][5]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +b[2], +A[2][5]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +b[3], +A[3][5]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +b[4], +A[4][5]], [+A[5][0], +A[5][1], +A[5][2], +A[5][3], +b[5], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +A[0][4], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +A[1][4], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +A[2][4], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +A[3][4], +b[3]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +A[4][4], +b[4]], [+A[5][0], +A[5][1], +A[5][2], +A[5][3], +A[5][4], +b[5]]]), det(A)] + } +} + var CACHE = [ robustLinearSolve0d, robustLinearSolve1d ] +function proc(s0, s1, s2, s3, s4, s5, CACHE, g) { + return function dispatchLinearSolve(A, b) { + switch (A.length) { + case 0: return s0(A, b); + case 1: return s1(A, b); + case 2: return s2(A, b); + case 3: return s3(A, b); + case 4: return s4(A, b); + case 5: return s5(A, b); + } + var s = CACHE[A.length]; + if (!s) s = CACHE[A.length] = g(A.length); + return s(A, b) + } +} + function generateDispatch() { while(CACHE.length < NUM_EXPAND) { CACHE.push(generateSolver(CACHE.length)) } - var procArgs = [] - var code = ["function dispatchLinearSolve(A,b){switch(A.length){"] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function determinant(m) { - if(m.length === 2) { - return [["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { return 1 } return 0.0 } -},{}],351:[function(_dereq_,module,exports){ +},{}],336:[function(_dereq_,module,exports){ 'use strict' module.exports = boundary @@ -46386,7 +46226,7 @@ function boundary(cells) { return reduce(bnd(cells)) } -},{"boundary-cells":45,"reduce-simplicial-complex":336}],352:[function(_dereq_,module,exports){ +},{"boundary-cells":45,"reduce-simplicial-complex":321}],337:[function(_dereq_,module,exports){ 'use strict' module.exports = extractContour @@ -46549,104 +46389,308 @@ function extractContour(cells, values, level, d) { vertexWeights: uweights } } -},{"./lib/codegen":353,"ndarray":305,"ndarray-sort":304,"typedarray-pool":372}],353:[function(_dereq_,module,exports){ +},{"./lib/codegen":338,"ndarray":293,"ndarray-sort":292,"typedarray-pool":355}],338:[function(_dereq_,module,exports){ 'use strict' module.exports = getPolygonizer -var pool = _dereq_('typedarray-pool') -var createMSTable = _dereq_('marching-simplex-table') - -var CACHE = {} - -function createCellPolygonizer(d) { - var maxCellSize = 0 - var tables = new Array(d+1) - tables[0] = [ [] ] - for(var i=1; i<=d; ++i) { - var tab = tables[i] = createMSTable(i) - for(var j=0; j>1,v=E[2*m+1];', - 'if(v===b){return m}', - 'if(b> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l } - code.push('R.push(') - for(var i=0; i 0) { - code.push(',') + function getContour0d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length } - code.push('[') - for(var j=0; j 0) { - code.push(',') + return R + } + return getContour0d + }, + function cellPolygonizer_1() { + 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 } - code.push('B(C,E,c[', f[0], '],c[', f[1], '])') } - code.push(']') + return l } - code.push(');') - } - - for(var i=d+1; i>1; --i) { - if(i < d+1) { - code.push('else ') + function getContour1d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R } - code.push('if(l===', i, '){') - - //Generate mask - var maskStr = [] - for(var j=0; j> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l } - - //Perform table look up - code.push('var M=', maskStr.join('+'), - ';if(M===0||M===', (1<> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour3d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 4) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + (S[c[3]] << 3) + if (M === 0 || M === 15) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])]) + break + case 2: + R.push([B(C, E, c[1], c[2]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])]) + break + case 3: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])], [B(C, E, c[1], c[3]), B(C, E, c[1], c[2]), B(C, E, c[0], c[3])]) + break + case 4: + R.push([B(C, E, c[2], c[0]), B(C, E, c[2], c[1]), B(C, E, c[2], c[3])]) + break + case 5: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[0], c[3])], [B(C, E, c[2], c[1]), B(C, E, c[2], c[3]), B(C, E, c[0], c[3])]) + break + case 6: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])], [B(C, E, c[2], c[3]), B(C, E, c[2], c[0]), B(C, E, c[1], c[3])]) + break + case 7: + R.push([B(C, E, c[0], c[3]), B(C, E, c[1], c[3]), B(C, E, c[2], c[3])]) + break + case 8: + R.push([B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[3], c[2])]) + break + case 9: + R.push([B(C, E, c[3], c[1]), B(C, E, c[0], c[1]), B(C, E, c[0], c[2])], [B(C, E, c[3], c[2]), B(C, E, c[3], c[1]), B(C, E, c[0], c[2])]) + break + case 10: + R.push([B(C, E, c[1], c[0]), B(C, E, c[3], c[0]), B(C, E, c[1], c[2])], [B(C, E, c[3], c[0]), B(C, E, c[3], c[2]), B(C, E, c[1], c[2])]) + break + case 11: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[3], c[2])]) + break + case 12: + R.push([B(C, E, c[3], c[0]), B(C, E, c[2], c[0]), B(C, E, c[2], c[1])], [B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[2], c[1])]) + break + case 13: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[3], c[1])]) + break + case 14: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[3], c[0])]) + break + case 15: + break + } + } else if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R + } + return getContour3d } - code.push('}return R;};return getContour', d, 'd') - - var proc = new Function('pool', code.join('')) - return proc(pool) -} +] function getPolygonizer(d) { - var alg = CACHE[d] - if(!alg) { - alg = CACHE[d] = createCellPolygonizer(d) - } - return alg + return allFns[d](); } -},{"marching-simplex-table":285,"typedarray-pool":372}],354:[function(_dereq_,module,exports){ + +},{}],339:[function(_dereq_,module,exports){ "use strict"; "use restrict"; var bits = _dereq_("bit-twiddle") @@ -46990,11 +47034,11 @@ function connectedComponents(cells, vertex_count) { } exports.connectedComponents = connectedComponents -},{"bit-twiddle":43,"union-find":373}],355:[function(_dereq_,module,exports){ +},{"bit-twiddle":43,"union-find":356}],340:[function(_dereq_,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"dup":43}],356:[function(_dereq_,module,exports){ -arguments[4][354][0].apply(exports,arguments) -},{"bit-twiddle":355,"dup":354,"union-find":357}],357:[function(_dereq_,module,exports){ +},{"dup":43}],341:[function(_dereq_,module,exports){ +arguments[4][339][0].apply(exports,arguments) +},{"bit-twiddle":340,"dup":339,"union-find":342}],342:[function(_dereq_,module,exports){ "use strict"; "use restrict"; module.exports = UnionFind; @@ -47051,7 +47095,7 @@ UnionFind.prototype.link = function(x, y) { } -},{}],358:[function(_dereq_,module,exports){ +},{}],343:[function(_dereq_,module,exports){ "use strict" module.exports = simplifyPolygon @@ -47323,7 +47367,7 @@ function simplifyPolygon(cells, positions, minArea) { edges: ncells } } -},{"robust-orientation":344,"simplicial-complex":356}],359:[function(_dereq_,module,exports){ +},{"robust-orientation":329,"simplicial-complex":341}],344:[function(_dereq_,module,exports){ "use strict" module.exports = orderSegments @@ -47419,9 +47463,7 @@ function orderSegments(b, a) { } return ar[0] - br[0] } -},{"robust-orientation":344}],360:[function(_dereq_,module,exports){ -arguments[4][99][0].apply(exports,arguments) -},{"dup":99}],361:[function(_dereq_,module,exports){ +},{"robust-orientation":329}],345:[function(_dereq_,module,exports){ "use strict" module.exports = createSlabDecomposition @@ -47652,7 +47694,7 @@ function createSlabDecomposition(segments) { } return new SlabDecomposition(slabs, lines, horizontal) } -},{"./lib/order-segments":359,"binary-search-bounds":360,"functional-red-black-tree":100,"robust-orientation":344}],362:[function(_dereq_,module,exports){ +},{"./lib/order-segments":344,"binary-search-bounds":42,"functional-red-black-tree":96,"robust-orientation":329}],346:[function(_dereq_,module,exports){ "use strict" var robustDot = _dereq_("robust-dot-product") @@ -47744,7 +47786,7 @@ function negative(points, plane) { } return neg } -},{"robust-dot-product":341,"robust-sum":349}],363:[function(_dereq_,module,exports){ +},{"robust-dot-product":326,"robust-sum":334}],347:[function(_dereq_,module,exports){ /* global window, exports, define */ !function() { @@ -47977,180 +48019,1570 @@ function negative(points, plane) { /* eslint-enable quote-props */ }(); // eslint-disable-line -},{}],364:[function(_dereq_,module,exports){ +},{}],348:[function(_dereq_,module,exports){ "use strict" module.exports = surfaceNets var generateContourExtractor = _dereq_("ndarray-extract-contour") -var triangulateCube = _dereq_("triangulate-hypercube") var zeroCrossings = _dereq_("zero-crossings") -function buildSurfaceNets(order, dtype) { - var dimension = order.length - var code = ["'use strict';"] - var funcName = "surfaceNets" + order.join("_") + "d" + dtype - - //Contour extraction function - code.push( - "var contour=genContour({", - "order:[", order.join(), "],", - "scalarArguments: 3,", - "phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },") - if(dtype === "generic") { - code.push("getters:[0],") - } - - //Generate vertex function - var cubeArgs = [] - var extraArgs = [] - for(var i=0; i>>7){") - } - for(var i=0; i<1<<(1< 128) { - if((i%128)===0) { - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - var efName = "vExtra" + extraFuncs.length - code.push("case ", (i>>>7), ":", efName, "(m&0x7f,", extraArgs.join(), ");break;") - currentFunc = [ - "function ", efName, "(m,", extraArgs.join(), "){switch(m){" - ] - extraFuncs.push(currentFunc) - } - } - currentFunc.push("case ", (i&0x7f), ":") - var crossings = new Array(dimension) - var denoms = new Array(dimension) - var crossingCount = new Array(dimension) - var bias = new Array(dimension) - var totalCrossings = 0 - for(var j=0; j j) { - continue +var F1_6 = 1 / 6 +var F5_6 = 5 / 6 +var F7_18 = 7 / 18 +var F1_14 = 1 / 14 +var F3_14 = 3 / 14 +var F5_14 = 5 / 14 +var F9_14 = 9 / 14 +var F11_18 = 11 / 18 + +var allFns = { + "2d": function (genContour, order, dtype) { + var contour = genContour({ + order: order, + scalarArguments: 3, + getters: dtype === "generic" ? [0] : undefined, + phase: function phaseFunc(p, a, b, c) { + return (p > c) | 0; + }, + vertex: function vertexFunc(d0, d1, v0, v1, v2, v3, p0, p1, p2, p3, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3)) | 0; + if (m === 0 || m === 15) { + return; } - if(!(i&(1< c) | 0; + }, + vertex: function vertexFunc(d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3) + (p4 << 4) + (p5 << 5) + (p6 << 6) + (p7 << 7)) | 0; + if (m === 0 || m === 255) { + return; } + switch (m >>> 7) { + case 0: + vExtra0(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + case 1: + vExtra1(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + } + }, + cell: function cellFunc(v0, v1, v2, v3, c0, c1, p0, p1, a, b, c) { + if (p0) { + b.push([v3, v2, v0], [v0, v1, v3]); + } else { + b.push([v0, v2, v3], [v3, v1, v0]); + } + }, + }); + return function (array, level) { + var verts = [], + cells = []; + contour(array, verts, cells, level); + return { positions: verts, cells: cells }; + }; + function vExtra0(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; + case 1: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 3: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 4: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 5: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 6: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 7: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 8: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 9: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 10: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 11: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 12: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 13: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 14: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 15: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (v4 + v0 + v5 + v1 + v6 + v2 + v7 + v3 - 8 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 16: + a.push([ + d0 - F1_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 17: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 18: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 19: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 20: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 21: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 22: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 23: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 24: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 25: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 26: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 28: + a.push([ + d0 - F5_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 30: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v4 - v0 + v1 - v5 + v2 - v6 + v3 - v7), + ]); + break; + case 31: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 32: + a.push([ + d0 - F5_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 33: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 34: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 35: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 36: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 37: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 38: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 40: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 41: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 42: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 43: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 44: + a.push([ + d0 - F9_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 45: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 46: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 47: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 48: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 49: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 50: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 51: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (v2 + v0 + v3 + v1 + v6 + v4 + v7 + v5 - 8 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5]); + break; + case 52: + a.push([ + d0 - F5_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 54: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v2 - v0 + v1 - v3 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 55: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 56: + a.push([ + d0 - F9_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 57: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 58: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 59: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 60: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + v7 + v5)) / (v2 - v0 + v3 - v1 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + v7 + v3)) / (v4 - v0 + v5 - v1 + v2 - v6 + v3 - v7)]); + break; + case 61: + a.push([ + d0 - F9_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 62: + a.push([ + d0 - F5_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 63: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 64: + a.push([ + d0 - F1_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 65: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 66: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 67: + a.push([ + d0 - F5_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 68: + a.push([d0 - 0.25 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 69: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 70: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 71: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 72: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 73: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 75: + a.push([ + d0 - 0.375 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 76: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 77: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 78: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 79: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 80: + a.push([d0 - 0.25 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 81: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 82: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 83: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 84: + a.push([d0 - 0.3 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 85: + a.push([d0 - 0.5 - (0.5 * (v1 + v0 + v3 + v2 + v5 + v4 + v7 + v6 - 8 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5]); + break; + case 86: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v1 - v0 + v2 - v3 + v4 - v5 + v6 - v7), + d1 - 0.375 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 87: + a.push([d0 - 0.7 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 88: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v3 - v2 + v4 - v5 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 90: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + v7 + v6)) / (v1 - v0 + v3 - v2 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + v7 + v3)) / (v4 - v0 + v1 - v5 + v6 - v2 + v3 - v7)]); + break; + case 91: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 92: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 93: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 94: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 95: + a.push([d0 - 0.75 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 96: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 97: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 99: + a.push([ + d0 - 0.375 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.375 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 102: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + v7 + v6)) / (v1 - v0 + v2 - v3 + v5 - v4 + v6 - v7), d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + v7 + v5)) / (v2 - v0 + v1 - v3 + v6 - v4 + v5 - v7), d2 - 0.5]); + break; + case 103: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 104: + a.push([ + d0 - F11_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 105: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + v7 + v6)) / (v0 - v1 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + v7 + v5)) / (v0 - v2 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + v7 + v3)) / (v0 - v4 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 106: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + v7 + v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.625 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 107: + a.push([ + d0 - F7_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 108: + a.push([ + d0 - 0.625 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + v7 + v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 109: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 110: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 111: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 112: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 113: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 114: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 115: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 116: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 117: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 119: + a.push([d0 - 0.75 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 120: + a.push([ + d0 - 0.625 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + v7 + v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 121: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 122: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 123: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 124: + a.push([ + d0 - F9_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 126: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 127: + a.push([ + d0 - F5_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; } } - var vertexStr = [] - for(var k=0; k 0) { - cStr = "+" + crossingCount[k] + "*c" - } - var weight = 0.5 * (crossings[k].length / totalCrossings) - var shift = 0.5 + 0.5 * (bias[k] / totalCrossings) - vertexStr.push("d" + k + "-" + shift + "-" + weight + "*(" + crossings[k].join("+") + cStr + ")/(" + denoms[k].join("+") + ")") - + function vExtra1(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([ + d0 - F5_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 1: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 3: + a.push([ + d0 - F9_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 4: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 5: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 6: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 7: + a.push([ + d0 - 0.625 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + v6 + v2 + -v7 - v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 8: + a.push([d0 - 0.75 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 9: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 10: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 11: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 12: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 13: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 14: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 15: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 16: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 17: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 18: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 19: + a.push([ + d0 - 0.625 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + v6 + v4 + -v7 - v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 20: + a.push([ + d0 - F7_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 21: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + v5 + v4 + -v7 - v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.625 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 22: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 + -v7 - v6)) / (v1 - v0 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 + -v7 - v5)) / (v2 - v0 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 + -v7 - v3)) / (v4 - v0 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 23: + a.push([ + d0 - F11_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 24: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 25: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + -v7 - v6)) / (v0 - v1 + v3 - v2 + v4 - v5 + v7 - v6), d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + -v7 - v5)) / (v0 - v2 + v3 - v1 + v4 - v6 + v7 - v5), d2 - 0.5]); + break; + case 26: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.375 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 28: + a.push([ + d0 - 0.375 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 30: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 31: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 32: + a.push([d0 - 0.75 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 33: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 34: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 35: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 36: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 37: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + -v7 - v6)) / (v0 - v1 + v2 - v3 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + -v7 - v3)) / (v0 - v4 + v5 - v1 + v2 - v6 + v7 - v3)]); + break; + case 38: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v2 - v3 + v5 - v4 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 40: + a.push([d0 - 0.7 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 41: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v0 - v1 + v3 - v2 + v5 - v4 + v7 - v6), + d1 - 0.375 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 42: + a.push([d0 - 0.5 - (0.5 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 8 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5]); + break; + case 43: + a.push([d0 - 0.3 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 44: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 45: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 46: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 47: + a.push([d0 - 0.25 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 48: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 49: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 50: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 51: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 52: + a.push([ + d0 - 0.375 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 54: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 55: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 56: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 57: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 58: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 59: + a.push([d0 - 0.25 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 60: + a.push([ + d0 - F5_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 61: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 62: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 63: + a.push([ + d0 - F1_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 64: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 65: + a.push([ + d0 - F5_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 66: + a.push([ + d0 - F9_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 67: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + -v7 - v5)) / (v0 - v2 + v1 - v3 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + -v7 - v3)) / (v0 - v4 + v1 - v5 + v6 - v2 + v7 - v3)]); + break; + case 68: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 69: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 70: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 71: + a.push([ + d0 - F9_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 72: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 73: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v0 - v2 + v3 - v1 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 75: + a.push([ + d0 - F5_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 76: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 8 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5]); + break; + case 77: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 78: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 79: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 80: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 81: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 82: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 83: + a.push([ + d0 - F9_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 84: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 85: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 86: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 87: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 88: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 90: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 91: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 92: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 93: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 94: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 95: + a.push([ + d0 - F5_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 96: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 97: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v0 - v4 + v5 - v1 + v6 - v2 + v7 - v3), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 99: + a.push([ + d0 - F5_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 102: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 103: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 104: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 105: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 106: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 107: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 108: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 109: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 110: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 111: + a.push([ + d0 - F1_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 112: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 8 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 113: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 114: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 115: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 116: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 117: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 119: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 120: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 121: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 122: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 123: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 124: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 126: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 127: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; } } - currentFunc.push("a.push([", vertexStr.join(), "]);", - "break;") - } - code.push("}},") - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - - //Create face function - var faceArgs = [] - for(var i=0; i<(1<<(dimension-1)); ++i) { - faceArgs.push("v" + i) - } - faceArgs.push("c0", "c1", "p0", "p1", "a", "b", "c") - code.push("cell:function cellFunc(", faceArgs.join(), "){") - - var facets = triangulateCube(dimension-1) - code.push("if(p0){b.push(", - facets.map(function(f) { - return "[" + f.map(function(v) { - return "v" + v - }) + "]" - }).join(), ")}else{b.push(", - facets.map(function(f) { - var e = f.slice() - e.reverse() - return "[" + e.map(function(v) { - return "v" + v - }) + "]" - }).join(), - ")}}});function ", funcName, "(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ", funcName, ";") - - for(var i=0; i= 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": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg1_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg2_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg3_", - "lvalue": false, - "rvalue": true, - "count": 2 - }, { - "name": "_inline_1_arg4_", - "lvalue": false, - "rvalue": true, - "count": 1 - }], - "thisVars": [], - "localVars": ["_inline_1_da", "_inline_1_db"] - }, +},{"./main":379,"object-assign":296}],381:[function(_dereq_,module,exports){ +"use strict" + +function CWiseOp() { + return function(SS, a0, t0, p0, Y0, Y1) { + var s0 = SS[0], + t0p0 = t0[0], + index = [0], + q0 = t0p0 + p0 |= 0 + var i0 = 0, + d0s0 = t0p0 + for (i0 = 0; i0 < s0; ++i0) { + { + var da = a0[p0] - Y1 + var db = a0[p0 + q0] - Y1 + if (da >= 0 !== db >= 0) { + Y0.push(index[0] + 0.5 + (0.5 * (da + db)) / (da - db)) + } + } + p0 += d0s0 + ++index[0] + } + } +} + +//Generates a cwise operator +function generateCWiseOp() { + return CWiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {} + return function zeroCrossings_cwise_thunk(array0, scalar2, scalar3) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar2, scalar3) + } +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ funcName: 'zeroCrossings' }) -},{"cwise-compiler":83}],399:[function(_dereq_,module,exports){ +},{}],382:[function(_dereq_,module,exports){ "use strict" module.exports = findZeroCrossings @@ -57068,7 +58477,7 @@ function findZeroCrossings(array, level) { core(array.hi(array.shape[0]-1), cross, level) return cross } -},{"./lib/zc-core":398}],400:[function(_dereq_,module,exports){ +},{"./lib/zc-core":381}],383:[function(_dereq_,module,exports){ 'use strict'; /** @@ -57131,7 +58540,7 @@ module.exports = [ } ]; -},{}],401:[function(_dereq_,module,exports){ +},{}],384:[function(_dereq_,module,exports){ 'use strict'; var ARROWPATHS = _dereq_('./arrow_paths'); @@ -57419,7 +58828,7 @@ module.exports = templatedArray('annotation', { } }); -},{"../../constants/axis_placeable_objects":524,"../../plot_api/plot_template":589,"../../plots/cartesian/constants":607,"../../plots/font_attributes":629,"./arrow_paths":400}],402:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":507,"../../plot_api/plot_template":572,"../../plots/cartesian/constants":590,"../../plots/font_attributes":612,"./arrow_paths":383}],385:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -57501,7 +58910,7 @@ function calcAxisExpansion(ann, ax) { ann._extremes[axId] = extremes; } -},{"../../lib":551,"../../plots/cartesian/axes":600,"./draw":407}],403:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/cartesian/axes":583,"./draw":390}],386:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -57631,7 +59040,7 @@ function clickData2r(d, ax) { return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d); } -},{"../../lib":551,"../../plot_api/plot_template":589,"../../registry":649}],404:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../../registry":632}],387:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -57702,7 +59111,7 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo coerce('captureevents', !!hoverText); }; -},{"../../lib":551,"../color":418}],405:[function(_dereq_,module,exports){ +},{"../../lib":534,"../color":401}],388:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -57756,7 +59165,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":578,"fast-isnumeric":97}],406:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":561,"fast-isnumeric":94}],389:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -57855,7 +59264,7 @@ function handleAnnotationDefaults(annIn, annOut, fullLayout) { } } -},{"../../lib":551,"../../plots/array_container_defaults":595,"../../plots/cartesian/axes":600,"./attributes":401,"./common_defaults":404}],407:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/array_container_defaults":578,"../../plots/cartesian/axes":583,"./attributes":384,"./common_defaults":387}],390:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -58608,7 +60017,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) { } else annText.call(textLayout); } -},{"../../lib":551,"../../lib/setcursor":571,"../../lib/svg_text_utils":576,"../../plot_api/plot_template":589,"../../plots/cartesian/axes":600,"../../plots/plots":646,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"../fx":458,"./draw_arrow_head":408,"@plotly/d3":17}],408:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../lib/setcursor":554,"../../lib/svg_text_utils":559,"../../plot_api/plot_template":572,"../../plots/cartesian/axes":583,"../../plots/plots":629,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"../fx":441,"./draw_arrow_head":391,"@plotly/d3":17}],391:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -58755,7 +60164,7 @@ module.exports = function drawArrowHead(el3, ends, options) { if(doEnd) drawhead(headStyle, end, endRot, scale); }; -},{"../../lib":551,"../color":418,"./arrow_paths":400,"@plotly/d3":17}],409:[function(_dereq_,module,exports){ +},{"../../lib":534,"../color":401,"./arrow_paths":383,"@plotly/d3":17}],392:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -58780,7 +60189,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":613,"./attributes":401,"./calc_autorange":402,"./click":403,"./convert_coords":405,"./defaults":406,"./draw":407}],410:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":596,"./attributes":384,"./calc_autorange":385,"./click":386,"./convert_coords":388,"./defaults":389,"./draw":390}],393:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -58849,7 +60258,7 @@ module.exports = overrideAll(templatedArray('annotation', { // zref: 'z' }), 'calc', 'from-root'); -},{"../../plot_api/edit_types":582,"../../plot_api/plot_template":589,"../annotations/attributes":401}],411:[function(_dereq_,module,exports){ +},{"../../plot_api/edit_types":565,"../../plot_api/plot_template":572,"../annotations/attributes":384}],394:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -58906,7 +60315,7 @@ function mockAnnAxes(ann, scene) { }; } -},{"../../lib":551,"../../plots/cartesian/axes":600}],412:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/cartesian/axes":583}],395:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -58974,7 +60383,7 @@ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) { } } -},{"../../lib":551,"../../plots/array_container_defaults":595,"../../plots/cartesian/axes":600,"../annotations/common_defaults":404,"./attributes":410}],413:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/array_container_defaults":578,"../../plots/cartesian/axes":583,"../annotations/common_defaults":387,"./attributes":393}],396:[function(_dereq_,module,exports){ 'use strict'; var drawRaw = _dereq_('../annotations/draw').drawRaw; @@ -59018,7 +60427,7 @@ module.exports = function draw(scene) { } }; -},{"../../plots/gl3d/project":641,"../annotations/draw":407}],414:[function(_dereq_,module,exports){ +},{"../../plots/gl3d/project":624,"../annotations/draw":390}],397:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -59058,7 +60467,7 @@ function includeGL3D(layoutIn, layoutOut) { } } -},{"../../lib":551,"../../registry":649,"./attributes":410,"./convert":411,"./defaults":412,"./draw":413}],415:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"./attributes":393,"./convert":394,"./defaults":395,"./draw":396}],398:[function(_dereq_,module,exports){ 'use strict'; // a trimmed down version of: @@ -59083,7 +60492,7 @@ _dereq_('world-calendars/dist/calendars/taiwan'); _dereq_('world-calendars/dist/calendars/thai'); _dereq_('world-calendars/dist/calendars/ummalqura'); -},{"world-calendars/dist/calendars/chinese":382,"world-calendars/dist/calendars/coptic":383,"world-calendars/dist/calendars/discworld":384,"world-calendars/dist/calendars/ethiopian":385,"world-calendars/dist/calendars/hebrew":386,"world-calendars/dist/calendars/islamic":387,"world-calendars/dist/calendars/julian":388,"world-calendars/dist/calendars/mayan":389,"world-calendars/dist/calendars/nanakshahi":390,"world-calendars/dist/calendars/nepali":391,"world-calendars/dist/calendars/persian":392,"world-calendars/dist/calendars/taiwan":393,"world-calendars/dist/calendars/thai":394,"world-calendars/dist/calendars/ummalqura":395,"world-calendars/dist/main":396,"world-calendars/dist/plus":397}],416:[function(_dereq_,module,exports){ +},{"world-calendars/dist/calendars/chinese":365,"world-calendars/dist/calendars/coptic":366,"world-calendars/dist/calendars/discworld":367,"world-calendars/dist/calendars/ethiopian":368,"world-calendars/dist/calendars/hebrew":369,"world-calendars/dist/calendars/islamic":370,"world-calendars/dist/calendars/julian":371,"world-calendars/dist/calendars/mayan":372,"world-calendars/dist/calendars/nanakshahi":373,"world-calendars/dist/calendars/nepali":374,"world-calendars/dist/calendars/persian":375,"world-calendars/dist/calendars/taiwan":376,"world-calendars/dist/calendars/thai":377,"world-calendars/dist/calendars/ummalqura":378,"world-calendars/dist/main":379,"world-calendars/dist/plus":380}],399:[function(_dereq_,module,exports){ 'use strict'; var calendars = _dereq_('./calendars'); @@ -59349,7 +60758,7 @@ module.exports = { worldCalFmt: worldCalFmt }; -},{"../../constants/numerical":530,"../../lib":551,"./calendars":415}],417:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"./calendars":398}],400:[function(_dereq_,module,exports){ 'use strict'; @@ -59381,7 +60790,7 @@ exports.borderLine = '#BEC8D9'; // gives back exactly lightLine if the other colors are defaults. exports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4); -},{}],418:[function(_dereq_,module,exports){ +},{}],401:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -59547,7 +60956,7 @@ function cleanOne(val) { return 'rgb(' + rgbStr + ')'; } -},{"../../lib/array":536,"./attributes":417,"fast-isnumeric":97,"tinycolor2":366}],419:[function(_dereq_,module,exports){ +},{"../../lib/array":519,"./attributes":400,"fast-isnumeric":94,"tinycolor2":350}],402:[function(_dereq_,module,exports){ 'use strict'; var axesAttrs = _dereq_('../../plots/cartesian/layout_attributes'); @@ -59694,7 +61103,7 @@ module.exports = overrideAll({ } }, 'colorbars', 'from-root'); -},{"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plots/cartesian/layout_attributes":615,"../../plots/font_attributes":629}],420:[function(_dereq_,module,exports){ +},{"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plots/cartesian/layout_attributes":598,"../../plots/font_attributes":612}],403:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -59714,7 +61123,7 @@ module.exports = { } }; -},{}],421:[function(_dereq_,module,exports){ +},{}],404:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -59784,7 +61193,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) { coerce('title.side'); }; -},{"../../lib":551,"../../plot_api/plot_template":589,"../../plots/cartesian/tick_label_defaults":622,"../../plots/cartesian/tick_mark_defaults":623,"../../plots/cartesian/tick_value_defaults":624,"./attributes":419}],422:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../../plots/cartesian/tick_label_defaults":605,"../../plots/cartesian/tick_mark_defaults":606,"../../plots/cartesian/tick_value_defaults":607,"./attributes":402}],405:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -60511,7 +61920,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":523,"../../lib":551,"../../lib/extend":544,"../../lib/setcursor":571,"../../lib/svg_text_utils":576,"../../plots/cartesian/axes":600,"../../plots/cartesian/axis_defaults":602,"../../plots/cartesian/layout_attributes":615,"../../plots/cartesian/position_defaults":618,"../../plots/plots":646,"../../registry":649,"../color":418,"../colorscale/helpers":429,"../dragelement":437,"../drawing":440,"../titles":516,"./constants":420,"@plotly/d3":17,"tinycolor2":366}],423:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../lib":534,"../../lib/extend":527,"../../lib/setcursor":554,"../../lib/svg_text_utils":559,"../../plots/cartesian/axes":583,"../../plots/cartesian/axis_defaults":585,"../../plots/cartesian/layout_attributes":598,"../../plots/cartesian/position_defaults":601,"../../plots/plots":629,"../../registry":632,"../color":401,"../colorscale/helpers":412,"../dragelement":420,"../drawing":423,"../titles":499,"./constants":403,"@plotly/d3":17,"tinycolor2":350}],406:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -60521,7 +61930,7 @@ module.exports = function hasColorbar(container) { return Lib.isPlainObject(container.colorbar); }; -},{"../../lib":551}],424:[function(_dereq_,module,exports){ +},{"../../lib":534}],407:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -60535,7 +61944,7 @@ module.exports = { hasColorbar: _dereq_('./has_colorbar') }; -},{"./attributes":419,"./defaults":421,"./draw":422,"./has_colorbar":423}],425:[function(_dereq_,module,exports){ +},{"./attributes":402,"./defaults":404,"./draw":405,"./has_colorbar":406}],408:[function(_dereq_,module,exports){ 'use strict'; var colorbarAttrs = _dereq_('../colorbar/attributes'); @@ -60716,7 +62125,7 @@ module.exports = function colorScaleAttrs(context, opts) { return attrs; }; -},{"../../lib/regex":567,"../../lib/sort_object_keys":573,"../colorbar/attributes":419,"./scales.js":433}],426:[function(_dereq_,module,exports){ +},{"../../lib/regex":550,"../../lib/sort_object_keys":556,"../colorbar/attributes":402,"./scales.js":416}],409:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -60787,7 +62196,7 @@ module.exports = function calc(gd, trace, opts) { } }; -},{"../../lib":551,"./helpers":429,"fast-isnumeric":97}],427:[function(_dereq_,module,exports){ +},{"../../lib":534,"./helpers":412,"fast-isnumeric":94}],410:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -60856,7 +62265,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":551,"./helpers":429}],428:[function(_dereq_,module,exports){ +},{"../../lib":534,"./helpers":412}],411:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -60973,7 +62382,7 @@ module.exports = function colorScaleDefaults(parentContIn, parentContOut, layout } }; -},{"../../lib":551,"../../registry":649,"../colorbar/defaults":421,"../colorbar/has_colorbar":423,"./scales":433,"fast-isnumeric":97}],429:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"../colorbar/defaults":404,"../colorbar/has_colorbar":406,"./scales":416,"fast-isnumeric":94}],412:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -61205,7 +62614,7 @@ module.exports = { makeColorScaleFuncFromTrace: makeColorScaleFuncFromTrace }; -},{"../../lib":551,"../color":418,"./scales":433,"@plotly/d3":17,"fast-isnumeric":97,"tinycolor2":366}],430:[function(_dereq_,module,exports){ +},{"../../lib":534,"../color":401,"./scales":416,"@plotly/d3":17,"fast-isnumeric":94,"tinycolor2":350}],413:[function(_dereq_,module,exports){ 'use strict'; var scales = _dereq_('./scales'); @@ -61239,7 +62648,7 @@ module.exports = { makeColorScaleFuncFromTrace: helpers.makeColorScaleFuncFromTrace }; -},{"./attributes":425,"./calc":426,"./cross_trace_defaults":427,"./defaults":428,"./helpers":429,"./layout_attributes":431,"./layout_defaults":432,"./scales":433}],431:[function(_dereq_,module,exports){ +},{"./attributes":408,"./calc":409,"./cross_trace_defaults":410,"./defaults":411,"./helpers":412,"./layout_attributes":414,"./layout_defaults":415,"./scales":416}],414:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -61285,7 +62694,7 @@ module.exports = { })) }; -},{"../../lib/extend":544,"./attributes":425,"./scales":433}],432:[function(_dereq_,module,exports){ +},{"../../lib/extend":527,"./attributes":408,"./scales":416}],415:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -61328,7 +62737,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { } }; -},{"../../lib":551,"../../plot_api/plot_template":589,"./defaults":428,"./layout_attributes":431}],433:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"./defaults":411,"./layout_attributes":414}],416:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -61524,7 +62933,7 @@ module.exports = { isValid: isValidScale }; -},{"tinycolor2":366}],434:[function(_dereq_,module,exports){ +},{"tinycolor2":350}],417:[function(_dereq_,module,exports){ 'use strict'; @@ -61548,7 +62957,7 @@ module.exports = function align(v, dv, v0, v1, anchor) { return vc; }; -},{}],435:[function(_dereq_,module,exports){ +},{}],418:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -61577,7 +62986,7 @@ module.exports = function getCursor(x, y, xanchor, yanchor) { return cursorset[y][x]; }; -},{"../../lib":551}],436:[function(_dereq_,module,exports){ +},{"../../lib":534}],419:[function(_dereq_,module,exports){ 'use strict'; exports.selectMode = function(dragmode) { @@ -61628,7 +63037,7 @@ exports.selectingOrDrawing = function(dragmode) { ); }; -},{}],437:[function(_dereq_,module,exports){ +},{}],420:[function(_dereq_,module,exports){ 'use strict'; var mouseOffset = _dereq_('mouse-event-offset'); @@ -61912,7 +63321,7 @@ function pointerOffset(e) { ); } -},{"../../lib":551,"../../plots/cartesian/constants":607,"./align":434,"./cursor":435,"./unhover":438,"has-hover":271,"has-passive-events":272,"mouse-event-offset":293}],438:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/cartesian/constants":590,"./align":417,"./cursor":418,"./unhover":421,"has-hover":263,"has-passive-events":264,"mouse-event-offset":281}],421:[function(_dereq_,module,exports){ 'use strict'; var Events = _dereq_('../../lib/events'); @@ -61959,7 +63368,7 @@ unhover.raw = function raw(gd, evt) { } }; -},{"../../lib/dom":542,"../../lib/events":543,"../../lib/throttle":577,"../fx/constants":452}],439:[function(_dereq_,module,exports){ +},{"../../lib/dom":525,"../../lib/events":526,"../../lib/throttle":560,"../fx/constants":435}],422:[function(_dereq_,module,exports){ 'use strict'; exports.dash = { @@ -62021,7 +63430,7 @@ exports.pattern = { editType: 'style', }; -},{}],440:[function(_dereq_,module,exports){ +},{}],423:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -63465,7 +64874,7 @@ drawing.setTextPointsScale = function(selection, xScale, yScale) { }); }; -},{"../../components/fx/helpers":454,"../../constants/alignment":523,"../../constants/interactions":529,"../../constants/xmlns_namespaces":531,"../../lib":551,"../../lib/svg_text_utils":576,"../../registry":649,"../../traces/scatter/make_bubble_size_func":695,"../../traces/scatter/subtypes":703,"../color":418,"../colorscale":430,"./symbol_defs":441,"@plotly/d3":17,"fast-isnumeric":97,"tinycolor2":366}],441:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":437,"../../constants/alignment":506,"../../constants/interactions":512,"../../constants/xmlns_namespaces":514,"../../lib":534,"../../lib/svg_text_utils":559,"../../registry":632,"../../traces/scatter/make_bubble_size_func":678,"../../traces/scatter/subtypes":686,"../color":401,"../colorscale":413,"./symbol_defs":424,"@plotly/d3":17,"fast-isnumeric":94,"tinycolor2":350}],424:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -64020,7 +65429,7 @@ module.exports = { } }; -},{"@plotly/d3":17}],442:[function(_dereq_,module,exports){ +},{"@plotly/d3":17}],425:[function(_dereq_,module,exports){ 'use strict'; @@ -64103,7 +65512,7 @@ module.exports = { } }; -},{}],443:[function(_dereq_,module,exports){ +},{}],426:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -64181,7 +65590,7 @@ function calcOneAxis(calcTrace, trace, axis, coord) { baseExtremes.max = baseExtremes.max.concat(extremes.max); } -},{"../../lib":551,"../../plots/cartesian/axes":600,"../../registry":649,"./compute_error":444,"fast-isnumeric":97}],444:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/cartesian/axes":583,"../../registry":632,"./compute_error":427,"fast-isnumeric":94}],427:[function(_dereq_,module,exports){ 'use strict'; @@ -64273,7 +65682,7 @@ function makeComputeErrorValue(type, value) { } } -},{}],445:[function(_dereq_,module,exports){ +},{}],428:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -64340,7 +65749,7 @@ module.exports = function(traceIn, traceOut, defaultColor, opts) { } }; -},{"../../lib":551,"../../plot_api/plot_template":589,"../../registry":649,"./attributes":442,"fast-isnumeric":97}],446:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../../registry":632,"./attributes":425,"fast-isnumeric":94}],429:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -64401,7 +65810,7 @@ function hoverInfo(calcPoint, trace, hoverPoint) { } } -},{"../../lib":551,"../../plot_api/edit_types":582,"./attributes":442,"./calc":443,"./compute_error":444,"./defaults":445,"./plot":447,"./style":448}],447:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/edit_types":565,"./attributes":425,"./calc":426,"./compute_error":427,"./defaults":428,"./plot":430,"./style":431}],430:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -64564,7 +65973,7 @@ function errorCoords(d, xa, ya) { return out; } -},{"../../traces/scatter/subtypes":703,"../drawing":440,"@plotly/d3":17,"fast-isnumeric":97}],448:[function(_dereq_,module,exports){ +},{"../../traces/scatter/subtypes":686,"../drawing":423,"@plotly/d3":17,"fast-isnumeric":94}],431:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -64592,7 +66001,7 @@ module.exports = function style(traces) { }); }; -},{"../color":418,"@plotly/d3":17}],449:[function(_dereq_,module,exports){ +},{"../color":401,"@plotly/d3":17}],432:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -64617,7 +66026,7 @@ module.exports = { } }; -},{"../../lib/extend":544,"../../plots/font_attributes":629,"./layout_attributes":459}],450:[function(_dereq_,module,exports){ +},{"../../lib/extend":527,"../../plots/font_attributes":612,"./layout_attributes":442}],433:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -64668,7 +66077,7 @@ function paste(traceAttr, cd, cdAttr, fn) { } } -},{"../../lib":551,"../../registry":649}],451:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632}],434:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -64697,7 +66106,7 @@ module.exports = function click(gd, evt, subplot) { } }; -},{"../../registry":649,"./hover":455}],452:[function(_dereq_,module,exports){ +},{"../../registry":632,"./hover":438}],435:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -64721,7 +66130,7 @@ module.exports = { HOVERID: '-hover' }; -},{}],453:[function(_dereq_,module,exports){ +},{}],436:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -64739,7 +66148,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleHoverLabelDefaults(traceIn, traceOut, coerce, opts); }; -},{"../../lib":551,"./attributes":449,"./hoverlabel_defaults":456}],454:[function(_dereq_,module,exports){ +},{"../../lib":534,"./attributes":432,"./hoverlabel_defaults":439}],437:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -64993,7 +66402,7 @@ exports.isXYhover = function(hovermode) { return !!xyHoverMode[hovermode]; }; -},{"../../lib":551}],455:[function(_dereq_,module,exports){ +},{"../../lib":534}],438:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -65887,7 +67296,7 @@ function createHoverText(hoverData, opts) { var ya = c0.ya; var axLetter = hovermode.charAt(0); var t0 = c0[axLetter + 'Label']; - var outerContainerBB = outerContainer.getBoundingClientRect(); + var outerContainerBB = getBoundingClientRect(gd, outerContainer); var outerTop = outerContainerBB.top; var outerWidth = outerContainerBB.width; var outerHeight = outerContainerBB.height; @@ -65962,7 +67371,7 @@ function createHoverText(hoverData, opts) { label.attr('transform', ''); - var tbb = ltext.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, ltext.node()); var lx, ly; if(hovermode === 'x') { @@ -66055,7 +67464,7 @@ function createHoverText(hoverData, opts) { var dummy = Drawing.tester.append('text') .text(s.text()) .call(Drawing.font, commonLabelFont); - var dummyBB = dummy.node().getBoundingClientRect(); + var dummyBB = getBoundingClientRect(gd, dummy.node()); if(Math.round(dummyBB.width) < Math.round(tbb.width)) { s.attr('x', ltx - dummyBB.width); } @@ -66144,7 +67553,7 @@ function createHoverText(hoverData, opts) { // Position the hover var legendContainer = container.select('g.legend'); - var tbb = legendContainer.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, legendContainer.node()); var tWidth = tbb.width + 2 * HOVERTEXTPAD; var tHeight = tbb.height + 2 * HOVERTEXTPAD; var winningPoint = hoverData[0]; @@ -66309,7 +67718,7 @@ function createHoverText(hoverData, opts) { .call(svgTextUtils.positionText, 0, 0) .call(svgTextUtils.convertToTspans, gd); - var t2bb = tx2.node().getBoundingClientRect(); + var t2bb = getBoundingClientRect(gd, tx2.node()); tx2width = t2bb.width + 2 * HOVERTEXTPAD; tx2height = t2bb.height + 2 * HOVERTEXTPAD; } else { @@ -66322,22 +67731,26 @@ function createHoverText(hoverData, opts) { stroke: contrastColor }); - var tbb = tx.node().getBoundingClientRect(); var htx = d.xa._offset + (d.x0 + d.x1) / 2; var hty = d.ya._offset + (d.y0 + d.y1) / 2; var dx = Math.abs(d.x1 - d.x0); var dy = Math.abs(d.y1 - d.y0); - var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width; - var anchorStartOK, anchorEndOK; - d.ty0 = outerTop - tbb.top; - d.bx = tbb.width + 2 * HOVERTEXTPAD; - d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height); + var tbb = getBoundingClientRect(gd, tx.node()); + var tbbWidth = tbb.width / fullLayout._invScaleX; + var tbbHeight = tbb.height / fullLayout._invScaleY; + + d.ty0 = (outerTop - tbb.top) / fullLayout._invScaleY; + d.bx = tbbWidth + 2 * HOVERTEXTPAD; + d.by = Math.max(tbbHeight + 2 * HOVERTEXTPAD, tx2height); d.anchor = 'start'; - d.txwidth = tbb.width; + d.txwidth = tbbWidth; d.tx2width = tx2width; d.offset = 0; + var txTotalWidth = (tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width) * fullLayout._invScaleX; + var anchorStartOK, anchorEndOK; + if(rotateLabels) { d.pos = htx; anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight; @@ -67097,7 +68510,37 @@ function getCoord(axLetter, winningPoint, fullLayout) { function getTopOffset(gd) { return gd.offsetTop + gd.clientTop; } function getLeftOffset(gd) { return gd.offsetLeft + gd.clientLeft; } -},{"../../lib":551,"../../lib/events":543,"../../lib/override_cursor":562,"../../lib/svg_text_utils":576,"../../plots/cartesian/axes":600,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"../legend/defaults":470,"../legend/draw":471,"./constants":452,"./helpers":454,"@plotly/d3":17,"fast-isnumeric":97,"tinycolor2":366}],456:[function(_dereq_,module,exports){ +function getBoundingClientRect(gd, node) { + var fullLayout = gd._fullLayout; + + var rect = node.getBoundingClientRect(); + + var x0 = rect.x; + var y0 = rect.y; + var x1 = x0 + rect.width; + var y1 = y0 + rect.height; + + var A = Lib.apply3DTransform(fullLayout._invTransform)(x0, y0); + var B = Lib.apply3DTransform(fullLayout._invTransform)(x1, y1); + + var Ax = A[0]; + var Ay = A[1]; + var Bx = B[0]; + var By = B[1]; + + return { + x: Ax, + y: Ay, + width: Bx - Ax, + height: By - Ay, + top: Math.min(Ay, By), + left: Math.min(Ax, Bx), + right: Math.max(Ax, Bx), + bottom: Math.max(Ay, By), + }; +} + +},{"../../lib":534,"../../lib/events":526,"../../lib/override_cursor":545,"../../lib/svg_text_utils":559,"../../plots/cartesian/axes":583,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"../legend/defaults":453,"../legend/draw":454,"./constants":435,"./helpers":437,"@plotly/d3":17,"fast-isnumeric":94,"tinycolor2":350}],439:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67135,7 +68578,7 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts coerce('hoverlabel.align', opts.align); }; -},{"../../lib":551,"../color":418,"./helpers":454}],457:[function(_dereq_,module,exports){ +},{"../../lib":534,"../color":401,"./helpers":437}],440:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67153,7 +68596,7 @@ module.exports = function handleHoverModeDefaults(layoutIn, layoutOut) { return coerce('hovermode'); }; -},{"../../lib":551,"./layout_attributes":459}],458:[function(_dereq_,module,exports){ +},{"../../lib":534,"./layout_attributes":442}],441:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -67224,7 +68667,7 @@ function castHoverinfo(trace, fullLayout, ptNumber) { return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce); } -},{"../../lib":551,"../dragelement":437,"./attributes":449,"./calc":450,"./click":451,"./constants":452,"./defaults":453,"./helpers":454,"./hover":455,"./layout_attributes":459,"./layout_defaults":460,"./layout_global_defaults":461,"@plotly/d3":17}],459:[function(_dereq_,module,exports){ +},{"../../lib":534,"../dragelement":420,"./attributes":432,"./calc":433,"./click":434,"./constants":435,"./defaults":436,"./helpers":437,"./hover":438,"./layout_attributes":442,"./layout_defaults":443,"./layout_global_defaults":444,"@plotly/d3":17}],442:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -67312,7 +68755,7 @@ module.exports = { } }; -},{"../../plots/font_attributes":629,"./constants":452}],460:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":612,"./constants":435}],443:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67351,7 +68794,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":551,"./hoverlabel_defaults":456,"./hovermode_defaults":457,"./layout_attributes":459}],461:[function(_dereq_,module,exports){ +},{"../../lib":534,"./hoverlabel_defaults":439,"./hovermode_defaults":440,"./layout_attributes":442}],444:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67366,7 +68809,7 @@ module.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":551,"./hoverlabel_defaults":456,"./layout_attributes":459}],462:[function(_dereq_,module,exports){ +},{"../../lib":534,"./hoverlabel_defaults":439,"./layout_attributes":442}],445:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67709,7 +69152,7 @@ module.exports = { contentDefaults: contentDefaults }; -},{"../../lib":551,"../../lib/regex":567,"../../plot_api/plot_template":589,"../../plots/cartesian/constants":607,"../../plots/domain":628}],463:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../lib/regex":550,"../../plot_api/plot_template":572,"../../plots/cartesian/constants":590,"../../plots/domain":611}],446:[function(_dereq_,module,exports){ 'use strict'; var cartesianConstants = _dereq_('../../plots/cartesian/constants'); @@ -67811,7 +69254,7 @@ module.exports = templatedArray('image', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":524,"../../plot_api/plot_template":589,"../../plots/cartesian/constants":607}],464:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":507,"../../plot_api/plot_template":572,"../../plots/cartesian/constants":590}],447:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -67883,7 +69326,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":578,"fast-isnumeric":97}],465:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":561,"fast-isnumeric":94}],448:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -67940,7 +69383,7 @@ function imageDefaults(imageIn, imageOut, fullLayout) { return imageOut; } -},{"../../lib":551,"../../plots/array_container_defaults":595,"../../plots/cartesian/axes":600,"./attributes":463}],466:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/array_container_defaults":578,"../../plots/cartesian/axes":583,"./attributes":446}],449:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -68190,7 +69633,7 @@ module.exports = function draw(gd) { } }; -},{"../../constants/xmlns_namespaces":531,"../../plots/cartesian/axes":600,"../../plots/cartesian/axis_ids":604,"../drawing":440,"@plotly/d3":17}],467:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":514,"../../plots/cartesian/axes":583,"../../plots/cartesian/axis_ids":587,"../drawing":423,"@plotly/d3":17}],450:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -68206,7 +69649,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":613,"./attributes":463,"./convert_coords":464,"./defaults":465,"./draw":466}],468:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":596,"./attributes":446,"./convert_coords":447,"./defaults":448,"./draw":449}],451:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -68332,7 +69775,7 @@ module.exports = { editType: 'legend' }; -},{"../../plots/font_attributes":629,"../color/attributes":417}],469:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":612,"../color/attributes":400}],452:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -68348,7 +69791,7 @@ module.exports = { itemGap: 5 }; -},{}],470:[function(_dereq_,module,exports){ +},{}],453:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -68481,7 +69924,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":551,"../../plot_api/plot_template":589,"../../plots/layout_attributes":644,"../../registry":649,"./attributes":468,"./helpers":474}],471:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../../plots/layout_attributes":627,"../../registry":632,"./attributes":451,"./helpers":457}],454:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -69306,7 +70749,7 @@ function getYanchor(legendObj) { 'top'; } -},{"../../constants/alignment":523,"../../lib":551,"../../lib/events":543,"../../lib/svg_text_utils":576,"../../plots/plots":646,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"./constants":469,"./get_legend_data":472,"./handle_click":473,"./helpers":474,"./style":476,"@plotly/d3":17}],472:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../lib":534,"../../lib/events":526,"../../lib/svg_text_utils":559,"../../plots/plots":629,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"./constants":452,"./get_legend_data":455,"./handle_click":456,"./helpers":457,"./style":459,"@plotly/d3":17}],455:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -69482,7 +70925,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../registry":649,"./helpers":474}],473:[function(_dereq_,module,exports){ +},{"../../registry":632,"./helpers":457}],456:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -69724,7 +71167,7 @@ module.exports = function handleClick(g, gd, numClicks) { } }; -},{"../../lib":551,"../../registry":649}],474:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632}],457:[function(_dereq_,module,exports){ 'use strict'; exports.isGrouped = function isGrouped(legendLayout) { @@ -69739,7 +71182,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{}],475:[function(_dereq_,module,exports){ +},{}],458:[function(_dereq_,module,exports){ 'use strict'; @@ -69754,7 +71197,7 @@ module.exports = { style: _dereq_('./style') }; -},{"./attributes":468,"./defaults":470,"./draw":471,"./style":476}],476:[function(_dereq_,module,exports){ +},{"./attributes":451,"./defaults":453,"./draw":454,"./style":459}],459:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -70441,7 +71884,7 @@ function dimAttr(v, dflt, max) { return v; } -},{"../../lib":551,"../../registry":649,"../../traces/pie/helpers":675,"../../traces/pie/style_one":676,"../../traces/scatter/subtypes":703,"../color":418,"../colorscale/helpers":429,"../drawing":440,"./constants":469,"@plotly/d3":17}],477:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"../../traces/pie/helpers":658,"../../traces/pie/style_one":659,"../../traces/scatter/subtypes":686,"../color":401,"../colorscale/helpers":412,"../drawing":423,"./constants":452,"@plotly/d3":17}],460:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -70485,7 +71928,7 @@ module.exports = { } }; -},{"./constants":479}],478:[function(_dereq_,module,exports){ +},{"./constants":462}],461:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -71237,7 +72680,7 @@ function resetView(gd, subplotType) { Registry.call('_guiRelayout', gd, aObj); } -},{"../../fonts/ploticon":533,"../../lib":551,"../../plots/cartesian/axis_ids":604,"../../plots/plots":646,"../../registry":649,"../shapes/draw":502}],479:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":516,"../../lib":534,"../../plots/cartesian/axis_ids":587,"../../plots/plots":629,"../../registry":632,"../shapes/draw":485}],462:[function(_dereq_,module,exports){ 'use strict'; var modeBarButtons = _dereq_('./buttons'); @@ -71280,7 +72723,7 @@ module.exports = { foreButtons: foreButtons }; -},{"./buttons":478}],480:[function(_dereq_,module,exports){ +},{"./buttons":461}],463:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -71306,7 +72749,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('remove'); }; -},{"../../lib":551,"../../plot_api/plot_template":589,"../color":418,"./attributes":477}],481:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../color":401,"./attributes":460}],464:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -71319,7 +72762,7 @@ module.exports = { manage: _dereq_('./manage') }; -},{"./attributes":477,"./defaults":480,"./manage":482}],482:[function(_dereq_,module,exports){ +},{"./attributes":460,"./defaults":463,"./manage":465}],465:[function(_dereq_,module,exports){ 'use strict'; var axisIds = _dereq_('../../plots/cartesian/axis_ids'); @@ -71674,7 +73117,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plots/cartesian/axis_ids":604,"../../registry":649,"../../traces/scatter/subtypes":703,"../fx/helpers":454,"./buttons":478,"./constants":479,"./modebar":483}],483:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axis_ids":587,"../../registry":632,"../../traces/scatter/subtypes":686,"../fx/helpers":437,"./buttons":461,"./constants":462,"./modebar":466}],466:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -72011,7 +73454,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../fonts/ploticon":533,"../../lib":551,"@plotly/d3":17,"fast-isnumeric":97}],484:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":516,"../../lib":534,"@plotly/d3":17,"fast-isnumeric":94}],467:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -72109,7 +73552,7 @@ module.exports = { editType: 'plot' }; -},{"../../plot_api/plot_template":589,"../../plots/font_attributes":629,"../color/attributes":417}],485:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":572,"../../plots/font_attributes":612,"../color/attributes":400}],468:[function(_dereq_,module,exports){ 'use strict'; @@ -72130,7 +73573,7 @@ module.exports = { darkAmount: 10 }; -},{}],486:[function(_dereq_,module,exports){ +},{}],469:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -72214,7 +73657,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":551,"../../plot_api/plot_template":589,"../../plots/array_container_defaults":595,"../color":418,"./attributes":484,"./constants":485}],487:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../../plots/array_container_defaults":578,"../color":401,"./attributes":467,"./constants":468}],470:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -72461,7 +73904,7 @@ function reposition(gd, buttons, opts, axName, selector) { selector.attr('transform', strTranslate(lx, ly)); } -},{"../../constants/alignment":523,"../../lib":551,"../../lib/svg_text_utils":576,"../../plots/cartesian/axis_ids":604,"../../plots/plots":646,"../../registry":649,"../color":418,"../drawing":440,"./constants":485,"./get_update_object":488,"@plotly/d3":17}],488:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../lib":534,"../../lib/svg_text_utils":559,"../../plots/cartesian/axis_ids":587,"../../plots/plots":629,"../../registry":632,"../color":401,"../drawing":423,"./constants":468,"./get_update_object":471,"@plotly/d3":17}],471:[function(_dereq_,module,exports){ 'use strict'; var d3Time = _dereq_('d3-time'); @@ -72510,7 +73953,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"../../lib":551,"d3-time":89}],489:[function(_dereq_,module,exports){ +},{"../../lib":534,"d3-time":86}],472:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -72529,7 +73972,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":484,"./defaults":486,"./draw":487}],490:[function(_dereq_,module,exports){ +},{"./attributes":467,"./defaults":469,"./draw":470}],473:[function(_dereq_,module,exports){ 'use strict'; var colorAttributes = _dereq_('../color/attributes'); @@ -72581,7 +74024,7 @@ module.exports = { editType: 'calc' }; -},{"../color/attributes":417}],491:[function(_dereq_,module,exports){ +},{"../color/attributes":400}],474:[function(_dereq_,module,exports){ 'use strict'; var listAxes = _dereq_('../../plots/cartesian/axis_ids').list; @@ -72607,7 +74050,7 @@ module.exports = function calcAutorange(gd) { } }; -},{"../../plots/cartesian/autorange":599,"../../plots/cartesian/axis_ids":604,"./constants":492}],492:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/autorange":582,"../../plots/cartesian/axis_ids":587,"./constants":475}],475:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -72655,7 +74098,7 @@ module.exports = { extraPad: 15 }; -},{}],493:[function(_dereq_,module,exports){ +},{}],476:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -72733,7 +74176,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName) { containerOut._input = containerIn; }; -},{"../../lib":551,"../../plot_api/plot_template":589,"../../plots/cartesian/axis_ids":604,"./attributes":490,"./oppaxis_attributes":497}],494:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plot_api/plot_template":572,"../../plots/cartesian/axis_ids":587,"./attributes":473,"./oppaxis_attributes":480}],477:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -73369,7 +74812,7 @@ function drawGrabbers(rangeSlider, gd, axisOpts, opts) { grabAreaMax.attr('height', opts._height); } -},{"../../lib":551,"../../lib/setcursor":571,"../../plots/cartesian":614,"../../plots/cartesian/axis_ids":604,"../../plots/plots":646,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"../titles":516,"./constants":492,"@plotly/d3":17}],495:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../lib/setcursor":554,"../../plots/cartesian":597,"../../plots/cartesian/axis_ids":587,"../../plots/plots":629,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"../titles":499,"./constants":475,"@plotly/d3":17}],478:[function(_dereq_,module,exports){ 'use strict'; var axisIDs = _dereq_('../../plots/cartesian/axis_ids'); @@ -73436,7 +74879,7 @@ exports.autoMarginOpts = function(gd, ax) { }; }; -},{"../../constants/alignment":523,"../../lib/svg_text_utils":576,"../../plots/cartesian/axis_ids":604,"./constants":492}],496:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../lib/svg_text_utils":559,"../../plots/cartesian/axis_ids":587,"./constants":475}],479:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -73467,7 +74910,7 @@ module.exports = { autoMarginOpts: helpers.autoMarginOpts }; -},{"../../lib":551,"./attributes":490,"./calc_autorange":491,"./defaults":493,"./draw":494,"./helpers":495,"./oppaxis_attributes":497}],497:[function(_dereq_,module,exports){ +},{"../../lib":534,"./attributes":473,"./calc_autorange":474,"./defaults":476,"./draw":477,"./helpers":478,"./oppaxis_attributes":480}],480:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -73493,7 +74936,7 @@ module.exports = { editType: 'calc' }; -},{}],498:[function(_dereq_,module,exports){ +},{}],481:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -73603,7 +75046,7 @@ module.exports = templatedArray('shape', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":524,"../../lib/extend":544,"../../plot_api/plot_template":589,"../../traces/scatter/attributes":678,"../annotations/attributes":401,"../drawing/attributes":439}],499:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":507,"../../lib/extend":527,"../../plot_api/plot_template":572,"../../traces/scatter/attributes":661,"../annotations/attributes":384,"../drawing/attributes":422}],482:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -73715,7 +75158,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":551,"../../plots/cartesian/axes":600,"./constants":500,"./helpers":509}],500:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/cartesian/axes":583,"./constants":483,"./helpers":492}],483:[function(_dereq_,module,exports){ 'use strict'; @@ -73770,7 +75213,7 @@ module.exports = { } }; -},{}],501:[function(_dereq_,module,exports){ +},{}],484:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -73892,7 +75335,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) { } } -},{"../../lib":551,"../../plots/array_container_defaults":595,"../../plots/cartesian/axes":600,"./attributes":498,"./helpers":509}],502:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/array_container_defaults":578,"../../plots/cartesian/axes":583,"./attributes":481,"./helpers":492}],485:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -74657,7 +76100,7 @@ function eraseActiveShape(gd) { } } -},{"../../lib":551,"../../lib/setcursor":571,"../../plot_api/plot_template":589,"../../plots/cartesian/axes":600,"../../plots/cartesian/handle_outline":611,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"./constants":500,"./draw_newshape/display_outlines":506,"./draw_newshape/helpers":507,"./helpers":509}],503:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../lib/setcursor":554,"../../plot_api/plot_template":572,"../../plots/cartesian/axes":583,"../../plots/cartesian/handle_outline":594,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"./constants":483,"./draw_newshape/display_outlines":489,"./draw_newshape/helpers":490,"./helpers":492}],486:[function(_dereq_,module,exports){ 'use strict'; var dash = _dereq_('../../drawing/attributes').dash; @@ -74733,7 +76176,7 @@ module.exports = { } }; -},{"../../../lib/extend":544,"../../drawing/attributes":439}],504:[function(_dereq_,module,exports){ +},{"../../../lib/extend":527,"../../drawing/attributes":422}],487:[function(_dereq_,module,exports){ 'use strict'; var CIRCLE_SIDES = 32; // should be divisible by 4 @@ -74749,7 +76192,7 @@ module.exports = { SQRT2: Math.sqrt(2) }; -},{}],505:[function(_dereq_,module,exports){ +},{}],488:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../color'); @@ -74772,7 +76215,7 @@ module.exports = function supplyDrawNewShapeDefaults(layoutIn, layoutOut, coerce coerce('activeshape.opacity'); }; -},{"../../color":418}],506:[function(_dereq_,module,exports){ +},{"../../color":401}],489:[function(_dereq_,module,exports){ 'use strict'; var dragElement = _dereq_('../../dragelement'); @@ -75058,7 +76501,7 @@ function recordPositions(polygonsOut, polygonsIn) { return polygonsOut; } -},{"../../../plots/cartesian/handle_outline":611,"../../../registry":649,"../../dragelement":437,"../../dragelement/helpers":436,"./constants":504,"./helpers":507,"./newshapes":508}],507:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":594,"../../../registry":632,"../../dragelement":420,"../../dragelement/helpers":419,"./constants":487,"./helpers":490,"./newshapes":491}],490:[function(_dereq_,module,exports){ 'use strict'; var parseSvgPath = _dereq_('parse-svg-path'); @@ -75387,7 +76830,7 @@ exports.ellipseOver = function(pos) { }; }; -},{"../../../plots/cartesian/helpers":612,"./constants":504,"parse-svg-path":312}],508:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/helpers":595,"./constants":487,"parse-svg-path":300}],491:[function(_dereq_,module,exports){ 'use strict'; var dragHelpers = _dereq_('../../dragelement/helpers'); @@ -75637,7 +77080,7 @@ function fixDatesForPaths(polygons, xaxis, yaxis) { return polygons; } -},{"../../../plots/cartesian/handle_outline":611,"../../../plots/cartesian/helpers":612,"../../dragelement/helpers":436,"./constants":504,"./helpers":507}],509:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":594,"../../../plots/cartesian/helpers":595,"../../dragelement/helpers":419,"./constants":487,"./helpers":490}],492:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -75786,7 +77229,7 @@ exports.makeOptionsAndPlotinfo = function(gd, index) { }; }; -},{"../../lib":551,"./constants":500}],510:[function(_dereq_,module,exports){ +},{"../../lib":534,"./constants":483}],493:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -75805,7 +77248,7 @@ module.exports = { drawOne: drawModule.drawOne }; -},{"../../plots/cartesian/include_components":613,"./attributes":498,"./calc_autorange":499,"./defaults":501,"./draw":502,"./draw_newshape/defaults":505}],511:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":596,"./attributes":481,"./calc_autorange":482,"./defaults":484,"./draw":485,"./draw_newshape/defaults":488}],494:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -75979,7 +77422,7 @@ module.exports = overrideAll(templatedArray('slider', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plot_api/plot_template":589,"../../plots/animation_attributes":594,"../../plots/font_attributes":629,"../../plots/pad_attributes":645,"./constants":512}],512:[function(_dereq_,module,exports){ +},{"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plot_api/plot_template":572,"../../plots/animation_attributes":577,"../../plots/font_attributes":612,"../../plots/pad_attributes":628,"./constants":495}],495:[function(_dereq_,module,exports){ 'use strict'; @@ -76064,7 +77507,7 @@ module.exports = { currentValueInset: 0, }; -},{}],513:[function(_dereq_,module,exports){ +},{}],496:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -76171,7 +77614,7 @@ function stepDefaults(valueIn, valueOut) { } } -},{"../../lib":551,"../../plots/array_container_defaults":595,"./attributes":511,"./constants":512}],514:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/array_container_defaults":578,"./attributes":494,"./constants":495}],497:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -76805,7 +78248,7 @@ function drawRail(sliderGroup, sliderOpts) { ); } -},{"../../constants/alignment":523,"../../lib":551,"../../lib/svg_text_utils":576,"../../plot_api/plot_template":589,"../../plots/plots":646,"../color":418,"../drawing":440,"./constants":512,"@plotly/d3":17}],515:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../lib":534,"../../lib/svg_text_utils":559,"../../plot_api/plot_template":572,"../../plots/plots":629,"../color":401,"../drawing":423,"./constants":495,"@plotly/d3":17}],498:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -76820,7 +78263,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":511,"./constants":512,"./defaults":513,"./draw":514}],516:[function(_dereq_,module,exports){ +},{"./attributes":494,"./constants":495,"./defaults":496,"./draw":497}],499:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -77079,7 +78522,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":523,"../../constants/interactions":529,"../../lib":551,"../../lib/svg_text_utils":576,"../../plots/plots":646,"../../registry":649,"../color":418,"../drawing":440,"@plotly/d3":17,"fast-isnumeric":97}],517:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../constants/interactions":512,"../../lib":534,"../../lib/svg_text_utils":559,"../../plots/plots":629,"../../registry":632,"../color":401,"../drawing":423,"@plotly/d3":17,"fast-isnumeric":94}],500:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -77202,7 +78645,7 @@ module.exports = overrideAll(templatedArray('updatemenu', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plot_api/plot_template":589,"../../plots/font_attributes":629,"../../plots/pad_attributes":645,"../color/attributes":417}],518:[function(_dereq_,module,exports){ +},{"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plot_api/plot_template":572,"../../plots/font_attributes":612,"../../plots/pad_attributes":628,"../color/attributes":400}],501:[function(_dereq_,module,exports){ 'use strict'; @@ -77274,7 +78717,7 @@ module.exports = { } }; -},{}],519:[function(_dereq_,module,exports){ +},{}],502:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -77349,7 +78792,7 @@ function buttonDefaults(buttonIn, buttonOut) { } } -},{"../../lib":551,"../../plots/array_container_defaults":595,"./attributes":517,"./constants":518}],520:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../plots/array_container_defaults":578,"./attributes":500,"./constants":501}],503:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -77991,9 +79434,9 @@ function removeAllButtons(gButton, newMenuIndexAttr) { .selectAll('g.' + constants.dropdownButtonClassName).remove(); } -},{"../../constants/alignment":523,"../../lib":551,"../../lib/svg_text_utils":576,"../../plot_api/plot_template":589,"../../plots/plots":646,"../color":418,"../drawing":440,"./constants":518,"./scrollbox":522,"@plotly/d3":17}],521:[function(_dereq_,module,exports){ -arguments[4][515][0].apply(exports,arguments) -},{"./attributes":517,"./constants":518,"./defaults":519,"./draw":520,"dup":515}],522:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../lib":534,"../../lib/svg_text_utils":559,"../../plot_api/plot_template":572,"../../plots/plots":629,"../color":401,"../drawing":423,"./constants":501,"./scrollbox":505,"@plotly/d3":17}],504:[function(_dereq_,module,exports){ +arguments[4][498][0].apply(exports,arguments) +},{"./attributes":500,"./constants":501,"./defaults":502,"./draw":503,"dup":498}],505:[function(_dereq_,module,exports){ 'use strict'; module.exports = ScrollBox; @@ -78450,7 +79893,7 @@ ScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) } }; -},{"../../lib":551,"../color":418,"../drawing":440,"@plotly/d3":17}],523:[function(_dereq_,module,exports){ +},{"../../lib":534,"../color":401,"../drawing":423,"@plotly/d3":17}],506:[function(_dereq_,module,exports){ 'use strict'; // fraction of some size to get to a named position @@ -78507,7 +79950,7 @@ module.exports = { } }; -},{}],524:[function(_dereq_,module,exports){ +},{}],507:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -78530,7 +79973,7 @@ module.exports = { } }; -},{}],525:[function(_dereq_,module,exports){ +},{}],508:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -78538,7 +79981,7 @@ module.exports = { DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format' }; -},{}],526:[function(_dereq_,module,exports){ +},{}],509:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -78568,7 +80011,7 @@ module.exports = { } }; -},{}],527:[function(_dereq_,module,exports){ +},{}],510:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -78580,7 +80023,7 @@ module.exports = { longdashdot: [[0.5, 0.7, 0.8, 1], 10] }; -},{}],528:[function(_dereq_,module,exports){ +},{}],511:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -78594,7 +80037,7 @@ module.exports = { x: '❌' }; -},{}],529:[function(_dereq_,module,exports){ +},{}],512:[function(_dereq_,module,exports){ 'use strict'; @@ -78609,7 +80052,7 @@ module.exports = { DESELECTDIM: 0.2 }; -},{}],530:[function(_dereq_,module,exports){ +},{}],513:[function(_dereq_,module,exports){ 'use strict'; @@ -78674,7 +80117,7 @@ module.exports = { MINUS_SIGN: '\u2212' }; -},{}],531:[function(_dereq_,module,exports){ +},{}],514:[function(_dereq_,module,exports){ 'use strict'; @@ -78689,7 +80132,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],532:[function(_dereq_,module,exports){ +},{}],515:[function(_dereq_,module,exports){ 'use strict'; exports.version = _dereq_('./version').version; @@ -78773,7 +80216,7 @@ exports.Fx = { exports.Snapshot = _dereq_('./snapshot'); exports.PlotSchema = _dereq_('./plot_api/plot_schema'); -},{"../build/plotcss":1,"./components/annotations":409,"./components/annotations3d":414,"./components/colorbar":424,"./components/colorscale":430,"./components/errorbars":446,"./components/fx":458,"./components/grid":462,"./components/images":467,"./components/legend":475,"./components/modebar":481,"./components/rangeselector":489,"./components/rangeslider":496,"./components/shapes":510,"./components/sliders":515,"./components/updatemenus":521,"./fonts/ploticon":533,"./locale-en":580,"./locale-en-us":579,"./plot_api":584,"./plot_api/plot_schema":588,"./plots/plots":646,"./registry":649,"./snapshot":654,"./traces/scatter":690,"./version":731,"native-promise-only":296}],533:[function(_dereq_,module,exports){ +},{"../build/plotcss":1,"./components/annotations":392,"./components/annotations3d":397,"./components/colorbar":407,"./components/colorscale":413,"./components/errorbars":429,"./components/fx":441,"./components/grid":445,"./components/images":450,"./components/legend":458,"./components/modebar":464,"./components/rangeselector":472,"./components/rangeslider":479,"./components/shapes":493,"./components/sliders":498,"./components/updatemenus":504,"./fonts/ploticon":516,"./locale-en":563,"./locale-en-us":562,"./plot_api":567,"./plot_api/plot_schema":571,"./plots/plots":629,"./registry":632,"./snapshot":637,"./traces/scatter":673,"./version":714,"native-promise-only":284}],516:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -78945,7 +80388,7 @@ module.exports = { } }; -},{}],534:[function(_dereq_,module,exports){ +},{}],517:[function(_dereq_,module,exports){ 'use strict'; @@ -79000,7 +80443,7 @@ exports.isBottomAnchor = function isBottomAnchor(opts) { ); }; -},{}],535:[function(_dereq_,module,exports){ +},{}],518:[function(_dereq_,module,exports){ 'use strict'; var modModule = _dereq_('./mod'); @@ -79233,7 +80676,7 @@ module.exports = { pathAnnulus: pathAnnulus }; -},{"./mod":558}],536:[function(_dereq_,module,exports){ +},{"./mod":541}],519:[function(_dereq_,module,exports){ 'use strict'; var isArray = Array.isArray; @@ -79375,7 +80818,7 @@ function _rowLength(z, fn, len0) { return 0; } -},{}],537:[function(_dereq_,module,exports){ +},{}],520:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -79399,7 +80842,7 @@ module.exports = function cleanNumber(v) { return BADNUM; }; -},{"../constants/numerical":530,"fast-isnumeric":97}],538:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"fast-isnumeric":94}],521:[function(_dereq_,module,exports){ 'use strict'; /** @@ -79419,7 +80862,7 @@ module.exports = function clearGlCanvases(gd) { } }; -},{}],539:[function(_dereq_,module,exports){ +},{}],522:[function(_dereq_,module,exports){ 'use strict'; /** @@ -79434,7 +80877,7 @@ module.exports = function clearResponsive(gd) { } }; -},{}],540:[function(_dereq_,module,exports){ +},{}],523:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -79879,7 +81322,7 @@ function validate(value, opts) { } exports.validate = validate; -},{"../components/color":418,"../components/colorscale/scales":433,"../constants/interactions":529,"../plots/attributes":596,"./array":536,"./mod":558,"./nested_property":559,"./regex":567,"fast-isnumeric":97,"tinycolor2":366}],541:[function(_dereq_,module,exports){ +},{"../components/color":401,"../components/colorscale/scales":416,"../constants/interactions":512,"../plots/attributes":579,"./array":519,"./mod":541,"./nested_property":542,"./regex":550,"fast-isnumeric":94,"tinycolor2":350}],524:[function(_dereq_,module,exports){ 'use strict'; var timeFormat = _dereq_('d3-time-format').timeFormat; @@ -80483,7 +81926,7 @@ exports.findExactDates = function(data, calendar) { }; }; -},{"../constants/numerical":530,"../registry":649,"./loggers":555,"./mod":558,"d3-time-format":87,"fast-isnumeric":97}],542:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"../registry":632,"./loggers":538,"./mod":541,"d3-time-format":84,"fast-isnumeric":94}],525:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -80653,7 +82096,7 @@ module.exports = { equalDomRects: equalDomRects }; -},{"./loggers":555,"./matrix":557,"@plotly/d3":17,"gl-mat4":141}],543:[function(_dereq_,module,exports){ +},{"./loggers":538,"./matrix":540,"@plotly/d3":17,"gl-mat4":135}],526:[function(_dereq_,module,exports){ 'use strict'; /* global jQuery:false */ @@ -80817,7 +82260,7 @@ var Events = { module.exports = Events; -},{"events":54}],544:[function(_dereq_,module,exports){ +},{"events":54}],527:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('./is_plain_object.js'); @@ -80922,7 +82365,7 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { return target; } -},{"./is_plain_object.js":552}],545:[function(_dereq_,module,exports){ +},{"./is_plain_object.js":535}],528:[function(_dereq_,module,exports){ 'use strict'; @@ -80964,7 +82407,7 @@ module.exports = function filterUnique(array) { return out; }; -},{}],546:[function(_dereq_,module,exports){ +},{}],529:[function(_dereq_,module,exports){ 'use strict'; /** Filter out object items with visible !== true @@ -81004,7 +82447,7 @@ function isCalcData(cont) { ); } -},{}],547:[function(_dereq_,module,exports){ +},{}],530:[function(_dereq_,module,exports){ 'use strict'; var mod = _dereq_('./mod').mod; @@ -81240,7 +82683,7 @@ exports.findPointOnPath = function findPointOnPath(path, val, coord, opts) { return pt; }; -},{"./mod":558}],548:[function(_dereq_,module,exports){ +},{"./mod":541}],531:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -81333,7 +82776,7 @@ module.exports = { parseColorScale: parseColorScale }; -},{"../components/color/attributes":417,"../components/colorscale":430,"./array":536,"color-normalize":68,"fast-isnumeric":97,"tinycolor2":366}],549:[function(_dereq_,module,exports){ +},{"../components/color/attributes":400,"../components/colorscale":413,"./array":519,"color-normalize":68,"fast-isnumeric":94,"tinycolor2":350}],532:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -81341,7 +82784,7 @@ module.exports = { module.exports = function identity(d) { return d; }; -},{}],550:[function(_dereq_,module,exports){ +},{}],533:[function(_dereq_,module,exports){ 'use strict'; module.exports = function incrementNumeric(x, delta) { @@ -81374,7 +82817,7 @@ module.exports = function incrementNumeric(x, delta) { return newX; }; -},{}],551:[function(_dereq_,module,exports){ +},{}],534:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -82762,7 +84205,7 @@ lib.getPositionFromD3Event = function() { } }; -},{"../constants/numerical":530,"./anchor_utils":534,"./angles":535,"./array":536,"./clean_number":537,"./clear_responsive":539,"./coerce":540,"./dates":541,"./dom":542,"./extend":544,"./filter_unique":545,"./filter_visible":546,"./geometry2d":547,"./identity":549,"./increment":550,"./is_plain_object":552,"./keyed_container":553,"./localize":554,"./loggers":555,"./make_trace_groups":556,"./matrix":557,"./mod":558,"./nested_property":559,"./noop":560,"./notifier":561,"./preserve_drawing_buffer":564,"./push_unique":565,"./regex":567,"./relative_attr":568,"./relink_private":569,"./search":570,"./sort_object_keys":573,"./stats":574,"./throttle":577,"./to_log_range":578,"@plotly/d3":17,"d3-format":86,"d3-time-format":87,"fast-isnumeric":97}],552:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"./anchor_utils":517,"./angles":518,"./array":519,"./clean_number":520,"./clear_responsive":522,"./coerce":523,"./dates":524,"./dom":525,"./extend":527,"./filter_unique":528,"./filter_visible":529,"./geometry2d":530,"./identity":532,"./increment":533,"./is_plain_object":535,"./keyed_container":536,"./localize":537,"./loggers":538,"./make_trace_groups":539,"./matrix":540,"./mod":541,"./nested_property":542,"./noop":543,"./notifier":544,"./preserve_drawing_buffer":547,"./push_unique":548,"./regex":550,"./relative_attr":551,"./relink_private":552,"./search":553,"./sort_object_keys":556,"./stats":557,"./throttle":560,"./to_log_range":561,"@plotly/d3":17,"d3-format":83,"d3-time-format":84,"fast-isnumeric":94}],535:[function(_dereq_,module,exports){ 'use strict'; // more info: http://stackoverflow.com/questions/18531624/isplainobject-thing @@ -82781,7 +84224,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],553:[function(_dereq_,module,exports){ +},{}],536:[function(_dereq_,module,exports){ 'use strict'; var nestedProperty = _dereq_('./nested_property'); @@ -82966,7 +84409,7 @@ module.exports = function keyedContainer(baseObj, path, keyName, valueName) { return obj; }; -},{"./nested_property":559}],554:[function(_dereq_,module,exports){ +},{"./nested_property":542}],537:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -83013,7 +84456,7 @@ module.exports = function localize(gd, s) { return s; }; -},{"../registry":649}],555:[function(_dereq_,module,exports){ +},{"../registry":632}],538:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-console */ @@ -83090,7 +84533,7 @@ loggers.error = function() { } }; -},{"../plot_api/plot_config":587,"./notifier":561}],556:[function(_dereq_,module,exports){ +},{"../plot_api/plot_config":570,"./notifier":544}],539:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -83125,7 +84568,7 @@ module.exports = function makeTraceGroups(traceLayer, cdModule, cls) { return traces; }; -},{"@plotly/d3":17}],557:[function(_dereq_,module,exports){ +},{"@plotly/d3":17}],540:[function(_dereq_,module,exports){ 'use strict'; var mat4X4 = _dereq_('gl-mat4'); @@ -83268,7 +84711,7 @@ exports.inverseTransformMatrix = function(m) { ]; }; -},{"gl-mat4":141}],558:[function(_dereq_,module,exports){ +},{"gl-mat4":135}],541:[function(_dereq_,module,exports){ 'use strict'; /** @@ -83295,7 +84738,7 @@ module.exports = { modHalf: modHalf }; -},{}],559:[function(_dereq_,module,exports){ +},{}],542:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -83532,7 +84975,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"./array":536,"fast-isnumeric":97}],560:[function(_dereq_,module,exports){ +},{"./array":519,"fast-isnumeric":94}],543:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -83540,7 +84983,7 @@ function badContainer(container, propStr, propParts) { module.exports = function noop() {}; -},{}],561:[function(_dereq_,module,exports){ +},{}],544:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -83619,7 +85062,7 @@ module.exports = function(text, displayLength) { }); }; -},{"@plotly/d3":17,"fast-isnumeric":97}],562:[function(_dereq_,module,exports){ +},{"@plotly/d3":17,"fast-isnumeric":94}],545:[function(_dereq_,module,exports){ 'use strict'; var setCursor = _dereq_('./setcursor'); @@ -83658,7 +85101,7 @@ module.exports = function overrideCursor(el3, csr) { } }; -},{"./setcursor":571}],563:[function(_dereq_,module,exports){ +},{"./setcursor":554}],546:[function(_dereq_,module,exports){ 'use strict'; var dot = _dereq_('./matrix').dot; @@ -83901,7 +85344,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"../constants/numerical":530,"./matrix":557}],564:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"./matrix":540}],547:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -83963,7 +85406,7 @@ function getUserAgent() { return ua; } -},{"fast-isnumeric":97,"is-mobile":281}],565:[function(_dereq_,module,exports){ +},{"fast-isnumeric":94,"is-mobile":270}],548:[function(_dereq_,module,exports){ 'use strict'; /** @@ -83993,7 +85436,7 @@ module.exports = function pushUnique(array, item) { return array; }; -},{}],566:[function(_dereq_,module,exports){ +},{}],549:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -84185,7 +85628,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../lib":551,"../plot_api/plot_config":587}],567:[function(_dereq_,module,exports){ +},{"../lib":534,"../plot_api/plot_config":570}],550:[function(_dereq_,module,exports){ 'use strict'; /* @@ -84207,7 +85650,7 @@ exports.counter = function(head, tail, openEnded, matchBeginning) { return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail); }; -},{}],568:[function(_dereq_,module,exports){ +},{}],551:[function(_dereq_,module,exports){ 'use strict'; // ASCEND: chop off the last nesting level - either [] or . - to ascend @@ -84251,7 +85694,7 @@ module.exports = function(baseAttr, relativeAttr) { return baseAttr + relativeAttr; }; -},{}],569:[function(_dereq_,module,exports){ +},{}],552:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; @@ -84299,7 +85742,7 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { } }; -},{"./array":536,"./is_plain_object":552}],570:[function(_dereq_,module,exports){ +},{"./array":519,"./is_plain_object":535}],553:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -84491,7 +85934,7 @@ exports.findIndexOfMin = function(arr, fn) { return ind; }; -},{"../constants/numerical":530,"./identity":549,"./loggers":555,"fast-isnumeric":97}],571:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"./identity":532,"./loggers":538,"fast-isnumeric":94}],554:[function(_dereq_,module,exports){ 'use strict'; // works with our CSS cursor classes (see css/_cursor.scss) @@ -84505,7 +85948,7 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],572:[function(_dereq_,module,exports){ +},{}],555:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../components/color'); @@ -84560,14 +86003,14 @@ module.exports = function showNoWebGlMsg(scene) { return false; }; -},{"../components/color":418}],573:[function(_dereq_,module,exports){ +},{"../components/color":401}],556:[function(_dereq_,module,exports){ 'use strict'; module.exports = function sortObjectKeys(obj) { return Object.keys(obj).sort(); }; -},{}],574:[function(_dereq_,module,exports){ +},{}],557:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -84668,7 +86111,7 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"./array":536,"fast-isnumeric":97}],575:[function(_dereq_,module,exports){ +},{"./array":519,"fast-isnumeric":94}],558:[function(_dereq_,module,exports){ 'use strict'; var rgba = _dereq_('color-normalize'); @@ -84680,7 +86123,7 @@ function str2RgbaArray(color) { module.exports = str2RgbaArray; -},{"color-normalize":68}],576:[function(_dereq_,module,exports){ +},{"color-normalize":68}],559:[function(_dereq_,module,exports){ 'use strict'; /* global MathJax:false */ @@ -85589,7 +87032,7 @@ exports.makeEditable = function(context, options) { return d3.rebind(context, dispatch, 'on'); }; -},{"../constants/alignment":523,"../constants/xmlns_namespaces":531,"../lib":551,"@plotly/d3":17}],577:[function(_dereq_,module,exports){ +},{"../constants/alignment":506,"../constants/xmlns_namespaces":514,"../lib":534,"@plotly/d3":17}],560:[function(_dereq_,module,exports){ 'use strict'; var timerCache = {}; @@ -85684,7 +87127,7 @@ function _clearTimeout(cache) { } } -},{}],578:[function(_dereq_,module,exports){ +},{}],561:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -85704,7 +87147,7 @@ module.exports = function toLogRange(val, range) { return newVal; }; -},{"fast-isnumeric":97}],579:[function(_dereq_,module,exports){ +},{"fast-isnumeric":94}],562:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -85718,7 +87161,7 @@ module.exports = { } }; -},{}],580:[function(_dereq_,module,exports){ +},{}],563:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -85753,7 +87196,7 @@ module.exports = { } }; -},{}],581:[function(_dereq_,module,exports){ +},{}],564:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -85802,7 +87245,7 @@ module.exports = function containerArrayMatch(astr) { return {array: arrayStr, index: Number(match[1]), property: match[3] || ''}; }; -},{"../registry":649}],582:[function(_dereq_,module,exports){ +},{"../registry":632}],565:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -85917,7 +87360,7 @@ function overrideOne(attr, editTypeOverride, overrideContainers, key) { } } -},{"../lib":551}],583:[function(_dereq_,module,exports){ +},{"../lib":534}],566:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -86611,7 +88054,7 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) { } }; -},{"../components/color":418,"../lib":551,"../plots/cartesian/axis_ids":604,"../plots/plots":646,"../registry":649,"fast-isnumeric":97,"gl-mat4/fromQuat":131}],584:[function(_dereq_,module,exports){ +},{"../components/color":401,"../lib":534,"../plots/cartesian/axis_ids":587,"../plots/plots":629,"../registry":632,"fast-isnumeric":94,"gl-mat4/fromQuat":125}],567:[function(_dereq_,module,exports){ 'use strict'; var main = _dereq_('./plot_api'); @@ -86646,7 +88089,7 @@ var templateApi = _dereq_('./template_api'); exports.makeTemplate = templateApi.makeTemplate; exports.validateTemplate = templateApi.validateTemplate; -},{"../snapshot/download":651,"./plot_api":586,"./template_api":591,"./to_image":592,"./validate":593}],585:[function(_dereq_,module,exports){ +},{"../snapshot/download":634,"./plot_api":569,"./template_api":574,"./to_image":575,"./validate":576}],568:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('../lib/is_plain_object'); @@ -86850,7 +88293,7 @@ exports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, return true; }; -},{"../lib/is_plain_object":552,"../lib/loggers":555,"../lib/noop":560,"../lib/search":570,"../registry":649,"./container_array_match":581}],586:[function(_dereq_,module,exports){ +},{"../lib/is_plain_object":535,"../lib/loggers":538,"../lib/noop":543,"../lib/search":553,"../registry":632,"./container_array_match":564}],569:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -90664,7 +92107,7 @@ exports._guiUpdate = guiEdit(update); exports._storeDirectGUIEdit = _storeDirectGUIEdit; -},{"../components/color":418,"../components/drawing":440,"../constants/xmlns_namespaces":531,"../lib":551,"../lib/events":543,"../lib/queue":566,"../plots/cartesian/axes":600,"../plots/cartesian/constants":607,"../plots/cartesian/graph_interact":610,"../plots/cartesian/select":620,"../plots/plots":646,"../registry":649,"./edit_types":582,"./helpers":583,"./manage_arrays":585,"./plot_config":587,"./plot_schema":588,"./subroutines":590,"@plotly/d3":17,"fast-isnumeric":97,"has-hover":271}],587:[function(_dereq_,module,exports){ +},{"../components/color":401,"../components/drawing":423,"../constants/xmlns_namespaces":514,"../lib":534,"../lib/events":526,"../lib/queue":549,"../plots/cartesian/axes":583,"../plots/cartesian/constants":590,"../plots/cartesian/graph_interact":593,"../plots/cartesian/select":603,"../plots/plots":629,"../registry":632,"./edit_types":565,"./helpers":566,"./manage_arrays":568,"./plot_config":570,"./plot_schema":571,"./subroutines":573,"@plotly/d3":17,"fast-isnumeric":94,"has-hover":263}],570:[function(_dereq_,module,exports){ 'use strict'; /** @@ -90925,7 +92368,7 @@ module.exports = { dfltConfig: dfltConfig }; -},{}],588:[function(_dereq_,module,exports){ +},{}],571:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -91590,7 +93033,7 @@ function insertAttrs(baseAttrs, newAttrs, astr) { np.set(extendDeepAll(np.get() || {}, newAttrs)); } -},{"../lib":551,"../plots/animation_attributes":594,"../plots/attributes":596,"../plots/frame_attributes":630,"../plots/layout_attributes":644,"../registry":649,"./edit_types":582,"./plot_config":587}],589:[function(_dereq_,module,exports){ +},{"../lib":534,"../plots/animation_attributes":577,"../plots/attributes":579,"../plots/frame_attributes":613,"../plots/layout_attributes":627,"../registry":632,"./edit_types":565,"./plot_config":570}],572:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -91889,7 +93332,7 @@ exports.arrayEditor = function(parentIn, containerStr, itemOut) { }; }; -},{"../lib":551,"../plots/attributes":596}],590:[function(_dereq_,module,exports){ +},{"../lib":534,"../plots/attributes":579}],573:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -92605,7 +94048,7 @@ exports.drawMarginPushers = function(gd) { Registry.getComponentMethod('colorbar', 'draw')(gd); }; -},{"../components/color":418,"../components/drawing":440,"../components/modebar":481,"../components/titles":516,"../constants/alignment":523,"../lib":551,"../lib/clear_gl_canvases":538,"../plots/cartesian/autorange":599,"../plots/cartesian/axes":600,"../plots/cartesian/constraints":608,"../plots/plots":646,"../registry":649,"@plotly/d3":17}],591:[function(_dereq_,module,exports){ +},{"../components/color":401,"../components/drawing":423,"../components/modebar":464,"../components/titles":499,"../constants/alignment":506,"../lib":534,"../lib/clear_gl_canvases":521,"../plots/cartesian/autorange":582,"../plots/cartesian/axes":583,"../plots/cartesian/constraints":591,"../plots/plots":629,"../registry":632,"@plotly/d3":17}],574:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -93058,7 +94501,7 @@ function format(opts) { return opts; } -},{"../lib":551,"../plots/attributes":596,"../plots/plots":646,"./plot_config":587,"./plot_schema":588,"./plot_template":589}],592:[function(_dereq_,module,exports){ +},{"../lib":534,"../plots/attributes":579,"../plots/plots":629,"./plot_config":570,"./plot_schema":571,"./plot_template":572}],575:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -93265,7 +94708,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":551,"../plots/plots":646,"../snapshot/helpers":653,"../snapshot/svgtoimg":655,"../snapshot/tosvg":657,"../version":731,"./plot_api":586,"fast-isnumeric":97}],593:[function(_dereq_,module,exports){ +},{"../lib":534,"../plots/plots":629,"../snapshot/helpers":636,"../snapshot/svgtoimg":638,"../snapshot/tosvg":640,"../version":714,"./plot_api":569,"fast-isnumeric":94}],576:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -93688,7 +95131,7 @@ function convertPathToAttributeString(path) { return astr; } -},{"../lib":551,"../plots/plots":646,"./plot_config":587,"./plot_schema":588}],594:[function(_dereq_,module,exports){ +},{"../lib":534,"../plots/plots":629,"./plot_config":570,"./plot_schema":571}],577:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -93776,7 +95219,7 @@ module.exports = { } }; -},{}],595:[function(_dereq_,module,exports){ +},{}],578:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -93863,7 +95306,7 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut return contOut; }; -},{"../lib":551,"../plot_api/plot_template":589}],596:[function(_dereq_,module,exports){ +},{"../lib":534,"../plot_api/plot_template":572}],579:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -93985,7 +95428,7 @@ module.exports = { } }; -},{"../components/fx/attributes":449,"./font_attributes":629}],597:[function(_dereq_,module,exports){ +},{"../components/fx/attributes":432,"./font_attributes":612}],580:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -94080,7 +95523,7 @@ module.exports = function alignPeriod(trace, ax, axLetter, vals) { }; }; -},{"../../constants/numerical":530,"../../lib":551,"fast-isnumeric":97}],598:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"fast-isnumeric":94}],581:[function(_dereq_,module,exports){ 'use strict'; @@ -94097,7 +95540,7 @@ module.exports = { } }; -},{}],599:[function(_dereq_,module,exports){ +},{}],582:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -94724,7 +96167,7 @@ function goodNumber(v) { function lessOrEqual(v0, v1) { return v0 <= v1; } function greaterOrEqual(v0, v1) { return v0 >= v1; } -},{"../../components/drawing":440,"../../constants/numerical":530,"../../lib":551,"../../registry":649,"./axis_ids":604,"@plotly/d3":17,"fast-isnumeric":97}],600:[function(_dereq_,module,exports){ +},{"../../components/drawing":423,"../../constants/numerical":513,"../../lib":534,"../../registry":632,"./axis_ids":587,"@plotly/d3":17,"fast-isnumeric":94}],583:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -98566,7 +100009,7 @@ function hideCounterAxisInsideTickLabels(ax, opts) { } } -},{"../../components/color":418,"../../components/drawing":440,"../../components/titles":516,"../../constants/alignment":523,"../../constants/numerical":530,"../../lib":551,"../../lib/svg_text_utils":576,"../../plots/plots":646,"../../registry":649,"./autorange":599,"./axis_autotype":601,"./axis_ids":604,"./clean_ticks":606,"./layout_attributes":615,"./set_convert":621,"@plotly/d3":17,"fast-isnumeric":97}],601:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/drawing":423,"../../components/titles":499,"../../constants/alignment":506,"../../constants/numerical":513,"../../lib":534,"../../lib/svg_text_utils":559,"../../plots/plots":629,"../../registry":632,"./autorange":582,"./axis_autotype":584,"./axis_ids":587,"./clean_ticks":589,"./layout_attributes":598,"./set_convert":604,"@plotly/d3":17,"fast-isnumeric":94}],584:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -98688,7 +100131,7 @@ function multiCategory(a) { return isArrayOrTypedArray(a[0]) && isArrayOrTypedArray(a[1]); } -},{"../../constants/numerical":530,"../../lib":551,"fast-isnumeric":97}],602:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"fast-isnumeric":94}],585:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -99000,7 +100443,7 @@ function indexOfDay(v) { ]; } -},{"../../lib":551,"../../registry":649,"../array_container_defaults":595,"./category_order_defaults":605,"./constants":607,"./layout_attributes":615,"./line_grid_defaults":617,"./set_convert":621,"./tick_label_defaults":622,"./tick_mark_defaults":623,"./tick_value_defaults":624,"fast-isnumeric":97}],603:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"../array_container_defaults":578,"./category_order_defaults":588,"./constants":590,"./layout_attributes":598,"./line_grid_defaults":600,"./set_convert":604,"./tick_label_defaults":605,"./tick_mark_defaults":606,"./tick_value_defaults":607,"fast-isnumeric":94}],586:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../../constants/docs'); @@ -99049,7 +100492,7 @@ module.exports = { descriptionWithDates: descriptionWithDates }; -},{"../../constants/docs":525}],604:[function(_dereq_,module,exports){ +},{"../../constants/docs":508}],587:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -99197,7 +100640,7 @@ exports.isLinked = function(fullLayout, axId) { ); }; -},{"../../registry":649,"./constants":607}],605:[function(_dereq_,module,exports){ +},{"../../registry":632,"./constants":590}],588:[function(_dereq_,module,exports){ 'use strict'; function findCategories(ax, opts) { @@ -99283,7 +100726,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],606:[function(_dereq_,module,exports){ +},{}],589:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -99367,7 +100810,7 @@ exports.tick0 = function(tick0, axType, calendar, dtick) { return isNumeric(tick0) ? Number(tick0) : 0; }; -},{"../../constants/numerical":530,"../../lib":551,"fast-isnumeric":97}],607:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"fast-isnumeric":94}],590:[function(_dereq_,module,exports){ 'use strict'; var counterRegex = _dereq_('../../lib/regex').counter; @@ -99451,7 +100894,7 @@ module.exports = { } }; -},{"../../lib/regex":567}],608:[function(_dereq_,module,exports){ +},{"../../lib/regex":550}],591:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -100094,7 +101537,7 @@ function updateDomain(ax, factor) { ax.setScale(); } -},{"../../constants/alignment":523,"../../constants/numerical":530,"../../lib":551,"./autorange":599,"./axis_ids":604,"./layout_attributes":615,"./scale_zoom":619,"./set_convert":621}],609:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506,"../../constants/numerical":513,"../../lib":534,"./autorange":582,"./axis_ids":587,"./layout_attributes":598,"./scale_zoom":602,"./set_convert":604}],592:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -101426,7 +102869,7 @@ module.exports = { attachWheelEventHandler: attachWheelEventHandler }; -},{"../../components/color":418,"../../components/dragelement":437,"../../components/dragelement/helpers":436,"../../components/drawing":440,"../../components/fx":458,"../../constants/alignment":523,"../../lib":551,"../../lib/clear_gl_canvases":538,"../../lib/setcursor":571,"../../lib/svg_text_utils":576,"../../plot_api/subroutines":590,"../../registry":649,"../plots":646,"./axes":600,"./axis_ids":604,"./constants":607,"./scale_zoom":619,"./select":620,"@plotly/d3":17,"has-passive-events":272,"tinycolor2":366}],610:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/dragelement":420,"../../components/dragelement/helpers":419,"../../components/drawing":423,"../../components/fx":441,"../../constants/alignment":506,"../../lib":534,"../../lib/clear_gl_canvases":521,"../../lib/setcursor":554,"../../lib/svg_text_utils":559,"../../plot_api/subroutines":573,"../../registry":632,"../plots":629,"./axes":583,"./axis_ids":587,"./constants":590,"./scale_zoom":602,"./select":603,"@plotly/d3":17,"has-passive-events":264,"tinycolor2":350}],593:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -101585,7 +103028,7 @@ exports.updateFx = function(gd) { setCursor(fullLayout._draggers, cursor); }; -},{"../../components/dragelement":437,"../../components/fx":458,"../../lib/setcursor":571,"./constants":607,"./dragbox":609,"@plotly/d3":17}],611:[function(_dereq_,module,exports){ +},{"../../components/dragelement":420,"../../components/fx":441,"../../lib/setcursor":554,"./constants":590,"./dragbox":592,"@plotly/d3":17}],594:[function(_dereq_,module,exports){ 'use strict'; function clearOutlineControllers(gd) { @@ -101612,7 +103055,7 @@ module.exports = { clearSelect: clearSelect }; -},{}],612:[function(_dereq_,module,exports){ +},{}],595:[function(_dereq_,module,exports){ 'use strict'; var strTranslate = _dereq_('../../lib').strTranslate; @@ -101660,7 +103103,7 @@ module.exports = { getTransform: getTransform }; -},{"../../lib":551}],613:[function(_dereq_,module,exports){ +},{"../../lib":534}],596:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -101729,7 +103172,7 @@ module.exports = function makeIncludeComponents(containerArrayName) { }; }; -},{"../../lib":551,"../../registry":649,"./axis_ids":604}],614:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"./axis_ids":587}],597:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -102338,7 +103781,7 @@ exports.toSVG = function(gd) { exports.updateFx = _dereq_('./graph_interact').updateFx; -},{"../../components/drawing":440,"../../constants/xmlns_namespaces":531,"../../lib":551,"../../registry":649,"../get_data":631,"../plots":646,"./attributes":598,"./axis_ids":604,"./constants":607,"./graph_interact":610,"./layout_attributes":615,"./layout_defaults":616,"./transition_axes":625,"@plotly/d3":17}],615:[function(_dereq_,module,exports){ +},{"../../components/drawing":423,"../../constants/xmlns_namespaces":514,"../../lib":534,"../../registry":632,"../get_data":614,"../plots":629,"./attributes":581,"./axis_ids":587,"./constants":590,"./graph_interact":593,"./layout_attributes":598,"./layout_defaults":599,"./transition_axes":608,"@plotly/d3":17}],598:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../font_attributes'); @@ -102899,7 +104342,7 @@ module.exports = { } }; -},{"../../components/color/attributes":417,"../../components/drawing/attributes":439,"../../constants/numerical":530,"../../lib/extend":544,"../../plot_api/plot_template":589,"../../plots/cartesian/axis_format_attributes":603,"../font_attributes":629,"./constants":607}],616:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":400,"../../components/drawing/attributes":422,"../../constants/numerical":513,"../../lib/extend":527,"../../plot_api/plot_template":572,"../../plots/cartesian/axis_format_attributes":586,"../font_attributes":612,"./constants":590}],599:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -103277,7 +104720,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":418,"../../components/fx/helpers":454,"../../components/fx/hovermode_defaults":457,"../../lib":551,"../../plot_api/plot_template":589,"../../registry":649,"../layout_attributes":644,"./axis_defaults":602,"./axis_ids":604,"./constants":607,"./constraints":608,"./layout_attributes":615,"./position_defaults":618,"./type_defaults":626}],617:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/fx/helpers":437,"../../components/fx/hovermode_defaults":440,"../../lib":534,"../../plot_api/plot_template":572,"../../registry":632,"../layout_attributes":627,"./axis_defaults":585,"./axis_ids":587,"./constants":590,"./constraints":591,"./layout_attributes":598,"./position_defaults":601,"./type_defaults":609}],600:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -103334,7 +104777,7 @@ module.exports = function handleLineGridDefaults(containerIn, containerOut, coer } }; -},{"../../components/color/attributes":417,"../../lib":551,"tinycolor2":366}],618:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":400,"../../lib":534,"tinycolor2":350}],601:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -103413,7 +104856,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":551,"fast-isnumeric":97}],619:[function(_dereq_,module,exports){ +},{"../../lib":534,"fast-isnumeric":94}],602:[function(_dereq_,module,exports){ 'use strict'; var FROM_BL = _dereq_('../../constants/alignment').FROM_BL; @@ -103433,7 +104876,7 @@ module.exports = function scaleZoom(ax, factor, centerFraction) { ax.setScale(); }; -},{"../../constants/alignment":523}],620:[function(_dereq_,module,exports){ +},{"../../constants/alignment":506}],603:[function(_dereq_,module,exports){ 'use strict'; var polybool = _dereq_('polybooljs'); @@ -104367,7 +105810,7 @@ module.exports = { selectOnClick: selectOnClick }; -},{"../../components/color":418,"../../components/dragelement/helpers":436,"../../components/drawing":440,"../../components/fx":458,"../../components/fx/helpers":454,"../../components/shapes/draw_newshape/display_outlines":506,"../../components/shapes/draw_newshape/helpers":507,"../../components/shapes/draw_newshape/newshapes":508,"../../lib":551,"../../lib/clear_gl_canvases":538,"../../lib/polygon":563,"../../lib/throttle":577,"../../plot_api/subroutines":590,"../../registry":649,"./axis_ids":604,"./constants":607,"./handle_outline":611,"./helpers":612,"polybooljs":321}],621:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/dragelement/helpers":419,"../../components/drawing":423,"../../components/fx":441,"../../components/fx/helpers":437,"../../components/shapes/draw_newshape/display_outlines":489,"../../components/shapes/draw_newshape/helpers":490,"../../components/shapes/draw_newshape/newshapes":491,"../../lib":534,"../../lib/clear_gl_canvases":521,"../../lib/polygon":546,"../../lib/throttle":560,"../../plot_api/subroutines":573,"../../registry":632,"./axis_ids":587,"./constants":590,"./handle_outline":594,"./helpers":595,"polybooljs":306}],604:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -105331,7 +106774,7 @@ module.exports = function setConvert(ax, fullLayout) { delete ax._forceTick0; }; -},{"../../constants/numerical":530,"../../lib":551,"./axis_ids":604,"./constants":607,"@plotly/d3":17,"d3-time-format":87,"fast-isnumeric":97}],622:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"./axis_ids":587,"./constants":590,"@plotly/d3":17,"d3-time-format":84,"fast-isnumeric":94}],605:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -105449,7 +106892,7 @@ function tickformatstopDefaults(valueIn, valueOut) { } } -},{"../../components/color":418,"../../lib":551,"../array_container_defaults":595,"./layout_attributes":615}],623:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../lib":534,"../array_container_defaults":578,"./layout_attributes":598}],606:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -105473,7 +106916,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":551,"./layout_attributes":615}],624:[function(_dereq_,module,exports){ +},{"../../lib":534,"./layout_attributes":598}],607:[function(_dereq_,module,exports){ 'use strict'; var cleanTicks = _dereq_('./clean_ticks'); @@ -105512,7 +106955,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"../../lib":551,"./clean_ticks":606}],625:[function(_dereq_,module,exports){ +},{"../../lib":534,"./clean_ticks":589}],608:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -105717,7 +107160,7 @@ module.exports = function transitionAxes(gd, edits, transitionOpts, makeOnComple return Promise.resolve(); }; -},{"../../components/drawing":440,"../../lib":551,"../../registry":649,"./axes":600,"@plotly/d3":17}],626:[function(_dereq_,module,exports){ +},{"../../components/drawing":423,"../../lib":534,"../../registry":632,"./axes":583,"@plotly/d3":17}],609:[function(_dereq_,module,exports){ 'use strict'; var traceIs = _dereq_('../../registry').traceIs; @@ -105849,7 +107292,7 @@ function isBoxWithoutPositionCoords(trace, axLetter) { ); } -},{"../../registry":649,"./axis_autotype":601}],627:[function(_dereq_,module,exports){ +},{"../../registry":632,"./axis_autotype":584}],610:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -106268,7 +107711,7 @@ function crawl(attrs, callback, path, depth) { }); } -},{"../lib":551,"../registry":649}],628:[function(_dereq_,module,exports){ +},{"../lib":534,"../registry":632}],611:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../lib/extend').extendFlat; @@ -106365,7 +107808,7 @@ exports.defaults = function(containerOut, layout, coerce, dfltDomains) { if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice(); }; -},{"../lib/extend":544}],629:[function(_dereq_,module,exports){ +},{"../lib/extend":527}],612:[function(_dereq_,module,exports){ 'use strict'; /* @@ -106417,7 +107860,7 @@ module.exports = function(opts) { return attrs; }; -},{}],630:[function(_dereq_,module,exports){ +},{}],613:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -106443,7 +107886,7 @@ module.exports = { } }; -},{}],631:[function(_dereq_,module,exports){ +},{}],614:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -106564,7 +108007,7 @@ exports.getSubplotData = function getSubplotData(data, type, subplotId) { return subplotData; }; -},{"../registry":649,"./cartesian/constants":607}],632:[function(_dereq_,module,exports){ +},{"../registry":632,"./cartesian/constants":590}],615:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -106715,7 +108158,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/fx/layout_attributes":459,"../../constants/xmlns_namespaces":531,"../../lib":551,"../../plot_api/edit_types":582,"../get_data":631,"./layout/attributes":633,"./layout/defaults":637,"./layout/layout_attributes":638,"./scene":642}],633:[function(_dereq_,module,exports){ +},{"../../components/fx/layout_attributes":442,"../../constants/xmlns_namespaces":514,"../../lib":534,"../../plot_api/edit_types":565,"../get_data":614,"./layout/attributes":616,"./layout/defaults":620,"./layout/layout_attributes":621,"./scene":625}],616:[function(_dereq_,module,exports){ 'use strict'; @@ -106727,7 +108170,7 @@ module.exports = { } }; -},{}],634:[function(_dereq_,module,exports){ +},{}],617:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../../components/color'); @@ -106829,7 +108272,7 @@ module.exports = overrideAll({ } }, 'plot', 'from-root'); -},{"../../../components/color":418,"../../../lib/extend":544,"../../../plot_api/edit_types":582,"../../cartesian/layout_attributes":615}],635:[function(_dereq_,module,exports){ +},{"../../../components/color":401,"../../../lib/extend":527,"../../../plot_api/edit_types":565,"../../cartesian/layout_attributes":598}],618:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -106898,7 +108341,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { } }; -},{"../../../lib":551,"../../../plot_api/plot_template":589,"../../cartesian/axis_defaults":602,"../../cartesian/type_defaults":626,"./axis_attributes":634,"tinycolor2":366}],636:[function(_dereq_,module,exports){ +},{"../../../lib":534,"../../../plot_api/plot_template":572,"../../cartesian/axis_defaults":585,"../../cartesian/type_defaults":609,"./axis_attributes":617,"tinycolor2":350}],619:[function(_dereq_,module,exports){ 'use strict'; var str2RgbaArray = _dereq_('../../../lib/str2rgbarray'); @@ -107055,7 +108498,7 @@ function createAxesOptions(fullLayout, sceneLayout) { module.exports = createAxesOptions; -},{"../../../lib":551,"../../../lib/str2rgbarray":575}],637:[function(_dereq_,module,exports){ +},{"../../../lib":534,"../../../lib/str2rgbarray":558}],620:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../../lib'); @@ -107196,7 +108639,7 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { coerce('hovermode', opts.getDfltFromLayout('hovermode')); } -},{"../../../components/color":418,"../../../lib":551,"../../../registry":649,"../../get_data":631,"../../subplot_defaults":647,"./axis_defaults":635,"./layout_attributes":638}],638:[function(_dereq_,module,exports){ +},{"../../../components/color":401,"../../../lib":534,"../../../registry":632,"../../get_data":614,"../../subplot_defaults":630,"./axis_defaults":618,"./layout_attributes":621}],621:[function(_dereq_,module,exports){ 'use strict'; var gl3dAxisAttrs = _dereq_('./axis_attributes'); @@ -107315,7 +108758,7 @@ module.exports = { } }; -},{"../../../lib":551,"../../../lib/extend":544,"../../domain":628,"./axis_attributes":634}],639:[function(_dereq_,module,exports){ +},{"../../../lib":534,"../../../lib/extend":527,"../../domain":611,"./axis_attributes":617}],622:[function(_dereq_,module,exports){ 'use strict'; var str2RGBArray = _dereq_('../../../lib/str2rgbarray'); @@ -107358,7 +108801,7 @@ function createSpikeOptions(layout) { module.exports = createSpikeOptions; -},{"../../../lib/str2rgbarray":575}],640:[function(_dereq_,module,exports){ +},{"../../../lib/str2rgbarray":558}],623:[function(_dereq_,module,exports){ /* eslint block-scoped-var: 0*/ /* eslint no-redeclare: 0*/ @@ -107451,7 +108894,7 @@ function computeTickMarks(scene) { scene.contourLevels = contourLevelsFromTicks(ticks); } -},{"../../../lib":551,"../../cartesian/axes":600}],641:[function(_dereq_,module,exports){ +},{"../../../lib":534,"../../cartesian/axes":583}],624:[function(_dereq_,module,exports){ 'use strict'; function xformMatrix(m, v) { @@ -107476,7 +108919,7 @@ function project(camera, v) { module.exports = project; -},{}],642:[function(_dereq_,module,exports){ +},{}],625:[function(_dereq_,module,exports){ 'use strict'; var glPlot3d = _dereq_('gl-plot3d'); @@ -108612,7 +110055,7 @@ proto.make4thDimension = function() { module.exports = Scene; -},{"../../components/fx":458,"../../lib":551,"../../lib/show_no_webgl_msg":572,"../../lib/str2rgbarray":575,"../../plots/cartesian/axes":600,"../../registry":649,"./layout/convert":636,"./layout/spikes":639,"./layout/tick_marks":640,"./project":641,"gl-plot3d":162,"has-passive-events":272,"webgl-context":381}],643:[function(_dereq_,module,exports){ +},{"../../components/fx":441,"../../lib":534,"../../lib/show_no_webgl_msg":555,"../../lib/str2rgbarray":558,"../../plots/cartesian/axes":583,"../../registry":632,"./layout/convert":619,"./layout/spikes":622,"./layout/tick_marks":623,"./project":624,"gl-plot3d":155,"has-passive-events":264,"webgl-context":364}],626:[function(_dereq_,module,exports){ 'use strict'; module.exports = function zip3(x, y, z, len) { @@ -108625,7 +110068,7 @@ module.exports = function zip3(x, y, z, len) { return result; }; -},{}],644:[function(_dereq_,module,exports){ +},{}],627:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -108852,7 +110295,7 @@ module.exports = { } }; -},{"../components/color/attributes":417,"../components/shapes/draw_newshape/attributes":503,"../lib/extend":544,"./animation_attributes":594,"./font_attributes":629,"./pad_attributes":645}],645:[function(_dereq_,module,exports){ +},{"../components/color/attributes":400,"../components/shapes/draw_newshape/attributes":486,"../lib/extend":527,"./animation_attributes":577,"./font_attributes":612,"./pad_attributes":628}],628:[function(_dereq_,module,exports){ 'use strict'; /** @@ -108891,7 +110334,7 @@ module.exports = function(opts) { }; }; -},{}],646:[function(_dereq_,module,exports){ +},{}],629:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -112317,7 +113760,7 @@ plots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullD } }; -},{"../components/color":418,"../constants/numerical":530,"../lib":551,"../plot_api/plot_schema":588,"../plot_api/plot_template":589,"../plots/get_data":631,"../registry":649,"./animation_attributes":594,"./attributes":596,"./cartesian/axis_ids":604,"./cartesian/handle_outline":611,"./command":627,"./font_attributes":629,"./frame_attributes":630,"./layout_attributes":644,"@plotly/d3":17,"d3-format":86,"d3-time-format":87,"fast-isnumeric":97}],647:[function(_dereq_,module,exports){ +},{"../components/color":401,"../constants/numerical":513,"../lib":534,"../plot_api/plot_schema":571,"../plot_api/plot_template":572,"../plots/get_data":614,"../registry":632,"./animation_attributes":577,"./attributes":579,"./cartesian/axis_ids":587,"./cartesian/handle_outline":594,"./command":610,"./font_attributes":612,"./frame_attributes":613,"./layout_attributes":627,"@plotly/d3":17,"d3-format":83,"d3-time-format":84,"fast-isnumeric":94}],630:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -112393,7 +113836,7 @@ module.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, o } }; -},{"../lib":551,"../plot_api/plot_template":589,"./domain":628}],648:[function(_dereq_,module,exports){ +},{"../lib":534,"../plot_api/plot_template":572,"./domain":611}],631:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../constants/docs'); @@ -112474,7 +113917,7 @@ exports.texttemplateAttrs = function(opts, extra) { return texttemplate; }; -},{"../constants/docs":525}],649:[function(_dereq_,module,exports){ +},{"../constants/docs":508}],632:[function(_dereq_,module,exports){ 'use strict'; var Loggers = _dereq_('./lib/loggers'); @@ -112932,7 +114375,7 @@ function getTraceType(traceType) { return traceType; } -},{"./lib/dom":542,"./lib/extend":544,"./lib/is_plain_object":552,"./lib/loggers":555,"./lib/noop":560,"./lib/push_unique":565,"./plots/attributes":596,"./plots/layout_attributes":644}],650:[function(_dereq_,module,exports){ +},{"./lib/dom":525,"./lib/extend":527,"./lib/is_plain_object":535,"./lib/loggers":538,"./lib/noop":543,"./lib/push_unique":548,"./plots/attributes":579,"./plots/layout_attributes":627}],633:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -113092,7 +114535,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../lib":551,"../registry":649}],651:[function(_dereq_,module,exports){ +},{"../lib":534,"../registry":632}],634:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -113156,7 +114599,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":551,"../plot_api/to_image":592,"./filesaver":652,"./helpers":653}],652:[function(_dereq_,module,exports){ +},{"../lib":534,"../plot_api/to_image":575,"./filesaver":635,"./helpers":636}],635:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -113224,7 +114667,7 @@ function fileSaver(url, name, format) { module.exports = fileSaver; -},{"../lib":551,"./helpers":653}],653:[function(_dereq_,module,exports){ +},{"../lib":534,"./helpers":636}],636:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -113293,7 +114736,7 @@ exports.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; exports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\'svg\'} instead.'; -},{"../registry":649}],654:[function(_dereq_,module,exports){ +},{"../registry":632}],637:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -113310,7 +114753,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":650,"./download":651,"./helpers":653,"./svgtoimg":655,"./toimage":656,"./tosvg":657}],655:[function(_dereq_,module,exports){ +},{"./cloneplot":633,"./download":634,"./helpers":636,"./svgtoimg":638,"./toimage":639,"./tosvg":640}],638:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -113429,7 +114872,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":551,"./helpers":653,"events":54}],656:[function(_dereq_,module,exports){ +},{"../lib":534,"./helpers":636,"events":54}],639:[function(_dereq_,module,exports){ 'use strict'; var EventEmitter = _dereq_('events').EventEmitter; @@ -113498,7 +114941,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":551,"../registry":649,"./cloneplot":650,"./helpers":653,"./svgtoimg":655,"./tosvg":657,"events":54}],657:[function(_dereq_,module,exports){ +},{"../lib":534,"../registry":632,"./cloneplot":633,"./helpers":636,"./svgtoimg":638,"./tosvg":640,"events":54}],640:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -113683,7 +115126,7 @@ module.exports = function toSVG(gd, format, scale) { return s; }; -},{"../components/color":418,"../components/drawing":440,"../constants/xmlns_namespaces":531,"../lib":551,"@plotly/d3":17}],658:[function(_dereq_,module,exports){ +},{"../components/color":401,"../components/drawing":423,"../constants/xmlns_namespaces":514,"../lib":534,"@plotly/d3":17}],641:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -113827,7 +115270,7 @@ attrs.transforms = undefined; module.exports = attrs; -},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../mesh3d/attributes":670}],659:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../mesh3d/attributes":653}],642:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -113863,7 +115306,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale/calc":426}],660:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":409}],643:[function(_dereq_,module,exports){ 'use strict'; var conePlot = _dereq_('gl-cone3d'); @@ -114002,7 +115445,7 @@ function createConeTrace(scene, data) { module.exports = createConeTrace; -},{"../../components/colorscale":430,"../../lib":551,"../../lib/gl_format_color":548,"../../plots/gl3d/zip3":643,"gl-cone3d":113}],661:[function(_dereq_,module,exports){ +},{"../../components/colorscale":413,"../../lib":534,"../../lib/gl_format_color":531,"../../plots/gl3d/zip3":626,"gl-cone3d":107}],644:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -114061,7 +115504,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":428,"../../lib":551,"./attributes":658}],662:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":411,"../../lib":534,"./attributes":641}],645:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -114087,7 +115530,7 @@ module.exports = { } }; -},{"../../plots/gl3d":632,"./attributes":658,"./calc":659,"./convert":660,"./defaults":661}],663:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":615,"./attributes":641,"./calc":642,"./convert":643,"./defaults":644}],646:[function(_dereq_,module,exports){ 'use strict'; var maxRowLength = _dereq_('../../lib').maxRowLength; @@ -114184,7 +115627,7 @@ module.exports = function findEmpties(z) { return empties.sort(function(a, b) { return b[2] - a[2]; }); }; -},{"../../lib":551}],664:[function(_dereq_,module,exports){ +},{"../../lib":534}],647:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -114309,7 +115752,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../lib":551}],665:[function(_dereq_,module,exports){ +},{"../../lib":534}],648:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -114463,7 +115906,7 @@ attrs.flatshading.dflt = true; attrs.lighting.facenormalsepsilon.dflt = 0; attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../mesh3d/attributes":670}],666:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../mesh3d/attributes":653}],649:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -114510,7 +115953,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale/calc":426,"../streamtube/calc":713}],667:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":409,"../streamtube/calc":696}],650:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -115558,7 +117001,7 @@ module.exports = { createIsosurfaceTrace: createIsosurfaceTrace, }; -},{"../../components/colorscale":430,"../../lib/gl_format_color":548,"../../lib/str2rgbarray":575,"../../plots/gl3d/zip3":643,"gl-mesh3d":158}],668:[function(_dereq_,module,exports){ +},{"../../components/colorscale":413,"../../lib/gl_format_color":531,"../../lib/str2rgbarray":558,"../../plots/gl3d/zip3":626,"gl-mesh3d":152}],651:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -115670,7 +117113,7 @@ module.exports = { supplyIsoDefaults: supplyIsoDefaults }; -},{"../../components/colorscale/defaults":428,"../../lib":551,"../../registry":649,"./attributes":665}],669:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":411,"../../lib":534,"../../registry":632,"./attributes":648}],652:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -115691,7 +117134,7 @@ module.exports = { } }; -},{"../../plots/gl3d":632,"./attributes":665,"./calc":666,"./convert":667,"./defaults":668}],670:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":615,"./attributes":648,"./calc":649,"./convert":650,"./defaults":651}],653:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -115839,7 +117282,7 @@ colorScaleAttrs('', { showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) }); -},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../surface/attributes":717}],671:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../surface/attributes":700}],654:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -115854,7 +117297,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":426}],672:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":409}],655:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -116049,7 +117492,7 @@ function createMesh3DTrace(scene, data) { module.exports = createMesh3DTrace; -},{"../../components/colorscale":430,"../../lib/gl_format_color":548,"../../lib/str2rgbarray":575,"../../plots/gl3d/zip3":643,"alpha-shape":22,"convex-hull":78,"delaunay-triangulate":91,"gl-mesh3d":158}],673:[function(_dereq_,module,exports){ +},{"../../components/colorscale":413,"../../lib/gl_format_color":531,"../../lib/str2rgbarray":558,"../../plots/gl3d/zip3":626,"alpha-shape":22,"convex-hull":78,"delaunay-triangulate":88,"gl-mesh3d":152}],656:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -116145,7 +117588,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":428,"../../lib":551,"../../registry":649,"./attributes":670}],674:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":411,"../../lib":534,"../../registry":632,"./attributes":653}],657:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -116166,7 +117609,7 @@ module.exports = { } }; -},{"../../plots/gl3d":632,"./attributes":670,"./calc":671,"./convert":672,"./defaults":673}],675:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":615,"./attributes":653,"./calc":654,"./convert":655,"./defaults":656}],658:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -116206,7 +117649,7 @@ exports.getRotationAngle = function(rotation) { return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180; }; -},{"../../lib":551}],676:[function(_dereq_,module,exports){ +},{"../../lib":534}],659:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -116222,7 +117665,7 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":418,"./helpers":675}],677:[function(_dereq_,module,exports){ +},{"../../components/color":401,"./helpers":658}],660:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -116265,7 +117708,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":551}],678:[function(_dereq_,module,exports){ +},{"../../lib":534}],661:[function(_dereq_,module,exports){ 'use strict'; var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; @@ -116615,7 +118058,7 @@ module.exports = { }), }; -},{"../../components/colorscale/attributes":425,"../../components/drawing":440,"../../components/drawing/attributes":439,"../../lib/extend":544,"../../plots/cartesian/axis_format_attributes":603,"../../plots/font_attributes":629,"../../plots/template_attributes":648,"./constants":682}],679:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../components/drawing":423,"../../components/drawing/attributes":422,"../../lib/extend":527,"../../plots/cartesian/axis_format_attributes":586,"../../plots/font_attributes":612,"../../plots/template_attributes":631,"./constants":665}],662:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -116912,7 +118355,7 @@ module.exports = { getStackOpts: getStackOpts }; -},{"../../constants/numerical":530,"../../lib":551,"../../plots/cartesian/align_period":597,"../../plots/cartesian/axes":600,"./arrays_to_calcdata":677,"./calc_selection":680,"./colorscale_calc":681,"./subtypes":703,"fast-isnumeric":97}],680:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"../../plots/cartesian/align_period":580,"../../plots/cartesian/axes":583,"./arrays_to_calcdata":660,"./calc_selection":663,"./colorscale_calc":664,"./subtypes":686,"fast-isnumeric":94}],663:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -116923,7 +118366,7 @@ module.exports = function calcSelection(cd, trace) { } }; -},{"../../lib":551}],681:[function(_dereq_,module,exports){ +},{"../../lib":534}],664:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -116958,7 +118401,7 @@ module.exports = function calcMarkerColorscale(gd, trace) { } }; -},{"../../components/colorscale/calc":426,"../../components/colorscale/helpers":429,"./subtypes":703}],682:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":409,"../../components/colorscale/helpers":412,"./subtypes":686}],665:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -116978,7 +118421,7 @@ module.exports = { eventDataKeys: [] }; -},{}],683:[function(_dereq_,module,exports){ +},{}],666:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('./calc'); @@ -117150,7 +118593,7 @@ function getInterp(calcTrace, index, position, posAttr) { return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]); } -},{"./calc":679}],684:[function(_dereq_,module,exports){ +},{"./calc":662}],667:[function(_dereq_,module,exports){ 'use strict'; @@ -117180,7 +118623,7 @@ module.exports = function crossTraceDefaults(fullData) { } }; -},{}],685:[function(_dereq_,module,exports){ +},{}],668:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -117267,7 +118710,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":551,"../../registry":649,"./attributes":678,"./constants":682,"./fillcolor_defaults":686,"./line_defaults":691,"./line_shape_defaults":693,"./marker_defaults":697,"./period_defaults":698,"./stack_defaults":701,"./subtypes":703,"./text_defaults":704,"./xy_defaults":705}],686:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"./attributes":661,"./constants":665,"./fillcolor_defaults":669,"./line_defaults":674,"./line_shape_defaults":676,"./marker_defaults":680,"./period_defaults":681,"./stack_defaults":684,"./subtypes":686,"./text_defaults":687,"./xy_defaults":688}],669:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -117295,7 +118738,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":418,"../../lib":551}],687:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../lib":534}],670:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -117313,7 +118756,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":600}],688:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":583}],671:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -117353,7 +118796,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":418,"./subtypes":703}],689:[function(_dereq_,module,exports){ +},{"../../components/color":401,"./subtypes":686}],672:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -117564,7 +119007,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { } }; -},{"../../components/color":418,"../../components/fx":458,"../../lib":551,"../../registry":649,"./get_trace_color":688}],690:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/fx":441,"../../lib":534,"../../registry":632,"./get_trace_color":671}],673:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -117601,7 +119044,7 @@ module.exports = { } }; -},{"../../plots/cartesian":614,"./arrays_to_calcdata":677,"./attributes":678,"./calc":679,"./cross_trace_calc":683,"./cross_trace_defaults":684,"./defaults":685,"./format_labels":687,"./hover":689,"./marker_colorbar":696,"./plot":699,"./select":700,"./style":702,"./subtypes":703}],691:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":597,"./arrays_to_calcdata":660,"./attributes":661,"./calc":662,"./cross_trace_calc":666,"./cross_trace_defaults":667,"./defaults":668,"./format_labels":670,"./hover":672,"./marker_colorbar":679,"./plot":682,"./select":683,"./style":685,"./subtypes":686}],674:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -117624,7 +119067,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, if(!(opts || {}).noDash) coerce('line.dash'); }; -},{"../../components/colorscale/defaults":428,"../../components/colorscale/helpers":429,"../../lib":551}],692:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":411,"../../components/colorscale/helpers":412,"../../lib":534}],675:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -118076,7 +119519,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../constants/numerical":530,"../../lib":551,"./constants":682}],693:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534,"./constants":665}],676:[function(_dereq_,module,exports){ 'use strict'; @@ -118086,7 +119529,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],694:[function(_dereq_,module,exports){ +},{}],677:[function(_dereq_,module,exports){ 'use strict'; var LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1}; @@ -118168,7 +119611,7 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) { return cdscatterSorted; }; -},{}],695:[function(_dereq_,module,exports){ +},{}],678:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -118204,7 +119647,7 @@ module.exports = function makeBubbleSizeFn(trace, factor) { }; }; -},{"fast-isnumeric":97}],696:[function(_dereq_,module,exports){ +},{"fast-isnumeric":94}],679:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -118213,7 +119656,7 @@ module.exports = { max: 'cmax' }; -},{}],697:[function(_dereq_,module,exports){ +},{}],680:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -118286,7 +119729,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":418,"../../components/colorscale/defaults":428,"../../components/colorscale/helpers":429,"./subtypes":703}],698:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/colorscale/defaults":411,"../../components/colorscale/helpers":412,"./subtypes":686}],681:[function(_dereq_,module,exports){ 'use strict'; var dateTick0 = _dereq_('../../lib').dateTick0; @@ -118325,7 +119768,7 @@ module.exports = function handlePeriodDefaults(traceIn, traceOut, layout, coerce } }; -},{"../../constants/numerical":530,"../../lib":551}],699:[function(_dereq_,module,exports){ +},{"../../constants/numerical":513,"../../lib":534}],682:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -118877,7 +120320,7 @@ function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) { }); } -},{"../../components/drawing":440,"../../lib":551,"../../lib/polygon":563,"../../registry":649,"./line_points":692,"./link_traces":694,"./subtypes":703,"@plotly/d3":17}],700:[function(_dereq_,module,exports){ +},{"../../components/drawing":423,"../../lib":534,"../../lib/polygon":546,"../../registry":632,"./line_points":675,"./link_traces":677,"./subtypes":686,"@plotly/d3":17}],683:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -118922,7 +120365,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"./subtypes":703}],701:[function(_dereq_,module,exports){ +},{"./subtypes":686}],684:[function(_dereq_,module,exports){ 'use strict'; var perStackAttrs = ['orientation', 'groupnorm', 'stackgaps']; @@ -119019,7 +120462,7 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) } }; -},{}],702:[function(_dereq_,module,exports){ +},{}],685:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -119081,7 +120524,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/drawing":440,"../../registry":649,"@plotly/d3":17}],703:[function(_dereq_,module,exports){ +},{"../../components/drawing":423,"../../registry":632,"@plotly/d3":17}],686:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -119111,7 +120554,7 @@ module.exports = { } }; -},{"../../lib":551}],704:[function(_dereq_,module,exports){ +},{"../../lib":534}],687:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -119132,7 +120575,7 @@ module.exports = function(traceIn, traceOut, layout, coerce, opts) { } }; -},{"../../lib":551}],705:[function(_dereq_,module,exports){ +},{"../../lib":534}],688:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -119168,7 +120611,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) { return len; }; -},{"../../lib":551,"../../registry":649}],706:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632}],689:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -119294,7 +120737,7 @@ var attrs = module.exports = overrideAll({ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; -},{"../../components/colorscale/attributes":425,"../../constants/gl3d_dashes":527,"../../constants/gl3d_markers":528,"../../lib/extend":544,"../../lib/sort_object_keys":573,"../../plot_api/edit_types":582,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../scatter/attributes":678}],707:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../constants/gl3d_dashes":510,"../../constants/gl3d_markers":511,"../../lib/extend":527,"../../lib/sort_object_keys":556,"../../plot_api/edit_types":565,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../scatter/attributes":661}],690:[function(_dereq_,module,exports){ 'use strict'; var arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata'); @@ -119314,7 +120757,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":677,"../scatter/colorscale_calc":681}],708:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":660,"../scatter/colorscale_calc":664}],691:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -119393,7 +120836,7 @@ function calculateErrors(data, scaleFactor, sceneLayout) { module.exports = calculateErrors; -},{"../../registry":649}],709:[function(_dereq_,module,exports){ +},{"../../registry":632}],692:[function(_dereq_,module,exports){ 'use strict'; var createLinePlot = _dereq_('gl-line3d'); @@ -119938,7 +121381,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../components/fx/helpers":454,"../../constants/gl3d_dashes":527,"../../constants/gl3d_markers":528,"../../lib":551,"../../lib/gl_format_color":548,"../../lib/str2rgbarray":575,"../../plots/cartesian/axes":600,"../scatter/make_bubble_size_func":695,"./calc_errors":708,"delaunay-triangulate":91,"gl-error3d":118,"gl-line3d":124,"gl-mesh3d":158,"gl-scatter3d":168}],710:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":437,"../../constants/gl3d_dashes":510,"../../constants/gl3d_markers":511,"../../lib":534,"../../lib/gl_format_color":531,"../../lib/str2rgbarray":558,"../../plots/cartesian/axes":583,"../scatter/make_bubble_size_func":678,"./calc_errors":691,"delaunay-triangulate":88,"gl-error3d":112,"gl-line3d":118,"gl-mesh3d":152,"gl-scatter3d":161}],693:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -120022,7 +121465,7 @@ function handleXYZDefaults(traceIn, traceOut, coerce, layout) { return len; } -},{"../../lib":551,"../../registry":649,"../scatter/line_defaults":691,"../scatter/marker_defaults":697,"../scatter/subtypes":703,"../scatter/text_defaults":704,"./attributes":706}],711:[function(_dereq_,module,exports){ +},{"../../lib":534,"../../registry":632,"../scatter/line_defaults":674,"../scatter/marker_defaults":680,"../scatter/subtypes":686,"../scatter/text_defaults":687,"./attributes":689}],694:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -120051,7 +121494,7 @@ module.exports = { } }; -},{"../../constants/gl3d_markers":528,"../../plots/gl3d":632,"./attributes":706,"./calc":707,"./convert":709,"./defaults":710}],712:[function(_dereq_,module,exports){ +},{"../../constants/gl3d_markers":511,"../../plots/gl3d":615,"./attributes":689,"./calc":690,"./convert":692,"./defaults":693}],695:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -120183,7 +121626,7 @@ attrs.transforms = undefined; module.exports = attrs; -},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../mesh3d/attributes":670}],713:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../mesh3d/attributes":653}],696:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -120431,7 +121874,7 @@ module.exports = { processGrid: processGrid }; -},{"../../components/colorscale/calc":426,"../../lib":551}],714:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":409,"../../lib":534}],697:[function(_dereq_,module,exports){ 'use strict'; var tube2mesh = _dereq_('gl-streamtube3d'); @@ -120649,7 +122092,7 @@ function createStreamtubeTrace(scene, data) { module.exports = createStreamtubeTrace; -},{"../../components/colorscale":430,"../../lib":551,"../../lib/gl_format_color":548,"../../plots/gl3d/zip3":643,"gl-streamtube3d":182}],715:[function(_dereq_,module,exports){ +},{"../../components/colorscale":413,"../../lib":534,"../../lib/gl_format_color":531,"../../plots/gl3d/zip3":626,"gl-streamtube3d":174}],698:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -120712,7 +122155,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":428,"../../lib":551,"./attributes":712}],716:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":411,"../../lib":534,"./attributes":695}],699:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -120753,7 +122196,7 @@ module.exports = { } }; -},{"../../plots/gl3d":632,"./attributes":712,"./calc":713,"./convert":714,"./defaults":715}],717:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":615,"./attributes":695,"./calc":696,"./convert":697,"./defaults":698}],700:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -120969,7 +122412,7 @@ colorScaleAttrs('', { attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/color":418,"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648}],718:[function(_dereq_,module,exports){ +},{"../../components/color":401,"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631}],701:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -120992,7 +122435,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":426}],719:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":409}],702:[function(_dereq_,module,exports){ 'use strict'; var createSurface = _dereq_('gl-surface3d'); @@ -121683,7 +123126,7 @@ function createSurfaceTrace(scene, data) { module.exports = createSurfaceTrace; -},{"../../components/colorscale":430,"../../lib":551,"../../lib/gl_format_color":548,"../../lib/str2rgbarray":575,"../heatmap/find_empties":663,"../heatmap/interp2d":664,"gl-surface3d":184,"ndarray":305,"ndarray-linear-interpolate":299}],720:[function(_dereq_,module,exports){ +},{"../../components/colorscale":413,"../../lib":534,"../../lib/gl_format_color":531,"../../lib/str2rgbarray":558,"../heatmap/find_empties":646,"../heatmap/interp2d":647,"gl-surface3d":176,"ndarray":293,"ndarray-linear-interpolate":287}],703:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -121852,7 +123295,7 @@ module.exports = { opacityscaleDefaults: opacityscaleDefaults }; -},{"../../components/colorscale/defaults":428,"../../lib":551,"../../registry":649,"./attributes":717}],721:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":411,"../../lib":534,"../../registry":632,"./attributes":700}],704:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -121873,7 +123316,7 @@ module.exports = { } }; -},{"../../plots/gl3d":632,"./attributes":717,"./calc":718,"./convert":719,"./defaults":720}],722:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":615,"./attributes":700,"./calc":701,"./convert":702,"./defaults":703}],705:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -121938,7 +123381,7 @@ colorScaleAttrs('', { attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plots/attributes":596,"../isosurface/attributes":665,"../surface/attributes":717}],723:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plots/attributes":579,"../isosurface/attributes":648,"../surface/attributes":700}],706:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -122063,7 +123506,7 @@ function createVolumeTrace(scene, data) { module.exports = createVolumeTrace; -},{"../../components/colorscale":430,"../../lib/gl_format_color":548,"../../lib/str2rgbarray":575,"../../plots/gl3d/zip3":643,"../isosurface/convert":667,"gl-mesh3d":158}],724:[function(_dereq_,module,exports){ +},{"../../components/colorscale":413,"../../lib/gl_format_color":531,"../../lib/str2rgbarray":558,"../../plots/gl3d/zip3":626,"../isosurface/convert":650,"gl-mesh3d":152}],707:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -122081,7 +123524,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout opacityscaleDefaults(traceIn, traceOut, layout, coerce); }; -},{"../../lib":551,"../isosurface/defaults":668,"../surface/defaults":720,"./attributes":722}],725:[function(_dereq_,module,exports){ +},{"../../lib":534,"../isosurface/defaults":651,"../surface/defaults":703,"./attributes":705}],708:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -122102,7 +123545,7 @@ module.exports = { } }; -},{"../../plots/gl3d":632,"../isosurface/calc":666,"./attributes":722,"./convert":723,"./defaults":724}],726:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":615,"../isosurface/calc":649,"./attributes":705,"./convert":706,"./defaults":707}],709:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../plots/cartesian/axes'); @@ -122506,7 +123949,7 @@ function last(array, indices) { return array[indices[indices.length - 1]]; } -},{"../constants/numerical":530,"../lib":551,"../plot_api/plot_schema":588,"../plots/cartesian/axes":600,"./helpers":729}],727:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"../lib":534,"../plot_api/plot_schema":571,"../plots/cartesian/axes":583,"./helpers":712}],710:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -122766,7 +124209,7 @@ function getFilterFunc(opts, d2c, targetCalendar) { } } -},{"../constants/filter_ops":526,"../lib":551,"../plots/cartesian/axes":600,"../registry":649,"./helpers":729}],728:[function(_dereq_,module,exports){ +},{"../constants/filter_ops":509,"../lib":534,"../plots/cartesian/axes":583,"../registry":632,"./helpers":712}],711:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -123010,7 +124453,7 @@ function transformOne(trace, state) { return newData; } -},{"../lib":551,"../plot_api/plot_schema":588,"../plots/plots":646,"./helpers":729}],729:[function(_dereq_,module,exports){ +},{"../lib":534,"../plot_api/plot_schema":571,"../plots/plots":629,"./helpers":712}],712:[function(_dereq_,module,exports){ 'use strict'; exports.pointsAccessorFunction = function(transforms, opts) { @@ -123028,7 +124471,7 @@ exports.pointsAccessorFunction = function(transforms, opts) { return originalPointsAccessor; }; -},{}],730:[function(_dereq_,module,exports){ +},{}],713:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -123166,11 +124609,11 @@ function getSortFunc(opts, d2c) { } } -},{"../constants/numerical":530,"../lib":551,"../plots/cartesian/axes":600,"./helpers":729}],731:[function(_dereq_,module,exports){ +},{"../constants/numerical":513,"../lib":534,"../plots/cartesian/axes":583,"./helpers":712}],714:[function(_dereq_,module,exports){ 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.4.2'; +exports.version = '2.5.0'; },{}]},{},[8])(8) }); diff --git a/dist/plotly-gl3d.min.js b/dist/plotly-gl3d.min.js index 5fbe2236067..406c3280cd7 100644 --- a/dist/plotly-gl3d.min.js +++ b/dist/plotly-gl3d.min.js @@ -1,52 +1,52 @@ /** -* plotly.js (gl3d - minified) v2.4.2 +* plotly.js (gl3d - minified) v2.5.0 * Copyright 2012-2021, 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{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(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){return a(e[o][1][t]||t)}),c,c.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":551}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":726}],3:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":416}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":662}],5:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":532}],6:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":727}],7:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":728}],8:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./calendars":3,"./cone":4,"./core":5,"./filter":6,"./groupby":7,"./isosurface":9,"./mesh3d":10,"./scatter3d":11,"./sort":12,"./streamtube":13,"./surface":14,"./volume":15}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":669}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":674}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":711}],12:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":730}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":716}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":721}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":725}],16:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=a(),h=i();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=t("turntable-camera-controller"),a=t("orbit-camera-controller"),i=t("matrix-camera-controller");function o(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}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach((function(t){for(var e=t[0],r=[],n=0;ne?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(h);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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,a=[],i=b(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,f,h=-1,d=i.length,p=a[s++],g=new _;++h=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return U(t,q),t}var V=function(t,e){return e.querySelector(t)},Y=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[R(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},Y=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var q=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return V(t,this)}}function X(t){return"function"==typeof t?t:function(){return Y(t,this)}}q.select=function(t){var e,r,n,a,i=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},q.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},q.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},q.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=gt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?P:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=q.append,ht.empty=q.empty,ht.node=q.node,ht.call=q.call,ht.size=q.size,ht.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?St:t<-1?-St:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,f=l-i,h=c*c+f*f;if(h<1e-12)n=Math.log(u/o)/Dt,r=function(t){return[a+t*c,i+t*f,o*Math.exp(Dt*t*n)]};else{var d=Math.sqrt(h),p=(u*u-o*o+4*h)/(2*o*2*d),g=(u*u-o*o-4*h)/(2*u*2*d),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Dt,r=function(t){var e,r=t*n,s=Rt(v),l=o/(2*d)*(s*(e=Dt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+l*c,i+l*f,o*s/Rt(Dt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,f,h={x:0,y:0,k:1},d=[960,500],p=zt,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=j(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,O).on(It+".zoom",D).on("dblclick.zoom",P).on(x,R)}function M(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function T(t){h.k=Math.max(p[0],Math.min(p[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function k(e,n,a,i){e.__chart__={x:h.x,y:h.y,k:h.k},T(Math.pow(2,i)),A(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function S(t){v++||t({type:"zoomstart"})}function E(t){L(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--v||(t({type:"zoomend"}),r=null)}function O(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,l).on(b,u),i=M(t.mouse(e)),s=xt(e);function l(){n=1,A(t.mouse(e),i),E(r)}function u(){a.on(y,null).on(b,null),s(n),C(r)}Ia.call(e),S(r)}function R(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),d=xt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=M(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=d[0];var b=d[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);Ia.call(r);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new Qt(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Yt?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}jt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,this.l/t)},jt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,t*this.l)},jt.rgb=function(){return Bt(this.h,this.s,this.l)},t.hcl=Ut;var Ht=Ut.prototype=new Nt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Et)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Ut?Vt(t.h,t.c,t.l):ie((t=Qt(t)).r,t.g,t.b):new Yt(t,e,r)}Ht.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Ht.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Ht.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Gt=18,qt=Yt.prototype=new Nt;function Wt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new Qt(Kt(3.2404542*(a=.95047*Zt(a))-1.5371385*(n=1*Zt(n))-.4985314*(i=1.08883*Zt(i))),Kt(-.969266*a+1.8760108*n+.041556*i),Kt(.0556434*a-.2040259*n+1.0572252*i))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Zt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Kt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,Bt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}qt.brighter=function(t){return new Yt(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},qt.darker=function(t){return new Yt(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},qt.rgb=function(){return Wt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Nt;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ft(n,a,l)}function ie(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Yt(116*a-16,500*(n-a),200*(a-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ue,t.xhr=ce(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=fe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(ye,e)),pe=0):(pe=1,ve(ye))}function be(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function xe(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function Te(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){me.apply(this,arguments)},t.timer.flush=function(){be(),xe()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ue(e),i=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nTt)s=s.L;else{if(!((a=i-He(s,o))>Tt)){n>-Tt?(e=s.P,r=s):a>-Tt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ne(t);if(Oe.insert(e,l),e||r){if(e===r)return We(e),r=Ne(e.site),Oe.insert(l,r),l.edge=r.edge=Je(e.site,l.site),qe(e),void qe(r);if(r){We(e),We(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};Qe(r.edge,u,p,x),l.edge=Je(u,t,null,x),r.edge=Je(t,p,null,x),qe(e),qe(r)}else l.edge=Je(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/i-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+a-i/2)))/f+n:(n+s)/2}function He(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ve(t){this.site=t,this.edges=[]}function Ye(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function qe(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,f=2*(l*(v=i.y-s)-u*c);if(!(f>=-1e-12)){var h=l*l+u*u,d=c*c+v*v,p=(v*h-u*d)/f,g=(l*d-c*h)/f,v=g+s,m=Ie.pop()||new Ge;m.arc=t,m.site=a,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=De._;b;)if(m.y=s)return;if(h>p){if(i){if(i.y>=u)return}else i={x:v,y:l};r={x:v,y:u}}else{if(i){if(i.y1)if(h>p){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=a-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=d,d<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=i-u,d||!(e<0)){if(e/=d,d<0){if(e>f)return;e>c&&(c=e)}else if(d>0){if(e0&&(t.a={x:l+c*h,y:u+c*d}),f<1&&(t.b={x:l+f*h,y:u+f*d}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)Tt||y(a-r)>Tt)&&(s.splice(o,0,new $e(Ke(i.site,c,y(n-f)Tt?{x:f,y:y(e-f)Tt?{x:y(r-p)Tt?{x:h,y:y(e-h)Tt?{x:y(r-d)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Tt)*Tt,y:Math.round(a(t,e)/Tt)*Tt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(Ye),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ci||f>o||h=_)<<1|e>=x,M=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:pr(r,n)})),i=mr.lastIndex;return ig&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-d,M=v-p;function T(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)A(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,A(t,c,l,u,a,i,o,s),A(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,a,i,o,s)}function A(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?a=l:o=l,f?i=u:s=u,T(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>M?v=p+w:g=d+M;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(k,t,+m(t,++f),+b(t,f),d,p,g,v)},visit:function(t){cr(t,k,d,p,g,v)},find:function(t){return fr(k,t[0],t[1],d,p,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function br(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function Tr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Lr(t){return t*t*t}function Sr(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 Er(t){return 1-Math.cos(t*St)}function Cr(t){return Math.pow(2,10*(t-1))}function Or(t){return 1-Math.sqrt(1-t*t)}function Rr(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 Dr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Pr(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=zr(a),s=Ir(a,i),l=zr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=_r.get(n)||xr,Mr((a=wr.get(a)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Vt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Bt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Wt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Dr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Pr(e?e.matrix:Nr)})(e)},Pr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Nr={a:1,b:0,c:0,d:1,e:0,f:0};function Fr(t){return t.length?t.pop()+",":""}function jr(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Fr(r)+"rotate(",null,")")-2,x:pr(t,e)})):e&&r.push(Fr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(Fr(r)+"skewX(",null,")")-2,x:pr(t,e)}):e&&r.push(Fr(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Fr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Fr(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=me(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(a[n])}function $r(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return $r(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function pn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function vn(t,e){return mn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function yn(e){return[t.min(e),t.max(e)]}function bn(t,e){return t.value-e.value}function xn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Mn(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Tn),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(kn(r,n,a=e[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,p)-1]).y+=g,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ue(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return mn(e,t)}:ue(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+c(t.value)})),$r(s,Mn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;$r(s,(function(t){t.r+=f})),$r(s,Mn),$r(s,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++od.x&&(d=t),t.depth>p.depth&&(p=t)}));var g=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+g),m=n[1]/(p.depth||1);Qr(c,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,f=s.m,h=l.m;s=En(s),i=Sn(i),s&&i;)l=Sn(l),(o=En(o)).a=t,(a=s.z+f-i.z-u+r(s._,i._))>0&&(Cn(On(s,t,n),t,a),u+=a,c+=a),f+=s.m,u+=i.m,h+=l.m,c+=o.m;s&&!En(o)&&(o.t=s,o.m+=f-c),i&&!Sn(l)&&(l.t=i,l.m+=u-h,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Kr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Ln,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;$r(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return $r(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Kr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=Rn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=d(s,g))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,g,i,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(p(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function p(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?Bn:zn,s=a?Ur:Br;return i=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Dr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Yn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Hn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Nn(a.map(i),n?Math:Gn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=Pn(a),e=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=r%1?2:r;if(isFinite(c-u)){if(n){for(;u0;h--)e.push(o(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=qn(r),i=qn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Yn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Hn(n,t))},o.exponent=function(t){return arguments.length?(a=qn(r=t),i=qn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tf?0:1;if(u=Lt)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,M,T,A,k=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Qn?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(L*=-1),u&&(L=Ot(v/u*Math.sin(m))),s&&(k=Ot(v/s*Math.sin(m)))),u){y=u*Math.cos(c+L),b=u*Math.sin(c+L),x=u*Math.cos(f-L),_=u*Math.sin(f-L);var E=Math.abs(f-c-2*L)<=At?0:1;if(L&&aa(y,b,x,_)===d^E){var C=(c+f)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-k),M=s*Math.sin(f-k),T=s*Math.cos(c+k),A=s*Math.sin(c+k);var O=Math.abs(c-f+2*k)<=At?0:1;if(k&&aa(w,M,T,A)===1-d^O){var R=(c+f)/2;w=s*Math.cos(R),M=s*Math.sin(R),T=A=null}}else w=M=0;if(h>Tt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,M=(-x*v-m*_)/y,T=(x*m+v*_)/y,A=(-x*v+m*_)/y,k=w-p,L=M-g,S=T-p,E=A-g;return k*k+L*L>S*S+E*E&&(w=T,M=A),[[w-l,M-u],[w*r/b,M*r/b]]}function oa(){return!0}function sa(t){var e=_e,r=we,n=oa,a=ua,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,f=i.length,h=ue(e),d=ue(r);function p(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":fa,"step-after":ha,basis:ga,"basis-open":function(t){if(t.length<4)return ua(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(va(ba,i)+","+va(ba,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ua(t){return t.length>1?t.join("L"):t+"Z"}function ca(t){return t.join("L")+"Z"}function fa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;uAt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ue(t),i):r},i.source=function(e){return arguments.length?(t=ue(e),i):t},i.target=function(t){return arguments.length?(e=ue(t),i):e},i.startAngle=function(t){return arguments.length?(n=ue(t),i):n},i.endAngle=function(t){return arguments.length?(a=ue(t),i):a},i},t.svg.diagonal=function(){var t=Ta,e=Aa,r=La;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=La,n=e.projection;return e.projection=function(t){return arguments.length?n(Sa(r=t)):r},e},t.svg.symbol=function(){var t=Ca,e=Ea;function r(r,n){return(Ra.get(t.call(this,r,n))||Oa)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var Ra=t.map({circle:Oa,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Pa)),r=e*Pa;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/Da),r=e*Da/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Da),r=e*Da/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ra.keys();var Da=Math.sqrt(3),Pa=Math.tan(30*Et);q.transition=function(t){for(var e,r,n=Fa||++Ua,a=Ya(t),i=[],o=ja||{time:Date.now(),ease:Sr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(i=a.time,o=me((function(t){var e=f.delay;if(o.t=e+i,e<=t)return h(t-e);o.c=h}),0,i),f=c[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}Ba.call=q.call,Ba.empty=q.empty,Ba.node=q.node,Ba.size=q.size,t.transition=function(e,r){return e&&e.transition?Fa?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=Ba,Ba.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,M=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),A=xt(m),k=t.mouse(m),L=t.select(o(m)).on("keydown.brush",C).on("keyup.brush",O);if(t.event.changedTouches?L.on("touchmove.brush",R).on("touchend.brush",P):L.on("mousemove.brush",R).on("mouseup.brush",P),x.interrupt().selectAll("*").interrupt(),T)k[0]=s[0]-k[0],k[1]=l[0]-k[1];else if(_){var S=+/w$/.test(_),E=+/^n/.test(_);v=[s[1-S]-k[0],l[1-E]-k[1]],k[0]=s[S],k[1]=l[E]}else t.event.altKey&&(f=k.slice());function C(){32==t.event.keyCode&&(T||(f=null,k[0]-=s[1],k[1]-=l[1],T=2),N())}function O(){32==t.event.keyCode&&2==T&&(k[0]+=s[1],k[1]+=l[1],T=0,N())}function R(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),k[0]=s[+(e[0]0?o-4:o;for(r=0;r>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[c++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var a,i,o=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],26:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":36}],27:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],28:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":36}],29:[function(t,e,r){"use strict";var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(a(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))u=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=i(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(a(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=i(r)}else c=i(1);f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f));return s(u,c)}},{"./div":28,"./is-rat":30,"./lib/is-bn":34,"./lib/num-to-bn":35,"./lib/rationalize":36,"./lib/str-to-bn":37}],30:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":34}],31:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":44}],32:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i20)return 52;return r+32}},{"bit-twiddle":43,"double-bits":92}],34:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":44}],35:[function(t,e,r){"use strict";var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":44,"double-bits":92}],36:[function(t,e,r){"use strict";var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":31,"./num-to-bn":35}],37:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":44}],38:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":36}],39:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":31}],40:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":36}],41:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":32,"./lib/ctz":33}],42:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(i=o,a=o-1):n=o+1}return i}function a(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(i=o,a=o-1):n=o+1}return i}function i(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(i=o,n=o+1):a=o-1}return i}function o(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(i=o,n=o+1):a=o-1}return i}function s(t,e,r,n,a){for(;n<=a;){var i=n+a>>>1,o=t[i],s=void 0!==r?r(o,e):o-e;if(0===s)return i;s<=0?n=i+1:a=i-1}return-1}function l(t,e,r,n,a,i){return"function"==typeof r?i(t,e,r,void 0===n?0:0|n,void 0===a?t.length-1:0|a):i(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,a,i){return l(t,e,r,a,i,n)},gt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},lt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},le:function(t,e,r,n,a){return l(t,e,r,n,a,o)},eq:function(t,e,r,n,a){return l(t,e,r,n,a,s)}}},{}],43:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],44:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(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){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=i:r.BN=i,i.BN=i,i.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,a=Math.min(t.length,r),i=e;i=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);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=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(a=0|t.words[p])*(i=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(i),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=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=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;it.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==i&&o>26,this.words[o]=67108863&e;if(0===i&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,T=w>>>13,A=0|o[5],k=8191&A,L=A>>>13,S=0|o[6],E=8191&S,C=S>>>13,O=0|o[7],R=8191&O,D=O>>>13,P=0|o[8],I=8191&P,z=P>>>13,N=0|o[9],F=8191&N,j=N>>>13,B=0|s[0],U=8191&B,H=B>>>13,V=0|s[1],Y=8191&V,G=V>>>13,q=0|s[2],W=8191&q,X=q>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(a=(a=Math.imul(f,H))+Math.imul(h,U)|0))<<13)|0;u=((i=Math.imul(h,H))+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),a=(a=Math.imul(p,H))+Math.imul(g,U)|0,i=Math.imul(g,H);var mt=(u+(n=n+Math.imul(f,Y)|0)|0)+((8191&(a=(a=a+Math.imul(f,G)|0)+Math.imul(h,Y)|0))<<13)|0;u=((i=i+Math.imul(h,G)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),a=(a=Math.imul(m,H))+Math.imul(y,U)|0,i=Math.imul(y,H),n=n+Math.imul(p,Y)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,G)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(a=(a=a+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;u=((i=i+Math.imul(h,X)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),a=(a=Math.imul(x,H))+Math.imul(_,U)|0,i=Math.imul(_,H),n=n+Math.imul(m,Y)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,a=(a=a+Math.imul(p,X)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,X)|0;var bt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(a=(a=a+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;u=((i=i+Math.imul(h,K)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),a=(a=Math.imul(M,H))+Math.imul(T,U)|0,i=Math.imul(T,H),n=n+Math.imul(x,Y)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,a=(a=a+Math.imul(p,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0;var xt=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(a=(a=a+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;u=((i=i+Math.imul(h,tt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,U),a=(a=Math.imul(k,H))+Math.imul(L,U)|0,i=Math.imul(L,H),n=n+Math.imul(M,Y)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(T,Y)|0,i=i+Math.imul(T,G)|0,n=n+Math.imul(x,W)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,K)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,a=(a=a+Math.imul(p,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(a=(a=a+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((i=i+Math.imul(h,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(E,U),a=(a=Math.imul(E,H))+Math.imul(C,U)|0,i=Math.imul(C,H),n=n+Math.imul(k,Y)|0,a=(a=a+Math.imul(k,G)|0)+Math.imul(L,Y)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(M,W)|0,a=(a=a+Math.imul(M,X)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,tt)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,a=(a=a+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,it)|0)|0)+((8191&(a=(a=a+Math.imul(f,ot)|0)+Math.imul(h,it)|0))<<13)|0;u=((i=i+Math.imul(h,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(R,U),a=(a=Math.imul(R,H))+Math.imul(D,U)|0,i=Math.imul(D,H),n=n+Math.imul(E,Y)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(k,W)|0,a=(a=a+Math.imul(k,X)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(M,J)|0,a=(a=a+Math.imul(M,K)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,a=(a=a+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,n=n+Math.imul(p,it)|0,a=(a=a+Math.imul(p,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var Mt=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(a=(a=a+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((i=i+Math.imul(h,ut)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,U),a=(a=Math.imul(I,H))+Math.imul(z,U)|0,i=Math.imul(z,H),n=n+Math.imul(R,Y)|0,a=(a=a+Math.imul(R,G)|0)+Math.imul(D,Y)|0,i=i+Math.imul(D,G)|0,n=n+Math.imul(E,W)|0,a=(a=a+Math.imul(E,X)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(M,$)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(x,rt)|0,a=(a=a+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(m,it)|0,a=(a=a+Math.imul(m,ot)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,a=(a=a+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0;var Tt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(a=(a=a+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((i=i+Math.imul(h,ht)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,U),a=(a=Math.imul(F,H))+Math.imul(j,U)|0,i=Math.imul(j,H),n=n+Math.imul(I,Y)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(z,Y)|0,i=i+Math.imul(z,G)|0,n=n+Math.imul(R,W)|0,a=(a=a+Math.imul(R,X)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,X)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,tt)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,a=(a=a+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(x,it)|0,a=(a=a+Math.imul(x,ot)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,a=(a=a+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,a=(a=a+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,ht)|0;var At=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(a=(a=a+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((i=i+Math.imul(h,gt)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,Y),a=(a=Math.imul(F,G))+Math.imul(j,Y)|0,i=Math.imul(j,G),n=n+Math.imul(I,W)|0,a=(a=a+Math.imul(I,X)|0)+Math.imul(z,W)|0,i=i+Math.imul(z,X)|0,n=n+Math.imul(R,J)|0,a=(a=a+Math.imul(R,K)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,tt)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,tt)|0,n=n+Math.imul(k,rt)|0,a=(a=a+Math.imul(k,nt)|0)+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,n=n+Math.imul(M,it)|0,a=(a=a+Math.imul(M,ot)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,ot)|0,n=n+Math.imul(x,lt)|0,a=(a=a+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,a=(a=a+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,i=i+Math.imul(y,ht)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(a=(a=a+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,W),a=(a=Math.imul(F,X))+Math.imul(j,W)|0,i=Math.imul(j,X),n=n+Math.imul(I,J)|0,a=(a=a+Math.imul(I,K)|0)+Math.imul(z,J)|0,i=i+Math.imul(z,K)|0,n=n+Math.imul(R,$)|0,a=(a=a+Math.imul(R,tt)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,tt)|0,n=n+Math.imul(E,rt)|0,a=(a=a+Math.imul(E,nt)|0)+Math.imul(C,rt)|0,i=i+Math.imul(C,nt)|0,n=n+Math.imul(k,it)|0,a=(a=a+Math.imul(k,ot)|0)+Math.imul(L,it)|0,i=i+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,a=(a=a+Math.imul(M,ut)|0)+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,n=n+Math.imul(x,ft)|0,a=(a=a+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,ht)|0;var Lt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(a=(a=a+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,J),a=(a=Math.imul(F,K))+Math.imul(j,J)|0,i=Math.imul(j,K),n=n+Math.imul(I,$)|0,a=(a=a+Math.imul(I,tt)|0)+Math.imul(z,$)|0,i=i+Math.imul(z,tt)|0,n=n+Math.imul(R,rt)|0,a=(a=a+Math.imul(R,nt)|0)+Math.imul(D,rt)|0,i=i+Math.imul(D,nt)|0,n=n+Math.imul(E,it)|0,a=(a=a+Math.imul(E,ot)|0)+Math.imul(C,it)|0,i=i+Math.imul(C,ot)|0,n=n+Math.imul(k,lt)|0,a=(a=a+Math.imul(k,ut)|0)+Math.imul(L,lt)|0,i=i+Math.imul(L,ut)|0,n=n+Math.imul(M,ft)|0,a=(a=a+Math.imul(M,ht)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,ht)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(a=(a=a+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,$),a=(a=Math.imul(F,tt))+Math.imul(j,$)|0,i=Math.imul(j,tt),n=n+Math.imul(I,rt)|0,a=(a=a+Math.imul(I,nt)|0)+Math.imul(z,rt)|0,i=i+Math.imul(z,nt)|0,n=n+Math.imul(R,it)|0,a=(a=a+Math.imul(R,ot)|0)+Math.imul(D,it)|0,i=i+Math.imul(D,ot)|0,n=n+Math.imul(E,lt)|0,a=(a=a+Math.imul(E,ut)|0)+Math.imul(C,lt)|0,i=i+Math.imul(C,ut)|0,n=n+Math.imul(k,ft)|0,a=(a=a+Math.imul(k,ht)|0)+Math.imul(L,ft)|0,i=i+Math.imul(L,ht)|0;var Et=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(a=(a=a+Math.imul(M,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((i=i+Math.imul(T,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,rt),a=(a=Math.imul(F,nt))+Math.imul(j,rt)|0,i=Math.imul(j,nt),n=n+Math.imul(I,it)|0,a=(a=a+Math.imul(I,ot)|0)+Math.imul(z,it)|0,i=i+Math.imul(z,ot)|0,n=n+Math.imul(R,lt)|0,a=(a=a+Math.imul(R,ut)|0)+Math.imul(D,lt)|0,i=i+Math.imul(D,ut)|0,n=n+Math.imul(E,ft)|0,a=(a=a+Math.imul(E,ht)|0)+Math.imul(C,ft)|0,i=i+Math.imul(C,ht)|0;var Ct=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(a=(a=a+Math.imul(k,gt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((i=i+Math.imul(L,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,it),a=(a=Math.imul(F,ot))+Math.imul(j,it)|0,i=Math.imul(j,ot),n=n+Math.imul(I,lt)|0,a=(a=a+Math.imul(I,ut)|0)+Math.imul(z,lt)|0,i=i+Math.imul(z,ut)|0,n=n+Math.imul(R,ft)|0,a=(a=a+Math.imul(R,ht)|0)+Math.imul(D,ft)|0,i=i+Math.imul(D,ht)|0;var Ot=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(a=(a=a+Math.imul(E,gt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((i=i+Math.imul(C,gt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,lt),a=(a=Math.imul(F,ut))+Math.imul(j,lt)|0,i=Math.imul(j,ut),n=n+Math.imul(I,ft)|0,a=(a=a+Math.imul(I,ht)|0)+Math.imul(z,ft)|0,i=i+Math.imul(z,ht)|0;var Rt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(a=(a=a+Math.imul(R,gt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((i=i+Math.imul(D,gt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(F,ft),a=(a=Math.imul(F,ht))+Math.imul(j,ft)|0,i=Math.imul(j,ht);var Dt=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(a=(a=a+Math.imul(I,gt)|0)+Math.imul(z,pt)|0))<<13)|0;u=((i=i+Math.imul(z,gt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Pt=(u+(n=Math.imul(F,pt))|0)+((8191&(a=(a=Math.imul(F,gt))+Math.imul(j,pt)|0))<<13)|0;return u=((i=Math.imul(j,gt))+(a>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=Tt,l[9]=At,l[10]=kt,l[11]=Lt,l[12]=St,l[13]=Et,l[14]=Ct,l[15]=Ot,l[16]=Rt,l[17]=Dt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=h),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=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.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=a);u--){var f=0|this.words[u];this.words[u]=c<<26-i|f>>>i,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var a=67108863^67108863>>>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(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(a,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new 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);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(f)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(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){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:at.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){na&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},a(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,a),h=this.pow(t,a.addn(1).iushrn(1)),d=this.pow(t,a),p=o;0!==d.cmp(s);){for(var g=d,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},a(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())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).iushrn(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)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:53}],45:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,a=t.length,i=0;for(e=0;e>>1;if(!(c<=0)){var f,h=a.mallocDouble(2*c*s),d=a.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)i.init(s),f=i.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=a.mallocDouble(2*c*u),g=a.mallocInt32(u);(u=l(e,c,p,g))>0&&(i.init(s+u),f=1===c?i.sweepBipartite(c,r,0,s,h,d,0,u,p,g):o(c,r,n,s,h,d,u,p,g),a.free(p),a.free(g))}a.free(h),a.free(d)}return f}}}function c(t,e){n.push([t,e])}function f(t){return n=[],u(t,t,c,!0),n}function h(t,e){return n=[],u(t,e,c,!1),n}},{"./lib/intersect":48,"./lib/sweep":52,"typedarray-pool":372}],47:[function(t,e,r){"use strict";var n=["d","ax","vv","rs","re","rb","ri","bs","be","bb","bi"];function a(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],a=n.slice();t||a.splice(3,0,"fp");var i=["function "+e+"("+a.join()+"){"];function o(e,a){var o=function(t,e,r){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",a,"(",n.join(),"){","var ","es","=2*","d",";"],o="for(var i=rs,rp=es*rs;ibe-bs){"),t?(o(!0,!1),i.push("}else{"),o(!1,!1)):(i.push("if(fp){"),o(!0,!0),i.push("}else{"),o(!0,!1),i.push("}}else{if(fp){"),o(!1,!0),i.push("}else{"),o(!1,!1),i.push("}")),i.push("}}return "+e);var s=r.join("")+i.join("");return new Function(s)()}r.partial=a(!1),r.full=a(!0)},{}],48:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,c,w,M,T,A){!function(t,e){var r=8*a.log2(e+1)*(t+1)|0,i=a.nextPow2(6*r);m.length0;){var E=6*(L-=1),C=m[E],O=m[E+1],R=m[E+2],D=m[E+3],P=m[E+4],I=m[E+5],z=2*L,N=y[z],F=y[z+1],j=1&I,B=!!(16&I),U=c,H=w,V=T,Y=A;if(j&&(U=T,H=A,V=c,Y=w),!(2&I&&(R=d(t,C,O,R,U,H,F),O>=R)||4&I&&(O=p(t,C,O,R,U,H,N))>=R)){var G=R-O,q=P-D;if(B){if(t*G*(G+q)<1<<22){if(void 0!==(k=l.scanComplete(t,C,e,O,R,U,H,D,P,V,Y)))return k;continue}}else{if(t*Math.min(G,q)<128){if(void 0!==(k=o(t,C,e,j,O,R,U,H,D,P,V,Y)))return k;continue}if(t*G*q<1<<22){if(void 0!==(k=l.scanBipartite(t,C,e,j,O,R,U,H,D,P,V,Y)))return k;continue}}var W=f(t,C,O,R,U,H,N,F);if(O=p0)&&!(p1>=hi)",["p0","p1"]),h=c("lo===p0",["p0"]),d=c("lo>>1,f=2*t,h=c,d=o[f*c+e];for(;l=y?(h=m,d=y):v>=x?(h=g,d=v):(h=b,d=x):y>=x?(h=m,d=y):x>=v?(h=g,d=v):(h=b,d=x);for(var _=f*(u-1),w=f*h,M=0;Mr&&a[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;p=0&&n.push("lo=e[k+n]");t.indexOf("hi")>=0&&n.push("hi=e[k+o]");return r.push("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".replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}},{}],51:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,c){var f=(r-e+1)/6|0,h=e+f,d=r-f,p=e+r>>1,g=p-f,v=p+f,m=h,y=g,b=p,x=v,_=d,w=e+1,M=r-1,T=0;l(m,y,c)&&(T=m,m=y,y=T);l(x,_,c)&&(T=x,x=_,_=T);l(m,b,c)&&(T=m,m=b,b=T);l(y,b,c)&&(T=y,y=b,b=T);l(m,x,c)&&(T=m,m=x,x=T);l(b,x,c)&&(T=b,b=x,x=T);l(y,_,c)&&(T=y,y=_,_=T);l(y,b,c)&&(T=y,y=b,b=T);l(x,_,c)&&(T=x,x=_,_=T);for(var A=c[2*y],k=c[2*y+1],L=c[2*x],S=c[2*x+1],E=2*m,C=2*b,O=2*_,R=2*h,D=2*p,P=2*d,I=0;I<2;++I){var z=c[E+I],N=c[C+I],F=c[O+I];c[R+I]=z,c[D+I]=N,c[P+I]=F}i(g,e,c),i(v,r,c);for(var j=w;j<=M;++j)if(u(j,A,k,c))j!==w&&a(j,w,c),++w;else if(!u(j,L,S,c))for(;;){if(u(M,L,S,c)){u(M,A,k,c)?(o(j,w,M,c),++w,--M):(a(j,M,c),--M);break}if(--Mt;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function u(t,e,r,n){var a=n[t*=2];return a>>1;i(h,k);var L=0,S=0;for(w=0;w=1<<28)d(l,u,S--,E=E-(1<<28)|0);else if(E>=0)d(o,s,L--,E);else if(E<=-(1<<28)){E=-E-(1<<28)|0;for(var C=0;C>>1;i(h,S);var E=0,C=0,O=0;for(T=0;T>1==h[2*T+3]>>1&&(D=2,T+=1),R<0){for(var P=-(R>>1)-1,I=0;I>1)-1;0===D?d(o,s,E--,P):1===D?d(l,u,C--,P):2===D&&d(c,f,O--,P)}}},scanBipartite:function(t,e,r,n,a,l,u,c,f,g,v,m){var y=0,b=2*t,x=e,_=e+t,w=1,M=1;n?M=1<<28:w=1<<28;for(var T=a;T>>1;i(h,S);var E=0;for(T=0;T=1<<28?(O=!n,A-=1<<28):(O=!!n,A-=1),O)p(o,s,E++,A);else{var R=m[A],D=b*A,P=v[D+e+1],I=v[D+e+1+t];t:for(var z=0;z>>1;i(h,w);var M=0;for(y=0;y=1<<28)o[M++]=b-(1<<28);else{var A=d[b-=1],k=g*b,L=f[k+e+1],S=f[k+e+1+t];t:for(var E=0;E=0;--E)if(o[E]===b){for(D=E+1;D0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=v(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],55:[function(t,e,r){(function(e){(function(){ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(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){return a(e[o][1][t]||t)}),c,c.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":534}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":709}],3:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":399}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":645}],5:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":515}],6:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":710}],7:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":711}],8:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./calendars":3,"./cone":4,"./core":5,"./filter":6,"./groupby":7,"./isosurface":9,"./mesh3d":10,"./scatter3d":11,"./sort":12,"./streamtube":13,"./surface":14,"./volume":15}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":652}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":657}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":694}],12:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":713}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":699}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":704}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":708}],16:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=a(),h=i();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=t("turntable-camera-controller"),a=t("orbit-camera-controller"),i=t("matrix-camera-controller");function o(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}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;re?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(h);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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,a=[],i=b(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,f,h=-1,d=i.length,p=a[s++],g=new _;++h=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return U(t,q),t}var Y=function(t,e){return e.querySelector(t)},V=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[R(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Y=function(t,e){return Sizzle(t,e)[0]||null},V=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var q=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return Y(t,this)}}function X(t){return"function"==typeof t?t:function(){return V(t,this)}}q.select=function(t){var e,r,n,a,i=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},q.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},q.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},q.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=gt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?P:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=q.append,ht.empty=q.empty,ht.node=q.node,ht.call=q.call,ht.size=q.size,ht.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?St:t<-1?-St:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,f=l-i,h=c*c+f*f;if(h<1e-12)n=Math.log(u/o)/Dt,r=function(t){return[a+t*c,i+t*f,o*Math.exp(Dt*t*n)]};else{var d=Math.sqrt(h),p=(u*u-o*o+4*h)/(2*o*2*d),g=(u*u-o*o-4*h)/(2*u*2*d),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Dt,r=function(t){var e,r=t*n,s=Rt(v),l=o/(2*d)*(s*(e=Dt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+l*c,i+l*f,o*s/Rt(Dt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,f,h={x:0,y:0,k:1},d=[960,500],p=zt,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,O).on(It+".zoom",D).on("dblclick.zoom",P).on(x,R)}function M(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function T(t){h.k=Math.max(p[0],Math.min(p[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function k(e,n,a,i){e.__chart__={x:h.x,y:h.y,k:h.k},T(Math.pow(2,i)),A(r=n,a),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function S(t){v++||t({type:"zoomstart"})}function E(t){L(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--v||(t({type:"zoomend"}),r=null)}function O(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,l).on(b,u),i=M(t.mouse(e)),s=xt(e);function l(){n=1,A(t.mouse(e),i),E(r)}function u(){a.on(y,null).on(b,null),s(n),C(r)}Ia.call(e),S(r)}function R(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),d=xt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=M(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=d[0];var b=d[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);Ia.call(r);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new Qt(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Vt?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Ht=Ut.prototype=new Nt;function Yt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Vt(r,Math.cos(t*=Et)*e,Math.sin(t)*e)}function Vt(t,e,r){return this instanceof Vt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Vt?new Vt(t.l,t.a,t.b):t instanceof Ut?Yt(t.h,t.c,t.l):ie((t=Qt(t)).r,t.g,t.b):new Vt(t,e,r)}Ht.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Ht.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Ht.rgb=function(){return Yt(this.h,this.c,this.l).rgb()},t.lab=Vt;var Gt=18,qt=Vt.prototype=new Nt;function Wt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new Qt(Kt(3.2404542*(a=.95047*Zt(a))-1.5371385*(n=1*Zt(n))-.4985314*(i=1.08883*Zt(i))),Kt(-.969266*a+1.8760108*n+.041556*i),Kt(.0556434*a-.2040259*n+1.0572252*i))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Zt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Kt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,jt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}qt.brighter=function(t){return new Vt(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},qt.darker=function(t){return new Vt(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},qt.rgb=function(){return Wt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Nt;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ft(n,a,l)}function ie(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Vt(116*a-16,500*(n-a),200*(a-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ue,t.xhr=ce(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=fe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(ye,e)),pe=0):(pe=1,ve(ye))}function be(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function xe(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function Te(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){me.apply(this,arguments)},t.timer.flush=function(){be(),xe()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ue(e),i=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nTt)s=s.L;else{if(!((a=i-He(s,o))>Tt)){n>-Tt?(e=s.P,r=s):a>-Tt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ne(t);if(Oe.insert(e,l),e||r){if(e===r)return We(e),r=Ne(e.site),Oe.insert(l,r),l.edge=r.edge=Je(e.site,l.site),qe(e),void qe(r);if(r){We(e),We(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};Qe(r.edge,u,p,x),l.edge=Je(u,t,null,x),r.edge=Je(t,p,null,x),qe(e),qe(r)}else l.edge=Je(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/i-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+a-i/2)))/f+n:(n+s)/2}function He(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ye(t){this.site=t,this.edges=[]}function Ve(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function qe(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,f=2*(l*(v=i.y-s)-u*c);if(!(f>=-1e-12)){var h=l*l+u*u,d=c*c+v*v,p=(v*h-u*d)/f,g=(l*d-c*h)/f,v=g+s,m=Ie.pop()||new Ge;m.arc=t,m.site=a,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=De._;b;)if(m.y=s)return;if(h>p){if(i){if(i.y>=u)return}else i={x:v,y:l};r={x:v,y:u}}else{if(i){if(i.y1)if(h>p){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=a-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=d,d<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=i-u,d||!(e<0)){if(e/=d,d<0){if(e>f)return;e>c&&(c=e)}else if(d>0){if(e0&&(t.a={x:l+c*h,y:u+c*d}),f<1&&(t.b={x:l+f*h,y:u+f*d}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)Tt||y(a-r)>Tt)&&(s.splice(o,0,new $e(Ke(i.site,c,y(n-f)Tt?{x:f,y:y(e-f)Tt?{x:y(r-p)Tt?{x:h,y:y(e-h)Tt?{x:y(r-d)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Tt)*Tt,y:Math.round(a(t,e)/Tt)*Tt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(Ve),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ci||f>o||h=_)<<1|e>=x,M=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:pr(r,n)})),i=mr.lastIndex;return ig&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-d,M=v-p;function T(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)A(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,A(t,c,l,u,a,i,o,s),A(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,a,i,o,s)}function A(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?a=l:o=l,f?i=u:s=u,T(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>M?v=p+w:g=d+M;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(k,t,+m(t,++f),+b(t,f),d,p,g,v)},visit:function(t){cr(t,k,d,p,g,v)},find:function(t){return fr(k,t[0],t[1],d,p,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function br(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function Tr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Lr(t){return t*t*t}function Sr(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 Er(t){return 1-Math.cos(t*St)}function Cr(t){return Math.pow(2,10*(t-1))}function Or(t){return 1-Math.sqrt(1-t*t)}function Rr(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 Dr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Pr(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=zr(a),s=Ir(a,i),l=zr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=_r.get(n)||xr,Mr((a=wr.get(a)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Yt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Wt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Dr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Pr(e?e.matrix:Nr)})(e)},Pr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Nr={a:1,b:0,c:0,d:1,e:0,f:0};function Fr(t){return t.length?t.pop()+",":""}function Br(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Fr(r)+"rotate(",null,")")-2,x:pr(t,e)})):e&&r.push(Fr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(Fr(r)+"skewX(",null,")")-2,x:pr(t,e)}):e&&r.push(Fr(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Fr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:pr(t[0],e[0])},{i:a-2,x:pr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Fr(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=me(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(a[n])}function $r(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return $r(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function pn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function vn(t,e){return mn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function yn(e){return[t.min(e),t.max(e)]}function bn(t,e){return t.value-e.value}function xn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Mn(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Tn),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(kn(r,n,a=e[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,p)-1]).y+=g,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ue(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return mn(e,t)}:ue(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+c(t.value)})),$r(s,Mn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;$r(s,(function(t){t.r+=f})),$r(s,Mn),$r(s,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++od.x&&(d=t),t.depth>p.depth&&(p=t)}));var g=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+g),m=n[1]/(p.depth||1);Qr(c,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,f=s.m,h=l.m;s=En(s),i=Sn(i),s&&i;)l=Sn(l),(o=En(o)).a=t,(a=s.z+f-i.z-u+r(s._,i._))>0&&(Cn(On(s,t,n),t,a),u+=a,c+=a),f+=s.m,u+=i.m,h+=l.m,c+=o.m;s&&!En(o)&&(o.t=s,o.m+=f-c),i&&!Sn(l)&&(l.t=i,l.m+=u-h,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Kr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Ln,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;$r(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return $r(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Kr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=Rn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=d(s,g))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,g,i,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(p(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function p(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:zn,s=a?Ur:jr;return i=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Dr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Vn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Hn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Nn(a.map(i),n?Math:Gn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=Pn(a),e=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=r%1?2:r;if(isFinite(c-u)){if(n){for(;u0;h--)e.push(o(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=qn(r),i=qn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Vn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Hn(n,t))},o.exponent=function(t){return arguments.length?(a=qn(r=t),i=qn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tf?0:1;if(u=Lt)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,M,T,A,k=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Qn?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(L*=-1),u&&(L=Ot(v/u*Math.sin(m))),s&&(k=Ot(v/s*Math.sin(m)))),u){y=u*Math.cos(c+L),b=u*Math.sin(c+L),x=u*Math.cos(f-L),_=u*Math.sin(f-L);var E=Math.abs(f-c-2*L)<=At?0:1;if(L&&aa(y,b,x,_)===d^E){var C=(c+f)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-k),M=s*Math.sin(f-k),T=s*Math.cos(c+k),A=s*Math.sin(c+k);var O=Math.abs(c-f+2*k)<=At?0:1;if(k&&aa(w,M,T,A)===1-d^O){var R=(c+f)/2;w=s*Math.cos(R),M=s*Math.sin(R),T=A=null}}else w=M=0;if(h>Tt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,M=(-x*v-m*_)/y,T=(x*m+v*_)/y,A=(-x*v+m*_)/y,k=w-p,L=M-g,S=T-p,E=A-g;return k*k+L*L>S*S+E*E&&(w=T,M=A),[[w-l,M-u],[w*r/b,M*r/b]]}function oa(){return!0}function sa(t){var e=_e,r=we,n=oa,a=ua,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,f=i.length,h=ue(e),d=ue(r);function p(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":fa,"step-after":ha,basis:ga,"basis-open":function(t){if(t.length<4)return ua(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(va(ba,i)+","+va(ba,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ua(t){return t.length>1?t.join("L"):t+"Z"}function ca(t){return t.join("L")+"Z"}function fa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;uAt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ue(t),i):r},i.source=function(e){return arguments.length?(t=ue(e),i):t},i.target=function(t){return arguments.length?(e=ue(t),i):e},i.startAngle=function(t){return arguments.length?(n=ue(t),i):n},i.endAngle=function(t){return arguments.length?(a=ue(t),i):a},i},t.svg.diagonal=function(){var t=Ta,e=Aa,r=La;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=La,n=e.projection;return e.projection=function(t){return arguments.length?n(Sa(r=t)):r},e},t.svg.symbol=function(){var t=Ca,e=Ea;function r(r,n){return(Ra.get(t.call(this,r,n))||Oa)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var Ra=t.map({circle:Oa,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Pa)),r=e*Pa;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/Da),r=e*Da/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Da),r=e*Da/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ra.keys();var Da=Math.sqrt(3),Pa=Math.tan(30*Et);q.transition=function(t){for(var e,r,n=Fa||++Ua,a=Va(t),i=[],o=Ba||{time:Date.now(),ease:Sr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(i=a.time,o=me((function(t){var e=f.delay;if(o.t=e+i,e<=t)return h(t-e);o.c=h}),0,i),f=c[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}ja.call=q.call,ja.empty=q.empty,ja.node=q.node,ja.size=q.size,t.transition=function(e,r){return e&&e.transition?Fa?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ja,ja.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,M=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),A=xt(m),k=t.mouse(m),L=t.select(o(m)).on("keydown.brush",C).on("keyup.brush",O);if(t.event.changedTouches?L.on("touchmove.brush",R).on("touchend.brush",P):L.on("mousemove.brush",R).on("mouseup.brush",P),x.interrupt().selectAll("*").interrupt(),T)k[0]=s[0]-k[0],k[1]=l[0]-k[1];else if(_){var S=+/w$/.test(_),E=+/^n/.test(_);v=[s[1-S]-k[0],l[1-E]-k[1]],k[0]=s[S],k[1]=l[E]}else t.event.altKey&&(f=k.slice());function C(){32==t.event.keyCode&&(T||(f=null,k[0]-=s[1],k[1]-=l[1],T=2),N())}function O(){32==t.event.keyCode&&2==T&&(k[0]+=s[1],k[1]+=l[1],T=0,N())}function R(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),k[0]=s[+(e[0]0?o-4:o;for(r=0;r>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[c++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var a,i,o=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],26:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":36}],27:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],28:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":36}],29:[function(t,e,r){"use strict";var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(a(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))u=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=i(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(a(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=i(r)}else c=i(1);f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f));return s(u,c)}},{"./div":28,"./is-rat":30,"./lib/is-bn":34,"./lib/num-to-bn":35,"./lib/rationalize":36,"./lib/str-to-bn":37}],30:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":34}],31:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":44}],32:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i20)return 52;return r+32}},{"bit-twiddle":43,"double-bits":89}],34:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":44}],35:[function(t,e,r){"use strict";var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":44,"double-bits":89}],36:[function(t,e,r){"use strict";var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":31,"./num-to-bn":35}],37:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":44}],38:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":36}],39:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":31}],40:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":36}],41:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":32,"./lib/ctz":33}],42:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(i=o,a=o-1):n=o+1}return i}function a(t,e,r,n,a){for(var i=a+1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(i=o,a=o-1):n=o+1}return i}function i(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(i=o,n=o+1):a=o-1}return i}function o(t,e,r,n,a){for(var i=n-1;n<=a;){var o=n+a>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(i=o,n=o+1):a=o-1}return i}function s(t,e,r,n,a){for(;n<=a;){var i=n+a>>>1,o=t[i],s=void 0!==r?r(o,e):o-e;if(0===s)return i;s<=0?n=i+1:a=i-1}return-1}function l(t,e,r,n,a,i){return"function"==typeof r?i(t,e,r,void 0===n?0:0|n,void 0===a?t.length-1:0|a):i(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,a,i){return l(t,e,r,a,i,n)},gt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},lt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},le:function(t,e,r,n,a){return l(t,e,r,n,a,o)},eq:function(t,e,r,n,a){return l(t,e,r,n,a,s)}}},{}],43:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],44:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(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){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=i:r.BN=i,i.BN=i,i.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,a=Math.min(t.length,r),i=e;i=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);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=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","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"],c=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(a=0|t.words[p])*(i=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(i),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=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=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;it.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==i&&o>26,this.words[o]=67108863&e;if(0===i&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,T=w>>>13,A=0|o[5],k=8191&A,L=A>>>13,S=0|o[6],E=8191&S,C=S>>>13,O=0|o[7],R=8191&O,D=O>>>13,P=0|o[8],I=8191&P,z=P>>>13,N=0|o[9],F=8191&N,B=N>>>13,j=0|s[0],U=8191&j,H=j>>>13,Y=0|s[1],V=8191&Y,G=Y>>>13,q=0|s[2],W=8191&q,X=q>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(a=(a=Math.imul(f,H))+Math.imul(h,U)|0))<<13)|0;u=((i=Math.imul(h,H))+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),a=(a=Math.imul(p,H))+Math.imul(g,U)|0,i=Math.imul(g,H);var mt=(u+(n=n+Math.imul(f,V)|0)|0)+((8191&(a=(a=a+Math.imul(f,G)|0)+Math.imul(h,V)|0))<<13)|0;u=((i=i+Math.imul(h,G)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),a=(a=Math.imul(m,H))+Math.imul(y,U)|0,i=Math.imul(y,H),n=n+Math.imul(p,V)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,G)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(a=(a=a+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;u=((i=i+Math.imul(h,X)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),a=(a=Math.imul(x,H))+Math.imul(_,U)|0,i=Math.imul(_,H),n=n+Math.imul(m,V)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,a=(a=a+Math.imul(p,X)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,X)|0;var bt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(a=(a=a+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;u=((i=i+Math.imul(h,K)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),a=(a=Math.imul(M,H))+Math.imul(T,U)|0,i=Math.imul(T,H),n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(_,V)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,a=(a=a+Math.imul(p,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0;var xt=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(a=(a=a+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;u=((i=i+Math.imul(h,tt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,U),a=(a=Math.imul(k,H))+Math.imul(L,U)|0,i=Math.imul(L,H),n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,G)|0,n=n+Math.imul(x,W)|0,a=(a=a+Math.imul(x,X)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,K)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,a=(a=a+Math.imul(p,tt)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(a=(a=a+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((i=i+Math.imul(h,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(E,U),a=(a=Math.imul(E,H))+Math.imul(C,U)|0,i=Math.imul(C,H),n=n+Math.imul(k,V)|0,a=(a=a+Math.imul(k,G)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(M,W)|0,a=(a=a+Math.imul(M,X)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,tt)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,a=(a=a+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,it)|0)|0)+((8191&(a=(a=a+Math.imul(f,ot)|0)+Math.imul(h,it)|0))<<13)|0;u=((i=i+Math.imul(h,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(R,U),a=(a=Math.imul(R,H))+Math.imul(D,U)|0,i=Math.imul(D,H),n=n+Math.imul(E,V)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(C,V)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(k,W)|0,a=(a=a+Math.imul(k,X)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(M,J)|0,a=(a=a+Math.imul(M,K)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,a=(a=a+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,n=n+Math.imul(p,it)|0,a=(a=a+Math.imul(p,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var Mt=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(a=(a=a+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((i=i+Math.imul(h,ut)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,U),a=(a=Math.imul(I,H))+Math.imul(z,U)|0,i=Math.imul(z,H),n=n+Math.imul(R,V)|0,a=(a=a+Math.imul(R,G)|0)+Math.imul(D,V)|0,i=i+Math.imul(D,G)|0,n=n+Math.imul(E,W)|0,a=(a=a+Math.imul(E,X)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(M,$)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(x,rt)|0,a=(a=a+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(m,it)|0,a=(a=a+Math.imul(m,ot)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,a=(a=a+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0;var Tt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(a=(a=a+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((i=i+Math.imul(h,ht)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,U),a=(a=Math.imul(F,H))+Math.imul(B,U)|0,i=Math.imul(B,H),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(z,V)|0,i=i+Math.imul(z,G)|0,n=n+Math.imul(R,W)|0,a=(a=a+Math.imul(R,X)|0)+Math.imul(D,W)|0,i=i+Math.imul(D,X)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,tt)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,a=(a=a+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(x,it)|0,a=(a=a+Math.imul(x,ot)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,a=(a=a+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,a=(a=a+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,ht)|0;var At=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(a=(a=a+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((i=i+Math.imul(h,gt)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,V),a=(a=Math.imul(F,G))+Math.imul(B,V)|0,i=Math.imul(B,G),n=n+Math.imul(I,W)|0,a=(a=a+Math.imul(I,X)|0)+Math.imul(z,W)|0,i=i+Math.imul(z,X)|0,n=n+Math.imul(R,J)|0,a=(a=a+Math.imul(R,K)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,tt)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,tt)|0,n=n+Math.imul(k,rt)|0,a=(a=a+Math.imul(k,nt)|0)+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,n=n+Math.imul(M,it)|0,a=(a=a+Math.imul(M,ot)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,ot)|0,n=n+Math.imul(x,lt)|0,a=(a=a+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,a=(a=a+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,i=i+Math.imul(y,ht)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(a=(a=a+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,W),a=(a=Math.imul(F,X))+Math.imul(B,W)|0,i=Math.imul(B,X),n=n+Math.imul(I,J)|0,a=(a=a+Math.imul(I,K)|0)+Math.imul(z,J)|0,i=i+Math.imul(z,K)|0,n=n+Math.imul(R,$)|0,a=(a=a+Math.imul(R,tt)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,tt)|0,n=n+Math.imul(E,rt)|0,a=(a=a+Math.imul(E,nt)|0)+Math.imul(C,rt)|0,i=i+Math.imul(C,nt)|0,n=n+Math.imul(k,it)|0,a=(a=a+Math.imul(k,ot)|0)+Math.imul(L,it)|0,i=i+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,a=(a=a+Math.imul(M,ut)|0)+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,n=n+Math.imul(x,ft)|0,a=(a=a+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,ht)|0;var Lt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(a=(a=a+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,J),a=(a=Math.imul(F,K))+Math.imul(B,J)|0,i=Math.imul(B,K),n=n+Math.imul(I,$)|0,a=(a=a+Math.imul(I,tt)|0)+Math.imul(z,$)|0,i=i+Math.imul(z,tt)|0,n=n+Math.imul(R,rt)|0,a=(a=a+Math.imul(R,nt)|0)+Math.imul(D,rt)|0,i=i+Math.imul(D,nt)|0,n=n+Math.imul(E,it)|0,a=(a=a+Math.imul(E,ot)|0)+Math.imul(C,it)|0,i=i+Math.imul(C,ot)|0,n=n+Math.imul(k,lt)|0,a=(a=a+Math.imul(k,ut)|0)+Math.imul(L,lt)|0,i=i+Math.imul(L,ut)|0,n=n+Math.imul(M,ft)|0,a=(a=a+Math.imul(M,ht)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,ht)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(a=(a=a+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,$),a=(a=Math.imul(F,tt))+Math.imul(B,$)|0,i=Math.imul(B,tt),n=n+Math.imul(I,rt)|0,a=(a=a+Math.imul(I,nt)|0)+Math.imul(z,rt)|0,i=i+Math.imul(z,nt)|0,n=n+Math.imul(R,it)|0,a=(a=a+Math.imul(R,ot)|0)+Math.imul(D,it)|0,i=i+Math.imul(D,ot)|0,n=n+Math.imul(E,lt)|0,a=(a=a+Math.imul(E,ut)|0)+Math.imul(C,lt)|0,i=i+Math.imul(C,ut)|0,n=n+Math.imul(k,ft)|0,a=(a=a+Math.imul(k,ht)|0)+Math.imul(L,ft)|0,i=i+Math.imul(L,ht)|0;var Et=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(a=(a=a+Math.imul(M,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((i=i+Math.imul(T,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,rt),a=(a=Math.imul(F,nt))+Math.imul(B,rt)|0,i=Math.imul(B,nt),n=n+Math.imul(I,it)|0,a=(a=a+Math.imul(I,ot)|0)+Math.imul(z,it)|0,i=i+Math.imul(z,ot)|0,n=n+Math.imul(R,lt)|0,a=(a=a+Math.imul(R,ut)|0)+Math.imul(D,lt)|0,i=i+Math.imul(D,ut)|0,n=n+Math.imul(E,ft)|0,a=(a=a+Math.imul(E,ht)|0)+Math.imul(C,ft)|0,i=i+Math.imul(C,ht)|0;var Ct=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(a=(a=a+Math.imul(k,gt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((i=i+Math.imul(L,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,it),a=(a=Math.imul(F,ot))+Math.imul(B,it)|0,i=Math.imul(B,ot),n=n+Math.imul(I,lt)|0,a=(a=a+Math.imul(I,ut)|0)+Math.imul(z,lt)|0,i=i+Math.imul(z,ut)|0,n=n+Math.imul(R,ft)|0,a=(a=a+Math.imul(R,ht)|0)+Math.imul(D,ft)|0,i=i+Math.imul(D,ht)|0;var Ot=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(a=(a=a+Math.imul(E,gt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((i=i+Math.imul(C,gt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,lt),a=(a=Math.imul(F,ut))+Math.imul(B,lt)|0,i=Math.imul(B,ut),n=n+Math.imul(I,ft)|0,a=(a=a+Math.imul(I,ht)|0)+Math.imul(z,ft)|0,i=i+Math.imul(z,ht)|0;var Rt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(a=(a=a+Math.imul(R,gt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((i=i+Math.imul(D,gt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(F,ft),a=(a=Math.imul(F,ht))+Math.imul(B,ft)|0,i=Math.imul(B,ht);var Dt=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(a=(a=a+Math.imul(I,gt)|0)+Math.imul(z,pt)|0))<<13)|0;u=((i=i+Math.imul(z,gt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Pt=(u+(n=Math.imul(F,pt))|0)+((8191&(a=(a=Math.imul(F,gt))+Math.imul(B,pt)|0))<<13)|0;return u=((i=Math.imul(B,gt))+(a>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=Tt,l[9]=At,l[10]=kt,l[11]=Lt,l[12]=St,l[13]=Et,l[14]=Ct,l[15]=Ot,l[16]=Rt,l[17]=Dt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=h),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=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.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=a);u--){var f=0|this.words[u];this.words[u]=c<<26-i|f>>>i,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var a=67108863^67108863>>>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(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(a,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new 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);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(f)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(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){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:at.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){na&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},a(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,a),h=this.pow(t,a.addn(1).iushrn(1)),d=this.pow(t,a),p=o;0!==d.cmp(s);){for(var g=d,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new M(t)},a(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())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).iushrn(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)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:53}],45:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,a=t.length,i=0;for(e=0;e>>1;if(!(c<=0)){var f,h=a.mallocDouble(2*c*s),d=a.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)i.init(s),f=i.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=a.mallocDouble(2*c*u),g=a.mallocInt32(u);(u=l(e,c,p,g))>0&&(i.init(s+u),f=1===c?i.sweepBipartite(c,r,0,s,h,d,0,u,p,g):o(c,r,n,s,h,d,u,p,g),a.free(p),a.free(g))}a.free(h),a.free(d)}return f}}}function c(t,e){n.push([t,e])}function f(t){return n=[],u(t,t,c,!0),n}function h(t,e){return n=[],u(t,e,c,!1),n}},{"./lib/intersect":48,"./lib/sweep":52,"typedarray-pool":355}],47:[function(t,e,r){"use strict";function n(t){return t?function(t,e,r,n,a,i,o,s,l,u,c){return a-n>l-s?function(t,e,r,n,a,i,o,s,l,u,c){for(var f=2*t,h=n,d=f*n;hu-l?n?function(t,e,r,n,a,i,o,s,l,u,c){for(var f=2*t,h=n,d=f*n;h0;){var E=6*(L-=1),C=m[E],O=m[E+1],R=m[E+2],D=m[E+3],P=m[E+4],I=m[E+5],z=2*L,N=y[z],F=y[z+1],B=1&I,j=!!(16&I),U=c,H=w,Y=T,V=A;if(B&&(U=T,H=A,Y=c,V=w),!(2&I&&(R=d(t,C,O,R,U,H,F),O>=R)||4&I&&(O=p(t,C,O,R,U,H,N))>=R)){var G=R-O,q=P-D;if(j){if(t*G*(G+q)<1<<22){if(void 0!==(k=l.scanComplete(t,C,e,O,R,U,H,D,P,Y,V)))return k;continue}}else{if(t*Math.min(G,q)<128){if(void 0!==(k=o(t,C,e,B,O,R,U,H,D,P,Y,V)))return k;continue}if(t*G*q<1<<22){if(void 0!==(k=l.scanBipartite(t,C,e,B,O,R,U,H,D,P,Y,V)))return k;continue}}var W=f(t,C,O,R,U,H,N,F);if(O=p0)&&!(p1>=hi)"),h=c("lo===p0"),d=c("lo>>1,f=2*t,h=c,d=o[f*c+e];for(;l=y?(h=m,d=y):v>=x?(h=g,d=v):(h=b,d=x):y>=x?(h=m,d=y):x>=v?(h=g,d=v):(h=b,d=x);for(var _=f*(u-1),w=f*h,M=0;Mr&&a[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;ph;++h,l+=s){if(a[l+f]===o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"loh;++h,l+=s){if(a[l+f]d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"lo<=p0":function(t,e,r,n,a,i,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s){if(a[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"hi<=p0":function(t,e,r,n,a,i,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s){if(a[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=a[l+d];a[l+d]=a[u],a[u++]=p}var g=i[h];i[h]=i[c],i[c++]=g}}return c},"lod;++d,l+=s){var p=a[l+f],g=a[l+h];if(pv;++v){var m=a[l+v];a[l+v]=a[u],a[u++]=m}var y=i[d];i[d]=i[c],i[c++]=y}}return c},"lo<=p0&&p0<=hi":function(t,e,r,n,a,i,o){for(var s=2*t,l=s*r,u=l,c=r,f=e,h=t+e,d=r;n>d;++d,l+=s){var p=a[l+f],g=a[l+h];if(p<=o&&o<=g)if(c===d)c+=1,u+=s;else{for(var v=0;s>v;++v){var m=a[l+v];a[l+v]=a[u],a[u++]=m}var y=i[d];i[d]=i[c],i[c++]=y}}return c},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,a,i,o,s){for(var l=2*t,u=l*r,c=u,f=r,h=e,d=t+e,p=r;n>p;++p,u+=l){var g=a[u+h],v=a[u+d];if(!(g>=o||s>=v))if(f===p)f+=1,c+=l;else{for(var m=0;l>m;++m){var y=a[u+m];a[u+m]=a[c],a[c++]=y}var b=i[p];i[p]=i[f],i[f++]=b}}return f}}},{}],51:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,c){var f=(r-e+1)/6|0,h=e+f,d=r-f,p=e+r>>1,g=p-f,v=p+f,m=h,y=g,b=p,x=v,_=d,w=e+1,M=r-1,T=0;l(m,y,c)&&(T=m,m=y,y=T);l(x,_,c)&&(T=x,x=_,_=T);l(m,b,c)&&(T=m,m=b,b=T);l(y,b,c)&&(T=y,y=b,b=T);l(m,x,c)&&(T=m,m=x,x=T);l(b,x,c)&&(T=b,b=x,x=T);l(y,_,c)&&(T=y,y=_,_=T);l(y,b,c)&&(T=y,y=b,b=T);l(x,_,c)&&(T=x,x=_,_=T);for(var A=c[2*y],k=c[2*y+1],L=c[2*x],S=c[2*x+1],E=2*m,C=2*b,O=2*_,R=2*h,D=2*p,P=2*d,I=0;I<2;++I){var z=c[E+I],N=c[C+I],F=c[O+I];c[R+I]=z,c[D+I]=N,c[P+I]=F}i(g,e,c),i(v,r,c);for(var B=w;B<=M;++B)if(u(B,A,k,c))B!==w&&a(B,w,c),++w;else if(!u(B,L,S,c))for(;;){if(u(M,L,S,c)){u(M,A,k,c)?(o(B,w,M,c),++w,--M):(a(B,M,c),--M);break}if(--Mt;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function u(t,e,r,n){var a=n[t*=2];return a>>1;i(h,k);var L=0,S=0;for(w=0;w=1<<28)d(l,u,S--,E=E-(1<<28)|0);else if(E>=0)d(o,s,L--,E);else if(E<=-(1<<28)){E=-E-(1<<28)|0;for(var C=0;C>>1;i(h,S);var E=0,C=0,O=0;for(T=0;T>1==h[2*T+3]>>1&&(D=2,T+=1),R<0){for(var P=-(R>>1)-1,I=0;I>1)-1;0===D?d(o,s,E--,P):1===D?d(l,u,C--,P):2===D&&d(c,f,O--,P)}}},scanBipartite:function(t,e,r,n,a,l,u,c,f,g,v,m){var y=0,b=2*t,x=e,_=e+t,w=1,M=1;n?M=1<<28:w=1<<28;for(var T=a;T>>1;i(h,S);var E=0;for(T=0;T=1<<28?(O=!n,A-=1<<28):(O=!!n,A-=1),O)p(o,s,E++,A);else{var R=m[A],D=b*A,P=v[D+e+1],I=v[D+e+1+t];t:for(var z=0;z>>1;i(h,w);var M=0;for(y=0;y=1<<28)o[M++]=b-(1<<28);else{var A=d[b-=1],k=g*b,L=f[k+e+1],S=f[k+e+1+t];t:for(var E=0;E=0;--E)if(o[E]===b){for(D=E+1;D0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=v(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],55:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},r.INSPECT_MAX_BYTES=50;function a(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(a)return n?-1:I(t).length;e=(""+e).toLowerCase(),a=!0}}function h(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),j(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;ha&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:u>223?3:u>191?2:1;if(a+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(F(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,a,i){return e=+e,r>>>=0,i||C(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function R(t,e,r,a,i){return e=+e,r>>>=0,i||C(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||E(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||E(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":25,buffer:55,ieee754:273}],56:[function(t,e,r){"use strict";var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),d=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(c||f!==h||d){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var d=r.pop(),p=(s=r.pop(),c=-1,f=-1,l=o[s],1);p=0||(e.flip(s,d),a(t,e,r,c,s,f),a(t,e,r,s,f,c),a(t,e,r,f,d,c),a(t,e,r,d,c,f)))}}},{"binary-search-bounds":42,"robust-in-sphere":342}],58:[function(t,e,r){"use strict";var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-a){u[d]=a;c[d];for(var p=0;p<3;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=a))}}}var v=l;l=s,s=v,l.length=0,a=-a}var m=function(t,e,r){for(var n=0,a=0;a1&&a(r[h[d-2]],r[h[d-1]],i)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=f.upperIds;for(d=p.length;d>1&&a(r[p[d-2]],r[p[d-1]],i)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function c(t,e){var r;return(r=t.a[0]p[0]&&a.push(new o(p,d,2,l),new o(d,p,1,l))}a.sort(s);for(var g=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),v=[new i([g,1],[g,0],-1,[],[],[],[])],m=[],y=(l=0,a.length);l=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;nr?r:t:te?e:t}},{}],65:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;ie[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--i){var b=e[c=(L=n[i])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var T=x;x=_,_=T}b[0]=x;var A,k=b[1]=L[1];for(a&&(A=b[2]);i>0&&n[i-1][0]===c;){var L,S=(L=n[--i])[1];a?e.push([k,S,A]):e.push([k,S]),k=S}a?e.push([k,_,A]):e.push([k,_])}return h}(t,e,h,v,r));return m(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":66,"big-rat":29,"big-rat/cmp":27,"big-rat/to-float":41,"box-intersect":46,nextafter:306,"rat-vec":333,"robust-segment-intersect":347,"union-find":373}],66:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),f=s(n,r),h=c(i,f);if(0===o(h))return null;var d=s(t,r),p=c(f,d),g=a(p,h),v=u(i,g);return l(t,v)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":28,"big-rat/mul":38,"big-rat/sign":39,"big-rat/sub":40,"rat-vec/add":332,"rat-vec/muls":334,"rat-vec/sub":335}],67:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],68:[function(t,e,r){"use strict";var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:64,"color-rgba":70,dtype:93}],69:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=(d=t.slice(1)).length;u=1,c<=4?(l=[parseInt(d[0]+d[0],16),parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16)],4===c&&(u=parseInt(d[3]+d[3],16)/255)):(l=[parseInt(d[0]+d[1],16),parseInt(d[2]+d[3],16),parseInt(d[4]+d[5],16)],8===c&&(u=parseInt(d[6]+d[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f,d=f.replace(/a$/,"");s=d;c="cmyk"===d?4:"gray"===d?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===d?255*parseFloat(t)/100:parseFloat(t);if("h"===d[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===d&&l.push(1),u=h||void 0===l[c]?1:l[c],l=l.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var p=i(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),u=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":67,defined:90,"is-plain-obj":282}],70:[function(t,e,r){"use strict";var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:64,"color-parse":69,"color-space/hsl":71}],71:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[u]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":72}],72:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],73:[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]}],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:1,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]}]}},{}],74:[function(t,e,r){"use strict";var n=t("./colorScale"),a=t("lerp");function i(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,f,h,d,p,g;t||(t={});d=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>d+1)throw new Error(f+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=c.map((function(t){return Math.round(t.index*d)})),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=c.map((function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=p[0]+(p[1]-p[0])*r),n})),m=[];for(g=0;g0||l(t,e,i)?-1:1:0===s?u>0||l(t,e,r)?1:-1:a(u-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,i)>0?1:-1:h<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),u=i(r[1],-e[1]),c=s(o(n,l),o(a,u));return c[c.length-1]>=0}},{"robust-orientation":344,"robust-product":345,"robust-sum":349,signum:350,"two-sum":371}],76:[function(t,e,r){e.exports=function(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]||n(t[0],t[1])-n(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=n(t[0],t[1]),u=n(e[0],e[1]);return n(l,t[2])-n(u,e[2])||n(l+t[2],o)-n(u+e[2],s);case 4:var c=t[0],f=t[1],h=t[2],d=t[3],p=e[0],g=e[1],v=e[2],m=e[3];return c+f+h+d-(p+g+v+m)||n(c,f,h,d)-n(p,g,v,m,p)||n(c+f,c+h,c+d,f+h,f+d,h+d)-n(p+g,p+v,p+m,g+v,g+m,v+m)||n(c+f+h,c+f+d,c+h+d,f+h+d)-n(p+g+v,p+g+m,p+v+m,g+v+m);default:for(var y=t.slice().sort(a),b=e.slice().sort(a),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],80:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var a=new Array(r),i=e[r-1],o=0;o=e[l]&&(s+=1);i[o]=s}}return t}(n(i,!0),r)}};var n=t("incremental-convex-hull"),a=t("affine-hull")},{"affine-hull":20,"incremental-convex-hull":274}],82:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a,i){var o=a-1,s=a*a,l=o*o,u=(1+2*a)*l,c=a*l,f=s*(3-2*a),h=s*o;if(t.length){i||(i=new Array(t.length));for(var d=t.length-1;d>=0;--d)i[d]=u*t[d]+c*e[d]+f*r[d]+h*n[d];return i}return u*t+c*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,a,i){var o=6*a*a-6*a,s=3*a*a-4*a+1,l=-6*a*a+6*a,u=3*a*a-2*a;if(t.length){i||(i=new Array(t.length));for(var c=t.length-1;c>=0;--c)i[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return i}return o*t+s*e+l*r[c]+u*n}},{}],83:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function a(){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}e.exports=function(t){var e=new a;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;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)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),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.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,n(e)}},{"./lib/thunk.js":85}],84:[function(t,e,r){"use strict";var n=t("uniq");function a(t,e,r){var n,a,i=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=i-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,a=[],i=[],o=0;o0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),u=0;u0&&b.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(u=0;u0&&y.push("var "+b.join(",")),u=0;u3&&y.push(i(t.pre,t,l));var T=i(t.body,t,l),A=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].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(c=0;c3&&y.push(i(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var k=[t.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",A,o(l)].join("");return new Function(["function ",k,"(",m.join(","),"){",y.join("\n"),"} return ",k].join(""))()}},{uniq:374}],85:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],a=t.funcName+"_cwise_thunk";e.push(["return function ",a,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],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;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".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"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;c1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?u:(e=f.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",d=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",v=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,u=t.symbol,f=t.zero,y=t.width,b=t.comma,x=t.precision,_=t.trim,w=t.type;"n"===w?(b=!0,w="g"):l[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var M="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===u?c:/[%p]/.test(w)?g:"",A=l[w],k=/[defgprs%]/.test(w);function L(t){var i,s,l,u=M,c=T;if("c"===w)c=A(t)+c,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:A(Math.abs(t),x),_&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==a&&(g=!1),u=(g?"("===a?a:v:"-"===a||"("===a?"":a)+u,c=("s"===w?h[8+n/3]:"")+c+(g&&"("===a?")":""),k)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){c=(46===l?d+t.slice(i+1):t.slice(i))+c,t=t.slice(0,i);break}}b&&!f&&(t=o(t,1/0));var L=u.length+t.length+c.length,S=L>1)+u+t+c+S.slice(L);break;default:t=S+u+t+c}return p(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),L.toString=function(){return t+""},L}return{format:y,formatPrefix:function(t,e){var n=y(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=h[8+a/3];return function(t){return n(o*t)+s}}}}function p(e){return c=d(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}p({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=p,t.formatLocale=d,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],87:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,f=t.shortDays,h=t.months,yt=t.shortMonths,bt=d(u),xt=p(u),_t=d(c),wt=p(c),Mt=d(f),Tt=p(f),At=d(h),kt=p(h),Lt=d(yt),St=p(yt),Et={a:function(t){return f[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:I,e:I,f:B,H:z,I:N,j:F,L:j,m:U,M:H,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:V,u:Y,U:G,V:q,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:K,"%":gt},Ct={a:function(t){return f[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:st,U:lt,V:ut,w:ct,W:ft,x:null,X:null,y:ht,Y:dt,Z:pt,"%":gt},Ot={a:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.w=Tt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Lt.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=kt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Pt(t,i,e,r)},d:A,e:A,f:O,H:L,I:L,j:k,L:C,m:T,M:S,p:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:M,Q:D,s:P,S:E,u:v,U:m,V:y,w:g,W:b,x:function(t,e,r){return Pt(t,o,e,r)},X:function(t,e,r){return Pt(t,l,e,r)},y:_,Y:x,Z:w,"%":R};function Rt(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function Pt(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Ot[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Et.x=Rt(o,Et),Et.X=Rt(l,Et),Et.c=Rt(i,Et),Ct.x=Rt(o,Ct),Ct.X=Rt(l,Ct),Ct.c=Rt(i,Ct),{format:function(t){var e=Rt(t+="",Et);return e.toString=function(){return t},e},parse:function(t){var e=Dt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Rt(t+="",Ct);return e.toString=function(){return t},e},utcParse:function(t){var e=Dt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function R(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function I(t,e){return f(t.getDate(),e,2)}function z(t,e){return f(t.getHours(),e,2)}function N(t,e){return f(t.getHours()%12||12,e,2)}function F(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function j(t,e){return f(t.getMilliseconds(),e,3)}function B(t,e){return j(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function H(t,e){return f(t.getMinutes(),e,2)}function V(t,e){return f(t.getSeconds(),e,2)}function Y(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function q(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function Q(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function dt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function pt(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=bt,t.isoParse=xt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":88}],88:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),d=h.range;function p(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=p(0),v=p(1),m=p(2),y=p(3),b=p(4),x=p(5),_=p(6),w=g.range,M=v.range,T=m.range,A=y.range,k=b.range,L=x.range,S=_.range,E=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),C=E.range,O=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));O.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var R=O.range,D=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),P=D.range,I=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),z=I.range,N=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),F=N.range;function j(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var B=j(0),U=j(1),H=j(2),V=j(3),Y=j(4),G=j(5),q=j(6),W=B.range,X=U.range,Z=H.range,J=V.range,K=Y.range,Q=G.range,$=q.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=d,t.timeFriday=x,t.timeFridays=L,t.timeHour=c,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=v,t.timeMondays=M,t.timeMonth=E,t.timeMonths=C,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=b,t.timeThursdays=k,t.timeTuesday=m,t.timeTuesdays=T,t.timeWednesday=y,t.timeWednesdays=A,t.timeWeek=g,t.timeWeeks=w,t.timeYear=O,t.timeYears=R,t.utcDay=N,t.utcDays=F,t.utcFriday=G,t.utcFridays=Q,t.utcHour=I,t.utcHours=z,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=D,t.utcMinutes=P,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=q,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=B,t.utcSundays=W,t.utcThursday=Y,t.utcThursdays=K,t.utcTuesday=H,t.utcTuesdays=Z,t.utcWednesday=V,t.utcWednesdays=J,t.utcWeek=B,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],89:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{dup:88}],90:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=m[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(c=0;c<_.length;++c){h=(x=_[c])[0];x[0]=x[1],x[1]=h}return _}},{"incremental-convex-hull":274,uniq:374}],92:[function(t,e,r){(function(t){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),a=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===a[1]){e.exports=function(t){return n[0]=t,[a[0],a[1]]},e.exports.pack=function(t,e){return a[0]=t,a[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[0]},e.exports.hi=function(t){return n[0]=t,a[1]}}else if(1072693248===a[0]){e.exports=function(t){return n[0]=t,[a[1],a[0]]},e.exports.pack=function(t,e){return a[1]=t,a[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[1]},e.exports.hi=function(t){return n[0]=t,a[0]}}else r=!1}if(!r){var i=new t(8);e.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:55}],93:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],94:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(i(l[f-1],u[f-1],arguments[f])),a.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=i(u[h-1],c[h-1],arguments[h]);n.push(d),a.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(i(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(i(l[h-1],u[h-1],n[o++]+d)),a.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(i(l[f],u[f],n[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":99,"cubic-hermite":82}],99:[function(t,e,r){"use strict";function n(t,e,r,n,a,i){var o=["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",a?".get(m)":"[m]"];return i?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("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],!1,a),n("B","x"+t+"y",e,["y"],!0,a),n("P","c(x,y)"+t+"0",e,["y","c"],!1,a),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,a),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],100:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(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}var l=s.prototype;function u(t,e){var r;if(e.left&&(r=u(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?u(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left)if(a=c(t,e,r,n.left))return a;if(a=r(n.key,n.value))return a}if(n.right)return c(t,e,r,n.right)}function f(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=f(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return f(t,e,r,n,a.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){a=l[f];u[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];a=l[f];if(1===h._color||1===a._color)break;var d=l[f-2];if(d.left===h)if(h.left===a){if(!(p=d.right)||0!==p._color){if(d._color=0,d.left=h.right,h._color=1,h.right=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).left===d?g.left=h:g.right=h;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else{if(!(p=d.right)||0!==p._color){if(h.right=a.left,d._color=0,d.left=a.right,a._color=1,a.left=h,a.right=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).left===d?g.left=a:g.right=a;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else if(h.right===a){if(!(p=d.left)||0!==p._color){if(d._color=0,d.right=h.left,h._color=1,h.left=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).right===d?g.right=h:g.left=h;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}else{var p;if(!(p=d.left)||0!==p._color){var g;if(h.left=a.right,d._color=0,d.right=a.left,a._color=1,a.right=h,a.left=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).right===d?g.right=a:g.left=a;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return u(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.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.right._count)break;e=e.right}return new h(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new h(this,n);r=a<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 d=h.prototype;function p(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 g(t,e){return te?1:0}Object.defineProperty(d,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(d,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),d.clone=function(){return new h(this.tree,this._stack.slice())},d.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var u=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var c=e[u-1];e.push(new n(r._color,c.key,c.value,r.left,r.right,r._count)),e[u-1].key=r.key,e[u-1].value=r.value;for(l=e.length-2;l>=u;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[u-1].left=e[u]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(u=t[l-2]).left===r?u.left=n:u.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).left===r?u.left=s:u.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),t[l-1]=n,t[l]=r,l+11)(u=t[l-2]).right===r?u.right=n:u.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).right===r?u.right=s:u.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var u;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(d,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(d,"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}),d.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(d,"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}}),d.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),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},d.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(d,"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}})},{}],101:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function i(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+607/128+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}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(i(e));e-=1;for(var r=n[0],a=1;a<9;a++)r+=n[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=i},{}],102:[function(t,e,r){e.exports=function(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,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;o0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}var g=[0,0,0],v={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var m=[0,0,0],y=[0,0,0],b=[0,0,0];f.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||l,n=t.view||l,a=t.projection||l,i=this.bounds,s=t._ortho||!1,c=o(r,n,a,i,s),f=c.cubeEdges,h=c.axis,x=n[12],_=n[13],w=n[14],M=n[15],T=(s?2:1)*this.pixelRatio*(a[3]*x+a[7]*_+a[11]*w+a[15]*M)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=f[A],this.lastCubeProps.axis[A]=h[A];var k=d;for(A=0;A<3;++A)p(d[A],A,this.bounds,f,h);e=this.gl;var L,S=g;for(A=0;A<3;++A)this.backgroundEnable[A]?S[A]=h[A]:S[A]=0;this._background.draw(r,n,a,i,S,this.backgroundColor),this._lines.bind(r,n,a,this);for(A=0;A<3;++A){var E=[0,0,0];h[A]>0?E[A]=i[1][A]:E[A]=i[0][A];for(var C=0;C<2;++C){var O=(A+1+C)%3,R=(A+1+(1^C))%3;this.gridEnable[O]&&this._lines.drawGrid(O,R,this.bounds,E,this.gridColor[O],this.gridWidth[O]*this.pixelRatio)}for(C=0;C<2;++C){O=(A+1+C)%3,R=(A+1+(1^C))%3;this.zeroEnable[R]&&Math.min(i[0][R],i[1][R])<=0&&Math.max(i[0][R],i[1][R])>=0&&this._lines.drawZero(O,R,this.bounds,E,this.zeroLineColor[R],this.zeroLineWidth[R]*this.pixelRatio)}}for(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);var D=u(m,k[A].primalMinor),P=u(y,k[A].mirrorMinor),I=this.lineTickLength;for(C=0;C<3;++C){var z=T/r[5*C];D[C]*=I[C]*z,P[C]*=I[C]*z}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,P,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,a,this.pixelRatio);var N,F;function j(t){(F=[0,0,0])[t]=1}function B(t,e,r){var n=(t+1)%3,a=(t+2)%3,i=e[n],o=e[a],s=r[n],l=r[a];i>0&&l>0||i>0&&l<0||i<0&&l>0||i<0&&l<0?j(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&j(a)}for(A=0;A<3;++A){var U=k[A].primalMinor,H=k[A].mirrorMinor,V=u(b,k[A].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[A]&&(V[C]+=T*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var Y=[0,0,0];if(Y[A]=1,this.tickEnable[A]){-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,N=1,"auto"===(L=[this.tickAlign[A],.5,N])[0]?L[0]=0:L[0]=parseInt(""+L[0]),F=[0,0,0],B(A,U,H);for(C=0;C<3;++C)V[C]+=T*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],V,this.tickColor[A],Y,F,L)}if(this.labelEnable[A]){N=0,F=[0,0,0],this.labels[A].length>4&&(j(A),N=1),"auto"===(L=[this.labelAlign[A],.5,N])[0]?L[0]=0:L[0]=parseInt(""+L[0]);for(C=0;C<3;++C)V[C]+=T*U[C]*this.labelPad[C]/r[5*C];V[A]+=.5*(i[0][A]+i[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],V,this.labelColor[A],[0,0,0],F,L)}}this._text.unbind()},f.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":104,"./lib/cube.js":105,"./lib/lines.js":106,"./lib/text.js":108,"./lib/ticks.js":109}],104:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[u]=p;for(var g=-1;g<=1;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var v=u;u=c,c=v}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=a(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=i(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,m,b,x)};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,a,i){for(var o=!1,s=0;s<3;++s)o=o||a[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:a,colors:i},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":107,"gl-buffer":112,"gl-vao":189}],105:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,d){a(s,e,t),a(s,r,s);for(var y=0,b=0;b<2;++b){c[2]=i[b][2];for(var x=0;x<2;++x){c[1]=i[x][1];for(var _=0;_<2;++_)c[0]=i[_][0],h(l[y],c,s),y+=1}}var w=-1;for(b=0;b<8;++b){for(var M=l[b][3],T=0;T<3;++T)u[b][T]=l[b][T]/M;d&&(u[b][2]*=-1),M<0&&(w<0||u[b][2]S&&(w|=1<S&&(w|=1<u[b][1])&&(z=b);var N=-1;for(b=0;b<3;++b){if((j=z^1<u[F][0]&&(F=j)}var B=g;B[0]=B[1]=B[2]=0,B[n.log2(N^z)]=z&N,B[n.log2(z^F)]=z&F;var U=7^F;U===w||U===I?(U=7^N,B[n.log2(F^U)]=U&F):B[n.log2(N^U)]=U&N;var H=v,V=w;for(A=0;A<3;++A)H[A]=V&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return a(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp 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 a(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":170,glslify:110}],108:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,i,s,l){var c=n(t),f=a(t,[{buffer:c,size:3}]),h=o(t);h.attributes.position.location=0;var d=new u(t,h,c,f);return d.update(e,r,i,s,l),d};var n=t("gl-buffer"),a=t("gl-vao"),i=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function u(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}var c=u.prototype,f=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var a=this.shader.uniforms;a.model=t,a.view=e,a.projection=r,a.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,a){var o=[];function s(t,e,r,n,a,s){var u=l[r];u||(u=l[r]={});var c=u[e];c||(c=u[e]=function(t,e){try{return i(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:a,styletags:s}));for(var f=(n||12)/12,h=c.positions,d=c.cells,p=0,g=d.length;p=0;--m){var y=h[v[m]];o.push(f*y[0],-f*y[1],t)}}for(var u=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],d={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){f[p]=o.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r[p],12,1.25,d),h[p]=(o.length/3|0)-f[p],u[p]=o.length/3|0;for(var g=0;g=0&&(a=r.length-n-1);var i=Math.pow(10,a),o=Math.round(t*e*i),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/i,u=o%i;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),a){for(var f=""+u;f.length=t[0][a];--o)i.push({x:o*e[a],text:n(e[a],o)});r.push(i)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function c(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:305,"ndarray-ops":300,"typedarray-pool":372}],113:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,a=t.vectors,i={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),i;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,f=1/0,h=-1/0,d=null,p=null,g=[],v=1/0,m=!1,y=0;yo&&(o=n.length(x)),y){var _=2*n.distance(d,b)/(n.length(p)+n.length(x));_?(v=Math.min(v,_),m=!1):m=!0}m||(d=b,p=x),g.push(x)}var w=[s,u,f],M=[l,c,h];e&&(e[0]=w,e[1]=M),0===o&&(o=1);var T=1/o;isFinite(v)||(v=1),i.vectorScale=v;var A=t.coneSize||.5;t.absoluteConeSize&&(A=t.absoluteConeSize*T),i.coneScale=A;y=0;for(var k=0;y=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(t){this.pickId=t},d.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"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),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=c({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var a=e[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,a=t.vectors;if(n&&r&&a){var i=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=a;var h=t.meshColor||[1,1,1,1],d=t.vertexIntensity,p=1/0,g=-1/0;if(d)if(t.vertexIntensityBounds)p=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var v=0;v0){var g=this.triShader;g.bind(),g.uniforms=u,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},d.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,a=t.projection||f,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:a,clipBounds:i,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},d.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),a={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?a.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(a.intensity=this.intensity[r[1]],a.velocity=this.vectors[r[1]].slice(0,3),a.divergence=this.vectors[r[1]][3],a.index=e),a},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=p(t,n),l=g(t,n),c=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));c.generateMipmap(),c.minFilter=t.LINEAR_MIPMAP_LINEAR,c.magFilter=t.LINEAR;var f=a(t),d=a(t),v=a(t),m=a(t),y=a(t),b=i(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:t.FLOAT,size:4},{buffer:m,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),x=new h(t,c,s,l,f,d,y,v,m,b,r.traceType||"cone");return x.update(e),x}},{colormap:74,"gl-buffer":112,"gl-mat4/invert":142,"gl-mat4/multiply":144,"gl-shader":170,"gl-texture2d":185,"gl-vao":189,ndarray:305}],115:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:270}],116:[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"}},{}],117:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":116}],118:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=a(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}]),l=i(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function u(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])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,a=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var i=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho||!1?2:1)*this.pixelRatio*(a[3]*i+a[7]*s+a[11]*l+a[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var a=-1;a<=1;a+=2){var i=[0,0,0];i[(n+e)%3]=a,r.push(i)}t[e]=r}return t}();function f(t,e,r,n){for(var a=c[n],i=0;i0)(g=c.slice())[s]+=d[1][s],a.push(c[0],c[1],c[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),u(this.bounds,g),o+=2+f(a,g,p,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(a)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":120,"gl-buffer":112,"gl-vao":189}],119:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{dup:110}],120:[function(t,e,r){"use strict";var n=t("glslify"),a=t("gl-shader"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":170,glslify:119}],121:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;ic||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,g,v,u)};var a,i,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function p(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=d(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=d(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,a,i,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(m=0;ma||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=u(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{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 a(t,i,o,null,l)},r.createPickShader=function(t){return a(t,i,s,null,l)}},{"gl-shader":170,glslify:125}],124:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(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 o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=a(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),d=0;d<1024;++d)c.data[d]=255;var p=i(e,c);p.wrap=e.REPEAT;var g=new m(e,r,o,s,l,p);return g.update(t),g};var n=t("gl-buffer"),a=t("gl-vao"),i=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),u=t("ndarray"),c=t("./lib/shaders"),f=c.createShader,h=c.createPickShader,d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(t,e){for(var r=0,n=0;n<3;++n){var a=t[n]-e[n];r+=a*a}return Math.sqrt(r)}function g(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 v(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function m(t,e,r,n,a,i){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=a,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=i,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=m.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,clipBounds:g(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,pickId:this.pickId,clipBounds:g(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var a=[],i=[],o=[],s=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var d=t.color||t.colors||[0,0,0,1],g=t.lineWidth||1,v=!1;t:for(e=1;e0){for(var w=0;w<24;++w)a.push(a[a.length-12]);c+=2,v=!0}continue t}f[0][r]=Math.min(f[0][r],x[r],_[r]),f[1][r]=Math.max(f[1][r],x[r],_[r])}Array.isArray(d[0])?(m=d.length>e-1?d[e-1]:d.length>0?d[d.length-1]:[0,0,0,1],y=d.length>e?d[e]:d.length>0?d[d.length-1]:[0,0,0,1]):m=y=d,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0),b=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var M=s;if(s+=p(x,_),v){for(r=0;r<2;++r)a.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,m[0],m[1],m[2],m[3]);c+=2,v=!1}a.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,m[0],m[1],m[2],m[3],x[0],x[1],x[2],_[0],_[1],_[2],M,-b,m[0],m[1],m[2],m[3],_[0],_[1],_[2],x[0],x[1],x[2],s,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],s,b,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(a),i.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=i,"dashes"in t){var T=t.dashes.slice();for(T.unshift(0),e=1;e1.0001)return null;m+=v[f]}if(Math.abs(m-1)>.001)return null;return[h,s(t,v),v]}},{barycentric:24,"polytope-closest-point/lib/closest_point_2d.js":329}],157:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),u=n(["precision highp 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}"]),c=n(["precision highp 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}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),d=n(["precision highp 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}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:d,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{glslify:270}],158:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),d=t("typedarray-pool"),p=t("./lib/shaders"),g=t("./lib/closest-point"),v=p.meshShader,m=p.wireShader,y=p.pointShader,b=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,M,T,A,k,L){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=a,this.pickShader=i,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=M,this.pointSizes=T,this.pointIds=x,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=L,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=M.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function k(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function L(t){var e=n(t,m.vertex,m.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function S(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function O(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(t){this.pickId=t},T.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=d.mallocFloat32(6*i),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,a=t.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:a,clipBounds:i,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.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,a=new Array(r.length),i=0;iMath.abs(e))u.rotate(i,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var o=-p.zoomSpeed*a*e/window.innerHeight*(i-u.lastT())/20;u.pan(i,0,0,f*(Math.exp(o)-1))}}}),!0)},p.enableMouseListeners(),p};var n=t("right-now"),a=t("3d-view"),i=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":16,"has-passive-events":272,"mouse-change":292,"mouse-event-offset":293,"mouse-wheel":295,"right-now":338}],160:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["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}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":170,glslify:161}],161:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{dup:110}],162:[function(t,e,r){"use strict";var n=t("./camera.js"),a=t("gl-axes3d"),i=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),u=t("a-big-triangle"),c=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("gl-mat4/ortho"),d=t("./lib/shader"),p=t("is-mobile")({tablet:!0,featureDetect:!0});function g(){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 v(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){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function m(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(p=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:p}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],b=new g,x=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!p}),_=d(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,M={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},T=t.axes||{},A=a(r,T);A.enable=!T.disable;var k=t.spikes||{},L=o(r,k),S=[],E=[],C=[],O=[],R=!0,D=!0,P=new Array(16),I=new Array(16),z={view:null,projection:P,model:I,_ortho:!1},N=(D=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),F=t.cameraObject||n(e,M),j={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:b,camera:F,axes:A,axesPixels:null,spikes:L,bounds:y,objects:S,shape:N,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:m(t.autoResize),autoBounds:m(t.autoBounds),autoScale:!!t.autoScale,autoCenter:m(t.autoCenter),clipToBounds:m(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:z,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,D=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},B=[r.drawingBufferWidth/j.pixelRatio|0,r.drawingBufferHeight/j.pixelRatio|0];function U(){if(!j._stopped&&j.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var a=0|Math.ceil(r*j.pixelRatio),i=0|Math.ceil(n*j.pixelRatio);if(a!==e.width||i!==e.height){e.width=a,e.height=i;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",R=!0}}}j.autoResize&&U();function H(){for(var t=S.length,e=O.length,n=0;n0&&0===C[e-1];)C.pop(),O.pop().dispose()}function V(){if(j.contextLost)return!0;r.isContextLost()&&(j.contextLost=!0,j.mouseListener.enabled=!1,j.selection.object=null,j.oncontextloss&&j.oncontextloss())}window.addEventListener("resize",U),j.update=function(t){j._stopped||(t=t||{},R=!0,D=!0)},j.add=function(t){j._stopped||(t.axes=A,S.push(t),E.push(-1),R=!0,D=!0,H())},j.remove=function(t){if(!j._stopped){var e=S.indexOf(t);e<0||(S.splice(e,1),E.pop(),R=!0,D=!0,H())}},j.dispose=function(){if(!j._stopped&&(j._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",V),j.mouseListener.enabled=!1,!j.contextLost)){A.dispose(),L.dispose();for(var t=0;tb.distance)continue;for(var u=0;u1e-6?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,l=Math.sin(n*a)/o):(s=1-n,l=n);return t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}},{}],164:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],165:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var i=a[e];i||(i=a[e]={});if(t in i)return i[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,u,c=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:i,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:i,fragment:u,attributes:c},g={vertex:o,fragment:u,attributes:c},v={vertex:s,fragment:u,attributes:c};function m(t,e){var r=n(t,e),a=r.attributes;return a.position.location=0,a.color.location=1,a.glyph.location=2,a.id.location=3,r}r.createPerspective=function(t){return m(t,f)},r.createOrtho=function(t){return m(t,h)},r.createProject=function(t){return m(t,d)},r.createPickPerspective=function(t){return m(t,p)},r.createPickOrtho=function(t){return m(t,g)},r.createPickProject=function(t){return m(t,v)}},{"gl-shader":170,glslify:167}],167:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{dup:110}],168:[function(t,e,r){"use strict";var n=t("is-string-blank"),a=t("gl-buffer"),i=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),u=t("./lib/glyphs"),c=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],a=t[2],i=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*a+e[12]*i,t[1]=e[1]*r+e[5]*n+e[9]*a+e[13]*i,t[2]=e[2]*r+e[6]*n+e[10]*a+e[14]*i,t[3]=e[3]*r+e[7]*n+e[11]*a+e[15]*i,t}function d(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function p(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t||t>1?1:t}function v(t,e,r,n,a,i,o,s,l,u,c,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=a,this.colorBuffer=i,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new p(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),f=a(e),h=a(e),d=a(e),p=a(e),g=i(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),m=new v(e,r,n,o,f,h,d,p,g,s,u,c);return m.update(t),m};var m=v.prototype;m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},m.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],b=[0,0,0],x=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],M=f.slice(),T=[0,0,0],A=[[0,0,0],[0,0,0]];function k(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 S(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function E(t,e,r,n){var a,i=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,p=e.axesBounds,g=function(t){for(var e=A,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}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=g,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var v=0;v<3;++v)if(i[v]){l.scale=e.projectScale[v],l.opacity=e.projectOpacity[v];for(var m=M,E=0;E<16;++E)m[E]=0;for(E=0;E<4;++E)m[5*E]=1;m[5*v]=0,a[v]<0?m[12+v]=p[0][v]:m[12+v]=p[1][v],s(m,u,m),l.model=m;var C=(v+1)%3,O=(v+2)%3,R=k(b),D=k(x);R[C]=1,D[O]=1;var P=d(0,0,0,L(_,R)),I=d(0,0,0,L(w,D));if(Math.abs(P[1])>Math.abs(I[1])){var z=P;P=I,I=z,z=R,R=D,D=z;var N=C;C=O,O=N}P[0]<0&&(R[C]=-1),I[1]>0&&(D[O]=-1);var F=0,j=0;for(E=0;E<4;++E)F+=Math.pow(u[4*C+E],2),j+=Math.pow(u[4*O+E],2);R[C]/=Math.sqrt(F),D[O]/=Math.sqrt(j),l.axes[0]=R,l.axes[1]=D,l.fragClipBounds[0]=S(T,g[0],v,-1e8),l.fragClipBounds[1]=S(T,g[1],v,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,a,i,o){var s=r.gl;if((i===r.projectHasAlpha||o)&&E(e,r,n,a),i===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=a,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*a),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function R(t,e,r,a){var i;i=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var a=0;a<3;++a)n.position[a]=n.dataCoordinate[a]=r[a];return n},m.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,a=e>>16&255;this.highlightId=[r/255,n/255,a/255,0]}else this.highlightId=[1,1,1,1]},m.update=function(t){if("perspective"in(t=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(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=g(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=g(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var a,i,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)a=u[0],i=u[1];else{a=[],i=[];for(n=0;n0){var D=0,P=b,I=[0,0,0,1],z=[0,0,0,1],N=Array.isArray(d)&&Array.isArray(d[0]),F=Array.isArray(m)&&Array.isArray(m[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],M=0;M<3;++M){if(isNaN(w[M])||!isFinite(w[M]))continue t;f[M]=Math.max(f[M],w[M]),c[M]=Math.min(c[M],w[M])}T=(j=R(h,n,l,this.pixelRatio)).mesh,A=j.lines,k=j.bounds;var j,B=j.visible;if(B)if(Array.isArray(d)){if(3===(U=N?n0?1-k[0][0]:q<0?1+k[1][0]:1,W*=W>0?1-k[0][1]:W<0?1+k[1][1]:1],Z=T.cells||[],J=T.positions||[];for(M=0;Mthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;ir)for(t=r;te)for(t=e;t=0){for(var M=0|w.type.charAt(w.type.length-1),T=new Array(M),A=0;A=0;)k+=1;_[y]=k}var L=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,d[0],a,p,i,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d,a,p,i,f)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;function o(t,e,r,n,i,o,s){for(var l=["gl","v"],u=[],c=0;c4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new a("","Unknown uniform data type for "+name+": "+r)}if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","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 a("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],a=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var a in r){var i=r[a],o=e;parseInt(a)+""===a?o+="["+a+"]":o+="."+a,"object"==typeof i?n.push.apply(n,t(o,i)):n.push([o,i])}return n}("",e),i=0;i4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var d}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:181}],181:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{dup:110}],182:[function(t,e,r){"use strict";var n=t("gl-vec3"),a=t("gl-vec4"),i=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,i){for(var o=0,s=0;s0)for(M=0;M<8;M++){var T=(M+1)%8;u.push(h[M],d[M],d[T],d[T],h[T],h[M]),f.push(y,m,m,m,y,y),p.push(g,v,v,v,g,g);var A=u.length;c.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var k=h;h=d,d=k;var L=y;y=m,m=L;var S=g;g=v,v=S}return{positions:u,cells:c,vectors:f,vertexIntensity:p}}(t,r,i,o)})),f=[],h=[],d=[],p=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},u=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||b>d-1)return n.create();var x,_,w,M,T,A,k=i[0][p],L=i[0][m],S=i[1][g],E=i[1][y],C=i[2][v],O=(o-k)/(L-k),R=(u-S)/(E-S),D=(c-C)/(i[2][b]-C);switch(isFinite(O)||(O=.5),isFinite(R)||(R=.5),isFinite(D)||(D=.5),r.reversedX&&(p=f-1-p,m=f-1-m),r.reversedY&&(g=h-1-g,y=h-1-y),r.reversedZ&&(v=d-1-v,b=d-1-b),r.filled){case 5:T=v,A=b,w=g*d,M=y*d,x=p*d*h,_=m*d*h;break;case 4:T=v,A=b,x=p*d,_=m*d,w=g*d*f,M=y*d*f;break;case 3:w=g,M=y,T=v*h,A=b*h,x=p*h*d,_=m*h*d;break;case 2:w=g,M=y,x=p*h,_=m*h,T=v*h*f,A=b*h*f;break;case 1:x=p,_=m,T=v*f,A=b*f,w=g*f*d,M=y*f*d;break;default:x=p,_=m,w=g*f,M=y*f,T=v*f*h,A=b*f*h}var P=a[x+w+T],I=a[x+w+A],z=a[x+M+T],N=a[x+M+A],F=a[_+w+T],j=a[_+w+A],B=a[_+M+T],U=a[_+M+A],H=n.create(),V=n.create(),Y=n.create(),G=n.create();n.lerp(H,P,F,O),n.lerp(V,I,j,O),n.lerp(Y,z,B,O),n.lerp(G,N,U,O);var q=n.create(),W=n.create();n.lerp(q,H,Y,R),n.lerp(W,V,G,R);var X=n.create();return n.lerp(X,q,W,D),X}(e,t,d)},g=t.getDivergence||function(t,e){var r=n.create(),a=1e-4;n.add(r,t,[a,0,0]);var i=p(r);n.subtract(i,i,e),n.scale(i,i,1/a),n.add(r,t,[0,a,0]);var o=p(r);n.subtract(o,o,e),n.scale(o,o,1/a),n.add(r,t,[0,0,a]);var s=p(r);return n.subtract(s,s,e),n.scale(s,s,1/a),n.add(r,i,o),n.add(r,r,s),r},v=[],m=e[0][0],y=e[0][1],b=e[0][2],x=e[1][0],_=e[1][1],w=e[1][2],M=function(t){var e=t[0],r=t[1],n=t[2];return!(ex||r_||nw)},T=10*n.distance(e[0],e[1])/a,A=T*T,k=1,L=0,S=r.length;S>1&&(k=function(t){for(var e=[],r=[],n=[],a={},i={},o={},s=t.length,l=0;lL&&(L=N),I.push(N),v.push({points:O,velocities:R,divergences:I});for(var F=0;F<100*a&&O.lengthA&&n.scale(j,j,T/Math.sqrt(B)),n.add(j,j,C),D=p(j),n.squaredDistance(P,j)-A>-1e-4*A){O.push(j),P=j,R.push(D);z=g(j,D),N=n.length(z);isFinite(N)&&N>L&&(L=N),I.push(N)}C=j}}var U=o(v,t.colormap,L,k);return f?U.tubeScale=f:(0===L&&(L=1),U.tubeScale=.5*c*k/L),U};var c=t("./lib/shaders"),f=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:c,traceType:"streamtube"})}},{"./lib/shaders":180,"gl-cone3d":113,"gl-vec3":208,"gl-vec4":244}],183:[function(t,e,r){var n=t("gl-shader"),a=t("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]),o=a(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]),s=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]),l=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,o,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,l,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,s,o,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,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":170,glslify:270}],184:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=x(e),s=b(e),l=_(e),u=a(e),c=i(e,[{buffer:u,size:4,stride:40,offset:0},{buffer:u,size:3,stride:40,offset:16},{buffer:u,size:3,stride:40,offset:28}]),f=a(e),h=i(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=a(e),p=i(e,[{buffer:d,size:2,type:e.FLOAT}]),g=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var v=new k(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,g,s,l,f,h,d,p,[0,0,0]),m={levels:[[],[],[]]};for(var w in t)m[w]=t[w];return m.colormap=m.colormap||"jet",v.update(m),v};var n=t("bit-twiddle"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),u=t("ndarray-ops"),c=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),d=t("gl-mat4/multiply"),p=t("gl-mat4/invert"),g=t("binary-search-bounds"),v=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,b=m.createContourShader,x=m.createPickShader,_=m.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],M=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[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 A(t,e,r,n,a){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=a}!function(){for(var t=0;t<3;++t){var e=T[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function k(t,e,r,n,a,i,o,l,u,c,h,d,p,g,v){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=v,this.intensityBounds=[],this._shader=n,this._pickShader=a,this._coordinateBuffer=i,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=g,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=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.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.pixelRatio=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}var L=k.prototype;L.genColormap=function(t,e){var r=!1,n=c([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var a=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return a<1&&(r=!0),[t[0],t[1],t[2],255*a]}))]);return u.divseq(n,255),this.hasAlphaScale=r,n},L.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},L.isOpaque=function(){return!this.isTransparent()},L.pickSlots=1,L.setPickBase=function(t){this.pickId=t};var S=[0,0,0],E={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,a,i=e.axes&&e.axes.lastCubeProps.axis||S,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=E.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[+(i[r]>0)][r],d(l,t.model,l);var u=E.clipBounds[r];for(a=0;a<2;++a)for(n=0;n<3;++n)u[a][n]=t.clipBounds[a][n];u[0][r]=-1e8,u[1][r]=1e8}return E.showSurface=o,E.showContour=s,E}var O={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},R=w.slice(),D=[1,0,0,0,1,0,0,0,1];function P(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=O;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var i=n.clipBounds[a],o=0;o<3;++o)i[o]=Math.min(Math.max(this.clipBounds[a][o],-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=D,n.vertexColor=this.vertexColor;var s=R;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),a=0;a<3;++a)n.eyePosition[a]=s[12+a]/s[15];var l=s[15];for(a=0;a<3;++a)l+=this.lightPosition[a]*s[4*a+3];for(a=0;a<3;++a){var u=s[12+a];for(o=0;o<3;++o)u+=s[4*o+a]*this.lightPosition[o];n.lightPosition[a]=u/l}var c=C(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[a],this._shader.uniforms.clipBounds=c.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),a=0;a<3;++a)for(f.uniforms.permutation=T[a],r.lineWidth(this.contourWidth[a]*this.pixelRatio),o=0;o>4)/16)/255,a=Math.floor(n),i=n-a,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;a+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?i:1-i,h=0;h<2;++h)for(var d=a+c,p=s+h,v=f*(h?l:1-l),m=0;m<3;++m)u[m]+=this._field[m].get(d,p)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=g.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=i<.5?a:a+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;m<3;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},L.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.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))},L.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=z(t.contourWidth,Number)),"showContour"in t&&(this.showContour=z(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=z(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=F(t.contourColor)),"contourProject"in t&&(this.contourProject=z(t.contourProject,(function(t){return z(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=F(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=z(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=z(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));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 a=(e.shape[0]+2)*(e.shape[1]+2);a>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(a))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(m=0;m<2;++m)if(u.shape[m]!==i[m])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(t.ticks){var c=t.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var d=c[o];if((Array.isArray(d)||d.length)&&(d=f(d)),d.shape[0]!==i[o])throw new Error("gl-surface: invalid tick length");var p=f(d.data,i);p.stride[o]=d.stride[0],p.stride[1^o]=0,this.padField(this._field[o],p)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2],g,0)}this._field[0].set(0,0,0);for(var m=0;m0){for(var bt=0;bt<5;++bt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var xt=s.mallocFloat(Q.length);for(o=0;oa||r<0||r>a)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 d(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,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}var p=d.prototype;function g(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 v(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 m(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new d(t,o,e,r,n,a)}function y(t,e,r,n,a,i){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new d(t,o,r,n,a,i)}function b(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var c,h,p=0;if(2===o.length)p=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=t.ALPHA;else if(2===o[2])p=t.LUMINANCE_ALPHA;else if(3===o[2])p=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)c=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];h=i.malloc(m,r);var b=n(h,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?a.assign(b,e):f(b,e),c=h.subarray(0,m)}var x=v(t);return t.texImage2D(t.TEXTURE_2D,0,p,o[0],o[1],0,p,u,c),l||i.free(h),new d(t,x,o[0],o[1],p,u)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.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},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.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)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,c){var h=c.dtype,d=c.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,v=0,m=g(d,c.stride.slice());"float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,m=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,m=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],c=n(c.data,d,[c.stride[0],c.stride[1],1],c.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=c.size,b=u.indexOf(o)<0;b&&u.push(o);if(p===l&&m)0===c.offset&&c.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data.subarray(c.offset,c.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data.subarray(c.offset,c.offset+y));else{var x;x=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,c):a.assign(_,c),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:305,"ndarray-ops":300,"typedarray-pool":372}],186:[function(t,e,r){"use strict";e.exports=function(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 a=0;a1?0:Math.acos(s)};var n=t("./fromValues"),a=t("./normalize"),i=t("./dot")},{"./dot":201,"./fromValues":207,"./normalize":218}],192:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],193:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],194:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],195:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],196:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t}},{}],197:[function(t,e,r){e.exports=t("./distance")},{"./distance":198}],198:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return Math.sqrt(r*r+n*n+a*a)}},{}],199:[function(t,e,r){e.exports=t("./divide")},{"./divide":200}],200:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],201:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],202:[function(t,e,r){e.exports=1e-6},{}],203:[function(t,e,r){e.exports=function(t,e){var r=t[0],a=t[1],i=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-s)<=n*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":202}],204:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],205:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],206:[function(t,e,r){e.exports=function(t,e,r,a,i,o){var s,l;e||(e=3);r||(r=0);l=a?Math.min(a*e+r,t.length):t.length;for(s=r;s0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i);return t}},{}],219:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,a=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=n*e,t}},{}],220:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[1],i=r[2],o=e[1]-a,s=e[2]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=a+o*u-s*l,t[2]=i+o*l+s*u,t}},{}],221:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[2],o=e[0]-a,s=e[2]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=a+s*l+o*u,t[1]=e[1],t[2]=i+s*u-o*l,t}},{}],222:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[1],o=e[0]-a,s=e[1]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=a+o*u-s*l,t[1]=i+o*l+s*u,t[2]=e[2],t}},{}],223:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],224:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],225:[function(t,e,r){e.exports=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}},{}],226:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],227:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":229}],228:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":230}],229:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return r*r+n*n+a*a}},{}],230:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],231:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":232}],232:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],233:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2];return t[0]=n*r[0]+a*r[3]+i*r[6],t[1]=n*r[1]+a*r[4]+i*r[7],t[2]=n*r[2]+a*r[5]+i*r[8],t}},{}],234:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[3]*n+r[7]*a+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/o,t}},{}],235:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*i-l*a,f=u*a+l*n-o*i,h=u*i+o*a-s*n,d=-o*n-s*a-l*i;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t}},{}],236:[function(t,e,r){e.exports=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}},{}],237:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],238:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],239:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],240:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return Math.sqrt(r*r+n*n+a*a+i*i)}},{}],241:[function(t,e,r){e.exports=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}},{}],242:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],243:[function(t,e,r){e.exports=function(t,e,r,n){var a=new Float32Array(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a}},{}],244:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":236,"./clone":237,"./copy":238,"./create":239,"./distance":240,"./divide":241,"./dot":242,"./fromValues":243,"./inverse":245,"./length":246,"./lerp":247,"./max":248,"./min":249,"./multiply":250,"./negate":251,"./normalize":252,"./random":253,"./scale":254,"./scaleAndAdd":255,"./set":256,"./squaredDistance":257,"./squaredLength":258,"./subtract":259,"./transformMat4":260,"./transformQuat":261}],245:[function(t,e,r){e.exports=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}},{}],246:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return Math.sqrt(e*e+r*r+n*n+a*a)}},{}],247:[function(t,e,r){e.exports=function(t,e,r,n){var a=e[0],i=e[1],o=e[2],s=e[3];return t[0]=a+n*(r[0]-a),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],248:[function(t,e,r){e.exports=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}},{}],249:[function(t,e,r){e.exports=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}},{}],250:[function(t,e,r){e.exports=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}},{}],251:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],252:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r*r+n*n+a*a+i*i;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=a*o,t[3]=i*o);return t}},{}],253:[function(t,e,r){var n=t("./normalize"),a=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),a(t,t,e),t}},{"./normalize":252,"./scale":254}],254:[function(t,e,r){e.exports=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}},{}],255:[function(t,e,r){e.exports=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}},{}],256:[function(t,e,r){e.exports=function(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}},{}],257:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return r*r+n*n+a*a+i*i}},{}],258:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return e*e+r*r+n*n+a*a}},{}],259:[function(t,e,r){e.exports=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}},{}],260:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}},{}],261:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*i-l*a,f=u*a+l*n-o*i,h=u*i+o*a-s*n,d=-o*n-s*a-l*i;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t[3]=e[3],t}},{}],262:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return A(r),m+=r.length,(d=d.slice(r.length)).length}}function R(){return/[^a-fA-F0-9]/.test(e)?(A(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function D(){return"."===e||/[eE]/.test(e)?(d.push(e),h=5,r=e,c+1):"x"===e&&1===d.length&&"0"===d[0]?(h=11,d.push(e),r=e,c+1):/[^\d]/.test(e)?(A(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function P(){return"f"===e&&(d.push(e),r=e,c+=1),/[eE]/.test(e)?(d.push(e),r=e,c+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(A(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function I(){if(/[^\d\w_]/.test(e)){var t=d.join("");return h=T[t]?8:M[t]?7:6,A(d.join("")),h=999,c}return d.push(e),r=e,c+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":265,"./lib/builtins-300es":264,"./lib/literals":267,"./lib/literals-300es":266,"./lib/operators":268}],264:[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":265}],265:[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"]},{}],266:[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","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":267}],267:[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","uint","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"]},{}],268:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],269:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return a=(a=a.concat(r(t))).concat(r(null))}},{"./index":263}],270:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{dup:110}],271:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":279}],272:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":279}],273:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,f=r?a-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),i-=u}return(d?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=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+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,a),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+d]=255&s,d+=p,s/=256,a-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],274:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var a=t[0].length;if(r<=a)throw new Error("Must input at least d+1 points");var o=t.slice(0,a+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(a+1),c=0;c<=a;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var f=new i(l,new Array(a+1),!1),h=f.adjacent,d=new Array(a+2);for(c=0;c<=a;++c){for(var p=l.slice(),g=0;g<=a;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new i(p,new Array(a+1),!0);h[c]=m,d[c]=m}d[a+1]=f;for(c=0;c<=a;++c){p=h[c].vertices;var y=h[c].adjacent;for(g=0;g<=a;++g){var b=p[g];if(b<0)y[g]=f;else for(var x=0;x<=a;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}}var _=new u(a,o,d),w=!!e;for(c=a+1;c0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var a=new Function("test",e.join("")),i=n[t+1];return i||(i=n),a(i)}(t)),this.orient=i}var c=u.prototype;c.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,a=this.tuple,i=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];a[f]=h<0?e:i[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,i=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)i[c]=a[l[c]];s.lastVisited=r;for(c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=i[c];i[c]=t;var d=this.orient();if(i[c]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,g=d.indexOf(r);if(!(g<0))for(var v=0;v<=n;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)y[x]<0?(b=x,l[x]=t):l[x]=a[y[x]];if(this.orient()>0){y[b]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var _=m.adjacent,w=d.slice(),M=p.slice(),T=new i(w,M,!0);c.push(T);var A=_.indexOf(e);if(!(A<0)){_[A]=T,M[g]=m,w[v]=-1,M[v]=e,p[v]=T,T.flip();for(x=0;x<=n;++x){var k=w[x];if(!(k<0||k===r)){for(var L=new Array(n-1),S=0,E=0;E<=n;++E){var C=w[E];C<0||E===x||(L[S++]=C)}h.push(new o(L,T,x))}}}}}}h.sort(s);for(v=0;v+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":344,"simplicial-complex":354}],275:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new m(null);return new m(v(t))};var i=a.prototype;function o(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 s(t,e){var r=v(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function h(t,e){for(var r=0;r>1],i=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=v([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=v([t]);else{var r=n.ge(this.leftPoints,t,p),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,p);ithis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},i.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=m.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":276}],276:[function(t,e,r){arguments[4][99][0].apply(r,arguments)},{dup:99}],277:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(a)return n?-1:I(t).length;e=(""+e).toLowerCase(),a=!0}}function h(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;ha&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:u>223?3:u>191?2:1;if(a+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(F(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,a,i){return e=+e,r>>>=0,i||C(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function R(t,e,r,a,i){return e=+e,r>>>=0,i||C(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||E(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||E(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":25,buffer:55,ieee754:265}],56:[function(t,e,r){"use strict";var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),d=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(c||f!==h||d){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var d=r.pop(),p=(s=r.pop(),c=-1,f=-1,l=o[s],1);p=0||(e.flip(s,d),a(t,e,r,c,s,f),a(t,e,r,s,f,c),a(t,e,r,f,d,c),a(t,e,r,d,c,f)))}}},{"binary-search-bounds":42,"robust-in-sphere":327}],58:[function(t,e,r){"use strict";var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-a){u[d]=a;c[d];for(var p=0;p<3;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=a))}}}var v=l;l=s,s=v,l.length=0,a=-a}var m=function(t,e,r){for(var n=0,a=0;a1&&a(r[h[d-2]],r[h[d-1]],i)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=f.upperIds;for(d=p.length;d>1&&a(r[p[d-2]],r[p[d-1]],i)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function c(t,e){var r;return(r=t.a[0]p[0]&&a.push(new o(p,d,2,l),new o(d,p,1,l))}a.sort(s);for(var g=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),v=[new i([g,1],[g,0],-1,[],[],[],[])],m=[],y=(l=0,a.length);l=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;nr?r:t:te?e:t}},{}],65:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;ie[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--i){var b=e[c=(L=n[i])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var T=x;x=_,_=T}b[0]=x;var A,k=b[1]=L[1];for(a&&(A=b[2]);i>0&&n[i-1][0]===c;){var L,S=(L=n[--i])[1];a?e.push([k,S,A]):e.push([k,S]),k=S}a?e.push([k,_,A]):e.push([k,_])}return h}(t,e,h,v,r));return m(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":66,"big-rat":29,"big-rat/cmp":27,"big-rat/to-float":41,"box-intersect":46,nextafter:294,"rat-vec":318,"robust-segment-intersect":332,"union-find":356}],66:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),f=s(n,r),h=c(i,f);if(0===o(h))return null;var d=s(t,r),p=c(f,d),g=a(p,h),v=u(i,g);return l(t,v)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":28,"big-rat/mul":38,"big-rat/sign":39,"big-rat/sub":40,"rat-vec/add":317,"rat-vec/muls":319,"rat-vec/sub":320}],67:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],68:[function(t,e,r){"use strict";var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:64,"color-rgba":70,dtype:90}],69:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=(d=t.slice(1)).length;u=1,c<=4?(l=[parseInt(d[0]+d[0],16),parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16)],4===c&&(u=parseInt(d[3]+d[3],16)/255)):(l=[parseInt(d[0]+d[1],16),parseInt(d[2]+d[3],16),parseInt(d[4]+d[5],16)],8===c&&(u=parseInt(d[6]+d[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f,d=f.replace(/a$/,"");s=d;c="cmyk"===d?4:"gray"===d?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===d?255*parseFloat(t)/100:parseFloat(t);if("h"===d[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===d&&l.push(1),u=h||void 0===l[c]?1:l[c],l=l.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var p=i(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),u=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":67,defined:87,"is-plain-obj":271}],70:[function(t,e,r){"use strict";var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:64,"color-parse":69,"color-space/hsl":71}],71:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[u]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":72}],72:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],73:[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]}],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:1,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]}]}},{}],74:[function(t,e,r){"use strict";var n=t("./colorScale"),a=t("lerp");function i(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,f,h,d,p,g;t||(t={});d=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>d+1)throw new Error(f+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=c.map((function(t){return Math.round(t.index*d)})),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=c.map((function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=p[0]+(p[1]-p[0])*r),n})),m=[];for(g=0;g0||l(t,e,i)?-1:1:0===s?u>0||l(t,e,r)?1:-1:a(u-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,i)>0?1:-1:h<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),u=i(r[1],-e[1]),c=s(o(n,l),o(a,u));return c[c.length-1]>=0}},{"robust-orientation":329,"robust-product":330,"robust-sum":334,signum:335,"two-sum":354}],76:[function(t,e,r){e.exports=function(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]||n(t[0],t[1])-n(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=n(t[0],t[1]),u=n(e[0],e[1]);return n(l,t[2])-n(u,e[2])||n(l+t[2],o)-n(u+e[2],s);case 4:var c=t[0],f=t[1],h=t[2],d=t[3],p=e[0],g=e[1],v=e[2],m=e[3];return c+f+h+d-(p+g+v+m)||n(c,f,h,d)-n(p,g,v,m,p)||n(c+f,c+h,c+d,f+h,f+d,h+d)-n(p+g,p+v,p+m,g+v,g+m,v+m)||n(c+f+h,c+f+d,c+h+d,f+h+d)-n(p+g+v,p+g+m,p+v+m,g+v+m);default:for(var y=t.slice().sort(a),b=e.slice().sort(a),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],80:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var a=new Array(r),i=e[r-1],o=0;o=e[l]&&(s+=1);i[o]=s}}return t}(n(i,!0),r)}};var n=t("incremental-convex-hull"),a=t("affine-hull")},{"affine-hull":20,"incremental-convex-hull":266}],82:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a,i){var o=a-1,s=a*a,l=o*o,u=(1+2*a)*l,c=a*l,f=s*(3-2*a),h=s*o;if(t.length){i||(i=new Array(t.length));for(var d=t.length-1;d>=0;--d)i[d]=u*t[d]+c*e[d]+f*r[d]+h*n[d];return i}return u*t+c*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,a,i){var o=6*a*a-6*a,s=3*a*a-4*a+1,l=-6*a*a+6*a,u=3*a*a-2*a;if(t.length){i||(i=new Array(t.length));for(var c=t.length-1;c>=0;--c)i[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return i}return o*t+s*e+l*r[c]+u*n}},{}],83:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?u:(e=f.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",d=void 0===t.decimal?".":t.decimal+"",p=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",v=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,u=t.symbol,f=t.zero,y=t.width,b=t.comma,x=t.precision,_=t.trim,w=t.type;"n"===w?(b=!0,w="g"):l[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var M="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===u?c:/[%p]/.test(w)?g:"",A=l[w],k=/[defgprs%]/.test(w);function L(t){var i,s,l,u=M,c=T;if("c"===w)c=A(t)+c,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:A(Math.abs(t),x),_&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==a&&(g=!1),u=(g?"("===a?a:v:"-"===a||"("===a?"":a)+u,c=("s"===w?h[8+n/3]:"")+c+(g&&"("===a?")":""),k)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){c=(46===l?d+t.slice(i+1):t.slice(i))+c,t=t.slice(0,i);break}}b&&!f&&(t=o(t,1/0));var L=u.length+t.length+c.length,S=L>1)+u+t+c+S.slice(L);break;default:t=S+u+t+c}return p(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),L.toString=function(){return t+""},L}return{format:y,formatPrefix:function(t,e){var n=y(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=h[8+a/3];return function(t){return n(o*t)+s}}}}function p(e){return c=d(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}p({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=p,t.formatLocale=d,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],84:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,f=t.shortDays,h=t.months,yt=t.shortMonths,bt=d(u),xt=p(u),_t=d(c),wt=p(c),Mt=d(f),Tt=p(f),At=d(h),kt=p(h),Lt=d(yt),St=p(yt),Et={a:function(t){return f[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:I,e:I,f:j,H:z,I:N,j:F,L:B,m:U,M:H,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:Y,u:V,U:G,V:q,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:K,"%":gt},Ct={a:function(t){return f[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:st,U:lt,V:ut,w:ct,W:ft,x:null,X:null,y:ht,Y:dt,Z:pt,"%":gt},Ot={a:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.w=Tt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Lt.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=kt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Pt(t,i,e,r)},d:A,e:A,f:O,H:L,I:L,j:k,L:C,m:T,M:S,p:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:M,Q:D,s:P,S:E,u:v,U:m,V:y,w:g,W:b,x:function(t,e,r){return Pt(t,o,e,r)},X:function(t,e,r){return Pt(t,l,e,r)},y:_,Y:x,Z:w,"%":R};function Rt(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function Pt(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Ot[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Et.x=Rt(o,Et),Et.X=Rt(l,Et),Et.c=Rt(i,Et),Ct.x=Rt(o,Ct),Ct.X=Rt(l,Ct),Ct.c=Rt(i,Ct),{format:function(t){var e=Rt(t+="",Et);return e.toString=function(){return t},e},parse:function(t){var e=Dt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Rt(t+="",Ct);return e.toString=function(){return t},e},utcParse:function(t){var e=Dt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function R(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function I(t,e){return f(t.getDate(),e,2)}function z(t,e){return f(t.getHours(),e,2)}function N(t,e){return f(t.getHours()%12||12,e,2)}function F(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return B(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function H(t,e){return f(t.getMinutes(),e,2)}function Y(t,e){return f(t.getSeconds(),e,2)}function V(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function q(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function Q(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function dt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function pt(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=bt,t.isoParse=xt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":85}],85:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),d=h.range;function p(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=p(0),v=p(1),m=p(2),y=p(3),b=p(4),x=p(5),_=p(6),w=g.range,M=v.range,T=m.range,A=y.range,k=b.range,L=x.range,S=_.range,E=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),C=E.range,O=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));O.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var R=O.range,D=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),P=D.range,I=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),z=I.range,N=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),F=N.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=B(0),U=B(1),H=B(2),Y=B(3),V=B(4),G=B(5),q=B(6),W=j.range,X=U.range,Z=H.range,J=Y.range,K=V.range,Q=G.range,$=q.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=d,t.timeFriday=x,t.timeFridays=L,t.timeHour=c,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=v,t.timeMondays=M,t.timeMonth=E,t.timeMonths=C,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=b,t.timeThursdays=k,t.timeTuesday=m,t.timeTuesdays=T,t.timeWednesday=y,t.timeWednesdays=A,t.timeWeek=g,t.timeWeeks=w,t.timeYear=O,t.timeYears=R,t.utcDay=N,t.utcDays=F,t.utcFriday=G,t.utcFridays=Q,t.utcHour=I,t.utcHours=z,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=D,t.utcMinutes=P,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=q,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=V,t.utcThursdays=K,t.utcTuesday=H,t.utcTuesdays=Z,t.utcWednesday=Y,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],86:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85}],87:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=m[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(c=0;c<_.length;++c){h=(x=_[c])[0];x[0]=x[1],x[1]=h}return _}},{"incremental-convex-hull":266,uniq:357}],89:[function(t,e,r){(function(t){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),a=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===a[1]){e.exports=function(t){return n[0]=t,[a[0],a[1]]},e.exports.pack=function(t,e){return a[0]=t,a[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[0]},e.exports.hi=function(t){return n[0]=t,a[1]}}else if(1072693248===a[0]){e.exports=function(t){return n[0]=t,[a[1],a[0]]},e.exports.pack=function(t,e){return a[1]=t,a[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[1]},e.exports.hi=function(t){return n[0]=t,a[0]}}else r=!1}if(!r){var i=new t(8);e.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:55}],90:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],91:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(i(l[f-1],u[f-1],arguments[f])),a.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=i(u[h-1],c[h-1],arguments[h]);n.push(d),a.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(i(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,a=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(i(l[h-1],u[h-1],n[o++]+d)),a.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(i(l[f],u[f],n[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":42,"cubic-hermite":82}],96:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(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}var l=s.prototype;function u(t,e){var r;if(e.left&&(r=u(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?u(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left)if(a=c(t,e,r,n.left))return a;if(a=r(n.key,n.value))return a}if(n.right)return c(t,e,r,n.right)}function f(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=f(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return f(t,e,r,n,a.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){a=l[f];u[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];a=l[f];if(1===h._color||1===a._color)break;var d=l[f-2];if(d.left===h)if(h.left===a){if(!(p=d.right)||0!==p._color){if(d._color=0,d.left=h.right,h._color=1,h.right=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).left===d?g.left=h:g.right=h;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else{if(!(p=d.right)||0!==p._color){if(h.right=a.left,d._color=0,d.left=a.right,a._color=1,a.left=h,a.right=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).left===d?g.left=a:g.right=a;break}h._color=1,d.right=i(1,p),d._color=0,f-=1}else if(h.right===a){if(!(p=d.left)||0!==p._color){if(d._color=0,d.right=h.left,h._color=1,h.left=d,l[f-2]=h,l[f-1]=a,o(d),o(h),f>=3)(g=l[f-3]).right===d?g.right=h:g.left=h;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}else{var p;if(!(p=d.left)||0!==p._color){var g;if(h.left=a.right,d._color=0,d.right=a.left,a._color=1,a.right=h,a.left=d,l[f-2]=a,l[f-1]=h,o(d),o(h),o(a),f>=3)(g=l[f-3]).right===d?g.right=a:g.left=a;break}h._color=1,d.left=i(1,p),d._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return u(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.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.right._count)break;e=e.right}return new h(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new h(this,n);r=a<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 d=h.prototype;function p(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 g(t,e){return te?1:0}Object.defineProperty(d,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(d,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),d.clone=function(){return new h(this.tree,this._stack.slice())},d.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var u=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var c=e[u-1];e.push(new n(r._color,c.key,c.value,r.left,r.right,r._count)),e[u-1].key=r.key,e[u-1].value=r.value;for(l=e.length-2;l>=u;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[u-1].left=e[u]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(u=t[l-2]).left===r?u.left=n:u.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).left===r?u.left=s:u.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),t[l-1]=n,t[l]=r,l+11)(u=t[l-2]).right===r?u.right=n:u.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).right===r?u.right=s:u.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var u;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(d,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(d,"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}),d.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(d,"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}}),d.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),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},d.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(d,"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}})},{}],97:[function(t,e,r){e.exports=function(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,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;o0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}var g=[0,0,0],v={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var m=[0,0,0],y=[0,0,0],b=[0,0,0];f.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||l,n=t.view||l,a=t.projection||l,i=this.bounds,s=t._ortho||!1,c=o(r,n,a,i,s),f=c.cubeEdges,h=c.axis,x=n[12],_=n[13],w=n[14],M=n[15],T=(s?2:1)*this.pixelRatio*(a[3]*x+a[7]*_+a[11]*w+a[15]*M)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=f[A],this.lastCubeProps.axis[A]=h[A];var k=d;for(A=0;A<3;++A)p(d[A],A,this.bounds,f,h);e=this.gl;var L,S=g;for(A=0;A<3;++A)this.backgroundEnable[A]?S[A]=h[A]:S[A]=0;this._background.draw(r,n,a,i,S,this.backgroundColor),this._lines.bind(r,n,a,this);for(A=0;A<3;++A){var E=[0,0,0];h[A]>0?E[A]=i[1][A]:E[A]=i[0][A];for(var C=0;C<2;++C){var O=(A+1+C)%3,R=(A+1+(1^C))%3;this.gridEnable[O]&&this._lines.drawGrid(O,R,this.bounds,E,this.gridColor[O],this.gridWidth[O]*this.pixelRatio)}for(C=0;C<2;++C){O=(A+1+C)%3,R=(A+1+(1^C))%3;this.zeroEnable[R]&&Math.min(i[0][R],i[1][R])<=0&&Math.max(i[0][R],i[1][R])>=0&&this._lines.drawZero(O,R,this.bounds,E,this.zeroLineColor[R],this.zeroLineWidth[R]*this.pixelRatio)}}for(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);var D=u(m,k[A].primalMinor),P=u(y,k[A].mirrorMinor),I=this.lineTickLength;for(C=0;C<3;++C){var z=T/r[5*C];D[C]*=I[C]*z,P[C]*=I[C]*z}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,P,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,a,this.pixelRatio);var N,F;function B(t){(F=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,a=(t+2)%3,i=e[n],o=e[a],s=r[n],l=r[a];i>0&&l>0||i>0&&l<0||i<0&&l>0||i<0&&l<0?B(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&B(a)}for(A=0;A<3;++A){var U=k[A].primalMinor,H=k[A].mirrorMinor,Y=u(b,k[A].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[A]&&(Y[C]+=T*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var V=[0,0,0];if(V[A]=1,this.tickEnable[A]){-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,N=1,"auto"===(L=[this.tickAlign[A],.5,N])[0]?L[0]=0:L[0]=parseInt(""+L[0]),F=[0,0,0],j(A,U,H);for(C=0;C<3;++C)Y[C]+=T*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],Y,this.tickColor[A],V,F,L)}if(this.labelEnable[A]){N=0,F=[0,0,0],this.labels[A].length>4&&(B(A),N=1),"auto"===(L=[this.labelAlign[A],.5,N])[0]?L[0]=0:L[0]=parseInt(""+L[0]);for(C=0;C<3;++C)Y[C]+=T*U[C]*this.labelPad[C]/r[5*C];Y[A]+=.5*(i[0][A]+i[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],Y,this.labelColor[A],[0,0,0],F,L)}}this._text.unbind()},f.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":99,"./lib/cube.js":100,"./lib/lines.js":101,"./lib/text.js":103,"./lib/ticks.js":104}],99:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[u]=p;for(var g=-1;g<=1;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var v=u;u=c,c=v}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=a(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=i(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,m,b,x)};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,a,i){for(var o=!1,s=0;s<3;++s)o=o||a[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:a,colors:i},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":102,"gl-buffer":106,"gl-vao":181}],100:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,d){a(s,e,t),a(s,r,s);for(var y=0,b=0;b<2;++b){c[2]=i[b][2];for(var x=0;x<2;++x){c[1]=i[x][1];for(var _=0;_<2;++_)c[0]=i[_][0],h(l[y],c,s),y+=1}}var w=-1;for(b=0;b<8;++b){for(var M=l[b][3],T=0;T<3;++T)u[b][T]=l[b][T]/M;d&&(u[b][2]*=-1),M<0&&(w<0||u[b][2]S&&(w|=1<S&&(w|=1<u[b][1])&&(z=b);var N=-1;for(b=0;b<3;++b){if((B=z^1<u[F][0]&&(F=B)}var j=g;j[0]=j[1]=j[2]=0,j[n.log2(N^z)]=z&N,j[n.log2(z^F)]=z&F;var U=7^F;U===w||U===I?(U=7^N,j[n.log2(F^U)]=U&F):j[n.log2(N^U)]=U&N;var H=v,Y=w;for(A=0;A<3;++A)H[A]=Y&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return a(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp 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 a(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":163,glslify:262}],103:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,i,s,l){var c=n(t),f=a(t,[{buffer:c,size:3}]),h=o(t);h.attributes.position.location=0;var d=new u(t,h,c,f);return d.update(e,r,i,s,l),d};var n=t("gl-buffer"),a=t("gl-vao"),i=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function u(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}var c=u.prototype,f=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var a=this.shader.uniforms;a.model=t,a.view=e,a.projection=r,a.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,a){var o=[];function s(t,e,r,n,a,s){var u=l[r];u||(u=l[r]={});var c=u[e];c||(c=u[e]=function(t,e){try{return i(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:a,styletags:s}));for(var f=(n||12)/12,h=c.positions,d=c.cells,p=0,g=d.length;p=0;--m){var y=h[v[m]];o.push(f*y[0],-f*y[1],t)}}for(var u=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],d={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){f[p]=o.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r[p],12,1.25,d),h[p]=(o.length/3|0)-f[p],u[p]=o.length/3|0;for(var g=0;g=0&&(a=r.length-n-1);var i=Math.pow(10,a),o=Math.round(t*e*i),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/i,u=o%i;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),a){for(var f=""+u;f.length=t[0][a];--o)i.push({x:o*e[a],text:n(e[a],o)});r.push(i)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function c(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:293,"ndarray-ops":288,"typedarray-pool":355}],107:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,a=t.vectors,i={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),i;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,f=1/0,h=-1/0,d=null,p=null,g=[],v=1/0,m=!1,y=0;yo&&(o=n.length(x)),y){var _=2*n.distance(d,b)/(n.length(p)+n.length(x));_?(v=Math.min(v,_),m=!1):m=!0}m||(d=b,p=x),g.push(x)}var w=[s,u,f],M=[l,c,h];e&&(e[0]=w,e[1]=M),0===o&&(o=1);var T=1/o;isFinite(v)||(v=1),i.vectorScale=v;var A=t.coneSize||.5;t.absoluteConeSize&&(A=t.absoluteConeSize*T),i.coneScale=A;y=0;for(var k=0;y=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(t){this.pickId=t},d.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"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),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=c({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var a=e[n],i=0;i<3;++i)r[4*n+i]=a[i];r[4*n+3]=255*a[3]}return u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,a=t.vectors;if(n&&r&&a){var i=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=a;var h=t.meshColor||[1,1,1,1],d=t.vertexIntensity,p=1/0,g=-1/0;if(d)if(t.vertexIntensityBounds)p=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var v=0;v0){var g=this.triShader;g.bind(),g.uniforms=u,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},d.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,a=t.projection||f,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:a,clipBounds:i,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},d.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),a={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?a.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(a.intensity=this.intensity[r[1]],a.velocity=this.vectors[r[1]].slice(0,3),a.divergence=this.vectors[r[1]][3],a.index=e),a},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=p(t,n),l=g(t,n),c=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));c.generateMipmap(),c.minFilter=t.LINEAR_MIPMAP_LINEAR,c.magFilter=t.LINEAR;var f=a(t),d=a(t),v=a(t),m=a(t),y=a(t),b=i(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:t.FLOAT,size:4},{buffer:m,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),x=new h(t,c,s,l,f,d,y,v,m,b,r.traceType||"cone");return x.update(e),x}},{colormap:74,"gl-buffer":106,"gl-mat4/invert":136,"gl-mat4/multiply":138,"gl-shader":163,"gl-texture2d":177,"gl-vao":181,ndarray:293}],109:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:262}],110:[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"}},{}],111:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":110}],112:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=a(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}]),l=i(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=t("gl-buffer"),a=t("gl-vao"),i=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function u(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])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,a=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var i=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho||!1?2:1)*this.pixelRatio*(a[3]*i+a[7]*s+a[11]*l+a[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var a=-1;a<=1;a+=2){var i=[0,0,0];i[(n+e)%3]=a,r.push(i)}t[e]=r}return t}();function f(t,e,r,n){for(var a=c[n],i=0;i0)(g=c.slice())[s]+=d[1][s],a.push(c[0],c[1],c[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),u(this.bounds,g),o+=2+f(a,g,p,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(a)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":114,"gl-buffer":106,"gl-vao":181}],113:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":163,glslify:113}],115:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;ic||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,g,v,u)};var a,i,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function p(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=d(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=d(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,a,i,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(m=0;ma||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=u(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{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 a(t,i,o,null,l)},r.createPickShader=function(t){return a(t,i,s,null,l)}},{"gl-shader":163,glslify:119}],118:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(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 o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=a(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),d=0;d<1024;++d)c.data[d]=255;var p=i(e,c);p.wrap=e.REPEAT;var g=new m(e,r,o,s,l,p);return g.update(t),g};var n=t("gl-buffer"),a=t("gl-vao"),i=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),u=t("ndarray"),c=t("./lib/shaders"),f=c.createShader,h=c.createPickShader,d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(t,e){for(var r=0,n=0;n<3;++n){var a=t[n]-e[n];r+=a*a}return Math.sqrt(r)}function g(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 v(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function m(t,e,r,n,a,i){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=a,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=i,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=m.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,clipBounds:g(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,pickId:this.pickId,clipBounds:g(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var a=[],i=[],o=[],s=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var d=t.color||t.colors||[0,0,0,1],g=t.lineWidth||1,v=!1;t:for(e=1;e0){for(var w=0;w<24;++w)a.push(a[a.length-12]);c+=2,v=!0}continue t}f[0][r]=Math.min(f[0][r],x[r],_[r]),f[1][r]=Math.max(f[1][r],x[r],_[r])}Array.isArray(d[0])?(m=d.length>e-1?d[e-1]:d.length>0?d[d.length-1]:[0,0,0,1],y=d.length>e?d[e]:d.length>0?d[d.length-1]:[0,0,0,1]):m=y=d,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0),b=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var M=s;if(s+=p(x,_),v){for(r=0;r<2;++r)a.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,m[0],m[1],m[2],m[3]);c+=2,v=!1}a.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,m[0],m[1],m[2],m[3],x[0],x[1],x[2],_[0],_[1],_[2],M,-b,m[0],m[1],m[2],m[3],_[0],_[1],_[2],x[0],x[1],x[2],s,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],s,b,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(a),i.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=i,"dashes"in t){var T=t.dashes.slice();for(T.unshift(0),e=1;e1.0001)return null;m+=v[f]}if(Math.abs(m-1)>.001)return null;return[h,s(t,v),v]}},{barycentric:24,"polytope-closest-point/lib/closest_point_2d.js":314}],151:[function(t,e,r){var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),u=n(["precision highp 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}"]),c=n(["precision highp 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}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),d=n(["precision highp 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}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:d,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{glslify:262}],152:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),d=t("typedarray-pool"),p=t("./lib/shaders"),g=t("./lib/closest-point"),v=p.meshShader,m=p.wireShader,y=p.pointShader,b=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,M,T,A,k,L){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=a,this.pickShader=i,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=M,this.pointSizes=T,this.pointIds=x,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=L,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=M.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function k(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function L(t){var e=n(t,m.vertex,m.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function S(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function O(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(t){this.pickId=t},T.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,a=e.vertexWeights,i=r.length,o=d.mallocFloat32(6*i),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,a=t.projection||w,i=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)i[0][o]=Math.max(i[0][o],this.clipBounds[0][o]),i[1][o]=Math.min(i[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:a,clipBounds:i,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.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,a=new Array(r.length),i=0;iMath.abs(e))u.rotate(i,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var o=-p.zoomSpeed*a*e/window.innerHeight*(i-u.lastT())/20;u.pan(i,0,0,f*(Math.exp(o)-1))}}}),!0)},p.enableMouseListeners(),p};var n=t("right-now"),a=t("3d-view"),i=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":16,"has-passive-events":264,"mouse-change":280,"mouse-event-offset":281,"mouse-wheel":283,"right-now":323}],154:[function(t,e,r){var n=t("glslify"),a=t("gl-shader"),i=n(["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}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return a(t,i,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":163,glslify:262}],155:[function(t,e,r){"use strict";var n=t("./camera.js"),a=t("gl-axes3d"),i=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),u=t("a-big-triangle"),c=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("gl-mat4/ortho"),d=t("./lib/shader"),p=t("is-mobile")({tablet:!0,featureDetect:!0});function g(){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 v(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){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function m(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(p=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:p}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],b=new g,x=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!p}),_=d(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,M={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},T=t.axes||{},A=a(r,T);A.enable=!T.disable;var k=t.spikes||{},L=o(r,k),S=[],E=[],C=[],O=[],R=!0,D=!0,P=new Array(16),I=new Array(16),z={view:null,projection:P,model:I,_ortho:!1},N=(D=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),F=t.cameraObject||n(e,M),B={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:b,camera:F,axes:A,axesPixels:null,spikes:L,bounds:y,objects:S,shape:N,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:m(t.autoResize),autoBounds:m(t.autoBounds),autoScale:!!t.autoScale,autoCenter:m(t.autoCenter),clipToBounds:m(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:z,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,D=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/B.pixelRatio|0,r.drawingBufferHeight/B.pixelRatio|0];function U(){if(!B._stopped&&B.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var a=0|Math.ceil(r*B.pixelRatio),i=0|Math.ceil(n*B.pixelRatio);if(a!==e.width||i!==e.height){e.width=a,e.height=i;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",R=!0}}}B.autoResize&&U();function H(){for(var t=S.length,e=O.length,n=0;n0&&0===C[e-1];)C.pop(),O.pop().dispose()}function Y(){if(B.contextLost)return!0;r.isContextLost()&&(B.contextLost=!0,B.mouseListener.enabled=!1,B.selection.object=null,B.oncontextloss&&B.oncontextloss())}window.addEventListener("resize",U),B.update=function(t){B._stopped||(t=t||{},R=!0,D=!0)},B.add=function(t){B._stopped||(t.axes=A,S.push(t),E.push(-1),R=!0,D=!0,H())},B.remove=function(t){if(!B._stopped){var e=S.indexOf(t);e<0||(S.splice(e,1),E.pop(),R=!0,D=!0,H())}},B.dispose=function(){if(!B._stopped&&(B._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",Y),B.mouseListener.enabled=!1,!B.contextLost)){A.dispose(),L.dispose();for(var t=0;tb.distance)continue;for(var u=0;u1e-6?(a=Math.acos(i),o=Math.sin(a),s=Math.sin((1-n)*a)/o,l=Math.sin(n*a)/o):(s=1-n,l=n);return t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}},{}],157:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],158:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var i=a[e];i||(i=a[e]={});if(t in i)return i[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,u,c=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:i,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:i,fragment:u,attributes:c},g={vertex:o,fragment:u,attributes:c},v={vertex:s,fragment:u,attributes:c};function m(t,e){var r=n(t,e),a=r.attributes;return a.position.location=0,a.color.location=1,a.glyph.location=2,a.id.location=3,r}r.createPerspective=function(t){return m(t,f)},r.createOrtho=function(t){return m(t,h)},r.createProject=function(t){return m(t,d)},r.createPickPerspective=function(t){return m(t,p)},r.createPickOrtho=function(t){return m(t,g)},r.createPickProject=function(t){return m(t,v)}},{"gl-shader":163,glslify:160}],160:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{dup:113}],161:[function(t,e,r){"use strict";var n=t("is-string-blank"),a=t("gl-buffer"),i=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),u=t("./lib/glyphs"),c=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],a=t[2],i=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*a+e[12]*i,t[1]=e[1]*r+e[5]*n+e[9]*a+e[13]*i,t[2]=e[2]*r+e[6]*n+e[10]*a+e[14]*i,t[3]=e[3]*r+e[7]*n+e[11]*a+e[15]*i,t}function d(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function p(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t||t>1?1:t}function v(t,e,r,n,a,i,o,s,l,u,c,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=a,this.colorBuffer=i,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new p(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),f=a(e),h=a(e),d=a(e),p=a(e),g=i(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),m=new v(e,r,n,o,f,h,d,p,g,s,u,c);return m.update(t),m};var m=v.prototype;m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},m.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],b=[0,0,0],x=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],M=f.slice(),T=[0,0,0],A=[[0,0,0],[0,0,0]];function k(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 S(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function E(t,e,r,n){var a,i=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,p=e.axesBounds,g=function(t){for(var e=A,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}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=g,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var v=0;v<3;++v)if(i[v]){l.scale=e.projectScale[v],l.opacity=e.projectOpacity[v];for(var m=M,E=0;E<16;++E)m[E]=0;for(E=0;E<4;++E)m[5*E]=1;m[5*v]=0,a[v]<0?m[12+v]=p[0][v]:m[12+v]=p[1][v],s(m,u,m),l.model=m;var C=(v+1)%3,O=(v+2)%3,R=k(b),D=k(x);R[C]=1,D[O]=1;var P=d(0,0,0,L(_,R)),I=d(0,0,0,L(w,D));if(Math.abs(P[1])>Math.abs(I[1])){var z=P;P=I,I=z,z=R,R=D,D=z;var N=C;C=O,O=N}P[0]<0&&(R[C]=-1),I[1]>0&&(D[O]=-1);var F=0,B=0;for(E=0;E<4;++E)F+=Math.pow(u[4*C+E],2),B+=Math.pow(u[4*O+E],2);R[C]/=Math.sqrt(F),D[O]/=Math.sqrt(B),l.axes[0]=R,l.axes[1]=D,l.fragClipBounds[0]=S(T,g[0],v,-1e8),l.fragClipBounds[1]=S(T,g[1],v,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,a,i,o){var s=r.gl;if((i===r.projectHasAlpha||o)&&E(e,r,n,a),i===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=a,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*a),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function R(t,e,r,a){var i;i=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var a=0;a<3;++a)n.position[a]=n.dataCoordinate[a]=r[a];return n},m.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,a=e>>16&255;this.highlightId=[r/255,n/255,a/255,0]}else this.highlightId=[1,1,1,1]},m.update=function(t){if("perspective"in(t=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(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=g(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=g(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var a,i,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)a=u[0],i=u[1];else{a=[],i=[];for(n=0;n0){var D=0,P=b,I=[0,0,0,1],z=[0,0,0,1],N=Array.isArray(d)&&Array.isArray(d[0]),F=Array.isArray(m)&&Array.isArray(m[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],M=0;M<3;++M){if(isNaN(w[M])||!isFinite(w[M]))continue t;f[M]=Math.max(f[M],w[M]),c[M]=Math.min(c[M],w[M])}T=(B=R(h,n,l,this.pixelRatio)).mesh,A=B.lines,k=B.bounds;var B,j=B.visible;if(j)if(Array.isArray(d)){if(3===(U=N?n0?1-k[0][0]:q<0?1+k[1][0]:1,W*=W>0?1-k[0][1]:W<0?1+k[1][1]:1],Z=T.cells||[],J=T.positions||[];for(M=0;Mthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;ir)for(t=r;te)for(t=e;t=0){for(var M=0|w.type.charAt(w.type.length-1),T=new Array(M),A=0;A=0;)k+=1;_[y]=k}var L=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d[0],a,p,i,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,d,a,p,i,f)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;i.pointer=function(t,e,r,n){var a=this._gl,i=this._locations[this._index];a.vertexAttribPointer(i,this._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(i)},i.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(i,"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}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,a){return void 0===r.length?t.vertexAttrib3f(e,r,n,a):t.vertexAttrib3fv(e,r)},function(t,e,r,n,a,i){return void 0===r.length?t.vertexAttrib4f(e,r,n,a,i):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,i,s,l){var u=o[i],c=new a(t,e,r,n,i,u);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),u(t,n[r],e),e},get:function(){return c},enumerable:!0})}function l(t,e,r,n,a,i,o){for(var l=new Array(a),u=new Array(a),c=0;c4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+m);t["uniformMatrix"+v+"fv"](s[c],!1,f);break}throw new a("","Unknown uniform data type for "+name+": "+m)}if((v=m.charCodeAt(m.length-1)-48)<2||v>4)throw new a("","Invalid data type");switch(m.charAt(0)){case"b":case"i":t["uniform"+v+"iv"](s[c],f);break;case"v":t["uniform"+v+"fv"](s[c],f);break;default:throw new a("","Unrecognized data type for vector "+name+": "+m)}}}}}}function u(t,e,n){if("object"==typeof n){var u=c(n);Object.defineProperty(t,e,{get:i(u),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(f=n,function(t,e,r){return t.getUniform(e.program,r[f])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var f}function c(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),i=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:173}],173:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{dup:113}],174:[function(t,e,r){"use strict";var n=t("gl-vec3"),a=t("gl-vec4"),i=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,i){for(var o=0,s=0;s0)for(M=0;M<8;M++){var T=(M+1)%8;u.push(h[M],d[M],d[T],d[T],h[T],h[M]),f.push(y,m,m,m,y,y),p.push(g,v,v,v,g,g);var A=u.length;c.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var k=h;h=d,d=k;var L=y;y=m,m=L;var S=g;g=v,v=S}return{positions:u,cells:c,vectors:f,vertexIntensity:p}}(t,r,i,o)})),f=[],h=[],d=[],p=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},u=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||b>d-1)return n.create();var x,_,w,M,T,A,k=i[0][p],L=i[0][m],S=i[1][g],E=i[1][y],C=i[2][v],O=(o-k)/(L-k),R=(u-S)/(E-S),D=(c-C)/(i[2][b]-C);switch(isFinite(O)||(O=.5),isFinite(R)||(R=.5),isFinite(D)||(D=.5),r.reversedX&&(p=f-1-p,m=f-1-m),r.reversedY&&(g=h-1-g,y=h-1-y),r.reversedZ&&(v=d-1-v,b=d-1-b),r.filled){case 5:T=v,A=b,w=g*d,M=y*d,x=p*d*h,_=m*d*h;break;case 4:T=v,A=b,x=p*d,_=m*d,w=g*d*f,M=y*d*f;break;case 3:w=g,M=y,T=v*h,A=b*h,x=p*h*d,_=m*h*d;break;case 2:w=g,M=y,x=p*h,_=m*h,T=v*h*f,A=b*h*f;break;case 1:x=p,_=m,T=v*f,A=b*f,w=g*f*d,M=y*f*d;break;default:x=p,_=m,w=g*f,M=y*f,T=v*f*h,A=b*f*h}var P=a[x+w+T],I=a[x+w+A],z=a[x+M+T],N=a[x+M+A],F=a[_+w+T],B=a[_+w+A],j=a[_+M+T],U=a[_+M+A],H=n.create(),Y=n.create(),V=n.create(),G=n.create();n.lerp(H,P,F,O),n.lerp(Y,I,B,O),n.lerp(V,z,j,O),n.lerp(G,N,U,O);var q=n.create(),W=n.create();n.lerp(q,H,V,R),n.lerp(W,Y,G,R);var X=n.create();return n.lerp(X,q,W,D),X}(e,t,d)},g=t.getDivergence||function(t,e){var r=n.create(),a=1e-4;n.add(r,t,[a,0,0]);var i=p(r);n.subtract(i,i,e),n.scale(i,i,1/a),n.add(r,t,[0,a,0]);var o=p(r);n.subtract(o,o,e),n.scale(o,o,1/a),n.add(r,t,[0,0,a]);var s=p(r);return n.subtract(s,s,e),n.scale(s,s,1/a),n.add(r,i,o),n.add(r,r,s),r},v=[],m=e[0][0],y=e[0][1],b=e[0][2],x=e[1][0],_=e[1][1],w=e[1][2],M=function(t){var e=t[0],r=t[1],n=t[2];return!(ex||r_||nw)},T=10*n.distance(e[0],e[1])/a,A=T*T,k=1,L=0,S=r.length;S>1&&(k=function(t){for(var e=[],r=[],n=[],a={},i={},o={},s=t.length,l=0;lL&&(L=N),I.push(N),v.push({points:O,velocities:R,divergences:I});for(var F=0;F<100*a&&O.lengthA&&n.scale(B,B,T/Math.sqrt(j)),n.add(B,B,C),D=p(B),n.squaredDistance(P,B)-A>-1e-4*A){O.push(B),P=B,R.push(D);z=g(B,D),N=n.length(z);isFinite(N)&&N>L&&(L=N),I.push(N)}C=B}}var U=o(v,t.colormap,L,k);return f?U.tubeScale=f:(0===L&&(L=1),U.tubeScale=.5*c*k/L),U};var c=t("./lib/shaders"),f=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:c,traceType:"streamtube"})}},{"./lib/shaders":172,"gl-cone3d":107,"gl-vec3":200,"gl-vec4":236}],175:[function(t,e,r){var n=t("gl-shader"),a=t("glslify"),i=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]),o=a(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]),s=a(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]),l=a(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,o,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,l,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,s,o,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,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":163,glslify:262}],176:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=x(e),s=b(e),l=_(e),u=a(e),c=i(e,[{buffer:u,size:4,stride:40,offset:0},{buffer:u,size:3,stride:40,offset:16},{buffer:u,size:3,stride:40,offset:28}]),f=a(e),h=i(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=a(e),p=i(e,[{buffer:d,size:2,type:e.FLOAT}]),g=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var v=new k(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,g,s,l,f,h,d,p,[0,0,0]),m={levels:[[],[],[]]};for(var w in t)m[w]=t[w];return m.colormap=m.colormap||"jet",v.update(m),v};var n=t("bit-twiddle"),a=t("gl-buffer"),i=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),u=t("ndarray-ops"),c=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),d=t("gl-mat4/multiply"),p=t("gl-mat4/invert"),g=t("binary-search-bounds"),v=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,b=m.createContourShader,x=m.createPickShader,_=m.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],M=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[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 A(t,e,r,n,a){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=a}!function(){for(var t=0;t<3;++t){var e=T[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function k(t,e,r,n,a,i,o,l,u,c,h,d,p,g,v){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=v,this.intensityBounds=[],this._shader=n,this._pickShader=a,this._coordinateBuffer=i,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=g,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=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.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.pixelRatio=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}var L=k.prototype;L.genColormap=function(t,e){var r=!1,n=c([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var a=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return a<1&&(r=!0),[t[0],t[1],t[2],255*a]}))]);return u.divseq(n,255),this.hasAlphaScale=r,n},L.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},L.isOpaque=function(){return!this.isTransparent()},L.pickSlots=1,L.setPickBase=function(t){this.pickId=t};var S=[0,0,0],E={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,a,i=e.axes&&e.axes.lastCubeProps.axis||S,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=E.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[+(i[r]>0)][r],d(l,t.model,l);var u=E.clipBounds[r];for(a=0;a<2;++a)for(n=0;n<3;++n)u[a][n]=t.clipBounds[a][n];u[0][r]=-1e8,u[1][r]=1e8}return E.showSurface=o,E.showContour=s,E}var O={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},R=w.slice(),D=[1,0,0,0,1,0,0,0,1];function P(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=O;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var i=n.clipBounds[a],o=0;o<3;++o)i[o]=Math.min(Math.max(this.clipBounds[a][o],-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=D,n.vertexColor=this.vertexColor;var s=R;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),a=0;a<3;++a)n.eyePosition[a]=s[12+a]/s[15];var l=s[15];for(a=0;a<3;++a)l+=this.lightPosition[a]*s[4*a+3];for(a=0;a<3;++a){var u=s[12+a];for(o=0;o<3;++o)u+=s[4*o+a]*this.lightPosition[o];n.lightPosition[a]=u/l}var c=C(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[a],this._shader.uniforms.clipBounds=c.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),a=0;a<3;++a)for(f.uniforms.permutation=T[a],r.lineWidth(this.contourWidth[a]*this.pixelRatio),o=0;o>4)/16)/255,a=Math.floor(n),i=n-a,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;a+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?i:1-i,h=0;h<2;++h)for(var d=a+c,p=s+h,v=f*(h?l:1-l),m=0;m<3;++m)u[m]+=this._field[m].get(d,p)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=g.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=i<.5?a:a+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;m<3;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},L.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.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))},L.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=z(t.contourWidth,Number)),"showContour"in t&&(this.showContour=z(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=z(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=F(t.contourColor)),"contourProject"in t&&(this.contourProject=z(t.contourProject,(function(t){return z(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=F(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=z(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=z(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));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 a=(e.shape[0]+2)*(e.shape[1]+2);a>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(a))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(m=0;m<2;++m)if(u.shape[m]!==i[m])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(t.ticks){var c=t.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var d=c[o];if((Array.isArray(d)||d.length)&&(d=f(d)),d.shape[0]!==i[o])throw new Error("gl-surface: invalid tick length");var p=f(d.data,i);p.stride[o]=d.stride[0],p.stride[1^o]=0,this.padField(this._field[o],p)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=f(this._field[o].data,[i[0]+2,i[1]+2],g,0)}this._field[0].set(0,0,0);for(var m=0;m0){for(var bt=0;bt<5;++bt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var xt=s.mallocFloat(Q.length);for(o=0;oa||r<0||r>a)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 d(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,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}var p=d.prototype;function g(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 v(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 m(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new d(t,o,e,r,n,a)}function y(t,e,r,n,a,i){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new d(t,o,r,n,a,i)}function b(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var c,h,p=0;if(2===o.length)p=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=t.ALPHA;else if(2===o[2])p=t.LUMINANCE_ALPHA;else if(3===o[2])p=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)c=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];h=i.malloc(m,r);var b=n(h,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?a.assign(b,e):f(b,e),c=h.subarray(0,m)}var x=v(t);return t.texImage2D(t.TEXTURE_2D,0,p,o[0],o[1],0,p,u,c),l||i.free(h),new d(t,x,o[0],o[1],p,u)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.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},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.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)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,c){var h=c.dtype,d=c.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,v=0,m=g(d,c.stride.slice());"float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,m=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,m=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],c=n(c.data,d,[c.stride[0],c.stride[1],1],c.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=c.size,b=u.indexOf(o)<0;b&&u.push(o);if(p===l&&m)0===c.offset&&c.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,c.data.subarray(c.offset,c.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,c.data.subarray(c.offset,c.offset+y));else{var x;x=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,c):a.assign(_,c),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:293,"ndarray-ops":288,"typedarray-pool":355}],178:[function(t,e,r){"use strict";e.exports=function(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 a=0;a1?0:Math.acos(s)};var n=t("./fromValues"),a=t("./normalize"),i=t("./dot")},{"./dot":193,"./fromValues":199,"./normalize":210}],184:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],185:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],186:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],187:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],188:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t}},{}],189:[function(t,e,r){e.exports=t("./distance")},{"./distance":190}],190:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return Math.sqrt(r*r+n*n+a*a)}},{}],191:[function(t,e,r){e.exports=t("./divide")},{"./divide":192}],192:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],193:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],194:[function(t,e,r){e.exports=1e-6},{}],195:[function(t,e,r){e.exports=function(t,e){var r=t[0],a=t[1],i=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(a-s)<=n*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":194}],196:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],197:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],198:[function(t,e,r){e.exports=function(t,e,r,a,i,o){var s,l;e||(e=3);r||(r=0);l=a?Math.min(a*e+r,t.length):t.length;for(s=r;s0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i);return t}},{}],211:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,a=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=n*e,t}},{}],212:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[1],i=r[2],o=e[1]-a,s=e[2]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=a+o*u-s*l,t[2]=i+o*l+s*u,t}},{}],213:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[2],o=e[0]-a,s=e[2]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=a+s*l+o*u,t[1]=e[1],t[2]=i+s*u-o*l,t}},{}],214:[function(t,e,r){e.exports=function(t,e,r,n){var a=r[0],i=r[1],o=e[0]-a,s=e[1]-i,l=Math.sin(n),u=Math.cos(n);return t[0]=a+o*u-s*l,t[1]=i+o*l+s*u,t[2]=e[2],t}},{}],215:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],216:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],217:[function(t,e,r){e.exports=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}},{}],218:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],219:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":221}],220:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":222}],221:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return r*r+n*n+a*a}},{}],222:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],223:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":224}],224:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],225:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2];return t[0]=n*r[0]+a*r[3]+i*r[6],t[1]=n*r[1]+a*r[4]+i*r[7],t[2]=n*r[2]+a*r[5]+i*r[8],t}},{}],226:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[3]*n+r[7]*a+r[11]*i+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/o,t[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/o,t[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/o,t}},{}],227:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*i-l*a,f=u*a+l*n-o*i,h=u*i+o*a-s*n,d=-o*n-s*a-l*i;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t}},{}],228:[function(t,e,r){e.exports=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}},{}],229:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],230:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],231:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],232:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return Math.sqrt(r*r+n*n+a*a+i*i)}},{}],233:[function(t,e,r){e.exports=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}},{}],234:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],235:[function(t,e,r){e.exports=function(t,e,r,n){var a=new Float32Array(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a}},{}],236:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":228,"./clone":229,"./copy":230,"./create":231,"./distance":232,"./divide":233,"./dot":234,"./fromValues":235,"./inverse":237,"./length":238,"./lerp":239,"./max":240,"./min":241,"./multiply":242,"./negate":243,"./normalize":244,"./random":245,"./scale":246,"./scaleAndAdd":247,"./set":248,"./squaredDistance":249,"./squaredLength":250,"./subtract":251,"./transformMat4":252,"./transformQuat":253}],237:[function(t,e,r){e.exports=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}},{}],238:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return Math.sqrt(e*e+r*r+n*n+a*a)}},{}],239:[function(t,e,r){e.exports=function(t,e,r,n){var a=e[0],i=e[1],o=e[2],s=e[3];return t[0]=a+n*(r[0]-a),t[1]=i+n*(r[1]-i),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],240:[function(t,e,r){e.exports=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}},{}],241:[function(t,e,r){e.exports=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}},{}],242:[function(t,e,r){e.exports=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}},{}],243:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],244:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r*r+n*n+a*a+i*i;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=a*o,t[3]=i*o);return t}},{}],245:[function(t,e,r){var n=t("./normalize"),a=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),a(t,t,e),t}},{"./normalize":244,"./scale":246}],246:[function(t,e,r){e.exports=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}},{}],247:[function(t,e,r){e.exports=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}},{}],248:[function(t,e,r){e.exports=function(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}},{}],249:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2],i=e[3]-t[3];return r*r+n*n+a*a+i*i}},{}],250:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3];return e*e+r*r+n*n+a*a}},{}],251:[function(t,e,r){e.exports=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}},{}],252:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}},{}],253:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*i-l*a,f=u*a+l*n-o*i,h=u*i+o*a-s*n,d=-o*n-s*a-l*i;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t[3]=e[3],t}},{}],254:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return A(r),m+=r.length,(d=d.slice(r.length)).length}}function R(){return/[^a-fA-F0-9]/.test(e)?(A(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function D(){return"."===e||/[eE]/.test(e)?(d.push(e),h=5,r=e,c+1):"x"===e&&1===d.length&&"0"===d[0]?(h=11,d.push(e),r=e,c+1):/[^\d]/.test(e)?(A(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function P(){return"f"===e&&(d.push(e),r=e,c+=1),/[eE]/.test(e)?(d.push(e),r=e,c+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(A(d.join("")),h=999,c):(d.push(e),r=e,c+1)}function I(){if(/[^\d\w_]/.test(e)){var t=d.join("");return h=T[t]?8:M[t]?7:6,A(d.join("")),h=999,c}return d.push(e),r=e,c+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":257,"./lib/builtins-300es":256,"./lib/literals":259,"./lib/literals-300es":258,"./lib/operators":260}],256:[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":257}],257:[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"]},{}],258:[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","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":259}],259:[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","uint","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"]},{}],260:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],261:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return a=(a=a.concat(r(t))).concat(r(null))}},{"./index":255}],262:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{dup:113}],263:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":268}],264:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":268}],265:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,f=r?a-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),i-=u}return(d?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,g=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+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,a),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+d]=255&s,d+=p,s/=256,a-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],266:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var a=t[0].length;if(r<=a)throw new Error("Must input at least d+1 points");var o=t.slice(0,a+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(a+1),c=0;c<=a;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var f=new i(l,new Array(a+1),!1),h=f.adjacent,d=new Array(a+2);for(c=0;c<=a;++c){for(var p=l.slice(),g=0;g<=a;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new i(p,new Array(a+1),!0);h[c]=m,d[c]=m}d[a+1]=f;for(c=0;c<=a;++c){p=h[c].vertices;var y=h[c].adjacent;for(g=0;g<=a;++g){var b=p[g];if(b<0)y[g]=f;else for(var x=0;x<=a;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}}var _=new u(a,o,d),w=!!e;for(c=a+1;c0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];a[f]=h<0?e:i[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,i=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)i[c]=a[l[c]];s.lastVisited=r;for(c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=i[c];i[c]=t;var d=this.orient();if(i[c]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,a=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,g=d.indexOf(r);if(!(g<0))for(var v=0;v<=n;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)y[x]<0?(b=x,l[x]=t):l[x]=a[y[x]];if(this.orient()>0){y[b]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var _=m.adjacent,w=d.slice(),M=p.slice(),T=new i(w,M,!0);c.push(T);var A=_.indexOf(e);if(!(A<0)){_[A]=T,M[g]=m,w[v]=-1,M[v]=e,p[v]=T,T.flip();for(x=0;x<=n;++x){var k=w[x];if(!(k<0||k===r)){for(var L=new Array(n-1),S=0,E=0;E<=n;++E){var C=w[E];C<0||E===x||(L[S++]=C)}h.push(new o(L,T,x))}}}}}}h.sort(s);for(v=0;v+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":329,"simplicial-complex":339}],267:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new m(null);return new m(v(t))};var i=a.prototype;function o(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 s(t,e){var r=v(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function h(t,e){for(var r=0;r>1],i=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=v([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=v([t]);else{var r=n.ge(this.leftPoints,t,p),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,p);ithis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},i.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=m.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":42}],268:[function(t,e,r){e.exports=!0},{}],269:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],281:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],282:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],283:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],284:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],285:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<d[1][2]&&(m[0]=-m[0]),d[0][2]>d[2][0]&&(m[1]=-m[1]),d[1][0]>d[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":287,"gl-mat4/clone":127,"gl-mat4/create":129,"gl-mat4/determinant":130,"gl-mat4/invert":142,"gl-mat4/transpose":155,"gl-vec3/cross":196,"gl-vec3/dot":201,"gl-vec3/length":211,"gl-vec3/normalize":218}],287:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,a=0;a<16;a++)t[a]=e[a]*n;return!0}},{}],288:[function(t,e,r){var n=t("gl-vec3/lerp"),a=t("mat4-recompose"),i=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=i(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=i(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!d)&&(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),a(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},{"gl-mat4/determinant":130,"gl-vec3/lerp":212,"mat4-decompose":286,"mat4-recompose":289,"quat-slerp":331}],289:[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")},a=(n.create(),n.create());e.exports=function(t,e,r,i,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(a),0!==i[2]&&(a[9]=i[2],n.multiply(t,t,a)),0!==i[1]&&(a[9]=0,a[8]=i[1],n.multiply(t,t,a)),0!==i[0]&&(a[8]=0,a[4]=i[0],n.multiply(t,t,a)),n.scale(t,t,r),t}},{"gl-mat4/create":129,"gl-mat4/fromRotationTranslation":133,"gl-mat4/identity":140,"gl-mat4/multiply":144,"gl-mat4/scale":152,"gl-mat4/translate":154}],290:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),a=t("mat4-interpolate"),i=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function d(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]}e.exports=function(t){return new d((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=d.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(u=0;u<16;++u)h[u]=s[l++];var p=this.nextMatrix;for(u=0;u<16;++u)p[u]=s[l++],d=d&&h[u]===p[u];if(c<1e-6||d)for(u=0;u<16;++u)o[u]=h[u];else a(o,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=o[1],g[1]=o[5],g[2]=o[9],f(g,g);var v=this.computedInverse;i(v,o);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)b[u]=m[u]-o[2+4*u]*x}},p.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(a=0,o.length);a0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":344}],292:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==a||c!==i||l(s))&&(r=0|t,a=u||0,i=c||0,e&&e(r,a,i,o))}function c(t){u(0,t)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,a,i,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":294}],293:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],294:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],271:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],272:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],273:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],274:[function(t,e,r){var n=t("./normalize"),a=t("gl-mat4/create"),i=t("gl-mat4/clone"),o=t("gl-mat4/determinant"),s=t("gl-mat4/invert"),l=t("gl-mat4/transpose"),u={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},c=a(),f=a(),h=[0,0,0,0],d=[[0,0,0],[0,0,0],[0,0,0]],p=[0,0,0];function g(t,e,r,n,a){t[0]=e[0]*n+r[0]*a,t[1]=e[1]*n+r[1]*a,t[2]=e[2]*n+r[2]*a}e.exports=function(t,e,r,a,v,m){if(e||(e=[0,0,0]),r||(r=[0,0,0]),a||(a=[0,0,0]),v||(v=[0,0,0,1]),m||(m=[0,0,0,1]),!n(c,t))return!1;if(i(f,c),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var y,b,x,_,w,M,T,A=c[3],k=c[7],L=c[11],S=c[12],E=c[13],C=c[14],O=c[15];if(0!==A||0!==k||0!==L){if(h[0]=A,h[1]=k,h[2]=L,h[3]=O,!s(f,f))return!1;l(f,f),y=v,x=f,_=(b=h)[0],w=b[1],M=b[2],T=b[3],y[0]=x[0]*_+x[4]*w+x[8]*M+x[12]*T,y[1]=x[1]*_+x[5]*w+x[9]*M+x[13]*T,y[2]=x[2]*_+x[6]*w+x[10]*M+x[14]*T,y[3]=x[3]*_+x[7]*w+x[11]*M+x[15]*T}else v[0]=v[1]=v[2]=0,v[3]=1;if(e[0]=S,e[1]=E,e[2]=C,function(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]}(d,c),r[0]=u.length(d[0]),u.normalize(d[0],d[0]),a[0]=u.dot(d[0],d[1]),g(d[1],d[1],d[0],1,-a[0]),r[1]=u.length(d[1]),u.normalize(d[1],d[1]),a[0]/=r[1],a[1]=u.dot(d[0],d[2]),g(d[2],d[2],d[0],1,-a[1]),a[2]=u.dot(d[1],d[2]),g(d[2],d[2],d[1],1,-a[2]),r[2]=u.length(d[2]),u.normalize(d[2],d[2]),a[1]/=r[2],a[2]/=r[2],u.cross(p,d[1],d[2]),u.dot(d[0],p)<0)for(var R=0;R<3;R++)r[R]*=-1,d[R][0]*=-1,d[R][1]*=-1,d[R][2]*=-1;return m[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),m[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),m[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),m[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(m[0]=-m[0]),d[0][2]>d[2][0]&&(m[1]=-m[1]),d[1][0]>d[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":275,"gl-mat4/clone":121,"gl-mat4/create":123,"gl-mat4/determinant":124,"gl-mat4/invert":136,"gl-mat4/transpose":149,"gl-vec3/cross":188,"gl-vec3/dot":193,"gl-vec3/length":203,"gl-vec3/normalize":210}],275:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,a=0;a<16;a++)t[a]=e[a]*n;return!0}},{}],276:[function(t,e,r){var n=t("gl-vec3/lerp"),a=t("mat4-recompose"),i=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=i(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=i(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!d)&&(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),a(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},{"gl-mat4/determinant":124,"gl-vec3/lerp":204,"mat4-decompose":274,"mat4-recompose":277,"quat-slerp":316}],277:[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")},a=(n.create(),n.create());e.exports=function(t,e,r,i,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(a),0!==i[2]&&(a[9]=i[2],n.multiply(t,t,a)),0!==i[1]&&(a[9]=0,a[8]=i[1],n.multiply(t,t,a)),0!==i[0]&&(a[8]=0,a[4]=i[0],n.multiply(t,t,a)),n.scale(t,t,r),t}},{"gl-mat4/create":123,"gl-mat4/fromRotationTranslation":127,"gl-mat4/identity":134,"gl-mat4/multiply":138,"gl-mat4/scale":146,"gl-mat4/translate":148}],278:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),a=t("mat4-interpolate"),i=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function d(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]}e.exports=function(t){return new d((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=d.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(u=0;u<16;++u)h[u]=s[l++];var p=this.nextMatrix;for(u=0;u<16;++u)p[u]=s[l++],d=d&&h[u]===p[u];if(c<1e-6||d)for(u=0;u<16;++u)o[u]=h[u];else a(o,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=o[1],g[1]=o[5],g[2]=o[9],f(g,g);var v=this.computedInverse;i(v,o);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)b[u]=m[u]-o[2+4*u]*x}},p.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(a=0,o.length);a0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":329}],280:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==a||c!==i||l(s))&&(r=0|t,a=u||0,i=c||0,e&&e(r,a,i,o))}function c(t){u(0,t)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,a,i,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":282}],281:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],282:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<0&&o(l,r))}catch(t){f.call(new d(r),t)}}}function f(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function h(t,e,r,n){for(var a=0;a 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 w=t.getters||[],M=new Array(x),T=0;T=0?M[T]=!0:M[T]=!1;return function(t,e,r,x,_,w){var M=w.length,T=_.length;if(T<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var A="extractContour"+_.join("_"),k=[],L=[],S=[],E=0;E0&&D.push(l(E,_[C-1])+"*"+s(_[C-1])),L.push(p(E,_[C])+"=("+D.join("-")+")|0")}for(E=0;E=0;--E)P.push(s(_[E]));L.push("Q=("+P.join("*")+")|0","P=mallocUint32(Q)","V=mallocUint32(Q)","X=0"),L.push(g(0)+"=0");for(C=1;C<1<0;_=_-1&p)b.push("V[X+"+m(_)+"]");b.push(y(0));for(_=0;_=0;--e)j(e,0);var r=[];for(e=0;e0){",d(_[e]),"=1;"),t(e-1,r|1<<_[e]);for(var n=0;n=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),i.push("1"),o.push("s["+l+"]-2"));var u=".lo("+i.join()+").hi("+o.join()+")";if(0===i.length&&(u=""),a>0){n.push("if(1");for(l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",a,"(src.pick(",s.join(),")",u);for(l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",u);n.push(");")}for(l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===a?n.push("dst.set(",s.join(),",",c,",0);"):n.push("zero(",f,");");break;case"wrap":var p=s.slice(),g=s.slice();e[l]<0?(p[c]="s["+c+"]-2",g[c]="0"):(p[c]="s["+c+"]-1",g[c]="1"),0===a?n.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>2){diff(",f,",src.pick(",p.join(),")",u,",src.pick(",g.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}a>0&&n.push("};")}for(var s=0;s<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_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=n({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=n({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=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_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=o({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=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:a,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":83}],301:[function(t,e,r){"use strict";var n=t("ndarray"),a=t("./doConvert.js");e.exports=function(t,e){for(var r=[],i=t,o=1;Array.isArray(i);)r.push(i.length),o*=i.length,i=i[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),a(e,t),e)}},{"./doConvert.js":302,ndarray:305}],302:[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":83}],303:[function(t,e,r){"use strict";var n=t("typedarray-pool"),a=32;function i(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r0?s.push(["d",p,"=s",p,"-d",f,"*n",f].join("")):s.push(["d",p,"=s",p].join("")),f=p),0!==(d=t.length-1-l)&&(h>0?s.push(["e",d,"=s",d,"-e",h,"*n",h,",f",d,"=",u[d],"-f",h,"*n",h].join("")):s.push(["e",d,"=s",d,",f",d,"=",u[d]].join("")),h=d)}r.push("var "+s.join(","));var g=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",a,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var v=new Function("insertionSort","quickSort",r.join("\n")),m=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),a=["left","right","data","offset"].concat(o(t.length)),s=i(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var u=[],c=1;c1){r.push("dptr=0;sptr=ptr");for(c=t.length-1;c>=0;--c){0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"b){break __l}"].join(""));for(c=t.length-1;c>=1;--c)r.push("sptr+=e"+c,"dptr+=f"+c,"}");r.push("dptr=cptr;sptr=cptr-s0");for(c=t.length-1;c>=0;--c){0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"=0;--c){0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e),y=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),u=i(e),c=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var f=["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 h=[],d=1;d=0;--i){0!==(o=t[i])&&n.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,a,i){if(1===r.length)n.push("ptr0="+p(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)a&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function b(){t.length>1&&u&&n.push("free(pivot1)","free(pivot2)")}function x(e,r){var a="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++c;y(o,[a,i],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",a,";",a,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",g(p(a)),">",g(p(i)),"){tmp0=",a,";",a,"=",i,";",i,"=tmp0}"].join(""))}function _(e,r){t.length>1?m([e,r],!1,v("ptr0",g("ptr1"))):n.push(v(p(e),g(p(r))))}function w(e,r,a){if(t.length>1){var i="__l"+ ++c;y(i,[r],!0,[e,"=",g("ptr0"),"-pivot",a,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else n.push([e,"=",g(p(r)),"-pivot",a].join(""))}function M(e,r){t.length>1?m([e,r],!1,["tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1","tmp")].join("")):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1","tmp")].join(""))}function T(e,r,a){t.length>1?(m([e,r,a],!1,["tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1",g("ptr2")),"\n",v("ptr2","tmp")].join("")),n.push("++"+r,"--"+a)):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","ptr2=",p(a),"\n","++",r,"\n","--",a,"\n","tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1",g("ptr2")),"\n",v("ptr2","tmp")].join(""))}function A(t,e){M(t,e),n.push("--"+e)}function k(e,r,a){t.length>1?m([e,r],!0,[v("ptr0",g("ptr1")),"\n",v("ptr1",["pivot",a,"[pivot_ptr]"].join(""))].join("")):n.push(v(p(e),g(p(r))),v(p(r),"pivot"+a))}function L(e,r){n.push(["if((",r,"-",e,")<=",a,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function S(e,r,a){t.length>1?(n.push(["__l",++c,":while(true){"].join("")),m([e],!0,["if(",g("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",c,"}"].join("")),n.push(a,"}")):n.push(["while(",g(p(e)),"===pivot",r,"){",a,"}"].join(""))}return n.push("var "+f.join(",")),x(1,2),x(4,5),x(1,3),x(2,3),x(1,4),x(3,4),x(2,5),x(2,3),x(4,5),t.length>1?m(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",v("ptr5","x"),"\n",v("ptr6","y"),"\n",v("ptr7","z")].join("")):n.push(["pivot1=",g(p("el2")),"\n","pivot2=",g(p("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(p("el1")),"\n","y=",g(p("el3")),"\n","z=",g(p("el5")),"\n",v(p("index1"),"x"),"\n",v(p("index3"),"y"),"\n",v(p("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),T("k","less","great"),n.push("break"),n.push("}else{"),A("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--greatindex5){"),S("less",1,"++less"),S("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great1&&u?new Function("insertionSort","malloc","free",n.join("\n"))(r,u[0],u[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,m);return v(m,y)}},{"typedarray-pool":372}],304:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),a={};e.exports=function(t){var e=t.order,r=t.dtype,i=[e,r].join(":"),o=a[i];return o||(a[i]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":303}],305:[function(t,e,r){var n=t("iota-array"),a=t("is-buffer"),i="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.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];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),a?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+r+"_get("+l.join(",")+"){"),a?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),i.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+o.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var d=o.map((function(t){return"a"+t+"=this.shape["+t+"]"})),p=o.map((function(t){return"c"+t+"=this.stride["+t+"]"}));i.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");i.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"c"+t})).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+o.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map((function(t){return"shape["+t+"]"})).join(",")+","+o.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",i.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n){n=0;for(s=0;st==t>0?i===-1>>>0?(r+=1,i=0):i+=1:0===i?(i=-1>>>0,r-=1):i-=1;return n.pack(i,r)}},{"double-bits":92}],307:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;oi){var x=a[u],_=1/Math.sqrt(v*y);for(b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(m[w]*g[M]-m[M]*g[w])}}}for(o=0;oi)for(_=1/Math.sqrt(T),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return a},r.faceNormals=function(t,e,r){for(var n=t.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;oi?1/Math.sqrt(d):0;for(u=0;u<3;++u)h[u]*=d;a[o]=h}return a}},{}],308:[function(t,e,r){ +!function(t,r,n){r[t]=r[t]||n(),void 0!==e&&e.exports&&(e.exports=r[t])}("Promise",void 0!==t?t:this,(function(){"use strict";var t,e,n,a=Object.prototype.toString,i=void 0!==r?function(t){return r(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function o(t,r){n.add(t,r),e||(e=i(n.drain))}function s(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function l(){for(var t=0;t0&&o(l,r))}catch(t){f.call(new d(r),t)}}}function f(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function h(t,e,r,n){for(var a=0;a 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 s=t.getters||[],l=new Array(i),u=0;u=0?l[u]=!0:l[u]=!1;return function(t,e,r,i,o,s){var l=[s,o].join(",");return(0,a[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var a={"false,0,1":function(t,e,r,n,a){return function(i,o,s,l){var u,c=0|i.shape[0],f=0|i.shape[1],h=i.data,d=0|i.offset,p=0|i.stride[0],g=0|i.stride[1],v=d,m=0|-p,y=0,b=0|-g,x=0,_=-p-g|0,w=0,M=0|p,T=g-p*c|0,A=0,k=0,L=0,S=2*c|0,E=n(S),C=n(S),O=0,R=0,D=-1,P=-1,I=0,z=0|-c,N=0|c,F=0,B=-c-1|0,j=c-1|0,U=0,H=0,Y=0;for(A=0;A0){if(k=1,E[O++]=r(h[v],o,s,l),v+=M,c>0)for(A=1,u=h[v],R=E[O]=r(u,o,s,l),I=E[O+D],F=E[O+z],U=E[O+B],R===I&&R===F&&R===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(A,k,u,y,x,w,R,I,F,U,o,s,l),H=C[O]=L++),O+=1,v+=M,A=2;A0)for(A=1,u=h[v],R=E[O]=r(u,o,s,l),I=E[O+D],F=E[O+z],U=E[O+B],R===I&&R===F&&R===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(A,k,u,y,x,w,R,I,F,U,o,s,l),H=C[O]=L++,U!==F&&e(C[O+z],H,x,w,F,U,o,s,l)),O+=1,v+=M,A=2;A0){if(A=1,E[O++]=r(h[v],o,s,l),v+=M,f>0)for(k=1,u=h[v],R=E[O]=r(u,o,s,l),F=E[O+z],I=E[O+D],U=E[O+B],R===F&&R===I&&R===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(A,k,u,y,x,w,R,F,I,U,o,s,l),H=C[O]=L++),O+=1,v+=M,k=2;k0)for(k=1,u=h[v],R=E[O]=r(u,o,s,l),F=E[O+z],I=E[O+D],U=E[O+B],R===F&&R===I&&R===U||(y=h[v+m],x=h[v+b],w=h[v+_],t(A,k,u,y,x,w,R,F,I,U,o,s,l),H=C[O]=L++,U!==F&&e(C[O+z],H,w,y,U,F,o,s,l)),O+=1,v+=M,k=2;k2&&i[1]>2&&n(a.pick(-1,-1).lo(1,1).hi(i[0]-2,i[1]-2),t.pick(-1,-1,0).lo(1,1).hi(i[0]-2,i[1]-2),t.pick(-1,-1,1).lo(1,1).hi(i[0]-2,i[1]-2)),i[1]>2&&(r(a.pick(0,-1).lo(1).hi(i[1]-2),t.pick(0,-1,1).lo(1).hi(i[1]-2)),e(t.pick(0,-1,0).lo(1).hi(i[1]-2))),i[1]>2&&(r(a.pick(i[0]-1,-1).lo(1).hi(i[1]-2),t.pick(i[0]-1,-1,1).lo(1).hi(i[1]-2)),e(t.pick(i[0]-1,-1,0).lo(1).hi(i[1]-2))),i[0]>2&&(r(a.pick(-1,0).lo(1).hi(i[0]-2),t.pick(-1,0,0).lo(1).hi(i[0]-2)),e(t.pick(-1,0,1).lo(1).hi(i[0]-2))),i[0]>2&&(r(a.pick(-1,i[1]-1).lo(1).hi(i[0]-2),t.pick(-1,i[1]-1,0).lo(1).hi(i[0]-2)),e(t.pick(-1,i[1]-1,1).lo(1).hi(i[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(i[0]-1,0,0,0),t.set(i[0]-1,0,1,0),t.set(0,i[1]-1,0,0),t.set(0,i[1]-1,1,0),t.set(i[0]-1,i[1]-1,0,0),t.set(i[0]-1,i[1]-1,1,0),t}}e.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(i=c[e])return i;for(var r=t.length,n=[f,h],a=1;a<=r;++a)n.push(d(a));var i=p.apply(void 0,n);return c[e]=i,i}(r)(t,e)}},{dup:91}],287:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,a=0<=r&&r0;){b<64?(l=b,b=0):(l=64,b-=64);for(var x=0|t[1];x>0;){x<64?(u=x,x=0):(u=64,x-=64),n=m+b*f+x*h,o=y+b*p+x*g;var _=0,w=0,M=0,T=d,A=f-c*d,k=h-l*f,L=v,S=p-c*v,E=g-l*p;for(M=0;M0;){g<64?(l=g,g=0):(l=64,g-=64);for(var v=0|t[0];v>0;){v<64?(s=v,v=0):(s=64,v-=64),n=d+g*c+v*u,o=p+g*h+v*f;var m=0,y=0,b=c,x=u-l*c,_=h,w=f-l*h;for(y=0;y0;){y<64?(u=y,y=0):(u=64,y-=64);for(var b=0|t[0];b>0;){b<64?(s=b,b=0):(s=64,b-=64);for(var x=0|t[1];x>0;){x<64?(l=x,x=0):(l=64,x-=64),n=v+y*h+b*c+x*f,o=m+y*g+b*d+x*p;var _=0,w=0,M=0,T=h,A=c-u*h,k=f-s*c,L=g,S=d-u*g,E=p-s*d;for(M=0;Mr;){m=0,y=g-o;e:for(v=0;vx)break e;y+=f,m+=h}for(m=g,y=g-o,v=0;v>1,V=Y-j,G=Y+j,q=U,W=V,X=Y,Z=G,J=H,K=a+1,Q=i-1,$=!0,tt=0,et=0,rt=0,nt=f,at=e(nt),it=e(nt);A=l*q,k=l*W,B=s;t:for(T=0;T0){v=q,q=W,W=v;break t}if(rt<0)break t;B+=d}A=l*Z,k=l*J,B=s;t:for(T=0;T0){v=Z,Z=J,J=v;break t}if(rt<0)break t;B+=d}A=l*q,k=l*X,B=s;t:for(T=0;T0){v=q,q=X,X=v;break t}if(rt<0)break t;B+=d}A=l*W,k=l*X,B=s;t:for(T=0;T0){v=W,W=X,X=v;break t}if(rt<0)break t;B+=d}A=l*q,k=l*Z,B=s;t:for(T=0;T0){v=q,q=Z,Z=v;break t}if(rt<0)break t;B+=d}A=l*X,k=l*Z,B=s;t:for(T=0;T0){v=X,X=Z,Z=v;break t}if(rt<0)break t;B+=d}A=l*W,k=l*J,B=s;t:for(T=0;T0){v=W,W=J,J=v;break t}if(rt<0)break t;B+=d}A=l*W,k=l*X,B=s;t:for(T=0;T0){v=W,W=X,X=v;break t}if(rt<0)break t;B+=d}A=l*Z,k=l*J,B=s;t:for(T=0;T0){v=Z,Z=J,J=v;break t}if(rt<0)break t;B+=d}for(A=l*q,k=l*W,L=l*X,S=l*Z,E=l*J,C=l*U,O=l*Y,R=l*H,F=0,B=s,T=0;T0)){if(rt<0){for(A=l*x,k=l*K,L=l*Q,B=s,T=0;T0)for(;;){_=s+Q*l,F=0;t:for(T=0;T0)){_=s+Q*l,F=0;t:for(T=0;TH){t:for(;;){for(_=s+K*l,F=0,B=s,T=0;T1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,u)}},{"typedarray-pool":355}],292:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),a={};e.exports=function(t){var e=t.order,r=t.dtype,i=[e,r].join(":"),o=a[i];return o||(a[i]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":291}],293:[function(t,e,r){var n=t("is-buffer"),a="undefined"!=typeof Float64Array;function i(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=i*(r=0|t),a-=r),new n(this.data,a,i,e)},a.step=function(t){var e=this.shape[0],r=this.stride[0],a=this.offset,i=0,o=Math.ceil;return"number"==typeof t&&((i=0|t)<0?(a+=r*(e-1),e=o(-e/i)):e=o(e/i),r*=i),new n(this.data,e,r,a)},a.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},a.pick=function(t){var r=[],n=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,a)},function(t,e,r,a){return new n(t,e[0],r[0],a)}},2:function(t,e,r){function n(t,e,r,n,a,i){this.data=t,this.shape=[e,r],this.stride=[n,a],this.offset=0|i}var a=n.prototype;return a.dtype=t,a.dimension=2,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(a,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),a.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},a.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},a.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},a.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},a.lo=function(t,e){var r=this.offset,a=0,i=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(a=0|t),i-=a),"number"==typeof e&&e>=0&&(r+=l*(a=0|e),o-=a),new n(this.data,i,o,s,l,r)},a.step=function(t,e){var r=this.shape[0],a=this.shape[1],i=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=i*(r-1),r=u(-r/l)):r=u(r/l),i*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(a-1),a=u(-a/l)):a=u(a/l),o*=l),new n(this.data,r,a,i,o,s)},a.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,a=this.stride;return new n(this.data,r[t],r[e],a[t],a[e],this.offset)},a.pick=function(t,r){var n=[],a=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(n.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?i=i+this.stride[1]*r|0:(n.push(this.shape[1]),a.push(this.stride[1])),(0,e[n.length+1])(this.data,n,a,i)},function(t,e,r,a){return new n(t,e[0],e[1],r[0],r[1],a)}},3:function(t,e,r){function n(t,e,r,n,a,i,o,s){this.data=t,this.shape=[e,r,n],this.stride=[a,i,o],this.offset=0|s}var a=n.prototype;return a.dtype=t,a.dimension=3,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(a,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),a.set=function(e,r,n,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=a},a.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},a.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},a.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},a.lo=function(t,e,r){var a=this.offset,i=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],f=this.stride[2];return"number"==typeof t&&t>=0&&(a+=u*(i=0|t),o-=i),"number"==typeof e&&e>=0&&(a+=c*(i=0|e),s-=i),"number"==typeof r&&r>=0&&(a+=f*(i=0|r),l-=i),new n(this.data,o,s,l,u,c,f,a)},a.step=function(t,e,r){var a=this.shape[0],i=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,f=0,h=Math.ceil;return"number"==typeof t&&((f=0|t)<0?(c+=s*(a-1),a=h(-a/f)):a=h(a/f),s*=f),"number"==typeof e&&((f=0|e)<0?(c+=l*(i-1),i=h(-i/f)):i=h(i/f),l*=f),"number"==typeof r&&((f=0|r)<0?(c+=u*(o-1),o=h(-o/f)):o=h(o/f),u*=f),new n(this.data,a,i,o,s,l,u,c)},a.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var a=this.shape,i=this.stride;return new n(this.data,a[t],a[e],a[r],i[t],i[e],i[r],this.offset)},a.pick=function(t,r,n){var a=[],i=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(a.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(a.push(this.shape[1]),i.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(a.push(this.shape[2]),i.push(this.stride[2])),(0,e[a.length+1])(this.data,a,i,o)},function(t,e,r,a){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],a)}},4:function(t,e,r){function n(t,e,r,n,a,i,o,s,l,u){this.data=t,this.shape=[e,r,n,a],this.stride=[i,o,s,l],this.offset=0|u}var a=n.prototype;return a.dtype=t,a.dimension=4,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(a,"order",{get:r}),a.set=function(e,r,n,a,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a]=i},a.get=function(e,r,n,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a]},a.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},a.hi=function(t,e,r,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof a||a<0?this.shape[3]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},a.lo=function(t,e,r,a){var i=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3];return"number"==typeof t&&t>=0&&(i+=f*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(i+=h*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(i+=d*(o=0|r),u-=o),"number"==typeof a&&a>=0&&(i+=p*(o=0|a),c-=o),new n(this.data,s,l,u,c,f,h,d,p,i)},a.step=function(t,e,r,a){var i=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],f=this.stride[2],h=this.stride[3],d=this.offset,p=0,g=Math.ceil;return"number"==typeof t&&((p=0|t)<0?(d+=u*(i-1),i=g(-i/p)):i=g(i/p),u*=p),"number"==typeof e&&((p=0|e)<0?(d+=c*(o-1),o=g(-o/p)):o=g(o/p),c*=p),"number"==typeof r&&((p=0|r)<0?(d+=f*(s-1),s=g(-s/p)):s=g(s/p),f*=p),"number"==typeof a&&((p=0|a)<0?(d+=h*(l-1),l=g(-l/p)):l=g(l/p),h*=p),new n(this.data,i,o,s,l,u,c,f,h,d)},a.transpose=function(t,e,r,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,a=void 0===a?3:0|a;var i=this.shape,o=this.stride;return new n(this.data,i[t],i[e],i[r],i[a],o[t],o[e],o[r],o[a],this.offset)},a.pick=function(t,r,n,a){var i=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(i.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(i.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(i.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof a&&a>=0?s=s+this.stride[3]*a|0:(i.push(this.shape[3]),o.push(this.stride[3])),(0,e[i.length+1])(this.data,i,o,s)},function(t,e,r,a){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],a)}},5:function(t,e,r){function n(t,e,r,n,a,i,o,s,l,u,c,f){this.data=t,this.shape=[e,r,n,a,i],this.stride=[o,s,l,u,c],this.offset=0|f}var a=n.prototype;return a.dtype=t,a.dimension=5,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(a,"order",{get:r}),a.set=function(e,r,n,a,i,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i]=o},a.get=function(e,r,n,a,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*a+this.stride[4]*i]},a.index=function(t,e,r,n,a){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*a},a.hi=function(t,e,r,a,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof a||a<0?this.shape[3]:0|a,"number"!=typeof i||i<0?this.shape[4]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},a.lo=function(t,e,r,a,i){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],f=this.shape[3],h=this.shape[4],d=this.stride[0],p=this.stride[1],g=this.stride[2],v=this.stride[3],m=this.stride[4];return"number"==typeof t&&t>=0&&(o+=d*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=p*(s=0|e),u-=s),"number"==typeof r&&r>=0&&(o+=g*(s=0|r),c-=s),"number"==typeof a&&a>=0&&(o+=v*(s=0|a),f-=s),"number"==typeof i&&i>=0&&(o+=m*(s=0|i),h-=s),new n(this.data,l,u,c,f,h,d,p,g,v,m,o)},a.step=function(t,e,r,a,i){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3],g=this.stride[4],v=this.offset,m=0,y=Math.ceil;return"number"==typeof t&&((m=0|t)<0?(v+=f*(o-1),o=y(-o/m)):o=y(o/m),f*=m),"number"==typeof e&&((m=0|e)<0?(v+=h*(s-1),s=y(-s/m)):s=y(s/m),h*=m),"number"==typeof r&&((m=0|r)<0?(v+=d*(l-1),l=y(-l/m)):l=y(l/m),d*=m),"number"==typeof a&&((m=0|a)<0?(v+=p*(u-1),u=y(-u/m)):u=y(u/m),p*=m),"number"==typeof i&&((m=0|i)<0?(v+=g*(c-1),c=y(-c/m)):c=y(c/m),g*=m),new n(this.data,o,s,l,u,c,f,h,d,p,g,v)},a.transpose=function(t,e,r,a,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,a=void 0===a?3:0|a,i=void 0===i?4:0|i;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[a],o[i],s[t],s[e],s[r],s[a],s[i],this.offset)},a.pick=function(t,r,n,a,i){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof a&&a>=0?l=l+this.stride[3]*a|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof i&&i>=0?l=l+this.stride[4]*i|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,a){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],a)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,u[t][0]):n(t,u[t],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(t,e,r,i){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===i){i=0;for(s=0;st==t>0?i===-1>>>0?(r+=1,i=0):i+=1:0===i?(i=-1>>>0,r-=1):i-=1;return n.pack(i,r)}},{"double-bits":89}],295:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;oi){var x=a[u],_=1/Math.sqrt(v*y);for(b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(m[w]*g[M]-m[M]*g[w])}}}for(o=0;oi)for(_=1/Math.sqrt(T),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return a},r.faceNormals=function(t,e,r){for(var n=t.length,a=new Array(n),i=void 0===r?1e-6:r,o=0;oi?1/Math.sqrt(d):0;for(u=0;u<3;++u)h[u]*=d;a[o]=h}return a}},{}],296:[function(t,e,r){ /* object-assign (c) Sindre Sorhus @license MIT */ -"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){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;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),u=1;u0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-i)/f,t[3]=.5*f}else{var h=Math.max(e,i,u);f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(a+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):i>=h?(t[0]=.5*(r+a)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-a)/f)}return t}},{}],310:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var a=new f(r,e,Math.log(n));a.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&a.lookAt(0,t.eye,t.center,t.up);return a};var n=t("filtered-vector"),a=t("gl-mat4/lookAt"),i=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=u(r,n,a,i);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=a/o,t[3]=i/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(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)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;i(r,e);var n=this.computedCenter,a=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);a[0]=n[0]+s*r[2],a[1]=n[1]+s*r[6],a[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,f=0;f<3;++f)u+=r[l+4*f]*a[f];r[12+l]=-u}},h.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},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=a[1],o=a[5],s=a[9],u=l(i,o,s);i/=u,o/=u,s/=u;var c=a[0],f=a[4],h=a[8],d=c*i+f*o+h*s,p=l(c-=i*d,f-=o*d,h-=s*d);c/=p,f/=p,h/=p;var g=a[2],v=a[6],m=a[10],y=g*i+v*o+m*s,b=g*c+v*f+m*h,x=l(g-=y*i+b*c,v-=y*o+b*f,m-=y*s+b*h);g/=x,v/=x,m/=x;var _=c*e+i*r,w=f*e+o*r,M=h*e+s*r;this.center.move(t,_,w,M);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(t,Math.log(T))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var a=this.computedMatrix,i=a[0],o=a[4],s=a[8],c=a[1],f=a[5],h=a[9],d=a[2],p=a[6],g=a[10],v=e*i+r*c,m=e*o+r*f,y=e*s+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=u(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var T=this.computedRotation,A=T[0],k=T[1],L=T[2],S=T[3],E=A*w+S*b+k*_-L*x,C=k*w+S*x+L*b-A*_,O=L*w+S*_+A*x-k*b,R=S*w-A*b-k*x-L*_;if(n){b=d,x=p,_=g;var D=Math.sin(n)/l(b,x,_);b*=D,x*=D,_*=D,R=R*(w=Math.cos(e))-(E=E*w+R*b+C*_-O*x)*b-(C=C*w+R*x+O*b-E*_)*x-(O=O*w+R*_+E*x-C*b)*_}var P=u(E,C,O,R);P>1e-6?(E/=P,C/=P,O/=P,R/=P):(E=C=O=0,R=1),this.rotation.set(t,E,C,O,R)},h.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;a(i,e,r,n);var o=this.computedRotation;s(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var a=n[15];if(Math.abs(a)>1e-6){var i=n[12]/a,l=n[13]/a,u=n[14]/a;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,i-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.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},h.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])]},h.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]}},h.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 a=t.distance;a&&a>0&&this.radius.set(e,Math.log(a)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":309,"filtered-vector":98,"gl-mat4/fromQuat":131,"gl-mat4/invert":142,"gl-mat4/lookAt":143}],311:[function(t,e,r){ +"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){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;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),u=1;u0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-i)/f,t[3]=.5*f}else{var h=Math.max(e,i,u);f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(a+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):i>=h?(t[0]=.5*(r+a)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-a)/f)}return t}},{}],298:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var a=new f(r,e,Math.log(n));a.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&a.lookAt(0,t.eye,t.center,t.up);return a};var n=t("filtered-vector"),a=t("gl-mat4/lookAt"),i=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=u(r,n,a,i);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=a/o,t[3]=i/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(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)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;i(r,e);var n=this.computedCenter,a=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);a[0]=n[0]+s*r[2],a[1]=n[1]+s*r[6],a[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,f=0;f<3;++f)u+=r[l+4*f]*a[f];r[12+l]=-u}},h.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},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=a[1],o=a[5],s=a[9],u=l(i,o,s);i/=u,o/=u,s/=u;var c=a[0],f=a[4],h=a[8],d=c*i+f*o+h*s,p=l(c-=i*d,f-=o*d,h-=s*d);c/=p,f/=p,h/=p;var g=a[2],v=a[6],m=a[10],y=g*i+v*o+m*s,b=g*c+v*f+m*h,x=l(g-=y*i+b*c,v-=y*o+b*f,m-=y*s+b*h);g/=x,v/=x,m/=x;var _=c*e+i*r,w=f*e+o*r,M=h*e+s*r;this.center.move(t,_,w,M);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(t,Math.log(T))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var a=this.computedMatrix,i=a[0],o=a[4],s=a[8],c=a[1],f=a[5],h=a[9],d=a[2],p=a[6],g=a[10],v=e*i+r*c,m=e*o+r*f,y=e*s+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=u(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var T=this.computedRotation,A=T[0],k=T[1],L=T[2],S=T[3],E=A*w+S*b+k*_-L*x,C=k*w+S*x+L*b-A*_,O=L*w+S*_+A*x-k*b,R=S*w-A*b-k*x-L*_;if(n){b=d,x=p,_=g;var D=Math.sin(n)/l(b,x,_);b*=D,x*=D,_*=D,R=R*(w=Math.cos(e))-(E=E*w+R*b+C*_-O*x)*b-(C=C*w+R*x+O*b-E*_)*x-(O=O*w+R*_+E*x-C*b)*_}var P=u(E,C,O,R);P>1e-6?(E/=P,C/=P,O/=P,R/=P):(E=C=O=0,R=1),this.rotation.set(t,E,C,O,R)},h.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;a(i,e,r,n);var o=this.computedRotation;s(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var a=n[15];if(Math.abs(a)>1e-6){var i=n[12]/a,l=n[13]/a,u=n[14]/a;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,i-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.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},h.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])]},h.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]}},h.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 a=t.distance;a&&a>0&&this.radius.set(e,Math.log(a)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":297,"filtered-vector":95,"gl-mat4/fromQuat":125,"gl-mat4/invert":136,"gl-mat4/lookAt":137}],299:[function(t,e,r){ /*! * pad-left * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT license. */ -"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":337}],312:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length0;--o)i=l[o],r=s[o],s[o]=s[i],s[i]=r,l[o]=l[r],l[r]=i,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(t,e,r){switch(t){case 0:return 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]}var n,a,i,o=1;for((r=r||new Array(t))[0]=0,i=1;i0;--i)e=e-(n=e/o|0)*o|0,o=o/i|0,a=0|r[i],r[i]=0|r[n],r[n]=0|a;return r}},{"invert-permutation":277,"typedarray-pool":372}],316:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=0|e.length,a=t.length,i=[new Array(r),new Array(r)],o=0;o0){o=i[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=i[f][r],d=0;d0&&(o=p,s=g,l=f)}return a||o&&u(o,l),s}function f(t,r){var a=i[r][t][0],o=[t];u(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(i[0][t].length+i[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){i[0][o].length;var g=f(o,d);h(0,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":75}],317:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),a=new Array(e.length),i=new Array(e.length),o=[],s=0;s0;){var u=o.pop();a[u]=!1;var c=r[u];for(s=0;s0}))).length,v=new Array(g),m=new Array(g);for(d=0;d0;){var F=z.pop(),j=S[F];l(j,(function(t,e){return t-e}));var B,U=j.length,H=N[F];if(0===H){var V=p[F];B=[V]}for(d=0;d=0))if(N[Y]=1^H,z.push(Y),0===H)I(V=p[Y])||(V.reverse(),B.push(V))}0===H&&r.push(B)}return r};var n=t("edges-to-adjacency-list"),a=t("planar-dual"),i=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,i=i.right}else if(u>0)i=i.left;else{if(!(u<0))return 0;s=1,i=i.right}}return s}}(m.slabs,m.coordinates);return 0===i.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(i),y)};var n=t("robust-orientation")[3],a=t("slab-decomposition"),i=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length0){o=i[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=i[f][r],d=0;d0&&(o=p,s=g,l=f)}return a||o&&u(o,l),s}function f(t,r){var a=i[r][t][0],o=[t];u(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(i[0][t].length+i[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){i[0][o].length;var g=f(o,d);h(0,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":75}],303:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),a=new Array(e.length),i=new Array(e.length),o=[],s=0;s0;){var u=o.pop();a[u]=!1;var c=r[u];for(s=0;s0}))).length,v=new Array(g),m=new Array(g);for(d=0;d0;){var F=z.pop(),B=S[F];l(B,(function(t,e){return t-e}));var j,U=B.length,H=N[F];if(0===H){var Y=p[F];j=[Y]}for(d=0;d=0))if(N[V]=1^H,z.push(V),0===H)I(Y=p[V])||(Y.reverse(),j.push(Y))}0===H&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),a=t("planar-dual"),i=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,i=i.right}else if(u>0)i=i.left;else{if(!(u<0))return 0;s=1,i=i.right}}return s}}(m.slabs,m.coordinates);return 0===i.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(i),y)};var n=t("robust-orientation")[3],a=t("slab-decomposition"),i=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],324:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),g=!d&&e.pointBetween(s,u,c);if(h)return g?l(n,s):l(t,c),n;p&&(d||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=c(h,p);if(t)return t}return!!g&&c(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:a,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l=u?(T=1,y=u+2*h+p):y=h*(T=-h/u)+p):(T=0,d>=0?(A=0,y=p):-d>=f?(A=1,y=f+2*d+p):y=d*(A=-d/f)+p);else if(A<0)A=0,h>=0?(T=0,y=p):-h>=u?(T=1,y=u+2*h+p):y=h*(T=-h/u)+p;else{var k=1/M;y=(T*=k)*(u*T+c*(A*=k)+2*h)+A*(c*T+f*A+2*d)+p}else T<0?(x=f+d)>(b=c+h)?(_=x-b)>=(w=u-2*c+f)?(T=1,A=0,y=u+2*h+p):y=(T=_/w)*(u*T+c*(A=1-T)+2*h)+A*(c*T+f*A+2*d)+p:(T=0,x<=0?(A=1,y=f+2*d+p):d>=0?(A=0,y=p):y=d*(A=-d/f)+p):A<0?(x=u+h)>(b=c+d)?(_=x-b)>=(w=u-2*c+f)?(A=1,T=0,y=f+2*d+p):y=(T=1-(A=_/w))*(u*T+c*A+2*h)+A*(c*T+f*A+2*d)+p:(A=0,x<=0?(T=1,y=u+2*h+p):h>=0?(T=0,y=p):y=h*(T=-h/u)+p):(_=f+d-c-h)<=0?(T=0,A=1,y=f+2*d+p):_>=(w=u-2*c+f)?(T=1,A=0,y=u+2*h+p):y=(T=_/w)*(u*T+c*(A=1-T)+2*h)+A*(c*T+f*A+2*d)+p;var L=1-T-A;for(l=0;l1)for(var r=1;r0){var u=t[r-1];if(0===n(s,u)&&i(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":61,"compare-cell":76,"compare-oriented-cell":77}],337:[function(t,e,r){ +var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,f=i();function h(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=a():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,f,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,f,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":307,"./lib/epsilon":308,"./lib/geojson":309,"./lib/intersecter":310,"./lib/segment-chainer":312,"./lib/segment-selector":313}],307:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],308:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=e[0];return(o-a)*(e[1]-i)-(s-i)*(l-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],309:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),g=!d&&e.pointBetween(s,u,c);if(h)return g?l(n,s):l(t,c),n;p&&(d||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=c(h,p);if(t)return t}return!!g&&c(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:a,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l=u?(T=1,y=u+2*h+p):y=h*(T=-h/u)+p):(T=0,d>=0?(A=0,y=p):-d>=f?(A=1,y=f+2*d+p):y=d*(A=-d/f)+p);else if(A<0)A=0,h>=0?(T=0,y=p):-h>=u?(T=1,y=u+2*h+p):y=h*(T=-h/u)+p;else{var k=1/M;y=(T*=k)*(u*T+c*(A*=k)+2*h)+A*(c*T+f*A+2*d)+p}else T<0?(x=f+d)>(b=c+h)?(_=x-b)>=(w=u-2*c+f)?(T=1,A=0,y=u+2*h+p):y=(T=_/w)*(u*T+c*(A=1-T)+2*h)+A*(c*T+f*A+2*d)+p:(T=0,x<=0?(A=1,y=f+2*d+p):d>=0?(A=0,y=p):y=d*(A=-d/f)+p):A<0?(x=u+h)>(b=c+d)?(_=x-b)>=(w=u-2*c+f)?(A=1,T=0,y=f+2*d+p):y=(T=1-(A=_/w))*(u*T+c*A+2*h)+A*(c*T+f*A+2*d)+p:(A=0,x<=0?(T=1,y=u+2*h+p):h>=0?(T=0,y=p):y=h*(T=-h/u)+p):(_=f+d-c-h)<=0?(T=0,A=1,y=f+2*d+p):_>=(w=u-2*c+f)?(T=1,A=0,y=u+2*h+p):y=(T=_/w)*(u*T+c*(A=1-T)+2*h)+A*(c*T+f*A+2*d)+p;var L=1-T-A;for(l=0;l1)for(var r=1;r0){var u=t[r-1];if(0===n(s,u)&&i(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":61,"compare-cell":76,"compare-oriented-cell":77}],322:[function(t,e,r){ /*! * repeat-string * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ -"use strict";var n,a="";e.exports=function(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(n!==t||void 0===n)n=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=(a+=t).substr(0,r)}},{}],338:[function(t,e,r){(function(t){(function(){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,a=e-2;a>=0;--a){var i=r,o=t[a];(l=o-((r=i+o)-i))&&(t[--n]=r,r=l)}var s=0;for(a=n;a>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function c(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(l(t)),")};return robustDeterminant",t].join(""))(a,i,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;f.length<6;)f.push(c(f.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++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 a=Function.apply(void 0,t);for(e.exports=a.apply(void 0,f.concat([f,c])),n=0;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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 u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===a?r.push("+b[",i,"]"):r.push("+A[",i,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var i=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;i.length<6;)i.push(a(i.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(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 o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,i.concat([i,a])),n=0;n<6;++n)e.exports[n]=i[n]}()},{"robust-determinant":340}],344:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(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;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=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],f=e[2]-n[2],d=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=5;)d.push(c(d.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],351:[function(t,e,r){"use strict";e.exports=function(t){return a(n(t))};var n=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":45,"reduce-simplicial-complex":336}],352:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",a[0],"],c[",a[1],"])")}l.push("]")}l.push(");")}}for(i=t+1;i>1;--i){i>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=T[0];return v(0,k-1),k-=1,b(0),t}return-1}function w(t,e){var r=T[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((k+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],g(e)),A[r]>=0&&w(A[r],g(r))}}var T=[],A=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var L=_();if(L<0||u[L]>r)break;M(L)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=A[e],a=A[r];n!==a&&C.push([n,a])}})),a.unique(a.normalize(C)),{positions:S,edges:C}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":344,"simplicial-complex":356}],359:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(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=n(s,o,i),u=n(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]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return a;d=f[h]}}if(d.start)if(s){var p=i(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=d.index)}else a=d.index;else d.y!==t[1]&&(a=d.index)}}}return a}},{"./lib/order-segments":359,"binary-search-bounds":360,"functional-red-black-tree":100,"robust-orientation":344}],362:[function(t,e,r){"use strict";var n=t("robust-dot-product"),a=t("robust-sum");function i(t,e){var r=a(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var a=-e/(n-e);a<0?a=0:a>1&&(a=1);for(var i=1-a,o=t.length,s=new Array(o),l=0;l0||a>0&&c<0){var f=o(s,c,l,a);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),a=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(a,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(a,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":341,"robust-sum":349}],363:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+a+l:"0"===u?h+l+a:l+h+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],364:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;s c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;i.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(A="+"+v[x]+"*c");var k=p[x].length/y*.5,L=.5+m[x]/y*.5;T.push("d"+x+"-"+L+"-"+k+"*("+p[x].join("+")+A+")/("+g[x].join("+")+")")}h.push("a.push([",T.join(),"]);","break;")}i.push("}},"),f.length>0&&h.push("}}");var S=[];for(u=0;u<1<=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":330,timers:365}],366:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(L[t])t=L[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=B.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=B.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=B.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=B.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=B.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=B.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=B.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:z(e[4]),format:a?"name":"hex8"};if(e=B.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:a?"name":"hex"};if(e=B.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:z(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=B.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,g=e.b,a={r:255*C(d,255),g:255*C(p,255),b:255*C(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=P(e.s),u=P(e.v),a=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=P(e.s),c=P(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var d,p,g;return i=E(i),{ok:f,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,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(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:P(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var L=u.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"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function z(t){return R(t)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),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})$/});function U(t){return!!B.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],367:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=i;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*i(r[1],t)}function i(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 function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":313}],368:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(i(t+1)),r=[],o=0;oMath.max(r,n)?a[2]=1:r>Math.max(e,n)?a[0]=1:a[1]=1;for(var i=0,o=0,l=0;l<3;++l)i+=t[l]*t[l],o+=a[l]*t[l];for(l=0;l<3;++l)a[l]-=o/i*t[l];return s(a,a),a}function h(t,e,r,a,i,o,s,l){this.center=n(r),this.up=n(a),this.right=n(i),this.radius=n([o]),this.angle=n([s,l]),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)}var d=h.prototype;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[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])]},d.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,n=0,a=0,i=0;i<3;++i)a+=e[i]*r[i],n+=e[i]*e[i];var l=Math.sqrt(n),c=0;for(i=0;i<3;++i)r[i]-=e[i]*a/n,c+=r[i]*r[i],e[i]/=l;var f=Math.sqrt(c);for(i=0;i<3;++i)r[i]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,M=b,T=-v*b,A=-m*b,k=y,L=this.computedEye,S=this.computedMatrix;for(i=0;i<3;++i){var E=_*r[i]+w*h[i]+M*e[i];S[4*i+1]=T*r[i]+A*h[i]+k*e[i],S[4*i+2]=E,S[4*i+3]=0}var C=S[1],O=S[5],R=S[9],D=S[2],P=S[6],I=S[10],z=O*I-R*P,N=R*D-C*I,F=C*P-O*D,j=u(z,N,F);z/=j,N/=j,F/=j,S[0]=z,S[4]=N,S[8]=F;for(i=0;i<3;++i)L[i]=x[i]+S[2+4*i]*d;for(i=0;i<3;++i){c=0;for(var B=0;B<3;++B)c+=S[i+4*B]*L[B];S[12+i]=-c}S[15]=1},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};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var a=this.computedMatrix;p[0]=a[2],p[1]=a[6],p[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)a[4*u]=o[u],a[4*u+1]=s[u],a[4*u+2]=l[u];i(a,a,n,p);for(u=0;u<3;++u)o[u]=a[4*u],s[u]=a[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=(Math.exp(this.computedRadius[0]),a[1]),o=a[5],s=a[9],l=u(i,o,s);i/=l,o/=l,s/=l;var c=a[0],f=a[4],h=a[8],d=c*i+f*o+h*s,p=u(c-=i*d,f-=o*d,h-=s*d),g=(c/=p)*e+i*r,v=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var i=1;"number"==typeof r&&(i=0|r),(i<0||i>3)&&(i=1);var o=(i+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[i],l=e[i+4],f=e[i+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),g=Math.max(h,d,p);h===g?(s=s<0?-1:1,l=f=0):p===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=u(s,l,f);s/=v,l/=v,f/=v}var m,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,M=u(b-=s*w,x-=l*w,_-=f*w),T=l*(_/=M)-f*(x/=M),A=f*(b/=M)-s*_,k=s*x-l*b,L=u(T,A,k);if(T/=L,A/=L,k/=L,this.center.jump(t,Y,G,q),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===i){var S=e[1],E=e[5],C=e[9],O=S*b+E*x+C*_,R=S*T+E*A+C*k;m=z<0?-Math.PI/2:Math.PI/2,y=Math.atan2(R,O)}else{var D=e[2],P=e[6],I=e[10],z=D*s+P*l+I*f,N=D*b+P*x+I*_,F=D*T+P*A+I*k;m=Math.asin(c(z)),y=Math.atan2(F,N)}this.angle.jump(t,y,m),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],H=this.computedMatrix;a(H,e);var V=H[15],Y=H[12]/V,G=H[13]/V,q=H[14]/V,W=Math.exp(this.computedRadius[0]);this.center.jump(t,Y-j*W,G-B*W,q-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var a=(n=n||this.computedUp)[0],i=n[1],o=n[2],s=u(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=a*g+i*v+o*m,b=u(g-=y*a,v-=y*i,m-=y*o);if(!(b<.01&&(b=u(g=i*h-o*f,v=o*l-a*h,m=a*f-i*l))<1e-6)){g/=b,v/=b,m/=b,this.up.set(t,a,i,o),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=i*m-o*v,_=o*g-a*m,w=a*v-i*g,M=u(x,_,w),T=a*l+i*f+o*h,A=g*l+v*f+m*h,k=(x/=M)*l+(_/=M)*f+(w/=M)*h,L=Math.asin(c(T)),S=Math.atan2(k,A),E=this.angle._state,C=E[E.length-1],O=E[E.length-2];C%=2*Math.PI;var R=Math.abs(C+2*Math.PI-S),D=Math.abs(C-S),P=Math.abs(C-2*Math.PI-S);R0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function M(t){return s?new BigUint64Array(d(8*t),0,t):null}function T(t){return l?new BigInt64Array(d(8*t),0,t):null}function A(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return M(t);case"buffer":return k(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=M,r.mallocBigInt64=T,r.mallocDataView=A,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":43,buffer:55,dup:94}],373:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(L(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",L())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(L(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",L())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[i]:a}))},has___:{value:y((function(e){var n=m(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,a){var i,o=m(n);return o?o[r]=a:(i=t.indexOf(n))>=0?e[i]=a:(i=t.length,e[i]=a,t[i]=n),this}))},delete___:{value:y((function(n){var a,i,o=m(n);return o?r in o&&delete o[r]:!((a=t.indexOf(n))<0)&&(i=t.length-1,t[a]=void 0,e[a]=e[i],t[a]=t[i],t.length=i,e.length=i,!0)}))}})};p.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 r?function(){function n(){this instanceof p||b();var e,n=new r,a=void 0,i=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(a||(a=new p),a.set(t,e)),this}:function(t,e){if(i)try{n.set(t,e)}catch(r){a||(a=new p),a.set___(t,e)}else n.set(t,e);return this},Object.create(p.prototype,{get___:{value:y((function(t,e){return a?n.has(t)?n.get(t):a.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!a&&a.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return a&&a.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=p.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=p)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function v(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function m(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function b(){h||"undefined"==typeof console||(h=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],378:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){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:n(e,t)}}},{"./hidden-store.js":379}],379:[function(t,e,r){e.exports=function(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}},{}],380:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":378}],381:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":102}],382:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-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 a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},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 a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],d=c>>13;u=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(g>>5&15)-1,(31&g)+s);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var d,p=f[i.year-f[0]];for(d=0;d<13;d++){var g=p&1<<12-d?30:29;if(l>13;!v||d=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":396,"object-assign":308}],385:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":396,"object-assign":308}],386:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":396,"object-assign":308}],387:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":396,"object-assign":308}],388:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":396,"object-assign":308}],389:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":396,"object-assign":308}],390:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":396,"object-assign":308}],391:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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),f=t-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":396,"object-assign":308}],393:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":396,"object-assign":308}],394:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":396,"object-assign":308}],395:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":396,"object-assign":308}],396:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":308}],397:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var a=""+e;if(d(t,n))for(;a.length1},b=function(t,r){var n=y(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(A).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(A));return A+=t.length,t}return b("m")},w=function(t,r,n,i){for(var o=y(t,i)?n:r,s=0;s-1){d=1,p=g;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":396,"object-assign":308}],398:[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":83}],399:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":398}],400:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],401:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":524,"../../plot_api/plot_template":589,"../../plots/cartesian/constants":607,"../../plots/font_attributes":629,"./arrow_paths":400}],402:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":551,"../../plots/cartesian/axes":600,"./draw":407}],403:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=at.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?at._offset+at._length*Q:J=M.l+M.w*Q):(Q=1-e[et],J=pt?at._offset+at._length*Q:J=M.t+M.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*Y(.5,e.xanchor)-st*Y(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=M.t+M.h*gt):ft.tail=M.l+M.w*gt:ft.tail=at._offset+at.r2p(gt),K=tt}else ft.tail=J+gt,K=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ct,ft.head+=ct}else K=tt=lt*Y($,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)z.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(A-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:j+xt-1,y:j+_t}).call(c.setClipUrl,U?E:null,t);else{var wt=j+_t-g.top,Mt=j+xt-g.left;G.call(h.positionText,Mt,wt).call(c.setClipUrl,U?E:null,t)}H.select("rect").call(c.setRect,j,j,A,I),B.call(c.setRect,N/2,N/2,F-N,V-N),z.call(c.setTranslate,Math.round(C.x.text-F/2),Math.round(C.y.text-V/2)),D.attr({transform:"rotate("+O+","+C.x.text+","+C.y.text+")"});var Tt,At=function(r,n){R.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,d=C.y.tail+n,g=C.x.text+r,x=C.y.text+n,_=o.rotationXYMatrix(O,g,x),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),E=+B.attr("width"),P=+B.attr("height"),I=g-.5*E,N=I+E,F=x-.5*P,j=F+P,U=[[I,F,I,j],[I,j,N,j],[N,j,N,F],[N,F,I,F]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,V=e.arrowcolor,Y=e.arrowside,G=R.append("g").style({opacity:u.opacity(V)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(u.stroke,u.rgb(V));if(v(q,Y,e),T.annotationPosition&&q.node().parentNode&&!i){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),a=n[0]+t,i=n[1]+r;z.call(c.setTranslate,a,i),L("x",y(m,t,"x",M,e)),L("y",y(b,r,"y",M,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",M,e)),e.ayref===e.yref&&L("ay",y(b,r,"ay",M,e)),G.attr("transform",s(t,r)),D.attr({transform:"rotate("+O+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){Tt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",M,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(b,r,"ay",M.w,e)):L("ay",e.ay+r),At(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",M,e);else{var l=e._xsize/M.w,u=e.x+(e._xshift-e.xshift)/M.w-l/2;a=p.align(u+t/M.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",M,e);else{var c=e._ysize/M.h,f=e.y-(e._yshift+e.yshift)/M.h-c/2;o=p.align(f-r/M.h,c,0,1,e.yanchor)}L("x",a),L("y",o),m&&b||(n=p.getCursor(m?.5:a,b?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+Tt}),d(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===d.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,M=o.y-c.y;if(h=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void P();if(x){if(x*x>w*w+M*M)return void P();var T=x*Math.cos(f),A=x*Math.sin(f);c.x+=T,c.y+=A,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+M*M)return void P();var k=_*Math.cos(f),L=_*Math.sin(f);o.x-=k,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),E="";if(S1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":641,"../annotations/draw":407}],414:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*u.roundUp(Z/J,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(q.tick0=0)}q.dtick=W}q.domain=[V+B,V+N-B],q.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var K,Q=t.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+A.cbaxis),tt=0;function et(n,a){var i={propContainer:q,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k)){var t,r=l.l+(e.x+F)*l.w,n=q.title.font.size;t="top"===k?(1-(V+N-B))*l.h+l.t+3+.75*n:(1-(V+B))*l.h+l.t-3-.25*n,et(q._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(k)){var i=t.select("."+A.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+q._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*w),h?(tt=d.bBox(h).height)>p&&(f[1]-=(tt-p)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(tt=d.bBox(o.node()).height),tt){if(tt+=5,"top"===k)q.domain[1]-=tt/l.h,f[1]*=-1;else{q.domain[0]+=tt/l.h;var g=v.lineCount(o);f[1]+=(1-g)*p}i.attr("transform",c(f[0],f[1])),q.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",c(0,Math.round(l.h*(1-q.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(R);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var b=L.map(q.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?L[0]:(R[i]+R[i-1])/2,i===R.length-1?L[1]:(R[i]+R[i+1])/2].map(q.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var s=n.select(this).attr({x:U,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)d.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=E(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(m.color&&m.width?D:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(q.c2p(t))+m.width/2%1)+"h"+P).call(d.lineGroupStyle,m.width,S(t),m.dash)})),$.selectAll("g."+q._id+"tick,path").remove();var _=U+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),M=s.calcTicks(q),T=s.getTickSigns(q)[2];return s.drawTicks(r,q,{vals:"inside"===q.ticks?s.clipEnds(q,M):M,layer:$,path:s.makeTickPath(q,_,T),transFn:s.makeTransTickFn(q)}),s.drawLabels(r,q,{vals:M,layer:$,transFn:s.makeTransTickLabelFn(q),labelFns:s.makeLabelFns(q,_)})},function(){if(-1===["top","bottom"].indexOf(k)){var t=q.title.font.size,e=q._offset+q._length/2,a=l.l+(q.position||0)*l.w+("right"===q.side?10+t*(q.showticklabels?1:.5):-10-t*(q.showticklabels?.5:0));et("h"+q._id+"title",{avoid:{selection:n.select(r).selectAll("g."+q._id+"tick"),side:k,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=P+e.outlinewidth/2;if(-1===q.ticklabelposition.indexOf("inside")&&(n+=d.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(A.jsPlaceholder)){var a,o=Q.select(".h"+q._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(k)?d.bBox(o).width:d.bBox(Q.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=Y-G;t.select("."+A.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-j,width:Math.max(s,2),height:Math.max(u+2*j,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:U,y:G+e.ypad+("top"===k?tt:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-tt,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-f,l.t));var h={},g=M[e.yanchor],v=T[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*g,h.b=u*v):(h.t=h.b=0,h.yt=e.y+e.len*g,h.yb=e.y-e.len*v);var m=M[e.xanchor],y=T[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*m,h.r=s*y;else{var b=s-P;h.l=b*m,h.r=b*y,h.xl=e.x-e.thickness*m,h.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,h)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":523,"../../lib":551,"../../lib/extend":544,"../../lib/setcursor":571,"../../lib/svg_text_utils":576,"../../plots/cartesian/axes":600,"../../plots/cartesian/axis_defaults":602,"../../plots/cartesian/layout_attributes":615,"../../plots/cartesian/position_defaults":618,"../../plots/plots":646,"../../registry":649,"../color":418,"../colorscale/helpers":429,"../dragelement":437,"../drawing":440,"../titles":516,"./constants":420,"@plotly/d3":17,tinycolor2:366}],423:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":551}],424:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":419,"./defaults":421,"./draw":422,"./has_colorbar":423}],425:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var d=i+"auto",p=i+"min",g=i+"max",v=i+"mid",m=(s(h+d),s(h+p),s(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":567,"../../lib/sort_object_keys":573,"../colorbar/attributes":419,"./scales.js":433}],426:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":551,"./helpers":429,"fast-isnumeric":97}],427:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],435:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":551}],436:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],437:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":551,"../../plots/cartesian/constants":607,"./align":434,"./cursor":435,"./unhover":438,"has-hover":271,"has-passive-events":272,"mouse-event-offset":293}],438:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":542,"../../lib/events":543,"../../lib/throttle":577,"../fx/constants":452}],439:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],440:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),f=a.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};b.font=function(t,e,r,n){a.isPlainObject(e)&&(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(u.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,a){t.call(b.setPosition,e,r).call(b.setSize,n,a)},b.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",f(a,i)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);b.translatePoint(t,a,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";u.stroke(e,n||i.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(u.stroke,r||i.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},b.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(u.fill,e)},b.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(u.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(t,e){var r=t%100;return b.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(t))t=+t;else 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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},A=i("~f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=k[i],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},b.pattern=function(t,e,r,i,o,s,l,c,f,h,d,p){var g="legend"===e;c&&("overlay"===f?(h=c,d=u.contrast(h)):(h=void 0,d=c));var v,m,y,b,x,_,w,M,T,A,k,L=r._fullLayout,S="p"+L._uid+"-"+i,E={};switch(o){case"/":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",E={d:y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"\\":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",E={d:y="M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"x":v=s*Math.sqrt(2),m=s*Math.sqrt(2),y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2+"M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,b=s-s*Math.sqrt(1-l),_="path",E={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case"|":_="path",_="path",E={d:y="M"+(v=s)/2+",0L"+v/2+","+(m=s),opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"-":_="path",_="path",E={d:y="M0,"+(m=s)/2+"L"+(v=s)+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"+":_="path",y="M"+(v=s)/2+",0L"+v/2+","+(m=s)+"M0,"+m/2+"L"+v+","+m/2,b=s-s*Math.sqrt(1-l),_="path",E={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case".":v=s,m=s,l.pattern_filled";L._patternUrlQueryParts[R]=1},b.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},b.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},b.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(c,l))}var f,h,d,p=!1;if(t.so)d=s.outlierwidth,h=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=u.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=o.gradient,m=t.mgt;m?p=!0:m=v&&v.type,a.isArrayOrTypedArray(m)&&(m=m[0],k[m]||(m=0));var y=o.pattern,x=y&&b.getPatternAttr(y.shape,t.i,"");if(m&&"none"!==m){var _=t.mgc;_?p=!0:_=v.color;var M=r.uid;p&&(M+="-"+t.i),b.gradient(e,i,M,m,[[0,_],[1,f]],"fill")}else if(x){var T=b.getPatternAttr(y.bgcolor,t.i,null),A=b.getPatternAttr(y.fgcolor,t.i,null),L=y.fgopacity,S=b.getPatternAttr(y.size,t.i,8),E=b.getPatternAttr(y.solidity,t.i,.3),C=t.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),O=r.uid;C&&(O+="-"+t.i),b.pattern(e,"point",i,O,x,S,E,t.mcc,y.fillmode,T,A,L)}else u.fill(e,f);d&&u.stroke(e,h)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,f=s.opacity,h=void 0!==c,d=void 0!==f;(a.isArrayOrTypedArray(u)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?f:g*e});var p=i.color,v=o.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?v||e:m||e});var y=i.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,g))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(b.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};u=a.texttemplateString(u,f,l._d3locale,d,t,p)}var g=t.tp||e.textposition,v=E(t,e),m=i?i(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,v,m).text(u).call(h.convertToTspans,r).call(S,g,v,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=E(t,e);u.fill(a,i),S(a,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},D=0),r&&(b.savedBBoxes[r]=v),D++,a.extendFlat({},v)},b.setClipUrl=function(t,e,r){t.attr("clip-path",I(e,r))},b.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(e,r)).trim(),t[a]("transform",i),i},b.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var z=/\s*sc.*/;b.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(z,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var N=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(N);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":454,"../../constants/alignment":523,"../../constants/interactions":529,"../../constants/xmlns_namespaces":531,"../../lib":551,"../../lib/svg_text_utils":576,"../../registry":649,"../../traces/scatter/make_bubble_size_func":695,"../../traces/scatter/subtypes":703,"../color":418,"../colorscale":430,"./symbol_defs":441,"@plotly/d3":17,"fast-isnumeric":97,tinycolor2:366}],441:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":17}],442:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],443:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(d.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(d.copy_ystyle?p:d).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":703,"../drawing":440,"@plotly/d3":17,"fast-isnumeric":97}],448:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":418,"@plotly/d3":17}],449:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":544,"../../plots/font_attributes":629,"./layout_attributes":459}],450:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||it<0||it>_[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+x[0]._offset,e.pointerY=it+_[0]._offset,F="xval"in e?m.flat(s,e.xval):m.p2c(x,at),H="yval"in e?m.flat(s,e.yval):m.p2c(_,it),!a(F[0])||!a(H[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(Y=0;Y$&&(tt.splice(0,$),ut=tt[0].distance),g&&0!==D&&0===tt.length){Q.distance=D,Q.index=!1;var f=q._module.hoverPoints(Q,J,K,"closest",{hoverLayer:l._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=D}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(h=ht(v),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(h=ht(b),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Mt-1;kt--)Ct(tt[kt]);tt=Lt,vt()}var Ot=t._hoverdata,Rt=[],Dt=B(t),Pt=U(t);for(V=0;V1||tt.length>1)||"closest"===L&&nt&&tt.length>1,Wt=d.combine(l.plot_bgcolor||d.background,l.paper_bgcolor),Xt=R(tt,{gd:t,hovermode:L,rotateLabels:qt,bgColor:Wt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});m.isUnifiedHover(L)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?M:1)/2,pmin:0,pmax:a?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",l),P(Xt,qt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Zt=v.getComponentMethod("annotations","hasClickToShow")(t,Rt);f(n.select(e.target),Zt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Ot))return;Ot&&t.emit("plotly_unhover",{event:e,points:Ot});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:_,xvals:F,yvals:H})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=B(a),o=U(a),s=R(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),g=t.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;c+=y,f+=y,h+=b,p+=b}u.bbox={x0:c+o,x1:f+o,y0:h+i,y1:p+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||d.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,w=e.commonLabelOpts||{},M=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,A=t[0],S=A.xa,E=A.ya,O=i.charAt(0),R=A[O+"Label"],P=g.getBoundingClientRect(),I=P.top,z=P.width,N=P.height,F=void 0!==R&&A.distance<=e.hoverdistance&&("x"===i||"y"===i);if(F){var j,B,U=!0;for(j=0;ja.width-x?(v=a.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*L+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(L+y.width/2)+"v"+b+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,C,O;"right"===E.side?(_="start",C=1,O="",v=S._offset+S._length):(_="end",C=-1,O="-",v=S._offset),m=E._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+O+k+","+k+"V"+(L+y.height/2)+"h"+O+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+O+k+"V-"+k+"Z");var D,P=y.height/2,z=I-y.top-P,N="clip"+a._uid+"commonlabel"+E._id;if(v=0?nt:at+st=0?at:gt+st=0?et:rt+lt=0?rt:vt+lt=0,"top"!==t.idealAlign&&O||!P?O?(U+=V/2,t.anchor="start"):t.anchor="middle":(U-=V/2,t.anchor="end");else if(t.pos=U,O=B+H/2+Y<=z,P=B-H/2-Y>=0,"left"!==t.idealAlign&&O||!P)if(O)B+=H/2,t.anchor="start";else{t.anchor="middle";var G=Y/2,q=B+G-z,W=B-G;q>0&&(B-=q),W<0&&(B+=-W)}else B-=H/2,t.anchor="end";w.attr("text-anchor",t.anchor),S&&A.attr("text-anchor",t.anchor),e.attr("transform",s(B,U)+(u?l(_):""))})),mt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=F(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=F(r,t.nameLength),""}))}return[l,s]}function P(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],f=u*(k+L),d=f+u*(t.txwidth+L),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,d+=t.txwidth/2+L),e&&(g*=-A,p=t.offset*T),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*k+p)+","+o(k+g)+"v"+o(t.by/2-k)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*k+p)+"V"+o(g-k)+"Z");var m=p+f,y=g+t.ty0-t.by/2+L,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+L:-t.bx-L):"right"===b&&"end"!==s&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-L:t.bx+L)),a.call(c.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(c.positionText,i(d+u*L+p),o(g+t.ty0-t.by/2+L)),r.select("rect").call(h.setRect,i(d+(u-1)*t.tx2width/2+p),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function I(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function z(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,p)<1.5?d.contrast(p):y.color,w=a.spikemode,M=a.spikethickness,T=a.spikecolor||_,A=g.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=A,x=v),-1!==w.indexOf("across")){var k=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(k=Math.min(k,a.position),L=Math.max(L,a.position)),b=l.l+k*l.w,x=l.l+L*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var S,E,C=e.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(S=u.pointerX,E=u.pointerY):(S=n._offset+C.x,E=a._offset+C.y);var O,R,D=i.readability(C.color,p)<1.5?d.contrast(p):C.color,P=n.spikemode,I=n.spikethickness,z=n.spikecolor||D,N=g.getPxPosition(t,n);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(O=N,R=E),-1!==P.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),O=l.t+(1-j)*l.h,R=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I,stroke:z,"stroke-dasharray":h.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function N(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function F(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function j(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}},{"../../lib":551,"../../lib/events":543,"../../lib/override_cursor":562,"../../lib/svg_text_utils":576,"../../plots/cartesian/axes":600,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"../legend/defaults":470,"../legend/draw":471,"./constants":452,"./helpers":454,"@plotly/d3":17,"fast-isnumeric":97,tinycolor2:366}],456:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":551,"../color":418,"./helpers":454}],457:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":551,"./layout_attributes":459}],458:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":551,"../dragelement":437,"./attributes":449,"./calc":450,"./click":451,"./constants":452,"./defaults":453,"./helpers":454,"./hover":455,"./layout_attributes":459,"./layout_defaults":460,"./layout_global_defaults":461,"@plotly/d3":17}],459:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":629,"./constants":452}],460:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":551,"./hoverlabel_defaults":456,"./hovermode_defaults":457,"./layout_attributes":459}],461:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":551,"./hoverlabel_defaults":456,"./layout_attributes":459}],462:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),f=c*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===T("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===T("roworder"),w=h?.2:.1,M=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",T,w,b,y),y:c("y",T,M,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(M("uirevision",e.uirevision),!1!==g){M("bgcolor",e.paper_bgcolor),M("bordercolor"),M("borderwidth");var m,y,b,x=a.coerceFont(M,"font",e.font),_="h"===M("orientation");if(_?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),M("traceorder",h),l.isGrouped(e.legend)&&M("tracegroupgap"),M("itemsizing"),M("itemwidth"),M("itemclick"),M("itemdoubleclick"),M("groupclick"),M("x",m),M("xanchor"),M("y",y),M("yanchor",b),M("valign"),a.noneOrAll(u,v,["x","y"]),M("title.text")){M("title.side",_?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(M,"title.font",w)}}}function M(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":551,"../../plot_api/plot_template":589,"../../plots/layout_attributes":644,"../../registry":649,"./attributes":468,"./helpers":474}],471:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(u.font,i).text(h?M(n,p):n);var v=r.itemwidth+2*d.itemGap;f.positionText(g,v,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(M(n,p)).call(A,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),f=c[c.length-1],h=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):A(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function A(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,p=s.size*g;if(o){var v=u.bBox(o);c=v.height,h=v.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(c=p*y,h=b?u.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;a.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=p,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function k(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function L(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var M=a.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),S=a.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),E=a.ensureSingle(M,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));E.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),O=e.title;if(e._titleWidth=0,e._titleHeight=0,O.text){var R=a.ensureSingle(C,"text","legendtitletext");R.attr("text-anchor","start").call(u.font,O.font).text(O.text),A(R,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(M,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),P=C.selectAll("g.groups").data(s);P.enter().append("g").attr("class","groups"),P.exit().remove();var I=P.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(T,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,h=d.itemGap,p=a.itemwidth+2*h,g=2*(c+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v,b=a.tracegroupgap;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+w[0],c+w[1]+a._height+e/2+h),a._height+=e,a._width=Math.max(a._width,t[0].width)})),_=p+a._width,a._width+=h+p+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var M=k(a),T=a.x<0||0===a.x&&"right"===M,A=a.x>1||1===a.x&&"left"===M,S=y||m,E=i.width/2;a._maxWidth=Math.max(T?S&&"left"===M?o.l+o.w:E:A?S&&"right"===M?o.r+o.w:E:o.w,2*p);var C=0,O=0;r.each((function(t){var e=t[0].width+p;C=Math.max(C,e),O+=e})),_=null;var R=0;if(l){var D=0,P=0,I=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,w[0],w[1]+c+h+n/2+e),e+=n,t=Math.max(t,p+r[0].width)})),D=Math.max(D,e);var r=t+h;r+c+P>a._maxWidth&&(R=Math.max(R,P),P=0,I+=D+b,D=e),u.setTranslate(this,P,I),P+=r})),a._width=Math.max(R,P)+c,a._height=I+D+g}else{var z=r.size(),N=O+f+(z-1)*h=a._maxWidth&&(R=Math.max(R,U),j=0,B+=F,a._height+=F,F=0),u.setTranslate(this,w[0]+c+j,w[1]+c+B+e/2+h),U=j+r+h,j+=n,F=Math.max(F,e)})),N?(a._width=j+f,a._height=F+g):(a._width=Math.max(R,U)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(c+d.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(c+d.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,V=H.legendText||H.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?p:_||p+t[0].width;s||(a+=h/2),u.setRect(e,0,-r/2,a,r)}))}(t,P,I,e)},function(){if(p||!function(t){var e=t._fullLayout.legend,r=k(e),n=L(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var s,c,g,y,b=f._size,x=e.borderwidth,w=b.l+b.w*e.x-v[k(e)]*e._width,T=b.t+b.h*(1-e.y)-v[L(e)]*e._effHeight;if(!p&&f.margin.autoexpand){var A=w,O=T;w=a.constrain(w,0,f.width-e._width),T=a.constrain(T,0,f.height-e._effHeight),w!==A&&a.log("Constrain legend.x to make legend fit inside graph"),T!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(p||u.setTranslate(M,w,T),D.on(".drag",null),M.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var R=e._effHeight;p&&(R=e._height),E.attr({width:e._width-x,height:R-x,x:x/2,y:x/2}),u.setTranslate(C,0,0),S.select("rect").attr({width:e._width-2*x,height:R-2*x,x:x,y:x}),u.setClipUrl(C,h,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var P,I,z,N=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-N-2*d.scrollBarMargin,j=e._height-e._effHeight,B=F/j,U=Math.min(e._scrollY||0,j);E.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),S.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(C,h,t),Y(U,N,B),M.on("wheel",(function(){Y(U=a.constrain(e._scrollY+n.event.deltaY/F*j,0,j),N,B),0!==U&&U!==j&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,z=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Y(U=function(t,e,r){var n=(r-e)/B+t;return a.constrain(n,0,j)}(z,P,I),N,B))}));D.call(H);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,z=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,Y(U=function(t,e,r){var n=(e-r)/B+t;return a.constrain(n,0,j)}(z,P,I),N,B))}));C.call(V)}if(t._context.edits.legendPosition)M.classed("cursor-move",!0),l.init({element:M.node(),gd:t,prepFn:function(){var t=u.getTranslate(M);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,a=y+r;u.setTranslate(M,n,a),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),c=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,M,a,e,n)}})}function Y(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(C,0,-r),u.setRect(D,e._width,d.scrollBarMargin+r*a,d.scrollBarWidth,n),S.select("rect").attr("y",x+r)}}],t)}(t,e)}},{"../../constants/alignment":523,"../../lib":551,"../../lib/events":543,"../../lib/svg_text_utils":576,"../../plots/plots":646,"../../registry":649,"../color":418,"../dragelement":437,"../drawing":440,"./constants":469,"./get_legend_data":472,"./handle_click":473,"./helpers":474,"./style":476,"@plotly/d3":17}],472:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],f=!1,h={},d=0,p=0;function g(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),f=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+d;c.push(n),u[n]=[r],d++}}for(r=0;rA&&(T=A)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return y?n:Math.min(a,r)};function M(t,i,o){var c=t[0].trace,f=c.marker||{},h=f.line||{},d=o?c.visible&&c.type===o:a.traceIs(c,"bar"),p=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var d=i.mcc;if(!r._inHover&&"mc"in i){var p=u(f),g=p.mid;void 0===g&&(g=(p.max+p.min)/2),d=s.tryColorscale(f,"")(g)}var m=d||i.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=v(y.size,8,10),A=v(y.solidity,.5,1),k="legend-"+c.uid;a.call(s.pattern,"legend",e,k,b,T,A,d,y.fillmode,x,_,M)}else a.call(l.fill,m);o&&l.stroke(a,i.mlc||h.color)}))}function T(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.size()){var c=(s.marker||{}).line,d=w(h(c.width,o.pts),c,5,2),p=i.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=c.color;var g=i.minExtend(o,{trace:p});f(u,g,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,f=n.select(this),h=u(a),d=h.colorscale,g=h.reversescale;if(d){if(!r){var v=d.length;c=0===o?d[g?v-1:0][1]:1===o?d[g?0:v-1][1]:d[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),c?f.call(l.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,p(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,M(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){M(t,this,"funnel")})).each((function(t){M(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,a,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=u(x),M=_.colorscale,T=_.reversescale,A=c.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),L=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",A+"h"+b+"v6h-"+b+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+x.uid;s.gradient(t,e,r,p(T),M,"fill")}}),f||h){var S=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",A+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),M,"stroke")}})})).each((function(t){var r,a,o=g(t),l=o.anyFill,u=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,v=!h&&!u&&!l&&c.hasText(p);function m(t,e,r,n){var a=i.nestedProperty(p,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||v||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",i.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(d,x)],(a=i.minExtend(p,w)).selectedpoints=null,a.texttemplate=null}var T=n.select(this).select("g.legendpoints"),A=T.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var k=T.selectAll("g.pointtext").data(v?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":551,"../../registry":649,"../../traces/pie/helpers":675,"../../traces/pie/style_one":676,"../../traces/scatter/subtypes":703,"../color":418,"../colorscale/helpers":429,"../drawing":440,"./constants":469,"@plotly/d3":17}],477:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":479}],478:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(O=["toggleHover"],R=["resetViews"]):m?(C=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],R=["resetGeo"]):v?(O=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],R=["resetViewMapbox"]):x?O=["hoverClosestGl2d"]:y?O=["hoverClosestPie"]:T?(O=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):O=["toggleHover"];g&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(T=f,S="y0",A=y,E="y1"):(T=y,S="y1",A=f,E="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===D?J:K,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;$(s)}};function Z(r){if(m(t))D=null;else if(z)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";d(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;P?F("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(V(t)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+a)):(l=function(t){return q(Y(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else P?F("xanchor",r.xanchor=G(b+n)):(F("x0",r.x0=G(u+n)),F("x1",r.x1=G(v+n))),I?F("yanchor",r.yanchor=q(M+a)):(F("y0",r.y0=q(f+a)),F("y1",r.y1=q(y+a)));e.attr("d",_(t,r)),Q(s,r)}function K(n,a){if(N){var i=function(t){return t},o=i,l=i;P?F("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(V(t)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+a)):(l=function(t){return q(Y(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else if(z){if("resize-over-start-point"===D){var c=u+n,h=I?f-a:f+a;F("x0",r.x0=P?c:G(c)),F("y0",r.y0=I?h:q(h))}else if("resize-over-end-point"===D){var d=v+n,p=I?y-a:y+a;F("x1",r.x1=P?d:G(d)),F("y1",r.y1=I?p:q(p))}}else{var m=function(t){return-1!==D.indexOf(t)},x=m("n"),B=m("s"),H=m("w"),W=m("e"),X=x?T+a:T,Z=B?A+a:A,J=H?k+n:k,K=W?L+n:L;I&&(x&&(X=T-a),B&&(Z=A-a)),(!I&&Z-X>10||I&&X-Z>10)&&(F(S,r[S]=I?X:q(X)),F(E,r[E]=I?Z:q(Z))),K-J>10&&(F(C,r[C]=P?J:G(J)),F(O,r[O]=P?K:G(K)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(P||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(P?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=Y(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),P&&I){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(P){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,P,l,e,r,D):!0===l.editable&&P.style("pointer-events",O||u.opacity(L)*k<=.5?"stroke":"all");P.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,v(t)}}(t,P)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),b=t._fullLayout._size;if(m?"domain"===d?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return b.l+b.w*t},y?"domain"===v?s=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return b.t+b.h*(1-t)},"path"===h)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var w=(l+u)/2,M=(c+f)/2,T=Math.abs(w-l),A=Math.abs(M-c),k="A"+T+","+A,L=w+T+","+M;return"M"+L+k+" 0 1,1 "+(w+","+(M-A))+k+" 0 0,1 "+L+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function M(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),A&&!h)&&(T=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===M&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function R(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=s.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return I.call(z),D&&(S?I.on(".opacity",null):(A=0,k=!0,I.text(y).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)}))),I.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),I.classed("js-placeholder",k),M}}},{"../../constants/alignment":523,"../../constants/interactions":529,"../../lib":551,"../../lib/svg_text_utils":576,"../../plots/plots":646,"../../registry":649,"../color":418,"../drawing":440,"@plotly/d3":17,"fast-isnumeric":97}],517:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:u,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plot_api/plot_template":589,"../../plots/font_attributes":629,"../../plots/pad_attributes":645,"../color/attributes":417}],518:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],519:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":551,"../../plots/array_container_defaults":595,"./attributes":517,"./constants":518}],520:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(k,a,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(M,o),c.call(_,o)}))})),c.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,d=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,A=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,L=p,S=v+m;S+k>u&&(S=u-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),T?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:L,y:S,width:A,height:k}),this._hbarXMin=L+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,D=p+g,P=v;D+O>l&&(D=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:P,width:O,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,N=c-.5,F=C?f+O+.5:f+.5,j=h-.5,B=T?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+z).data(T||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",z).append("rect"),T||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,z,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||C){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(V),C&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":551,"../color":418,"../drawing":440,"@plotly/d3":17}],523:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],524:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],525:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],526:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],527:[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]}},{}],528:[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"}},{}],529:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],530:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],531:[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}},{}],532:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],534:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],535:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":558}],536:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),M=t.match(w?b:y);if(!M)return c;var T=M[1],A=M[3]||"1",k=Number(M[5]||1),L=Number(M[7]||0),S=Number(M[9]||0),E=Number(M[11]||0);if(u){if(2===T.length)return c;var C;T=Number(T);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===A.charAt(A.length-1);A=parseInt(A,10),C=O.newDate(T,O.toMonthIndex(T,A,R),k)}else C=O.newDate(T,Number(A),k)}catch(t){return c}return C?(C.toJD()-g)*f+L*h+S*d+E*p:c}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),A-=1;var D=new Date(Date.UTC(2e3,A,k,L,S));return D.setUTCFullYear(T),D.getUTCMonth()!==A||D.getUTCDate()!==k?c:D.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var M=90*f,T=3*h,A=5*d;function k(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var L=/%\d?f/g,S=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(L,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return E[r("%q")(a)]})),_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var O=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),O[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+C(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return C(e,t,n,a)};var R=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+R);return u.setUTCMonth(u.getUTCMonth()+e)+n-R},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,h=o-a,d=u-i,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(h,d,g,t-a,e-i),l(h,d,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=a:h=a,f++}return i}},{"./mod":558}],548:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],551:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=i(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=t("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=t("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=t("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var A=t("./regex");f.counterRegex=A.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var L=t("./dom");function S(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},f.syncOrAsync=function(t,e,r){var n;function a(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var P=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var a;return P.test(n)?a=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var I={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(I,arguments)};var z={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(z,arguments)};var N=/^[:|\|]/;function F(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,v="xother"===s||"yother"===s||d||g||p,m=s;if((d||p)&&(m=m.substring(1)),(g||p)&&(m=m.substring(0,m.length-1)),v){if(void 0===(u=e[m]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var t=j;return j=(69069*j+1)%4294967296,Math.abs(j-t)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(t,e,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(a-u*(r+o),i-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var B=f.getFirefoxVersion(),U=null!==B&&B<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":530,"./anchor_utils":534,"./angles":535,"./array":536,"./clean_number":537,"./clear_responsive":539,"./coerce":540,"./dates":541,"./dom":542,"./extend":544,"./filter_unique":545,"./filter_visible":546,"./geometry2d":547,"./identity":549,"./increment":550,"./is_plain_object":552,"./keyed_container":553,"./localize":554,"./loggers":555,"./make_trace_groups":556,"./matrix":557,"./mod":558,"./nested_property":559,"./noop":560,"./notifier":561,"./preserve_drawing_buffer":564,"./push_unique":565,"./regex":567,"./relative_attr":568,"./relink_private":569,"./search":570,"./sort_object_keys":573,"./stats":574,"./throttle":577,"./to_log_range":578,"@plotly/d3":17,"d3-format":86,"d3-time-format":87,"fast-isnumeric":97}],552:[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).hasOwnProperty("hasOwnProperty")}},{}],553:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":587,"./notifier":561}],556:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":17}],557:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],559:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":530,"./matrix":557}],564:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":97,"is-mobile":281}],565:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-a;void 0===a?(l.push(c),a=c):f>s&&(i=Math.min(i,f),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":536,"fast-isnumeric":97}],575:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":68}],576:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var k=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&k.match(u),C=n.select(t.node().parentNode);if(!C.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return R(),void e();var u=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:O,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",f=s.select("g");f.attr({fill:c,stroke:c});var h=l(f,"width"),d=l(f,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],v=-(r||l(t,"height"))/4;"y"===O[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-h/2,v-d/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?s.attr({x:t.attr("x"),y:v-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?s.attr({x:0,y:v}):s.attr({x:p,y:+t.attr("y")+v-d/2}),g&&g.call(t,u),e(u)}))}))):R(),t}function R(){C.empty()||(O=t.attr("class")+"-math",C.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var L=e.split(m),C=0;C|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var k={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):k[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?e:""}function C(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],578:[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":97}],579:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],580:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],581:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,M,T,A,k,L=Object.keys(r).map(Number).sort(o),S=e.get(),E=S||[],C=c(m,f).get(),O=[],R=-1,D=E.length;for(b=0;bE.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?O.push(_):A?("add"===T&&(T={}),E.splice(_,0,T),C&&C.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===R&&(R=_);else for(x=0;x=0;b--)E.splice(O[b],1),C&&C.splice(O[b],1);if(E.length?S||e.set(E):e.set(null),g)return!1;if(h(v,m),p!==a){var P;if(-1===R)P=L;else{for(D=Math.max(E.length,D),P=[],b=0;b=R);b++)P.push(_);for(b=R;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),O(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in O(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&V(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=d.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function V(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=d.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),p=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(B(e),p=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[I];)I--;var F=D.parts[I],j=D.parts[I-1]+"."+F,U=D.parts.slice(0,I).join("."),H=s(t.layout,U).get(),V=s(l,U).get(),W=D.get();if(void 0!==P){k[R]=P,L[R]="reverse"===F?P:z(W);var Z=f.getLayoutValObject(l,D.parts);if(Z&&Z.impliedEdits&&null!==P)for(var J in Z.impliedEdits)S(o.relativeAttr(R,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(R))if(P){S("autosize",null);var K="height"===R?"width":"height";S(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)S("width",P?null:l.width),S("height",P?null:l.height);else if(j.match(Y))O(j),s(l,U+"._inputRange").set(null);else if(j.match(G)){O(j),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===F){E=H;var $="linear"===V.type&&"log"===P,tt="log"===V.type&&"linear"===P;if($||tt){if(E&&E.range)if(V.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&S(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(U+".range[0]",Math.log(et)/Math.LN10),S(U+".range[1]",Math.log(rt)/Math.LN10)):(S(U+".range[0]",Math.pow(10,et)),S(U+".range[1]",Math.pow(10,rt)))}else S(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,V,P,S),c.getComponentMethod("images","convertCoords")(t,V,P,S)}else S(U+".autorange",!0),S(U+".range",null);s(l,U+"._inputRange").set(null)}else if(F.match(T)){var nt=s(l,R).get(),at=(P||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,S),c.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=x.containerArrayMatch(R);if(it){r=it.array,n=it.index;var ot=it.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(P)?L[R]=null:x.isRemoveVal(P)?L[R]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(A,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=P,delete e[R]}else"reverse"===F?(H.range?H.range.reverse():(S(U+".autorange",!0),H.range=[1,0]),V.autorange?A.calc=!0:A.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===P||"select"===P)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:Z?M.update(A,Z):A.calc=!0,D.set(P))}}for(r in m){x.applyContainerArrayChanges(t,h(i,r),m[r],A,h)||(A.plot=!0)}for(var ut in C){var ct=(E=d.getFromId(t,ut))&&E._constraintGroup;if(ct)for(var ft in A.calc=!0,ct)C[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:L,redoit:k,eventData:v}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,a){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=_.coerceTraceIndices(t,a),s=j(t,o.extendFlat({},e),i),l=s.flags,c=W(t,o.extendFlat({},n)),f=c.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,i,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,c)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&V(d,c.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag),u.add(t,Z,[t,s.undoit,c.undoit,s.traces],Z,[t,s.redoit,c.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&A.push(g);y=A}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,i];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":551,"../plots/attributes":596}],590:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function M(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=M(c,T,c.side),c._mainMirrorPosition=c.mirror&&T?M(c,T,d.OPPOSITE_SIDE[c.side]):null}var A=[],k=[],L=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,C=s.yaxis.domain,O=s.plotgroup;if(y(E,C,L)){var R=O.node(),D=s.bg=o.ensureSingle(O,"rect","bg");R.insertBefore(D.node(),R.childNodes[0]),k.push(a)}else O.select("rect.bg").remove(),L.push([E,C]),S||(A.push(a),k.push(a))}var P,I,z,N,F,j,B,U,H,V,Y,G,q,W=v._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eM?c.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":551,"../plots/attributes":596,"../plots/plots":646,"./plot_config":587,"./plot_schema":588,"./plot_template":589}],592:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var A=o.extendFlat({},h);b?A.width=b:null===e.width&&n(p.width)&&(A.width=p.width),x?A.height=x:null===e.height&&n(p.height)&&(A.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=i.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(T,r,A,k).then(L).then(S).then(E).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":551,"../plots/plots":646,"../snapshot/helpers":653,"../snapshot/svgtoimg":655,"../snapshot/tosvg":657,"../version":731,"./plot_api":586,"fast-isnumeric":97}],593:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&a.push(p("unused",i,m.concat(b.length)));var A,k,L,S,E,C=b.length,O=Array.isArray(T);if(O&&(C=Math.min(C,T.length)),2===x.dimensions)for(k=0;kb[k].length&&a.push(p("unused",i,m.concat(k,b[k].length)));var R=b[k].length;for(A=0;A<(O?Math.min(R,T[k].length):R);A++)L=O?T[k][A]:T,S=y[k][A],E=b[k][A],n.validate(S,L)?E!==S&&E!==+S&&a.push(p("dynamic",i,m.concat(k,A),S,E)):a.push(p("value",i,m.concat(k,A),S))}else a.push(p("array",i,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};u=f}for(var h=e.calendar,d="start"===l,p="end"===l,g=t[r+"period0"],v=i(g,h)||0,m=[],y=[],b=[],x=a.length,_=0;_A;)T=o(T,-u,h);for(;T<=A;)T=o(T,u,h);M=o(T,-u,h)}else{for(T=v+(w=Math.round((A-v)/c))*c;T>A;)T-=c;for(;T<=A;)T+=c;M=T-c}m[_]=d?M:p?T:(M+T)/2,y[_]=M,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":530,"../../lib":551,"fast-isnumeric":97}],598:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],599:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,f=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),u=g(t,e),c=u.min,f=u.max;if(0===c.length||0===f.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,v=f[0].val;for(r=1;r0&&((M=S-s(b)-l(x))>E?T/M>C&&(_=b,w=x,C=T/M):T/S>C&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},C=T/S));if(h===v){var O=h-1,R=h+1;if(k)if(0===h)a=[0,1];else{var D=(h>0?f:c).reduce((function(t,e){return Math.max(t,l(e))}),0),P=h/(1-Math.min(.5,D/S));a=h>0?[0,P]:[P,0]}else a=L?[Math.max(0,O),Math.max(1,R)]:[O,R]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-d(e,b.val,x.val))/(S-s(_)-l(w)),a=[_.val-C*s(_),w.val+C*l(w)];return m&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),E=A(r.vpadminus||r.vpad);if(!M){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=i),i>d&&i-o&&(h=i),i>d&&i=R;n--)O(n);return{min:p,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],f=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function b(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":440,"../../constants/numerical":530,"../../lib":551,"../../registry":649,"./axis_ids":604,"@plotly/d3":17,"fast-isnumeric":97}],600:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,M=g.ONEAVGMONTH,T=g.ONEMINMONTH,A=g.ONEWEEK,k=g.ONEDAY,L=k/2,S=g.ONEHOUR,E=g.ONEMIN,C=g.ONESEC,O=g.MINUS_SIGN,R=g.BADNUM,D={K:"zeroline"},P={K:"gridline",L:"path"},I={K:"tick",L:"path"},z={K:"tick",L:"text"},N=t("../../constants/alignment"),F=N.MID_SHIFT,j=N.CAP_SHIFT,B=N.LINE_SPACING,U=N.OPPOSITE_SIDE,H=e.exports={};H.setConvert=t("./set_convert");var V=t("./axis_autotype"),Y=t("./axis_ids"),G=Y.idSort,q=Y.isLinked;H.id2name=Y.id2name,H.name2id=Y.name2id,H.cleanId=Y.cleanId,H.list=Y.list,H.listIds=Y.listIds,H.getFromId=Y.getFromId,H.getFromTrace=Y.getFromTrace;var W=t("./autorange");H.getAutoRange=W.getAutoRange,H.findExtremes=W.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}H.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},H.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},H.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==H.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=H.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},H.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:H.getFromId(e,r).cleanPos)(t)},H.redrawComponents=function(t,e){e=e||H.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},H.saveRangeInitial=function(t,e){for(var r=H.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=H.tickIncrement(t,"M6","reverse")+1.5*k:i.exactMonths>.8?t=H.tickIncrement(t,"M1","reverse")+15.5*k:t-=L;var l=H.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,u,i)),v=y,0;v<=c;)v=H.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:c-u}},H.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,H.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=H.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dticki&&f=o:d<=o;d=H.tickIncrement(d,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(d=c)break}if(E.length>g||d===C)break;C=d;var O=!1;f&&d!==(0|d)&&(O=!0),E.push({minor:O,value:d})}if(h&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),f=r||c,h=0;f>=y?h=c>=y&&c<=v?c:m:r===x&&f>=_?h=c>=_&&c<=b?c:x:f>=T?h=c>=T&&c<=w?c:M:r===A&&f>=A?h=A:f>=k?h=k:r===L&&f>=L?h=L:r===S&&f>=S&&(h=S),h>=c&&(h=c,s=!0);var d=a+h;if(e.rangebreaks&&h>0){for(var p=0,g=0;g<84;g++){var E=(g+.5)/84;e.maskBreaks(a*(1-E)+E*d)!==R&&p++}(h*=p/84)||(t[n].drop=!0),s&&c>A&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(E,t,t._definedDelta),t.rangebreaks){var D="y"===t._id.charAt(0),P=1;"auto"===t.tickmode&&(P=t.tickfont?t.tickfont.size:12);var I=NaN;for(p=E.length-1;p>-1;p--)if(E[p].drop)E.splice(p,1);else{E[p].value=kt(E[p].value,t);var z=t.c2p(E[p].value);(D?I>z-P:Ic||Fc&&(N.periodX=c),F10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&i<=10||e>=15*k)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=C&&i<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ct(t.exponentformat)&&!ft(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}H.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(i>M)e/=M,t.dtick="M"+ot(e,1,tt);else if(i>k){t.dtick=ot(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=H.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>S?t.dtick=ot(e,S,tt):i>E?t.dtick=ot(e,E,et):i>C?t.dtick=ot(e,C,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):At(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},H.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?at:nt,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},H.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=ht(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||ct(d)&&ft(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":O)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":O)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):At(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=O+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ht(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},H.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return H.hoverLabelText(t,n,r)+" - "+H.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=H.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":O+o:o};var ut=["f","p","n","\u03bc","m","","k","M","G","T"];function ct(t){return"SI"===t||"B"===t}function ft(t){return t>14||t<-15}function ht(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=H.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,O);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":ct(l)&&(t+=ut[u/3+5]));return i?O+t:t}function dt(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==u._dfltTitle[p]&&(n[l]+=vt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,bt(e),n),i.autoMargin(t,xt(e),a),i.autoMargin(t,_t(e),s)})),r.skipTitle||K&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+vt(e);else{var s=Lt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,f,d,p,g=H.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,d="top"===e.side?g-r:g+r):(d=e._offset+e._length/2,f="right"===e.side?g+r:g-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=h.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:p,transform:u,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function Q(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=yt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},H.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},H.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},H.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*j,f+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,f+=3);s&&"top"===u&&(f-=h*(1-j));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(f=-f);return[l?c:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(pt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(pt(e)))}},H.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},H.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,f=i("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,g=h?t.ticklen:0;if(f?g*=-1:c&&(g=0),h&&(d+=g,r)){var v=s.deg2rad(r);d=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},M=0,T=t.side,A=t._id.charAt(0),k=t.tickangle;if("x"===A)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=F:b=-90===k&&"bottom"===T?j:90===k&&"top"===T?F:.5,M=F/2*(k/90)),w.xFn=function(t){return t.dx+m+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===A){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===T||90===k&&"right"===T?j:.5),f){var L=a(k)?+k:0;if(0!==L){var S=s.deg2rad(L);M=Math.abs(Math.sin(S))*j*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*F},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},H.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],gt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),St(e,[I]),i.attr("transform",r.transFn)},H.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&H.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sd||i.leftd||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),d.length&&"x"===c&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=yt(this),o=h.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",f=function(t){return-1!==u.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,s={},c=0;c2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":649,"./constants":607}],605:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*b)||M)for(r=0;rD&&NO&&(O=N);h/=(O-C)/(2*R),C=l.l2r(C),O=l.l2r(O),l.range=l._input.range=L=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function j(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",a+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,a,i)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){R&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),R=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,O)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,i){for(var o,s,l,u,c=!1,f={},h={},d=(i||{}).xaHash,p=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==t||mt||Yt(),vt)o.indexOf("select")>-1&&L(r,a,J,K,e.id,Ot),o.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&mt){var s=g?D:R,u="s"===g||"w"===m?0:1,f=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),p="left",v="middle";if(s.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:v}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,f,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),a=Math.max(0,Math.min(et,pt*r+wt)),i=Math.abs(n-_t),o=Math.abs(a-wt);function s(){Lt="",Mt.r=Mt.l,Mt.t=Mt.b,Et.attr("d","M0,0Z")}if(Mt.l=Math.min(_t,n),Mt.r=Math.max(_t,n),Mt.t=Math.min(wt,a),Mt.b=Math.max(wt,a),rt.isSubplotConstrained)i>O||o>O?(Lt="xy",i/tt>o/et?(o=i*et/tt,wt>a?Mt.t=wt-o:Mt.b=wt+o):(i=o*tt/et,_t>n?Mt.l=_t-i:Mt.r=_t+i),Et.attr("d",G(Mt))):s();else if(nt.isSubplotConstrained)if(i>O||o>O){Lt="xy";var l=Math.min(Mt.l/tt,(et-Mt.b)/et),u=Math.max(Mt.r/tt,(et-Mt.t)/et);Mt.l=l*tt,Mt.r=u*tt,Mt.b=(1-l)*et,Mt.t=(1-u)*et,Et.attr("d",G(Mt))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cg[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":551,"fast-isnumeric":97}],619:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":523}],620:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),M=t("../../plot_api/subroutines").redrawReglTraces,T=t("./constants"),A=T.MINSELECT,k=b.filter,L=b.tester,S=t("./handle_outline").clearSelect,E=t("./helpers"),C=E.p2r,O=E.axValue,R=E.getTransform;function D(t,e,r,n,a,i,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){N(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=B(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function j(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)E._fullLayout._deactivateShape(E);else if(!_){var r=P.clickmode;x.done(gt).then((function(){if(x.clear(gt),2===t){for(ft.remove(),$=0;$-1&&D(e,E,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&E.emit("plotly_selected",void 0);s.click(E,e)})).catch(y.error)}},a.doneFn=function(){pt.remove(),x.done(gt).then((function(){x.clear(gt),a.gd.emit("plotly_selected",et),Q&&a.selectionDefs&&(Q.subtract=ct,a.selectionDefs.push(Q),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&F(a)}},clearSelect:S,clearSelectionsCache:F,selectOnClick:D}},{"../../components/color":418,"../../components/dragelement/helpers":436,"../../components/drawing":440,"../../components/fx":458,"../../components/fx/helpers":454,"../../components/shapes/draw_newshape/display_outlines":506,"../../components/shapes/draw_newshape/helpers":507,"../../components/shapes/draw_newshape/newshapes":508,"../../lib":551,"../../lib/clear_gl_canvases":538,"../../lib/polygon":563,"../../lib/throttle":577,"../../plot_api/subroutines":590,"../../registry":649,"./axis_ids":604,"./constants":607,"./handle_outline":611,"./helpers":612,polybooljs:321}],621:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,f=i.ensureNumber,h=i.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,g=d.BADNUM,v=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),M=t("./constants"),T=M.HOUR_PATTERN,A=M.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function L(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(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],a=t.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function E(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function C(e,r,n){return u(e,r,n||t.calendar)}function O(e){return t._categories[Math.round(e)]}function R(e){if(L(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return g}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function I(t){return s(t)?+t:D(t)}function z(t,e,r){return n.round(r+e*t,2)}function N(t,e,r){return(t-r)/e}var F=function(e){return s(e)?z(e,t._m,t._b):g},j=function(e){return N(e,t._m,t._b)};if(t.rangebreaks){var B="y"===d;F=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);var n=B;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?z(e,t._m2,f):0},j=function(e){var r=t._rangebreaks.length;if(!r)return N(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return N(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?k:f,t.l2p=F,t.p2l=j,t.c2p="log"===t.type?function(t,e){return F(S(t,e))}:F,t.p2c="log"===t.type?function(t){return k(j(t))}:j,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=j,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(j(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=j,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(j(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=R,t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(a=0;ap&&(o[n]=p),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),f="y"===d;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/d[2]:1,M=h?c/d[3]:1,T=f?d[0]:0,A=h?d[1]:0,k=f?d[0]/d[2]*u:0,L=h?d[1]/d[3]*c:0,S=a._offset-k,E=l._offset-L;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,S,E).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},{"../../components/drawing":440,"../../lib":551,"../../registry":649,"./axes":600,"@plotly/d3":17}],626:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var d=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var a=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:c,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":418,"../../../lib":551,"../../../registry":649,"../../get_data":631,"../../subplot_defaults":647,"./axis_defaults":635,"./layout_attributes":638}],638:[function(t,e,r){"use strict";var n=t("./axis_attributes"),a=t("../../domain").attributes,i=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(s(0,0,1),{}),center:i(s(0,0,0),{}),eye:i(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":551,"../../../lib/extend":544,"../../domain":628,"./axis_attributes":634}],639:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function i(){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]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}},{"../../../lib/str2rgbarray":575}],640:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[i[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||a.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var d=n.calcTicks(c,{msUTC:!0}),p=0;p/g," "));l[u]=d,c.tickmode=f}}e.ticks=l;for(u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],a=new Array(n.length),i=0;ir.deltaY?1.1:1/1.1,i=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*i.x,y:n*i.y,z:n*i.z})}a(t)}}),!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,a=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var i=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=a.width*i,l=a.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var u,c=Object.keys(e.traces),h=null,g=e.glplot.selection,v=0;v")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=d.hoverLabelText(e._mockAxis,e._mockAxis.d2l(g.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+T.valueLabel),g.textLabel&&S.push(g.textLabel),_=S.join("
")):_=g.textLabel;var E={x:g.traceCoordinate[0],y:g.traceCoordinate[1],z:g.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:M};p.appendArrayPointValue(E,w,M),t._module.eventData&&(E=w._module.eventData(E,g,w,{},M));var C={points:[E]};if(e.fullSceneLayout.hovermode){var O=[];p.loneHover({trace:w,x:(.5+.5*b[0]/b[3])*s,y:(.5-.5*b[1]/b[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:_,name:h.name,color:p.castHoverOption(w,M,"bgcolor")||h.color,borderColor:p.castHoverOption(w,M,"bordercolor"),fontFamily:p.castHoverOption(w,M,"font.family"),fontSize:p.castHoverOption(w,M,"font.size"),fontColor:p.castHoverOption(w,M,"font.color"),nameLength:p.castHoverOption(w,M,"namelength"),textAlign:p.castHoverOption(w,M,"align"),hovertemplate:f.castOption(w,M,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:O}),E.bbox=O[0]}g.buttons&&g.distance<5?r.emit("plotly_click",C):r.emit("plotly_hover",C),u=C}else p.loneUnhover(n),r.emit("plotly_unhover",u);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,a=0;a<3;a++){var i=T[a],o=i.charAt(0),s=n[i],l=e[o],u=e[o+"calendar"],c=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(c||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pv[1][i])v[0][i]=-1,v[1][i]=1;else{var E=v[1][i]-v[0][i];v[0][i]-=E/32,v[1][i]+=E/32}if("reversed"===s.autorange){var C=v[0][i];v[0][i]=v[1][i],v[1][i]=C}}else{var O=s.range;v[0][i]=s.r2l(O[0]),v[1][i]=s.r2l(O[1])}v[0][i]===v[1][i]&&(v[0][i]-=1,v[1][i]+=1),m[i]=v[1][i]-v[0][i],this.glplot.setBounds(i,{min:v[0][i]*h[i],max:v[1][i]*h[i]})}var R=u.aspectmode;if("cube"===R)p=[1,1,1];else if("manual"===R){var D=u.aspectratio;p=[D.x,D.y,D.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=[1,1,1];for(i=0;i<3;++i){var I=y[l=(s=u[T[i]]).type];P[i]=Math.pow(I.acc,1/I.count)/h[i]}p="data"===R||Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1]}u.aspectratio.x=c.aspectratio.x=p[0],u.aspectratio.y=c.aspectratio.y=p[1],u.aspectratio.z=c.aspectratio.z=p[2],this.glplot.setAspectratio(u.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=u.aspectmode);var z=u.domain||null,N=e._size||null;if(z&&N){var F=this.container.style;F.position="absolute",F.left=N.l+z.x[0]*N.w+"px",F.top=N.t+(1-z.y[1])*N.h+"px",F.width=N.w*(z.x[1]-z.x[0])+"px",F.height=N.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).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]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var a=["up","center","eye"],i=["x","y","z"];return e[a[r]]&&t[a[r]][i[n]]===e[a[r]][i[n]]}var a=!1;if(void 0===r)a=!0;else{for(var i=0;i<3;i++)for(var o=0;o<3;o++)if(!n(e,r,i,o)){a=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(a=!0)}return a},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,a,i,o,s=this.fullLayout,l=this.isCameraChanged(t),u=this.isAspectChanged(t),h=l||u;if(h){var d={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),d[this.id+".camera"]=n),u&&(a=this.glplot.getAspectratio(),o=(i=f.nestedProperty(t,this.id+".aspectratio")).get(),d[this.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,s._preGUI,d),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(u)i.set(a),f.nestedProperty(s,this.id+".aspectratio").set(a),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,i=this.fullSceneLayout.camera,o=i.up.x,s=i.up.y,l=i.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var u=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[u]=h;var p=n.layout;c.call("_storeDirectGUIEdit",p,a._preGUI,d),i.up=h,f.nestedProperty(p,u).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i),function(t,e,r){for(var n=0,a=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[i+l]=Math.min(s*t[i+l],255)}}(i,r,a);var o=document.createElement("canvas");o.width=r,o.height=a;var s,l=o.getContext("2d"),u=l.createImageData(r,a);switch(u.data.set(i),l.putImageData(u,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];d.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":458,"../../lib":551,"../../lib/show_no_webgl_msg":572,"../../lib/str2rgbarray":575,"../../plots/cartesian/axes":600,"../../registry":649,"./layout/convert":636,"./layout/spikes":639,"./layout/tick_marks":640,"./project":641,"gl-plot3d":162,"has-passive-events":272,"webgl-context":381}],643:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var a=new Array(n),i=0;i=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&P.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&P.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||j,H=!(!l._has||!l._has("cartesian"))||B;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:m,size:r.l+p},r:{val:y,size:r.r+p},b:{val:_,size:r.b+p},t:{val:b,size:r.t+p}},d[e]=1}else delete h[e],delete d[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,f=i.r,h=i.t,p=i.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,M=b.size,T=_.val,A=_.size;for(var k in g){if(o(M)&&g[k].r){var L=g[k].r.val,S=g[k].r.size;if(L>w){var E=(M*L+(S-r)*w)/(L-w),O=(S*(1-w)+(M-r)*(1-L))/(L-w);E+O>u+f&&(u=E,f=O)}}if(o(A)&&g[k].t){var R=g[k].t.val,D=g[k].t.size;if(R>T){var P=(A*R+(D-n)*T)/(R-T),I=(D*(1-T)+(A-n)*(1-R))/(R-T);P+I>p+h&&(p=P,h=I)}}}}}var z=c.constrain(r-i.l-i.r,2,64),N=c.constrain(n-i.t-i.b,2,64),F=Math.max(0,r-z),j=Math.max(0,n-N);if(F){var B=(u+f)/F;B>1&&(u/=B,f/=B)}if(j){var U=(p+h)/j;U>1&&(p/=U,h/=U)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(h),a.b=Math.round(p),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var H=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=u(s),a)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=u(l)),i&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(P(o,u,f),a=0;a0){for(var n=[],a=0;a-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(M),M=(M=M.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(M=(M=(M=M.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),M}},{"../components/color":418,"../components/drawing":440,"../constants/xmlns_namespaces":531,"../lib":551,"@plotly/d3":17}],658:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){u[t]=o[t]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../mesh3d/attributes":670}],659:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,a=e.v,i=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,a.length,i.length),s=-1/0,l=1/0,u=0;u=0;o--)(s=((f[[(r=(i=h[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":551}],664:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":551}],665:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll;var c=e.exports=u(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),valuehoverformat:a("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plot_api/edit_types":582,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../mesh3d/attributes":670}],666:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../streamtube/calc").processGrid,i=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=i(e.x,e._len),e._y=i(e.y,e._len),e._z=i(e.z,e._len),e._value=i(e.value,e._len);var r=a(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),a=Math.max(e[r],e[r-1]);if(a>n&&n-1}function z(t,e){return null===t?e:t}function N(e,r,n){C();var a,i,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(t,e){var r=t[0],n=t[1],a=t[2],i=function(t,e,r){for(var n=[],a=0;a-1?n[d]:E(p,g,m);h[d]=b>-1?b:R(p,g,m,z(e,y))}a=h[0],i=h[1],o=h[2],t._meshI.push(a),t._meshJ.push(i),t._meshK.push(o),++v}}function F(t,e,r,n){var a=t[3];an&&(a=n);for(var i=(t[3]-a)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-i)*t[s]+i*e[s];return o}function j(t,e,r){return t>=e&&t<=r}function B(t){var e=.001*(S-L);return t>=L-e&&t<=S+e}function U(e){for(var r=[],n=0;n<4;n++){var a=e[n];r.push([t._x[a],t._y[a],t._z[a],t._value[a]])}return r}function H(t,e,r,n,a,i){i||(i=1),r=[-1,-1,-1];var o=!1,s=[j(e[0][3],n,a),j(e[1][3],n,a),j(e[2][3],n,a)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return B(e[0][3])&&B(e[1][3])&&B(e[2][3])?(N(t,e,r),!0):i<3&&H(t,e,r,L,S,++i)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(i){if(s[i[0]]&&s[i[1]]&&!s[i[2]]){var c=e[i[0]],f=e[i[1]],h=e[i[2]],d=F(h,c,n,a),p=F(h,f,n,a);o=l(t,[p,d,c],[-1,-1,r[i[0]]])||o,o=l(t,[c,f,p],[r[i[0]],r[i[1]],-1])||o,u=!0}})),u||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(i){if(s[i[0]]&&!s[i[1]]&&!s[i[2]]){var c=e[i[0]],f=e[i[1]],h=e[i[2]],d=F(f,c,n,a),p=F(h,c,n,a);o=l(t,[p,d,c],[-1,-1,r[i[0]]])||o,u=!0}})),o}function V(t,e,r,n){var a=!1,i=U(e),o=[j(i[0][3],r,n),j(i[1][3],r,n),j(i[2][3],r,n),j(i[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return a;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(a=function(t,e,r){var n=function(n,a,i){N(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,i,e)||a),a;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var u=i[l[0]],c=i[l[1]],f=i[l[2]],h=i[l[3]];if(g)a=N(t,[u,c,f],[e[l[0]],e[l[1]],e[l[2]]])||a;else{var d=F(h,u,r,n),p=F(h,c,r,n),v=F(h,f,r,n);a=N(null,[d,p,v],[-1,-1,-1])||a}s=!0}})),s?a:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=i[l[0]],c=i[l[1]],f=i[l[2]],h=i[l[3]],d=F(f,u,r,n),p=F(f,c,r,n),v=F(h,c,r,n),m=F(h,u,r,n);g?(a=N(t,[u,m,d],[e[l[0]],-1,-1])||a,a=N(t,[c,p,v],[e[l[1]],-1,-1])||a):a=function(t,e,r){var n=function(n,a,i){N(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(2,3,0)}(null,[d,p,v,m],[-1,-1,-1,-1])||a,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=i[l[0]],c=i[l[1]],f=i[l[2]],h=i[l[3]],d=F(c,u,r,n),p=F(f,u,r,n),v=F(h,u,r,n);g?(a=N(t,[u,d,p],[e[l[0]],-1,-1])||a,a=N(t,[u,p,v],[e[l[0]],-1,-1])||a,a=N(t,[u,v,d],[e[l[0]],-1,-1])||a):a=N(null,[d,p,v],[-1,-1,-1])||a,s=!0}})),a)}function Y(t,e,r,n,a,i,o,s,l,u,c){var f=!1;return p&&(I(t,"A")&&(f=V(null,[e,r,n,i],u,c)||f),I(t,"B")&&(f=V(null,[r,n,a,l],u,c)||f),I(t,"C")&&(f=V(null,[r,i,o,l],u,c)||f),I(t,"D")&&(f=V(null,[n,i,s,l],u,c)||f),I(t,"E")&&(f=V(null,[r,n,i,l],u,c)||f)),g&&(f=V(t,[r,n,i,l],u,c)||f),f}function G(t,e,r,n,a,i,o,s){return[!0===s[0]||H(t,U([e,r,n]),[e,r,n],i,o),!0===s[1]||H(t,U([n,a,e]),[n,a,e],i,o)]}function q(t,e,r,n,a,i,o,s,l){return s?G(t,e,r,a,n,i,o,l):G(t,r,a,n,e,i,o,l)}function W(t,e,r,n,a,i,o){var s,l,u,c,f=!1,h=function(){f=H(t,[s,l,u],[-1,-1,-1],a,i)||f,f=H(t,[u,c,s],[-1,-1,-1],a,i)||f},d=o[0],p=o[1],g=o[2];return d&&(s=D(U([T(e,r-0,n-0)])[0],U([T(e-1,r-0,n-0)])[0],d),l=D(U([T(e,r-0,n-1)])[0],U([T(e-1,r-0,n-1)])[0],d),u=D(U([T(e,r-1,n-1)])[0],U([T(e-1,r-1,n-1)])[0],d),c=D(U([T(e,r-1,n-0)])[0],U([T(e-1,r-1,n-0)])[0],d),h()),p&&(s=D(U([T(e-0,r,n-0)])[0],U([T(e-0,r-1,n-0)])[0],p),l=D(U([T(e-0,r,n-1)])[0],U([T(e-0,r-1,n-1)])[0],p),u=D(U([T(e-1,r,n-1)])[0],U([T(e-1,r-1,n-1)])[0],p),c=D(U([T(e-1,r,n-0)])[0],U([T(e-1,r-1,n-0)])[0],p),h()),g&&(s=D(U([T(e-0,r-0,n)])[0],U([T(e-0,r-0,n-1)])[0],g),l=D(U([T(e-0,r-1,n)])[0],U([T(e-0,r-1,n-1)])[0],g),u=D(U([T(e-1,r-1,n)])[0],U([T(e-1,r-1,n-1)])[0],g),c=D(U([T(e-1,r-0,n)])[0],U([T(e-1,r-0,n-1)])[0],g),h()),f}function X(t,e,r,n,a,i,o,s,l,u,c,f){var h=t;return f?(p&&"even"===t&&(h=null),Y(h,e,r,n,a,i,o,s,l,u,c)):(p&&"odd"===t&&(h=null),Y(h,l,s,o,i,a,n,r,e,u,c))}function Z(t,e,r,n,a){for(var i=[],o=0,s=0;sMath.abs(p-k)?[A,p]:[p,k];$(e,M[0],M[1])}}var E=[[Math.min(L,k),Math.max(L,k)],[Math.min(A,S),Math.max(A,S)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(c.push(d.id),"x"===e?f.push([d.distRatio,0,0]):"y"===e?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);c.length>0&&(r[a]="x"===e?tt(null,c,i,o,f,r[a]):"y"===e?et(null,c,i,o,f,r[a]):rt(null,c,i,o,f,r[a]),a++),u.length>0&&(r[a]="x"===e?Z(null,u,i,o,r[a]):"y"===e?J(null,u,i,o,r[a]):K(null,u,i,o,r[a]),a++)}var p=t.caps[e];p.show&&p.fill&&(P(p.fill),r[a]="x"===e?Z(null,[0,x-1],i,o,r[a]):"y"===e?J(null,[0,_-1],i,o,r[a]):K(null,[0,w-1],i,o,r[a]),a++)}})),0===v&&O(),t._meshX=n,t._meshY=a,t._meshZ=i,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new u(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}}},{"../../components/colorscale":430,"../../lib/gl_format_color":548,"../../lib/str2rgbarray":575,"../../plots/gl3d/zip3":643,"gl-mesh3d":158}],668:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,i){var s=i("isomin"),l=i("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=i("x"),c=i("y"),f=i("z"),h=i("value");u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length?(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),i("valuehoverformat"),["x","y","z"].forEach((function(t){i(t+"hoverformat");var e="caps."+t;i(e+".show")&&i(e+".fill");var r="slices."+t;i(r+".show")&&(i(r+".fill"),i(r+".locations"))})),i("spaceframe.show")&&i("spaceframe.fill"),i("surface.show")&&(i("surface.count"),i("surface.fill"),i("surface.pattern")),i("contour.show")&&(i("contour.color"),i("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){i(t)})),o(t,e,n,i,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,a){s(t,e,r,a,(function(r,a){return n.coerce(t,e,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":428,"../../lib":551,"../../registry":649,"./attributes":665}],669:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":632,"./attributes":665,"./calc":666,"./convert":667,"./defaults":668}],670:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../surface/attributes":717}],671:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":426}],672:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),a=t("delaunay-triangulate"),i=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,c=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function d(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=c(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!v(t.i,f)||!v(t.j,f)||!v(t.k,f))return;n=c(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?i(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],i=e.length,o=0;ol&&C[m].gap;)m--;for(b=C[m].s,g=C.length-1;g>m;g--)C[g].s=b;for(;lk[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],685:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=l(t,e,v,m);if(y||(e.visible=!1),e.visible){u(t,e,v,m),m("xhoverformat"),m("yhoverformat");var b=c(t,e,v,m),x=!b&&y=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-p);return i=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(d.c2p(t.y)-g);return iW!=(j=P[R][1])>=W&&(z=P[R-1][0],N=P[R][0],j-F&&(I=z+(N-z)*(W-F)/(j-F),V=Math.min(V,I),Y=Math.max(Y,I)));V=Math.max(V,0),Y=Math.min(Y,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:Y,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":418,"../../components/fx":458,"../../lib":551,"../../registry":649,"./get_trace_color":688}],690:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":614,"./arrays_to_calcdata":677,"./attributes":678,"./calc":679,"./cross_trace_calc":683,"./cross_trace_defaults":684,"./defaults":685,"./format_labels":687,"./hover":689,"./marker_colorbar":696,"./plot":699,"./select":700,"./style":702,"./subtypes":703}],691:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":428,"../../components/colorscale/helpers":429,"../../lib":551}],692:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,h,d,p,g,v,m,y,b,x,_,w,M,T,A,k,L=e.xaxis,S=e.yaxis,E="log"===L.type,C="log"===S.type,O=L._length,R=S._length,D=e.connectGaps,P=e.baseTolerance,I=e.shape,z="linear"===I,N=e.fill&&"none"!==e.fill,F=[],j=f.minTolerance,B=t.length,U=new Array(B),H=0;function V(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(E&&(i=L.c2p(n.x,!0)),i===a)return!1;C&&l===a&&(i*=Math.abs(L._m*R*(L._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),i*=1e3}if(l===a){if(C&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function Y(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[H-1][0],a=r===U[H-1][1];if(!n||!a)if(H>1){var i=e===U[H-2][0],o=r===U[H-2][1];n&&(e===et||e===rt)&&i?o?H--:U[H-1]=t:a&&(r===nt||r===at)&&o?i?H--:U[H-1]=t:U[H++]=t}else U[H++]=t}function ct(t){U[H-1][0]!==t[0]&&U[H-1][1]!==t[1]&&ut([Z,J]),ut(t),K=null,Z=J=0}function ft(t){if(A=t[0]/O,k=t[1]/R,W=t[0]rt?rt:0,X=t[1]at?at:0,W||X){if(H)if(K){var e=$(K,t);e.length>1&&(ct(e[0]),U[H++]=e[1])}else Q=$(U[H-1],t)[0],U[H++]=Q;else U[H++]=[W||t[0],X||t[1]];var r=U[H-1];W&&X&&(r[0]!==W||r[1]!==X)?(K&&(Z!==W&&J!==X?ut(Z&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||X]):Z&&J&&ut([Z,J])),ut([W,X])):Z-W&&J-X&&ut([W||Z,X||J]),K=t,Z=W,J=X}else K&&ct($(K,t)[0]),U[H++]=t;var n,a,i,o}for("linear"===I||"spline"===I?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&q(o,t)G(p,ht))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}K&&ut([Z||K[0],J||K[1]]),F.push(U.slice(0,H))}return F}},{"../../constants/numerical":530,"../../lib":551,"./constants":682}],693:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],694:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(i=0;i=0?l=d:(l=d=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":97}],696:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],697:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(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")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":418,"../../components/colorscale/defaults":428,"../../components/colorscale/helpers":429,"./subtypes":703}],698:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":530,"../../lib":551}],699:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(p),T=o(M,"g","errorbars"),A=o(M,"g","lines"),k=o(M,"g","points"),L=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,E;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var O,R,D="",P=[],I=_._prevtrace;I&&(D=I._prevRevpath||"",E=I._nextFill,P=I._polygons);var z,N,F,j,B,U,H,V="",Y="",G=[],q=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(z=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):z=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return N(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),l.singleLineStyle(f,a)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(S?(S.datum(f),j&&U&&(C?("y"===C?j[1]=U[1]=x.c2p(0,!0):"x"===C&&(j[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+j+"L"+V.substr(1)).call(l.singleFillStyle)):y(S).attr("d",V+"Z").call(l.singleFillStyle))):E&&("tonext"===_.fill.substr(0,6)&&V&&D?("tonext"===_.fill?y(E).attr("d",V+"Z"+D+"Z").call(l.singleFillStyle):y(E).attr("d",V+"L"+D.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(P)):(Z(E),_._polygons=null)),_._prevRevpath=Y,_._prevPolygons=H):(S?Z(S):E&&Z(E),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),L.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?K:J:_&&!w&&(v=Q),f&&(p=v),h&&(g=v)}var M,T=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(L,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":440,"../../lib":551,"../../lib/polygon":563,"../../registry":649,"./line_points":692,"./link_traces":694,"./subtypes":703,"@plotly/d3":17}],700:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=a.c2l(c);a._lowerLogErrorBound||(a._lowerLogErrorBound=h),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[a(t.x,t.error_x,e[0],r.xaxis),a(t.y,t.error_y,e[1],r.yaxis),a(t.z,t.error_z,e[2],r.zaxis)],i=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,a){var i=null;if(l.isArrayOrTypedArray(t)){i=[];for(var o=0;o=0){var g=function(t,e,r){var n,a=(r+1)%3,i=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],g=0;g<3;++g){var v="projection."+p[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":551,"../../registry":649,"../scatter/line_defaults":691,"../scatter/marker_defaults":697,"../scatter/subtypes":703,"../scatter/text_defaults":704,"./attributes":706}],711:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":528,"../../plots/gl3d":632,"./attributes":706,"./calc":707,"./convert":709,"./defaults":710}],712:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){u[t]=o[t]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},{"../../components/colorscale/attributes":425,"../../lib/extend":544,"../../plots/attributes":596,"../../plots/cartesian/axis_format_attributes":603,"../../plots/template_attributes":648,"../mesh3d/attributes":670}],713:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/colorscale/calc");function i(t){var e,r,a,i,s,l,u,c,f,h,d,p,g=t._x,v=t._y,m=t._z,y=t._len,b=-1/0,x=1/0,_=-1/0,w=1/0,M=-1/0,T=1/0,A="";for(y&&(u=g[0],f=v[0],d=m[0]),y>1&&(c=g[y-1],h=v[y-1],p=m[y-1]),e=0;ec?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var E=function(){y=0,k=[],L=[],S=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,a=t.dataScale,c=e._len,f={};function p(t,e){var n=r[e],o=a[u[e]];return i.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var g=p(e._Xs,"xaxis"),v=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[g,v,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=v[0],b=h(g),x=h(m),_=new Array(b.length*x.length),w=0,M=0;M0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=v(t),n=v(e),a=1,i=0;i_;)r--,r/=m(r),++r1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],i=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,u=1+i+1,c=a(new Float32Array(l*u),[l,u]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(a[t]=!0,e=this.contourStart[t];ei&&(this.minValues[e]=i),this.maxValues[e]a&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),b={},x={},_=0;p?(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),T(v);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],323:[function(t,e,r){(function(t){(function(){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],324:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,a=e-2;a>=0;--a){var i=r,o=t[a];(l=o-((r=i+o)-i))&&(t[--n]=r,r=l)}var s=0;for(a=n;a0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=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],f=e[2]-n[2],d=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+d*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(d));return x>_||-x>_?x:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}function g(t,e,r,n,a,i,o){return function(e,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return a(e,r,s);case 4:return i(e,r,s,l);case 5:return o(e,r,s,l,u)}for(var c=new Array(arguments.length),f=0;f0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],336:[function(t,e,r){"use strict";e.exports=function(t){return a(n(t))};var n=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":45,"reduce-simplicial-complex":321}],337:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,u=e[2*l+1];if(u===i)return l;i>1,u=e[2*l+1];if(u===i)return l;i>1,u=e[2*l+1];if(u===i)return l;i>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=T[0];return v(0,k-1),k-=1,b(0),t}return-1}function w(t,e){var r=T[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((k+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],g(e)),A[r]>=0&&w(A[r],g(r))}}var T=[],A=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var L=_();if(L<0||u[L]>r)break;M(L)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=A[e],a=A[r];n!==a&&C.push([n,a])}})),a.unique(a.normalize(C)),{positions:S,edges:C}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":329,"simplicial-complex":341}],344:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(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=n(s,o,i),u=n(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]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return a;d=f[h]}}if(d.start)if(s){var p=i(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=d.index)}else a=d.index;else d.y!==t[1]&&(a=d.index)}}}return a}},{"./lib/order-segments":344,"binary-search-bounds":42,"functional-red-black-tree":96,"robust-orientation":329}],346:[function(t,e,r){"use strict";var n=t("robust-dot-product"),a=t("robust-sum");function i(t,e){var r=a(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var a=-e/(n-e);a<0?a=0:a>1&&(a=1);for(var i=1-a,o=t.length,s=new Array(o),l=0;l0||a>0&&c<0){var f=o(s,c,l,a);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),a=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(a,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=i(t[t.length-1],e),a=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(a,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":326,"robust-sum":334}],347:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+a+l:"0"===u?h+l+a:l+h+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],348:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=a(t,e),n=r.length,i=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,a,i,o,s,l,u,c,f,h){var d=(o<<0)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==d&&15!==d)switch(d){case 0:c.push([t-.5,e-.5]);break;case 1:c.push([t-.25-.25*(n+r-2*h)/(r-n),e-.25-.25*(a+r-2*h)/(r-a)]);break;case 2:c.push([t-.75-.25*(-n-r+2*h)/(n-r),e-.25-.25*(i+n-2*h)/(n-i)]);break;case 3:c.push([t-.5,e-.5-.5*(a+r+i+n-4*h)/(r-a+n-i)]);break;case 4:c.push([t-.25-.25*(i+a-2*h)/(a-i),e-.75-.25*(-a-r+2*h)/(a-r)]);break;case 5:c.push([t-.5-.5*(n+r+i+a-4*h)/(r-n+a-i),e-.5]);break;case 6:c.push([t-.5-.25*(-n-r+i+a)/(n-r+a-i),e-.5-.25*(-a-r+i+n)/(a-r+n-i)]);break;case 7:c.push([t-.75-.25*(i+a-2*h)/(a-i),e-.75-.25*(i+n-2*h)/(n-i)]);break;case 8:c.push([t-.75-.25*(-i-a+2*h)/(i-a),e-.75-.25*(-i-n+2*h)/(i-n)]);break;case 9:c.push([t-.5-.25*(n+r+-i-a)/(r-n+i-a),e-.5-.25*(a+r+-i-n)/(r-a+i-n)]);break;case 10:c.push([t-.5-.5*(-n-r-i-a+4*h)/(n-r+i-a),e-.5]);break;case 11:c.push([t-.25-.25*(-i-a+2*h)/(i-a),e-.75-.25*(a+r-2*h)/(r-a)]);break;case 12:c.push([t-.5,e-.5-.5*(-a-r-i-n+4*h)/(a-r+i-n)]);break;case 13:c.push([t-.75-.25*(n+r-2*h)/(r-n),e-.25-.25*(-i-n+2*h)/(i-n)]);break;case 14:c.push([t-.25-.25*(-n-r+2*h)/(n-r),e-.25-.25*(-a-r+2*h)/(a-r)]);break;case 15:c.push([t-.5,e-.5])}},cell:function(t,e,r,n,a,i,o,s,l){a?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],a=[];return n(t,r,a,e),{positions:r,cells:a}}},"3d":function(t,e,r){var n=t({order:e,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(t,e,r,n){return t>n|0},vertex:function(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_){var w=(f<<0)+(h<<1)+(d<<2)+(p<<3)+(g<<4)+(v<<5)+(m<<6)+(y<<7)|0;if(0!==w&&255!==w)switch(w>>>7){case 0:!function(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_){switch(t){case 0:x.push([e-.5,r-.5,n-.5]);break;case 1:x.push([e-1/6-1/6*(i+a-2*_)/(a-i),r-1/6-1/6*(o+a-2*_)/(a-o),n-1/6-1/6*(l+a-2*_)/(a-l)]);break;case 2:x.push([e-5/6-1/6*(-i-a+2*_)/(i-a),r-1/6-1/6*(s+i-2*_)/(i-s),n-1/6-1/6*(u+i-2*_)/(i-u)]);break;case 3:x.push([e-.5,r-.25-.25*(o+a+s+i-4*_)/(a-o+i-s),n-.25-.25*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 4:x.push([e-1/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(-o-a+2*_)/(o-a),n-1/6-1/6*(c+o-2*_)/(o-c)]);break;case 5:x.push([e-.25-.25*(i+a+s+o-4*_)/(a-i+o-s),r-.5,n-.25-.25*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 6:x.push([e-.5-1/6*(-i-a+s+o)/(i-a+o-s),r-.5-1/6*(-o-a+s+i)/(o-a+i-s),n-1/6-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 7:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(s+i-2*_)/(i-s),n-.3-.3*(l+a+u+i+c+o-6*_)/(a-l+i-u+o-c)]);break;case 8:x.push([e-5/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(-s-i+2*_)/(s-i),n-1/6-1/6*(f+s-2*_)/(s-f)]);break;case 9:x.push([e-.5-1/6*(i+a+-s-o)/(a-i+s-o),r-.5-1/6*(o+a+-s-i)/(a-o+s-i),n-1/6-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 10:x.push([e-.75-.25*(-i-a-s-o+4*_)/(i-a+s-o),r-.5,n-.25-.25*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 11:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(o+a-2*_)/(a-o),n-.3-.3*(l+a+u+i+f+s-6*_)/(a-l+i-u+s-f)]);break;case 12:x.push([e-.5,r-.75-.25*(-o-a-s-i+4*_)/(o-a+s-i),n-.25-.25*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 13:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.5-.1*(-s-i+2*_)/(s-i),n-.3-.3*(l+a+c+o+f+s-6*_)/(a-l+o-c+s-f)]);break;case 14:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.5-.1*(-o-a+2*_)/(o-a),n-.3-.3*(u+i+c+o+f+s-6*_)/(i-u+o-c+s-f)]);break;case 15:x.push([e-.5,r-.5,n-.5-.5*(l+a+u+i+c+o+f+s-8*_)/(a-l+i-u+o-c+s-f)]);break;case 16:x.push([e-1/6-1/6*(u+l-2*_)/(l-u),r-1/6-1/6*(c+l-2*_)/(l-c),n-5/6-1/6*(-l-a+2*_)/(l-a)]);break;case 17:x.push([e-.25-.25*(i+a+u+l-4*_)/(a-i+l-u),r-.25-.25*(o+a+c+l-4*_)/(a-o+l-c),n-.5]);break;case 18:x.push([e-.5-1/6*(-i-a+u+l)/(i-a+l-u),r-1/6-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(-l-a+u+i)/(l-a+i-u)]);break;case 19:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.3-.3*(o+a+s+i+c+l-6*_)/(a-o+i-s+l-c),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 20:x.push([e-1/6-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(-o-a+c+l)/(o-a+l-c),n-.5-1/6*(-l-a+c+o)/(l-a+o-c)]);break;case 21:x.push([e-.3-.3*(i+a+s+o+u+l-6*_)/(a-i+o-s+l-u),r-.5-.1*(c+l-2*_)/(l-c),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 22:x.push([e-7/18-1/6*(-i-a+s+o+u+l-2*_)/(i-a+o-s+l-u),r-7/18-1/6*(-o-a+s+i+c+l-2*_)/(o-a+i-s+l-c),n-7/18-1/6*(-l-a+u+i+c+o-2*_)/(l-a+i-u+o-c)]);break;case 23:x.push([e-.5-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 24:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 25:x.push([e-.5-3/14*(i+a+-s-o+u+l-2*_)/(a-i+s-o+l-u),r-.5-3/14*(o+a+-s-i+c+l-2*_)/(a-o+s-i+l-c),n-5/14-1/14*(f+s-2*_)/(s-f)]);break;case 26:x.push([e-.5-3/14*(-i-a-s-o+u+l+2*_)/(i-a+s-o+l-u),r-5/14-1/14*(c+l-2*_)/(l-c),n-.5-3/14*(-l-a+u+i+f+s-2*_)/(l-a+i-u+s-f)]);break;case 27:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(o+a+c+l-4*_)/(a-o+l-c),n-.5-1/6*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 28:x.push([e-5/14-1/14*(u+l-2*_)/(l-u),r-.5-3/14*(-o-a-s-i+c+l+2*_)/(o-a+s-i+l-c),n-.5-3/14*(-l-a+c+o+f+s-2*_)/(l-a+o-c+s-f)]);break;case 29:x.push([e-.5-1/6*(i+a+u+l-4*_)/(a-i+l-u),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 30:x.push([e-.375-.125*(-i-a+u+l)/(i-a+l-u),r-.375-.125*(-o-a+c+l)/(o-a+l-c),n-.5-.25*(-l-a+u+i+c+o+f+s-4*_)/(l-a+i-u+o-c+s-f)]);break;case 31:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.5-.1*(c+l-2*_)/(l-c),n-.7-.3*(u+i+c+o+f+s-6*_)/(i-u+o-c+s-f)]);break;case 32:x.push([e-5/6-1/6*(-u-l+2*_)/(u-l),r-1/6-1/6*(f+u-2*_)/(u-f),n-5/6-1/6*(-u-i+2*_)/(u-i)]);break;case 33:x.push([e-.5-1/6*(i+a+-u-l)/(a-i+u-l),r-1/6-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(l+a+-u-i)/(a-l+u-i)]);break;case 34:x.push([e-.75-.25*(-i-a-u-l+4*_)/(i-a+u-l),r-.25-.25*(s+i+f+u-4*_)/(i-s+u-f),n-.5]);break;case 35:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.3-.3*(o+a+s+i+f+u-6*_)/(a-o+i-s+u-f),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 36:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 37:x.push([e-.5-3/14*(i+a+s+o+-u-l-2*_)/(a-i+o-s+u-l),r-5/14-1/14*(f+u-2*_)/(u-f),n-.5-3/14*(l+a+-u-i+c+o-2*_)/(a-l+u-i+o-c)]);break;case 38:x.push([e-.5-3/14*(-i-a+s+o+-u-l+2*_)/(i-a+o-s+u-l),r-.5-3/14*(-o-a+s+i+f+u-2*_)/(o-a+i-s+u-f),n-5/14-1/14*(c+o-2*_)/(o-c)]);break;case 39:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(s+i+f+u-4*_)/(i-s+u-f),n-.5-1/6*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 40:x.push([e-5/6-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(-s-i+f+u)/(s-i+u-f),n-.5-1/6*(-u-i+f+s)/(u-i+s-f)]);break;case 41:x.push([e-11/18-1/6*(i+a+-s-o-u-l+2*_)/(a-i+s-o+u-l),r-7/18-1/6*(o+a+-s-i+f+u-2*_)/(a-o+s-i+u-f),n-7/18-1/6*(l+a+-u-i+f+s-2*_)/(a-l+u-i+s-f)]);break;case 42:x.push([e-.7-.3*(-i-a-s-o-u-l+6*_)/(i-a+s-o+u-l),r-.5-.1*(f+u-2*_)/(u-f),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 43:x.push([e-.5-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 44:x.push([e-9/14-1/14*(-u-l+2*_)/(u-l),r-.5-3/14*(-o-a-s-i+f+u+2*_)/(o-a+s-i+u-f),n-.5-3/14*(-u-i+c+o+f+s-2*_)/(u-i+o-c+s-f)]);break;case 45:x.push([e-.625-.125*(i+a+-u-l)/(a-i+u-l),r-.375-.125*(-s-i+f+u)/(s-i+u-f),n-.5-.25*(l+a+-u-i+c+o+f+s-4*_)/(a-l+u-i+o-c+s-f)]);break;case 46:x.push([e-.5-1/6*(-i-a-u-l+4*_)/(i-a+u-l),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 47:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.5-.1*(f+u-2*_)/(u-f),n-.7-.3*(l+a+c+o+f+s-6*_)/(a-l+o-c+s-f)]);break;case 48:x.push([e-.5,r-.25-.25*(c+l+f+u-4*_)/(l-c+u-f),n-.75-.25*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 49:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.3-.3*(o+a+c+l+f+u-6*_)/(a-o+l-c+u-f),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 50:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.3-.3*(s+i+c+l+f+u-6*_)/(i-s+l-c+u-f),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 51:x.push([e-.5,r-.5-.5*(o+a+s+i+c+l+f+u-8*_)/(a-o+i-s+l-c+u-f),n-.5]);break;case 52:x.push([e-5/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(-o-a+c+l+f+u-2*_)/(o-a+l-c+u-f),n-.5-3/14*(-l-a-u-i+c+o+2*_)/(l-a+u-i+o-c)]);break;case 53:x.push([e-.5-1/6*(i+a+s+o-4*_)/(a-i+o-s),r-.5-1/6*(c+l+f+u-4*_)/(l-c+u-f),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 54:x.push([e-.375-.125*(-i-a+s+o)/(i-a+o-s),r-.5-.25*(-o-a+s+i+c+l+f+u-4*_)/(o-a+i-s+l-c+u-f),n-.375-.125*(-l-a+c+o)/(l-a+o-c)]);break;case 55:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(s+i+c+l+f+u-6*_)/(i-s+l-c+u-f),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 56:x.push([e-9/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(-s-i+c+l+f+u-2*_)/(s-i+l-c+u-f),n-.5-3/14*(-l-a-u-i+f+s+2*_)/(l-a+u-i+s-f)]);break;case 57:x.push([e-.625-.125*(i+a+-s-o)/(a-i+s-o),r-.5-.25*(o+a+-s-i+c+l+f+u-4*_)/(a-o+s-i+l-c+u-f),n-.375-.125*(-u-i+f+s)/(u-i+s-f)]);break;case 58:x.push([e-.5-1/6*(-i-a-s-o+4*_)/(i-a+s-o),r-.5-1/6*(c+l+f+u-4*_)/(l-c+u-f),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 59:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(o+a+c+l+f+u-6*_)/(a-o+l-c+u-f),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 60:x.push([e-.5,r-.5-.25*(-o-a-s-i+c+l+f+u)/(o-a+s-i+l-c+u-f),n-.5-.25*(-l-a-u-i+c+o+f+s)/(l-a+u-i+o-c+s-f)]);break;case 61:x.push([e-9/14-1/14*(i+a-2*_)/(a-i),r-.5-3/14*(-s-i+c+l+f+u-2*_)/(s-i+l-c+u-f),n-.5-3/14*(-u-i+c+o+f+s-2*_)/(u-i+o-c+s-f)]);break;case 62:x.push([e-5/14-1/14*(-i-a+2*_)/(i-a),r-.5-3/14*(-o-a+c+l+f+u-2*_)/(o-a+l-c+u-f),n-.5-3/14*(-l-a+c+o+f+s-2*_)/(l-a+o-c+s-f)]);break;case 63:x.push([e-.5,r-.75-.25*(c+l+f+u-4*_)/(l-c+u-f),n-.75-.25*(c+o+f+s-4*_)/(o-c+s-f)]);break;case 64:x.push([e-1/6-1/6*(f+c-2*_)/(c-f),r-5/6-1/6*(-c-l+2*_)/(c-l),n-5/6-1/6*(-c-o+2*_)/(c-o)]);break;case 65:x.push([e-1/6-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(o+a+-c-l)/(a-o+c-l),n-.5-1/6*(l+a+-c-o)/(a-l+c-o)]);break;case 66:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 67:x.push([e-5/14-1/14*(f+c-2*_)/(c-f),r-.5-3/14*(o+a+s+i+-c-l-2*_)/(a-o+i-s+c-l),n-.5-3/14*(l+a+u+i+-c-o-2*_)/(a-l+i-u+c-o)]);break;case 68:x.push([e-.25-.25*(s+o+f+c-4*_)/(o-s+c-f),r-.75-.25*(-o-a-c-l+4*_)/(o-a+c-l),n-.5]);break;case 69:x.push([e-.3-.3*(i+a+s+o+f+c-6*_)/(a-i+o-s+c-f),r-.5-.1*(-c-l+2*_)/(c-l),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 70:x.push([e-.5-3/14*(-i-a+s+o+f+c-2*_)/(i-a+o-s+c-f),r-.5-3/14*(-o-a+s+i+-c-l+2*_)/(o-a+i-s+c-l),n-5/14-1/14*(u+i-2*_)/(i-u)]);break;case 71:x.push([e-.5-1/6*(s+o+f+c-4*_)/(o-s+c-f),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 72:x.push([e-.5-1/6*(-s-o+f+c)/(s-o+c-f),r-5/6-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(-c-o+f+s)/(c-o+s-f)]);break;case 73:x.push([e-7/18-1/6*(i+a+-s-o+f+c-2*_)/(a-i+s-o+c-f),r-11/18-1/6*(o+a+-s-i-c-l+2*_)/(a-o+s-i+c-l),n-7/18-1/6*(l+a+-c-o+f+s-2*_)/(a-l+c-o+s-f)]);break;case 74:x.push([e-.5-3/14*(-i-a-s-o+f+c+2*_)/(i-a+s-o+c-f),r-9/14-1/14*(-c-l+2*_)/(c-l),n-.5-3/14*(u+i+-c-o+f+s-2*_)/(i-u+c-o+s-f)]);break;case 75:x.push([e-.375-.125*(-s-o+f+c)/(s-o+c-f),r-.625-.125*(o+a+-c-l)/(a-o+c-l),n-.5-.25*(l+a+u+i+-c-o+f+s-4*_)/(a-l+i-u+c-o+s-f)]);break;case 76:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.7-.3*(-o-a-s-i-c-l+6*_)/(o-a+s-i+c-l),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 77:x.push([e-.5-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 78:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(-o-a-c-l+4*_)/(o-a+c-l),n-.5-1/6*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 79:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.5-.1*(-c-l+2*_)/(c-l),n-.7-.3*(l+a+u+i+f+s-6*_)/(a-l+i-u+s-f)]);break;case 80:x.push([e-.25-.25*(u+l+f+c-4*_)/(l-u+c-f),r-.5,n-.75-.25*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 81:x.push([e-.3-.3*(i+a+u+l+f+c-6*_)/(a-i+l-u+c-f),r-.5-.1*(o+a-2*_)/(a-o),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 82:x.push([e-.5-3/14*(-i-a+u+l+f+c-2*_)/(i-a+l-u+c-f),r-5/14-1/14*(s+i-2*_)/(i-s),n-.5-3/14*(-l-a+u+i+-c-o+2*_)/(l-a+i-u+c-o)]);break;case 83:x.push([e-.5-1/6*(u+l+f+c-4*_)/(l-u+c-f),r-.5-1/6*(o+a+s+i-4*_)/(a-o+i-s),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 84:x.push([e-.3-.3*(s+o+u+l+f+c-6*_)/(o-s+l-u+c-f),r-.5-.1*(-o-a+2*_)/(o-a),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 85:x.push([e-.5-.5*(i+a+s+o+u+l+f+c-8*_)/(a-i+o-s+l-u+c-f),r-.5,n-.5]);break;case 86:x.push([e-.5-.25*(-i-a+s+o+u+l+f+c-4*_)/(i-a+o-s+l-u+c-f),r-.375-.125*(-o-a+s+i)/(o-a+i-s),n-.375-.125*(-l-a+u+i)/(l-a+i-u)]);break;case 87:x.push([e-.7-.3*(s+o+u+l+f+c-6*_)/(o-s+l-u+c-f),r-.5-.1*(s+i-2*_)/(i-s),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 88:x.push([e-.5-3/14*(-s-o+u+l+f+c-2*_)/(s-o+l-u+c-f),r-9/14-1/14*(-s-i+2*_)/(s-i),n-.5-3/14*(-l-a-c-o+f+s+2*_)/(l-a+c-o+s-f)]);break;case 89:x.push([e-.5-.25*(i+a+-s-o+u+l+f+c-4*_)/(a-i+s-o+l-u+c-f),r-.625-.125*(o+a+-s-i)/(a-o+s-i),n-.375-.125*(-c-o+f+s)/(c-o+s-f)]);break;case 90:x.push([e-.5-.25*(-i-a-s-o+u+l+f+c)/(i-a+s-o+l-u+c-f),r-.5,n-.5-.25*(-l-a+u+i+-c-o+f+s)/(l-a+i-u+c-o+s-f)]);break;case 91:x.push([e-.5-3/14*(-s-o+u+l+f+c-2*_)/(s-o+l-u+c-f),r-9/14-1/14*(o+a-2*_)/(a-o),n-.5-3/14*(u+i+-c-o+f+s-2*_)/(i-u+c-o+s-f)]);break;case 92:x.push([e-.5-1/6*(u+l+f+c-4*_)/(l-u+c-f),r-.5-1/6*(-o-a-s-i+4*_)/(o-a+s-i),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 93:x.push([e-.7-.3*(i+a+u+l+f+c-6*_)/(a-i+l-u+c-f),r-.5-.1*(-s-i+2*_)/(s-i),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 94:x.push([e-.5-3/14*(-i-a+u+l+f+c-2*_)/(i-a+l-u+c-f),r-5/14-1/14*(-o-a+2*_)/(o-a),n-.5-3/14*(-l-a+u+i+f+s-2*_)/(l-a+i-u+s-f)]);break;case 95:x.push([e-.75-.25*(u+l+f+c-4*_)/(l-u+c-f),r-.5,n-.75-.25*(u+i+f+s-4*_)/(i-u+s-f)]);break;case 96:x.push([e-.5-1/6*(-u-l+f+c)/(u-l+c-f),r-.5-1/6*(-c-l+f+u)/(c-l+u-f),n-5/6-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 97:x.push([e-7/18-1/6*(i+a+-u-l+f+c-2*_)/(a-i+u-l+c-f),r-7/18-1/6*(o+a+-c-l+f+u-2*_)/(a-o+c-l+u-f),n-11/18-1/6*(l+a+-u-i-c-o+2*_)/(a-l+u-i+c-o)]);break;case 98:x.push([e-.5-3/14*(-i-a-u-l+f+c+2*_)/(i-a+u-l+c-f),r-.5-3/14*(s+i+-c-l+f+u-2*_)/(i-s+c-l+u-f),n-9/14-1/14*(-c-o+2*_)/(c-o)]);break;case 99:x.push([e-.375-.125*(-u-l+f+c)/(u-l+c-f),r-.5-.25*(o+a+s+i+-c-l+f+u-4*_)/(a-o+i-s+c-l+u-f),n-.625-.125*(l+a+-c-o)/(a-l+c-o)]);break;case 100:x.push([e-.5-3/14*(s+o+-u-l+f+c-2*_)/(o-s+u-l+c-f),r-.5-3/14*(-o-a-c-l+f+u+2*_)/(o-a+c-l+u-f),n-9/14-1/14*(-u-i+2*_)/(u-i)]);break;case 101:x.push([e-.5-.25*(i+a+s+o+-u-l+f+c-4*_)/(a-i+o-s+u-l+c-f),r-.375-.125*(-c-l+f+u)/(c-l+u-f),n-.625-.125*(l+a+-u-i)/(a-l+u-i)]);break;case 102:x.push([e-.5-.25*(-i-a+s+o+-u-l+f+c)/(i-a+o-s+u-l+c-f),r-.5-.25*(-o-a+s+i+-c-l+f+u)/(o-a+i-s+c-l+u-f),n-.5]);break;case 103:x.push([e-.5-3/14*(s+o+-u-l+f+c-2*_)/(o-s+u-l+c-f),r-.5-3/14*(s+i+-c-l+f+u-2*_)/(i-s+c-l+u-f),n-9/14-1/14*(l+a-2*_)/(a-l)]);break;case 104:x.push([e-11/18-1/6*(-s-o-u-l+f+c+2*_)/(s-o+u-l+c-f),r-11/18-1/6*(-s-i-c-l+f+u+2*_)/(s-i+c-l+u-f),n-11/18-1/6*(-u-i-c-o+f+s+2*_)/(u-i+c-o+s-f)]);break;case 105:x.push([e-.5-1/6*(i+a+-s-o-u-l+f+c)/(a-i+s-o+u-l+c-f),r-.5-1/6*(o+a+-s-i-c-l+f+u)/(a-o+s-i+c-l+u-f),n-.5-1/6*(l+a+-u-i-c-o+f+s)/(a-l+u-i+c-o+s-f)]);break;case 106:x.push([e-.5-.25*(-i-a-s-o-u-l+f+c+4*_)/(i-a+s-o+u-l+c-f),r-.625-.125*(-c-l+f+u)/(c-l+u-f),n-.625-.125*(-c-o+f+s)/(c-o+s-f)]);break;case 107:x.push([e-7/18-1/6*(-s-o-u-l+f+c+2*_)/(s-o+u-l+c-f),r-11/18-1/6*(o+a+-c-l+f+u-2*_)/(a-o+c-l+u-f),n-11/18-1/6*(l+a+-c-o+f+s-2*_)/(a-l+c-o+s-f)]);break;case 108:x.push([e-.625-.125*(-u-l+f+c)/(u-l+c-f),r-.5-.25*(-o-a-s-i-c-l+f+u+4*_)/(o-a+s-i+c-l+u-f),n-.625-.125*(-u-i+f+s)/(u-i+s-f)]);break;case 109:x.push([e-11/18-1/6*(i+a+-u-l+f+c-2*_)/(a-i+u-l+c-f),r-7/18-1/6*(-s-i-c-l+f+u+2*_)/(s-i+c-l+u-f),n-11/18-1/6*(l+a+-u-i+f+s-2*_)/(a-l+u-i+s-f)]);break;case 110:x.push([e-.5-3/14*(-i-a-u-l+f+c+2*_)/(i-a+u-l+c-f),r-.5-3/14*(-o-a-c-l+f+u+2*_)/(o-a+c-l+u-f),n-9/14-1/14*(f+s-2*_)/(s-f)]);break;case 111:x.push([e-.5-1/6*(-u-l+f+c)/(u-l+c-f),r-.5-1/6*(-c-l+f+u)/(c-l+u-f),n-5/6-1/6*(l+a+f+s-4*_)/(a-l+s-f)]);break;case 112:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.5-.1*(f+u-2*_)/(u-f),n-.7-.3*(-l-a-u-i-c-o+6*_)/(l-a+u-i+c-o)]);break;case 113:x.push([e-.5-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 114:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(s+i+f+u-4*_)/(i-s+u-f),n-.5-1/6*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 115:x.push([e-.5-.1*(f+c-2*_)/(c-f),r-.7-.3*(o+a+s+i+f+u-6*_)/(a-o+i-s+u-f),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 116:x.push([e-.5-1/6*(s+o+f+c-4*_)/(o-s+c-f),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 117:x.push([e-.7-.3*(i+a+s+o+f+c-6*_)/(a-i+o-s+c-f),r-.5-.1*(f+u-2*_)/(u-f),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 118:x.push([e-.5-3/14*(-i-a+s+o+f+c-2*_)/(i-a+o-s+c-f),r-.5-3/14*(-o-a+s+i+f+u-2*_)/(o-a+i-s+u-f),n-5/14-1/14*(-l-a+2*_)/(l-a)]);break;case 119:x.push([e-.75-.25*(s+o+f+c-4*_)/(o-s+c-f),r-.75-.25*(s+i+f+u-4*_)/(i-s+u-f),n-.5]);break;case 120:x.push([e-.625-.125*(-s-o+f+c)/(s-o+c-f),r-.625-.125*(-s-i+f+u)/(s-i+u-f),n-.5-.25*(-l-a-u-i-c-o+f+s+4*_)/(l-a+u-i+c-o+s-f)]);break;case 121:x.push([e-11/18-1/6*(i+a+-s-o+f+c-2*_)/(a-i+s-o+c-f),r-11/18-1/6*(o+a+-s-i+f+u-2*_)/(a-o+s-i+u-f),n-7/18-1/6*(-u-i-c-o+f+s+2*_)/(u-i+c-o+s-f)]);break;case 122:x.push([e-.5-3/14*(-i-a-s-o+f+c+2*_)/(i-a+s-o+c-f),r-9/14-1/14*(f+u-2*_)/(u-f),n-.5-3/14*(-l-a-c-o+f+s+2*_)/(l-a+c-o+s-f)]);break;case 123:x.push([e-.5-1/6*(-s-o+f+c)/(s-o+c-f),r-5/6-1/6*(o+a+f+u-4*_)/(a-o+u-f),n-.5-1/6*(-c-o+f+s)/(c-o+s-f)]);break;case 124:x.push([e-9/14-1/14*(f+c-2*_)/(c-f),r-.5-3/14*(-o-a-s-i+f+u+2*_)/(o-a+s-i+u-f),n-.5-3/14*(-l-a-u-i+f+s+2*_)/(l-a+u-i+s-f)]);break;case 125:x.push([e-5/6-1/6*(i+a+f+c-4*_)/(a-i+c-f),r-.5-1/6*(-s-i+f+u)/(s-i+u-f),n-.5-1/6*(-u-i+f+s)/(u-i+s-f)]);break;case 126:x.push([e-.5-1/6*(-i-a+f+c)/(i-a+c-f),r-.5-1/6*(-o-a+f+u)/(o-a+u-f),n-.5-1/6*(-l-a+f+s)/(l-a+s-f)]);break;case 127:x.push([e-5/6-1/6*(f+c-2*_)/(c-f),r-5/6-1/6*(f+u-2*_)/(u-f),n-5/6-1/6*(f+s-2*_)/(s-f)])}}(127&w,t,e,r,n,a,i,o,s,l,u,c,0,0,0,0,0,0,0,0,b,_);break;case 1:!function(t,e,r,n,a,i,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_){switch(t){case 0:x.push([e-5/6-1/6*(-f-c+2*_)/(f-c),r-5/6-1/6*(-f-u+2*_)/(f-u),n-5/6-1/6*(-f-s+2*_)/(f-s)]);break;case 1:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 2:x.push([e-5/6-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(s+i+-f-u)/(i-s+f-u),n-.5-1/6*(u+i+-f-s)/(i-u+f-s)]);break;case 3:x.push([e-9/14-1/14*(-f-c+2*_)/(f-c),r-.5-3/14*(o+a+s+i+-f-u-2*_)/(a-o+i-s+f-u),n-.5-3/14*(l+a+u+i+-f-s-2*_)/(a-l+i-u+f-s)]);break;case 4:x.push([e-.5-1/6*(s+o+-f-c)/(o-s+f-c),r-5/6-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(c+o+-f-s)/(o-c+f-s)]);break;case 5:x.push([e-.5-3/14*(i+a+s+o+-f-c-2*_)/(a-i+o-s+f-c),r-9/14-1/14*(-f-u+2*_)/(f-u),n-.5-3/14*(l+a+c+o+-f-s-2*_)/(a-l+o-c+f-s)]);break;case 6:x.push([e-11/18-1/6*(-i-a+s+o+-f-c+2*_)/(i-a+o-s+f-c),r-11/18-1/6*(-o-a+s+i+-f-u+2*_)/(o-a+i-s+f-u),n-7/18-1/6*(u+i+c+o+-f-s-2*_)/(i-u+o-c+f-s)]);break;case 7:x.push([e-.625-.125*(s+o+-f-c)/(o-s+f-c),r-.625-.125*(s+i+-f-u)/(i-s+f-u),n-.5-.25*(l+a+u+i+c+o+-f-s-4*_)/(a-l+i-u+o-c+f-s)]);break;case 8:x.push([e-.75-.25*(-s-o-f-c+4*_)/(s-o+f-c),r-.75-.25*(-s-i-f-u+4*_)/(s-i+f-u),n-.5]);break;case 9:x.push([e-.5-3/14*(i+a+-s-o-f-c+2*_)/(a-i+s-o+f-c),r-.5-3/14*(o+a+-s-i-f-u+2*_)/(a-o+s-i+f-u),n-5/14-1/14*(l+a-2*_)/(a-l)]);break;case 10:x.push([e-.7-.3*(-i-a-s-o-f-c+6*_)/(i-a+s-o+f-c),r-.5-.1*(-f-u+2*_)/(f-u),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 11:x.push([e-.5-1/6*(-s-o-f-c+4*_)/(s-o+f-c),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 12:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.7-.3*(-o-a-s-i-f-u+6*_)/(o-a+s-i+f-u),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 13:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(-s-i-f-u+4*_)/(s-i+f-u),n-.5-1/6*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 14:x.push([e-.5-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 15:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.5-.1*(-f-u+2*_)/(f-u),n-.7-.3*(l+a+u+i+c+o-6*_)/(a-l+i-u+o-c)]);break;case 16:x.push([e-.5-1/6*(u+l+-f-c)/(l-u+f-c),r-.5-1/6*(c+l+-f-u)/(l-c+f-u),n-5/6-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 17:x.push([e-.5-3/14*(i+a+u+l+-f-c-2*_)/(a-i+l-u+f-c),r-.5-3/14*(o+a+c+l+-f-u-2*_)/(a-o+l-c+f-u),n-9/14-1/14*(-f-s+2*_)/(f-s)]);break;case 18:x.push([e-11/18-1/6*(-i-a+u+l+-f-c+2*_)/(i-a+l-u+f-c),r-7/18-1/6*(s+i+c+l+-f-u-2*_)/(i-s+l-c+f-u),n-11/18-1/6*(-l-a+u+i+-f-s+2*_)/(l-a+i-u+f-s)]);break;case 19:x.push([e-.625-.125*(u+l+-f-c)/(l-u+f-c),r-.5-.25*(o+a+s+i+c+l+-f-u-4*_)/(a-o+i-s+l-c+f-u),n-.625-.125*(u+i+-f-s)/(i-u+f-s)]);break;case 20:x.push([e-7/18-1/6*(s+o+u+l+-f-c-2*_)/(o-s+l-u+f-c),r-11/18-1/6*(-o-a+c+l+-f-u+2*_)/(o-a+l-c+f-u),n-11/18-1/6*(-l-a+c+o+-f-s+2*_)/(l-a+o-c+f-s)]);break;case 21:x.push([e-.5-.25*(i+a+s+o+u+l+-f-c-4*_)/(a-i+o-s+l-u+f-c),r-.625-.125*(c+l+-f-u)/(l-c+f-u),n-.625-.125*(c+o+-f-s)/(o-c+f-s)]);break;case 22:x.push([e-.5-1/6*(-i-a+s+o+u+l+-f-c)/(i-a+o-s+l-u+f-c),r-.5-1/6*(-o-a+s+i+c+l+-f-u)/(o-a+i-s+l-c+f-u),n-.5-1/6*(-l-a+u+i+c+o+-f-s)/(l-a+i-u+o-c+f-s)]);break;case 23:x.push([e-11/18-1/6*(s+o+u+l+-f-c-2*_)/(o-s+l-u+f-c),r-11/18-1/6*(s+i+c+l+-f-u-2*_)/(i-s+l-c+f-u),n-11/18-1/6*(u+i+c+o+-f-s-2*_)/(i-u+o-c+f-s)]);break;case 24:x.push([e-.5-3/14*(-s-o+u+l+-f-c+2*_)/(s-o+l-u+f-c),r-.5-3/14*(-s-i+c+l+-f-u+2*_)/(s-i+l-c+f-u),n-9/14-1/14*(-l-a+2*_)/(l-a)]);break;case 25:x.push([e-.5-.25*(i+a+-s-o+u+l+-f-c)/(a-i+s-o+l-u+f-c),r-.5-.25*(o+a+-s-i+c+l+-f-u)/(a-o+s-i+l-c+f-u),n-.5]);break;case 26:x.push([e-.5-.25*(-i-a-s-o+u+l+-f-c+4*_)/(i-a+s-o+l-u+f-c),r-.375-.125*(c+l+-f-u)/(l-c+f-u),n-.625-.125*(-l-a+u+i)/(l-a+i-u)]);break;case 27:x.push([e-.5-3/14*(-s-o+u+l+-f-c+2*_)/(s-o+l-u+f-c),r-.5-3/14*(o+a+c+l+-f-u-2*_)/(a-o+l-c+f-u),n-9/14-1/14*(u+i-2*_)/(i-u)]);break;case 28:x.push([e-.375-.125*(u+l+-f-c)/(l-u+f-c),r-.5-.25*(-o-a-s-i+c+l+-f-u+4*_)/(o-a+s-i+l-c+f-u),n-.625-.125*(-l-a+c+o)/(l-a+o-c)]);break;case 29:x.push([e-.5-3/14*(i+a+u+l+-f-c-2*_)/(a-i+l-u+f-c),r-.5-3/14*(-s-i+c+l+-f-u+2*_)/(s-i+l-c+f-u),n-9/14-1/14*(c+o-2*_)/(o-c)]);break;case 30:x.push([e-7/18-1/6*(-i-a+u+l+-f-c+2*_)/(i-a+l-u+f-c),r-7/18-1/6*(-o-a+c+l+-f-u+2*_)/(o-a+l-c+f-u),n-11/18-1/6*(-l-a+u+i+c+o-2*_)/(l-a+i-u+o-c)]);break;case 31:x.push([e-.5-1/6*(u+l+-f-c)/(l-u+f-c),r-.5-1/6*(c+l+-f-u)/(l-c+f-u),n-5/6-1/6*(u+i+c+o-4*_)/(i-u+o-c)]);break;case 32:x.push([e-.75-.25*(-u-l-f-c+4*_)/(u-l+f-c),r-.5,n-.75-.25*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 33:x.push([e-.5-3/14*(i+a+-u-l-f-c+2*_)/(a-i+u-l+f-c),r-5/14-1/14*(o+a-2*_)/(a-o),n-.5-3/14*(l+a+-u-i-f-s+2*_)/(a-l+u-i+f-s)]);break;case 34:x.push([e-.7-.3*(-i-a-u-l-f-c+6*_)/(i-a+u-l+f-c),r-.5-.1*(s+i-2*_)/(i-s),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 35:x.push([e-.5-1/6*(-u-l-f-c+4*_)/(u-l+f-c),r-.5-1/6*(o+a+s+i-4*_)/(a-o+i-s),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 36:x.push([e-.5-3/14*(s+o+-u-l-f-c+2*_)/(o-s+u-l+f-c),r-9/14-1/14*(-o-a+2*_)/(o-a),n-.5-3/14*(-u-i+c+o+-f-s+2*_)/(u-i+o-c+f-s)]);break;case 37:x.push([e-.5-.25*(i+a+s+o+-u-l-f-c)/(a-i+o-s+u-l+f-c),r-.5,n-.5-.25*(l+a+-u-i+c+o+-f-s)/(a-l+u-i+o-c+f-s)]);break;case 38:x.push([e-.5-.25*(-i-a+s+o+-u-l-f-c+4*_)/(i-a+o-s+u-l+f-c),r-.625-.125*(-o-a+s+i)/(o-a+i-s),n-.375-.125*(c+o+-f-s)/(o-c+f-s)]);break;case 39:x.push([e-.5-3/14*(s+o+-u-l-f-c+2*_)/(o-s+u-l+f-c),r-9/14-1/14*(s+i-2*_)/(i-s),n-.5-3/14*(l+a+c+o+-f-s-2*_)/(a-l+o-c+f-s)]);break;case 40:x.push([e-.7-.3*(-s-o-u-l-f-c+6*_)/(s-o+u-l+f-c),r-.5-.1*(-s-i+2*_)/(s-i),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 41:x.push([e-.5-.25*(i+a+-s-o-u-l-f-c+4*_)/(a-i+s-o+u-l+f-c),r-.375-.125*(o+a+-s-i)/(a-o+s-i),n-.375-.125*(l+a+-u-i)/(a-l+u-i)]);break;case 42:x.push([e-.5-.5*(-i-a-s-o-u-l-f-c+8*_)/(i-a+s-o+u-l+f-c),r-.5,n-.5]);break;case 43:x.push([e-.3-.3*(-s-o-u-l-f-c+6*_)/(s-o+u-l+f-c),r-.5-.1*(o+a-2*_)/(a-o),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 44:x.push([e-.5-1/6*(-u-l-f-c+4*_)/(u-l+f-c),r-.5-1/6*(-o-a-s-i+4*_)/(o-a+s-i),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 45:x.push([e-.5-3/14*(i+a+-u-l-f-c+2*_)/(a-i+u-l+f-c),r-5/14-1/14*(-s-i+2*_)/(s-i),n-.5-3/14*(l+a+-u-i+c+o-2*_)/(a-l+u-i+o-c)]);break;case 46:x.push([e-.3-.3*(-i-a-u-l-f-c+6*_)/(i-a+u-l+f-c),r-.5-.1*(-o-a+2*_)/(o-a),n-.5-.1*(c+o-2*_)/(o-c)]);break;case 47:x.push([e-.25-.25*(-u-l-f-c+4*_)/(u-l+f-c),r-.5,n-.75-.25*(l+a+c+o-4*_)/(a-l+o-c)]);break;case 48:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.5-.1*(c+l-2*_)/(l-c),n-.7-.3*(-l-a-u-i-f-s+6*_)/(l-a+u-i+f-s)]);break;case 49:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(o+a+c+l-4*_)/(a-o+l-c),n-.5-1/6*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 50:x.push([e-.5-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 51:x.push([e-.5-.1*(-f-c+2*_)/(f-c),r-.7-.3*(o+a+s+i+c+l-6*_)/(a-o+i-s+l-c),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 52:x.push([e-.375-.125*(s+o+-f-c)/(o-s+f-c),r-.625-.125*(-o-a+c+l)/(o-a+l-c),n-.5-.25*(-l-a-u-i+c+o+-f-s+4*_)/(l-a+u-i+o-c+f-s)]);break;case 53:x.push([e-.5-3/14*(i+a+s+o+-f-c-2*_)/(a-i+o-s+f-c),r-9/14-1/14*(c+l-2*_)/(l-c),n-.5-3/14*(-u-i+c+o+-f-s+2*_)/(u-i+o-c+f-s)]);break;case 54:x.push([e-7/18-1/6*(-i-a+s+o+-f-c+2*_)/(i-a+o-s+f-c),r-11/18-1/6*(-o-a+s+i+c+l-2*_)/(o-a+i-s+l-c),n-7/18-1/6*(-l-a+c+o+-f-s+2*_)/(l-a+o-c+f-s)]);break;case 55:x.push([e-.5-1/6*(s+o+-f-c)/(o-s+f-c),r-5/6-1/6*(s+i+c+l-4*_)/(i-s+l-c),n-.5-1/6*(c+o+-f-s)/(o-c+f-s)]);break;case 56:x.push([e-.5-1/6*(-s-o-f-c+4*_)/(s-o+f-c),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 57:x.push([e-.5-3/14*(i+a+-s-o-f-c+2*_)/(a-i+s-o+f-c),r-.5-3/14*(o+a+-s-i+c+l-2*_)/(a-o+s-i+l-c),n-5/14-1/14*(-u-i+2*_)/(u-i)]);break;case 58:x.push([e-.3-.3*(-i-a-s-o-f-c+6*_)/(i-a+s-o+f-c),r-.5-.1*(c+l-2*_)/(l-c),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 59:x.push([e-.25-.25*(-s-o-f-c+4*_)/(s-o+f-c),r-.75-.25*(o+a+c+l-4*_)/(a-o+l-c),n-.5]);break;case 60:x.push([e-5/14-1/14*(-f-c+2*_)/(f-c),r-.5-3/14*(-o-a-s-i+c+l+2*_)/(o-a+s-i+l-c),n-.5-3/14*(-l-a-u-i+c+o+2*_)/(l-a+u-i+o-c)]);break;case 61:x.push([e-.5-1/6*(i+a+-f-c)/(a-i+f-c),r-.5-1/6*(-s-i+c+l)/(s-i+l-c),n-.5-1/6*(-u-i+c+o)/(u-i+o-c)]);break;case 62:x.push([e-1/6-1/6*(-i-a-f-c+4*_)/(i-a+f-c),r-.5-1/6*(-o-a+c+l)/(o-a+l-c),n-.5-1/6*(-l-a+c+o)/(l-a+o-c)]);break;case 63:x.push([e-1/6-1/6*(-f-c+2*_)/(f-c),r-5/6-1/6*(c+l-2*_)/(l-c),n-5/6-1/6*(c+o-2*_)/(o-c)]);break;case 64:x.push([e-.5,r-.75-.25*(-c-l-f-u+4*_)/(c-l+f-u),n-.75-.25*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 65:x.push([e-5/14-1/14*(i+a-2*_)/(a-i),r-.5-3/14*(o+a+-c-l-f-u+2*_)/(a-o+c-l+f-u),n-.5-3/14*(l+a+-c-o-f-s+2*_)/(a-l+c-o+f-s)]);break;case 66:x.push([e-9/14-1/14*(-i-a+2*_)/(i-a),r-.5-3/14*(s+i+-c-l-f-u+2*_)/(i-s+c-l+f-u),n-.5-3/14*(u+i+-c-o-f-s+2*_)/(i-u+c-o+f-s)]);break;case 67:x.push([e-.5,r-.5-.25*(o+a+s+i+-c-l-f-u)/(a-o+i-s+c-l+f-u),n-.5-.25*(l+a+u+i+-c-o-f-s)/(a-l+i-u+c-o+f-s)]);break;case 68:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(-o-a-c-l-f-u+6*_)/(o-a+c-l+f-u),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 69:x.push([e-.5-1/6*(i+a+s+o-4*_)/(a-i+o-s),r-.5-1/6*(-c-l-f-u+4*_)/(c-l+f-u),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 70:x.push([e-.625-.125*(-i-a+s+o)/(i-a+o-s),r-.5-.25*(-o-a+s+i+-c-l-f-u+4*_)/(o-a+i-s+c-l+f-u),n-.375-.125*(u+i+-f-s)/(i-u+f-s)]);break;case 71:x.push([e-9/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(s+i+-c-l-f-u+2*_)/(i-s+c-l+f-u),n-.5-3/14*(l+a+u+i+-f-s-2*_)/(a-l+i-u+f-s)]);break;case 72:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(-s-i-c-l-f-u+6*_)/(s-i+c-l+f-u),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 73:x.push([e-.375-.125*(i+a+-s-o)/(a-i+s-o),r-.5-.25*(o+a+-s-i-c-l-f-u+4*_)/(a-o+s-i+c-l+f-u),n-.375-.125*(l+a+-c-o)/(a-l+c-o)]);break;case 74:x.push([e-.5-1/6*(-i-a-s-o+4*_)/(i-a+s-o),r-.5-1/6*(-c-l-f-u+4*_)/(c-l+f-u),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 75:x.push([e-5/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(o+a+-c-l-f-u+2*_)/(a-o+c-l+f-u),n-.5-3/14*(l+a+u+i+-c-o-2*_)/(a-l+i-u+c-o)]);break;case 76:x.push([e-.5,r-.5-.5*(-o-a-s-i-c-l-f-u+8*_)/(o-a+s-i+c-l+f-u),n-.5]);break;case 77:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.3-.3*(-s-i-c-l-f-u+6*_)/(s-i+c-l+f-u),n-.5-.1*(l+a-2*_)/(a-l)]);break;case 78:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.3-.3*(-o-a-c-l-f-u+6*_)/(o-a+c-l+f-u),n-.5-.1*(u+i-2*_)/(i-u)]);break;case 79:x.push([e-.5,r-.25-.25*(-c-l-f-u+4*_)/(c-l+f-u),n-.75-.25*(l+a+u+i-4*_)/(a-l+i-u)]);break;case 80:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.5-.1*(-f-u+2*_)/(f-u),n-.7-.3*(-l-a-c-o-f-s+6*_)/(l-a+c-o+f-s)]);break;case 81:x.push([e-.5-1/6*(i+a+u+l-4*_)/(a-i+l-u),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 82:x.push([e-.625-.125*(-i-a+u+l)/(i-a+l-u),r-.375-.125*(s+i+-f-u)/(i-s+f-u),n-.5-.25*(-l-a+u+i+-c-o-f-s+4*_)/(l-a+i-u+c-o+f-s)]);break;case 83:x.push([e-9/14-1/14*(u+l-2*_)/(l-u),r-.5-3/14*(o+a+s+i+-f-u-2*_)/(a-o+i-s+f-u),n-.5-3/14*(u+i+-c-o-f-s+2*_)/(i-u+c-o+f-s)]);break;case 84:x.push([e-.5-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 85:x.push([e-.7-.3*(i+a+s+o+u+l-6*_)/(a-i+o-s+l-u),r-.5-.1*(-f-u+2*_)/(f-u),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 86:x.push([e-11/18-1/6*(-i-a+s+o+u+l-2*_)/(i-a+o-s+l-u),r-7/18-1/6*(-o-a+s+i+-f-u+2*_)/(o-a+i-s+f-u),n-7/18-1/6*(-l-a+u+i+-f-s+2*_)/(l-a+i-u+f-s)]);break;case 87:x.push([e-5/6-1/6*(s+o+u+l-4*_)/(o-s+l-u),r-.5-1/6*(s+i+-f-u)/(i-s+f-u),n-.5-1/6*(u+i+-f-s)/(i-u+f-s)]);break;case 88:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(-s-i-f-u+4*_)/(s-i+f-u),n-.5-1/6*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 89:x.push([e-.5-3/14*(i+a+-s-o+u+l-2*_)/(a-i+s-o+l-u),r-.5-3/14*(o+a+-s-i-f-u+2*_)/(a-o+s-i+f-u),n-5/14-1/14*(-c-o+2*_)/(c-o)]);break;case 90:x.push([e-.5-3/14*(-i-a-s-o+u+l+2*_)/(i-a+s-o+l-u),r-5/14-1/14*(-f-u+2*_)/(f-u),n-.5-3/14*(-l-a+u+i+-c-o+2*_)/(l-a+i-u+c-o)]);break;case 91:x.push([e-.5-1/6*(-s-o+u+l)/(s-o+l-u),r-.5-1/6*(o+a+-f-u)/(a-o+f-u),n-.5-1/6*(u+i+-c-o)/(i-u+c-o)]);break;case 92:x.push([e-.5-.1*(u+l-2*_)/(l-u),r-.3-.3*(-o-a-s-i-f-u+6*_)/(o-a+s-i+f-u),n-.5-.1*(-l-a+2*_)/(l-a)]);break;case 93:x.push([e-.75-.25*(i+a+u+l-4*_)/(a-i+l-u),r-.25-.25*(-s-i-f-u+4*_)/(s-i+f-u),n-.5]);break;case 94:x.push([e-.5-1/6*(-i-a+u+l)/(i-a+l-u),r-1/6-1/6*(-o-a-f-u+4*_)/(o-a+f-u),n-.5-1/6*(-l-a+u+i)/(l-a+i-u)]);break;case 95:x.push([e-5/6-1/6*(u+l-2*_)/(l-u),r-1/6-1/6*(-f-u+2*_)/(f-u),n-5/6-1/6*(u+i-2*_)/(i-u)]);break;case 96:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.5-.1*(-c-l+2*_)/(c-l),n-.7-.3*(-u-i-c-o-f-s+6*_)/(u-i+c-o+f-s)]);break;case 97:x.push([e-.375-.125*(i+a+-u-l)/(a-i+u-l),r-.375-.125*(o+a+-c-l)/(a-o+c-l),n-.5-.25*(l+a+-u-i-c-o-f-s+4*_)/(a-l+u-i+c-o+f-s)]);break;case 98:x.push([e-.5-1/6*(-i-a-u-l+4*_)/(i-a+u-l),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 99:x.push([e-5/14-1/14*(-u-l+2*_)/(u-l),r-.5-3/14*(o+a+s+i+-c-l-2*_)/(a-o+i-s+c-l),n-.5-3/14*(l+a+-c-o-f-s+2*_)/(a-l+c-o+f-s)]);break;case 100:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(-o-a-c-l+4*_)/(o-a+c-l),n-.5-1/6*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 101:x.push([e-.5-3/14*(i+a+s+o+-u-l-2*_)/(a-i+o-s+u-l),r-5/14-1/14*(-c-l+2*_)/(c-l),n-.5-3/14*(l+a+-u-i-f-s+2*_)/(a-l+u-i+f-s)]);break;case 102:x.push([e-.5-3/14*(-i-a+s+o+-u-l+2*_)/(i-a+o-s+u-l),r-.5-3/14*(-o-a+s+i+-c-l+2*_)/(o-a+i-s+c-l),n-5/14-1/14*(-f-s+2*_)/(f-s)]);break;case 103:x.push([e-.5-1/6*(s+o+-u-l)/(o-s+u-l),r-.5-1/6*(s+i+-c-l)/(i-s+c-l),n-.5-1/6*(l+a+-f-s)/(a-l+f-s)]);break;case 104:x.push([e-.5-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 105:x.push([e-7/18-1/6*(i+a+-s-o-u-l+2*_)/(a-i+s-o+u-l),r-7/18-1/6*(o+a+-s-i-c-l+2*_)/(a-o+s-i+c-l),n-7/18-1/6*(l+a+-u-i-c-o+2*_)/(a-l+u-i+c-o)]);break;case 106:x.push([e-.3-.3*(-i-a-s-o-u-l+6*_)/(i-a+s-o+u-l),r-.5-.1*(-c-l+2*_)/(c-l),n-.5-.1*(-c-o+2*_)/(c-o)]);break;case 107:x.push([e-1/6-1/6*(-s-o-u-l+4*_)/(s-o+u-l),r-.5-1/6*(o+a+-c-l)/(a-o+c-l),n-.5-1/6*(l+a+-c-o)/(a-l+c-o)]);break;case 108:x.push([e-.5-.1*(-u-l+2*_)/(u-l),r-.3-.3*(-o-a-s-i-c-l+6*_)/(o-a+s-i+c-l),n-.5-.1*(-u-i+2*_)/(u-i)]);break;case 109:x.push([e-.5-1/6*(i+a+-u-l)/(a-i+u-l),r-1/6-1/6*(-s-i-c-l+4*_)/(s-i+c-l),n-.5-1/6*(l+a+-u-i)/(a-l+u-i)]);break;case 110:x.push([e-.25-.25*(-i-a-u-l+4*_)/(i-a+u-l),r-.25-.25*(-o-a-c-l+4*_)/(o-a+c-l),n-.5]);break;case 111:x.push([e-1/6-1/6*(-u-l+2*_)/(u-l),r-1/6-1/6*(-c-l+2*_)/(c-l),n-5/6-1/6*(l+a-2*_)/(a-l)]);break;case 112:x.push([e-.5,r-.5,n-.5-.5*(-l-a-u-i-c-o-f-s+8*_)/(l-a+u-i+c-o+f-s)]);break;case 113:x.push([e-.5-.1*(i+a-2*_)/(a-i),r-.5-.1*(o+a-2*_)/(a-o),n-.3-.3*(-u-i-c-o-f-s+6*_)/(u-i+c-o+f-s)]);break;case 114:x.push([e-.5-.1*(-i-a+2*_)/(i-a),r-.5-.1*(s+i-2*_)/(i-s),n-.3-.3*(-l-a-c-o-f-s+6*_)/(l-a+c-o+f-s)]);break;case 115:x.push([e-.5,r-.75-.25*(o+a+s+i-4*_)/(a-o+i-s),n-.25-.25*(-c-o-f-s+4*_)/(c-o+f-s)]);break;case 116:x.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(-o-a+2*_)/(o-a),n-.3-.3*(-l-a-u-i-f-s+6*_)/(l-a+u-i+f-s)]);break;case 117:x.push([e-.75-.25*(i+a+s+o-4*_)/(a-i+o-s),r-.5,n-.25-.25*(-u-i-f-s+4*_)/(u-i+f-s)]);break;case 118:x.push([e-.5-1/6*(-i-a+s+o)/(i-a+o-s),r-.5-1/6*(-o-a+s+i)/(o-a+i-s),n-1/6-1/6*(-l-a-f-s+4*_)/(l-a+f-s)]);break;case 119:x.push([e-5/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(s+i-2*_)/(i-s),n-1/6-1/6*(-f-s+2*_)/(f-s)]);break;case 120:x.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(-s-i+2*_)/(s-i),n-.3-.3*(-l-a-u-i-c-o+6*_)/(l-a+u-i+c-o)]);break;case 121:x.push([e-.5-1/6*(i+a+-s-o)/(a-i+s-o),r-.5-1/6*(o+a+-s-i)/(a-o+s-i),n-1/6-1/6*(-u-i-c-o+4*_)/(u-i+c-o)]);break;case 122:x.push([e-.25-.25*(-i-a-s-o+4*_)/(i-a+s-o),r-.5,n-.25-.25*(-l-a-c-o+4*_)/(l-a+c-o)]);break;case 123:x.push([e-1/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(o+a-2*_)/(a-o),n-1/6-1/6*(-c-o+2*_)/(c-o)]);break;case 124:x.push([e-.5,r-.25-.25*(-o-a-s-i+4*_)/(o-a+s-i),n-.25-.25*(-l-a-u-i+4*_)/(l-a+u-i)]);break;case 125:x.push([e-5/6-1/6*(i+a-2*_)/(a-i),r-1/6-1/6*(-s-i+2*_)/(s-i),n-1/6-1/6*(-u-i+2*_)/(u-i)]);break;case 126:x.push([e-1/6-1/6*(-i-a+2*_)/(i-a),r-1/6-1/6*(-o-a+2*_)/(o-a),n-1/6-1/6*(-l-a+2*_)/(l-a)]);break;case 127:x.push([e-.5,r-.5,n-.5])}}(127&w,t,e,r,n,a,i,o,s,l,u,c,0,0,0,0,0,0,0,0,b,_)}},cell:function(t,e,r,n,a,i,o,s,l,u,c){o?u.push([n,r,t],[t,e,n]):u.push([t,r,n],[n,e,t])}});return function(t,e){var r=[],a=[];return n(t,r,a,e),{positions:r,cells:a}}}};var o={}},{"ndarray-extract-contour":285,"zero-crossings":382}],349:[function(t,e,r){(function(e,n){(function(){var a=t("process/browser.js").nextTick,i=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function u(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new u(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new u(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":315,timers:349}],350:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(L[t])t=L[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:z(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:z(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,g=e.b,a={r:255*C(d,255),g:255*C(p,255),b:255*C(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=P(e.s),u=P(e.v),a=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=P(e.s),c=P(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var d,p,g;return i=E(i),{ok:f,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(I(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(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(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,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(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:P(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var L=u.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"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(L);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function z(t){return R(t)/255}var N,F,B,j=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",B="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+B),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],351:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=i;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*i(r[1],t)}function i(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 function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":301}],352:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||f(r),a=t.radius||1,i=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];o(n,p,r),u(n[0],n[1],n[2])<1e-6?n=f(r):s(n,n),a=u(p[0],p[1],p[2]);var g=l(r,p)/a,v=l(n,p)/a;c=Math.acos(g),i=Math.acos(v)}return a=Math.log(a),new h(t.zoomMin,t.zoomMax,e,r,n,a,i,c)};var n=t("filtered-vector"),a=t("gl-mat4/invert"),i=t("gl-mat4/rotate"),o=t("gl-vec3/cross"),s=t("gl-vec3/normalize"),l=t("gl-vec3/dot");function u(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t){return Math.min(1,Math.max(-1,t))}function f(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),a=[0,0,0];e>Math.max(r,n)?a[2]=1:r>Math.max(e,n)?a[0]=1:a[1]=1;for(var i=0,o=0,l=0;l<3;++l)i+=t[l]*t[l],o+=a[l]*t[l];for(l=0;l<3;++l)a[l]-=o/i*t[l];return s(a,a),a}function h(t,e,r,a,i,o,s,l){this.center=n(r),this.up=n(a),this.right=n(i),this.radius=n([o]),this.angle=n([s,l]),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)}var d=h.prototype;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[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])]},d.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,n=0,a=0,i=0;i<3;++i)a+=e[i]*r[i],n+=e[i]*e[i];var l=Math.sqrt(n),c=0;for(i=0;i<3;++i)r[i]-=e[i]*a/n,c+=r[i]*r[i],e[i]/=l;var f=Math.sqrt(c);for(i=0;i<3;++i)r[i]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,M=b,T=-v*b,A=-m*b,k=y,L=this.computedEye,S=this.computedMatrix;for(i=0;i<3;++i){var E=_*r[i]+w*h[i]+M*e[i];S[4*i+1]=T*r[i]+A*h[i]+k*e[i],S[4*i+2]=E,S[4*i+3]=0}var C=S[1],O=S[5],R=S[9],D=S[2],P=S[6],I=S[10],z=O*I-R*P,N=R*D-C*I,F=C*P-O*D,B=u(z,N,F);z/=B,N/=B,F/=B,S[0]=z,S[4]=N,S[8]=F;for(i=0;i<3;++i)L[i]=x[i]+S[2+4*i]*d;for(i=0;i<3;++i){c=0;for(var j=0;j<3;++j)c+=S[i+4*j]*L[j];S[12+i]=-c}S[15]=1},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};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var a=this.computedMatrix;p[0]=a[2],p[1]=a[6],p[2]=a[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)a[4*u]=o[u],a[4*u+1]=s[u],a[4*u+2]=l[u];i(a,a,n,p);for(u=0;u<3;++u)o[u]=a[4*u],s[u]=a[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=(Math.exp(this.computedRadius[0]),a[1]),o=a[5],s=a[9],l=u(i,o,s);i/=l,o/=l,s/=l;var c=a[0],f=a[4],h=a[8],d=c*i+f*o+h*s,p=u(c-=i*d,f-=o*d,h-=s*d),g=(c/=p)*e+i*r,v=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var i=1;"number"==typeof r&&(i=0|r),(i<0||i>3)&&(i=1);var o=(i+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[i],l=e[i+4],f=e[i+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),g=Math.max(h,d,p);h===g?(s=s<0?-1:1,l=f=0):p===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=u(s,l,f);s/=v,l/=v,f/=v}var m,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,M=u(b-=s*w,x-=l*w,_-=f*w),T=l*(_/=M)-f*(x/=M),A=f*(b/=M)-s*_,k=s*x-l*b,L=u(T,A,k);if(T/=L,A/=L,k/=L,this.center.jump(t,V,G,q),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===i){var S=e[1],E=e[5],C=e[9],O=S*b+E*x+C*_,R=S*T+E*A+C*k;m=z<0?-Math.PI/2:Math.PI/2,y=Math.atan2(R,O)}else{var D=e[2],P=e[6],I=e[10],z=D*s+P*l+I*f,N=D*b+P*x+I*_,F=D*T+P*A+I*k;m=Math.asin(c(z)),y=Math.atan2(F,N)}this.angle.jump(t,y,m),this.recalcMatrix(t);var B=e[2],j=e[6],U=e[10],H=this.computedMatrix;a(H,e);var Y=H[15],V=H[12]/Y,G=H[13]/Y,q=H[14]/Y,W=Math.exp(this.computedRadius[0]);this.center.jump(t,V-B*W,G-j*W,q-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var a=(n=n||this.computedUp)[0],i=n[1],o=n[2],s=u(a,i,o);if(!(s<1e-6)){a/=s,i/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=a*g+i*v+o*m,b=u(g-=y*a,v-=y*i,m-=y*o);if(!(b<.01&&(b=u(g=i*h-o*f,v=o*l-a*h,m=a*f-i*l))<1e-6)){g/=b,v/=b,m/=b,this.up.set(t,a,i,o),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=i*m-o*v,_=o*g-a*m,w=a*v-i*g,M=u(x,_,w),T=a*l+i*f+o*h,A=g*l+v*f+m*h,k=(x/=M)*l+(_/=M)*f+(w/=M)*h,L=Math.asin(c(T)),S=Math.atan2(k,A),E=this.angle._state,C=E[E.length-1],O=E[E.length-2];C%=2*Math.PI;var R=Math.abs(C+2*Math.PI-S),D=Math.abs(C-S),P=Math.abs(C-2*Math.PI-S);R0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function M(t){return s?new BigUint64Array(d(8*t),0,t):null}function T(t){return l?new BigInt64Array(d(8*t),0,t):null}function A(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.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|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return M(t);case"buffer":return k(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=M,r.mallocBigInt64=T,r.mallocDataView=A,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":43,buffer:55,dup:91}],356:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(d=0;d-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(L(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",L())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,h=c>-1?parseInt(r[1+c]):0;f!==h&&(n=n.replace(L(),"?px "),v*=Math.pow(.75,h-f),n=n.replace("?px ",L())),g-=.25*b*(h-f)}if(!0===o.bolds){var d=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!d&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),d&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,p=r.substr(d,c-d).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[i]:a}))},has___:{value:y((function(e){var n=m(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,a){var i,o=m(n);return o?o[r]=a:(i=t.indexOf(n))>=0?e[i]=a:(i=t.length,e[i]=a,t[i]=n),this}))},delete___:{value:y((function(n){var a,i,o=m(n);return o?r in o&&delete o[r]:!((a=t.indexOf(n))<0)&&(i=t.length-1,t[a]=void 0,e[a]=e[i],t[a]=t[i],t.length=i,e.length=i,!0)}))}})};p.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 r?function(){function n(){this instanceof p||b();var e,n=new r,a=void 0,i=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(a||(a=new p),a.set(t,e)),this}:function(t,e){if(i)try{n.set(t,e)}catch(r){a||(a=new p),a.set___(t,e)}else n.set(t,e);return this},Object.create(p.prototype,{get___:{value:y((function(t,e){return a?n.has(t)?n.get(t):a.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!a&&a.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return a&&a.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");i=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=p.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=p)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function v(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function m(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function b(){h||"undefined"==typeof console||(h=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],361:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){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:n(e,t)}}},{"./hidden-store.js":362}],362:[function(t,e,r){e.exports=function(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}},{}],363:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":361}],364:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":97}],365:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-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 a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},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 a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],d=c>>13;u=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(g>>5&15)-1,(31&g)+s);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var d,p=f[i.year-f[0]];for(d=0;d<13;d++){var g=p&1<<12-d?30:29;if(l>13;!v||d=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":379,"object-assign":296}],368:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":379,"object-assign":296}],369:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":379,"object-assign":296}],370:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":379,"object-assign":296}],371:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":379,"object-assign":296}],372:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":379,"object-assign":296}],373:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":379,"object-assign":296}],374:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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),f=t-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":379,"object-assign":296}],376:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":379,"object-assign":296}],377:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":379,"object-assign":296}],378:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":379,"object-assign":296}],379:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":296}],380:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var a=""+e;if(d(t,n))for(;a.length1},b=function(t,r){var n=y(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(A).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(A));return A+=t.length,t}return b("m")},w=function(t,r,n,i){for(var o=y(t,i)?n:r,s=0;s-1){d=1,p=g;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":379,"object-assign":296}],381:[function(t,e,r){"use strict";var n,a=function(){return function(t,e,r,n,a,i){var o=t[0],s=r[0],l=[0],u=s;n|=0;var c=0,f=s;for(c=0;c=0!=d>=0&&a.push(l[0]+.5+.5*(h+d)/(h-d)),n+=f,++l[0]}}};e.exports=(n={funcName:{funcName:"zeroCrossings"}.funcName},function(t){var e={};return function(r,n,a){var i=r.dtype,o=r.order,s=[i,o.join()].join(),l=e[s];return l||(e[s]=l=t([i,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,a)}}(a.bind(void 0,n)))},{}],382:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":381}],383:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],384:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":507,"../../plot_api/plot_template":572,"../../plots/cartesian/constants":590,"../../plots/font_attributes":612,"./arrow_paths":383}],385:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":534,"../../plots/cartesian/axes":583,"./draw":390}],386:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=at.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?at._offset+at._length*Q:J=M.l+M.w*Q):(Q=1-e[et],J=pt?at._offset+at._length*Q:J=M.t+M.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*V(.5,e.xanchor)-st*V(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=M.t+M.h*gt):ft.tail=M.l+M.w*gt:ft.tail=at._offset+at.r2p(gt),K=tt}else ft.tail=J+gt,K=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ct,ft.head+=ct}else K=tt=lt*V($,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)z.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(A-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(c.setClipUrl,U?E:null,t);else{var wt=B+_t-g.top,Mt=B+xt-g.left;G.call(h.positionText,Mt,wt).call(c.setClipUrl,U?E:null,t)}H.select("rect").call(c.setRect,B,B,A,I),j.call(c.setRect,N/2,N/2,F-N,Y-N),z.call(c.setTranslate,Math.round(C.x.text-F/2),Math.round(C.y.text-Y/2)),D.attr({transform:"rotate("+O+","+C.x.text+","+C.y.text+")"});var Tt,At=function(r,n){R.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,d=C.y.tail+n,g=C.x.text+r,x=C.y.text+n,_=o.rotationXYMatrix(O,g,x),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),E=+j.attr("width"),P=+j.attr("height"),I=g-.5*E,N=I+E,F=x-.5*P,B=F+P,U=[[I,F,I,B],[I,B,N,B],[N,B,N,F],[N,F,I,F]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,Y=e.arrowcolor,V=e.arrowside,G=R.append("g").style({opacity:u.opacity(Y)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(u.stroke,u.rgb(Y));if(v(q,V,e),T.annotationPosition&&q.node().parentNode&&!i){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),a=n[0]+t,i=n[1]+r;z.call(c.setTranslate,a,i),L("x",y(m,t,"x",M,e)),L("y",y(b,r,"y",M,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",M,e)),e.ayref===e.yref&&L("ay",y(b,r,"ay",M,e)),G.attr("transform",s(t,r)),D.attr({transform:"rotate("+O+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){Tt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",M,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(b,r,"ay",M.w,e)):L("ay",e.ay+r),At(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",M,e);else{var l=e._xsize/M.w,u=e.x+(e._xshift-e.xshift)/M.w-l/2;a=p.align(u+t/M.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",M,e);else{var c=e._ysize/M.h,f=e.y-(e._yshift+e.yshift)/M.h-c/2;o=p.align(f-r/M.h,c,0,1,e.yanchor)}L("x",a),L("y",o),m&&b||(n=p.getCursor(m?.5:a,b?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+Tt}),d(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===d.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,M=o.y-c.y;if(h=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void P();if(x){if(x*x>w*w+M*M)return void P();var T=x*Math.cos(f),A=x*Math.sin(f);c.x+=T,c.y+=A,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+M*M)return void P();var k=_*Math.cos(f),L=_*Math.sin(f);o.x-=k,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),E="";if(S1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":624,"../annotations/draw":390}],397:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*u.roundUp(Z/J,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(q.tick0=0)}q.dtick=W}q.domain=[Y+j,Y+N-j],q.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var K,Q=t.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+A.cbaxis),tt=0;function et(n,a){var i={propContainer:q,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k)){var t,r=l.l+(e.x+F)*l.w,n=q.title.font.size;t="top"===k?(1-(Y+N-j))*l.h+l.t+3+.75*n:(1-(Y+j))*l.h+l.t-3-.25*n,et(q._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(k)){var i=t.select("."+A.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+q._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*w),h?(tt=d.bBox(h).height)>p&&(f[1]-=(tt-p)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(tt=d.bBox(o.node()).height),tt){if(tt+=5,"top"===k)q.domain[1]-=tt/l.h,f[1]*=-1;else{q.domain[0]+=tt/l.h;var g=v.lineCount(o);f[1]+=(1-g)*p}i.attr("transform",c(f[0],f[1])),q.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",c(0,Math.round(l.h*(1-q.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(R);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var b=L.map(q.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?L[0]:(R[i]+R[i-1])/2,i===R.length-1?L[1]:(R[i]+R[i+1])/2].map(q.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var s=n.select(this).attr({x:U,width:Math.max(P,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)d.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=E(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(m.color&&m.width?D:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(q.c2p(t))+m.width/2%1)+"h"+P).call(d.lineGroupStyle,m.width,S(t),m.dash)})),$.selectAll("g."+q._id+"tick,path").remove();var _=U+P+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),M=s.calcTicks(q),T=s.getTickSigns(q)[2];return s.drawTicks(r,q,{vals:"inside"===q.ticks?s.clipEnds(q,M):M,layer:$,path:s.makeTickPath(q,_,T),transFn:s.makeTransTickFn(q)}),s.drawLabels(r,q,{vals:M,layer:$,transFn:s.makeTransTickLabelFn(q),labelFns:s.makeLabelFns(q,_)})},function(){if(-1===["top","bottom"].indexOf(k)){var t=q.title.font.size,e=q._offset+q._length/2,a=l.l+(q.position||0)*l.w+("right"===q.side?10+t*(q.showticklabels?1:.5):-10-t*(q.showticklabels?.5:0));et("h"+q._id+"title",{avoid:{selection:n.select(r).selectAll("g."+q._id+"tick"),side:k,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=P+e.outlinewidth/2;if(-1===q.ticklabelposition.indexOf("inside")&&(n+=d.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(A.jsPlaceholder)){var a,o=Q.select(".h"+q._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(k)?d.bBox(o).width:d.bBox(Q.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=V-G;t.select("."+A.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:U,y:G+e.ypad+("top"===k?tt:0),width:Math.max(P,2),height:Math.max(u-2*e.ypad-tt,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-f,l.t));var h={},g=M[e.yanchor],v=T[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*g,h.b=u*v):(h.t=h.b=0,h.yt=e.y+e.len*g,h.yb=e.y-e.len*v);var m=M[e.xanchor],y=T[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*m,h.r=s*y;else{var b=s-P;h.l=b*m,h.r=b*y,h.xl=e.x-e.thickness*m,h.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,h)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":506,"../../lib":534,"../../lib/extend":527,"../../lib/setcursor":554,"../../lib/svg_text_utils":559,"../../plots/cartesian/axes":583,"../../plots/cartesian/axis_defaults":585,"../../plots/cartesian/layout_attributes":598,"../../plots/cartesian/position_defaults":601,"../../plots/plots":629,"../../registry":632,"../color":401,"../colorscale/helpers":412,"../dragelement":420,"../drawing":423,"../titles":499,"./constants":403,"@plotly/d3":17,tinycolor2:350}],406:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":534}],407:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":402,"./defaults":404,"./draw":405,"./has_colorbar":406}],408:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var d=i+"auto",p=i+"min",g=i+"max",v=i+"mid",m=(s(h+d),s(h+p),s(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":550,"../../lib/sort_object_keys":556,"../colorbar/attributes":402,"./scales.js":416}],409:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=c._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":534,"./helpers":412,"fast-isnumeric":94}],410:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],418:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":534}],419:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],420:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":534,"../../plots/cartesian/constants":590,"./align":417,"./cursor":418,"./unhover":421,"has-hover":263,"has-passive-events":264,"mouse-event-offset":281}],421:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":525,"../../lib/events":526,"../../lib/throttle":560,"../fx/constants":435}],422:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],423:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),f=a.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};b.font=function(t,e,r,n){a.isPlainObject(e)&&(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(u.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,a){t.call(b.setPosition,e,r).call(b.setSize,n,a)},b.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",f(a,i)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);b.translatePoint(t,a,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";u.stroke(e,n||i.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(u.stroke,r||i.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},b.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(u.fill,e)},b.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(u.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var _=b.symbolNames.length;function w(t,e){var r=t%100;return b.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(t))t=+t;else 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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},A=i("~f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=k[i],h=new Array(c),d=0;d"+m(t);p._gradientUrlQueryParts[y]=1},b.pattern=function(t,e,r,i,o,s,l,c,f,h,d,p){var g="legend"===e;c&&("overlay"===f?(h=c,d=u.contrast(h)):(h=void 0,d=c));var v,m,y,b,x,_,w,M,T,A,k,L=r._fullLayout,S="p"+L._uid+"-"+i,E={};switch(o){case"/":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",E={d:y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"\\":v=s*Math.sqrt(2),m=s*Math.sqrt(2),_="path",E={d:y="M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"x":v=s*Math.sqrt(2),m=s*Math.sqrt(2),y="M-"+v/4+","+m/4+"l"+v/2+",-"+m/2+"M0,"+m+"L"+v+",0M"+v/4*3+","+m/4*5+"l"+v/2+",-"+m/2+"M"+v/4*3+",-"+m/4+"l"+v/2+","+m/2+"M0,0L"+v+","+m+"M-"+v/4+","+m/4*3+"l"+v/2+","+m/2,b=s-s*Math.sqrt(1-l),_="path",E={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case"|":_="path",_="path",E={d:y="M"+(v=s)/2+",0L"+v/2+","+(m=s),opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"-":_="path",_="path",E={d:y="M0,"+(m=s)/2+"L"+(v=s)+","+m/2,opacity:p,stroke:d,"stroke-width":(b=l*s)+"px"};break;case"+":_="path",y="M"+(v=s)/2+",0L"+v/2+","+(m=s)+"M0,"+m/2+"L"+v+","+m/2,b=s-s*Math.sqrt(1-l),_="path",E={d:y,opacity:p,stroke:d,"stroke-width":b+"px"};break;case".":v=s,m=s,l.pattern_filled";L._patternUrlQueryParts[R]=1},b.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},b.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},b.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(c,l))}var f,h,d,p=!1;if(t.so)d=s.outlierwidth,h=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=u.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:d)+"px");var v=o.gradient,m=t.mgt;m?p=!0:m=v&&v.type,a.isArrayOrTypedArray(m)&&(m=m[0],k[m]||(m=0));var y=o.pattern,x=y&&b.getPatternAttr(y.shape,t.i,"");if(m&&"none"!==m){var _=t.mgc;_?p=!0:_=v.color;var M=r.uid;p&&(M+="-"+t.i),b.gradient(e,i,M,m,[[0,_],[1,f]],"fill")}else if(x){var T=b.getPatternAttr(y.bgcolor,t.i,null),A=b.getPatternAttr(y.fgcolor,t.i,null),L=y.fgopacity,S=b.getPatternAttr(y.size,t.i,8),E=b.getPatternAttr(y.solidity,t.i,.3),C=t.mcc||a.isArrayOrTypedArray(y.shape)||a.isArrayOrTypedArray(y.bgcolor)||a.isArrayOrTypedArray(y.size)||a.isArrayOrTypedArray(y.solidity),O=r.uid;C&&(O+="-"+t.i),b.pattern(e,"point",i,O,x,S,E,t.mcc,y.fillmode,T,A,L)}else u.fill(e,f);d&&u.stroke(e,h)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,f=s.opacity,h=void 0!==c,d=void 0!==f;(a.isArrayOrTypedArray(u)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?f:g*e});var p=i.color,v=o.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?v||e:m||e});var y=i.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,g))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(b.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};u=a.texttemplateString(u,f,l._d3locale,d,t,p)}var g=t.tp||e.textposition,v=E(t,e),m=i?i(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,v,m).text(u).call(h.convertToTspans,r).call(S,g,v,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=E(t,e);u.fill(a,i),S(a,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},D=0),r&&(b.savedBBoxes[r]=v),D++,a.extendFlat({},v)},b.setClipUrl=function(t,e,r){t.attr("clip-path",I(e,r))},b.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(e,r)).trim(),t[a]("transform",i),i},b.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var z=/\s*sc.*/;b.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(z,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var N=/translate\([^)]*\)\s*$/;b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(N);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":437,"../../constants/alignment":506,"../../constants/interactions":512,"../../constants/xmlns_namespaces":514,"../../lib":534,"../../lib/svg_text_utils":559,"../../registry":632,"../../traces/scatter/make_bubble_size_func":678,"../../traces/scatter/subtypes":686,"../color":401,"../colorscale":413,"./symbol_defs":424,"@plotly/d3":17,"fast-isnumeric":94,tinycolor2:350}],424:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":17}],425:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],426:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(d.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(d.copy_ystyle?p:d).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":686,"../drawing":423,"@plotly/d3":17,"fast-isnumeric":94}],431:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":401,"@plotly/d3":17}],432:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":527,"../../plots/font_attributes":612,"./layout_attributes":442}],433:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||it<0||it>_[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+x[0]._offset,e.pointerY=it+_[0]._offset,F="xval"in e?m.flat(s,e.xval):m.p2c(x,at),H="yval"in e?m.flat(s,e.yval):m.p2c(_,it),!a(F[0])||!a(H[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(V=0;V$&&(tt.splice(0,$),ut=tt[0].distance),g&&0!==D&&0===tt.length){Q.distance=D,Q.index=!1;var f=q._module.hoverPoints(Q,J,K,"closest",{hoverLayer:l._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=D}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(h=ht(v),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(h=ht(b),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Mt-1;kt--)Ct(tt[kt]);tt=Lt,vt()}var Ot=t._hoverdata,Rt=[],Dt=j(t),Pt=U(t);for(Y=0;Y1||tt.length>1)||"closest"===L&&nt&&tt.length>1,Wt=d.combine(l.plot_bgcolor||d.background,l.paper_bgcolor),Xt=R(tt,{gd:t,hovermode:L,rotateLabels:qt,bgColor:Wt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});m.isUnifiedHover(L)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?M:1)/2,pmin:0,pmax:a?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),d.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",l),P(Xt,qt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Zt=v.getComponentMethod("annotations","hasClickToShow")(t,Rt);f(n.select(e.target),Zt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Ot))return;Ot&&t.emit("plotly_unhover",{event:e,points:Ot});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:_,xvals:F,yvals:H})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=R(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),g=t.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;c+=y,f+=y,h+=b,p+=b}u.bbox={x0:c+o,x1:f+o,y0:h+i,y1:p+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||d.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,w=e.commonLabelOpts||{},M=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,A=t[0],S=A.xa,E=A.ya,O=i.charAt(0),R=A[O+"Label"],P=H(r,g),I=P.top,z=P.width,N=P.height,F=void 0!==R&&A.distance<=e.hoverdistance&&("x"===i||"y"===i);if(F){var B,j,U=!0;for(B=0;Ba.width-x?(v=a.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*L+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(L+y.width/2)+"v"+b+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,C,O;"right"===E.side?(_="start",C=1,O="",v=S._offset+S._length):(_="end",C=-1,O="-",v=S._offset),m=E._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+O+k+","+k+"V"+(L+y.height/2)+"h"+O+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+O+k+"V-"+k+"Z");var D,P=y.height/2,z=I-y.top-P,N="clip"+a._uid+"commonlabel"+E._id;if(v=0?at:it+lt=0?it:vt+lt=0?rt:nt+ut=0?nt:mt+ut=0,"top"!==t.idealAlign&&G||!q?G?(P+=j/2,t.anchor="start"):t.anchor="middle":(P-=j/2,t.anchor="end");else if(t.pos=P,G=O+B/2+W<=z,q=O-B/2-W>=0,"left"!==t.idealAlign&&G||!q)if(G)O+=B/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=O+X-z,J=O-X;Z>0&&(O-=Z),J<0&&(O+=-J)}else O-=B/2,t.anchor="end";w.attr("text-anchor",t.anchor),S&&A.attr("text-anchor",t.anchor),e.attr("transform",s(O,P)+(u?l(_):""))})),yt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=F(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=F(r,t.nameLength),""}))}return[l,s]}function P(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],f=u*(k+L),d=f+u*(t.txwidth+L),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,d+=t.txwidth/2+L),e&&(g*=-A,p=t.offset*T),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*k+p)+","+o(k+g)+"v"+o(t.by/2-k)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*k+p)+"V"+o(g-k)+"Z");var m=p+f,y=g+t.ty0-t.by/2+L,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+L:-t.bx-L):"right"===b&&"end"!==s&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-L:t.bx+L)),a.call(c.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(c.positionText,i(d+u*L+p),o(g+t.ty0-t.by/2+L)),r.select("rect").call(h.setRect,i(d+(u-1)*t.tx2width/2+p),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function I(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function z(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,p)<1.5?d.contrast(p):y.color,w=a.spikemode,M=a.spikethickness,T=a.spikecolor||_,A=g.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=A,x=v),-1!==w.indexOf("across")){var k=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(k=Math.min(k,a.position),L=Math.max(L,a.position)),b=l.l+k*l.w,x=l.l+L*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var S,E,C=e.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(S=u.pointerX,E=u.pointerY):(S=n._offset+C.x,E=a._offset+C.y);var O,R,D=i.readability(C.color,p)<1.5?d.contrast(p):C.color,P=n.spikemode,I=n.spikethickness,z=n.spikecolor||D,N=g.getPxPosition(t,n);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(O=N,R=E),-1!==P.indexOf("across")){var F=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),B=Math.max(B,n.position)),O=l.t+(1-B)*l.h,R=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I,stroke:z,"stroke-dasharray":h.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function N(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function F(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.x,i=n.y,s=a+n.width,l=i+n.height,u=o.apply3DTransform(r._invTransform)(a,i),c=o.apply3DTransform(r._invTransform)(s,l),f=u[0],h=u[1],d=c[0],p=c[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},{"../../lib":534,"../../lib/events":526,"../../lib/override_cursor":545,"../../lib/svg_text_utils":559,"../../plots/cartesian/axes":583,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"../legend/defaults":453,"../legend/draw":454,"./constants":435,"./helpers":437,"@plotly/d3":17,"fast-isnumeric":94,tinycolor2:350}],439:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":534,"../color":401,"./helpers":437}],440:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":534,"./layout_attributes":442}],441:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":534,"../dragelement":420,"./attributes":432,"./calc":433,"./click":434,"./constants":435,"./defaults":436,"./helpers":437,"./hover":438,"./layout_attributes":442,"./layout_defaults":443,"./layout_global_defaults":444,"@plotly/d3":17}],442:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":612,"./constants":435}],443:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":534,"./hoverlabel_defaults":439,"./hovermode_defaults":440,"./layout_attributes":442}],444:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":534,"./hoverlabel_defaults":439,"./layout_attributes":442}],445:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),f=c*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===T("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===T("roworder"),w=h?.2:.1,M=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",T,w,b,y),y:c("y",T,M,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(M("uirevision",e.uirevision),!1!==g){M("bgcolor",e.paper_bgcolor),M("bordercolor"),M("borderwidth");var m,y,b,x=a.coerceFont(M,"font",e.font),_="h"===M("orientation");if(_?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),M("traceorder",h),l.isGrouped(e.legend)&&M("tracegroupgap"),M("itemsizing"),M("itemwidth"),M("itemclick"),M("itemdoubleclick"),M("groupclick"),M("x",m),M("xanchor"),M("y",y),M("yanchor",b),M("valign"),a.noneOrAll(u,v,["x","y"]),M("title.text")){M("title.side",_?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(M,"title.font",w)}}}function M(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":534,"../../plot_api/plot_template":572,"../../plots/layout_attributes":627,"../../registry":632,"./attributes":451,"./helpers":457}],454:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(u.font,i).text(h?M(n,p):n);var v=r.itemwidth+2*d.itemGap;f.positionText(g,v,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(M(n,p)).call(A,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),f=c[c.length-1],h=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):A(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function A(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,p=s.size*g;if(o){var v=u.bBox(o);c=v.height,h=v.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(c=p*y,h=b?u.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;a.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=p,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function k(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function L(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var M=a.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),S=a.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),E=a.ensureSingle(M,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));E.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),O=e.title;if(e._titleWidth=0,e._titleHeight=0,O.text){var R=a.ensureSingle(C,"text","legendtitletext");R.attr("text-anchor","start").call(u.font,O.font).text(O.text),A(R,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(M,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),P=C.selectAll("g.groups").data(s);P.enter().append("g").attr("class","groups"),P.exit().remove();var I=P.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(T,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,h=d.itemGap,p=a.itemwidth+2*h,g=2*(c+h),v=L(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v,b=a.tracegroupgap;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+w[0],c+w[1]+a._height+e/2+h),a._height+=e,a._width=Math.max(a._width,t[0].width)})),_=p+a._width,a._width+=h+p+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var M=k(a),T=a.x<0||0===a.x&&"right"===M,A=a.x>1||1===a.x&&"left"===M,S=y||m,E=i.width/2;a._maxWidth=Math.max(T?S&&"left"===M?o.l+o.w:E:A?S&&"right"===M?o.r+o.w:E:o.w,2*p);var C=0,O=0;r.each((function(t){var e=t[0].width+p;C=Math.max(C,e),O+=e})),_=null;var R=0;if(l){var D=0,P=0,I=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,w[0],w[1]+c+h+n/2+e),e+=n,t=Math.max(t,p+r[0].width)})),D=Math.max(D,e);var r=t+h;r+c+P>a._maxWidth&&(R=Math.max(R,P),P=0,I+=D+b,D=e),u.setTranslate(this,P,I),P+=r})),a._width=Math.max(R,P)+c,a._height=I+D+g}else{var z=r.size(),N=O+f+(z-1)*h=a._maxWidth&&(R=Math.max(R,U),B=0,j+=F,a._height+=F,F=0),u.setTranslate(this,w[0]+c+B,w[1]+c+j+e/2+h),U=B+r+h,B+=n,F=Math.max(F,e)})),N?(a._width=B+f,a._height=F+g):(a._width=Math.max(R,U)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(c+d.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(c+d.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,Y=H.legendText||H.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=Y?p:_||p+t[0].width;s||(a+=h/2),u.setRect(e,0,-r/2,a,r)}))}(t,P,I,e)},function(){if(p||!function(t){var e=t._fullLayout.legend,r=k(e),n=L(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var s,c,g,y,b=f._size,x=e.borderwidth,w=b.l+b.w*e.x-v[k(e)]*e._width,T=b.t+b.h*(1-e.y)-v[L(e)]*e._effHeight;if(!p&&f.margin.autoexpand){var A=w,O=T;w=a.constrain(w,0,f.width-e._width),T=a.constrain(T,0,f.height-e._effHeight),w!==A&&a.log("Constrain legend.x to make legend fit inside graph"),T!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(p||u.setTranslate(M,w,T),D.on(".drag",null),M.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var R=e._effHeight;p&&(R=e._height),E.attr({width:e._width-x,height:R-x,x:x/2,y:x/2}),u.setTranslate(C,0,0),S.select("rect").attr({width:e._width-2*x,height:R-2*x,x:x,y:x}),u.setClipUrl(C,h,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var P,I,z,N=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-N-2*d.scrollBarMargin,B=e._height-e._effHeight,j=F/B,U=Math.min(e._scrollY||0,B);E.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),S.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(C,h,t),V(U,N,j),M.on("wheel",(function(){V(U=a.constrain(e._scrollY+n.event.deltaY/F*B,0,B),N,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,z=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,V(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,B)}(z,P,I),N,j))}));D.call(H);var Y=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,z=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,V(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,B)}(z,P,I),N,j))}));C.call(Y)}if(t._context.edits.legendPosition)M.classed("cursor-move",!0),l.init({element:M.node(),gd:t,prepFn:function(){var t=u.getTranslate(M);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,a=y+r;u.setTranslate(M,n,a),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),c=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,M,a,e,n)}})}function V(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(C,0,-r),u.setRect(D,e._width,d.scrollBarMargin+r*a,d.scrollBarWidth,n),S.select("rect").attr("y",x+r)}}],t)}(t,e)}},{"../../constants/alignment":506,"../../lib":534,"../../lib/events":526,"../../lib/svg_text_utils":559,"../../plots/plots":629,"../../registry":632,"../color":401,"../dragelement":420,"../drawing":423,"./constants":452,"./get_legend_data":455,"./handle_click":456,"./helpers":457,"./style":459,"@plotly/d3":17}],455:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],f=!1,h={},d=0,p=0;function g(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),f=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+d;c.push(n),u[n]=[r],d++}}for(r=0;rA&&(T=A)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return y?n:Math.min(a,r)};function M(t,i,o){var c=t[0].trace,f=c.marker||{},h=f.line||{},d=o?c.visible&&c.type===o:a.traceIs(c,"bar"),p=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var d=i.mcc;if(!r._inHover&&"mc"in i){var p=u(f),g=p.mid;void 0===g&&(g=(p.max+p.min)/2),d=s.tryColorscale(f,"")(g)}var m=d||i.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=v(y.size,8,10),A=v(y.solidity,.5,1),k="legend-"+c.uid;a.call(s.pattern,"legend",e,k,b,T,A,d,y.fillmode,x,_,M)}else a.call(l.fill,m);o&&l.stroke(a,i.mlc||h.color)}))}function T(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.size()){var c=(s.marker||{}).line,d=w(h(c.width,o.pts),c,5,2),p=i.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=c.color;var g=i.minExtend(o,{trace:p});f(u,g,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,f=n.select(this),h=u(a),d=h.colorscale,g=h.reversescale;if(d){if(!r){var v=d.length;c=0===o?d[g?v-1:0][1]:1===o?d[g?0:v-1][1]:d[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),c?f.call(l.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,p(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,M(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){M(t,this,"funnel")})).each((function(t){M(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,a,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=u(x),M=_.colorscale,T=_.reversescale,A=c.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),L=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",A+"h"+b+"v6h-"+b+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+x.uid;s.gradient(t,e,r,p(T),M,"fill")}}),f||h){var S=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",A+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),M,"stroke")}})})).each((function(t){var r,a,o=g(t),l=o.anyFill,u=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,v=!h&&!u&&!l&&c.hasText(p);function m(t,e,r,n){var a=i.nestedProperty(p,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||v||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",i.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(d,x)],(a=i.minExtend(p,w)).selectedpoints=null,a.texttemplate=null}var T=n.select(this).select("g.legendpoints"),A=T.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var k=T.selectAll("g.pointtext").data(v?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":534,"../../registry":632,"../../traces/pie/helpers":658,"../../traces/pie/style_one":659,"../../traces/scatter/subtypes":686,"../color":401,"../colorscale/helpers":412,"../drawing":423,"./constants":452,"@plotly/d3":17}],460:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":462}],461:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(O=["toggleHover"],R=["resetViews"]):m?(C=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],R=["resetGeo"]):v?(O=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],R=["resetViewMapbox"]):x?O=["hoverClosestGl2d"]:y?O=["hoverClosestPie"]:T?(O=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):O=["toggleHover"];g&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(T=f,S="y0",A=y,E="y1"):(T=y,S="y1",A=f,E="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===D?J:K,X.altKey=n.altKey},doneFn:function(){if(m(t))return;d(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;$(s)}};function Z(r){if(m(t))D=null;else if(z)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";d(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;P?F("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(Y(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+a)):(l=function(t){return q(V(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else P?F("xanchor",r.xanchor=G(b+n)):(F("x0",r.x0=G(u+n)),F("x1",r.x1=G(v+n))),I?F("yanchor",r.yanchor=q(M+a)):(F("y0",r.y0=q(f+a)),F("y1",r.y1=q(y+a)));e.attr("d",_(t,r)),Q(s,r)}function K(n,a){if(N){var i=function(t){return t},o=i,l=i;P?F("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(Y(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+a)):(l=function(t){return q(V(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),F("path",r.path=w(R,o,l))}else if(z){if("resize-over-start-point"===D){var c=u+n,h=I?f-a:f+a;F("x0",r.x0=P?c:G(c)),F("y0",r.y0=I?h:q(h))}else if("resize-over-end-point"===D){var d=v+n,p=I?y-a:y+a;F("x1",r.x1=P?d:G(d)),F("y1",r.y1=I?p:q(p))}}else{var m=function(t){return-1!==D.indexOf(t)},x=m("n"),j=m("s"),H=m("w"),W=m("e"),X=x?T+a:T,Z=j?A+a:A,J=H?k+n:k,K=W?L+n:L;I&&(x&&(X=T-a),j&&(Z=A-a)),(!I&&Z-X>10||I&&X-Z>10)&&(F(S,r[S]=I?X:q(X)),F(E,r[E]=I?Z:q(Z))),K-J>10&&(F(C,r[C]=P?J:G(J)),F(O,r[O]=P?K:G(K)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(P||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Y(P?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=V(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),P&&I){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(P){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,P,l,e,r,D):!0===l.editable&&P.style("pointer-events",O||u.opacity(L)*k<=.5?"stroke":"all");P.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,v(t)}}(t,P)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,h=e.type,d=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),b=t._fullLayout._size;if(m?"domain"===d?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return b.l+b.w*t},y?"domain"===v?s=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return b.t+b.h*(1-t)},"path"===h)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],h=p.numParams[u],d=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+d}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+f;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var w=(l+u)/2,M=(c+f)/2,T=Math.abs(w-l),A=Math.abs(M-c),k="A"+T+","+A,L=w+T+","+M;return"M"+L+k+" 0 1,1 "+(w+","+(M-A))+k+" 0 0,1 "+L+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function M(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),A&&!h)&&(T=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===M&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function R(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=s.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return I.call(z),D&&(S?I.on(".opacity",null):(A=0,k=!0,I.text(y).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)}))),I.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),I.classed("js-placeholder",k),M}}},{"../../constants/alignment":506,"../../constants/interactions":512,"../../lib":534,"../../lib/svg_text_utils":559,"../../plots/plots":629,"../../registry":632,"../color":401,"../drawing":423,"@plotly/d3":17,"fast-isnumeric":94}],500:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:u,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plot_api/plot_template":572,"../../plots/font_attributes":612,"../../plots/pad_attributes":628,"../color/attributes":400}],501:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],502:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":534,"../../plots/array_container_defaults":578,"./attributes":500,"./constants":501}],503:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(k,a,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(M,o),c.call(_,o)}))})),c.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,d=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,A=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,L=p,S=v+m;S+k>u&&(S=u-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),T?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:L,y:S,width:A,height:k}),this._hbarXMin=L+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,D=p+g,P=v;D+O>l&&(D=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:P,width:O,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,N=c-.5,F=C?f+O+.5:f+.5,B=h-.5,j=T?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+z).data(T||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",z).append("rect"),T||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(B),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,z,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||C){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(Y),C&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":534,"../color":401,"../drawing":423,"@plotly/d3":17}],506:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],507:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],508:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],509:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],510:[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]}},{}],511:[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"}},{}],512:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],513:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],514:[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}},{}],515:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],517:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],518:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":541}],519:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),M=t.match(w?b:y);if(!M)return c;var T=M[1],A=M[3]||"1",k=Number(M[5]||1),L=Number(M[7]||0),S=Number(M[9]||0),E=Number(M[11]||0);if(u){if(2===T.length)return c;var C;T=Number(T);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===A.charAt(A.length-1);A=parseInt(A,10),C=O.newDate(T,O.toMonthIndex(T,A,R),k)}else C=O.newDate(T,Number(A),k)}catch(t){return c}return C?(C.toJD()-g)*f+L*h+S*d+E*p:c}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),A-=1;var D=new Date(Date.UTC(2e3,A,k,L,S));return D.setUTCFullYear(T),D.getUTCMonth()!==A||D.getUTCDate()!==k?c:D.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var M=90*f,T=3*h,A=5*d;function k(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var L=/%\d?f/g,S=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(L,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return E[r("%q")(a)]})),_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var O=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),O[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+C(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return C(e,t,n,a)};var R=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+R);return u.setUTCMonth(u.getUTCMonth()+e)+n-R},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,h=o-a,d=u-i,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(h,d,g,t-a,e-i),l(h,d,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=a:h=a,f++}return i}},{"./mod":541}],531:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],534:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=i(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=t("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=t("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=t("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var A=t("./regex");f.counterRegex=A.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var L=t("./dom");function S(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},f.syncOrAsync=function(t,e,r){var n;function a(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var P=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var a;return P.test(n)?a=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var I={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(I,arguments)};var z={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(z,arguments)};var N=/^[:|\|]/;function F(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,v="xother"===s||"yother"===s||d||g||p,m=s;if((d||p)&&(m=m.substring(1)),(g||p)&&(m=m.substring(0,m.length-1)),v){if(void 0===(u=e[m]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(t,e,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(a-u*(r+o),i-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":513,"./anchor_utils":517,"./angles":518,"./array":519,"./clean_number":520,"./clear_responsive":522,"./coerce":523,"./dates":524,"./dom":525,"./extend":527,"./filter_unique":528,"./filter_visible":529,"./geometry2d":530,"./identity":532,"./increment":533,"./is_plain_object":535,"./keyed_container":536,"./localize":537,"./loggers":538,"./make_trace_groups":539,"./matrix":540,"./mod":541,"./nested_property":542,"./noop":543,"./notifier":544,"./preserve_drawing_buffer":547,"./push_unique":548,"./regex":550,"./relative_attr":551,"./relink_private":552,"./search":553,"./sort_object_keys":556,"./stats":557,"./throttle":560,"./to_log_range":561,"@plotly/d3":17,"d3-format":83,"d3-time-format":84,"fast-isnumeric":94}],535:[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).hasOwnProperty("hasOwnProperty")}},{}],536:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":570,"./notifier":544}],539:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":17}],540:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],542:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":513,"./matrix":540}],547:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":94,"is-mobile":270}],548:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],f=c-a;void 0===a?(l.push(c),a=c):f>s&&(i=Math.min(i,f),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":519,"fast-isnumeric":94}],558:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":68}],559:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var k=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&k.match(u),C=n.select(t.node().parentNode);if(!C.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,a,o){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return R(),void e();var u=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:O,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",f=s.select("g");f.attr({fill:c,stroke:c});var h=l(f,"width"),d=l(f,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],v=-(r||l(t,"height"))/4;"y"===O[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-h/2,v-d/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?s.attr({x:t.attr("x"),y:v-d/2}):"a"===O[0]&&0!==O.indexOf("atitle")?s.attr({x:0,y:v}):s.attr({x:p,y:+t.attr("y")+v-d/2}),g&&g.call(t,u),e(u)}))}))):R(),t}function R(){C.empty()||(O=t.attr("class")+"-math",C.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var L=e.split(m),C=0;C|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var k={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):k[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?e:""}function C(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],561:[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":94}],562:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],563:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],564:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,M,T,A,k,L=Object.keys(r).map(Number).sort(o),S=e.get(),E=S||[],C=c(m,f).get(),O=[],R=-1,D=E.length;for(b=0;bE.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?O.push(_):A?("add"===T&&(T={}),E.splice(_,0,T),C&&C.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===R&&(R=_);else for(x=0;x=0;b--)E.splice(O[b],1),C&&C.splice(O[b],1);if(E.length?S||e.set(E):e.set(null),g)return!1;if(h(v,m),p!==a){var P;if(-1===R)P=L;else{for(D=Math.max(E.length,D),P=[],b=0;b=R);b++)P.push(_);for(b=R;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),O(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in O(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&Y(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=d.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function Y(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=d.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var V=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),p=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[I];)I--;var F=D.parts[I],B=D.parts[I-1]+"."+F,U=D.parts.slice(0,I).join("."),H=s(t.layout,U).get(),Y=s(l,U).get(),W=D.get();if(void 0!==P){k[R]=P,L[R]="reverse"===F?P:z(W);var Z=f.getLayoutValObject(l,D.parts);if(Z&&Z.impliedEdits&&null!==P)for(var J in Z.impliedEdits)S(o.relativeAttr(R,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(R))if(P){S("autosize",null);var K="height"===R?"width":"height";S(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)S("width",P?null:l.width),S("height",P?null:l.height);else if(B.match(V))O(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){O(B),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===F){E=H;var $="linear"===Y.type&&"log"===P,tt="log"===Y.type&&"linear"===P;if($||tt){if(E&&E.range)if(Y.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&S(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(U+".range[0]",Math.log(et)/Math.LN10),S(U+".range[1]",Math.log(rt)/Math.LN10)):(S(U+".range[0]",Math.pow(10,et)),S(U+".range[1]",Math.pow(10,rt)))}else S(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,Y,P,S),c.getComponentMethod("images","convertCoords")(t,Y,P,S)}else S(U+".autorange",!0),S(U+".range",null);s(l,U+"._inputRange").set(null)}else if(F.match(T)){var nt=s(l,R).get(),at=(P||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,S),c.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=x.containerArrayMatch(R);if(it){r=it.array,n=it.index;var ot=it.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(P)?L[R]=null:x.isRemoveVal(P)?L[R]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(A,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=P,delete e[R]}else"reverse"===F?(H.range?H.range.reverse():(S(U+".autorange",!0),H.range=[1,0]),Y.autorange?A.calc=!0:A.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===P||"select"===P)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:Z?M.update(A,Z):A.calc=!0,D.set(P))}}for(r in m){x.applyContainerArrayChanges(t,h(i,r),m[r],A,h)||(A.plot=!0)}for(var ut in C){var ct=(E=d.getFromId(t,ut))&&E._constraintGroup;if(ct)for(var ft in A.calc=!0,ct)C[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:L,redoit:k,eventData:v}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,a){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=_.coerceTraceIndices(t,a),s=B(t,o.extendFlat({},e),i),l=s.flags,c=W(t,o.extendFlat({},n)),f=c.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,i,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,c)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&Y(d,c.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag),u.add(t,Z,[t,s.undoit,c.undoit,s.traces],Z,[t,s.redoit,c.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&A.push(g);y=A}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,i];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":534,"../plots/attributes":579}],573:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function M(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=M(c,T,c.side),c._mainMirrorPosition=c.mirror&&T?M(c,T,d.OPPOSITE_SIDE[c.side]):null}var A=[],k=[],L=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,C=s.yaxis.domain,O=s.plotgroup;if(y(E,C,L)){var R=O.node(),D=s.bg=o.ensureSingle(O,"rect","bg");R.insertBefore(D.node(),R.childNodes[0]),k.push(a)}else O.select("rect.bg").remove(),L.push([E,C]),S||(A.push(a),k.push(a))}var P,I,z,N,F,B,j,U,H,Y,V,G,q,W=v._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eM?c.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},{"../lib":534,"../plots/attributes":579,"../plots/plots":629,"./plot_config":570,"./plot_schema":571,"./plot_template":572}],575:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var A=o.extendFlat({},h);b?A.width=b:null===e.width&&n(p.width)&&(A.width=p.width),x?A.height=x:null===e.height&&n(p.height)&&(A.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=i.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(T,r,A,k).then(L).then(S).then(E).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":534,"../plots/plots":629,"../snapshot/helpers":636,"../snapshot/svgtoimg":638,"../snapshot/tosvg":640,"../version":714,"./plot_api":569,"fast-isnumeric":94}],576:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&a.push(p("unused",i,m.concat(b.length)));var A,k,L,S,E,C=b.length,O=Array.isArray(T);if(O&&(C=Math.min(C,T.length)),2===x.dimensions)for(k=0;kb[k].length&&a.push(p("unused",i,m.concat(k,b[k].length)));var R=b[k].length;for(A=0;A<(O?Math.min(R,T[k].length):R);A++)L=O?T[k][A]:T,S=y[k][A],E=b[k][A],n.validate(S,L)?E!==S&&E!==+S&&a.push(p("dynamic",i,m.concat(k,A),S,E)):a.push(p("value",i,m.concat(k,A),S))}else a.push(p("array",i,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};u=f}for(var h=e.calendar,d="start"===l,p="end"===l,g=t[r+"period0"],v=i(g,h)||0,m=[],y=[],b=[],x=a.length,_=0;_A;)T=o(T,-u,h);for(;T<=A;)T=o(T,u,h);M=o(T,-u,h)}else{for(T=v+(w=Math.round((A-v)/c))*c;T>A;)T-=c;for(;T<=A;)T+=c;M=T-c}m[_]=d?M:p?T:(M+T)/2,y[_]=M,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":513,"../../lib":534,"fast-isnumeric":94}],581:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],582:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,f=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),u=g(t,e),c=u.min,f=u.max;if(0===c.length||0===f.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,v=f[0].val;for(r=1;r0&&((M=S-s(b)-l(x))>E?T/M>C&&(_=b,w=x,C=T/M):T/S>C&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},C=T/S));if(h===v){var O=h-1,R=h+1;if(k)if(0===h)a=[0,1];else{var D=(h>0?f:c).reduce((function(t,e){return Math.max(t,l(e))}),0),P=h/(1-Math.min(.5,D/S));a=h>0?[0,P]:[P,0]}else a=L?[Math.max(0,O),Math.max(1,R)]:[O,R]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-d(e,b.val,x.val))/(S-s(_)-l(w)),a=[_.val-C*s(_),w.val+C*l(w)];return m&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),E=A(r.vpadminus||r.vpad);if(!M){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=i),i>d&&i-o&&(h=i),i>d&&i=R;n--)O(n);return{min:p,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],f=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function b(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":423,"../../constants/numerical":513,"../../lib":534,"../../registry":632,"./axis_ids":587,"@plotly/d3":17,"fast-isnumeric":94}],583:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,M=g.ONEAVGMONTH,T=g.ONEMINMONTH,A=g.ONEWEEK,k=g.ONEDAY,L=k/2,S=g.ONEHOUR,E=g.ONEMIN,C=g.ONESEC,O=g.MINUS_SIGN,R=g.BADNUM,D={K:"zeroline"},P={K:"gridline",L:"path"},I={K:"tick",L:"path"},z={K:"tick",L:"text"},N=t("../../constants/alignment"),F=N.MID_SHIFT,B=N.CAP_SHIFT,j=N.LINE_SPACING,U=N.OPPOSITE_SIDE,H=e.exports={};H.setConvert=t("./set_convert");var Y=t("./axis_autotype"),V=t("./axis_ids"),G=V.idSort,q=V.isLinked;H.id2name=V.id2name,H.name2id=V.name2id,H.cleanId=V.cleanId,H.list=V.list,H.listIds=V.listIds,H.getFromId=V.getFromId,H.getFromTrace=V.getFromTrace;var W=t("./autorange");H.getAutoRange=W.getAutoRange,H.findExtremes=W.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}H.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},H.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},H.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==H.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=H.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},H.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:H.getFromId(e,r).cleanPos)(t)},H.redrawComponents=function(t,e){e=e||H.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},H.saveRangeInitial=function(t,e){for(var r=H.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=H.tickIncrement(t,"M6","reverse")+1.5*k:i.exactMonths>.8?t=H.tickIncrement(t,"M1","reverse")+15.5*k:t-=L;var l=H.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,u,i)),v=y,0;v<=c;)v=H.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:c-u}},H.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,H.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=H.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dticki&&f=o:d<=o;d=H.tickIncrement(d,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(d=c)break}if(E.length>g||d===C)break;C=d;var O=!1;f&&d!==(0|d)&&(O=!0),E.push({minor:O,value:d})}if(h&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),f=r||c,h=0;f>=y?h=c>=y&&c<=v?c:m:r===x&&f>=_?h=c>=_&&c<=b?c:x:f>=T?h=c>=T&&c<=w?c:M:r===A&&f>=A?h=A:f>=k?h=k:r===L&&f>=L?h=L:r===S&&f>=S&&(h=S),h>=c&&(h=c,s=!0);var d=a+h;if(e.rangebreaks&&h>0){for(var p=0,g=0;g<84;g++){var E=(g+.5)/84;e.maskBreaks(a*(1-E)+E*d)!==R&&p++}(h*=p/84)||(t[n].drop=!0),s&&c>A&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(E,t,t._definedDelta),t.rangebreaks){var D="y"===t._id.charAt(0),P=1;"auto"===t.tickmode&&(P=t.tickfont?t.tickfont.size:12);var I=NaN;for(p=E.length-1;p>-1;p--)if(E[p].drop)E.splice(p,1);else{E[p].value=kt(E[p].value,t);var z=t.c2p(E[p].value);(D?I>z-P:Ic||Fc&&(N.periodX=c),F10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&i<=10||e>=15*k)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=C&&i<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ct(t.exponentformat)&&!ft(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}H.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(i>M)e/=M,t.dtick="M"+ot(e,1,tt);else if(i>k){t.dtick=ot(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=H.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>S?t.dtick=ot(e,S,tt):i>E?t.dtick=ot(e,E,et):i>C?t.dtick=ot(e,C,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):At(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},H.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?at:nt,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},H.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=ht(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||ct(d)&&ft(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":O)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":O)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):At(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=O+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ht(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},H.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return H.hoverLabelText(t,n,r)+" - "+H.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=H.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":O+o:o};var ut=["f","p","n","\u03bc","m","","k","M","G","T"];function ct(t){return"SI"===t||"B"===t}function ft(t){return t>14||t<-15}function ht(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=H.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,O);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":ct(l)&&(t+=ut[u/3+5]));return i?O+t:t}function dt(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==u._dfltTitle[p]&&(n[l]+=vt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,bt(e),n),i.autoMargin(t,xt(e),a),i.autoMargin(t,_t(e),s)})),r.skipTitle||K&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+vt(e);else{var s=Lt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,f,d,p,g=H.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,d="top"===e.side?g-r:g+r):(d=e._offset+e._length/2,f="right"===e.side?g+r:g-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=h.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:p,transform:u,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function Q(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=yt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},H.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},H.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},H.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*B,f+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,f+=3);s&&"top"===u&&(f-=h*(1-B));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(f=-f);return[l?c:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(pt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(pt(e)))}},H.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},H.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,f=i("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,g=h?t.ticklen:0;if(f?g*=-1:c&&(g=0),h&&(d+=g,r)){var v=s.deg2rad(r);d=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},M=0,T=t.side,A=t._id.charAt(0),k=t.tickangle;if("x"===A)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=F:b=-90===k&&"bottom"===T?B:90===k&&"top"===T?F:.5,M=F/2*(k/90)),w.xFn=function(t){return t.dx+m+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===A){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===T||90===k&&"right"===T?B:.5),f){var L=a(k)?+k:0;if(0!==L){var S=s.deg2rad(L);M=Math.abs(Math.sin(S))*B*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*F},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},H.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],gt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),St(e,[I]),i.attr("transform",r.transFn)},H.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&H.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sd||i.leftd||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),d.length&&"x"===c&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=yt(this),o=h.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",f=function(t){return-1!==u.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,s={},c=0;c2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":632,"./constants":590}],588:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*b)||M)for(r=0;rD&&NO&&(O=N);h/=(O-C)/(2*R),C=l.l2r(C),O=l.l2r(O),l.range=l._input.range=L=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,a,i)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function Y(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){R&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),R=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,O)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,i){for(var o,s,l,u,c=!1,f={},h={},d=(i||{}).xaHash,p=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(Y(a),2!==t||mt||Vt(),vt)o.indexOf("select")>-1&&L(r,a,J,K,e.id,Ot),o.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&mt){var s=g?D:R,u="s"===g||"w"===m?0:1,f=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),p="left",v="middle";if(s.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:v}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,f,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),a=Math.max(0,Math.min(et,pt*r+wt)),i=Math.abs(n-_t),o=Math.abs(a-wt);function s(){Lt="",Mt.r=Mt.l,Mt.t=Mt.b,Et.attr("d","M0,0Z")}if(Mt.l=Math.min(_t,n),Mt.r=Math.max(_t,n),Mt.t=Math.min(wt,a),Mt.b=Math.max(wt,a),rt.isSubplotConstrained)i>O||o>O?(Lt="xy",i/tt>o/et?(o=i*et/tt,wt>a?Mt.t=wt-o:Mt.b=wt+o):(i=o*tt/et,_t>n?Mt.l=_t-i:Mt.r=_t+i),Et.attr("d",G(Mt))):s();else if(nt.isSubplotConstrained)if(i>O||o>O){Lt="xy";var l=Math.min(Mt.l/tt,(et-Mt.b)/et),u=Math.max(Mt.r/tt,(et-Mt.t)/et);Mt.l=l*tt,Mt.r=u*tt,Mt.b=(1-l)*et,Mt.t=(1-u)*et,Et.attr("d",G(Mt))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cg[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":534,"fast-isnumeric":94}],602:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":506}],603:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),M=t("../../plot_api/subroutines").redrawReglTraces,T=t("./constants"),A=T.MINSELECT,k=b.filter,L=b.tester,S=t("./handle_outline").clearSelect,E=t("./helpers"),C=E.p2r,O=E.axValue,R=E.getTransform;function D(t,e,r,n,a,i,o){var s,l,u,c,f,h,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){N(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)E._fullLayout._deactivateShape(E);else if(!_){var r=P.clickmode;x.done(gt).then((function(){if(x.clear(gt),2===t){for(ft.remove(),$=0;$-1&&D(e,E,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&E.emit("plotly_selected",void 0);s.click(E,e)})).catch(y.error)}},a.doneFn=function(){pt.remove(),x.done(gt).then((function(){x.clear(gt),a.gd.emit("plotly_selected",et),Q&&a.selectionDefs&&(Q.subtract=ct,a.selectionDefs.push(Q),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&F(a)}},clearSelect:S,clearSelectionsCache:F,selectOnClick:D}},{"../../components/color":401,"../../components/dragelement/helpers":419,"../../components/drawing":423,"../../components/fx":441,"../../components/fx/helpers":437,"../../components/shapes/draw_newshape/display_outlines":489,"../../components/shapes/draw_newshape/helpers":490,"../../components/shapes/draw_newshape/newshapes":491,"../../lib":534,"../../lib/clear_gl_canvases":521,"../../lib/polygon":546,"../../lib/throttle":560,"../../plot_api/subroutines":573,"../../registry":632,"./axis_ids":587,"./constants":590,"./handle_outline":594,"./helpers":595,polybooljs:306}],604:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,f=i.ensureNumber,h=i.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,g=d.BADNUM,v=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),M=t("./constants"),T=M.HOUR_PATTERN,A=M.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function L(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(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],a=t.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function E(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function C(e,r,n){return u(e,r,n||t.calendar)}function O(e){return t._categories[Math.round(e)]}function R(e){if(L(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return g}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function I(t){return s(t)?+t:D(t)}function z(t,e,r){return n.round(r+e*t,2)}function N(t,e,r){return(t-r)/e}var F=function(e){return s(e)?z(e,t._m,t._b):g},B=function(e){return N(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;F=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?z(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return N(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return N(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?k:f,t.l2p=F,t.p2l=B,t.c2p="log"===t.type?function(t,e){return F(S(t,e))}:F,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(B(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=R,t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(a=0;ap&&(o[n]=p),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),f="y"===d;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=u;if(h){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/d[2]:1,M=h?c/d[3]:1,T=f?d[0]:0,A=h?d[1]:0,k=f?d[0]/d[2]*u:0,L=h?d[1]/d[3]*c:0,S=a._offset-k,E=l._offset-L;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,S,E).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},{"../../components/drawing":423,"../../lib":534,"../../registry":632,"./axes":583,"@plotly/d3":17}],609:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var d=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var a=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:c,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":401,"../../../lib":534,"../../../registry":632,"../../get_data":614,"../../subplot_defaults":630,"./axis_defaults":618,"./layout_attributes":621}],621:[function(t,e,r){"use strict";var n=t("./axis_attributes"),a=t("../../domain").attributes,i=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(s(0,0,1),{}),center:i(s(0,0,0),{}),eye:i(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":534,"../../../lib/extend":527,"../../domain":611,"./axis_attributes":617}],622:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];function i(){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]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}},{"../../../lib/str2rgbarray":558}],623:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[i[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||a.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var d=n.calcTicks(c,{msUTC:!0}),p=0;p/g," "));l[u]=d,c.tickmode=f}}e.ticks=l;for(u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],a=new Array(n.length),i=0;ir.deltaY?1.1:1/1.1,i=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*i.x,y:n*i.y,z:n*i.z})}a(t)}}),!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,a=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var i=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=a.width*i,l=a.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var u,c=Object.keys(e.traces),h=null,g=e.glplot.selection,v=0;v")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=d.hoverLabelText(e._mockAxis,e._mockAxis.d2l(g.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+T.valueLabel),g.textLabel&&S.push(g.textLabel),_=S.join("
")):_=g.textLabel;var E={x:g.traceCoordinate[0],y:g.traceCoordinate[1],z:g.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:M};p.appendArrayPointValue(E,w,M),t._module.eventData&&(E=w._module.eventData(E,g,w,{},M));var C={points:[E]};if(e.fullSceneLayout.hovermode){var O=[];p.loneHover({trace:w,x:(.5+.5*b[0]/b[3])*s,y:(.5-.5*b[1]/b[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:_,name:h.name,color:p.castHoverOption(w,M,"bgcolor")||h.color,borderColor:p.castHoverOption(w,M,"bordercolor"),fontFamily:p.castHoverOption(w,M,"font.family"),fontSize:p.castHoverOption(w,M,"font.size"),fontColor:p.castHoverOption(w,M,"font.color"),nameLength:p.castHoverOption(w,M,"namelength"),textAlign:p.castHoverOption(w,M,"align"),hovertemplate:f.castOption(w,M,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:O}),E.bbox=O[0]}g.buttons&&g.distance<5?r.emit("plotly_click",C):r.emit("plotly_hover",C),u=C}else p.loneUnhover(n),r.emit("plotly_unhover",u);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,a=0;a<3;a++){var i=T[a],o=i.charAt(0),s=n[i],l=e[o],u=e[o+"calendar"],c=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(c||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pv[1][i])v[0][i]=-1,v[1][i]=1;else{var E=v[1][i]-v[0][i];v[0][i]-=E/32,v[1][i]+=E/32}if("reversed"===s.autorange){var C=v[0][i];v[0][i]=v[1][i],v[1][i]=C}}else{var O=s.range;v[0][i]=s.r2l(O[0]),v[1][i]=s.r2l(O[1])}v[0][i]===v[1][i]&&(v[0][i]-=1,v[1][i]+=1),m[i]=v[1][i]-v[0][i],this.glplot.setBounds(i,{min:v[0][i]*h[i],max:v[1][i]*h[i]})}var R=u.aspectmode;if("cube"===R)p=[1,1,1];else if("manual"===R){var D=u.aspectratio;p=[D.x,D.y,D.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=[1,1,1];for(i=0;i<3;++i){var I=y[l=(s=u[T[i]]).type];P[i]=Math.pow(I.acc,1/I.count)/h[i]}p="data"===R||Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1]}u.aspectratio.x=c.aspectratio.x=p[0],u.aspectratio.y=c.aspectratio.y=p[1],u.aspectratio.z=c.aspectratio.z=p[2],this.glplot.setAspectratio(u.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=u.aspectmode);var z=u.domain||null,N=e._size||null;if(z&&N){var F=this.container.style;F.position="absolute",F.left=N.l+z.x[0]*N.w+"px",F.top=N.t+(1-z.y[1])*N.h+"px",F.width=N.w*(z.x[1]-z.x[0])+"px",F.height=N.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).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]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var a=["up","center","eye"],i=["x","y","z"];return e[a[r]]&&t[a[r]][i[n]]===e[a[r]][i[n]]}var a=!1;if(void 0===r)a=!0;else{for(var i=0;i<3;i++)for(var o=0;o<3;o++)if(!n(e,r,i,o)){a=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(a=!0)}return a},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,a,i,o,s=this.fullLayout,l=this.isCameraChanged(t),u=this.isAspectChanged(t),h=l||u;if(h){var d={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),d[this.id+".camera"]=n),u&&(a=this.glplot.getAspectratio(),o=(i=f.nestedProperty(t,this.id+".aspectratio")).get(),d[this.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,s._preGUI,d),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(u)i.set(a),f.nestedProperty(s,this.id+".aspectratio").set(a),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,i=this.fullSceneLayout.camera,o=i.up.x,s=i.up.y,l=i.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var u=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[u]=h;var p=n.layout;c.call("_storeDirectGUIEdit",p,a._preGUI,d),i.up=h,f.nestedProperty(p,u).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i),function(t,e,r){for(var n=0,a=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[i+l]=Math.min(s*t[i+l],255)}}(i,r,a);var o=document.createElement("canvas");o.width=r,o.height=a;var s,l=o.getContext("2d"),u=l.createImageData(r,a);switch(u.data.set(i),l.putImageData(u,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];d.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":441,"../../lib":534,"../../lib/show_no_webgl_msg":555,"../../lib/str2rgbarray":558,"../../plots/cartesian/axes":583,"../../registry":632,"./layout/convert":619,"./layout/spikes":622,"./layout/tick_marks":623,"./project":624,"gl-plot3d":155,"has-passive-events":264,"webgl-context":364}],626:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var a=new Array(n),i=0;i=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&P.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&P.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:m,size:r.l+p},r:{val:y,size:r.r+p},b:{val:_,size:r.b+p},t:{val:b,size:r.t+p}},d[e]=1}else delete h[e],delete d[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,f=i.r,h=i.t,p=i.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,M=b.size,T=_.val,A=_.size;for(var k in g){if(o(M)&&g[k].r){var L=g[k].r.val,S=g[k].r.size;if(L>w){var E=(M*L+(S-r)*w)/(L-w),O=(S*(1-w)+(M-r)*(1-L))/(L-w);E+O>u+f&&(u=E,f=O)}}if(o(A)&&g[k].t){var R=g[k].t.val,D=g[k].t.size;if(R>T){var P=(A*R+(D-n)*T)/(R-T),I=(D*(1-T)+(A-n)*(1-R))/(R-T);P+I>p+h&&(p=P,h=I)}}}}}var z=c.constrain(r-i.l-i.r,2,64),N=c.constrain(n-i.t-i.b,2,64),F=Math.max(0,r-z),B=Math.max(0,n-N);if(F){var j=(u+f)/F;j>1&&(u/=j,f/=j)}if(B){var U=(p+h)/B;U>1&&(p/=U,h/=U)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(h),a.b=Math.round(p),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var H=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=u(s),a)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=u(l)),i&&(f.config=u(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(P(o,u,f),a=0;a0){for(var n=[],a=0;a-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(M),M=(M=M.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(M=(M=(M=M.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),M}},{"../components/color":401,"../components/drawing":423,"../constants/xmlns_namespaces":514,"../lib":534,"@plotly/d3":17}],641:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){u[t]=o[t]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../mesh3d/attributes":653}],642:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,a=e.v,i=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,a.length,i.length),s=-1/0,l=1/0,u=0;u=0;o--)(s=((f[[(r=(i=h[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":534}],647:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":534}],648:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u=t("../../plot_api/edit_types").overrideAll;var c=e.exports=u(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),valuehoverformat:a("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plot_api/edit_types":565,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../mesh3d/attributes":653}],649:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../streamtube/calc").processGrid,i=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=i(e.x,e._len),e._y=i(e.y,e._len),e._z=i(e.z,e._len),e._value=i(e.value,e._len);var r=a(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),a=Math.max(e[r],e[r-1]);if(a>n&&n-1}function z(t,e){return null===t?e:t}function N(e,r,n){C();var a,i,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(t,e){var r=t[0],n=t[1],a=t[2],i=function(t,e,r){for(var n=[],a=0;a-1?n[d]:E(p,g,m);h[d]=b>-1?b:R(p,g,m,z(e,y))}a=h[0],i=h[1],o=h[2],t._meshI.push(a),t._meshJ.push(i),t._meshK.push(o),++v}}function F(t,e,r,n){var a=t[3];an&&(a=n);for(var i=(t[3]-a)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-i)*t[s]+i*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(S-L);return t>=L-e&&t<=S+e}function U(e){for(var r=[],n=0;n<4;n++){var a=e[n];r.push([t._x[a],t._y[a],t._z[a],t._value[a]])}return r}function H(t,e,r,n,a,i){i||(i=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,a),B(e[1][3],n,a),B(e[2][3],n,a)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(N(t,e,r),!0):i<3&&H(t,e,r,L,S,++i)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var u=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(i){if(s[i[0]]&&s[i[1]]&&!s[i[2]]){var c=e[i[0]],f=e[i[1]],h=e[i[2]],d=F(h,c,n,a),p=F(h,f,n,a);o=l(t,[p,d,c],[-1,-1,r[i[0]]])||o,o=l(t,[c,f,p],[r[i[0]],r[i[1]],-1])||o,u=!0}})),u||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(i){if(s[i[0]]&&!s[i[1]]&&!s[i[2]]){var c=e[i[0]],f=e[i[1]],h=e[i[2]],d=F(f,c,n,a),p=F(h,c,n,a);o=l(t,[p,d,c],[-1,-1,r[i[0]]])||o,u=!0}})),o}function Y(t,e,r,n){var a=!1,i=U(e),o=[B(i[0][3],r,n),B(i[1][3],r,n),B(i[2][3],r,n),B(i[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return a;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(a=function(t,e,r){var n=function(n,a,i){N(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,i,e)||a),a;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var u=i[l[0]],c=i[l[1]],f=i[l[2]],h=i[l[3]];if(g)a=N(t,[u,c,f],[e[l[0]],e[l[1]],e[l[2]]])||a;else{var d=F(h,u,r,n),p=F(h,c,r,n),v=F(h,f,r,n);a=N(null,[d,p,v],[-1,-1,-1])||a}s=!0}})),s?a:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=i[l[0]],c=i[l[1]],f=i[l[2]],h=i[l[3]],d=F(f,u,r,n),p=F(f,c,r,n),v=F(h,c,r,n),m=F(h,u,r,n);g?(a=N(t,[u,m,d],[e[l[0]],-1,-1])||a,a=N(t,[c,p,v],[e[l[1]],-1,-1])||a):a=function(t,e,r){var n=function(n,a,i){N(t,[e[n],e[a],e[i]],[r[n],r[a],r[i]])};n(0,1,2),n(2,3,0)}(null,[d,p,v,m],[-1,-1,-1,-1])||a,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var u=i[l[0]],c=i[l[1]],f=i[l[2]],h=i[l[3]],d=F(c,u,r,n),p=F(f,u,r,n),v=F(h,u,r,n);g?(a=N(t,[u,d,p],[e[l[0]],-1,-1])||a,a=N(t,[u,p,v],[e[l[0]],-1,-1])||a,a=N(t,[u,v,d],[e[l[0]],-1,-1])||a):a=N(null,[d,p,v],[-1,-1,-1])||a,s=!0}})),a)}function V(t,e,r,n,a,i,o,s,l,u,c){var f=!1;return p&&(I(t,"A")&&(f=Y(null,[e,r,n,i],u,c)||f),I(t,"B")&&(f=Y(null,[r,n,a,l],u,c)||f),I(t,"C")&&(f=Y(null,[r,i,o,l],u,c)||f),I(t,"D")&&(f=Y(null,[n,i,s,l],u,c)||f),I(t,"E")&&(f=Y(null,[r,n,i,l],u,c)||f)),g&&(f=Y(t,[r,n,i,l],u,c)||f),f}function G(t,e,r,n,a,i,o,s){return[!0===s[0]||H(t,U([e,r,n]),[e,r,n],i,o),!0===s[1]||H(t,U([n,a,e]),[n,a,e],i,o)]}function q(t,e,r,n,a,i,o,s,l){return s?G(t,e,r,a,n,i,o,l):G(t,r,a,n,e,i,o,l)}function W(t,e,r,n,a,i,o){var s,l,u,c,f=!1,h=function(){f=H(t,[s,l,u],[-1,-1,-1],a,i)||f,f=H(t,[u,c,s],[-1,-1,-1],a,i)||f},d=o[0],p=o[1],g=o[2];return d&&(s=D(U([T(e,r-0,n-0)])[0],U([T(e-1,r-0,n-0)])[0],d),l=D(U([T(e,r-0,n-1)])[0],U([T(e-1,r-0,n-1)])[0],d),u=D(U([T(e,r-1,n-1)])[0],U([T(e-1,r-1,n-1)])[0],d),c=D(U([T(e,r-1,n-0)])[0],U([T(e-1,r-1,n-0)])[0],d),h()),p&&(s=D(U([T(e-0,r,n-0)])[0],U([T(e-0,r-1,n-0)])[0],p),l=D(U([T(e-0,r,n-1)])[0],U([T(e-0,r-1,n-1)])[0],p),u=D(U([T(e-1,r,n-1)])[0],U([T(e-1,r-1,n-1)])[0],p),c=D(U([T(e-1,r,n-0)])[0],U([T(e-1,r-1,n-0)])[0],p),h()),g&&(s=D(U([T(e-0,r-0,n)])[0],U([T(e-0,r-0,n-1)])[0],g),l=D(U([T(e-0,r-1,n)])[0],U([T(e-0,r-1,n-1)])[0],g),u=D(U([T(e-1,r-1,n)])[0],U([T(e-1,r-1,n-1)])[0],g),c=D(U([T(e-1,r-0,n)])[0],U([T(e-1,r-0,n-1)])[0],g),h()),f}function X(t,e,r,n,a,i,o,s,l,u,c,f){var h=t;return f?(p&&"even"===t&&(h=null),V(h,e,r,n,a,i,o,s,l,u,c)):(p&&"odd"===t&&(h=null),V(h,l,s,o,i,a,n,r,e,u,c))}function Z(t,e,r,n,a){for(var i=[],o=0,s=0;sMath.abs(p-k)?[A,p]:[p,k];$(e,M[0],M[1])}}var E=[[Math.min(L,k),Math.max(L,k)],[Math.min(A,S),Math.max(A,S)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(c.push(d.id),"x"===e?f.push([d.distRatio,0,0]):"y"===e?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);c.length>0&&(r[a]="x"===e?tt(null,c,i,o,f,r[a]):"y"===e?et(null,c,i,o,f,r[a]):rt(null,c,i,o,f,r[a]),a++),u.length>0&&(r[a]="x"===e?Z(null,u,i,o,r[a]):"y"===e?J(null,u,i,o,r[a]):K(null,u,i,o,r[a]),a++)}var p=t.caps[e];p.show&&p.fill&&(P(p.fill),r[a]="x"===e?Z(null,[0,x-1],i,o,r[a]):"y"===e?J(null,[0,_-1],i,o,r[a]):K(null,[0,w-1],i,o,r[a]),a++)}})),0===v&&O(),t._meshX=n,t._meshY=a,t._meshZ=i,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,a=n({gl:r}),i=new u(t,a,e.uid);return a._trace=i,i.update(e),t.glplot.add(a),i}}},{"../../components/colorscale":413,"../../lib/gl_format_color":531,"../../lib/str2rgbarray":558,"../../plots/gl3d/zip3":626,"gl-mesh3d":152}],651:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,i){var s=i("isomin"),l=i("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=i("x"),c=i("y"),f=i("z"),h=i("value");u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length?(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),i("valuehoverformat"),["x","y","z"].forEach((function(t){i(t+"hoverformat");var e="caps."+t;i(e+".show")&&i(e+".fill");var r="slices."+t;i(r+".show")&&(i(r+".fill"),i(r+".locations"))})),i("spaceframe.show")&&i("spaceframe.fill"),i("surface.show")&&(i("surface.count"),i("surface.fill"),i("surface.pattern")),i("contour.show")&&(i("contour.color"),i("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){i(t)})),o(t,e,n,i,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,a){s(t,e,r,a,(function(r,a){return n.coerce(t,e,i,r,a)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":411,"../../lib":534,"../../registry":632,"./attributes":648}],652:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":615,"./attributes":648,"./calc":649,"./convert":650,"./defaults":651}],653:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../surface/attributes":700}],654:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":409}],655:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),a=t("delaunay-triangulate"),i=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../components/colorscale").extractOpts,c=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function d(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=c(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!v(t.i,f)||!v(t.j,f)||!v(t.k,f))return;n=c(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?i(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],i=e.length,o=0;ol&&C[m].gap;)m--;for(b=C[m].s,g=C.length-1;g>m;g--)C[g].s=b;for(;lk[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],668:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=l(t,e,v,m);if(y||(e.visible=!1),e.visible){u(t,e,v,m),m("xhoverformat"),m("yhoverformat");var b=c(t,e,v,m),x=!b&&y=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-p);return i=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(d.c2p(t.y)-g);return iW!=(B=P[R][1])>=W&&(z=P[R-1][0],N=P[R][0],B-F&&(I=z+(N-z)*(W-F)/(B-F),Y=Math.min(Y,I),V=Math.max(V,I)));Y=Math.max(Y,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:Y,x1:V,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":401,"../../components/fx":441,"../../lib":534,"../../registry":632,"./get_trace_color":671}],673:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":597,"./arrays_to_calcdata":660,"./attributes":661,"./calc":662,"./cross_trace_calc":666,"./cross_trace_defaults":667,"./defaults":668,"./format_labels":670,"./hover":672,"./marker_colorbar":679,"./plot":682,"./select":683,"./style":685,"./subtypes":686}],674:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":411,"../../components/colorscale/helpers":412,"../../lib":534}],675:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,h,d,p,g,v,m,y,b,x,_,w,M,T,A,k,L=e.xaxis,S=e.yaxis,E="log"===L.type,C="log"===S.type,O=L._length,R=S._length,D=e.connectGaps,P=e.baseTolerance,I=e.shape,z="linear"===I,N=e.fill&&"none"!==e.fill,F=[],B=f.minTolerance,j=t.length,U=new Array(j),H=0;function Y(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(E&&(i=L.c2p(n.x,!0)),i===a)return!1;C&&l===a&&(i*=Math.abs(L._m*R*(L._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),i*=1e3}if(l===a){if(C&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function V(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[H-1][0],a=r===U[H-1][1];if(!n||!a)if(H>1){var i=e===U[H-2][0],o=r===U[H-2][1];n&&(e===et||e===rt)&&i?o?H--:U[H-1]=t:a&&(r===nt||r===at)&&o?i?H--:U[H-1]=t:U[H++]=t}else U[H++]=t}function ct(t){U[H-1][0]!==t[0]&&U[H-1][1]!==t[1]&&ut([Z,J]),ut(t),K=null,Z=J=0}function ft(t){if(A=t[0]/O,k=t[1]/R,W=t[0]rt?rt:0,X=t[1]at?at:0,W||X){if(H)if(K){var e=$(K,t);e.length>1&&(ct(e[0]),U[H++]=e[1])}else Q=$(U[H-1],t)[0],U[H++]=Q;else U[H++]=[W||t[0],X||t[1]];var r=U[H-1];W&&X&&(r[0]!==W||r[1]!==X)?(K&&(Z!==W&&J!==X?ut(Z&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||X]):Z&&J&&ut([Z,J])),ut([W,X])):Z-W&&J-X&&ut([W||Z,X||J]),K=t,Z=W,J=X}else K&&ct($(K,t)[0]),U[H++]=t;var n,a,i,o}for("linear"===I||"spline"===I?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&q(o,t)G(p,ht))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}K&&ut([Z||K[0],J||K[1]]),F.push(U.slice(0,H))}return F}},{"../../constants/numerical":513,"../../lib":534,"./constants":665}],676:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],677:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(i=0;i=0?l=d:(l=d=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":94}],679:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],680:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(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")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":401,"../../components/colorscale/defaults":411,"../../components/colorscale/helpers":412,"./subtypes":686}],681:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":513,"../../lib":534}],682:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(p),T=o(M,"g","errorbars"),A=o(M,"g","lines"),k=o(M,"g","points"),L=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,E;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var O,R,D="",P=[],I=_._prevtrace;I&&(D=I._prevRevpath||"",E=I._nextFill,P=I._polygons);var z,N,F,B,j,U,H,Y="",V="",G=[],q=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(z=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):z=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return N(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),l.singleLineStyle(f,a)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(S?(S.datum(f),B&&U&&(C?("y"===C?B[1]=U[1]=x.c2p(0,!0):"x"===C&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+Y.substr(1)).call(l.singleFillStyle)):y(S).attr("d",Y+"Z").call(l.singleFillStyle))):E&&("tonext"===_.fill.substr(0,6)&&Y&&D?("tonext"===_.fill?y(E).attr("d",Y+"Z"+D+"Z").call(l.singleFillStyle):y(E).attr("d",Y+"L"+D.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(P)):(Z(E),_._polygons=null)),_._prevRevpath=V,_._prevPolygons=H):(S?Z(S):E&&Z(E),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),L.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?K:J:_&&!w&&(v=Q),f&&(p=v),h&&(g=v)}var M,T=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(L,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){d(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":423,"../../lib":534,"../../lib/polygon":546,"../../registry":632,"./line_points":675,"./link_traces":677,"./subtypes":686,"@plotly/d3":17}],683:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=a.c2l(c);a._lowerLogErrorBound||(a._lowerLogErrorBound=h),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[a(t.x,t.error_x,e[0],r.xaxis),a(t.y,t.error_y,e[1],r.yaxis),a(t.z,t.error_z,e[2],r.zaxis)],i=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,a){var i=null;if(l.isArrayOrTypedArray(t)){i=[];for(var o=0;o=0){var g=function(t,e,r){var n,a=(r+1)%3,i=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],g=0;g<3;++g){var v="projection."+p[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":534,"../../registry":632,"../scatter/line_defaults":674,"../scatter/marker_defaults":680,"../scatter/subtypes":686,"../scatter/text_defaults":687,"./attributes":689}],694:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":511,"../../plots/gl3d":615,"./attributes":689,"./calc":690,"./convert":692,"./defaults":693}],695:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:a("u",1),vhoverformat:a("v",1),whoverformat:a("w",1),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){u[t]=o[t]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},{"../../components/colorscale/attributes":408,"../../lib/extend":527,"../../plots/attributes":579,"../../plots/cartesian/axis_format_attributes":586,"../../plots/template_attributes":631,"../mesh3d/attributes":653}],696:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/colorscale/calc");function i(t){var e,r,a,i,s,l,u,c,f,h,d,p,g=t._x,v=t._y,m=t._z,y=t._len,b=-1/0,x=1/0,_=-1/0,w=1/0,M=-1/0,T=1/0,A="";for(y&&(u=g[0],f=v[0],d=m[0]),y>1&&(c=g[y-1],h=v[y-1],p=m[y-1]),e=0;ec?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var E=function(){y=0,k=[],L=[],S=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,a=t.dataScale,c=e._len,f={};function p(t,e){var n=r[e],o=a[u[e]];return i.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var g=p(e._Xs,"xaxis"),v=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[g,v,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=v[0],b=h(g),x=h(m),_=new Array(b.length*x.length),w=0,M=0;M0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=v(t),n=v(e),a=1,i=0;i_;)r--,r/=m(r),++r1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],i=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,u=1+i+1,c=a(new Float32Array(l*u),[l,u]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(a[t]=!0,e=this.contourStart[t];ei&&(this.minValues[e]=i),this.maxValues[e]a&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),b={},x={},_=0;p?(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),T(v);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":246}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":408}],3:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":112}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":355}],5:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":226}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":363}],7:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":409}],8:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":410}],9:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./calendars":3,"./choroplethmapbox":4,"./core":5,"./densitymapbox":6,"./filter":7,"./groupby":8,"./scattermapbox":10,"./sort":11}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":405}],11:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":412}],12:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},a=self.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=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}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,p=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){p.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var y=m(h);function g(t){return t.length}t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function _(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.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,a=[],i=_(v(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,p,h=-1,f=i.length,d=a[s++],m=new b;++h=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,G),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[E(t,"matchesSelector")];return(Z=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,Z=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var G=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return q(t,this)}}function W(t){return"function"==typeof t?t:function(){return H(t,this)}}G.select=function(t){var e,r,n,a,i=[];t=Y(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},G.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},G.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},G.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=mt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=gt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=pt,t.selection.enter.prototype=ht,ht.append=G.append,ht.empty=G.empty,ht.node=G.node,ht.call=G.call,ht.size=G.size,ht.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?Ct:t<-1?-Ct:Math.asin(t)}function Et(t){return((t=Math.exp(t))+1/t)/2}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,p=l-i,h=c*c+p*p;if(h<1e-12)n=Math.log(u/o)/Dt,r=function(t){return[a+t*c,i+t*p,o*Math.exp(Dt*t*n)]};else{var f=Math.sqrt(h),d=(u*u-o*o+4*h)/(2*o*2*f),m=(u*u-o*o-4*h)/(2*u*2*f),y=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-y)/Dt,r=function(t){var e,r=t*n,s=Et(y),l=o/(2*f)*(s*(e=Dt*r+y,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[a+l*c,i+l*p,o*s/Et(Dt*r+y)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,p,h={x:0,y:0,k:1},f=[960,500],d=Rt,m=250,y=0,g="mousedown.zoom",v="mousemove.zoom",_="mouseup.zoom",x="touchstart.zoom",b=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(g,P).on(Ot+".zoom",D).on("dblclick.zoom",z).on(x,E)}function T(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(d[0],Math.min(d[1],t))}function M(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function A(e,n,a,i){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,i)),M(r=n,a),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),p&&p.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function C(t){y++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function I(t){--y||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=b.of(e,arguments),n=0,a=t.select(o(e)).on(v,l).on(_,u),i=T(t.mouse(e)),s=xt(e);function l(){n=1,M(t.mouse(e),i),L(r)}function u(){a.on(v,null).on(_,null),s(n),I(r)}Oa.call(e),C(r)}function E(){var e,r=this,n=b.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],p=t.select(r),f=xt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,y).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,p=n.length;o1){g=f[0];var _=f[1],x=g[0]-_[0],b=g[1]-_[1];i=x*x+b*b}}function y(){var o,l,u,c,p=t.touches(r);Oa.call(r);for(var h=0,f=p.length;h360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new Qt(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Wt(e instanceof Ht?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Nt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,this.l/t)},Nt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,t*this.l)},Nt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Ft;function qt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Ht(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Ht(t,e,r){return this instanceof Ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Ht?new Ht(t.l,t.a,t.b):t instanceof Ut?qt(t.h,t.c,t.l):ie((t=Qt(t)).r,t.g,t.b):new Ht(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Vt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},t.lab=Ht;var Zt=18,Gt=Ht.prototype=new Ft;function Yt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new Qt(Kt(3.2404542*(a=.95047*Xt(a))-1.5371385*(n=1*Xt(n))-.4985314*(i=1.08883*Xt(i))),Kt(-.969266*a+1.8760108*n+.041556*i),Kt(.0556434*a-.2040259*n+1.0572252*i))}function Wt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Xt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Kt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,jt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}Gt.brighter=function(t){return new Ht(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Gt.darker=function(t){return new Ht(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Gt.rgb=function(){return Yt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Ft;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Bt(n,a,l)}function ie(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Ht(116*a-16,500*(n-a),200*(a-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=p:u.onreadystatechange=function(){u.readyState>3&&p()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ue,t.xhr=ce(I),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=pe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(me),me=setTimeout(ve,e)),de=0):(de=1,ye(ve))}function _e(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function xe(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ge.apply(this,arguments)},t.timer.flush=function(){_e(),xe()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=be,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ue(e),i=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)f.push(t[s[u[n]][2]]);for(n=+p;nkt)s=s.L;else{if(!((a=i-Ve(s,o))>kt)){n>-kt?(e=s.P,r=s):a>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fe(t);if(Pe.insert(e,l),e||r){if(e===r)return Ye(e),r=Fe(e.site),Pe.insert(l,r),l.edge=r.edge=Je(e.site,l.site),Ge(e),void Ge(r);if(r){Ye(e),Ye(r);var u=e.site,c=u.x,p=u.y,h=t.x-c,f=t.y-p,d=r.site,m=d.x-c,y=d.y-p,g=2*(h*y-f*m),v=h*h+f*f,_=m*m+y*y,x={x:(y*v-f*_)/g+c,y:(h*_-m*v)/g+p};Qe(r.edge,u,d,x),l.edge=Je(u,t,null,x),r.edge=Je(t,d,null,x),Ge(e),Ge(r)}else l.edge=Je(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,p=1/i-1/u,h=c/u;return p?(-h+Math.sqrt(h*h-2*p*(c*c/(-2*u)-l+u/2+a-i/2)))/p+n:(n+s)/2}function Ve(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function qe(t){this.site=t,this.edges=[]}function He(t,e){return e.angle-t.angle}function Ze(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ge(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,p=2*(l*(y=i.y-s)-u*c);if(!(p>=-1e-12)){var h=l*l+u*u,f=c*c+y*y,d=(y*h-u*f)/p,m=(l*f-c*h)/p,y=m+s,g=Oe.pop()||new Ze;g.arc=t,g.site=a,g.x=d+o,g.y=y+Math.sqrt(d*d+m*m),g.cy=y,t.circle=g;for(var v=null,_=De._;_;)if(g.y<_.y||g.y===_.y&&g.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}De.insert(v,g),v||(Ee=g)}}}}function Ye(t){var e=t.circle;e&&(e.P||(Ee=e.N),De.remove(e),Oe.push(e),er(e),t.circle=null)}function We(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,p=t.r,h=c.x,f=c.y,d=p.x,m=p.y,y=(h+d)/2,g=(f+m)/2;if(m===f){if(y=s)return;if(h>d){if(i){if(i.y>=u)return}else i={x:y,y:l};r={x:y,y:u}}else{if(i){if(i.y1)if(h>d){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=h,h<0){if(e0){if(e>p)return;e>c&&(c=e)}if(e=a-l,h||!(e<0)){if(e/=h,h<0){if(e>p)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=f,f<0){if(e0){if(e>p)return;e>c&&(c=e)}if(e=i-u,f||!(e<0)){if(e/=f,f<0){if(e>p)return;e>c&&(c=e)}else if(f>0){if(e0&&(t.a={x:l+c*h,y:u+c*f}),p<1&&(t.b={x:l+p*h,y:u+p*f}),t}}}}}),l=o.length;l--;)(!We(e=o[l],t)||!s(e)||v(e.a.x-e.b.x)kt||v(a-r)>kt)&&(s.splice(o,0,new $e(Ke(i.site,c,v(n-p)kt?{x:p,y:v(e-p)kt?{x:v(r-d)kt?{x:h,y:v(e-h)kt?{x:v(r-f)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(He),c=-1,p=u.length,h=u[p-1].edge,f=h.l===l?h.r:h.l;++ci||p>o||h=b)<<1|e>=x,T=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:dr(r,n)})),i=gr.lastIndex;return im&&(m=l.x),l.y>y&&(y=l.y),u.push(l.x),c.push(l.y);else for(p=0;pm&&(m=x),b>y&&(y=b),u.push(x),c.push(b)}var w=m-f,T=y-d;function k(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(v(l-r)+v(u-n)<.01)M(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,M(t,c,l,u,a,i,o,s),M(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,s)}function M(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,p=n>=u,h=p<<1|c;t.leaf=!1,c?a=l:o=l,p?i=u:s=u,k(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>T?y=d+w:m=f+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+g(t,++p),+_(t,p),f,d,m,y)},visit:function(t){cr(t,A,f,d,m,y)},find:function(t){return pr(A,t[0],t[1],f,d,m,y)}};if(p=-1,null==e){for(;++p=0&&!(n=t.interpolators[a](e,r)););return n}function _r(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Ar(t){return t*t}function Sr(t){return t*t*t}function Cr(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 Lr(t){return 1-Math.cos(t*Ct)}function Ir(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Er(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 Dr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function zr(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=Rr(a),s=Or(a,i),l=Rr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=br.get(n)||xr,Tr((a=wr.get(a)||I)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Yt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Dr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new zr(e?e.matrix:Fr)})(e)},zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function Nr(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:dr(t[0],e[0])},{i:a-2,x:dr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:dr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:dr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:a-4,x:dr(t[0],e[0])},{i:a-2,x:dr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Br(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ge(s.tick)),s):n},s.start=function(){var t,e,r,n=g.length,l=v.length,c=u[0],d=u[1];for(t=0;t=0;)r.push(a[n])}function $r(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return $r(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function dn(t){return t.reduce(mn,0)}function mn(t,e){return t+e[1]}function yn(t,e){return gn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function vn(e){return[t.min(e),t.max(e)]}function _n(t,e){return t.value-e.value}function xn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function bn(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,p=1/0,h=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,_(r),l>1&&((n=e[1]).x=n.r,n.y=0,_(n),l>2))for(An(r,n,a=e[2]),_(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=p[0]&&l<=p[1]&&((s=u[t.bisect(h,l,1,d)-1]).y+=m,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ue(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return gn(e,t)}:ue(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(_n),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+c(t.value)})),$r(s,Tn),n){var p=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;$r(s,(function(t){t.r+=p})),$r(s,Tn),$r(s,(function(t){t.r-=p}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++of.x&&(f=t),t.depth>d.depth&&(d=t)}));var m=r(h,f)/2-h.x,y=n[0]/(f.x+r(f,h)/2+m),g=n[1]/(d.depth||1);Qr(c,(function(t){t.x=(t.x+m)*y,t.y=t.depth*g}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,p=s.m,h=l.m;s=Ln(s),i=Cn(i),s&&i;)l=Cn(l),(o=Ln(o)).a=t,(a=s.z+p-i.z-u+r(s._,i._))>0&&(In(Pn(s,t,n),t,a),u+=a,c+=a),p+=s.m,u+=i.m,h+=l.m,c+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=p-c),i&&!Cn(l)&&(l.t=i,l.m+=u-h,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Kr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;$r(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var p=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),f=p.x-r(p,h)/2,d=h.x+r(h,p)/2;return $r(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Kr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=En,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,m,i,!1),m=Math.min(i.dx,i.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,m,i,!0),s.length=s.area=0),e.forEach(p)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(d(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(h)}}function f(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function d(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Rn,s=a?Ur:jr;return i=t(e,r,s,n),o=t(r,e,s,vr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Dr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Hn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Vn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],vr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Fn(a.map(i),n?Math:Zn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=zn(a),e=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),p=r%1?2:r;if(isFinite(c-u)){if(n){for(;u0;h--)e.push(o(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Zn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Gn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Gn(r),i=Gn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Hn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Vn(n,t))},o.exponent=function(t){return arguments.length?(a=Gn(r=t),i=Gn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new b;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tp?0:1;if(u=St)return l(u,f)+(s?l(s,1-f):"")+"Z";var d,m,y,g,v,_,x,b,w,T,k,M,A=0,S=0,C=[];if((g=(+o.apply(this,arguments)||0)/2)&&(y=n===Qn?Math.sqrt(s*s+u*u):+n.apply(this,arguments),f||(S*=-1),u&&(S=Pt(y/u*Math.sin(g))),s&&(A=Pt(y/s*Math.sin(g)))),u){v=u*Math.cos(c+S),_=u*Math.sin(c+S),x=u*Math.cos(p-S),b=u*Math.sin(p-S);var L=Math.abs(p-c-2*S)<=Mt?0:1;if(S&&aa(v,_,x,b)===f^L){var I=(c+p)/2;v=u*Math.cos(I),_=u*Math.sin(I),x=b=null}}else v=_=0;if(s){w=s*Math.cos(p-A),T=s*Math.sin(p-A),k=s*Math.cos(c+A),M=s*Math.sin(c+A);var P=Math.abs(c-p+2*A)<=Mt?0:1;if(A&&aa(w,T,k,M)===1-f^P){var E=(c+p)/2;w=s*Math.cos(E),T=s*Math.sin(E),k=M=null}}else w=T=0;if(h>kt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,p=t[1]+u,h=e[0]+l,f=e[1]+u,d=(c+h)/2,m=(p+f)/2,y=h-c,g=f-p,v=y*y+g*g,_=r-n,x=c*f-h*p,b=(g<0?-1:1)*Math.sqrt(Math.max(0,_*_*v-x*x)),w=(x*g-y*b)/v,T=(-x*y-g*b)/v,k=(x*g+y*b)/v,M=(-x*y+g*b)/v,A=w-d,S=T-m,C=k-d,L=M-m;return A*A+S*S>C*C+L*L&&(w=k,T=M),[[w-l,T-u],[w*r/_,T*r/_]]}function oa(){return!0}function sa(t){var e=be,r=we,n=oa,a=ua,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,p=i.length,h=ue(e),f=ue(r);function d(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":pa,"step-after":ha,basis:ma,"basis-open":function(t){if(t.length<4)return ua(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(ya(_a,i)+","+ya(_a,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ua(t){return t.length>1?t.join("L"):t+"Z"}function ca(t){return t.join("L")+"Z"}function pa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;uMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ue(t),i):r},i.source=function(e){return arguments.length?(t=ue(e),i):t},i.target=function(t){return arguments.length?(e=ue(t),i):e},i.startAngle=function(t){return arguments.length?(n=ue(t),i):n},i.endAngle=function(t){return arguments.length?(a=ue(t),i):a},i},t.svg.diagonal=function(){var t=ka,e=Ma,r=Sa;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Sa,n=e.projection;return e.projection=function(t){return arguments.length?n(Ca(r=t)):r},e},t.svg.symbol=function(){var t=Ia,e=La;function r(r,n){return(Ea.get(t.call(this,r,n))||Pa)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var Ea=t.map({circle:Pa,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*za)),r=e*za;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/Da),r=e*Da/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Da),r=e*Da/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ea.keys();var Da=Math.sqrt(3),za=Math.tan(30*Lt);G.transition=function(t){for(var e,r,n=Ba||++Ua,a=Ha(t),i=[],o=Na||{time:Date.now(),ease:Cr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(i>=1)return p.event&&p.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}p||(i=a.time,o=ge((function(t){var e=p.delay;if(o.t=e+i,e<=t)return h(t-e);o.c=h}),0,i),p=c[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}ja.call=G.call,ja.empty=G.empty,ja.node=G.node,ja.size=G.size,t.transition=function(e,r){return e&&e.transition?Ba?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ja,ja.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Y(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function y(){var p,y,g=this,v=t.select(t.event.target),_=n.of(g,arguments),x=t.select(g),b=v.datum(),w=!/^(n|s)$/.test(b)&&a,T=!/^(e|w)$/.test(b)&&i,k=v.classed("extent"),M=xt(g),A=t.mouse(g),S=t.select(o(g)).on("keydown.brush",I).on("keyup.brush",P);if(t.event.changedTouches?S.on("touchmove.brush",E).on("touchend.brush",z):S.on("mousemove.brush",E).on("mouseup.brush",z),x.interrupt().selectAll("*").interrupt(),k)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(b){var C=+/w$/.test(b),L=+/^n/.test(b);y=[s[1-C]-A[0],l[1-L]-A[1]],A[0]=s[C],A[1]=l[L]}else t.event.altKey&&(p=A.slice());function I(){32==t.event.keyCode&&(k||(p=null,A[0]-=s[1],A[1]-=l[1],k=2),F())}function P(){32==t.event.keyCode&&2==k&&(A[0]+=s[1],A[1]+=l[1],k=0,F())}function E(){var e=t.mouse(g),r=!1;y&&(e[0]+=y[0],e[1]+=y[1]),k||(t.event.altKey?(p||(p=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return f(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,u,c,p,h=0,f=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;vu||f>c||d>p)return l=a,u=r,c=f,p=d,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return f(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,u,c,p,h=0,f=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;vu||f>c||d>p)return l=a,u=r,c=f,p=d,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function d(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=y(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],23:[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"}},{}],24:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,p=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function f(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?u:(e=p.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",f=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(p.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",y=void 0===t.minus?"-":t.minus+"",g=void 0===t.nan?"NaN":t.nan+"";function v(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,u=t.symbol,p=t.zero,v=t.width,_=t.comma,x=t.precision,b=t.trim,w=t.type;"n"===w?(_=!0,w="g"):l[w]||(void 0===x&&(x=12),b=!0,w="g"),(p||"0"===e&&"="===r)&&(p=!0,e="0",r="=");var T="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===u?c:/[%p]/.test(w)?m:"",M=l[w],A=/[defgprs%]/.test(w);function S(t){var i,s,l,u=T,c=k;if("c"===w)c=M(t)+c,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?g:M(Math.abs(t),x),b&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==a&&(m=!1),u=(m?"("===a?a:y:"-"===a||"("===a?"":a)+u,c=("s"===w?h[8+n/3]:"")+c+(m&&"("===a?")":""),A)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){c=(46===l?f+t.slice(i+1):t.slice(i))+c,t=t.slice(0,i);break}}_&&!p&&(t=o(t,1/0));var S=u.length+t.length+c.length,C=S>1)+u+t+c+C.slice(S);break;default:t=C+u+t+c}return d(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),S.toString=function(){return t+""},S}return{format:v,formatPrefix:function(t,e){var n=v(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=h[8+a/3];return function(t){return n(o*t)+s}}}}function d(e){return c=f(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=f,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],25:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,p=t.shortDays,h=t.months,vt=t.shortMonths,_t=f(u),xt=d(u),bt=f(c),wt=d(c),Tt=f(p),kt=d(p),Mt=f(h),At=d(h),St=f(vt),Ct=d(vt),Lt={a:function(t){return p[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:O,e:O,f:j,H:R,I:F,j:B,L:N,m:U,M:V,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:yt,s:gt,S:q,u:H,U:Z,V:G,w:Y,W:W,x:null,X:null,y:X,Y:J,Z:K,"%":mt},It={a:function(t){return p[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:yt,s:gt,S:ot,u:st,U:lt,V:ut,w:ct,W:pt,x:null,X:null,y:ht,Y:ft,Z:dt,"%":mt},Pt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Ct[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return zt(t,i,e,r)},d:M,e:M,f:P,H:S,I:S,j:A,L:I,m:k,M:C,p:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:D,s:z,S:L,u:y,U:g,V:v,w:m,W:_,x:function(t,e,r){return zt(t,o,e,r)},X:function(t,e,r){return zt(t,l,e,r)},y:b,Y:x,Z:w,"%":E};function Et(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function zt(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Pt[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Lt.x=Et(o,Lt),Lt.X=Et(l,Lt),Lt.c=Et(i,Lt),It.x=Et(o,It),It.X=Et(l,It),It.c=Et(i,It),{format:function(t){var e=Et(t+="",Lt);return e.toString=function(){return t},e},parse:function(t){var e=Dt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Et(t+="",It);return e.toString=function(){return t},e},utcParse:function(t){var e=Dt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function p(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function E(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return p(t.getDate(),e,2)}function R(t,e){return p(t.getHours(),e,2)}function F(t,e){return p(t.getHours()%12||12,e,2)}function B(t,r){return p(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return p(t.getMilliseconds(),e,3)}function j(t,e){return N(t,e)+"000"}function U(t,e){return p(t.getMonth()+1,e,2)}function V(t,e){return p(t.getMinutes(),e,2)}function q(t,e){return p(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function Z(t,r){return p(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function G(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),p(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Y(t){return t.getDay()}function W(t,r){return p(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function X(t,e){return p(t.getFullYear()%100,e,2)}function J(t,e){return p(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+p(e/60|0,"0",2)+p(e%60,"0",2)}function Q(t,e){return p(t.getUTCDate(),e,2)}function $(t,e){return p(t.getUTCHours(),e,2)}function tt(t,e){return p(t.getUTCHours()%12||12,e,2)}function et(t,r){return p(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return p(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return p(t.getUTCMonth()+1,e,2)}function it(t,e){return p(t.getUTCMinutes(),e,2)}function ot(t,e){return p(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return p(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),p(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function pt(t,r){return p(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return p(t.getUTCFullYear()%100,e,2)}function ft(t,e){return p(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function yt(t){return+t}function gt(t){return Math.floor(+t/1e3)}function vt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var _t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=_t,t.isoParse=xt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":26}],26:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),p=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),f=h.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var m=d(0),y=d(1),g=d(2),v=d(3),_=d(4),x=d(5),b=d(6),w=m.range,T=y.range,k=g.range,M=v.range,A=_.range,S=x.range,C=b.range,L=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),I=L.range,P=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));P.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var E=P.range,D=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),z=D.range,O=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=O.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),B=F.range;function N(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=N(0),U=N(1),V=N(2),q=N(3),H=N(4),Z=N(5),G=N(6),Y=j.range,W=U.range,X=V.range,J=q.range,K=H.range,Q=Z.range,$=G.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=f,t.timeFriday=x,t.timeFridays=S,t.timeHour=c,t.timeHours=p,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=y,t.timeMondays=T,t.timeMonth=L,t.timeMonths=I,t.timeSaturday=b,t.timeSaturdays=C,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=m,t.timeSundays=w,t.timeThursday=_,t.timeThursdays=A,t.timeTuesday=g,t.timeTuesdays=k,t.timeWednesday=v,t.timeWednesdays=M,t.timeWeek=m,t.timeWeeks=w,t.timeYear=P,t.timeYears=E,t.utcDay=F,t.utcDays=B,t.utcFriday=Z,t.utcFridays=Q,t.utcHour=O,t.utcHours=R,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=D,t.utcMinutes=z,t.utcMonday=U,t.utcMondays=W,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=G,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=Y,t.utcThursday=H,t.utcThursdays=K,t.utcTuesday=V,t.utcTuesdays=X,t.utcWednesday=q,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=Y,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],27:[function(t,e,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],28:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":63}],29:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15];return t[0]=s*(h*g-f*y)-p*(l*g-u*y)+m*(l*f-u*h),t[1]=-(n*(h*g-f*y)-p*(a*g-i*y)+m*(a*f-i*h)),t[2]=n*(l*g-u*y)-s*(a*g-i*y)+m*(a*u-i*l),t[3]=-(n*(l*f-u*h)-s*(a*f-i*h)+p*(a*u-i*l)),t[4]=-(o*(h*g-f*y)-c*(l*g-u*y)+d*(l*f-u*h)),t[5]=r*(h*g-f*y)-c*(a*g-i*y)+d*(a*f-i*h),t[6]=-(r*(l*g-u*y)-o*(a*g-i*y)+d*(a*u-i*l)),t[7]=r*(l*f-u*h)-o*(a*f-i*h)+c*(a*u-i*l),t[8]=o*(p*g-f*m)-c*(s*g-u*m)+d*(s*f-u*p),t[9]=-(r*(p*g-f*m)-c*(n*g-i*m)+d*(n*f-i*p)),t[10]=r*(s*g-u*m)-o*(n*g-i*m)+d*(n*u-i*s),t[11]=-(r*(s*f-u*p)-o*(n*f-i*p)+c*(n*u-i*s)),t[12]=-(o*(p*y-h*m)-c*(s*y-l*m)+d*(s*h-l*p)),t[13]=r*(p*y-h*m)-c*(n*y-a*m)+d*(n*h-a*p),t[14]=-(r*(s*y-l*m)-o*(n*y-a*m)+d*(n*l-a*s)),t[15]=r*(s*h-l*p)-o*(n*h-a*p)+c*(n*l-a*s),t}},{}],30:[function(t,e,r){e.exports=function(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}},{}],31:[function(t,e,r){e.exports=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}},{}],32:[function(t,e,r){e.exports=function(){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}},{}],33:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],p=t[10],h=t[11],f=t[12],d=t[13],m=t[14],y=t[15];return(e*o-r*i)*(p*y-h*m)-(e*s-n*i)*(c*y-h*d)+(e*l-a*i)*(c*m-p*d)+(r*s-n*o)*(u*y-h*f)-(r*l-a*o)*(u*m-p*f)+(n*l-a*s)*(u*d-c*f)}},{}],34:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,s=n+n,l=a+a,u=r*o,c=n*o,p=n*s,h=a*o,f=a*s,d=a*l,m=i*o,y=i*s,g=i*l;return t[0]=1-p-d,t[1]=c+g,t[2]=h-y,t[3]=0,t[4]=c-g,t[5]=1-u-d,t[6]=f+m,t[7]=0,t[8]=h+y,t[9]=f-m,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],35:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);if(Math.abs(u)<1e-6)return null;return o*=u=1/u,s*=u,l*=u,n=Math.sin(e),a=Math.cos(e),i=1-a,t[0]=o*o*i+a,t[1]=s*o*i+l*n,t[2]=l*o*i-s*n,t[3]=0,t[4]=o*s*i-l*n,t[5]=s*s*i+a,t[6]=l*s*i+o*n,t[7]=0,t[8]=o*l*i+s*n,t[9]=s*l*i-o*n,t[10]=l*l*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],36:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=n+n,l=a+a,u=i+i,c=n*s,p=n*l,h=n*u,f=a*l,d=a*u,m=i*u,y=o*s,g=o*l,v=o*u;return t[0]=1-(f+m),t[1]=p+v,t[2]=h-g,t[3]=0,t[4]=p-v,t[5]=1-(c+m),t[6]=d+y,t[7]=0,t[8]=h+g,t[9]=d-y,t[10]=1-(c+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],37:[function(t,e,r){e.exports=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}},{}],38:[function(t,e,r){e.exports=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}},{}],39:[function(t,e,r){e.exports=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}},{}],40:[function(t,e,r){e.exports=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}},{}],41:[function(t,e,r){e.exports=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}},{}],42:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(r-e),l=1/(a-n),u=1/(i-o);return t[0]=2*i*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(a+n)*l,t[10]=(o+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*u,t[15]=0,t}},{}],43:[function(t,e,r){e.exports=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}},{}],44:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),copy:t("./copy"),identity:t("./identity"),transpose:t("./transpose"),invert:t("./invert"),adjoint:t("./adjoint"),determinant:t("./determinant"),multiply:t("./multiply"),translate:t("./translate"),scale:t("./scale"),rotate:t("./rotate"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),fromRotation:t("./fromRotation"),fromRotationTranslation:t("./fromRotationTranslation"),fromScaling:t("./fromScaling"),fromTranslation:t("./fromTranslation"),fromXRotation:t("./fromXRotation"),fromYRotation:t("./fromYRotation"),fromZRotation:t("./fromZRotation"),fromQuat:t("./fromQuat"),frustum:t("./frustum"),perspective:t("./perspective"),perspectiveFromFieldOfView:t("./perspectiveFromFieldOfView"),ortho:t("./ortho"),lookAt:t("./lookAt"),str:t("./str")}},{"./adjoint":29,"./clone":30,"./copy":31,"./create":32,"./determinant":33,"./fromQuat":34,"./fromRotation":35,"./fromRotationTranslation":36,"./fromScaling":37,"./fromTranslation":38,"./fromXRotation":39,"./fromYRotation":40,"./fromZRotation":41,"./frustum":42,"./identity":43,"./invert":45,"./lookAt":46,"./multiply":47,"./ortho":48,"./perspective":49,"./perspectiveFromFieldOfView":50,"./rotate":51,"./rotateX":52,"./rotateY":53,"./rotateZ":54,"./scale":55,"./str":56,"./translate":57,"./transpose":58}],45:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],v=r*s-n*o,_=r*l-a*o,x=r*u-i*o,b=n*l-a*s,w=n*u-i*s,T=a*u-i*l,k=c*m-p*d,M=c*y-h*d,A=c*g-f*d,S=p*y-h*m,C=p*g-f*m,L=h*g-f*y,I=v*L-_*C+x*S+b*A-w*M+T*k;if(!I)return null;return I=1/I,t[0]=(s*L-l*C+u*S)*I,t[1]=(a*C-n*L-i*S)*I,t[2]=(m*T-y*w+g*b)*I,t[3]=(h*w-p*T-f*b)*I,t[4]=(l*A-o*L-u*M)*I,t[5]=(r*L-a*A+i*M)*I,t[6]=(y*x-d*T-g*_)*I,t[7]=(c*T-h*x+f*_)*I,t[8]=(o*C-s*A+u*k)*I,t[9]=(n*A-r*C-i*k)*I,t[10]=(d*w-m*x+g*v)*I,t[11]=(p*x-c*w-f*v)*I,t[12]=(s*M-o*S-l*k)*I,t[13]=(r*S-n*M+a*k)*I,t[14]=(m*_-d*b-y*v)*I,t[15]=(c*b-p*_+h*v)*I,t}},{}],46:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,a){var i,o,s,l,u,c,p,h,f,d,m=e[0],y=e[1],g=e[2],v=a[0],_=a[1],x=a[2],b=r[0],w=r[1],T=r[2];if(Math.abs(m-b)<1e-6&&Math.abs(y-w)<1e-6&&Math.abs(g-T)<1e-6)return n(t);p=m-b,h=y-w,f=g-T,d=1/Math.sqrt(p*p+h*h+f*f),i=_*(f*=d)-x*(h*=d),o=x*(p*=d)-v*f,s=v*h-_*p,(d=Math.sqrt(i*i+o*o+s*s))?(i*=d=1/d,o*=d,s*=d):(i=0,o=0,s=0);l=h*s-f*o,u=f*i-p*s,c=p*o-h*i,(d=Math.sqrt(l*l+u*u+c*c))?(l*=d=1/d,u*=d,c*=d):(l=0,u=0,c=0);return t[0]=i,t[1]=l,t[2]=p,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*m+o*y+s*g),t[13]=-(l*m+u*y+c*g),t[14]=-(p*m+h*y+f*g),t[15]=1,t}},{"./identity":43}],47:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*a+x*l+b*h+w*y,t[2]=_*i+x*u+b*f+w*g,t[3]=_*o+x*c+b*d+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*a+x*l+b*h+w*y,t[6]=_*i+x*u+b*f+w*g,t[7]=_*o+x*c+b*d+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*a+x*l+b*h+w*y,t[10]=_*i+x*u+b*f+w*g,t[11]=_*o+x*c+b*d+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*a+x*l+b*h+w*y,t[14]=_*i+x*u+b*f+w*g,t[15]=_*o+x*c+b*d+w*v,t}},{}],48:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-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]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t}},{}],49:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=1/Math.tan(e/2),o=1/(n-a);return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*o,t[15]=0,t}},{}],50:[function(t,e,r){e.exports=function(t,e,r,n){var a=Math.tan(e.upDegrees*Math.PI/180),i=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/(a+i);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]=(a-i)*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}},{}],51:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S,C=n[0],L=n[1],I=n[2],P=Math.sqrt(C*C+L*L+I*I);if(Math.abs(P)<1e-6)return null;C*=P=1/P,L*=P,I*=P,a=Math.sin(r),i=Math.cos(r),o=1-i,s=e[0],l=e[1],u=e[2],c=e[3],p=e[4],h=e[5],f=e[6],d=e[7],m=e[8],y=e[9],g=e[10],v=e[11],_=C*C*o+i,x=L*C*o+I*a,b=I*C*o-L*a,w=C*L*o-I*a,T=L*L*o+i,k=I*L*o+C*a,M=C*I*o+L*a,A=L*I*o-C*a,S=I*I*o+i,t[0]=s*_+p*x+m*b,t[1]=l*_+h*x+y*b,t[2]=u*_+f*x+g*b,t[3]=c*_+d*x+v*b,t[4]=s*w+p*T+m*k,t[5]=l*w+h*T+y*k,t[6]=u*w+f*T+g*k,t[7]=c*w+d*T+v*k,t[8]=s*M+p*A+m*S,t[9]=l*M+h*A+y*S,t[10]=u*M+f*A+g*S,t[11]=c*M+d*A+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],52:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],p=e[10],h=e[11];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]);return t[4]=i*a+u*n,t[5]=o*a+c*n,t[6]=s*a+p*n,t[7]=l*a+h*n,t[8]=u*a-i*n,t[9]=c*a-o*n,t[10]=p*a-s*n,t[11]=h*a-l*n,t}},{}],53:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],p=e[10],h=e[11];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]);return t[0]=i*a-u*n,t[1]=o*a-c*n,t[2]=s*a-p*n,t[3]=l*a-h*n,t[8]=i*n+u*a,t[9]=o*n+c*a,t[10]=s*n+p*a,t[11]=l*n+h*a,t}},{}],54:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],p=e[6],h=e[7];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]);return t[0]=i*a+u*n,t[1]=o*a+c*n,t[2]=s*a+p*n,t[3]=l*a+h*n,t[4]=u*a-i*n,t[5]=c*a-o*n,t[6]=p*a-s*n,t[7]=h*a-l*n,t}},{}],55:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],a=r[1],i=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]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],56:[function(t,e,r){e.exports=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]+")"}},{}],57:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o,s,l,u,c,p,h,f,d,m=r[0],y=r[1],g=r[2];e===t?(t[12]=e[0]*m+e[4]*y+e[8]*g+e[12],t[13]=e[1]*m+e[5]*y+e[9]*g+e[13],t[14]=e[2]*m+e[6]*y+e[10]*g+e[14],t[15]=e[3]*m+e[7]*y+e[11]*g+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*y+p*g+e[12],t[13]=a*m+l*y+h*g+e[13],t[14]=i*m+u*y+f*g+e[14],t[15]=o*m+c*y+d*g+e[15]);return t}},{}],58:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=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]=i,t[11]=e[14],t[12]=a,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}},{}],59:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":61}],60:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":61}],61:[function(t,e,r){e.exports=!0},{}],62:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],63:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],64:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,a){if(t)if(e){var i="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else e=a;else t=a}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}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){var r,n,a,i,o;for(void 0===e&&(e=1e-6),a=t,o=0;o<8;o++){if(i=this.sampleCurveX(a)-t,Math.abs(i)(n=1))return n;for(;ri?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=i;function i(t,e){this.x=t,this.y=e}function o(t,e,n,a){var i=new r(t,e,n,a);return function(t){return i.solve(t)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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,a=r*this.x+e*this.y;return this.x=n,this.y=a,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),a=e.x+r*(this.x-e.x)-n*(this.y-e.y),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=a,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function u(t,e,r){var n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var a in t)n[a]=e.call(r||this,t[a],a,t);return n}function v(t,e,r){var n={};for(var a in t)e.call(r||this,t[a],a,t)&&(n[a]=t[a]);return n}function _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?g(t,_):t}var x={};function b(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,a=n-1,i=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,a){var i=n||a;return e[r]=!i||i.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var A=null;function S(t){if(null==A){var e=t.navigator?t.navigator.userAgent:null;A=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return A}function C(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,I,P,E,D=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),z=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,O=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:D,frame:function(t){var e=z(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=self.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==I&&(I=self.matchMedia("(prefers-reduced-motion: reduce)")),I.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){if(N||!E)return;j?U(t):P=t}},N=!1,j=!1;function U(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,E),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((E=self.document.createElement("img")).onload=function(){P&&U(P),P=null,j=!0},E.onerror=function(){N=!0,P=null},E.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01";var q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=W(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=W(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=W(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var a=W(t);return H(t)?(a.path="/styles/v1"+a.path+"/sprite"+e+r,this._makeAPIURL(a,this._customAccessToken||n)):(a.path+=""+e+r,X(a))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=W(t),n=R.devicePixelRatio>=2||512===e?"@2x":"",a=B.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+a),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){b("Unable to write to LocalStorage")}},K.prototype.processRequests=function(t){},K.prototype.postEvent=function(t,e,r,n){var a=this;if(F.EVENTS_URL){var i=W(F.EVENTS_URL);i.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?c(o,e):o,l={url:X(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=xt(l,(function(t){a.pendingRequest=null,r(t),a.saveEventData(),a.processRequests(n)}))}},K.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,a=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=f()),this.postEvent(a,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(K),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,a=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=f(),a=!0);var i=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(i),l=(i-this.eventData.lastSuccess)/864e5;a=a||l>=1||l<-1||o.getDate()!==s.getDate()}else a=!0;if(!a)return this.processRequests();this.postEvent(i,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=i,e.eventData.tokenU=n)}),t)}},e}(K)),rt=et.postTurnstileEvent.bind(et),nt=new tt,at=nt.postMapLoadEvent.bind(nt),it=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var a=M(e.headers.get("Cache-Control")||"");if(!a["no-store"])a["max-age"]&&n.headers.set("Expires",new Date(r+1e3*a["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(ut(t.url),r)})).catch((function(t){return b(t.message)}))}))}}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ct(t,e){if(st(),!Q)return e(null);var r=ut(t.url);Q.then((function(t){t.match(r).then((function(n){var a=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),a&&t.put(r,n.clone()),e(null,n,a)})).catch(e)})).catch(e)}var pt,ht=1/0;function ft(){return null==pt&&(pt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),pt}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt=function(t){function e(e,r,n){401===r&&G(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function gt(t,e){var r,n=new self.AbortController,a=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&G(r);"json"===t.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&b(r),n&&i)return u(n);var l=Date.now();self.fetch(a).then((function(r){if(r.ok){var n=s?r.clone():null;return u(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&<(a,n,s),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?ct(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}var vt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(yt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return gt(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},_t=function(t,e){return vt(c(t,{type:"arrayBuffer"}),e)},xt=function(t,e){return vt(c(t,{method:"POST"}),e)};var bt,wt;bt=[],wt=0;var Tt=function(t,e){if(B.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),wt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return bt.push(r),r}wt++;var n=!1,a=function(){if(!n)for(n=!0,wt--;bt.length&&wt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ct.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Lt={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},It=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.key,r=t.value;return r?[new It(e,r,"constants have been deprecated as of v8")]:[]}function Et(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Xt=[Ft,Bt,Nt,jt,Ut,Zt,Vt,Yt(qt),Gt];function Jt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Xt;r255?255:t}function a(t){return t<0?0:t>1?1:t}function i(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?a(parseFloat(t)/100):a(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}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in r)return r[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var c=a.substr(0,l),p=a.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=o(p.pop());case"rgb":return 3!==p.length?null:[i(p[0]),i(p[1]),i(p[2]),h];case"hsla":if(4!==p.length)return null;h=o(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return[n(255*s(g,y,f+1/3)),n(255*s(g,y,f)),n(255*s(g,y,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],a=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+a+")"},te.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=a},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ae)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in pe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[s],n++}else i=qt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Yt(i,o)}else r=pe[a];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Zt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],a=!1,i=1;i<=t.length-1;++i){var o=t[i];if(a&&"object"==typeof o&&!Array.isArray(o)){a=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Bt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Yt(Nt))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,Ut)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var p=e.parse(t[i],1,qt);if(!p)return null;var h=p.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:p,scale:null,font:null,textColor:null})}}return new fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Gt?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":jt,"to-color":Ut,"to-number":Bt,"to-string":Nt},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=me[r],a=[],i=1;i4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ie(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Te(t,e){var r,n=(180+t[0])/360,a=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,e.z);return[Math.round(n*i*8192),Math.round(a*i*8192)]}function ke(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Me(t,e){for(var r,n,a,i,o,s,l,u=!1,c=0,p=e.length;c0&&p<0||c<0&&p>0}function Ce(t,e,r){for(var n=0,a=r;nr[2]){var a=.5*n,i=t[0]-r[0]>a?-n:r[0]-t[0]>a?n:0;0===i&&(i=t[0]-r[2]>a?-n:r[2]-t[0]>a?n:0),t[0]+=i}be(e,t)}function ze(t,e,r,n){for(var a=8192*Math.pow(2,n.z),i=[8192*n.x,8192*n.y],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ne(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=s-1}return 0}Ue.prototype.parse=function(t,e,r,n,a){return void 0===a&&(a={}),e?this.concat(e,r,n)._parse(t,a):this._parse(t,a)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new he(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof ue)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof Re)return!1;var r=e instanceof ye||e instanceof he,n=!0;if(e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ue})),!n)return!1;return Fe(e)&&Ne(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new ve;try{i=new ue(i.type,i.evaluate(l))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,a,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ot(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Jt(t,e);return r&&this.error(r),r};var qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,a=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,a);if(!c)return null;a=a||c.type,n.push([o,c])}return new qe(a,r,n)},qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;return n>=e[a-1]?r[a-1].evaluate(t):r[Ve(e,n)].evaluate(t)},qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ze=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new te(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return He(t,e[n],r)}))}}),Ge=6/29,Ye=3*Ge*Ge,We=Math.PI/180,Xe=180/Math.PI;function Je(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ye+4/29}function Ke(t){return t>Ge?t*t*t:Ye*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),n=$e(t.b),a=Je((.4124564*e+.3575761*r+.1804375*n)/.95047),i=Je((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Je((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Qe(3.2404542*r-1.5371385*e-.4985314*n),Qe(-.969266*r+1.8760108*e+.041556*n),Qe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function rr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ar={forward:function(t){var e=tr(t),r=e.l,n=e.a,a=e.b,i=Math.atan2(a,n)*Xe;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:t.a}},reverse:function(t){var e=t.h*We,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:nr,hcl:ar}),or=function(t,e,r,n,a){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(a=e.parse(a,2,Bt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,u);if(!m)return null;u=u||m.type,l.push([p,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new or(u,r,n,a,l):e.error("Type "+Wt(u)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;if(n>=e[a-1])return r[a-1].evaluate(t);var i=Ve(e,n),o=e[i],s=e[i+1],l=or.interpolationFactor(this.interpolation,n,o,s),u=r[i].evaluate(t),c=r[i+1].evaluate(t);return"interpolate"===this.operator?Ze[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?ar.reverse(ar.interpolate(ar.forward(u),ar.forward(c),l)):nr.reverse(nr.interpolate(nr.forward(u),nr.forward(c),l))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},cr.prototype.eachChild=function(t){t(this.index),t(this.input)},cr.prototype.outputDefined=function(){return!1},cr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var pr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};pr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);return r&&n?Kt(r.type,[jt,Nt,Bt,Ft,qt])?new pr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},pr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");return r.indexOf(e)>=0},pr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},pr.prototype.outputDefined=function(){return!0},pr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Bt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);if(!r||!n)return null;if(!Kt(r.type,[jt,Nt,Bt,Ft,qt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Bt);return a?new hr(r,n,a):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var fr=function(t,e,r,n,a,i){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};fr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var a={},i=[],o=2;oNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,se(h)))return null}else r=se(h);if(void 0!==a[String(h)])return u.error("Branch labels must be unique.");a[String(h)]=i.length}var f=e.parse(l,o,n);if(!f)return null;n=n||f.type,i.push(f)}var d=e.parse(t[1],1,qt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new fr(r,n,d,a,i,m):null},fr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},fr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},fr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,Bt);if(!r||!n)return null;if(!Kt(r.type,[Yt(qt),Nt,qt]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Bt);return a?new mr(r.type,r,n,a):null}return new mr(r.type,r,n)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Wt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var _r=vr("==",(function(t,e,r){return e===r}),gr),xr=vr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!gr(0,e,r,n)})),br=vr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Tr=vr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),kr=vr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Mr=function(t,e,r,n,a){this.type=Nt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};Mr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=e.parse(n.locale,1,Nt)))return null;var i=null;if(n.currency&&!(i=e.parse(n.currency,1,Nt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Bt))?null:new Mr(r,a,i,o,s)},Mr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ar=function(t){this.type=Bt,this.input=t};Ar.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Wt(r.type)+" instead."):new Ar(r):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ce("Expected value to be of type string or array, but found "+Wt(se(e))+" instead.")},Ar.prototype.eachChild=function(t){t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":_r,"!=":xr,">":wr,"<":br,">=":kr,"<=":Tr,array:he,at:cr,boolean:he,case:dr,coalesce:lr,collator:xe,format:fe,image:de,in:pr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Ar,let:ur,literal:ue,match:fr,number:he,"number-format":Mr,object:he,slice:mr,step:qe,string:he,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:je,within:Re};function Cr(t,e){var r=e[0],n=e[1],a=e[2],i=e[3];r=r.evaluate(t),n=n.evaluate(t),a=a.evaluate(t);var o=i?i.evaluate(t):1,s=ie(r,n,a,o);if(s)throw new ce(s);return new te(r/255*o,n/255*o,a/255*o,o)}function Lr(t,e){return t in e}function Ir(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Er(t){return{result:"success",value:t}}function Dr(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Br(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,a){return jr(typeof r===a?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var a=Ve(t.stops.map((function(t){return t[0]})),r);return t.stops[a][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Fr(r))return jr(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var i=Ve(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}(r,n,t.stops[i][0],t.stops[i+1][0]),s=t.stops[i][1],l=t.stops[i+1][1],u=Ze[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function Hr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ae.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}_e.register(Sr,{error:[{kind:"error"},[Nt],function(t,e){var r=e[0];throw new ce(r.evaluate(t))}],typeof:[Nt,[qt],function(t,e){return Wt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Bt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Bt,Bt,Bt],Cr],rgba:[Ut,[Bt,Bt,Bt,Bt],Cr],has:{type:jt,overloads:[[[Nt],function(t,e){return Lr(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Lr(r.evaluate(t),n.evaluate(t))}]]},get:{type:qt,overloads:[[[Nt],function(t,e){return Ir(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Ir(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[qt,[Nt],function(t,e){return Ir(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[Nt,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Bt,[],function(t){return t.globals.zoom}],"heatmap-density":[Bt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Bt,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Bt,Pr(Bt),function(t,e){for(var r=0,n=0,a=e;n":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[jt,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[Yt(Nt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Yt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Nt,Yt(qt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Nt,Yt(qt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var a=r+n>>1;if(e[a]===t)return!0;e[a]>t?n=a-1:r=a+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Pr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Yr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Nt,number:Bt,enum:Nt,boolean:jt,formatted:Zt,resolvedImage:Gt};if("array"===t.type)return Yt(e[t.value]||qt,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Er(new Zr(n,e)):Dr(r.errors)}Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Zr.prototype.evaluate=function(t,e,r,n,a,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Wr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Be(e.expression)};Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,a,i)},Wr.prototype.evaluate=function(t,e,r,n,a,i){return this._styleExpression.evaluate(t,e,r,n,a,i)};var Xr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Be(e.expression),this.interpolationType=n};function Jr(t,e){if("error"===(t=Yr(t,e)).result)return t;var r=t.value.expression,n=Fe(r);if(!n&&!zr(e))return Dr([new Ot("","data expressions not supported")]);var a=Ne(r,["zoom"]);if(!a&&!Or(e))return Dr([new Ot("","zoom expressions not supported")]);var i=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof lr)for(var n=0,a=e.args;nn.maximum?[new It(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function en(t){var e,r,n,a=t.valueSpec,i=Dt(t.value.type),o={},s="categorical"!==i&&void 0===t.value.property,l=!s,u="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),c=Qr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat($r({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Fr(r)&&0===r.length&&e.push(new It(t.key,r,"array must have at least one stop"));return e},default:function(t){return kn({key:t.key,value:t.value,valueSpec:a,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&c.push(new It(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||c.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Rr(t.valueSpec)&&c.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!zr(t.valueSpec)?c.push(new It(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&c.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!u||void 0!==t.value.property||c.push(new It(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],i=t.value,s=t.key;if("array"!==Fr(i))return[new It(s,i,"array expected, "+Fr(i)+" found")];if(2!==i.length)return[new It(s,i,"array length 2 expected, length "+i.length+" found")];if(u){if("object"!==Fr(i[0]))return[new It(s,i,"object expected, "+Fr(i[0])+" found")];if(void 0===i[0].zoom)return[new It(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new It(s,i,"object stop key must have value")];if(n&&n>Dt(i[0].zoom))return[new It(s,i[0].zoom,"stop zoom values must appear in ascending order")];Dt(i[0].zoom)!==n&&(n=Dt(i[0].zoom),r=void 0,o={}),e=e.concat(Qr({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tn,value:h}}))}else e=e.concat(h({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return Gr(zt(i[1]))?e.concat([new It(s+"[1]",i[1],"expressions are not allowed in function stops.")]):e.concat(kn({key:s+"[1]",value:i[1],valueSpec:a,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Fr(t.value),l=Dt(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new It(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new It(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var c="number expected, "+s+" found";return zr(a)&&void 0===i&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,u,c)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?cn(t[1],t[2],"=="):"!="===r?fn(cn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?cn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(fn)):"in"===r?pn(t[1],t.slice(2)):"!in"===r?fn(pn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?fn(hn(t[1])):"within"!==r||t}function cn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function pn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ln)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function fn(t){return["!",t]}function dn(t){return an(zt(t.value))?rn(Et({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Fr(r))return[new It(n,r,"array expected, "+Fr(r)+" found")];var a,i=e.styleSpec,o=[];if(r.length<1)return[new It(n,r,"filter array must have at least 1 element")];switch(o=o.concat(nn({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Dt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Dt(r[1])&&o.push(new It(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new It(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=Fr(r[1]))&&o.push(new It(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(o[h]=!0,i.push(u[h])):o[h]=!1}}},On.prototype._forEachCell=function(t,e,r,n,a,i,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),h=l;h<=c;h++)for(var f=u;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&a.call(this,t,e,r,n,d,i,o,s))return}},On.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var p=t[c];u[c]=Bn[l].shallow.indexOf(c)>=0?p:qn(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof t)}function Hn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Hn);if("object"==typeof t){var e=t.$name||"Object",r=Bn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),a=0,i=Object.keys(t);a=0?s:Hn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Zn=function(){this.first=!0};Zn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Yn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Gn["CJK Compatibility Ideographs"](t)||(!!Gn["CJK Compatibility"](t)||(!!Gn["CJK Radicals Supplement"](t)||(!!Gn["CJK Strokes"](t)||(!(!Gn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Gn["CJK Unified Ideographs Extension A"](t)||(!!Gn["CJK Unified Ideographs"](t)||(!!Gn["Enclosed CJK Letters and Months"](t)||(!!Gn["Hangul Compatibility Jamo"](t)||(!!Gn["Hangul Jamo Extended-A"](t)||(!!Gn["Hangul Jamo Extended-B"](t)||(!!Gn["Hangul Jamo"](t)||(!!Gn["Hangul Syllables"](t)||(!!Gn.Hiragana(t)||(!!Gn["Ideographic Description Characters"](t)||(!!Gn.Kanbun(t)||(!!Gn["Kangxi Radicals"](t)||(!!Gn["Katakana Phonetic Extensions"](t)||(!(!Gn.Katakana(t)||12540===t)||(!(!Gn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Gn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Gn["Unified Canadian Aboriginal Syllabics"](t)||(!!Gn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Gn["Vertical Forms"](t)||(!!Gn["Yijing Hexagram Symbols"](t)||(!!Gn["Yi Syllables"](t)||!!Gn["Yi Radicals"](t))))))))))))))))))))))))))))))}function Jn(t){return!(Xn(t)||function(t){return!(!Gn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Gn["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!Gn["Letterlike Symbols"](t)||(!!Gn["Number Forms"](t)||(!(!Gn["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!Gn["Control Pictures"](t)||9251===t)||(!!Gn["Optical Character Recognition"](t)||(!!Gn["Enclosed Alphanumerics"](t)||(!!Gn["Geometric Shapes"](t)||(!(!Gn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Gn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Gn["CJK Symbols and Punctuation"](t)||(!!Gn.Katakana(t)||(!!Gn["Private Use Area"](t)||(!!Gn["CJK Compatibility Forms"](t)||(!!Gn["Small Form Variants"](t)||(!!Gn["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function Kn(t){return t>=1424&&t<=2303||Gn["Arabic Presentation Forms-A"](t)||Gn["Arabic Presentation Forms-B"](t)}function Qn(t,e){return!(!e&&Kn(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Gn.Khmer(t))}function $n(t){for(var e=0,r=t;e-1&&(ia=na),aa&&aa(t)};function la(){ua.fire(new At("pluginStateChange",{pluginStatus:ia,pluginURL:oa}))}var ua=new Ct,ca=function(){return ia},pa=function(){if(ia!==ta||!oa)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ia=ea,la(),oa&&_t({url:oa},(function(t){t?sa(t):(ia=ra,la())}))},ha={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ia===ra||null!=ha.applyArabicShaping},isLoading:function(){return ia===ea},setState:function(t){ia=t.pluginStatus,oa=t.pluginURL},isParsed:function(){return null!=ha.applyArabicShaping&&null!=ha.processBidirectionalText&&null!=ha.processStyledBidirectionalText},getPluginURL:function(){return oa}},fa=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Zn,this.transition={})};fa.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var da=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Br(t))return new Kr(t,e);if(Gr(t)){var r=Jr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};da.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},da.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ma=function(t){this.property=t,this.value=new da(t,void 0)};ma.prototype.transitioned=function(t,e){return new ga(this.property,this.value,e,c({},t.transition,this.transition),t.now)},ma.prototype.untransitioned=function(){return new ga(this.property,this.value,null,{},0)};var ya=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ya.prototype.getValue=function(t){return _(this._values[t].value.value)},ya.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ma(this._values[t].property)),this._values[t].value=new da(this._values[t].property,null===e?void 0:_(e))},ya.prototype.getTransition=function(t){return _(this._values[t].transition)},ya.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ma(this._values[t].property)),this._values[t].transition=_(e)||void 0},ya.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return a};var va=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};va.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ba(this._properties),a=0,i=Object.keys(this._values);an.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ta),Ma=function(t){this.specification=t};Ma.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var a=t.expression.evaluate(e,null,{},r,n);return this._calculate(a,a,a,e)}return this._calculate(t.expression.evaluate(new fa(Math.floor(e.zoom-1),e)),t.expression.evaluate(new fa(Math.floor(e.zoom),e)),t.expression.evaluate(new fa(Math.floor(e.zoom+1),e)),e)}},Ma.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ma.prototype.interpolate=function(t){return t};var Aa=function(t){this.specification=t};Aa.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Aa.prototype.interpolate=function(){return!1};var Sa=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new da(r,void 0),a=this.defaultTransitionablePropertyValues[e]=new ma(r);this.defaultTransitioningPropertyValues[e]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Nn("DataDrivenProperty",Ta),Nn("DataConstantProperty",wa),Nn("CrossFadedDataDrivenProperty",ka),Nn("CrossFadedProperty",Ma),Nn("ColorRampProperty",Aa);var Ca=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new _a(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ya(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ba(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(En,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Pn,n,t,e,r))return!1}if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var a=this._transitionablePaint._values[t],i="cross-faded-data-driven"===a.property.specification["property-type"],o=a.value.isDataDriven(),s=a.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Dn(this,t.call(Ln,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof xa&&zr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Ct),La={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ia=function(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},Pa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ea(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var a,i=(a=t.type,La[a].BYTES_PER_ELEMENT),o=r=Da(r,Math.max(e,i)),s=t.components||1;return n=Math.max(n,i),r+=i*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Da(r,Math.max(n,e)),alignment:e}}function Da(t,e){return Math.ceil(t/e)*e}Pa.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Pa.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Pa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Pa.prototype.clear=function(){this.length=0},Pa.prototype.resize=function(t){this.reserve(t),this.length=t},Pa.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Pa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Pa);za.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",za);var Oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,this.int16[i+3]=a,t},e}(Pa);Oa.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Oa);var Ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(Pa);Ra.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Ra);var Fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=a,this.uint8[l+6]=i,this.uint8[l+7]=o,t},e}(Pa);Fa.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Fa);var Ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,a,i,o,s,l,u)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c){var p=9*t,h=18*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=a,this.uint16[p+4]=i,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.uint8[h+16]=u,this.uint8[h+17]=c,t},e}(Pa);Ba.prototype.bytesPerElement=18,Nn("StructArrayLayout8ui2ub18",Ba);var Na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,a,i,o,s,l,u,c,p)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=a,this.uint16[f+4]=i,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(Pa);Na.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",Na);var ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,t},e}(Pa);ja.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",ja);var Ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Pa);Ua.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Ua);var Va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,a,i,o,s,l)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u){var c=10*t,p=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=a,this.int16[c+4]=i,this.int16[c+5]=o,this.uint32[p+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(Pa);Va.prototype.bytesPerElement=20,Nn("StructArrayLayout6i1ul2ui20",Va);var qa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(Pa);qa.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",qa);var Ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n,a)},e.prototype.emplace=function(t,e,r,n,a,i){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=a,this.int16[s+7]=i,t},e}(Pa);Ha.prototype.bytesPerElement=16,Nn("StructArrayLayout2f1f2i16",Ha);var Za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=12*t,o=3*t;return this.uint8[i+0]=e,this.uint8[i+1]=r,this.float32[o+1]=n,this.float32[o+2]=a,t},e}(Pa);Za.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",Za);var Ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.uint16[a+0]=e,this.uint16[a+1]=r,this.uint16[a+2]=n,t},e}(Pa);Ga.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",Ga);var Ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g){var v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=a,this.uint32[_+2]=i,this.uint32[_+3]=o,this.uint32[_+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[_+7]=p,this.float32[_+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[_+10]=y,this.int16[v+22]=g,t},e}(Pa);Ya.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ya);var Wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S,C){var L=34*t,I=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=a,this.int16[L+4]=i,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=u,this.uint16[L+9]=c,this.uint16[L+10]=p,this.uint16[L+11]=h,this.uint16[L+12]=f,this.uint16[L+13]=d,this.uint16[L+14]=m,this.uint16[L+15]=y,this.uint16[L+16]=g,this.uint16[L+17]=v,this.uint16[L+18]=_,this.uint16[L+19]=x,this.uint16[L+20]=b,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[I+12]=k,this.float32[I+13]=M,this.float32[I+14]=A,this.float32[I+15]=S,this.float32[I+16]=C,t},e}(Pa);Wa.prototype.bytesPerElement=68,Nn("StructArrayLayout8i15ui1ul4f68",Wa);var Xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Pa);Xa.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Xa);var Ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,t},e}(Pa);Ja.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Ja);var Ka=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=2*t,i=4*t;return this.uint32[a+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Pa);Ka.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Ka);var Qa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Pa);Qa.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",Qa);var $a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Pa);$a.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",$a);var ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Pa);ti.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",ti);var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,this.float32[i+3]=a,t},e}(Pa);ei.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",ei);var ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ia);ri.prototype.size=20;var ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ri(this,t)},e}(Va);Nn("CollisionBoxArray",ni);var ai=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ia);ai.prototype.size=48;var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ai(this,t)},e}(Ya);Nn("PlacedSymbolArray",ii);var oi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ia);oi.prototype.size=68;var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new oi(this,t)},e}(Wa);Nn("SymbolInstanceArray",si);var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Xa);Nn("GlyphOffsetArray",li);var ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ja);Nn("SymbolLineVertexArray",ui);var ci=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ia);ci.prototype.size=8;var pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ci(this,t)},e}(Ka);Nn("FeatureIndexArray",pi);var hi=Ea([{name:"a_pos",components:2,type:"Int16"}],4).members,fi=function(t){void 0===t&&(t=[]),this.segments=t};function di(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}fi.prototype.prepareSegment=function(t,e,r,n){var a=this.segments[this.segments.length-1];return t>fi.MAX_VERTEX_ARRAY_LENGTH&&b("Max vertices per segment is "+fi.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!a||a.vertexLength+t>fi.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a},fi.prototype.get=function(){return this.segments},fi.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:a^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),gi=e((function(t){t.exports=function(t,e){for(var r,n=t.length,a=e^n,i=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:a^=(255&t.charCodeAt(i+2))<<16;case 2:a^=(255&t.charCodeAt(i+1))<<8;case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(i)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0}})),vi=yi,_i=yi,xi=gi;vi.murmur3=_i,vi.murmur2=xi;var bi=function(){this.ids=[],this.positions=[],this.indexed=!1};bi.prototype.add=function(t,e,r,n){this.ids.push(Ti(t)),this.positions.push(e,r,n)},bi.prototype.getPositions=function(t){for(var e=Ti(t),r=0,n=this.ids.length-1;r>1;this.ids[a]>=e?n=a:r=a+1}for(var i=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];i.push({index:o,start:s,end:l}),r++}return i},bi.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,a){for(;n>1],o=n-1,s=a+1;;){do{o++}while(e[o]i);if(o>=s)break;ki(e,o,s),ki(r,3*o,3*s),ki(r,3*o+1,3*s+1),ki(r,3*o+2,3*s+2)}s-nZi.max||o.yZi.max)&&(b("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Zi.min,Zi.max),o.y=l(o.y,Zi.min,Zi.max))}return r}function Yi(t,e,r,n,a){t.emplaceBack(2*e+(n+1)/2,2*r+(a+1)/2)}var Wi=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new za,this.indexArray=new Ga,this.segments=new fi,this.programConfigurations=new Ui(hi,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Xi(t,e){for(var r=0;r1){if($i(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(a)._add(e))}function no(t,e){for(var r,n,a,i=!1,o=0;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(i=!i);return i}function ao(t,e){for(var r=!1,n=0,a=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function io(t,e,r){var n=r[0],a=r[2];if(t.xa.x&&e.x>a.x||t.ya.y&&e.y>a.y)return!1;var i=w(t,e,r[0]);return i!==w(t,e,r[1])||i!==w(t,e,r[2])||i!==w(t,e,r[3])}function oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function so(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function lo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;Yi(this.layoutVertexArray,u,c,-1,-1),Yi(this.layoutVertexArray,u,c,1,-1),Yi(this.layoutVertexArray,u,c,1,1),Yi(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Nn("CircleBucket",Wi,{omit:["layers"]});var uo=new Sa({"circle-sort-key":new Ta(Lt.layout_circle["circle-sort-key"])}),co={paint:new Sa({"circle-radius":new Ta(Lt.paint_circle["circle-radius"]),"circle-color":new Ta(Lt.paint_circle["circle-color"]),"circle-blur":new Ta(Lt.paint_circle["circle-blur"]),"circle-opacity":new Ta(Lt.paint_circle["circle-opacity"]),"circle-translate":new wa(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new wa(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wa(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wa(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ta(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ta(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ta(Lt.paint_circle["circle-stroke-opacity"])}),layout:uo},po="undefined"!=typeof Float32Array?Float32Array:Array;function ho(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}function fo(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*a+x*l+b*h+w*y,t[2]=_*i+x*u+b*f+w*g,t[3]=_*o+x*c+b*d+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*a+x*l+b*h+w*y,t[6]=_*i+x*u+b*f+w*g,t[7]=_*o+x*c+b*d+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*a+x*l+b*h+w*y,t[10]=_*i+x*u+b*f+w*g,t[11]=_*o+x*c+b*d+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*a+x*l+b*h+w*y,t[14]=_*i+x*u+b*f+w*g,t[15]=_*o+x*c+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var mo=fo;var yo,go,vo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};yo=new po(3),po!=Float32Array&&(yo[0]=0,yo[1]=0,yo[2]=0),go=yo;function _o(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}!function(){var t=function(){var t=new po(4);return po!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var xo=function(t){var e=t[0],r=t[1];return e*e+r*r},bo=(function(){var t=function(){var t=new po(2);return po!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),function(t){function e(e){t.call(this,e,co)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Wi(t)},e.prototype.queryRadius=function(t){var e=t;return oo("circle-radius",this,e)+oo("circle-stroke-width",this,e)+so(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,i,o,s){for(var l=lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),p=c?l:function(t,e){return t.map((function(t){return wo(t,e)}))}(l,s),h=c?u*o:u,f=0,d=n;ft.width||a.height>t.height||r.x>t.width-a.width||r.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||n.x>e.width-a.width||n.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=i=t[0],a=o=t[1];for(var d=r;di&&(i=s),l>o&&(o=l);u=0!==(u=Math.max(i-n,o-a))?1/u:0}return jo(h,f,r,n,a,u),f}function Bo(t,e,r,n,a){var i,o;if(a===ls(t,e,r,n)>0)for(i=e;i=e;i-=n)o=is(i,t[i],t[i+1],o);return o&&$o(o,o.next)&&(os(o),o=o.next),o}function No(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!$o(n,n.next)&&0!==Qo(n.prev,n,n.next))n=n.next;else{if(os(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,a,i,o){if(t){!o&&i&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=Wo(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,i);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,i?Vo(t,n,a,i):Uo(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),os(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?jo(t=qo(No(t),e,r),e,r,n,a,i,2):2===o&&Ho(t,e,r,n,a,i):jo(No(t),e,r,n,a,i,1);break}}}function Uo(t){var e=t.prev,r=t,n=t.next;if(Qo(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(Jo(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&Qo(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Vo(t,e,r,n){var a=t.prev,i=t,o=t.next;if(Qo(a,i,o)>=0)return!1;for(var s=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,p=Wo(s,l,e,r,n),h=Wo(u,c,e,r,n),f=t.prevZ,d=t.nextZ;f&&f.z>=p&&d&&d.z<=h;){if(f!==t.prev&&f!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&Qo(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&Qo(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function qo(t,e,r){var n=t;do{var a=n.prev,i=n.next.next;!$o(a,i)&&ts(a,n,n.next,i)&&ns(a,i)&&ns(i,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(i.i/r),os(n),os(n.next),n=t=i),n=n.next}while(n!==t);return No(n)}function Ho(t,e,r,n,a,i){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ko(o,s)){var l=as(o,s);return o=No(o,o.next),l=No(l,l.next),jo(o,e,r,n,a,i),void jo(l,e,r,n,a,i)}s=s.next}o=o.next}while(o!==t)}function Zo(t,e){return t.x-e.x}function Go(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&a!==n.x&&Jo(ir.x||n.x===r.x&&Yo(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=as(e,t);No(e,e.next),No(r,r.next)}}function Yo(t,e){return Qo(t.prev,t,e.prev)<0&&Qo(e.next,t,t.next)<0}function Wo(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Xo(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function Ko(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&ts(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ns(t,e)&&ns(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Qo(t.prev,t,e.prev)||Qo(t,e.prev,e))||$o(t,e)&&Qo(t.prev,t,t.next)>0&&Qo(e.prev,e,e.next)>0)}function Qo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $o(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,r,n){var a=rs(Qo(t,e,r)),i=rs(Qo(t,e,n)),o=rs(Qo(r,n,t)),s=rs(Qo(r,n,e));return a!==i&&o!==s||(!(0!==a||!es(t,r,e))||(!(0!==i||!es(t,n,e))||(!(0!==o||!es(r,t,n))||!(0!==s||!es(r,e,n)))))}function es(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function rs(t){return t>0?1:t<0?-1:0}function ns(t,e){return Qo(t.prev,t,t.next)<0?Qo(t,e,t.next)>=0&&Qo(t,t.prev,e)>=0:Qo(t,e,t.prev)<0||Qo(t,t.next,e)<0}function as(t,e){var r=new ss(t.i,t.x,t.y),n=new ss(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function is(t,e,r,n){var a=new ss(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function os(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 ss(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 ls(t,e,r,n){for(var a=0,i=e,o=r-n;in;){if(a-n>600){var o=a-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1),p=Math.max(n,Math.floor(r-s*u/o+c)),h=Math.min(a,Math.floor(r+(o-s)*u/o+c));t(e,r,p,h,i)}var f=e[r],d=n,m=a;for(cs(e,n,r),i(e[a],f)>0&&cs(e,n,a);d0;)m--}0===i(e[n],f)?cs(e,n,m):(m++,cs(e,m,a)),m<=r&&(n=m+1),r<=m&&(a=m-1)}}(t,e,r||0,n||t.length-1,a||ps)}function cs(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ps(t,e){return te?1:0}function hs(t,e){var r=t.length;if(r<=1)return[t];for(var n,a,i=[],o=0;o1)for(var l=0;l0&&(n+=t[a-1].length,r.holes.push(n))}return r},Oo.default=Ro;var ys=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new za,this.indexArray=new Ga,this.indexArray2=new Qa,this.programConfigurations=new Ui(zo,t.layers,t.zoom),this.segments=new fi,this.segments2=new fi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ys.prototype.populate=function(t,e,r){this.hasPattern=ds("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),a=[],i=0,o=t;i>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ws.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,a=0,i=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)(a+=t.readSVarint())s&&(s=a),(i+=t.readSVarint())u&&(u=i);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},ws.prototype.toGeoJSON=function(t,e,r){var n,a,i=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=ws.types[this.type];function c(t){for(var e=0;e>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}(r))}function Cs(t,e,r){if(3===t){var n=new Ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}As.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 bs(this._pbf,e,this.extent,this._keys,this._values)};var Ls={VectorTile:function(t,e){this.layers=t.readFields(Cs,{},e)},VectorTileFeature:bs,VectorTileLayer:Ms},Is=Ls.VectorTileFeature.types,Ps=Math.pow(2,13);function Es(t,e,r,n,a,i,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ps)+o,a*Ps*2,i*Ps*2,Math.round(s))}var Ds=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ra,this.indexArray=new Ga,this.programConfigurations=new Ui(xs,t.layers,t.zoom),this.segments=new fi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function zs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Os(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>8192}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>8192}))}Ds.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ds("fill-extrusion",this.layers,e);for(var n=0,a=t;n=1){var v=d[y-1];if(!zs(g,v)){p.vertexLength+4>fi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=g.sub(v)._perp()._unit(),x=v.dist(g);m+x>32768&&(m=0),Es(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,0,m),Es(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,1,m),m+=x,Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+l>fi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Is[t.type]){for(var w=[],T=[],k=p.vertexLength,M=0,A=s;M=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u0;if(T&&g>u){var M=c.dist(f);if(M>2*p){var A=c.sub(c.sub(f)._mult(p/M)._round());this.updateDistance(f,A),this.addCurrentVertex(A,m,0,0,h),f=A}}var S=f&&d,C=S?r:s?"butt":n;if(S&&"round"===C&&(ba&&(C="bevel"),"bevel"===C&&(b>2&&(C="flipbevel"),b100)v=y.mult(-1);else{var L=b*m.add(y).mag()/m.sub(y).mag();v._perp()._mult(L*(k?-1:1))}this.addCurrentVertex(c,v,0,0,h),this.addCurrentVertex(c,v.mult(-1),0,0,h)}else if("bevel"===C||"fakeround"===C){var I=-Math.sqrt(b*b-1),P=k?I:0,E=k?0:I;if(f&&this.addCurrentVertex(c,m,P,E,h),"fakeround"===C)for(var D=Math.round(180*w/Math.PI/20),z=1;z2*p){var j=c.add(d.sub(c)._mult(p/N)._round());this.updateDistance(c,j),this.addCurrentVertex(j,y,0,0,h),c=j}}}}},Hs.prototype.addCurrentVertex=function(t,e,r,n,a,i){void 0===i&&(i=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,u=-e.y-e.x*n;this.addHalfVertex(t,o,s,i,!1,r,a),this.addHalfVertex(t,l,u,i,!0,-n,a),this.distance>qs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,a,i))},Hs.prototype.addHalfVertex=function(t,e,r,n,a,i,o){var s=t.x,l=t.y,u=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(a?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===i?0:i<0?-1:1)|(63&u)<<2,u>>6);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),a?this.e2=c:this.e1=c},Hs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(qs-1):this.distance},Hs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Nn("LineBucket",Hs,{omit:["layers","patternFeatures"]});var Zs=new Sa({"line-cap":new wa(Lt.layout_line["line-cap"]),"line-join":new Ta(Lt.layout_line["line-join"]),"line-miter-limit":new wa(Lt.layout_line["line-miter-limit"]),"line-round-limit":new wa(Lt.layout_line["line-round-limit"]),"line-sort-key":new Ta(Lt.layout_line["line-sort-key"])}),Gs={paint:new Sa({"line-opacity":new Ta(Lt.paint_line["line-opacity"]),"line-color":new Ta(Lt.paint_line["line-color"]),"line-translate":new wa(Lt.paint_line["line-translate"]),"line-translate-anchor":new wa(Lt.paint_line["line-translate-anchor"]),"line-width":new Ta(Lt.paint_line["line-width"]),"line-gap-width":new Ta(Lt.paint_line["line-gap-width"]),"line-offset":new Ta(Lt.paint_line["line-offset"]),"line-blur":new Ta(Lt.paint_line["line-blur"]),"line-dasharray":new Ma(Lt.paint_line["line-dasharray"]),"line-pattern":new ka(Lt.paint_line["line-pattern"]),"line-gradient":new Aa(Lt.paint_line["line-gradient"])}),layout:Zs},Ys=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new fa(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,a){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,a)},e}(Ta))(Gs.paint.properties["line-width"].specification);Ys.useIntegerZoom=!0;var Ws=function(t){function e(e){t.call(this,e,Gs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Io(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ys.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Hs(t)},e.prototype.queryRadius=function(t){var e=t,r=Xs(oo("line-width",this,e),oo("line-gap-width",this,e)),n=oo("line-offset",this,e);return r/2+Math.abs(n)+so(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*Xs(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var i=0;i0?e+2*t:t}var Js=Ea([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ks=Ea([{name:"a_projected_pos",components:3,type:"Float32"}],4),Qs=(Ea([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ea([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),$s=(Ea([{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:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),tl=Ea([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ea([{name:"triangle",components:3,type:"Uint16"}]),Ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ea([{type:"Float32",name:"offsetX"}]),Ea([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function el(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ha.applyArabicShaping&&(t=ha.applyArabicShaping(t)),t}(t.text,e,r)})),t}var rl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var nl=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,p=r?a-1:0,h=r?-1:1,f=t[e+p];for(p+=h,i=f&(1<<-c)-1,f>>=-c,c+=s;c>0;i=256*i+t[e+p],p+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+p],p+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),i-=u}return(f?-1:1)*o*Math.pow(2,i-n)},al=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,d=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+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(e*l-1)*Math.pow(2,a),o+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,a),o=0));a>=8;t[r+f]=255&s,f+=d,s/=256,a-=8);for(o=o<0;t[r+f]=255&o,f+=d,o/=256,u-=8);t[r+f-d]|=128*m},il=ol;function ol(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ol.Varint=0,ol.Fixed64=1,ol.Bytes=2,ol.Fixed32=5;var sl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ll(t){return t.type===ol.Bytes?t.readVarint()+t.pos:t.pos+1}function ul(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function cl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var a=r.pos-1;a>=t;a--)r.buf[a+n]=r.buf[a]}function pl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ol.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,i=this.pos;this.type=7&n,t(a,e,this),this.pos===i&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=xl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=xl(this.buf,this.pos)+4294967296*xl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=xl(this.buf,this.pos)+4294967296*wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,a,i=r.buf;if(a=i[r.pos++],n=(112&a)>>4,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<3,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<10,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<17,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<24,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(1&a)<<31,a<128)return ul(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},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.pos;return this.pos=t,t-e>=12&&sl?function(t,e,r){return sl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",a=e;for(;a239?4:l>223?3:l>191?2:1;if(a+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(i=t[a+1]))&&(u=(31&l)<<6|63&i)<=127&&(u=null):3===c?(i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&((u=(15&l)<<12|(63&i)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&i)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),a+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ol.Bytes)return t.push(this.readVarint(e));var r=ll(this);for(t=t||[];this.pos127;);else if(e===ol.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ol.Fixed32)this.pos+=4;else{if(e!==ol.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),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),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,a,i=0;i55295&&n<57344){if(!a){n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(t[r++]=239,t[r++]=191,t[r++]=189,a=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&cl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),al(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),al(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&cl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ol.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_l,e)},writeBytesField:function(t,e){this.writeTag(t,ol.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ol.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ol.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Tl(t,e,r){1===t&&r.readMessage(kl,e)}function kl(t,e,r){if(3===t){var n=r.readMessage(Ml,{}),a=n.id,i=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:a,bitmap:new So({width:o+6,height:s+6},i),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function Ml(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())}function Al(t){for(var e=0,r=0,n=0,a=t;n=0;h--){var f=o[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,l=Math.max(l,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=o.pop();h0&&N>M&&(M=N)}else{var j=r[S.fontStack],U=j&&j[L];if(U&&U.rect)E=U.rect,P=U.metrics;else{var V=e[S.fontStack],q=V&&V[L];if(!q)continue;P=q.metrics}I=24*(b-S.scale)}O?(t.verticalizable=!0,k.push({glyph:L,imageName:D,x:h,y:f+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:C,metrics:P,rect:E}),h+=z*S.scale+u):(k.push({glyph:L,imageName:D,x:h,y:f+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:C,metrics:P,rect:E}),h+=P.advance*S.scale+u)}if(0!==k.length){var H=h-u;d=Math.max(H,d),Vl(k,0,k.length-1,y,M)}h=0;var Z=i*b+M;T.lineOffset=Math.max(M,w),f+=Z,m=Math.max(Z,m),++g}else f+=i,++g}var G;var Y=f- -17,W=Ul(o),X=W.horizontalAlign,J=W.verticalAlign;(function(t,e,r,n,a,i,o,s,l){var u=(e-r)*a,c=0;c=i!==o?-s*n- -17:(-n*l+.5)*o;for(var p=0,h=t;p=0&&n>=t&&zl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},El.prototype.substring=function(t,e){var r=new El;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},El.prototype.toString=function(){return this.text},El.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},El.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Pl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ol={};function Rl(t,e,r,n,a,i){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/i+a:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+a:0}function Fl(t,e,r,n){var a=Math.pow(t-e,2);return n?t=0,p=0,h=0;h-r/2;){if(--o<0)return!1;s-=t[o].dist(i),i=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>a)return!1;o++,s+=p.dist(h)}return!0}function Jl(t){for(var e=0,r=0;ru){var d=(u-l)/f,m=He(p.x,h.x,d),y=He(p.y,h.y,d),g=new Hl(m,y,h.angleTo(p),c);return g._round(),!o||Xl(t,g,s,o,e)?g:void 0}l+=f}}function tu(t,e,r,n,a,i,o,s,l){var u=Kl(n,i,o),c=Ql(n,a),p=c*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-p=0&&b=0&&w=0&&f+c<=p){var T=new Hl(b,w,_,m);T._round(),a&&!Xl(e,T,o,a,i)||d.push(T)}}h+=v}l||d.length||s||(d=t(e,h/2,n,a,i,o,s,!0,u));return d}(t,h?e/2*s%e:(c/2+2*i)*o*s%e,e,u,r,p,h,!1,l)}function eu(t,e,r,n,i){for(var o=[],s=0;s=n&&h.x>=n||(p.x>=n?p=new a(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new a(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=i&&h.y>=i||(p.y>=i?p=new a(p.x+(h.x-p.x)*((i-p.y)/(h.y-p.y)),i)._round():h.y>=i&&(h=new a(p.x+(h.x-p.x)*((i-p.y)/(h.y-p.y)),i)._round()),u&&p.equals(u[u.length-1])||(u=[p],o.push(u)),u.push(h)))))}return o}function ru(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,c=t.right-t.left,p=t.bottom-t.top,h=o.stretchX||[[0,l]],f=o.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),y=f.reduce(d,0),g=l-m,v=u-y,_=0,x=m,b=0,w=y,T=0,k=g,M=0,A=v;if(o.content&&n){var S=o.content;_=nu(h,0,S[0]),b=nu(f,0,S[1]),x=nu(h,S[0],S[2]),w=nu(f,S[1],S[3]),T=S[0]-_,M=S[1]-b,k=S[2]-S[0]-x,A=S[3]-S[1]-w}var C=function(n,i,l,u){var h=iu(n.stretch-_,x,c,t.left),f=ou(n.fixed-T,k,n.stretch,m),d=iu(i.stretch-b,w,p,t.top),g=ou(i.fixed-M,A,i.stretch,y),v=iu(l.stretch-_,x,c,t.left),S=ou(l.fixed-T,k,l.stretch,m),C=iu(u.stretch-b,w,p,t.top),L=ou(u.fixed-M,A,u.stretch,y),I=new a(h,d),P=new a(v,d),E=new a(v,C),D=new a(h,C),z=new a(f/s,g/s),O=new a(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];I._matMult(N),P._matMult(N),D._matMult(N),E._matMult(N)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=u.stretch+u.fixed;return{tl:I,tr:P,bl:D,br:E,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:O,minFontScaleX:k/s/c,minFontScaleY:A/s/p,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=au(h,g,m),I=au(f,v,y),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,y=o.bottom*s+l,g=o.left*s-l,v=o.right*s+l,_=o.collisionPadding;if(_&&(g-=_[0]*s,m-=_[1]*s,v+=_[2]*s,y+=_[3]*s),c){var x=new a(g,m),b=new a(v,m),w=new a(g,y),T=new a(v,y),k=c*Math.PI/180;x._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),g=Math.min(x.x,b.x,w.x,T.x),v=Math.max(x.x,b.x,w.x,T.x),m=Math.min(x.y,b.y,w.y,T.y),y=Math.max(x.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,g,m,v,y,r,n,i)}this.boxEndIndex=t.length},lu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=uu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function uu(t,e){return te?1:0}function cu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],u=0;uo)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var p=o-n,h=s-i,f=Math.min(p,h),d=f/2,m=new lu([],pu);if(0===f)return new a(n,i);for(var y=n;yv.d||!v.d)&&(v=x,r&&console.log("found best %d after %d probes",Math.round(1e4*x.d)/1e4,_)),x.max-v.d<=e||(d=x.h/2,m.push(new hu(x.p.x-d,x.p.y-d,d,t)),m.push(new hu(x.p.x+d,x.p.y-d,d,t)),m.push(new hu(x.p.x-d,x.p.y+d,d,t)),m.push(new hu(x.p.x+d,x.p.y+d,d,t)),_+=4)}return r&&(console.log("num probes: "+_),console.log("best distance: "+v.d)),v.p}function pu(t,e){return e.max-t.max}function hu(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,a=0;at.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,ro(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}lu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},lu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},lu.prototype.peek=function(){return this.data[0]},lu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var a=t-1>>1,i=e[a];if(r(n,i)>=0)break;e[t]=i,t=a}e[t]=n},lu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,a=e[t];t=0)break;e[t]=o,t=i}e[t]=a};var fu=Number.POSITIVE_INFINITY;function du(t,e){return e[1]!==fu?function(t,e,r){var n=0,a=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":a=r-7;break;case"bottom-right":case"bottom-left":case"bottom":a=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,a]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var a=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=a-7;break;case"bottom-right":case"bottom-left":n=7-a;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-a;break;case"top-left":case"bottom-left":r=a;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function mu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function yu(t,e,r,n,i,o,s,l,u,c,p,h,f,d,m){var y=function(t,e,r,n,i,o,s,l){for(var u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[],p=0,h=e.positionedLines;p32640&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,v,l,o,s,c,e,u.lineStartIndex,u.lineLength,f,m);for(var _=0,x=p;_=0;o--)if(n.dist(i[o])0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=a.get("symbol-sort-key");if(this.features=[],l||u){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new fa(this.zoom),m=0,y=t;m=0;for(var D=0,z=k.sections;D=0;s--)i[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=e[s-1].dist(e[s]));for(var l=0;l0},Au.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Au.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Au.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Au.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Au.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,a=r.vertexStartIndex;a1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Nn("SymbolBucket",Au,{omit:["layers","collisionBoxArray","features","compareText"]}),Au.MAX_GLYPHS=65535,Au.addDynamicAttributes=wu;var Su=new Sa({"symbol-placement":new wa(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new wa(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wa(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ta(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wa(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wa(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wa(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new wa(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wa(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ta(Lt.layout_symbol["icon-size"]),"icon-text-fit":new wa(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wa(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ta(Lt.layout_symbol["icon-image"]),"icon-rotate":new Ta(Lt.layout_symbol["icon-rotate"]),"icon-padding":new wa(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new wa(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ta(Lt.layout_symbol["icon-offset"]),"icon-anchor":new Ta(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wa(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wa(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wa(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new Ta(Lt.layout_symbol["text-field"]),"text-font":new Ta(Lt.layout_symbol["text-font"]),"text-size":new Ta(Lt.layout_symbol["text-size"]),"text-max-width":new Ta(Lt.layout_symbol["text-max-width"]),"text-line-height":new wa(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ta(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new Ta(Lt.layout_symbol["text-justify"]),"text-radial-offset":new Ta(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wa(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ta(Lt.layout_symbol["text-anchor"]),"text-max-angle":new wa(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new wa(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new Ta(Lt.layout_symbol["text-rotate"]),"text-padding":new wa(Lt.layout_symbol["text-padding"]),"text-keep-upright":new wa(Lt.layout_symbol["text-keep-upright"]),"text-transform":new Ta(Lt.layout_symbol["text-transform"]),"text-offset":new Ta(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new wa(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wa(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new wa(Lt.layout_symbol["text-optional"])}),Cu={paint:new Sa({"icon-opacity":new Ta(Lt.paint_symbol["icon-opacity"]),"icon-color":new Ta(Lt.paint_symbol["icon-color"]),"icon-halo-color":new Ta(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ta(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ta(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new wa(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new wa(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ta(Lt.paint_symbol["text-opacity"]),"text-color":new Ta(Lt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ta(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new Ta(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ta(Lt.paint_symbol["text-halo-blur"]),"text-translate":new wa(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new wa(Lt.paint_symbol["text-translate-anchor"])}),layout:Su},Lu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};Lu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Lu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Lu.prototype.outputDefined=function(){return!1},Lu.prototype.serialize=function(){return null},Nn("FormatSectionOverride",Lu,{omit:["defaultValue"]});var Iu=function(t){function e(e){t.call(this,e,Cu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var a=[],i=0,o=n;i",targetMapId:n,sourceMapId:i.mapId})}}},Hu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Hu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hu.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Hn(e.error)):n(null,Hn(e.data)))}else{var a=!1,i=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){a=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,i)},i)}:function(t){a=!0},s=null,l=Hn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+e.type));!a&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Gu=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Gu.prototype.setNorthEast=function(t){return this._ne=t instanceof Yu?new Yu(t.lng,t.lat):Yu.convert(t),this},Gu.prototype.setSouthWest=function(t){return this._sw=t instanceof Yu?new Yu(t.lng,t.lat):Yu.convert(t),this},Gu.prototype.extend=function(t){var e,r,n=this._sw,a=this._ne;if(t instanceof Yu)e=t,r=t;else{if(!(t instanceof Gu)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var i=t;return this.extend(Gu.convert(i))}var o=t;return this.extend(Yu.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||a?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new Yu(e.lng,e.lat),this._ne=new Yu(r.lng,r.lat)),this},Gu.prototype.getCenter=function(){return new Yu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Gu.prototype.getSouthWest=function(){return this._sw},Gu.prototype.getNorthEast=function(){return this._ne},Gu.prototype.getNorthWest=function(){return new Yu(this.getWest(),this.getNorth())},Gu.prototype.getSouthEast=function(){return new Yu(this.getEast(),this.getSouth())},Gu.prototype.getWest=function(){return this._sw.lng},Gu.prototype.getSouth=function(){return this._sw.lat},Gu.prototype.getEast=function(){return this._ne.lng},Gu.prototype.getNorth=function(){return this._ne.lat},Gu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Gu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Gu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Gu.prototype.contains=function(t){var e=Yu.convert(t),r=e.lng,n=e.lat,a=this._sw.lat<=n&&n<=this._ne.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),a&&i},Gu.convert=function(t){return!t||t instanceof Gu?t:new Gu(t)};var Yu=function(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")};Yu.prototype.wrap=function(){return new Yu(u(this.lng,-180,180),this.lat)},Yu.prototype.toArray=function(){return[this.lng,this.lat]},Yu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Yu.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,a=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(a,1))},Yu.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Gu(new Yu(this.lng-r,this.lat-e),new Yu(this.lng+r,this.lat+e))},Yu.convert=function(t){if(t instanceof Yu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Yu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Yu(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Wu=2*Math.PI*6371008.8;function Xu(t){return Wu*Math.cos(t*Math.PI/180)}function Ju(t){return(180+t)/360}function Ku(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Qu(t,e){return t/Xu(e)}function $u(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var tc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};tc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Yu.convert(t);return new tc(Ju(r.lng),Ku(r.lat),Qu(e,r.lat))},tc.prototype.toLngLat=function(){return new Yu(360*this.x-180,$u(this.y))},tc.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Xu($u(e));var t,e},tc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Wu*(t=$u(this.y),1/Math.cos(t*Math.PI/180));var t};var ec=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ac(0,t,t,e,r)};ec.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ec.prototype.url=function(t,e){var r,n,a,i,o,s=(r=this.x,n=this.y,a=this.z,i=Zu(256*r,256*(n=Math.pow(2,a)-n-1),a),o=Zu(256*(r+1),256*(n+1),a),i[0]+","+i[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,a="",i=t;i>0;i--)a+=(e&(n=1<this.canonical.z?new nc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},nc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?ac(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ac(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nc.prototype.children=function(t){if(this.overscaledZ>=t)return[new nc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nc(e,this.wrap,e,r,n),new nc(e,this.wrap,e,r+1,n),new nc(e,this.wrap,e,r,n+1),new nc(e,this.wrap,e,r+1,n+1)]},nc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},ic.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},ic.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},ic.prototype.getPixels=function(){return new Co({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ic.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,a=e*this.dim+this.dim,i=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=a-1;break;case 1:a=n+1}switch(r){case-1:i=o-1;break;case 1:o=i+1}for(var s=-e*this.dim,l=-r*this.dim,u=i;u=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},cc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ls.VectorTile(new il(this.rawTileData)).layers,this.sourceLayerCoder=new oc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},cc.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=sn(o.filter),u=t.queryGeometry,c=t.queryPadding*s,p=hc(u),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=hc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var u=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var c=0,p=u;c=0)return!0;return!1}(i,p)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(n);if(a.filter(new fa(this.tileID.overscaledZ),f))for(var d=this.getId(f,h),m=0;mn)a=!1;else if(e)if(this.expirationTimeot&&(t.getActor().send("enforceCacheSizeLimit",it),ht=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=eu,t.clone=function(t){var e=new po(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},t.clone$1=_,t.clone$2=function(t){var e=new po(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=tl,t.config=F,t.create=function(){var t=new po(16);return po!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new po(9);return po!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new po(4);return po!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Yr,t.createLayout=Ea,t.createStyleLayer=function(t){return"custom"===t.type?new Ou(t):new Ru[t.type](t)},t.cross=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.number=He,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-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]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new il(t).readFields(Tl,[])},t.pbf=il,t.performSymbolLayout=function(t,e,r,n,a,i,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=8192/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var p=t.textSizeData,h=p.minZoom,f=p.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new fa(h),o),u["text-size"].possiblyEvaluate(new fa(f),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,y=d.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new fa(m),o),u["icon-size"].possiblyEvaluate(new fa(y),o)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new fa(t.zoom+1),o),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new fa(t.zoom+1),o),c.textMaxSize=u["text-size"].possiblyEvaluate(new fa(18));for(var g=24*l.get("text-line-height"),v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),_=l.get("text-keep-upright"),x=l.get("text-size"),w=function(){var i=k[T],s=l.get("text-font").evaluate(i,{},o).join(","),u=x.evaluate(i,{},o),p=c.layoutTextSize.evaluate(i,{},o),h=c.layoutIconSize.evaluate(i,{},o),f={horizontal:{},vertical:void 0},d=i.text,m=[0,0];if(d){var y=d.toString(),w=24*l.get("text-letter-spacing").evaluate(i,{},o),M=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,w,T,k,M){var A,S,C,L,I,P=t.addToLineVertexArray(e,r),E=0,D=0,z=0,O=0,R=-1,F=-1,B={},N=vi(""),j=0,U=0;void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(A=s.layout.get("text-offset").evaluate(x,{},k).map((function(t){return 24*t})),j=A[0],U=A[1]):(j=24*s.layout.get("text-radial-offset").evaluate(x,{},k),U=fu);if(t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(x,{},k)+90,q=n.vertical;L=new su(l,e,u,c,p,q,h,f,d,V),o&&(I=new su(l,e,u,c,p,o,y,g,d,V))}if(a){var H=s.layout.get("icon-rotate").evaluate(x,{}),Z="none"!==s.layout.get("icon-text-fit"),G=ru(a,H,T,Z),Y=o?ru(o,H,T,Z):void 0;C=new su(l,e,u,c,p,a,y,g,!1,H),E=4*G.length;var W=t.iconSizeData,X=null;"source"===W.kind?(X=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===W.kind&&((X=[128*w.compositeIconSizes[0].evaluate(x,{},k),128*w.compositeIconSizes[1].evaluate(x,{},k)])[0]>32640||X[1]>32640)&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,X,_,v,x,!1,e,P.lineStartIndex,P.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,Y&&(D=4*Y.length,t.addSymbols(t.icon,Y,X,_,v,x,Il.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var J in n.horizontal){var K=n.horizontal[J];if(!S){N=vi(K.text);var Q=s.layout.get("text-rotate").evaluate(x,{},k);S=new su(l,e,u,c,p,K,h,f,d,Q)}var $=1===K.positionedLines.length;if(z+=yu(t,e,K,i,s,d,x,m,P,n.vertical?Il.horizontal:Il.horizontalOnly,$?Object.keys(n.horizontal):[J],B,R,w,k),$)break}n.vertical&&(O+=yu(t,e,n.vertical,i,s,d,x,m,P,Il.vertical,["vertical"],B,F,w,k));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=L?L.boxStartIndex:t.collisionBoxArray.length,nt=L?L.boxEndIndex:t.collisionBoxArray.length,at=C?C.boxStartIndex:t.collisionBoxArray.length,it=C?C.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,lt=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ut(S,lt),lt=ut(L,lt),lt=ut(C,lt);var ct=(lt=ut(I,lt))>-1?1:0;ct&&(lt*=M/24);t.glyphOffsetArray.length>=Au.MAX_GLYPHS&&b("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey);t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,tt,et,rt,nt,at,it,ot,st,u,z,O,E,D,ct,0,h,j,U,lt)}(t,p,s,r,n,a,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,w,M,l,_,T,A,d,e,i,u,c,o)};if("line"===S)for(var P=0,E=eu(e.geometry,0,0,8192,8192);P1){var V=$l(U,k,r.vertical||m,n,24,v);V&&I(U,V)}}else if("Polygon"===e.type)for(var q=0,H=hs(e.geometry,0);q=C.maxzoom))if("none"!==C.visibility)o(S,this.zoom,n),(m[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),c.bucketLayerIDs.push(S.map((function(t){return t.id})))}}}var L=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(L).length?i.send("getGlyphs",{uid:this.uid,stacks:L},(function(t,e){p||(p=t,h=e,E.call(l))})):h={};var I=Object.keys(y.iconDependencies);I.length?i.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,f=e,E.call(l))})):f={};var P=Object.keys(y.patternDependencies);function E(){if(p)return s(p);if(h&&f&&d){var e=new a(h),r=new t.ImageAtlas(f,d);for(var i in m){var l=m[i];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,h,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?i.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,E.call(l))})):d={},E.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,a=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[a]=new i(e);s.abort=this.loadVectorData(e,(function(e,i){if(delete n.loading[a],e||!i)return s.status="done",n.loaded[a]=s,r(e);var l=i.rawData,u={};i.expires&&(u.expires=i.expires),i.cacheControl&&(u.cacheControl=i.cacheControl);var c={};if(o){var p=o.finish();p&&(c.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=i.vectorTile,s.parse(i.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[a]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,a=t.uid,i=this;if(n&&n[a]){var o=n[a];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,r.availableImages,i.actor,a)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};c.prototype.loadTile=function(e,r){var n=e.uid,a=e.encoding,i=e.rawImageData,o=u&&i instanceof u?this.getImageData(i):i,s=new t.DEMData(n,o,a);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var p=function t(e,r){var n,a=e&&e.type;if("FeatureCollection"===a)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,a=0,i=0,o=r.length,s=0;s>1;!function t(e,r,n,a,i,o){for(;i>a;){if(i-a>600){var s=i-a+1,l=n-a+1,u=Math.log(s),c=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),h=Math.max(a,Math.floor(n-l*c/s+p)),f=Math.min(i,Math.floor(n+(s-l)*c/s+p));t(e,r,n,h,f,o)}var d=r[2*n+o],m=a,y=i;for(z(e,r,a,n),r[2*i+o]>d&&z(e,r,a,i);md;)y--}r[2*a+o]===d?z(e,r,a,y):(y++,z(e,r,y,i)),y<=n&&(a=y+1),n<=y&&(i=y-1)}}(t,e,o,n,a,i%2),D(t,e,r,n,o-1,i+1),D(t,e,r,o+1,a,i+1)}}function z(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}function R(t,e,r,n){var a=t-r,i=e-n;return a*a+i*i}b.fromVectorTileJs=w,b.fromGeojsonVt=T,b.GeoJSONWrapper=k;var F=function(t){return t[0]},B=function(t){return t[1]},N=function(t,e,r,n,a){void 0===e&&(e=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===a&&(a=Float64Array),this.nodeSize=n,this.points=t;for(var i=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new i(t.length),s=this.coords=new a(2*t.length),l=0;l=r&&s<=a&&l>=n&&l<=i&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=a&&l>=n&&l<=i&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===p?a>=s:i>=l)&&(u.push(m+1),u.push(h),u.push(y))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,a,i){for(var o=[0,t.length-1,0],s=[],l=a*a;o.length;){var u=o.pop(),c=o.pop(),p=o.pop();if(c-p<=i)for(var h=p;h<=c;h++)R(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var f=Math.floor((p+c)/2),d=e[2*f],m=e[2*f+1];R(d,m,r,n)<=l&&s.push(t[f]);var y=(u+1)%2;(0===u?r-a<=d:n-a<=m)&&(o.push(p),o.push(f-1),o.push(y)),(0===u?r+a>=d:n+a>=m)&&(o.push(f+1),o.push(c),o.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=W(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,a){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:a}}function q(t,e){var r=t.geometry.coordinates,n=r[0],a=r[1];return{x:G(n),y:Y(a),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:Z(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Z(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return W(W({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function G(t){return t/360+.5}function Y(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 W(t,e){for(var r in e)t[r]=e[r];return t}function X(t){return t.x}function J(t){return t.y}function K(t,e,r,n,a,i){var o=a-r,s=i-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=a,n=i):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function Q(t,e,r,n){var a={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(a*u-l*i)/2:Math.sqrt(Math.pow(l-a,2)+Math.pow(u-i,2))),a=l,i=u}var c=e.length-3;e[2]=1,function t(e,r,n,a){for(var i,o=a,s=n-r>>1,l=n-r,u=e[r],c=e[r+1],p=e[n],h=e[n+1],f=r+3;fo)i=f,o=d;else if(d===o){var m=Math.abs(f-s);ma&&(i-r>3&&t(e,r,i,a),e[i+2]=o,n-i>3&&t(e,i,n,a))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function nt(t,e,r,n){for(var a=0;a1?1:r}function ot(t,e,r,n,a,i,o,s){if(n/=e,i>=(r/=e)&&o=n)return null;for(var l=[],u=0;u=r&&d=n)){var m=[];if("Point"===h||"MultiPoint"===h)st(p,m,r,n,a);else if("LineString"===h)lt(p,m,r,n,a,!1,s.lineMetrics);else if("MultiLineString"===h)ct(p,m,r,n,a,!1);else if("Polygon"===h)ct(p,m,r,n,a,!0);else if("MultiPolygon"===h)for(var y=0;y=r&&o<=n&&(e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]))}}function lt(t,e,r,n,a,i,o){for(var s,l,u=ut(t),c=0===a?ht:ft,p=t.start,h=0;hr&&(l=c(u,f,d,y,g,r),o&&(u.start=p+s*l)):v>n?_=r&&(l=c(u,f,d,y,g,r),x=!0),_>n&&v<=n&&(l=c(u,f,d,y,g,n),x=!0),!i&&x&&(o&&(u.end=p+s*l),e.push(u),u=ut(t)),o&&(p+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(v=0===a?f:d)>=r&&v<=n&&pt(u,f,d,m),b=u.length-3,i&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&pt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function ut(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ct(t,e,r,n,a,i){for(var o=0;oo.maxX&&(o.maxX=c),p>o.maxY&&(o.maxY=p)}return o}function _t(t,e,r,n){var a=e.geometry,i=e.type,o=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s0&&e.size<(a?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;a&&function(t,e){for(var r=0,n=0,a=t.length,i=a-2;n0===e)for(n=0,a=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new N(s,X,J,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,a=180;else if(r>a){var o=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,a,i],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,p=l.range(G(r),Y(i),G(a),Y(n));c1?this._map(u,!0):null,y=(l<<5)+(e+1)+this.points.length,g=0,v=p;g>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?W({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?W({},n):n},bt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},bt.prototype.splitTile=function(t,e,r,n,a,i,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),h=this.tiles[p]=vt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,a){if(e===l.maxZoom||e===a)continue;var d=1<1&&console.time("clipping");var m,y,g,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=y=g=v=null,_=ot(t,c,r-b,r+T,0,h.minX,h.maxX,l),x=ot(t,c,r+w,r+k,0,h.minX,h.maxX,l),t=null,_&&(m=ot(_,c,n-b,n+T,1,h.minY,h.maxY,l),y=ot(_,c,n+w,n+k,1,h.minY,h.maxY,l),_=null),x&&(g=ot(x,c,n-b,n+T,1,h.minY,h.maxY,l),v=ot(x,c,n+w,n+k,1,h.minY,h.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(g||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},bt.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,i=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,p=r;!l&&u>0;)u--,c=Math.floor(c/2),p=Math.floor(p/2),l=this.tiles[wt(u,c,p)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",u,c,p),i>1&&console.time("drilling down"),this.splitTile(l.source,u,c,p,t,e,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?yt(this.tiles[s],a):null):null};var kt=function(e){function r(t,r,n,a){e.call(this,t,r,n,Tt),a&&(this.loadGeoJSON=a)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var a=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(i,o){if(i||!o)return r(i);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));p(o,!0);try{e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var a={},i={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function g(t,e,r,n,a,i,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(i.ranges[s])e(null,{stack:r,id:a,glyph:o});else{var l=i.requests[s];l||(l=i.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(i.glyphs[+r]=e[+r]);i.ranges[s]=!0}for(var a=0,o=l;a1&&(l=t[++s]);var c=Math.abs(u-l.left),p=Math.abs(u-l.right),h=Math.min(c,p),f=void 0,d=a/r*(n+1);if(l.isDash){var m=n-Math.abs(d);f=Math.sqrt(h*h+m*m)}else f=n-Math.sqrt(h*h+d*d);this.data[o+u]=Math.max(0,Math.min(255,f+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var a=t[0],i=t[t.length-1];a.isDash===i.isDash&&(a.left=i.left-this.width,i.right=a.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],u=0;u1&&(l=t[++s]);var c=Math.abs(u-l.left),p=Math.abs(u-l.right),h=Math.min(c,p),f=l.isDash?h:-h;this.data[o+u]=Math.max(0,Math.min(255,f+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,a=2*n+1;if(this.nextRow+a>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var i=0,o=0;o=n&&e.x=a&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,i,r.z,a,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),a=this._data;"string"==typeof a?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(a),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(a),this.actor.send(this.type+".loadData",n,(function(t,a){r._removed||a&&a.abandoned||(r._loaded=!0,a&&a.resourceTiming&&a.resourceTiming[r.id]&&(r._resourceTiming=a.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,a=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(a,i,(function(t,i){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(i,n.map.painter,"reloadTile"===a),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),E=function(e){function r(t,r,n,a){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(a),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(a,i){n._loaded=!0,a?n.fire(new t.ErrorEvent(a)):i&&(n.image=i,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,a=-1/0,i=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(E),z=function(e){function r(r,n,a,i){e.call(this,r,n,a,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var a in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var i=this.tiles[a];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),a=this.data[r][n];return this.data[r].splice(n,1),a.timeout&&clearTimeout(a.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(a.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,a=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[i]&&(t.neighboringTiles[i].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var a in this._tiles){var i=this._tiles[a];if(!(n[a]||!i.hasData()||i.tileID.overscaledZ<=e||i.tileID.overscaledZ>r)){for(var o=i.tileID;i&&i.tileID.overscaledZ>e+1;){var s=i.tileID.scaledTo(i.tileID.overscaledZ-1);(i=this._tiles[s.key])&&i.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var a=t.scaledTo(n),i=this._getLoadedTile(a);if(i)return i}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var a in this._tiles){var i=this._tiles[a];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+r),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var a;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(a=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(a=a.filter((function(t){return n._source.hasTile(t)})))):a=[];var i=e.coveringZoomLevel(this._source),o=Math.max(i-r.maxOverzooming,this._source.minzoom),s=Math.max(i+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(a,i);if(Et(this._source.type)){for(var u={},c={},p=0,h=Object.keys(l);pthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],g=this.getTile(y);if(g&&g.hasData()){n[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=i;--x){var b=d.scaledTo(x);if(a[b.key])break;if(a[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var a=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(a))break;n=a}for(var i=0,o=e;i0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var a=this,i=[],o=this.transform;if(!o)return i;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),u=s.map((function(t){return o.pointCoordinate(t)})),c=this.getIds(),p=1/0,h=1/0,f=-1/0,d=-1/0,m=0,y=u;m=0&&g[1].y+y>=0){var v=l.map((function(t){return s.getTilePoint(t)})),_=u.map((function(t){return s.getTilePoint(t)}));i.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles){this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading")}this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Et(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(Xa.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(a-o)/s:0;return this.points[i].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var i=0;i=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,a,i,o,s,l){var u=a?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],h=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var f=e.lineVertexArray,d=a?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,y=!1,g=0;gMath.abs(n.x-r.x)*a)return{useVertical:!0};return(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,a,i,o,s,l,u,c,p,h,f,d){var m,y=r/24,g=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ae(y,l,g,v,n,p,h,e,u,o,f);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,k=te(w.last.point,s).point;if(a&&!n){var M=ie(e.writingMode,T,k,d);if(M)return M}m=[w.first];for(var A=e.glyphStartIndex+1;A<_-1;A++)m.push(le(y*l.getoffsetX(A),g,v,n,p,h,e.segment,x,b,u,o,f));m.push(w.last)}else{if(a&&!n){var S=te(h,i).point,C=e.lineStartIndex+e.segment+1,L=new t.Point(u.getx(C),u.gety(C)),I=te(L,i),P=I.signedDistanceFromCamera>0?I.point:se(h,L,S,1,i),E=ie(e.writingMode,S,P,d);if(E)return E}var D=le(y*l.getoffsetX(e.glyphStartIndex),g,v,n,p,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f);if(!D)return{notEnoughRoom:!0};m=[D]}for(var z=0,O=m;z0?1:-1,m=0;a&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?l+s:l+s+1,g=i,v=i,_=0,x=0,b=Math.abs(f),w=[];_+x<=b;){if((y+=d)=u)return null;if(v=g,w.push(g),void 0===(g=h[y])){var T=new t.Point(c.getx(y),c.gety(y)),k=te(T,p);if(k.signedDistanceFromCamera>0)g=h[y]=k.point;else{var M=y-d;g=se(0===_?o:new t.Point(c.getx(M),c.gety(M)),T,v,b-_+1,p)}}_+=x,x=v.dist(g)}var A=(b-_)/x,S=g.sub(v),C=S.mult(A)._add(v);C._add(S._unit()._perp()._mult(n*d));var L=m+Math.atan2(g.y-v.y,g.x-v.x);return w.push(C),{point:C,angle:L,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,a){this._forEachCell(e,r,n,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,a,i){this.boxCells[a].push(i)},Kt.prototype._insertCircleCell=function(t,e,r,n,a,i){this.circleCells[a].push(i)},Kt.prototype._query=function(t,e,r,n,a,i){if(r<0||t>this.width||n<0||e>this.height)return!a&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(a)return!0;for(var s=0;s0:o},Kt.prototype._queryCircle=function(t,e,r,n,a){var i=t-r,o=t+r,s=e-r,l=e+r;if(o<0||i>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,s,o,l,this._queryCellCircle,u,c,a),n?u.length>0:u},Kt.prototype.query=function(t,e,r,n,a){return this._query(t,e,r,n,!1,a)},Kt.prototype.hitTest=function(t,e,r,n,a){return this._query(t,e,r,n,!0,a)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,a,i,o,s){var l=o.seenUids,u=this.boxCells[a];if(null!==u)for(var c=this.bboxes,p=0,h=u;p=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return i.push(!0),!0;i.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[a];if(null!==m)for(var y=this.circles,g=0,v=m;go*o+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,a,i,o){var s=(i-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-a)/2,c=Math.abs(e-(a+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var p=l-s,h=c-u;return p*p+h*h<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var r=0;r=1;P--)I.push(C.path[P]);for(var E=1;E0){for(var R=I[0].clone(),F=I[0].clone(),B=1;B=M.x&&F.x<=A.x&&R.y>=M.y&&F.y<=A.y?[I]:F.xA.x||F.yA.y?[]:t.clipLine([I],M.x,M.y,A.x,A.y)}for(var N=0,j=O;N=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:a,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:g,placedGlyphBoxes:v}},we.prototype.placeLayerBucketPart=function(e,r,n){var a=this,i=e.parameters,o=i.bucket,s=i.layout,l=i.posMatrix,u=i.textLabelPlaneMatrix,c=i.labelToScreenMatrix,p=i.textPixelRatio,h=i.holdingForFade,f=i.collisionBoxArray,d=i.partiallyEvaluatedTextSize,m=i.collisionGroup,y=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(_||!o.hasIconData()||g),M=_&&(v||!o.hasTextData()||y);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var A=function(e,i){if(!r[e.crossTileID])if(h)a.placements[e.crossTileID]=new ye(!1,!1,!1);else{var f,T=!1,A=!1,S=!0,C=null,L={box:null,offscreen:null},I={box:null,offscreen:null},P=null,E=null,D=0,z=0,O=0;i.textFeatureIndex?D=i.textFeatureIndex:e.useRuntimeCollisionCircles&&(D=e.featureIndex),i.verticalTextFeatureIndex&&(z=i.verticalTextFeatureIndex);var R=i.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&a.prevPlacement){var i=a.prevPlacement.placedOrientations[e.crossTileID];i&&(a.placedOrientations[e.crossTileID]=i,n=i,a.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i.verticalTextBox)for(var a=0,s=o.writingModes;a0&&(N=N.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,r,n){for(var i=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!_?r:null,h={box:[],offscreen:!1},f=v?2*N.length:N.length,d=0;d=N.length,k=a.attemptAnchorPlacement(y,t,i,s,u,x,b,p,l,m,g,e,o,n,c);if(k&&(h=k.placedGlyphBoxes)&&h.box&&h.box.length){T=!0,C=k.shift;break}}return h};B((function(){return U(R,i.iconBox,t.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox,n=L&&L.box&&L.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,i.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&a.prevPlacement){var q=a.prevPlacement.variableOffsets[e.crossTileID];q&&(a.variableOffsets[e.crossTileID]=q,a.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=a.collisionIndex.placeCollisionBox(t,v,p,l,m.predicate);return n&&n.box&&n.box.length&&(a.markUsedOrientation(o,r,e),a.placedOrientations[e.crossTileID]=r),n};B((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(L&&L.box&&L.box.length)}}if(T=(f=L)&&f.box&&f.box.length>0,S=f&&f.offscreen,e.useRuntimeCollisionCircles){var Z=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),G=t.evaluateSizeForFeature(o.textSizeData,d,Z),Y=s.get("text-padding"),W=e.collisionCircleDiameter;P=a.collisionIndex.placeCollisionCircles(v,Z,o.lineVertexArray,o.glyphOffsetArray,G,l,u,c,n,b,m.predicate,W,Y),T=v||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(i.iconFeatureIndex&&(O=i.iconFeatureIndex),i.iconBox){var X=function(t){var e=w&&C?be(t,C.x,C.y,x,b,a.transform.angle):t;return a.collisionIndex.placeCollisionBox(e,_,p,l,m.predicate)};A=I&&I.box&&I.box.length&&i.verticalIconBox?(E=X(i.verticalIconBox)).box.length>0:(E=X(i.iconBox)).box.length>0,S=S&&E.offscreen}var J=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=g||0===e.numIconVertices;if(J||K?K?J||(A=A&&T):T=A&&T:A=T=A&&T,T&&f&&f.box&&(I&&I.box&&z?a.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID):a.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID)),A&&E&&a.collisionIndex.insertCollisionBox(E.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),P&&(T&&a.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID),n)){var Q=o.bucketInstanceId,$=a.collisionCircleArrays[Q];void 0===$&&($=a.collisionCircleArrays[Q]=new ge);for(var tt=0;tt=0;--C){var L=S[C];A(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var I=e.symbolInstanceStart;I=0&&(e.text.placedSymbolArray.get(u).crossTileID=i>=0&&u!==i?0:n.crossTileID)}},we.prototype.markUsedOrientation=function(e,r,n){for(var a=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,i=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,_=i.numIconVertices>0,x=a.placedOrientations[i.crossTileID],b=x===t.WritingMode.vertical,w=x===t.WritingMode.horizontal||x===t.WritingMode.horizontalOnly;if(v){var T=Pe(g.text),k=b?Ee:T;d(e.text,s,k);var M=w?Ee:T;d(e.text,l,M);var A=g.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=A||b?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var S=a.variableOffsets[i.crossTileID];S&&a.markUsedJustification(e,S.anchor,i,x);var C=a.placedOrientations[i.crossTileID];C&&(a.markUsedJustification(e,"left",i,C),a.markUsedOrientation(e,C,i))}if(_){var L=Pe(g.icon),I=!(h&&i.verticalPlacedIconSymbolIndex&&b);if(i.placedIconSymbolIndex>=0){var P=I?L:Ee;d(e.icon,i.numIconVertices,P),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(i.verticalPlacedIconSymbolIndex>=0){var E=I?Ee:L;d(e.icon,i.numVerticalIconVertices,E),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var D=e.collisionArrays[n];if(D){var z=new t.Point(0,0);if(D.textBox||D.verticalTextBox){var O=!0;if(u){var R=a.variableOffsets[m];R?(z=xe(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),c&&z._rotate(p?a.transform.angle:-a.transform.angle)):O=!1}D.textBox&&Te(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||b,z.x,z.y),D.verticalTextBox&&Te(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||w,z.x,z.y)}var F=Boolean(!w&&D.verticalIconBox);D.iconBox&&Te(e.iconCollisionBox.collisionVertexArray,g.icon.placed,F,h?z.x:0,h?z.y:0),D.verticalIconBox&&Te(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!F,h?z.x:0,h?z.y:0)}}},y=0;yt},we.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Ae=Math.pow(2,17),Se=Math.pow(2,16),Ce=Math.pow(2,9),Le=Math.pow(2,8),Ie=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Me+r*Ae+e*Se+r*Ce+e*Le+r*Ie+e}var Ee=0,De=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};De.prototype.continuePlacement=function(t,e,r,n,a){for(var i=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,a)}else{var u=o[t.scaledTo(Number(i)).key];u&&u.findMatches(e.symbolInstances,t,a)}}for(var c=0;c1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,a=e,c())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,o||(o=t,i=e,c())}));function c(){if(o)n(o);else if(a&&i){var e=t.browser.getImageData(i),r={};for(var s in a){var l=a[s],u=l.width,c=l.height,p=l.x,h=l.y,f=l.sdf,d=l.pixelRatio,m=l.stretchX,y=l.stretchY,g=l.content,v=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,v,{x:p,y:h},{x:0,y:0},{width:u,height:c}),r[s]={data:v,pixelRatio:d,sdf:f,stretchX:m,stretchY:y,content:g}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var a in n)r.imageManager.addImage(a,n[a]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var a=r.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+a.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+a.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var a=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var i=this.sourceCaches[e]=new It(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(function(){return{isSourceLoaded:a.loaded(),source:i.serialize(),sourceId:e}})),i.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=e.id;if(this.getLayer(a))this.fire(new t.ErrorEvent(new Error('Layer with id "'+a+'" already exists on this map')));else{var i;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;i=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(a,e.source),e=t.clone$1(e),e=t.extend(e,{source:a})),this._validate(t.validateStyle.layer,"layers."+a,e,{arrayIndex:-1},n))return;i=t.createStyleLayer(e),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}}),this._serializedLayers[i.id]=i.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){var s=this._removedLayers[a];delete this._removedLayers[a],s.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var a=r?this._order.indexOf(r):this._order.length;r&&-1===a?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(a,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var a=this.getLayer(e);a?a.minzoom===r&&a.maxzoom===n||(null!=r&&(a.minzoom=r),null!=n&&(a.maxzoom=n),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(e);if(a){if(!t.deepEqual(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(t.validateStyle.filter,"layers."+a.id+".filter",r,null,n)||(a.filter=t.clone$1(r),this._updateLayer(a)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n,a),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getPaintProperty(r),n)||(i.setPaintProperty(r,n,a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=e.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type;"geojson"===o&&a?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||a?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.setFeatureState(a,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=this.sourceCaches[n];if(void 0!==a){var i=a.getSource().type,o="vector"===i?e.sourceLayer:void 0;"vector"!==i||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):a.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,a=this.sourceCaches[r];if(void 0!==a){if("vector"!==a.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},a=[],i=this._order.length-1;i>=0;i--){var o=this._order[i];if(r(o)){n[o]=i;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var y=a.length-1;y>=0;y--){var g=a[y].feature;if(n[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=vr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=vr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=vr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=vr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=vr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=vr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),lr=vr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=vr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),cr=vr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=vr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),fr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=vr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),mr=vr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),yr=vr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gr=vr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function vr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,a,i){return n[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,a,i){var o="float"===a?"vec2":"vec4",s=i.match(/color/)?"color":o;return n[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"}))}}var _r=Object.freeze({__proto__:null,prelude:Ge,background:Ye,backgroundPattern:We,circle:Xe,clippingMask:Je,heatmap:Ke,heatmapTexture:Qe,collisionBox:$e,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ar,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:sr,hillshadePrepare:lr,hillshade:ur,line:cr,lineGradient:pr,linePattern:hr,lineSDF:fr,raster:dr,symbolIcon:mr,symbolSDF:yr,symbolTextAndIcon:gr}),xr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};xr.prototype.bind=function(t,e,r,n,a,i,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}br.prototype.draw=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m){var y,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(a),t.setCullFace(i),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var _=(y={},y[g.LINES]=2,y[g.TRIANGLES]=3,y[g.LINE_STRIP]=1,y)[e],x=0,b=c.get();x0?1-1/(1.001-o):-o),u_contrast_factor:(i=a.paint.get("raster-contrast"),i>0?1/(1-i):1+i),u_spin_weights:qr(a.paint.get("raster-hue-rotate"))};var i,o};function qr(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]}var Hr,Zr=function(t,e,r,n,a,i,o,s,l,u){var c=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:i,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Gr=function(e,r,n,a,i,o,s,l,u,c,p){var h=i.transform;return t.extend(Zr(e,r,n,a,i,o,s,l,u,c),{u_gamma_scale:a?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})},Yr=function(e,r,n,a,i,o,s,l,u,c){return t.extend(Gr(e,r,n,a,i,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},Wr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,n,a,i,o){return t.extend(function(t,e,r,n){var a=r.imageManager.getPattern(t.from.toString()),i=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,p=c*(n.tileID.canonical.x+n.tileID.wrap*u),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:i.tl,u_pattern_br_b:i.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:i.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/fe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(a,o,n,i),{u_matrix:e,u_opacity:r})},Jr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,a,i,o,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),p=[],h=0,f=0,d=0;d0){var b=t.create(),w=v;t.mul(b,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,g.placementViewportMatrix),p.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=h+=x.length/4}_&&c.draw(l,u.LINES,Mt.disabled,At.disabled,e.colorModeForRenderPass(),Ct.disabled,Ir(v,e.transform,y),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&p.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var M=0,A=0,S=p;A=0&&(m[g.associatedIconIndex]={shiftedAnchor:S,angle:C})}else ce(g.numGlyphs,f)}if(p){d.clear();for(var I=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),p=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(e.tileID.overscaledZ-p),f=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var cn=new t.Color(1,0,0,1),pn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),fn=new t.Color(1,0,1,1),dn=new t.Color(0,1,1,1);function mn(t){var e=t.transform.padding;yn(t,t.transform.height-(e.top||0),3,cn),yn(t,e.bottom||0,3,pn),gn(t,e.left||0,3,hn),gn(t,t.transform.width-(e.right||0),3,fn);var r=t.transform.centerPoint;!function(t,e,r,n){vn(t,e-1,r-10,2,20,n),vn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,dn)}function yn(t,e,r,n){vn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){vn(t,e-r/2,0,r,t.transform.height,n)}function vn(e,r,n,a,i,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function _n(e,r,n){var a=e.context,i=a.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,u=At.disabled,c=e.colorModeForRenderPass();a.activeTexture.set(i.TEXTURE0),e.emptyTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE),s.draw(a,i.LINE_STRIP,l,u,c,Ct.disabled,Er(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,h=p&&p.byteLength||0,f=Math.floor(h/1024),d=r.getTile(n).tileSize,m=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,a=t.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,r.width,r.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(e,5,5),a.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+f+"kb"),s.draw(a,i.TRIANGLES,l,u,St.alphaBlended,Ct.disabled,Er(o,t.Color.transparent,m),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var xn={symbol:function(e,r,n,a,i){if("translucent"===e.renderPass){var o=At.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,a,i,o,s){for(var l=r.transform,u="map"===i,c="map"===o,p=0,h=e;p256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(Mt.disabled);var a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var i=0,o=e;i256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new At({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},bn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new At({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},bn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),a=n[n.length-1].overscaledZ,i=n[0].overscaledZ-a+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[a[this.currentLayer]],T=i[w.source],k=c[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},bn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},bn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,_r[t],e,Jr[t],this._showOverdrawInspector)),this.cache[r]},bn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},bn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},bn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},bn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var wn=function(t,e){this.points=t,this.planes=e};wn.fromInvProjectionMatrix=function(e,r,n){var a=Math.pow(2,n),i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*a)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],i[e[0]],i[e[1]]),n=t.sub([],i[e[2]],i[e[1]]),a=t.normalize([],t.cross([],r,n)),o=-t.dot(a,i[e[1]]);return a.concat(o)}));return new wn(i,o)};var Tn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Tn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),a=t.clone$2(this.max),i=0;i=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;pthis.max[l]-this.min[l])return 0}return 1};var kn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};kn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},kn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),a=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,a)},kn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},kn.prototype.clone=function(){return new kn(this.top,this.bottom,this.left,this.right)},kn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Mn=function(e,r,n,a,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==a?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new kn,this._posMatrixCache={},this._alignedPosMatrixCache={}},An={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Mn.prototype.clone=function(){var t=new Mn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},An.minZoom.get=function(){return this._minZoom},An.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},An.maxZoom.get=function(){return this._maxZoom},An.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},An.minPitch.get=function(){return this._minPitch},An.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},An.maxPitch.get=function(){return this._maxPitch},An.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},An.renderWorldCopies.get=function(){return this._renderWorldCopies},An.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},An.worldSize.get=function(){return this.tileSize*this.scale},An.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},An.size.get=function(){return new t.Point(this.width,this.height)},An.bearing.get=function(){return-this.angle/Math.PI*180},An.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},An.pitch.get=function(){return this._pitch/Math.PI*180},An.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},An.fov.get=function(){return this._fov/Math.PI*180},An.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},An.zoom.get=function(){return this._zoom},An.zoom.set=function(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._constrain(),this._calcMatrices())},An.center.get=function(){return this._center},An.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},An.padding.get=function(){return this._edgeInsets.toJSON()},An.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},An.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Mn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Mn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Mn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Mn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),a=this.pointCoordinate(new t.Point(this.width,0)),i=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,a.x,i.x,o.x)),l=Math.floor(Math.max(n.x,a.x,i.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},Mn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var a=t.MercatorCoordinate.fromLngLat(this.center),i=Math.pow(2,r),o=[i*a.x,i*a.y,0],s=wn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new Tn([t*i,0,0],[(t+1)*i,i,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],p=[],h=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(u(-d)),c.push(u(d));for(c.push(u(0));c.length>0;){var m=c.pop(),y=m.x,g=m.y,v=m.fullyVisible;if(!v){var _=m.aabb.intersects(s);if(0===_)continue;v=2===_}var x=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(x),Math.abs(b)),T=3+(1<T&&m.zoom>=l)p.push({tileID:new t.OverscaledTileID(m.zoom===h?f:m.zoom,m.wrap,m.zoom,y,g),distanceSq:t.sqrLen([o[0]-.5-y,o[1]-.5-g])});else for(var k=0;k<4;k++){var M=(y<<1)+k%2,A=(g<<1)+(k>>1);c.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:M,y:A,wrap:m.wrap,fullyVisible:v})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Mn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},An.unmodified.get=function(){return this._unmodified},Mn.prototype.zoomScale=function(t){return Math.pow(2,t)},Mn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Mn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Mn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},An.point.get=function(){return this.project(this.center)},Mn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(e),o=new t.MercatorCoordinate(i.x-(n.x-a.x),i.y-(n.y-a.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Mn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Mn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Mn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Mn.prototype.coordinateLocation=function(t){return t.toLngLat()},Mn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var a=r[3],i=n[3],o=r[0]/a,s=n[0]/i,l=r[1]/a,u=n[1]/i,c=r[2]/a,p=n[2]/i,h=c===p?0:(0-c)/(p-c);return new t.MercatorCoordinate(t.number(o,s,h)/this.worldSize,t.number(l,u,h)/this.worldSize)},Mn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Mn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Mn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Mn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Mn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,a=r?this._alignedPosMatrixCache:this._posMatrixCache;if(a[n])return a[n];var i=e.canonical,o=this.worldSize/this.zoomScale(i.z),s=i.x+Math.pow(2,i.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,i.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),a[n]=new Float32Array(l),a[n]},Mn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Mn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,a,i=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;i=t.mercatorYfromLat(p[1])*this.worldSize,e=(o=t.mercatorYfromLat(p[0])*this.worldSize)-io&&(a=o-y)}if(this.lngRange){var g=f.x,v=u.x/2;g-vl&&(n=l-v)}void 0===n&&void 0===a||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==a?a:f.y))),this._unmodified=c,this._constraining=!1}},Mn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,a=this._fov*(.5+r.y/this.height),i=Math.sin(a)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-a,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,p=new Float64Array(16);t.perspective(p,this._fov,this.width/this.height,c,u),p[8]=2*-r.x/this.width,p[9]=2*r.y/this.height,t.scale(p,p,[1,-1,1]),t.translate(p,p,[0,0,-this.cameraToCenterDistance]),t.rotateX(p,p,this._pitch),t.rotateZ(p,p,this.angle),t.translate(p,p,[-s,-l,0]),this.mercatorMatrix=t.scale([],p,[this.worldSize,this.worldSize,this.worldSize]),t.scale(p,p,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=p,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,f=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),y=s-Math.round(s)+d*h+m*f,g=l-Math.round(l)+d*f+m*h,v=new Float64Array(p);if(t.translate(v,v,[y>.5?y-1:y,g>.5?g-1:g,0]),this.alignedProjMatrix=v,p=t.create(),t.scale(p,p,[this.width/2,-this.height/2,1]),t.translate(p,p,[1,-1,0]),this.labelPlaneMatrix=p,p=t.create(),t.scale(p,p,[1,-1,1]),t.translate(p,p,[-1,-1,0]),t.scale(p,p,[2/this.width,2/this.height,1]),this.glCoordMatrix=p,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(p=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=p,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Mn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Mn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Mn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,a=r.y,i=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Sn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Ln=t.extend({deceleration:2500,maxSpeed:1400},Cn),In=t.extend({deceleration:20,maxSpeed:1400},Cn),Pn=t.extend({deceleration:1e3,maxSpeed:360},Cn),En=t.extend({deceleration:1e3,maxSpeed:90},Cn),Dn=function(t){this._map=t,this.clear()};function zn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Dn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,a=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.dblclick=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},Nn.prototype.mouseover=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.mouseout=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},Nn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Nn.prototype.isEnabled=function(){return!0},Nn.prototype.isActive=function(){return!1},Nn.prototype.enable=function(){},Nn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Rn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Vn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,a=e;n30)&&(this.aborted=!0)}}},qn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new qn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var a=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(a&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Zn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Zn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Zn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Zn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Zn.prototype.touchend=function(t,e,r){var n=this,a=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r);return a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(a)},{originalEvent:t})}}):i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(i)},{originalEvent:t})}}):void 0},Zn.prototype.touchcancel=function(){this.reset()},Zn.prototype.enable=function(){this._enabled=!0},Zn.prototype.disable=function(){this._enabled=!1,this.reset()},Zn.prototype.isEnabled=function(){return this._enabled},Zn.prototype.isActive=function(){return this._active};var Gn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Gn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Gn.prototype._correctButton=function(t,e){return!1},Gn.prototype._move=function(t,e){return{}},Gn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Gn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var a=Vn(n,r),i=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in a){var u=a[l],c=this._touches[l];c&&(i._add(u),o._add(u.sub(c)),s++,a[l]=u)}if(this._touches=a,!(sMath.abs(t.x)}var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,na(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),a=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,a,r.timeStamp),this._valid){this._lastPoints=t,this._active=!0;return{pitchDelta:-.5*((n.y+a.y)/2)}}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,a=e.mag()>=2;if(n||a){if(!n||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var i=t.y>0==e.y>0;return na(t)&&na(e)&&i}},e}(Kn),ia={panStep:100,bearingStep:15,pitchStep:10},oa=function(){var t=ia;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function sa(t){return t*(2-t)}oa.prototype.reset=function(){this._active=!1},oa.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,a=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?a=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?a=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:sa,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+a*e._pitchStep,offset:[-i*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oa.prototype.enable=function(){this._enabled=!0},oa.prototype.disable=function(){this._enabled=!1,this.reset()},oa.prototype.isEnabled=function(){return this._enabled},oa.prototype.isActive=function(){return this._active};var la=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};la.prototype.setZoomRate=function(t){this._defaultZoomRate=t},la.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},la.prototype.isEnabled=function(){return!!this._enabled},la.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},la.prototype.isZooming=function(){return!!this._zooming},la.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},la.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},la.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),a=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(a*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},la.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},la.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},la.prototype.renderFrame=function(){return this._onScrollFrame()},la.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==a&&(a=1/a);var i="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(i*a))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var p=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(p);o=t.number(l,s,h),p<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},la.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,a=(t.browser.now()-n.start)/n.duration,i=n.easing(a+.01)-n.easing(a),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},la.prototype.reset=function(){this._active=!1};var ua=function(t,e){this._clickZoom=t,this._tapZoom=e};ua.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ua.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ua.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ua.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ca=function(){this.reset()};ca.prototype.reset=function(){this._active=!1},ca.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ca.prototype.enable=function(){this._enabled=!0},ca.prototype.disable=function(){this._enabled=!1,this.reset()},ca.prototype.isEnabled=function(){return this._enabled},ca.prototype.isActive=function(){return this._active};var pa=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};pa.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},pa.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},pa.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],a=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:a/128}}}else this._tap.touchmove(t,e,r)},pa.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},pa.prototype.touchcancel=function(){this.reset()},pa.prototype.enable=function(){this._enabled=!0},pa.prototype.disable=function(){this._enabled=!1,this.reset()},pa.prototype.isEnabled=function(){return this._enabled},pa.prototype.isActive=function(){return this._active};var ha=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};ha.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ha.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ha.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ha.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fa=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};fa.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fa.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fa.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fa.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var da=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};da.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},da.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},da.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},da.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},da.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},da.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ma=function(t){return t.zoom||t.drag||t.pitch||t.rotate},ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function ga(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var va=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Dn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var a=this._el;this._listeners=[[a,"touchstart",{passive:!1}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[t.window,"blur",void 0]];for(var i=0,o=this._listeners;ii?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),T=a.unproject(_.add(x.mult(e*w)).mult(m));a.setLocationAtPoint(a.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,a=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),a&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var a=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(a,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):o,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:i.padding,d=i.zoomScale(c-o),m=t.Point.convert(e.offset),y=i.centerPoint.add(m),g=i.pointLocation(y),v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var _=i.project(g),x=i.project(v).sub(_),b=e.curve,w=Math.max(i.width,i.height),T=w/d,k=x.mag();if("minZoom"in e){var M=t.clamp(Math.min(e.minZoom,o,c),i.minZoom,i.maxZoom),A=w/i.zoomScale(M-o);b=Math.sqrt(A/k*2)}var S=b*b;function C(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var P=C(0),E=function(t){return I(P)/I(P+b*t)},D=function(t){return w*((I(P)*(L(e=P+b*t)/I(e))-L(P))/S)/k;var e},z=(C(1)-P)/b;if(Math.abs(k)<1e-6||!isFinite(z)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=h!==l,this._padding=!i.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var a=e*z,d=1/E(a);i.zoom=1===e?c:o+i.scaleZoom(d),n._rotating&&(i.bearing=t.number(s,p,e)),n._pitching&&(i.pitch=t.number(l,h,e)),n._padding&&(i.interpolatePadding(u,f,e),y=i.centerPoint.add(m));var g=1===e?v:i.unproject(_.add(x.mult(D(a))).mult(d));i.setLocationAtPoint(i.renderWorldCopies?g.wrap():g,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),xa=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};xa.prototype.getDefaultPosition=function(){return"bottom-right"},xa.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},xa.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},xa.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},xa.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var ba=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};ba.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ba.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ba.prototype.getDefaultPosition=function(){return"bottom-left"},ba.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},ba.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},ba.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wa.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wa.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var a=new Mn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,a,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wa,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ta,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ma))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new va(this,e);var i="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Sn(i).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new xa({customAttribution:e.customAttribution})),this.addControl(new ba,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(a.__proto__=n),a.prototype=Object.create(n&&n.prototype),a.prototype.constructor=a;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var a=this._controlPositions[r];return-1!==r.indexOf("bottom")?a.insertBefore(n,a.firstChild):a.appendChild(n),this},a.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},a.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],a=r[1];this._resizeCanvas(n,a),this.transform.resize(n,a),this.painter.resize(n,a);var i=!this._moving;return i&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},a.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},a.prototype.getMaxPitch=function(){return this.transform.maxPitch},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},a.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},a.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},a.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},a.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},a.prototype._createDelegatedListener=function(t,e,r){var n,a=this;if("mouseenter"===t||"mouseover"===t){var i=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?i||(i=!0,r.call(a,new Rn(t,a,n.originalEvent,{features:o}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(a,new Rn(t,a,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(a,new Rn(t,a,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(a,t),delete t.features)},n)}},a.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var a=this._createDelegatedListener(t,e,r);for(var i in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)this.on(i,a.delegates[i]);return this},a.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var a=this._createDelegatedListener(t,e,r);for(var i in a.delegates)this.once(i,a.delegates[i]);return this},a.prototype.off=function(t,e,r){var a=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var i=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ea.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ea.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var a=this.mousePitch.mousemoveWindow(t,e);a&&a.pitchDelta&&r.setPitch(r.getPitch()+a.pitchDelta)}},Ea.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ea.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ea.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ea.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ea.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ea.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ea.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ea.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,a=this._map.getBearing(),i=t.extend({bearing:a},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),i,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),a=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=a+"px",this._circleElement.style.height=a+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ja)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{var i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fa(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fa({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Na--,ja=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Na>1?(e={maximumAge:6e5,timeout:0},ja=!0):(e=this.options.positionOptions,ja=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Va={maxWidth:100,unit:"metric"},qa=function(e){this.options=t.extend({},Va,e),t.bindAll(["_onMove","setUnit"],this)};function Ha(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,i=t.unproject([0,a]),o=t.unproject([n,a]),s=i.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;if(l>5280)Za(e,n,l/5280,t._getUIString("ScaleControl.Miles"));else Za(e,n,l,t._getUIString("ScaleControl.Feet"))}else if(r&&"nautical"===r.unit){Za(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?Za(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Za(e,n,s,t._getUIString("ScaleControl.Meters"))}function Za(t,e,r,n){var a,i,o,s=(a=r,i=Math.pow(10,(""+Math.floor(a)).length-1),o=(o=a/i)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),i*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}qa.prototype.getDefaultPosition=function(){return"bottom-left"},qa.prototype._onMove=function(){Ha(this._map,this._container,this.options)},qa.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qa.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qa.prototype.setUnit=function(t){this.options.unit=t,Ha(this._map,this._container,this.options)};var Ga=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ga.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ga.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ga.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ga.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ga.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ga.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ga.prototype._isFullscreen=function(){return this._fullscreen},Ga.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ga.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Ya={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Wa=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Ya),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),a=t.window.document.createElement("body");for(a.innerHTML=e;r=a.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this,a=this._lngLat||this._trackPointer;if(this._map&&a&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Da(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var a=t.Point.convert(r);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,u=this._container.offsetWidth,c=this._container.offsetHeight;l=i.y+s.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-u/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var p=i.add(s[o]).round();r.setTransform(this._container,za[o]+" translate("+p.x+"px,"+p.y+"px)"),Oa(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);var Xa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ca,NavigationControl:Pa,GeolocateControl:Ua,AttributionControl:xa,ScaleControl:qa,FullscreenControl:Ga,Popup:Wa,Marker:Fa,Style:He,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Bt().acquire(zt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Xa})),r}))},{}],65:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],66:[function(t,e,r){(function(t,r){(function(){ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(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){return a(e[o][1][t]||t)}),c,c.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":246}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":408}],3:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":112}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":355}],5:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":226}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":363}],7:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":409}],8:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":410}],9:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./calendars":3,"./choroplethmapbox":4,"./core":5,"./densitymapbox":6,"./filter":7,"./groupby":8,"./scattermapbox":10,"./sort":11}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":405}],11:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":412}],12:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},a=self.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=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}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,p=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){p.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var y=m(h);function g(t){return t.length}t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function _(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.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,a=[],i=_(v(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,p,h=-1,f=i.length,d=a[s++],m=new b;++h=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,G),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[E(t,"matchesSelector")];return(Z=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,Z=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var G=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return q(t,this)}}function X(t){return"function"==typeof t?t:function(){return H(t,this)}}G.select=function(t){var e,r,n,a,i=[];t=Y(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},G.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},G.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},G.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=mt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=gt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=pt,t.selection.enter.prototype=ht,ht.append=G.append,ht.empty=G.empty,ht.node=G.node,ht.call=G.call,ht.size=G.size,ht.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?Ct:t<-1?-Ct:Math.asin(t)}function Et(t){return((t=Math.exp(t))+1/t)/2}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,p=l-i,h=c*c+p*p;if(h<1e-12)n=Math.log(u/o)/Dt,r=function(t){return[a+t*c,i+t*p,o*Math.exp(Dt*t*n)]};else{var f=Math.sqrt(h),d=(u*u-o*o+4*h)/(2*o*2*f),m=(u*u-o*o-4*h)/(2*u*2*f),y=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-y)/Dt,r=function(t){var e,r=t*n,s=Et(y),l=o/(2*f)*(s*(e=Dt*r+y,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[a+l*c,i+l*p,o*s/Et(Dt*r+y)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,p,h={x:0,y:0,k:1},f=[960,500],d=Rt,m=250,y=0,g="mousedown.zoom",v="mousemove.zoom",_="mouseup.zoom",x="touchstart.zoom",b=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(g,P).on(Ot+".zoom",D).on("dblclick.zoom",z).on(x,E)}function T(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(d[0],Math.min(d[1],t))}function M(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function A(e,n,a,i){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,i)),M(r=n,a),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),p&&p.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function C(t){y++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function I(t){--y||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=b.of(e,arguments),n=0,a=t.select(o(e)).on(v,l).on(_,u),i=T(t.mouse(e)),s=xt(e);function l(){n=1,M(t.mouse(e),i),L(r)}function u(){a.on(v,null).on(_,null),s(n),I(r)}Oa.call(e),C(r)}function E(){var e,r=this,n=b.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],p=t.select(r),f=xt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,y).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,p=n.length;o1){g=f[0];var _=f[1],x=g[0]-_[0],b=g[1]-_[1];i=x*x+b*b}}function y(){var o,l,u,c,p=t.touches(r);Oa.call(r);for(var h=0,f=p.length;h360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new Qt(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Ht?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Nt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,this.l/t)},Nt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,t*this.l)},Nt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Ft;function qt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Ht(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Ht(t,e,r){return this instanceof Ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Ht?new Ht(t.l,t.a,t.b):t instanceof Ut?qt(t.h,t.c,t.l):ie((t=Qt(t)).r,t.g,t.b):new Ht(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Vt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},t.lab=Ht;var Zt=18,Gt=Ht.prototype=new Ft;function Yt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new Qt(Kt(3.2404542*(a=.95047*Wt(a))-1.5371385*(n=1*Wt(n))-.4985314*(i=1.08883*Wt(i))),Kt(-.969266*a+1.8760108*n+.041556*i),Kt(.0556434*a-.2040259*n+1.0572252*i))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Wt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Kt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,jt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}Gt.brighter=function(t){return new Ht(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Gt.darker=function(t){return new Ht(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Gt.rgb=function(){return Yt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Ft;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Bt(n,a,l)}function ie(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Ht(116*a-16,500*(n-a),200*(a-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=p:u.onreadystatechange=function(){u.readyState>3&&p()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ue,t.xhr=ce(I),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=pe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(me),me=setTimeout(ve,e)),de=0):(de=1,ye(ve))}function _e(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function xe(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ge.apply(this,arguments)},t.timer.flush=function(){_e(),xe()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=be,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ue(e),i=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)f.push(t[s[u[n]][2]]);for(n=+p;nkt)s=s.L;else{if(!((a=i-Ve(s,o))>kt)){n>-kt?(e=s.P,r=s):a>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fe(t);if(Pe.insert(e,l),e||r){if(e===r)return Ye(e),r=Fe(e.site),Pe.insert(l,r),l.edge=r.edge=Je(e.site,l.site),Ge(e),void Ge(r);if(r){Ye(e),Ye(r);var u=e.site,c=u.x,p=u.y,h=t.x-c,f=t.y-p,d=r.site,m=d.x-c,y=d.y-p,g=2*(h*y-f*m),v=h*h+f*f,_=m*m+y*y,x={x:(y*v-f*_)/g+c,y:(h*_-m*v)/g+p};Qe(r.edge,u,d,x),l.edge=Je(u,t,null,x),r.edge=Je(t,d,null,x),Ge(e),Ge(r)}else l.edge=Je(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,p=1/i-1/u,h=c/u;return p?(-h+Math.sqrt(h*h-2*p*(c*c/(-2*u)-l+u/2+a-i/2)))/p+n:(n+s)/2}function Ve(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function qe(t){this.site=t,this.edges=[]}function He(t,e){return e.angle-t.angle}function Ze(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ge(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,p=2*(l*(y=i.y-s)-u*c);if(!(p>=-1e-12)){var h=l*l+u*u,f=c*c+y*y,d=(y*h-u*f)/p,m=(l*f-c*h)/p,y=m+s,g=Oe.pop()||new Ze;g.arc=t,g.site=a,g.x=d+o,g.y=y+Math.sqrt(d*d+m*m),g.cy=y,t.circle=g;for(var v=null,_=De._;_;)if(g.y<_.y||g.y===_.y&&g.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}De.insert(v,g),v||(Ee=g)}}}}function Ye(t){var e=t.circle;e&&(e.P||(Ee=e.N),De.remove(e),Oe.push(e),er(e),t.circle=null)}function Xe(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,p=t.r,h=c.x,f=c.y,d=p.x,m=p.y,y=(h+d)/2,g=(f+m)/2;if(m===f){if(y=s)return;if(h>d){if(i){if(i.y>=u)return}else i={x:y,y:l};r={x:y,y:u}}else{if(i){if(i.y1)if(h>d){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=h,h<0){if(e0){if(e>p)return;e>c&&(c=e)}if(e=a-l,h||!(e<0)){if(e/=h,h<0){if(e>p)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=f,f<0){if(e0){if(e>p)return;e>c&&(c=e)}if(e=i-u,f||!(e<0)){if(e/=f,f<0){if(e>p)return;e>c&&(c=e)}else if(f>0){if(e0&&(t.a={x:l+c*h,y:u+c*f}),p<1&&(t.b={x:l+p*h,y:u+p*f}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||v(e.a.x-e.b.x)kt||v(a-r)>kt)&&(s.splice(o,0,new $e(Ke(i.site,c,v(n-p)kt?{x:p,y:v(e-p)kt?{x:v(r-d)kt?{x:h,y:v(e-h)kt?{x:v(r-f)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(He),c=-1,p=u.length,h=u[p-1].edge,f=h.l===l?h.r:h.l;++ci||p>o||h=b)<<1|e>=x,T=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:dr(r,n)})),i=gr.lastIndex;return im&&(m=l.x),l.y>y&&(y=l.y),u.push(l.x),c.push(l.y);else for(p=0;pm&&(m=x),b>y&&(y=b),u.push(x),c.push(b)}var w=m-f,T=y-d;function k(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(v(l-r)+v(u-n)<.01)M(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,M(t,c,l,u,a,i,o,s),M(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,s)}function M(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,p=n>=u,h=p<<1|c;t.leaf=!1,c?a=l:o=l,p?i=u:s=u,k(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>T?y=d+w:m=f+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+g(t,++p),+_(t,p),f,d,m,y)},visit:function(t){cr(t,A,f,d,m,y)},find:function(t){return pr(A,t[0],t[1],f,d,m,y)}};if(p=-1,null==e){for(;++p=0&&!(n=t.interpolators[a](e,r)););return n}function _r(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Ar(t){return t*t}function Sr(t){return t*t*t}function Cr(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 Lr(t){return 1-Math.cos(t*Ct)}function Ir(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Er(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 Dr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function zr(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=Rr(a),s=Or(a,i),l=Rr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=br.get(n)||xr,Tr((a=wr.get(a)||I)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Yt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Dr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new zr(e?e.matrix:Fr)})(e)},zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function Nr(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:dr(t[0],e[0])},{i:a-2,x:dr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:dr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:dr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:a-4,x:dr(t[0],e[0])},{i:a-2,x:dr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Br(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ge(s.tick)),s):n},s.start=function(){var t,e,r,n=g.length,l=v.length,c=u[0],d=u[1];for(t=0;t=0;)r.push(a[n])}function $r(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return $r(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function dn(t){return t.reduce(mn,0)}function mn(t,e){return t+e[1]}function yn(t,e){return gn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function vn(e){return[t.min(e),t.max(e)]}function _n(t,e){return t.value-e.value}function xn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function bn(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,p=1/0,h=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,_(r),l>1&&((n=e[1]).x=n.r,n.y=0,_(n),l>2))for(An(r,n,a=e[2]),_(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=p[0]&&l<=p[1]&&((s=u[t.bisect(h,l,1,d)-1]).y+=m,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ue(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return gn(e,t)}:ue(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(_n),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+c(t.value)})),$r(s,Tn),n){var p=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;$r(s,(function(t){t.r+=p})),$r(s,Tn),$r(s,(function(t){t.r-=p}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++of.x&&(f=t),t.depth>d.depth&&(d=t)}));var m=r(h,f)/2-h.x,y=n[0]/(f.x+r(f,h)/2+m),g=n[1]/(d.depth||1);Qr(c,(function(t){t.x=(t.x+m)*y,t.y=t.depth*g}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,p=s.m,h=l.m;s=Ln(s),i=Cn(i),s&&i;)l=Cn(l),(o=Ln(o)).a=t,(a=s.z+p-i.z-u+r(s._,i._))>0&&(In(Pn(s,t,n),t,a),u+=a,c+=a),p+=s.m,u+=i.m,h+=l.m,c+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=p-c),i&&!Cn(l)&&(l.t=i,l.m+=u-h,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Kr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;$r(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var p=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),f=p.x-r(p,h)/2,d=h.x+r(h,p)/2;return $r(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Kr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=En,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,m,i,!1),m=Math.min(i.dx,i.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,m,i,!0),s.length=s.area=0),e.forEach(p)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(d(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(h)}}function f(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function d(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Rn,s=a?Ur:jr;return i=t(e,r,s,n),o=t(r,e,s,vr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Dr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Hn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Vn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],vr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Fn(a.map(i),n?Math:Zn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=zn(a),e=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),p=r%1?2:r;if(isFinite(c-u)){if(n){for(;u0;h--)e.push(o(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Zn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Gn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Gn(r),i=Gn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Hn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Vn(n,t))},o.exponent=function(t){return arguments.length?(a=Gn(r=t),i=Gn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new b;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tp?0:1;if(u=St)return l(u,f)+(s?l(s,1-f):"")+"Z";var d,m,y,g,v,_,x,b,w,T,k,M,A=0,S=0,C=[];if((g=(+o.apply(this,arguments)||0)/2)&&(y=n===Qn?Math.sqrt(s*s+u*u):+n.apply(this,arguments),f||(S*=-1),u&&(S=Pt(y/u*Math.sin(g))),s&&(A=Pt(y/s*Math.sin(g)))),u){v=u*Math.cos(c+S),_=u*Math.sin(c+S),x=u*Math.cos(p-S),b=u*Math.sin(p-S);var L=Math.abs(p-c-2*S)<=Mt?0:1;if(S&&aa(v,_,x,b)===f^L){var I=(c+p)/2;v=u*Math.cos(I),_=u*Math.sin(I),x=b=null}}else v=_=0;if(s){w=s*Math.cos(p-A),T=s*Math.sin(p-A),k=s*Math.cos(c+A),M=s*Math.sin(c+A);var P=Math.abs(c-p+2*A)<=Mt?0:1;if(A&&aa(w,T,k,M)===1-f^P){var E=(c+p)/2;w=s*Math.cos(E),T=s*Math.sin(E),k=M=null}}else w=T=0;if(h>kt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,p=t[1]+u,h=e[0]+l,f=e[1]+u,d=(c+h)/2,m=(p+f)/2,y=h-c,g=f-p,v=y*y+g*g,_=r-n,x=c*f-h*p,b=(g<0?-1:1)*Math.sqrt(Math.max(0,_*_*v-x*x)),w=(x*g-y*b)/v,T=(-x*y-g*b)/v,k=(x*g+y*b)/v,M=(-x*y+g*b)/v,A=w-d,S=T-m,C=k-d,L=M-m;return A*A+S*S>C*C+L*L&&(w=k,T=M),[[w-l,T-u],[w*r/_,T*r/_]]}function oa(){return!0}function sa(t){var e=be,r=we,n=oa,a=ua,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,p=i.length,h=ue(e),f=ue(r);function d(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":pa,"step-after":ha,basis:ma,"basis-open":function(t){if(t.length<4)return ua(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(ya(_a,i)+","+ya(_a,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ua(t){return t.length>1?t.join("L"):t+"Z"}function ca(t){return t.join("L")+"Z"}function pa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;uMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ue(t),i):r},i.source=function(e){return arguments.length?(t=ue(e),i):t},i.target=function(t){return arguments.length?(e=ue(t),i):e},i.startAngle=function(t){return arguments.length?(n=ue(t),i):n},i.endAngle=function(t){return arguments.length?(a=ue(t),i):a},i},t.svg.diagonal=function(){var t=ka,e=Ma,r=Sa;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Sa,n=e.projection;return e.projection=function(t){return arguments.length?n(Ca(r=t)):r},e},t.svg.symbol=function(){var t=Ia,e=La;function r(r,n){return(Ea.get(t.call(this,r,n))||Pa)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var Ea=t.map({circle:Pa,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*za)),r=e*za;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/Da),r=e*Da/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Da),r=e*Da/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ea.keys();var Da=Math.sqrt(3),za=Math.tan(30*Lt);G.transition=function(t){for(var e,r,n=Ba||++Ua,a=Ha(t),i=[],o=Na||{time:Date.now(),ease:Cr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(i>=1)return p.event&&p.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}p||(i=a.time,o=ge((function(t){var e=p.delay;if(o.t=e+i,e<=t)return h(t-e);o.c=h}),0,i),p=c[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}ja.call=G.call,ja.empty=G.empty,ja.node=G.node,ja.size=G.size,t.transition=function(e,r){return e&&e.transition?Ba?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ja,ja.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Y(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function y(){var p,y,g=this,v=t.select(t.event.target),_=n.of(g,arguments),x=t.select(g),b=v.datum(),w=!/^(n|s)$/.test(b)&&a,T=!/^(e|w)$/.test(b)&&i,k=v.classed("extent"),M=xt(g),A=t.mouse(g),S=t.select(o(g)).on("keydown.brush",I).on("keyup.brush",P);if(t.event.changedTouches?S.on("touchmove.brush",E).on("touchend.brush",z):S.on("mousemove.brush",E).on("mouseup.brush",z),x.interrupt().selectAll("*").interrupt(),k)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(b){var C=+/w$/.test(b),L=+/^n/.test(b);y=[s[1-C]-A[0],l[1-L]-A[1]],A[0]=s[C],A[1]=l[L]}else t.event.altKey&&(p=A.slice());function I(){32==t.event.keyCode&&(k||(p=null,A[0]-=s[1],A[1]-=l[1],k=2),F())}function P(){32==t.event.keyCode&&2==k&&(A[0]+=s[1],A[1]+=l[1],k=0,F())}function E(){var e=t.mouse(g),r=!1;y&&(e[0]+=y[0],e[1]+=y[1]),k||(t.event.altKey?(p||(p=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return f(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,u,c,p,h=0,f=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;vu||f>c||d>p)return l=a,u=r,c=f,p=d,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return f(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,u,c,p,h=0,f=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;vu||f>c||d>p)return l=a,u=r,c=f,p=d,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function d(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=y(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],23:[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"}},{}],24:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var c,p=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function f(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?u:(e=p.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",f=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(p.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",y=void 0===t.minus?"-":t.minus+"",g=void 0===t.nan?"NaN":t.nan+"";function v(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,u=t.symbol,p=t.zero,v=t.width,_=t.comma,x=t.precision,b=t.trim,w=t.type;"n"===w?(_=!0,w="g"):l[w]||(void 0===x&&(x=12),b=!0,w="g"),(p||"0"===e&&"="===r)&&(p=!0,e="0",r="=");var T="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===u?c:/[%p]/.test(w)?m:"",M=l[w],A=/[defgprs%]/.test(w);function S(t){var i,s,l,u=T,c=k;if("c"===w)c=M(t)+c,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?g:M(Math.abs(t),x),b&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==a&&(m=!1),u=(m?"("===a?a:y:"-"===a||"("===a?"":a)+u,c=("s"===w?h[8+n/3]:"")+c+(m&&"("===a?")":""),A)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){c=(46===l?f+t.slice(i+1):t.slice(i))+c,t=t.slice(0,i);break}}_&&!p&&(t=o(t,1/0));var S=u.length+t.length+c.length,C=S>1)+u+t+c+C.slice(S);break;default:t=C+u+t+c}return d(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),S.toString=function(){return t+""},S}return{format:v,formatPrefix:function(t,e){var n=v(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=h[8+a/3];return function(t){return n(o*t)+s}}}}function d(e){return c=f(e),t.format=c.format,t.formatPrefix=c.formatPrefix,c}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=f,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],25:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,p=t.shortDays,h=t.months,vt=t.shortMonths,_t=f(u),xt=d(u),bt=f(c),wt=d(c),Tt=f(p),kt=d(p),Mt=f(h),At=d(h),St=f(vt),Ct=d(vt),Lt={a:function(t){return p[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:O,e:O,f:j,H:R,I:F,j:B,L:N,m:U,M:V,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:yt,s:gt,S:q,u:H,U:Z,V:G,w:Y,W:X,x:null,X:null,y:W,Y:J,Z:K,"%":mt},It={a:function(t){return p[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:yt,s:gt,S:ot,u:st,U:lt,V:ut,w:ct,W:pt,x:null,X:null,y:ht,Y:ft,Z:dt,"%":mt},Pt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Ct[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return zt(t,i,e,r)},d:M,e:M,f:P,H:S,I:S,j:A,L:I,m:k,M:C,p:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:D,s:z,S:L,u:y,U:g,V:v,w:m,W:_,x:function(t,e,r){return zt(t,o,e,r)},X:function(t,e,r){return zt(t,l,e,r)},y:b,Y:x,Z:w,"%":E};function Et(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function zt(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Pt[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Lt.x=Et(o,Lt),Lt.X=Et(l,Lt),Lt.c=Et(i,Lt),It.x=Et(o,It),It.X=Et(l,It),It.c=Et(i,It),{format:function(t){var e=Et(t+="",Lt);return e.toString=function(){return t},e},parse:function(t){var e=Dt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Et(t+="",It);return e.toString=function(){return t},e},utcParse:function(t){var e=Dt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function p(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function E(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return p(t.getDate(),e,2)}function R(t,e){return p(t.getHours(),e,2)}function F(t,e){return p(t.getHours()%12||12,e,2)}function B(t,r){return p(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return p(t.getMilliseconds(),e,3)}function j(t,e){return N(t,e)+"000"}function U(t,e){return p(t.getMonth()+1,e,2)}function V(t,e){return p(t.getMinutes(),e,2)}function q(t,e){return p(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function Z(t,r){return p(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function G(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),p(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Y(t){return t.getDay()}function X(t,r){return p(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function W(t,e){return p(t.getFullYear()%100,e,2)}function J(t,e){return p(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+p(e/60|0,"0",2)+p(e%60,"0",2)}function Q(t,e){return p(t.getUTCDate(),e,2)}function $(t,e){return p(t.getUTCHours(),e,2)}function tt(t,e){return p(t.getUTCHours()%12||12,e,2)}function et(t,r){return p(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return p(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return p(t.getUTCMonth()+1,e,2)}function it(t,e){return p(t.getUTCMinutes(),e,2)}function ot(t,e){return p(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return p(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),p(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function pt(t,r){return p(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return p(t.getUTCFullYear()%100,e,2)}function ft(t,e){return p(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function yt(t){return+t}function gt(t){return Math.floor(+t/1e3)}function vt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var _t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=_t,t.isoParse=xt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":26}],26:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),p=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),f=h.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var m=d(0),y=d(1),g=d(2),v=d(3),_=d(4),x=d(5),b=d(6),w=m.range,T=y.range,k=g.range,M=v.range,A=_.range,S=x.range,C=b.range,L=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),I=L.range,P=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));P.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var E=P.range,D=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),z=D.range,O=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=O.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),B=F.range;function N(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=N(0),U=N(1),V=N(2),q=N(3),H=N(4),Z=N(5),G=N(6),Y=j.range,X=U.range,W=V.range,J=q.range,K=H.range,Q=Z.range,$=G.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=f,t.timeFriday=x,t.timeFridays=S,t.timeHour=c,t.timeHours=p,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=y,t.timeMondays=T,t.timeMonth=L,t.timeMonths=I,t.timeSaturday=b,t.timeSaturdays=C,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=m,t.timeSundays=w,t.timeThursday=_,t.timeThursdays=A,t.timeTuesday=g,t.timeTuesdays=k,t.timeWednesday=v,t.timeWednesdays=M,t.timeWeek=m,t.timeWeeks=w,t.timeYear=P,t.timeYears=E,t.utcDay=F,t.utcDays=B,t.utcFriday=Z,t.utcFridays=Q,t.utcHour=O,t.utcHours=R,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=D,t.utcMinutes=z,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=G,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=Y,t.utcThursday=H,t.utcThursdays=K,t.utcTuesday=V,t.utcTuesdays=W,t.utcWednesday=q,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=Y,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],27:[function(t,e,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],28:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":63}],29:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15];return t[0]=s*(h*g-f*y)-p*(l*g-u*y)+m*(l*f-u*h),t[1]=-(n*(h*g-f*y)-p*(a*g-i*y)+m*(a*f-i*h)),t[2]=n*(l*g-u*y)-s*(a*g-i*y)+m*(a*u-i*l),t[3]=-(n*(l*f-u*h)-s*(a*f-i*h)+p*(a*u-i*l)),t[4]=-(o*(h*g-f*y)-c*(l*g-u*y)+d*(l*f-u*h)),t[5]=r*(h*g-f*y)-c*(a*g-i*y)+d*(a*f-i*h),t[6]=-(r*(l*g-u*y)-o*(a*g-i*y)+d*(a*u-i*l)),t[7]=r*(l*f-u*h)-o*(a*f-i*h)+c*(a*u-i*l),t[8]=o*(p*g-f*m)-c*(s*g-u*m)+d*(s*f-u*p),t[9]=-(r*(p*g-f*m)-c*(n*g-i*m)+d*(n*f-i*p)),t[10]=r*(s*g-u*m)-o*(n*g-i*m)+d*(n*u-i*s),t[11]=-(r*(s*f-u*p)-o*(n*f-i*p)+c*(n*u-i*s)),t[12]=-(o*(p*y-h*m)-c*(s*y-l*m)+d*(s*h-l*p)),t[13]=r*(p*y-h*m)-c*(n*y-a*m)+d*(n*h-a*p),t[14]=-(r*(s*y-l*m)-o*(n*y-a*m)+d*(n*l-a*s)),t[15]=r*(s*h-l*p)-o*(n*h-a*p)+c*(n*l-a*s),t}},{}],30:[function(t,e,r){e.exports=function(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}},{}],31:[function(t,e,r){e.exports=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}},{}],32:[function(t,e,r){e.exports=function(){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}},{}],33:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],p=t[10],h=t[11],f=t[12],d=t[13],m=t[14],y=t[15];return(e*o-r*i)*(p*y-h*m)-(e*s-n*i)*(c*y-h*d)+(e*l-a*i)*(c*m-p*d)+(r*s-n*o)*(u*y-h*f)-(r*l-a*o)*(u*m-p*f)+(n*l-a*s)*(u*d-c*f)}},{}],34:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,s=n+n,l=a+a,u=r*o,c=n*o,p=n*s,h=a*o,f=a*s,d=a*l,m=i*o,y=i*s,g=i*l;return t[0]=1-p-d,t[1]=c+g,t[2]=h-y,t[3]=0,t[4]=c-g,t[5]=1-u-d,t[6]=f+m,t[7]=0,t[8]=h+y,t[9]=f-m,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],35:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);if(Math.abs(u)<1e-6)return null;return o*=u=1/u,s*=u,l*=u,n=Math.sin(e),a=Math.cos(e),i=1-a,t[0]=o*o*i+a,t[1]=s*o*i+l*n,t[2]=l*o*i-s*n,t[3]=0,t[4]=o*s*i-l*n,t[5]=s*s*i+a,t[6]=l*s*i+o*n,t[7]=0,t[8]=o*l*i+s*n,t[9]=s*l*i-o*n,t[10]=l*l*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],36:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=n+n,l=a+a,u=i+i,c=n*s,p=n*l,h=n*u,f=a*l,d=a*u,m=i*u,y=o*s,g=o*l,v=o*u;return t[0]=1-(f+m),t[1]=p+v,t[2]=h-g,t[3]=0,t[4]=p-v,t[5]=1-(c+m),t[6]=d+y,t[7]=0,t[8]=h+g,t[9]=d-y,t[10]=1-(c+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],37:[function(t,e,r){e.exports=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}},{}],38:[function(t,e,r){e.exports=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}},{}],39:[function(t,e,r){e.exports=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}},{}],40:[function(t,e,r){e.exports=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}},{}],41:[function(t,e,r){e.exports=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}},{}],42:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(r-e),l=1/(a-n),u=1/(i-o);return t[0]=2*i*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(a+n)*l,t[10]=(o+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*u,t[15]=0,t}},{}],43:[function(t,e,r){e.exports=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}},{}],44:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),copy:t("./copy"),identity:t("./identity"),transpose:t("./transpose"),invert:t("./invert"),adjoint:t("./adjoint"),determinant:t("./determinant"),multiply:t("./multiply"),translate:t("./translate"),scale:t("./scale"),rotate:t("./rotate"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),fromRotation:t("./fromRotation"),fromRotationTranslation:t("./fromRotationTranslation"),fromScaling:t("./fromScaling"),fromTranslation:t("./fromTranslation"),fromXRotation:t("./fromXRotation"),fromYRotation:t("./fromYRotation"),fromZRotation:t("./fromZRotation"),fromQuat:t("./fromQuat"),frustum:t("./frustum"),perspective:t("./perspective"),perspectiveFromFieldOfView:t("./perspectiveFromFieldOfView"),ortho:t("./ortho"),lookAt:t("./lookAt"),str:t("./str")}},{"./adjoint":29,"./clone":30,"./copy":31,"./create":32,"./determinant":33,"./fromQuat":34,"./fromRotation":35,"./fromRotationTranslation":36,"./fromScaling":37,"./fromTranslation":38,"./fromXRotation":39,"./fromYRotation":40,"./fromZRotation":41,"./frustum":42,"./identity":43,"./invert":45,"./lookAt":46,"./multiply":47,"./ortho":48,"./perspective":49,"./perspectiveFromFieldOfView":50,"./rotate":51,"./rotateX":52,"./rotateY":53,"./rotateZ":54,"./scale":55,"./str":56,"./translate":57,"./transpose":58}],45:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],v=r*s-n*o,_=r*l-a*o,x=r*u-i*o,b=n*l-a*s,w=n*u-i*s,T=a*u-i*l,k=c*m-p*d,M=c*y-h*d,A=c*g-f*d,S=p*y-h*m,C=p*g-f*m,L=h*g-f*y,I=v*L-_*C+x*S+b*A-w*M+T*k;if(!I)return null;return I=1/I,t[0]=(s*L-l*C+u*S)*I,t[1]=(a*C-n*L-i*S)*I,t[2]=(m*T-y*w+g*b)*I,t[3]=(h*w-p*T-f*b)*I,t[4]=(l*A-o*L-u*M)*I,t[5]=(r*L-a*A+i*M)*I,t[6]=(y*x-d*T-g*_)*I,t[7]=(c*T-h*x+f*_)*I,t[8]=(o*C-s*A+u*k)*I,t[9]=(n*A-r*C-i*k)*I,t[10]=(d*w-m*x+g*v)*I,t[11]=(p*x-c*w-f*v)*I,t[12]=(s*M-o*S-l*k)*I,t[13]=(r*S-n*M+a*k)*I,t[14]=(m*_-d*b-y*v)*I,t[15]=(c*b-p*_+h*v)*I,t}},{}],46:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,a){var i,o,s,l,u,c,p,h,f,d,m=e[0],y=e[1],g=e[2],v=a[0],_=a[1],x=a[2],b=r[0],w=r[1],T=r[2];if(Math.abs(m-b)<1e-6&&Math.abs(y-w)<1e-6&&Math.abs(g-T)<1e-6)return n(t);p=m-b,h=y-w,f=g-T,d=1/Math.sqrt(p*p+h*h+f*f),i=_*(f*=d)-x*(h*=d),o=x*(p*=d)-v*f,s=v*h-_*p,(d=Math.sqrt(i*i+o*o+s*s))?(i*=d=1/d,o*=d,s*=d):(i=0,o=0,s=0);l=h*s-f*o,u=f*i-p*s,c=p*o-h*i,(d=Math.sqrt(l*l+u*u+c*c))?(l*=d=1/d,u*=d,c*=d):(l=0,u=0,c=0);return t[0]=i,t[1]=l,t[2]=p,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*m+o*y+s*g),t[13]=-(l*m+u*y+c*g),t[14]=-(p*m+h*y+f*g),t[15]=1,t}},{"./identity":43}],47:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*a+x*l+b*h+w*y,t[2]=_*i+x*u+b*f+w*g,t[3]=_*o+x*c+b*d+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*a+x*l+b*h+w*y,t[6]=_*i+x*u+b*f+w*g,t[7]=_*o+x*c+b*d+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*a+x*l+b*h+w*y,t[10]=_*i+x*u+b*f+w*g,t[11]=_*o+x*c+b*d+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*a+x*l+b*h+w*y,t[14]=_*i+x*u+b*f+w*g,t[15]=_*o+x*c+b*d+w*v,t}},{}],48:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-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]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t}},{}],49:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=1/Math.tan(e/2),o=1/(n-a);return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*o,t[15]=0,t}},{}],50:[function(t,e,r){e.exports=function(t,e,r,n){var a=Math.tan(e.upDegrees*Math.PI/180),i=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/(a+i);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]=(a-i)*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}},{}],51:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S,C=n[0],L=n[1],I=n[2],P=Math.sqrt(C*C+L*L+I*I);if(Math.abs(P)<1e-6)return null;C*=P=1/P,L*=P,I*=P,a=Math.sin(r),i=Math.cos(r),o=1-i,s=e[0],l=e[1],u=e[2],c=e[3],p=e[4],h=e[5],f=e[6],d=e[7],m=e[8],y=e[9],g=e[10],v=e[11],_=C*C*o+i,x=L*C*o+I*a,b=I*C*o-L*a,w=C*L*o-I*a,T=L*L*o+i,k=I*L*o+C*a,M=C*I*o+L*a,A=L*I*o-C*a,S=I*I*o+i,t[0]=s*_+p*x+m*b,t[1]=l*_+h*x+y*b,t[2]=u*_+f*x+g*b,t[3]=c*_+d*x+v*b,t[4]=s*w+p*T+m*k,t[5]=l*w+h*T+y*k,t[6]=u*w+f*T+g*k,t[7]=c*w+d*T+v*k,t[8]=s*M+p*A+m*S,t[9]=l*M+h*A+y*S,t[10]=u*M+f*A+g*S,t[11]=c*M+d*A+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],52:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],p=e[10],h=e[11];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]);return t[4]=i*a+u*n,t[5]=o*a+c*n,t[6]=s*a+p*n,t[7]=l*a+h*n,t[8]=u*a-i*n,t[9]=c*a-o*n,t[10]=p*a-s*n,t[11]=h*a-l*n,t}},{}],53:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],p=e[10],h=e[11];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]);return t[0]=i*a-u*n,t[1]=o*a-c*n,t[2]=s*a-p*n,t[3]=l*a-h*n,t[8]=i*n+u*a,t[9]=o*n+c*a,t[10]=s*n+p*a,t[11]=l*n+h*a,t}},{}],54:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],p=e[6],h=e[7];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]);return t[0]=i*a+u*n,t[1]=o*a+c*n,t[2]=s*a+p*n,t[3]=l*a+h*n,t[4]=u*a-i*n,t[5]=c*a-o*n,t[6]=p*a-s*n,t[7]=h*a-l*n,t}},{}],55:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],a=r[1],i=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]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],56:[function(t,e,r){e.exports=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]+")"}},{}],57:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o,s,l,u,c,p,h,f,d,m=r[0],y=r[1],g=r[2];e===t?(t[12]=e[0]*m+e[4]*y+e[8]*g+e[12],t[13]=e[1]*m+e[5]*y+e[9]*g+e[13],t[14]=e[2]*m+e[6]*y+e[10]*g+e[14],t[15]=e[3]*m+e[7]*y+e[11]*g+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*y+p*g+e[12],t[13]=a*m+l*y+h*g+e[13],t[14]=i*m+u*y+f*g+e[14],t[15]=o*m+c*y+d*g+e[15]);return t}},{}],58:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=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]=i,t[11]=e[14],t[12]=a,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}},{}],59:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":61}],60:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":61}],61:[function(t,e,r){e.exports=!0},{}],62:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],63:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],64:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,a){if(t)if(e){var i="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else e=a;else t=a}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}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){var r,n,a,i,o;for(void 0===e&&(e=1e-6),a=t,o=0;o<8;o++){if(i=this.sampleCurveX(a)-t,Math.abs(i)(n=1))return n;for(;ri?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=i;function i(t,e){this.x=t,this.y=e}function o(t,e,n,a){var i=new r(t,e,n,a);return function(t){return i.solve(t)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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,a=r*this.x+e*this.y;return this.x=n,this.y=a,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),a=e.x+r*(this.x-e.x)-n*(this.y-e.y),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=a,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function u(t,e,r){var n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var a in t)n[a]=e.call(r||this,t[a],a,t);return n}function v(t,e,r){var n={};for(var a in t)e.call(r||this,t[a],a,t)&&(n[a]=t[a]);return n}function _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?g(t,_):t}var x={};function b(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,a=n-1,i=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,a){var i=n||a;return e[r]=!i||i.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var A=null;function S(t){if(null==A){var e=t.navigator?t.navigator.userAgent:null;A=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return A}function C(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,I,P,E,D=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),z=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,O=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:D,frame:function(t){var e=z(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=self.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==I&&(I=self.matchMedia("(prefers-reduced-motion: reduce)")),I.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){if(N||!E)return;j?U(t):P=t}},N=!1,j=!1;function U(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,E),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((E=self.document.createElement("img")).onload=function(){P&&U(P),P=null,j=!0},E.onerror=function(){N=!0,P=null},E.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01";var q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var a=X(t);return H(t)?(a.path="/styles/v1"+a.path+"/sprite"+e+r,this._makeAPIURL(a,this._customAccessToken||n)):(a.path+=""+e+r,W(a))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=X(t),n=R.devicePixelRatio>=2||512===e?"@2x":"",a=B.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+a),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){b("Unable to write to LocalStorage")}},K.prototype.processRequests=function(t){},K.prototype.postEvent=function(t,e,r,n){var a=this;if(F.EVENTS_URL){var i=X(F.EVENTS_URL);i.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?c(o,e):o,l={url:W(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=xt(l,(function(t){a.pendingRequest=null,r(t),a.saveEventData(),a.processRequests(n)}))}},K.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,a=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=f()),this.postEvent(a,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(K),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,a=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=f(),a=!0);var i=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(i),l=(i-this.eventData.lastSuccess)/864e5;a=a||l>=1||l<-1||o.getDate()!==s.getDate()}else a=!0;if(!a)return this.processRequests();this.postEvent(i,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=i,e.eventData.tokenU=n)}),t)}},e}(K)),rt=et.postTurnstileEvent.bind(et),nt=new tt,at=nt.postMapLoadEvent.bind(nt),it=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var a=M(e.headers.get("Cache-Control")||"");if(!a["no-store"])a["max-age"]&&n.headers.set("Expires",new Date(r+1e3*a["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(ut(t.url),r)})).catch((function(t){return b(t.message)}))}))}}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ct(t,e){if(st(),!Q)return e(null);var r=ut(t.url);Q.then((function(t){t.match(r).then((function(n){var a=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),a&&t.put(r,n.clone()),e(null,n,a)})).catch(e)})).catch(e)}var pt,ht=1/0;function ft(){return null==pt&&(pt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),pt}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt=function(t){function e(e,r,n){401===r&&G(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function gt(t,e){var r,n=new self.AbortController,a=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&G(r);"json"===t.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&b(r),n&&i)return u(n);var l=Date.now();self.fetch(a).then((function(r){if(r.ok){var n=s?r.clone():null;return u(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&<(a,n,s),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?ct(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}var vt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(yt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return gt(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},_t=function(t,e){return vt(c(t,{type:"arrayBuffer"}),e)},xt=function(t,e){return vt(c(t,{method:"POST"}),e)};var bt,wt;bt=[],wt=0;var Tt=function(t,e){if(B.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),wt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return bt.push(r),r}wt++;var n=!1,a=function(){if(!n)for(n=!0,wt--;bt.length&&wt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ct.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Lt={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},It=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.key,r=t.value;return r?[new It(e,r,"constants have been deprecated as of v8")]:[]}function Et(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Wt=[Ft,Bt,Nt,jt,Ut,Zt,Vt,Yt(qt),Gt];function Jt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Wt;r255?255:t}function a(t){return t<0?0:t>1?1:t}function i(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?a(parseFloat(t)/100):a(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}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in r)return r[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var c=a.substr(0,l),p=a.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=o(p.pop());case"rgb":return 3!==p.length?null:[i(p[0]),i(p[1]),i(p[2]),h];case"hsla":if(4!==p.length)return null;h=o(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return[n(255*s(g,y,f+1/3)),n(255*s(g,y,f)),n(255*s(g,y,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],a=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+a+")"},te.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=a},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ae)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in pe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[s],n++}else i=qt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Yt(i,o)}else r=pe[a];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Zt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],a=!1,i=1;i<=t.length-1;++i){var o=t[i];if(a&&"object"==typeof o&&!Array.isArray(o)){a=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Bt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Yt(Nt))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,Ut)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var p=e.parse(t[i],1,qt);if(!p)return null;var h=p.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:p,scale:null,font:null,textColor:null})}}return new fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Gt?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":jt,"to-color":Ut,"to-number":Bt,"to-string":Nt},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=me[r],a=[],i=1;i4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ie(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Te(t,e){var r,n=(180+t[0])/360,a=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,e.z);return[Math.round(n*i*8192),Math.round(a*i*8192)]}function ke(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Me(t,e){for(var r,n,a,i,o,s,l,u=!1,c=0,p=e.length;c0&&p<0||c<0&&p>0}function Ce(t,e,r){for(var n=0,a=r;nr[2]){var a=.5*n,i=t[0]-r[0]>a?-n:r[0]-t[0]>a?n:0;0===i&&(i=t[0]-r[2]>a?-n:r[2]-t[0]>a?n:0),t[0]+=i}be(e,t)}function ze(t,e,r,n){for(var a=8192*Math.pow(2,n.z),i=[8192*n.x,8192*n.y],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ne(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=s-1}return 0}Ue.prototype.parse=function(t,e,r,n,a){return void 0===a&&(a={}),e?this.concat(e,r,n)._parse(t,a):this._parse(t,a)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new he(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof ue)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof Re)return!1;var r=e instanceof ye||e instanceof he,n=!0;if(e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ue})),!n)return!1;return Fe(e)&&Ne(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new ve;try{i=new ue(i.type,i.evaluate(l))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,a,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ot(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Jt(t,e);return r&&this.error(r),r};var qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,a=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,a);if(!c)return null;a=a||c.type,n.push([o,c])}return new qe(a,r,n)},qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;return n>=e[a-1]?r[a-1].evaluate(t):r[Ve(e,n)].evaluate(t)},qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ze=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new te(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return He(t,e[n],r)}))}}),Ge=6/29,Ye=3*Ge*Ge,Xe=Math.PI/180,We=180/Math.PI;function Je(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ye+4/29}function Ke(t){return t>Ge?t*t*t:Ye*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),n=$e(t.b),a=Je((.4124564*e+.3575761*r+.1804375*n)/.95047),i=Je((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Je((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Qe(3.2404542*r-1.5371385*e-.4985314*n),Qe(-.969266*r+1.8760108*e+.041556*n),Qe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function rr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ar={forward:function(t){var e=tr(t),r=e.l,n=e.a,a=e.b,i=Math.atan2(a,n)*We;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:nr,hcl:ar}),or=function(t,e,r,n,a){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(a=e.parse(a,2,Bt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,u);if(!m)return null;u=u||m.type,l.push([p,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new or(u,r,n,a,l):e.error("Type "+Xt(u)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;if(n>=e[a-1])return r[a-1].evaluate(t);var i=Ve(e,n),o=e[i],s=e[i+1],l=or.interpolationFactor(this.interpolation,n,o,s),u=r[i].evaluate(t),c=r[i+1].evaluate(t);return"interpolate"===this.operator?Ze[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?ar.reverse(ar.interpolate(ar.forward(u),ar.forward(c),l)):nr.reverse(nr.interpolate(nr.forward(u),nr.forward(c),l))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},cr.prototype.eachChild=function(t){t(this.index),t(this.input)},cr.prototype.outputDefined=function(){return!1},cr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var pr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};pr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);return r&&n?Kt(r.type,[jt,Nt,Bt,Ft,qt])?new pr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead"):null},pr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");return r.indexOf(e)>=0},pr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},pr.prototype.outputDefined=function(){return!0},pr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Bt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);if(!r||!n)return null;if(!Kt(r.type,[jt,Nt,Bt,Ft,qt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Bt);return a?new hr(r,n,a):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var fr=function(t,e,r,n,a,i){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};fr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var a={},i=[],o=2;oNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,se(h)))return null}else r=se(h);if(void 0!==a[String(h)])return u.error("Branch labels must be unique.");a[String(h)]=i.length}var f=e.parse(l,o,n);if(!f)return null;n=n||f.type,i.push(f)}var d=e.parse(t[1],1,qt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new fr(r,n,d,a,i,m):null},fr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},fr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},fr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,Bt);if(!r||!n)return null;if(!Kt(r.type,[Yt(qt),Nt,qt]))return e.error("Expected first argument to be of type array or string, but found "+Xt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Bt);return a?new mr(r.type,r,n,a):null}return new mr(r.type,r,n)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Xt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var _r=vr("==",(function(t,e,r){return e===r}),gr),xr=vr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!gr(0,e,r,n)})),br=vr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Tr=vr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),kr=vr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Mr=function(t,e,r,n,a){this.type=Nt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};Mr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=e.parse(n.locale,1,Nt)))return null;var i=null;if(n.currency&&!(i=e.parse(n.currency,1,Nt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Bt))?null:new Mr(r,a,i,o,s)},Mr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ar=function(t){this.type=Bt,this.input=t};Ar.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Xt(r.type)+" instead."):new Ar(r):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ce("Expected value to be of type string or array, but found "+Xt(se(e))+" instead.")},Ar.prototype.eachChild=function(t){t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":_r,"!=":xr,">":wr,"<":br,">=":kr,"<=":Tr,array:he,at:cr,boolean:he,case:dr,coalesce:lr,collator:xe,format:fe,image:de,in:pr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Ar,let:ur,literal:ue,match:fr,number:he,"number-format":Mr,object:he,slice:mr,step:qe,string:he,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:je,within:Re};function Cr(t,e){var r=e[0],n=e[1],a=e[2],i=e[3];r=r.evaluate(t),n=n.evaluate(t),a=a.evaluate(t);var o=i?i.evaluate(t):1,s=ie(r,n,a,o);if(s)throw new ce(s);return new te(r/255*o,n/255*o,a/255*o,o)}function Lr(t,e){return t in e}function Ir(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Er(t){return{result:"success",value:t}}function Dr(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Br(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,a){return jr(typeof r===a?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var a=Ve(t.stops.map((function(t){return t[0]})),r);return t.stops[a][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Fr(r))return jr(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var i=Ve(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}(r,n,t.stops[i][0],t.stops[i+1][0]),s=t.stops[i][1],l=t.stops[i+1][1],u=Ze[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function Hr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ae.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}_e.register(Sr,{error:[{kind:"error"},[Nt],function(t,e){var r=e[0];throw new ce(r.evaluate(t))}],typeof:[Nt,[qt],function(t,e){return Xt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Bt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Bt,Bt,Bt],Cr],rgba:[Ut,[Bt,Bt,Bt,Bt],Cr],has:{type:jt,overloads:[[[Nt],function(t,e){return Lr(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Lr(r.evaluate(t),n.evaluate(t))}]]},get:{type:qt,overloads:[[[Nt],function(t,e){return Ir(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Ir(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[qt,[Nt],function(t,e){return Ir(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[Nt,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Bt,[],function(t){return t.globals.zoom}],"heatmap-density":[Bt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Bt,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Bt,Pr(Bt),function(t,e){for(var r=0,n=0,a=e;n":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[jt,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[Yt(Nt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Yt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Nt,Yt(qt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Nt,Yt(qt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var a=r+n>>1;if(e[a]===t)return!0;e[a]>t?n=a-1:r=a+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Pr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Yr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Nt,number:Bt,enum:Nt,boolean:jt,formatted:Zt,resolvedImage:Gt};if("array"===t.type)return Yt(e[t.value]||qt,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Er(new Zr(n,e)):Dr(r.errors)}Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Zr.prototype.evaluate=function(t,e,r,n,a,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Be(e.expression)};Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,a,i)},Xr.prototype.evaluate=function(t,e,r,n,a,i){return this._styleExpression.evaluate(t,e,r,n,a,i)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Be(e.expression),this.interpolationType=n};function Jr(t,e){if("error"===(t=Yr(t,e)).result)return t;var r=t.value.expression,n=Fe(r);if(!n&&!zr(e))return Dr([new Ot("","data expressions not supported")]);var a=Ne(r,["zoom"]);if(!a&&!Or(e))return Dr([new Ot("","zoom expressions not supported")]);var i=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof lr)for(var n=0,a=e.args;nn.maximum?[new It(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function en(t){var e,r,n,a=t.valueSpec,i=Dt(t.value.type),o={},s="categorical"!==i&&void 0===t.value.property,l=!s,u="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),c=Qr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat($r({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Fr(r)&&0===r.length&&e.push(new It(t.key,r,"array must have at least one stop"));return e},default:function(t){return kn({key:t.key,value:t.value,valueSpec:a,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&c.push(new It(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||c.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Rr(t.valueSpec)&&c.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!zr(t.valueSpec)?c.push(new It(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&c.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!u||void 0!==t.value.property||c.push(new It(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],i=t.value,s=t.key;if("array"!==Fr(i))return[new It(s,i,"array expected, "+Fr(i)+" found")];if(2!==i.length)return[new It(s,i,"array length 2 expected, length "+i.length+" found")];if(u){if("object"!==Fr(i[0]))return[new It(s,i,"object expected, "+Fr(i[0])+" found")];if(void 0===i[0].zoom)return[new It(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new It(s,i,"object stop key must have value")];if(n&&n>Dt(i[0].zoom))return[new It(s,i[0].zoom,"stop zoom values must appear in ascending order")];Dt(i[0].zoom)!==n&&(n=Dt(i[0].zoom),r=void 0,o={}),e=e.concat(Qr({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tn,value:h}}))}else e=e.concat(h({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return Gr(zt(i[1]))?e.concat([new It(s+"[1]",i[1],"expressions are not allowed in function stops.")]):e.concat(kn({key:s+"[1]",value:i[1],valueSpec:a,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Fr(t.value),l=Dt(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new It(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new It(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var c="number expected, "+s+" found";return zr(a)&&void 0===i&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,u,c)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?cn(t[1],t[2],"=="):"!="===r?fn(cn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?cn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(fn)):"in"===r?pn(t[1],t.slice(2)):"!in"===r?fn(pn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?fn(hn(t[1])):"within"!==r||t}function cn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function pn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ln)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function fn(t){return["!",t]}function dn(t){return an(zt(t.value))?rn(Et({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Fr(r))return[new It(n,r,"array expected, "+Fr(r)+" found")];var a,i=e.styleSpec,o=[];if(r.length<1)return[new It(n,r,"filter array must have at least 1 element")];switch(o=o.concat(nn({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Dt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Dt(r[1])&&o.push(new It(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new It(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=Fr(r[1]))&&o.push(new It(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(o[h]=!0,i.push(u[h])):o[h]=!1}}},On.prototype._forEachCell=function(t,e,r,n,a,i,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),h=l;h<=c;h++)for(var f=u;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&a.call(this,t,e,r,n,d,i,o,s))return}},On.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var p=t[c];u[c]=Bn[l].shallow.indexOf(c)>=0?p:qn(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof t)}function Hn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Hn);if("object"==typeof t){var e=t.$name||"Object",r=Bn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),a=0,i=Object.keys(t);a=0?s:Hn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Zn=function(){this.first=!0};Zn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Yn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Gn["CJK Compatibility Ideographs"](t)||(!!Gn["CJK Compatibility"](t)||(!!Gn["CJK Radicals Supplement"](t)||(!!Gn["CJK Strokes"](t)||(!(!Gn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Gn["CJK Unified Ideographs Extension A"](t)||(!!Gn["CJK Unified Ideographs"](t)||(!!Gn["Enclosed CJK Letters and Months"](t)||(!!Gn["Hangul Compatibility Jamo"](t)||(!!Gn["Hangul Jamo Extended-A"](t)||(!!Gn["Hangul Jamo Extended-B"](t)||(!!Gn["Hangul Jamo"](t)||(!!Gn["Hangul Syllables"](t)||(!!Gn.Hiragana(t)||(!!Gn["Ideographic Description Characters"](t)||(!!Gn.Kanbun(t)||(!!Gn["Kangxi Radicals"](t)||(!!Gn["Katakana Phonetic Extensions"](t)||(!(!Gn.Katakana(t)||12540===t)||(!(!Gn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Gn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Gn["Unified Canadian Aboriginal Syllabics"](t)||(!!Gn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Gn["Vertical Forms"](t)||(!!Gn["Yijing Hexagram Symbols"](t)||(!!Gn["Yi Syllables"](t)||!!Gn["Yi Radicals"](t))))))))))))))))))))))))))))))}function Jn(t){return!(Wn(t)||function(t){return!(!Gn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Gn["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!Gn["Letterlike Symbols"](t)||(!!Gn["Number Forms"](t)||(!(!Gn["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!Gn["Control Pictures"](t)||9251===t)||(!!Gn["Optical Character Recognition"](t)||(!!Gn["Enclosed Alphanumerics"](t)||(!!Gn["Geometric Shapes"](t)||(!(!Gn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Gn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Gn["CJK Symbols and Punctuation"](t)||(!!Gn.Katakana(t)||(!!Gn["Private Use Area"](t)||(!!Gn["CJK Compatibility Forms"](t)||(!!Gn["Small Form Variants"](t)||(!!Gn["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function Kn(t){return t>=1424&&t<=2303||Gn["Arabic Presentation Forms-A"](t)||Gn["Arabic Presentation Forms-B"](t)}function Qn(t,e){return!(!e&&Kn(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Gn.Khmer(t))}function $n(t){for(var e=0,r=t;e-1&&(ia=na),aa&&aa(t)};function la(){ua.fire(new At("pluginStateChange",{pluginStatus:ia,pluginURL:oa}))}var ua=new Ct,ca=function(){return ia},pa=function(){if(ia!==ta||!oa)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ia=ea,la(),oa&&_t({url:oa},(function(t){t?sa(t):(ia=ra,la())}))},ha={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ia===ra||null!=ha.applyArabicShaping},isLoading:function(){return ia===ea},setState:function(t){ia=t.pluginStatus,oa=t.pluginURL},isParsed:function(){return null!=ha.applyArabicShaping&&null!=ha.processBidirectionalText&&null!=ha.processStyledBidirectionalText},getPluginURL:function(){return oa}},fa=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Zn,this.transition={})};fa.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var da=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Br(t))return new Kr(t,e);if(Gr(t)){var r=Jr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};da.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},da.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ma=function(t){this.property=t,this.value=new da(t,void 0)};ma.prototype.transitioned=function(t,e){return new ga(this.property,this.value,e,c({},t.transition,this.transition),t.now)},ma.prototype.untransitioned=function(){return new ga(this.property,this.value,null,{},0)};var ya=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ya.prototype.getValue=function(t){return _(this._values[t].value.value)},ya.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ma(this._values[t].property)),this._values[t].value=new da(this._values[t].property,null===e?void 0:_(e))},ya.prototype.getTransition=function(t){return _(this._values[t].transition)},ya.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ma(this._values[t].property)),this._values[t].transition=_(e)||void 0},ya.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return a};var va=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};va.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ba(this._properties),a=0,i=Object.keys(this._values);an.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ta),Ma=function(t){this.specification=t};Ma.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var a=t.expression.evaluate(e,null,{},r,n);return this._calculate(a,a,a,e)}return this._calculate(t.expression.evaluate(new fa(Math.floor(e.zoom-1),e)),t.expression.evaluate(new fa(Math.floor(e.zoom),e)),t.expression.evaluate(new fa(Math.floor(e.zoom+1),e)),e)}},Ma.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ma.prototype.interpolate=function(t){return t};var Aa=function(t){this.specification=t};Aa.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Aa.prototype.interpolate=function(){return!1};var Sa=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new da(r,void 0),a=this.defaultTransitionablePropertyValues[e]=new ma(r);this.defaultTransitioningPropertyValues[e]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Nn("DataDrivenProperty",Ta),Nn("DataConstantProperty",wa),Nn("CrossFadedDataDrivenProperty",ka),Nn("CrossFadedProperty",Ma),Nn("ColorRampProperty",Aa);var Ca=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new _a(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ya(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ba(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(En,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Pn,n,t,e,r))return!1}if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var a=this._transitionablePaint._values[t],i="cross-faded-data-driven"===a.property.specification["property-type"],o=a.value.isDataDriven(),s=a.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Dn(this,t.call(Ln,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof xa&&zr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Ct),La={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ia=function(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},Pa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ea(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var a,i=(a=t.type,La[a].BYTES_PER_ELEMENT),o=r=Da(r,Math.max(e,i)),s=t.components||1;return n=Math.max(n,i),r+=i*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Da(r,Math.max(n,e)),alignment:e}}function Da(t,e){return Math.ceil(t/e)*e}Pa.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Pa.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Pa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Pa.prototype.clear=function(){this.length=0},Pa.prototype.resize=function(t){this.reserve(t),this.length=t},Pa.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Pa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Pa);za.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",za);var Oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,this.int16[i+3]=a,t},e}(Pa);Oa.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Oa);var Ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(Pa);Ra.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Ra);var Fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=a,this.uint8[l+6]=i,this.uint8[l+7]=o,t},e}(Pa);Fa.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Fa);var Ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,a,i,o,s,l,u)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c){var p=9*t,h=18*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=a,this.uint16[p+4]=i,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.uint8[h+16]=u,this.uint8[h+17]=c,t},e}(Pa);Ba.prototype.bytesPerElement=18,Nn("StructArrayLayout8ui2ub18",Ba);var Na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,a,i,o,s,l,u,c,p)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=a,this.uint16[f+4]=i,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(Pa);Na.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",Na);var ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,t},e}(Pa);ja.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",ja);var Ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Pa);Ua.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Ua);var Va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,a,i,o,s,l)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u){var c=10*t,p=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=a,this.int16[c+4]=i,this.int16[c+5]=o,this.uint32[p+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(Pa);Va.prototype.bytesPerElement=20,Nn("StructArrayLayout6i1ul2ui20",Va);var qa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(Pa);qa.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",qa);var Ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n,a)},e.prototype.emplace=function(t,e,r,n,a,i){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=a,this.int16[s+7]=i,t},e}(Pa);Ha.prototype.bytesPerElement=16,Nn("StructArrayLayout2f1f2i16",Ha);var Za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=12*t,o=3*t;return this.uint8[i+0]=e,this.uint8[i+1]=r,this.float32[o+1]=n,this.float32[o+2]=a,t},e}(Pa);Za.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",Za);var Ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.uint16[a+0]=e,this.uint16[a+1]=r,this.uint16[a+2]=n,t},e}(Pa);Ga.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",Ga);var Ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g){var v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=a,this.uint32[_+2]=i,this.uint32[_+3]=o,this.uint32[_+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[_+7]=p,this.float32[_+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[_+10]=y,this.int16[v+22]=g,t},e}(Pa);Ya.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ya);var Xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S,C){var L=34*t,I=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=a,this.int16[L+4]=i,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=u,this.uint16[L+9]=c,this.uint16[L+10]=p,this.uint16[L+11]=h,this.uint16[L+12]=f,this.uint16[L+13]=d,this.uint16[L+14]=m,this.uint16[L+15]=y,this.uint16[L+16]=g,this.uint16[L+17]=v,this.uint16[L+18]=_,this.uint16[L+19]=x,this.uint16[L+20]=b,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[I+12]=k,this.float32[I+13]=M,this.float32[I+14]=A,this.float32[I+15]=S,this.float32[I+16]=C,t},e}(Pa);Xa.prototype.bytesPerElement=68,Nn("StructArrayLayout8i15ui1ul4f68",Xa);var Wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Pa);Wa.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Wa);var Ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,t},e}(Pa);Ja.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Ja);var Ka=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=2*t,i=4*t;return this.uint32[a+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Pa);Ka.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Ka);var Qa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Pa);Qa.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",Qa);var $a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Pa);$a.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",$a);var ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Pa);ti.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",ti);var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,this.float32[i+3]=a,t},e}(Pa);ei.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",ei);var ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ia);ri.prototype.size=20;var ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ri(this,t)},e}(Va);Nn("CollisionBoxArray",ni);var ai=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ia);ai.prototype.size=48;var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ai(this,t)},e}(Ya);Nn("PlacedSymbolArray",ii);var oi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ia);oi.prototype.size=68;var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new oi(this,t)},e}(Xa);Nn("SymbolInstanceArray",si);var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Wa);Nn("GlyphOffsetArray",li);var ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ja);Nn("SymbolLineVertexArray",ui);var ci=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ia);ci.prototype.size=8;var pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ci(this,t)},e}(Ka);Nn("FeatureIndexArray",pi);var hi=Ea([{name:"a_pos",components:2,type:"Int16"}],4).members,fi=function(t){void 0===t&&(t=[]),this.segments=t};function di(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}fi.prototype.prepareSegment=function(t,e,r,n){var a=this.segments[this.segments.length-1];return t>fi.MAX_VERTEX_ARRAY_LENGTH&&b("Max vertices per segment is "+fi.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!a||a.vertexLength+t>fi.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a},fi.prototype.get=function(){return this.segments},fi.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:a^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),gi=e((function(t){t.exports=function(t,e){for(var r,n=t.length,a=e^n,i=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:a^=(255&t.charCodeAt(i+2))<<16;case 2:a^=(255&t.charCodeAt(i+1))<<8;case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(i)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0}})),vi=yi,_i=yi,xi=gi;vi.murmur3=_i,vi.murmur2=xi;var bi=function(){this.ids=[],this.positions=[],this.indexed=!1};bi.prototype.add=function(t,e,r,n){this.ids.push(Ti(t)),this.positions.push(e,r,n)},bi.prototype.getPositions=function(t){for(var e=Ti(t),r=0,n=this.ids.length-1;r>1;this.ids[a]>=e?n=a:r=a+1}for(var i=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];i.push({index:o,start:s,end:l}),r++}return i},bi.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,a){for(;n>1],o=n-1,s=a+1;;){do{o++}while(e[o]i);if(o>=s)break;ki(e,o,s),ki(r,3*o,3*s),ki(r,3*o+1,3*s+1),ki(r,3*o+2,3*s+2)}s-nZi.max||o.yZi.max)&&(b("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Zi.min,Zi.max),o.y=l(o.y,Zi.min,Zi.max))}return r}function Yi(t,e,r,n,a){t.emplaceBack(2*e+(n+1)/2,2*r+(a+1)/2)}var Xi=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new za,this.indexArray=new Ga,this.segments=new fi,this.programConfigurations=new Ui(hi,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Wi(t,e){for(var r=0;r1){if($i(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(a)._add(e))}function no(t,e){for(var r,n,a,i=!1,o=0;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(i=!i);return i}function ao(t,e){for(var r=!1,n=0,a=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function io(t,e,r){var n=r[0],a=r[2];if(t.xa.x&&e.x>a.x||t.ya.y&&e.y>a.y)return!1;var i=w(t,e,r[0]);return i!==w(t,e,r[1])||i!==w(t,e,r[2])||i!==w(t,e,r[3])}function oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function so(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function lo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;Yi(this.layoutVertexArray,u,c,-1,-1),Yi(this.layoutVertexArray,u,c,1,-1),Yi(this.layoutVertexArray,u,c,1,1),Yi(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Nn("CircleBucket",Xi,{omit:["layers"]});var uo=new Sa({"circle-sort-key":new Ta(Lt.layout_circle["circle-sort-key"])}),co={paint:new Sa({"circle-radius":new Ta(Lt.paint_circle["circle-radius"]),"circle-color":new Ta(Lt.paint_circle["circle-color"]),"circle-blur":new Ta(Lt.paint_circle["circle-blur"]),"circle-opacity":new Ta(Lt.paint_circle["circle-opacity"]),"circle-translate":new wa(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new wa(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wa(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wa(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ta(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ta(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ta(Lt.paint_circle["circle-stroke-opacity"])}),layout:uo},po="undefined"!=typeof Float32Array?Float32Array:Array;function ho(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}function fo(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*a+x*l+b*h+w*y,t[2]=_*i+x*u+b*f+w*g,t[3]=_*o+x*c+b*d+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*a+x*l+b*h+w*y,t[6]=_*i+x*u+b*f+w*g,t[7]=_*o+x*c+b*d+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*a+x*l+b*h+w*y,t[10]=_*i+x*u+b*f+w*g,t[11]=_*o+x*c+b*d+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*a+x*l+b*h+w*y,t[14]=_*i+x*u+b*f+w*g,t[15]=_*o+x*c+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var mo=fo;var yo,go,vo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};yo=new po(3),po!=Float32Array&&(yo[0]=0,yo[1]=0,yo[2]=0),go=yo;function _o(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}!function(){var t=function(){var t=new po(4);return po!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var xo=function(t){var e=t[0],r=t[1];return e*e+r*r},bo=(function(){var t=function(){var t=new po(2);return po!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),function(t){function e(e){t.call(this,e,co)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xi(t)},e.prototype.queryRadius=function(t){var e=t;return oo("circle-radius",this,e)+oo("circle-stroke-width",this,e)+so(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,i,o,s){for(var l=lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),p=c?l:function(t,e){return t.map((function(t){return wo(t,e)}))}(l,s),h=c?u*o:u,f=0,d=n;ft.width||a.height>t.height||r.x>t.width-a.width||r.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||n.x>e.width-a.width||n.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=i=t[0],a=o=t[1];for(var d=r;di&&(i=s),l>o&&(o=l);u=0!==(u=Math.max(i-n,o-a))?1/u:0}return jo(h,f,r,n,a,u),f}function Bo(t,e,r,n,a){var i,o;if(a===ls(t,e,r,n)>0)for(i=e;i=e;i-=n)o=is(i,t[i],t[i+1],o);return o&&$o(o,o.next)&&(os(o),o=o.next),o}function No(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!$o(n,n.next)&&0!==Qo(n.prev,n,n.next))n=n.next;else{if(os(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,a,i,o){if(t){!o&&i&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=Xo(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,i);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,i?Vo(t,n,a,i):Uo(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),os(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?jo(t=qo(No(t),e,r),e,r,n,a,i,2):2===o&&Ho(t,e,r,n,a,i):jo(No(t),e,r,n,a,i,1);break}}}function Uo(t){var e=t.prev,r=t,n=t.next;if(Qo(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(Jo(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&Qo(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Vo(t,e,r,n){var a=t.prev,i=t,o=t.next;if(Qo(a,i,o)>=0)return!1;for(var s=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,p=Xo(s,l,e,r,n),h=Xo(u,c,e,r,n),f=t.prevZ,d=t.nextZ;f&&f.z>=p&&d&&d.z<=h;){if(f!==t.prev&&f!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&Qo(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,f.x,f.y)&&Qo(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Jo(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function qo(t,e,r){var n=t;do{var a=n.prev,i=n.next.next;!$o(a,i)&&ts(a,n,n.next,i)&&ns(a,i)&&ns(i,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(i.i/r),os(n),os(n.next),n=t=i),n=n.next}while(n!==t);return No(n)}function Ho(t,e,r,n,a,i){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ko(o,s)){var l=as(o,s);return o=No(o,o.next),l=No(l,l.next),jo(o,e,r,n,a,i),void jo(l,e,r,n,a,i)}s=s.next}o=o.next}while(o!==t)}function Zo(t,e){return t.x-e.x}function Go(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&a!==n.x&&Jo(ir.x||n.x===r.x&&Yo(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=as(e,t);No(e,e.next),No(r,r.next)}}function Yo(t,e){return Qo(t.prev,t,e.prev)<0&&Qo(e.next,t,t.next)<0}function Xo(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Wo(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function Ko(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&ts(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ns(t,e)&&ns(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Qo(t.prev,t,e.prev)||Qo(t,e.prev,e))||$o(t,e)&&Qo(t.prev,t,t.next)>0&&Qo(e.prev,e,e.next)>0)}function Qo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $o(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,r,n){var a=rs(Qo(t,e,r)),i=rs(Qo(t,e,n)),o=rs(Qo(r,n,t)),s=rs(Qo(r,n,e));return a!==i&&o!==s||(!(0!==a||!es(t,r,e))||(!(0!==i||!es(t,n,e))||(!(0!==o||!es(r,t,n))||!(0!==s||!es(r,e,n)))))}function es(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function rs(t){return t>0?1:t<0?-1:0}function ns(t,e){return Qo(t.prev,t,t.next)<0?Qo(t,e,t.next)>=0&&Qo(t,t.prev,e)>=0:Qo(t,e,t.prev)<0||Qo(t,t.next,e)<0}function as(t,e){var r=new ss(t.i,t.x,t.y),n=new ss(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function is(t,e,r,n){var a=new ss(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function os(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 ss(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 ls(t,e,r,n){for(var a=0,i=e,o=r-n;in;){if(a-n>600){var o=a-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1),p=Math.max(n,Math.floor(r-s*u/o+c)),h=Math.min(a,Math.floor(r+(o-s)*u/o+c));t(e,r,p,h,i)}var f=e[r],d=n,m=a;for(cs(e,n,r),i(e[a],f)>0&&cs(e,n,a);d0;)m--}0===i(e[n],f)?cs(e,n,m):(m++,cs(e,m,a)),m<=r&&(n=m+1),r<=m&&(a=m-1)}}(t,e,r||0,n||t.length-1,a||ps)}function cs(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ps(t,e){return te?1:0}function hs(t,e){var r=t.length;if(r<=1)return[t];for(var n,a,i=[],o=0;o1)for(var l=0;l0&&(n+=t[a-1].length,r.holes.push(n))}return r},Oo.default=Ro;var ys=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new za,this.indexArray=new Ga,this.indexArray2=new Qa,this.programConfigurations=new Ui(zo,t.layers,t.zoom),this.segments=new fi,this.segments2=new fi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ys.prototype.populate=function(t,e,r){this.hasPattern=ds("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),a=[],i=0,o=t;i>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ws.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,a=0,i=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(n--,1===r||2===r)(a+=t.readSVarint())s&&(s=a),(i+=t.readSVarint())u&&(u=i);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},ws.prototype.toGeoJSON=function(t,e,r){var n,a,i=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=ws.types[this.type];function c(t){for(var e=0;e>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}(r))}function Cs(t,e,r){if(3===t){var n=new Ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}As.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 bs(this._pbf,e,this.extent,this._keys,this._values)};var Ls={VectorTile:function(t,e){this.layers=t.readFields(Cs,{},e)},VectorTileFeature:bs,VectorTileLayer:Ms},Is=Ls.VectorTileFeature.types,Ps=Math.pow(2,13);function Es(t,e,r,n,a,i,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ps)+o,a*Ps*2,i*Ps*2,Math.round(s))}var Ds=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ra,this.indexArray=new Ga,this.programConfigurations=new Ui(xs,t.layers,t.zoom),this.segments=new fi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function zs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Os(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>8192}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>8192}))}Ds.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ds("fill-extrusion",this.layers,e);for(var n=0,a=t;n=1){var v=d[y-1];if(!zs(g,v)){p.vertexLength+4>fi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=g.sub(v)._perp()._unit(),x=v.dist(g);m+x>32768&&(m=0),Es(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,0,m),Es(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,1,m),m+=x,Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+l>fi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Is[t.type]){for(var w=[],T=[],k=p.vertexLength,M=0,A=s;M=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u0;if(T&&g>u){var M=c.dist(f);if(M>2*p){var A=c.sub(c.sub(f)._mult(p/M)._round());this.updateDistance(f,A),this.addCurrentVertex(A,m,0,0,h),f=A}}var S=f&&d,C=S?r:s?"butt":n;if(S&&"round"===C&&(ba&&(C="bevel"),"bevel"===C&&(b>2&&(C="flipbevel"),b100)v=y.mult(-1);else{var L=b*m.add(y).mag()/m.sub(y).mag();v._perp()._mult(L*(k?-1:1))}this.addCurrentVertex(c,v,0,0,h),this.addCurrentVertex(c,v.mult(-1),0,0,h)}else if("bevel"===C||"fakeround"===C){var I=-Math.sqrt(b*b-1),P=k?I:0,E=k?0:I;if(f&&this.addCurrentVertex(c,m,P,E,h),"fakeround"===C)for(var D=Math.round(180*w/Math.PI/20),z=1;z2*p){var j=c.add(d.sub(c)._mult(p/N)._round());this.updateDistance(c,j),this.addCurrentVertex(j,y,0,0,h),c=j}}}}},Hs.prototype.addCurrentVertex=function(t,e,r,n,a,i){void 0===i&&(i=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,u=-e.y-e.x*n;this.addHalfVertex(t,o,s,i,!1,r,a),this.addHalfVertex(t,l,u,i,!0,-n,a),this.distance>qs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,a,i))},Hs.prototype.addHalfVertex=function(t,e,r,n,a,i,o){var s=t.x,l=t.y,u=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(a?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===i?0:i<0?-1:1)|(63&u)<<2,u>>6);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),a?this.e2=c:this.e1=c},Hs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(qs-1):this.distance},Hs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Nn("LineBucket",Hs,{omit:["layers","patternFeatures"]});var Zs=new Sa({"line-cap":new wa(Lt.layout_line["line-cap"]),"line-join":new Ta(Lt.layout_line["line-join"]),"line-miter-limit":new wa(Lt.layout_line["line-miter-limit"]),"line-round-limit":new wa(Lt.layout_line["line-round-limit"]),"line-sort-key":new Ta(Lt.layout_line["line-sort-key"])}),Gs={paint:new Sa({"line-opacity":new Ta(Lt.paint_line["line-opacity"]),"line-color":new Ta(Lt.paint_line["line-color"]),"line-translate":new wa(Lt.paint_line["line-translate"]),"line-translate-anchor":new wa(Lt.paint_line["line-translate-anchor"]),"line-width":new Ta(Lt.paint_line["line-width"]),"line-gap-width":new Ta(Lt.paint_line["line-gap-width"]),"line-offset":new Ta(Lt.paint_line["line-offset"]),"line-blur":new Ta(Lt.paint_line["line-blur"]),"line-dasharray":new Ma(Lt.paint_line["line-dasharray"]),"line-pattern":new ka(Lt.paint_line["line-pattern"]),"line-gradient":new Aa(Lt.paint_line["line-gradient"])}),layout:Zs},Ys=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new fa(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,a){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,a)},e}(Ta))(Gs.paint.properties["line-width"].specification);Ys.useIntegerZoom=!0;var Xs=function(t){function e(e){t.call(this,e,Gs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Io(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ys.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Hs(t)},e.prototype.queryRadius=function(t){var e=t,r=Ws(oo("line-width",this,e),oo("line-gap-width",this,e)),n=oo("line-offset",this,e);return r/2+Math.abs(n)+so(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*Ws(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var i=0;i0?e+2*t:t}var Js=Ea([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ks=Ea([{name:"a_projected_pos",components:3,type:"Float32"}],4),Qs=(Ea([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ea([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),$s=(Ea([{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:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ea([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),tl=Ea([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ea([{name:"triangle",components:3,type:"Uint16"}]),Ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ea([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ea([{type:"Float32",name:"offsetX"}]),Ea([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function el(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ha.applyArabicShaping&&(t=ha.applyArabicShaping(t)),t}(t.text,e,r)})),t}var rl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var nl=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,p=r?a-1:0,h=r?-1:1,f=t[e+p];for(p+=h,i=f&(1<<-c)-1,f>>=-c,c+=s;c>0;i=256*i+t[e+p],p+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+p],p+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),i-=u}return(f?-1:1)*o*Math.pow(2,i-n)},al=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,d=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+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(e*l-1)*Math.pow(2,a),o+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,a),o=0));a>=8;t[r+f]=255&s,f+=d,s/=256,a-=8);for(o=o<0;t[r+f]=255&o,f+=d,o/=256,u-=8);t[r+f-d]|=128*m},il=ol;function ol(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ol.Varint=0,ol.Fixed64=1,ol.Bytes=2,ol.Fixed32=5;var sl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ll(t){return t.type===ol.Bytes?t.readVarint()+t.pos:t.pos+1}function ul(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function cl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var a=r.pos-1;a>=t;a--)r.buf[a+n]=r.buf[a]}function pl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ol.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,i=this.pos;this.type=7&n,t(a,e,this),this.pos===i&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=xl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=xl(this.buf,this.pos)+4294967296*xl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=xl(this.buf,this.pos)+4294967296*wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,a,i=r.buf;if(a=i[r.pos++],n=(112&a)>>4,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<3,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<10,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<17,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(127&a)<<24,a<128)return ul(t,n,e);if(a=i[r.pos++],n|=(1&a)<<31,a<128)return ul(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},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.pos;return this.pos=t,t-e>=12&&sl?function(t,e,r){return sl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",a=e;for(;a239?4:l>223?3:l>191?2:1;if(a+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(i=t[a+1]))&&(u=(31&l)<<6|63&i)<=127&&(u=null):3===c?(i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&((u=(15&l)<<12|(63&i)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&i)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),a+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ol.Bytes)return t.push(this.readVarint(e));var r=ll(this);for(t=t||[];this.pos127;);else if(e===ol.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ol.Fixed32)this.pos+=4;else{if(e!==ol.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),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),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,a,i=0;i55295&&n<57344){if(!a){n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(t[r++]=239,t[r++]=191,t[r++]=189,a=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&cl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),al(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),al(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&cl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ol.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_l,e)},writeBytesField:function(t,e){this.writeTag(t,ol.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ol.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ol.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Tl(t,e,r){1===t&&r.readMessage(kl,e)}function kl(t,e,r){if(3===t){var n=r.readMessage(Ml,{}),a=n.id,i=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:a,bitmap:new So({width:o+6,height:s+6},i),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function Ml(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())}function Al(t){for(var e=0,r=0,n=0,a=t;n=0;h--){var f=o[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,l=Math.max(l,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=o.pop();h0&&N>M&&(M=N)}else{var j=r[S.fontStack],U=j&&j[L];if(U&&U.rect)E=U.rect,P=U.metrics;else{var V=e[S.fontStack],q=V&&V[L];if(!q)continue;P=q.metrics}I=24*(b-S.scale)}O?(t.verticalizable=!0,k.push({glyph:L,imageName:D,x:h,y:f+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:C,metrics:P,rect:E}),h+=z*S.scale+u):(k.push({glyph:L,imageName:D,x:h,y:f+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:C,metrics:P,rect:E}),h+=P.advance*S.scale+u)}if(0!==k.length){var H=h-u;d=Math.max(H,d),Vl(k,0,k.length-1,y,M)}h=0;var Z=i*b+M;T.lineOffset=Math.max(M,w),f+=Z,m=Math.max(Z,m),++g}else f+=i,++g}var G;var Y=f- -17,X=Ul(o),W=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,a,i,o,s,l){var u=(e-r)*a,c=0;c=i!==o?-s*n- -17:(-n*l+.5)*o;for(var p=0,h=t;p=0&&n>=t&&zl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},El.prototype.substring=function(t,e){var r=new El;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},El.prototype.toString=function(){return this.text},El.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},El.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Pl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ol={};function Rl(t,e,r,n,a,i){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/i+a:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+a:0}function Fl(t,e,r,n){var a=Math.pow(t-e,2);return n?t=0,p=0,h=0;h-r/2;){if(--o<0)return!1;s-=t[o].dist(i),i=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;sn;)u-=l.shift().angleDelta;if(u>a)return!1;o++,s+=p.dist(h)}return!0}function Jl(t){for(var e=0,r=0;ru){var d=(u-l)/f,m=He(p.x,h.x,d),y=He(p.y,h.y,d),g=new Hl(m,y,h.angleTo(p),c);return g._round(),!o||Wl(t,g,s,o,e)?g:void 0}l+=f}}function tu(t,e,r,n,a,i,o,s,l){var u=Kl(n,i,o),c=Ql(n,a),p=c*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-p=0&&b=0&&w=0&&f+c<=p){var T=new Hl(b,w,_,m);T._round(),a&&!Wl(e,T,o,a,i)||d.push(T)}}h+=v}l||d.length||s||(d=t(e,h/2,n,a,i,o,s,!0,u));return d}(t,h?e/2*s%e:(c/2+2*i)*o*s%e,e,u,r,p,h,!1,l)}function eu(t,e,r,n,i){for(var o=[],s=0;s=n&&h.x>=n||(p.x>=n?p=new a(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new a(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=i&&h.y>=i||(p.y>=i?p=new a(p.x+(h.x-p.x)*((i-p.y)/(h.y-p.y)),i)._round():h.y>=i&&(h=new a(p.x+(h.x-p.x)*((i-p.y)/(h.y-p.y)),i)._round()),u&&p.equals(u[u.length-1])||(u=[p],o.push(u)),u.push(h)))))}return o}function ru(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,c=t.right-t.left,p=t.bottom-t.top,h=o.stretchX||[[0,l]],f=o.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),y=f.reduce(d,0),g=l-m,v=u-y,_=0,x=m,b=0,w=y,T=0,k=g,M=0,A=v;if(o.content&&n){var S=o.content;_=nu(h,0,S[0]),b=nu(f,0,S[1]),x=nu(h,S[0],S[2]),w=nu(f,S[1],S[3]),T=S[0]-_,M=S[1]-b,k=S[2]-S[0]-x,A=S[3]-S[1]-w}var C=function(n,i,l,u){var h=iu(n.stretch-_,x,c,t.left),f=ou(n.fixed-T,k,n.stretch,m),d=iu(i.stretch-b,w,p,t.top),g=ou(i.fixed-M,A,i.stretch,y),v=iu(l.stretch-_,x,c,t.left),S=ou(l.fixed-T,k,l.stretch,m),C=iu(u.stretch-b,w,p,t.top),L=ou(u.fixed-M,A,u.stretch,y),I=new a(h,d),P=new a(v,d),E=new a(v,C),D=new a(h,C),z=new a(f/s,g/s),O=new a(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];I._matMult(N),P._matMult(N),D._matMult(N),E._matMult(N)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=u.stretch+u.fixed;return{tl:I,tr:P,bl:D,br:E,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:O,minFontScaleX:k/s/c,minFontScaleY:A/s/p,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=au(h,g,m),I=au(f,v,y),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,y=o.bottom*s+l,g=o.left*s-l,v=o.right*s+l,_=o.collisionPadding;if(_&&(g-=_[0]*s,m-=_[1]*s,v+=_[2]*s,y+=_[3]*s),c){var x=new a(g,m),b=new a(v,m),w=new a(g,y),T=new a(v,y),k=c*Math.PI/180;x._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),g=Math.min(x.x,b.x,w.x,T.x),v=Math.max(x.x,b.x,w.x,T.x),m=Math.min(x.y,b.y,w.y,T.y),y=Math.max(x.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,g,m,v,y,r,n,i)}this.boxEndIndex=t.length},lu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=uu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function uu(t,e){return te?1:0}function cu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],u=0;uo)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var p=o-n,h=s-i,f=Math.min(p,h),d=f/2,m=new lu([],pu);if(0===f)return new a(n,i);for(var y=n;yv.d||!v.d)&&(v=x,r&&console.log("found best %d after %d probes",Math.round(1e4*x.d)/1e4,_)),x.max-v.d<=e||(d=x.h/2,m.push(new hu(x.p.x-d,x.p.y-d,d,t)),m.push(new hu(x.p.x+d,x.p.y-d,d,t)),m.push(new hu(x.p.x-d,x.p.y+d,d,t)),m.push(new hu(x.p.x+d,x.p.y+d,d,t)),_+=4)}return r&&(console.log("num probes: "+_),console.log("best distance: "+v.d)),v.p}function pu(t,e){return e.max-t.max}function hu(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,a=0;at.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,ro(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}lu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},lu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},lu.prototype.peek=function(){return this.data[0]},lu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var a=t-1>>1,i=e[a];if(r(n,i)>=0)break;e[t]=i,t=a}e[t]=n},lu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,a=e[t];t=0)break;e[t]=o,t=i}e[t]=a};var fu=Number.POSITIVE_INFINITY;function du(t,e){return e[1]!==fu?function(t,e,r){var n=0,a=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":a=r-7;break;case"bottom-right":case"bottom-left":case"bottom":a=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,a]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var a=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=a-7;break;case"bottom-right":case"bottom-left":n=7-a;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-a;break;case"top-left":case"bottom-left":r=a;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function mu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function yu(t,e,r,n,i,o,s,l,u,c,p,h,f,d,m){var y=function(t,e,r,n,i,o,s,l){for(var u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[],p=0,h=e.positionedLines;p32640&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,v,l,o,s,c,e,u.lineStartIndex,u.lineLength,f,m);for(var _=0,x=p;_=0;o--)if(n.dist(i[o])0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=a.get("symbol-sort-key");if(this.features=[],l||u){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new fa(this.zoom),m=0,y=t;m=0;for(var D=0,z=k.sections;D=0;s--)i[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=e[s-1].dist(e[s]));for(var l=0;l0},Au.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Au.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Au.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Au.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Au.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,a=r.vertexStartIndex;a1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Nn("SymbolBucket",Au,{omit:["layers","collisionBoxArray","features","compareText"]}),Au.MAX_GLYPHS=65535,Au.addDynamicAttributes=wu;var Su=new Sa({"symbol-placement":new wa(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new wa(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wa(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ta(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wa(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wa(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wa(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new wa(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wa(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ta(Lt.layout_symbol["icon-size"]),"icon-text-fit":new wa(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wa(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ta(Lt.layout_symbol["icon-image"]),"icon-rotate":new Ta(Lt.layout_symbol["icon-rotate"]),"icon-padding":new wa(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new wa(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ta(Lt.layout_symbol["icon-offset"]),"icon-anchor":new Ta(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wa(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wa(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wa(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new Ta(Lt.layout_symbol["text-field"]),"text-font":new Ta(Lt.layout_symbol["text-font"]),"text-size":new Ta(Lt.layout_symbol["text-size"]),"text-max-width":new Ta(Lt.layout_symbol["text-max-width"]),"text-line-height":new wa(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ta(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new Ta(Lt.layout_symbol["text-justify"]),"text-radial-offset":new Ta(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wa(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ta(Lt.layout_symbol["text-anchor"]),"text-max-angle":new wa(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new wa(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new Ta(Lt.layout_symbol["text-rotate"]),"text-padding":new wa(Lt.layout_symbol["text-padding"]),"text-keep-upright":new wa(Lt.layout_symbol["text-keep-upright"]),"text-transform":new Ta(Lt.layout_symbol["text-transform"]),"text-offset":new Ta(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new wa(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wa(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new wa(Lt.layout_symbol["text-optional"])}),Cu={paint:new Sa({"icon-opacity":new Ta(Lt.paint_symbol["icon-opacity"]),"icon-color":new Ta(Lt.paint_symbol["icon-color"]),"icon-halo-color":new Ta(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ta(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ta(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new wa(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new wa(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ta(Lt.paint_symbol["text-opacity"]),"text-color":new Ta(Lt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ta(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new Ta(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ta(Lt.paint_symbol["text-halo-blur"]),"text-translate":new wa(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new wa(Lt.paint_symbol["text-translate-anchor"])}),layout:Su},Lu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};Lu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Lu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Lu.prototype.outputDefined=function(){return!1},Lu.prototype.serialize=function(){return null},Nn("FormatSectionOverride",Lu,{omit:["defaultValue"]});var Iu=function(t){function e(e){t.call(this,e,Cu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var a=[],i=0,o=n;i",targetMapId:n,sourceMapId:i.mapId})}}},Hu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Hu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hu.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Hn(e.error)):n(null,Hn(e.data)))}else{var a=!1,i=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){a=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,i)},i)}:function(t){a=!0},s=null,l=Hn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+e.type));!a&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Gu=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Gu.prototype.setNorthEast=function(t){return this._ne=t instanceof Yu?new Yu(t.lng,t.lat):Yu.convert(t),this},Gu.prototype.setSouthWest=function(t){return this._sw=t instanceof Yu?new Yu(t.lng,t.lat):Yu.convert(t),this},Gu.prototype.extend=function(t){var e,r,n=this._sw,a=this._ne;if(t instanceof Yu)e=t,r=t;else{if(!(t instanceof Gu)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var i=t;return this.extend(Gu.convert(i))}var o=t;return this.extend(Yu.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||a?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new Yu(e.lng,e.lat),this._ne=new Yu(r.lng,r.lat)),this},Gu.prototype.getCenter=function(){return new Yu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Gu.prototype.getSouthWest=function(){return this._sw},Gu.prototype.getNorthEast=function(){return this._ne},Gu.prototype.getNorthWest=function(){return new Yu(this.getWest(),this.getNorth())},Gu.prototype.getSouthEast=function(){return new Yu(this.getEast(),this.getSouth())},Gu.prototype.getWest=function(){return this._sw.lng},Gu.prototype.getSouth=function(){return this._sw.lat},Gu.prototype.getEast=function(){return this._ne.lng},Gu.prototype.getNorth=function(){return this._ne.lat},Gu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Gu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Gu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Gu.prototype.contains=function(t){var e=Yu.convert(t),r=e.lng,n=e.lat,a=this._sw.lat<=n&&n<=this._ne.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),a&&i},Gu.convert=function(t){return!t||t instanceof Gu?t:new Gu(t)};var Yu=function(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")};Yu.prototype.wrap=function(){return new Yu(u(this.lng,-180,180),this.lat)},Yu.prototype.toArray=function(){return[this.lng,this.lat]},Yu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Yu.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,a=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(a,1))},Yu.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Gu(new Yu(this.lng-r,this.lat-e),new Yu(this.lng+r,this.lat+e))},Yu.convert=function(t){if(t instanceof Yu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Yu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Yu(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Xu=2*Math.PI*6371008.8;function Wu(t){return Xu*Math.cos(t*Math.PI/180)}function Ju(t){return(180+t)/360}function Ku(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Qu(t,e){return t/Wu(e)}function $u(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var tc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};tc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Yu.convert(t);return new tc(Ju(r.lng),Ku(r.lat),Qu(e,r.lat))},tc.prototype.toLngLat=function(){return new Yu(360*this.x-180,$u(this.y))},tc.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Wu($u(e));var t,e},tc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xu*(t=$u(this.y),1/Math.cos(t*Math.PI/180));var t};var ec=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ac(0,t,t,e,r)};ec.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ec.prototype.url=function(t,e){var r,n,a,i,o,s=(r=this.x,n=this.y,a=this.z,i=Zu(256*r,256*(n=Math.pow(2,a)-n-1),a),o=Zu(256*(r+1),256*(n+1),a),i[0]+","+i[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,a="",i=t;i>0;i--)a+=(e&(n=1<this.canonical.z?new nc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},nc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?ac(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ac(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nc.prototype.children=function(t){if(this.overscaledZ>=t)return[new nc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nc(e,this.wrap,e,r,n),new nc(e,this.wrap,e,r+1,n),new nc(e,this.wrap,e,r,n+1),new nc(e,this.wrap,e,r+1,n+1)]},nc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},ic.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},ic.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},ic.prototype.getPixels=function(){return new Co({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ic.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,a=e*this.dim+this.dim,i=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=a-1;break;case 1:a=n+1}switch(r){case-1:i=o-1;break;case 1:o=i+1}for(var s=-e*this.dim,l=-r*this.dim,u=i;u=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},cc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ls.VectorTile(new il(this.rawTileData)).layers,this.sourceLayerCoder=new oc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},cc.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=sn(o.filter),u=t.queryGeometry,c=t.queryPadding*s,p=hc(u),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=hc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var u=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var c=0,p=u;c=0)return!0;return!1}(i,p)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(n);if(a.filter(new fa(this.tileID.overscaledZ),f))for(var d=this.getId(f,h),m=0;mn)a=!1;else if(e)if(this.expirationTimeot&&(t.getActor().send("enforceCacheSizeLimit",it),ht=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=eu,t.clone=function(t){var e=new po(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},t.clone$1=_,t.clone$2=function(t){var e=new po(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=tl,t.config=F,t.create=function(){var t=new po(16);return po!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new po(9);return po!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new po(4);return po!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Yr,t.createLayout=Ea,t.createStyleLayer=function(t){return"custom"===t.type?new Ou(t):new Ru[t.type](t)},t.cross=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.number=He,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-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]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new il(t).readFields(Tl,[])},t.pbf=il,t.performSymbolLayout=function(t,e,r,n,a,i,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=8192/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var p=t.textSizeData,h=p.minZoom,f=p.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new fa(h),o),u["text-size"].possiblyEvaluate(new fa(f),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,y=d.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new fa(m),o),u["icon-size"].possiblyEvaluate(new fa(y),o)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new fa(t.zoom+1),o),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new fa(t.zoom+1),o),c.textMaxSize=u["text-size"].possiblyEvaluate(new fa(18));for(var g=24*l.get("text-line-height"),v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),_=l.get("text-keep-upright"),x=l.get("text-size"),w=function(){var i=k[T],s=l.get("text-font").evaluate(i,{},o).join(","),u=x.evaluate(i,{},o),p=c.layoutTextSize.evaluate(i,{},o),h=c.layoutIconSize.evaluate(i,{},o),f={horizontal:{},vertical:void 0},d=i.text,m=[0,0];if(d){var y=d.toString(),w=24*l.get("text-letter-spacing").evaluate(i,{},o),M=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,w,T,k,M){var A,S,C,L,I,P=t.addToLineVertexArray(e,r),E=0,D=0,z=0,O=0,R=-1,F=-1,B={},N=vi(""),j=0,U=0;void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(A=s.layout.get("text-offset").evaluate(x,{},k).map((function(t){return 24*t})),j=A[0],U=A[1]):(j=24*s.layout.get("text-radial-offset").evaluate(x,{},k),U=fu);if(t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(x,{},k)+90,q=n.vertical;L=new su(l,e,u,c,p,q,h,f,d,V),o&&(I=new su(l,e,u,c,p,o,y,g,d,V))}if(a){var H=s.layout.get("icon-rotate").evaluate(x,{}),Z="none"!==s.layout.get("icon-text-fit"),G=ru(a,H,T,Z),Y=o?ru(o,H,T,Z):void 0;C=new su(l,e,u,c,p,a,y,g,!1,H),E=4*G.length;var X=t.iconSizeData,W=null;"source"===X.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((W=[128*w.compositeIconSizes[0].evaluate(x,{},k),128*w.compositeIconSizes[1].evaluate(x,{},k)])[0]>32640||W[1]>32640)&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,W,_,v,x,!1,e,P.lineStartIndex,P.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,Y&&(D=4*Y.length,t.addSymbols(t.icon,Y,W,_,v,x,Il.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var J in n.horizontal){var K=n.horizontal[J];if(!S){N=vi(K.text);var Q=s.layout.get("text-rotate").evaluate(x,{},k);S=new su(l,e,u,c,p,K,h,f,d,Q)}var $=1===K.positionedLines.length;if(z+=yu(t,e,K,i,s,d,x,m,P,n.vertical?Il.horizontal:Il.horizontalOnly,$?Object.keys(n.horizontal):[J],B,R,w,k),$)break}n.vertical&&(O+=yu(t,e,n.vertical,i,s,d,x,m,P,Il.vertical,["vertical"],B,F,w,k));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=L?L.boxStartIndex:t.collisionBoxArray.length,nt=L?L.boxEndIndex:t.collisionBoxArray.length,at=C?C.boxStartIndex:t.collisionBoxArray.length,it=C?C.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,lt=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ut(S,lt),lt=ut(L,lt),lt=ut(C,lt);var ct=(lt=ut(I,lt))>-1?1:0;ct&&(lt*=M/24);t.glyphOffsetArray.length>=Au.MAX_GLYPHS&&b("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey);t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,tt,et,rt,nt,at,it,ot,st,u,z,O,E,D,ct,0,h,j,U,lt)}(t,p,s,r,n,a,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,w,M,l,_,T,A,d,e,i,u,c,o)};if("line"===S)for(var P=0,E=eu(e.geometry,0,0,8192,8192);P1){var V=$l(U,k,r.vertical||m,n,24,v);V&&I(U,V)}}else if("Polygon"===e.type)for(var q=0,H=hs(e.geometry,0);q=C.maxzoom))if("none"!==C.visibility)o(S,this.zoom,n),(m[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),c.bucketLayerIDs.push(S.map((function(t){return t.id})))}}}var L=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(L).length?i.send("getGlyphs",{uid:this.uid,stacks:L},(function(t,e){p||(p=t,h=e,E.call(l))})):h={};var I=Object.keys(y.iconDependencies);I.length?i.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,f=e,E.call(l))})):f={};var P=Object.keys(y.patternDependencies);function E(){if(p)return s(p);if(h&&f&&d){var e=new a(h),r=new t.ImageAtlas(f,d);for(var i in m){var l=m[i];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,h,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?i.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,E.call(l))})):d={},E.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,a=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[a]=new i(e);s.abort=this.loadVectorData(e,(function(e,i){if(delete n.loading[a],e||!i)return s.status="done",n.loaded[a]=s,r(e);var l=i.rawData,u={};i.expires&&(u.expires=i.expires),i.cacheControl&&(u.cacheControl=i.cacheControl);var c={};if(o){var p=o.finish();p&&(c.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=i.vectorTile,s.parse(i.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[a]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,a=t.uid,i=this;if(n&&n[a]){var o=n[a];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,r.availableImages,i.actor,a)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};c.prototype.loadTile=function(e,r){var n=e.uid,a=e.encoding,i=e.rawImageData,o=u&&i instanceof u?this.getImageData(i):i,s=new t.DEMData(n,o,a);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var p=function t(e,r){var n,a=e&&e.type;if("FeatureCollection"===a)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,a=0,i=0,o=r.length,s=0;s>1;!function t(e,r,n,a,i,o){for(;i>a;){if(i-a>600){var s=i-a+1,l=n-a+1,u=Math.log(s),c=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),h=Math.max(a,Math.floor(n-l*c/s+p)),f=Math.min(i,Math.floor(n+(s-l)*c/s+p));t(e,r,n,h,f,o)}var d=r[2*n+o],m=a,y=i;for(z(e,r,a,n),r[2*i+o]>d&&z(e,r,a,i);md;)y--}r[2*a+o]===d?z(e,r,a,y):(y++,z(e,r,y,i)),y<=n&&(a=y+1),n<=y&&(i=y-1)}}(t,e,o,n,a,i%2),D(t,e,r,n,o-1,i+1),D(t,e,r,o+1,a,i+1)}}function z(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}function R(t,e,r,n){var a=t-r,i=e-n;return a*a+i*i}b.fromVectorTileJs=w,b.fromGeojsonVt=T,b.GeoJSONWrapper=k;var F=function(t){return t[0]},B=function(t){return t[1]},N=function(t,e,r,n,a){void 0===e&&(e=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===a&&(a=Float64Array),this.nodeSize=n,this.points=t;for(var i=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new i(t.length),s=this.coords=new a(2*t.length),l=0;l=r&&s<=a&&l>=n&&l<=i&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=a&&l>=n&&l<=i&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===p?a>=s:i>=l)&&(u.push(m+1),u.push(h),u.push(y))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,a,i){for(var o=[0,t.length-1,0],s=[],l=a*a;o.length;){var u=o.pop(),c=o.pop(),p=o.pop();if(c-p<=i)for(var h=p;h<=c;h++)R(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var f=Math.floor((p+c)/2),d=e[2*f],m=e[2*f+1];R(d,m,r,n)<=l&&s.push(t[f]);var y=(u+1)%2;(0===u?r-a<=d:n-a<=m)&&(o.push(p),o.push(f-1),o.push(y)),(0===u?r+a>=d:n+a>=m)&&(o.push(f+1),o.push(c),o.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=X(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,a){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:a}}function q(t,e){var r=t.geometry.coordinates,n=r[0],a=r[1];return{x:G(n),y:Y(a),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:Z(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Z(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function G(t){return t/360+.5}function Y(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 X(t,e){for(var r in e)t[r]=e[r];return t}function W(t){return t.x}function J(t){return t.y}function K(t,e,r,n,a,i){var o=a-r,s=i-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=a,n=i):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function Q(t,e,r,n){var a={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(a*u-l*i)/2:Math.sqrt(Math.pow(l-a,2)+Math.pow(u-i,2))),a=l,i=u}var c=e.length-3;e[2]=1,function t(e,r,n,a){for(var i,o=a,s=n-r>>1,l=n-r,u=e[r],c=e[r+1],p=e[n],h=e[n+1],f=r+3;fo)i=f,o=d;else if(d===o){var m=Math.abs(f-s);ma&&(i-r>3&&t(e,r,i,a),e[i+2]=o,n-i>3&&t(e,i,n,a))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function nt(t,e,r,n){for(var a=0;a1?1:r}function ot(t,e,r,n,a,i,o,s){if(n/=e,i>=(r/=e)&&o=n)return null;for(var l=[],u=0;u=r&&d=n)){var m=[];if("Point"===h||"MultiPoint"===h)st(p,m,r,n,a);else if("LineString"===h)lt(p,m,r,n,a,!1,s.lineMetrics);else if("MultiLineString"===h)ct(p,m,r,n,a,!1);else if("Polygon"===h)ct(p,m,r,n,a,!0);else if("MultiPolygon"===h)for(var y=0;y=r&&o<=n&&(e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]))}}function lt(t,e,r,n,a,i,o){for(var s,l,u=ut(t),c=0===a?ht:ft,p=t.start,h=0;hr&&(l=c(u,f,d,y,g,r),o&&(u.start=p+s*l)):v>n?_=r&&(l=c(u,f,d,y,g,r),x=!0),_>n&&v<=n&&(l=c(u,f,d,y,g,n),x=!0),!i&&x&&(o&&(u.end=p+s*l),e.push(u),u=ut(t)),o&&(p+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(v=0===a?f:d)>=r&&v<=n&&pt(u,f,d,m),b=u.length-3,i&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&pt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function ut(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ct(t,e,r,n,a,i){for(var o=0;oo.maxX&&(o.maxX=c),p>o.maxY&&(o.maxY=p)}return o}function _t(t,e,r,n){var a=e.geometry,i=e.type,o=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s0&&e.size<(a?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;a&&function(t,e){for(var r=0,n=0,a=t.length,i=a-2;n0===e)for(n=0,a=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new N(s,W,J,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,a=180;else if(r>a){var o=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,a,i],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,p=l.range(G(r),Y(i),G(a),Y(n));c1?this._map(u,!0):null,y=(l<<5)+(e+1)+this.points.length,g=0,v=p;g>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},bt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},bt.prototype.splitTile=function(t,e,r,n,a,i,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),h=this.tiles[p]=vt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,a){if(e===l.maxZoom||e===a)continue;var d=1<1&&console.time("clipping");var m,y,g,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=y=g=v=null,_=ot(t,c,r-b,r+T,0,h.minX,h.maxX,l),x=ot(t,c,r+w,r+k,0,h.minX,h.maxX,l),t=null,_&&(m=ot(_,c,n-b,n+T,1,h.minY,h.maxY,l),y=ot(_,c,n+w,n+k,1,h.minY,h.maxY,l),_=null),x&&(g=ot(x,c,n-b,n+T,1,h.minY,h.maxY,l),v=ot(x,c,n+w,n+k,1,h.minY,h.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(g||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},bt.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,i=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,p=r;!l&&u>0;)u--,c=Math.floor(c/2),p=Math.floor(p/2),l=this.tiles[wt(u,c,p)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",u,c,p),i>1&&console.time("drilling down"),this.splitTile(l.source,u,c,p,t,e,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?yt(this.tiles[s],a):null):null};var kt=function(e){function r(t,r,n,a){e.call(this,t,r,n,Tt),a&&(this.loadGeoJSON=a)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var a=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(i,o){if(i||!o)return r(i);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));p(o,!0);try{e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var a={},i={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function g(t,e,r,n,a,i,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(i.ranges[s])e(null,{stack:r,id:a,glyph:o});else{var l=i.requests[s];l||(l=i.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(i.glyphs[+r]=e[+r]);i.ranges[s]=!0}for(var a=0,o=l;a1&&(l=t[++s]);var c=Math.abs(u-l.left),p=Math.abs(u-l.right),h=Math.min(c,p),f=void 0,d=a/r*(n+1);if(l.isDash){var m=n-Math.abs(d);f=Math.sqrt(h*h+m*m)}else f=n-Math.sqrt(h*h+d*d);this.data[o+u]=Math.max(0,Math.min(255,f+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var a=t[0],i=t[t.length-1];a.isDash===i.isDash&&(a.left=i.left-this.width,i.right=a.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],u=0;u1&&(l=t[++s]);var c=Math.abs(u-l.left),p=Math.abs(u-l.right),h=Math.min(c,p),f=l.isDash?h:-h;this.data[o+u]=Math.max(0,Math.min(255,f+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,a=2*n+1;if(this.nextRow+a>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var i=0,o=0;o=n&&e.x=a&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,i,r.z,a,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),a=this._data;"string"==typeof a?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(a),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(a),this.actor.send(this.type+".loadData",n,(function(t,a){r._removed||a&&a.abandoned||(r._loaded=!0,a&&a.resourceTiming&&a.resourceTiming[r.id]&&(r._resourceTiming=a.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,a=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(a,i,(function(t,i){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(i,n.map.painter,"reloadTile"===a),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),E=function(e){function r(t,r,n,a){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(a),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(a,i){n._loaded=!0,a?n.fire(new t.ErrorEvent(a)):i&&(n.image=i,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,a=-1/0,i=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(E),z=function(e){function r(r,n,a,i){e.call(this,r,n,a,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var a in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var i=this.tiles[a];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),a=this.data[r][n];return this.data[r].splice(n,1),a.timeout&&clearTimeout(a.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(a.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,a=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[i]&&(t.neighboringTiles[i].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var a in this._tiles){var i=this._tiles[a];if(!(n[a]||!i.hasData()||i.tileID.overscaledZ<=e||i.tileID.overscaledZ>r)){for(var o=i.tileID;i&&i.tileID.overscaledZ>e+1;){var s=i.tileID.scaledTo(i.tileID.overscaledZ-1);(i=this._tiles[s.key])&&i.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var a=t.scaledTo(n),i=this._getLoadedTile(a);if(i)return i}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var a in this._tiles){var i=this._tiles[a];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+r),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var a;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(a=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(a=a.filter((function(t){return n._source.hasTile(t)})))):a=[];var i=e.coveringZoomLevel(this._source),o=Math.max(i-r.maxOverzooming,this._source.minzoom),s=Math.max(i+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(a,i);if(Et(this._source.type)){for(var u={},c={},p=0,h=Object.keys(l);pthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],g=this.getTile(y);if(g&&g.hasData()){n[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=i;--x){var b=d.scaledTo(x);if(a[b.key])break;if(a[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var a=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(a))break;n=a}for(var i=0,o=e;i0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var a=this,i=[],o=this.transform;if(!o)return i;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),u=s.map((function(t){return o.pointCoordinate(t)})),c=this.getIds(),p=1/0,h=1/0,f=-1/0,d=-1/0,m=0,y=u;m=0&&g[1].y+y>=0){var v=l.map((function(t){return s.getTilePoint(t)})),_=u.map((function(t){return s.getTilePoint(t)}));i.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles){this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading")}this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Et(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(Wa.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(a-o)/s:0;return this.points[i].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var i=0;i=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,a,i,o,s,l){var u=a?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],h=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var f=e.lineVertexArray,d=a?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,y=!1,g=0;gMath.abs(n.x-r.x)*a)return{useVertical:!0};return(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,a,i,o,s,l,u,c,p,h,f,d){var m,y=r/24,g=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ae(y,l,g,v,n,p,h,e,u,o,f);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,k=te(w.last.point,s).point;if(a&&!n){var M=ie(e.writingMode,T,k,d);if(M)return M}m=[w.first];for(var A=e.glyphStartIndex+1;A<_-1;A++)m.push(le(y*l.getoffsetX(A),g,v,n,p,h,e.segment,x,b,u,o,f));m.push(w.last)}else{if(a&&!n){var S=te(h,i).point,C=e.lineStartIndex+e.segment+1,L=new t.Point(u.getx(C),u.gety(C)),I=te(L,i),P=I.signedDistanceFromCamera>0?I.point:se(h,L,S,1,i),E=ie(e.writingMode,S,P,d);if(E)return E}var D=le(y*l.getoffsetX(e.glyphStartIndex),g,v,n,p,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f);if(!D)return{notEnoughRoom:!0};m=[D]}for(var z=0,O=m;z0?1:-1,m=0;a&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?l+s:l+s+1,g=i,v=i,_=0,x=0,b=Math.abs(f),w=[];_+x<=b;){if((y+=d)=u)return null;if(v=g,w.push(g),void 0===(g=h[y])){var T=new t.Point(c.getx(y),c.gety(y)),k=te(T,p);if(k.signedDistanceFromCamera>0)g=h[y]=k.point;else{var M=y-d;g=se(0===_?o:new t.Point(c.getx(M),c.gety(M)),T,v,b-_+1,p)}}_+=x,x=v.dist(g)}var A=(b-_)/x,S=g.sub(v),C=S.mult(A)._add(v);C._add(S._unit()._perp()._mult(n*d));var L=m+Math.atan2(g.y-v.y,g.x-v.x);return w.push(C),{point:C,angle:L,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,a){this._forEachCell(e,r,n,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,a,i){this.boxCells[a].push(i)},Kt.prototype._insertCircleCell=function(t,e,r,n,a,i){this.circleCells[a].push(i)},Kt.prototype._query=function(t,e,r,n,a,i){if(r<0||t>this.width||n<0||e>this.height)return!a&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(a)return!0;for(var s=0;s0:o},Kt.prototype._queryCircle=function(t,e,r,n,a){var i=t-r,o=t+r,s=e-r,l=e+r;if(o<0||i>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,s,o,l,this._queryCellCircle,u,c,a),n?u.length>0:u},Kt.prototype.query=function(t,e,r,n,a){return this._query(t,e,r,n,!1,a)},Kt.prototype.hitTest=function(t,e,r,n,a){return this._query(t,e,r,n,!0,a)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,a,i,o,s){var l=o.seenUids,u=this.boxCells[a];if(null!==u)for(var c=this.bboxes,p=0,h=u;p=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return i.push(!0),!0;i.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[a];if(null!==m)for(var y=this.circles,g=0,v=m;go*o+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,a,i,o){var s=(i-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-a)/2,c=Math.abs(e-(a+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var p=l-s,h=c-u;return p*p+h*h<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var r=0;r=1;P--)I.push(C.path[P]);for(var E=1;E0){for(var R=I[0].clone(),F=I[0].clone(),B=1;B=M.x&&F.x<=A.x&&R.y>=M.y&&F.y<=A.y?[I]:F.xA.x||F.yA.y?[]:t.clipLine([I],M.x,M.y,A.x,A.y)}for(var N=0,j=O;N=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:a,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:g,placedGlyphBoxes:v}},we.prototype.placeLayerBucketPart=function(e,r,n){var a=this,i=e.parameters,o=i.bucket,s=i.layout,l=i.posMatrix,u=i.textLabelPlaneMatrix,c=i.labelToScreenMatrix,p=i.textPixelRatio,h=i.holdingForFade,f=i.collisionBoxArray,d=i.partiallyEvaluatedTextSize,m=i.collisionGroup,y=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(_||!o.hasIconData()||g),M=_&&(v||!o.hasTextData()||y);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var A=function(e,i){if(!r[e.crossTileID])if(h)a.placements[e.crossTileID]=new ye(!1,!1,!1);else{var f,T=!1,A=!1,S=!0,C=null,L={box:null,offscreen:null},I={box:null,offscreen:null},P=null,E=null,D=0,z=0,O=0;i.textFeatureIndex?D=i.textFeatureIndex:e.useRuntimeCollisionCircles&&(D=e.featureIndex),i.verticalTextFeatureIndex&&(z=i.verticalTextFeatureIndex);var R=i.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&a.prevPlacement){var i=a.prevPlacement.placedOrientations[e.crossTileID];i&&(a.placedOrientations[e.crossTileID]=i,n=i,a.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i.verticalTextBox)for(var a=0,s=o.writingModes;a0&&(N=N.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,r,n){for(var i=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!_?r:null,h={box:[],offscreen:!1},f=v?2*N.length:N.length,d=0;d=N.length,k=a.attemptAnchorPlacement(y,t,i,s,u,x,b,p,l,m,g,e,o,n,c);if(k&&(h=k.placedGlyphBoxes)&&h.box&&h.box.length){T=!0,C=k.shift;break}}return h};B((function(){return U(R,i.iconBox,t.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox,n=L&&L.box&&L.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,i.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&a.prevPlacement){var q=a.prevPlacement.variableOffsets[e.crossTileID];q&&(a.variableOffsets[e.crossTileID]=q,a.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=a.collisionIndex.placeCollisionBox(t,v,p,l,m.predicate);return n&&n.box&&n.box.length&&(a.markUsedOrientation(o,r,e),a.placedOrientations[e.crossTileID]=r),n};B((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(L&&L.box&&L.box.length)}}if(T=(f=L)&&f.box&&f.box.length>0,S=f&&f.offscreen,e.useRuntimeCollisionCircles){var Z=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),G=t.evaluateSizeForFeature(o.textSizeData,d,Z),Y=s.get("text-padding"),X=e.collisionCircleDiameter;P=a.collisionIndex.placeCollisionCircles(v,Z,o.lineVertexArray,o.glyphOffsetArray,G,l,u,c,n,b,m.predicate,X,Y),T=v||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(i.iconFeatureIndex&&(O=i.iconFeatureIndex),i.iconBox){var W=function(t){var e=w&&C?be(t,C.x,C.y,x,b,a.transform.angle):t;return a.collisionIndex.placeCollisionBox(e,_,p,l,m.predicate)};A=I&&I.box&&I.box.length&&i.verticalIconBox?(E=W(i.verticalIconBox)).box.length>0:(E=W(i.iconBox)).box.length>0,S=S&&E.offscreen}var J=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=g||0===e.numIconVertices;if(J||K?K?J||(A=A&&T):T=A&&T:A=T=A&&T,T&&f&&f.box&&(I&&I.box&&z?a.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID):a.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID)),A&&E&&a.collisionIndex.insertCollisionBox(E.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),P&&(T&&a.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID),n)){var Q=o.bucketInstanceId,$=a.collisionCircleArrays[Q];void 0===$&&($=a.collisionCircleArrays[Q]=new ge);for(var tt=0;tt=0;--C){var L=S[C];A(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var I=e.symbolInstanceStart;I=0&&(e.text.placedSymbolArray.get(u).crossTileID=i>=0&&u!==i?0:n.crossTileID)}},we.prototype.markUsedOrientation=function(e,r,n){for(var a=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,i=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,_=i.numIconVertices>0,x=a.placedOrientations[i.crossTileID],b=x===t.WritingMode.vertical,w=x===t.WritingMode.horizontal||x===t.WritingMode.horizontalOnly;if(v){var T=Pe(g.text),k=b?Ee:T;d(e.text,s,k);var M=w?Ee:T;d(e.text,l,M);var A=g.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=A||b?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var S=a.variableOffsets[i.crossTileID];S&&a.markUsedJustification(e,S.anchor,i,x);var C=a.placedOrientations[i.crossTileID];C&&(a.markUsedJustification(e,"left",i,C),a.markUsedOrientation(e,C,i))}if(_){var L=Pe(g.icon),I=!(h&&i.verticalPlacedIconSymbolIndex&&b);if(i.placedIconSymbolIndex>=0){var P=I?L:Ee;d(e.icon,i.numIconVertices,P),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(i.verticalPlacedIconSymbolIndex>=0){var E=I?Ee:L;d(e.icon,i.numVerticalIconVertices,E),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var D=e.collisionArrays[n];if(D){var z=new t.Point(0,0);if(D.textBox||D.verticalTextBox){var O=!0;if(u){var R=a.variableOffsets[m];R?(z=xe(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),c&&z._rotate(p?a.transform.angle:-a.transform.angle)):O=!1}D.textBox&&Te(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||b,z.x,z.y),D.verticalTextBox&&Te(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||w,z.x,z.y)}var F=Boolean(!w&&D.verticalIconBox);D.iconBox&&Te(e.iconCollisionBox.collisionVertexArray,g.icon.placed,F,h?z.x:0,h?z.y:0),D.verticalIconBox&&Te(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!F,h?z.x:0,h?z.y:0)}}},y=0;yt},we.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Ae=Math.pow(2,17),Se=Math.pow(2,16),Ce=Math.pow(2,9),Le=Math.pow(2,8),Ie=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Me+r*Ae+e*Se+r*Ce+e*Le+r*Ie+e}var Ee=0,De=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};De.prototype.continuePlacement=function(t,e,r,n,a){for(var i=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,a)}else{var u=o[t.scaledTo(Number(i)).key];u&&u.findMatches(e.symbolInstances,t,a)}}for(var c=0;c1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,a=e,c())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,o||(o=t,i=e,c())}));function c(){if(o)n(o);else if(a&&i){var e=t.browser.getImageData(i),r={};for(var s in a){var l=a[s],u=l.width,c=l.height,p=l.x,h=l.y,f=l.sdf,d=l.pixelRatio,m=l.stretchX,y=l.stretchY,g=l.content,v=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,v,{x:p,y:h},{x:0,y:0},{width:u,height:c}),r[s]={data:v,pixelRatio:d,sdf:f,stretchX:m,stretchY:y,content:g}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var a in n)r.imageManager.addImage(a,n[a]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var a=r.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+a.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+a.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var a=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var i=this.sourceCaches[e]=new It(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(function(){return{isSourceLoaded:a.loaded(),source:i.serialize(),sourceId:e}})),i.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=e.id;if(this.getLayer(a))this.fire(new t.ErrorEvent(new Error('Layer with id "'+a+'" already exists on this map')));else{var i;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;i=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(a,e.source),e=t.clone$1(e),e=t.extend(e,{source:a})),this._validate(t.validateStyle.layer,"layers."+a,e,{arrayIndex:-1},n))return;i=t.createStyleLayer(e),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}}),this._serializedLayers[i.id]=i.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){var s=this._removedLayers[a];delete this._removedLayers[a],s.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var a=r?this._order.indexOf(r):this._order.length;r&&-1===a?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(a,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var a=this.getLayer(e);a?a.minzoom===r&&a.maxzoom===n||(null!=r&&(a.minzoom=r),null!=n&&(a.maxzoom=n),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(e);if(a){if(!t.deepEqual(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(t.validateStyle.filter,"layers."+a.id+".filter",r,null,n)||(a.filter=t.clone$1(r),this._updateLayer(a)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n,a),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getPaintProperty(r),n)||(i.setPaintProperty(r,n,a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=e.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type;"geojson"===o&&a?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||a?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.setFeatureState(a,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=this.sourceCaches[n];if(void 0!==a){var i=a.getSource().type,o="vector"===i?e.sourceLayer:void 0;"vector"!==i||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):a.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,a=this.sourceCaches[r];if(void 0!==a){if("vector"!==a.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},a=[],i=this._order.length-1;i>=0;i--){var o=this._order[i];if(r(o)){n[o]=i;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var y=a.length-1;y>=0;y--){var g=a[y].feature;if(n[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=vr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=vr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=vr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=vr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=vr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=vr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),lr=vr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=vr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),cr=vr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=vr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),fr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=vr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),mr=vr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),yr=vr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gr=vr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function vr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,a,i){return n[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,a,i){var o="float"===a?"vec2":"vec4",s=i.match(/color/)?"color":o;return n[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"}))}}var _r=Object.freeze({__proto__:null,prelude:Ge,background:Ye,backgroundPattern:Xe,circle:We,clippingMask:Je,heatmap:Ke,heatmapTexture:Qe,collisionBox:$e,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ar,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:sr,hillshadePrepare:lr,hillshade:ur,line:cr,lineGradient:pr,linePattern:hr,lineSDF:fr,raster:dr,symbolIcon:mr,symbolSDF:yr,symbolTextAndIcon:gr}),xr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};xr.prototype.bind=function(t,e,r,n,a,i,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}br.prototype.draw=function(t,e,r,n,a,i,o,s,l,u,c,p,h,f,d,m){var y,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(a),t.setCullFace(i),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var _=(y={},y[g.LINES]=2,y[g.TRIANGLES]=3,y[g.LINE_STRIP]=1,y)[e],x=0,b=c.get();x0?1-1/(1.001-o):-o),u_contrast_factor:(i=a.paint.get("raster-contrast"),i>0?1/(1-i):1+i),u_spin_weights:qr(a.paint.get("raster-hue-rotate"))};var i,o};function qr(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]}var Hr,Zr=function(t,e,r,n,a,i,o,s,l,u){var c=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:i,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Gr=function(e,r,n,a,i,o,s,l,u,c,p){var h=i.transform;return t.extend(Zr(e,r,n,a,i,o,s,l,u,c),{u_gamma_scale:a?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})},Yr=function(e,r,n,a,i,o,s,l,u,c){return t.extend(Gr(e,r,n,a,i,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},Xr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,a,i,o){return t.extend(function(t,e,r,n){var a=r.imageManager.getPattern(t.from.toString()),i=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,p=c*(n.tileID.canonical.x+n.tileID.wrap*u),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:i.tl,u_pattern_br_b:i.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:i.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/fe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(a,o,n,i),{u_matrix:e,u_opacity:r})},Jr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,a,i,o,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),p=[],h=0,f=0,d=0;d0){var b=t.create(),w=v;t.mul(b,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,g.placementViewportMatrix),p.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=h+=x.length/4}_&&c.draw(l,u.LINES,Mt.disabled,At.disabled,e.colorModeForRenderPass(),Ct.disabled,Ir(v,e.transform,y),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&p.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var M=0,A=0,S=p;A=0&&(m[g.associatedIconIndex]={shiftedAnchor:S,angle:C})}else ce(g.numGlyphs,f)}if(p){d.clear();for(var I=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),p=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(e.tileID.overscaledZ-p),f=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var cn=new t.Color(1,0,0,1),pn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),fn=new t.Color(1,0,1,1),dn=new t.Color(0,1,1,1);function mn(t){var e=t.transform.padding;yn(t,t.transform.height-(e.top||0),3,cn),yn(t,e.bottom||0,3,pn),gn(t,e.left||0,3,hn),gn(t,t.transform.width-(e.right||0),3,fn);var r=t.transform.centerPoint;!function(t,e,r,n){vn(t,e-1,r-10,2,20,n),vn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,dn)}function yn(t,e,r,n){vn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){vn(t,e-r/2,0,r,t.transform.height,n)}function vn(e,r,n,a,i,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function _n(e,r,n){var a=e.context,i=a.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,u=At.disabled,c=e.colorModeForRenderPass();a.activeTexture.set(i.TEXTURE0),e.emptyTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE),s.draw(a,i.LINE_STRIP,l,u,c,Ct.disabled,Er(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,h=p&&p.byteLength||0,f=Math.floor(h/1024),d=r.getTile(n).tileSize,m=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,a=t.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,r.width,r.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(e,5,5),a.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+f+"kb"),s.draw(a,i.TRIANGLES,l,u,St.alphaBlended,Ct.disabled,Er(o,t.Color.transparent,m),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var xn={symbol:function(e,r,n,a,i){if("translucent"===e.renderPass){var o=At.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,a,i,o,s){for(var l=r.transform,u="map"===i,c="map"===o,p=0,h=e;p256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(Mt.disabled);var a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var i=0,o=e;i256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new At({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},bn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new At({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},bn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),a=n[n.length-1].overscaledZ,i=n[0].overscaledZ-a+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[a[this.currentLayer]],T=i[w.source],k=c[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},bn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},bn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,_r[t],e,Jr[t],this._showOverdrawInspector)),this.cache[r]},bn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},bn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},bn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},bn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var wn=function(t,e){this.points=t,this.planes=e};wn.fromInvProjectionMatrix=function(e,r,n){var a=Math.pow(2,n),i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*a)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],i[e[0]],i[e[1]]),n=t.sub([],i[e[2]],i[e[1]]),a=t.normalize([],t.cross([],r,n)),o=-t.dot(a,i[e[1]]);return a.concat(o)}));return new wn(i,o)};var Tn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Tn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),a=t.clone$2(this.max),i=0;i=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;pthis.max[l]-this.min[l])return 0}return 1};var kn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};kn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},kn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),a=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,a)},kn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},kn.prototype.clone=function(){return new kn(this.top,this.bottom,this.left,this.right)},kn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Mn=function(e,r,n,a,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==a?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new kn,this._posMatrixCache={},this._alignedPosMatrixCache={}},An={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Mn.prototype.clone=function(){var t=new Mn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},An.minZoom.get=function(){return this._minZoom},An.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},An.maxZoom.get=function(){return this._maxZoom},An.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},An.minPitch.get=function(){return this._minPitch},An.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},An.maxPitch.get=function(){return this._maxPitch},An.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},An.renderWorldCopies.get=function(){return this._renderWorldCopies},An.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},An.worldSize.get=function(){return this.tileSize*this.scale},An.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},An.size.get=function(){return new t.Point(this.width,this.height)},An.bearing.get=function(){return-this.angle/Math.PI*180},An.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},An.pitch.get=function(){return this._pitch/Math.PI*180},An.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},An.fov.get=function(){return this._fov/Math.PI*180},An.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},An.zoom.get=function(){return this._zoom},An.zoom.set=function(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._constrain(),this._calcMatrices())},An.center.get=function(){return this._center},An.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},An.padding.get=function(){return this._edgeInsets.toJSON()},An.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},An.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Mn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Mn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Mn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Mn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),a=this.pointCoordinate(new t.Point(this.width,0)),i=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,a.x,i.x,o.x)),l=Math.floor(Math.max(n.x,a.x,i.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},Mn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var a=t.MercatorCoordinate.fromLngLat(this.center),i=Math.pow(2,r),o=[i*a.x,i*a.y,0],s=wn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new Tn([t*i,0,0],[(t+1)*i,i,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],p=[],h=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(u(-d)),c.push(u(d));for(c.push(u(0));c.length>0;){var m=c.pop(),y=m.x,g=m.y,v=m.fullyVisible;if(!v){var _=m.aabb.intersects(s);if(0===_)continue;v=2===_}var x=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(x),Math.abs(b)),T=3+(1<T&&m.zoom>=l)p.push({tileID:new t.OverscaledTileID(m.zoom===h?f:m.zoom,m.wrap,m.zoom,y,g),distanceSq:t.sqrLen([o[0]-.5-y,o[1]-.5-g])});else for(var k=0;k<4;k++){var M=(y<<1)+k%2,A=(g<<1)+(k>>1);c.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:M,y:A,wrap:m.wrap,fullyVisible:v})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Mn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},An.unmodified.get=function(){return this._unmodified},Mn.prototype.zoomScale=function(t){return Math.pow(2,t)},Mn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Mn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Mn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},An.point.get=function(){return this.project(this.center)},Mn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(e),o=new t.MercatorCoordinate(i.x-(n.x-a.x),i.y-(n.y-a.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Mn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Mn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Mn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Mn.prototype.coordinateLocation=function(t){return t.toLngLat()},Mn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var a=r[3],i=n[3],o=r[0]/a,s=n[0]/i,l=r[1]/a,u=n[1]/i,c=r[2]/a,p=n[2]/i,h=c===p?0:(0-c)/(p-c);return new t.MercatorCoordinate(t.number(o,s,h)/this.worldSize,t.number(l,u,h)/this.worldSize)},Mn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Mn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Mn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Mn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Mn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,a=r?this._alignedPosMatrixCache:this._posMatrixCache;if(a[n])return a[n];var i=e.canonical,o=this.worldSize/this.zoomScale(i.z),s=i.x+Math.pow(2,i.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,i.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),a[n]=new Float32Array(l),a[n]},Mn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Mn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,a,i=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;i=t.mercatorYfromLat(p[1])*this.worldSize,e=(o=t.mercatorYfromLat(p[0])*this.worldSize)-io&&(a=o-y)}if(this.lngRange){var g=f.x,v=u.x/2;g-vl&&(n=l-v)}void 0===n&&void 0===a||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==a?a:f.y))),this._unmodified=c,this._constraining=!1}},Mn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,a=this._fov*(.5+r.y/this.height),i=Math.sin(a)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-a,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,p=new Float64Array(16);t.perspective(p,this._fov,this.width/this.height,c,u),p[8]=2*-r.x/this.width,p[9]=2*r.y/this.height,t.scale(p,p,[1,-1,1]),t.translate(p,p,[0,0,-this.cameraToCenterDistance]),t.rotateX(p,p,this._pitch),t.rotateZ(p,p,this.angle),t.translate(p,p,[-s,-l,0]),this.mercatorMatrix=t.scale([],p,[this.worldSize,this.worldSize,this.worldSize]),t.scale(p,p,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=p,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,f=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),y=s-Math.round(s)+d*h+m*f,g=l-Math.round(l)+d*f+m*h,v=new Float64Array(p);if(t.translate(v,v,[y>.5?y-1:y,g>.5?g-1:g,0]),this.alignedProjMatrix=v,p=t.create(),t.scale(p,p,[this.width/2,-this.height/2,1]),t.translate(p,p,[1,-1,0]),this.labelPlaneMatrix=p,p=t.create(),t.scale(p,p,[1,-1,1]),t.translate(p,p,[-1,-1,0]),t.scale(p,p,[2/this.width,2/this.height,1]),this.glCoordMatrix=p,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(p=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=p,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Mn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Mn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Mn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,a=r.y,i=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Sn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Ln=t.extend({deceleration:2500,maxSpeed:1400},Cn),In=t.extend({deceleration:20,maxSpeed:1400},Cn),Pn=t.extend({deceleration:1e3,maxSpeed:360},Cn),En=t.extend({deceleration:1e3,maxSpeed:90},Cn),Dn=function(t){this._map=t,this.clear()};function zn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Dn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,a=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.dblclick=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},Nn.prototype.mouseover=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.mouseout=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},Nn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Nn.prototype.isEnabled=function(){return!0},Nn.prototype.isActive=function(){return!1},Nn.prototype.enable=function(){},Nn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Rn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Vn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,a=e;n30)&&(this.aborted=!0)}}},qn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new qn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var a=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(a&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Zn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Zn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Zn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Zn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Zn.prototype.touchend=function(t,e,r){var n=this,a=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r);return a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(a)},{originalEvent:t})}}):i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(i)},{originalEvent:t})}}):void 0},Zn.prototype.touchcancel=function(){this.reset()},Zn.prototype.enable=function(){this._enabled=!0},Zn.prototype.disable=function(){this._enabled=!1,this.reset()},Zn.prototype.isEnabled=function(){return this._enabled},Zn.prototype.isActive=function(){return this._active};var Gn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Gn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Gn.prototype._correctButton=function(t,e){return!1},Gn.prototype._move=function(t,e){return{}},Gn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Gn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var a=Vn(n,r),i=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in a){var u=a[l],c=this._touches[l];c&&(i._add(u),o._add(u.sub(c)),s++,a[l]=u)}if(this._touches=a,!(sMath.abs(t.x)}var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,na(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),a=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,a,r.timeStamp),this._valid){this._lastPoints=t,this._active=!0;return{pitchDelta:-.5*((n.y+a.y)/2)}}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,a=e.mag()>=2;if(n||a){if(!n||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var i=t.y>0==e.y>0;return na(t)&&na(e)&&i}},e}(Kn),ia={panStep:100,bearingStep:15,pitchStep:10},oa=function(){var t=ia;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function sa(t){return t*(2-t)}oa.prototype.reset=function(){this._active=!1},oa.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,a=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?a=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?a=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:sa,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+a*e._pitchStep,offset:[-i*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oa.prototype.enable=function(){this._enabled=!0},oa.prototype.disable=function(){this._enabled=!1,this.reset()},oa.prototype.isEnabled=function(){return this._enabled},oa.prototype.isActive=function(){return this._active};var la=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};la.prototype.setZoomRate=function(t){this._defaultZoomRate=t},la.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},la.prototype.isEnabled=function(){return!!this._enabled},la.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},la.prototype.isZooming=function(){return!!this._zooming},la.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},la.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},la.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),a=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(a*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},la.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},la.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},la.prototype.renderFrame=function(){return this._onScrollFrame()},la.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==a&&(a=1/a);var i="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(i*a))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var p=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(p);o=t.number(l,s,h),p<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},la.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,a=(t.browser.now()-n.start)/n.duration,i=n.easing(a+.01)-n.easing(a),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},la.prototype.reset=function(){this._active=!1};var ua=function(t,e){this._clickZoom=t,this._tapZoom=e};ua.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ua.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ua.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ua.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ca=function(){this.reset()};ca.prototype.reset=function(){this._active=!1},ca.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ca.prototype.enable=function(){this._enabled=!0},ca.prototype.disable=function(){this._enabled=!1,this.reset()},ca.prototype.isEnabled=function(){return this._enabled},ca.prototype.isActive=function(){return this._active};var pa=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};pa.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},pa.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},pa.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],a=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:a/128}}}else this._tap.touchmove(t,e,r)},pa.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},pa.prototype.touchcancel=function(){this.reset()},pa.prototype.enable=function(){this._enabled=!0},pa.prototype.disable=function(){this._enabled=!1,this.reset()},pa.prototype.isEnabled=function(){return this._enabled},pa.prototype.isActive=function(){return this._active};var ha=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};ha.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ha.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ha.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ha.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fa=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};fa.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fa.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fa.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fa.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var da=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};da.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},da.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},da.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},da.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},da.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},da.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ma=function(t){return t.zoom||t.drag||t.pitch||t.rotate},ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function ga(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var va=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Dn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var a=this._el;this._listeners=[[a,"touchstart",{passive:!1}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[t.window,"blur",void 0]];for(var i=0,o=this._listeners;ii?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),T=a.unproject(_.add(x.mult(e*w)).mult(m));a.setLocationAtPoint(a.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,a=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),a&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var a=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(a,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):o,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:i.padding,d=i.zoomScale(c-o),m=t.Point.convert(e.offset),y=i.centerPoint.add(m),g=i.pointLocation(y),v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var _=i.project(g),x=i.project(v).sub(_),b=e.curve,w=Math.max(i.width,i.height),T=w/d,k=x.mag();if("minZoom"in e){var M=t.clamp(Math.min(e.minZoom,o,c),i.minZoom,i.maxZoom),A=w/i.zoomScale(M-o);b=Math.sqrt(A/k*2)}var S=b*b;function C(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var P=C(0),E=function(t){return I(P)/I(P+b*t)},D=function(t){return w*((I(P)*(L(e=P+b*t)/I(e))-L(P))/S)/k;var e},z=(C(1)-P)/b;if(Math.abs(k)<1e-6||!isFinite(z)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=h!==l,this._padding=!i.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var a=e*z,d=1/E(a);i.zoom=1===e?c:o+i.scaleZoom(d),n._rotating&&(i.bearing=t.number(s,p,e)),n._pitching&&(i.pitch=t.number(l,h,e)),n._padding&&(i.interpolatePadding(u,f,e),y=i.centerPoint.add(m));var g=1===e?v:i.unproject(_.add(x.mult(D(a))).mult(d));i.setLocationAtPoint(i.renderWorldCopies?g.wrap():g,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),xa=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};xa.prototype.getDefaultPosition=function(){return"bottom-right"},xa.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},xa.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},xa.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},xa.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var ba=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};ba.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ba.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ba.prototype.getDefaultPosition=function(){return"bottom-left"},ba.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},ba.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},ba.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wa.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wa.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var a=new Mn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,a,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wa,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ta,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ma))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new va(this,e);var i="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Sn(i).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new xa({customAttribution:e.customAttribution})),this.addControl(new ba,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(a.__proto__=n),a.prototype=Object.create(n&&n.prototype),a.prototype.constructor=a;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var a=this._controlPositions[r];return-1!==r.indexOf("bottom")?a.insertBefore(n,a.firstChild):a.appendChild(n),this},a.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},a.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],a=r[1];this._resizeCanvas(n,a),this.transform.resize(n,a),this.painter.resize(n,a);var i=!this._moving;return i&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},a.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},a.prototype.getMaxPitch=function(){return this.transform.maxPitch},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},a.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},a.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},a.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},a.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},a.prototype._createDelegatedListener=function(t,e,r){var n,a=this;if("mouseenter"===t||"mouseover"===t){var i=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?i||(i=!0,r.call(a,new Rn(t,a,n.originalEvent,{features:o}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(a,new Rn(t,a,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(a,new Rn(t,a,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(a,t),delete t.features)},n)}},a.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var a=this._createDelegatedListener(t,e,r);for(var i in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)this.on(i,a.delegates[i]);return this},a.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var a=this._createDelegatedListener(t,e,r);for(var i in a.delegates)this.once(i,a.delegates[i]);return this},a.prototype.off=function(t,e,r){var a=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var i=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ea.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ea.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var a=this.mousePitch.mousemoveWindow(t,e);a&&a.pitchDelta&&r.setPitch(r.getPitch()+a.pitchDelta)}},Ea.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ea.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ea.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ea.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ea.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ea.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ea.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ea.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,a=this._map.getBearing(),i=t.extend({bearing:a},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),i,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),a=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=a+"px",this._circleElement.style.height=a+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ja)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{var i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fa(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fa({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Na--,ja=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Na>1?(e={maximumAge:6e5,timeout:0},ja=!0):(e=this.options.positionOptions,ja=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Va={maxWidth:100,unit:"metric"},qa=function(e){this.options=t.extend({},Va,e),t.bindAll(["_onMove","setUnit"],this)};function Ha(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,i=t.unproject([0,a]),o=t.unproject([n,a]),s=i.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;if(l>5280)Za(e,n,l/5280,t._getUIString("ScaleControl.Miles"));else Za(e,n,l,t._getUIString("ScaleControl.Feet"))}else if(r&&"nautical"===r.unit){Za(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?Za(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Za(e,n,s,t._getUIString("ScaleControl.Meters"))}function Za(t,e,r,n){var a,i,o,s=(a=r,i=Math.pow(10,(""+Math.floor(a)).length-1),o=(o=a/i)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),i*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}qa.prototype.getDefaultPosition=function(){return"bottom-left"},qa.prototype._onMove=function(){Ha(this._map,this._container,this.options)},qa.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qa.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qa.prototype.setUnit=function(t){this.options.unit=t,Ha(this._map,this._container,this.options)};var Ga=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ga.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ga.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ga.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ga.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ga.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ga.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ga.prototype._isFullscreen=function(){return this._fullscreen},Ga.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ga.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Ya={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Xa=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Ya),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),a=t.window.document.createElement("body");for(a.innerHTML=e;r=a.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this,a=this._lngLat||this._trackPointer;if(this._map&&a&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Da(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var a=t.Point.convert(r);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,u=this._container.offsetWidth,c=this._container.offsetHeight;l=i.y+s.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-u/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var p=i.add(s[o]).round();r.setTransform(this._container,za[o]+" translate("+p.x+"px,"+p.y+"px)"),Oa(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);var Wa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ca,NavigationControl:Pa,GeolocateControl:Ua,AttributionControl:xa,ScaleControl:qa,FullscreenControl:Ga,Popup:Xa,Marker:Fa,Style:He,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Bt().acquire(zt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Wa})),r}))},{}],65:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],66:[function(t,e,r){(function(t,r){(function(){ /*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org @@ -21,4 +21,4 @@ object-assign * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,p=i();function h(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=a():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return p.epsilon(t)},segments:function(t){var e=o(!0,p,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,p,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,p,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,p,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":70,"./lib/epsilon":71,"./lib/geojson":72,"./lib/intersecter":73,"./lib/segment-chainer":75,"./lib/segment-selector":76}],70:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],71:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=e[0];return(o-a)*(e[1]-i)-(s-i)*(l-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],72:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:a,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:g,below:g};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}i.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":77,timers:78}],79:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,p=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(S[t])t=S[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(f=e.r,d=e.g,m=e.b,a={r:255*I(f,255),g:255*I(d,255),b:255*I(m,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),u=z(e.v),a=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),p=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),c=z(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=I(t,360),e=I(e,100),r=I(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var f,d,m;return i=L(i),{ok:p,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function A(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(O(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*I(this._r,255))+"%",g:i(100*I(this._g,255))+"%",b:i(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%)":"rgba("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(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(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.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"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function E(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return E(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],80:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-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 a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},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 a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(p/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=p[t-p[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=p[o.year-p[0]],f=c>>13;u=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var f,d=p[i.year-p[0]];for(f=0;f<13;f++){var m=d&1<<12-f?30:29;if(l>13;!y||f=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":94,"object-assign":67}],83:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":94,"object-assign":67}],84:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":94,"object-assign":67}],85:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":94,"object-assign":67}],86:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":94,"object-assign":67}],87:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":94,"object-assign":67}],88:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":94,"object-assign":67}],89:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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),p=t-this.toJD(l,c,1)+1;return this.newDate(l,c,p)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":94,"object-assign":67}],91:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":94,"object-assign":67}],92:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":94,"object-assign":67}],93:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":94,"object-assign":67}],94:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":67}],95:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,p=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(f(t,n))for(;a.length1},_=function(t,r){var n=v(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(M).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,b=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(M));return M+=t.length,t}return _("m")},w=function(t,r,n,i){for(var o=v(t,i)?n:r,s=0;s-1){f=1,d=m;for(var C=this.daysInMonth(h,f);d>C;C=this.daysInMonth(h,f))f++,d-=C}return p>-1?this.fromJD(p):this.newDate(h,f,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":94,"object-assign":67}],96:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],97:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":220,"../../plot_api/plot_template":282,"../../plots/cartesian/constants":300,"../../plots/font_attributes":322,"./arrow_paths":96}],98:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],p=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":246,"../../plots/cartesian/axes":293,"./draw":103}],99:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,W=["x","y"],X=0;X1)&&(nt===rt?((ft=at.r2fraction(e["a"+et]))<0||ft>1)&&(Y=!0):Y=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?at._offset+at._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?at._offset+at._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){pt.head=J;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var yt=l.getRefType(nt);"domain"===yt?("y"===et&&(mt=1-mt),pt.tail=at._offset+at._length*mt):"paper"===yt?"y"===et?(mt=1-mt,pt.tail=T.t+T.h*mt):pt.tail=T.l+T.w*mt:pt.tail=at._offset+at.r2p(mt),K=tt}else pt.tail=J+mt,K=tt+mt;pt.text=pt.tail+tt;var gt=w["x"===et?"width":"height"];if("paper"===rt&&(pt.head=o.constrain(pt.head,1,gt-1)),"pixel"===nt){var vt=-Math.max(pt.tail-3,pt.text),_t=Math.min(pt.tail+3,pt.text)-gt;vt>0?(pt.tail+=vt,pt.text+=vt):_t>0&&(pt.tail-=_t,pt.text-=_t)}pt.tail+=ct,pt.head+=ct}else K=tt=lt*H($,ut),pt.text=J+tt;pt.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,bt=0;if("left"!==e.align&&(xt=(M-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),p)n.select("svg").attr({x:N+xt-1,y:N+bt}).call(c.setClipUrl,U?L:null,t);else{var wt=N+bt-m.top,Tt=N+xt-m.left;Z.call(h.positionText,Tt,wt).call(c.setClipUrl,U?L:null,t)}V.select("rect").call(c.setRect,N,N,M,O),j.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),D.attr({transform:"rotate("+P+","+I.x.text+","+I.y.text+")"});var kt,Mt=function(r,n){E.selectAll(".annotation-arrow-g").remove();var l=I.x.head,p=I.y.head,h=I.x.tail+r,f=I.y.tail+n,m=I.x.text+r,x=I.y.text+n,b=o.rotationXYMatrix(P,m,x),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),L=+j.attr("width"),z=+j.attr("height"),O=m-.5*L,F=O+L,B=x-.5*z,N=B+z,U=[[O,B,O,N],[O,N,F,N],[F,N,F,B],[F,B,O,B]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,p,l+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,f,l,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,Z=E.append("g").style({opacity:u.opacity(q)}).classed("annotation-arrow-g",!0),G=Z.append("path").attr("d","M"+h+","+f+"L"+l+","+p).style("stroke-width",V+"px").call(u.stroke,u.rgb(q));if(y(G,H,e),k.annotationPosition&&G.node().parentNode&&!i){var Y=l,W=p;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(p-f,2));Y+=e.standoff*(h-l)/X,W+=e.standoff*(f-p)/X}var J,K,Q=Z.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Y)+","+(f-W),transform:s(Y,W)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);J=t.x,K=t.y,g&&g.autorange&&A(g._name+".autorange",!0),_&&_.autorange&&A(_._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),a=n[0]+t,i=n[1]+r;R.call(c.setTranslate,a,i),S("x",v(g,t,"x",T,e)),S("y",v(_,r,"y",T,e)),e.axref===e.xref&&S("ax",v(g,t,"ax",T,e)),e.ayref===e.yref&&S("ay",v(_,r,"ay",T,e)),Z.attr("transform",s(t,r)),D.attr({transform:"rotate("+P+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(g,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(_,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(g)a=v(g,t,"x",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;a=d.align(u+t/T.w,l,0,1,e.xanchor)}if(_)o=v(_,r,"y",T,e);else{var c=e._ysize/T.h,p=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(p-r/T.h,c,0,1,e.yanchor)}S("x",a),S("y",o),g&&_||(n=d.getCursor(g?.5:a,_?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",G(n))},doneFn:function(){f(R),a.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,_=e.indexOf("end")>=0,x=d.backoff*y+r.standoff,b=m.backoff*g+r.startstandoff;if("line"===f.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,T=o.y-c.y;if(h=(p=Math.atan2(T,w))+Math.PI,x&&b&&x+b>Math.sqrt(w*w+T*T))return void z();if(x){if(x*x>w*w+T*T)return void z();var k=x*Math.cos(p),M=x*Math.sin(p);c.x+=k,c.y+=M,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>w*w+T*T)return void z();var A=b*Math.cos(p),S=b*Math.sin(p);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===f.nodeName){var C=f.getTotalLength(),L="";if(C1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":325,"../annotations/draw":103}],110:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Y*=J*u.roundUp(X/J,[2,5,10]),(Math.abs(I.start)/I.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Y}G.domain=[q+j,q+F-j],G.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var K,Q=t.select("."+M.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+M.cbaxis),tt=0;function et(n,a){var i={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),m.draw(r,n,p(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+B)*l.w,n=G.title.font.size;t="top"===A?(1-(q+F-j))*l.h+l.t+3+.75*n:(1-(q+j))*l.h+l.t-3-.25*n,et(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+M.cbtitle),o=i.select("text"),p=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+G._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),h?(tt=f.bBox(h).height)>d&&(p[1]-=(tt-d)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=f.bBox(o.node()).height),tt){if(tt+=5,"top"===A)G.domain[1]-=tt/l.h,p[1]*=-1;else{G.domain[0]+=tt/l.h;var m=y.lineCount(o);p[1]+=(1-m)*d}i.attr("transform",c(p[0],p[1])),G.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",c(0,Math.round(l.h*(1-G.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var v=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(E);v.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),v.exit().remove();var _=S.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?S[0]:(E[i]+E[i-1])/2,i===E.length-1?S[1]:(E[i]+E[i+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,_[0],_[1]);var s=n.select(this).attr({x:U,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)f.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+M.cblines).selectAll("path."+M.cbline).data(g.color&&g.width?D:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(G.c2p(t))+g.width/2%1)+"h"+z).call(f.lineGroupStyle,g.width,C(t),g.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=U+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(G),k=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,T):T,layer:$,path:s.makeTickPath(G,b,k),transFn:s.makeTransTickFn(G)}),s.drawLabels(r,G,{vals:T,layer:$,transFn:s.makeTransTickLabelFn(G),labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=G.title.font.size,e=G._offset+G._length/2,a=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));et("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+e.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=f.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(M.jsPlaceholder)){var a,o=Q.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?f.bBox(o).width:f.bBox(Q.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-Z;t.select("."+M.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:Z-N,width:Math.max(s,2),height:Math.max(u+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:U,y:Z+e.ypad+("top"===A?tt:0),width:Math.max(z,2),height:Math.max(u-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var p=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-p,l.t));var h={},m=T[e.yanchor],y=k[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*m,h.b=u*y):(h.t=h.b=0,h.yt=e.y+e.len*m,h.yb=e.y-e.len*y);var g=T[e.xanchor],v=k[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*g,h.r=s*v;else{var _=s-z;h.l=_*g,h.r=_*v,h.xl=e.x-e.thickness*g,h.xr=e.x+e.thickness*v}i.autoMargin(r,e._id,h)}],r)}(r,e,t);g&&g.then&&(t._promises||[]).push(g),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":219,"../../lib":246,"../../lib/extend":238,"../../lib/setcursor":266,"../../lib/svg_text_utils":269,"../../plots/cartesian/axes":293,"../../plots/cartesian/axis_defaults":295,"../../plots/cartesian/layout_attributes":308,"../../plots/cartesian/position_defaults":311,"../../plots/plots":335,"../../registry":338,"../color":114,"../colorscale/helpers":125,"../dragelement":133,"../drawing":136,"../titles":212,"./constants":116,"@plotly/d3":12,tinycolor2:79}],119:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":246}],120:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":115,"./defaults":117,"./draw":118,"./has_colorbar":119}],121:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var f=i+"auto",d=i+"min",m=i+"max",y=i+"mid",g=(s(h+f),s(h+d),s(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":262,"../../lib/sort_object_keys":267,"../colorbar/attributes":115,"./scales.js":129}],122:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,p=i(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return a.aggNums(Math.min,null,l)},g=function(){return a.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":246,"./helpers":125,"fast-isnumeric":28}],123:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],131:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":246}],132:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],133:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){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 p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":246,"../../plots/cartesian/constants":300,"./align":130,"./cursor":131,"./unhover":134,"has-hover":59,"has-passive-events":60,"mouse-event-offset":65}],134:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":236,"../../lib/events":237,"../../lib/throttle":270,"../fx/constants":148}],135:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],136:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),p=a.strTranslate,h=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,y=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,_=e.exports={};_.font=function(t,e,r,n){a.isPlainObject(e)&&(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(u.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,a){t.call(_.setPosition,e,r).call(_.setSize,n,a)},_.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",p(a,i)),!0)},_.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);_.translatePoint(t,a,e,r)}))},_.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){_.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},_.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";u.stroke(e,n||i.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(u.stroke,r||i.color).call(_.dashLine,s,o)}))},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},_.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(u.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(u.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;_.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),_.symbolNames[r]=t,_.symbolFuncs[r]=e.f,e.needLine&&(_.symbolNeedLines[r]=!0),e.noDot?_.symbolNoDot[r]=!0:_.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(_.symbolNoFill[r]=!0)}));var b=_.symbolNames.length;function w(t,e){var r=t%100;return _.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}_.symbolNumber=function(t){if(o(t))t=+t;else 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=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};_.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=A[i],h=new Array(c),f=0;f"+g(t);d._gradientUrlQueryParts[v]=1},_.pattern=function(t,e,r,i,o,s,l,c,p,h,f,d){var m="legend"===e;c&&("overlay"===p?(h=c,f=u.contrast(h)):(h=void 0,f=c));var y,g,v,_,x,b,w,T,k,M,A,S=r._fullLayout,C="p"+S._uid+"-"+i,L={};switch(o){case"/":y=s*Math.sqrt(2),g=s*Math.sqrt(2),b="path",L={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"\\":y=s*Math.sqrt(2),g=s*Math.sqrt(2),b="path",L={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"x":y=s*Math.sqrt(2),g=s*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,_=s-s*Math.sqrt(1-l),b="path",L={d:v,opacity:d,stroke:f,"stroke-width":_+"px"};break;case"|":b="path",b="path",L={d:v="M"+(y=s)/2+",0L"+y/2+","+(g=s),opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"-":b="path",b="path",L={d:v="M0,"+(g=s)/2+"L"+(y=s)+","+g/2,opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"+":b="path",v="M"+(y=s)/2+",0L"+y/2+","+(g=s)+"M0,"+g/2+"L"+y+","+g/2,_=s-s*Math.sqrt(1-l),b="path",L={d:v,opacity:d,stroke:f,"stroke-width":_+"px"};break;case".":y=s,g=s,l.pattern_filled";S._patternUrlQueryParts[E]=1},_.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},_.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},_.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(c,l))}var p,h,f,d=!1;if(t.so)f=s.outlierwidth,h=s.outliercolor,p=o.outliercolor;else{var m=(s||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(p=u.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,p).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:f)+"px");var y=o.gradient,g=t.mgt;g?d=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,x=v&&_.getPatternAttr(v.shape,t.i,"");if(g&&"none"!==g){var b=t.mgc;b?d=!0:b=y.color;var T=r.uid;d&&(T+="-"+t.i),_.gradient(e,i,T,g,[[0,b],[1,p]],"fill")}else if(x){var k=_.getPatternAttr(v.bgcolor,t.i,null),M=_.getPatternAttr(v.fgcolor,t.i,null),S=v.fgopacity,C=_.getPatternAttr(v.size,t.i,8),L=_.getPatternAttr(v.solidity,t.i,.3),I=t.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),P=r.uid;I&&(P+="-"+t.i),_.pattern(e,"point",i,P,x,C,L,t.mcc,v.fillmode,k,M,S)}else u.fill(e,p);f&&u.stroke(e,h)}},_.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=_.tryColorscale(r,""),e.lineScale=_.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=y.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,_.makeSelectedPointStyleFns(t)),e},_.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,p=s.opacity,h=void 0!==c,f=void 0!==p;(a.isArrayOrTypedArray(u)||h||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:f?p:m*e});var d=i.color,y=o.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?y||e:g||e});var v=i.size,_=o.size,x=s.size,b=void 0!==_,w=void 0!==x;return l.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},_.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,m))},e},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(_.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}_.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=_.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,p=c?c(t,e,l):{},f={};v(f,e,t.i);var d=e._meta||{};u=a.texttemplateString(u,p,l._d3locale,f,t,d)}var m=t.tp||e.textposition,y=L(t,e),g=i?i(t):t.tc||e.textfont.color;o.call(_.font,t.tf||e.textfont.family,y,g).text(u).call(h.convertToTspans,r).call(C,m,y,t.mrc)}else o.remove()}))}},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);u.fill(a,i),C(a,o,s,t.mrc2||t.mrc)}))}};function I(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),p=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,f=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(f&&p/f),2),n.round(e[1]+(f&&h/f),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&h/d),2)]]}_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(_.savedBBoxes={},D=0),r&&(_.savedBBoxes[r]=y),D++,a.extendFlat({},y)},_.setClipUrl=function(t,e,r){t.attr("clip-path",O(e,r))},_.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},_.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=p(e,r)).trim(),t[a]("transform",i),i},_.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},_.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var R=/\s*sc.*/;_.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(F);t=1===e&&1===r?[]:[p(o,s),"scale("+e+","+r+")",p(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":150,"../../constants/alignment":219,"../../constants/interactions":223,"../../constants/xmlns_namespaces":225,"../../lib":246,"../../lib/svg_text_utils":269,"../../registry":338,"../../traces/scatter/make_bubble_size_func":386,"../../traces/scatter/subtypes":394,"../color":114,"../colorscale":126,"./symbol_defs":137,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:79}],137:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":12}],138:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],139:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),p=0;p0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,t),y.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,u);if(!m||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var p=d.width;i="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(i+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(f.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(f.copy_ystyle?d:f).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":394,"../drawing":136,"@plotly/d3":12,"fast-isnumeric":28}],144:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":114,"@plotly/d3":12}],145:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":238,"../../plots/font_attributes":322,"./layout_attributes":155}],146:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||it<0||it>b[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+x[0]._offset,e.pointerY=it+b[0]._offset,B="xval"in e?g.flat(s,e.xval):g.p2c(x,at),V="yval"in e?g.flat(s,e.yval):g.p2c(b,it),!a(B[0])||!a(V[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(H=0;H$&&(tt.splice(0,$),ut=tt[0].distance),m&&0!==D&&0===tt.length){Q.distance=D,Q.index=!1;var p=G._module.hoverPoints(Q,J,K,"closest",{hoverLayer:l._hoverlayer});if(p&&(p=p.filter((function(t){return t.spikeDistance<=D}))),p&&p.length){var h,d=p.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var y=d[0];a(y.x0)&&a(y.y0)&&(h=ht(y),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var v=p.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var _=v[0];a(_.x0)&&a(_.y0)&&(h=ht(_),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function pt(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)It(tt[At]);tt=St,yt()}var Pt=t._hoverdata,Et=[],Dt=j(t),zt=U(t);for(q=0;q1||tt.length>1)||"closest"===S&&nt&&tt.length>1,Yt=f.combine(l.plot_bgcolor||f.background,l.paper_bgcolor),Wt=E(tt,{gd:t,hovermode:S,rotateLabels:Gt,bgColor:Yt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});g.isUnifiedHover(S)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(p=-1),f[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=a;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(i=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=i;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var b=x[s],w=b.datum;w.offset=b.dp,w.del=b.del}}}(Wt,Gt?"xa":"ya",l),z(Wt,Gt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Xt=y.getComponentMethod("annotations","hasClickToShow")(t,Et);p(n.select(e.target),Xt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:b,xvals:B,yvals:V})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=E(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),p=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,_=g.offsetTop;c+=v,p+=v,h+=_,d+=_}u.bbox={x0:c+o,x1:p+o,y0:h+i,y1:d+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||f.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function E(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,p=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{},T=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,M=t[0],C=M.xa,L=M.ya,P=i.charAt(0),E=M[P+"Label"],z=m.getBoundingClientRect(),O=z.top,R=z.width,F=z.height,B=void 0!==E&&M.distance<=e.hoverdistance&&("x"===i||"y"===i);if(B){var N,j,U=!0;for(N=0;Na.width-x?(y=a.width-x,e.attr("d","M"+(x-A)+",0L"+x+","+_+A+"v"+_+(2*S+v.height)+"H-"+x+"V"+_+A+"H"+(x-2*A)+"Z")):e.attr("d","M0,0L"+A+","+_+A+"H"+(S+v.width/2)+"v"+_+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+_+A+"H-"+A+"Z")}else{var b,I,P;"right"===L.side?(b="start",I=1,P="",y=C._offset+C._length):(b="end",I=-1,P="-",y=C._offset),g=L._offset+(M.y0+M.y1)/2,l.attr("text-anchor",b),e.attr("d","M0,0L"+P+A+","+A+"V"+(S+v.height/2)+"h"+P+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+P+A+"V-"+A+"Z");var D,z=v.height/2,R=O-v.top-z,F="clip"+a._uid+"commonlabel"+L._id;if(y=0?nt:at+st=0?at:mt+st=0?et:rt+lt=0?rt:yt+lt=0,"top"!==t.idealAlign&&P||!z?P?(U+=q/2,t.anchor="start"):t.anchor="middle":(U-=q/2,t.anchor="end");else if(t.pos=U,P=j+V/2+H<=R,z=j-V/2-H>=0,"left"!==t.idealAlign&&P||!z)if(P)j+=V/2,t.anchor="start";else{t.anchor="middle";var Z=H/2,G=j+Z-R,Y=j-Z;G>0&&(j-=G),Y<0&&(j+=-Y)}else j-=V/2,t.anchor="end";w.attr("text-anchor",t.anchor),C&&M.attr("text-anchor",t.anchor),e.attr("transform",s(j,U)+(u?l(b):""))})),gt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var p=t.hovertemplate||!1;if(p){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(p,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],p=u*(A+S),f=p+u*(t.txwidth+S),d=0,m=t.offset,y="middle"===s;y&&(p-=t.tx2width/2,f+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",y?"M-"+i(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*A+d)+"V"+o(m-A)+"Z");var g=d+p,v=m+t.ty0-t.by/2+S,_=t.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==s?(a.attr("text-anchor","start"),g=y?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===_&&"end"!==s&&(a.attr("text-anchor","end"),g=y?t.bx/2-t.tx2width/2-S:t.bx+S)),a.call(c.positionText,i(g),o(v)),t.tx2width&&(r.select("text.name").call(c.positionText,i(f+u*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,i(f+(u-1)*t.tx2width/2+d),o(m-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||c){var d=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var _,x,b=i.readability(v.color,d)<1.5?f.contrast(d):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,M=m.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=M,x=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),_=l.l+A*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(p){var C,L,I=e.vLinePoint;n=I&&I.xa,a=I&&I.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+I.x,L=a._offset+I.y);var P,E,D=i.readability(I.color,d)<1.5?f.contrast(d):I.color,z=n.spikemode,O=n.spikethickness,R=n.spikecolor||D,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,E=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,E=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}},{"../../lib":246,"../../lib/events":237,"../../lib/override_cursor":257,"../../lib/svg_text_utils":269,"../../plots/cartesian/axes":293,"../../registry":338,"../color":114,"../dragelement":133,"../drawing":136,"../legend/defaults":166,"../legend/draw":167,"./constants":148,"./helpers":150,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:79}],152:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":246,"../color":114,"./helpers":150}],153:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":246,"./layout_attributes":155}],154:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":246,"../dragelement":133,"./attributes":145,"./calc":146,"./click":147,"./constants":148,"./defaults":149,"./helpers":150,"./hover":151,"./layout_attributes":155,"./layout_defaults":156,"./layout_global_defaults":157,"@plotly/d3":12}],155:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":322,"./constants":148}],156:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":246,"./hoverlabel_defaults":152,"./hovermode_defaults":153,"./layout_attributes":155}],157:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":246,"./hoverlabel_defaults":152,"./layout_attributes":155}],158:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),p=c*(1-o),h=0;h1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);y._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1!==m||u.uirevision){var y=i.newContainer(e,"legend");if(T("uirevision",e.uirevision),!1!==m){T("bgcolor",e.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,_,x=a.coerceFont(T,"font",e.font),b="h"===T("orientation");if(b?(g=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,_="bottom"):(v=-.1,_="top")):(g=1.02,v=1,_="auto"),T("traceorder",h),l.isGrouped(e.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",_),T("valign"),a.noneOrAll(u,y,["x","y"]),T("title.text")){T("title.side",b?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(T,"title.font",w)}}}function T(t,e){return a.coerce(u,y,o,t,e)}}},{"../../lib":246,"../../plot_api/plot_template":282,"../../plots/layout_attributes":326,"../../registry":338,"./attributes":164,"./helpers":170}],167:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var m=a.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(u.font,i).text(h?T(n,d):n);var y=r.itemwidth+2*f.itemGap;p.positionText(m,y,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(M,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),p=c[c.length-1],h=a.keyedContainer(i,"transforms["+p+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):M(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}})))}function M(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,d=s.size*m;if(o){var y=u.bBox(o);c=y.height,h=y.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var g=t.select(1===n?".legendtitletext":".legendtext"),v=p.lineCount(g),_=g.node();if(c=d*v,h=_?u.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),p.positionText(g,l+f.titlePad,l+d);else{var x=2*f.itemGap+r.itemwidth;a.groupTitle&&(x=f.itemGap,h-=r.itemwidth),p.positionText(g,x,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=d,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function A(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function S(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,p=t._fullLayout,h="legend"+p._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=p._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=p.showlegend&&v(t.calcdata,e)}var m=p.hiddenlabels||[];if(!(d||p.showlegend&&s.length))return r.selectAll(".legend").remove(),p._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var T=a.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),C=a.ensureSingleById(p._topdefs,"clipPath",h,(function(t){t.append("rect")})),L=a.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var I=a.ensureSingle(T,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var E=a.ensureSingle(I,"text","legendtitletext");E.attr("text-anchor","start").call(u.font,P.font).text(P.text),M(E,I,t,e,1)}else I.selectAll(".legendtitletext").remove();var D=a.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),z=I.selectAll("g.groups").data(s);z.enter().append("g").attr("class","groups"),z.exit().remove();var O=z.selectAll("g.traces").data(a.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(_,t,e).each((function(){d||n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,p=2*c,h=f.itemGap,d=a.itemwidth+2*h,m=2*(c+h),y=S(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,_=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var b=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+w[0],c+w[1]+a._height+e/2+h),a._height+=e,a._width=Math.max(a._width,t[0].width)})),b=d+a._width,a._width+=h+d+p,a._height+=m,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),k=a.x<0||0===a.x&&"right"===T,M=a.x>1||1===a.x&&"left"===T,C=v||g,L=i.width/2;a._maxWidth=Math.max(k?C&&"left"===T?o.l+o.w:L:M?C&&"right"===T?o.r+o.w:L:o.w,2*d);var I=0,P=0;r.each((function(t){var e=t[0].width+d;I=Math.max(I,e),P+=e})),b=null;var E=0;if(l){var D=0,z=0,O=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,w[0],w[1]+c+h+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),D=Math.max(D,e);var r=t+h;r+c+z>a._maxWidth&&(E=Math.max(E,z),z=0,O+=D+_,D=e),u.setTranslate(this,z,O),z+=r})),a._width=Math.max(E,z)+c,a._height=O+D+m}else{var R=r.size(),F=P+p+(R-1)*h=a._maxWidth&&(E=Math.max(E,U),N=0,j+=B,a._height+=B,B=0),u.setTranslate(this,w[0]+c+N,w[1]+c+j+e/2+h),U=N+r+h,N+=n,B=Math.max(B,e)})),F?(a._width=N+p,a._height=B+m):(a._width=Math.max(E,U)+p,a._height+=B+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(c+f.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(c+f.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=t._context.edits,q=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=q?d:b||d+t[0].width;s||(a+=h/2),u.setRect(e,0,-r/2,a,r)}))}(t,z,O,e)},function(){if(d||!function(t){var e=t._fullLayout.legend,r=A(e),n=S(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t)){var s,c,m,v,_=p._size,x=e.borderwidth,w=_.l+_.w*e.x-y[A(e)]*e._width,k=_.t+_.h*(1-e.y)-y[S(e)]*e._effHeight;if(!d&&p.margin.autoexpand){var M=w,P=k;w=a.constrain(w,0,p.width-e._width),k=a.constrain(k,0,p.height-e._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==P&&a.log("Constrain legend.y to make legend fit inside graph")}if(d||u.setTranslate(T,w,k),D.on(".drag",null),T.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var E=e._effHeight;d&&(E=e._height),L.attr({width:e._width-x,height:E-x,x:x/2,y:x/2}),u.setTranslate(I,0,0),C.select("rect").attr({width:e._width-2*x,height:E-2*x,x:x,y:x}),u.setClipUrl(I,h,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var z,O,R,F=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*f.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);L.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),C.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(I,h,t),H(U,F,j),T.on("wheel",(function(){H(U=a.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,N)}(R,z,O),F,j))}));D.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,H(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,N)}(R,z,O),F,j))}));I.call(q)}if(t._context.edits.legendPosition)T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=u.getTranslate(T);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,a=v+r;u.setTranslate(T,n,a),s=l.align(n,0,_.l,_.l+_.w,e.xanchor),c=l.align(a,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&b(t,T,a,e,n)}})}function H(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(I,0,-r),u.setRect(D,e._width,f.scrollBarMargin+r*a,f.scrollBarWidth,n),C.select("rect").attr("y",x+r)}}],t)}(t,e)}},{"../../constants/alignment":219,"../../lib":246,"../../lib/events":237,"../../lib/svg_text_utils":269,"../../plots/plots":335,"../../registry":338,"../color":114,"../dragelement":133,"../drawing":136,"./constants":165,"./get_legend_data":168,"./handle_click":169,"./helpers":170,"./style":172,"@plotly/d3":12}],168:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],p=!1,h={},f=0,d=0;function m(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),p=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+f;c.push(n),u[n]=[r],f++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,_=r.itemwidth,x=(_+2*f.itemGap)/2,b=o(x,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return v?n:Math.min(a,r)};function T(t,i,o){var c=t[0].trace,p=c.marker||{},h=p.line||{},f=o?c.visible&&c.type===o:a.traceIs(c,"bar"),d=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(f?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),d.exit().remove(),d.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,p.line,5,2);a.style("stroke-width",o+"px");var f=i.mcc;if(!r._inHover&&"mc"in i){var d=u(p),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),f=s.tryColorscale(p,"")(m)}var g=f||i.mc||p.color,v=p.pattern,_=v&&s.getPatternAttr(v.shape,0,"");if(_){var x=s.getPatternAttr(v.bgcolor,0,null),b=s.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=y(v.size,8,10),M=y(v.solidity,.5,1),A="legend-"+c.uid;a.call(s.pattern,"legend",e,A,_,k,M,f,v.fillmode,x,b,T)}else a.call(l.fill,g);o&&l.stroke(a,i.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),u.exit().remove(),u.size()){var c=(s.marker||{}).line,f=w(h(c.width,o.pts),c,5,2),d=i.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=c.color;var m=i.minExtend(o,{trace:d});p(u,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=a.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,p=n.select(this),h=u(a),f=h.colorscale,m=h.reversescale;if(f){if(!r){var y=f.length;c=0===o?f[m?y-1:0][1]:1===o?f[m?0:y-1][1]:f[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}p.attr("d",t[0]),c?p.call(l.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,d(m,"radial"===r),f,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,T(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,a,o=m(t),l=o.showFill,p=o.showLine,h=o.showGradientLine,f=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=t[0],x=v.trace,b=u(x),T=b.colorscale,k=b.reversescale,M=c.hasMarkers(x)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||f?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+_+"v6h-"+_+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+x.uid;s.gradient(t,e,r,d(k),T,"fill")}}),p||h){var C=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:C}}),r=[i.minExtend(v,{trace:a})]}var L=A.select(".legendlines").selectAll("path").data(p||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(h?"l"+_+",0.0001":"h"+_)).call(p?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,a,o=m(t),l=o.anyFill,u=o.anyLine,p=o.showLine,h=o.showMarker,f=t[0],d=f.trace,y=!h&&!u&&!l&&c.hasText(d);function g(t,e,r,n){var a=i.nestedProperty(d,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function _(t){return f._distinct&&f.index&&t[f.index]?t[f.index]:t[0]}if(h||y||p){var x={},w={};if(h){x.mc=g("marker.color",_),x.mx=g("marker.symbol",_),x.mo=g("marker.opacity",i.mean,[.2,1]),x.mlc=g("marker.line.color",_),x.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);x.ms=T,w.marker.size=T}p&&(w.line={width:g("line.width",_,[0,10],5)}),y&&(x.tx="Aa",x.tp=g("textposition",_),x.ts=10,x.tc=g("textfont.color",_),x.tf=g("textfont.family",_)),r=[i.minExtend(f,x)],(a=i.minExtend(d,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(h?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),M.exit().remove(),M.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),A.exit().remove(),A.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":246,"../../registry":338,"../../traces/pie/helpers":366,"../../traces/pie/style_one":367,"../../traces/scatter/subtypes":394,"../color":114,"../colorscale/helpers":125,"../drawing":136,"./constants":165,"@plotly/d3":12}],173:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":175}],174:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(a=0;a1?(P=["toggleHover"],E=["resetViews"]):g?(I=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],E=["resetGeo"]):y?(P=["hoverClosest3d"],E=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(I=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],E=["resetViewMapbox"]):x?P=["hoverClosestGl2d"]:v?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],E=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lf&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;ov?(k=p,C="y0",M=v,L="y1"):(k=v,C="y1",M=p,L="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),W.moveFn="move"===D?J:K,W.altKey=n.altKey},doneFn:function(){if(g(t))return;f(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(g(t))return;$(s)}};function X(r){if(g(t))D=null;else if(R)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";f(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=Z(_+n)):(o=function(t){return Z(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(H(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else z?B("xanchor",r.xanchor=Z(_+n)):(B("x0",r.x0=Z(u+n)),B("x1",r.x1=Z(y+n))),O?B("yanchor",r.yanchor=G(T+a)):(B("y0",r.y0=G(p+a)),B("y1",r.y1=G(v+a)));e.attr("d",b(t,r)),Q(s,r)}function K(n,a){if(F){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=Z(_+n)):(o=function(t){return Z(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(H(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else if(R){if("resize-over-start-point"===D){var c=u+n,h=O?p-a:p+a;B("x0",r.x0=z?c:Z(c)),B("y0",r.y0=O?h:G(h))}else if("resize-over-end-point"===D){var f=y+n,d=O?v-a:v+a;B("x1",r.x1=z?f:Z(f)),B("y1",r.y1=O?d:G(d))}}else{var g=function(t){return-1!==D.indexOf(t)},x=g("n"),j=g("s"),V=g("w"),Y=g("e"),W=x?k+a:k,X=j?M+a:M,J=V?A+n:A,K=Y?S+n:S;O&&(x&&(W=k-a),j&&(X=M-a)),(!O&&X-W>10||O&&W-X>10)&&(B(C,r[C]=O?W:G(W)),B(L,r[L]=O?X:G(X))),K-J>10&&(B(I,r[I]=z?J:Z(J)),B(P,r[P]=z?K:Z(K)))}e.attr("d",b(t,r)),Q(s,r)}function Q(t,e){(z||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=q(z?e.xanchor:a.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=H(O?e.yanchor:a.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&O){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(W),Y.node().onmousemove=X}(t,z,l,e,r,D):!0===l.editable&&z.style("pointer-events",P||u.opacity(S)*A<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!v(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,y(t)}}(t,z)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function b(t,e){var r,n,o,s,l,u,c,p,h=e.type,f=i.getRefType(e.xref),y=i.getRefType(e.yref),g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),_=t._fullLayout._size;if(g?"domain"===f?n=function(t){return g._offset+g._length*t}:(r=m.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return _.l+_.w*t},v?"domain"===y?s=function(t){return v._offset+v._length*(1-t)}:(o=m.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return _.t+_.h*(1-t)},"path"===h)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,u=t.charAt(0),c=d.paramIsX[u],p=d.paramIsY[u],h=d.numParams[u],f=t.substr(1).replace(d.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):p[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(f=f.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+f}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,p=b-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+p;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var w=(l+u)/2,T=(c+p)/2,k=Math.abs(w-l),M=Math.abs(T-c),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){v(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:_,eraseActiveShape:function(t){if(!v(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&p(g),r.attr("d",m(e)),M&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,v(),_())}}()}}function E(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*p.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+p.stepInset+(r.inputAreaLength-2*p.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-p.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*p.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",p.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,p.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*p.railInset,a=s.ensureSingle(t,"rect",p.railRectClass);a.attr({width:n,height:p.railWidth,rx:p.railRadius,ry:p.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,p.railInset,.5*(r.inputAreaWidth-p.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[p.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,y(e))}if(i.enter().append("g").classed(p.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+p.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+p.groupClassName).data(r,g);l.enter().append("g").classed(p.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var g={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(g[0],g[1]))}}}return O.call(R),D&&(C?O.on(".opacity",null):(M=0,A=!0,O.text(v).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)}))),O.call(p.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?o.call("_guiRestyle",t,g,e,_):o.call("_guiRelayout",t,g,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(p.positionText,b.x,b.y)}))),O.classed("js-placeholder",A),T}}},{"../../constants/alignment":219,"../../constants/interactions":223,"../../lib":246,"../../lib/svg_text_utils":269,"../../plots/plots":335,"../../registry":338,"../color":114,"../drawing":136,"@plotly/d3":12,"fast-isnumeric":28}],213:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:u,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":238,"../../plot_api/edit_types":275,"../../plot_api/plot_template":282,"../../plots/font_attributes":322,"../../plots/pad_attributes":334,"../color/attributes":113}],214:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],215:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":246,"../../plots/array_container_defaults":288,"./attributes":213,"./constants":214}],216:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(a.attr(p.menuIndexAttrName,"-1"),y(t,n,a,i,e),s||g(t,n,a,i,e))}function y(t,e,r,n,a){var i=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||p.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};i.call(v,a,c,t).call(A,a,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(p.arrowSymbol[a.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+a.pad.l,y:l.headerHeight/2+p.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),g(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(A,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,f=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,C=y+g;C+A>u&&(C=u-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>T,P=s.barWidth+2*s.barPad,E=s.barLength+2*s.barPad,D=d+m,z=y;D+P>l&&(D=l-P);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),I?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:z,width:P,height:E}),this._vbarYMin=z+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=I?p+P+.5:p+.5,N=h-.5,j=k?f+A+.5:f+.5,U=o._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":246,"../color":114,"../drawing":136,"@plotly/d3":12}],219:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],220:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],221:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],222:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],223:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],224:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],225:[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}},{}],226:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],228:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],229:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function p(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}m?(c=0,p=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return p(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return p(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return p(t,e,r,n,a,i,1)}}},{"./mod":253}],230:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(p(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var I;k=Number(k);try{var P=y.getComponentMethod("calendars","getCal")(e);if(w){var E="i"===M.charAt(M.length-1);M=parseInt(M,10),I=P.newDate(k,P.toMonthIndex(k,M,E),A)}else I=P.newDate(k,Number(M),A)}catch(t){return c}return I?(I.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,S,C));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?c:D.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,M=5*f;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+p&&t<=a-p))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,C=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function I(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return L[r("%q")(a)]})),b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=b(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+I(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return I(e,t,n,a)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var a=Math.round(t/p)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=h.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(h.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,p=n-e,h=o-a,f=u-i,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,a-t,i-e),l(c,p,d,o-t,u-e),l(h,f,m,t-a,e-i),l(h,f,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p0?f=a:h=a,p++}return i}},{"./mod":253}],244:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],245:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],246:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,p=e.exports={};p.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};p.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,p.warn('encountered bad format: "'+e+'"'))},p.noFormat=function(t){return String(t)},p.numberFormat=function(t){var e;try{e=i(p.adjustFormat(t))}catch(e){return p.warnBadFormat(t),p.noFormat}return e},p.nestedProperty=t("./nested_property"),p.keyedContainer=t("./keyed_container"),p.relativeAttr=t("./relative_attr"),p.isPlainObject=t("./is_plain_object"),p.toLogRange=t("./to_log_range"),p.relinkPrivateKeys=t("./relink_private");var f=t("./array");p.isTypedArray=f.isTypedArray,p.isArrayOrTypedArray=f.isArrayOrTypedArray,p.isArray1D=f.isArray1D,p.ensureArray=f.ensureArray,p.concat=f.concat,p.maxRowLength=f.maxRowLength,p.minRowLength=f.minRowLength;var d=t("./mod");p.mod=d.mod,p.modHalf=d.modHalf;var m=t("./coerce");p.valObjectMeta=m.valObjectMeta,p.coerce=m.coerce,p.coerce2=m.coerce2,p.coerceFont=m.coerceFont,p.coercePattern=m.coercePattern,p.coerceHoverinfo=m.coerceHoverinfo,p.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,p.validate=m.validate;var y=t("./dates");p.dateTime2ms=y.dateTime2ms,p.isDateTime=y.isDateTime,p.ms2DateTime=y.ms2DateTime,p.ms2DateTimeLocal=y.ms2DateTimeLocal,p.cleanDate=y.cleanDate,p.isJSDate=y.isJSDate,p.formatDate=y.formatDate,p.incrementMonth=y.incrementMonth,p.dateTick0=y.dateTick0,p.dfltRange=y.dfltRange,p.findExactDates=y.findExactDates,p.MIN_MS=y.MIN_MS,p.MAX_MS=y.MAX_MS;var g=t("./search");p.findBin=g.findBin,p.sorterAsc=g.sorterAsc,p.sorterDes=g.sorterDes,p.distinctVals=g.distinctVals,p.roundUp=g.roundUp,p.sort=g.sort,p.findIndexOfMin=g.findIndexOfMin,p.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");p.aggNums=v.aggNums,p.len=v.len,p.mean=v.mean,p.median=v.median,p.midRange=v.midRange,p.variance=v.variance,p.stdev=v.stdev,p.interp=v.interp;var _=t("./matrix");p.init2dArray=_.init2dArray,p.transposeRagged=_.transposeRagged,p.dot=_.dot,p.translationMatrix=_.translationMatrix,p.rotationMatrix=_.rotationMatrix,p.rotationXYMatrix=_.rotationXYMatrix,p.apply3DTransform=_.apply3DTransform,p.apply2DTransform=_.apply2DTransform,p.apply2DTransform2=_.apply2DTransform2,p.convertCssMatrix=_.convertCssMatrix,p.inverseTransformMatrix=_.inverseTransformMatrix;var x=t("./angles");p.deg2rad=x.deg2rad,p.rad2deg=x.rad2deg,p.angleDelta=x.angleDelta,p.angleDist=x.angleDist,p.isFullCircle=x.isFullCircle,p.isAngleInsideSector=x.isAngleInsideSector,p.isPtInsideSector=x.isPtInsideSector,p.pathArc=x.pathArc,p.pathSector=x.pathSector,p.pathAnnulus=x.pathAnnulus;var b=t("./anchor_utils");p.isLeftAnchor=b.isLeftAnchor,p.isCenterAnchor=b.isCenterAnchor,p.isRightAnchor=b.isRightAnchor,p.isTopAnchor=b.isTopAnchor,p.isMiddleAnchor=b.isMiddleAnchor,p.isBottomAnchor=b.isBottomAnchor;var w=t("./geometry2d");p.segmentsIntersect=w.segmentsIntersect,p.segmentDistance=w.segmentDistance,p.getTextLocation=w.getTextLocation,p.clearLocationCache=w.clearLocationCache,p.getVisibleSegment=w.getVisibleSegment,p.findPointOnPath=w.findPointOnPath;var T=t("./extend");p.extendFlat=T.extendFlat,p.extendDeep=T.extendDeep,p.extendDeepAll=T.extendDeepAll,p.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");p.log=k.log,p.warn=k.warn,p.error=k.error;var M=t("./regex");p.counterRegex=M.counter;var A=t("./throttle");p.throttle=A.throttle,p.throttleDone=A.done,p.clearThrottle=A.clear;var S=t("./dom");function C(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},p.noop=t("./noop"),p.identity=t("./identity"),p.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},p.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},p.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(p.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},p.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},p.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},p.syncOrAsync=function(t,e,r){var n;function a(){return p.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},p.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},p.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},p.fillArray=function(t,e,r,n){if(n=n||p.identity,p.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},p.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;p.templateString=function(t,e){var r={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,n){var a;return z.test(n)?a=e[n]:(r[n]=r[n]||p.nestedProperty(e,n).get,a=r[n]()),p.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};p.hovertemplateString=function(){return B.apply(O,arguments)};var R={max:10,count:0,name:"texttemplate"};p.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,f="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,y="xother"===s||"yother"===s||f||m||d,g=s;if((f||d)&&(g=g.substring(1)),(m||d)&&(g=g.substring(0,g.length-1)),y){if(void 0===(u=e[g]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var N=2e9;p.seedPseudoRandom=function(){N=2e9},p.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?p.pseudoRandom():N/4294967296},p.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=p.extractOption(t,e,"htx","hovertext");if(p.isValidTextValue(a))return n(a);var i=p.extractOption(t,e,"tx","text");return p.isValidTextValue(i)?n(i):void 0},p.isValidTextValue=function(t){return t||0===t},p.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,p.strTranslate(a-u*(r+o),i-u*(n+s))+p.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},p.ensureUniformFontSize=function(t,e){var r=p.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},p.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},p.bigFont=function(t){return Math.round(1.2*t)};var j=p.getFirefoxVersion(),U=null!==j&&j<86;p.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":224,"./anchor_utils":228,"./angles":229,"./array":230,"./clean_number":231,"./clear_responsive":233,"./coerce":234,"./dates":235,"./dom":236,"./extend":238,"./filter_unique":239,"./filter_visible":240,"./geometry2d":243,"./identity":244,"./increment":245,"./is_plain_object":247,"./keyed_container":248,"./localize":249,"./loggers":250,"./make_trace_groups":251,"./matrix":252,"./mod":253,"./nested_property":254,"./noop":255,"./notifier":256,"./preserve_drawing_buffer":259,"./push_unique":260,"./regex":262,"./relative_attr":263,"./relink_private":264,"./search":265,"./sort_object_keys":267,"./stats":268,"./throttle":270,"./to_log_range":271,"@plotly/d3":12,"d3-format":24,"d3-time-format":25,"fast-isnumeric":28}],247:[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).hasOwnProperty("hasOwnProperty")}},{}],248:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":280,"./notifier":256}],251:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":12}],252:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],254:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;cMath.max(p,y)||u>Math.max(h,g)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":224,"./matrix":252}],259:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":28,"is-mobile":62}],260:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&a.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],p=c-a;void 0===a?(l.push(c),a=c):p>s&&(i=Math.min(i,p),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":230,"fast-isnumeric":28}],269:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(u),I=n.select(t.node().parentNode);if(!I.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(p,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,a,o){I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return E(),void e();var u=I.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",p=s.select("g");p.attr({fill:c,stroke:c});var h=l(p,"width"),f=l(p,"height"),d=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=-(r||l(t,"height"))/4;"y"===P[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-h/2,y-f/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:y-f/2}):"a"===P[0]&&0!==P.indexOf("atitle")?s.attr({x:0,y:y}):s.attr({x:d,y:+t.attr("y")+y-f/2}),m&&m.call(t,u),e(u)}))}))):E(),t}function E(){I.empty()||(P=t.attr("class")+"-math",I.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(y," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(g),I=0;I|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(g),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,d-a)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?e:""}function I(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(y," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(g),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],271:[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":28}],272:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],273:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],274:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],I=c(g,p).get(),P=[],E=-1,D=L.length;for(_=0;_L.length-(M?0:1))i.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?P.push(b):M?("add"===k&&(k={}),L.splice(b,0,k),I&&I.splice(b,0,{})):i.warn("Unrecognized full object edit value",p,b,k),-1===E&&(E=b);else for(x=0;x=0;_--)L.splice(P[_],1),I&&I.splice(P[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(y,g),d!==a){var z;if(-1===E)z=S;else{for(D=Math.max(L.length,D),z=[],_=0;_=E);_++)z.push(b);for(_=E;_=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in P(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),b.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=Y(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(h.rehover,h.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=f.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[f.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=f.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return f.draw(t,r,{skipTitle:n})}:function(t){return f.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=F(l._preGUI,u),d=Object.keys(e),m=f.list(t),y=o.extendDeepAll({},e),g={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[O];)O--;var B=D.parts[O],N=D.parts[O-1]+"."+B,U=D.parts.slice(0,O).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),Y=D.get();if(void 0!==z){A[E]=z,S[E]="reverse"===B?z:R(Y);var X=p.getLayoutValObject(l,D.parts);if(X&&X.impliedEdits&&null!==z)for(var J in X.impliedEdits)C(o.relativeAttr(E,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(E))if(z){C("autosize",null);var K="height"===E?"width":"height";C(K,l[K])}else l[E]=t._initialAutoSize[E];else if("autosize"===E)C("width",z?null:l.width),C("height",z?null:l.height);else if(N.match(H))P(N),s(l,U+"._inputRange").set(null);else if(N.match(Z)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(G)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===q.type&&"log"===z,tt="log"===q.type&&"linear"===z;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,z,C),c.getComponentMethod("images","convertCoords")(t,q,z,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,E).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,C),c.getComponentMethod("images","convertCoords")(t,nt,at,C)}var it=x.containerArrayMatch(E);if(it){r=it.array,n=it.index;var ot=it.property,st=X||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(z)?S[E]=null:x.isRemoveVal(z)?S[E]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),g[r]||(g[r]={});var lt=g[r][n];lt||(lt=g[r][n]={}),lt[ot]=z,delete e[E]}else"reverse"===B?(V.range?V.range.reverse():(C(U+".autorange",!0),V.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===E&&("lasso"===z||"select"===z)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?M.plot=!0:X?T.update(M,X):M.calc=!0,D.set(z))}}for(r in g){x.applyContainerArrayChanges(t,h(i,r),g[r],M,h)||(M.plot=!0)}for(var ut in I){var ct=(L=f.getFromId(t,ut))&&L._constraintGroup;if(ct)for(var pt in M.calc=!0,ct)I[pt]||(f.getFromId(t,pt)._constraintShrinkable=!0)}return(W(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:I,undoit:S,redoit:A,eventData:y}}function W(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,a){t=o.getGraphDiv(t),b.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=b.coerceTraceIndices(t,a),s=N(t,o.extendFlat({},e),i),l=s.flags,c=Y(t,o.extendFlat({},n)),p=c.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&b.clearAxisTypes(t,i,n);var f=[];p.layoutReplot?f.push(w.layoutReplot):l.fullReplot?f.push(r._doPlot):(f.push(h.previousPromises),V(t,p,c)||h.supplyDefaults(t),l.style&&f.push(w.doTraceStyle),(l.colorbars||p.colorbars)&&f.push(w.doColorBars),p.legend&&f.push(w.doLegend),p.layoutstyle&&f.push(w.layoutStyles),p.axrange&&q(f,c.rangesAltered),p.ticks&&f.push(w.doTicksRelayout),p.modebar&&f.push(w.doModeBar),p.camera&&f.push(w.doCamera),f.push(A)),f.push(h.rehover,h.redrag),u.add(t,X,[t,s.undoit,c.undoit,s.traces],X,[t,s.redoit,c.redoit,s.traces]);var d=o.syncOrAsync(f,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,b.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(a)?y>=a.length?t.transitionOpts=a[y]:t.transitionOpts=a[0]:t.transitionOpts=a,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);v=M}}v.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,i];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function v(t){return t===Math.round(t)&&t>=0}function _(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var p=c.basePlotModule;p&&p.attributes&&(a=p.attributes[o])}a||(a=i[o])}return g(a,e,s)},r.getLayoutValObject=function(t,e){return g(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var a=p();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":246,"../plots/attributes":289}],283:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function _(t){var e,a,s,c,d,m,y=t._fullLayout,g=y._size,_=g.p,b=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._has("cartesian"))return i.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-_-n:e._offset+e._length+_+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=m(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&y(i)&&t(i,o)}}({data:f,layout:h},""),c.length)return c.map(g)}},{"../lib":246,"../plots/attributes":289,"../plots/plots":335,"./plot_config":280,"./plot_schema":281,"./plot_template":282}],285:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(p.format.values,", "," or ")+".");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),_=g("width"),x=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},h);_?M.width=_:null===e.width&&n(d.width)&&(M.width=d.width),x?M.height=x:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){a.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=i.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(k,r,M,A).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":246,"../plots/plots":335,"../snapshot/helpers":342,"../snapshot/svgtoimg":344,"../snapshot/tosvg":346,"../version":413,"./plot_api":279,"fast-isnumeric":28}],286:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var p=Object.keys(t),h=0;h_.length&&a.push(d("unused",i,g.concat(_.length)));var M,A,S,C,L,I=_.length,P=Array.isArray(k);if(P&&(I=Math.min(I,k.length)),2===x.dimensions)for(A=0;A_[A].length&&a.push(d("unused",i,g.concat(A,_[A].length)));var E=_[A].length;for(M=0;M<(P?Math.min(E,k[A].length):E);M++)S=P?k[A][M]:k,C=v[A][M],L=_[A][M],n.validate(C,S)?L!==C&&L!==+C&&a.push(d("dynamic",i,g.concat(A,M),C,L)):a.push(d("value",i,g.concat(A,M),C))}else a.push(d("array",i,g.concat(A),v[A]));else for(A=0;A1&&f.push(d("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(p)===p))return{vals:a};u=p}for(var h=e.calendar,f="start"===l,d="end"===l,m=t[r+"period0"],y=i(m,h)||0,g=[],v=[],_=[],x=a.length,b=0;bM;)k=o(k,-u,h);for(;k<=M;)k=o(k,u,h);T=o(k,-u,h)}else{for(k=y+(w=Math.round((M-y)/c))*c;k>M;)k-=c;for(;k<=M;)k+=c;T=k-c}g[b]=f?T:d?k:(T+k)/2,v[b]=T,_[b]=k}return{vals:g,starts:v,ends:_}}},{"../../constants/numerical":224,"../../lib":246,"fast-isnumeric":28}],291:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],292:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,p=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),u=m(t,e),c=u.min,p=u.max;if(0===c.length||0===p.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,y=p[0].val;for(r=1;r0&&((T=C-s(_)-l(x))>L?k/T>I&&(b=_,w=x,I=k/T):k/C>I&&(b={val:_.val,nopad:1},w={val:x.val,nopad:1},I=k/C));if(h===y){var P=h-1,E=h+1;if(A)if(0===h)a=[0,1];else{var D=(h>0?p:c).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,D/C));a=h>0?[0,z]:[z,0]}else a=S?[Math.max(0,P),Math.max(1,E)]:[P,E]}else A?(b.val>=0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(b.val-I*s(b)<0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),I=(w.val-b.val-f(e,_.val,x.val))/(C-s(b)-l(w)),a=[b.val-I*s(b),w.val+I*l(w)];return g&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!T){if(h=1/0,f=-1/0,w)for(n=0;n0&&(h=i),i>f&&i-o&&(h=i),i>f&&i=E;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],p=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function _(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":136,"../../constants/numerical":224,"../../lib":246,"../../registry":338,"./axis_ids":297,"@plotly/d3":12,"fast-isnumeric":28}],293:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),p=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,_=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,C=m.ONEHOUR,L=m.ONEMIN,I=m.ONESEC,P=m.MINUS_SIGN,E=m.BADNUM,D={K:"zeroline"},z={K:"gridline",L:"path"},O={K:"tick",L:"path"},R={K:"tick",L:"text"},F=t("../../constants/alignment"),B=F.MID_SHIFT,N=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var q=t("./axis_autotype"),H=t("./axis_ids"),Z=H.idSort,G=H.isLinked;V.id2name=H.id2name,V.name2id=H.name2id,V.cleanId=H.cleanId,V.list=H.list,V.listIds=H.listIds,V.getFromId=H.getFromId,V.getFromTrace=H.getFromTrace;var Y=t("./autorange");V.getAutoRange=Y.getAutoRange,V.findExtremes=Y.findExtremes;function W(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=V.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,g,u,i)),y=v,0;y<=c;)y=V.tickIncrement(y,g,!1,i);return{start:e.c2r(v,0,i),end:e.c2r(y,0,i),size:g,_dataSpan:c-u}},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,V.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=V.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=C,o&&!n&&t.dticki&&p=o:f<=o;f=V.tickIncrement(f,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(f=c)break}if(L.length>m||f===I)break;I=f;var P=!1;p&&f!==(0|f)&&(P=!0),L.push({minor:P,value:f})}if(h&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),p=r||c,h=0;p>=v?h=c>=v&&c<=y?c:g:r===x&&p>=b?h=c>=b&&c<=_?c:x:p>=k?h=c>=k&&c<=w?c:T:r===M&&p>=M?h=M:p>=A?h=A:r===S&&p>=S?h=S:r===C&&p>=C&&(h=C),h>=c&&(h=c,s=!0);var f=a+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(a*(1-L)+L*f)!==E&&d++}(h*=d/84)||(t[n].drop=!0),s&&c>M&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(L,t,t._definedDelta),t.rangebreaks){var D="y"===t._id.charAt(0),z=1;"auto"===t.tickmode&&(z=t.tickfont?t.tickfont.size:12);var O=NaN;for(d=L.length-1;d>-1;d--)if(L[d].drop)L.splice(d,1);else{L[d].value=At(L[d].value,t);var R=t.c2p(L[d].value);(D?O>R-z:Oc||Bc&&(F.periodX=c),B10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&i<=10||e>=15*A)t._tickround="d";else if(e>=L&&i<=16||e>=C)t._tickround="M";else if(e>=I&&i<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ct(t.exponentformat)&&!pt(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}V.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>g)e/=g,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(i>T)e/=T,t.dtick="M"+ot(e,1,tt);else if(i>A){t.dtick=ot(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=V.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>C?t.dtick=ot(e,C,tt):i>L?t.dtick=ot(e,L,et):i>I?t.dtick=ot(e,I,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Mt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},V.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?at:nt,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=ht(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||ct(f)&&pt(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":P)+h+"",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":P)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):Mt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ht(e.x,t,a,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":P+o:o};var ut=["f","p","n","\u03bc","m","","k","M","G","T"];function ct(t){return"SI"===t||"B"===t}function pt(t){return t>14||t<-15}function ht(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=V.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,P);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+f+"":"B"===l&&9===u?t+="B":ct(l)&&(t+=ut[u/3+5]));return i?P+t:t}function ft(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-p:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?p-r.top:0,h),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?p-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-p:0,h),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==u._dfltTitle[d]&&(n[l]+=yt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,_t(e),n),i.autoMargin(t,xt(e),a),i.autoMargin(t,bt(e),s)})),r.skipTitle||K&&"bottom"===e.side||X.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+yt(e);else{var s=St(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,p,f,d,m=V.getPxPosition(t,e);"x"===i?(p=e._offset+e._length/2,f="top"===e.side?m-r:m+r):(f=e._offset+e._length/2,p="right"===e.side?m+r:m-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var y=e._selections[e._id+"tick"];if(d={selection:y,side:e.side},y&&y.node()&&y.node().parentNode){var g=h.getTranslate(y.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:u,attributes:{x:p,y:f,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(X)}}function Q(t){var r=f+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=vt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},V.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,p=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*N,p+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,p+=3);s&&"top"===u&&(p-=h*(1-N));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(p=-p);return[l?c:0,s?p:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(dt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(dt(e)))}},V.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,p=i("inside"),h="inside"===n&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,d=0,m=h?t.ticklen:0;if(p?m*=-1:c&&(m=0),h&&(f+=m,r)){var y=s.deg2rad(r);f=m*Math.cos(y)+1,d=m*Math.sin(y)}t.showticklabels&&(h||t.showline)&&(f+=.2*t.tickfont.size);var g,v,_,x,b,w={labelStandoff:f+=(t.linewidth||1)/2*(p?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)x=(b=!p&&"bottom"===k||p&&"top"===k)?1:-1,p&&(x*=-1),g=d*x,v=e+f*x,_=b?1:-.2,90===Math.abs(A)&&(p?_+=B:_=-90===A&&"bottom"===k?N:90===A&&"top"===k?B:.5,T=B/2*(A/90)),w.xFn=function(t){return t.dx+g+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*_},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==p?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===M){if(x=(b=!p&&"left"===k||p&&"right"===k)?1:-1,p&&(x*=-1),g=f,v=d*x,_=0,p||90!==Math.abs(A)||(_=-90===A&&"left"===k||90===A&&"right"===k?N:.5),p){var S=a(A)?+A:0;if(0!==S){var C=s.deg2rad(S);T=Math.abs(Math.sin(C))*N*x,_=0}}w.xFn=function(t){return t.dx+e-(g+t.fontSize*_)*x+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*B},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},V.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],mt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(p.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),Ct(e,[O]),i.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&V.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sf||i.leftf||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},_(g,y+1?y:m);var x=null;e._selections&&(e._selections[p]=g);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&i._redrawFromAutoMarginCount&&90===y?(x=90,b.push((function(){_(g,y)}))):b.push((function(){if(_(g,m),f.length&&"x"===c&&!a(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=vt(this),o=h.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=f.length,l=Math.abs((f[o-1].x-f[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",p=function(t){return-1!==u.indexOf(t)},d=p("top"),y=p("left"),v=p("right"),b=p("bottom")||y||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var y="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=p(r),a=0,o=0,s={},c=0;c2*a}(a,y)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=v(o[l])){c=d;break}var p=a("pattern",c);if(p===d)for(l=0;l<2;l++)(u=v(o[l]))&&(e.bounds[l]=o[l]=u-1);if(p)for(l=0;l<2;l++)switch(u=o[l],p){case d:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case m:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":338,"./constants":300}],298:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function y(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*_)||T)for(r=0;rD&&FP&&(P=F);h/=(P-I)/(2*E),I=l.l2r(I),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:p.background,stroke:p.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,a,i)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){E&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),E=!1)}function Z(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function G(t,e,r,n,i){for(var o,s,l,u,c=!1,p={},h={},f=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(q(a),2!==t||gt||Ht(),yt)o.indexOf("select")>-1&&S(r,a,J,K,e.id,Pt),o.indexOf("event")>-1&&f.click(a,r,e.id);else if(1===t&>){var s=m?D:E,u="s"===m||"w"===g?0:1,p=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),d="left",y="middle";if(s.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===g&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:y}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,p,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ft*e+bt)),a=Math.max(0,Math.min(et,dt*r+wt)),i=Math.abs(n-bt),o=Math.abs(a-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,a),Tt.b=Math.max(wt,a),rt.isSubplotConstrained)i>P||o>P?(St="xy",i/tt>o/et?(o=i*et/tt,wt>a?Tt.t=wt-o:Tt.b=wt+o):(i=o*tt/et,bt>n?Tt.l=bt-i:Tt.r=bt+i),Lt.attr("d",Z(Tt))):s();else if(nt.isSubplotConstrained)if(i>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),u=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=u*tt,Tt.b=(1-l)*et,Tt.t=(1-u)*et,Lt.attr("d",Z(Tt))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cm[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":246,"fast-isnumeric":28}],312:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":219}],313:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,p=u.rectMode,h=u.drawMode,f=u.openMode,d=u.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),y=t("../../components/shapes/draw_newshape/helpers").handleEllipse,g=t("../../components/shapes/draw_newshape/newshapes"),v=t("../../lib"),_=t("../../lib/polygon"),x=t("../../lib/throttle"),b=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),M=k.MINSELECT,A=_.filter,S=_.tester,C=t("./handle_outline").clearSelect,L=t("./helpers"),I=L.p2r,P=L.axValue,E=L.getTransform;function D(t,e,r,n,a,i,o){var s,l,u,c,p,h,d,y,g,v=e._hoverdata,_=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){F(t,e,i);var b=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(b))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)L._fullLayout._deactivateShape(L);else if(!b){var r=z.clickmode;x.done(mt).then((function(){if(x.clear(mt),2===t){for(pt.remove(),$=0;$-1&&D(e,L,a.xaxes,a.yaxes,a.subplot,a,pt),"event"===r&&L.emit("plotly_selected",void 0);s.click(L,e)})).catch(v.error)}},a.doneFn=function(){dt.remove(),x.done(mt).then((function(){x.clear(mt),a.gd.emit("plotly_selected",et),Q&&a.selectionDefs&&(Q.subtract=ct,a.selectionDefs.push(Q),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(yt)})).catch(v.error),b&&B(a)}},clearSelect:C,clearSelectionsCache:B,selectOnClick:D}},{"../../components/color":114,"../../components/dragelement/helpers":132,"../../components/drawing":136,"../../components/fx":154,"../../components/fx/helpers":150,"../../components/shapes/draw_newshape/display_outlines":202,"../../components/shapes/draw_newshape/helpers":203,"../../components/shapes/draw_newshape/newshapes":204,"../../lib":246,"../../lib/clear_gl_canvases":232,"../../lib/polygon":258,"../../lib/throttle":270,"../../plot_api/subroutines":283,"../../registry":338,"./axis_ids":297,"./constants":300,"./handle_outline":304,"./helpers":305,polybooljs:69}],314:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,p=i.ensureNumber,h=i.isArrayOrTypedArray,f=t("../../constants/numerical"),d=f.FP_SAFE,m=f.BADNUM,y=f.LOG_CLIP,g=f.ONEWEEK,v=f.ONEDAY,_=f.ONEHOUR,x=f.ONEMIN,b=f.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function C(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],a=t.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function L(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function I(e,r,n){return u(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function E(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function O(t){return s(t)?+t:D(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===f;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var p=t._B[o]||0;return isFinite(p)?R(e,t._m2,p):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:p,t.l2c="log"===t.type?A:p,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(C(t,e))}:B,t.p2c="log"===t.type?function(t){return A(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=p,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=p):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=p,t.c2r=C,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=p):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=I,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return I(N(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=E,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=p,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:p(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=p,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:p(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var p=[[0,{}],[0,{}]],d=[];for(a=0;ad&&(o[n]=d),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),p="y"===f;if((p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(p?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function y(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=i.simpleMap(e.xr0,a.r2l),m=i.simpleMap(e.xr1,a.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),a.range[0]=a.l2r(d[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=i.simpleMap(e.yr0,l.r2l),_=i.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=a.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,M=h?f[1]:0,A=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=a._offset-A,L=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":136,"../../lib":246,"../../registry":338,"./axes":293,"@plotly/d3":12}],319:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var f=i(u),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;pOpenStreetMap
contributors',i=['\xa9 Carto',a].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":267}],328:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(a){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(i){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":246}],329:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),a=t("../../lib"),i=a.strTranslate,o=a.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),u=t("@plotly/d3"),c=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),h=t("./mapbox"),f=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==f.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,i=e._subplots.mapbox;if(n.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(f.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,i);n.accessToken=o;for(var l=0;lb/2){var w=g.split("|").join("
");_.text(w).attr("data-unformatted",w).call(p.convertToTspans,t),x=c.bBox(_.node())}_.attr("transform",i(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;x.width+6>b&&(T=b/(x.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];v.attr("transform",i(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=p(o)?function(t,r){(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(u)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),f(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.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])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,p,n),x.cleanPlot(h,l,p,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=x.layoutAttributes.width.min,f=x.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,p=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(p),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,b=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:g,size:r.l+d},r:{val:v,size:r.r+d},b:{val:b,size:r.b+d},t:{val:_,size:r.t+d}},f[e]=1}else delete h[e],delete f[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),I(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,p=i.r,h=i.t,d=i.b,m=e._pushmargin,y=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:u},r:{val:1,size:p},t:{val:1,size:h},b:{val:0,size:d}},m){var _=m[v].l||{},b=m[v].b||{},w=_.val,T=_.size,k=b.val,M=b.size;for(var A in m){if(o(T)&&m[A].r){var S=m[A].r.val,C=m[A].r.size;if(S>w){var L=(T*S+(C-r)*w)/(S-w),P=(C*(1-w)+(T-r)*(1-S))/(S-w);L+P>u+p&&(u=L,p=P)}}if(o(M)&&m[A].t){var E=m[A].t.val,D=m[A].t.size;if(E>k){var z=(M*E+(D-n)*k)/(E-k),O=(D*(1-k)+(M-n)*(1-E))/(E-k);z+O>d+h&&(d=z,h=O)}}}}}var R=c.constrain(r-i.l-i.r,2,64),F=c.constrain(n-i.t-i.b,2,64),B=Math.max(0,r-R),N=Math.max(0,n-F);if(B){var j=(u+p)/B;j>1&&(u/=j,p/=j)}if(N){var U=(d+h)/N;U>1&&(d/=U,h/=U)}if(a.l=Math.round(u),a.r=Math.round(p),a.t=Math.round(h),a.b=Math.round(d),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var p={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=u(s),a)){var h=s._size;p.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(p.frames=u(l)),i&&(p.config=u(t._context,!0)),"object"===n?p:JSON.stringify(p)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,u,p),a=0;a0){for(var n=[],a=0;a-1&&(p[f[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":114,"../components/drawing":136,"../constants/xmlns_namespaces":225,"../lib":246,"@plotly/d3":12}],347:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":113,"../../components/colorscale/attributes":121,"../../lib/extend":238,"../../plots/attributes":289,"../../plots/template_attributes":337,"../scattergeo/attributes":397}],348:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o),[t]}},{"../../lib":246,"../../plots/cartesian/axes":293,"./attributes":347}],351:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":327,"./convert":353}],357:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:a(),showlegend:s({},i.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":121,"../../lib/extend":238,"../../plots/attributes":289,"../../plots/template_attributes":337,"../scattermapbox/attributes":399}],358:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=a(u)&&u.length,p=0;p0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":327,"./convert":359}],365:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],366:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;rl&&I[g].gap;)g--;for(_=I[g].s,m=I.length-1;m>g;m--)I[m].s=_;for(;lA[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],376:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),p=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults");e.exports=function(t,e,r,y){function g(r,a){return n.coerce(t,e,i,r,a)}var v=l(t,e,y,g);if(v||(e.visible=!1),e.visible){u(t,e,y,g),g("xhoverformat"),g("yhoverformat");var _=c(t,e,y,g),x=!_&&v=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-d);return i=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(f.c2p(t.y)-m);return iY!=(N=z[E][1])>=Y&&(R=z[E-1][0],F=z[E][0],N-B&&(O=R+(F-R)*(Y-B)/(N-B),q=Math.min(q,O),H=Math.max(H,O)));q=Math.max(q,0),H=Math.min(H,h._length);var W=s.defaultLine;return s.opacity(p.fillcolor)?W=p.fillcolor:s.opacity((p.line||{}).color)&&(W=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:H,y0:Y,y1:Y,color:W,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":114,"../../components/fx":154,"../../lib":246,"../../registry":338,"./get_trace_color":379}],381:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":307,"./arrays_to_calcdata":368,"./attributes":369,"./calc":370,"./cross_trace_calc":374,"./cross_trace_defaults":375,"./defaults":376,"./format_labels":378,"./hover":380,"./marker_colorbar":387,"./plot":390,"./select":391,"./style":393,"./subtypes":394}],382:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":124,"../../components/colorscale/helpers":125,"../../lib":246}],383:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,i,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S=e.xaxis,C=e.yaxis,L="log"===S.type,I="log"===C.type,P=S._length,E=C._length,D=e.connectGaps,z=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,B=[],N=p.minTolerance,j=t.length,U=new Array(j),V=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(L&&(i=S.c2p(n.x,!0)),i===a)return!1;I&&l===a&&(i*=Math.abs(S._m*E*(S._m>0?o:s)/(C._m*P*(C._m>0?o:s)))),i*=1e3}if(l===a){if(I&&(l=C.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function H(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],a=r===U[V-1][1];if(!n||!a)if(V>1){var i=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&i?o?V--:U[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([X,J]),ut(t),K=null,X=J=0}function pt(t){if(M=t[0]/P,A=t[1]/E,Y=t[0]rt?rt:0,W=t[1]at?at:0,Y||W){if(V)if(K){var e=$(K,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else Q=$(U[V-1],t)[0],U[V++]=Q;else U[V++]=[Y||t[0],W||t[1]];var r=U[V-1];Y&&W&&(r[0]!==Y||r[1]!==W)?(K&&(X!==Y&&J!==W?ut(X&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[X||Y,J||W]):X&&J&&ut([X,J])),ut([Y,W])):X-Y&&J-W&&ut([Y||X,W||J]),K=t,X=Y,J=W}else K&&ct($(K,t)[0]),U[V++]=t;var n,a,i,o}for("linear"===O||"spline"===O?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,t)Z(d,ht))break;i=d,(b=g[0]*y[0]+g[1]*y[1])>_?(_=b,h=d,m=!1):b=t.length||!d)break;pt(d),n=d}}else pt(h)}K&&ut([X||K[0],J||K[1]]),B.push(U.slice(0,V))}return B}},{"../../constants/numerical":224,"../../lib":246,"./constants":373}],384:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],385:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,p=-1,h=0,f=-1;for(i=0;i=0?l=f:(l=f=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":28}],387:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],388:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),a(t,"marker.line")&&i(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")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":114,"../../components/colorscale/defaults":124,"../../components/colorscale/helpers":125,"./subtypes":394}],389:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":224,"../../lib":246}],390:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),p=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),y=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var I=b.fill.charAt(b.fill.length-1);"x"!==I&&"y"!==I&&(I=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,E,D="",z=[],O=b._prevtrace;O&&(D=O._prevRevpath||"",L=O._nextFill,z=O._polygons);var R,F,B,N,j,U,V,q="",H="",Z=[],G=i.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},Z=c(p,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(Z.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",P),l.singleLineStyle(p,a)}}}}}var Y=M.selectAll(".js-line").data(Z);v(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(G(!0)),l.setClipUrl(Y,r.layerClipId,t),Z.length?(C?(C.datum(p),N&&U&&(I?("y"===I?N[1]=U[1]=x.c2p(0,!0):"x"===I&&(N[0]=U[0]=_.c2p(0,!0)),v(C).attr("d","M"+U+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):v(C).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===b.fill.substr(0,6)&&q&&D?("tonext"===b.fill?v(L).attr("d",q+"Z"+D+"Z").call(l.singleFillStyle):v(L).attr("d",q+"L"+D.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(z)):(X(L),b._polygons=null)),b._prevRevpath=H,b._prevPolygons=V):(C?X(C):L&&X(L),b._polygons=b._prevRevpath=b._prevPolygons=null),A.datum(p),S.datum(p),function(e,a,i){var o,c=i[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?K:J:b&&!w&&(y=Q),p&&(d=y),h&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=v(a);l.translatePoint(e,i,_,x)?(l.singlePointStyle(e,i,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,_,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=v(e.select("text"));l.translatePoint(t,a,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(A,W,t),l.setClipUrl(S,W,t)}function X(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,d=!i,m=!!i&&i.duration>0,y=p(t,e,r);((c=a.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){f(t,n,e,r,y,this,i)}))}))):c.each((function(r,n){f(t,n,e,r,y,this,i)}));d&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":136,"../../lib":246,"../../lib/polygon":258,"../../registry":338,"./line_points":383,"./link_traces":385,"./subtypes":394,"@plotly/d3":12}],391:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r")}function c(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,u=o[0].trace,c=t.xa,p=t.ya,h=t.subplot,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=h.project([n,i]),l=o.x-c.c2p([d,i]),u=o.y-p.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)}),t),!1!==t.index){var m=o[t.index],y=m.lonlat,g=[a.modHalf(y[0],360)+f,y[1]],v=c.c2p(g),_=p.c2p(g),x=m.mrc||1;t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x;var b={};b[u.subplot]={_subplot:h};var w=u._module.formatLabels(m,u,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=i(u,m),t.extraText=l(u,m,o[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}},{"../../components/fx":154,"../../constants/numerical":224,"../../lib":246,"../scatter/get_trace_color":379}],405:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":329,"../scatter/marker_colorbar":387,"../scattergeo/calc":398,"./attributes":399,"./defaults":401,"./event_data":402,"./format_labels":403,"./hover":404,"./plot":406,"./select":407}],406:[function(t,e,r){"use strict";var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,a,o=this.subplot,s=o.map,l=n(o.gd,t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=i.length-1;e>=0;e--)r=i[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=i[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,a=new o(t,r.uid),s=n(t.gd,e),l=a.below=t.belowLookup["trace-"+r.uid],u=0;ua&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),_={},x={},b=0;d?(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set(new Array(p))},g=function(t,e){var r=_[t.astr][e];t.get()[e]=r}):(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set([])},g=function(t,e){var r=_[t.astr][e];t.get().push(r)}),k(y);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],72:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:a,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:g,below:g};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}i.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":77,timers:78}],79:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,p=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(S[t])t=S[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(f=e.r,d=e.g,m=e.b,a={r:255*I(f,255),g:255*I(d,255),b:255*I(m,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),u=z(e.v),a=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),p=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),c=z(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=I(t,360),e=I(e,100),r=I(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var f,d,m;return i=L(i),{ok:p,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function A(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(O(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*I(this._r,255))+"%",g:i(100*I(this._g,255))+"%",b:i(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%)":"rgba("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(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(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.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"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function E(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return E(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],80:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-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 a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},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 a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(p/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=p[t-p[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=p[o.year-p[0]],f=c>>13;u=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var f,d=p[i.year-p[0]];for(f=0;f<13;f++){var m=d&1<<12-f?30:29;if(l>13;!y||f=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":94,"object-assign":67}],83:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":94,"object-assign":67}],84:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":94,"object-assign":67}],85:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":94,"object-assign":67}],86:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":94,"object-assign":67}],87:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":94,"object-assign":67}],88:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":94,"object-assign":67}],89:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.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])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+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),p=t-this.toJD(l,c,1)+1;return this.newDate(l,c,p)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":94,"object-assign":67}],91:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":94,"object-assign":67}],92:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":94,"object-assign":67}],93:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":94,"object-assign":67}],94:[function(t,e,r){var n=t("object-assign");function a(){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 o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.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){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).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?"-":"")+o(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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[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(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(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),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":67}],95:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,p=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(f(t,n))for(;a.length1},_=function(t,r){var n=v(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(M).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,b=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(M));return M+=t.length,t}return _("m")},w=function(t,r,n,i){for(var o=v(t,i)?n:r,s=0;s-1){f=1,d=m;for(var C=this.daysInMonth(h,f);d>C;C=this.daysInMonth(h,f))f++,d-=C}return p>-1?this.fromJD(p):this.newDate(h,f,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":94,"object-assign":67}],96:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],97:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":220,"../../plot_api/plot_template":282,"../../plots/cartesian/constants":300,"../../plots/font_attributes":322,"./arrow_paths":96}],98:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],p=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":246,"../../plots/cartesian/axes":293,"./draw":103}],99:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,X=["x","y"],W=0;W1)&&(nt===rt?((ft=at.r2fraction(e["a"+et]))<0||ft>1)&&(Y=!0):Y=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?at._offset+at._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?at._offset+at._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){pt.head=J;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var yt=l.getRefType(nt);"domain"===yt?("y"===et&&(mt=1-mt),pt.tail=at._offset+at._length*mt):"paper"===yt?"y"===et?(mt=1-mt,pt.tail=T.t+T.h*mt):pt.tail=T.l+T.w*mt:pt.tail=at._offset+at.r2p(mt),K=tt}else pt.tail=J+mt,K=tt+mt;pt.text=pt.tail+tt;var gt=w["x"===et?"width":"height"];if("paper"===rt&&(pt.head=o.constrain(pt.head,1,gt-1)),"pixel"===nt){var vt=-Math.max(pt.tail-3,pt.text),_t=Math.min(pt.tail+3,pt.text)-gt;vt>0?(pt.tail+=vt,pt.text+=vt):_t>0&&(pt.tail-=_t,pt.text-=_t)}pt.tail+=ct,pt.head+=ct}else K=tt=lt*H($,ut),pt.text=J+tt;pt.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,bt=0;if("left"!==e.align&&(xt=(M-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),p)n.select("svg").attr({x:N+xt-1,y:N+bt}).call(c.setClipUrl,U?L:null,t);else{var wt=N+bt-m.top,Tt=N+xt-m.left;Z.call(h.positionText,Tt,wt).call(c.setClipUrl,U?L:null,t)}V.select("rect").call(c.setRect,N,N,M,O),j.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),D.attr({transform:"rotate("+P+","+I.x.text+","+I.y.text+")"});var kt,Mt=function(r,n){E.selectAll(".annotation-arrow-g").remove();var l=I.x.head,p=I.y.head,h=I.x.tail+r,f=I.y.tail+n,m=I.x.text+r,x=I.y.text+n,b=o.rotationXYMatrix(P,m,x),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),L=+j.attr("width"),z=+j.attr("height"),O=m-.5*L,F=O+L,B=x-.5*z,N=B+z,U=[[O,B,O,N],[O,N,F,N],[F,N,F,B],[F,B,O,B]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,p,l+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,f,l,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,Z=E.append("g").style({opacity:u.opacity(q)}).classed("annotation-arrow-g",!0),G=Z.append("path").attr("d","M"+h+","+f+"L"+l+","+p).style("stroke-width",V+"px").call(u.stroke,u.rgb(q));if(y(G,H,e),k.annotationPosition&&G.node().parentNode&&!i){var Y=l,X=p;if(e.standoff){var W=Math.sqrt(Math.pow(l-h,2)+Math.pow(p-f,2));Y+=e.standoff*(h-l)/W,X+=e.standoff*(f-p)/W}var J,K,Q=Z.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Y)+","+(f-X),transform:s(Y,X)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);J=t.x,K=t.y,g&&g.autorange&&A(g._name+".autorange",!0),_&&_.autorange&&A(_._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),a=n[0]+t,i=n[1]+r;R.call(c.setTranslate,a,i),S("x",v(g,t,"x",T,e)),S("y",v(_,r,"y",T,e)),e.axref===e.xref&&S("ax",v(g,t,"ax",T,e)),e.ayref===e.yref&&S("ay",v(_,r,"ay",T,e)),Z.attr("transform",s(t,r)),D.attr({transform:"rotate("+P+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(g,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(_,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(g)a=v(g,t,"x",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;a=d.align(u+t/T.w,l,0,1,e.xanchor)}if(_)o=v(_,r,"y",T,e);else{var c=e._ysize/T.h,p=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(p-r/T.h,c,0,1,e.yanchor)}S("x",a),S("y",o),g&&_||(n=d.getCursor(g?.5:a,_?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",G(n))},doneFn:function(){f(R),a.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,_=e.indexOf("end")>=0,x=d.backoff*y+r.standoff,b=m.backoff*g+r.startstandoff;if("line"===f.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,T=o.y-c.y;if(h=(p=Math.atan2(T,w))+Math.PI,x&&b&&x+b>Math.sqrt(w*w+T*T))return void z();if(x){if(x*x>w*w+T*T)return void z();var k=x*Math.cos(p),M=x*Math.sin(p);c.x+=k,c.y+=M,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>w*w+T*T)return void z();var A=b*Math.cos(p),S=b*Math.sin(p);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===f.nodeName){var C=f.getTotalLength(),L="";if(C1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":325,"../annotations/draw":103}],110:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Y*=J*u.roundUp(W/J,[2,5,10]),(Math.abs(I.start)/I.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Y}G.domain=[q+j,q+F-j],G.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var K,Q=t.select("."+M.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+M.cbaxis),tt=0;function et(n,a){var i={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),m.draw(r,n,p(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+B)*l.w,n=G.title.font.size;t="top"===A?(1-(q+F-j))*l.h+l.t+3+.75*n:(1-(q+j))*l.h+l.t-3-.25*n,et(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+M.cbtitle),o=i.select("text"),p=[-e.outlinewidth/2,e.outlinewidth/2],h=i.select(".h"+G._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),h?(tt=f.bBox(h).height)>d&&(p[1]-=(tt-d)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=f.bBox(o.node()).height),tt){if(tt+=5,"top"===A)G.domain[1]-=tt/l.h,p[1]*=-1;else{G.domain[0]+=tt/l.h;var m=y.lineCount(o);p[1]+=(1-m)*d}i.attr("transform",c(p[0],p[1])),G.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",c(0,Math.round(l.h*(1-G.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var v=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(E);v.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),v.exit().remove();var _=S.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?S[0]:(E[i]+E[i-1])/2,i===E.length-1?S[1]:(E[i]+E[i+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,_[0],_[1]);var s=n.select(this).attr({x:U,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)f.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+M.cblines).selectAll("path."+M.cbline).data(g.color&&g.width?D:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(G.c2p(t))+g.width/2%1)+"h"+z).call(f.lineGroupStyle,g.width,C(t),g.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=U+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(G),k=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,T):T,layer:$,path:s.makeTickPath(G,b,k),transFn:s.makeTransTickFn(G)}),s.drawLabels(r,G,{vals:T,layer:$,transFn:s.makeTransTickLabelFn(G),labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=G.title.font.size,e=G._offset+G._length/2,a=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));et("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+e.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=f.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(M.jsPlaceholder)){var a,o=Q.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?f.bBox(o).width:f.bBox(Q.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-Z;t.select("."+M.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:Z-N,width:Math.max(s,2),height:Math.max(u+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:U,y:Z+e.ypad+("top"===A?tt:0),width:Math.max(z,2),height:Math.max(u-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var p=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-p,l.t));var h={},m=T[e.yanchor],y=k[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*m,h.b=u*y):(h.t=h.b=0,h.yt=e.y+e.len*m,h.yb=e.y-e.len*y);var g=T[e.xanchor],v=k[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*g,h.r=s*v;else{var _=s-z;h.l=_*g,h.r=_*v,h.xl=e.x-e.thickness*g,h.xr=e.x+e.thickness*v}i.autoMargin(r,e._id,h)}],r)}(r,e,t);g&&g.then&&(t._promises||[]).push(g),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":219,"../../lib":246,"../../lib/extend":238,"../../lib/setcursor":266,"../../lib/svg_text_utils":269,"../../plots/cartesian/axes":293,"../../plots/cartesian/axis_defaults":295,"../../plots/cartesian/layout_attributes":308,"../../plots/cartesian/position_defaults":311,"../../plots/plots":335,"../../registry":338,"../color":114,"../colorscale/helpers":125,"../dragelement":133,"../drawing":136,"../titles":212,"./constants":116,"@plotly/d3":12,tinycolor2:79}],119:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":246}],120:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":115,"./defaults":117,"./draw":118,"./has_colorbar":119}],121:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var f=i+"auto",d=i+"min",m=i+"max",y=i+"mid",g=(s(h+f),s(h+d),s(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":262,"../../lib/sort_object_keys":267,"../colorbar/attributes":115,"./scales.js":129}],122:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,p=i(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return a.aggNums(Math.min,null,l)},g=function(){return a.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":246,"./helpers":125,"fast-isnumeric":28}],123:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],131:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":246}],132:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],133:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){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 p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":246,"../../plots/cartesian/constants":300,"./align":130,"./cursor":131,"./unhover":134,"has-hover":59,"has-passive-events":60,"mouse-event-offset":65}],134:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":236,"../../lib/events":237,"../../lib/throttle":270,"../fx/constants":148}],135:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],136:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),p=a.strTranslate,h=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,y=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,_=e.exports={};_.font=function(t,e,r,n){a.isPlainObject(e)&&(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(u.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,a){t.call(_.setPosition,e,r).call(_.setSize,n,a)},_.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",p(a,i)),!0)},_.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);_.translatePoint(t,a,e,r)}))},_.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){_.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},_.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";u.stroke(e,n||i.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(u.stroke,r||i.color).call(_.dashLine,s,o)}))},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},_.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(u.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(u.fill,t[0].trace.fillcolor)}))};var x=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(x).forEach((function(t){var e=x[t],r=e.n;_.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),_.symbolNames[r]=t,_.symbolFuncs[r]=e.f,e.needLine&&(_.symbolNeedLines[r]=!0),e.noDot?_.symbolNoDot[r]=!0:_.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(_.symbolNoFill[r]=!0)}));var b=_.symbolNames.length;function w(t,e){var r=t%100;return _.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}_.symbolNumber=function(t){if(o(t))t=+t;else 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=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};_.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=A[i],h=new Array(c),f=0;f"+g(t);d._gradientUrlQueryParts[v]=1},_.pattern=function(t,e,r,i,o,s,l,c,p,h,f,d){var m="legend"===e;c&&("overlay"===p?(h=c,f=u.contrast(h)):(h=void 0,f=c));var y,g,v,_,x,b,w,T,k,M,A,S=r._fullLayout,C="p"+S._uid+"-"+i,L={};switch(o){case"/":y=s*Math.sqrt(2),g=s*Math.sqrt(2),b="path",L={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"\\":y=s*Math.sqrt(2),g=s*Math.sqrt(2),b="path",L={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"x":y=s*Math.sqrt(2),g=s*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,_=s-s*Math.sqrt(1-l),b="path",L={d:v,opacity:d,stroke:f,"stroke-width":_+"px"};break;case"|":b="path",b="path",L={d:v="M"+(y=s)/2+",0L"+y/2+","+(g=s),opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"-":b="path",b="path",L={d:v="M0,"+(g=s)/2+"L"+(y=s)+","+g/2,opacity:d,stroke:f,"stroke-width":(_=l*s)+"px"};break;case"+":b="path",v="M"+(y=s)/2+",0L"+y/2+","+(g=s)+"M0,"+g/2+"L"+y+","+g/2,_=s-s*Math.sqrt(1-l),b="path",L={d:v,opacity:d,stroke:f,"stroke-width":_+"px"};break;case".":y=s,g=s,l.pattern_filled";S._patternUrlQueryParts[E]=1},_.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},_.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},_.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(c,l))}var p,h,f,d=!1;if(t.so)f=s.outlierwidth,h=s.outliercolor,p=o.outliercolor;else{var m=(s||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(p=u.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,p).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:f)+"px");var y=o.gradient,g=t.mgt;g?d=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,x=v&&_.getPatternAttr(v.shape,t.i,"");if(g&&"none"!==g){var b=t.mgc;b?d=!0:b=y.color;var T=r.uid;d&&(T+="-"+t.i),_.gradient(e,i,T,g,[[0,b],[1,p]],"fill")}else if(x){var k=_.getPatternAttr(v.bgcolor,t.i,null),M=_.getPatternAttr(v.fgcolor,t.i,null),S=v.fgopacity,C=_.getPatternAttr(v.size,t.i,8),L=_.getPatternAttr(v.solidity,t.i,.3),I=t.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),P=r.uid;I&&(P+="-"+t.i),_.pattern(e,"point",i,P,x,C,L,t.mcc,v.fillmode,k,M,S)}else u.fill(e,p);f&&u.stroke(e,h)}},_.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=_.tryColorscale(r,""),e.lineScale=_.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=y.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,_.makeSelectedPointStyleFns(t)),e},_.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,p=s.opacity,h=void 0!==c,f=void 0!==p;(a.isArrayOrTypedArray(u)||h||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:f?p:m*e});var d=i.color,y=o.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?y||e:g||e});var v=i.size,_=o.size,x=s.size,b=void 0!==_,w=void 0!==x;return l.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},_.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,m))},e},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(_.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}_.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=_.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,p=c?c(t,e,l):{},f={};v(f,e,t.i);var d=e._meta||{};u=a.texttemplateString(u,p,l._d3locale,f,t,d)}var m=t.tp||e.textposition,y=L(t,e),g=i?i(t):t.tc||e.textfont.color;o.call(_.font,t.tf||e.textfont.family,y,g).text(u).call(h.convertToTspans,r).call(C,m,y,t.mrc)}else o.remove()}))}},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);u.fill(a,i),C(a,o,s,t.mrc2||t.mrc)}))}};function I(t,e,r,a){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,.25),c=Math.pow(s*s+l*l,.25),p=(c*c*i-u*u*s)*a,h=(c*c*o-u*u*l)*a,f=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(f&&p/f),2),n.round(e[1]+(f&&h/f),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&h/d),2)]]}_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(_.savedBBoxes={},D=0),r&&(_.savedBBoxes[r]=y),D++,a.extendFlat({},y)},_.setClipUrl=function(t,e,r){t.attr("clip-path",O(e,r))},_.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},_.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=p(e,r)).trim(),t[a]("transform",i),i},_.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},_.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var R=/\s*sc.*/;_.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(F);t=1===e&&1===r?[]:[p(o,s),"scale("+e+","+r+")",p(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":150,"../../constants/alignment":219,"../../constants/interactions":223,"../../constants/xmlns_namespaces":225,"../../lib":246,"../../lib/svg_text_utils":269,"../../registry":338,"../../traces/scatter/make_bubble_size_func":386,"../../traces/scatter/subtypes":394,"../color":114,"../colorscale":126,"./symbol_defs":137,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:79}],137:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":12}],138:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],139:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),p=0;p0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,t),y.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,u);if(!m||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var p=d.width;i="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(i+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(f.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(f.copy_ystyle?d:f).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":394,"../drawing":136,"@plotly/d3":12,"fast-isnumeric":28}],144:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":114,"@plotly/d3":12}],145:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":238,"../../plots/font_attributes":322,"./layout_attributes":155}],146:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||it<0||it>b[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+x[0]._offset,e.pointerY=it+b[0]._offset,B="xval"in e?g.flat(s,e.xval):g.p2c(x,at),V="yval"in e?g.flat(s,e.yval):g.p2c(b,it),!a(B[0])||!a(V[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(H=0;H$&&(tt.splice(0,$),ut=tt[0].distance),m&&0!==D&&0===tt.length){Q.distance=D,Q.index=!1;var p=G._module.hoverPoints(Q,J,K,"closest",{hoverLayer:l._hoverlayer});if(p&&(p=p.filter((function(t){return t.spikeDistance<=D}))),p&&p.length){var h,d=p.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var y=d[0];a(y.x0)&&a(y.y0)&&(h=ht(y),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var v=p.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var _=v[0];a(_.x0)&&a(_.y0)&&(h=ht(_),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function pt(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)It(tt[At]);tt=St,yt()}var Pt=t._hoverdata,Et=[],Dt=j(t),zt=U(t);for(q=0;q1||tt.length>1)||"closest"===S&&nt&&tt.length>1,Yt=f.combine(l.plot_bgcolor||f.background,l.paper_bgcolor),Xt=E(tt,{gd:t,hovermode:S,rotateLabels:Gt,bgColor:Yt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});g.isUnifiedHover(S)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(p=-1),f[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=a;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(i=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=i;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var b=x[s],w=b.datum;w.offset=b.dp,w.del=b.del}}}(Xt,Gt?"xa":"ya",l),z(Xt,Gt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Wt=y.getComponentMethod("annotations","hasClickToShow")(t,Et);p(n.select(e.target),Wt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:b,xvals:B,yvals:V})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=E(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),p=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,_=g.offsetTop;c+=v,p+=v,h+=_,d+=_}u.bbox={x0:c+o,x1:p+o,y0:h+i,y1:d+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||f.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function E(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,p=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{},T=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,M=t[0],C=M.xa,L=M.ya,P=i.charAt(0),E=M[P+"Label"],z=V(r,m),O=z.top,R=z.width,F=z.height,B=void 0!==E&&M.distance<=e.hoverdistance&&("x"===i||"y"===i);if(B){var N,j,U=!0;for(N=0;Na.width-x?(y=a.width-x,e.attr("d","M"+(x-A)+",0L"+x+","+_+A+"v"+_+(2*S+v.height)+"H-"+x+"V"+_+A+"H"+(x-2*A)+"Z")):e.attr("d","M0,0L"+A+","+_+A+"H"+(S+v.width/2)+"v"+_+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+_+A+"H-"+A+"Z")}else{var b,I,P;"right"===L.side?(b="start",I=1,P="",y=C._offset+C._length):(b="end",I=-1,P="-",y=C._offset),g=L._offset+(M.y0+M.y1)/2,l.attr("text-anchor",b),e.attr("d","M0,0L"+P+A+","+A+"V"+(S+v.height/2)+"h"+P+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+P+A+"V-"+A+"Z");var D,z=v.height/2,R=O-v.top-z,F="clip"+a._uid+"commonlabel"+L._id;if(y=0?at:it+lt=0?it:yt+lt=0?rt:nt+ut=0?nt:gt+ut=0,"top"!==t.idealAlign&&Z||!G?Z?(z+=j/2,t.anchor="start"):t.anchor="middle":(z-=j/2,t.anchor="end");else if(t.pos=z,Z=P+N/2+Y<=R,G=P-N/2-Y>=0,"left"!==t.idealAlign&&Z||!G)if(Z)P+=N/2,t.anchor="start";else{t.anchor="middle";var X=Y/2,W=P+X-R,J=P-X;W>0&&(P-=W),J<0&&(P+=-J)}else P-=N/2,t.anchor="end";w.attr("text-anchor",t.anchor),C&&M.attr("text-anchor",t.anchor),e.attr("transform",s(P,z)+(u?l(b):""))})),vt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var p=t.hovertemplate||!1;if(p){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(p,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],p=u*(A+S),f=p+u*(t.txwidth+S),d=0,m=t.offset,y="middle"===s;y&&(p-=t.tx2width/2,f+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",y?"M-"+i(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*A+d)+"V"+o(m-A)+"Z");var g=d+p,v=m+t.ty0-t.by/2+S,_=t.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==s?(a.attr("text-anchor","start"),g=y?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===_&&"end"!==s&&(a.attr("text-anchor","end"),g=y?t.bx/2-t.tx2width/2-S:t.bx+S)),a.call(c.positionText,i(g),o(v)),t.tx2width&&(r.select("text.name").call(c.positionText,i(f+u*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,i(f+(u-1)*t.tx2width/2+d),o(m-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||c){var d=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var _,x,b=i.readability(v.color,d)<1.5?f.contrast(d):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,M=m.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=M,x=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),_=l.l+A*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(p){var C,L,I=e.vLinePoint;n=I&&I.xa,a=I&&I.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+I.x,L=a._offset+I.y);var P,E,D=i.readability(I.color,d)<1.5?f.contrast(d):I.color,z=n.spikemode,O=n.spikethickness,R=n.spikecolor||D,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,E=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,E=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.x,i=n.y,s=a+n.width,l=i+n.height,u=o.apply3DTransform(r._invTransform)(a,i),c=o.apply3DTransform(r._invTransform)(s,l),p=u[0],h=u[1],f=c[0],d=c[1];return{x:p,y:h,width:f-p,height:d-h,top:Math.min(h,d),left:Math.min(p,f),right:Math.max(p,f),bottom:Math.max(h,d)}}},{"../../lib":246,"../../lib/events":237,"../../lib/override_cursor":257,"../../lib/svg_text_utils":269,"../../plots/cartesian/axes":293,"../../registry":338,"../color":114,"../dragelement":133,"../drawing":136,"../legend/defaults":166,"../legend/draw":167,"./constants":148,"./helpers":150,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:79}],152:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":246,"../color":114,"./helpers":150}],153:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":246,"./layout_attributes":155}],154:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":246,"../dragelement":133,"./attributes":145,"./calc":146,"./click":147,"./constants":148,"./defaults":149,"./helpers":150,"./hover":151,"./layout_attributes":155,"./layout_defaults":156,"./layout_global_defaults":157,"@plotly/d3":12}],155:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":322,"./constants":148}],156:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":246,"./hoverlabel_defaults":152,"./hovermode_defaults":153,"./layout_attributes":155}],157:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":246,"./hoverlabel_defaults":152,"./layout_attributes":155}],158:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),p=c*(1-o),h=0;h1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);y._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1!==m||u.uirevision){var y=i.newContainer(e,"legend");if(T("uirevision",e.uirevision),!1!==m){T("bgcolor",e.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,_,x=a.coerceFont(T,"font",e.font),b="h"===T("orientation");if(b?(g=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,_="bottom"):(v=-.1,_="top")):(g=1.02,v=1,_="auto"),T("traceorder",h),l.isGrouped(e.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",_),T("valign"),a.noneOrAll(u,y,["x","y"]),T("title.text")){T("title.side",b?"left":"top");var w=a.extendFlat({},x,{size:a.bigFont(x.size)});a.coerceFont(T,"title.font",w)}}}function T(t,e){return a.coerce(u,y,o,t,e)}}},{"../../lib":246,"../../plot_api/plot_template":282,"../../plots/layout_attributes":326,"../../registry":338,"./attributes":164,"./helpers":170}],167:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var m=a.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(u.font,i).text(h?T(n,d):n);var y=r.itemwidth+2*f.itemGap;p.positionText(m,y,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(M,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),p=c[c.length-1],h=a.keyedContainer(i,"transforms["+p+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):M(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}})))}function M(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,d=s.size*m;if(o){var y=u.bBox(o);c=y.height,h=y.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var g=t.select(1===n?".legendtitletext":".legendtext"),v=p.lineCount(g),_=g.node();if(c=d*v,h=_?u.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),p.positionText(g,l+f.titlePad,l+d);else{var x=2*f.itemGap+r.itemwidth;a.groupTitle&&(x=f.itemGap,h-=r.itemwidth),p.positionText(g,x,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=d,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function A(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function S(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,p=t._fullLayout,h="legend"+p._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=p._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=p.showlegend&&v(t.calcdata,e)}var m=p.hiddenlabels||[];if(!(d||p.showlegend&&s.length))return r.selectAll(".legend").remove(),p._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var T=a.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),C=a.ensureSingleById(p._topdefs,"clipPath",h,(function(t){t.append("rect")})),L=a.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var I=a.ensureSingle(T,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var E=a.ensureSingle(I,"text","legendtitletext");E.attr("text-anchor","start").call(u.font,P.font).text(P.text),M(E,I,t,e,1)}else I.selectAll(".legendtitletext").remove();var D=a.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),z=I.selectAll("g.groups").data(s);z.enter().append("g").attr("class","groups"),z.exit().remove();var O=z.selectAll("g.traces").data(a.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(_,t,e).each((function(){d||n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,p=2*c,h=f.itemGap,d=a.itemwidth+2*h,m=2*(c+h),y=S(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,_=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var b=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+w[0],c+w[1]+a._height+e/2+h),a._height+=e,a._width=Math.max(a._width,t[0].width)})),b=d+a._width,a._width+=h+d+p,a._height+=m,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),k=a.x<0||0===a.x&&"right"===T,M=a.x>1||1===a.x&&"left"===T,C=v||g,L=i.width/2;a._maxWidth=Math.max(k?C&&"left"===T?o.l+o.w:L:M?C&&"right"===T?o.r+o.w:L:o.w,2*d);var I=0,P=0;r.each((function(t){var e=t[0].width+d;I=Math.max(I,e),P+=e})),b=null;var E=0;if(l){var D=0,z=0,O=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,w[0],w[1]+c+h+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),D=Math.max(D,e);var r=t+h;r+c+z>a._maxWidth&&(E=Math.max(E,z),z=0,O+=D+_,D=e),u.setTranslate(this,z,O),z+=r})),a._width=Math.max(E,z)+c,a._height=O+D+m}else{var R=r.size(),F=P+p+(R-1)*h=a._maxWidth&&(E=Math.max(E,U),N=0,j+=B,a._height+=B,B=0),u.setTranslate(this,w[0]+c+N,w[1]+c+j+e/2+h),U=N+r+h,N+=n,B=Math.max(B,e)})),F?(a._width=N+p,a._height=B+m):(a._width=Math.max(E,U)+p,a._height+=B+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(c+f.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(c+f.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=t._context.edits,q=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=q?d:b||d+t[0].width;s||(a+=h/2),u.setRect(e,0,-r/2,a,r)}))}(t,z,O,e)},function(){if(d||!function(t){var e=t._fullLayout.legend,r=A(e),n=S(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t)){var s,c,m,v,_=p._size,x=e.borderwidth,w=_.l+_.w*e.x-y[A(e)]*e._width,k=_.t+_.h*(1-e.y)-y[S(e)]*e._effHeight;if(!d&&p.margin.autoexpand){var M=w,P=k;w=a.constrain(w,0,p.width-e._width),k=a.constrain(k,0,p.height-e._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==P&&a.log("Constrain legend.y to make legend fit inside graph")}if(d||u.setTranslate(T,w,k),D.on(".drag",null),T.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var E=e._effHeight;d&&(E=e._height),L.attr({width:e._width-x,height:E-x,x:x/2,y:x/2}),u.setTranslate(I,0,0),C.select("rect").attr({width:e._width-2*x,height:E-2*x,x:x,y:x}),u.setClipUrl(I,h,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var z,O,R,F=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*f.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);L.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),C.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(I,h,t),H(U,F,j),T.on("wheel",(function(){H(U=a.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,N)}(R,z,O),F,j))}));D.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,H(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,N)}(R,z,O),F,j))}));I.call(q)}if(t._context.edits.legendPosition)T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=u.getTranslate(T);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,a=v+r;u.setTranslate(T,n,a),s=l.align(n,0,_.l,_.l+_.w,e.xanchor),c=l.align(a,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&b(t,T,a,e,n)}})}function H(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(I,0,-r),u.setRect(D,e._width,f.scrollBarMargin+r*a,f.scrollBarWidth,n),C.select("rect").attr("y",x+r)}}],t)}(t,e)}},{"../../constants/alignment":219,"../../lib":246,"../../lib/events":237,"../../lib/svg_text_utils":269,"../../plots/plots":335,"../../registry":338,"../color":114,"../dragelement":133,"../drawing":136,"./constants":165,"./get_legend_data":168,"./handle_click":169,"./helpers":170,"./style":172,"@plotly/d3":12}],168:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],p=!1,h={},f=0,d=0;function m(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),p=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+f;c.push(n),u[n]=[r],f++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,_=r.itemwidth,x=(_+2*f.itemGap)/2,b=o(x,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return v?n:Math.min(a,r)};function T(t,i,o){var c=t[0].trace,p=c.marker||{},h=p.line||{},f=o?c.visible&&c.type===o:a.traceIs(c,"bar"),d=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(f?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),d.exit().remove(),d.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,p.line,5,2);a.style("stroke-width",o+"px");var f=i.mcc;if(!r._inHover&&"mc"in i){var d=u(p),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),f=s.tryColorscale(p,"")(m)}var g=f||i.mc||p.color,v=p.pattern,_=v&&s.getPatternAttr(v.shape,0,"");if(_){var x=s.getPatternAttr(v.bgcolor,0,null),b=s.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=y(v.size,8,10),M=y(v.solidity,.5,1),A="legend-"+c.uid;a.call(s.pattern,"legend",e,A,_,k,M,f,v.fillmode,x,b,T)}else a.call(l.fill,g);o&&l.stroke(a,i.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),u.exit().remove(),u.size()){var c=(s.marker||{}).line,f=w(h(c.width,o.pts),c,5,2),d=i.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=c.color;var m=i.minExtend(o,{trace:d});p(u,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=a.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,p=n.select(this),h=u(a),f=h.colorscale,m=h.reversescale;if(f){if(!r){var y=f.length;c=0===o?f[m?y-1:0][1]:1===o?f[m?0:y-1][1]:f[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}p.attr("d",t[0]),c?p.call(l.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,d(m,"radial"===r),f,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,T(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,a,o=m(t),l=o.showFill,p=o.showLine,h=o.showGradientLine,f=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=t[0],x=v.trace,b=u(x),T=b.colorscale,k=b.reversescale,M=c.hasMarkers(x)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||f?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+_+"v6h-"+_+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+x.uid;s.gradient(t,e,r,d(k),T,"fill")}}),p||h){var C=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:C}}),r=[i.minExtend(v,{trace:a})]}var L=A.select(".legendlines").selectAll("path").data(p||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(h?"l"+_+",0.0001":"h"+_)).call(p?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,a,o=m(t),l=o.anyFill,u=o.anyLine,p=o.showLine,h=o.showMarker,f=t[0],d=f.trace,y=!h&&!u&&!l&&c.hasText(d);function g(t,e,r,n){var a=i.nestedProperty(d,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function _(t){return f._distinct&&f.index&&t[f.index]?t[f.index]:t[0]}if(h||y||p){var x={},w={};if(h){x.mc=g("marker.color",_),x.mx=g("marker.symbol",_),x.mo=g("marker.opacity",i.mean,[.2,1]),x.mlc=g("marker.line.color",_),x.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);x.ms=T,w.marker.size=T}p&&(w.line={width:g("line.width",_,[0,10],5)}),y&&(x.tx="Aa",x.tp=g("textposition",_),x.ts=10,x.tc=g("textfont.color",_),x.tf=g("textfont.family",_)),r=[i.minExtend(f,x)],(a=i.minExtend(d,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(h?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),M.exit().remove(),M.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),A.exit().remove(),A.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":246,"../../registry":338,"../../traces/pie/helpers":366,"../../traces/pie/style_one":367,"../../traces/scatter/subtypes":394,"../color":114,"../colorscale/helpers":125,"../drawing":136,"./constants":165,"@plotly/d3":12}],173:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":175}],174:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(a=0;a1?(P=["toggleHover"],E=["resetViews"]):g?(I=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],E=["resetGeo"]):y?(P=["hoverClosest3d"],E=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(I=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],E=["resetViewMapbox"]):x?P=["hoverClosestGl2d"]:v?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],E=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lf&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;ov?(k=p,C="y0",M=v,L="y1"):(k=v,C="y1",M=p,L="y0");W(n),Q(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===D?J:K,X.altKey=n.altKey},doneFn:function(){if(g(t))return;f(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(g(t))return;$(s)}};function W(r){if(g(t))D=null;else if(R)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";f(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=Z(_+n)):(o=function(t){return Z(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(H(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else z?B("xanchor",r.xanchor=Z(_+n)):(B("x0",r.x0=Z(u+n)),B("x1",r.x1=Z(y+n))),O?B("yanchor",r.yanchor=G(T+a)):(B("y0",r.y0=G(p+a)),B("y1",r.y1=G(v+a)));e.attr("d",b(t,r)),Q(s,r)}function K(n,a){if(F){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=Z(_+n)):(o=function(t){return Z(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(H(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else if(R){if("resize-over-start-point"===D){var c=u+n,h=O?p-a:p+a;B("x0",r.x0=z?c:Z(c)),B("y0",r.y0=O?h:G(h))}else if("resize-over-end-point"===D){var f=y+n,d=O?v-a:v+a;B("x1",r.x1=z?f:Z(f)),B("y1",r.y1=O?d:G(d))}}else{var g=function(t){return-1!==D.indexOf(t)},x=g("n"),j=g("s"),V=g("w"),Y=g("e"),X=x?k+a:k,W=j?M+a:M,J=V?A+n:A,K=Y?S+n:S;O&&(x&&(X=k-a),j&&(W=M-a)),(!O&&W-X>10||O&&X-W>10)&&(B(C,r[C]=O?X:G(X)),B(L,r[L]=O?W:G(W))),K-J>10&&(B(I,r[I]=z?J:Z(J)),B(P,r[P]=z?K:Z(K)))}e.attr("d",b(t,r)),Q(s,r)}function Q(t,e){(z||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=q(z?e.xanchor:a.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=H(O?e.yanchor:a.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&O){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),Y.node().onmousemove=W}(t,z,l,e,r,D):!0===l.editable&&z.style("pointer-events",P||u.opacity(S)*A<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!v(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,y(t)}}(t,z)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function b(t,e){var r,n,o,s,l,u,c,p,h=e.type,f=i.getRefType(e.xref),y=i.getRefType(e.yref),g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),_=t._fullLayout._size;if(g?"domain"===f?n=function(t){return g._offset+g._length*t}:(r=m.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return _.l+_.w*t},v?"domain"===y?s=function(t){return v._offset+v._length*(1-t)}:(o=m.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return _.t+_.h*(1-t)},"path"===h)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,u=t.charAt(0),c=d.paramIsX[u],p=d.paramIsY[u],h=d.numParams[u],f=t.substr(1).replace(d.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):p[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(f=f.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+f}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,p=b-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+p;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var w=(l+u)/2,T=(c+p)/2,k=Math.abs(w-l),M=Math.abs(T-c),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){v(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:_,eraseActiveShape:function(t){if(!v(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&p(g),r.attr("d",m(e)),M&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,v(),_())}}()}}function E(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*p.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+p.stepInset+(r.inputAreaLength-2*p.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-p.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*p.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",p.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,p.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*p.railInset,a=s.ensureSingle(t,"rect",p.railRectClass);a.attr({width:n,height:p.railWidth,rx:p.railRadius,ry:p.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,p.railInset,.5*(r.inputAreaWidth-p.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[p.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,y(e))}if(i.enter().append("g").classed(p.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+p.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+p.groupClassName).data(r,g);l.enter().append("g").classed(p.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var g={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(g[0],g[1]))}}}return O.call(R),D&&(C?O.on(".opacity",null):(M=0,A=!0,O.text(v).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)}))),O.call(p.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?o.call("_guiRestyle",t,g,e,_):o.call("_guiRelayout",t,g,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(p.positionText,b.x,b.y)}))),O.classed("js-placeholder",A),T}}},{"../../constants/alignment":219,"../../constants/interactions":223,"../../lib":246,"../../lib/svg_text_utils":269,"../../plots/plots":335,"../../registry":338,"../color":114,"../drawing":136,"@plotly/d3":12,"fast-isnumeric":28}],213:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:u,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":238,"../../plot_api/edit_types":275,"../../plot_api/plot_template":282,"../../plots/font_attributes":322,"../../plots/pad_attributes":334,"../color/attributes":113}],214:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],215:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":246,"../../plots/array_container_defaults":288,"./attributes":213,"./constants":214}],216:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(a.attr(p.menuIndexAttrName,"-1"),y(t,n,a,i,e),s||g(t,n,a,i,e))}function y(t,e,r,n,a){var i=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||p.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};i.call(v,a,c,t).call(A,a,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(p.arrowSymbol[a.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+a.pad.l,y:l.headerHeight/2+p.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),g(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(A,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,f=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,C=y+g;C+A>u&&(C=u-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>T,P=s.barWidth+2*s.barPad,E=s.barLength+2*s.barPad,D=d+m,z=y;D+P>l&&(D=l-P);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),I?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:z,width:P,height:E}),this._vbarYMin=z+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=I?p+P+.5:p+.5,N=h-.5,j=k?f+A+.5:f+.5,U=o._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":246,"../color":114,"../drawing":136,"@plotly/d3":12}],219:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],220:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],221:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],222:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],223:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],224:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],225:[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}},{}],226:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],228:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],229:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function p(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}m?(c=0,p=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return p(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return p(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return p(t,e,r,n,a,i,1)}}},{"./mod":253}],230:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(p(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var I;k=Number(k);try{var P=y.getComponentMethod("calendars","getCal")(e);if(w){var E="i"===M.charAt(M.length-1);M=parseInt(M,10),I=P.newDate(k,P.toMonthIndex(k,M,E),A)}else I=P.newDate(k,Number(M),A)}catch(t){return c}return I?(I.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,S,C));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?c:D.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,M=5*f;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+p&&t<=a-p))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,C=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function I(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return L[r("%q")(a)]})),b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=b(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+I(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return I(e,t,n,a)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var a=Math.round(t/p)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=h.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(h.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,p=n-e,h=o-a,f=u-i,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,a-t,i-e),l(c,p,d,o-t,u-e),l(h,f,m,t-a,e-i),l(h,f,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p0?f=a:h=a,p++}return i}},{"./mod":253}],244:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],245:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],246:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,p=e.exports={};p.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};p.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,p.warn('encountered bad format: "'+e+'"'))},p.noFormat=function(t){return String(t)},p.numberFormat=function(t){var e;try{e=i(p.adjustFormat(t))}catch(e){return p.warnBadFormat(t),p.noFormat}return e},p.nestedProperty=t("./nested_property"),p.keyedContainer=t("./keyed_container"),p.relativeAttr=t("./relative_attr"),p.isPlainObject=t("./is_plain_object"),p.toLogRange=t("./to_log_range"),p.relinkPrivateKeys=t("./relink_private");var f=t("./array");p.isTypedArray=f.isTypedArray,p.isArrayOrTypedArray=f.isArrayOrTypedArray,p.isArray1D=f.isArray1D,p.ensureArray=f.ensureArray,p.concat=f.concat,p.maxRowLength=f.maxRowLength,p.minRowLength=f.minRowLength;var d=t("./mod");p.mod=d.mod,p.modHalf=d.modHalf;var m=t("./coerce");p.valObjectMeta=m.valObjectMeta,p.coerce=m.coerce,p.coerce2=m.coerce2,p.coerceFont=m.coerceFont,p.coercePattern=m.coercePattern,p.coerceHoverinfo=m.coerceHoverinfo,p.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,p.validate=m.validate;var y=t("./dates");p.dateTime2ms=y.dateTime2ms,p.isDateTime=y.isDateTime,p.ms2DateTime=y.ms2DateTime,p.ms2DateTimeLocal=y.ms2DateTimeLocal,p.cleanDate=y.cleanDate,p.isJSDate=y.isJSDate,p.formatDate=y.formatDate,p.incrementMonth=y.incrementMonth,p.dateTick0=y.dateTick0,p.dfltRange=y.dfltRange,p.findExactDates=y.findExactDates,p.MIN_MS=y.MIN_MS,p.MAX_MS=y.MAX_MS;var g=t("./search");p.findBin=g.findBin,p.sorterAsc=g.sorterAsc,p.sorterDes=g.sorterDes,p.distinctVals=g.distinctVals,p.roundUp=g.roundUp,p.sort=g.sort,p.findIndexOfMin=g.findIndexOfMin,p.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");p.aggNums=v.aggNums,p.len=v.len,p.mean=v.mean,p.median=v.median,p.midRange=v.midRange,p.variance=v.variance,p.stdev=v.stdev,p.interp=v.interp;var _=t("./matrix");p.init2dArray=_.init2dArray,p.transposeRagged=_.transposeRagged,p.dot=_.dot,p.translationMatrix=_.translationMatrix,p.rotationMatrix=_.rotationMatrix,p.rotationXYMatrix=_.rotationXYMatrix,p.apply3DTransform=_.apply3DTransform,p.apply2DTransform=_.apply2DTransform,p.apply2DTransform2=_.apply2DTransform2,p.convertCssMatrix=_.convertCssMatrix,p.inverseTransformMatrix=_.inverseTransformMatrix;var x=t("./angles");p.deg2rad=x.deg2rad,p.rad2deg=x.rad2deg,p.angleDelta=x.angleDelta,p.angleDist=x.angleDist,p.isFullCircle=x.isFullCircle,p.isAngleInsideSector=x.isAngleInsideSector,p.isPtInsideSector=x.isPtInsideSector,p.pathArc=x.pathArc,p.pathSector=x.pathSector,p.pathAnnulus=x.pathAnnulus;var b=t("./anchor_utils");p.isLeftAnchor=b.isLeftAnchor,p.isCenterAnchor=b.isCenterAnchor,p.isRightAnchor=b.isRightAnchor,p.isTopAnchor=b.isTopAnchor,p.isMiddleAnchor=b.isMiddleAnchor,p.isBottomAnchor=b.isBottomAnchor;var w=t("./geometry2d");p.segmentsIntersect=w.segmentsIntersect,p.segmentDistance=w.segmentDistance,p.getTextLocation=w.getTextLocation,p.clearLocationCache=w.clearLocationCache,p.getVisibleSegment=w.getVisibleSegment,p.findPointOnPath=w.findPointOnPath;var T=t("./extend");p.extendFlat=T.extendFlat,p.extendDeep=T.extendDeep,p.extendDeepAll=T.extendDeepAll,p.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");p.log=k.log,p.warn=k.warn,p.error=k.error;var M=t("./regex");p.counterRegex=M.counter;var A=t("./throttle");p.throttle=A.throttle,p.throttleDone=A.done,p.clearThrottle=A.clear;var S=t("./dom");function C(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},p.noop=t("./noop"),p.identity=t("./identity"),p.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},p.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},p.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(p.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},p.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},p.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},p.syncOrAsync=function(t,e,r){var n;function a(){return p.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},p.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},p.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},p.fillArray=function(t,e,r,n){if(n=n||p.identity,p.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},p.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;p.templateString=function(t,e){var r={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,n){var a;return z.test(n)?a=e[n]:(r[n]=r[n]||p.nestedProperty(e,n).get,a=r[n]()),p.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};p.hovertemplateString=function(){return B.apply(O,arguments)};var R={max:10,count:0,name:"texttemplate"};p.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,f="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,y="xother"===s||"yother"===s||f||m||d,g=s;if((f||d)&&(g=g.substring(1)),(m||d)&&(g=g.substring(0,g.length-1)),y){if(void 0===(u=e[g]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var N=2e9;p.seedPseudoRandom=function(){N=2e9},p.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?p.pseudoRandom():N/4294967296},p.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=p.extractOption(t,e,"htx","hovertext");if(p.isValidTextValue(a))return n(a);var i=p.extractOption(t,e,"tx","text");return p.isValidTextValue(i)?n(i):void 0},p.isValidTextValue=function(t){return t||0===t},p.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,p.strTranslate(a-u*(r+o),i-u*(n+s))+p.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},p.ensureUniformFontSize=function(t,e){var r=p.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},p.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},p.bigFont=function(t){return Math.round(1.2*t)};var j=p.getFirefoxVersion(),U=null!==j&&j<86;p.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":224,"./anchor_utils":228,"./angles":229,"./array":230,"./clean_number":231,"./clear_responsive":233,"./coerce":234,"./dates":235,"./dom":236,"./extend":238,"./filter_unique":239,"./filter_visible":240,"./geometry2d":243,"./identity":244,"./increment":245,"./is_plain_object":247,"./keyed_container":248,"./localize":249,"./loggers":250,"./make_trace_groups":251,"./matrix":252,"./mod":253,"./nested_property":254,"./noop":255,"./notifier":256,"./preserve_drawing_buffer":259,"./push_unique":260,"./regex":262,"./relative_attr":263,"./relink_private":264,"./search":265,"./sort_object_keys":267,"./stats":268,"./throttle":270,"./to_log_range":271,"@plotly/d3":12,"d3-format":24,"d3-time-format":25,"fast-isnumeric":28}],247:[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).hasOwnProperty("hasOwnProperty")}},{}],248:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":280,"./notifier":256}],251:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":12}],252:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],254:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;cMath.max(p,y)||u>Math.max(h,g)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":224,"./matrix":252}],259:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":28,"is-mobile":62}],260:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&a.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],p=c-a;void 0===a?(l.push(c),a=c):p>s&&(i=Math.min(i,p),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":230,"fast-isnumeric":28}],269:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(u),I=n.select(t.node().parentNode);if(!I.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(p,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,a,o){I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return E(),void e();var u=I.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",p=s.select("g");p.attr({fill:c,stroke:c});var h=l(p,"width"),f=l(p,"height"),d=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=-(r||l(t,"height"))/4;"y"===P[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-h/2,y-f/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:y-f/2}):"a"===P[0]&&0!==P.indexOf("atitle")?s.attr({x:0,y:y}):s.attr({x:d,y:+t.attr("y")+y-f/2}),m&&m.call(t,u),e(u)}))}))):E(),t}function E(){I.empty()||(P=t.attr("class")+"-math",I.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(y," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(g),I=0;I|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(g),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,d-a)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?e:""}function I(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(y," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(g),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],271:[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":28}],272:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],273:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],274:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],I=c(g,p).get(),P=[],E=-1,D=L.length;for(_=0;_L.length-(M?0:1))i.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?P.push(b):M?("add"===k&&(k={}),L.splice(b,0,k),I&&I.splice(b,0,{})):i.warn("Unrecognized full object edit value",p,b,k),-1===E&&(E=b);else for(x=0;x=0;_--)L.splice(P[_],1),I&&I.splice(P[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(y,g),d!==a){var z;if(-1===E)z=S;else{for(D=Math.max(L.length,D),z=[],_=0;_=E);_++)z.push(b);for(_=E;_=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in P(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),b.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=Y(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(h.rehover,h.redrag),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=f.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[f.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=f.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return f.draw(t,r,{skipTitle:n})}:function(t){return f.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=F(l._preGUI,u),d=Object.keys(e),m=f.list(t),y=o.extendDeepAll({},e),g={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[O];)O--;var B=D.parts[O],N=D.parts[O-1]+"."+B,U=D.parts.slice(0,O).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),Y=D.get();if(void 0!==z){A[E]=z,S[E]="reverse"===B?z:R(Y);var W=p.getLayoutValObject(l,D.parts);if(W&&W.impliedEdits&&null!==z)for(var J in W.impliedEdits)C(o.relativeAttr(E,J),W.impliedEdits[J]);if(-1!==["width","height"].indexOf(E))if(z){C("autosize",null);var K="height"===E?"width":"height";C(K,l[K])}else l[E]=t._initialAutoSize[E];else if("autosize"===E)C("width",z?null:l.width),C("height",z?null:l.height);else if(N.match(H))P(N),s(l,U+"._inputRange").set(null);else if(N.match(Z)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(G)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===q.type&&"log"===z,tt="log"===q.type&&"linear"===z;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,z,C),c.getComponentMethod("images","convertCoords")(t,q,z,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,E).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,C),c.getComponentMethod("images","convertCoords")(t,nt,at,C)}var it=x.containerArrayMatch(E);if(it){r=it.array,n=it.index;var ot=it.property,st=W||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(z)?S[E]=null:x.isRemoveVal(z)?S[E]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),g[r]||(g[r]={});var lt=g[r][n];lt||(lt=g[r][n]={}),lt[ot]=z,delete e[E]}else"reverse"===B?(V.range?V.range.reverse():(C(U+".autorange",!0),V.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===E&&("lasso"===z||"select"===z)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?M.plot=!0:W?T.update(M,W):M.calc=!0,D.set(z))}}for(r in g){x.applyContainerArrayChanges(t,h(i,r),g[r],M,h)||(M.plot=!0)}for(var ut in I){var ct=(L=f.getFromId(t,ut))&&L._constraintGroup;if(ct)for(var pt in M.calc=!0,ct)I[pt]||(f.getFromId(t,pt)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:I,undoit:S,redoit:A,eventData:y}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function W(t,e,n,a){t=o.getGraphDiv(t),b.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=b.coerceTraceIndices(t,a),s=N(t,o.extendFlat({},e),i),l=s.flags,c=Y(t,o.extendFlat({},n)),p=c.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&b.clearAxisTypes(t,i,n);var f=[];p.layoutReplot?f.push(w.layoutReplot):l.fullReplot?f.push(r._doPlot):(f.push(h.previousPromises),V(t,p,c)||h.supplyDefaults(t),l.style&&f.push(w.doTraceStyle),(l.colorbars||p.colorbars)&&f.push(w.doColorBars),p.legend&&f.push(w.doLegend),p.layoutstyle&&f.push(w.layoutStyles),p.axrange&&q(f,c.rangesAltered),p.ticks&&f.push(w.doTicksRelayout),p.modebar&&f.push(w.doModeBar),p.camera&&f.push(w.doCamera),f.push(A)),f.push(h.rehover,h.redrag),u.add(t,W,[t,s.undoit,c.undoit,s.traces],W,[t,s.redoit,c.redoit,s.traces]);var d=o.syncOrAsync(f,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,b.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(a)?y>=a.length?t.transitionOpts=a[y]:t.transitionOpts=a[0]:t.transitionOpts=a,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);v=M}}v.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,i];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function v(t){return t===Math.round(t)&&t>=0}function _(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var p=c.basePlotModule;p&&p.attributes&&(a=p.attributes[o])}a||(a=i[o])}return g(a,e,s)},r.getLayoutValObject=function(t,e){return g(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var a=p();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":246,"../plots/attributes":289}],283:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function _(t){var e,a,s,c,d,m,y=t._fullLayout,g=y._size,_=g.p,b=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._has("cartesian"))return i.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-_-n:e._offset+e._length+_+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=m(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&y(i)&&t(i,o)}}({data:f,layout:h},""),c.length)return c.map(g)}},{"../lib":246,"../plots/attributes":289,"../plots/plots":335,"./plot_config":280,"./plot_schema":281,"./plot_template":282}],285:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(p.format.values,", "," or ")+".");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),_=g("width"),x=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},h);_?M.width=_:null===e.width&&n(d.width)&&(M.width=d.width),x?M.height=x:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){a.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=i.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(k,r,M,A).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":246,"../plots/plots":335,"../snapshot/helpers":342,"../snapshot/svgtoimg":344,"../snapshot/tosvg":346,"../version":413,"./plot_api":279,"fast-isnumeric":28}],286:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var p=Object.keys(t),h=0;h_.length&&a.push(d("unused",i,g.concat(_.length)));var M,A,S,C,L,I=_.length,P=Array.isArray(k);if(P&&(I=Math.min(I,k.length)),2===x.dimensions)for(A=0;A_[A].length&&a.push(d("unused",i,g.concat(A,_[A].length)));var E=_[A].length;for(M=0;M<(P?Math.min(E,k[A].length):E);M++)S=P?k[A][M]:k,C=v[A][M],L=_[A][M],n.validate(C,S)?L!==C&&L!==+C&&a.push(d("dynamic",i,g.concat(A,M),C,L)):a.push(d("value",i,g.concat(A,M),C))}else a.push(d("array",i,g.concat(A),v[A]));else for(A=0;A1&&f.push(d("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(p)===p))return{vals:a};u=p}for(var h=e.calendar,f="start"===l,d="end"===l,m=t[r+"period0"],y=i(m,h)||0,g=[],v=[],_=[],x=a.length,b=0;bM;)k=o(k,-u,h);for(;k<=M;)k=o(k,u,h);T=o(k,-u,h)}else{for(k=y+(w=Math.round((M-y)/c))*c;k>M;)k-=c;for(;k<=M;)k+=c;T=k-c}g[b]=f?T:d?k:(T+k)/2,v[b]=T,_[b]=k}return{vals:g,starts:v,ends:_}}},{"../../constants/numerical":224,"../../lib":246,"fast-isnumeric":28}],291:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],292:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,p=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),u=m(t,e),c=u.min,p=u.max;if(0===c.length||0===p.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,y=p[0].val;for(r=1;r0&&((T=C-s(_)-l(x))>L?k/T>I&&(b=_,w=x,I=k/T):k/C>I&&(b={val:_.val,nopad:1},w={val:x.val,nopad:1},I=k/C));if(h===y){var P=h-1,E=h+1;if(A)if(0===h)a=[0,1];else{var D=(h>0?p:c).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,D/C));a=h>0?[0,z]:[z,0]}else a=S?[Math.max(0,P),Math.max(1,E)]:[P,E]}else A?(b.val>=0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(b.val-I*s(b)<0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),I=(w.val-b.val-f(e,_.val,x.val))/(C-s(b)-l(w)),a=[b.val-I*s(b),w.val+I*l(w)];return g&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!T){if(h=1/0,f=-1/0,w)for(n=0;n0&&(h=i),i>f&&i-o&&(h=i),i>f&&i=E;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],p=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function _(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":136,"../../constants/numerical":224,"../../lib":246,"../../registry":338,"./axis_ids":297,"@plotly/d3":12,"fast-isnumeric":28}],293:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),p=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,_=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,C=m.ONEHOUR,L=m.ONEMIN,I=m.ONESEC,P=m.MINUS_SIGN,E=m.BADNUM,D={K:"zeroline"},z={K:"gridline",L:"path"},O={K:"tick",L:"path"},R={K:"tick",L:"text"},F=t("../../constants/alignment"),B=F.MID_SHIFT,N=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var q=t("./axis_autotype"),H=t("./axis_ids"),Z=H.idSort,G=H.isLinked;V.id2name=H.id2name,V.name2id=H.name2id,V.cleanId=H.cleanId,V.list=H.list,V.listIds=H.listIds,V.getFromId=H.getFromId,V.getFromTrace=H.getFromTrace;var Y=t("./autorange");V.getAutoRange=Y.getAutoRange,V.findExtremes=Y.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=V.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,g,u,i)),y=v,0;y<=c;)y=V.tickIncrement(y,g,!1,i);return{start:e.c2r(v,0,i),end:e.c2r(y,0,i),size:g,_dataSpan:c-u}},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,V.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=V.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=C,o&&!n&&t.dticki&&p=o:f<=o;f=V.tickIncrement(f,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(f=c)break}if(L.length>m||f===I)break;I=f;var P=!1;p&&f!==(0|f)&&(P=!0),L.push({minor:P,value:f})}if(h&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),p=r||c,h=0;p>=v?h=c>=v&&c<=y?c:g:r===x&&p>=b?h=c>=b&&c<=_?c:x:p>=k?h=c>=k&&c<=w?c:T:r===M&&p>=M?h=M:p>=A?h=A:r===S&&p>=S?h=S:r===C&&p>=C&&(h=C),h>=c&&(h=c,s=!0);var f=a+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(a*(1-L)+L*f)!==E&&d++}(h*=d/84)||(t[n].drop=!0),s&&c>M&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(L,t,t._definedDelta),t.rangebreaks){var D="y"===t._id.charAt(0),z=1;"auto"===t.tickmode&&(z=t.tickfont?t.tickfont.size:12);var O=NaN;for(d=L.length-1;d>-1;d--)if(L[d].drop)L.splice(d,1);else{L[d].value=At(L[d].value,t);var R=t.c2p(L[d].value);(D?O>R-z:Oc||Bc&&(F.periodX=c),B10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&i<=10||e>=15*A)t._tickround="d";else if(e>=L&&i<=16||e>=C)t._tickround="M";else if(e>=I&&i<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ct(t.exponentformat)&&!pt(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}V.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>g)e/=g,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(i>T)e/=T,t.dtick="M"+ot(e,1,tt);else if(i>A){t.dtick=ot(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=V.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>C?t.dtick=ot(e,C,tt):i>L?t.dtick=ot(e,L,et):i>I?t.dtick=ot(e,I,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Mt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},V.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?at:nt,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=ht(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||ct(f)&&pt(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":P)+h+"",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":P)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):Mt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ht(e.x,t,a,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":P+o:o};var ut=["f","p","n","\u03bc","m","","k","M","G","T"];function ct(t){return"SI"===t||"B"===t}function pt(t){return t>14||t<-15}function ht(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=V.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,P);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+f+"":"B"===l&&9===u?t+="B":ct(l)&&(t+=ut[u/3+5]));return i?P+t:t}function ft(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-p:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?p-r.top:0,h),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?p-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-p:0,h),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==u._dfltTitle[d]&&(n[l]+=yt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,_t(e),n),i.autoMargin(t,xt(e),a),i.autoMargin(t,bt(e),s)})),r.skipTitle||K&&"bottom"===e.side||W.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+yt(e);else{var s=St(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,p,f,d,m=V.getPxPosition(t,e);"x"===i?(p=e._offset+e._length/2,f="top"===e.side?m-r:m+r):(f=e._offset+e._length/2,p="right"===e.side?m+r:m-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var y=e._selections[e._id+"tick"];if(d={selection:y,side:e.side},y&&y.node()&&y.node().parentNode){var g=h.getTranslate(y.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:u,attributes:{x:p,y:f,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(W)}}function Q(t){var r=f+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=vt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},V.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,p=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*N,p+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,p+=3);s&&"top"===u&&(p-=h*(1-N));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(p=-p);return[l?c:0,s?p:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(dt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(dt(e)))}},V.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,p=i("inside"),h="inside"===n&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,d=0,m=h?t.ticklen:0;if(p?m*=-1:c&&(m=0),h&&(f+=m,r)){var y=s.deg2rad(r);f=m*Math.cos(y)+1,d=m*Math.sin(y)}t.showticklabels&&(h||t.showline)&&(f+=.2*t.tickfont.size);var g,v,_,x,b,w={labelStandoff:f+=(t.linewidth||1)/2*(p?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)x=(b=!p&&"bottom"===k||p&&"top"===k)?1:-1,p&&(x*=-1),g=d*x,v=e+f*x,_=b?1:-.2,90===Math.abs(A)&&(p?_+=B:_=-90===A&&"bottom"===k?N:90===A&&"top"===k?B:.5,T=B/2*(A/90)),w.xFn=function(t){return t.dx+g+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*_},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==p?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===M){if(x=(b=!p&&"left"===k||p&&"right"===k)?1:-1,p&&(x*=-1),g=f,v=d*x,_=0,p||90!==Math.abs(A)||(_=-90===A&&"left"===k||90===A&&"right"===k?N:.5),p){var S=a(A)?+A:0;if(0!==S){var C=s.deg2rad(S);T=Math.abs(Math.sin(C))*N*x,_=0}}w.xFn=function(t){return t.dx+e-(g+t.fontSize*_)*x+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*B},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},V.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],mt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(p.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),Ct(e,[O]),i.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&V.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sf||i.leftf||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},_(g,y+1?y:m);var x=null;e._selections&&(e._selections[p]=g);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&i._redrawFromAutoMarginCount&&90===y?(x=90,b.push((function(){_(g,y)}))):b.push((function(){if(_(g,m),f.length&&"x"===c&&!a(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=vt(this),o=h.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=f.length,l=Math.abs((f[o-1].x-f[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",p=function(t){return-1!==u.indexOf(t)},d=p("top"),y=p("left"),v=p("right"),b=p("bottom")||y||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var y="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=p(r),a=0,o=0,s={},c=0;c2*a}(a,y)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=v(o[l])){c=d;break}var p=a("pattern",c);if(p===d)for(l=0;l<2;l++)(u=v(o[l]))&&(e.bounds[l]=o[l]=u-1);if(p)for(l=0;l<2;l++)switch(u=o[l],p){case d:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case m:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":338,"./constants":300}],298:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function y(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*_)||T)for(r=0;rD&&FP&&(P=F);h/=(P-I)/(2*E),I=l.l2r(I),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:p.background,stroke:p.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,a,i)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){E&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),E=!1)}function Z(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function G(t,e,r,n,i){for(var o,s,l,u,c=!1,p={},h={},f=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(q(a),2!==t||gt||Ht(),yt)o.indexOf("select")>-1&&S(r,a,J,K,e.id,Pt),o.indexOf("event")>-1&&f.click(a,r,e.id);else if(1===t&>){var s=m?D:E,u="s"===m||"w"===g?0:1,p=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),d="left",y="middle";if(s.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===g&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:y}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,p,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ft*e+bt)),a=Math.max(0,Math.min(et,dt*r+wt)),i=Math.abs(n-bt),o=Math.abs(a-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,a),Tt.b=Math.max(wt,a),rt.isSubplotConstrained)i>P||o>P?(St="xy",i/tt>o/et?(o=i*et/tt,wt>a?Tt.t=wt-o:Tt.b=wt+o):(i=o*tt/et,bt>n?Tt.l=bt-i:Tt.r=bt+i),Lt.attr("d",Z(Tt))):s();else if(nt.isSubplotConstrained)if(i>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),u=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=u*tt,Tt.b=(1-l)*et,Tt.t=(1-u)*et,Lt.attr("d",Z(Tt))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cm[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":246,"fast-isnumeric":28}],312:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":219}],313:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,p=u.rectMode,h=u.drawMode,f=u.openMode,d=u.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),y=t("../../components/shapes/draw_newshape/helpers").handleEllipse,g=t("../../components/shapes/draw_newshape/newshapes"),v=t("../../lib"),_=t("../../lib/polygon"),x=t("../../lib/throttle"),b=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),M=k.MINSELECT,A=_.filter,S=_.tester,C=t("./handle_outline").clearSelect,L=t("./helpers"),I=L.p2r,P=L.axValue,E=L.getTransform;function D(t,e,r,n,a,i,o){var s,l,u,c,p,h,d,y,g,v=e._hoverdata,_=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){F(t,e,i);var b=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=j(b))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),h(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)L._fullLayout._deactivateShape(L);else if(!b){var r=z.clickmode;x.done(mt).then((function(){if(x.clear(mt),2===t){for(pt.remove(),$=0;$-1&&D(e,L,a.xaxes,a.yaxes,a.subplot,a,pt),"event"===r&&L.emit("plotly_selected",void 0);s.click(L,e)})).catch(v.error)}},a.doneFn=function(){dt.remove(),x.done(mt).then((function(){x.clear(mt),a.gd.emit("plotly_selected",et),Q&&a.selectionDefs&&(Q.subtract=ct,a.selectionDefs.push(Q),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,K)),a.doneFnCompleted&&a.doneFnCompleted(yt)})).catch(v.error),b&&B(a)}},clearSelect:C,clearSelectionsCache:B,selectOnClick:D}},{"../../components/color":114,"../../components/dragelement/helpers":132,"../../components/drawing":136,"../../components/fx":154,"../../components/fx/helpers":150,"../../components/shapes/draw_newshape/display_outlines":202,"../../components/shapes/draw_newshape/helpers":203,"../../components/shapes/draw_newshape/newshapes":204,"../../lib":246,"../../lib/clear_gl_canvases":232,"../../lib/polygon":258,"../../lib/throttle":270,"../../plot_api/subroutines":283,"../../registry":338,"./axis_ids":297,"./constants":300,"./handle_outline":304,"./helpers":305,polybooljs:69}],314:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,p=i.ensureNumber,h=i.isArrayOrTypedArray,f=t("../../constants/numerical"),d=f.FP_SAFE,m=f.BADNUM,y=f.LOG_CLIP,g=f.ONEWEEK,v=f.ONEDAY,_=f.ONEHOUR,x=f.ONEMIN,b=f.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function C(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],a=t.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function L(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function I(e,r,n){return u(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function E(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function O(t){return s(t)?+t:D(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===f;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var p=t._B[o]||0;return isFinite(p)?R(e,t._m2,p):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:p,t.l2c="log"===t.type?A:p,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(C(t,e))}:B,t.p2c="log"===t.type?function(t){return A(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=p,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=p):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=p,t.c2r=C,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=p):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=I,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return I(N(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=E,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=p,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:p(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=p,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:p(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var p=[[0,{}],[0,{}]],d=[];for(a=0;ad&&(o[n]=d),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),p="y"===f;if((p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(p?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function y(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=i.simpleMap(e.xr0,a.r2l),m=i.simpleMap(e.xr1,a.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),a.range[0]=a.l2r(d[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=i.simpleMap(e.yr0,l.r2l),_=i.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=a.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,M=h?f[1]:0,A=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=a._offset-A,L=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":136,"../../lib":246,"../../registry":338,"./axes":293,"@plotly/d3":12}],319:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var f=i(u),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;pOpenStreetMap contributors',i=['\xa9 Carto',a].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":267}],328:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(a){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(i){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":246}],329:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),a=t("../../lib"),i=a.strTranslate,o=a.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),u=t("@plotly/d3"),c=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),h=t("./mapbox"),f=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==f.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,i=e._subplots.mapbox;if(n.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(f.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,i);n.accessToken=o;for(var l=0;lb/2){var w=g.split("|").join("
");_.text(w).attr("data-unformatted",w).call(p.convertToTspans,t),x=c.bBox(_.node())}_.attr("transform",i(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;x.width+6>b&&(T=b/(x.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];v.attr("transform",i(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=p(o)?function(t,r){(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(u)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),f(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.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])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){x.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},x.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,p,n),x.cleanPlot(h,l,p,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=x.layoutAttributes.width.min,f=x.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,p=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(p),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,b=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:g,size:r.l+d},r:{val:v,size:r.r+d},b:{val:b,size:r.b+d},t:{val:_,size:r.t+d}},f[e]=1}else delete h[e],delete f[e];if(!n._replotting)return x.doAutoMargin(t)}},x.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),I(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,p=i.r,h=i.t,d=i.b,m=e._pushmargin,y=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:u},r:{val:1,size:p},t:{val:1,size:h},b:{val:0,size:d}},m){var _=m[v].l||{},b=m[v].b||{},w=_.val,T=_.size,k=b.val,M=b.size;for(var A in m){if(o(T)&&m[A].r){var S=m[A].r.val,C=m[A].r.size;if(S>w){var L=(T*S+(C-r)*w)/(S-w),P=(C*(1-w)+(T-r)*(1-S))/(S-w);L+P>u+p&&(u=L,p=P)}}if(o(M)&&m[A].t){var E=m[A].t.val,D=m[A].t.size;if(E>k){var z=(M*E+(D-n)*k)/(E-k),O=(D*(1-k)+(M-n)*(1-E))/(E-k);z+O>d+h&&(d=z,h=O)}}}}}var R=c.constrain(r-i.l-i.r,2,64),F=c.constrain(n-i.t-i.b,2,64),B=Math.max(0,r-R),N=Math.max(0,n-F);if(B){var j=(u+p)/B;j>1&&(u/=j,p/=j)}if(N){var U=(d+h)/N;U>1&&(d/=U,h/=U)}if(a.l=Math.round(u),a.r=Math.round(p),a.t=Math.round(h),a.b=Math.round(d),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=c.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(c.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!c.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return u(t,e)})):c.isTypedArray(t)?c.simpleMap(t,c.identity):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var p={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=u(s),a)){var h=s._size;p.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(p.frames=u(l)),i&&(p.config=u(t._context,!0)),"object"===n?p:JSON.stringify(p)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,u,p),a=0;a0){for(var n=[],a=0;a-1&&(p[f[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":114,"../components/drawing":136,"../constants/xmlns_namespaces":225,"../lib":246,"@plotly/d3":12}],347:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":113,"../../components/colorscale/attributes":121,"../../lib/extend":238,"../../plots/attributes":289,"../../plots/template_attributes":337,"../scattergeo/attributes":397}],348:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o),[t]}},{"../../lib":246,"../../plots/cartesian/axes":293,"./attributes":347}],351:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":327,"./convert":353}],357:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:a(),showlegend:s({},i.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":121,"../../lib/extend":238,"../../plots/attributes":289,"../../plots/template_attributes":337,"../scattermapbox/attributes":399}],358:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=a(u)&&u.length,p=0;p0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":327,"./convert":359}],365:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],366:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;rl&&I[g].gap;)g--;for(_=I[g].s,m=I.length-1;m>g;m--)I[m].s=_;for(;lA[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],376:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),p=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults");e.exports=function(t,e,r,y){function g(r,a){return n.coerce(t,e,i,r,a)}var v=l(t,e,y,g);if(v||(e.visible=!1),e.visible){u(t,e,y,g),g("xhoverformat"),g("yhoverformat");var _=c(t,e,y,g),x=!_&&v=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-d);return i=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(f.c2p(t.y)-m);return iY!=(N=z[E][1])>=Y&&(R=z[E-1][0],F=z[E][0],N-B&&(O=R+(F-R)*(Y-B)/(N-B),q=Math.min(q,O),H=Math.max(H,O)));q=Math.max(q,0),H=Math.min(H,h._length);var X=s.defaultLine;return s.opacity(p.fillcolor)?X=p.fillcolor:s.opacity((p.line||{}).color)&&(X=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:H,y0:Y,y1:Y,color:X,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":114,"../../components/fx":154,"../../lib":246,"../../registry":338,"./get_trace_color":379}],381:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":307,"./arrays_to_calcdata":368,"./attributes":369,"./calc":370,"./cross_trace_calc":374,"./cross_trace_defaults":375,"./defaults":376,"./format_labels":378,"./hover":380,"./marker_colorbar":387,"./plot":390,"./select":391,"./style":393,"./subtypes":394}],382:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":124,"../../components/colorscale/helpers":125,"../../lib":246}],383:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,i,h,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S=e.xaxis,C=e.yaxis,L="log"===S.type,I="log"===C.type,P=S._length,E=C._length,D=e.connectGaps,z=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,B=[],N=p.minTolerance,j=t.length,U=new Array(j),V=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(L&&(i=S.c2p(n.x,!0)),i===a)return!1;I&&l===a&&(i*=Math.abs(S._m*E*(S._m>0?o:s)/(C._m*P*(C._m>0?o:s)))),i*=1e3}if(l===a){if(I&&(l=C.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function H(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],a=r===U[V-1][1];if(!n||!a)if(V>1){var i=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&i?o?V--:U[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([W,J]),ut(t),K=null,W=J=0}function pt(t){if(M=t[0]/P,A=t[1]/E,Y=t[0]rt?rt:0,X=t[1]at?at:0,Y||X){if(V)if(K){var e=$(K,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else Q=$(U[V-1],t)[0],U[V++]=Q;else U[V++]=[Y||t[0],X||t[1]];var r=U[V-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(K&&(W!==Y&&J!==X?ut(W&&J?(n=K,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[W||Y,J||X]):W&&J&&ut([W,J])),ut([Y,X])):W-Y&&J-X&&ut([Y||W,X||J]),K=t,W=Y,J=X}else K&&ct($(K,t)[0]),U[V++]=t;var n,a,i,o}for("linear"===O||"spline"===O?$=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,t)Z(d,ht))break;i=d,(b=g[0]*y[0]+g[1]*y[1])>_?(_=b,h=d,m=!1):b=t.length||!d)break;pt(d),n=d}}else pt(h)}K&&ut([W||K[0],J||K[1]]),B.push(U.slice(0,V))}return B}},{"../../constants/numerical":224,"../../lib":246,"./constants":373}],384:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],385:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,p=-1,h=0,f=-1;for(i=0;i=0?l=f:(l=f=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":28}],387:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],388:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),a(t,"marker.line")&&i(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")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":114,"../../components/colorscale/defaults":124,"../../components/colorscale/helpers":125,"./subtypes":394}],389:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":224,"../../lib":246}],390:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),p=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),y=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var I=b.fill.charAt(b.fill.length-1);"x"!==I&&"y"!==I&&(I=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,E,D="",z=[],O=b._prevtrace;O&&(D=O._prevRevpath||"",L=O._nextFill,z=O._polygons);var R,F,B,N,j,U,V,q="",H="",Z=[],G=i.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},Z=c(p,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(Z.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",P),l.singleLineStyle(p,a)}}}}}var Y=M.selectAll(".js-line").data(Z);v(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(G(!0)),l.setClipUrl(Y,r.layerClipId,t),Z.length?(C?(C.datum(p),N&&U&&(I?("y"===I?N[1]=U[1]=x.c2p(0,!0):"x"===I&&(N[0]=U[0]=_.c2p(0,!0)),v(C).attr("d","M"+U+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):v(C).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===b.fill.substr(0,6)&&q&&D?("tonext"===b.fill?v(L).attr("d",q+"Z"+D+"Z").call(l.singleFillStyle):v(L).attr("d",q+"L"+D.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(z)):(W(L),b._polygons=null)),b._prevRevpath=H,b._prevPolygons=V):(C?W(C):L&&W(L),b._polygons=b._prevRevpath=b._prevPolygons=null),A.datum(p),S.datum(p),function(e,a,i){var o,c=i[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?K:J:b&&!w&&(y=Q),p&&(d=y),h&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=v(a);l.translatePoint(e,i,_,x)?(l.singlePointStyle(e,i,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,_,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=v(e.select("text"));l.translatePoint(t,a,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,p);var X=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(A,X,t),l.setClipUrl(S,X,t)}function W(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,d=!i,m=!!i&&i.duration>0,y=p(t,e,r);((c=a.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){f(t,n,e,r,y,this,i)}))}))):c.each((function(r,n){f(t,n,e,r,y,this,i)}));d&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":136,"../../lib":246,"../../lib/polygon":258,"../../registry":338,"./line_points":383,"./link_traces":385,"./subtypes":394,"@plotly/d3":12}],391:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r")}function c(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,u=o[0].trace,c=t.xa,p=t.ya,h=t.subplot,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=h.project([n,i]),l=o.x-c.c2p([d,i]),u=o.y-p.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)}),t),!1!==t.index){var m=o[t.index],y=m.lonlat,g=[a.modHalf(y[0],360)+f,y[1]],v=c.c2p(g),_=p.c2p(g),x=m.mrc||1;t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x;var b={};b[u.subplot]={_subplot:h};var w=u._module.formatLabels(m,u,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=i(u,m),t.extraText=l(u,m,o[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}},{"../../components/fx":154,"../../constants/numerical":224,"../../lib":246,"../scatter/get_trace_color":379}],405:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":329,"../scatter/marker_colorbar":387,"../scattergeo/calc":398,"./attributes":399,"./defaults":401,"./event_data":402,"./format_labels":403,"./hover":404,"./plot":406,"./select":407}],406:[function(t,e,r){"use strict";var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,a,o=this.subplot,s=o.map,l=n(o.gd,t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=i.length-1;e>=0;e--)r=i[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=i[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,a=new o(t,r.uid),s=n(t.gd,e),l=a.below=t.belowLookup["trace-"+r.uid],u=0;ua&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),_={},x={},b=0;d?(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set(new Array(p))},g=function(t,e){var r=_[t.astr][e];t.get()[e]=r}):(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set([])},g=function(t,e){var r=_[t.astr][e];t.get().push(r)}),k(y);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i 0) { + a = a.ushln(shift) + } else if(shift < 0) { + b = b.ushln(-shift) } - this._maxListeners = n; - return this; -}; - -function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; + return rationalize(a, b) } -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); -}; - -EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = (type === 'error'); +},{"./div":78,"./is-rat":80,"./lib/is-bn":84,"./lib/num-to-bn":85,"./lib/rationalize":86,"./lib/str-to-bn":87}],80:[function(_dereq_,module,exports){ +'use strict' - var events = this._events; - if (events !== undefined) - doError = (doError && events.error === undefined); - else if (!doError) - return false; +var isBN = _dereq_('./lib/is-bn') - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) - er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event - } - // At least give some kind of context to the user - var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); - err.context = er; - throw err; // Unhandled 'error' event - } +module.exports = isRat - var handler = events[type]; +function isRat(x) { + return Array.isArray(x) && x.length === 2 && isBN(x[0]) && isBN(x[1]) +} - if (handler === undefined) - return false; +},{"./lib/is-bn":84}],81:[function(_dereq_,module,exports){ +'use strict' - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); - } +var BN = _dereq_('bn.js') - return true; -}; +module.exports = sign -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; +function sign (x) { + return x.cmp(new BN(0)) +} - checkListener(listener); +},{"bn.js":94}],82:[function(_dereq_,module,exports){ +'use strict' - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); +var sign = _dereq_('./bn-sign') - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } +module.exports = bn2num - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; +//TODO: Make this better +function bn2num(b) { + var l = b.length + var words = b.words + var out = 0 + if (l === 1) { + out = words[0] + } else if (l === 2) { + out = words[0] + (words[1] * 0x4000000) } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + String(type) + ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); + for (var i = 0; i < l; i++) { + var w = words[i] + out += w * Math.pow(0x4000000, i) } } - - return target; + return sign(b) * out } -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; +},{"./bn-sign":81}],83:[function(_dereq_,module,exports){ +'use strict' -EventEmitter.prototype.on = EventEmitter.prototype.addListener; +var db = _dereq_('double-bits') +var ctz = _dereq_('bit-twiddle').countTrailingZeros -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; +module.exports = ctzNumber -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) - return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); +//Counts the number of trailing zeros +function ctzNumber(x) { + var l = ctz(db.lo(x)) + if(l < 32) { + return l } + var h = ctz(db.hi(x)) + if(h > 20) { + return 52 + } + return h + 32 } -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} +},{"bit-twiddle":93,"double-bits":153}],84:[function(_dereq_,module,exports){ +'use strict' -EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; -}; +var BN = _dereq_('bn.js') -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; +module.exports = isBN -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; +//Test if x is a bignumber +//FIXME: obviously this is the wrong way to do it +function isBN(x) { + return x && typeof x === 'object' && Boolean(x.words) +} - checkListener(listener); +},{"bn.js":94}],85:[function(_dereq_,module,exports){ +'use strict' - events = this._events; - if (events === undefined) - return this; +var BN = _dereq_('bn.js') +var db = _dereq_('double-bits') - list = events[type]; - if (list === undefined) - return this; +module.exports = num2bn - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; +function num2bn(x) { + var e = db.exponent(x) + if(e < 52) { + return new BN(x) + } else { + return (new BN(x * Math.pow(2, 52-e))).ushln(e-52) + } +} - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } +},{"bn.js":94,"double-bits":153}],86:[function(_dereq_,module,exports){ +'use strict' - if (position < 0) - return this; +var num2bn = _dereq_('./num-to-bn') +var sign = _dereq_('./bn-sign') - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } +module.exports = rationalize - if (list.length === 1) - events[type] = list[0]; +function rationalize(numer, denom) { + var snumer = sign(numer) + var sdenom = sign(denom) + if(snumer === 0) { + return [num2bn(0), num2bn(1)] + } + if(sdenom === 0) { + return [num2bn(0), num2bn(0)] + } + if(sdenom < 0) { + numer = numer.neg() + denom = denom.neg() + } + var d = numer.gcd(denom) + if(d.cmpn(1)) { + return [ numer.div(d), denom.div(d) ] + } + return [ numer, denom ] +} - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); - } +},{"./bn-sign":81,"./num-to-bn":85}],87:[function(_dereq_,module,exports){ +'use strict' - return this; - }; +var BN = _dereq_('bn.js') -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +module.exports = str2BN -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; +function str2BN(x) { + return new BN(x) +} - events = this._events; - if (events === undefined) - return this; +},{"bn.js":94}],88:[function(_dereq_,module,exports){ +'use strict' - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else - delete events[type]; - } - return this; - } +var rationalize = _dereq_('./lib/rationalize') - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } +module.exports = mul - listeners = events[type]; +function mul(a, b) { + return rationalize(a[0].mul(b[0]), a[1].mul(b[1])) +} - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } +},{"./lib/rationalize":86}],89:[function(_dereq_,module,exports){ +'use strict' - return this; - }; +var bnsign = _dereq_('./lib/bn-sign') -function _listeners(target, type, unwrap) { - var events = target._events; +module.exports = sign - if (events === undefined) - return []; +function sign(x) { + return bnsign(x[0]) * bnsign(x[1]) +} - var evlistener = events[type]; - if (evlistener === undefined) - return []; +},{"./lib/bn-sign":81}],90:[function(_dereq_,module,exports){ +'use strict' - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; +var rationalize = _dereq_('./lib/rationalize') - return unwrap ? - unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +module.exports = sub + +function sub(a, b) { + return rationalize(a[0].mul(b[1]).sub(a[1].mul(b[0])), a[1].mul(b[1])) } -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; +},{"./lib/rationalize":86}],91:[function(_dereq_,module,exports){ +'use strict' -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; +var bn2num = _dereq_('./lib/bn-to-num') +var ctz = _dereq_('./lib/ctz') -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); +module.exports = roundRat + +// Round a rational to the closest float +function roundRat (f) { + var a = f[0] + var b = f[1] + if (a.cmpn(0) === 0) { + return 0 + } + var h = a.abs().divmod(b.abs()) + var iv = h.div + var x = bn2num(iv) + var ir = h.mod + var sgn = (a.negative !== b.negative) ? -1 : 1 + if (ir.cmpn(0) === 0) { + return sgn * x + } + if (x) { + var s = ctz(x) + 4 + var y = bn2num(ir.ushln(s).divRound(b)) + return sgn * (x + y * Math.pow(2, -s)) } else { - return listenerCount.call(emitter, type); + var ybits = b.bitLength() - ir.bitLength() + 53 + var y = bn2num(ir.ushln(ybits).divRound(b)) + if (ybits < 1023) { + return sgn * y * Math.pow(2, -ybits) + } + y *= Math.pow(2, -1023) + return sgn * y * Math.pow(2, 1023 - ybits) } -}; +} -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; +},{"./lib/bn-to-num":82,"./lib/ctz":83}],92:[function(_dereq_,module,exports){ +"use strict" - if (events !== undefined) { - var evlistener = events[type]; +// (a, y, c, l, h) = (array, y[, cmp, lo, hi]) - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; - } +function ge(a, y, c, l, h) { + var i = h + 1; + while (l <= h) { + var m = (l + h) >>> 1, x = a[m]; + var p = (c !== undefined) ? c(x, y) : (x - y); + if (p >= 0) { i = m; h = m - 1 } else { l = m + 1 } } + return i; +}; - return 0; -} +function gt(a, y, c, l, h) { + var i = h + 1; + while (l <= h) { + var m = (l + h) >>> 1, x = a[m]; + var p = (c !== undefined) ? c(x, y) : (x - y); + if (p > 0) { i = m; h = m - 1 } else { l = m + 1 } + } + return i; +}; -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +function lt(a, y, c, l, h) { + var i = l - 1; + while (l <= h) { + var m = (l + h) >>> 1, x = a[m]; + var p = (c !== undefined) ? c(x, y) : (x - y); + if (p < 0) { i = m; l = m + 1 } else { h = m - 1 } + } + return i; }; -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} +function le(a, y, c, l, h) { + var i = l - 1; + while (l <= h) { + var m = (l + h) >>> 1, x = a[m]; + var p = (c !== undefined) ? c(x, y) : (x - y); + if (p <= 0) { i = m; l = m + 1 } else { h = m - 1 } + } + return i; +}; -function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); -} +function eq(a, y, c, l, h) { + while (l <= h) { + var m = (l + h) >>> 1, x = a[m]; + var p = (c !== undefined) ? c(x, y) : (x - y); + if (p === 0) { return m } + if (p <= 0) { l = m + 1 } else { h = m - 1 } + } + return -1; +}; -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; +function norm(a, y, c, l, h, f) { + if (typeof c === 'function') { + return f(a, y, c, (l === undefined) ? 0 : l | 0, (h === undefined) ? a.length - 1 : h | 0); } - return ret; + return f(a, y, undefined, (c === undefined) ? 0 : c | 0, (l === undefined) ? a.length - 1 : l | 0); } -function once(emitter, name) { - return new Promise(function (resolve, reject) { - function eventListener() { - if (errorListener !== undefined) { - emitter.removeListener('error', errorListener); - } - resolve([].slice.call(arguments)); - }; - var errorListener; - - // Adding an error listener is not optional because - // if an error is thrown on an event emitter we cannot - // guarantee that the actual event we are waiting will - // be fired. The result could be a silent way to create - // memory or file descriptor leaks, which is something - // we should avoid. - if (name !== 'error') { - errorListener = function errorListener(err) { - emitter.removeListener(name, eventListener); - reject(err); - }; - - emitter.once('error', errorListener); - } - - emitter.once(name, eventListener); - }); +module.exports = { + ge: function(a, y, c, l, h) { return norm(a, y, c, l, h, ge)}, + gt: function(a, y, c, l, h) { return norm(a, y, c, l, h, gt)}, + lt: function(a, y, c, l, h) { return norm(a, y, c, l, h, lt)}, + le: function(a, y, c, l, h) { return norm(a, y, c, l, h, le)}, + eq: function(a, y, c, l, h) { return norm(a, y, c, l, h, eq)} } -},{}],61:[function(_dereq_,module,exports){ -(function (Buffer){(function (){ -/*! - * The buffer module from node.js, for the browser. +},{}],93:[function(_dereq_,module,exports){ +/** + * Bit twiddling hacks for JavaScript. * - * @author Feross Aboukhadijeh - * @license MIT + * Author: Mikola Lysenko + * + * Ported from Stanford bit twiddling hack library: + * http://graphics.stanford.edu/~seander/bithacks.html */ -/* eslint-disable no-proto */ -'use strict' +"use strict"; "use restrict"; -var base64 = _dereq_('base64-js') -var ieee754 = _dereq_('ieee754') +//Number of bits in an integer +var INT_BITS = 32; -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 +//Constants +exports.INT_BITS = INT_BITS; +exports.INT_MAX = 0x7fffffff; +exports.INT_MIN = -1<<(INT_BITS-1); -var K_MAX_LENGTH = 0x7fffffff -exports.kMaxLength = K_MAX_LENGTH +//Returns -1, 0, +1 depending on sign of x +exports.sign = function(v) { + return (v > 0) - (v < 0); +} -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ -Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() +//Computes absolute value of integer +exports.abs = function(v) { + var mask = v >> (INT_BITS-1); + return (v ^ mask) - mask; +} -if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - 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.' - ) +//Computes minimum of integers x and y +exports.min = function(x, y) { + return y ^ ((x ^ y) & -(x < y)); } -function typedArraySupport () { - // Can typed array instances can be augmented? - try { - var arr = new Uint8Array(1) - arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } } - return arr.foo() === 42 - } catch (e) { - return false - } +//Computes maximum of integers x and y +exports.max = function(x, y) { + return x ^ ((x ^ y) & -(x < y)); } -Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } -}) +//Checks if a number is a power of two +exports.isPow2 = function(v) { + return !(v & (v-1)) && (!!v); +} -Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } -}) +//Computes log base 2 of v +exports.log2 = function(v) { + var r, shift; + r = (v > 0xFFFF) << 4; v >>>= r; + shift = (v > 0xFF ) << 3; v >>>= shift; r |= shift; + shift = (v > 0xF ) << 2; v >>>= shift; r |= shift; + shift = (v > 0x3 ) << 1; v >>>= shift; r |= shift; + return r | (v >> 1); +} -function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - var buf = new Uint8Array(length) - buf.__proto__ = Buffer.prototype - return buf +//Computes log base 10 of v +exports.log10 = function(v) { + return (v >= 1000000000) ? 9 : (v >= 100000000) ? 8 : (v >= 10000000) ? 7 : + (v >= 1000000) ? 6 : (v >= 100000) ? 5 : (v >= 10000) ? 4 : + (v >= 1000) ? 3 : (v >= 100) ? 2 : (v >= 10) ? 1 : 0; } -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ +//Counts number of bits +exports.popCount = function(v) { + v = v - ((v >>> 1) & 0x55555555); + v = (v & 0x33333333) + ((v >>> 2) & 0x33333333); + return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24; +} -function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) +//Counts number of trailing zeros +function countTrailingZeros(v) { + var c = 32; + v &= -v; + if (v) c--; + if (v & 0x0000FFFF) c -= 16; + if (v & 0x00FF00FF) c -= 8; + if (v & 0x0F0F0F0F) c -= 4; + if (v & 0x33333333) c -= 2; + if (v & 0x55555555) c -= 1; + return c; +} +exports.countTrailingZeros = countTrailingZeros; + +//Rounds to next power of 2 +exports.nextPow2 = function(v) { + v += v === 0; + --v; + v |= v >>> 1; + v |= v >>> 2; + v |= v >>> 4; + v |= v >>> 8; + v |= v >>> 16; + return v + 1; +} + +//Rounds down to previous power of 2 +exports.prevPow2 = function(v) { + v |= v >>> 1; + v |= v >>> 2; + v |= v >>> 4; + v |= v >>> 8; + v |= v >>> 16; + return v - (v>>>1); +} + +//Computes parity of word +exports.parity = function(v) { + v ^= v >>> 16; + v ^= v >>> 8; + v ^= v >>> 4; + v &= 0xf; + return (0x6996 >>> v) & 1; +} + +var REVERSE_TABLE = new Array(256); + +(function(tab) { + for(var i=0; i<256; ++i) { + var v = i, r = i, s = 7; + for (v >>>= 1; v; v >>>= 1) { + r <<= 1; + r |= v & 1; + --s; + } + tab[i] = (r << s) & 0xff; + } +})(REVERSE_TABLE); + +//Reverse bits in a 32 bit word +exports.reverse = function(v) { + return (REVERSE_TABLE[ v & 0xff] << 24) | + (REVERSE_TABLE[(v >>> 8) & 0xff] << 16) | + (REVERSE_TABLE[(v >>> 16) & 0xff] << 8) | + REVERSE_TABLE[(v >>> 24) & 0xff]; +} + +//Interleave bits of 2 coordinates with 16 bits. Useful for fast quadtree codes +exports.interleave2 = function(x, y) { + x &= 0xFFFF; + x = (x | (x << 8)) & 0x00FF00FF; + x = (x | (x << 4)) & 0x0F0F0F0F; + x = (x | (x << 2)) & 0x33333333; + x = (x | (x << 1)) & 0x55555555; + + y &= 0xFFFF; + y = (y | (y << 8)) & 0x00FF00FF; + y = (y | (y << 4)) & 0x0F0F0F0F; + y = (y | (y << 2)) & 0x33333333; + y = (y | (y << 1)) & 0x55555555; + + return x | (y << 1); +} + +//Extracts the nth interleaved component +exports.deinterleave2 = function(v, n) { + v = (v >>> n) & 0x55555555; + v = (v | (v >>> 1)) & 0x33333333; + v = (v | (v >>> 2)) & 0x0F0F0F0F; + v = (v | (v >>> 4)) & 0x00FF00FF; + v = (v | (v >>> 16)) & 0x000FFFF; + return (v << 16) >> 16; +} + + +//Interleave bits of 3 coordinates, each with 10 bits. Useful for fast octree codes +exports.interleave3 = function(x, y, z) { + x &= 0x3FF; + x = (x | (x<<16)) & 4278190335; + x = (x | (x<<8)) & 251719695; + x = (x | (x<<4)) & 3272356035; + x = (x | (x<<2)) & 1227133513; + + y &= 0x3FF; + y = (y | (y<<16)) & 4278190335; + y = (y | (y<<8)) & 251719695; + y = (y | (y<<4)) & 3272356035; + y = (y | (y<<2)) & 1227133513; + x |= (y << 1); + + z &= 0x3FF; + z = (z | (z<<16)) & 4278190335; + z = (z | (z<<8)) & 251719695; + z = (z | (z<<4)) & 3272356035; + z = (z | (z<<2)) & 1227133513; + + return x | (z << 2); } -// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species != null && - Buffer[Symbol.species] === Buffer) { - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true, - enumerable: false, - writable: false - }) +//Extracts nth interleaved component of a 3-tuple +exports.deinterleave3 = function(v, n) { + v = (v >>> n) & 1227133513; + v = (v | (v>>>2)) & 3272356035; + v = (v | (v>>>4)) & 251719695; + v = (v | (v>>>8)) & 4278190335; + v = (v | (v>>>16)) & 0x3FF; + return (v<<22)>>22; } -Buffer.poolSize = 8192 // not used by this implementation +//Computes next combination in colexicographic order (this is mistakenly called nextPermutation on the bit twiddling hacks page) +exports.nextCombination = function(v) { + var t = v | (v - 1); + return (t + 1) | (((~t & -~t) - 1) >>> (countTrailingZeros(v) + 1)); +} -function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - if (ArrayBuffer.isView(value)) { - return fromArrayLike(value) - } +},{}],94:[function(_dereq_,module,exports){ +(function (module, exports) { + 'use strict'; - if (value == null) { - throw TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) + // Utils + function assert (val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); } - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) + // Could use `inherits` module, but don't want to move from single file + // architecture yet. + function inherits (ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; } - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) - } + // BN - var valueOf = value.valueOf && value.valueOf() - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) - } + function BN (number, base, endian) { + if (BN.isBN(number)) { + return number; + } - var b = fromObject(value) - if (b) return b + this.negative = 0; + this.words = null; + this.length = 0; - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from( - value[Symbol.toPrimitive]('string'), encodingOrOffset, length - ) - } + // Reduction context + this.red = null; - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) -} + if (number !== null) { + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length) -} + this._init(number || 0, base || 10, endian || 'be'); + } + } + if (typeof module === 'object') { + module.exports = BN; + } else { + exports.BN = BN; + } -// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: -// https://github.com/feross/buffer/pull/148 -Buffer.prototype.__proto__ = Uint8Array.prototype -Buffer.__proto__ = Uint8Array + BN.BN = BN; + BN.wordSize = 26; -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') + var Buffer; + try { + Buffer = _dereq_('buffer').Buffer; + } catch (e) { } -} -function alloc (size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) -} + BN.isBN = function isBN (num) { + if (num instanceof BN) { + return true; + } -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) -} + return num !== null && typeof num === 'object' && + num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; -function allocUnsafe (size) { - assertSize(size) - return createBuffer(size < 0 ? 0 : checked(size) | 0) -} + BN.max = function max (left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) -} + BN.min = function min (left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; -function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } + BN.prototype._init = function init (number, base, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base, endian); + } - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } + if (typeof number === 'object') { + return this._initArray(number, base, endian); + } - var length = byteLength(string, encoding) | 0 - var buf = createBuffer(length) + if (base === 'hex') { + base = 16; + } + assert(base === (base | 0) && base >= 2 && base <= 36); - var actual = buf.write(string, encoding) + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + } - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual) - } + if (base === 16) { + this._parseHex(number, start); + } else { + this._parseBase(number, base, start); + } - return buf -} + if (number[0] === '-') { + this.negative = 1; + } -function fromArrayLike (array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - var buf = createBuffer(length) - for (var i = 0; i < length; i += 1) { - buf[i] = array[i] & 255 - } - return buf -} + this.strip(); -function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } + if (endian !== 'le') return; - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } + this._initArray(this.toArray(), base, endian); + }; - var buf - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array) - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset) - } else { - buf = new Uint8Array(array, byteOffset, length) - } + BN.prototype._initNumber = function _initNumber (number, base, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 0x4000000) { + this.words = [ number & 0x3ffffff ]; + this.length = 1; + } else if (number < 0x10000000000000) { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } - // Return an augmented `Uint8Array` instance - buf.__proto__ = Buffer.prototype - return buf -} + if (endian !== 'le') return; -function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - var buf = createBuffer(len) + // Reverse the bytes + this._initArray(this.toArray(), base, endian); + }; - if (buf.length === 0) { - return buf + BN.prototype._initArray = function _initArray (number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [ 0 ]; + this.length = 1; + return this; } - obj.copy(buf, 0, 0, len) - return buf - } + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) + var j, w; + var off = 0; + if (endian === 'be') { + for (i = number.length - 1, j = 0; i >= 0; i -= 3) { + w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i = 0, j = 0; i < number.length; i += 3) { + w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } } - return fromArrayLike(obj) - } + return this.strip(); + }; - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } -} + function parseHex (str, start, end) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; -function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 -} + r <<= 4; -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} + // 'a' - 'f' + if (c >= 49 && c <= 54) { + r |= c - 49 + 0xa; -Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false -} + // 'A' - 'F' + } else if (c >= 17 && c <= 22) { + r |= c - 17 + 0xa; -Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) + // '0' - '9' + } else { + r |= c & 0xf; + } + } + return r; } - if (a === b) return 0 + BN.prototype._parseHex = function _parseHex (number, start) { + // Create possibly bigger array to ensure that it fits the number + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + var j, w; + // Scan 24-bit chunks and add them to the number + var off = 0; + for (i = number.length - 6, j = 0; i >= start; i -= 6) { + w = parseHex(number, i, i + 6); + this.words[j] |= (w << off) & 0x3ffffff; + // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb + this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + if (i + 6 !== start) { + w = parseHex(number, start, i + 6); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; + } + this.strip(); + }; - var x = a.length - var y = b.length + function parseBase (str, start, end, mul) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break + r *= mul; + + // 'a' + if (c >= 49) { + r += c - 49 + 0xa; + + // 'A' + } else if (c >= 17) { + r += c - 17 + 0xa; + + // '0' - '9' + } else { + r += c; + } } + return r; } - if (x < y) return -1 - if (y < x) return 1 - return 0 -} + BN.prototype._parseBase = function _parseBase (number, base, start) { + // Initialize as zero + this.words = [ 0 ]; + this.length = 1; -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).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 true - default: - return false - } -} + // Find length of limb in base + for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base) | 0; -Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; - if (list.length === 0) { - return Buffer.alloc(0) - } + var word = 0; + for (var i = start; i < end; i += limbLen) { + word = parseBase(number, i, i + limbLen, base); - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length + this.imuln(limbPow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } } - } - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (isInstance(buf, Uint8Array)) { - buf = Buffer.from(buf) + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i, number.length, base); + + for (i = 0; i < mod; i++) { + pow *= base; + } + + this.imuln(pow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } } - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') + }; + + BN.prototype.copy = function copy (dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + dest.words[i] = this.words[i]; } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } + BN.prototype.clone = function clone () { + var r = new BN(null); + this.copy(r); + return r; + }; - var len = string.length - var mustMatch = (arguments.length > 2 && arguments[2] === true) - if (!mustMatch && len === 0) return 0 + BN.prototype._expand = function _expand (size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase() - loweredCase = true + // Remove leading `0` from `this` + BN.prototype.strip = function strip () { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; } - } -} -Buffer.byteLength = byteLength + return this._normSign(); + }; -function slowToString (encoding, start, end) { - var loweredCase = false + BN.prototype._normSign = function _normSign () { + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. + BN.prototype.inspect = function inspect () { + return (this.red ? ''; + }; + + /* + + var zeros = []; + var groupSizes = []; + var groupBases = []; + + var s = ''; + var i = -1; + while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; + } + groupSizes[0] = 0; + groupSizes[1] = 0; + groupBases[0] = 0; + groupBases[1] = 0; + var base = 2 - 1; + while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; + } + + */ + + var zeros = [ + '', + '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' + ]; - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } + var groupSizes = [ + 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 + ]; - if (end === undefined || end > this.length) { - end = this.length - } + var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 + ]; - if (end <= 0) { - return '' - } + BN.prototype.toString = function toString (base, padding) { + base = base || 10; + padding = padding | 0 || 1; - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 + var out; + if (base === 16 || base === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = this.words[i]; + var word = (((w << off) | carry) & 0xffffff).toString(16); + carry = (w >>> (24 - off)) & 0xffffff; + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off += 2; + if (off >= 26) { + off -= 26; + i--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } - if (end <= start) { - return '' - } + if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r = c.modn(groupBase).toString(base); + c = c.idivn(groupBase); - if (!encoding) encoding = 'utf8' + if (!c.isZero()) { + out = zeros[groupSize - r.length] + r + out; + } else { + out = r + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) + assert(false, 'Base should be between 2 and 36'); + }; - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) + BN.prototype.toNumber = function toNumber () { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // NOTE: at this stage it is known that the top bit is set + ret += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + assert(false, 'Number can only safely store up to 53 bits'); + } + return (this.negative !== 0) ? -ret : ret; + }; - case 'ascii': - return asciiSlice(this, start, end) + BN.prototype.toJSON = function toJSON () { + return this.toString(16); + }; - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) + BN.prototype.toBuffer = function toBuffer (endian, length) { + assert(typeof Buffer !== 'undefined'); + return this.toArrayLike(Buffer, endian, length); + }; - case 'base64': - return base64Slice(this, start, end) + BN.prototype.toArray = function toArray (endian, length) { + return this.toArrayLike(Array, endian, length); + }; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert(byteLength <= reqLength, 'byte array longer than desired length'); + assert(reqLength > 0, 'Requested array length <= 0'); - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} + this.strip(); + var littleEndian = endian === 'le'; + var res = new ArrayType(reqLength); -// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) -// to detect a Buffer instance. It's not possible to use `instanceof Buffer` -// reliably in a browserify context because there could be multiple different -// copies of the 'buffer' package in use. This method works even for Buffer -// instances that were created from another copy of the `buffer` package. -// See: https://github.com/feross/buffer/issues/154 -Buffer.prototype._isBuffer = true + var b, i; + var q = this.clone(); + if (!littleEndian) { + // Assume big-endian + for (i = 0; i < reqLength - byteLength; i++) { + res[i] = 0; + } -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} + res[reqLength - i - 1] = b; + } + } else { + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} + res[i] = b; + } -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) + for (; i < reqLength; i++) { + res[i] = 0; + } + } + + return res; + }; + + if (Math.clz32) { + BN.prototype._countBits = function _countBits (w) { + return 32 - Math.clz32(w); + }; + } else { + BN.prototype._countBits = function _countBits (w) { + var t = w; + var r = 0; + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + return r + t; + }; } - return this -} -Buffer.prototype.toString = function toString () { - var length = this.length - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} + BN.prototype._zeroBits = function _zeroBits (w) { + // Short-cut + if (w === 0) return 26; -Buffer.prototype.toLocaleString = Buffer.prototype.toString + var t = w; + var r = 0; + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + if ((t & 0x1) === 0) { + r++; + } + return r; + }; -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} + // Return number of used bits in a BN + BN.prototype.bitLength = function bitLength () { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() - if (this.length > max) str += ' ... ' - return '' -} + function toBitArray (num) { + var w = new Array(num.bitLength()); -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength) - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } + w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; + } - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') + return w; } - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } + // Number of trailing zero bits + BN.prototype.zeroBits = function zeroBits () { + if (this.isZero()) return 0; - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 + var r = 0; + for (var i = 0; i < this.length; i++) { + var b = this._zeroBits(this.words[i]); + r += b; + if (b !== 26) break; + } + return r; + }; - if (this === target) return 0 + BN.prototype.byteLength = function byteLength () { + return Math.ceil(this.bitLength() / 8); + }; - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) + BN.prototype.toTwos = function toTwos (width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) + BN.prototype.fromTwos = function fromTwos (width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break + BN.prototype.isNeg = function isNeg () { + return this.negative !== 0; + }; + + // Return negative clone of `this` + BN.prototype.neg = function neg () { + return this.clone().ineg(); + }; + + BN.prototype.ineg = function ineg () { + if (!this.isZero()) { + this.negative ^= 1; } - } - if (x < y) return -1 - if (y < x) return 1 - return 0 -} + return this; + }; -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 + // Or `num` with `this` in-place + BN.prototype.iuor = function iuor (num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } + for (var i = 0; i < num.length; i++) { + this.words[i] = this.words[i] | num.words[i]; + } - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } + return this.strip(); + }; - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } + BN.prototype.ior = function ior (num) { + assert((this.negative | num.negative) === 0); + return this.iuor(num); + }; - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 + // Or `num` with `this` + BN.prototype.or = function or (num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; + + BN.prototype.uor = function uor (num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; + + // And `num` with `this` in-place + BN.prototype.iuand = function iuand (num) { + // b = min-length(num, this) + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } + + for (var i = 0; i < b.length; i++) { + this.words[i] = this.words[i] & num.words[i]; } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - throw new TypeError('val must be string, number or Buffer') -} + this.length = b.length; -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length + return this.strip(); + }; - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } + BN.prototype.iand = function iand (num) { + assert((this.negative | num.negative) === 0); + return this.iuand(num); + }; - function read (buf, i) { - if (indexSize === 1) { - return buf[i] + // And `num` with `this` + BN.prototype.and = function and (num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; + + BN.prototype.uand = function uand (num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + + // Xor `num` with `this` in-place + BN.prototype.iuxor = function iuxor (num) { + // a.length > b.length + var a; + var b; + if (this.length > num.length) { + a = this; + b = num; } else { - return buf.readUInt16BE(i * indexSize) + a = num; + b = this; } - } - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } + for (var i = 0; i < b.length; i++) { + this.words[i] = a.words[i] ^ b.words[i]; } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } + + if (this !== a) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; } - if (found) return i } - } - return -1 -} + this.length = a.length; -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} + return this.strip(); + }; -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} + BN.prototype.ixor = function ixor (num) { + assert((this.negative | num.negative) === 0); + return this.iuxor(num); + }; -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} + // Xor `num` with `this` + BN.prototype.xor = function xor (num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining + BN.prototype.uxor = function uxor (num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + + // Not ``this`` with ``width`` bitwidth + BN.prototype.inotn = function inotn (width) { + assert(typeof width === 'number' && width >= 0); + + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + + // Extend the buffer with leading zeroes + this._expand(bytesNeeded); + + if (bitsLeft > 0) { + bytesNeeded--; } - } - var strLen = string.length + // Handle complete words + for (var i = 0; i < bytesNeeded; i++) { + this.words[i] = ~this.words[i] & 0x3ffffff; + } - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} + // Handle the residue + if (bitsLeft > 0) { + this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); + } -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} + // And remove leading zeroes + return this.strip(); + }; -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} + BN.prototype.notn = function notn (width) { + return this.clone().inotn(width); + }; -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} + // Set `bit` of `this` + BN.prototype.setn = function setn (bit, val) { + assert(typeof bit === 'number' && bit >= 0); -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} + var off = (bit / 26) | 0; + var wbit = bit % 26; -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} + this._expand(off + 1); -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0 - if (isFinite(length)) { - length = length >>> 0 - if (encoding === undefined) encoding = 'utf8' + if (val) { + this.words[off] = this.words[off] | (1 << wbit); } else { - encoding = length - length = undefined + this.words[off] = this.words[off] & ~(1 << wbit); } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining + return this.strip(); + }; - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } + // Add `num` to `this` in-place + BN.prototype.iadd = function iadd (num) { + var r; - if (!encoding) encoding = 'utf8' + // negative + positive + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r = this.isub(num); + this.negative ^= 1; + return this._normSign(); - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) + // positive + negative + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r = this.isub(num); + num.negative = 1; + return r._normSign(); + } - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) + // a.length > b.length + var a, b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + + this.length = a.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + // Copy the rest of the words + } else if (a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } - case 'ascii': - return asciiWrite(this, string, offset, length) + return this; + }; - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) + // Add `num` to `this` + BN.prototype.add = function add (num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + + if (this.length > num.length) return this.clone().iadd(num); + + return num.clone().iadd(this); + }; + + // Subtract `num` from `this` in-place + BN.prototype.isub = function isub (num) { + // this - (-num) = this + num + if (num.negative !== 0) { + num.negative = 0; + var r = this.iadd(num); + num.negative = 1; + return r._normSign(); + + // -this - num = -(this + num) + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + + // At this point both numbers are positive + var cmp = this.cmp(num); + + // Optimization - zeroify + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) + // a > b + var a, b; + if (cmp > 0) { + a = this; + b = num; + } else { + a = num; + b = this; + } - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true + // Copy rest of the words + if (carry === 0 && i < a.length && a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } } - } -} -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} + this.length = Math.max(this.length, i); -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} + if (a !== this) { + this.negative = 1; + } -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] + return this.strip(); + }; - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + // Subtract `num` from `this` + BN.prototype.sub = function sub (num) { + return this.clone().isub(num); + }; - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint + function smallMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + var len = (self.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } + // Peel one iteration (compiler can't do it, because of code complexity) + var a = self.words[0] | 0; + var b = num.words[0] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + var carry = (r / 0x4000000) | 0; + out.words[0] = lo; + + for (var k = 1; k < len; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = carry >>> 26; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = (k - j) | 0; + a = self.words[i] | 0; + b = num.words[j] | 0; + r = a * b + rword; + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; } + out.words[k] = rword | 0; + carry = ncarry | 0; } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF + if (carry !== 0) { + out.words[k] = carry | 0; + } else { + out.length--; } - res.push(codePoint) - i += bytesPerSequence + return out.strip(); } - return decodeCodePointsArray(res) -} + // TODO(indutny): it may be reasonable to omit it for users who don't need + // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit + // multiplication (like elliptic secp256k1). + var comb10MulTo = function comb10MulTo (self, num, out) { + var a = self.words; + var b = num.words; + var o = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a[0] | 0; + var al0 = a0 & 0x1fff; + var ah0 = a0 >>> 13; + var a1 = a[1] | 0; + var al1 = a1 & 0x1fff; + var ah1 = a1 >>> 13; + var a2 = a[2] | 0; + var al2 = a2 & 0x1fff; + var ah2 = a2 >>> 13; + var a3 = a[3] | 0; + var al3 = a3 & 0x1fff; + var ah3 = a3 >>> 13; + var a4 = a[4] | 0; + var al4 = a4 & 0x1fff; + var ah4 = a4 >>> 13; + var a5 = a[5] | 0; + var al5 = a5 & 0x1fff; + var ah5 = a5 >>> 13; + var a6 = a[6] | 0; + var al6 = a6 & 0x1fff; + var ah6 = a6 >>> 13; + var a7 = a[7] | 0; + var al7 = a7 & 0x1fff; + var ah7 = a7 >>> 13; + var a8 = a[8] | 0; + var al8 = a8 & 0x1fff; + var ah8 = a8 >>> 13; + var a9 = a[9] | 0; + var al9 = a9 & 0x1fff; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 0x1fff; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 0x1fff; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 0x1fff; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 0x1fff; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 0x1fff; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 0x1fff; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 0x1fff; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 0x1fff; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 0x1fff; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 0x1fff; + var bh9 = b9 >>> 13; + + out.negative = self.negative ^ num.negative; + out.length = 19; + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + if (c !== 0) { + o[19] = c; + out.length++; + } + return out; + }; -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 + // Polyfill comb + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + + function bigMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + out.length = self.length + num.length; + + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = k - j; + var a = self.words[i] | 0; + var b = num.words[j] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + return out.strip(); } - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) + function jumboMulTo (self, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self, num, out); } - return res -} -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) + BN.prototype.mulTo = function mulTo (num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} + return res; + }; -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) + // Cooley-Tukey algorithm for FFT + // slightly revisited to rely on looping instead of recursion - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) + function FFTM (x, y) { + this.x = x; + this.y = y; } - return ret -} -function hexSlice (buf, start, end) { - var len = buf.length + FFTM.prototype.makeRBT = function makeRBT (N) { + var t = new Array(N); + var l = BN.prototype._countBits(N) - 1; + for (var i = 0; i < N; i++) { + t[i] = this.revBin(i, l, N); + } - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len + return t; + }; - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} + // Returns binary-reversed representation of `x` + FFTM.prototype.revBin = function revBin (x, l, N) { + if (x === 0 || x === N - 1) return x; -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) - } - return res -} + var rb = 0; + for (var i = 0; i < l; i++) { + rb |= (x & 1) << (l - i - 1); + x >>= 1; + } -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end + return rb; + }; - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } + // Performs "tweedling" phase, therefore 'emulating' + // behaviour of the recursive algorithm + FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { + for (var i = 0; i < N; i++) { + rtws[i] = rws[rbt[i]]; + itws[i] = iws[rbt[i]]; + } + }; - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } + FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N); - if (end < start) end = start + for (var s = 1; s < N; s <<= 1) { + var l = s << 1; - var newBuf = this.subarray(start, end) - // Return an augmented `Uint8Array` instance - newBuf.__proto__ = Buffer.prototype - return newBuf -} + var rtwdf = Math.cos(2 * Math.PI / l); + var itwdf = Math.sin(2 * Math.PI / l); -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} + for (var p = 0; p < N; p += l) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) + for (var j = 0; j < s; j++) { + var re = rtws[p + j]; + var ie = itws[p + j]; - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } + var ro = rtws[p + j + s]; + var io = itws[p + j + s]; - return val -} + var rx = rtwdf_ * ro - itwdf_ * io; -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } + rtws[p + j] = re + ro; + itws[p + j] = ie + io; - return val -} + rtws[p + j + s] = re - ro; + itws[p + j + s] = ie - io; -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} + /* jshint maxdepth : false */ + if (j !== l) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} + FFTM.prototype.guessLen13b = function guessLen13b (n, m) { + var N = Math.max(m, n) | 1; + var odd = N & 1; + var i = 0; + for (N = N / 2 | 0; N; N = N >>> 1) { + i++; + } -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) + return 1 << i + 1 + odd; + }; - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} + FFTM.prototype.conjugate = function conjugate (rws, iws, N) { + if (N <= 1) return; -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) + for (var i = 0; i < N / 2; i++) { + var t = rws[i]; - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} + rws[i] = rws[N - i - 1]; + rws[N - i - 1] = t; -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) + t = iws[i]; - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 + iws[i] = -iws[N - i - 1]; + iws[N - i - 1] = -t; + } + }; - if (val >= mul) val -= Math.pow(2, 8 * byteLength) + FFTM.prototype.normalize13b = function normalize13b (ws, N) { + var carry = 0; + for (var i = 0; i < N / 2; i++) { + var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + + Math.round(ws[2 * i] / N) + + carry; - return val -} + ws[i] = w & 0x3ffffff; -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) + if (w < 0x4000000) { + carry = 0; + } else { + carry = w / 0x4000000 | 0; + } + } - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 + return ws; + }; - if (val >= mul) val -= Math.pow(2, 8 * byteLength) + FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { + var carry = 0; + for (var i = 0; i < len; i++) { + carry = carry + (ws[i] | 0); - return val -} + rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; + rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; + } -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} + // Pad with zeroes + for (i = 2 * len; i < N; ++i) { + rws[i] = 0; + } -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} + assert(carry === 0); + assert((carry & ~0x1fff) === 0); + }; -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} + FFTM.prototype.stub = function stub (N) { + var ph = new Array(N); + for (var i = 0; i < N; i++) { + ph[i] = 0; + } -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) + return ph; + }; - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} + FFTM.prototype.mulp = function mulp (x, y, out) { + var N = 2 * this.guessLen13b(x.length, y.length); -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) + var rbt = this.makeRBT(N); - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} + var _ = this.stub(N); -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} + var rws = new Array(N); + var rwst = new Array(N); + var iwst = new Array(N); -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} + var nrws = new Array(N); + var nrwst = new Array(N); + var niwst = new Array(N); -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} + var rmws = out.words; + rmws.length = N; -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} + this.convert13b(x.words, x.length, rws, N); + this.convert13b(y.words, y.length, nrws, N); -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} + this.transform(rws, _, rwst, iwst, N, rbt); + this.transform(nrws, _, nrwst, niwst, N, rbt); -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } + for (var i = 0; i < N; i++) { + var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; + iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; + rwst[i] = rx; + } - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } + this.conjugate(rwst, iwst, N); + this.transform(rwst, iwst, rmws, _, N, rbt); + this.conjugate(rmws, _, N); + this.normalize13b(rmws, N); - return offset + byteLength -} + out.negative = x.negative ^ y.negative; + out.length = x.length + y.length; + return out.strip(); + }; -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } + // Multiply `this` by `num` + BN.prototype.mul = function mul (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } + // Multiply employing FFT + BN.prototype.mulf = function mulf (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; - return offset + byteLength -} + // In-place Multiplication + BN.prototype.imul = function imul (num) { + return this.clone().mulTo(num, this); + }; -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - this[offset] = (value & 0xff) - return offset + 1 -} + BN.prototype.imuln = function imuln (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} + // Carry + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = (this.words[i] | 0) * num; + var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); + carry >>= 26; + carry += (w / 0x4000000) | 0; + // NOTE: lo is 27bit maximum + carry += lo >>> 26; + this.words[i] = lo & 0x3ffffff; + } -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - return offset + 4 -} + return this; + }; -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} + BN.prototype.muln = function muln (num) { + return this.clone().imuln(num); + }; -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) + // `this` * `this` + BN.prototype.sqr = function sqr () { + return this.mul(this); + }; - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } + // `this` * `this` in-place + BN.prototype.isqr = function isqr () { + return this.imul(this.clone()); + }; - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 + // Math.pow(`this`, `num`) + BN.prototype.pow = function pow (num) { + var w = toBitArray(num); + if (w.length === 0) return new BN(1); + + // Skip leading zeroes + var res = this; + for (var i = 0; i < w.length; i++, res = res.sqr()) { + if (w[i] !== 0) break; } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - return offset + byteLength -} + if (++i < w.length) { + for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { + if (w[i] === 0) continue; -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) + res = res.mul(q); + } + } - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } + return res; + }; - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 + // Shift-left in-place + BN.prototype.iushln = function iushln (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); + var i; + + if (r !== 0) { + var carry = 0; + + for (i = 0; i < this.length; i++) { + var newCarry = this.words[i] & carryMask; + var c = ((this.words[i] | 0) - newCarry) << r; + this.words[i] = c | carry; + carry = newCarry >>> (26 - r); + } + + if (carry) { + this.words[i] = carry; + this.length++; + } } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - return offset + byteLength -} + if (s !== 0) { + for (i = this.length - 1; i >= 0; i--) { + this.words[i + s] = this.words[i]; + } -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} + for (i = 0; i < s; i++) { + this.words[i] = 0; + } -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} + this.length += s; + } -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} + return this.strip(); + }; -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - return offset + 4 -} + BN.prototype.ishln = function ishln (bits) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushln(bits); + }; -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} + // Shift-right in-place + // NOTE: `hint` is a lowest bit before trailing zeroes + // NOTE: if `extended` is present - it will be filled with destroyed bits + BN.prototype.iushrn = function iushrn (bits, hint, extended) { + assert(typeof bits === 'number' && bits >= 0); + var h; + if (hint) { + h = (hint - (hint % 26)) / 26; + } else { + h = 0; + } -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} + var r = bits % 26; + var s = Math.min((bits - r) / 26, this.length); + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + var maskedWords = extended; -function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} + h -= s; + h = Math.max(0, h); -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} + // Extended mode, copy masked part + if (maskedWords) { + for (var i = 0; i < s; i++) { + maskedWords.words[i] = this.words[i]; + } + maskedWords.length = s; + } -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} + if (s === 0) { + // No-op, we should not move anything at all + } else if (this.length > s) { + this.length -= s; + for (i = 0; i < this.length; i++) { + this.words[i] = this.words[i + s]; + } + } else { + this.words[0] = 0; + this.length = 1; + } -function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} + var carry = 0; + for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { + var word = this.words[i] | 0; + this.words[i] = (carry << (26 - r)) | (word >>> r); + carry = word & mask; + } -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} + // Push carried bits as a mask + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start + return this.strip(); + }; - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 + BN.prototype.ishrn = function ishrn (bits, hint, extended) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') + // Shift-left + BN.prototype.shln = function shln (bits) { + return this.clone().ishln(bits); + }; - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } + BN.prototype.ushln = function ushln (bits) { + return this.clone().iushln(bits); + }; - var len = end - start + // Shift-right + BN.prototype.shrn = function shrn (bits) { + return this.clone().ishrn(bits); + }; - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end) - } else if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (var i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ) - } + BN.prototype.ushrn = function ushrn (bits) { + return this.clone().iushrn(bits); + }; - return len -} + // Test if n bit is set + BN.prototype.testn = function testn (bit) { + assert(typeof bit === 'number' && bit >= 0); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code - } - } - } else if (typeof val === 'number') { - val = val & 255 - } + // Fast case: bit is much higher than all existing words + if (this.length <= s) return false; - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } + // Check bit and return + var w = this.words[s]; - if (end <= start) { - return this - } + return !!(w & q); + }; - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 + // Return only lowers bits of number (in-place) + BN.prototype.imaskn = function imaskn (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; - if (!val) val = 0 + assert(this.negative === 0, 'imaskn works only with positive numbers'); - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding) - var len = bytes.length - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] + if (this.length <= s) { + return this; } - } - return this -} + if (r !== 0) { + s++; + } + this.length = Math.min(s, this.length); -// HELPER FUNCTIONS -// ================ + if (r !== 0) { + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + this.words[this.length - 1] &= mask; + } -var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g + return this.strip(); + }; -function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0] - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} + // Return only lowers bits of number + BN.prototype.maskn = function maskn (bits) { + return this.clone().imaskn(bits); + }; -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} + // Add plain number `num` to `this` + BN.prototype.iaddn = function iaddn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.isubn(-num); -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] + // Possible sign change + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) < num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } + // Add without checks + return this._iaddn(num); + }; - // valid lead - leadSurrogate = codePoint + BN.prototype._iaddn = function _iaddn (num) { + this.words[0] += num; - continue + // Carry + for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { + this.words[i] -= 0x4000000; + if (i === this.length - 1) { + this.words[i + 1] = 1; + } else { + this.words[i + 1]++; } + } + this.length = Math.max(this.length, i + 1); - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } + return this; + }; - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + // Subtract plain number `num` from `this` + BN.prototype.isubn = function isubn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.iaddn(-num); + + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; } - leadSurrogate = null + this.words[0] -= num; - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; } else { - throw new Error('Invalid code point') + // Carry + for (var i = 0; i < this.length && this.words[i] < 0; i++) { + this.words[i] += 0x4000000; + this.words[i + 1] -= 1; + } } - } - - return bytes -} -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} + return this.strip(); + }; -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break + BN.prototype.addn = function addn (num) { + return this.clone().iaddn(num); + }; - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } + BN.prototype.subn = function subn (num) { + return this.clone().isubn(num); + }; - return byteArray -} + BN.prototype.iabs = function iabs () { + this.negative = 0; -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} + return this; + }; -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} + BN.prototype.abs = function abs () { + return this.clone().iabs(); + }; -// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass -// the `instanceof` check but they should be treated as of that type. -// See: https://github.com/feross/buffer/issues/166 -function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) -} -function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare -} + BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { + var len = num.length + shift; + var i; -}).call(this)}).call(this,_dereq_("buffer").Buffer) -},{"base64-js":58,"buffer":61,"ieee754":114}],62:[function(_dereq_,module,exports){ -module.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|ç)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|é)union', - ROU: 'r(o|u|ou)mania', - RUS: '\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics', - RWA: 'rwanda', - BLM: 'barth(e|é)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|ã)o.?tom(e|é)', - 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' -} + this._expand(len); -},{}],63:[function(_dereq_,module,exports){ -// https://d3js.org/d3-array/ v1.2.4 Copyright 2018 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(factory((global.d3 = global.d3 || {}))); -}(this, (function (exports) { 'use strict'; + var w; + var carry = 0; + for (i = 0; i < num.length; i++) { + w = (this.words[i + shift] | 0) + carry; + var right = (num.words[i] | 0) * mul; + w -= right & 0x3ffffff; + carry = (w >> 26) - ((right / 0x4000000) | 0); + this.words[i + shift] = w & 0x3ffffff; + } + for (; i < this.length - shift; i++) { + w = (this.words[i + shift] | 0) + carry; + carry = w >> 26; + this.words[i + shift] = w & 0x3ffffff; + } -function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} + if (carry === 0) return this.strip(); -function bisector(compare) { - if (compare.length === 1) compare = ascendingComparator(compare); - return { - left: function(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) < 0) lo = mid + 1; - else hi = mid; - } - return lo; - }, - right: function(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) > 0) hi = mid; - else lo = mid + 1; - } - return lo; + // Subtraction overflow + assert(carry === -1); + carry = 0; + for (i = 0; i < this.length; i++) { + w = -(this.words[i] | 0) + carry; + carry = w >> 26; + this.words[i] = w & 0x3ffffff; } - }; -} + this.negative = 1; -function ascendingComparator(f) { - return function(d, x) { - return ascending(f(d), x); + return this.strip(); }; -} - -var ascendingBisect = bisector(ascending); -var bisectRight = ascendingBisect.right; -var bisectLeft = ascendingBisect.left; -function pairs(array, f) { - if (f == null) f = pair; - var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n); - while (i < n) pairs[i] = f(p, p = array[++i]); - return pairs; -} + BN.prototype._wordDiv = function _wordDiv (num, mode) { + var shift = this.length - num.length; -function pair(a, b) { - return [a, b]; -} + var a = this.clone(); + var b = num; -function cross(values0, values1, reduce) { - var n0 = values0.length, - n1 = values1.length, - values = new Array(n0 * n1), - i0, - i1, - i, - value0; + // Normalize + var bhi = b.words[b.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b = b.ushln(shift); + a.iushln(shift); + bhi = b.words[b.length - 1] | 0; + } - if (reduce == null) reduce = pair; + // Initialize quotient + var m = a.length - b.length; + var q; - for (i0 = i = 0; i0 < n0; ++i0) { - for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) { - values[i] = reduce(value0, values1[i1]); + if (mode !== 'mod') { + q = new BN(null); + q.length = m + 1; + q.words = new Array(q.length); + for (var i = 0; i < q.length; i++) { + q.words[i] = 0; + } } - } - - return values; -} -function descending(a, b) { - return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; -} + var diff = a.clone()._ishlnsubmul(b, 1, m); + if (diff.negative === 0) { + a = diff; + if (q) { + q.words[m] = 1; + } + } -function number(x) { - return x === null ? NaN : +x; -} + for (var j = m - 1; j >= 0; j--) { + var qj = (a.words[b.length + j] | 0) * 0x4000000 + + (a.words[b.length + j - 1] | 0); -function variance(values, valueof) { - var n = values.length, - m = 0, - i = -1, - mean = 0, - value, - delta, - sum = 0; + // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max + // (0x7ffffff) + qj = Math.min((qj / bhi) | 0, 0x3ffffff); - if (valueof == null) { - while (++i < n) { - if (!isNaN(value = number(values[i]))) { - delta = value - mean; - mean += delta / ++m; - sum += delta * (value - mean); + a._ishlnsubmul(b, qj, j); + while (a.negative !== 0) { + qj--; + a.negative = 0; + a._ishlnsubmul(b, 1, j); + if (!a.isZero()) { + a.negative ^= 1; + } + } + if (q) { + q.words[j] = qj; } } - } + if (q) { + q.strip(); + } + a.strip(); - else { - while (++i < n) { - if (!isNaN(value = number(valueof(values[i], i, values)))) { - delta = value - mean; - mean += delta / ++m; - sum += delta * (value - mean); - } + // Denormalize + if (mode !== 'div' && shift !== 0) { + a.iushrn(shift); } - } - if (m > 1) return sum / (m - 1); -} + return { + div: q || null, + mod: a + }; + }; -function deviation(array, f) { - var v = variance(array, f); - return v ? Math.sqrt(v) : v; -} + // NOTE: 1) `mode` can be set to `mod` to request mod only, + // to `div` to request div only, or be absent to + // request both div & mod + // 2) `positive` is true if unsigned mod is requested + BN.prototype.divmod = function divmod (num, mode, positive) { + assert(!num.isZero()); -function extent(values, valueof) { - var n = values.length, - i = -1, - value, - min, - max; + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } - if (valueof == null) { - while (++i < n) { // Find the first comparable value. - if ((value = values[i]) != null && value >= value) { - min = max = value; - while (++i < n) { // Compare the remaining values. - if ((value = values[i]) != null) { - if (min > value) min = value; - if (max < value) max = value; - } - } + var div, mod, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + + if (mode !== 'mod') { + div = res.div.neg(); } - } - } - else { - while (++i < n) { // Find the first comparable value. - if ((value = valueof(values[i], i, values)) != null && value >= value) { - min = max = value; - while (++i < n) { // Compare the remaining values. - if ((value = valueof(values[i], i, values)) != null) { - if (min > value) min = value; - if (max < value) max = value; - } + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.iadd(num); } } + + return { + div: div, + mod: mod + }; } - } - return [min, max]; -} + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); -var array = Array.prototype; + if (mode !== 'mod') { + div = res.div.neg(); + } -var slice = array.slice; -var map = array.map; + return { + div: div, + mod: res.mod + }; + } -function constant(x) { - return function() { - return x; - }; -} + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); -function identity(x) { - return x; -} + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.isub(num); + } + } -function range(start, stop, step) { - start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; + return { + div: res.div, + mod: mod + }; + } - var i = -1, - n = Math.max(0, Math.ceil((stop - start) / step)) | 0, - range = new Array(n); + // Both numbers are positive at this point - while (++i < n) { - range[i] = start + i * step; - } + // Strip both numbers to approximate shift value + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this + }; + } - return range; -} + // Very short reduction + if (num.length === 1) { + if (mode === 'div') { + return { + div: this.divn(num.words[0]), + mod: null + }; + } -var e10 = Math.sqrt(50), - e5 = Math.sqrt(10), - e2 = Math.sqrt(2); + if (mode === 'mod') { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } -function ticks(start, stop, count) { - var reverse, - i = -1, - n, - ticks, - step; + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } - stop = +stop, start = +start, count = +count; - if (start === stop && count > 0) return [start]; - if (reverse = stop < start) n = start, start = stop, stop = n; - if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return []; + return this._wordDiv(num, mode); + }; - if (step > 0) { - start = Math.ceil(start / step); - stop = Math.floor(stop / step); - ticks = new Array(n = Math.ceil(stop - start + 1)); - while (++i < n) ticks[i] = (start + i) * step; - } else { - start = Math.floor(start * step); - stop = Math.ceil(stop * step); - ticks = new Array(n = Math.ceil(start - stop + 1)); - while (++i < n) ticks[i] = (start - i) / step; - } + // Find `this` / `num` + BN.prototype.div = function div (num) { + return this.divmod(num, 'div', false).div; + }; - if (reverse) ticks.reverse(); + // Find `this` % `num` + BN.prototype.mod = function mod (num) { + return this.divmod(num, 'mod', false).mod; + }; - return ticks; -} + BN.prototype.umod = function umod (num) { + return this.divmod(num, 'mod', true).mod; + }; -function tickIncrement(start, stop, count) { - var step = (stop - start) / Math.max(0, count), - power = Math.floor(Math.log(step) / Math.LN10), - error = step / Math.pow(10, power); - return power >= 0 - ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) - : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); -} + // Find Round(`this` / `num`) + BN.prototype.divRound = function divRound (num) { + var dm = this.divmod(num); -function tickStep(start, stop, count) { - var step0 = Math.abs(stop - start) / Math.max(0, count), - step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), - error = step0 / step1; - if (error >= e10) step1 *= 10; - else if (error >= e5) step1 *= 5; - else if (error >= e2) step1 *= 2; - return stop < start ? -step1 : step1; -} + // Fast case - exact division + if (dm.mod.isZero()) return dm.div; -function sturges(values) { - return Math.ceil(Math.log(values.length) / Math.LN2) + 1; -} + var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; -function histogram() { - var value = identity, - domain = extent, - threshold = sturges; + var half = num.ushrn(1); + var r2 = num.andln(1); + var cmp = mod.cmp(half); - function histogram(data) { - var i, - n = data.length, - x, - values = new Array(n); + // Round down + if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - for (i = 0; i < n; ++i) { - values[i] = value(data[i], i, data); - } + // Round up + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; - var xz = domain(values), - x0 = xz[0], - x1 = xz[1], - tz = threshold(values, x0, x1); + BN.prototype.modn = function modn (num) { + assert(num <= 0x3ffffff); + var p = (1 << 26) % num; - // Convert number of thresholds into uniform thresholds. - if (!Array.isArray(tz)) { - tz = tickStep(x0, x1, tz); - tz = range(Math.ceil(x0 / tz) * tz, x1, tz); // exclusive + var acc = 0; + for (var i = this.length - 1; i >= 0; i--) { + acc = (p * acc + (this.words[i] | 0)) % num; } - // Remove any thresholds outside the domain. - var m = tz.length; - while (tz[0] <= x0) tz.shift(), --m; - while (tz[m - 1] > x1) tz.pop(), --m; - - var bins = new Array(m + 1), - bin; + return acc; + }; - // Initialize bins. - for (i = 0; i <= m; ++i) { - bin = bins[i] = []; - bin.x0 = i > 0 ? tz[i - 1] : x0; - bin.x1 = i < m ? tz[i] : x1; - } + // In-place division by number + BN.prototype.idivn = function idivn (num) { + assert(num <= 0x3ffffff); - // Assign data to bins by value, ignoring any outside the domain. - for (i = 0; i < n; ++i) { - x = values[i]; - if (x0 <= x && x <= x1) { - bins[bisectRight(tz, x, 0, m)].push(data[i]); - } + var carry = 0; + for (var i = this.length - 1; i >= 0; i--) { + var w = (this.words[i] | 0) + carry * 0x4000000; + this.words[i] = (w / num) | 0; + carry = w % num; } - return bins; - } - - histogram.value = function(_) { - return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value; + return this.strip(); }; - histogram.domain = function(_) { - return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain; + BN.prototype.divn = function divn (num) { + return this.clone().idivn(num); }; - histogram.thresholds = function(_) { - return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold; - }; + BN.prototype.egcd = function egcd (p) { + assert(p.negative === 0); + assert(!p.isZero()); - return histogram; -} + var x = this; + var y = p.clone(); -function quantile(values, p, valueof) { - if (valueof == null) valueof = number; - if (!(n = values.length)) return; - if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values); - if (p >= 1) return +valueof(values[n - 1], n - 1, values); - var n, - i = (n - 1) * p, - i0 = Math.floor(i), - value0 = +valueof(values[i0], i0, values), - value1 = +valueof(values[i0 + 1], i0 + 1, values); - return value0 + (value1 - value0) * (i - i0); -} + if (x.negative !== 0) { + x = x.umod(p); + } else { + x = x.clone(); + } -function freedmanDiaconis(values, min, max) { - values = map.call(values, number).sort(ascending); - return Math.ceil((max - min) / (2 * (quantile(values, 0.75) - quantile(values, 0.25)) * Math.pow(values.length, -1 / 3))); -} + // A * x + B * y = x + var A = new BN(1); + var B = new BN(0); -function scott(values, min, max) { - return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3))); -} + // C * x + D * y = y + var C = new BN(0); + var D = new BN(1); -function max(values, valueof) { - var n = values.length, - i = -1, - value, - max; + var g = 0; - if (valueof == null) { - while (++i < n) { // Find the first comparable value. - if ((value = values[i]) != null && value >= value) { - max = value; - while (++i < n) { // Compare the remaining values. - if ((value = values[i]) != null && value > max) { - max = value; + while (x.isEven() && y.isEven()) { + x.iushrn(1); + y.iushrn(1); + ++g; + } + + var yp = y.clone(); + var xp = x.clone(); + + while (!x.isZero()) { + for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + x.iushrn(i); + while (i-- > 0) { + if (A.isOdd() || B.isOdd()) { + A.iadd(yp); + B.isub(xp); } + + A.iushrn(1); + B.iushrn(1); } } - } - } - else { - while (++i < n) { // Find the first comparable value. - if ((value = valueof(values[i], i, values)) != null && value >= value) { - max = value; - while (++i < n) { // Compare the remaining values. - if ((value = valueof(values[i], i, values)) != null && value > max) { - max = value; + for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + y.iushrn(j); + while (j-- > 0) { + if (C.isOdd() || D.isOdd()) { + C.iadd(yp); + D.isub(xp); } + + C.iushrn(1); + D.iushrn(1); } } + + if (x.cmp(y) >= 0) { + x.isub(y); + A.isub(C); + B.isub(D); + } else { + y.isub(x); + C.isub(A); + D.isub(B); + } } - } - return max; -} + return { + a: C, + b: D, + gcd: y.iushln(g) + }; + }; -function mean(values, valueof) { - var n = values.length, - m = n, - i = -1, - value, - sum = 0; + // This is reduced incarnation of the binary EEA + // above, designated to invert members of the + // _prime_ fields F(p) at a maximal speed + BN.prototype._invmp = function _invmp (p) { + assert(p.negative === 0); + assert(!p.isZero()); - if (valueof == null) { - while (++i < n) { - if (!isNaN(value = number(values[i]))) sum += value; - else --m; - } - } + var a = this; + var b = p.clone(); - else { - while (++i < n) { - if (!isNaN(value = number(valueof(values[i], i, values)))) sum += value; - else --m; + if (a.negative !== 0) { + a = a.umod(p); + } else { + a = a.clone(); } - } - if (m) return sum / m; -} + var x1 = new BN(1); + var x2 = new BN(0); -function median(values, valueof) { - var n = values.length, - i = -1, - value, - numbers = []; + var delta = b.clone(); - if (valueof == null) { - while (++i < n) { - if (!isNaN(value = number(values[i]))) { - numbers.push(value); + while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { + for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + a.iushrn(i); + while (i-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + + x1.iushrn(1); + } } - } - } - else { - while (++i < n) { - if (!isNaN(value = number(valueof(values[i], i, values)))) { - numbers.push(value); + for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + b.iushrn(j); + while (j-- > 0) { + if (x2.isOdd()) { + x2.iadd(delta); + } + + x2.iushrn(1); + } + } + + if (a.cmp(b) >= 0) { + a.isub(b); + x1.isub(x2); + } else { + b.isub(a); + x2.isub(x1); } } - } - return quantile(numbers.sort(ascending), 0.5); -} + var res; + if (a.cmpn(1) === 0) { + res = x1; + } else { + res = x2; + } -function merge(arrays) { - var n = arrays.length, - m, - i = -1, - j = 0, - merged, - array; + if (res.cmpn(0) < 0) { + res.iadd(p); + } - while (++i < n) j += arrays[i].length; - merged = new Array(j); + return res; + }; - while (--n >= 0) { - array = arrays[n]; - m = array.length; - while (--m >= 0) { - merged[--j] = array[m]; - } - } + BN.prototype.gcd = function gcd (num) { + if (this.isZero()) return num.abs(); + if (num.isZero()) return this.abs(); - return merged; -} + var a = this.clone(); + var b = num.clone(); + a.negative = 0; + b.negative = 0; -function min(values, valueof) { - var n = values.length, - i = -1, - value, - min; + // Remove common factor of two + for (var shift = 0; a.isEven() && b.isEven(); shift++) { + a.iushrn(1); + b.iushrn(1); + } - if (valueof == null) { - while (++i < n) { // Find the first comparable value. - if ((value = values[i]) != null && value >= value) { - min = value; - while (++i < n) { // Compare the remaining values. - if ((value = values[i]) != null && min > value) { - min = value; - } - } + do { + while (a.isEven()) { + a.iushrn(1); + } + while (b.isEven()) { + b.iushrn(1); } - } - } - else { - while (++i < n) { // Find the first comparable value. - if ((value = valueof(values[i], i, values)) != null && value >= value) { - min = value; - while (++i < n) { // Compare the remaining values. - if ((value = valueof(values[i], i, values)) != null && min > value) { - min = value; - } - } + var r = a.cmp(b); + if (r < 0) { + // Swap `a` and `b` to make `a` always bigger than `b` + var t = a; + a = b; + b = t; + } else if (r === 0 || b.cmpn(1) === 0) { + break; } - } - } - return min; -} + a.isub(b); + } while (true); -function permute(array, indexes) { - var i = indexes.length, permutes = new Array(i); - while (i--) permutes[i] = array[indexes[i]]; - return permutes; -} + return b.iushln(shift); + }; -function scan(values, compare) { - if (!(n = values.length)) return; - var n, - i = 0, - j = 0, - xi, - xj = values[j]; + // Invert number in the field F(num) + BN.prototype.invm = function invm (num) { + return this.egcd(num).a.umod(num); + }; - if (compare == null) compare = ascending; + BN.prototype.isEven = function isEven () { + return (this.words[0] & 1) === 0; + }; - while (++i < n) { - if (compare(xi = values[i], xj) < 0 || compare(xj, xj) !== 0) { - xj = xi, j = i; + BN.prototype.isOdd = function isOdd () { + return (this.words[0] & 1) === 1; + }; + + // And first word and num + BN.prototype.andln = function andln (num) { + return this.words[0] & num; + }; + + // Increment at the bit position in-line + BN.prototype.bincn = function bincn (bit) { + assert(typeof bit === 'number'); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) { + this._expand(s + 1); + this.words[s] |= q; + return this; } - } - if (compare(xj, xj) === 0) return j; -} + // Add bit and propagate, if needed + var carry = q; + for (var i = s; carry !== 0 && i < this.length; i++) { + var w = this.words[i] | 0; + w += carry; + carry = w >>> 26; + w &= 0x3ffffff; + this.words[i] = w; + } + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + return this; + }; -function shuffle(array, i0, i1) { - var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0), - t, - i; + BN.prototype.isZero = function isZero () { + return this.length === 1 && this.words[0] === 0; + }; - while (m) { - i = Math.random() * m-- | 0; - t = array[m + i0]; - array[m + i0] = array[i + i0]; - array[i + i0] = t; - } + BN.prototype.cmpn = function cmpn (num) { + var negative = num < 0; - return array; -} + if (this.negative !== 0 && !negative) return -1; + if (this.negative === 0 && negative) return 1; -function sum(values, valueof) { - var n = values.length, - i = -1, - value, - sum = 0; + this.strip(); - if (valueof == null) { - while (++i < n) { - if (value = +values[i]) sum += value; // Note: zero and null are equivalent. - } - } + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } - else { - while (++i < n) { - if (value = +valueof(values[i], i, values)) sum += value; + assert(num <= 0x3ffffff, 'Number is too big'); + + var w = this.words[0] | 0; + res = w === num ? 0 : w < num ? -1 : 1; } - } + if (this.negative !== 0) return -res | 0; + return res; + }; - return sum; -} + // Compare two numbers and return: + // 1 - if `this` > `num` + // 0 - if `this` == `num` + // -1 - if `this` < `num` + BN.prototype.cmp = function cmp (num) { + if (this.negative !== 0 && num.negative === 0) return -1; + if (this.negative === 0 && num.negative !== 0) return 1; -function transpose(matrix) { - if (!(n = matrix.length)) return []; - for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) { - for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) { - row[j] = matrix[j][i]; + var res = this.ucmp(num); + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Unsigned comparison + BN.prototype.ucmp = function ucmp (num) { + // At this point both numbers have the same sign + if (this.length > num.length) return 1; + if (this.length < num.length) return -1; + + var res = 0; + for (var i = this.length - 1; i >= 0; i--) { + var a = this.words[i] | 0; + var b = num.words[i] | 0; + + if (a === b) continue; + if (a < b) { + res = -1; + } else if (a > b) { + res = 1; + } + break; } - } - return transpose; -} + return res; + }; -function length(d) { - return d.length; -} + BN.prototype.gtn = function gtn (num) { + return this.cmpn(num) === 1; + }; -function zip() { - return transpose(arguments); -} + BN.prototype.gt = function gt (num) { + return this.cmp(num) === 1; + }; -exports.bisect = bisectRight; -exports.bisectRight = bisectRight; -exports.bisectLeft = bisectLeft; -exports.ascending = ascending; -exports.bisector = bisector; -exports.cross = cross; -exports.descending = descending; -exports.deviation = deviation; -exports.extent = extent; -exports.histogram = histogram; -exports.thresholdFreedmanDiaconis = freedmanDiaconis; -exports.thresholdScott = scott; -exports.thresholdSturges = sturges; -exports.max = max; -exports.mean = mean; -exports.median = median; -exports.merge = merge; -exports.min = min; -exports.pairs = pairs; -exports.permute = permute; -exports.quantile = quantile; -exports.range = range; -exports.scan = scan; -exports.shuffle = shuffle; -exports.sum = sum; -exports.ticks = ticks; -exports.tickIncrement = tickIncrement; -exports.tickStep = tickStep; -exports.transpose = transpose; -exports.variance = variance; -exports.zip = zip; + BN.prototype.gten = function gten (num) { + return this.cmpn(num) >= 0; + }; -Object.defineProperty(exports, '__esModule', { value: true }); + BN.prototype.gte = function gte (num) { + return this.cmp(num) >= 0; + }; -}))); + BN.prototype.ltn = function ltn (num) { + return this.cmpn(num) === -1; + }; -},{}],64:[function(_dereq_,module,exports){ -// https://d3js.org/d3-collection/ v1.0.7 Copyright 2018 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(factory((global.d3 = global.d3 || {}))); -}(this, (function (exports) { 'use strict'; + BN.prototype.lt = function lt (num) { + return this.cmp(num) === -1; + }; -var prefix = "$"; + BN.prototype.lten = function lten (num) { + return this.cmpn(num) <= 0; + }; -function Map() {} + BN.prototype.lte = function lte (num) { + return this.cmp(num) <= 0; + }; -Map.prototype = map.prototype = { - constructor: Map, - has: function(key) { - return (prefix + key) in this; - }, - get: function(key) { - return this[prefix + key]; - }, - set: function(key, value) { - this[prefix + key] = value; + BN.prototype.eqn = function eqn (num) { + return this.cmpn(num) === 0; + }; + + BN.prototype.eq = function eq (num) { + return this.cmp(num) === 0; + }; + + // + // A reduce context, could be using montgomery or something better, depending + // on the `m` itself. + // + BN.red = function red (num) { + return new Red(num); + }; + + BN.prototype.toRed = function toRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + assert(this.negative === 0, 'red works only with positives'); + return ctx.convertTo(this)._forceRed(ctx); + }; + + BN.prototype.fromRed = function fromRed () { + assert(this.red, 'fromRed works only with numbers in reduction context'); + return this.red.convertFrom(this); + }; + + BN.prototype._forceRed = function _forceRed (ctx) { + this.red = ctx; return this; - }, - remove: function(key) { - var property = prefix + key; - return property in this && delete this[property]; - }, - clear: function() { - for (var property in this) if (property[0] === prefix) delete this[property]; - }, - keys: function() { - var keys = []; - for (var property in this) if (property[0] === prefix) keys.push(property.slice(1)); - return keys; - }, - values: function() { - var values = []; - for (var property in this) if (property[0] === prefix) values.push(this[property]); - return values; - }, - entries: function() { - var entries = []; - for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]}); - return entries; - }, - size: function() { - var size = 0; - for (var property in this) if (property[0] === prefix) ++size; - return size; - }, - empty: function() { - for (var property in this) if (property[0] === prefix) return false; - return true; - }, - each: function(f) { - for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this); + }; + + BN.prototype.forceRed = function forceRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + return this._forceRed(ctx); + }; + + BN.prototype.redAdd = function redAdd (num) { + assert(this.red, 'redAdd works only with red numbers'); + return this.red.add(this, num); + }; + + BN.prototype.redIAdd = function redIAdd (num) { + assert(this.red, 'redIAdd works only with red numbers'); + return this.red.iadd(this, num); + }; + + BN.prototype.redSub = function redSub (num) { + assert(this.red, 'redSub works only with red numbers'); + return this.red.sub(this, num); + }; + + BN.prototype.redISub = function redISub (num) { + assert(this.red, 'redISub works only with red numbers'); + return this.red.isub(this, num); + }; + + BN.prototype.redShl = function redShl (num) { + assert(this.red, 'redShl works only with red numbers'); + return this.red.shl(this, num); + }; + + BN.prototype.redMul = function redMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + + BN.prototype.redIMul = function redIMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + + BN.prototype.redSqr = function redSqr () { + assert(this.red, 'redSqr works only with red numbers'); + this.red._verify1(this); + return this.red.sqr(this); + }; + + BN.prototype.redISqr = function redISqr () { + assert(this.red, 'redISqr works only with red numbers'); + this.red._verify1(this); + return this.red.isqr(this); + }; + + // Square root over p + BN.prototype.redSqrt = function redSqrt () { + assert(this.red, 'redSqrt works only with red numbers'); + this.red._verify1(this); + return this.red.sqrt(this); + }; + + BN.prototype.redInvm = function redInvm () { + assert(this.red, 'redInvm works only with red numbers'); + this.red._verify1(this); + return this.red.invm(this); + }; + + // Return negative clone of `this` % `red modulo` + BN.prototype.redNeg = function redNeg () { + assert(this.red, 'redNeg works only with red numbers'); + this.red._verify1(this); + return this.red.neg(this); + }; + + BN.prototype.redPow = function redPow (num) { + assert(this.red && !num.red, 'redPow(normalNum)'); + this.red._verify1(this); + return this.red.pow(this, num); + }; + + // Prime numbers with efficient reduction + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + + // Pseudo-Mersenne prime + function MPrime (name, p) { + // P = 2 ^ N - K + this.name = name; + this.p = new BN(p, 16); + this.n = this.p.bitLength(); + this.k = new BN(1).iushln(this.n).isub(this.p); + + this.tmp = this._tmp(); } -}; -function map(object, f) { - var map = new Map; + MPrime.prototype._tmp = function _tmp () { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; - // Copy constructor. - if (object instanceof Map) object.each(function(value, key) { map.set(key, value); }); + MPrime.prototype.ireduce = function ireduce (num) { + // Assumes that `num` is less than `P^2` + // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) + var r = num; + var rlen; - // Index array by numeric index or specified key function. - else if (Array.isArray(object)) { - var i = -1, - n = object.length, - o; + do { + this.split(r, this.tmp); + r = this.imulK(r); + r = r.iadd(this.tmp); + rlen = r.bitLength(); + } while (rlen > this.n); + + var cmp = rlen < this.n ? -1 : r.ucmp(this.p); + if (cmp === 0) { + r.words[0] = 0; + r.length = 1; + } else if (cmp > 0) { + r.isub(this.p); + } else { + r.strip(); + } - if (f == null) while (++i < n) map.set(i, object[i]); - else while (++i < n) map.set(f(o = object[i], i, object), o); + return r; + }; + + MPrime.prototype.split = function split (input, out) { + input.iushrn(this.n, 0, out); + }; + + MPrime.prototype.imulK = function imulK (num) { + return num.imul(this.k); + }; + + function K256 () { + MPrime.call( + this, + 'k256', + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); } + inherits(K256, MPrime); - // Convert object to map. - else if (object) for (var key in object) map.set(key, object[key]); + K256.prototype.split = function split (input, output) { + // 256 = 9 * 26 + 22 + var mask = 0x3fffff; - return map; -} + var outLen = Math.min(input.length, 9); + for (var i = 0; i < outLen; i++) { + output.words[i] = input.words[i]; + } + output.length = outLen; -function nest() { - var keys = [], - sortKeys = [], - sortValues, - rollup, - nest; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } - function apply(array, depth, createResult, setResult) { - if (depth >= keys.length) { - if (sortValues != null) array.sort(sortValues); - return rollup != null ? rollup(array) : array; + // Shift by 9 limbs + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + + for (i = 10; i < input.length; i++) { + var next = input.words[i] | 0; + input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); + prev = next; + } + prev >>>= 22; + input.words[i - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; } + }; - var i = -1, - n = array.length, - key = keys[depth++], - keyValue, - value, - valuesByKey = map(), - values, - result = createResult(); + K256.prototype.imulK = function imulK (num) { + // K = 0x1000003d1 = [ 0x40, 0x3d1 ] + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; - while (++i < n) { - if (values = valuesByKey.get(keyValue = key(value = array[i]) + "")) { - values.push(value); - } else { - valuesByKey.set(keyValue, [value]); + // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 + var lo = 0; + for (var i = 0; i < num.length; i++) { + var w = num.words[i] | 0; + lo += w * 0x3d1; + num.words[i] = lo & 0x3ffffff; + lo = w * 0x40 + ((lo / 0x4000000) | 0); + } + + // Fast length reduction + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; } } + return num; + }; - valuesByKey.each(function(values, key) { - setResult(result, key, apply(values, depth, createResult, setResult)); - }); + function P224 () { + MPrime.call( + this, + 'p224', + 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); + } + inherits(P224, MPrime); - return result; + function P192 () { + MPrime.call( + this, + 'p192', + 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); } + inherits(P192, MPrime); - function entries(map$$1, depth) { - if (++depth > keys.length) return map$$1; - var array, sortKey = sortKeys[depth - 1]; - if (rollup != null && depth >= keys.length) array = map$$1.entries(); - else array = [], map$$1.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); }); - return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array; + function P25519 () { + // 2 ^ 255 - 19 + MPrime.call( + this, + '25519', + '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); } + inherits(P25519, MPrime); - return nest = { - object: function(array) { return apply(array, 0, createObject, setObject); }, - map: function(array) { return apply(array, 0, createMap, setMap); }, - entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); }, - key: function(d) { keys.push(d); return nest; }, - sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; }, - sortValues: function(order) { sortValues = order; return nest; }, - rollup: function(f) { rollup = f; return nest; } + P25519.prototype.imulK = function imulK (num) { + // K = 0x13 + var carry = 0; + for (var i = 0; i < num.length; i++) { + var hi = (num.words[i] | 0) * 0x13 + carry; + var lo = hi & 0x3ffffff; + hi >>>= 26; + + num.words[i] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; }; -} -function createObject() { - return {}; -} + // Exported mostly for testing purposes, use plain name instead + BN._prime = function prime (name) { + // Cached version of prime + if (primes[name]) return primes[name]; -function setObject(object, key, value) { - object[key] = value; -} + var prime; + if (name === 'k256') { + prime = new K256(); + } else if (name === 'p224') { + prime = new P224(); + } else if (name === 'p192') { + prime = new P192(); + } else if (name === 'p25519') { + prime = new P25519(); + } else { + throw new Error('Unknown prime ' + name); + } + primes[name] = prime; -function createMap() { - return map(); -} + return prime; + }; -function setMap(map$$1, key, value) { - map$$1.set(key, value); -} + // + // Base reduction engine + // + function Red (m) { + if (typeof m === 'string') { + var prime = BN._prime(m); + this.m = prime.p; + this.prime = prime; + } else { + assert(m.gtn(1), 'modulus must be greater than 1'); + this.m = m; + this.prime = null; + } + } -function Set() {} + Red.prototype._verify1 = function _verify1 (a) { + assert(a.negative === 0, 'red works only with positives'); + assert(a.red, 'red works only with red numbers'); + }; -var proto = map.prototype; + Red.prototype._verify2 = function _verify2 (a, b) { + assert((a.negative | b.negative) === 0, 'red works only with positives'); + assert(a.red && a.red === b.red, + 'red works only with red numbers'); + }; -Set.prototype = set.prototype = { - constructor: Set, - has: proto.has, - add: function(value) { - value += ""; - this[prefix + value] = value; - return this; - }, - remove: proto.remove, - clear: proto.clear, - values: proto.keys, - size: proto.size, - empty: proto.empty, - each: proto.each -}; + Red.prototype.imod = function imod (a) { + if (this.prime) return this.prime.ireduce(a)._forceRed(this); + return a.umod(this.m)._forceRed(this); + }; -function set(object, f) { - var set = new Set; + Red.prototype.neg = function neg (a) { + if (a.isZero()) { + return a.clone(); + } - // Copy constructor. - if (object instanceof Set) object.each(function(value) { set.add(value); }); + return this.m.sub(a)._forceRed(this); + }; - // Otherwise, assume it’s an array. - else if (object) { - var i = -1, n = object.length; - if (f == null) while (++i < n) set.add(object[i]); - else while (++i < n) set.add(f(object[i], i, object)); - } + Red.prototype.add = function add (a, b) { + this._verify2(a, b); - return set; -} + var res = a.add(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; -function keys(map) { - var keys = []; - for (var key in map) keys.push(key); - return keys; -} + Red.prototype.iadd = function iadd (a, b) { + this._verify2(a, b); -function values(map) { - var values = []; - for (var key in map) values.push(map[key]); - return values; -} + var res = a.iadd(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; -function entries(map) { - var entries = []; - for (var key in map) entries.push({key: key, value: map[key]}); - return entries; -} + Red.prototype.sub = function sub (a, b) { + this._verify2(a, b); -exports.nest = nest; -exports.set = set; -exports.map = map; -exports.keys = keys; -exports.values = values; -exports.entries = entries; + var res = a.sub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; -Object.defineProperty(exports, '__esModule', { value: true }); + Red.prototype.isub = function isub (a, b) { + this._verify2(a, b); -}))); + var res = a.isub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; -},{}],65:[function(_dereq_,module,exports){ -// https://d3js.org/d3-color/ v1.4.1 Copyright 2020 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {})); -}(this, function (exports) { 'use strict'; + Red.prototype.shl = function shl (a, num) { + this._verify1(a); + return this.imod(a.ushln(num)); + }; -function define(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; -} + Red.prototype.imul = function imul (a, b) { + this._verify2(a, b); + return this.imod(a.imul(b)); + }; -function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; -} + Red.prototype.mul = function mul (a, b) { + this._verify2(a, b); + return this.imod(a.mul(b)); + }; -function Color() {} + Red.prototype.isqr = function isqr (a) { + return this.imul(a, a.clone()); + }; -var darker = 0.7; -var brighter = 1 / darker; + Red.prototype.sqr = function sqr (a) { + return this.mul(a, a); + }; -var reI = "\\s*([+-]?\\d+)\\s*", - reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), - reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), - reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), - reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), - reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), - reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); + Red.prototype.sqrt = function sqrt (a) { + if (a.isZero()) return a.clone(); -var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 -}; + var mod3 = this.m.andln(3); + assert(mod3 % 2 === 1); -define(Color, color, { - copy: function(channels) { - return Object.assign(new this.constructor, this, channels); - }, - displayable: function() { - return this.rgb().displayable(); - }, - hex: color_formatHex, // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb -}); + // Fast case + if (mod3 === 3) { + var pow = this.m.add(new BN(1)).iushrn(2); + return this.pow(a, pow); + } -function color_formatHex() { - return this.rgb().formatHex(); -} + // Tonelli-Shanks algorithm (Totally unoptimized and slow) + // + // Find Q and S, that Q * 2 ^ S = (P - 1) + var q = this.m.subn(1); + var s = 0; + while (!q.isZero() && q.andln(1) === 0) { + s++; + q.iushrn(1); + } + assert(!q.isZero()); -function color_formatHsl() { - return hslConvert(this).formatHsl(); -} + var one = new BN(1).toRed(this); + var nOne = one.redNeg(); -function color_formatRgb() { - return this.rgb().formatRgb(); -} + // Find quadratic non-residue + // NOTE: Max is such because of generalized Riemann hypothesis. + var lpow = this.m.subn(1).iushrn(1); + var z = this.m.bitLength(); + z = new BN(2 * z * z).toRed(this); -function color(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 - : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 - : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 - : null) // invalid hex - : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) - : null; -} + while (this.pow(z, lpow).cmp(nOne) !== 0) { + z.redIAdd(nOne); + } -function rgbn(n) { - return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); -} + var c = this.pow(z, q); + var r = this.pow(a, q.addn(1).iushrn(1)); + var t = this.pow(a, q); + var m = s; + while (t.cmp(one) !== 0) { + var tmp = t; + for (var i = 0; tmp.cmp(one) !== 0; i++) { + tmp = tmp.redSqr(); + } + assert(i < m); + var b = this.pow(c, new BN(1).iushln(m - i - 1)); -function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); -} + r = r.redMul(b); + c = b.redSqr(); + t = t.redMul(c); + m = i; + } -function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb; - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); -} + return r; + }; -function rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); -} + Red.prototype.invm = function invm (a) { + var inv = a._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; -function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; -} + Red.prototype.pow = function pow (a, num) { + if (num.isZero()) return new BN(1).toRed(this); + if (num.cmpn(1) === 0) return a.clone(); -define(Rgb, rgb, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function() { - return this; - }, - displayable: function() { - return (-0.5 <= this.r && this.r < 255.5) - && (-0.5 <= this.g && this.g < 255.5) - && (-0.5 <= this.b && this.b < 255.5) - && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb -})); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this); + wnd[1] = a; + for (var i = 2; i < wnd.length; i++) { + wnd[i] = this.mul(wnd[i - 1], a); + } -function rgb_formatHex() { - return "#" + hex(this.r) + hex(this.g) + hex(this.b); -} + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } -function rgb_formatRgb() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") - + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.b) || 0)) - + (a === 1 ? ")" : ", " + a + ")"); -} + for (i = num.length - 1; i >= 0; i--) { + var word = num.words[i]; + for (var j = start - 1; j >= 0; j--) { + var bit = (word >> j) & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } -function hex(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); -} + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } -function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN; - else if (l <= 0 || l >= 1) h = s = NaN; - else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); -} + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; -function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl; - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6; - else if (g === max) h = (b - r) / s + 2; - else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); -} + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } -function hsl(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); -} + return res; + }; -function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; -} + Red.prototype.convertTo = function convertTo (num) { + var r = num.umod(this.m); -define(Hsl, hsl, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - displayable: function() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) - && (0 <= this.l && this.l <= 1) - && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl: function() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") - + (this.h || 0) + ", " - + (this.s || 0) * 100 + "%, " - + (this.l || 0) * 100 + "%" - + (a === 1 ? ")" : ", " + a + ")"); + return r === num ? r.clone() : r; + }; + + Red.prototype.convertFrom = function convertFrom (num) { + var res = num.clone(); + res.red = null; + return res; + }; + + // + // Montgomery method engine + // + + BN.mont = function mont (num) { + return new Mont(num); + }; + + function Mont (m) { + Red.call(this, m); + + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - (this.shift % 26); + } + + this.r = new BN(1).iushln(this.shift); + this.r2 = this.imod(this.r.sqr()); + this.rinv = this.r._invmp(this.m); + + this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); + this.minv = this.minv.umod(this.r); + this.minv = this.r.sub(this.minv); } -})); + inherits(Mont, Red); -/* From FvD 13.37, CSS Color Module Level 3 */ -function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 - : h < 180 ? m2 - : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 - : m1) * 255; -} + Mont.prototype.convertTo = function convertTo (num) { + return this.imod(num.ushln(this.shift)); + }; -var deg2rad = Math.PI / 180; -var rad2deg = 180 / Math.PI; + Mont.prototype.convertFrom = function convertFrom (num) { + var r = this.imod(num.mul(this.rinv)); + r.red = null; + return r; + }; -// https://observablehq.com/@mbostock/lab-and-rgb -var K = 18, - Xn = 0.96422, - Yn = 1, - Zn = 0.82521, - t0 = 4 / 29, - t1 = 6 / 29, - t2 = 3 * t1 * t1, - t3 = t1 * t1 * t1; + Mont.prototype.imul = function imul (a, b) { + if (a.isZero() || b.isZero()) { + a.words[0] = 0; + a.length = 1; + return a; + } -function labConvert(o) { - if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); - if (o instanceof Hcl) return hcl2lab(o); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = rgb2lrgb(o.r), - g = rgb2lrgb(o.g), - b = rgb2lrgb(o.b), - y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; - if (r === g && g === b) x = z = y; else { - x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); + var t = a.imul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.mul = function mul (a, b) { + if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); + + var t = a.mul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.invm = function invm (a) { + // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R + var res = this.imod(a._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; +})(typeof module === 'undefined' || module, this); + +},{"buffer":103}],95:[function(_dereq_,module,exports){ +'use strict' + +module.exports = boundary + +function boundary (cells) { + var i, j, k + var n = cells.length + var sz = 0 + for (i = 0; i < n; ++i) { + sz += cells[i].length } - return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); + var result = new Array(sz) + var ptr = 0 + for (i = 0; i < n; ++i) { + var c = cells[i] + var d = c.length + for (j = 0; j < d; ++j) { + var b = result[ptr++] = new Array(d - 1) + var p = 0 + for (k = 0; k < d; ++k) { + if (k === j) { + continue + } + b[p++] = c[k] + } + if (j & 1) { + var tmp = b[1] + b[1] = b[0] + b[0] = tmp + } + } + } + return result } -function gray(l, opacity) { - return new Lab(l, 0, 0, opacity == null ? 1 : opacity); -} +},{}],96:[function(_dereq_,module,exports){ +'use strict' -function lab(l, a, b, opacity) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); +module.exports = boxIntersectWrapper + +var pool = _dereq_('typedarray-pool') +var sweep = _dereq_('./lib/sweep') +var boxIntersectIter = _dereq_('./lib/intersect') + +function boxEmpty(d, box) { + for(var j=0; j t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; -} + //Compute dimension, if it is 0 then we skip + var d = (red[0].length)>>>1 + if(d <= 0) { + return + } -function lab2xyz(t) { - return t > t1 ? t * t * t : t2 * (t - t0); -} + var retval -function lrgb2rgb(x) { - return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); -} + //Convert red boxes + var redList = pool.mallocDouble(2*d*n) + var redIds = pool.mallocInt32(n) + n = convertBoxes(red, d, redList, redIds) -function rgb2lrgb(x) { - return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); -} + if(n > 0) { + if(d === 1 && full) { + //Special case: 1d complete + sweep.init(n) + retval = sweep.sweepComplete( + d, visit, + 0, n, redList, redIds, + 0, n, redList, redIds) + } else { -function hclConvert(o) { - if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) o = labConvert(o); - if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * rad2deg; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); -} + //Convert blue boxes + var blueList = pool.mallocDouble(2*d*m) + var blueIds = pool.mallocInt32(m) + m = convertBoxes(blue, d, blueList, blueIds) -function lch(l, c, h, opacity) { - return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); -} + if(m > 0) { + sweep.init(n+m) -function hcl(h, c, l, opacity) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); -} + if(d === 1) { + //Special case: 1d bipartite + retval = sweep.sweepBipartite( + d, visit, + 0, n, redList, redIds, + 0, m, blueList, blueIds) + } else { + //General case: d>1 + retval = boxIntersectIter( + d, visit, full, + n, redList, redIds, + m, blueList, blueIds) + } -function Hcl(h, c, l, opacity) { - this.h = +h; - this.c = +c; - this.l = +l; - this.opacity = +opacity; -} + pool.free(blueList) + pool.free(blueIds) + } + } -function hcl2lab(o) { - if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * deg2rad; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); + pool.free(redList) + pool.free(redIds) + } + + return retval } -define(Hcl, hcl, extend(Color, { - brighter: function(k) { - return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); - }, - darker: function(k) { - return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); - }, - rgb: function() { - return hcl2lab(this).rgb(); - } -})); -var A = -0.14861, - B = +1.78277, - C = -0.29227, - D = -0.90649, - E = +1.97294, - ED = E * D, - EB = E * B, - BC_DA = B * C - D * A; +var RESULT -function cubehelixConvert(o) { - if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), - bl = b - l, - k = (E * (g - l) - C * bl) / D, - s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 - h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; - return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); +function appendItem(i,j) { + RESULT.push([i,j]) } -function cubehelix(h, s, l, opacity) { - return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); +function intersectFullArray(x) { + RESULT = [] + boxIntersect(x, x, appendItem, true) + return RESULT } -function Cubehelix(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; +function intersectBipartiteArray(x, y) { + RESULT = [] + boxIntersect(x, y, appendItem, false) + return RESULT } -define(Cubehelix, cubehelix, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, - l = +this.l, - a = isNaN(this.s) ? 0 : this.s * l * (1 - l), - cosh = Math.cos(h), - sinh = Math.sin(h); - return new Rgb( - 255 * (l + a * (A * cosh + B * sinh)), - 255 * (l + a * (C * cosh + D * sinh)), - 255 * (l + a * (E * cosh)), - this.opacity - ); +//User-friendly wrapper, handle full input and no-visitor cases +function boxIntersectWrapper(arg0, arg1, arg2) { + switch(arguments.length) { + case 1: + return intersectFullArray(arg0) + case 2: + if(typeof arg1 === 'function') { + return boxIntersect(arg0, arg0, arg1, true) + } else { + return intersectBipartiteArray(arg0, arg1) + } + case 3: + return boxIntersect(arg0, arg1, arg2, false) + default: + throw new Error('box-intersect: Invalid arguments') } -})); +} +},{"./lib/intersect":98,"./lib/sweep":102,"typedarray-pool":477}],97:[function(_dereq_,module,exports){ +'use strict' -exports.color = color; -exports.cubehelix = cubehelix; -exports.gray = gray; -exports.hcl = hcl; -exports.hsl = hsl; -exports.lab = lab; -exports.lch = lch; -exports.rgb = rgb; - -Object.defineProperty(exports, '__esModule', { value: true }); - -})); - -},{}],66:[function(_dereq_,module,exports){ -// https://d3js.org/d3-dispatch/ v1.0.6 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {})); -}(this, function (exports) { 'use strict'; - -var noop = {value: function() {}}; - -function dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; +function full() { + function bruteForceRedFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], y1 = bb[ax + bp + d], yi = bi[j] + if (y1 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } } - return new Dispatch(_); -} - -function Dispatch(_) { - this._ = _; -} - -function parseTypenames(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return {type: t, name: name}; - }); + function bruteForceBlueFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], y1 = bb[ax + bp + d], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y1 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } + } + function bruteForceFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + if (re - rs > be - bs) { + return bruteForceRedFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlueFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + return bruteForceFull } -Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _ = this._, - T = parseTypenames(typename + "", _), - t, - i = -1, - n = T.length; - - // If no callback was specified, return the callback of the given type and name. - if (arguments.length < 2) { - while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; - return; +function partial() { + function bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } } - - // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); - else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); + } + function bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } } - - return this; - }, - copy: function() { - var copy = {}, _ = this._; - for (var t in _) copy[t] = _[t].slice(); - return new Dispatch(copy); - }, - call: function(type, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - }, - apply: function(type, that, args) { - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); } -}; - -function get(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; + function bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } } } -} - -function set(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); - break; + function bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } } } - if (callback != null) type.push({name: name, value: callback}); - return type; + function bruteForcePartial(d, ax, vv, fp, rs, re, rb, ri, bs, be, bb, bi) { + if (re - rs > be - bs) { + if (fp) { + return bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + else { + if (fp) { + return bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + } + return bruteForcePartial } -exports.dispatch = dispatch; - -Object.defineProperty(exports, '__esModule', { value: true }); - -})); - -},{}],67:[function(_dereq_,module,exports){ -// https://d3js.org/d3-force/ v1.2.1 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-quadtree'), _dereq_('d3-collection'), _dereq_('d3-dispatch'), _dereq_('d3-timer')) : -typeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree', 'd3-collection', 'd3-dispatch', 'd3-timer'], factory) : -(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3)); -}(this, (function (exports,d3Quadtree,d3Collection,d3Dispatch,d3Timer) { 'use strict'; - -function center(x, y) { - var nodes; +function bruteForcePlanner(isFull) { + return isFull ? full() : partial() - if (x == null) x = 0; - if (y == null) y = 0; +} - function force() { - var i, - n = nodes.length, - node, - sx = 0, - sy = 0; +exports.partial = bruteForcePlanner(false) +exports.full = bruteForcePlanner(true) +},{}],98:[function(_dereq_,module,exports){ +'use strict' - for (i = 0; i < n; ++i) { - node = nodes[i], sx += node.x, sy += node.y; +module.exports = boxIntersectIter + +var pool = _dereq_('typedarray-pool') +var bits = _dereq_('bit-twiddle') +var bruteForce = _dereq_('./brute') +var bruteForcePartial = bruteForce.partial +var bruteForceFull = bruteForce.full +var sweep = _dereq_('./sweep') +var findMedian = _dereq_('./median') +var genPartition = _dereq_('./partition') + +//Twiddle parameters +var BRUTE_FORCE_CUTOFF = 128 //Cut off for brute force search +var SCAN_CUTOFF = (1<<22) //Cut off for two way scan +var SCAN_COMPLETE_CUTOFF = (1<<22) + +//Partition functions +var partitionInteriorContainsInterval = genPartition( + '!(lo>=p0)&&!(p1>=hi)') + +var partitionStartEqual = genPartition( + 'lo===p0') + +var partitionStartLessThan = genPartition( + 'lo 0) { + top -= 1 + + var iptr = top * IFRAME_SIZE + var axis = BOX_ISTACK[iptr] + var redStart = BOX_ISTACK[iptr+1] + var redEnd = BOX_ISTACK[iptr+2] + var blueStart = BOX_ISTACK[iptr+3] + var blueEnd = BOX_ISTACK[iptr+4] + var state = BOX_ISTACK[iptr+5] + + var dptr = top * DFRAME_SIZE + var lo = BOX_DSTACK[dptr] + var hi = BOX_DSTACK[dptr+1] + + //Unpack state info + var flip = (state & 1) + var full = !!(state & 16) + + //Unpack indices + var red = xBoxes + var redIndex = xIndex + var blue = yBoxes + var blueIndex = yIndex + if(flip) { + red = yBoxes + redIndex = yIndex + blue = xBoxes + blueIndex = xIndex + } + + if(state & 2) { + redEnd = partitionStartLessThan( + d, axis, + redStart, redEnd, red, redIndex, + hi) + if(redStart >= redEnd) { + continue + } + } + if(state & 4) { + redStart = partitionEndLessThanEqual( + d, axis, + redStart, redEnd, red, redIndex, + lo) + if(redStart >= redEnd) { + continue + } + } -function constant(x) { - return function() { - return x; - }; -} + var redCount = redEnd - redStart + var blueCount = blueEnd - blueStart -function jiggle() { - return (Math.random() - 0.5) * 1e-6; -} + if(full) { + if(d * redCount * (redCount + blueCount) < SCAN_COMPLETE_CUTOFF) { + retval = sweep.scanComplete( + d, axis, visit, + redStart, redEnd, red, redIndex, + blueStart, blueEnd, blue, blueIndex) + if(retval !== void 0) { + return retval + } + continue + } + } else { + if(d * Math.min(redCount, blueCount) < BRUTE_FORCE_CUTOFF) { + //If input small, then use brute force + retval = bruteForcePartial( + d, axis, visit, flip, + redStart, redEnd, red, redIndex, + blueStart, blueEnd, blue, blueIndex) + if(retval !== void 0) { + return retval + } + continue + } else if(d * redCount * blueCount < SCAN_CUTOFF) { + //If input medium sized, then use sweep and prune + retval = sweep.scanBipartite( + d, axis, visit, flip, + redStart, redEnd, red, redIndex, + blueStart, blueEnd, blue, blueIndex) + if(retval !== void 0) { + return retval + } + continue + } + } -function x(d) { - return d.x + d.vx; -} + //First, find all red intervals whose interior contains (lo,hi) + var red0 = partitionInteriorContainsInterval( + d, axis, + redStart, redEnd, red, redIndex, + lo, hi) -function y(d) { - return d.y + d.vy; -} + //Lower dimensional case + if(redStart < red0) { -function collide(radius) { - var nodes, - radii, - strength = 1, - iterations = 1; + if(d * (red0 - redStart) < BRUTE_FORCE_CUTOFF) { + //Special case for small inputs: use brute force + retval = bruteForceFull( + d, axis+1, visit, + redStart, red0, red, redIndex, + blueStart, blueEnd, blue, blueIndex) + if(retval !== void 0) { + return retval + } + } else if(axis === d-2) { + if(flip) { + retval = sweep.sweepBipartite( + d, visit, + blueStart, blueEnd, blue, blueIndex, + redStart, red0, red, redIndex) + } else { + retval = sweep.sweepBipartite( + d, visit, + redStart, red0, red, redIndex, + blueStart, blueEnd, blue, blueIndex) + } + if(retval !== void 0) { + return retval + } + } else { + iterPush(top++, + axis+1, + redStart, red0, + blueStart, blueEnd, + flip, + -Infinity, Infinity) + iterPush(top++, + axis+1, + blueStart, blueEnd, + redStart, red0, + flip^1, + -Infinity, Infinity) + } + } - if (typeof radius !== "function") radius = constant(radius == null ? 1 : +radius); + //Divide and conquer phase + if(red0 < redEnd) { - function force() { - var i, n = nodes.length, - tree, - node, - xi, - yi, - ri, - ri2; + //Cut blue into 3 parts: + // + // Points < mid point + // Points = mid point + // Points > mid point + // + var blue0 = findMedian( + d, axis, + blueStart, blueEnd, blue, blueIndex) + var mid = blue[elemSize * blue0 + axis] + var blue1 = partitionStartEqual( + d, axis, + blue0, blueEnd, blue, blueIndex, + mid) + + //Right case + if(blue1 < blueEnd) { + iterPush(top++, + axis, + red0, redEnd, + blue1, blueEnd, + (flip|4) + (full ? 16 : 0), + mid, hi) + } - for (var k = 0; k < iterations; ++k) { - tree = d3Quadtree.quadtree(nodes, x, y).visitAfter(prepare); - for (i = 0; i < n; ++i) { - node = nodes[i]; - ri = radii[node.index], ri2 = ri * ri; - xi = node.x + node.vx; - yi = node.y + node.vy; - tree.visit(apply); + //Left case + if(blueStart < blue0) { + iterPush(top++, + axis, + red0, redEnd, + blueStart, blue0, + (flip|2) + (full ? 16 : 0), + lo, mid) } - } - function apply(quad, x0, y0, x1, y1) { - var data = quad.data, rj = quad.r, r = ri + rj; - if (data) { - if (data.index > node.index) { - var x = xi - data.x - data.vx, - y = yi - data.y - data.vy, - l = x * x + y * y; - if (l < r * r) { - if (x === 0) x = jiggle(), l += x * x; - if (y === 0) y = jiggle(), l += y * y; - l = (r - (l = Math.sqrt(l))) / l * strength; - node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj)); - node.vy += (y *= l) * r; - data.vx -= x * (r = 1 - r); - data.vy -= y * r; + //Center case (the hard part) + if(blue0 + 1 === blue1) { + //Optimization: Range with exactly 1 point, use a brute force scan + if(full) { + retval = onePointFull( + d, axis, visit, + red0, redEnd, red, redIndex, + blue0, blue, blueIndex[blue0]) + } else { + retval = onePointPartial( + d, axis, visit, flip, + red0, redEnd, red, redIndex, + blue0, blue, blueIndex[blue0]) + } + if(retval !== void 0) { + return retval + } + } else if(blue0 < blue1) { + var red1 + if(full) { + //If full intersection, need to handle special case + red1 = partitionContainsPoint( + d, axis, + red0, redEnd, red, redIndex, + mid) + if(red0 < red1) { + var redX = partitionStartEqual( + d, axis, + red0, red1, red, redIndex, + mid) + if(axis === d-2) { + //Degenerate sweep intersection: + // [red0, redX] with [blue0, blue1] + if(red0 < redX) { + retval = sweep.sweepComplete( + d, visit, + red0, redX, red, redIndex, + blue0, blue1, blue, blueIndex) + if(retval !== void 0) { + return retval + } + } + + //Normal sweep intersection: + // [redX, red1] with [blue0, blue1] + if(redX < red1) { + retval = sweep.sweepBipartite( + d, visit, + redX, red1, red, redIndex, + blue0, blue1, blue, blueIndex) + if(retval !== void 0) { + return retval + } + } + } else { + if(red0 < redX) { + iterPush(top++, + axis+1, + red0, redX, + blue0, blue1, + 16, + -Infinity, Infinity) + } + if(redX < red1) { + iterPush(top++, + axis+1, + redX, red1, + blue0, blue1, + 0, + -Infinity, Infinity) + iterPush(top++, + axis+1, + blue0, blue1, + redX, red1, + 1, + -Infinity, Infinity) + } + } + } + } else { + if(flip) { + red1 = partitionContainsPointProper( + d, axis, + red0, redEnd, red, redIndex, + mid) + } else { + red1 = partitionContainsPoint( + d, axis, + red0, redEnd, red, redIndex, + mid) + } + if(red0 < red1) { + if(axis === d-2) { + if(flip) { + retval = sweep.sweepBipartite( + d, visit, + blue0, blue1, blue, blueIndex, + red0, red1, red, redIndex) + } else { + retval = sweep.sweepBipartite( + d, visit, + red0, red1, red, redIndex, + blue0, blue1, blue, blueIndex) + } + } else { + iterPush(top++, + axis+1, + red0, red1, + blue0, blue1, + flip, + -Infinity, Infinity) + iterPush(top++, + axis+1, + blue0, blue1, + red0, red1, + flip^1, + -Infinity, Infinity) + } } } - return; } - return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r; } } +} +},{"./brute":97,"./median":99,"./partition":100,"./sweep":102,"bit-twiddle":93,"typedarray-pool":477}],99:[function(_dereq_,module,exports){ +'use strict' - function prepare(quad) { - if (quad.data) return quad.r = radii[quad.data.index]; - for (var i = quad.r = 0; i < 4; ++i) { - if (quad[i] && quad[i].r > quad.r) { - quad.r = quad[i].r; +module.exports = findMedian + +var genPartition = _dereq_('./partition') + +var partitionStartLessThan = genPartition('lostart && boxes[ptr+axis] > x; + --j, ptr-=elemSize) { + //Swap + var aPtr = ptr + var bPtr = ptr+elemSize + for(var k=0; k>> 1) + var elemSize = 2*d + var pivot = mid + var value = boxes[elemSize*mid+axis] - force.iterations = function(_) { - return arguments.length ? (iterations = +_, force) : iterations; - }; + while(lo < hi) { + if(hi - lo < PARTITION_THRESHOLD) { + insertionSort(d, axis, lo, hi, boxes, ids) + value = boxes[elemSize*mid+axis] + break + } - force.strength = function(_) { - return arguments.length ? (strength = +_, force) : strength; - }; + //Select pivot using median-of-3 + var count = hi - lo + var pivot0 = (Math.random()*count+lo)|0 + var value0 = boxes[elemSize*pivot0 + axis] + var pivot1 = (Math.random()*count+lo)|0 + var value1 = boxes[elemSize*pivot1 + axis] + var pivot2 = (Math.random()*count+lo)|0 + var value2 = boxes[elemSize*pivot2 + axis] + if(value0 <= value1) { + if(value2 >= value1) { + pivot = pivot1 + value = value1 + } else if(value0 >= value2) { + pivot = pivot0 + value = value0 + } else { + pivot = pivot2 + value = value2 + } + } else { + if(value1 >= value2) { + pivot = pivot1 + value = value1 + } else if(value2 >= value0) { + pivot = pivot0 + value = value0 + } else { + pivot = pivot2 + value = value2 + } + } - force.radius = function(_) { - return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), initialize(), force) : radius; - }; + //Swap pivot to end of array + var aPtr = elemSize * (hi-1) + var bPtr = elemSize * pivot + for(var i=0; i=p0)&&!(p1>=hi)': lo_lessThan_p0_and_p1_lessThan_hi } -function link(links) { - var id = index, - strength = defaultStrength, - strengths, - distance = constant(30), - distances, - nodes, - count, - bias, - iterations = 1; - - if (links == null) links = []; +function genPartition(predicate) { + return P2F[predicate] +} - function defaultStrength(link) { - return 1 / Math.min(count[link.source.index], count[link.target.index]); +// lo===p0 +function lo_equal_p0(a, b, c, d, e, f, p0) { + 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 lo = e[k + n]; + if (lo === p0) 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 +} - function force(alpha) { - for (var k = 0, n = links.length; k < iterations; ++k) { - for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) { - link = links[i], source = link.source, target = link.target; - x = target.x + target.vx - source.x - source.vx || jiggle(); - y = target.y + target.vy - source.y - source.vy || jiggle(); - l = Math.sqrt(x * x + y * y); - l = (l - distances[i]) / l * alpha * strengths[i]; - x *= l, y *= l; - target.vx -= x * (b = bias[i]); - target.vy -= y * b; - source.vx += x * (b = 1 - b); - source.vy += y * b; - } +// lo p; ++p, k += j) { + var lo = e[k + n]; + if (lo < p0) 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 +} - function initialize() { - if (!nodes) return; - - var i, - n = nodes.length, - m = links.length, - nodeById = d3Collection.map(nodes, id), - link; - - for (i = 0, count = new Array(n); i < m; ++i) { - link = links[i], link.index = i; - if (typeof link.source !== "object") link.source = find(nodeById, link.source); - if (typeof link.target !== "object") link.target = find(nodeById, link.target); - count[link.source.index] = (count[link.source.index] || 0) + 1; - count[link.target.index] = (count[link.target.index] || 0) + 1; +// lo<=p0 +function lo_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} - for (i = 0, bias = new Array(m); i < m; ++i) { - link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]); +// hi<=p0 +function hi_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 } - - strengths = new Array(m), initializeStrength(); - distances = new Array(m), initializeDistance(); } + return m +} - function initializeStrength() { - if (!nodes) return; - - for (var i = 0, n = links.length; i < n; ++i) { - strengths[i] = +strength(links[i], i, links); +// lo<=p0&&p0<=hi +function lo_lassOrEqual_p0_and_p0_lessOrEqual_hi(a, b, c, d, e, f, p0) { + 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 lo = e[k + n], hi = e[k + o]; + if (lo <= p0 && p0 <= hi) 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 +} - function initializeDistance() { - if (!nodes) return; - - for (var i = 0, n = links.length; i < n; ++i) { - distances[i] = +distance(links[i], i, links); +// lo p; ++p, k += j) { + var lo = e[k + n], hi = e[k + o]; + if (lo < p0 && p0 <= hi) 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 +} - force.initialize = function(_) { - nodes = _; - initialize(); - }; - - force.links = function(_) { - return arguments.length ? (links = _, initialize(), force) : links; - }; - - force.id = function(_) { - return arguments.length ? (id = _, force) : id; - }; +// !(lo>=p0)&&!(p1>=hi) +function lo_lessThan_p0_and_p1_lessThan_hi(a, b, c, d, e, f, p0, p1) { + 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 lo = e[k + n], hi = e[k + o]; + if (!(lo >= p0) && !(p1 >= hi)) 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 +} - force.iterations = function(_) { - return arguments.length ? (iterations = +_, force) : iterations; - }; +},{}],101:[function(_dereq_,module,exports){ +'use strict'; - force.strength = function(_) { - return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initializeStrength(), force) : strength; - }; +//This code is extracted from ndarray-sort +//It is inlined here as a temporary workaround - force.distance = function(_) { - return arguments.length ? (distance = typeof _ === "function" ? _ : constant(+_), initializeDistance(), force) : distance; - }; +module.exports = wrapper; - return force; -} +var INSERT_SORT_CUTOFF = 32 -function x$1(d) { - return d.x; +function wrapper(data, n0) { + if (n0 <= 4*INSERT_SORT_CUTOFF) { + insertionSort(0, n0 - 1, data); + } else { + quickSort(0, n0 - 1, data); + } +} + +function insertionSort(left, right, data) { + var ptr = 2*(left+1) + for(var i=left+1; i<=right; ++i) { + var a = data[ptr++] + var b = data[ptr++] + var j = i + var jptr = ptr-2 + while(j-- > left) { + var x = data[jptr-2] + var y = data[jptr-1] + if(x < a) { + break + } else if(x === a && y < b) { + break + } + data[jptr] = x + data[jptr+1] = y + jptr -= 2 + } + data[jptr] = a + data[jptr+1] = b + } +} + +function swap(i, j, data) { + i *= 2 + j *= 2 + var x = data[i] + var y = data[i+1] + data[i] = data[j] + data[i+1] = data[j+1] + data[j] = x + data[j+1] = y +} + +function move(i, j, data) { + i *= 2 + j *= 2 + data[i] = data[j] + data[i+1] = data[j+1] +} + +function rotate(i, j, k, data) { + i *= 2 + j *= 2 + k *= 2 + var x = data[i] + var y = data[i+1] + data[i] = data[j] + data[i+1] = data[j+1] + data[j] = data[k] + data[j+1] = data[k+1] + data[k] = x + data[k+1] = y +} + +function shufflePivot(i, j, px, py, data) { + i *= 2 + j *= 2 + data[i] = data[j] + data[j] = px + data[i+1] = data[j+1] + data[j+1] = py +} + +function compare(i, j, data) { + i *= 2 + j *= 2 + var x = data[i], + y = data[j] + if(x < y) { + return false + } else if(x === y) { + return data[i+1] > data[j+1] + } + return true +} + +function comparePivot(i, y, b, data) { + i *= 2 + var x = data[i] + if(x < y) { + return true + } else if(x === y) { + return data[i+1] < b + } + return false +} + +function quickSort(left, right, data) { + var 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, + tmp = 0 + if(compare(el1, el2, data)) { + tmp = el1 + el1 = el2 + el2 = tmp + } + if(compare(el4, el5, data)) { + tmp = el4 + el4 = el5 + el5 = tmp + } + if(compare(el1, el3, data)) { + tmp = el1 + el1 = el3 + el3 = tmp + } + if(compare(el2, el3, data)) { + tmp = el2 + el2 = el3 + el3 = tmp + } + if(compare(el1, el4, data)) { + tmp = el1 + el1 = el4 + el4 = tmp + } + if(compare(el3, el4, data)) { + tmp = el3 + el3 = el4 + el4 = tmp + } + if(compare(el2, el5, data)) { + tmp = el2 + el2 = el5 + el5 = tmp + } + if(compare(el2, el3, data)) { + tmp = el2 + el2 = el3 + el3 = tmp + } + if(compare(el4, el5, data)) { + tmp = el4 + el4 = el5 + el5 = tmp + } + + var pivot1X = data[2*el2] + var pivot1Y = data[2*el2+1] + var pivot2X = data[2*el4] + var pivot2Y = data[2*el4+1] + + var ptr0 = 2 * el1; + var ptr2 = 2 * el3; + var ptr4 = 2 * el5; + var ptr5 = 2 * index1; + var ptr6 = 2 * index3; + var ptr7 = 2 * index5; + for (var i1 = 0; i1 < 2; ++i1) { + var x = data[ptr0+i1]; + var y = data[ptr2+i1]; + var z = data[ptr4+i1]; + data[ptr5+i1] = x; + data[ptr6+i1] = y; + data[ptr7+i1] = z; + } + + move(index2, left, data) + move(index4, right, data) + for (var k = less; k <= great; ++k) { + if (comparePivot(k, pivot1X, pivot1Y, data)) { + if (k !== less) { + swap(k, less, data) + } + ++less; + } else { + if (!comparePivot(k, pivot2X, pivot2Y, data)) { + while (true) { + if (!comparePivot(great, pivot2X, pivot2Y, data)) { + if (--great < k) { + break; + } + continue; + } else { + if (comparePivot(great, pivot1X, pivot1Y, data)) { + rotate(k, less, great, data) + ++less; + --great; + } else { + swap(k, great, data) + --great; + } + break; + } + } + } + } + } + shufflePivot(left, less-1, pivot1X, pivot1Y, data) + shufflePivot(right, great+1, pivot2X, pivot2Y, data) + if (less - 2 - left <= INSERT_SORT_CUTOFF) { + insertionSort(left, less - 2, data); + } else { + quickSort(left, less - 2, data); + } + if (right - (great + 2) <= INSERT_SORT_CUTOFF) { + insertionSort(great + 2, right, data); + } else { + quickSort(great + 2, right, data); + } + if (great - less <= INSERT_SORT_CUTOFF) { + insertionSort(less, great, data); + } else { + quickSort(less, great, data); + } } +},{}],102:[function(_dereq_,module,exports){ +'use strict' -function y$1(d) { - return d.y; +module.exports = { + init: sqInit, + sweepBipartite: sweepBipartite, + sweepComplete: sweepComplete, + scanBipartite: scanBipartite, + scanComplete: scanComplete } -var initialRadius = 10, - initialAngle = Math.PI * (3 - Math.sqrt(5)); +var pool = _dereq_('typedarray-pool') +var bits = _dereq_('bit-twiddle') +var isort = _dereq_('./sort') -function simulation(nodes) { - var simulation, - alpha = 1, - alphaMin = 0.001, - alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), - alphaTarget = 0, - velocityDecay = 0.6, - forces = d3Collection.map(), - stepper = d3Timer.timer(step), - event = d3Dispatch.dispatch("tick", "end"); +//Flag for blue +var BLUE_FLAG = (1<<28) - if (nodes == null) nodes = []; +//1D sweep event queue stuff (use pool to save space) +var INIT_CAPACITY = 1024 +var RED_SWEEP_QUEUE = pool.mallocInt32(INIT_CAPACITY) +var RED_SWEEP_INDEX = pool.mallocInt32(INIT_CAPACITY) +var BLUE_SWEEP_QUEUE = pool.mallocInt32(INIT_CAPACITY) +var BLUE_SWEEP_INDEX = pool.mallocInt32(INIT_CAPACITY) +var COMMON_SWEEP_QUEUE = pool.mallocInt32(INIT_CAPACITY) +var COMMON_SWEEP_INDEX = pool.mallocInt32(INIT_CAPACITY) +var SWEEP_EVENTS = pool.mallocDouble(INIT_CAPACITY * 8) - function step() { - tick(); - event.call("tick", simulation); - if (alpha < alphaMin) { - stepper.stop(); - event.call("end", simulation); - } +//Reserves memory for the 1D sweep data structures +function sqInit(count) { + var rcount = bits.nextPow2(count) + if(RED_SWEEP_QUEUE.length < rcount) { + pool.free(RED_SWEEP_QUEUE) + RED_SWEEP_QUEUE = pool.mallocInt32(rcount) } + if(RED_SWEEP_INDEX.length < rcount) { + pool.free(RED_SWEEP_INDEX) + RED_SWEEP_INDEX = pool.mallocInt32(rcount) + } + if(BLUE_SWEEP_QUEUE.length < rcount) { + pool.free(BLUE_SWEEP_QUEUE) + BLUE_SWEEP_QUEUE = pool.mallocInt32(rcount) + } + if(BLUE_SWEEP_INDEX.length < rcount) { + pool.free(BLUE_SWEEP_INDEX) + BLUE_SWEEP_INDEX = pool.mallocInt32(rcount) + } + if(COMMON_SWEEP_QUEUE.length < rcount) { + pool.free(COMMON_SWEEP_QUEUE) + COMMON_SWEEP_QUEUE = pool.mallocInt32(rcount) + } + if(COMMON_SWEEP_INDEX.length < rcount) { + pool.free(COMMON_SWEEP_INDEX) + COMMON_SWEEP_INDEX = pool.mallocInt32(rcount) + } + var eventLength = 8 * rcount + if(SWEEP_EVENTS.length < eventLength) { + pool.free(SWEEP_EVENTS) + SWEEP_EVENTS = pool.mallocDouble(eventLength) + } +} - function tick(iterations) { - var i, n = nodes.length, node; - - if (iterations === undefined) iterations = 1; - - for (var k = 0; k < iterations; ++k) { - alpha += (alphaTarget - alpha) * alphaDecay; - - forces.each(function (force) { - force(alpha); - }); +//Remove an item from the active queue in O(1) +function sqPop(queue, index, count, item) { + var idx = index[item] + var top = queue[count-1] + queue[idx] = top + index[top] = idx +} - for (i = 0; i < n; ++i) { - node = nodes[i]; - if (node.fx == null) node.x += node.vx *= velocityDecay; - else node.x = node.fx, node.vx = 0; - if (node.fy == null) node.y += node.vy *= velocityDecay; - else node.y = node.fy, node.vy = 0; - } - } +//Insert an item into the active queue in O(1) +function sqPush(queue, index, count, item) { + queue[count] = item + index[item] = count +} - return simulation; - } +//Recursion base case: use 1D sweep algorithm +function sweepBipartite( + d, visit, + redStart, redEnd, red, redIndex, + blueStart, blueEnd, blue, blueIndex) { - function initializeNodes() { - for (var i = 0, n = nodes.length, node; i < n; ++i) { - node = nodes[i], node.index = i; - if (node.fx != null) node.x = node.fx; - if (node.fy != null) node.y = node.fy; - if (isNaN(node.x) || isNaN(node.y)) { - var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle; - node.x = radius * Math.cos(angle); - node.y = radius * Math.sin(angle); + //store events as pairs [coordinate, idx] + // + // red create: -(idx+1) + // red destroy: idx + // blue create: -(idx+BLUE_FLAG) + // blue destroy: idx+BLUE_FLAG + // + var ptr = 0 + var elemSize = 2*d + var istart = d-1 + var iend = elemSize-1 + + for(var i=redStart; iright + var n = ptr >>> 1 + isort(SWEEP_EVENTS, n) + + var redActive = 0 + var blueActive = 0 + for(var i=0; i= BLUE_FLAG) { + //blue destroy event + e = (e-BLUE_FLAG)|0 + sqPop(BLUE_SWEEP_QUEUE, BLUE_SWEEP_INDEX, blueActive--, e) + } else if(e >= 0) { + //red destroy event + sqPop(RED_SWEEP_QUEUE, RED_SWEEP_INDEX, redActive--, e) + } else if(e <= -BLUE_FLAG) { + //blue create event + e = (-e-BLUE_FLAG)|0 + for(var j=0; jright + var n = ptr >>> 1 + isort(SWEEP_EVENTS, n) + + var redActive = 0 + var blueActive = 0 + var commonActive = 0 + for(var i=0; i>1) === (SWEEP_EVENTS[2*i+3]>>1)) { + color = 2 + i += 1 + } + + if(e < 0) { + //Create event + var id = -(e>>1) - 1 - alpha: function(_) { - return arguments.length ? (alpha = +_, simulation) : alpha; - }, + //Intersect with common + for(var j=0; j>1) - 1 + if(color === 0) { + //Red + sqPop(RED_SWEEP_QUEUE, RED_SWEEP_INDEX, redActive--, id) + } else if(color === 1) { + //Blue + sqPop(BLUE_SWEEP_QUEUE, BLUE_SWEEP_INDEX, blueActive--, id) + } else if(color === 2) { + //Both + sqPop(COMMON_SWEEP_QUEUE, COMMON_SWEEP_INDEX, commonActive--, id) + } + } + } +} - velocityDecay: function(_) { - return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay; - }, +//Sweep and prune/scanline algorithm: +// Scan along axis, detect intersections +// Brute force all boxes along axis +function scanBipartite( + d, axis, visit, flip, + redStart, redEnd, red, redIndex, + blueStart, blueEnd, blue, blueIndex) { + + var ptr = 0 + var elemSize = 2*d + var istart = axis + var iend = axis+d + + var redShift = 1 + var blueShift = 1 + if(flip) { + blueShift = BLUE_FLAG + } else { + redShift = BLUE_FLAG + } - force: function(name, _) { - return arguments.length > 1 ? ((_ == null ? forces.remove(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name); - }, + for(var i=redStart; iright + var n = ptr >>> 1 + isort(SWEEP_EVENTS, n) + + var redActive = 0 + for(var i=0; i= BLUE_FLAG) { + isRed = !flip + idx -= BLUE_FLAG + } else { + isRed = !!flip + idx -= 1 + } + if(isRed) { + sqPush(RED_SWEEP_QUEUE, RED_SWEEP_INDEX, redActive++, idx) + } else { + var blueId = blueIndex[idx] + var bluePtr = elemSize * idx + + var b0 = blue[bluePtr+axis+1] + var b1 = blue[bluePtr+axis+1+d] - if (radius == null) radius = Infinity; - else radius *= radius; +red_loop: + for(var j=0; j 1 ? (event.on(name, _), simulation) : event.on(name); + var redId = redIndex[oidx] + var retval + if(flip) { + retval = visit(blueId, redId) + } else { + retval = visit(redId, blueId) + } + if(retval !== void 0) { + return retval + } + } + } + } else { + sqPop(RED_SWEEP_QUEUE, RED_SWEEP_INDEX, redActive--, e - redShift) } - }; + } } -function manyBody() { - var nodes, - node, - alpha, - strength = constant(-30), - strengths, - distanceMin2 = 1, - distanceMax2 = Infinity, - theta2 = 0.81; +function scanComplete( + d, axis, visit, + redStart, redEnd, red, redIndex, + blueStart, blueEnd, blue, blueIndex) { - function force(_) { - var i, n = nodes.length, tree = d3Quadtree.quadtree(nodes, x$1, y$1).visitAfter(accumulate); - for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply); - } + var ptr = 0 + var elemSize = 2*d + var istart = axis + var iend = axis+d - function initialize() { - if (!nodes) return; - var i, n = nodes.length, node; - strengths = new Array(n); - for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes); + for(var i=redStart; iright + var n = ptr >>> 1 + isort(SWEEP_EVENTS, n) + + var redActive = 0 + for(var i=0; i= BLUE_FLAG) { + RED_SWEEP_QUEUE[redActive++] = idx - BLUE_FLAG + } else { + idx -= 1 + var blueId = blueIndex[idx] + var bluePtr = elemSize * idx - // For leaf nodes, accumulate forces from coincident quadrants. - else { - q = quad; - q.x = q.data.x; - q.y = q.data.y; - do strength += strengths[q.data.index]; - while (q = q.next); - } + var b0 = blue[bluePtr+axis+1] + var b1 = blue[bluePtr+axis+1+d] - quad.value = strength; - } +red_loop: + for(var j=0; j=0; --j) { + if(RED_SWEEP_QUEUE[j] === idx) { + for(var k=j+1; k= distanceMax2) return; +},{}],104:[function(_dereq_,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Limit forces for very close nodes; randomize direction if coincident. - if (quad.data !== node || quad.next) { - if (x === 0) x = jiggle(), l += x * x; - if (y === 0) y = jiggle(), l += y * y; - if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l); - } +'use strict'; - do if (quad.data !== node) { - w = strengths[quad.data.index] * alpha / l; - node.vx += x * w; - node.vy += y * w; - } while (quad = quad.next); +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); } - force.initialize = function(_) { - nodes = _; - initialize(); - }; - - force.strength = function(_) { - return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); }; - - force.distanceMin = function(_) { - return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2); +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); }; +} - force.distanceMax = function(_) { - return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2); - }; +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} - force.theta = function(_) { - return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2); - }; +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} - return force; +function EventEmitter() { + EventEmitter.init.call(this); } +module.exports = EventEmitter; +module.exports.once = once; -function radial(radius, x, y) { - var nodes, - strength = constant(0.1), - strengths, - radiuses; +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; - if (typeof radius !== "function") radius = constant(+radius); - if (x == null) x = 0; - if (y == null) y = 0; +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = undefined; - function force(alpha) { - for (var i = 0, n = nodes.length; i < n; ++i) { - var node = nodes[i], - dx = node.x - x || 1e-6, - dy = node.y - y || 1e-6, - r = Math.sqrt(dx * dx + dy * dy), - k = (radiuses[i] - r) * strengths[i] * alpha / r; - node.vx += dx * k; - node.vy += dy * k; - } +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); } +} - function initialize() { - if (!nodes) return; - var i, n = nodes.length; - strengths = new Array(n); - radiuses = new Array(n); - for (i = 0; i < n; ++i) { - radiuses[i] = +radius(nodes[i], i, nodes); - strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes); +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); } + defaultMaxListeners = arg; } +}); - force.initialize = function(_) { - nodes = _, initialize(); - }; - - force.strength = function(_) { - return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; - }; +EventEmitter.init = function() { - force.radius = function(_) { - return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), initialize(), force) : radius; - }; + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } - force.x = function(_) { - return arguments.length ? (x = +_, force) : x; - }; + this._maxListeners = this._maxListeners || undefined; +}; - force.y = function(_) { - return arguments.length ? (y = +_, force) : y; - }; +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; - return force; +function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; } -function x$2(x) { - var strength = constant(0.1), - nodes, - strengths, - xz; +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); +}; - if (typeof x !== "function") x = constant(x == null ? 0 : +x); +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); - function force(alpha) { - for (var i = 0, n = nodes.length, node; i < n; ++i) { - node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha; - } - } + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; - function initialize() { - if (!nodes) return; - var i, n = nodes.length; - strengths = new Array(n); - xz = new Array(n); - for (i = 0; i < n; ++i) { - strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes); + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event } - force.initialize = function(_) { - nodes = _; - initialize(); - }; + var handler = events[type]; - force.strength = function(_) { - return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; - }; + if (handler === undefined) + return false; - force.x = function(_) { - return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), initialize(), force) : x; - }; + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } - return force; -} + return true; +}; -function y$2(y) { - var strength = constant(0.1), - nodes, - strengths, - yz; +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; - if (typeof y !== "function") y = constant(y == null ? 0 : +y); + checkListener(listener); - function force(alpha) { - for (var i = 0, n = nodes.length, node; i < n; ++i) { - node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha; - } - } + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); - function initialize() { - if (!nodes) return; - var i, n = nodes.length; - strengths = new Array(n); - yz = new Array(n); - for (i = 0; i < n; ++i) { - strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes); + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; } + existing = events[type]; } - force.initialize = function(_) { - nodes = _; - initialize(); - }; - - force.strength = function(_) { - return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; - }; + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } - force.y = function(_) { - return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), initialize(), force) : y; - }; + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } - return force; + return target; } -exports.forceCenter = center; -exports.forceCollide = collide; -exports.forceLink = link; -exports.forceManyBody = manyBody; -exports.forceRadial = radial; -exports.forceSimulation = simulation; -exports.forceX = x$2; -exports.forceY = y$2; - -Object.defineProperty(exports, '__esModule', { value: true }); +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; -}))); +EventEmitter.prototype.on = EventEmitter.prototype.addListener; -},{"d3-collection":64,"d3-dispatch":66,"d3-quadtree":74,"d3-timer":79}],68:[function(_dereq_,module,exports){ -// https://d3js.org/d3-format/ v1.4.5 Copyright 2020 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); -}(this, (function (exports) { 'use strict'; +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; -function formatDecimal(x) { - return Math.abs(x = Math.round(x)) >= 1e21 - ? x.toLocaleString("en").replace(/,/g, "") - : x.toString(10); +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } } -// Computes the decimal coefficient and exponent of the specified number x with -// significant digits p, where x is positive and p is in [1, 21] or undefined. -// For example, formatDecimalParts(1.23) returns ["123", 0]. -function formatDecimalParts(x, p) { - if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity - var i, coefficient = x.slice(0, i); - - // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x.slice(i + 1) - ]; +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; } -function exponent(x) { - return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN; -} +EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; -function formatGroup(grouping, thousands) { - return function(value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; - return t.reverse().join(thousands); - }; -} + checkListener(listener); -function formatNumerals(numerals) { - return function(value) { - return value.replace(/[0-9]/g, function(i) { - return numerals[+i]; - }); - }; -} + events = this._events; + if (events === undefined) + return this; -// [[fill]align][sign][symbol][0][width][,][.precision][~][type] -var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; + list = events[type]; + if (list === undefined) + return this; -function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); -} + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; -formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } -function FormatSpecifier(specifier) { - this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; - this.align = specifier.align === undefined ? ">" : specifier.align + ""; - this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === undefined ? undefined : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === undefined ? undefined : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === undefined ? "" : specifier.type + ""; -} + if (position < 0) + return this; -FormatSpecifier.prototype.toString = function() { - return this.fill - + this.align - + this.sign - + this.symbol - + (this.zero ? "0" : "") - + (this.width === undefined ? "" : Math.max(1, this.width | 0)) - + (this.comma ? "," : "") - + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) - + (this.trim ? "~" : "") - + this.type; -}; + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } -// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. -function formatTrim(s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case ".": i0 = i1 = i; break; - case "0": if (i0 === 0) i0 = i; i1 = i; break; - default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; - } - } - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; -} + if (list.length === 1) + events[type] = list[0]; -var prefixExponent; + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } -function formatPrefixAuto(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1], - i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, - n = coefficient.length; - return i === n ? coefficient - : i > n ? coefficient + new Array(i - n + 1).join("0") - : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) - : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! -} + return this; + }; -function formatRounded(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient - : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) - : coefficient + new Array(exponent - coefficient.length + 2).join("0"); -} +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -var formatTypes = { - "%": function(x, p) { return (x * 100).toFixed(p); }, - "b": function(x) { return Math.round(x).toString(2); }, - "c": function(x) { return x + ""; }, - "d": formatDecimal, - "e": function(x, p) { return x.toExponential(p); }, - "f": function(x, p) { return x.toFixed(p); }, - "g": function(x, p) { return x.toPrecision(p); }, - "o": function(x) { return Math.round(x).toString(8); }, - "p": function(x, p) { return formatRounded(x * 100, p); }, - "r": formatRounded, - "s": formatPrefixAuto, - "X": function(x) { return Math.round(x).toString(16).toUpperCase(); }, - "x": function(x) { return Math.round(x).toString(16); } -}; +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; -function identity(x) { - return x; -} + events = this._events; + if (events === undefined) + return this; -var map = Array.prototype.map, - prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } -function formatLocale(locale) { - var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), - currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", - currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", - decimal = locale.decimal === undefined ? "." : locale.decimal + "", - numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)), - percent = locale.percent === undefined ? "%" : locale.percent + "", - minus = locale.minus === undefined ? "-" : locale.minus + "", - nan = locale.nan === undefined ? "NaN" : locale.nan + ""; + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } - function newFormat(specifier) { - specifier = formatSpecifier(specifier); + listeners = events[type]; - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } - // The "n" type is an alias for ",g". - if (type === "n") comma = true, type = "g"; + return this; + }; - // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g"; +function _listeners(target, type, unwrap) { + var events = target._events; - // If zero fill is specified, padding goes after sign and before digits. - if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; + if (events === undefined) + return []; - // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", - suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; + var evlistener = events[type]; + if (evlistener === undefined) + return []; - // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - var formatType = formatTypes[type], - maybeSuffix = /[defgprs%]/.test(type); + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - precision = precision === undefined ? 6 - : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) - : Math.max(0, Math.min(20, precision)); + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, n, c; +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; - // Determine the sign. -0 is not less than 0, but 1 / -0 is! - var valueNegative = value < 0 || 1 / value < 0; +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; - // Perform the initial formatting. - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; - // Trim insignificant zeros. - if (trim) value = formatTrim(value); + if (events !== undefined) { + var evlistener = events[type]; - // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. - if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } - // Compute the prefix and suffix. - valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; - valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); + return 0; +} - // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - if (maybeSuffix) { - i = -1, n = value.length; - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; - // If the fill character is not "0", grouping is applied before padding. - if (comma && !zero) value = group(value, Infinity); +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} - // Compute the padding. - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = length < width ? new Array(width - length + 1).join(fill) : ""; +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} - // If the fill character is "0", grouping is applied after padding. - if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} - // Reconstruct the final output based on the desired alignment. - switch (align) { - case "<": value = valuePrefix + value + valueSuffix + padding; break; - case "=": value = valuePrefix + padding + value + valueSuffix; break; - case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; - default: value = padding + valuePrefix + value + valueSuffix; break; +function once(emitter, name) { + return new Promise(function (resolve, reject) { + function eventListener() { + if (errorListener !== undefined) { + emitter.removeListener('error', errorListener); } + resolve([].slice.call(arguments)); + }; + var errorListener; - return numerals(value); + // Adding an error listener is not optional because + // if an error is thrown on an event emitter we cannot + // guarantee that the actual event we are waiting will + // be fired. The result could be a silent way to create + // memory or file descriptor leaks, which is something + // we should avoid. + if (name !== 'error') { + errorListener = function errorListener(err) { + emitter.removeListener(name, eventListener); + reject(err); + }; + + emitter.once('error', errorListener); } - format.toString = function() { - return specifier + ""; - }; + emitter.once(name, eventListener); + }); +} - return format; - } +},{}],105:[function(_dereq_,module,exports){ +(function (Buffer){(function (){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ - function formatPrefix(specifier, value) { - var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), - e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes[8 + e / 3]; - return function(value) { - return f(k * value) + prefix; - }; - } +'use strict' - return { - format: newFormat, - formatPrefix: formatPrefix - }; -} +var base64 = _dereq_('base64-js') +var ieee754 = _dereq_('ieee754') -var locale; +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 -defaultLocale({ - decimal: ".", - thousands: ",", - grouping: [3], - currency: ["$", ""], - minus: "-" -}); +var K_MAX_LENGTH = 0x7fffffff +exports.kMaxLength = K_MAX_LENGTH -function defaultLocale(definition) { - locale = formatLocale(definition); - exports.format = locale.format; - exports.formatPrefix = locale.formatPrefix; - return locale; +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + 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.' + ) } -function precisionFixed(step) { - return Math.max(0, -exponent(Math.abs(step))); +function typedArraySupport () { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1) + arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } } + return arr.foo() === 42 + } catch (e) { + return false + } } -function precisionPrefix(step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); +Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } +}) + +Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } +}) + +function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + var buf = new Uint8Array(length) + buf.__proto__ = Buffer.prototype + return buf } -function precisionRound(step, max) { - step = Math.abs(step), max = Math.abs(max) - step; - return Math.max(0, exponent(max) - exponent(step)) + 1; +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) } -exports.FormatSpecifier = FormatSpecifier; -exports.formatDefaultLocale = defaultLocale; -exports.formatLocale = formatLocale; -exports.formatSpecifier = formatSpecifier; -exports.precisionFixed = precisionFixed; -exports.precisionPrefix = precisionPrefix; -exports.precisionRound = precisionRound; +// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 +if (typeof Symbol !== 'undefined' && Symbol.species != null && + Buffer[Symbol.species] === Buffer) { + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true, + enumerable: false, + writable: false + }) +} -Object.defineProperty(exports, '__esModule', { value: true }); +Buffer.poolSize = 8192 // not used by this implementation -}))); +function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } -},{}],69:[function(_dereq_,module,exports){ -// https://d3js.org/d3-geo-projection/ v2.9.0 Copyright 2020 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-geo'), _dereq_('d3-array')) : -typeof define === 'function' && define.amd ? define(['exports', 'd3-geo', 'd3-array'], factory) : -(factory((global.d3 = global.d3 || {}),global.d3,global.d3)); -}(this, (function (exports,d3Geo,d3Array) { 'use strict'; + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value) + } -var abs = Math.abs; -var atan = Math.atan; -var atan2 = Math.atan2; -var cos = Math.cos; -var exp = Math.exp; -var floor = Math.floor; -var log = Math.log; -var max = Math.max; -var min = Math.min; -var pow = Math.pow; -var round = Math.round; -var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }; -var sin = Math.sin; -var tan = Math.tan; + if (value == null) { + throw TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } -var epsilon = 1e-6; -var epsilon2 = 1e-12; -var pi = Math.PI; -var halfPi = pi / 2; -var quarterPi = pi / 4; -var sqrt1_2 = Math.SQRT1_2; -var sqrt2 = sqrt(2); -var sqrtPi = sqrt(pi); -var tau = pi * 2; -var degrees = 180 / pi; -var radians = pi / 180; + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } -function sinci(x) { - return x ? x / Math.sin(x) : 1; -} + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } -function asin(x) { - return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x); -} + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } -function acos(x) { - return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); -} + var b = fromObject(value) + if (b) return b -function sqrt(x) { - return x > 0 ? Math.sqrt(x) : 0; + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) } -function tanh(x) { - x = exp(2 * x); - return (x - 1) / (x + 1); +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) } -function sinh(x) { - return (exp(x) - exp(-x)) / 2; +// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: +// https://github.com/feross/buffer/pull/148 +Buffer.prototype.__proto__ = Uint8Array.prototype +Buffer.__proto__ = Uint8Array + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } } -function cosh(x) { - return (exp(x) + exp(-x)) / 2; +function alloc (size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) } -function arsinh(x) { - return log(x + sqrt(x * x + 1)); +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) } -function arcosh(x) { - return log(x + sqrt(x * x - 1)); +function allocUnsafe (size) { + assertSize(size) + return createBuffer(size < 0 ? 0 : checked(size) | 0) } -function airyRaw(beta) { - var tanBeta_2 = tan(beta / 2), - b = 2 * log(cos(beta / 2)) / (tanBeta_2 * tanBeta_2); +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) +} - function forward(x, y) { - var cosx = cos(x), - cosy = cos(y), - siny = sin(y), - cosz = cosy * cosx, - k = -((1 - cosz ? log((1 + cosz) / 2) / (1 - cosz) : -0.5) + b / (1 + cosz)); - return [k * cosy * sin(x), k * siny]; +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' } - forward.invert = function(x, y) { - var r = sqrt(x * x + y * y), - z = -beta / 2, - i = 50, delta; - if (!r) return [0, 0]; - do { - var z_2 = z / 2, - cosz_2 = cos(z_2), - sinz_2 = sin(z_2), - tanz_2 = sinz_2 / cosz_2, - lnsecz_2 = -log(abs(cosz_2)); - z -= delta = (2 / tanz_2 * lnsecz_2 - b * tanz_2 - r) / (-lnsecz_2 / (sinz_2 * sinz_2) + 1 - b / (2 * cosz_2 * cosz_2)) * (cosz_2 < 0 ? 0.7 : 1); - } while (abs(delta) > epsilon && --i > 0); - var sinz = sin(z); - return [atan2(x * sinz, r * cos(z)), asin(y * sinz / r)]; - }; - - return forward; -} + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } -function airy() { - var beta = halfPi, - m = d3Geo.geoProjectionMutator(airyRaw), - p = m(beta); + var length = byteLength(string, encoding) | 0 + var buf = createBuffer(length) - p.radius = function(_) { - return arguments.length ? m(beta = _ * radians) : beta * degrees; - }; + var actual = buf.write(string, encoding) - return p - .scale(179.976) - .clipAngle(147); -} + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } -function aitoffRaw(x, y) { - var cosy = cos(y), sincia = sinci(acos(cosy * cos(x /= 2))); - return [2 * cosy * sin(x) * sincia, sin(y) * sincia]; + return buf } -// Abort if [x, y] is not within an ellipse centered at [0, 0] with -// semi-major axis pi and semi-minor axis pi/2. -aitoffRaw.invert = function(x, y) { - if (x * x + 4 * y * y > pi * pi + epsilon) return; - var x1 = x, y1 = y, i = 25; - do { - var sinx = sin(x1), - sinx_2 = sin(x1 / 2), - cosx_2 = cos(x1 / 2), - siny = sin(y1), - cosy = cos(y1), - sin_2y = sin(2 * y1), - sin2y = siny * siny, - cos2y = cosy * cosy, - sin2x_2 = sinx_2 * sinx_2, - c = 1 - cos2y * cosx_2 * cosx_2, - e = c ? acos(cosy * cosx_2) * sqrt(f = 1 / c) : f = 0, - f, - fx = 2 * e * cosy * sinx_2 - x, - fy = e * siny - y, - dxdx = f * (cos2y * sin2x_2 + e * cosy * cosx_2 * sin2y), - dxdy = f * (0.5 * sinx * sin_2y - e * 2 * siny * sinx_2), - dydx = f * 0.25 * (sin_2y * sinx_2 - e * siny * cos2y * sinx), - dydy = f * (sin2y * cosx_2 + e * sin2x_2 * cosy), - z = dxdy * dydx - dydy * dxdx; - if (!z) break; - var dx = (fy * dxdy - fx * dydy) / z, - dy = (fx * dydx - fy * dxdx) / z; - x1 -= dx, y1 -= dy; - } while ((abs(dx) > epsilon || abs(dy) > epsilon) && --i > 0); - return [x1, y1]; -}; - -function aitoff() { - return d3Geo.geoProjection(aitoffRaw) - .scale(152.63); +function fromArrayLike (array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + var buf = createBuffer(length) + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf } -function armadilloRaw(phi0) { - var sinPhi0 = sin(phi0), - cosPhi0 = cos(phi0), - sPhi0 = phi0 >= 0 ? 1 : -1, - tanPhi0 = tan(sPhi0 * phi0), - k = (1 + sinPhi0 - cosPhi0) / 2; +function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } - function forward(lambda, phi) { - var cosPhi = cos(phi), - cosLambda = cos(lambda /= 2); - return [ - (1 + cosPhi) * sin(lambda), - (sPhi0 * phi > -atan2(cosLambda, tanPhi0) - 1e-3 ? 0 : -sPhi0 * 10) + k + sin(phi) * cosPhi0 - (1 + cosPhi) * sinPhi0 * cosLambda // TODO D3 core should allow null or [NaN, NaN] to be returned. - ]; + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') } - forward.invert = function(x, y) { - var lambda = 0, - phi = 0, - i = 50; - do { - var cosLambda = cos(lambda), - sinLambda = sin(lambda), - cosPhi = cos(phi), - sinPhi = sin(phi), - A = 1 + cosPhi, - fx = A * sinLambda - x, - fy = k + sinPhi * cosPhi0 - A * sinPhi0 * cosLambda - y, - dxdLambda = A * cosLambda / 2, - dxdPhi = -sinLambda * sinPhi, - dydLambda = sinPhi0 * A * sinLambda / 2, - dydPhi = cosPhi0 * cosPhi + sinPhi0 * cosLambda * sinPhi, - denominator = dxdPhi * dydLambda - dydPhi * dxdLambda, - dLambda = (fy * dxdPhi - fx * dydPhi) / denominator / 2, - dPhi = (fx * dydLambda - fy * dxdLambda) / denominator; - if (abs(dPhi) > 2) dPhi /= 2; - lambda -= dLambda, phi -= dPhi; - } while ((abs(dLambda) > epsilon || abs(dPhi) > epsilon) && --i > 0); - return sPhi0 * phi > -atan2(cos(lambda), tanPhi0) - 1e-3 ? [lambda * 2, phi] : null; - }; + var buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } - return forward; + // Return an augmented `Uint8Array` instance + buf.__proto__ = Buffer.prototype + return buf } -function armadillo() { - var phi0 = 20 * radians, - sPhi0 = phi0 >= 0 ? 1 : -1, - tanPhi0 = tan(sPhi0 * phi0), - m = d3Geo.geoProjectionMutator(armadilloRaw), - p = m(phi0), - stream_ = p.stream; +function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + var buf = createBuffer(len) - p.parallel = function(_) { - if (!arguments.length) return phi0 * degrees; - tanPhi0 = tan((sPhi0 = (phi0 = _ * radians) >= 0 ? 1 : -1) * phi0); - return m(phi0); - }; + if (buf.length === 0) { + return buf + } - p.stream = function(stream) { - var rotate = p.rotate(), - rotateStream = stream_(stream), - sphereStream = (p.rotate([0, 0]), stream_(stream)), - precision = p.precision(); - p.rotate(rotate); - rotateStream.sphere = function() { - sphereStream.polygonStart(), sphereStream.lineStart(); - for (var lambda = sPhi0 * -180; sPhi0 * lambda < 180; lambda += sPhi0 * 90) - sphereStream.point(lambda, sPhi0 * 90); - if (phi0) while (sPhi0 * (lambda -= 3 * sPhi0 * precision) >= -180) { - sphereStream.point(lambda, sPhi0 * -atan2(cos(lambda * radians / 2), tanPhi0) * degrees); - } - sphereStream.lineEnd(), sphereStream.polygonEnd(); - }; - return rotateStream; - }; + obj.copy(buf, 0, 0, len) + return buf + } - return p - .scale(218.695) - .center([0, 28.0974]); + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } } -function augustRaw(lambda, phi) { - var tanPhi = tan(phi / 2), - k = sqrt(1 - tanPhi * tanPhi), - c = 1 + k * cos(lambda /= 2), - x = sin(lambda) * k / c, - y = tanPhi / c, - x2 = x * x, - y2 = y * y; - return [ - 4 / 3 * x * (3 + x2 - 3 * y2), - 4 / 3 * y * (3 + 3 * x2 - y2) - ]; +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 } -augustRaw.invert = function(x, y) { - x *= 3 / 8, y *= 3 / 8; - if (!x && abs(y) > 1) return null; - var x2 = x * x, - y2 = y * y, - s = 1 + x2 + y2, - sin3Eta = sqrt((s - sqrt(s * s - 4 * y * y)) / 2), - eta = asin(sin3Eta) / 3, - xi = sin3Eta ? arcosh(abs(y / sin3Eta)) / 3 : arsinh(abs(x)) / 3, - cosEta = cos(eta), - coshXi = cosh(xi), - d = coshXi * coshXi - cosEta * cosEta; - return [ - sign(x) * 2 * atan2(sinh(xi) * cosEta, 0.25 - d), - sign(y) * 2 * atan2(coshXi * sin(eta), 0.25 + d) - ]; -}; +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} -function august() { - return d3Geo.geoProjection(augustRaw) - .scale(66.1603); +Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } -var sqrt8 = sqrt(8), - phi0 = log(1 + sqrt2); +Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } -function bakerRaw(lambda, phi) { - var phi0 = abs(phi); - return phi0 < quarterPi - ? [lambda, log(tan(quarterPi + phi / 2))] - : [lambda * cos(phi0) * (2 * sqrt2 - 1 / sin(phi0)), sign(phi) * (2 * sqrt2 * (phi0 - quarterPi) - log(tan(phi0 / 2)))]; -} + if (a === b) return 0 -bakerRaw.invert = function(x, y) { - if ((y0 = abs(y)) < phi0) return [x, 2 * atan(exp(y)) - halfPi]; - var phi = quarterPi, i = 25, delta, y0; - do { - var cosPhi_2 = cos(phi / 2), tanPhi_2 = tan(phi / 2); - phi -= delta = (sqrt8 * (phi - quarterPi) - log(tanPhi_2) - y0) / (sqrt8 - cosPhi_2 * cosPhi_2 / (2 * tanPhi_2)); - } while (abs(delta) > epsilon2 && --i > 0); - return [x / (cos(phi) * (sqrt8 - 1 / sin(phi))), sign(y) * phi]; -}; + var x = a.length + var y = b.length -function baker() { - return d3Geo.geoProjection(bakerRaw) - .scale(112.314); -} + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } -function berghausRaw(lobes) { - var k = 2 * pi / lobes; + if (x < y) return -1 + if (y < x) return 1 + return 0 +} - function forward(lambda, phi) { - var p = d3Geo.geoAzimuthalEquidistantRaw(lambda, phi); - if (abs(lambda) > halfPi) { // back hemisphere - var theta = atan2(p[1], p[0]), - r = sqrt(p[0] * p[0] + p[1] * p[1]), - theta0 = k * round((theta - halfPi) / k) + halfPi, - alpha = atan2(sin(theta -= theta0), 2 - cos(theta)); // angle relative to lobe end - theta = theta0 + asin(pi / r * sin(alpha)) - alpha; - p[0] = r * cos(theta); - p[1] = r * sin(theta); - } - return p; +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).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 true + default: + return false } - - forward.invert = function(x, y) { - var r = sqrt(x * x + y * y); - if (r > halfPi) { - var theta = atan2(y, x), - theta0 = k * round((theta - halfPi) / k) + halfPi, - s = theta > theta0 ? -1 : 1, - A = r * cos(theta0 - theta), - cotAlpha = 1 / tan(s * acos((A - pi) / sqrt(pi * (pi - 2 * A) + r * r))); - theta = theta0 + 2 * atan((cotAlpha + s * sqrt(cotAlpha * cotAlpha - 3)) / 3); - x = r * cos(theta), y = r * sin(theta); - } - return d3Geo.geoAzimuthalEquidistantRaw.invert(x, y); - }; - - return forward; } -function berghaus() { - var lobes = 5, - m = d3Geo.geoProjectionMutator(berghausRaw), - p = m(lobes), - projectionStream = p.stream, - epsilon$$1 = 1e-2, - cr = -cos(epsilon$$1 * radians), - sr = sin(epsilon$$1 * radians); +Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } - p.lobes = function(_) { - return arguments.length ? m(lobes = +_) : lobes; - }; + if (list.length === 0) { + return Buffer.alloc(0) + } - p.stream = function(stream) { - var rotate = p.rotate(), - rotateStream = projectionStream(stream), - sphereStream = (p.rotate([0, 0]), projectionStream(stream)); - p.rotate(rotate); - rotateStream.sphere = function() { - sphereStream.polygonStart(), sphereStream.lineStart(); - for (var i = 0, delta = 360 / lobes, delta0 = 2 * pi / lobes, phi = 90 - 180 / lobes, phi0 = halfPi; i < lobes; ++i, phi -= delta, phi0 -= delta0) { - sphereStream.point(atan2(sr * cos(phi0), cr) * degrees, asin(sr * sin(phi0)) * degrees); - if (phi < -90) { - sphereStream.point(-90, -180 - phi - epsilon$$1); - sphereStream.point(-90, -180 - phi + epsilon$$1); - } else { - sphereStream.point(90, phi + epsilon$$1); - sphereStream.point(90, phi - epsilon$$1); - } - } - sphereStream.lineEnd(), sphereStream.polygonEnd(); - }; - return rotateStream; - }; + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } - return p - .scale(87.8076) - .center([0, 17.1875]) - .clipAngle(180 - 1e-3); + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (isInstance(buf, Uint8Array)) { + buf = Buffer.from(buf) + } + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer } -function hammerRaw(A, B) { - if (arguments.length < 2) B = A; - if (B === 1) return d3Geo.geoAzimuthalEqualAreaRaw; - if (B === Infinity) return hammerQuarticAuthalicRaw; - - function forward(lambda, phi) { - var coordinates = d3Geo.geoAzimuthalEqualAreaRaw(lambda / B, phi); - coordinates[0] *= A; - return coordinates; +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) } - forward.invert = function(x, y) { - var coordinates = d3Geo.geoAzimuthalEqualAreaRaw.invert(x / A, y); - coordinates[0] *= B; - return coordinates; - }; + var len = string.length + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 - return forward; + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } } +Buffer.byteLength = byteLength -function hammerQuarticAuthalicRaw(lambda, phi) { - return [ - lambda * cos(phi) / cos(phi /= 2), - 2 * sin(phi) - ]; -} +function slowToString (encoding, start, end) { + var loweredCase = false -hammerQuarticAuthalicRaw.invert = function(x, y) { - var phi = 2 * asin(y / 2); - return [ - x * cos(phi / 2) / cos(phi), - phi - ]; -}; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. -function hammer() { - var B = 2, - m = d3Geo.geoProjectionMutator(hammerRaw), - p = m(B); + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } - p.coefficient = function(_) { - if (!arguments.length) return B; - return m(B = +_); - }; + if (end === undefined || end > this.length) { + end = this.length + } - return p - .scale(169.529); -} + if (end <= 0) { + return '' + } -// Approximate Newton-Raphson -// Solve f(x) = y, start from x -function solve(f, y, x) { - var steps = 100, delta, f0, f1; - x = x === undefined ? 0 : +x; - y = +y; - do { - f0 = f(x); - f1 = f(x + epsilon); - if (f0 === f1) f1 = f0 + epsilon; - x -= delta = (-1 * epsilon * (f0 - y)) / (f0 - f1); - } while (steps-- > 0 && abs(delta) > epsilon); - return steps < 0 ? NaN : x; -} + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 -// Approximate Newton-Raphson in 2D -// Solve f(a,b) = [x,y] -function solve2d(f, MAX_ITERATIONS, eps) { - if (MAX_ITERATIONS === undefined) MAX_ITERATIONS = 40; - if (eps === undefined) eps = epsilon2; - return function(x, y, a, b) { - var err2, da, db; - a = a === undefined ? 0 : +a; - b = b === undefined ? 0 : +b; - for (var i = 0; i < MAX_ITERATIONS; i++) { - var p = f(a, b), - // diffs - tx = p[0] - x, - ty = p[1] - y; - if (abs(tx) < eps && abs(ty) < eps) break; // we're there! + if (end <= start) { + return '' + } - // backtrack if we overshot - var h = tx * tx + ty * ty; - if (h > err2) { - a -= da /= 2; - b -= db /= 2; - continue; - } - err2 = h; + if (!encoding) encoding = 'utf8' - // partial derivatives - var ea = (a > 0 ? -1 : 1) * eps, - eb = (b > 0 ? -1 : 1) * eps, - pa = f(a + ea, b), - pb = f(a, b + eb), - dxa = (pa[0] - p[0]) / ea, - dya = (pa[1] - p[1]) / ea, - dxb = (pb[0] - p[0]) / eb, - dyb = (pb[1] - p[1]) / eb, - // determinant - D = dyb * dxa - dya * dxb, - // newton step — or half-step for small D - l = (abs(D) < 0.5 ? 0.5 : 1) / D; - da = (ty * dxb - tx * dyb) * l; - db = (tx * dya - ty * dxa) * l; - a += da; - b += db; - if (abs(da) < eps && abs(db) < eps) break; // we're crawling - } - return [a, b]; - }; -} + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) -// Bertin 1953 as a modified Briesemeister -// https://bl.ocks.org/Fil/5b9ee9636dfb6ffa53443c9006beb642 -function bertin1953Raw() { - var hammer$$1 = hammerRaw(1.68, 2), - fu = 1.4, k = 12; + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) - function forward(lambda, phi) { + case 'ascii': + return asciiSlice(this, start, end) - if (lambda + phi < -fu) { - var u = (lambda - phi + 1.6) * (lambda + phi + fu) / 8; - lambda += u; - phi -= 0.8 * u * sin(phi + pi / 2); - } + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) - var r = hammer$$1(lambda, phi); + case 'base64': + return base64Slice(this, start, end) - var d = (1 - cos(lambda * phi)) / k; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) - if (r[1] < 0) { - r[0] *= 1 + d; - } - if (r[1] > 0) { - r[1] *= 1 + d / 1.5 * r[0] * r[0]; + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true } - - return r; } - - forward.invert = solve2d(forward); - return forward; } -function bertin() { - // this projection should not be rotated - return d3Geo.geoProjection(bertin1953Raw()) - .rotate([-16.5, -42]) - .scale(176.57) - .center([7.93, 0.09]); -} +// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) +// to detect a Buffer instance. It's not possible to use `instanceof Buffer` +// reliably in a browserify context because there could be multiple different +// copies of the 'buffer' package in use. This method works even for Buffer +// instances that were created from another copy of the `buffer` package. +// See: https://github.com/feross/buffer/issues/154 +Buffer.prototype._isBuffer = true -function mollweideBromleyTheta(cp, phi) { - var cpsinPhi = cp * sin(phi), i = 30, delta; - do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi)); - while (abs(delta) > epsilon && --i > 0); - return phi / 2; +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i } -function mollweideBromleyRaw(cx, cy, cp) { - - function forward(lambda, phi) { - return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)]; +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') } - - forward.invert = function(x, y) { - return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)]; - }; - - return forward; + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this } -var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi); - -function mollweide() { - return d3Geo.geoProjection(mollweideRaw) - .scale(169.529); +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this } -var k = 2.00276, - w = 1.11072; - -function boggsRaw(lambda, phi) { - var theta = mollweideBromleyTheta(pi, phi); - return [k * lambda / (1 / cos(phi) + w / cos(theta)), (phi + sqrt2 * sin(theta)) / k]; +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this } -boggsRaw.invert = function(x, y) { - var ky = k * y, theta = y < 0 ? -quarterPi : quarterPi, i = 25, delta, phi; - do { - phi = ky - sqrt2 * sin(theta); - theta -= delta = (sin(2 * theta) + 2 * theta - pi * sin(phi)) / (2 * cos(2 * theta) + 2 + pi * cos(phi) * sqrt2 * cos(theta)); - } while (abs(delta) > epsilon && --i > 0); - phi = ky - sqrt2 * sin(theta); - return [x * (1 / cos(phi) + w / cos(theta)) / k, phi]; -}; - -function boggs() { - return d3Geo.geoProjection(boggsRaw) - .scale(160.857); +Buffer.prototype.toString = function toString () { + var length = this.length + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) } -function parallel1(projectAt) { - var phi0 = 0, - m = d3Geo.geoProjectionMutator(projectAt), - p = m(phi0); - - p.parallel = function(_) { - return arguments.length ? m(phi0 = _ * radians) : phi0 * degrees; - }; +Buffer.prototype.toLocaleString = Buffer.prototype.toString - return p; +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 } -function sinusoidalRaw(lambda, phi) { - return [lambda * cos(phi), phi]; +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' + return '' } -sinusoidalRaw.invert = function(x, y) { - return [x / cos(y), y]; -}; +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } -function sinusoidal() { - return d3Geo.geoProjection(sinusoidalRaw) - .scale(152.63); -} + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } -function bonneRaw(phi0) { - if (!phi0) return sinusoidalRaw; - var cotPhi0 = 1 / tan(phi0); + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } - function forward(lambda, phi) { - var rho = cotPhi0 + phi0 - phi, - e = rho ? lambda * cos(phi) / rho : rho; - return [rho * sin(e), cotPhi0 - rho * cos(e)]; + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 } - forward.invert = function(x, y) { - var rho = sqrt(x * x + (y = cotPhi0 - y) * y), - phi = cotPhi0 + phi0 - rho; - return [rho / cos(phi) * atan2(x, y), phi]; - }; + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 - return forward; -} + if (this === target) return 0 -function bonne() { - return parallel1(bonneRaw) - .scale(123.082) - .center([0, 26.1441]) - .parallel(45); -} + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) -function bottomleyRaw(sinPsi) { + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) - function forward(lambda, phi) { - var rho = halfPi - phi, - eta = rho ? lambda * sinPsi * sin(rho) / rho : rho; - return [rho * sin(eta) / sinPsi, halfPi - rho * cos(eta)]; + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } } - forward.invert = function(x, y) { - var x1 = x * sinPsi, - y1 = halfPi - y, - rho = sqrt(x1 * x1 + y1 * y1), - eta = atan2(x1, y1); - return [(rho ? rho / sin(rho) : 1) * eta / sinPsi, halfPi - rho]; - }; - - return forward; + if (x < y) return -1 + if (y < x) return 1 + return 0 } -function bottomley() { - var sinPsi = 0.5, - m = d3Geo.geoProjectionMutator(bottomleyRaw), - p = m(sinPsi); - - p.fraction = function(_) { - return arguments.length ? m(sinPsi = +_) : sinPsi; - }; - - return p - .scale(158.837); -} +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 -var bromleyRaw = mollweideBromleyRaw(1, 4 / pi, pi); + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } -function bromley() { - return d3Geo.geoProjection(bromleyRaw) - .scale(152.63); -} + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } -// Azimuthal distance. -function distance(dPhi, c1, s1, c2, s2, dLambda) { - var cosdLambda = cos(dLambda), r; - if (abs(dPhi) > 1 || abs(dLambda) > 1) { - r = acos(s1 * s2 + c1 * c2 * cosdLambda); - } else { - var sindPhi = sin(dPhi / 2), sindLambda = sin(dLambda / 2); - r = 2 * asin(sqrt(sindPhi * sindPhi + c1 * c2 * sindLambda * sindLambda)); + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) } - return abs(r) > epsilon ? [r, atan2(c2 * sin(dLambda), c1 * s2 - s1 * c2 * cosdLambda)] : [0, 0]; -} -// Angle opposite a, and contained between sides of lengths b and c. -function angle(b, c, a) { - return acos((b * b + c * c - a * a) / (2 * b * c)); -} + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } -// Normalize longitude. -function longitude(lambda) { - return lambda - 2 * pi * floor((lambda + pi) / (2 * pi)); + throw new TypeError('val must be string, number or Buffer') } -function chamberlinRaw(p0, p1, p2) { - var points = [ - [p0[0], p0[1], sin(p0[1]), cos(p0[1])], - [p1[0], p1[1], sin(p1[1]), cos(p1[1])], - [p2[0], p2[1], sin(p2[1]), cos(p2[1])] - ]; +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length - for (var a = points[2], b, i = 0; i < 3; ++i, a = b) { - b = points[i]; - a.v = distance(b[1] - a[1], a[3], a[2], b[3], b[2], b[0] - a[0]); - a.point = [0, 0]; + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } } - var beta0 = angle(points[0].v[0], points[2].v[0], points[1].v[0]), - beta1 = angle(points[0].v[0], points[1].v[0], points[2].v[0]), - beta2 = pi - beta0; - - points[2].point[1] = 0; - points[0].point[0] = -(points[1].point[0] = points[0].v[0] / 2); - - var mean = [ - points[2].point[0] = points[0].point[0] + points[2].v[0] * cos(beta0), - 2 * (points[0].point[1] = points[1].point[1] = points[2].v[0] * sin(beta0)) - ]; - - function forward(lambda, phi) { - var sinPhi = sin(phi), - cosPhi = cos(phi), - v = new Array(3), i; - - // Compute distance and azimuth from control points. - for (i = 0; i < 3; ++i) { - var p = points[i]; - v[i] = distance(phi - p[1], p[3], p[2], cosPhi, sinPhi, lambda - p[0]); - if (!v[i][0]) return p.point; - v[i][1] = longitude(v[i][1] - p.v[1]); + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) } + } - // Arithmetic mean of interception points. - var point = mean.slice(); - for (i = 0; i < 3; ++i) { - var j = i == 2 ? 0 : i + 1; - var a = angle(points[i].v[0], v[i][0], v[j][0]); - if (v[i][1] < 0) a = -a; - - if (!i) { - point[0] += v[i][0] * cos(a); - point[1] -= v[i][0] * sin(a); - } else if (i == 1) { - a = beta1 - a; - point[0] -= v[i][0] * cos(a); - point[1] -= v[i][0] * sin(a); + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { - a = beta2 - a; - point[0] += v[i][0] * cos(a); - point[1] += v[i][0] * sin(a); + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 } } - - point[0] /= 3, point[1] /= 3; - return point; + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } } - return forward; -} - -function pointRadians(p) { - return p[0] *= radians, p[1] *= radians, p; -} - -function chamberlinAfrica() { - return chamberlin([0, 22], [45, 22], [22.5, -22]) - .scale(380) - .center([22.5, 2]); + return -1 } -function chamberlin(p0, p1, p2) { // TODO order matters! - var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: [p0, p1, p2]}), - R = [-c[0], -c[1]], - r = d3Geo.geoRotation(R), - f = chamberlinRaw(pointRadians(r(p0)), pointRadians(r(p1)), pointRadians(r(p2))); - f.invert = solve2d(f); - var p = d3Geo.geoProjection(f).rotate(R), - center = p.center; - - delete p.rotate; - - p.center = function(_) { - return arguments.length ? center(r(_)) : r.invert(center()); - }; - - return p - .clipAngle(90); +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 } -function collignonRaw(lambda, phi) { - var alpha = sqrt(1 - sin(phi)); - return [(2 / sqrtPi) * lambda * alpha, sqrtPi * (1 - alpha)]; +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } -collignonRaw.invert = function(x, y) { - var lambda = (lambda = y / sqrtPi - 1) * lambda; - return [lambda > 0 ? x * sqrt(pi / lambda) / 2 : 0, asin(1 - lambda)]; -}; - -function collignon() { - return d3Geo.geoProjection(collignonRaw) - .scale(95.6464) - .center([0, 30]); +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } -function craigRaw(phi0) { - var tanPhi0 = tan(phi0); - - function forward(lambda, phi) { - return [lambda, (lambda ? lambda / sin(lambda) : 1) * (sin(phi) * cos(lambda) - tanPhi0 * cos(phi))]; +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } } - forward.invert = tanPhi0 ? function(x, y) { - if (x) y *= sin(x) / x; - var cosLambda = cos(x); - return [x, 2 * atan2(sqrt(cosLambda * cosLambda + tanPhi0 * tanPhi0 - y * y) - cosLambda, tanPhi0 - y)]; - } : function(x, y) { - return [x, asin(x ? y * tan(x) / x : y)]; - }; + var strLen = string.length - return forward; + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed + } + return i } -function craig() { - return parallel1(craigRaw) - .scale(249.828) - .clipAngle(90); +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } -var sqrt3 = sqrt(3); - -function crasterRaw(lambda, phi) { - return [sqrt3 * lambda * (2 * cos(2 * phi / 3) - 1) / sqrtPi, sqrt3 * sqrtPi * sin(phi / 3)]; +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) } -crasterRaw.invert = function(x, y) { - var phi = 3 * asin(y / (sqrt3 * sqrtPi)); - return [sqrtPi * x / (sqrt3 * (2 * cos(2 * phi / 3) - 1)), phi]; -}; - -function craster() { - return d3Geo.geoProjection(crasterRaw) - .scale(156.19); +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) } -function cylindricalEqualAreaRaw(phi0) { - var cosPhi0 = cos(phi0); - - function forward(lambda, phi) { - return [lambda * cosPhi0, sin(phi) / cosPhi0]; - } - - forward.invert = function(x, y) { - return [x / cosPhi0, asin(y * cosPhi0)]; - }; - - return forward; +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) } -function cylindricalEqualArea() { - return parallel1(cylindricalEqualAreaRaw) - .parallel(38.58) // acos(sqrt(width / height / pi)) * radians - .scale(195.044); // width / (sqrt(width / height / pi) * 2 * pi) +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } -function cylindricalStereographicRaw(phi0) { - var cosPhi0 = cos(phi0); - - function forward(lambda, phi) { - return [lambda * cosPhi0, (1 + cosPhi0) * tan(phi / 2)]; +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0 + if (isFinite(length)) { + length = length >>> 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) } - forward.invert = function(x, y) { - return [x / cosPhi0, atan(y / (1 + cosPhi0)) * 2]; - }; + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining - return forward; -} + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } -function cylindricalStereographic() { - return parallel1(cylindricalStereographicRaw) - .scale(124.75); -} + if (!encoding) encoding = 'utf8' -function eckert1Raw(lambda, phi) { - var alpha = sqrt(8 / (3 * pi)); - return [ - alpha * lambda * (1 - abs(phi) / pi), - alpha * phi - ]; -} + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) -eckert1Raw.invert = function(x, y) { - var alpha = sqrt(8 / (3 * pi)), - phi = y / alpha; - return [ - x / (alpha * (1 - abs(phi) / pi)), - phi - ]; -}; + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) -function eckert1() { - return d3Geo.geoProjection(eckert1Raw) - .scale(165.664); -} + case 'ascii': + return asciiWrite(this, string, offset, length) -function eckert2Raw(lambda, phi) { - var alpha = sqrt(4 - 3 * sin(abs(phi))); - return [ - 2 / sqrt(6 * pi) * lambda * alpha, - sign(phi) * sqrt(2 * pi / 3) * (2 - alpha) - ]; -} + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) -eckert2Raw.invert = function(x, y) { - var alpha = 2 - abs(y) / sqrt(2 * pi / 3); - return [ - x * sqrt(6 * pi) / (2 * alpha), - sign(y) * asin((4 - alpha * alpha) / 3) - ]; -}; + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) -function eckert2() { - return d3Geo.geoProjection(eckert2Raw) - .scale(165.664); -} + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) -function eckert3Raw(lambda, phi) { - var k = sqrt(pi * (4 + pi)); - return [ - 2 / k * lambda * (1 + sqrt(1 - 4 * phi * phi / (pi * pi))), - 4 / k * phi - ]; + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } } -eckert3Raw.invert = function(x, y) { - var k = sqrt(pi * (4 + pi)) / 2; - return [ - x * k / (1 + sqrt(1 - y * y * (4 + pi) / (4 * pi))), - y * k / 2 - ]; -}; - -function eckert3() { - return d3Geo.geoProjection(eckert3Raw) - .scale(180.739); +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } } -function eckert4Raw(lambda, phi) { - var k = (2 + halfPi) * sin(phi); - phi /= 2; - for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) { - var cosPhi = cos(phi); - phi -= delta = (phi + sin(phi) * (cosPhi + 2) - k) / (2 * cosPhi * (1 + cosPhi)); +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) } - return [ - 2 / sqrt(pi * (4 + pi)) * lambda * (1 + cos(phi)), - 2 * sqrt(pi / (4 + pi)) * sin(phi) - ]; } -eckert4Raw.invert = function(x, y) { - var A = y * sqrt((4 + pi) / pi) / 2, - k = asin(A), - c = cos(k); - return [ - x / (2 / sqrt(pi * (4 + pi)) * (1 + c)), - asin((k + A * (c + 2)) / (2 + halfPi)) - ]; -}; +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] -function eckert4() { - return d3Geo.geoProjection(eckert4Raw) - .scale(180.739); -} + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 -function eckert5Raw(lambda, phi) { - return [ - lambda * (1 + cos(phi)) / sqrt(2 + pi), - 2 * phi / sqrt(2 + pi) - ]; -} + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint -eckert5Raw.invert = function(x, y) { - var k = sqrt(2 + pi), - phi = y * k / 2; - return [ - k * x / (1 + cos(phi)), - phi - ]; -}; + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } -function eckert5() { - return d3Geo.geoProjection(eckert5Raw) - .scale(173.044); -} + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } -function eckert6Raw(lambda, phi) { - var k = (1 + halfPi) * sin(phi); - for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) { - phi -= delta = (phi + sin(phi) - k) / (1 + cos(phi)); + res.push(codePoint) + i += bytesPerSequence } - k = sqrt(2 + pi); - return [ - lambda * (1 + cos(phi)) / k, - 2 * phi / k - ]; -} - -eckert6Raw.invert = function(x, y) { - var j = 1 + halfPi, - k = sqrt(j / 2); - return [ - x * 2 * k / (1 + cos(y *= k)), - asin((y + sin(y)) / j) - ]; -}; -function eckert6() { - return d3Geo.geoProjection(eckert6Raw) - .scale(173.044); + return decodeCodePointsArray(res) } -var eisenlohrK = 3 + 2 * sqrt2; - -function eisenlohrRaw(lambda, phi) { - var s0 = sin(lambda /= 2), - c0 = cos(lambda), - k = sqrt(cos(phi)), - c1 = cos(phi /= 2), - t = sin(phi) / (c1 + sqrt2 * c0 * k), - c = sqrt(2 / (1 + t * t)), - v = sqrt((sqrt2 * c1 + (c0 + s0) * k) / (sqrt2 * c1 + (c0 - s0) * k)); - return [ - eisenlohrK * (c * (v - 1 / v) - 2 * log(v)), - eisenlohrK * (c * t * (v + 1 / v) - 2 * atan(t)) - ]; -} +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 -eisenlohrRaw.invert = function(x, y) { - if (!(p = augustRaw.invert(x / 1.2, y * 1.065))) return null; - var lambda = p[0], phi = p[1], i = 20, p; - x /= eisenlohrK, y /= eisenlohrK; - do { - var _0 = lambda / 2, - _1 = phi / 2, - s0 = sin(_0), - c0 = cos(_0), - s1 = sin(_1), - c1 = cos(_1), - cos1 = cos(phi), - k = sqrt(cos1), - t = s1 / (c1 + sqrt2 * c0 * k), - t2 = t * t, - c = sqrt(2 / (1 + t2)), - v0 = (sqrt2 * c1 + (c0 + s0) * k), - v1 = (sqrt2 * c1 + (c0 - s0) * k), - v2 = v0 / v1, - v = sqrt(v2), - vm1v = v - 1 / v, - vp1v = v + 1 / v, - fx = c * vm1v - 2 * log(v) - x, - fy = c * t * vp1v - 2 * atan(t) - y, - deltatDeltaLambda = s1 && sqrt1_2 * k * s0 * t2 / s1, - deltatDeltaPhi = (sqrt2 * c0 * c1 + k) / (2 * (c1 + sqrt2 * c0 * k) * (c1 + sqrt2 * c0 * k) * k), - deltacDeltat = -0.5 * t * c * c * c, - deltacDeltaLambda = deltacDeltat * deltatDeltaLambda, - deltacDeltaPhi = deltacDeltat * deltatDeltaPhi, - A = (A = 2 * c1 + sqrt2 * k * (c0 - s0)) * A * v, - deltavDeltaLambda = (sqrt2 * c0 * c1 * k + cos1) / A, - deltavDeltaPhi = -(sqrt2 * s0 * s1) / (k * A), - deltaxDeltaLambda = vm1v * deltacDeltaLambda - 2 * deltavDeltaLambda / v + c * (deltavDeltaLambda + deltavDeltaLambda / v2), - deltaxDeltaPhi = vm1v * deltacDeltaPhi - 2 * deltavDeltaPhi / v + c * (deltavDeltaPhi + deltavDeltaPhi / v2), - deltayDeltaLambda = t * vp1v * deltacDeltaLambda - 2 * deltatDeltaLambda / (1 + t2) + c * vp1v * deltatDeltaLambda + c * t * (deltavDeltaLambda - deltavDeltaLambda / v2), - deltayDeltaPhi = t * vp1v * deltacDeltaPhi - 2 * deltatDeltaPhi / (1 + t2) + c * vp1v * deltatDeltaPhi + c * t * (deltavDeltaPhi - deltavDeltaPhi / v2), - denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda; - if (!denominator) break; - var deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator, - deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator; - lambda -= deltaLambda; - phi = max(-halfPi, min(halfPi, phi - deltaPhi)); - } while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0); - return abs(abs(phi) - halfPi) < epsilon ? [0, phi] : i && [lambda, phi]; -}; +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } -function eisenlohr() { - return d3Geo.geoProjection(eisenlohrRaw) - .scale(62.5271); + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res } -var faheyK = cos(35 * radians); +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) -function faheyRaw(lambda, phi) { - var t = tan(phi / 2); - return [lambda * faheyK * sqrt(1 - t * t), (1 + faheyK) * t]; + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret } -faheyRaw.invert = function(x, y) { - var t = y / (1 + faheyK); - return [x && x / (faheyK * sqrt(1 - t * t)), 2 * atan(t)]; -}; +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) -function fahey() { - return d3Geo.geoProjection(faheyRaw) - .scale(137.152); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret } -function foucautRaw(lambda, phi) { - var k = phi / 2, cosk = cos(k); - return [ 2 * lambda / sqrtPi * cos(phi) * cosk * cosk, sqrtPi * tan(k)]; -} +function hexSlice (buf, start, end) { + var len = buf.length -foucautRaw.invert = function(x, y) { - var k = atan(y / sqrtPi), cosk = cos(k), phi = 2 * k; - return [x * sqrtPi / 2 / (cos(phi) * cosk * cosk), phi]; -}; + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len -function foucaut() { - return d3Geo.geoProjection(foucautRaw) - .scale(135.264); + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out } -function foucautSinusoidalRaw(alpha) { - var beta = 1 - alpha, - equatorial = raw(pi, 0)[0] - raw(-pi, 0)[0], - polar = raw(0, halfPi)[1] - raw(0, -halfPi)[1], - ratio = sqrt(2 * polar / equatorial); - - function raw(lambda, phi) { - var cosphi = cos(phi), - sinphi = sin(phi); - return [ - cosphi / (beta + alpha * cosphi) * lambda, - beta * phi + alpha * sinphi - ]; +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) } + return res +} - function forward(lambda, phi) { - var p = raw(lambda, phi); - return [p[0] * ratio, p[1] / ratio]; - } +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end - function forwardMeridian(phi) { - return forward(0, phi)[1]; + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len } - forward.invert = function(x, y) { - var phi = solve(forwardMeridian, y), - lambda = x / ratio * (alpha + beta / cos(phi)); - return [lambda, phi]; - }; - - return forward; -} - -function foucautSinusoidal() { - var alpha = 0.5, - m = d3Geo.geoProjectionMutator(foucautSinusoidalRaw), - p = m(alpha); - - p.alpha = function(_) { - return arguments.length ? m(alpha = +_) : alpha; - }; + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } - return p - .scale(168.725); -} + if (end < start) end = start -function gilbertForward(point) { - return [point[0] / 2, asin(tan(point[1] / 2 * radians)) * degrees]; + var newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + newBuf.__proto__ = Buffer.prototype + return newBuf } -function gilbertInvert(point) { - return [point[0] * 2, 2 * atan(sin(point[1] * radians)) * degrees]; +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } -function gilbert(projectionType) { - if (projectionType == null) projectionType = d3Geo.geoOrthographic; - var projection = projectionType(), - equirectangular = d3Geo.geoEquirectangular().scale(degrees).precision(0).clipAngle(null).translate([0, 0]); // antimeridian cutting +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) - function gilbert(point) { - return projection(gilbertForward(point)); + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul } - if (projection.invert) gilbert.invert = function(point) { - return gilbertInvert(projection.invert(point)); - }; + return val +} - gilbert.stream = function(stream) { - var s1 = projection.stream(stream), s0 = equirectangular.stream({ - point: function(lambda, phi) { s1.point(lambda / 2, asin(tan(-phi / 2 * radians)) * degrees); }, - lineStart: function() { s1.lineStart(); }, - lineEnd: function() { s1.lineEnd(); }, - polygonStart: function() { s1.polygonStart(); }, - polygonEnd: function() { s1.polygonEnd(); } - }); - s0.sphere = s1.sphere; - return s0; - }; +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } - function property(name) { - gilbert[name] = function() { - return arguments.length ? (projection[name].apply(projection, arguments), gilbert) : projection[name](); - }; + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul } - gilbert.rotate = function(_) { - return arguments.length ? (equirectangular.rotate(_), gilbert) : equirectangular.rotate(); - }; + return val +} - gilbert.center = function(_) { - return arguments.length ? (projection.center(gilbertForward(_)), gilbert) : gilbertInvert(projection.center()); - }; +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} - property("angle"); - property("clipAngle"); - property("clipExtent"); - property("fitExtent"); - property("fitHeight"); - property("fitSize"); - property("fitWidth"); - property("scale"); - property("translate"); - property("precision"); +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} - return gilbert - .scale(249.5); +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] } -function gingeryRaw(rho, n) { - var k = 2 * pi / n, - rho2 = rho * rho; +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) - function forward(lambda, phi) { - var p = d3Geo.geoAzimuthalEquidistantRaw(lambda, phi), - x = p[0], - y = p[1], - r2 = x * x + y * y; + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} - if (r2 > rho2) { - var r = sqrt(r2), - theta = atan2(y, x), - theta0 = k * round(theta / k), - alpha = theta - theta0, - rhoCosAlpha = rho * cos(alpha), - k_ = (rho * sin(alpha) - alpha * sin(rhoCosAlpha)) / (halfPi - rhoCosAlpha), - s_ = gingeryLength(alpha, k_), - e = (pi - rho) / gingeryIntegrate(s_, rhoCosAlpha, pi); +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) - x = r; - var i = 50, delta; - do { - x -= delta = (rho + gingeryIntegrate(s_, rhoCosAlpha, x) * e - r) / (s_(x) * e); - } while (abs(delta) > epsilon && --i > 0); + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} - y = alpha * sin(x); - if (x < halfPi) y -= k_ * (x - halfPi); +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) - var s = sin(theta0), - c = cos(theta0); - p[0] = x * c - y * s; - p[1] = x * s + y * c; - } - return p; + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul } + mul *= 0x80 - forward.invert = function(x, y) { - var r2 = x * x + y * y; - if (r2 > rho2) { - var r = sqrt(r2), - theta = atan2(y, x), - theta0 = k * round(theta / k), - dTheta = theta - theta0; - - x = r * cos(dTheta); - y = r * sin(dTheta); + if (val >= mul) val -= Math.pow(2, 8 * byteLength) - var x_halfPi = x - halfPi, - sinx = sin(x), - alpha = y / sinx, - delta = x < halfPi ? Infinity : 0, - i = 10; + return val +} - while (true) { - var rhosinAlpha = rho * sin(alpha), - rhoCosAlpha = rho * cos(alpha), - sinRhoCosAlpha = sin(rhoCosAlpha), - halfPi_RhoCosAlpha = halfPi - rhoCosAlpha, - k_ = (rhosinAlpha - alpha * sinRhoCosAlpha) / halfPi_RhoCosAlpha, - s_ = gingeryLength(alpha, k_); +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) - if (abs(delta) < epsilon2 || !--i) break; + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 - alpha -= delta = (alpha * sinx - k_ * x_halfPi - y) / ( - sinx - x_halfPi * 2 * ( - halfPi_RhoCosAlpha * (rhoCosAlpha + alpha * rhosinAlpha * cos(rhoCosAlpha) - sinRhoCosAlpha) - - rhosinAlpha * (rhosinAlpha - alpha * sinRhoCosAlpha) - ) / (halfPi_RhoCosAlpha * halfPi_RhoCosAlpha)); - } - r = rho + gingeryIntegrate(s_, rhoCosAlpha, x) * (pi - rho) / gingeryIntegrate(s_, rhoCosAlpha, pi); - theta = theta0 + alpha; - x = r * cos(theta); - y = r * sin(theta); - } - return d3Geo.geoAzimuthalEquidistantRaw.invert(x, y); - }; + if (val >= mul) val -= Math.pow(2, 8 * byteLength) - return forward; + return val } -function gingeryLength(alpha, k) { - return function(x) { - var y_ = alpha * cos(x); - if (x < halfPi) y_ -= k; - return sqrt(1 + y_ * y_); - }; +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) } -// Numerical integration: trapezoidal rule. -function gingeryIntegrate(f, a, b) { - var n = 50, - h = (b - a) / n, - s = f(a) + f(b); - for (var i = 1, x = a; i < n; ++i) s += 2 * f(x += h); - return s * 0.5 * h; +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val } -function gingery() { - var n = 6, - rho = 30 * radians, - cRho = cos(rho), - sRho = sin(rho), - m = d3Geo.geoProjectionMutator(gingeryRaw), - p = m(rho, n), - stream_ = p.stream, - epsilon$$1 = 1e-2, - cr = -cos(epsilon$$1 * radians), - sr = sin(epsilon$$1 * radians); +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} - p.radius = function(_) { - if (!arguments.length) return rho * degrees; - cRho = cos(rho = _ * radians); - sRho = sin(rho); - return m(rho, n); - }; +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) - p.lobes = function(_) { - if (!arguments.length) return n; - return m(rho, n = +_); - }; + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} - p.stream = function(stream) { - var rotate = p.rotate(), - rotateStream = stream_(stream), - sphereStream = (p.rotate([0, 0]), stream_(stream)); - p.rotate(rotate); - rotateStream.sphere = function() { - sphereStream.polygonStart(), sphereStream.lineStart(); - for (var i = 0, delta = 2 * pi / n, phi = 0; i < n; ++i, phi -= delta) { - sphereStream.point(atan2(sr * cos(phi), cr) * degrees, asin(sr * sin(phi)) * degrees); - sphereStream.point(atan2(sRho * cos(phi - delta / 2), cRho) * degrees, asin(sRho * sin(phi - delta / 2)) * degrees); - } - sphereStream.lineEnd(), sphereStream.polygonEnd(); - }; - return rotateStream; - }; +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) - return p - .rotate([90, -40]) - .scale(91.7095) - .clipAngle(180 - 1e-3); + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) } -function ginzburgPolyconicRaw(a, b, c, d, e, f, g, h) { - if (arguments.length < 8) h = 0; - - function forward(lambda, phi) { - if (!phi) return [a * lambda / pi, 0]; - var phi2 = phi * phi, - xB = a + phi2 * (b + phi2 * (c + phi2 * d)), - yB = phi * (e - 1 + phi2 * (f - h + phi2 * g)), - m = (xB * xB + yB * yB) / (2 * yB), - alpha = lambda * asin(xB / m) / pi; - return [m * sin(alpha), phi * (1 + phi2 * h) + m * (1 - cos(alpha))]; - } +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} - forward.invert = function(x, y) { - var lambda = pi * x / a, - phi = y, - deltaLambda, deltaPhi, i = 50; - do { - var phi2 = phi * phi, - xB = a + phi2 * (b + phi2 * (c + phi2 * d)), - yB = phi * (e - 1 + phi2 * (f - h + phi2 * g)), - p = xB * xB + yB * yB, - q = 2 * yB, - m = p / q, - m2 = m * m, - dAlphadLambda = asin(xB / m) / pi, - alpha = lambda * dAlphadLambda, - xB2 = xB * xB, - dxBdPhi = (2 * b + phi2 * (4 * c + phi2 * 6 * d)) * phi, - dyBdPhi = e + phi2 * (3 * f + phi2 * 5 * g), - dpdPhi = 2 * (xB * dxBdPhi + yB * (dyBdPhi - 1)), - dqdPhi = 2 * (dyBdPhi - 1), - dmdPhi = (dpdPhi * q - p * dqdPhi) / (q * q), - cosAlpha = cos(alpha), - sinAlpha = sin(alpha), - mcosAlpha = m * cosAlpha, - msinAlpha = m * sinAlpha, - dAlphadPhi = ((lambda / pi) * (1 / sqrt(1 - xB2 / m2)) * (dxBdPhi * m - xB * dmdPhi)) / m2, - fx = msinAlpha - x, - fy = phi * (1 + phi2 * h) + m - mcosAlpha - y, - deltaxDeltaPhi = dmdPhi * sinAlpha + mcosAlpha * dAlphadPhi, - deltaxDeltaLambda = mcosAlpha * dAlphadLambda, - deltayDeltaPhi = 1 + dmdPhi - (dmdPhi * cosAlpha - msinAlpha * dAlphadPhi), - deltayDeltaLambda = msinAlpha * dAlphadLambda, - denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda; - if (!denominator) break; - lambda -= deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator; - phi -= deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator; - } while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0); - return [lambda, phi]; - }; +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} - return forward; +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) } -var ginzburg4Raw = ginzburgPolyconicRaw(2.8284, -1.6988, 0.75432, -0.18071, 1.76003, -0.38914, 0.042555); +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} -function ginzburg4() { - return d3Geo.geoProjection(ginzburg4Raw) - .scale(149.995); +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') } -var ginzburg5Raw = ginzburgPolyconicRaw(2.583819, -0.835827, 0.170354, -0.038094, 1.543313, -0.411435,0.082742); +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } -function ginzburg5() { - return d3Geo.geoProjection(ginzburg5Raw) - .scale(153.93); + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength } -var ginzburg6Raw = ginzburgPolyconicRaw(5 / 6 * pi, -0.62636, -0.0344, 0, 1.3493, -0.05524, 0, 0.045); +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } -function ginzburg6() { - return d3Geo.geoProjection(ginzburg6Raw) - .scale(130.945); + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength } -function ginzburg8Raw(lambda, phi) { - var lambda2 = lambda * lambda, - phi2 = phi * phi; - return [ - lambda * (1 - 0.162388 * phi2) * (0.87 - 0.000952426 * lambda2 * lambda2), - phi * (1 + phi2 / 12) - ]; +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + this[offset] = (value & 0xff) + return offset + 1 } -ginzburg8Raw.invert = function(x, y) { - var lambda = x, - phi = y, - i = 50, delta; - do { - var phi2 = phi * phi; - phi -= delta = (phi * (1 + phi2 / 12) - y) / (1 + phi2 / 4); - } while (abs(delta) > epsilon && --i > 0); - i = 50; - x /= 1 -0.162388 * phi2; - do { - var lambda4 = (lambda4 = lambda * lambda) * lambda4; - lambda -= delta = (lambda * (0.87 - 0.000952426 * lambda4) - x) / (0.87 - 0.00476213 * lambda4); - } while (abs(delta) > epsilon && --i > 0); - return [lambda, phi]; -}; +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} -function ginzburg8() { - return d3Geo.geoProjection(ginzburg8Raw) - .scale(131.747); +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 } -var ginzburg9Raw = ginzburgPolyconicRaw(2.6516, -0.76534, 0.19123, -0.047094, 1.36289, -0.13965,0.031762); +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + return offset + 4 +} -function ginzburg9() { - return d3Geo.geoProjection(ginzburg9Raw) - .scale(131.087); +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 } -function squareRaw(project) { - var dx = project(halfPi, 0)[0] - project(-halfPi, 0)[0]; +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) - function projectSquare(lambda, phi) { - var s = lambda > 0 ? -0.5 : 0.5, - point = project(lambda + s * pi, phi); - point[0] -= s * dx; - return point; + checkInt(this, value, offset, byteLength, limit - 1, -limit) } - if (project.invert) projectSquare.invert = function(x, y) { - var s = x > 0 ? -0.5 : 0.5, - location = project.invert(x + s * dx, y), - lambda = location[0] - s * pi; - if (lambda < -pi) lambda += 2 * pi; - else if (lambda > pi) lambda -= 2 * pi; - location[0] = lambda; - return location; - }; + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } - return projectSquare; + return offset + byteLength } -function gringortenRaw(lambda, phi) { - var sLambda = sign(lambda), - sPhi = sign(phi), - cosPhi = cos(phi), - x = cos(lambda) * cosPhi, - y = sin(lambda) * cosPhi, - z = sin(sPhi * phi); - lambda = abs(atan2(y, z)); - phi = asin(x); - if (abs(lambda - halfPi) > epsilon) lambda %= halfPi; - var point = gringortenHexadecant(lambda > pi / 4 ? halfPi - lambda : lambda, phi); - if (lambda > pi / 4) z = point[0], point[0] = -point[1], point[1] = -z; - return (point[0] *= sLambda, point[1] *= -sPhi, point); -} +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) -gringortenRaw.invert = function(x, y) { - if (abs(x) > 1) x = sign(x) * 2 - x; - if (abs(y) > 1) y = sign(y) * 2 - y; - var sx = sign(x), - sy = sign(y), - x0 = -sx * x, - y0 = -sy * y, - t = y0 / x0 < 1, - p = gringortenHexadecantInvert(t ? y0 : x0, t ? x0 : y0), - lambda = p[0], - phi = p[1], - cosPhi = cos(phi); - if (t) lambda = -halfPi - lambda; - return [sx * (atan2(sin(lambda) * cosPhi, -sin(phi)) + pi), sy * asin(cos(lambda) * cosPhi)]; -}; + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } -function gringortenHexadecant(lambda, phi) { - if (phi === halfPi) return [0, 0]; + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } - var sinPhi = sin(phi), - r = sinPhi * sinPhi, - r2 = r * r, - j = 1 + r2, - k = 1 + 3 * r2, - q = 1 - r2, - z = asin(1 / sqrt(j)), - v = q + r * j * z, - p2 = (1 - sinPhi) / v, - p = sqrt(p2), - a2 = p2 * j, - a = sqrt(a2), - h = p * q, - x, - i; + return offset + byteLength +} - if (lambda === 0) return [0, -(h + r * a)]; +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} - var cosPhi = cos(phi), - secPhi = 1 / cosPhi, - drdPhi = 2 * sinPhi * cosPhi, - dvdPhi = (-3 * r + z * k) * drdPhi, - dp2dPhi = (-v * cosPhi - (1 - sinPhi) * dvdPhi) / (v * v), - dpdPhi = (0.5 * dp2dPhi) / p, - dhdPhi = q * dpdPhi - 2 * r * p * drdPhi, - dra2dPhi = r * j * dp2dPhi + p2 * k * drdPhi, - mu = -secPhi * drdPhi, - nu = -secPhi * dra2dPhi, - zeta = -2 * secPhi * dhdPhi, - lambda1 = 4 * lambda / pi, - delta; +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} - // Slower but accurate bisection method. - if (lambda > 0.222 * pi || phi < pi / 4 && lambda > 0.175 * pi) { - x = (h + r * sqrt(a2 * (1 + r2) - h * h)) / (1 + r2); - if (lambda > pi / 4) return [x, x]; - var x1 = x, x0 = 0.5 * x; - x = 0.5 * (x0 + x1), i = 50; - do { - var g = sqrt(a2 - x * x), - f = (x * (zeta + mu * g) + nu * asin(x / a)) - lambda1; - if (!f) break; - if (f < 0) x0 = x; - else x1 = x; - x = 0.5 * (x0 + x1); - } while (abs(x1 - x0) > epsilon && --i > 0); - } +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} - // Newton-Raphson. - else { - x = epsilon, i = 25; - do { - var x2 = x * x, - g2 = sqrt(a2 - x2), - zetaMug = zeta + mu * g2, - f2 = x * zetaMug + nu * asin(x / a) - lambda1, - df = zetaMug + (nu - mu * x2) / g2; - x -= delta = g2 ? f2 / df : 0; - } while (abs(delta) > epsilon && --i > 0); - } +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + return offset + 4 +} - return [x, -h - r * sqrt(a2 - x * x)]; +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 } -function gringortenHexadecantInvert(x, y) { - var x0 = 0, - x1 = 1, - r = 0.5, - i = 50; +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} - while (true) { - var r2 = r * r, - sinPhi = sqrt(r), - z = asin(1 / sqrt(1 + r2)), - v = (1 - r2) + r * (1 + r2) * z, - p2 = (1 - sinPhi) / v, - p = sqrt(p2), - a2 = p2 * (1 + r2), - h = p * (1 - r2), - g2 = a2 - x * x, - g = sqrt(g2), - y0 = y + h + r * g; - if (abs(x1 - x0) < epsilon2 || --i === 0 || y0 === 0) break; - if (y0 > 0) x0 = r; - else x1 = r; - r = 0.5 * (x0 + x1); +function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} - if (!i) return null; +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} - var phi = asin(sinPhi), - cosPhi = cos(phi), - secPhi = 1 / cosPhi, - drdPhi = 2 * sinPhi * cosPhi, - dvdPhi = (-3 * r + z * (1 + 3 * r2)) * drdPhi, - dp2dPhi = (-v * cosPhi - (1 - sinPhi) * dvdPhi) / (v * v), - dpdPhi = 0.5 * dp2dPhi / p, - dhdPhi = (1 - r2) * dpdPhi - 2 * r * p * drdPhi, - zeta = -2 * secPhi * dhdPhi, - mu = -secPhi * drdPhi, - nu = -secPhi * (r * (1 + r2) * dp2dPhi + p2 * (1 + 3 * r2) * drdPhi); +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} - return [pi / 4 * (x * (zeta + mu * g) + nu * asin(x / sqrt(a2))), phi]; +function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 } -function gringorten() { - return d3Geo.geoProjection(squareRaw(gringortenRaw)) - .scale(239.75); +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) } -// Returns [sn, cn, dn](u + iv|m). -function ellipticJi(u, v, m) { - var a, b, c; - if (!u) { - b = ellipticJ(v, 1 - m); - return [ - [0, b[0] / b[1]], - [1 / b[1], 0], - [b[2] / b[1], 0] - ]; - } - a = ellipticJ(u, m); - if (!v) return [[a[0], 0], [a[1], 0], [a[2], 0]]; - b = ellipticJ(v, 1 - m); - c = b[1] * b[1] + m * a[0] * a[0] * b[0] * b[0]; - return [ - [a[0] * b[2] / c, a[1] * a[2] * b[0] * b[1] / c], - [a[1] * b[1] / c, -a[0] * a[2] * b[0] * b[2] / c], - [a[2] * b[1] * b[2] / c, -m * a[0] * a[1] * b[0] / c] - ]; +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) } -// Returns [sn, cn, dn, ph](u|m). -function ellipticJ(u, m) { - var ai, b, phi, t, twon; - if (m < epsilon) { - t = sin(u); - b = cos(u); - ai = m * (u - t * b) / 4; - return [ - t - ai * b, - b + ai * t, - 1 - m * t * t / 2, - u - ai - ]; +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') } - if (m >= 1 - epsilon) { - ai = (1 - m) / 4; - b = cosh(u); - t = tanh(u); - phi = 1 / b; - twon = b * sinh(u); - return [ - t + ai * (twon - u) / (b * b), - phi - ai * t * phi * (twon - u), - phi + ai * t * phi * (twon + u), - 2 * atan(exp(u)) - halfPi + ai * (twon - u) / b - ]; + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start } - var a = [1, 0, 0, 0, 0, 0, 0, 0, 0], - c = [sqrt(m), 0, 0, 0, 0, 0, 0, 0, 0], - i = 0; - b = sqrt(1 - m); - twon = 1; + var len = end - start - while (abs(c[i] / a[i]) > epsilon && i < 8) { - ai = a[i++]; - c[i] = (ai - b) / 2; - a[i] = (ai + b) / 2; - b = sqrt(ai * b); - twon *= 2; + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end) + } else if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (var i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ) } - phi = twon * a[i] * u; - do { - t = c[i] * sin(b = phi) / a[i]; - phi = (asin(t) + phi) / 2; - } while (--i); - - return [sin(phi), t = cos(phi), t / cos(phi - b), phi]; + return len } -// Calculate F(phi+iPsi|m). -// See Abramowitz and Stegun, 17.4.11. -function ellipticFi(phi, psi, m) { - var r = abs(phi), - i = abs(psi), - sinhPsi = sinh(i); - if (r) { - var cscPhi = 1 / sin(r), - cotPhi2 = 1 / (tan(r) * tan(r)), - b = -(cotPhi2 + m * (sinhPsi * sinhPsi * cscPhi * cscPhi) - 1 + m), - c = (m - 1) * cotPhi2, - cotLambda2 = (-b + sqrt(b * b - 4 * c)) / 2; - return [ - ellipticF(atan(1 / sqrt(cotLambda2)), m) * sign(phi), - ellipticF(atan(sqrt((cotLambda2 / cotPhi2 - 1) / m)), 1 - m) * sign(psi) - ]; +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 } - return [ - 0, - ellipticF(atan(sinhPsi), 1 - m) * sign(psi) - ]; -} -// Calculate F(phi|m) where m = k² = sin²α. -// See Abramowitz and Stegun, 17.6.7. -function ellipticF(phi, m) { - if (!m) return phi; - if (m === 1) return log(tan(phi / 2 + quarterPi)); - var a = 1, - b = sqrt(1 - m), - c = sqrt(m); - for (var i = 0; abs(c) > epsilon; i++) { - if (phi % pi) { - var dPhi = atan(b * tan(phi) / a); - if (dPhi < 0) dPhi += pi; - phi += dPhi + ~~(phi / pi) * pi; - } else phi += phi; - c = (a + b) / 2; - b = sqrt(a * b); - c = ((a = c) - b) / 2; + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') } - return phi / (pow(2, i) * a); -} -function guyouRaw(lambda, phi) { - var k_ = (sqrt2 - 1) / (sqrt2 + 1), - k = sqrt(1 - k_ * k_), - K = ellipticF(halfPi, k * k), - f = -1, - psi = log(tan(pi / 4 + abs(phi) / 2)), - r = exp(f * psi) / sqrt(k_), - at = guyouComplexAtan(r * cos(f * lambda), r * sin(f * lambda)), - t = ellipticFi(at[0], at[1], k * k); - return [-t[1], (phi >= 0 ? 1 : -1) * (0.5 * K - t[0])]; -} + if (end <= start) { + return this + } -function guyouComplexAtan(x, y) { - var x2 = x * x, - y_1 = y + 1, - t = 1 - x2 - y * y; - return [ - 0.5 * ((x >= 0 ? halfPi : -halfPi) - atan2(t, 2 * x)), - -0.25 * log(t * t + 4 * x2) +0.5 * log(y_1 * y_1 + x2) - ]; -} + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 -function guyouComplexDivide(a, b) { - var denominator = b[0] * b[0] + b[1] * b[1]; - return [ - (a[0] * b[0] + a[1] * b[1]) / denominator, - (a[1] * b[0] - a[0] * b[1]) / denominator - ]; -} + if (!val) val = 0 -guyouRaw.invert = function(x, y) { - var k_ = (sqrt2 - 1) / (sqrt2 + 1), - k = sqrt(1 - k_ * k_), - K = ellipticF(halfPi, k * k), - f = -1, - j = ellipticJi(0.5 * K - y, -x, k * k), - tn = guyouComplexDivide(j[0], j[1]), - lambda = atan2(tn[1], tn[0]) / f; - return [ - lambda, - 2 * atan(exp(0.5 / f * log(k_ * tn[0] * tn[0] + k_ * tn[1] * tn[1]))) - halfPi - ]; -}; + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding) + var len = bytes.length + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } -function guyou() { - return d3Geo.geoProjection(squareRaw(guyouRaw)) - .scale(151.496); + return this } -function hammerRetroazimuthalRaw(phi0) { - var sinPhi0 = sin(phi0), - cosPhi0 = cos(phi0), - rotate = hammerRetroazimuthalRotation(phi0); +// HELPER FUNCTIONS +// ================ - rotate.invert = hammerRetroazimuthalRotation(-phi0); +var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g - function forward(lambda, phi) { - var p = rotate(lambda, phi); - lambda = p[0], phi = p[1]; - var sinPhi = sin(phi), - cosPhi = cos(phi), - cosLambda = cos(lambda), - z = acos(sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosLambda), - sinz = sin(z), - K = abs(sinz) > epsilon ? z / sinz : 1; - return [ - K * cosPhi0 * sin(lambda), - (abs(lambda) > halfPi ? K : -K) // rotate for back hemisphere - * (sinPhi0 * cosPhi - cosPhi0 * sinPhi * cosLambda) - ]; +function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0] + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' } - - forward.invert = function(x, y) { - var rho = sqrt(x * x + y * y), - sinz = -sin(rho), - cosz = cos(rho), - a = rho * cosz, - b = -y * sinz, - c = rho * sinPhi0, - d = sqrt(a * a + b * b - c * c), - phi = atan2(a * c + b * d, b * c - a * d), - lambda = (rho > halfPi ? -1 : 1) * atan2(x * sinz, rho * cos(phi) * cosz + y * sin(phi) * sinz); - return rotate.invert(lambda, phi); - }; - - return forward; + return str } -// Latitudinal rotation by phi0. -// Temporary hack until D3 supports arbitrary small-circle clipping origins. -function hammerRetroazimuthalRotation(phi0) { - var sinPhi0 = sin(phi0), - cosPhi0 = cos(phi0); - - return function(lambda, phi) { - var cosPhi = cos(phi), - x = cos(lambda) * cosPhi, - y = sin(lambda) * cosPhi, - z = sin(phi); - return [ - atan2(y, x * cosPhi0 - z * sinPhi0), - asin(z * cosPhi0 + x * sinPhi0) - ]; - }; +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) } -function hammerRetroazimuthal() { - var phi0 = 0, - m = d3Geo.geoProjectionMutator(hammerRetroazimuthalRaw), - p = m(phi0), - rotate_ = p.rotate, - stream_ = p.stream, - circle = d3Geo.geoCircle(); +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] - p.parallel = function(_) { - if (!arguments.length) return phi0 * degrees; - var r = p.rotate(); - return m(phi0 = _ * radians).rotate(r); - }; + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) - // Temporary hack; see hammerRetroazimuthalRotation. - p.rotate = function(_) { - if (!arguments.length) return (_ = rotate_.call(p), _[1] += phi0 * degrees, _); - rotate_.call(p, [_[0], _[1] - phi0 * degrees]); - circle.center([-_[0], -_[1]]); - return p; - }; + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } - p.stream = function(stream) { - stream = stream_(stream); - stream.sphere = function() { - stream.polygonStart(); - var epsilon$$1 = 1e-2, - ring = circle.radius(90 - epsilon$$1)().coordinates[0], - n = ring.length - 1, - i = -1, - p; - stream.lineStart(); - while (++i < n) stream.point((p = ring[i])[0], p[1]); - stream.lineEnd(); - ring = circle.radius(90 + epsilon$$1)().coordinates[0]; - n = ring.length - 1; - stream.lineStart(); - while (--i >= 0) stream.point((p = ring[i])[0], p[1]); - stream.lineEnd(); - stream.polygonEnd(); - }; - return stream; - }; + // valid lead + leadSurrogate = codePoint - return p - .scale(79.4187) - .parallel(45) - .clipAngle(180 - 1e-3); -} + continue + } -var K = 3, - healpixParallel = asin(1 - 1 / K) * degrees, - healpixLambert = cylindricalEqualAreaRaw(0); + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } -function healpixRaw(H) { - var phi0 = healpixParallel * radians, - dx = collignonRaw(pi, phi0)[0] - collignonRaw(-pi, phi0)[0], - y0 = healpixLambert(0, phi0)[1], - y1 = collignonRaw(0, phi0)[1], - dy1 = sqrtPi - y1, - k = tau / H, - w = 4 / tau, - h = y0 + (dy1 * dy1 * 4) / tau; + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } - function forward(lambda, phi) { - var point, - phi2 = abs(phi); - if (phi2 > phi0) { - var i = min(H - 1, max(0, floor((lambda + pi) / k))); - lambda += pi * (H - 1) / H - i * k; - point = collignonRaw(lambda, phi2); - point[0] = point[0] * tau / dx - tau * (H - 1) / (2 * H) + i * tau / H; - point[1] = y0 + (point[1] - y1) * 4 * dy1 / tau; - if (phi < 0) point[1] = -point[1]; + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) } else { - point = healpixLambert(lambda, phi); + throw new Error('Invalid code point') } - point[0] *= w, point[1] /= h; - return point; } - forward.invert = function(x, y) { - x /= w, y *= h; - var y2 = abs(y); - if (y2 > y0) { - var i = min(H - 1, max(0, floor((x + pi) / k))); - x = (x + pi * (H - 1) / H - i * k) * dx / tau; - var point = collignonRaw.invert(x, 0.25 * (y2 - y0) * tau / dy1 + y1); - point[0] -= pi * (H - 1) / H - i * k; - if (y < 0) point[1] = -point[1]; - return point; - } - return healpixLambert.invert(x, y); - }; + return bytes +} - return forward; +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray } -function sphereTop(x, i) { - return [x, i & 1 ? 90 - epsilon : healpixParallel]; +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray } -function sphereBottom(x, i) { - return [x, i & 1 ? -90 + epsilon : -healpixParallel]; +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) } -function sphereNudge(d) { - return [d[0] * (1 - epsilon), d[1]]; +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i } -function sphere(step) { - var c = [].concat( - d3Array.range(-180, 180 + step / 2, step).map(sphereTop), - d3Array.range(180, -180 - step / 2, -step).map(sphereBottom) - ); - return { - type: "Polygon", - coordinates: [step === 180 ? c.map(sphereNudge) : c] - }; +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) +} +function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare } -function healpix() { - var H = 4, - m = d3Geo.geoProjectionMutator(healpixRaw), - p = m(H), - stream_ = p.stream; +}).call(this)}).call(this,_dereq_("buffer").Buffer) +},{"base64-js":75,"buffer":105,"ieee754":345}],106:[function(_dereq_,module,exports){ +'use strict' - p.lobes = function(_) { - return arguments.length ? m(H = +_) : H; - }; +var monotoneTriangulate = _dereq_('./lib/monotone') +var makeIndex = _dereq_('./lib/triangulation') +var delaunayFlip = _dereq_('./lib/delaunay') +var filterTriangulation = _dereq_('./lib/filter') - p.stream = function(stream) { - var rotate = p.rotate(), - rotateStream = stream_(stream), - sphereStream = (p.rotate([0, 0]), stream_(stream)); - p.rotate(rotate); - rotateStream.sphere = function() { d3Geo.geoStream(sphere(180 / H), sphereStream); }; - return rotateStream; - }; +module.exports = cdt2d - return p - .scale(239.75); +function canonicalizeEdge(e) { + return [Math.min(e[0], e[1]), Math.max(e[0], e[1])] } -function hillRaw(K) { - var L = 1 + K, - sinBt = sin(1 / L), - Bt = asin(sinBt), - A = 2 * sqrt(pi / (B = pi + 4 * Bt * L)), - B, - rho0 = 0.5 * A * (L + sqrt(K * (2 + K))), - K2 = K * K, - L2 = L * L; - - function forward(lambda, phi) { - var t = 1 - sin(phi), - rho, - omega; - if (t && t < 2) { - var theta = halfPi - phi, i = 25, delta; - do { - var sinTheta = sin(theta), - cosTheta = cos(theta), - Bt_Bt1 = Bt + atan2(sinTheta, L - cosTheta), - C = 1 + L2 - 2 * L * cosTheta; - theta -= delta = (theta - K2 * Bt - L * sinTheta + C * Bt_Bt1 -0.5 * t * B) / (2 * L * sinTheta * Bt_Bt1); - } while (abs(delta) > epsilon2 && --i > 0); - rho = A * sqrt(C); - omega = lambda * Bt_Bt1 / pi; - } else { - rho = A * (K + t); - omega = lambda * Bt / pi; - } - return [ - rho * sin(omega), - rho0 - rho * cos(omega) - ]; - } +function compareEdge(a, b) { + return a[0]-b[0] || a[1]-b[1] +} - forward.invert = function(x, y) { - var rho2 = x * x + (y -= rho0) * y, - cosTheta = (1 + L2 - rho2 / (A * A)) / (2 * L), - theta = acos(cosTheta), - sinTheta = sin(theta), - Bt_Bt1 = Bt + atan2(sinTheta, L - cosTheta); - return [ - asin(x / sqrt(rho2)) * pi / Bt_Bt1, - asin(1 - 2 * (theta - K2 * Bt - L * sinTheta + (1 + L2 - 2 * L * cosTheta) * Bt_Bt1) / B) - ]; - }; +function canonicalizeEdges(edges) { + return edges.map(canonicalizeEdge).sort(compareEdge) +} - return forward; +function getDefault(options, property, dflt) { + if(property in options) { + return options[property] + } + return dflt } -function hill() { - var K = 1, - m = d3Geo.geoProjectionMutator(hillRaw), - p = m(K); +function cdt2d(points, edges, options) { - p.ratio = function(_) { - return arguments.length ? m(K = +_) : K; - }; + if(!Array.isArray(edges)) { + options = edges || {} + edges = [] + } else { + options = options || {} + edges = edges || [] + } - return p - .scale(167.774) - .center([0, 18.67]); -} + //Parse out options + var delaunay = !!getDefault(options, 'delaunay', true) + var interior = !!getDefault(options, 'interior', true) + var exterior = !!getDefault(options, 'exterior', true) + var infinity = !!getDefault(options, 'infinity', false) -var sinuMollweidePhi = 0.7109889596207567; + //Handle trivial case + if((!interior && !exterior) || points.length === 0) { + return [] + } -var sinuMollweideY = 0.0528035274542; + //Construct initial triangulation + var cells = monotoneTriangulate(points, edges) -function sinuMollweideRaw(lambda, phi) { - return phi > -sinuMollweidePhi - ? (lambda = mollweideRaw(lambda, phi), lambda[1] += sinuMollweideY, lambda) - : sinusoidalRaw(lambda, phi); -} + //If delaunay refinement needed, then improve quality by edge flipping + if(delaunay || interior !== exterior || infinity) { -sinuMollweideRaw.invert = function(x, y) { - return y > -sinuMollweidePhi - ? mollweideRaw.invert(x, y - sinuMollweideY) - : sinusoidalRaw.invert(x, y); -}; + //Index all of the cells to support fast neighborhood queries + var triangulation = makeIndex(points.length, canonicalizeEdges(edges)) + for(var i=0; i sinuMollweidePhi - ? (lambda = mollweideRaw(lambda, phi), lambda[1] -= phi > 0 ? sinuMollweideY : -sinuMollweideY, lambda) - : sinusoidalRaw(lambda, phi); + //Filter points + if(!exterior) { + return filterTriangulation(triangulation, -1) + } else if(!interior) { + return filterTriangulation(triangulation, 1, infinity) + } else if(infinity) { + return filterTriangulation(triangulation, 0, infinity) + } else { + return triangulation.cells() + } + + } else { + return cells + } } -homolosineRaw.invert = function(x, y) { - return abs(y) > sinuMollweidePhi - ? mollweideRaw.invert(x, y + (y > 0 ? sinuMollweideY : -sinuMollweideY)) - : sinusoidalRaw.invert(x, y); -}; +},{"./lib/delaunay":107,"./lib/filter":108,"./lib/monotone":109,"./lib/triangulation":110}],107:[function(_dereq_,module,exports){ +'use strict' -function homolosine() { - return d3Geo.geoProjection(homolosineRaw) - .scale(152.63); -} +var inCircle = _dereq_('robust-in-sphere')[4] +var bsearch = _dereq_('binary-search-bounds') -function hufnagelRaw(a, b, psiMax, ratio) { - var k = sqrt( - (4 * pi) / - (2 * psiMax + - (1 + a - b / 2) * sin(2 * psiMax) + - ((a + b) / 2) * sin(4 * psiMax) + - (b / 2) * sin(6 * psiMax)) - ), - c = sqrt( - ratio * - sin(psiMax) * - sqrt((1 + a * cos(2 * psiMax) + b * cos(4 * psiMax)) / (1 + a + b)) - ), - M = psiMax * mapping(1); +module.exports = delaunayRefine - function radius(psi) { - return sqrt(1 + a * cos(2 * psi) + b * cos(4 * psi)); - } +function testFlip(points, triangulation, stack, a, b, x) { + var y = triangulation.opposite(a, b) - function mapping(t) { - var psi = t * psiMax; - return ( - (2 * psi + - (1 + a - b / 2) * sin(2 * psi) + - ((a + b) / 2) * sin(4 * psi) + - (b / 2) * sin(6 * psi)) / - psiMax - ); + //Test boundary edge + if(y < 0) { + return } - function inversemapping(psi) { - return radius(psi) * sin(psi); + //Swap edge if order flipped + if(b < a) { + var tmp = a + a = b + b = tmp + tmp = x + x = y + y = tmp } - var forward = function(lambda, phi) { - var psi = psiMax * solve(mapping, (M * sin(phi)) / psiMax, phi / pi); - if (isNaN(psi)) psi = psiMax * sign(phi); - var kr = k * radius(psi); - return [((kr * c * lambda) / pi) * cos(psi), (kr / c) * sin(psi)]; - }; - - forward.invert = function(x, y) { - var psi = solve(inversemapping, (y * c) / k); - return [ - (x * pi) / (cos(psi) * k * c * radius(psi)), - asin((psiMax * mapping(psi / psiMax)) / M) - ]; - }; - - if (psiMax === 0) { - k = sqrt(ratio / pi); - forward = function(lambda, phi) { - return [lambda * k, sin(phi) / k]; - }; - forward.invert = function(x, y) { - return [x / k, asin(y * k)]; - }; + //Test if edge is constrained + if(triangulation.isConstraint(a, b)) { + return } - return forward; + //Test if edge is delaunay + if(inCircle(points[a], points[b], points[x], points[y]) < 0) { + stack.push(a, b) + } } -function hufnagel() { - var a = 1, - b = 0, - psiMax = 45 * radians, - ratio = 2, - mutate = d3Geo.geoProjectionMutator(hufnagelRaw), - projection = mutate(a, b, psiMax, ratio); +//Assume edges are sorted lexicographically +function delaunayRefine(points, triangulation) { + var stack = [] - projection.a = function(_) { - return arguments.length ? mutate((a = +_), b, psiMax, ratio) : a; - }; - projection.b = function(_) { - return arguments.length ? mutate(a, (b = +_), psiMax, ratio) : b; - }; - projection.psiMax = function(_) { - return arguments.length - ? mutate(a, b, (psiMax = +_ * radians), ratio) - : psiMax * degrees; - }; - projection.ratio = function(_) { - return arguments.length ? mutate(a, b, psiMax, (ratio = +_)) : ratio; - }; + var numPoints = points.length + var stars = triangulation.stars + for(var a=0; a 0) { + var b = stack.pop() + var a = stack.pop() - h = b - a; - f1 = f(a + h * 0.25); - f2 = f(b - h * 0.25); + //Find opposite pairs + var x = -1, y = -1 + var star = stars[a] + for(var i=1; i= 0) { + continue + } + + //Flip the edge + triangulation.flip(a, b) + + //Test flipping neighboring edges + testFlip(points, triangulation, stack, x, a, y) + testFlip(points, triangulation, stack, a, y, x) + testFlip(points, triangulation, stack, y, b, x) + testFlip(points, triangulation, stack, b, x, y) } +} - sl = h * (fa + 4 * f1 + fm) / 12; - sr = h * (fm + 4 * f2 + fb) / 12; - s2 = sl + sr; - err = (s2 - V0) / 15; +},{"binary-search-bounds":92,"robust-in-sphere":425}],108:[function(_dereq_,module,exports){ +'use strict' - if (depth > maxdepth) { - state.maxDepthCount++; - return s2 + err; - } else if (Math.abs(err) < tol) { - return s2 + err; - } else { - m = a + h * 0.5; +var bsearch = _dereq_('binary-search-bounds') - V1 = adsimp(f, a, m, fa, f1, fm, sl, tol * 0.5, maxdepth, depth + 1, state); +module.exports = classifyFaces - if (isNaN(V1)) { - state.nanEncountered = true; - return NaN; - } +function FaceIndex(cells, neighbor, constraint, flags, active, next, boundary) { + this.cells = cells + this.neighbor = neighbor + this.flags = flags + this.constraint = constraint + this.active = active + this.next = next + this.boundary = boundary +} - V2 = adsimp(f, m, b, fm, f2, fb, sr, tol * 0.5, maxdepth, depth + 1, state); +var proto = FaceIndex.prototype - if (isNaN(V2)) { - state.nanEncountered = true; - return NaN; +function compareCell(a, b) { + return a[0] - b[0] || + a[1] - b[1] || + a[2] - b[2] +} + +proto.locate = (function() { + var key = [0,0,0] + return function(a, b, c) { + var x = a, y = b, z = c + if(b < c) { + if(b < a) { + x = b + y = c + z = a + } + } else if(c < a) { + x = c + y = a + z = b + } + if(x < 0) { + return -1 } + key[0] = x + key[1] = y + key[2] = z + return bsearch.eq(this.cells, key, compareCell) + } +})() + +function indexCells(triangulation, infinity) { + //First get cells and canonicalize + var cells = triangulation.cells() + var nc = cells.length + for(var i=0; i 0 || next.length > 0) { + while(active.length > 0) { + var t = active.pop() + if(flags[t] === -side) { + continue + } + flags[t] = side + var c = cells[t] + for(var j=0; j<3; ++j) { + var f = neighbor[3*t+j] + if(f >= 0 && flags[f] === 0) { + if(constraint[3*t+j]) { + next.push(f) + } else { + active.push(f) + flags[f] = side + } + } + } + } - var result = adsimp(f, a, b, fa, fm, fb, V0, tol, maxdepth, 1, state); + //Swap arrays and loop + var tmp = next + next = active + active = tmp + next.length = 0 + side = -side + } -/* - if (state.maxDepthCount > 0 && console && console.warn) { - console.warn('integrate-adaptive-simpson: Warning: maximum recursion depth (' + maxdepth + ') reached ' + state.maxDepthCount + ' times'); + var result = filterCells(cells, flags, target) + if(infinity) { + return result.concat(index.boundary) } + return result +} - if (state.nanEncountered && console && console.warn) { - console.warn('integrate-adaptive-simpson: Warning: NaN encountered. Halting early.'); +},{"binary-search-bounds":92}],109:[function(_dereq_,module,exports){ +'use strict' + +var bsearch = _dereq_('binary-search-bounds') +var orient = _dereq_('robust-orientation')[3] + +var EVENT_POINT = 0 +var EVENT_END = 1 +var EVENT_START = 2 + +module.exports = monotoneTriangulate + +//A partial convex hull fragment, made of two unimonotone polygons +function PartialHull(a, b, idx, lowerIds, upperIds) { + this.a = a + this.b = b + this.idx = idx + this.lowerIds = lowerIds + this.upperIds = upperIds +} + +//An event in the sweep line procedure +function Event(a, b, type, idx) { + this.a = a + this.b = b + this.type = type + this.idx = idx +} + +//This is used to compare events for the sweep line procedure +// Points are: +// 1. sorted lexicographically +// 2. sorted by type (point < end < start) +// 3. segments sorted by winding order +// 4. sorted by index +function compareEvent(a, b) { + var d = + (a.a[0] - b.a[0]) || + (a.a[1] - b.a[1]) || + (a.type - b.type) + if(d) { return d } + if(a.type !== EVENT_POINT) { + d = orient(a.a, a.b, b.b) + if(d) { return d } + } + return a.idx - b.idx +} + +function testPoint(hull, p) { + return orient(hull.a, hull.b, p) +} + +function addPoint(cells, hulls, points, p, idx) { + var lo = bsearch.lt(hulls, p, testPoint) + var hi = bsearch.gt(hulls, p, testPoint) + for(var i=lo; i 1 && orient( + points[lowerIds[m-2]], + points[lowerIds[m-1]], + p) > 0) { + cells.push( + [lowerIds[m-1], + lowerIds[m-2], + idx]) + m -= 1 + } + lowerIds.length = m + lowerIds.push(idx) + + //Insert p into upper hull + var upperIds = hull.upperIds + var m = upperIds.length + while(m > 1 && orient( + points[upperIds[m-2]], + points[upperIds[m-1]], + p) < 0) { + cells.push( + [upperIds[m-2], + upperIds[m-1], + idx]) + m -= 1 + } + upperIds.length = m + upperIds.push(idx) + } +} + +function findSplit(hull, edge) { + var d + if(hull.a[0] < edge.a[0]) { + d = orient(hull.a, hull.b, edge.a) + } else { + d = orient(edge.b, edge.a, hull.a) } -*/ + if(d) { return d } + if(edge.b[0] < hull.b[0]) { + d = orient(hull.a, hull.b, edge.b) + } else { + d = orient(edge.b, edge.a, hull.b) + } + return d || hull.idx - edge.idx +} - return result; +function splitHulls(hulls, points, event) { + var splitIdx = bsearch.le(hulls, event, findSplit) + var hull = hulls[splitIdx] + var upperIds = hull.upperIds + var x = upperIds[upperIds.length-1] + hull.upperIds = [x] + hulls.splice(splitIdx+1, 0, + new PartialHull(event.a, event.b, event.idx, [x], upperIds)) } -function hyperellipticalRaw(alpha, k, gamma) { - function elliptic (f) { - return alpha + (1 - alpha) * pow(1 - pow(f, k), 1 / k); +function mergeHulls(hulls, points, event) { + //Swap pointers for merge search + var tmp = event.a + event.a = event.b + event.b = tmp + var mergeIdx = bsearch.eq(hulls, event, findSplit) + var upper = hulls[mergeIdx] + var lower = hulls[mergeIdx-1] + lower.upperIds = upper.upperIds + hulls.splice(mergeIdx, 1) +} + + +function monotoneTriangulate(points, edges) { + + var numPoints = points.length + var numEdges = edges.length + + var events = [] + + //Create point events + for(var i=0; i b[0]) { + events.push( + new Event(b, a, EVENT_START, i), + new Event(a, b, EVENT_END, i)) + } } - var G = 1 / z(1), - n = 1000, - m = (1 + 1e-8) * G, - approx = []; - for (var i = 0; i <= n; i++) - approx.push(z(i / n) * m); + //Sort events + events.sort(compareEvent) - function Y(sinphi) { - var rmin = 0, rmax = n, r = n >> 1; - do { - if (approx[r] > sinphi) rmax = r; else rmin = r; - r = (rmin + rmax) >> 1; - } while (r > rmin); - var u = approx[r + 1] - approx[r]; - if (u) u = (sinphi - approx[r + 1]) / u; - return (r + 1 + u) / n; + //Initialize hull + var minX = events[0].a[0] - (1 + Math.abs(events[0].a[0])) * Math.pow(2, -52) + var hull = [ new PartialHull([minX, 1], [minX, 0], -1, [], [], [], []) ] + + //Process events in order + var cells = [] + for(var i=0, numEvents=events.length; i= 0) ? y : -y ]; - }; +},{"binary-search-bounds":92,"robust-orientation":427}],110:[function(_dereq_,module,exports){ +'use strict' - forward.invert = function(x, y) { - var phi; - y *= ratio; - if (abs(y) < 1) phi = sign(y) * asin(z(abs(y)) * G); - return [ x / elliptic(abs(y)), phi ]; - }; +var bsearch = _dereq_('binary-search-bounds') - return forward; -} +module.exports = createTriangulation -function hyperelliptical() { - var alpha = 0, - k = 2.5, - gamma = 1.183136, // affine = sqrt(2 * gamma / pi) = 0.8679 - m = d3Geo.geoProjectionMutator(hyperellipticalRaw), - p = m(alpha, k, gamma); +function Triangulation(stars, edges) { + this.stars = stars + this.edges = edges +} - p.alpha = function(_) { - return arguments.length ? m(alpha = +_, k, gamma) : alpha; - }; +var proto = Triangulation.prototype - p.k = function(_) { - return arguments.length ? m(alpha, k = +_, gamma) : k; - }; +function removePair(list, j, k) { + for(var i=1, n=list.length; i= 0 + } +})() - return p - .scale(152.63); +proto.removeTriangle = function(i, j, k) { + var stars = this.stars + removePair(stars[i], j, k) + removePair(stars[j], k, i) + removePair(stars[k], i, j) } -function pointEqual(a, b) { - return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon; +proto.addTriangle = function(i, j, k) { + var stars = this.stars + stars[i].push(j, k) + stars[j].push(k, i) + stars[k].push(i, j) } -function interpolateLine(coordinates, m) { - var i = -1, - n = coordinates.length, - p0 = coordinates[0], - p1, - dx, - dy, - resampled = []; - while (++i < n) { - p1 = coordinates[i]; - dx = (p1[0] - p0[0]) / m; - dy = (p1[1] - p0[1]) / m; - for (var j = 0; j < m; ++j) resampled.push([p0[0] + j * dx, p0[1] + j * dy]); - p0 = p1; +proto.opposite = function(j, i) { + var list = this.stars[i] + for(var k=1, n=list.length; k= 0; --i) { - lobe = lobes[1][i]; - lambda0 = lobe[0][0], phi0 = lobe[0][1], phi1 = lobe[1][1]; - lambda2 = lobe[2][0], phi2 = lobe[2][1]; - coordinates.push(interpolateLine([ - [lambda2 - epsilon, phi2 - epsilon], - [lambda2 - epsilon, phi1 + epsilon], - [lambda0 + epsilon, phi1 + epsilon], - [lambda0 + epsilon, phi0 - epsilon] - ], 30)); +proto.cells = function() { + var stars = this.stars + var result = [] + for(var i=0, n=stars.length; i lobe[i][2][0]; ++i); - var p = project(lambda - lobe[i][1][0], phi); - p[0] += project(lobe[i][1][0], sign$$1 * phi > sign$$1 * lobe[i][0][1] ? lobe[i][0][1] : phi)[0]; - return p; - } +module.exports = orientation - if (inverse) { - forward.invert = inverse(forward); - } else if (project.invert) { - forward.invert = function(x, y) { - var bound = bounds[+(y < 0)], lobe = lobes[+(y < 0)]; - for (var i = 0, n = bound.length; i < n; ++i) { - var b = bound[i]; - if (b[0][0] <= x && x < b[1][0] && b[0][1] <= y && y < b[1][1]) { - var p = project.invert(x - project(lobe[i][1][0], 0)[0], y); - p[0] += lobe[i][1][0]; - return pointEqual(forward(p[0], p[1]), [x, y]) ? p : null; - } +function orientation(s) { + var p = 1 + for(var i=1; i y1) t = y0, y0 = y1, y1 = t; - return [[x0, y0], [x1, y1]]; - }); - }); + return y +} - return p; - }; +function circumcenter(points) { + if(points.length === 0) { + return [] + } + var D = points[0].length + var result = dup([D]) + var weights = barycentricCircumcenter(points) + for(var i=0; i max ? max : value) + : (value < max ? max : value > min ? min : value) } -var lobes$1 = [[ // northern hemisphere - [[-180, 0], [-100, 90], [ -40, 0]], - [[ -40, 0], [ 30, 90], [ 180, 0]] -], [ // southern hemisphere - [[-180, 0], [-160, -90], [-100, 0]], - [[-100, 0], [ -60, -90], [ -20, 0]], - [[ -20, 0], [ 20, -90], [ 80, 0]], - [[ 80, 0], [ 140, -90], [ 180, 0]] -]]; - -function homolosine$1() { - return interrupt(homolosineRaw, lobes$1) - .scale(152.63); -} +},{}],115:[function(_dereq_,module,exports){ +'use strict' -var lobes$2 = [[ // northern hemisphere - [[-180, 0], [-100, 90], [ -40, 0]], - [[ -40, 0], [ 30, 90], [ 180, 0]] -], [ // southern hemisphere - [[-180, 0], [-160, -90], [-100, 0]], - [[-100, 0], [ -60, -90], [ -20, 0]], - [[ -20, 0], [ 20, -90], [ 80, 0]], - [[ 80, 0], [ 140, -90], [ 180, 0]] -]]; +module.exports = cleanPSLG -function mollweide$1() { - return interrupt(mollweideRaw, lobes$2) - .scale(169.529); -} +var UnionFind = _dereq_('union-find') +var boxIntersect = _dereq_('box-intersect') +var segseg = _dereq_('robust-segment-intersect') +var rat = _dereq_('big-rat') +var ratCmp = _dereq_('big-rat/cmp') +var ratToFloat = _dereq_('big-rat/to-float') +var ratVec = _dereq_('rat-vec') +var nextafter = _dereq_('nextafter') -var lobes$3 = [[ // northern hemisphere - [[-180, 0], [ -90, 90], [ 0, 0]], - [[ 0, 0], [ 90, 90], [ 180, 0]] -], [ // southern hemisphere - [[-180, 0], [ -90, -90], [ 0, 0]], - [[ 0, 0], [ 90, -90], [ 180, 0]] -]]; +var solveIntersection = _dereq_('./lib/rat-seg-intersect') -function mollweideHemispheres() { - return interrupt(mollweideRaw, lobes$3) - .scale(169.529) - .rotate([20, 0]); +// Bounds on a rational number when rounded to a float +function boundRat (r) { + var f = ratToFloat(r) + return [ + nextafter(f, -Infinity), + nextafter(f, Infinity) + ] +} + +// Convert a list of edges in a pslg to bounding boxes +function boundEdges (points, edges) { + var bounds = new Array(edges.length) + for (var i = 0; i < edges.length; ++i) { + var e = edges[i] + var a = points[e[0]] + var b = points[e[1]] + bounds[i] = [ + nextafter(Math.min(a[0], b[0]), -Infinity), + nextafter(Math.min(a[1], b[1]), -Infinity), + nextafter(Math.max(a[0], b[0]), Infinity), + nextafter(Math.max(a[1], b[1]), Infinity) + ] + } + return bounds } -var lobes$4 = [[ // northern hemisphere - [[-180, 35], [ -30, 90], [ 0, 35]], - [[ 0, 35], [ 30, 90], [ 180, 35]] -], [ // southern hemisphere - [[-180, -10], [-102, -90], [ -65, -10]], - [[ -65, -10], [ 5, -90], [ 77, -10]], - [[ 77, -10], [ 103, -90], [ 180, -10]] -]]; - -function sinuMollweide$1() { - return interrupt(sinuMollweideRaw, lobes$4, solve2d) - .rotate([-20, -55]) - .scale(164.263) - .center([0, -5.4036]); +// Convert a list of points into bounding boxes by duplicating coords +function boundPoints (points) { + var bounds = new Array(points.length) + for (var i = 0; i < points.length; ++i) { + var p = points[i] + bounds[i] = [ + nextafter(p[0], -Infinity), + nextafter(p[1], -Infinity), + nextafter(p[0], Infinity), + nextafter(p[1], Infinity) + ] + } + return bounds } -var lobes$5 = [[ // northern hemisphere - [[-180, 0], [-110, 90], [ -40, 0]], - [[ -40, 0], [ 0, 90], [ 40, 0]], - [[ 40, 0], [ 110, 90], [ 180, 0]] -], [ // southern hemisphere - [[-180, 0], [-110, -90], [ -40, 0]], - [[ -40, 0], [ 0, -90], [ 40, 0]], - [[ 40, 0], [ 110, -90], [ 180, 0]] -]]; - -function sinusoidal$1() { - return interrupt(sinusoidalRaw, lobes$5) - .scale(152.63) - .rotate([-20, 0]); +// Find all pairs of crossing edges in a pslg (given edge bounds) +function getCrossings (points, edges, edgeBounds) { + var result = [] + boxIntersect(edgeBounds, function (i, j) { + var e = edges[i] + var f = edges[j] + if (e[0] === f[0] || e[0] === f[1] || + e[1] === f[0] || e[1] === f[1]) { + return + } + var a = points[e[0]] + var b = points[e[1]] + var c = points[f[0]] + var d = points[f[1]] + if (segseg(a, b, c, d)) { + result.push([i, j]) + } + }) + return result } -function kavrayskiy7Raw(lambda, phi) { - return [3 / tau * lambda * sqrt(pi * pi / 3 - phi * phi), phi]; +// Find all pairs of crossing vertices in a pslg (given edge/vert bounds) +function getTJunctions (points, edges, edgeBounds, vertBounds) { + var result = [] + boxIntersect(edgeBounds, vertBounds, function (i, v) { + var e = edges[i] + if (e[0] === v || e[1] === v) { + return + } + var p = points[v] + var a = points[e[0]] + var b = points[e[1]] + if (segseg(a, b, p, p)) { + result.push([i, v]) + } + }) + return result } -kavrayskiy7Raw.invert = function(x, y) { - return [tau / 3 * x / sqrt(pi * pi / 3 - y * y), y]; -}; +// Cut edges along crossings/tjunctions +function cutEdges (floatPoints, edges, crossings, junctions, useColor) { + var i, e -function kavrayskiy7() { - return d3Geo.geoProjection(kavrayskiy7Raw) - .scale(158.837); -} + // Convert crossings into tjunctions by constructing rational points + var ratPoints = floatPoints.map(function(p) { + return [ + rat(p[0]), + rat(p[1]) + ] + }) + for (i = 0; i < crossings.length; ++i) { + var crossing = crossings[i] + e = crossing[0] + var f = crossing[1] + var ee = edges[e] + var ef = edges[f] + var x = solveIntersection( + ratVec(floatPoints[ee[0]]), + ratVec(floatPoints[ee[1]]), + ratVec(floatPoints[ef[0]]), + ratVec(floatPoints[ef[1]])) + if (!x) { + // Segments are parallel, should already be handled by t-junctions + continue + } + var idx = floatPoints.length + floatPoints.push([ratToFloat(x[0]), ratToFloat(x[1])]) + ratPoints.push(x) + junctions.push([e, idx], [f, idx]) + } + + // Sort tjunctions + junctions.sort(function (a, b) { + if (a[0] !== b[0]) { + return a[0] - b[0] + } + var u = ratPoints[a[1]] + var v = ratPoints[b[1]] + return ratCmp(u[0], v[0]) || ratCmp(u[1], v[1]) + }) -function lagrangeRaw(n) { + // Split edges along junctions + for (i = junctions.length - 1; i >= 0; --i) { + var junction = junctions[i] + e = junction[0] - function forward(lambda, phi) { - if (abs(abs(phi) - halfPi) < epsilon) return [0, phi < 0 ? -2 : 2]; - var sinPhi = sin(phi), - v = pow((1 + sinPhi) / (1 - sinPhi), n / 2), - c = 0.5 * (v + 1 / v) + cos(lambda *= n); - return [ - 2 * sin(lambda) / c, - (v - 1 / v) / c - ]; - } + var edge = edges[e] + var s = edge[0] + var t = edge[1] - forward.invert = function(x, y) { - var y0 = abs(y); - if (abs(y0 - 2) < epsilon) return x ? null : [0, sign(y) * halfPi]; - if (y0 > 2) return null; + // Check if edge is not lexicographically sorted + var a = floatPoints[s] + var b = floatPoints[t] + if (((a[0] - b[0]) || (a[1] - b[1])) < 0) { + var tmp = s + s = t + t = tmp + } - x /= 2, y /= 2; - var x2 = x * x, - y2 = y * y, - t = 2 * y / (1 + x2 + y2); // tanh(nPhi) - t = pow((1 + t) / (1 - t), 1 / n); - return [ - atan2(2 * x, 1 - x2 - y2) / n, - asin((t - 1) / (t + 1)) - ]; - }; + // Split leading edge + edge[0] = s + var last = edge[1] = junction[1] - return forward; -} + // If we are grouping edges by color, remember to track data + var color + if (useColor) { + color = edge[2] + } -function lagrange() { - var n = 0.5, - m = d3Geo.geoProjectionMutator(lagrangeRaw), - p = m(n); + // Split other edges + while (i > 0 && junctions[i - 1][0] === e) { + var junction = junctions[--i] + var next = junction[1] + if (useColor) { + edges.push([last, next, color]) + } else { + edges.push([last, next]) + } + last = next + } - p.spacing = function(_) { - return arguments.length ? m(n = +_) : n; - }; + // Add final edge + if (useColor) { + edges.push([last, t, color]) + } else { + edges.push([last, t]) + } + } - return p - .scale(124.75); + // Return constructed rational points + return ratPoints } -var pi_sqrt2 = pi / sqrt2; +// Merge overlapping points +function dedupPoints (floatPoints, ratPoints, floatBounds) { + var numPoints = ratPoints.length + var uf = new UnionFind(numPoints) -function larriveeRaw(lambda, phi) { - return [ - lambda * (1 + sqrt(cos(phi))) / 2, - phi / (cos(phi / 2) * cos(lambda / 6)) - ]; -} + // Compute rational bounds + var bounds = [] + for (var i = 0; i < ratPoints.length; ++i) { + var p = ratPoints[i] + var xb = boundRat(p[0]) + var yb = boundRat(p[1]) + bounds.push([ + nextafter(xb[0], -Infinity), + nextafter(yb[0], -Infinity), + nextafter(xb[1], Infinity), + nextafter(yb[1], Infinity) + ]) + } -larriveeRaw.invert = function(x, y) { - var x0 = abs(x), - y0 = abs(y), - lambda = epsilon, - phi = halfPi; - if (y0 < pi_sqrt2) phi *= y0 / pi_sqrt2; - else lambda += 6 * acos(pi_sqrt2 / y0); - for (var i = 0; i < 25; i++) { - var sinPhi = sin(phi), - sqrtcosPhi = sqrt(cos(phi)), - sinPhi_2 = sin(phi / 2), - cosPhi_2 = cos(phi / 2), - sinLambda_6 = sin(lambda / 6), - cosLambda_6 = cos(lambda / 6), - f0 = 0.5 * lambda * (1 + sqrtcosPhi) - x0, - f1 = phi / (cosPhi_2 * cosLambda_6) - y0, - df0dPhi = sqrtcosPhi ? -0.25 * lambda * sinPhi / sqrtcosPhi : 0, - df0dLambda = 0.5 * (1 + sqrtcosPhi), - df1dPhi = (1 + 0.5 * phi * sinPhi_2 / cosPhi_2) / (cosPhi_2 * cosLambda_6), - df1dLambda = (phi / cosPhi_2) * (sinLambda_6 / 6) / (cosLambda_6 * cosLambda_6), - denom = df0dPhi * df1dLambda - df1dPhi * df0dLambda, - dPhi = (f0 * df1dLambda - f1 * df0dLambda) / denom, - dLambda = (f1 * df0dPhi - f0 * df1dPhi) / denom; - phi -= dPhi; - lambda -= dLambda; - if (abs(dPhi) < epsilon && abs(dLambda) < epsilon) break; + // Link all points with over lapping boxes + boxIntersect(bounds, function (i, j) { + uf.link(i, j) + }) + + // Do 1 pass over points to combine points in label sets + var noDupes = true + var labels = new Array(numPoints) + for (var i = 0; i < numPoints; ++i) { + var j = uf.find(i) + if (j !== i) { + // Clear no-dupes flag, zero out label + noDupes = false + // Make each point the top-left point from its cell + floatPoints[j] = [ + Math.min(floatPoints[i][0], floatPoints[j][0]), + Math.min(floatPoints[i][1], floatPoints[j][1]) + ] + } } - return [x < 0 ? -lambda : lambda, y < 0 ? -phi : phi]; -}; -function larrivee() { - return d3Geo.geoProjection(larriveeRaw) - .scale(97.2672); -} + // If no duplicates, return null to signal termination + if (noDupes) { + return null + } -function laskowskiRaw(lambda, phi) { - var lambda2 = lambda * lambda, phi2 = phi * phi; - return [ - lambda * (0.975534 + phi2 * (-0.119161 + lambda2 * -0.0143059 + phi2 * -0.0547009)), - phi * (1.00384 + lambda2 * (0.0802894 + phi2 * -0.02855 + lambda2 * 0.000199025) + phi2 * (0.0998909 + phi2 * -0.0491032)) - ]; -} + var ptr = 0 + for (var i = 0; i < numPoints; ++i) { + var j = uf.find(i) + if (j === i) { + labels[i] = ptr + floatPoints[ptr++] = floatPoints[i] + } else { + labels[i] = -1 + } + } -laskowskiRaw.invert = function(x, y) { - var lambda = sign(x) * pi, - phi = y / 2, - i = 50; - do { - var lambda2 = lambda * lambda, - phi2 = phi * phi, - lambdaPhi = lambda * phi, - fx = lambda * (0.975534 + phi2 * (-0.119161 + lambda2 * -0.0143059 + phi2 * -0.0547009)) - x, - fy = phi * (1.00384 + lambda2 * (0.0802894 + phi2 * -0.02855 + lambda2 * 0.000199025) + phi2 * (0.0998909 + phi2 * -0.0491032)) - y, - deltaxDeltaLambda = 0.975534 - phi2 * (0.119161 + 3 * lambda2 * 0.0143059 + phi2 * 0.0547009), - deltaxDeltaPhi = -lambdaPhi * (2 * 0.119161 + 4 * 0.0547009 * phi2 + 2 * 0.0143059 * lambda2), - deltayDeltaLambda = lambdaPhi * (2 * 0.0802894 + 4 * 0.000199025 * lambda2 + 2 * -0.02855 * phi2), - deltayDeltaPhi = 1.00384 + lambda2 * (0.0802894 + 0.000199025 * lambda2) + phi2 * (3 * (0.0998909 - 0.02855 * lambda2) - 5 * 0.0491032 * phi2), - denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda, - deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator, - deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator; - lambda -= deltaLambda, phi -= deltaPhi; - } while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0); - return i && [lambda, phi]; -}; + floatPoints.length = ptr -function laskowski() { - return d3Geo.geoProjection(laskowskiRaw) - .scale(139.98); + // Do a second pass to fix up missing labels + for (var i = 0; i < numPoints; ++i) { + if (labels[i] < 0) { + labels[i] = labels[uf.find(i)] + } + } + + // Return resulting union-find data structure + return labels } -function littrowRaw(lambda, phi) { - return [ - sin(lambda) / cos(phi), - tan(phi) * cos(lambda) - ]; +function compareLex2 (a, b) { return (a[0] - b[0]) || (a[1] - b[1]) } +function compareLex3 (a, b) { + var d = (a[0] - b[0]) || (a[1] - b[1]) + if (d) { + return d + } + if (a[2] < b[2]) { + return -1 + } else if (a[2] > b[2]) { + return 1 + } + return 0 } -littrowRaw.invert = function(x, y) { - var x2 = x * x, - y2 = y * y, - y2_1 = y2 + 1, - x2_y2_1 = x2 + y2_1, - cosPhi = x - ? sqrt1_2 * sqrt((x2_y2_1 - sqrt(x2_y2_1 * x2_y2_1 - 4 * x2)) / x2) - : 1 / sqrt(y2_1); - return [ - asin(x * cosPhi), - sign(y) * acos(cosPhi) - ]; -}; +// Remove duplicate edge labels +function dedupEdges (edges, labels, useColor) { + if (edges.length === 0) { + return + } + if (labels) { + for (var i = 0; i < edges.length; ++i) { + var e = edges[i] + var a = labels[e[0]] + var b = labels[e[1]] + e[0] = Math.min(a, b) + e[1] = Math.max(a, b) + } + } else { + for (var i = 0; i < edges.length; ++i) { + var e = edges[i] + var a = e[0] + var b = e[1] + e[0] = Math.min(a, b) + e[1] = Math.max(a, b) + } + } + if (useColor) { + edges.sort(compareLex3) + } else { + edges.sort(compareLex2) + } + var ptr = 1 + for (var i = 1; i < edges.length; ++i) { + var prev = edges[i - 1] + var next = edges[i] + if (next[0] === prev[0] && next[1] === prev[1] && + (!useColor || next[2] === prev[2])) { + continue + } + edges[ptr++] = next + } + edges.length = ptr +} -function littrow() { - return d3Geo.geoProjection(littrowRaw) - .scale(144.049) - .clipAngle(90 - 1e-3); +function preRound (points, edges, useColor) { + var labels = dedupPoints(points, [], boundPoints(points)) + dedupEdges(edges, labels, useColor) + return !!labels } -function loximuthalRaw(phi0) { - var cosPhi0 = cos(phi0), - tanPhi0 = tan(quarterPi + phi0 / 2); +// Repeat until convergence +function snapRound (points, edges, useColor) { + // 1. find edge crossings + var edgeBounds = boundEdges(points, edges) + var crossings = getCrossings(points, edges, edgeBounds) - function forward(lambda, phi) { - var y = phi - phi0, - x = abs(y) < epsilon ? lambda * cosPhi0 - : abs(x = quarterPi + phi / 2) < epsilon || abs(abs(x) - halfPi) < epsilon - ? 0 : lambda * y / log(tan(x) / tanPhi0); - return [x, y]; - } + // 2. find t-junctions + var vertBounds = boundPoints(points) + var tjunctions = getTJunctions(points, edges, edgeBounds, vertBounds) - forward.invert = function(x, y) { - var lambda, - phi = y + phi0; - return [ - abs(y) < epsilon ? x / cosPhi0 - : (abs(lambda = quarterPi + phi / 2) < epsilon || abs(abs(lambda) - halfPi) < epsilon) ? 0 - : x * log(tan(lambda) / tanPhi0) / y, - phi - ]; - }; + // 3. cut edges, construct rational points + var ratPoints = cutEdges(points, edges, crossings, tjunctions, useColor) - return forward; -} + // 4. dedupe verts + var labels = dedupPoints(points, ratPoints, vertBounds) -function loximuthal() { - return parallel1(loximuthalRaw) - .parallel(40) - .scale(158.837); -} + // 5. dedupe edges + dedupEdges(edges, labels, useColor) -function millerRaw(lambda, phi) { - return [lambda, 1.25 * log(tan(quarterPi + 0.4 * phi))]; + // 6. check termination + if (!labels) { + return (crossings.length > 0 || tjunctions.length > 0) + } + + // More iterations necessary + return true } -millerRaw.invert = function(x, y) { - return [x, 2.5 * atan(exp(0.8 * y)) - 0.625 * pi]; -}; +// Main loop, runs PSLG clean up until completion +function cleanPSLG (points, edges, colors) { + // If using colors, augment edges with color data + var prevEdges + if (colors) { + prevEdges = edges + var augEdges = new Array(edges.length) + for (var i = 0; i < edges.length; ++i) { + var e = edges[i] + augEdges[i] = [e[0], e[1], colors[i]] + } + edges = augEdges + } -function miller() { - return d3Geo.geoProjection(millerRaw) - .scale(108.318); -} + // First round: remove duplicate edges and points + var modified = preRound(points, edges, !!colors) -function modifiedStereographicRaw(C) { - var m = C.length - 1; + // Run snap rounding until convergence + while (snapRound(points, edges, !!colors)) { + modified = true + } - function forward(lambda, phi) { - var cosPhi = cos(phi), - k = 2 / (1 + cosPhi * cos(lambda)), - zr = k * cosPhi * sin(lambda), - zi = k * sin(phi), - i = m, - w = C[i], - ar = w[0], - ai = w[1], - t; - while (--i >= 0) { - w = C[i]; - ar = w[0] + zr * (t = ar) - zi * ai; - ai = w[1] + zr * ai + zi * t; + // Strip color tags + if (!!colors && modified) { + prevEdges.length = 0 + colors.length = 0 + for (var i = 0; i < edges.length; ++i) { + var e = edges[i] + prevEdges.push([e[0], e[1]]) + colors.push(e[2]) } - ar = zr * (t = ar) - zi * ai; - ai = zr * ai + zi * t; - return [ar, ai]; } - forward.invert = function(x, y) { - var i = 20, - zr = x, - zi = y; - do { - var j = m, - w = C[j], - ar = w[0], - ai = w[1], - br = 0, - bi = 0, - t; + return modified +} - while (--j >= 0) { - w = C[j]; - br = ar + zr * (t = br) - zi * bi; - bi = ai + zr * bi + zi * t; - ar = w[0] + zr * (t = ar) - zi * ai; - ai = w[1] + zr * ai + zi * t; - } - br = ar + zr * (t = br) - zi * bi; - bi = ai + zr * bi + zi * t; - ar = zr * (t = ar) - zi * ai - x; - ai = zr * ai + zi * t - y; +},{"./lib/rat-seg-intersect":116,"big-rat":79,"big-rat/cmp":77,"big-rat/to-float":91,"box-intersect":96,"nextafter":377,"rat-vec":416,"robust-segment-intersect":430,"union-find":478}],116:[function(_dereq_,module,exports){ +'use strict' - var denominator = br * br + bi * bi, deltar, deltai; - zr -= deltar = (ar * br + ai * bi) / denominator; - zi -= deltai = (ai * br - ar * bi) / denominator; - } while (abs(deltar) + abs(deltai) > epsilon * epsilon && --i > 0); +module.exports = solveIntersection - if (i) { - var rho = sqrt(zr * zr + zi * zi), - c = 2 * atan(rho * 0.5), - sinc = sin(c); - return [atan2(zr * sinc, rho * cos(c)), rho ? asin(zi * sinc / rho) : 0]; - } - }; +var ratMul = _dereq_('big-rat/mul') +var ratDiv = _dereq_('big-rat/div') +var ratSub = _dereq_('big-rat/sub') +var ratSign = _dereq_('big-rat/sign') +var rvSub = _dereq_('rat-vec/sub') +var rvAdd = _dereq_('rat-vec/add') +var rvMuls = _dereq_('rat-vec/muls') - return forward; +function ratPerp (a, b) { + return ratSub(ratMul(a[0], b[1]), ratMul(a[1], b[0])) } -var alaska = [[0.9972523, 0], [0.0052513, -0.0041175], [0.0074606, 0.0048125], [-0.0153783, -0.1968253], [0.0636871, -0.1408027], [0.3660976, -0.2937382]], - gs48 = [[0.98879, 0], [0, 0], [-0.050909, 0], [0, 0], [0.075528, 0]], - gs50 = [[0.9842990, 0], [0.0211642, 0.0037608], [-0.1036018, -0.0575102], [-0.0329095, -0.0320119], [0.0499471, 0.1223335], [0.0260460, 0.0899805], [0.0007388, -0.1435792], [0.0075848, -0.1334108], [-0.0216473, 0.0776645], [-0.0225161, 0.0853673]], - miller$1 = [[0.9245, 0], [0, 0], [0.01943, 0]], - lee = [[0.721316, 0], [0, 0], [-0.00881625, -0.00617325]]; +// Solve for intersection +// x = a + t (b-a) +// (x - c) ^ (d-c) = 0 +// (t * (b-a) + (a-c) ) ^ (d-c) = 0 +// t * (b-a)^(d-c) = (d-c)^(a-c) +// t = (d-c)^(a-c) / (b-a)^(d-c) -function modifiedStereographicAlaska() { - return modifiedStereographic(alaska, [152, -64]) - .scale(1400) - .center([-160.908, 62.4864]) - .clipAngle(30) - .angle(7.8); -} +function solveIntersection (a, b, c, d) { + var ba = rvSub(b, a) + var dc = rvSub(d, c) -function modifiedStereographicGs48() { - return modifiedStereographic(gs48, [95, -38]) - .scale(1000) - .clipAngle(55) - .center([-96.5563, 38.8675]); -} + var baXdc = ratPerp(ba, dc) -function modifiedStereographicGs50() { - return modifiedStereographic(gs50, [120, -45]) - .scale(359.513) - .clipAngle(55) - .center([-117.474, 53.0628]); -} + if (ratSign(baXdc) === 0) { + return null + } -function modifiedStereographicMiller() { - return modifiedStereographic(miller$1, [-20, -18]) - .scale(209.091) - .center([20, 16.7214]) - .clipAngle(82); -} + var ac = rvSub(a, c) + var dcXac = ratPerp(dc, ac) -function modifiedStereographicLee() { - return modifiedStereographic(lee, [165, 10]) - .scale(250) - .clipAngle(130) - .center([-165, -10]); + var t = ratDiv(dcXac, baXdc) + var s = rvMuls(ba, t) + var r = rvAdd(a, s) + + return r } -function modifiedStereographic(coefficients, rotate) { - var p = d3Geo.geoProjection(modifiedStereographicRaw(coefficients)).rotate(rotate).clipAngle(90), - r = d3Geo.geoRotation(rotate), - center = p.center; +},{"big-rat/div":78,"big-rat/mul":88,"big-rat/sign":89,"big-rat/sub":90,"rat-vec/add":415,"rat-vec/muls":417,"rat-vec/sub":418}],117:[function(_dereq_,module,exports){ +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; - delete p.rotate; +},{}],118:[function(_dereq_,module,exports){ +/** @module color-normalize */ + +'use strict' + +var rgba = _dereq_('color-rgba') +var clamp = _dereq_('clamp') +var dtype = _dereq_('dtype') + +module.exports = function normalize (color, type) { + if (type === 'float' || !type) type = 'array' + if (type === 'uint') type = 'uint8' + if (type === 'uint_clamped') type = 'uint8_clamped' + var Ctor = dtype(type) + var output = new Ctor(4) + + var normalize = type !== 'uint8' && type !== 'uint8_clamped' + + // attempt to parse non-array arguments + if (!color.length || typeof color === 'string') { + color = rgba(color) + color[0] /= 255 + color[1] /= 255 + color[2] /= 255 + } + + // 0, 1 are possible contradictory values for Arrays: + // [1,1,1] input gives [1,1,1] output instead of [1/255,1/255,1/255], which may be collision if input is meant to be uint. + // converting [1,1,1] to [1/255,1/255,1/255] in case of float input gives larger mistake since [1,1,1] float is frequent edge value, whereas [0,1,1], [1,1,1] etc. uint inputs are relatively rare + if (isInt(color)) { + output[0] = color[0] + output[1] = color[1] + output[2] = color[2] + output[3] = color[3] != null ? color[3] : 255 + + if (normalize) { + output[0] /= 255 + output[1] /= 255 + output[2] /= 255 + output[3] /= 255 + } + + return output + } + + if (!normalize) { + output[0] = clamp(Math.floor(color[0] * 255), 0, 255) + output[1] = clamp(Math.floor(color[1] * 255), 0, 255) + output[2] = clamp(Math.floor(color[2] * 255), 0, 255) + output[3] = color[3] == null ? 255 : clamp(Math.floor(color[3] * 255), 0, 255) + } else { + output[0] = color[0] + output[1] = color[1] + output[2] = color[2] + output[3] = color[3] != null ? color[3] : 1 + } + + return output +} + +function isInt(color) { + if (color instanceof Uint8Array || color instanceof Uint8ClampedArray) return true + + if (Array.isArray(color) && + (color[0] > 1 || color[0] === 0) && + (color[1] > 1 || color[1] === 0) && + (color[2] > 1 || color[2] === 0) && + (!color[3] || color[3] > 1) + ) return true + + return false +} - p.center = function(_) { - return arguments.length ? center(r(_)) : r.invert(center()); - }; +},{"clamp":114,"color-rgba":120,"dtype":154}],119:[function(_dereq_,module,exports){ +(function (global){(function (){ +/** + * @module color-parse + */ - return p; -} +'use strict' -var sqrt6 = sqrt(6), - sqrt7 = sqrt(7); +var names = _dereq_('color-name') +var isObject = _dereq_('is-plain-obj') +var defined = _dereq_('defined') -function mtFlatPolarParabolicRaw(lambda, phi) { - var theta = asin(7 * sin(phi) / (3 * sqrt6)); - return [ - sqrt6 * lambda * (2 * cos(2 * theta / 3) - 1) / sqrt7, - 9 * sin(theta / 3) / sqrt7 - ]; +module.exports = parse + +/** + * Base hues + * http://dev.w3.org/csswg/css-color/#typedef-named-hue + */ +//FIXME: use external hue detector +var baseHues = { + red: 0, + orange: 60, + yellow: 120, + green: 180, + blue: 240, + purple: 300 } -mtFlatPolarParabolicRaw.invert = function(x, y) { - var theta = 3 * asin(y * sqrt7 / 9); - return [ - x * sqrt7 / (sqrt6 * (2 * cos(2 * theta / 3) - 1)), - asin(sin(theta) * 3 * sqrt6 / 7) - ]; -}; +/** + * Parse color from the string passed + * + * @return {Object} A space indicator `space`, an array `values` and `alpha` + */ +function parse (cstr) { + var m, parts = [], alpha = 1, space -function mtFlatPolarParabolic() { - return d3Geo.geoProjection(mtFlatPolarParabolicRaw) - .scale(164.859); -} + if (typeof cstr === 'string') { + //keyword + if (names[cstr]) { + parts = names[cstr].slice() + space = 'rgb' + } -function mtFlatPolarQuarticRaw(lambda, phi) { - var k = (1 + sqrt1_2) * sin(phi), - theta = phi; - for (var i = 0, delta; i < 25; i++) { - theta -= delta = (sin(theta / 2) + sin(theta) - k) / (0.5 * cos(theta / 2) + cos(theta)); - if (abs(delta) < epsilon) break; - } - return [ - lambda * (1 + 2 * cos(theta) / cos(theta / 2)) / (3 * sqrt2), - 2 * sqrt(3) * sin(theta / 2) / sqrt(2 + sqrt2) - ]; -} + //reserved words + else if (cstr === 'transparent') { + alpha = 0 + space = 'rgb' + parts = [0,0,0] + } -mtFlatPolarQuarticRaw.invert = function(x, y) { - var sinTheta_2 = y * sqrt(2 + sqrt2) / (2 * sqrt(3)), - theta = 2 * asin(sinTheta_2); - return [ - 3 * sqrt2 * x / (1 + 2 * cos(theta) / cos(theta / 2)), - asin((sinTheta_2 + sin(theta)) / (1 + sqrt1_2)) - ]; -}; + //hex + else if (/^#[A-Fa-f0-9]+$/.test(cstr)) { + var base = cstr.slice(1) + var size = base.length + var isShort = size <= 4 + alpha = 1 + + if (isShort) { + parts = [ + parseInt(base[0] + base[0], 16), + parseInt(base[1] + base[1], 16), + parseInt(base[2] + base[2], 16) + ] + if (size === 4) { + alpha = parseInt(base[3] + base[3], 16) / 255 + } + } + else { + parts = [ + parseInt(base[0] + base[1], 16), + parseInt(base[2] + base[3], 16), + parseInt(base[4] + base[5], 16) + ] + if (size === 8) { + alpha = parseInt(base[6] + base[7], 16) / 255 + } + } -function mtFlatPolarQuartic() { - return d3Geo.geoProjection(mtFlatPolarQuarticRaw) - .scale(188.209); -} + if (!parts[0]) parts[0] = 0 + if (!parts[1]) parts[1] = 0 + if (!parts[2]) parts[2] = 0 -function mtFlatPolarSinusoidalRaw(lambda, phi) { - var A = sqrt(6 / (4 + pi)), - k = (1 + pi / 4) * sin(phi), - theta = phi / 2; - for (var i = 0, delta; i < 25; i++) { - theta -= delta = (theta / 2 + sin(theta) - k) / (0.5 + cos(theta)); - if (abs(delta) < epsilon) break; - } - return [ - A * (0.5 + cos(theta)) * lambda / 1.5, - A * theta - ]; -} + space = 'rgb' + } -mtFlatPolarSinusoidalRaw.invert = function(x, y) { - var A = sqrt(6 / (4 + pi)), - theta = y / A; - if (abs(abs(theta) - halfPi) < epsilon) theta = theta < 0 ? -halfPi : halfPi; - return [ - 1.5 * x / (A * (0.5 + cos(theta))), - asin((theta / 2 + sin(theta)) / (1 + pi / 4)) - ]; -}; + //color space + else if (m = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(cstr)) { + var name = m[1] + var isRGB = name === 'rgb' + var base = name.replace(/a$/, '') + space = base + var size = base === 'cmyk' ? 4 : base === 'gray' ? 1 : 3 + parts = m[2].trim() + .split(/\s*,\s*/) + .map(function (x, i) { + // + if (/%$/.test(x)) { + //alpha + if (i === size) return parseFloat(x) / 100 + //rgb + if (base === 'rgb') return parseFloat(x) * 255 / 100 + return parseFloat(x) + } + //hue + else if (base[i] === 'h') { + // + if (/deg$/.test(x)) { + return parseFloat(x) + } + // + else if (baseHues[x] !== undefined) { + return baseHues[x] + } + } + return parseFloat(x) + }) -function mtFlatPolarSinusoidal() { - return d3Geo.geoProjection(mtFlatPolarSinusoidalRaw) - .scale(166.518); -} + if (name === base) parts.push(1) + alpha = (isRGB) ? 1 : (parts[size] === undefined) ? 1 : parts[size] + parts = parts.slice(0, size) + } -function naturalEarth2Raw(lambda, phi) { - var phi2 = phi * phi, phi4 = phi2 * phi2, phi6 = phi2 * phi4; - return [ - lambda * (0.84719 - 0.13063 * phi2 + phi6 * phi6 * (-0.04515 + 0.05494 * phi2 - 0.02326 * phi4 + 0.00331 * phi6)), - phi * (1.01183 + phi4 * phi4 * (-0.02625 + 0.01926 * phi2 - 0.00396 * phi4)) - ]; -} + //named channels case + else if (cstr.length > 10 && /[0-9](?:\s|\/)/.test(cstr)) { + parts = cstr.match(/([0-9]+)/g).map(function (value) { + return parseFloat(value) + }) -naturalEarth2Raw.invert = function(x, y) { - var phi = y, i = 25, delta, phi2, phi4, phi6; - do { - phi2 = phi * phi; phi4 = phi2 * phi2; - phi -= delta = ((phi * (1.01183 + phi4 * phi4 * (-0.02625 + 0.01926 * phi2 - 0.00396 * phi4))) - y) / - (1.01183 + phi4 * phi4 * ((9 * -0.02625) + (11 * 0.01926) * phi2 + (13 * -0.00396) * phi4)); - } while (abs(delta) > epsilon2 && --i > 0); - phi2 = phi * phi; phi4 = phi2 * phi2; phi6 = phi2 * phi4; - return [ - x / (0.84719 - 0.13063 * phi2 + phi6 * phi6 * (-0.04515 + 0.05494 * phi2 - 0.02326 * phi4 + 0.00331 * phi6)), - phi - ]; -}; + space = cstr.match(/([a-z])/ig).join('').toLowerCase() + } + } -function naturalEarth2() { - return d3Geo.geoProjection(naturalEarth2Raw) - .scale(175.295); -} + //numeric case + else if (!isNaN(cstr)) { + space = 'rgb' + parts = [cstr >>> 16, (cstr & 0x00ff00) >>> 8, cstr & 0x0000ff] + } -function nellHammerRaw(lambda, phi) { - return [ - lambda * (1 + cos(phi)) / 2, - 2 * (phi - tan(phi / 2)) - ]; -} + //object case - detects css cases of rgb and hsl + else if (isObject(cstr)) { + var r = defined(cstr.r, cstr.red, cstr.R, null) -nellHammerRaw.invert = function(x, y) { - var p = y / 2; - for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; ++i) { - var c = cos(y / 2); - y -= delta = (y - tan(y / 2) - p) / (1 - 0.5 / (c * c)); - } - return [ - 2 * x / (1 + cos(y)), - y - ]; -}; + if (r !== null) { + space = 'rgb' + parts = [ + r, + defined(cstr.g, cstr.green, cstr.G), + defined(cstr.b, cstr.blue, cstr.B) + ] + } + else { + space = 'hsl' + parts = [ + defined(cstr.h, cstr.hue, cstr.H), + defined(cstr.s, cstr.saturation, cstr.S), + defined(cstr.l, cstr.lightness, cstr.L, cstr.b, cstr.brightness) + ] + } -function nellHammer() { - return d3Geo.geoProjection(nellHammerRaw) - .scale(152.63); -} + alpha = defined(cstr.a, cstr.alpha, cstr.opacity, 1) -var lobes$6 = [[ // northern hemisphere - [[-180, 0], [-90, 90], [ 0, 0]], - [[ 0, 0], [ 90, 90], [ 180, 0]] -], [ // southern hemisphere - [[-180, 0], [-90, -90], [ 0, 0]], - [[ 0, 0], [ 90, -90], [180, 0]] -]]; + if (cstr.opacity != null) alpha /= 100 + } -function quarticAuthalic() { - return interrupt(hammerRaw(Infinity), lobes$6) - .rotate([20, 0]) - .scale(152.63); + //array + else if (Array.isArray(cstr) || global.ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(cstr)) { + parts = [cstr[0], cstr[1], cstr[2]] + space = 'rgb' + alpha = cstr.length === 4 ? cstr[3] : 1 + } + + return { + space: space, + values: parts, + alpha: alpha + } } -// Based on Torben Jansen's implementation -// https://beta.observablehq.com/@toja/nicolosi-globular-projection -// https://beta.observablehq.com/@toja/nicolosi-globular-inverse +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"color-name":117,"defined":151,"is-plain-obj":353}],120:[function(_dereq_,module,exports){ +/** @module color-rgba */ -function nicolosiRaw(lambda, phi) { - var sinPhi = sin(phi), - q = cos(phi), - s = sign(lambda); +'use strict' - if (lambda === 0 || abs(phi) === halfPi) return [0, phi]; - else if (phi === 0) return [lambda, 0]; - else if (abs(lambda) === halfPi) return [lambda * q, halfPi * sinPhi]; +var parse = _dereq_('color-parse') +var hsl = _dereq_('color-space/hsl') +var clamp = _dereq_('clamp') - var b = pi / (2 * lambda) - (2 * lambda) / pi, - c = (2 * phi) / pi, - d = (1 - c * c) / (sinPhi - c); +module.exports = function rgba (color) { + var values, i, l - var b2 = b * b, - d2 = d * d, - b2d2 = 1 + b2 / d2, - d2b2 = 1 + d2 / b2; + //attempt to parse non-array arguments + var parsed = parse(color) - var M = ((b * sinPhi) / d - b / 2) / b2d2, - N = ((d2 * sinPhi) / b2 + d / 2) / d2b2, - m = M * M + (q * q) / b2d2, - n = N * N - ((d2 * sinPhi * sinPhi) / b2 + d * sinPhi - 1) / d2b2; + if (!parsed.space) return [] - return [ - halfPi * (M + sqrt(m) * s), - halfPi * (N + sqrt(n < 0 ? 0 : n) * sign(-phi * b) * s) - ]; + values = Array(3) + values[0] = clamp(parsed.values[0], 0, 255) + values[1] = clamp(parsed.values[1], 0, 255) + values[2] = clamp(parsed.values[2], 0, 255) + + if (parsed.space[0] === 'h') { + values = hsl.rgb(values) + } + + values.push(clamp(parsed.alpha, 0, 1)) + + return values } -nicolosiRaw.invert = function(x, y) { +},{"clamp":114,"color-parse":119,"color-space/hsl":121}],121:[function(_dereq_,module,exports){ +/** + * @module color-space/hsl + */ +'use strict' - x /= halfPi; - y /= halfPi; +var rgb = _dereq_('./rgb'); - var x2 = x * x, - y2 = y * y, - x2y2 = x2 + y2, - pi2 = pi * pi; +module.exports = { + name: 'hsl', + min: [0,0,0], + max: [360,100,100], + channel: ['hue', 'saturation', 'lightness'], + alias: ['HSL'], + + rgb: function(hsl) { + var h = hsl[0] / 360, + s = hsl[1] / 100, + l = hsl[2] / 100, + t1, t2, t3, rgb, val; + + if (s === 0) { + val = l * 255; + return [val, val, val]; + } - return [ - x ? (x2y2 -1 + sqrt((1 - x2y2) * (1 - x2y2) + 4 * x2)) / (2 * x) * halfPi : 0, - solve(function(phi) { - return ( - x2y2 * (pi * sin(phi) - 2 * phi) * pi + - 4 * phi * phi * (y - sin(phi)) + - 2 * pi * phi - - pi2 * y - ); - }, 0) - ]; + if (l < 0.5) { + t2 = l * (1 + s); + } + else { + t2 = l + s - l * s; + } + t1 = 2 * l - t2; + + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { + t3 = h + 1 / 3 * - (i - 1); + if (t3 < 0) { + t3++; + } + else if (t3 > 1) { + t3--; + } + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } + else if (2 * t3 < 1) { + val = t2; + } + else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } + else { + val = t1; + } + + rgb[i] = val * 255; + } + + return rgb; + } }; -function nicolosi() { - return d3Geo.geoProjection(nicolosiRaw) - .scale(127.267); -} -// Based on Java implementation by Bojan Savric. -// https://github.com/OSUCartography/JMapProjLib/blob/master/src/com/jhlabs/map/proj/PattersonProjection.java +//extend rgb +rgb.hsl = function(rgb) { + var r = rgb[0]/255, + g = rgb[1]/255, + b = rgb[2]/255, + min = Math.min(r, g, b), + max = Math.max(r, g, b), + delta = max - min, + h, s, l; -var pattersonK1 = 1.0148, - pattersonK2 = 0.23185, - pattersonK3 = -0.14499, - pattersonK4 = 0.02406, - pattersonC1 = pattersonK1, - pattersonC2 = 5 * pattersonK2, - pattersonC3 = 7 * pattersonK3, - pattersonC4 = 9 * pattersonK4, - pattersonYmax = 1.790857183; + if (max === min) { + h = 0; + } + else if (r === max) { + h = (g - b) / delta; + } + else if (g === max) { + h = 2 + (b - r) / delta; + } + else if (b === max) { + h = 4 + (r - g)/ delta; + } -function pattersonRaw(lambda, phi) { - var phi2 = phi * phi; - return [ - lambda, - phi * (pattersonK1 + phi2 * phi2 * (pattersonK2 + phi2 * (pattersonK3 + pattersonK4 * phi2))) - ]; -} + h = Math.min(h * 60, 360); -pattersonRaw.invert = function(x, y) { - if (y > pattersonYmax) y = pattersonYmax; - else if (y < -pattersonYmax) y = -pattersonYmax; - var yc = y, delta; + if (h < 0) { + h += 360; + } - do { // Newton-Raphson - var y2 = yc * yc; - yc -= delta = ((yc * (pattersonK1 + y2 * y2 * (pattersonK2 + y2 * (pattersonK3 + pattersonK4 * y2)))) - y) / (pattersonC1 + y2 * y2 * (pattersonC2 + y2 * (pattersonC3 + pattersonC4 * y2))); - } while (abs(delta) > epsilon); + l = (min + max) / 2; - return [x, yc]; -}; + if (max === min) { + s = 0; + } + else if (l <= 0.5) { + s = delta / (max + min); + } + else { + s = delta / (2 - max - min); + } -function patterson() { - return d3Geo.geoProjection(pattersonRaw) - .scale(139.319); -} + return [h, s * 100, l * 100]; +}; -function polyconicRaw(lambda, phi) { - if (abs(phi) < epsilon) return [lambda, 0]; - var tanPhi = tan(phi), - k = lambda * sin(phi); - return [ - sin(k) / tanPhi, - phi + (1 - cos(k)) / tanPhi - ]; -} +},{"./rgb":122}],122:[function(_dereq_,module,exports){ +/** + * RGB space. + * + * @module color-space/rgb + */ +'use strict' -polyconicRaw.invert = function(x, y) { - if (abs(y) < epsilon) return [x, 0]; - var k = x * x + y * y, - phi = y * 0.5, - i = 10, delta; - do { - var tanPhi = tan(phi), - secPhi = 1 / cos(phi), - j = k - 2 * y * phi + phi * phi; - phi -= delta = (tanPhi * j + 2 * (phi - y)) / (2 + j * secPhi * secPhi + 2 * (phi - y) * tanPhi); - } while (abs(delta) > epsilon && --i > 0); - tanPhi = tan(phi); - return [ - (abs(y) < abs(phi + 1 / tanPhi) ? asin(x * tanPhi) : sign(y) * sign(x) * (acos(abs(x * tanPhi)) + halfPi)) / sin(phi), - phi - ]; +module.exports = { + name: 'rgb', + min: [0,0,0], + max: [255,255,255], + channel: ['red', 'green', 'blue'], + alias: ['RGB'] }; -function polyconic() { - return d3Geo.geoProjection(polyconicRaw) - .scale(103.74); -} +},{}],123:[function(_dereq_,module,exports){ +module.exports={ + "jet":[{"index":0,"rgb":[0,0,131]},{"index":0.125,"rgb":[0,60,170]},{"index":0.375,"rgb":[5,255,255]},{"index":0.625,"rgb":[255,255,0]},{"index":0.875,"rgb":[250,0,0]},{"index":1,"rgb":[128,0,0]}], -// Note: 6-element arrays are used to denote the 3x3 affine transform matrix: -// [a, b, c, -// d, e, f, -// 0, 0, 1] - this redundant row is left out. + "hsv":[{"index":0,"rgb":[255,0,0]},{"index":0.169,"rgb":[253,255,2]},{"index":0.173,"rgb":[247,255,2]},{"index":0.337,"rgb":[0,252,4]},{"index":0.341,"rgb":[0,252,10]},{"index":0.506,"rgb":[1,249,255]},{"index":0.671,"rgb":[2,0,253]},{"index":0.675,"rgb":[8,0,253]},{"index":0.839,"rgb":[255,0,251]},{"index":0.843,"rgb":[255,0,245]},{"index":1,"rgb":[255,0,6]}], -// Transform matrix for [a0, a1] -> [b0, b1]. -function matrix(a, b) { - var u = subtract(a[1], a[0]), - v = subtract(b[1], b[0]), - phi = angle$1(u, v), - s = length(u) / length(v); + "hot":[{"index":0,"rgb":[0,0,0]},{"index":0.3,"rgb":[230,0,0]},{"index":0.6,"rgb":[255,210,0]},{"index":1,"rgb":[255,255,255]}], - return multiply([ - 1, 0, a[0][0], - 0, 1, a[0][1] - ], multiply([ - s, 0, 0, - 0, s, 0 - ], multiply([ - cos(phi), sin(phi), 0, - -sin(phi), cos(phi), 0 - ], [ - 1, 0, -b[0][0], - 0, 1, -b[0][1] - ]))); -} + "spring":[{"index":0,"rgb":[255,0,255]},{"index":1,"rgb":[255,255,0]}], -// Inverts a transform matrix. -function inverse(m) { - var k = 1 / (m[0] * m[4] - m[1] * m[3]); - return [ - k * m[4], -k * m[1], k * (m[1] * m[5] - m[2] * m[4]), - -k * m[3], k * m[0], k * (m[2] * m[3] - m[0] * m[5]) - ]; -} + "summer":[{"index":0,"rgb":[0,128,102]},{"index":1,"rgb":[255,255,102]}], -// Multiplies two 3x2 matrices. -function multiply(a, b) { - return [ - a[0] * b[0] + a[1] * b[3], - a[0] * b[1] + a[1] * b[4], - a[0] * b[2] + a[1] * b[5] + a[2], - a[3] * b[0] + a[4] * b[3], - a[3] * b[1] + a[4] * b[4], - a[3] * b[2] + a[4] * b[5] + a[5] - ]; -} + "autumn":[{"index":0,"rgb":[255,0,0]},{"index":1,"rgb":[255,255,0]}], -// Subtracts 2D vectors. -function subtract(a, b) { - return [a[0] - b[0], a[1] - b[1]]; -} + "winter":[{"index":0,"rgb":[0,0,255]},{"index":1,"rgb":[0,255,128]}], -// Magnitude of a 2D vector. -function length(v) { - return sqrt(v[0] * v[0] + v[1] * v[1]); -} + "bone":[{"index":0,"rgb":[0,0,0]},{"index":0.376,"rgb":[84,84,116]},{"index":0.753,"rgb":[169,200,200]},{"index":1,"rgb":[255,255,255]}], -// Angle between two 2D vectors. -function angle$1(a, b) { - return atan2(a[0] * b[1] - a[1] * b[0], a[0] * b[0] + a[1] * b[1]); -} + "copper":[{"index":0,"rgb":[0,0,0]},{"index":0.804,"rgb":[255,160,102]},{"index":1,"rgb":[255,199,127]}], -// Creates a polyhedral projection. -// * root: a spanning tree of polygon faces. Nodes are automatically -// augmented with a transform matrix. -// * face: a function that returns the appropriate node for a given {lambda, phi} -// point (radians). -// * r: rotation angle for root face [deprecated by .angle()]. -function polyhedral(root, face, r) { + "greys":[{"index":0,"rgb":[0,0,0]},{"index":1,"rgb":[255,255,255]}], - recurse(root, {transform: null}); + "yignbu":[{"index":0,"rgb":[8,29,88]},{"index":0.125,"rgb":[37,52,148]},{"index":0.25,"rgb":[34,94,168]},{"index":0.375,"rgb":[29,145,192]},{"index":0.5,"rgb":[65,182,196]},{"index":0.625,"rgb":[127,205,187]},{"index":0.75,"rgb":[199,233,180]},{"index":0.875,"rgb":[237,248,217]},{"index":1,"rgb":[255,255,217]}], - function recurse(node, parent) { - node.edges = faceEdges(node.face); - // Find shared edge. - if (parent.face) { - var shared = node.shared = sharedEdge(node.face, parent.face), - m = matrix(shared.map(parent.project), shared.map(node.project)); - node.transform = parent.transform ? multiply(parent.transform, m) : m; - // Replace shared edge in parent edges array. - var edges = parent.edges; - for (var i = 0, n = edges.length; i < n; ++i) { - if (pointEqual$1(shared[0], edges[i][1]) && pointEqual$1(shared[1], edges[i][0])) edges[i] = node; - if (pointEqual$1(shared[0], edges[i][0]) && pointEqual$1(shared[1], edges[i][1])) edges[i] = node; - } - edges = node.edges; - for (i = 0, n = edges.length; i < n; ++i) { - if (pointEqual$1(shared[0], edges[i][0]) && pointEqual$1(shared[1], edges[i][1])) edges[i] = parent; - if (pointEqual$1(shared[0], edges[i][1]) && pointEqual$1(shared[1], edges[i][0])) edges[i] = parent; - } - } else { - node.transform = parent.transform; - } - if (node.children) { - node.children.forEach(function(child) { - recurse(child, node); - }); - } - return node; - } + "greens":[{"index":0,"rgb":[0,68,27]},{"index":0.125,"rgb":[0,109,44]},{"index":0.25,"rgb":[35,139,69]},{"index":0.375,"rgb":[65,171,93]},{"index":0.5,"rgb":[116,196,118]},{"index":0.625,"rgb":[161,217,155]},{"index":0.75,"rgb":[199,233,192]},{"index":0.875,"rgb":[229,245,224]},{"index":1,"rgb":[247,252,245]}], - function forward(lambda, phi) { - var node = face(lambda, phi), - point = node.project([lambda * degrees, phi * degrees]), - t; - if (t = node.transform) { - return [ - t[0] * point[0] + t[1] * point[1] + t[2], - -(t[3] * point[0] + t[4] * point[1] + t[5]) - ]; - } - point[1] = -point[1]; - return point; - } + "yiorrd":[{"index":0,"rgb":[128,0,38]},{"index":0.125,"rgb":[189,0,38]},{"index":0.25,"rgb":[227,26,28]},{"index":0.375,"rgb":[252,78,42]},{"index":0.5,"rgb":[253,141,60]},{"index":0.625,"rgb":[254,178,76]},{"index":0.75,"rgb":[254,217,118]},{"index":0.875,"rgb":[255,237,160]},{"index":1,"rgb":[255,255,204]}], - // Naive inverse! A faster solution would use bounding boxes, or even a - // polygonal quadtree. - if (hasInverse(root)) forward.invert = function(x, y) { - var coordinates = faceInvert(root, [x, -y]); - return coordinates && (coordinates[0] *= radians, coordinates[1] *= radians, coordinates); - }; + "bluered":[{"index":0,"rgb":[0,0,255]},{"index":1,"rgb":[255,0,0]}], - function faceInvert(node, coordinates) { - var invert = node.project.invert, - t = node.transform, - point = coordinates; - if (t) { - t = inverse(t); - point = [ - t[0] * point[0] + t[1] * point[1] + t[2], - (t[3] * point[0] + t[4] * point[1] + t[5]) - ]; - } - if (invert && node === faceDegrees(p = invert(point))) return p; - var p, - children = node.children; - for (var i = 0, n = children && children.length; i < n; ++i) { - if (p = faceInvert(children[i], coordinates)) return p; - } - } + "rdbu":[{"index":0,"rgb":[5,10,172]},{"index":0.35,"rgb":[106,137,247]},{"index":0.5,"rgb":[190,190,190]},{"index":0.6,"rgb":[220,170,132]},{"index":0.7,"rgb":[230,145,90]},{"index":1,"rgb":[178,10,28]}], - function faceDegrees(coordinates) { - return face(coordinates[0] * radians, coordinates[1] * radians); - } + "picnic":[{"index":0,"rgb":[0,0,255]},{"index":0.1,"rgb":[51,153,255]},{"index":0.2,"rgb":[102,204,255]},{"index":0.3,"rgb":[153,204,255]},{"index":0.4,"rgb":[204,204,255]},{"index":0.5,"rgb":[255,255,255]},{"index":0.6,"rgb":[255,204,255]},{"index":0.7,"rgb":[255,153,255]},{"index":0.8,"rgb":[255,102,204]},{"index":0.9,"rgb":[255,102,102]},{"index":1,"rgb":[255,0,0]}], - var proj = d3Geo.geoProjection(forward), - stream_ = proj.stream; + "rainbow":[{"index":0,"rgb":[150,0,90]},{"index":0.125,"rgb":[0,0,200]},{"index":0.25,"rgb":[0,25,255]},{"index":0.375,"rgb":[0,152,255]},{"index":0.5,"rgb":[44,255,150]},{"index":0.625,"rgb":[151,255,0]},{"index":0.75,"rgb":[255,234,0]},{"index":0.875,"rgb":[255,111,0]},{"index":1,"rgb":[255,0,0]}], - proj.stream = function(stream) { - var rotate = proj.rotate(), - rotateStream = stream_(stream), - sphereStream = (proj.rotate([0, 0]), stream_(stream)); - proj.rotate(rotate); - rotateStream.sphere = function() { - sphereStream.polygonStart(); - sphereStream.lineStart(); - outline(sphereStream, root); - sphereStream.lineEnd(); - sphereStream.polygonEnd(); - }; - return rotateStream; - }; + "portland":[{"index":0,"rgb":[12,51,131]},{"index":0.25,"rgb":[10,136,186]},{"index":0.5,"rgb":[242,211,56]},{"index":0.75,"rgb":[242,143,56]},{"index":1,"rgb":[217,30,30]}], - return proj.angle(r == null ? -30 : r * degrees); -} + "blackbody":[{"index":0,"rgb":[0,0,0]},{"index":0.2,"rgb":[230,0,0]},{"index":0.4,"rgb":[230,210,0]},{"index":0.7,"rgb":[255,255,255]},{"index":1,"rgb":[160,200,255]}], -function outline(stream, node, parent) { - var point, - edges = node.edges, - n = edges.length, - edge, - multiPoint = {type: "MultiPoint", coordinates: node.face}, - notPoles = node.face.filter(function(d) { return abs(d[1]) !== 90; }), - b = d3Geo.geoBounds({type: "MultiPoint", coordinates: notPoles}), - inside = false, - j = -1, - dx = b[1][0] - b[0][0]; - // TODO - var c = dx === 180 || dx === 360 - ? [(b[0][0] + b[1][0]) / 2, (b[0][1] + b[1][1]) / 2] - : d3Geo.geoCentroid(multiPoint); - // First find the shared edge… - if (parent) while (++j < n) { - if (edges[j] === parent) break; - } - ++j; - for (var i = 0; i < n; ++i) { - edge = edges[(i + j) % n]; - if (Array.isArray(edge)) { - if (!inside) { - stream.point((point = d3Geo.geoInterpolate(edge[0], c)(epsilon))[0], point[1]); - inside = true; - } - stream.point((point = d3Geo.geoInterpolate(edge[1], c)(epsilon))[0], point[1]); - } else { - inside = false; - if (edge !== parent) outline(stream, edge, node); - } - } -} + "earth":[{"index":0,"rgb":[0,0,130]},{"index":0.1,"rgb":[0,180,180]},{"index":0.2,"rgb":[40,210,40]},{"index":0.4,"rgb":[230,230,50]},{"index":0.6,"rgb":[120,70,20]},{"index":1,"rgb":[255,255,255]}], -// Tests equality of two spherical points. -function pointEqual$1(a, b) { - return a && b && a[0] === b[0] && a[1] === b[1]; -} + "electric":[{"index":0,"rgb":[0,0,0]},{"index":0.15,"rgb":[30,0,100]},{"index":0.4,"rgb":[120,0,100]},{"index":0.6,"rgb":[160,90,0]},{"index":0.8,"rgb":[230,200,0]},{"index":1,"rgb":[255,250,220]}], -// Finds a shared edge given two clockwise polygons. -function sharedEdge(a, b) { - var x, y, n = a.length, found = null; - for (var i = 0; i < n; ++i) { - x = a[i]; - for (var j = b.length; --j >= 0;) { - y = b[j]; - if (x[0] === y[0] && x[1] === y[1]) { - if (found) return [found, x]; - found = x; - } - } - } -} + "alpha": [{"index":0, "rgb": [255,255,255,0]},{"index":1, "rgb": [255,255,255,1]}], -// Converts an array of n face vertices to an array of n + 1 edges. -function faceEdges(face) { - var n = face.length, - edges = []; - for (var a = face[n - 1], i = 0; i < n; ++i) edges.push([a, a = face[i]]); - return edges; -} + "viridis": [{"index":0,"rgb":[68,1,84]},{"index":0.13,"rgb":[71,44,122]},{"index":0.25,"rgb":[59,81,139]},{"index":0.38,"rgb":[44,113,142]},{"index":0.5,"rgb":[33,144,141]},{"index":0.63,"rgb":[39,173,129]},{"index":0.75,"rgb":[92,200,99]},{"index":0.88,"rgb":[170,220,50]},{"index":1,"rgb":[253,231,37]}], -function hasInverse(node) { - return node.project.invert || node.children && node.children.some(hasInverse); -} + "inferno": [{"index":0,"rgb":[0,0,4]},{"index":0.13,"rgb":[31,12,72]},{"index":0.25,"rgb":[85,15,109]},{"index":0.38,"rgb":[136,34,106]},{"index":0.5,"rgb":[186,54,85]},{"index":0.63,"rgb":[227,89,51]},{"index":0.75,"rgb":[249,140,10]},{"index":0.88,"rgb":[249,201,50]},{"index":1,"rgb":[252,255,164]}], -// TODO generate on-the-fly to avoid external modification. -var octahedron = [ - [0, 90], - [-90, 0], [0, 0], [90, 0], [180, 0], - [0, -90] -]; + "magma": [{"index":0,"rgb":[0,0,4]},{"index":0.13,"rgb":[28,16,68]},{"index":0.25,"rgb":[79,18,123]},{"index":0.38,"rgb":[129,37,129]},{"index":0.5,"rgb":[181,54,122]},{"index":0.63,"rgb":[229,80,100]},{"index":0.75,"rgb":[251,135,97]},{"index":0.88,"rgb":[254,194,135]},{"index":1,"rgb":[252,253,191]}], -var octahedron$1 = [ - [0, 2, 1], - [0, 3, 2], - [5, 1, 2], - [5, 2, 3], - [0, 1, 4], - [0, 4, 3], - [5, 4, 1], - [5, 3, 4] -].map(function(face) { - return face.map(function(i) { - return octahedron[i]; - }); -}); + "plasma": [{"index":0,"rgb":[13,8,135]},{"index":0.13,"rgb":[75,3,161]},{"index":0.25,"rgb":[125,3,168]},{"index":0.38,"rgb":[168,34,150]},{"index":0.5,"rgb":[203,70,121]},{"index":0.63,"rgb":[229,107,93]},{"index":0.75,"rgb":[248,148,65]},{"index":0.88,"rgb":[253,195,40]},{"index":1,"rgb":[240,249,33]}], -function butterfly(faceProjection) { + "warm": [{"index":0,"rgb":[125,0,179]},{"index":0.13,"rgb":[172,0,187]},{"index":0.25,"rgb":[219,0,170]},{"index":0.38,"rgb":[255,0,130]},{"index":0.5,"rgb":[255,63,74]},{"index":0.63,"rgb":[255,123,0]},{"index":0.75,"rgb":[234,176,0]},{"index":0.88,"rgb":[190,228,0]},{"index":1,"rgb":[147,255,0]}], - faceProjection = faceProjection || function(face) { - var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: face}); - return d3Geo.geoGnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]); - }; + "cool": [{"index":0,"rgb":[125,0,179]},{"index":0.13,"rgb":[116,0,218]},{"index":0.25,"rgb":[98,74,237]},{"index":0.38,"rgb":[68,146,231]},{"index":0.5,"rgb":[0,204,197]},{"index":0.63,"rgb":[0,247,146]},{"index":0.75,"rgb":[0,255,88]},{"index":0.88,"rgb":[40,255,8]},{"index":1,"rgb":[147,255,0]}], - var faces = octahedron$1.map(function(face) { - return {face: face, project: faceProjection(face)}; - }); + "rainbow-soft": [{"index":0,"rgb":[125,0,179]},{"index":0.1,"rgb":[199,0,180]},{"index":0.2,"rgb":[255,0,121]},{"index":0.3,"rgb":[255,108,0]},{"index":0.4,"rgb":[222,194,0]},{"index":0.5,"rgb":[150,255,0]},{"index":0.6,"rgb":[0,255,55]},{"index":0.7,"rgb":[0,246,150]},{"index":0.8,"rgb":[50,167,222]},{"index":0.9,"rgb":[103,51,235]},{"index":1,"rgb":[124,0,186]}], - [-1, 0, 0, 1, 0, 1, 4, 5].forEach(function(d, i) { - var node = faces[d]; - node && (node.children || (node.children = [])).push(faces[i]); - }); + "bathymetry": [{"index":0,"rgb":[40,26,44]},{"index":0.13,"rgb":[59,49,90]},{"index":0.25,"rgb":[64,76,139]},{"index":0.38,"rgb":[63,110,151]},{"index":0.5,"rgb":[72,142,158]},{"index":0.63,"rgb":[85,174,163]},{"index":0.75,"rgb":[120,206,163]},{"index":0.88,"rgb":[187,230,172]},{"index":1,"rgb":[253,254,204]}], - return polyhedral(faces[0], function(lambda, phi) { - return faces[lambda < -pi / 2 ? phi < 0 ? 6 : 4 - : lambda < 0 ? phi < 0 ? 2 : 0 - : lambda < pi / 2 ? phi < 0 ? 3 : 1 - : phi < 0 ? 7 : 5]; - }) - .angle(-30) - .scale(101.858) - .center([0, 45]); -} + "cdom": [{"index":0,"rgb":[47,15,62]},{"index":0.13,"rgb":[87,23,86]},{"index":0.25,"rgb":[130,28,99]},{"index":0.38,"rgb":[171,41,96]},{"index":0.5,"rgb":[206,67,86]},{"index":0.63,"rgb":[230,106,84]},{"index":0.75,"rgb":[242,149,103]},{"index":0.88,"rgb":[249,193,135]},{"index":1,"rgb":[254,237,176]}], -var kx = 2 / sqrt(3); + "chlorophyll": [{"index":0,"rgb":[18,36,20]},{"index":0.13,"rgb":[25,63,41]},{"index":0.25,"rgb":[24,91,59]},{"index":0.38,"rgb":[13,119,72]},{"index":0.5,"rgb":[18,148,80]},{"index":0.63,"rgb":[80,173,89]},{"index":0.75,"rgb":[132,196,122]},{"index":0.88,"rgb":[175,221,162]},{"index":1,"rgb":[215,249,208]}], -function collignonK(a, b) { - var p = collignonRaw(a, b); - return [p[0] * kx, p[1]]; -} + "density": [{"index":0,"rgb":[54,14,36]},{"index":0.13,"rgb":[89,23,80]},{"index":0.25,"rgb":[110,45,132]},{"index":0.38,"rgb":[120,77,178]},{"index":0.5,"rgb":[120,113,213]},{"index":0.63,"rgb":[115,151,228]},{"index":0.75,"rgb":[134,185,227]},{"index":0.88,"rgb":[177,214,227]},{"index":1,"rgb":[230,241,241]}], -collignonK.invert = function(x,y) { - return collignonRaw.invert(x / kx, y); -}; + "freesurface-blue": [{"index":0,"rgb":[30,4,110]},{"index":0.13,"rgb":[47,14,176]},{"index":0.25,"rgb":[41,45,236]},{"index":0.38,"rgb":[25,99,212]},{"index":0.5,"rgb":[68,131,200]},{"index":0.63,"rgb":[114,156,197]},{"index":0.75,"rgb":[157,181,203]},{"index":0.88,"rgb":[200,208,216]},{"index":1,"rgb":[241,237,236]}], -function collignon$1(faceProjection) { + "freesurface-red": [{"index":0,"rgb":[60,9,18]},{"index":0.13,"rgb":[100,17,27]},{"index":0.25,"rgb":[142,20,29]},{"index":0.38,"rgb":[177,43,27]},{"index":0.5,"rgb":[192,87,63]},{"index":0.63,"rgb":[205,125,105]},{"index":0.75,"rgb":[216,162,148]},{"index":0.88,"rgb":[227,199,193]},{"index":1,"rgb":[241,237,236]}], - faceProjection = faceProjection || function(face) { - var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: face}); - return d3Geo.geoProjection(collignonK).translate([0, 0]).scale(1).rotate(c[1] > 0 ? [-c[0], 0] : [180 - c[0], 180]); - }; + "oxygen": [{"index":0,"rgb":[64,5,5]},{"index":0.13,"rgb":[106,6,15]},{"index":0.25,"rgb":[144,26,7]},{"index":0.38,"rgb":[168,64,3]},{"index":0.5,"rgb":[188,100,4]},{"index":0.63,"rgb":[206,136,11]},{"index":0.75,"rgb":[220,174,25]},{"index":0.88,"rgb":[231,215,44]},{"index":1,"rgb":[248,254,105]}], - var faces = octahedron$1.map(function(face) { - return {face: face, project: faceProjection(face)}; - }); + "par": [{"index":0,"rgb":[51,20,24]},{"index":0.13,"rgb":[90,32,35]},{"index":0.25,"rgb":[129,44,34]},{"index":0.38,"rgb":[159,68,25]},{"index":0.5,"rgb":[182,99,19]},{"index":0.63,"rgb":[199,134,22]},{"index":0.75,"rgb":[212,171,35]},{"index":0.88,"rgb":[221,210,54]},{"index":1,"rgb":[225,253,75]}], - [-1, 0, 0, 1, 0, 1, 4, 5].forEach(function(d, i) { - var node = faces[d]; - node && (node.children || (node.children = [])).push(faces[i]); - }); + "phase": [{"index":0,"rgb":[145,105,18]},{"index":0.13,"rgb":[184,71,38]},{"index":0.25,"rgb":[186,58,115]},{"index":0.38,"rgb":[160,71,185]},{"index":0.5,"rgb":[110,97,218]},{"index":0.63,"rgb":[50,123,164]},{"index":0.75,"rgb":[31,131,110]},{"index":0.88,"rgb":[77,129,34]},{"index":1,"rgb":[145,105,18]}], - return polyhedral(faces[0], function(lambda, phi) { - return faces[lambda < -pi / 2 ? phi < 0 ? 6 : 4 - : lambda < 0 ? phi < 0 ? 2 : 0 - : lambda < pi / 2 ? phi < 0 ? 3 : 1 - : phi < 0 ? 7 : 5]; - }) - .angle(-30) - .scale(121.906) - .center([0, 48.5904]); -} + "salinity": [{"index":0,"rgb":[42,24,108]},{"index":0.13,"rgb":[33,50,162]},{"index":0.25,"rgb":[15,90,145]},{"index":0.38,"rgb":[40,118,137]},{"index":0.5,"rgb":[59,146,135]},{"index":0.63,"rgb":[79,175,126]},{"index":0.75,"rgb":[120,203,104]},{"index":0.88,"rgb":[193,221,100]},{"index":1,"rgb":[253,239,154]}], -function waterman(faceProjection) { + "temperature": [{"index":0,"rgb":[4,35,51]},{"index":0.13,"rgb":[23,51,122]},{"index":0.25,"rgb":[85,59,157]},{"index":0.38,"rgb":[129,79,143]},{"index":0.5,"rgb":[175,95,130]},{"index":0.63,"rgb":[222,112,101]},{"index":0.75,"rgb":[249,146,66]},{"index":0.88,"rgb":[249,196,65]},{"index":1,"rgb":[232,250,91]}], - faceProjection = faceProjection || function(face) { - var c = face.length === 6 ? d3Geo.geoCentroid({type: "MultiPoint", coordinates: face}) : face[0]; - return d3Geo.geoGnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]); - }; + "turbidity": [{"index":0,"rgb":[34,31,27]},{"index":0.13,"rgb":[65,50,41]},{"index":0.25,"rgb":[98,69,52]},{"index":0.38,"rgb":[131,89,57]},{"index":0.5,"rgb":[161,112,59]},{"index":0.63,"rgb":[185,140,66]},{"index":0.75,"rgb":[202,174,88]},{"index":0.88,"rgb":[216,209,126]},{"index":1,"rgb":[233,246,171]}], - var w5 = octahedron$1.map(function(face) { - var xyz = face.map(cartesian), - n = xyz.length, - a = xyz[n - 1], - b, - hexagon = []; - for (var i = 0; i < n; ++i) { - b = xyz[i]; - hexagon.push(spherical([ - a[0] * 0.9486832980505138 + b[0] * 0.31622776601683794, - a[1] * 0.9486832980505138 + b[1] * 0.31622776601683794, - a[2] * 0.9486832980505138 + b[2] * 0.31622776601683794 - ]), spherical([ - b[0] * 0.9486832980505138 + a[0] * 0.31622776601683794, - b[1] * 0.9486832980505138 + a[1] * 0.31622776601683794, - b[2] * 0.9486832980505138 + a[2] * 0.31622776601683794 - ])); - a = b; - } - return hexagon; - }); + "velocity-blue": [{"index":0,"rgb":[17,32,64]},{"index":0.13,"rgb":[35,52,116]},{"index":0.25,"rgb":[29,81,156]},{"index":0.38,"rgb":[31,113,162]},{"index":0.5,"rgb":[50,144,169]},{"index":0.63,"rgb":[87,173,176]},{"index":0.75,"rgb":[149,196,189]},{"index":0.88,"rgb":[203,221,211]},{"index":1,"rgb":[254,251,230]}], - var cornerNormals = []; + "velocity-green": [{"index":0,"rgb":[23,35,19]},{"index":0.13,"rgb":[24,64,38]},{"index":0.25,"rgb":[11,95,45]},{"index":0.38,"rgb":[39,123,35]},{"index":0.5,"rgb":[95,146,12]},{"index":0.63,"rgb":[152,165,18]},{"index":0.75,"rgb":[201,186,69]},{"index":0.88,"rgb":[233,216,137]},{"index":1,"rgb":[255,253,205]}], - var parents = [-1, 0, 0, 1, 0, 1, 4, 5]; + "cubehelix": [{"index":0,"rgb":[0,0,0]},{"index":0.07,"rgb":[22,5,59]},{"index":0.13,"rgb":[60,4,105]},{"index":0.2,"rgb":[109,1,135]},{"index":0.27,"rgb":[161,0,147]},{"index":0.33,"rgb":[210,2,142]},{"index":0.4,"rgb":[251,11,123]},{"index":0.47,"rgb":[255,29,97]},{"index":0.53,"rgb":[255,54,69]},{"index":0.6,"rgb":[255,85,46]},{"index":0.67,"rgb":[255,120,34]},{"index":0.73,"rgb":[255,157,37]},{"index":0.8,"rgb":[241,191,57]},{"index":0.87,"rgb":[224,220,93]},{"index":0.93,"rgb":[218,241,142]},{"index":1,"rgb":[227,253,198]}] +}; - w5.forEach(function(hexagon, j) { - var face = octahedron$1[j], - n = face.length, - normals = cornerNormals[j] = []; - for (var i = 0; i < n; ++i) { - w5.push([ - face[i], - hexagon[(i * 2 + 2) % (2 * n)], - hexagon[(i * 2 + 1) % (2 * n)] - ]); - parents.push(j); - normals.push(cross( - cartesian(hexagon[(i * 2 + 2) % (2 * n)]), - cartesian(hexagon[(i * 2 + 1) % (2 * n)]) - )); - } - }); +},{}],124:[function(_dereq_,module,exports){ +/* + * Ben Postlethwaite + * January 2013 + * License MIT + */ +'use strict'; - var faces = w5.map(function(face) { - return { - project: faceProjection(face), - face: face - }; - }); +var colorScale = _dereq_('./colorScale'); +var lerp = _dereq_('lerp') - parents.forEach(function(d, i) { - var parent = faces[d]; - parent && (parent.children || (parent.children = [])).push(faces[i]); - }); +module.exports = createColormap; - function face(lambda, phi) { - var cosphi = cos(phi), - p = [cosphi * cos(lambda), cosphi * sin(lambda), sin(phi)]; +function createColormap (spec) { + /* + * Default Options + */ + var indicies, fromrgba, torgba, + nsteps, cmap, colormap, format, + nshades, colors, alpha, i; - var hexagon = lambda < -pi / 2 ? phi < 0 ? 6 : 4 - : lambda < 0 ? phi < 0 ? 2 : 0 - : lambda < pi / 2 ? phi < 0 ? 3 : 1 - : phi < 0 ? 7 : 5; + if ( !spec ) spec = {}; - var n = cornerNormals[hexagon]; + nshades = (spec.nshades || 72) - 1; + format = spec.format || 'hex'; - return faces[dot(n[0], p) < 0 ? 8 + 3 * hexagon - : dot(n[1], p) < 0 ? 8 + 3 * hexagon + 1 - : dot(n[2], p) < 0 ? 8 + 3 * hexagon + 2 - : hexagon]; - } + colormap = spec.colormap; + if (!colormap) colormap = 'jet'; - return polyhedral(faces[0], face) - .angle(-30) - .scale(110.625) - .center([0,45]); -} + if (typeof colormap === 'string') { + colormap = colormap.toLowerCase(); -function dot(a, b) { - for (var i = 0, n = a.length, s = 0; i < n; ++i) s += a[i] * b[i]; - return s; -} + if (!colorScale[colormap]) { + throw Error(colormap + ' not a supported colorscale'); + } -function cross(a, b) { - return [ - a[1] * b[2] - a[2] * b[1], - a[2] * b[0] - a[0] * b[2], - a[0] * b[1] - a[1] * b[0] - ]; -} + cmap = colorScale[colormap]; -// Converts 3D Cartesian to spherical coordinates (degrees). -function spherical(cartesian) { - return [ - atan2(cartesian[1], cartesian[0]) * degrees, - asin(max(-1, min(1, cartesian[2]))) * degrees - ]; -} + } else if (Array.isArray(colormap)) { + cmap = colormap.slice(); -// Converts spherical coordinates (degrees) to 3D Cartesian. -function cartesian(coordinates) { - var lambda = coordinates[0] * radians, - phi = coordinates[1] * radians, - cosphi = cos(phi); - return [ - cosphi * cos(lambda), - cosphi * sin(lambda), - sin(phi) - ]; -} + } else { + throw Error('unsupported colormap option', colormap); + } -function noop() {} + if (cmap.length > nshades + 1) { + throw new Error( + colormap+' map requires nshades to be at least size '+cmap.length + ); + } -function clockwise(ring) { - if ((n = ring.length) < 4) return false; - var i = 0, - n, - area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1]; - while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1]; - return area <= 0; -} + if (!Array.isArray(spec.alpha)) { -function contains(ring, point) { - var x = point[0], - y = point[1], - contains = false; - for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) { - var pi = ring[i], xi = pi[0], yi = pi[1], - pj = ring[j], xj = pj[0], yj = pj[1]; - if (((yi > y) ^ (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi)) contains = !contains; - } - return contains; -} + if (typeof spec.alpha === 'number') { + alpha = [spec.alpha, spec.alpha]; -function index(object, projection) { - var stream = projection.stream, project; - if (!stream) throw new Error("invalid projection"); - switch (object && object.type) { - case "Feature": project = projectFeature; break; - case "FeatureCollection": project = projectFeatureCollection; break; - default: project = projectGeometry; break; - } - return project(object, stream); -} + } else { + alpha = [1, 1]; + } -function projectFeatureCollection(o, stream) { - return { - type: "FeatureCollection", - features: o.features.map(function(f) { - return projectFeature(f, stream); - }) - }; -} + } else if (spec.alpha.length !== 2) { + alpha = [1, 1]; -function projectFeature(o, stream) { - return { - type: "Feature", - id: o.id, - properties: o.properties, - geometry: projectGeometry(o.geometry, stream) - }; -} + } else { + alpha = spec.alpha.slice(); + } -function projectGeometryCollection(o, stream) { - return { - type: "GeometryCollection", - geometries: o.geometries.map(function(o) { - return projectGeometry(o, stream); - }) - }; -} + // map index points from 0..1 to 0..n-1 + indicies = cmap.map(function(c) { + return Math.round(c.index * nshades); + }); -function projectGeometry(o, stream) { - if (!o) return null; - if (o.type === "GeometryCollection") return projectGeometryCollection(o, stream); - var sink; - switch (o.type) { - case "Point": sink = sinkPoint; break; - case "MultiPoint": sink = sinkPoint; break; - case "LineString": sink = sinkLine; break; - case "MultiLineString": sink = sinkLine; break; - case "Polygon": sink = sinkPolygon; break; - case "MultiPolygon": sink = sinkPolygon; break; - case "Sphere": sink = sinkPolygon; break; - default: return null; - } - d3Geo.geoStream(o, stream(sink)); - return sink.result(); -} + // Add alpha channel to the map + alpha[0] = Math.min(Math.max(alpha[0], 0), 1); + alpha[1] = Math.min(Math.max(alpha[1], 0), 1); -var points = [], - lines = []; + var steps = cmap.map(function(c, i) { + var index = cmap[i].index -var sinkPoint = { - point: function(x, y) { - points.push([x, y]); - }, - result: function() { - var result = !points.length ? null - : points.length < 2 ? {type: "Point", coordinates: points[0]} - : {type: "MultiPoint", coordinates: points}; - points = []; - return result; - } -}; + var rgba = cmap[i].rgb.slice(); -var sinkLine = { - lineStart: noop, - point: function(x, y) { - points.push([x, y]); - }, - lineEnd: function() { - if (points.length) lines.push(points), points = []; - }, - result: function() { - var result = !lines.length ? null - : lines.length < 2 ? {type: "LineString", coordinates: lines[0]} - : {type: "MultiLineString", coordinates: lines}; - lines = []; - return result; - } -}; + // if user supplies their own map use it + if (rgba.length === 4 && rgba[3] >= 0 && rgba[3] <= 1) { + return rgba + } + rgba[3] = alpha[0] + (alpha[1] - alpha[0])*index; -var sinkPolygon = { - polygonStart: noop, - lineStart: noop, - point: function(x, y) { - points.push([x, y]); - }, - lineEnd: function() { - var n = points.length; - if (n) { - do points.push(points[0].slice()); while (++n < 4); - lines.push(points), points = []; - } - }, - polygonEnd: noop, - result: function() { - if (!lines.length) return null; - var polygons = [], - holes = []; + return rgba + }) - // https://github.com/d3/d3/issues/1558 - lines.forEach(function(ring) { - if (clockwise(ring)) polygons.push([ring]); - else holes.push(ring); - }); - holes.forEach(function(hole) { - var point = hole[0]; - polygons.some(function(polygon) { - if (contains(polygon[0], point)) { - polygon.push(hole); - return true; + /* + * map increasing linear values between indicies to + * linear steps in colorvalues + */ + var colors = [] + for (i = 0; i < indicies.length-1; ++i) { + nsteps = indicies[i+1] - indicies[i]; + fromrgba = steps[i]; + torgba = steps[i+1]; + + for (var j = 0; j < nsteps; j++) { + var amt = j / nsteps + colors.push([ + Math.round(lerp(fromrgba[0], torgba[0], amt)), + Math.round(lerp(fromrgba[1], torgba[1], amt)), + Math.round(lerp(fromrgba[2], torgba[2], amt)), + lerp(fromrgba[3], torgba[3], amt) + ]) } - }) || polygons.push([hole]); - }); - - lines = []; + } - return !polygons.length ? null - : polygons.length > 1 ? {type: "MultiPolygon", coordinates: polygons} - : {type: "Polygon", coordinates: polygons[0]}; - } -}; + //add 1 step as last value + colors.push(cmap[cmap.length - 1].rgb.concat(alpha[1])) -function quincuncial(project) { - var dx = project(halfPi, 0)[0] - project(-halfPi, 0)[0]; + if (format === 'hex') colors = colors.map( rgb2hex ); + else if (format === 'rgbaString') colors = colors.map( rgbaStr ); + else if (format === 'float') colors = colors.map( rgb2float ); - function projectQuincuncial(lambda, phi) { - var t = abs(lambda) < halfPi, - p = project(t ? lambda : lambda > 0 ? lambda - pi : lambda + pi, phi), - x = (p[0] - p[1]) * sqrt1_2, - y = (p[0] + p[1]) * sqrt1_2; - if (t) return [x, y]; - var d = dx * sqrt1_2, - s = x > 0 ^ y > 0 ? -1 : 1; - return [s * x - sign(y) * d, s * y - sign(x) * d]; - } + return colors; +}; - if (project.invert) projectQuincuncial.invert = function(x0, y0) { - var x = (x0 + y0) * sqrt1_2, - y = (y0 - x0) * sqrt1_2, - t = abs(x) < 0.5 * dx && abs(y) < 0.5 * dx; +function rgb2float (rgba) { + return [ + rgba[0] / 255, + rgba[1] / 255, + rgba[2] / 255, + rgba[3] + ] +} - if (!t) { - var d = dx * sqrt1_2, - s = x > 0 ^ y > 0 ? -1 : 1, - x1 = -s * x0 + (y > 0 ? 1 : -1) * d, - y1 = -s * y0 + (x > 0 ? 1 : -1) * d; - x = (-x1 - y1) * sqrt1_2; - y = (x1 - y1) * sqrt1_2; +function rgb2hex (rgba) { + var dig, hex = '#'; + for (var i = 0; i < 3; ++i) { + dig = rgba[i]; + dig = dig.toString(16); + hex += ('00' + dig).substr( dig.length ); } - - var p = project.invert(x, y); - if (!t) p[0] += x > 0 ? pi : -pi; - return p; - }; - - return d3Geo.geoProjection(projectQuincuncial) - .rotate([-90, -90, 45]) - .clipAngle(180 - 1e-3); + return hex; } -function gringorten$1() { - return quincuncial(gringortenRaw) - .scale(176.423); +function rgbaStr (rgba) { + return 'rgba(' + rgba.join(',') + ')'; } -function peirce() { - return quincuncial(guyouRaw) - .scale(111.48); -} +},{"./colorScale":123,"lerp":355}],125:[function(_dereq_,module,exports){ +"use strict" -function quantize(input, digits) { - if (!(0 <= (digits = +digits) && digits <= 20)) throw new Error("invalid digits"); +module.exports = compareAngle - function quantizePoint(input) { - var n = input.length, i = 2, output = new Array(n); - output[0] = +input[0].toFixed(digits); - output[1] = +input[1].toFixed(digits); - while (i < n) output[i] = input[i], ++i; - return output; - } +var orient = _dereq_("robust-orientation") +var sgn = _dereq_("signum") +var twoSum = _dereq_("two-sum") +var robustProduct = _dereq_("robust-product") +var robustSum = _dereq_("robust-sum") - function quantizePoints(input) { - return input.map(quantizePoint); - } +function testInterior(a, b, c) { + var x0 = twoSum(a[0], -b[0]) + var y0 = twoSum(a[1], -b[1]) + var x1 = twoSum(c[0], -b[0]) + var y1 = twoSum(c[1], -b[1]) - function quantizePointsNoDuplicates(input) { - var point0 = quantizePoint(input[0]); - var output = [point0]; - for (var i = 1; i < input.length; i++) { - var point = quantizePoint(input[i]); - if (point.length > 2 || point[0] != point0[0] || point[1] != point0[1]) { - output.push(point); - point0 = point; + var d = robustSum( + robustProduct(x0, x1), + robustProduct(y0, y1)) + + return d[d.length-1] >= 0 +} + +function compareAngle(a, b, c, d) { + var bcd = orient(b, c, d) + if(bcd === 0) { + //Handle degenerate cases + var sabc = sgn(orient(a, b, c)) + var sabd = sgn(orient(a, b, d)) + if(sabc === sabd) { + if(sabc === 0) { + var ic = testInterior(a, b, c) + var id = testInterior(a, b, d) + if(ic === id) { + return 0 + } else if(ic) { + return 1 + } else { + return -1 + } + } + return 0 + } else if(sabd === 0) { + if(sabc > 0) { + return -1 + } else if(testInterior(a, b, d)) { + return -1 + } else { + return 1 + } + } else if(sabc === 0) { + if(sabd > 0) { + return 1 + } else if(testInterior(a, b, c)) { + return 1 + } else { + return -1 } } - if (output.length === 1 && input.length > 1) { - output.push(quantizePoint(input[input.length - 1])); + return sgn(sabd - sabc) + } + var abc = orient(a, b, c) + if(abc > 0) { + if(bcd > 0 && orient(a, b, d) > 0) { + return 1 + } + return -1 + } else if(abc < 0) { + if(bcd > 0 || orient(a, b, d) > 0) { + return 1 + } + return -1 + } else { + var abd = orient(a, b, d) + if(abd > 0) { + return 1 + } else { + if(testInterior(a, b, c)) { + return 1 + } else { + return -1 + } } - return output; } +} +},{"robust-orientation":427,"robust-product":428,"robust-sum":432,"signum":434,"two-sum":476}],126:[function(_dereq_,module,exports){ +module.exports = compareCells - function quantizePolygon(input) { - return input.map(quantizePointsNoDuplicates); - } +var min = Math.min - function quantizeGeometry(input) { - if (input == null) return input; - var output; - switch (input.type) { - case "GeometryCollection": output = {type: "GeometryCollection", geometries: input.geometries.map(quantizeGeometry)}; break; - case "Point": output = {type: "Point", coordinates: quantizePoint(input.coordinates)}; break; - case "MultiPoint": output = {type: input.type, coordinates: quantizePoints(input.coordinates)}; break; - case "LineString": output = {type: input.type, coordinates: quantizePointsNoDuplicates(input.coordinates)}; break; - case "MultiLineString": case "Polygon": output = {type: input.type, coordinates: quantizePolygon(input.coordinates)}; break; - case "MultiPolygon": output = {type: "MultiPolygon", coordinates: input.coordinates.map(quantizePolygon)}; break; - default: return input; - } - if (input.bbox != null) output.bbox = input.bbox; - return output; - } +function compareInt(a, b) { + return a - b +} - function quantizeFeature(input) { - var output = {type: "Feature", properties: input.properties, geometry: quantizeGeometry(input.geometry)}; - if (input.id != null) output.id = input.id; - if (input.bbox != null) output.bbox = input.bbox; - return output; +function compareCells(a, b) { + var n = a.length + , t = a.length - b.length + if(t) { + return t } - - if (input != null) switch (input.type) { - case "Feature": return quantizeFeature(input); - case "FeatureCollection": { - var output = {type: "FeatureCollection", features: input.features.map(quantizeFeature)}; - if (input.bbox != null) output.bbox = input.bbox; - return output; - } - default: return quantizeGeometry(input); + switch(n) { + case 0: + return 0 + case 1: + return a[0] - b[0] + case 2: + return (a[0]+a[1]-b[0]-b[1]) || + min(a[0],a[1]) - min(b[0],b[1]) + case 3: + var l1 = a[0]+a[1] + , m1 = b[0]+b[1] + t = l1+a[2] - (m1+b[2]) + if(t) { + return t + } + var l0 = min(a[0], a[1]) + , m0 = min(b[0], b[1]) + return min(l0, a[2]) - min(m0, b[2]) || + min(l0+a[2], l1) - min(m0+b[2], m1) + case 4: + var aw=a[0], ax=a[1], ay=a[2], az=a[3] + , bw=b[0], bx=b[1], by=b[2], bz=b[3] + return (aw+ax+ay+az)-(bw+bx+by+bz) || + min(aw,ax,ay,az)-min(bw,bx,by,bz,bw) || + min(aw+ax,aw+ay,aw+az,ax+ay,ax+az,ay+az) - + min(bw+bx,bw+by,bw+bz,bx+by,bx+bz,by+bz) || + min(aw+ax+ay,aw+ax+az,aw+ay+az,ax+ay+az) - + min(bw+bx+by,bw+bx+bz,bw+by+bz,bx+by+bz) + default: + var as = a.slice().sort(compareInt) + var bs = b.slice().sort(compareInt) + for(var i=0; i epsilon && --i > 0); - var E = x * (tanPhi = tan(phi)), - A = tan(abs(y) < abs(phi + 1 / tanPhi) ? asin(E) * 0.5 : acos(E) * 0.5 + pi / 4) / sin(phi); - return [ - sinPhi0 ? 2 * atan(sinPhi0 * A) / sinPhi0 : 2 * A, - phi - ]; - }; +module.exports = compareOrientedCells - return forward; +function compareOrientedCells(a, b) { + return compareCells(a, b) || parity(a) - parity(b) } -function rectangularPolyconic() { - return parallel1(rectangularPolyconicRaw) - .scale(131.215); -} +},{"cell-orientation":111,"compare-cell":126}],128:[function(_dereq_,module,exports){ +"use strict" -var K$1 = [ - [0.9986, -0.062], - [1.0000, 0.0000], - [0.9986, 0.0620], - [0.9954, 0.1240], - [0.9900, 0.1860], - [0.9822, 0.2480], - [0.9730, 0.3100], - [0.9600, 0.3720], - [0.9427, 0.4340], - [0.9216, 0.4958], - [0.8962, 0.5571], - [0.8679, 0.6176], - [0.8350, 0.6769], - [0.7986, 0.7346], - [0.7597, 0.7903], - [0.7186, 0.8435], - [0.6732, 0.8936], - [0.6213, 0.9394], - [0.5722, 0.9761], - [0.5322, 1.0000] -]; +var convexHull1d = _dereq_('./lib/ch1d') +var convexHull2d = _dereq_('./lib/ch2d') +var convexHullnd = _dereq_('./lib/chnd') -K$1.forEach(function(d) { - d[1] *= 1.0144; -}); +module.exports = convexHull -function robinsonRaw(lambda, phi) { - var i = min(18, abs(phi) * 36 / pi), - i0 = floor(i), - di = i - i0, - ax = (k = K$1[i0])[0], - ay = k[1], - bx = (k = K$1[++i0])[0], - by = k[1], - cx = (k = K$1[min(19, ++i0)])[0], - cy = k[1], - k; - return [ - lambda * (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2), - (phi > 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) - ]; +function convexHull(points) { + var n = points.length + if(n === 0) { + return [] + } else if(n === 1) { + return [[0]] + } + var d = points[0].length + if(d === 0) { + return [] + } else if(d === 1) { + return convexHull1d(points) + } else if(d === 2) { + return convexHull2d(points) + } + return convexHullnd(points, d) } +},{"./lib/ch1d":129,"./lib/ch2d":130,"./lib/chnd":131}],129:[function(_dereq_,module,exports){ +"use strict" -robinsonRaw.invert = function(x, y) { - var yy = y / halfPi, - phi = yy * 90, - i = min(18, abs(phi / 5)), - i0 = max(0, floor(i)); - do { - var ay = K$1[i0][1], - by = K$1[i0 + 1][1], - cy = K$1[min(19, i0 + 2)][1], - u = cy - ay, - v = cy - 2 * by + ay, - t = 2 * (abs(yy) - by) / u, - c = v / u, - di = t * (1 - c * t * (1 - 2 * c * t)); - if (di >= 0 || i0 === 1) { - phi = (y >= 0 ? 5 : -5) * (di + i); - var j = 50, delta; - do { - i = min(18, abs(phi) / 5); - i0 = floor(i); - di = i - i0; - ay = K$1[i0][1]; - by = K$1[i0 + 1][1]; - cy = K$1[min(19, i0 + 2)][1]; - phi -= (delta = (y >= 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) - y) * degrees; - } while (abs(delta) > epsilon2 && --j > 0); - break; - } - } while (--i0 >= 0); - var ax = K$1[i0][0], - bx = K$1[i0 + 1][0], - cx = K$1[min(19, i0 + 2)][0]; - return [ - x / (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2), - phi * radians - ]; -}; +module.exports = convexHull1d -function robinson() { - return d3Geo.geoProjection(robinsonRaw) - .scale(152.63); +function convexHull1d(points) { + var lo = 0 + var hi = 0 + for(var i=1; i points[hi][0]) { + hi = i + } + } + if(lo < hi) { + return [[lo], [hi]] + } else if(lo > hi) { + return [[hi], [lo]] + } else { + return [[lo]] + } } +},{}],130:[function(_dereq_,module,exports){ +'use strict' -function satelliteVerticalRaw(P) { - function forward(lambda, phi) { - var cosPhi = cos(phi), - k = (P - 1) / (P - cosPhi * cos(lambda)); - return [ - k * cosPhi * sin(lambda), - k * sin(phi) - ]; - } +module.exports = convexHull2D - forward.invert = function(x, y) { - var rho2 = x * x + y * y, - rho = sqrt(rho2), - sinc = (P - sqrt(1 - rho2 * (P + 1) / (P - 1))) / ((P - 1) / rho + rho / (P - 1)); - return [ - atan2(x * sinc, rho * sqrt(1 - sinc * sinc)), - rho ? asin(y * sinc / rho) : 0 - ]; - }; +var monotoneHull = _dereq_('monotone-convex-hull-2d') - return forward; +function convexHull2D(points) { + var hull = monotoneHull(points) + var h = hull.length + if(h <= 2) { + return [] + } + var edges = new Array(h) + var a = hull[h-1] + for(var i=0; i= front[k]) { + x += 1 + } + } + c[j] = x + } + } + } + return cells +} - return p - .scale(432.147) - .clipAngle(acos(1 / distance) * degrees - 1e-6); +function convexHullnD(points, d) { + try { + return ich(points, true) + } catch(e) { + //If point set is degenerate, try to find a basis and rerun it + var ah = aff(points) + if(ah.length <= d) { + //No basis, no try + return [] + } + var npoints = permute(points, ah) + var nhull = ich(npoints, true) + return invPermute(nhull, ah) + } +} +},{"affine-hull":66,"incremental-convex-hull":346}],132:[function(_dereq_,module,exports){ +module.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|ç)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|é)union', + ROU: 'r(o|u|ou)mania', + RUS: '\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics', + RWA: 'rwanda', + BLM: 'barth(e|é)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|ã)o.?tom(e|é)', + 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' } -var epsilon$1 = 1e-4, - epsilonInverse = 1e4, - x0 = -180, x0e = x0 + epsilon$1, - x1 = 180, x1e = x1 - epsilon$1, - y0 = -90, y0e = y0 + epsilon$1, - y1 = 90, y1e = y1 - epsilon$1; +},{}],133:[function(_dereq_,module,exports){ +"use strict" -function nonempty(coordinates) { - return coordinates.length > 0; +function dcubicHermite(p0, v0, p1, v1, t, f) { + var dh00 = 6*t*t-6*t, + dh10 = 3*t*t-4*t + 1, + dh01 = -6*t*t+6*t, + dh11 = 3*t*t-2*t + if(p0.length) { + if(!f) { + f = new Array(p0.length) + } + for(var i=p0.length-1; i>=0; --i) { + f[i] = dh00*p0[i] + dh10*v0[i] + dh01*p1[i] + dh11*v1[i] + } + return f + } + return dh00*p0 + dh10*v0 + dh01*p1[i] + dh11*v1 } -function quantize$1(x) { - return Math.floor(x * epsilonInverse) / epsilonInverse; +function cubicHermite(p0, v0, p1, v1, t, f) { + var ti = (t-1), t2 = t*t, ti2 = ti*ti, + h00 = (1+2*t)*ti2, + h10 = t*ti2, + h01 = t2*(3-2*t), + h11 = t2*ti + if(p0.length) { + if(!f) { + f = new Array(p0.length) + } + for(var i=p0.length-1; i>=0; --i) { + f[i] = h00*p0[i] + h10*v0[i] + h01*p1[i] + h11*v1[i] + } + return f + } + return h00*p0 + h10*v0 + h01*p1 + h11*v1 } -function normalizePoint(y) { - return y === y0 || y === y1 ? [0, y] : [x0, quantize$1(y)]; // pole or antimeridian? +module.exports = cubicHermite +module.exports.derivative = dcubicHermite +},{}],134:[function(_dereq_,module,exports){ +// https://d3js.org/d3-array/ v1.2.4 Copyright 2018 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(factory((global.d3 = global.d3 || {}))); +}(this, (function (exports) { 'use strict'; + +function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; } -function clampPoint(p) { - var x = p[0], y = p[1], clamped = false; - if (x <= x0e) x = x0, clamped = true; - else if (x >= x1e) x = x1, clamped = true; - if (y <= y0e) y = y0, clamped = true; - else if (y >= y1e) y = y1, clamped = true; - return clamped ? [x, y] : p; +function bisector(compare) { + if (compare.length === 1) compare = ascendingComparator(compare); + return { + left: function(a, x, lo, hi) { + if (lo == null) lo = 0; + if (hi == null) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) < 0) lo = mid + 1; + else hi = mid; + } + return lo; + }, + right: function(a, x, lo, hi) { + if (lo == null) lo = 0; + if (hi == null) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) > 0) hi = mid; + else lo = mid + 1; + } + return lo; + } + }; } -function clampPoints(points) { - return points.map(clampPoint); +function ascendingComparator(f) { + return function(d, x) { + return ascending(f(d), x); + }; } -// For each ring, detect where it crosses the antimeridian or pole. -function extractFragments(rings, polygon, fragments) { - for (var j = 0, m = rings.length; j < m; ++j) { - var ring = rings[j].slice(); +var ascendingBisect = bisector(ascending); +var bisectRight = ascendingBisect.right; +var bisectLeft = ascendingBisect.left; - // By default, assume that this ring doesn’t need any stitching. - fragments.push({index: -1, polygon: polygon, ring: ring}); +function pairs(array, f) { + if (f == null) f = pair; + var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n); + while (i < n) pairs[i] = f(p, p = array[++i]); + return pairs; +} - for (var i = 0, n = ring.length; i < n; ++i) { - var point = ring[i], - x = point[0], - y = point[1]; +function pair(a, b) { + return [a, b]; +} - // If this is an antimeridian or polar point… - if (x <= x0e || x >= x1e || y <= y0e || y >= y1e) { - ring[i] = clampPoint(point); +function cross(values0, values1, reduce) { + var n0 = values0.length, + n1 = values1.length, + values = new Array(n0 * n1), + i0, + i1, + i, + value0; - // Advance through any antimeridian or polar points… - for (var k = i + 1; k < n; ++k) { - var pointk = ring[k], - xk = pointk[0], - yk = pointk[1]; - if (xk > x0e && xk < x1e && yk > y0e && yk < y1e) break; - } + if (reduce == null) reduce = pair; - // If this was just a single antimeridian or polar point, - // we don’t need to cut this ring into a fragment; - // we can just leave it as-is. - if (k === i + 1) continue; + for (i0 = i = 0; i0 < n0; ++i0) { + for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) { + values[i] = reduce(value0, values1[i1]); + } + } - // Otherwise, if this is not the first point in the ring, - // cut the current fragment so that it ends at the current point. - // The current point is also normalized for later joining. - if (i) { - var fragmentBefore = {index: -1, polygon: polygon, ring: ring.slice(0, i + 1)}; - fragmentBefore.ring[fragmentBefore.ring.length - 1] = normalizePoint(y); - fragments[fragments.length - 1] = fragmentBefore; - } + return values; +} - // If the ring started with an antimeridian fragment, - // we can ignore that fragment entirely. - else fragments.pop(); +function descending(a, b) { + return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; +} - // If the remainder of the ring is an antimeridian fragment, - // move on to the next ring. - if (k >= n) break; +function number(x) { + return x === null ? NaN : +x; +} - // Otherwise, add the remaining ring fragment and continue. - fragments.push({index: -1, polygon: polygon, ring: ring = ring.slice(k - 1)}); - ring[0] = normalizePoint(ring[0][1]); - i = -1; - n = ring.length; +function variance(values, valueof) { + var n = values.length, + m = 0, + i = -1, + mean = 0, + value, + delta, + sum = 0; + + if (valueof == null) { + while (++i < n) { + if (!isNaN(value = number(values[i]))) { + delta = value - mean; + mean += delta / ++m; + sum += delta * (value - mean); } } } -} - -// Now stitch the fragments back together into rings. -function stitchFragments(fragments) { - var i, n = fragments.length; - - // To connect the fragments start-to-end, create a simple index by end. - var fragmentByStart = {}, - fragmentByEnd = {}, - fragment, - start, - startFragment, - end, - endFragment; - - // For each fragment… - for (i = 0; i < n; ++i) { - fragment = fragments[i]; - start = fragment.ring[0]; - end = fragment.ring[fragment.ring.length - 1]; - // If this fragment is closed, add it as a standalone ring. - if (start[0] === end[0] && start[1] === end[1]) { - fragment.polygon.push(fragment.ring); - fragments[i] = null; - continue; + else { + while (++i < n) { + if (!isNaN(value = number(valueof(values[i], i, values)))) { + delta = value - mean; + mean += delta / ++m; + sum += delta * (value - mean); + } } - - fragment.index = i; - fragmentByStart[start] = fragmentByEnd[end] = fragment; } - // For each open fragment… - for (i = 0; i < n; ++i) { - fragment = fragments[i]; - if (fragment) { - start = fragment.ring[0]; - end = fragment.ring[fragment.ring.length - 1]; - startFragment = fragmentByEnd[start]; - endFragment = fragmentByStart[end]; + if (m > 1) return sum / (m - 1); +} - delete fragmentByStart[start]; - delete fragmentByEnd[end]; +function deviation(array, f) { + var v = variance(array, f); + return v ? Math.sqrt(v) : v; +} - // If this fragment is closed, add it as a standalone ring. - if (start[0] === end[0] && start[1] === end[1]) { - fragment.polygon.push(fragment.ring); - continue; - } +function extent(values, valueof) { + var n = values.length, + i = -1, + value, + min, + max; - if (startFragment) { - delete fragmentByEnd[start]; - delete fragmentByStart[startFragment.ring[0]]; - startFragment.ring.pop(); // drop the shared coordinate - fragments[startFragment.index] = null; - fragment = {index: -1, polygon: startFragment.polygon, ring: startFragment.ring.concat(fragment.ring)}; + if (valueof == null) { + while (++i < n) { // Find the first comparable value. + if ((value = values[i]) != null && value >= value) { + min = max = value; + while (++i < n) { // Compare the remaining values. + if ((value = values[i]) != null) { + if (min > value) min = value; + if (max < value) max = value; + } + } + } + } + } - if (startFragment === endFragment) { - // Connect both ends to this single fragment to create a ring. - fragment.polygon.push(fragment.ring); - } else { - fragment.index = n++; - fragments.push(fragmentByStart[fragment.ring[0]] = fragmentByEnd[fragment.ring[fragment.ring.length - 1]] = fragment); + else { + while (++i < n) { // Find the first comparable value. + if ((value = valueof(values[i], i, values)) != null && value >= value) { + min = max = value; + while (++i < n) { // Compare the remaining values. + if ((value = valueof(values[i], i, values)) != null) { + if (min > value) min = value; + if (max < value) max = value; + } } - } else if (endFragment) { - delete fragmentByStart[end]; - delete fragmentByEnd[endFragment.ring[endFragment.ring.length - 1]]; - fragment.ring.pop(); // drop the shared coordinate - fragment = {index: n++, polygon: endFragment.polygon, ring: fragment.ring.concat(endFragment.ring)}; - fragments[endFragment.index] = null; - fragments.push(fragmentByStart[fragment.ring[0]] = fragmentByEnd[fragment.ring[fragment.ring.length - 1]] = fragment); - } else { - fragment.ring.push(fragment.ring[0]); // close ring - fragment.polygon.push(fragment.ring); } } } + + return [min, max]; } -function stitchFeature(input) { - var output = {type: "Feature", geometry: stitchGeometry(input.geometry)}; - if (input.id != null) output.id = input.id; - if (input.bbox != null) output.bbox = input.bbox; - if (input.properties != null) output.properties = input.properties; - return output; +var array = Array.prototype; + +var slice = array.slice; +var map = array.map; + +function constant(x) { + return function() { + return x; + }; } -function stitchGeometry(input) { - if (input == null) return input; - var output, fragments, i, n; - switch (input.type) { - case "GeometryCollection": output = {type: "GeometryCollection", geometries: input.geometries.map(stitchGeometry)}; break; - case "Point": output = {type: "Point", coordinates: clampPoint(input.coordinates)}; break; - case "MultiPoint": case "LineString": output = {type: input.type, coordinates: clampPoints(input.coordinates)}; break; - case "MultiLineString": output = {type: "MultiLineString", coordinates: input.coordinates.map(clampPoints)}; break; - case "Polygon": { - var polygon = []; - extractFragments(input.coordinates, polygon, fragments = []); - stitchFragments(fragments); - output = {type: "Polygon", coordinates: polygon}; - break; - } - case "MultiPolygon": { - fragments = [], i = -1, n = input.coordinates.length; - var polygons = new Array(n); - while (++i < n) extractFragments(input.coordinates[i], polygons[i] = [], fragments); - stitchFragments(fragments); - output = {type: "MultiPolygon", coordinates: polygons.filter(nonempty)}; - break; - } - default: return input; +function identity(x) { + return x; +} + +function range(start, stop, step) { + start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; + + var i = -1, + n = Math.max(0, Math.ceil((stop - start) / step)) | 0, + range = new Array(n); + + while (++i < n) { + range[i] = start + i * step; } - if (input.bbox != null) output.bbox = input.bbox; - return output; + + return range; } -function stitch(input) { - if (input == null) return input; - switch (input.type) { - case "Feature": return stitchFeature(input); - case "FeatureCollection": { - var output = {type: "FeatureCollection", features: input.features.map(stitchFeature)}; - if (input.bbox != null) output.bbox = input.bbox; - return output; - } - default: return stitchGeometry(input); +var e10 = Math.sqrt(50), + e5 = Math.sqrt(10), + e2 = Math.sqrt(2); + +function ticks(start, stop, count) { + var reverse, + i = -1, + n, + ticks, + step; + + stop = +stop, start = +start, count = +count; + if (start === stop && count > 0) return [start]; + if (reverse = stop < start) n = start, start = stop, stop = n; + if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return []; + + if (step > 0) { + start = Math.ceil(start / step); + stop = Math.floor(stop / step); + ticks = new Array(n = Math.ceil(stop - start + 1)); + while (++i < n) ticks[i] = (start + i) * step; + } else { + start = Math.floor(start * step); + stop = Math.ceil(stop * step); + ticks = new Array(n = Math.ceil(start - stop + 1)); + while (++i < n) ticks[i] = (start - i) / step; } + + if (reverse) ticks.reverse(); + + return ticks; } -function timesRaw(lambda, phi) { - var t = tan(phi / 2), - s = sin(quarterPi * t); - return [ - lambda * (0.74482 - 0.34588 * s * s), - 1.70711 * t - ]; +function tickIncrement(start, stop, count) { + var step = (stop - start) / Math.max(0, count), + power = Math.floor(Math.log(step) / Math.LN10), + error = step / Math.pow(10, power); + return power >= 0 + ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) + : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); } -timesRaw.invert = function(x, y) { - var t = y / 1.70711, - s = sin(quarterPi * t); - return [ - x / (0.74482 - 0.34588 * s * s), - 2 * atan(t) - ]; -}; +function tickStep(start, stop, count) { + var step0 = Math.abs(stop - start) / Math.max(0, count), + step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), + error = step0 / step1; + if (error >= e10) step1 *= 10; + else if (error >= e5) step1 *= 5; + else if (error >= e2) step1 *= 2; + return stop < start ? -step1 : step1; +} -function times() { - return d3Geo.geoProjection(timesRaw) - .scale(146.153); +function sturges(values) { + return Math.ceil(Math.log(values.length) / Math.LN2) + 1; } -// Compute the origin as the midpoint of the two reference points. -// Rotate one of the reference points by the origin. -// Apply the spherical law of sines to compute gamma rotation. -function twoPoint(raw, p0, p1) { - var i = d3Geo.geoInterpolate(p0, p1), - o = i(0.5), - a = d3Geo.geoRotation([-o[0], -o[1]])(p0), - b = i.distance / 2, - y = -asin(sin(a[1] * radians) / sin(b)), - R = [-o[0], -o[1], -(a[0] > 0 ? pi - y : y) * degrees], - p = d3Geo.geoProjection(raw(b)).rotate(R), - r = d3Geo.geoRotation(R), - center = p.center; +function histogram() { + var value = identity, + domain = extent, + threshold = sturges; - delete p.rotate; + function histogram(data) { + var i, + n = data.length, + x, + values = new Array(n); - p.center = function(_) { - return arguments.length ? center(r(_)) : r.invert(center()); - }; + for (i = 0; i < n; ++i) { + values[i] = value(data[i], i, data); + } - return p - .clipAngle(90); -} + var xz = domain(values), + x0 = xz[0], + x1 = xz[1], + tz = threshold(values, x0, x1); -function twoPointAzimuthalRaw(d) { - var cosd = cos(d); + // Convert number of thresholds into uniform thresholds. + if (!Array.isArray(tz)) { + tz = tickStep(x0, x1, tz); + tz = range(Math.ceil(x0 / tz) * tz, x1, tz); // exclusive + } - function forward(lambda, phi) { - var coordinates = d3Geo.geoGnomonicRaw(lambda, phi); - coordinates[0] *= cosd; - return coordinates; + // Remove any thresholds outside the domain. + var m = tz.length; + while (tz[0] <= x0) tz.shift(), --m; + while (tz[m - 1] > x1) tz.pop(), --m; + + var bins = new Array(m + 1), + bin; + + // Initialize bins. + for (i = 0; i <= m; ++i) { + bin = bins[i] = []; + bin.x0 = i > 0 ? tz[i - 1] : x0; + bin.x1 = i < m ? tz[i] : x1; + } + + // Assign data to bins by value, ignoring any outside the domain. + for (i = 0; i < n; ++i) { + x = values[i]; + if (x0 <= x && x <= x1) { + bins[bisectRight(tz, x, 0, m)].push(data[i]); + } + } + + return bins; } - forward.invert = function(x, y) { - return d3Geo.geoGnomonicRaw.invert(x / cosd, y); + histogram.value = function(_) { + return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value; }; - return forward; + histogram.domain = function(_) { + return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain; + }; + + histogram.thresholds = function(_) { + return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold; + }; + + return histogram; } -function twoPointAzimuthalUsa() { - return twoPointAzimuthal([-158, 21.5], [-77, 39]) - .clipAngle(60) - .scale(400); +function quantile(values, p, valueof) { + if (valueof == null) valueof = number; + if (!(n = values.length)) return; + if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values); + if (p >= 1) return +valueof(values[n - 1], n - 1, values); + var n, + i = (n - 1) * p, + i0 = Math.floor(i), + value0 = +valueof(values[i0], i0, values), + value1 = +valueof(values[i0 + 1], i0 + 1, values); + return value0 + (value1 - value0) * (i - i0); } -function twoPointAzimuthal(p0, p1) { - return twoPoint(twoPointAzimuthalRaw, p0, p1); +function freedmanDiaconis(values, min, max) { + values = map.call(values, number).sort(ascending); + return Math.ceil((max - min) / (2 * (quantile(values, 0.75) - quantile(values, 0.25)) * Math.pow(values.length, -1 / 3))); } -// TODO clip to ellipse -function twoPointEquidistantRaw(z0) { - if (!(z0 *= 2)) return d3Geo.geoAzimuthalEquidistantRaw; - var lambdaa = -z0 / 2, - lambdab = -lambdaa, - z02 = z0 * z0, - tanLambda0 = tan(lambdab), - S = 0.5 / sin(lambdab); +function scott(values, min, max) { + return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3))); +} - function forward(lambda, phi) { - var za = acos(cos(phi) * cos(lambda - lambdaa)), - zb = acos(cos(phi) * cos(lambda - lambdab)), - ys = phi < 0 ? -1 : 1; - za *= za, zb *= zb; - return [ - (za - zb) / (2 * z0), - ys * sqrt(4 * z02 * zb - (z02 - za + zb) * (z02 - za + zb)) / (2 * z0) - ]; +function max(values, valueof) { + var n = values.length, + i = -1, + value, + max; + + if (valueof == null) { + while (++i < n) { // Find the first comparable value. + if ((value = values[i]) != null && value >= value) { + max = value; + while (++i < n) { // Compare the remaining values. + if ((value = values[i]) != null && value > max) { + max = value; + } + } + } + } } - forward.invert = function(x, y) { - var y2 = y * y, - cosza = cos(sqrt(y2 + (t = x + lambdaa) * t)), - coszb = cos(sqrt(y2 + (t = x + lambdab) * t)), - t, - d; - return [ - atan2(d = cosza - coszb, t = (cosza + coszb) * tanLambda0), - (y < 0 ? -1 : 1) * acos(sqrt(t * t + d * d) * S) - ]; - }; + else { + while (++i < n) { // Find the first comparable value. + if ((value = valueof(values[i], i, values)) != null && value >= value) { + max = value; + while (++i < n) { // Compare the remaining values. + if ((value = valueof(values[i], i, values)) != null && value > max) { + max = value; + } + } + } + } + } - return forward; + return max; } -function twoPointEquidistantUsa() { - return twoPointEquidistant([-158, 21.5], [-77, 39]) - .clipAngle(130) - .scale(122.571); -} +function mean(values, valueof) { + var n = values.length, + m = n, + i = -1, + value, + sum = 0; -function twoPointEquidistant(p0, p1) { - return twoPoint(twoPointEquidistantRaw, p0, p1); -} + if (valueof == null) { + while (++i < n) { + if (!isNaN(value = number(values[i]))) sum += value; + else --m; + } + } -function vanDerGrintenRaw(lambda, phi) { - if (abs(phi) < epsilon) return [lambda, 0]; - var sinTheta = abs(phi / halfPi), - theta = asin(sinTheta); - if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, sign(phi) * pi * tan(theta / 2)]; - var cosTheta = cos(theta), - A = abs(pi / lambda - lambda / pi) / 2, - A2 = A * A, - G = cosTheta / (sinTheta + cosTheta - 1), - P = G * (2 / sinTheta - 1), - P2 = P * P, - P2_A2 = P2 + A2, - G_P2 = G - P2, - Q = A2 + G; - return [ - sign(lambda) * pi * (A * G_P2 + sqrt(A2 * G_P2 * G_P2 - P2_A2 * (G * G - P2))) / P2_A2, - sign(phi) * pi * (P * Q - A * sqrt((A2 + 1) * P2_A2 - Q * Q)) / P2_A2 - ]; + else { + while (++i < n) { + if (!isNaN(value = number(valueof(values[i], i, values)))) sum += value; + else --m; + } + } + + if (m) return sum / m; } -vanDerGrintenRaw.invert = function(x, y) { - if (abs(y) < epsilon) return [x, 0]; - if (abs(x) < epsilon) return [0, halfPi * sin(2 * atan(y / pi))]; - var x2 = (x /= pi) * x, - y2 = (y /= pi) * y, - x2_y2 = x2 + y2, - z = x2_y2 * x2_y2, - c1 = -abs(y) * (1 + x2_y2), - c2 = c1 - 2 * y2 + x2, - c3 = -2 * c1 + 1 + 2 * y2 + z, - d = y2 / c3 + (2 * c2 * c2 * c2 / (c3 * c3 * c3) - 9 * c1 * c2 / (c3 * c3)) / 27, - a1 = (c1 - c2 * c2 / (3 * c3)) / c3, - m1 = 2 * sqrt(-a1 / 3), - theta1 = acos(3 * d / (a1 * m1)) / 3; - return [ - pi * (x2_y2 - 1 + sqrt(1 + 2 * (x2 - y2) + z)) / (2 * x), - sign(y) * pi * (-m1 * cos(theta1 + pi / 3) - c2 / (3 * c3)) - ]; -}; +function median(values, valueof) { + var n = values.length, + i = -1, + value, + numbers = []; -function vanDerGrinten() { - return d3Geo.geoProjection(vanDerGrintenRaw) - .scale(79.4183); + if (valueof == null) { + while (++i < n) { + if (!isNaN(value = number(values[i]))) { + numbers.push(value); + } + } + } + + else { + while (++i < n) { + if (!isNaN(value = number(valueof(values[i], i, values)))) { + numbers.push(value); + } + } + } + + return quantile(numbers.sort(ascending), 0.5); } -function vanDerGrinten2Raw(lambda, phi) { - if (abs(phi) < epsilon) return [lambda, 0]; - var sinTheta = abs(phi / halfPi), - theta = asin(sinTheta); - if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, sign(phi) * pi * tan(theta / 2)]; - var cosTheta = cos(theta), - A = abs(pi / lambda - lambda / pi) / 2, - A2 = A * A, - x1 = cosTheta * (sqrt(1 + A2) - A * cosTheta) / (1 + A2 * sinTheta * sinTheta); - return [ - sign(lambda) * pi * x1, - sign(phi) * pi * sqrt(1 - x1 * (2 * A + x1)) - ]; +function merge(arrays) { + var n = arrays.length, + m, + i = -1, + j = 0, + merged, + array; + + while (++i < n) j += arrays[i].length; + merged = new Array(j); + + while (--n >= 0) { + array = arrays[n]; + m = array.length; + while (--m >= 0) { + merged[--j] = array[m]; + } + } + + return merged; } -vanDerGrinten2Raw.invert = function(x, y) { - if (!x) return [0, halfPi * sin(2 * atan(y / pi))]; - var x1 = abs(x / pi), - A = (1 - x1 * x1 - (y /= pi) * y) / (2 * x1), - A2 = A * A, - B = sqrt(A2 + 1); - return [ - sign(x) * pi * (B - A), - sign(y) * halfPi * sin(2 * atan2(sqrt((1 - 2 * A * x1) * (A + B) - x1), sqrt(B + A + x1))) - ]; -}; +function min(values, valueof) { + var n = values.length, + i = -1, + value, + min; -function vanDerGrinten2() { - return d3Geo.geoProjection(vanDerGrinten2Raw) - .scale(79.4183); + if (valueof == null) { + while (++i < n) { // Find the first comparable value. + if ((value = values[i]) != null && value >= value) { + min = value; + while (++i < n) { // Compare the remaining values. + if ((value = values[i]) != null && min > value) { + min = value; + } + } + } + } + } + + else { + while (++i < n) { // Find the first comparable value. + if ((value = valueof(values[i], i, values)) != null && value >= value) { + min = value; + while (++i < n) { // Compare the remaining values. + if ((value = valueof(values[i], i, values)) != null && min > value) { + min = value; + } + } + } + } + } + + return min; } -function vanDerGrinten3Raw(lambda, phi) { - if (abs(phi) < epsilon) return [lambda, 0]; - var sinTheta = phi / halfPi, - theta = asin(sinTheta); - if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, pi * tan(theta / 2)]; - var A = (pi / lambda - lambda / pi) / 2, - y1 = sinTheta / (1 + cos(theta)); - return [ - pi * (sign(lambda) * sqrt(A * A + 1 - y1 * y1) - A), - pi * y1 - ]; +function permute(array, indexes) { + var i = indexes.length, permutes = new Array(i); + while (i--) permutes[i] = array[indexes[i]]; + return permutes; } -vanDerGrinten3Raw.invert = function(x, y) { - if (!y) return [x, 0]; - var y1 = y / pi, - A = (pi * pi * (1 - y1 * y1) - x * x) / (2 * pi * x); - return [ - x ? pi * (sign(x) * sqrt(A * A + 1) - A) : 0, - halfPi * sin(2 * atan(y1)) - ]; -}; +function scan(values, compare) { + if (!(n = values.length)) return; + var n, + i = 0, + j = 0, + xi, + xj = values[j]; -function vanDerGrinten3() { - return d3Geo.geoProjection(vanDerGrinten3Raw) - .scale(79.4183); + if (compare == null) compare = ascending; + + while (++i < n) { + if (compare(xi = values[i], xj) < 0 || compare(xj, xj) !== 0) { + xj = xi, j = i; + } + } + + if (compare(xj, xj) === 0) return j; } -function vanDerGrinten4Raw(lambda, phi) { - if (!phi) return [lambda, 0]; - var phi0 = abs(phi); - if (!lambda || phi0 === halfPi) return [0, phi]; - var B = phi0 / halfPi, - B2 = B * B, - C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)), - C2 = C * C, - BC = B * C, - B_C2 = B2 + C2 + 2 * BC, - B_3C = B + 3 * C, - lambda0 = lambda / halfPi, - lambda1 = lambda0 + 1 / lambda0, - D = sign(abs(lambda) - halfPi) * sqrt(lambda1 * lambda1 - 4), - D2 = D * D, - F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + 12 * BC * C2 + 4 * C2 * C2), - x1 = (D * (B_C2 + C2 - 1) + 2 * sqrt(F)) / (4 * B_C2 + D2); - return [ - sign(lambda) * halfPi * x1, - sign(phi) * halfPi * sqrt(1 + D * abs(x1) - x1 * x1) - ]; +function shuffle(array, i0, i1) { + var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0), + t, + i; + + while (m) { + i = Math.random() * m-- | 0; + t = array[m + i0]; + array[m + i0] = array[i + i0]; + array[i + i0] = t; + } + + return array; } -vanDerGrinten4Raw.invert = function(x, y) { - var delta; - if (!x || !y) return [x, y]; - y /= pi; - var x1 = sign(x) * x / halfPi, - D = (x1 * x1 - 1 + 4 * y * y) / abs(x1), - D2 = D * D, - B = 2 * y, - i = 50; - do { - var B2 = B * B, - C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)), - C_ = (3 * B - B2 * B - 10) / (2 * B2 * B), - C2 = C * C, - BC = B * C, - B_C = B + C, - B_C2 = B_C * B_C, - B_3C = B + 3 * C, - F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + C2 * (12 * BC + 4 * C2)), - F_ = -2 * B_C * (4 * BC * C2 + (1 - 4 * B2 + 3 * B2 * B2) * (1 + C_) + C2 * (-6 + 14 * B2 - D2 + (-8 + 8 * B2 - 2 * D2) * C_) + BC * (-8 + 12 * B2 + (-10 + 10 * B2 - D2) * C_)), - sqrtF = sqrt(F), - f = D * (B_C2 + C2 - 1) + 2 * sqrtF - x1 * (4 * B_C2 + D2), - f_ = D * (2 * C * C_ + 2 * B_C * (1 + C_)) + F_ / sqrtF - 8 * B_C * (D * (-1 + C2 + B_C2) + 2 * sqrtF) * (1 + C_) / (D2 + 4 * B_C2); - B -= delta = f / f_; - } while (delta > epsilon && --i > 0); - return [ - sign(x) * (sqrt(D * D + 4) + D) * pi / 4, - halfPi * B - ]; -}; +function sum(values, valueof) { + var n = values.length, + i = -1, + value, + sum = 0; -function vanDerGrinten4() { - return d3Geo.geoProjection(vanDerGrinten4Raw) - .scale(127.16); + if (valueof == null) { + while (++i < n) { + if (value = +values[i]) sum += value; // Note: zero and null are equivalent. + } + } + + else { + while (++i < n) { + if (value = +valueof(values[i], i, values)) sum += value; + } + } + + return sum; } -function wagnerFormula(cx, cy, m1, m2, n) { - function forward(lambda, phi) { - var s = m1 * sin(m2 * phi), - c0 = sqrt(1 - s * s), - c1 = sqrt(2 / (1 + c0 * cos(lambda *= n))); - return [ - cx * c0 * c1 * sin(lambda), - cy * s * c1 - ]; +function transpose(matrix) { + if (!(n = matrix.length)) return []; + for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) { + for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) { + row[j] = matrix[j][i]; + } } + return transpose; +} - forward.invert = function(x, y) { - var t1 = x / cx, - t2 = y / cy, - p = sqrt(t1 * t1 + t2 * t2), - c = 2 * asin(p / 2); - return [ - atan2(x * tan(c), cx * p) / n, - p && asin(y * sin(c) / (cy * m1 * p)) / m2 - ]; - }; +function length(d) { + return d.length; +} - return forward; +function zip() { + return transpose(arguments); } -function wagnerRaw(poleline, parallels, inflation, ratio) { - // 60 is always used as reference parallel - var phi1 = pi / 3; +exports.bisect = bisectRight; +exports.bisectRight = bisectRight; +exports.bisectLeft = bisectLeft; +exports.ascending = ascending; +exports.bisector = bisector; +exports.cross = cross; +exports.descending = descending; +exports.deviation = deviation; +exports.extent = extent; +exports.histogram = histogram; +exports.thresholdFreedmanDiaconis = freedmanDiaconis; +exports.thresholdScott = scott; +exports.thresholdSturges = sturges; +exports.max = max; +exports.mean = mean; +exports.median = median; +exports.merge = merge; +exports.min = min; +exports.pairs = pairs; +exports.permute = permute; +exports.quantile = quantile; +exports.range = range; +exports.scan = scan; +exports.shuffle = shuffle; +exports.sum = sum; +exports.ticks = ticks; +exports.tickIncrement = tickIncrement; +exports.tickStep = tickStep; +exports.transpose = transpose; +exports.variance = variance; +exports.zip = zip; - // sanitizing the input values - // poleline and parallels may approximate but never equal 0 - poleline = max(poleline, epsilon); - parallels = max(parallels, epsilon); - // poleline must be <= 90; parallels may approximate but never equal 180 - poleline = min(poleline, halfPi); - parallels = min(parallels, pi - epsilon); - // 0 <= inflation <= 99.999 - inflation = max(inflation, 0); - inflation = min(inflation, 100 - epsilon); - // ratio > 0. - // sensible values, i.e. something that renders a map which still can be - // recognized as world map, are e.g. 20 <= ratio <= 1000. - ratio = max(ratio, epsilon); +Object.defineProperty(exports, '__esModule', { value: true }); - // convert values from boehm notation - // areal inflation e.g. from 0 to 1 or 20 to 1.2: - var vinflation = inflation/100 + 1; - // axial ratio e.g. from 200 to 2: - var vratio = ratio / 100; - // the other ones are a bit more complicated... - var m2 = acos(vinflation * cos(phi1)) / phi1, - m1 = sin(poleline) / sin(m2 * halfPi), - n = parallels / pi, - k = sqrt(vratio * sin(poleline / 2) / sin(parallels / 2)), - cx = k / sqrt(n * m1 * m2), - cy = 1 / (k * sqrt(n * m1 * m2)); +}))); - return wagnerFormula(cx, cy, m1, m2, n); -} +},{}],135:[function(_dereq_,module,exports){ +// https://d3js.org/d3-collection/ v1.0.7 Copyright 2018 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(factory((global.d3 = global.d3 || {}))); +}(this, (function (exports) { 'use strict'; -function wagner() { - // default values generate wagner8 - var poleline = 65 * radians, - parallels = 60 * radians, - inflation = 20, - ratio = 200, - mutate = d3Geo.geoProjectionMutator(wagnerRaw), - projection = mutate(poleline, parallels, inflation, ratio); +var prefix = "$"; - projection.poleline = function(_) { - return arguments.length ? mutate(poleline = +_ * radians, parallels, inflation, ratio) : poleline * degrees; - }; +function Map() {} - projection.parallels = function(_) { - return arguments.length ? mutate(poleline, parallels = +_ * radians, inflation, ratio) : parallels * degrees; - }; - projection.inflation = function(_) { - return arguments.length ? mutate(poleline, parallels, inflation = +_, ratio) : inflation; - }; - projection.ratio = function(_) { - return arguments.length ? mutate(poleline, parallels, inflation, ratio = +_) : ratio; - }; +Map.prototype = map.prototype = { + constructor: Map, + has: function(key) { + return (prefix + key) in this; + }, + get: function(key) { + return this[prefix + key]; + }, + set: function(key, value) { + this[prefix + key] = value; + return this; + }, + remove: function(key) { + var property = prefix + key; + return property in this && delete this[property]; + }, + clear: function() { + for (var property in this) if (property[0] === prefix) delete this[property]; + }, + keys: function() { + var keys = []; + for (var property in this) if (property[0] === prefix) keys.push(property.slice(1)); + return keys; + }, + values: function() { + var values = []; + for (var property in this) if (property[0] === prefix) values.push(this[property]); + return values; + }, + entries: function() { + var entries = []; + for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]}); + return entries; + }, + size: function() { + var size = 0; + for (var property in this) if (property[0] === prefix) ++size; + return size; + }, + empty: function() { + for (var property in this) if (property[0] === prefix) return false; + return true; + }, + each: function(f) { + for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this); + } +}; - return projection - .scale(163.775); -} +function map(object, f) { + var map = new Map; -function wagner7() { - return wagner() - .poleline(65) - .parallels(60) - .inflation(0) - .ratio(200) - .scale(172.633); -} + // Copy constructor. + if (object instanceof Map) object.each(function(value, key) { map.set(key, value); }); -var A = 4 * pi + 3 * sqrt(3), - B = 2 * sqrt(2 * pi * sqrt(3) / A); + // Index array by numeric index or specified key function. + else if (Array.isArray(object)) { + var i = -1, + n = object.length, + o; -var wagner4Raw = mollweideBromleyRaw(B * sqrt(3) / pi, B, A / 6); + if (f == null) while (++i < n) map.set(i, object[i]); + else while (++i < n) map.set(f(o = object[i], i, object), o); + } -function wagner4() { - return d3Geo.geoProjection(wagner4Raw) - .scale(176.84); -} + // Convert object to map. + else if (object) for (var key in object) map.set(key, object[key]); -function wagner6Raw(lambda, phi) { - return [lambda * sqrt(1 - 3 * phi * phi / (pi * pi)), phi]; + return map; } -wagner6Raw.invert = function(x, y) { - return [x / sqrt(1 - 3 * y * y / (pi * pi)), y]; -}; +function nest() { + var keys = [], + sortKeys = [], + sortValues, + rollup, + nest; -function wagner6() { - return d3Geo.geoProjection(wagner6Raw) - .scale(152.63); + function apply(array, depth, createResult, setResult) { + if (depth >= keys.length) { + if (sortValues != null) array.sort(sortValues); + return rollup != null ? rollup(array) : array; + } + + var i = -1, + n = array.length, + key = keys[depth++], + keyValue, + value, + valuesByKey = map(), + values, + result = createResult(); + + while (++i < n) { + if (values = valuesByKey.get(keyValue = key(value = array[i]) + "")) { + values.push(value); + } else { + valuesByKey.set(keyValue, [value]); + } + } + + valuesByKey.each(function(values, key) { + setResult(result, key, apply(values, depth, createResult, setResult)); + }); + + return result; + } + + function entries(map$$1, depth) { + if (++depth > keys.length) return map$$1; + var array, sortKey = sortKeys[depth - 1]; + if (rollup != null && depth >= keys.length) array = map$$1.entries(); + else array = [], map$$1.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); }); + return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array; + } + + return nest = { + object: function(array) { return apply(array, 0, createObject, setObject); }, + map: function(array) { return apply(array, 0, createMap, setMap); }, + entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); }, + key: function(d) { keys.push(d); return nest; }, + sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; }, + sortValues: function(order) { sortValues = order; return nest; }, + rollup: function(f) { rollup = f; return nest; } + }; } -function wiechelRaw(lambda, phi) { - var cosPhi = cos(phi), - sinPhi = cos(lambda) * cosPhi, - sin1_Phi = 1 - sinPhi, - cosLambda = cos(lambda = atan2(sin(lambda) * cosPhi, -sin(phi))), - sinLambda = sin(lambda); - cosPhi = sqrt(1 - sinPhi * sinPhi); - return [ - sinLambda * cosPhi - cosLambda * sin1_Phi, - -cosLambda * cosPhi - sinLambda * sin1_Phi - ]; +function createObject() { + return {}; } -wiechelRaw.invert = function(x, y) { - var w = (x * x + y * y) / -2, - k = sqrt(-w * (2 + w)), - b = y * w + x * k, - a = x * w - y * k, - D = sqrt(a * a + b * b); - return [ - atan2(k * b, D * (1 + w)), - D ? -asin(k * a / D) : 0 - ]; -}; +function setObject(object, key, value) { + object[key] = value; +} -function wiechel() { - return d3Geo.geoProjection(wiechelRaw) - .rotate([0, -90, 45]) - .scale(124.75) - .clipAngle(180 - 1e-3); +function createMap() { + return map(); } -function winkel3Raw(lambda, phi) { - var coordinates = aitoffRaw(lambda, phi); - return [ - (coordinates[0] + lambda / halfPi) / 2, - (coordinates[1] + phi) / 2 - ]; +function setMap(map$$1, key, value) { + map$$1.set(key, value); } -winkel3Raw.invert = function(x, y) { - var lambda = x, phi = y, i = 25; - do { - var cosphi = cos(phi), - sinphi = sin(phi), - sin_2phi = sin(2 * phi), - sin2phi = sinphi * sinphi, - cos2phi = cosphi * cosphi, - sinlambda = sin(lambda), - coslambda_2 = cos(lambda / 2), - sinlambda_2 = sin(lambda / 2), - sin2lambda_2 = sinlambda_2 * sinlambda_2, - C = 1 - cos2phi * coslambda_2 * coslambda_2, - E = C ? acos(cosphi * coslambda_2) * sqrt(F = 1 / C) : F = 0, - F, - fx = 0.5 * (2 * E * cosphi * sinlambda_2 + lambda / halfPi) - x, - fy = 0.5 * (E * sinphi + phi) - y, - dxdlambda = 0.5 * F * (cos2phi * sin2lambda_2 + E * cosphi * coslambda_2 * sin2phi) + 0.5 / halfPi, - dxdphi = F * (sinlambda * sin_2phi / 4 - E * sinphi * sinlambda_2), - dydlambda = 0.125 * F * (sin_2phi * sinlambda_2 - E * sinphi * cos2phi * sinlambda), - dydphi = 0.5 * F * (sin2phi * coslambda_2 + E * sin2lambda_2 * cosphi) + 0.5, - denominator = dxdphi * dydlambda - dydphi * dxdlambda, - dlambda = (fy * dxdphi - fx * dydphi) / denominator, - dphi = (fx * dydlambda - fy * dxdlambda) / denominator; - lambda -= dlambda, phi -= dphi; - } while ((abs(dlambda) > epsilon || abs(dphi) > epsilon) && --i > 0); - return [lambda, phi]; -}; - -function winkel3() { - return d3Geo.geoProjection(winkel3Raw) - .scale(158.837); -} +function Set() {} -exports.geoNaturalEarth = d3Geo.geoNaturalEarth1; -exports.geoNaturalEarthRaw = d3Geo.geoNaturalEarth1Raw; -exports.geoAiry = airy; -exports.geoAiryRaw = airyRaw; -exports.geoAitoff = aitoff; -exports.geoAitoffRaw = aitoffRaw; -exports.geoArmadillo = armadillo; -exports.geoArmadilloRaw = armadilloRaw; -exports.geoAugust = august; -exports.geoAugustRaw = augustRaw; -exports.geoBaker = baker; -exports.geoBakerRaw = bakerRaw; -exports.geoBerghaus = berghaus; -exports.geoBerghausRaw = berghausRaw; -exports.geoBertin1953 = bertin; -exports.geoBertin1953Raw = bertin1953Raw; -exports.geoBoggs = boggs; -exports.geoBoggsRaw = boggsRaw; -exports.geoBonne = bonne; -exports.geoBonneRaw = bonneRaw; -exports.geoBottomley = bottomley; -exports.geoBottomleyRaw = bottomleyRaw; -exports.geoBromley = bromley; -exports.geoBromleyRaw = bromleyRaw; -exports.geoChamberlin = chamberlin; -exports.geoChamberlinRaw = chamberlinRaw; -exports.geoChamberlinAfrica = chamberlinAfrica; -exports.geoCollignon = collignon; -exports.geoCollignonRaw = collignonRaw; -exports.geoCraig = craig; -exports.geoCraigRaw = craigRaw; -exports.geoCraster = craster; -exports.geoCrasterRaw = crasterRaw; -exports.geoCylindricalEqualArea = cylindricalEqualArea; -exports.geoCylindricalEqualAreaRaw = cylindricalEqualAreaRaw; -exports.geoCylindricalStereographic = cylindricalStereographic; -exports.geoCylindricalStereographicRaw = cylindricalStereographicRaw; -exports.geoEckert1 = eckert1; -exports.geoEckert1Raw = eckert1Raw; -exports.geoEckert2 = eckert2; -exports.geoEckert2Raw = eckert2Raw; -exports.geoEckert3 = eckert3; -exports.geoEckert3Raw = eckert3Raw; -exports.geoEckert4 = eckert4; -exports.geoEckert4Raw = eckert4Raw; -exports.geoEckert5 = eckert5; -exports.geoEckert5Raw = eckert5Raw; -exports.geoEckert6 = eckert6; -exports.geoEckert6Raw = eckert6Raw; -exports.geoEisenlohr = eisenlohr; -exports.geoEisenlohrRaw = eisenlohrRaw; -exports.geoFahey = fahey; -exports.geoFaheyRaw = faheyRaw; -exports.geoFoucaut = foucaut; -exports.geoFoucautRaw = foucautRaw; -exports.geoFoucautSinusoidal = foucautSinusoidal; -exports.geoFoucautSinusoidalRaw = foucautSinusoidalRaw; -exports.geoGilbert = gilbert; -exports.geoGingery = gingery; -exports.geoGingeryRaw = gingeryRaw; -exports.geoGinzburg4 = ginzburg4; -exports.geoGinzburg4Raw = ginzburg4Raw; -exports.geoGinzburg5 = ginzburg5; -exports.geoGinzburg5Raw = ginzburg5Raw; -exports.geoGinzburg6 = ginzburg6; -exports.geoGinzburg6Raw = ginzburg6Raw; -exports.geoGinzburg8 = ginzburg8; -exports.geoGinzburg8Raw = ginzburg8Raw; -exports.geoGinzburg9 = ginzburg9; -exports.geoGinzburg9Raw = ginzburg9Raw; -exports.geoGringorten = gringorten; -exports.geoGringortenRaw = gringortenRaw; -exports.geoGuyou = guyou; -exports.geoGuyouRaw = guyouRaw; -exports.geoHammer = hammer; -exports.geoHammerRaw = hammerRaw; -exports.geoHammerRetroazimuthal = hammerRetroazimuthal; -exports.geoHammerRetroazimuthalRaw = hammerRetroazimuthalRaw; -exports.geoHealpix = healpix; -exports.geoHealpixRaw = healpixRaw; -exports.geoHill = hill; -exports.geoHillRaw = hillRaw; -exports.geoHomolosine = homolosine; -exports.geoHomolosineRaw = homolosineRaw; -exports.geoHufnagel = hufnagel; -exports.geoHufnagelRaw = hufnagelRaw; -exports.geoHyperelliptical = hyperelliptical; -exports.geoHyperellipticalRaw = hyperellipticalRaw; -exports.geoInterrupt = interrupt; -exports.geoInterruptedBoggs = boggs$1; -exports.geoInterruptedHomolosine = homolosine$1; -exports.geoInterruptedMollweide = mollweide$1; -exports.geoInterruptedMollweideHemispheres = mollweideHemispheres; -exports.geoInterruptedSinuMollweide = sinuMollweide$1; -exports.geoInterruptedSinusoidal = sinusoidal$1; -exports.geoKavrayskiy7 = kavrayskiy7; -exports.geoKavrayskiy7Raw = kavrayskiy7Raw; -exports.geoLagrange = lagrange; -exports.geoLagrangeRaw = lagrangeRaw; -exports.geoLarrivee = larrivee; -exports.geoLarriveeRaw = larriveeRaw; -exports.geoLaskowski = laskowski; -exports.geoLaskowskiRaw = laskowskiRaw; -exports.geoLittrow = littrow; -exports.geoLittrowRaw = littrowRaw; -exports.geoLoximuthal = loximuthal; -exports.geoLoximuthalRaw = loximuthalRaw; -exports.geoMiller = miller; -exports.geoMillerRaw = millerRaw; -exports.geoModifiedStereographic = modifiedStereographic; -exports.geoModifiedStereographicRaw = modifiedStereographicRaw; -exports.geoModifiedStereographicAlaska = modifiedStereographicAlaska; -exports.geoModifiedStereographicGs48 = modifiedStereographicGs48; -exports.geoModifiedStereographicGs50 = modifiedStereographicGs50; -exports.geoModifiedStereographicMiller = modifiedStereographicMiller; -exports.geoModifiedStereographicLee = modifiedStereographicLee; -exports.geoMollweide = mollweide; -exports.geoMollweideRaw = mollweideRaw; -exports.geoMtFlatPolarParabolic = mtFlatPolarParabolic; -exports.geoMtFlatPolarParabolicRaw = mtFlatPolarParabolicRaw; -exports.geoMtFlatPolarQuartic = mtFlatPolarQuartic; -exports.geoMtFlatPolarQuarticRaw = mtFlatPolarQuarticRaw; -exports.geoMtFlatPolarSinusoidal = mtFlatPolarSinusoidal; -exports.geoMtFlatPolarSinusoidalRaw = mtFlatPolarSinusoidalRaw; -exports.geoNaturalEarth2 = naturalEarth2; -exports.geoNaturalEarth2Raw = naturalEarth2Raw; -exports.geoNellHammer = nellHammer; -exports.geoNellHammerRaw = nellHammerRaw; -exports.geoInterruptedQuarticAuthalic = quarticAuthalic; -exports.geoNicolosi = nicolosi; -exports.geoNicolosiRaw = nicolosiRaw; -exports.geoPatterson = patterson; -exports.geoPattersonRaw = pattersonRaw; -exports.geoPolyconic = polyconic; -exports.geoPolyconicRaw = polyconicRaw; -exports.geoPolyhedral = polyhedral; -exports.geoPolyhedralButterfly = butterfly; -exports.geoPolyhedralCollignon = collignon$1; -exports.geoPolyhedralWaterman = waterman; -exports.geoProject = index; -exports.geoGringortenQuincuncial = gringorten$1; -exports.geoPeirceQuincuncial = peirce; -exports.geoPierceQuincuncial = peirce; -exports.geoQuantize = quantize; -exports.geoQuincuncial = quincuncial; -exports.geoRectangularPolyconic = rectangularPolyconic; -exports.geoRectangularPolyconicRaw = rectangularPolyconicRaw; -exports.geoRobinson = robinson; -exports.geoRobinsonRaw = robinsonRaw; -exports.geoSatellite = satellite; -exports.geoSatelliteRaw = satelliteRaw; -exports.geoSinuMollweide = sinuMollweide; -exports.geoSinuMollweideRaw = sinuMollweideRaw; -exports.geoSinusoidal = sinusoidal; -exports.geoSinusoidalRaw = sinusoidalRaw; -exports.geoStitch = stitch; -exports.geoTimes = times; -exports.geoTimesRaw = timesRaw; -exports.geoTwoPointAzimuthal = twoPointAzimuthal; -exports.geoTwoPointAzimuthalRaw = twoPointAzimuthalRaw; -exports.geoTwoPointAzimuthalUsa = twoPointAzimuthalUsa; -exports.geoTwoPointEquidistant = twoPointEquidistant; -exports.geoTwoPointEquidistantRaw = twoPointEquidistantRaw; -exports.geoTwoPointEquidistantUsa = twoPointEquidistantUsa; -exports.geoVanDerGrinten = vanDerGrinten; -exports.geoVanDerGrintenRaw = vanDerGrintenRaw; -exports.geoVanDerGrinten2 = vanDerGrinten2; -exports.geoVanDerGrinten2Raw = vanDerGrinten2Raw; -exports.geoVanDerGrinten3 = vanDerGrinten3; -exports.geoVanDerGrinten3Raw = vanDerGrinten3Raw; -exports.geoVanDerGrinten4 = vanDerGrinten4; -exports.geoVanDerGrinten4Raw = vanDerGrinten4Raw; -exports.geoWagner = wagner; -exports.geoWagner7 = wagner7; -exports.geoWagnerRaw = wagnerRaw; -exports.geoWagner4 = wagner4; -exports.geoWagner4Raw = wagner4Raw; -exports.geoWagner6 = wagner6; -exports.geoWagner6Raw = wagner6Raw; -exports.geoWiechel = wiechel; -exports.geoWiechelRaw = wiechelRaw; -exports.geoWinkel3 = winkel3; -exports.geoWinkel3Raw = winkel3Raw; +var proto = map.prototype; -Object.defineProperty(exports, '__esModule', { value: true }); +Set.prototype = set.prototype = { + constructor: Set, + has: proto.has, + add: function(value) { + value += ""; + this[prefix + value] = value; + return this; + }, + remove: proto.remove, + clear: proto.clear, + values: proto.keys, + size: proto.size, + empty: proto.empty, + each: proto.each +}; -}))); +function set(object, f) { + var set = new Set; -},{"d3-array":63,"d3-geo":70}],70:[function(_dereq_,module,exports){ -// https://d3js.org/d3-geo/ v1.12.1 Copyright 2020 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-array')) : -typeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); -}(this, (function (exports, d3Array) { 'use strict'; + // Copy constructor. + if (object instanceof Set) object.each(function(value) { set.add(value); }); -// Adds floating point numbers with twice the normal precision. -// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and -// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3) -// 305–363 (1997). -// Code adapted from GeographicLib by Charles F. F. Karney, -// http://geographiclib.sourceforge.net/ + // Otherwise, assume it’s an array. + else if (object) { + var i = -1, n = object.length; + if (f == null) while (++i < n) set.add(object[i]); + else while (++i < n) set.add(f(object[i], i, object)); + } -function adder() { - return new Adder; + return set; } -function Adder() { - this.reset(); +function keys(map) { + var keys = []; + for (var key in map) keys.push(key); + return keys; } -Adder.prototype = { - constructor: Adder, - reset: function() { - this.s = // rounded value - this.t = 0; // exact error - }, - add: function(y) { - add(temp, y, this.t); - add(this, temp.s, this.s); - if (this.s) this.t += temp.t; - else this.s = temp.t; - }, - valueOf: function() { - return this.s; - } -}; - -var temp = new Adder; +function values(map) { + var values = []; + for (var key in map) values.push(map[key]); + return values; +} -function add(adder, a, b) { - var x = adder.s = a + b, - bv = x - a, - av = x - bv; - adder.t = (a - av) + (b - bv); +function entries(map) { + var entries = []; + for (var key in map) entries.push({key: key, value: map[key]}); + return entries; } -var epsilon = 1e-6; -var epsilon2 = 1e-12; -var pi = Math.PI; -var halfPi = pi / 2; -var quarterPi = pi / 4; -var tau = pi * 2; +exports.nest = nest; +exports.set = set; +exports.map = map; +exports.keys = keys; +exports.values = values; +exports.entries = entries; -var degrees = 180 / pi; -var radians = pi / 180; +Object.defineProperty(exports, '__esModule', { value: true }); -var abs = Math.abs; -var atan = Math.atan; -var atan2 = Math.atan2; -var cos = Math.cos; -var ceil = Math.ceil; -var exp = Math.exp; -var log = Math.log; -var pow = Math.pow; -var sin = Math.sin; -var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }; -var sqrt = Math.sqrt; -var tan = Math.tan; +}))); -function acos(x) { - return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); -} +},{}],136:[function(_dereq_,module,exports){ +// https://d3js.org/d3-color/ v1.4.1 Copyright 2020 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; -function asin(x) { - return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x); +function define(constructor, factory, prototype) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; } -function haversin(x) { - return (x = sin(x / 2)) * x; +function extend(parent, definition) { + var prototype = Object.create(parent.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; } -function noop() {} +function Color() {} -function streamGeometry(geometry, stream) { - if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) { - streamGeometryType[geometry.type](geometry, stream); - } -} +var darker = 0.7; +var brighter = 1 / darker; -var streamObjectType = { - Feature: function(object, stream) { - streamGeometry(object.geometry, stream); - }, - FeatureCollection: function(object, stream) { - var features = object.features, i = -1, n = features.length; - while (++i < n) streamGeometry(features[i].geometry, stream); - } +var reI = "\\s*([+-]?\\d+)\\s*", + reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", + reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", + reHex = /^#([0-9a-f]{3,8})$/, + reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), + reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), + reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), + reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), + reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), + reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); + +var named = { + aliceblue: 0xf0f8ff, + antiquewhite: 0xfaebd7, + aqua: 0x00ffff, + aquamarine: 0x7fffd4, + azure: 0xf0ffff, + beige: 0xf5f5dc, + bisque: 0xffe4c4, + black: 0x000000, + blanchedalmond: 0xffebcd, + blue: 0x0000ff, + blueviolet: 0x8a2be2, + brown: 0xa52a2a, + burlywood: 0xdeb887, + cadetblue: 0x5f9ea0, + chartreuse: 0x7fff00, + chocolate: 0xd2691e, + coral: 0xff7f50, + cornflowerblue: 0x6495ed, + cornsilk: 0xfff8dc, + crimson: 0xdc143c, + cyan: 0x00ffff, + darkblue: 0x00008b, + darkcyan: 0x008b8b, + darkgoldenrod: 0xb8860b, + darkgray: 0xa9a9a9, + darkgreen: 0x006400, + darkgrey: 0xa9a9a9, + darkkhaki: 0xbdb76b, + darkmagenta: 0x8b008b, + darkolivegreen: 0x556b2f, + darkorange: 0xff8c00, + darkorchid: 0x9932cc, + darkred: 0x8b0000, + darksalmon: 0xe9967a, + darkseagreen: 0x8fbc8f, + darkslateblue: 0x483d8b, + darkslategray: 0x2f4f4f, + darkslategrey: 0x2f4f4f, + darkturquoise: 0x00ced1, + darkviolet: 0x9400d3, + deeppink: 0xff1493, + deepskyblue: 0x00bfff, + dimgray: 0x696969, + dimgrey: 0x696969, + dodgerblue: 0x1e90ff, + firebrick: 0xb22222, + floralwhite: 0xfffaf0, + forestgreen: 0x228b22, + fuchsia: 0xff00ff, + gainsboro: 0xdcdcdc, + ghostwhite: 0xf8f8ff, + gold: 0xffd700, + goldenrod: 0xdaa520, + gray: 0x808080, + green: 0x008000, + greenyellow: 0xadff2f, + grey: 0x808080, + honeydew: 0xf0fff0, + hotpink: 0xff69b4, + indianred: 0xcd5c5c, + indigo: 0x4b0082, + ivory: 0xfffff0, + khaki: 0xf0e68c, + lavender: 0xe6e6fa, + lavenderblush: 0xfff0f5, + lawngreen: 0x7cfc00, + lemonchiffon: 0xfffacd, + lightblue: 0xadd8e6, + lightcoral: 0xf08080, + lightcyan: 0xe0ffff, + lightgoldenrodyellow: 0xfafad2, + lightgray: 0xd3d3d3, + lightgreen: 0x90ee90, + lightgrey: 0xd3d3d3, + lightpink: 0xffb6c1, + lightsalmon: 0xffa07a, + lightseagreen: 0x20b2aa, + lightskyblue: 0x87cefa, + lightslategray: 0x778899, + lightslategrey: 0x778899, + lightsteelblue: 0xb0c4de, + lightyellow: 0xffffe0, + lime: 0x00ff00, + limegreen: 0x32cd32, + linen: 0xfaf0e6, + magenta: 0xff00ff, + maroon: 0x800000, + mediumaquamarine: 0x66cdaa, + mediumblue: 0x0000cd, + mediumorchid: 0xba55d3, + mediumpurple: 0x9370db, + mediumseagreen: 0x3cb371, + mediumslateblue: 0x7b68ee, + mediumspringgreen: 0x00fa9a, + mediumturquoise: 0x48d1cc, + mediumvioletred: 0xc71585, + midnightblue: 0x191970, + mintcream: 0xf5fffa, + mistyrose: 0xffe4e1, + moccasin: 0xffe4b5, + navajowhite: 0xffdead, + navy: 0x000080, + oldlace: 0xfdf5e6, + olive: 0x808000, + olivedrab: 0x6b8e23, + orange: 0xffa500, + orangered: 0xff4500, + orchid: 0xda70d6, + palegoldenrod: 0xeee8aa, + palegreen: 0x98fb98, + paleturquoise: 0xafeeee, + palevioletred: 0xdb7093, + papayawhip: 0xffefd5, + peachpuff: 0xffdab9, + peru: 0xcd853f, + pink: 0xffc0cb, + plum: 0xdda0dd, + powderblue: 0xb0e0e6, + purple: 0x800080, + rebeccapurple: 0x663399, + red: 0xff0000, + rosybrown: 0xbc8f8f, + royalblue: 0x4169e1, + saddlebrown: 0x8b4513, + salmon: 0xfa8072, + sandybrown: 0xf4a460, + seagreen: 0x2e8b57, + seashell: 0xfff5ee, + sienna: 0xa0522d, + silver: 0xc0c0c0, + skyblue: 0x87ceeb, + slateblue: 0x6a5acd, + slategray: 0x708090, + slategrey: 0x708090, + snow: 0xfffafa, + springgreen: 0x00ff7f, + steelblue: 0x4682b4, + tan: 0xd2b48c, + teal: 0x008080, + thistle: 0xd8bfd8, + tomato: 0xff6347, + turquoise: 0x40e0d0, + violet: 0xee82ee, + wheat: 0xf5deb3, + white: 0xffffff, + whitesmoke: 0xf5f5f5, + yellow: 0xffff00, + yellowgreen: 0x9acd32 }; -var streamGeometryType = { - Sphere: function(object, stream) { - stream.sphere(); - }, - Point: function(object, stream) { - object = object.coordinates; - stream.point(object[0], object[1], object[2]); - }, - MultiPoint: function(object, stream) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]); - }, - LineString: function(object, stream) { - streamLine(object.coordinates, stream, 0); - }, - MultiLineString: function(object, stream) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) streamLine(coordinates[i], stream, 0); - }, - Polygon: function(object, stream) { - streamPolygon(object.coordinates, stream); +define(Color, color, { + copy: function(channels) { + return Object.assign(new this.constructor, this, channels); }, - MultiPolygon: function(object, stream) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) streamPolygon(coordinates[i], stream); + displayable: function() { + return this.rgb().displayable(); }, - GeometryCollection: function(object, stream) { - var geometries = object.geometries, i = -1, n = geometries.length; - while (++i < n) streamGeometry(geometries[i], stream); - } -}; + hex: color_formatHex, // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb +}); -function streamLine(coordinates, stream, closed) { - var i = -1, n = coordinates.length - closed, coordinate; - stream.lineStart(); - while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]); - stream.lineEnd(); +function color_formatHex() { + return this.rgb().formatHex(); } -function streamPolygon(coordinates, stream) { - var i = -1, n = coordinates.length; - stream.polygonStart(); - while (++i < n) streamLine(coordinates[i], stream, 1); - stream.polygonEnd(); +function color_formatHsl() { + return hslConvert(this).formatHsl(); } -function geoStream(object, stream) { - if (object && streamObjectType.hasOwnProperty(object.type)) { - streamObjectType[object.type](object, stream); - } else { - streamGeometry(object, stream); - } +function color_formatRgb() { + return this.rgb().formatRgb(); } -var areaRingSum = adder(); - -var areaSum = adder(), - lambda00, - phi00, - lambda0, - cosPhi0, - sinPhi0; - -var areaStream = { - point: noop, - lineStart: noop, - lineEnd: noop, - polygonStart: function() { - areaRingSum.reset(); - areaStream.lineStart = areaRingStart; - areaStream.lineEnd = areaRingEnd; - }, - polygonEnd: function() { - var areaRing = +areaRingSum; - areaSum.add(areaRing < 0 ? tau + areaRing : areaRing); - this.lineStart = this.lineEnd = this.point = noop; - }, - sphere: function() { - areaSum.add(tau); - } -}; - -function areaRingStart() { - areaStream.point = areaPointFirst; +function color(format) { + var m, l; + format = (format + "").trim().toLowerCase(); + return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 + : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 + : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 + : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 + : null) // invalid hex + : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) + : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) + : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) + : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) + : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) + : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) + : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins + : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) + : null; } -function areaRingEnd() { - areaPoint(lambda00, phi00); +function rgbn(n) { + return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); } -function areaPointFirst(lambda, phi) { - areaStream.point = areaPoint; - lambda00 = lambda, phi00 = phi; - lambda *= radians, phi *= radians; - lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi); +function rgba(r, g, b, a) { + if (a <= 0) r = g = b = NaN; + return new Rgb(r, g, b, a); } -function areaPoint(lambda, phi) { - lambda *= radians, phi *= radians; - phi = phi / 2 + quarterPi; // half the angular distance from south pole - - // Spherical excess E for a spherical triangle with vertices: south pole, - // previous point, current point. Uses a formula derived from Cagnoli’s - // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2). - var dLambda = lambda - lambda0, - sdLambda = dLambda >= 0 ? 1 : -1, - adLambda = sdLambda * dLambda, - cosPhi = cos(phi), - sinPhi = sin(phi), - k = sinPhi0 * sinPhi, - u = cosPhi0 * cosPhi + k * cos(adLambda), - v = k * sdLambda * sin(adLambda); - areaRingSum.add(atan2(v, u)); - - // Advance the previous points. - lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi; +function rgbConvert(o) { + if (!(o instanceof Color)) o = color(o); + if (!o) return new Rgb; + o = o.rgb(); + return new Rgb(o.r, o.g, o.b, o.opacity); } -function area(object) { - areaSum.reset(); - geoStream(object, areaStream); - return areaSum * 2; +function rgb(r, g, b, opacity) { + return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); } -function spherical(cartesian) { - return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])]; +function Rgb(r, g, b, opacity) { + this.r = +r; + this.g = +g; + this.b = +b; + this.opacity = +opacity; } -function cartesian(spherical) { - var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi); - return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)]; +define(Rgb, rgb, extend(Color, { + brighter: function(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + darker: function(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + rgb: function() { + return this; + }, + displayable: function() { + return (-0.5 <= this.r && this.r < 255.5) + && (-0.5 <= this.g && this.g < 255.5) + && (-0.5 <= this.b && this.b < 255.5) + && (0 <= this.opacity && this.opacity <= 1); + }, + hex: rgb_formatHex, // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb +})); + +function rgb_formatHex() { + return "#" + hex(this.r) + hex(this.g) + hex(this.b); } -function cartesianDot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +function rgb_formatRgb() { + var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return (a === 1 ? "rgb(" : "rgba(") + + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + + (a === 1 ? ")" : ", " + a + ")"); } -function cartesianCross(a, b) { - return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; +function hex(value) { + value = Math.max(0, Math.min(255, Math.round(value) || 0)); + return (value < 16 ? "0" : "") + value.toString(16); } -// TODO return a -function cartesianAddInPlace(a, b) { - a[0] += b[0], a[1] += b[1], a[2] += b[2]; +function hsla(h, s, l, a) { + if (a <= 0) h = s = l = NaN; + else if (l <= 0 || l >= 1) h = s = NaN; + else if (s <= 0) h = NaN; + return new Hsl(h, s, l, a); } -function cartesianScale(vector, k) { - return [vector[0] * k, vector[1] * k, vector[2] * k]; +function hslConvert(o) { + if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Color)) o = color(o); + if (!o) return new Hsl; + if (o instanceof Hsl) return o; + o = o.rgb(); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + min = Math.min(r, g, b), + max = Math.max(r, g, b), + h = NaN, + s = max - min, + l = (max + min) / 2; + if (s) { + if (r === max) h = (g - b) / s + (g < b) * 6; + else if (g === max) h = (b - r) / s + 2; + else h = (r - g) / s + 4; + s /= l < 0.5 ? max + min : 2 - max - min; + h *= 60; + } else { + s = l > 0 && l < 1 ? 0 : h; + } + return new Hsl(h, s, l, o.opacity); } -// TODO return d -function cartesianNormalizeInPlace(d) { - var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); - d[0] /= l, d[1] /= l, d[2] /= l; +function hsl(h, s, l, opacity) { + return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); } -var lambda0$1, phi0, lambda1, phi1, // bounds - lambda2, // previous lambda-coordinate - lambda00$1, phi00$1, // first point - p0, // previous 3D point - deltaSum = adder(), - ranges, - range; +function Hsl(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} -var boundsStream = { - point: boundsPoint, - lineStart: boundsLineStart, - lineEnd: boundsLineEnd, - polygonStart: function() { - boundsStream.point = boundsRingPoint; - boundsStream.lineStart = boundsRingStart; - boundsStream.lineEnd = boundsRingEnd; - deltaSum.reset(); - areaStream.polygonStart(); +define(Hsl, hsl, extend(Color, { + brighter: function(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); }, - polygonEnd: function() { - areaStream.polygonEnd(); - boundsStream.point = boundsPoint; - boundsStream.lineStart = boundsLineStart; - boundsStream.lineEnd = boundsLineEnd; - if (areaRingSum < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90); - else if (deltaSum > epsilon) phi1 = 90; - else if (deltaSum < -epsilon) phi0 = -90; - range[0] = lambda0$1, range[1] = lambda1; + darker: function(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); }, - sphere: function() { - lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90); + rgb: function() { + var h = this.h % 360 + (this.h < 0) * 360, + s = isNaN(h) || isNaN(this.s) ? 0 : this.s, + l = this.l, + m2 = l + (l < 0.5 ? l : 1 - l) * s, + m1 = 2 * l - m2; + return new Rgb( + hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), + hsl2rgb(h, m1, m2), + hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), + this.opacity + ); + }, + displayable: function() { + return (0 <= this.s && this.s <= 1 || isNaN(this.s)) + && (0 <= this.l && this.l <= 1) + && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl: function() { + var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return (a === 1 ? "hsl(" : "hsla(") + + (this.h || 0) + ", " + + (this.s || 0) * 100 + "%, " + + (this.l || 0) * 100 + "%" + + (a === 1 ? ")" : ", " + a + ")"); } -}; +})); -function boundsPoint(lambda, phi) { - ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]); - if (phi < phi0) phi0 = phi; - if (phi > phi1) phi1 = phi; +/* From FvD 13.37, CSS Color Module Level 3 */ +function hsl2rgb(h, m1, m2) { + return (h < 60 ? m1 + (m2 - m1) * h / 60 + : h < 180 ? m2 + : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 + : m1) * 255; } -function linePoint(lambda, phi) { - var p = cartesian([lambda * radians, phi * radians]); - if (p0) { - var normal = cartesianCross(p0, p), - equatorial = [normal[1], -normal[0], 0], - inflection = cartesianCross(equatorial, normal); - cartesianNormalizeInPlace(inflection); - inflection = spherical(inflection); - var delta = lambda - lambda2, - sign = delta > 0 ? 1 : -1, - lambdai = inflection[0] * degrees * sign, - phii, - antimeridian = abs(delta) > 180; - if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) { - phii = inflection[1] * degrees; - if (phii > phi1) phi1 = phii; - } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) { - phii = -inflection[1] * degrees; - if (phii < phi0) phi0 = phii; - } else { - if (phi < phi0) phi0 = phi; - if (phi > phi1) phi1 = phi; - } - if (antimeridian) { - if (lambda < lambda2) { - if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda; - } else { - if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda; - } - } else { - if (lambda1 >= lambda0$1) { - if (lambda < lambda0$1) lambda0$1 = lambda; - if (lambda > lambda1) lambda1 = lambda; - } else { - if (lambda > lambda2) { - if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda; - } else { - if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda; - } - } - } - } else { - ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]); +var deg2rad = Math.PI / 180; +var rad2deg = 180 / Math.PI; + +// https://observablehq.com/@mbostock/lab-and-rgb +var K = 18, + Xn = 0.96422, + Yn = 1, + Zn = 0.82521, + t0 = 4 / 29, + t1 = 6 / 29, + t2 = 3 * t1 * t1, + t3 = t1 * t1 * t1; + +function labConvert(o) { + if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); + if (o instanceof Hcl) return hcl2lab(o); + if (!(o instanceof Rgb)) o = rgbConvert(o); + var r = rgb2lrgb(o.r), + g = rgb2lrgb(o.g), + b = rgb2lrgb(o.b), + y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; + if (r === g && g === b) x = z = y; else { + x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); + z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); } - if (phi < phi0) phi0 = phi; - if (phi > phi1) phi1 = phi; - p0 = p, lambda2 = lambda; + return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); } -function boundsLineStart() { - boundsStream.point = linePoint; +function gray(l, opacity) { + return new Lab(l, 0, 0, opacity == null ? 1 : opacity); } -function boundsLineEnd() { - range[0] = lambda0$1, range[1] = lambda1; - boundsStream.point = boundsPoint; - p0 = null; +function lab(l, a, b, opacity) { + return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); } -function boundsRingPoint(lambda, phi) { - if (p0) { - var delta = lambda - lambda2; - deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta); - } else { - lambda00$1 = lambda, phi00$1 = phi; +function Lab(l, a, b, opacity) { + this.l = +l; + this.a = +a; + this.b = +b; + this.opacity = +opacity; +} + +define(Lab, lab, extend(Color, { + brighter: function(k) { + return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); + }, + darker: function(k) { + return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); + }, + rgb: function() { + var y = (this.l + 16) / 116, + x = isNaN(this.a) ? y : y + this.a / 500, + z = isNaN(this.b) ? y : y - this.b / 200; + x = Xn * lab2xyz(x); + y = Yn * lab2xyz(y); + z = Zn * lab2xyz(z); + return new Rgb( + lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), + lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), + lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), + this.opacity + ); } - areaStream.point(lambda, phi); - linePoint(lambda, phi); +})); + +function xyz2lab(t) { + return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; } -function boundsRingStart() { - areaStream.lineStart(); +function lab2xyz(t) { + return t > t1 ? t * t * t : t2 * (t - t0); } -function boundsRingEnd() { - boundsRingPoint(lambda00$1, phi00$1); - areaStream.lineEnd(); - if (abs(deltaSum) > epsilon) lambda0$1 = -(lambda1 = 180); - range[0] = lambda0$1, range[1] = lambda1; - p0 = null; +function lrgb2rgb(x) { + return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); } -// Finds the left-right distance between two longitudes. -// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want -// the distance between ±180° to be 360°. -function angle(lambda0, lambda1) { - return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1; +function rgb2lrgb(x) { + return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); } -function rangeCompare(a, b) { - return a[0] - b[0]; +function hclConvert(o) { + if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); + if (!(o instanceof Lab)) o = labConvert(o); + if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); + var h = Math.atan2(o.b, o.a) * rad2deg; + return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); } -function rangeContains(range, x) { - return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; +function lch(l, c, h, opacity) { + return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); } -function bounds(feature) { - var i, n, a, b, merged, deltaMax, delta; +function hcl(h, c, l, opacity) { + return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); +} - phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity); - ranges = []; - geoStream(feature, boundsStream); +function Hcl(h, c, l, opacity) { + this.h = +h; + this.c = +c; + this.l = +l; + this.opacity = +opacity; +} - // First, sort ranges by their minimum longitudes. - if (n = ranges.length) { - ranges.sort(rangeCompare); +function hcl2lab(o) { + if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); + var h = o.h * deg2rad; + return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); +} - // Then, merge any ranges that overlap. - for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) { - b = ranges[i]; - if (rangeContains(a, b[0]) || rangeContains(a, b[1])) { - if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; - if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; - } else { - merged.push(a = b); - } - } +define(Hcl, hcl, extend(Color, { + brighter: function(k) { + return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); + }, + darker: function(k) { + return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); + }, + rgb: function() { + return hcl2lab(this).rgb(); + } +})); - // Finally, find the largest gap between the merged ranges. - // The final bounding box will be the inverse of this gap. - for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) { - b = merged[i]; - if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0$1 = b[0], lambda1 = a[1]; - } - } +var A = -0.14861, + B = +1.78277, + C = -0.29227, + D = -0.90649, + E = +1.97294, + ED = E * D, + EB = E * B, + BC_DA = B * C - D * A; - ranges = range = null; +function cubehelixConvert(o) { + if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Rgb)) o = rgbConvert(o); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), + bl = b - l, + k = (E * (g - l) - C * bl) / D, + s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 + h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; + return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); +} - return lambda0$1 === Infinity || phi0 === Infinity - ? [[NaN, NaN], [NaN, NaN]] - : [[lambda0$1, phi0], [lambda1, phi1]]; +function cubehelix(h, s, l, opacity) { + return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); } -var W0, W1, - X0, Y0, Z0, - X1, Y1, Z1, - X2, Y2, Z2, - lambda00$2, phi00$2, // first point - x0, y0, z0; // previous point +function Cubehelix(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} -var centroidStream = { - sphere: noop, - point: centroidPoint, - lineStart: centroidLineStart, - lineEnd: centroidLineEnd, - polygonStart: function() { - centroidStream.lineStart = centroidRingStart; - centroidStream.lineEnd = centroidRingEnd; +define(Cubehelix, cubehelix, extend(Color, { + brighter: function(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Cubehelix(this.h, this.s, this.l * k, this.opacity); }, - polygonEnd: function() { - centroidStream.lineStart = centroidLineStart; - centroidStream.lineEnd = centroidLineEnd; + darker: function(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Cubehelix(this.h, this.s, this.l * k, this.opacity); + }, + rgb: function() { + var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, + l = +this.l, + a = isNaN(this.s) ? 0 : this.s * l * (1 - l), + cosh = Math.cos(h), + sinh = Math.sin(h); + return new Rgb( + 255 * (l + a * (A * cosh + B * sinh)), + 255 * (l + a * (C * cosh + D * sinh)), + 255 * (l + a * (E * cosh)), + this.opacity + ); } -}; - -// Arithmetic mean of Cartesian vectors. -function centroidPoint(lambda, phi) { - lambda *= radians, phi *= radians; - var cosPhi = cos(phi); - centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)); -} +})); -function centroidPointCartesian(x, y, z) { - ++W0; - X0 += (x - X0) / W0; - Y0 += (y - Y0) / W0; - Z0 += (z - Z0) / W0; -} +exports.color = color; +exports.cubehelix = cubehelix; +exports.gray = gray; +exports.hcl = hcl; +exports.hsl = hsl; +exports.lab = lab; +exports.lch = lch; +exports.rgb = rgb; -function centroidLineStart() { - centroidStream.point = centroidLinePointFirst; -} +Object.defineProperty(exports, '__esModule', { value: true }); -function centroidLinePointFirst(lambda, phi) { - lambda *= radians, phi *= radians; - var cosPhi = cos(phi); - x0 = cosPhi * cos(lambda); - y0 = cosPhi * sin(lambda); - z0 = sin(phi); - centroidStream.point = centroidLinePoint; - centroidPointCartesian(x0, y0, z0); -} +})); -function centroidLinePoint(lambda, phi) { - lambda *= radians, phi *= radians; - var cosPhi = cos(phi), - x = cosPhi * cos(lambda), - y = cosPhi * sin(lambda), - z = sin(phi), - w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); - W1 += w; - X1 += w * (x0 + (x0 = x)); - Y1 += w * (y0 + (y0 = y)); - Z1 += w * (z0 + (z0 = z)); - centroidPointCartesian(x0, y0, z0); -} +},{}],137:[function(_dereq_,module,exports){ +// https://d3js.org/d3-dispatch/ v1.0.6 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; -function centroidLineEnd() { - centroidStream.point = centroidPoint; -} +var noop = {value: function() {}}; -// See J. E. Brock, The Inertia Tensor for a Spherical Triangle, -// J. Applied Mechanics 42, 239 (1975). -function centroidRingStart() { - centroidStream.point = centroidRingPointFirst; +function dispatch() { + for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { + if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); + _[t] = []; + } + return new Dispatch(_); } -function centroidRingEnd() { - centroidRingPoint(lambda00$2, phi00$2); - centroidStream.point = centroidPoint; +function Dispatch(_) { + this._ = _; } -function centroidRingPointFirst(lambda, phi) { - lambda00$2 = lambda, phi00$2 = phi; - lambda *= radians, phi *= radians; - centroidStream.point = centroidRingPoint; - var cosPhi = cos(phi); - x0 = cosPhi * cos(lambda); - y0 = cosPhi * sin(lambda); - z0 = sin(phi); - centroidPointCartesian(x0, y0, z0); +function parseTypenames(typenames, types) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); + return {type: t, name: name}; + }); } -function centroidRingPoint(lambda, phi) { - lambda *= radians, phi *= radians; - var cosPhi = cos(phi), - x = cosPhi * cos(lambda), - y = cosPhi * sin(lambda), - z = sin(phi), - cx = y0 * z - z0 * y, - cy = z0 * x - x0 * z, - cz = x0 * y - y0 * x, - m = sqrt(cx * cx + cy * cy + cz * cz), - w = asin(m), // line weight = angle - v = m && -w / m; // area weight multiplier - X2 += v * cx; - Y2 += v * cy; - Z2 += v * cz; - W1 += w; - X1 += w * (x0 + (x0 = x)); - Y1 += w * (y0 + (y0 = y)); - Z1 += w * (z0 + (z0 = z)); - centroidPointCartesian(x0, y0, z0); -} +Dispatch.prototype = dispatch.prototype = { + constructor: Dispatch, + on: function(typename, callback) { + var _ = this._, + T = parseTypenames(typename + "", _), + t, + i = -1, + n = T.length; -function centroid(object) { - W0 = W1 = - X0 = Y0 = Z0 = - X1 = Y1 = Z1 = - X2 = Y2 = Z2 = 0; - geoStream(object, centroidStream); + // If no callback was specified, return the callback of the given type and name. + if (arguments.length < 2) { + while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; + return; + } - var x = X2, - y = Y2, - z = Z2, - m = x * x + y * y + z * z; + // If a type was specified, set the callback for the given type and name. + // Otherwise, if a null callback was specified, remove callbacks of the given name. + if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); + while (++i < n) { + if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); + else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); + } - // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid. - if (m < epsilon2) { - x = X1, y = Y1, z = Z1; - // If the feature has zero length, fall back to arithmetic mean of point vectors. - if (W1 < epsilon) x = X0, y = Y0, z = Z0; - m = x * x + y * y + z * z; - // If the feature still has an undefined ccentroid, then return. - if (m < epsilon2) return [NaN, NaN]; + return this; + }, + copy: function() { + var copy = {}, _ = this._; + for (var t in _) copy[t] = _[t].slice(); + return new Dispatch(copy); + }, + call: function(type, that) { + if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + }, + apply: function(type, that, args) { + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); } +}; - return [atan2(y, x) * degrees, asin(z / sqrt(m)) * degrees]; -} - -function constant(x) { - return function() { - return x; - }; +function get(type, name) { + for (var i = 0, n = type.length, c; i < n; ++i) { + if ((c = type[i]).name === name) { + return c.value; + } + } } -function compose(a, b) { - - function compose(x, y) { - return x = a(x, y), b(x[0], x[1]); +function set(type, name, callback) { + for (var i = 0, n = type.length; i < n; ++i) { + if (type[i].name === name) { + type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); + break; + } } + if (callback != null) type.push({name: name, value: callback}); + return type; +} - if (a.invert && b.invert) compose.invert = function(x, y) { - return x = b.invert(x, y), x && a.invert(x[0], x[1]); - }; +exports.dispatch = dispatch; - return compose; -} +Object.defineProperty(exports, '__esModule', { value: true }); -function rotationIdentity(lambda, phi) { - return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi]; -} +})); -rotationIdentity.invert = rotationIdentity; +},{}],138:[function(_dereq_,module,exports){ +// https://d3js.org/d3-force/ v1.2.1 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-quadtree'), _dereq_('d3-collection'), _dereq_('d3-dispatch'), _dereq_('d3-timer')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree', 'd3-collection', 'd3-dispatch', 'd3-timer'], factory) : +(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3)); +}(this, (function (exports,d3Quadtree,d3Collection,d3Dispatch,d3Timer) { 'use strict'; -function rotateRadians(deltaLambda, deltaPhi, deltaGamma) { - return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) - : rotationLambda(deltaLambda)) - : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) - : rotationIdentity); -} +function center(x, y) { + var nodes; -function forwardRotationLambda(deltaLambda) { - return function(lambda, phi) { - return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi]; - }; -} + if (x == null) x = 0; + if (y == null) y = 0; -function rotationLambda(deltaLambda) { - var rotation = forwardRotationLambda(deltaLambda); - rotation.invert = forwardRotationLambda(-deltaLambda); - return rotation; -} + function force() { + var i, + n = nodes.length, + node, + sx = 0, + sy = 0; -function rotationPhiGamma(deltaPhi, deltaGamma) { - var cosDeltaPhi = cos(deltaPhi), - sinDeltaPhi = sin(deltaPhi), - cosDeltaGamma = cos(deltaGamma), - sinDeltaGamma = sin(deltaGamma); + for (i = 0; i < n; ++i) { + node = nodes[i], sx += node.x, sy += node.y; + } - function rotation(lambda, phi) { - var cosPhi = cos(phi), - x = cos(lambda) * cosPhi, - y = sin(lambda) * cosPhi, - z = sin(phi), - k = z * cosDeltaPhi + x * sinDeltaPhi; - return [ - atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi), - asin(k * cosDeltaGamma + y * sinDeltaGamma) - ]; + for (sx = sx / n - x, sy = sy / n - y, i = 0; i < n; ++i) { + node = nodes[i], node.x -= sx, node.y -= sy; + } } - rotation.invert = function(lambda, phi) { - var cosPhi = cos(phi), - x = cos(lambda) * cosPhi, - y = sin(lambda) * cosPhi, - z = sin(phi), - k = z * cosDeltaGamma - y * sinDeltaGamma; - return [ - atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi), - asin(k * cosDeltaPhi - x * sinDeltaPhi) - ]; + force.initialize = function(_) { + nodes = _; }; - return rotation; -} + force.x = function(_) { + return arguments.length ? (x = +_, force) : x; + }; -function rotation(rotate) { - rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0); + force.y = function(_) { + return arguments.length ? (y = +_, force) : y; + }; - function forward(coordinates) { - coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians); - return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates; - } + return force; +} - forward.invert = function(coordinates) { - coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians); - return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates; +function constant(x) { + return function() { + return x; }; +} - return forward; +function jiggle() { + return (Math.random() - 0.5) * 1e-6; } -// Generates a circle centered at [0°, 0°], with a given radius and precision. -function circleStream(stream, radius, delta, direction, t0, t1) { - if (!delta) return; - var cosRadius = cos(radius), - sinRadius = sin(radius), - step = direction * delta; - if (t0 == null) { - t0 = radius + direction * tau; - t1 = radius - step / 2; - } else { - t0 = circleRadius(cosRadius, t0); - t1 = circleRadius(cosRadius, t1); - if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau; - } - for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) { - point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]); - stream.point(point[0], point[1]); - } +function x(d) { + return d.x + d.vx; } -// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0]. -function circleRadius(cosRadius, point) { - point = cartesian(point), point[0] -= cosRadius; - cartesianNormalizeInPlace(point); - var radius = acos(-point[1]); - return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau; +function y(d) { + return d.y + d.vy; } -function circle() { - var center = constant([0, 0]), - radius = constant(90), - precision = constant(6), - ring, - rotate, - stream = {point: point}; +function collide(radius) { + var nodes, + radii, + strength = 1, + iterations = 1; - function point(x, y) { - ring.push(x = rotate(x, y)); - x[0] *= degrees, x[1] *= degrees; + if (typeof radius !== "function") radius = constant(radius == null ? 1 : +radius); + + function force() { + var i, n = nodes.length, + tree, + node, + xi, + yi, + ri, + ri2; + + for (var k = 0; k < iterations; ++k) { + tree = d3Quadtree.quadtree(nodes, x, y).visitAfter(prepare); + for (i = 0; i < n; ++i) { + node = nodes[i]; + ri = radii[node.index], ri2 = ri * ri; + xi = node.x + node.vx; + yi = node.y + node.vy; + tree.visit(apply); + } + } + + function apply(quad, x0, y0, x1, y1) { + var data = quad.data, rj = quad.r, r = ri + rj; + if (data) { + if (data.index > node.index) { + var x = xi - data.x - data.vx, + y = yi - data.y - data.vy, + l = x * x + y * y; + if (l < r * r) { + if (x === 0) x = jiggle(), l += x * x; + if (y === 0) y = jiggle(), l += y * y; + l = (r - (l = Math.sqrt(l))) / l * strength; + node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj)); + node.vy += (y *= l) * r; + data.vx -= x * (r = 1 - r); + data.vy -= y * r; + } + } + return; + } + return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r; + } } - function circle() { - var c = center.apply(this, arguments), - r = radius.apply(this, arguments) * radians, - p = precision.apply(this, arguments) * radians; - ring = []; - rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert; - circleStream(stream, r, p, 1); - c = {type: "Polygon", coordinates: [ring]}; - ring = rotate = null; - return c; + function prepare(quad) { + if (quad.data) return quad.r = radii[quad.data.index]; + for (var i = quad.r = 0; i < 4; ++i) { + if (quad[i] && quad[i].r > quad.r) { + quad.r = quad[i].r; + } + } } - circle.center = function(_) { - return arguments.length ? (center = typeof _ === "function" ? _ : constant([+_[0], +_[1]]), circle) : center; - }; + function initialize() { + if (!nodes) return; + var i, n = nodes.length, node; + radii = new Array(n); + for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes); + } - circle.radius = function(_) { - return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), circle) : radius; + force.initialize = function(_) { + nodes = _; + initialize(); }; - circle.precision = function(_) { - return arguments.length ? (precision = typeof _ === "function" ? _ : constant(+_), circle) : precision; + force.iterations = function(_) { + return arguments.length ? (iterations = +_, force) : iterations; }; - return circle; -} + force.strength = function(_) { + return arguments.length ? (strength = +_, force) : strength; + }; -function clipBuffer() { - var lines = [], - line; - return { - point: function(x, y, m) { - line.push([x, y, m]); - }, - lineStart: function() { - lines.push(line = []); - }, - lineEnd: noop, - rejoin: function() { - if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); - }, - result: function() { - var result = lines; - lines = []; - line = null; - return result; - } + force.radius = function(_) { + return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), initialize(), force) : radius; }; + + return force; } -function pointEqual(a, b) { - return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon; +function index(d) { + return d.index; } -function Intersection(point, points, other, entry) { - this.x = point; - this.z = points; - this.o = other; // another intersection - this.e = entry; // is an entry? - this.v = false; // visited - this.n = this.p = null; // next & previous +function find(nodeById, nodeId) { + var node = nodeById.get(nodeId); + if (!node) throw new Error("missing: " + nodeId); + return node; } -// A generalized polygon clipping algorithm: given a polygon that has been cut -// into its visible line segments, and rejoins the segments by interpolating -// along the clip edge. -function clipRejoin(segments, compareIntersection, startInside, interpolate, stream) { - var subject = [], - clip = [], - i, - n; +function link(links) { + var id = index, + strength = defaultStrength, + strengths, + distance = constant(30), + distances, + nodes, + count, + bias, + iterations = 1; - segments.forEach(function(segment) { - if ((n = segment.length - 1) <= 0) return; - var n, p0 = segment[0], p1 = segment[n], x; + if (links == null) links = []; - if (pointEqual(p0, p1)) { - if (!p0[2] && !p1[2]) { - stream.lineStart(); - for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]); - stream.lineEnd(); - return; + function defaultStrength(link) { + return 1 / Math.min(count[link.source.index], count[link.target.index]); + } + + function force(alpha) { + for (var k = 0, n = links.length; k < iterations; ++k) { + for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) { + link = links[i], source = link.source, target = link.target; + x = target.x + target.vx - source.x - source.vx || jiggle(); + y = target.y + target.vy - source.y - source.vy || jiggle(); + l = Math.sqrt(x * x + y * y); + l = (l - distances[i]) / l * alpha * strengths[i]; + x *= l, y *= l; + target.vx -= x * (b = bias[i]); + target.vy -= y * b; + source.vx += x * (b = 1 - b); + source.vy += y * b; } - // handle degenerate cases by moving the point - p1[0] += 2 * epsilon; } + } - subject.push(x = new Intersection(p0, segment, null, true)); - clip.push(x.o = new Intersection(p0, null, x, false)); - subject.push(x = new Intersection(p1, segment, null, false)); - clip.push(x.o = new Intersection(p1, null, x, true)); - }); + function initialize() { + if (!nodes) return; - if (!subject.length) return; + var i, + n = nodes.length, + m = links.length, + nodeById = d3Collection.map(nodes, id), + link; - clip.sort(compareIntersection); - link(subject); - link(clip); + for (i = 0, count = new Array(n); i < m; ++i) { + link = links[i], link.index = i; + if (typeof link.source !== "object") link.source = find(nodeById, link.source); + if (typeof link.target !== "object") link.target = find(nodeById, link.target); + count[link.source.index] = (count[link.source.index] || 0) + 1; + count[link.target.index] = (count[link.target.index] || 0) + 1; + } - for (i = 0, n = clip.length; i < n; ++i) { - clip[i].e = startInside = !startInside; + for (i = 0, bias = new Array(m); i < m; ++i) { + link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]); + } + + strengths = new Array(m), initializeStrength(); + distances = new Array(m), initializeDistance(); } - var start = subject[0], - points, - point; + function initializeStrength() { + if (!nodes) return; - while (1) { - // Find first unvisited intersection. - var current = start, - isSubject = true; - while (current.v) if ((current = current.n) === start) return; - points = current.z; - stream.lineStart(); - do { - current.v = current.o.v = true; - if (current.e) { - if (isSubject) { - for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]); - } else { - interpolate(current.x, current.n.x, 1, stream); - } - current = current.n; - } else { - if (isSubject) { - points = current.p.z; - for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]); - } else { - interpolate(current.x, current.p.x, -1, stream); - } - current = current.p; - } - current = current.o; - points = current.z; - isSubject = !isSubject; - } while (!current.v); - stream.lineEnd(); + for (var i = 0, n = links.length; i < n; ++i) { + strengths[i] = +strength(links[i], i, links); + } } -} -function link(array) { - if (!(n = array.length)) return; - var n, - i = 0, - a = array[0], - b; - while (++i < n) { - a.n = b = array[i]; - b.p = a; - a = b; + function initializeDistance() { + if (!nodes) return; + + for (var i = 0, n = links.length; i < n; ++i) { + distances[i] = +distance(links[i], i, links); + } } - a.n = b = array[0]; - b.p = a; + + force.initialize = function(_) { + nodes = _; + initialize(); + }; + + force.links = function(_) { + return arguments.length ? (links = _, initialize(), force) : links; + }; + + force.id = function(_) { + return arguments.length ? (id = _, force) : id; + }; + + force.iterations = function(_) { + return arguments.length ? (iterations = +_, force) : iterations; + }; + + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initializeStrength(), force) : strength; + }; + + force.distance = function(_) { + return arguments.length ? (distance = typeof _ === "function" ? _ : constant(+_), initializeDistance(), force) : distance; + }; + + return force; } -var sum = adder(); +function x$1(d) { + return d.x; +} -function longitude(point) { - if (abs(point[0]) <= pi) - return point[0]; - else - return sign(point[0]) * ((abs(point[0]) + pi) % tau - pi); +function y$1(d) { + return d.y; } -function polygonContains(polygon, point) { - var lambda = longitude(point), - phi = point[1], - sinPhi = sin(phi), - normal = [sin(lambda), -cos(lambda), 0], - angle = 0, - winding = 0; +var initialRadius = 10, + initialAngle = Math.PI * (3 - Math.sqrt(5)); - sum.reset(); +function simulation(nodes) { + var simulation, + alpha = 1, + alphaMin = 0.001, + alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), + alphaTarget = 0, + velocityDecay = 0.6, + forces = d3Collection.map(), + stepper = d3Timer.timer(step), + event = d3Dispatch.dispatch("tick", "end"); - if (sinPhi === 1) phi = halfPi + epsilon; - else if (sinPhi === -1) phi = -halfPi - epsilon; + if (nodes == null) nodes = []; - for (var i = 0, n = polygon.length; i < n; ++i) { - if (!(m = (ring = polygon[i]).length)) continue; - var ring, - m, - point0 = ring[m - 1], - lambda0 = longitude(point0), - phi0 = point0[1] / 2 + quarterPi, - sinPhi0 = sin(phi0), - cosPhi0 = cos(phi0); + function step() { + tick(); + event.call("tick", simulation); + if (alpha < alphaMin) { + stepper.stop(); + event.call("end", simulation); + } + } - for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) { - var point1 = ring[j], - lambda1 = longitude(point1), - phi1 = point1[1] / 2 + quarterPi, - sinPhi1 = sin(phi1), - cosPhi1 = cos(phi1), - delta = lambda1 - lambda0, - sign = delta >= 0 ? 1 : -1, - absDelta = sign * delta, - antimeridian = absDelta > pi, - k = sinPhi0 * sinPhi1; + function tick(iterations) { + var i, n = nodes.length, node; - sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta))); - angle += antimeridian ? delta + sign * tau : delta; + if (iterations === undefined) iterations = 1; - // Are the longitudes either side of the point’s meridian (lambda), - // and are the latitudes smaller than the parallel (phi)? - if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) { - var arc = cartesianCross(cartesian(point0), cartesian(point1)); - cartesianNormalizeInPlace(arc); - var intersection = cartesianCross(normal, arc); - cartesianNormalizeInPlace(intersection); - var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]); - if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) { - winding += antimeridian ^ delta >= 0 ? 1 : -1; - } + for (var k = 0; k < iterations; ++k) { + alpha += (alphaTarget - alpha) * alphaDecay; + + forces.each(function (force) { + force(alpha); + }); + + for (i = 0; i < n; ++i) { + node = nodes[i]; + if (node.fx == null) node.x += node.vx *= velocityDecay; + else node.x = node.fx, node.vx = 0; + if (node.fy == null) node.y += node.vy *= velocityDecay; + else node.y = node.fy, node.vy = 0; } } + + return simulation; } - // First, determine whether the South pole is inside or outside: - // - // It is inside if: - // * the polygon winds around it in a clockwise direction. - // * the polygon does not (cumulatively) wind around it, but has a negative - // (counter-clockwise) area. - // - // Second, count the (signed) number of times a segment crosses a lambda - // from the point to the South pole. If it is zero, then the point is the - // same side as the South pole. + function initializeNodes() { + for (var i = 0, n = nodes.length, node; i < n; ++i) { + node = nodes[i], node.index = i; + if (node.fx != null) node.x = node.fx; + if (node.fy != null) node.y = node.fy; + if (isNaN(node.x) || isNaN(node.y)) { + var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle; + node.x = radius * Math.cos(angle); + node.y = radius * Math.sin(angle); + } + if (isNaN(node.vx) || isNaN(node.vy)) { + node.vx = node.vy = 0; + } + } + } - return (angle < -epsilon || angle < epsilon && sum < -epsilon) ^ (winding & 1); -} + function initializeForce(force) { + if (force.initialize) force.initialize(nodes); + return force; + } -function clip(pointVisible, clipLine, interpolate, start) { - return function(sink) { - var line = clipLine(sink), - ringBuffer = clipBuffer(), - ringSink = clipLine(ringBuffer), - polygonStarted = false, - polygon, - segments, - ring; + initializeNodes(); - var clip = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { - clip.point = pointRing; - clip.lineStart = ringStart; - clip.lineEnd = ringEnd; - segments = []; - polygon = []; - }, - polygonEnd: function() { - clip.point = point; - clip.lineStart = lineStart; - clip.lineEnd = lineEnd; - segments = d3Array.merge(segments); - var startInside = polygonContains(polygon, start); - if (segments.length) { - if (!polygonStarted) sink.polygonStart(), polygonStarted = true; - clipRejoin(segments, compareIntersection, startInside, interpolate, sink); - } else if (startInside) { - if (!polygonStarted) sink.polygonStart(), polygonStarted = true; - sink.lineStart(); - interpolate(null, null, 1, sink); - sink.lineEnd(); - } - if (polygonStarted) sink.polygonEnd(), polygonStarted = false; - segments = polygon = null; - }, - sphere: function() { - sink.polygonStart(); - sink.lineStart(); - interpolate(null, null, 1, sink); - sink.lineEnd(); - sink.polygonEnd(); - } - }; + return simulation = { + tick: tick, - function point(lambda, phi) { - if (pointVisible(lambda, phi)) sink.point(lambda, phi); - } + restart: function() { + return stepper.restart(step), simulation; + }, - function pointLine(lambda, phi) { - line.point(lambda, phi); - } + stop: function() { + return stepper.stop(), simulation; + }, - function lineStart() { - clip.point = pointLine; - line.lineStart(); - } + nodes: function(_) { + return arguments.length ? (nodes = _, initializeNodes(), forces.each(initializeForce), simulation) : nodes; + }, - function lineEnd() { - clip.point = point; - line.lineEnd(); - } + alpha: function(_) { + return arguments.length ? (alpha = +_, simulation) : alpha; + }, - function pointRing(lambda, phi) { - ring.push([lambda, phi]); - ringSink.point(lambda, phi); - } + alphaMin: function(_) { + return arguments.length ? (alphaMin = +_, simulation) : alphaMin; + }, - function ringStart() { - ringSink.lineStart(); - ring = []; - } + alphaDecay: function(_) { + return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay; + }, - function ringEnd() { - pointRing(ring[0][0], ring[0][1]); - ringSink.lineEnd(); + alphaTarget: function(_) { + return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget; + }, - var clean = ringSink.clean(), - ringSegments = ringBuffer.result(), - i, n = ringSegments.length, m, - segment, - point; + velocityDecay: function(_) { + return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay; + }, - ring.pop(); - polygon.push(ring); - ring = null; + force: function(name, _) { + return arguments.length > 1 ? ((_ == null ? forces.remove(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name); + }, - if (!n) return; + find: function(x, y, radius) { + var i = 0, + n = nodes.length, + dx, + dy, + d2, + node, + closest; - // No intersections. - if (clean & 1) { - segment = ringSegments[0]; - if ((m = segment.length - 1) > 0) { - if (!polygonStarted) sink.polygonStart(), polygonStarted = true; - sink.lineStart(); - for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]); - sink.lineEnd(); - } - return; + if (radius == null) radius = Infinity; + else radius *= radius; + + for (i = 0; i < n; ++i) { + node = nodes[i]; + dx = x - node.x; + dy = y - node.y; + d2 = dx * dx + dy * dy; + if (d2 < radius) closest = node, radius = d2; } - // Rejoin connected segments. - // TODO reuse ringBuffer.rejoin()? - if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); + return closest; + }, - segments.push(ringSegments.filter(validSegment)); + on: function(name, _) { + return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name); } - - return clip; }; } -function validSegment(segment) { - return segment.length > 1; -} +function manyBody() { + var nodes, + node, + alpha, + strength = constant(-30), + strengths, + distanceMin2 = 1, + distanceMax2 = Infinity, + theta2 = 0.81; -// Intersections are sorted along the clip edge. For both antimeridian cutting -// and circle clipping, the same comparison is used. -function compareIntersection(a, b) { - return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1]) - - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]); -} + function force(_) { + var i, n = nodes.length, tree = d3Quadtree.quadtree(nodes, x$1, y$1).visitAfter(accumulate); + for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply); + } -var clipAntimeridian = clip( - function() { return true; }, - clipAntimeridianLine, - clipAntimeridianInterpolate, - [-pi, -halfPi] -); + function initialize() { + if (!nodes) return; + var i, n = nodes.length, node; + strengths = new Array(n); + for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes); + } -// Takes a line and cuts into visible segments. Return values: 0 - there were -// intersections or the line was empty; 1 - no intersections; 2 - there were -// intersections, and the first and last segments should be rejoined. -function clipAntimeridianLine(stream) { - var lambda0 = NaN, - phi0 = NaN, - sign0 = NaN, - clean; // no intersections + function accumulate(quad) { + var strength = 0, q, c, weight = 0, x, y, i; - return { - lineStart: function() { - stream.lineStart(); - clean = 1; - }, - point: function(lambda1, phi1) { - var sign1 = lambda1 > 0 ? pi : -pi, - delta = abs(lambda1 - lambda0); - if (abs(delta - pi) < epsilon) { // line crosses a pole - stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi); - stream.point(sign0, phi0); - stream.lineEnd(); - stream.lineStart(); - stream.point(sign1, phi0); - stream.point(lambda1, phi0); - clean = 0; - } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian - if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies - if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon; - phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1); - stream.point(sign0, phi0); - stream.lineEnd(); - stream.lineStart(); - stream.point(sign1, phi0); - clean = 0; + // For internal nodes, accumulate forces from child quadrants. + if (quad.length) { + for (x = y = i = 0; i < 4; ++i) { + if ((q = quad[i]) && (c = Math.abs(q.value))) { + strength += q.value, weight += c, x += c * q.x, y += c * q.y; + } } - stream.point(lambda0 = lambda1, phi0 = phi1); - sign0 = sign1; - }, - lineEnd: function() { - stream.lineEnd(); - lambda0 = phi0 = NaN; - }, - clean: function() { - return 2 - clean; // if intersections, rejoin first and last segments + quad.x = x / weight; + quad.y = y / weight; } - }; -} -function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) { - var cosPhi0, - cosPhi1, - sinLambda0Lambda1 = sin(lambda0 - lambda1); - return abs(sinLambda0Lambda1) > epsilon - ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1) - - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0)) - / (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) - : (phi0 + phi1) / 2; -} + // For leaf nodes, accumulate forces from coincident quadrants. + else { + q = quad; + q.x = q.data.x; + q.y = q.data.y; + do strength += strengths[q.data.index]; + while (q = q.next); + } -function clipAntimeridianInterpolate(from, to, direction, stream) { - var phi; - if (from == null) { - phi = direction * halfPi; - stream.point(-pi, phi); - stream.point(0, phi); - stream.point(pi, phi); - stream.point(pi, 0); - stream.point(pi, -phi); - stream.point(0, -phi); - stream.point(-pi, -phi); - stream.point(-pi, 0); - stream.point(-pi, phi); - } else if (abs(from[0] - to[0]) > epsilon) { - var lambda = from[0] < to[0] ? pi : -pi; - phi = direction * lambda / 2; - stream.point(-lambda, phi); - stream.point(0, phi); - stream.point(lambda, phi); - } else { - stream.point(to[0], to[1]); + quad.value = strength; } -} - -function clipCircle(radius) { - var cr = cos(radius), - delta = 6 * radians, - smallRadius = cr > 0, - notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case - function interpolate(from, to, direction, stream) { - circleStream(stream, radius, delta, direction, from, to); - } + function apply(quad, x1, _, x2) { + if (!quad.value) return true; - function visible(lambda, phi) { - return cos(lambda) * cos(phi) > cr; - } + var x = quad.x - node.x, + y = quad.y - node.y, + w = x2 - x1, + l = x * x + y * y; - // Takes a line and cuts into visible segments. Return values used for polygon - // clipping: 0 - there were intersections or the line was empty; 1 - no - // intersections 2 - there were intersections, and the first and last segments - // should be rejoined. - function clipLine(stream) { - var point0, // previous point - c0, // code for previous point - v0, // visibility of previous point - v00, // visibility of first point - clean; // no intersections - return { - lineStart: function() { - v00 = v0 = false; - clean = 1; - }, - point: function(lambda, phi) { - var point1 = [lambda, phi], - point2, - v = visible(lambda, phi), - c = smallRadius - ? v ? 0 : code(lambda, phi) - : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0; - if (!point0 && (v00 = v0 = v)) stream.lineStart(); - if (v !== v0) { - point2 = intersect(point0, point1); - if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) - point1[2] = 1; - } - if (v !== v0) { - clean = 0; - if (v) { - // outside going in - stream.lineStart(); - point2 = intersect(point1, point0); - stream.point(point2[0], point2[1]); - } else { - // inside going out - point2 = intersect(point0, point1); - stream.point(point2[0], point2[1], 2); - stream.lineEnd(); - } - point0 = point2; - } else if (notHemisphere && point0 && smallRadius ^ v) { - var t; - // If the codes for two points are different, or are both zero, - // and there this segment intersects with the small circle. - if (!(c & c0) && (t = intersect(point1, point0, true))) { - clean = 0; - if (smallRadius) { - stream.lineStart(); - stream.point(t[0][0], t[0][1]); - stream.point(t[1][0], t[1][1]); - stream.lineEnd(); - } else { - stream.point(t[1][0], t[1][1]); - stream.lineEnd(); - stream.lineStart(); - stream.point(t[0][0], t[0][1], 3); - } - } - } - if (v && (!point0 || !pointEqual(point0, point1))) { - stream.point(point1[0], point1[1]); - } - point0 = point1, v0 = v, c0 = c; - }, - lineEnd: function() { - if (v0) stream.lineEnd(); - point0 = null; - }, - // Rejoin first and last segments if there were intersections and the first - // and last points were visible. - clean: function() { - return clean | ((v00 && v0) << 1); + // Apply the Barnes-Hut approximation if possible. + // Limit forces for very close nodes; randomize direction if coincident. + if (w * w / theta2 < l) { + if (l < distanceMax2) { + if (x === 0) x = jiggle(), l += x * x; + if (y === 0) y = jiggle(), l += y * y; + if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l); + node.vx += x * quad.value * alpha / l; + node.vy += y * quad.value * alpha / l; } - }; - } - - // Intersects the great circle between a and b with the clip circle. - function intersect(a, b, two) { - var pa = cartesian(a), - pb = cartesian(b); + return true; + } - // We have two planes, n1.p = d1 and n2.p = d2. - // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2). - var n1 = [1, 0, 0], // normal - n2 = cartesianCross(pa, pb), - n2n2 = cartesianDot(n2, n2), - n1n2 = n2[0], // cartesianDot(n1, n2), - determinant = n2n2 - n1n2 * n1n2; + // Otherwise, process points directly. + else if (quad.length || l >= distanceMax2) return; - // Two polar points. - if (!determinant) return !two && a; + // Limit forces for very close nodes; randomize direction if coincident. + if (quad.data !== node || quad.next) { + if (x === 0) x = jiggle(), l += x * x; + if (y === 0) y = jiggle(), l += y * y; + if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l); + } - var c1 = cr * n2n2 / determinant, - c2 = -cr * n1n2 / determinant, - n1xn2 = cartesianCross(n1, n2), - A = cartesianScale(n1, c1), - B = cartesianScale(n2, c2); - cartesianAddInPlace(A, B); + do if (quad.data !== node) { + w = strengths[quad.data.index] * alpha / l; + node.vx += x * w; + node.vy += y * w; + } while (quad = quad.next); + } - // Solve |p(t)|^2 = 1. - var u = n1xn2, - w = cartesianDot(A, u), - uu = cartesianDot(u, u), - t2 = w * w - uu * (cartesianDot(A, A) - 1); + force.initialize = function(_) { + nodes = _; + initialize(); + }; - if (t2 < 0) return; + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; + }; - var t = sqrt(t2), - q = cartesianScale(u, (-w - t) / uu); - cartesianAddInPlace(q, A); - q = spherical(q); + force.distanceMin = function(_) { + return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2); + }; - if (!two) return q; + force.distanceMax = function(_) { + return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2); + }; - // Two intersection points. - var lambda0 = a[0], - lambda1 = b[0], - phi0 = a[1], - phi1 = b[1], - z; + force.theta = function(_) { + return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2); + }; - if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z; + return force; +} - var delta = lambda1 - lambda0, - polar = abs(delta - pi) < epsilon, - meridian = polar || delta < epsilon; +function radial(radius, x, y) { + var nodes, + strength = constant(0.1), + strengths, + radiuses; - if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z; + if (typeof radius !== "function") radius = constant(+radius); + if (x == null) x = 0; + if (y == null) y = 0; - // Check that the first point is between a and b. - if (meridian - ? polar - ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1) - : phi0 <= q[1] && q[1] <= phi1 - : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) { - var q1 = cartesianScale(u, (-w + t) / uu); - cartesianAddInPlace(q1, A); - return [q, spherical(q1)]; + function force(alpha) { + for (var i = 0, n = nodes.length; i < n; ++i) { + var node = nodes[i], + dx = node.x - x || 1e-6, + dy = node.y - y || 1e-6, + r = Math.sqrt(dx * dx + dy * dy), + k = (radiuses[i] - r) * strengths[i] * alpha / r; + node.vx += dx * k; + node.vy += dy * k; } } - // Generates a 4-bit vector representing the location of a point relative to - // the small circle's bounding box. - function code(lambda, phi) { - var r = smallRadius ? radius : pi - radius, - code = 0; - if (lambda < -r) code |= 1; // left - else if (lambda > r) code |= 2; // right - if (phi < -r) code |= 4; // below - else if (phi > r) code |= 8; // above - return code; + function initialize() { + if (!nodes) return; + var i, n = nodes.length; + strengths = new Array(n); + radiuses = new Array(n); + for (i = 0; i < n; ++i) { + radiuses[i] = +radius(nodes[i], i, nodes); + strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes); + } } - return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]); -} - -function clipLine(a, b, x0, y0, x1, y1) { - var ax = a[0], - ay = a[1], - bx = b[0], - by = b[1], - t0 = 0, - t1 = 1, - dx = bx - ax, - dy = by - ay, - r; + force.initialize = function(_) { + nodes = _, initialize(); + }; - r = x0 - ax; - if (!dx && r > 0) return; - r /= dx; - if (dx < 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } else if (dx > 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; + }; - r = x1 - ax; - if (!dx && r < 0) return; - r /= dx; - if (dx < 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } else if (dx > 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } + force.radius = function(_) { + return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), initialize(), force) : radius; + }; - r = y0 - ay; - if (!dy && r > 0) return; - r /= dy; - if (dy < 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } else if (dy > 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } + force.x = function(_) { + return arguments.length ? (x = +_, force) : x; + }; - r = y1 - ay; - if (!dy && r < 0) return; - r /= dy; - if (dy < 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } else if (dy > 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } + force.y = function(_) { + return arguments.length ? (y = +_, force) : y; + }; - if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy; - if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy; - return true; + return force; } -var clipMax = 1e9, clipMin = -clipMax; - -// TODO Use d3-polygon’s polygonContains here for the ring check? -// TODO Eliminate duplicate buffering in clipBuffer and polygon.push? - -function clipRectangle(x0, y0, x1, y1) { +function x$2(x) { + var strength = constant(0.1), + nodes, + strengths, + xz; - function visible(x, y) { - return x0 <= x && x <= x1 && y0 <= y && y <= y1; - } + if (typeof x !== "function") x = constant(x == null ? 0 : +x); - function interpolate(from, to, direction, stream) { - var a = 0, a1 = 0; - if (from == null - || (a = corner(from, direction)) !== (a1 = corner(to, direction)) - || comparePoint(from, to) < 0 ^ direction > 0) { - do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); - while ((a = (a + direction + 4) % 4) !== a1); - } else { - stream.point(to[0], to[1]); + function force(alpha) { + for (var i = 0, n = nodes.length, node; i < n; ++i) { + node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha; } } - function corner(p, direction) { - return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3 - : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1 - : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0 - : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon - } - - function compareIntersection(a, b) { - return comparePoint(a.x, b.x); - } - - function comparePoint(a, b) { - var ca = corner(a, 1), - cb = corner(b, 1); - return ca !== cb ? ca - cb - : ca === 0 ? b[1] - a[1] - : ca === 1 ? a[0] - b[0] - : ca === 2 ? a[1] - b[1] - : b[0] - a[0]; + function initialize() { + if (!nodes) return; + var i, n = nodes.length; + strengths = new Array(n); + xz = new Array(n); + for (i = 0; i < n; ++i) { + strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes); + } } - return function(stream) { - var activeStream = stream, - bufferStream = clipBuffer(), - segments, - polygon, - ring, - x__, y__, v__, // first point - x_, y_, v_, // previous point - first, - clean; - - var clipStream = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: polygonStart, - polygonEnd: polygonEnd - }; + force.initialize = function(_) { + nodes = _; + initialize(); + }; - function point(x, y) { - if (visible(x, y)) activeStream.point(x, y); - } + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; + }; - function polygonInside() { - var winding = 0; + force.x = function(_) { + return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), initialize(), force) : x; + }; - for (var i = 0, n = polygon.length; i < n; ++i) { - for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) { - a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1]; - if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; } - else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; } - } - } + return force; +} - return winding; - } +function y$2(y) { + var strength = constant(0.1), + nodes, + strengths, + yz; - // Buffer geometry within a polygon and then clip it en masse. - function polygonStart() { - activeStream = bufferStream, segments = [], polygon = [], clean = true; - } + if (typeof y !== "function") y = constant(y == null ? 0 : +y); - function polygonEnd() { - var startInside = polygonInside(), - cleanInside = clean && startInside, - visible = (segments = d3Array.merge(segments)).length; - if (cleanInside || visible) { - stream.polygonStart(); - if (cleanInside) { - stream.lineStart(); - interpolate(null, null, 1, stream); - stream.lineEnd(); - } - if (visible) { - clipRejoin(segments, compareIntersection, startInside, interpolate, stream); - } - stream.polygonEnd(); - } - activeStream = stream, segments = polygon = ring = null; + function force(alpha) { + for (var i = 0, n = nodes.length, node; i < n; ++i) { + node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha; } + } - function lineStart() { - clipStream.point = linePoint; - if (polygon) polygon.push(ring = []); - first = true; - v_ = false; - x_ = y_ = NaN; + function initialize() { + if (!nodes) return; + var i, n = nodes.length; + strengths = new Array(n); + yz = new Array(n); + for (i = 0; i < n; ++i) { + strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes); } + } - // TODO rather than special-case polygons, simply handle them separately. - // Ideally, coincident intersection points should be jittered to avoid - // clipping issues. - function lineEnd() { - if (segments) { - linePoint(x__, y__); - if (v__ && v_) bufferStream.rejoin(); - segments.push(bufferStream.result()); - } - clipStream.point = point; - if (v_) activeStream.lineEnd(); - } + force.initialize = function(_) { + nodes = _; + initialize(); + }; - function linePoint(x, y) { - var v = visible(x, y); - if (polygon) ring.push([x, y]); - if (first) { - x__ = x, y__ = y, v__ = v; - first = false; - if (v) { - activeStream.lineStart(); - activeStream.point(x, y); - } - } else { - if (v && v_) activeStream.point(x, y); - else { - var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], - b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))]; - if (clipLine(a, b, x0, y0, x1, y1)) { - if (!v_) { - activeStream.lineStart(); - activeStream.point(a[0], a[1]); - } - activeStream.point(b[0], b[1]); - if (!v) activeStream.lineEnd(); - clean = false; - } else if (v) { - activeStream.lineStart(); - activeStream.point(x, y); - clean = false; - } - } - } - x_ = x, y_ = y, v_ = v; - } + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength; + }; - return clipStream; + force.y = function(_) { + return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), initialize(), force) : y; }; + + return force; } -function extent() { - var x0 = 0, - y0 = 0, - x1 = 960, - y1 = 500, - cache, - cacheStream, - clip; +exports.forceCenter = center; +exports.forceCollide = collide; +exports.forceLink = link; +exports.forceManyBody = manyBody; +exports.forceRadial = radial; +exports.forceSimulation = simulation; +exports.forceX = x$2; +exports.forceY = y$2; - return clip = { - stream: function(stream) { - return cache && cacheStream === stream ? cache : cache = clipRectangle(x0, y0, x1, y1)(cacheStream = stream); - }, - extent: function(_) { - return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]]; - } - }; -} +Object.defineProperty(exports, '__esModule', { value: true }); -var lengthSum = adder(), - lambda0$2, - sinPhi0$1, - cosPhi0$1; +}))); -var lengthStream = { - sphere: noop, - point: noop, - lineStart: lengthLineStart, - lineEnd: noop, - polygonStart: noop, - polygonEnd: noop -}; +},{"d3-collection":135,"d3-dispatch":137,"d3-quadtree":145,"d3-timer":150}],139:[function(_dereq_,module,exports){ +// https://d3js.org/d3-format/ v1.4.5 Copyright 2020 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); +}(this, (function (exports) { 'use strict'; -function lengthLineStart() { - lengthStream.point = lengthPointFirst; - lengthStream.lineEnd = lengthLineEnd; +function formatDecimal(x) { + return Math.abs(x = Math.round(x)) >= 1e21 + ? x.toLocaleString("en").replace(/,/g, "") + : x.toString(10); } -function lengthLineEnd() { - lengthStream.point = lengthStream.lineEnd = noop; -} +// Computes the decimal coefficient and exponent of the specified number x with +// significant digits p, where x is positive and p is in [1, 21] or undefined. +// For example, formatDecimalParts(1.23) returns ["123", 0]. +function formatDecimalParts(x, p) { + if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity + var i, coefficient = x.slice(0, i); -function lengthPointFirst(lambda, phi) { - lambda *= radians, phi *= radians; - lambda0$2 = lambda, sinPhi0$1 = sin(phi), cosPhi0$1 = cos(phi); - lengthStream.point = lengthPoint; + // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ + // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). + return [ + coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, + +x.slice(i + 1) + ]; } -function lengthPoint(lambda, phi) { - lambda *= radians, phi *= radians; - var sinPhi = sin(phi), - cosPhi = cos(phi), - delta = abs(lambda - lambda0$2), - cosDelta = cos(delta), - sinDelta = sin(delta), - x = cosPhi * sinDelta, - y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta, - z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta; - lengthSum.add(atan2(sqrt(x * x + y * y), z)); - lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi; +function exponent(x) { + return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN; } -function length(object) { - lengthSum.reset(); - geoStream(object, lengthStream); - return +lengthSum; -} +function formatGroup(grouping, thousands) { + return function(value, width) { + var i = value.length, + t = [], + j = 0, + g = grouping[0], + length = 0; -var coordinates = [null, null], - object = {type: "LineString", coordinates: coordinates}; + while (i > 0 && g > 0) { + if (length + g + 1 > width) g = Math.max(1, width - length); + t.push(value.substring(i -= g, i + g)); + if ((length += g + 1) > width) break; + g = grouping[j = (j + 1) % grouping.length]; + } -function distance(a, b) { - coordinates[0] = a; - coordinates[1] = b; - return length(object); + return t.reverse().join(thousands); + }; } -var containsObjectType = { - Feature: function(object, point) { - return containsGeometry(object.geometry, point); - }, - FeatureCollection: function(object, point) { - var features = object.features, i = -1, n = features.length; - while (++i < n) if (containsGeometry(features[i].geometry, point)) return true; - return false; - } -}; +function formatNumerals(numerals) { + return function(value) { + return value.replace(/[0-9]/g, function(i) { + return numerals[+i]; + }); + }; +} -var containsGeometryType = { - Sphere: function() { - return true; - }, - Point: function(object, point) { - return containsPoint(object.coordinates, point); - }, - MultiPoint: function(object, point) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) if (containsPoint(coordinates[i], point)) return true; - return false; - }, - LineString: function(object, point) { - return containsLine(object.coordinates, point); - }, - MultiLineString: function(object, point) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) if (containsLine(coordinates[i], point)) return true; - return false; - }, - Polygon: function(object, point) { - return containsPolygon(object.coordinates, point); - }, - MultiPolygon: function(object, point) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) if (containsPolygon(coordinates[i], point)) return true; - return false; - }, - GeometryCollection: function(object, point) { - var geometries = object.geometries, i = -1, n = geometries.length; - while (++i < n) if (containsGeometry(geometries[i], point)) return true; - return false; - } -}; +// [[fill]align][sign][symbol][0][width][,][.precision][~][type] +var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; -function containsGeometry(geometry, point) { - return geometry && containsGeometryType.hasOwnProperty(geometry.type) - ? containsGeometryType[geometry.type](geometry, point) - : false; +function formatSpecifier(specifier) { + if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); + var match; + return new FormatSpecifier({ + fill: match[1], + align: match[2], + sign: match[3], + symbol: match[4], + zero: match[5], + width: match[6], + comma: match[7], + precision: match[8] && match[8].slice(1), + trim: match[9], + type: match[10] + }); } -function containsPoint(coordinates, point) { - return distance(coordinates, point) === 0; +formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof + +function FormatSpecifier(specifier) { + this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; + this.align = specifier.align === undefined ? ">" : specifier.align + ""; + this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; + this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; + this.zero = !!specifier.zero; + this.width = specifier.width === undefined ? undefined : +specifier.width; + this.comma = !!specifier.comma; + this.precision = specifier.precision === undefined ? undefined : +specifier.precision; + this.trim = !!specifier.trim; + this.type = specifier.type === undefined ? "" : specifier.type + ""; } -function containsLine(coordinates, point) { - var ao, bo, ab; - for (var i = 0, n = coordinates.length; i < n; i++) { - bo = distance(coordinates[i], point); - if (bo === 0) return true; - if (i > 0) { - ab = distance(coordinates[i], coordinates[i - 1]); - if ( - ab > 0 && - ao <= ab && - bo <= ab && - (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < epsilon2 * ab - ) - return true; +FormatSpecifier.prototype.toString = function() { + return this.fill + + this.align + + this.sign + + this.symbol + + (this.zero ? "0" : "") + + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + + (this.comma ? "," : "") + + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + + (this.trim ? "~" : "") + + this.type; +}; + +// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. +function formatTrim(s) { + out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { + switch (s[i]) { + case ".": i0 = i1 = i; break; + case "0": if (i0 === 0) i0 = i; i1 = i; break; + default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; } - ao = bo; } - return false; + return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; } -function containsPolygon(coordinates, point) { - return !!polygonContains(coordinates.map(ringRadians), pointRadians(point)); -} +var prefixExponent; -function ringRadians(ring) { - return ring = ring.map(pointRadians), ring.pop(), ring; +function formatPrefixAuto(x, p) { + var d = formatDecimalParts(x, p); + if (!d) return x + ""; + var coefficient = d[0], + exponent = d[1], + i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, + n = coefficient.length; + return i === n ? coefficient + : i > n ? coefficient + new Array(i - n + 1).join("0") + : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) + : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! } -function pointRadians(point) { - return [point[0] * radians, point[1] * radians]; +function formatRounded(x, p) { + var d = formatDecimalParts(x, p); + if (!d) return x + ""; + var coefficient = d[0], + exponent = d[1]; + return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient + : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) + : coefficient + new Array(exponent - coefficient.length + 2).join("0"); } -function contains(object, point) { - return (object && containsObjectType.hasOwnProperty(object.type) - ? containsObjectType[object.type] - : containsGeometry)(object, point); -} +var formatTypes = { + "%": function(x, p) { return (x * 100).toFixed(p); }, + "b": function(x) { return Math.round(x).toString(2); }, + "c": function(x) { return x + ""; }, + "d": formatDecimal, + "e": function(x, p) { return x.toExponential(p); }, + "f": function(x, p) { return x.toFixed(p); }, + "g": function(x, p) { return x.toPrecision(p); }, + "o": function(x) { return Math.round(x).toString(8); }, + "p": function(x, p) { return formatRounded(x * 100, p); }, + "r": formatRounded, + "s": formatPrefixAuto, + "X": function(x) { return Math.round(x).toString(16).toUpperCase(); }, + "x": function(x) { return Math.round(x).toString(16); } +}; -function graticuleX(y0, y1, dy) { - var y = d3Array.range(y0, y1 - epsilon, dy).concat(y1); - return function(x) { return y.map(function(y) { return [x, y]; }); }; +function identity(x) { + return x; } -function graticuleY(x0, x1, dx) { - var x = d3Array.range(x0, x1 - epsilon, dx).concat(x1); - return function(y) { return x.map(function(x) { return [x, y]; }); }; -} +var map = Array.prototype.map, + prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; -function graticule() { - var x1, x0, X1, X0, - y1, y0, Y1, Y0, - dx = 10, dy = dx, DX = 90, DY = 360, - x, y, X, Y, - precision = 2.5; +function formatLocale(locale) { + var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), + currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", + currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", + decimal = locale.decimal === undefined ? "." : locale.decimal + "", + numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)), + percent = locale.percent === undefined ? "%" : locale.percent + "", + minus = locale.minus === undefined ? "-" : locale.minus + "", + nan = locale.nan === undefined ? "NaN" : locale.nan + ""; - function graticule() { - return {type: "MultiLineString", coordinates: lines()}; - } + function newFormat(specifier) { + specifier = formatSpecifier(specifier); - function lines() { - return d3Array.range(ceil(X0 / DX) * DX, X1, DX).map(X) - .concat(d3Array.range(ceil(Y0 / DY) * DY, Y1, DY).map(Y)) - .concat(d3Array.range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x)) - .concat(d3Array.range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y)); - } + var fill = specifier.fill, + align = specifier.align, + sign = specifier.sign, + symbol = specifier.symbol, + zero = specifier.zero, + width = specifier.width, + comma = specifier.comma, + precision = specifier.precision, + trim = specifier.trim, + type = specifier.type; - graticule.lines = function() { - return lines().map(function(coordinates) { return {type: "LineString", coordinates: coordinates}; }); - }; + // The "n" type is an alias for ",g". + if (type === "n") comma = true, type = "g"; - graticule.outline = function() { - return { - type: "Polygon", - coordinates: [ - X(X0).concat( - Y(Y1).slice(1), - X(X1).reverse().slice(1), - Y(Y0).reverse().slice(1)) - ] - }; - }; + // The "" type, and any invalid type, is an alias for ".12~g". + else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g"; - graticule.extent = function(_) { - if (!arguments.length) return graticule.extentMinor(); - return graticule.extentMajor(_).extentMinor(_); - }; + // If zero fill is specified, padding goes after sign and before digits. + if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; - graticule.extentMajor = function(_) { - if (!arguments.length) return [[X0, Y0], [X1, Y1]]; - X0 = +_[0][0], X1 = +_[1][0]; - Y0 = +_[0][1], Y1 = +_[1][1]; - if (X0 > X1) _ = X0, X0 = X1, X1 = _; - if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; - return graticule.precision(precision); - }; + // Compute the prefix and suffix. + // For SI-prefix, the suffix is lazily computed. + var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", + suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; - graticule.extentMinor = function(_) { - if (!arguments.length) return [[x0, y0], [x1, y1]]; - x0 = +_[0][0], x1 = +_[1][0]; - y0 = +_[0][1], y1 = +_[1][1]; - if (x0 > x1) _ = x0, x0 = x1, x1 = _; - if (y0 > y1) _ = y0, y0 = y1, y1 = _; - return graticule.precision(precision); - }; + // What format function should we use? + // Is this an integer type? + // Can this type generate exponential notation? + var formatType = formatTypes[type], + maybeSuffix = /[defgprs%]/.test(type); - graticule.step = function(_) { - if (!arguments.length) return graticule.stepMinor(); - return graticule.stepMajor(_).stepMinor(_); - }; + // Set the default precision if not specified, + // or clamp the specified precision to the supported range. + // For significant precision, it must be in [1, 21]. + // For fixed precision, it must be in [0, 20]. + precision = precision === undefined ? 6 + : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) + : Math.max(0, Math.min(20, precision)); - graticule.stepMajor = function(_) { - if (!arguments.length) return [DX, DY]; - DX = +_[0], DY = +_[1]; - return graticule; - }; + function format(value) { + var valuePrefix = prefix, + valueSuffix = suffix, + i, n, c; - graticule.stepMinor = function(_) { - if (!arguments.length) return [dx, dy]; - dx = +_[0], dy = +_[1]; - return graticule; - }; + if (type === "c") { + valueSuffix = formatType(value) + valueSuffix; + value = ""; + } else { + value = +value; - graticule.precision = function(_) { - if (!arguments.length) return precision; - precision = +_; - x = graticuleX(y0, y1, 90); - y = graticuleY(x0, x1, precision); - X = graticuleX(Y0, Y1, 90); - Y = graticuleY(X0, X1, precision); - return graticule; - }; + // Determine the sign. -0 is not less than 0, but 1 / -0 is! + var valueNegative = value < 0 || 1 / value < 0; - return graticule - .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]]) - .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]); -} + // Perform the initial formatting. + value = isNaN(value) ? nan : formatType(Math.abs(value), precision); -function graticule10() { - return graticule()(); -} + // Trim insignificant zeros. + if (trim) value = formatTrim(value); -function interpolate(a, b) { - var x0 = a[0] * radians, - y0 = a[1] * radians, - x1 = b[0] * radians, - y1 = b[1] * radians, - cy0 = cos(y0), - sy0 = sin(y0), - cy1 = cos(y1), - sy1 = sin(y1), - kx0 = cy0 * cos(x0), - ky0 = cy0 * sin(x0), - kx1 = cy1 * cos(x1), - ky1 = cy1 * sin(x1), - d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))), - k = sin(d); + // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. + if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; - var interpolate = d ? function(t) { - var B = sin(t *= d) / k, - A = sin(d - t) / k, - x = A * kx0 + B * kx1, - y = A * ky0 + B * ky1, - z = A * sy0 + B * sy1; - return [ - atan2(y, x) * degrees, - atan2(z, sqrt(x * x + y * y)) * degrees - ]; - } : function() { - return [x0 * degrees, y0 * degrees]; - }; + // Compute the prefix and suffix. + valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; + valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); - interpolate.distance = d; + // Break the formatted value into the integer “value” part that can be + // grouped, and fractional or exponential “suffix” part that is not. + if (maybeSuffix) { + i = -1, n = value.length; + while (++i < n) { + if (c = value.charCodeAt(i), 48 > c || c > 57) { + valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; + value = value.slice(0, i); + break; + } + } + } + } - return interpolate; -} + // If the fill character is not "0", grouping is applied before padding. + if (comma && !zero) value = group(value, Infinity); -function identity(x) { - return x; -} + // Compute the padding. + var length = valuePrefix.length + value.length + valueSuffix.length, + padding = length < width ? new Array(width - length + 1).join(fill) : ""; -var areaSum$1 = adder(), - areaRingSum$1 = adder(), - x00, - y00, - x0$1, - y0$1; + // If the fill character is "0", grouping is applied after padding. + if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; -var areaStream$1 = { - point: noop, - lineStart: noop, - lineEnd: noop, - polygonStart: function() { - areaStream$1.lineStart = areaRingStart$1; - areaStream$1.lineEnd = areaRingEnd$1; - }, - polygonEnd: function() { - areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop; - areaSum$1.add(abs(areaRingSum$1)); - areaRingSum$1.reset(); - }, - result: function() { - var area = areaSum$1 / 2; - areaSum$1.reset(); - return area; + // Reconstruct the final output based on the desired alignment. + switch (align) { + case "<": value = valuePrefix + value + valueSuffix + padding; break; + case "=": value = valuePrefix + padding + value + valueSuffix; break; + case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; + default: value = padding + valuePrefix + value + valueSuffix; break; + } + + return numerals(value); + } + + format.toString = function() { + return specifier + ""; + }; + + return format; } -}; -function areaRingStart$1() { - areaStream$1.point = areaPointFirst$1; + function formatPrefix(specifier, value) { + var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), + e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, + k = Math.pow(10, -e), + prefix = prefixes[8 + e / 3]; + return function(value) { + return f(k * value) + prefix; + }; + } + + return { + format: newFormat, + formatPrefix: formatPrefix + }; } -function areaPointFirst$1(x, y) { - areaStream$1.point = areaPoint$1; - x00 = x0$1 = x, y00 = y0$1 = y; +var locale; + +defaultLocale({ + decimal: ".", + thousands: ",", + grouping: [3], + currency: ["$", ""], + minus: "-" +}); + +function defaultLocale(definition) { + locale = formatLocale(definition); + exports.format = locale.format; + exports.formatPrefix = locale.formatPrefix; + return locale; } -function areaPoint$1(x, y) { - areaRingSum$1.add(y0$1 * x - x0$1 * y); - x0$1 = x, y0$1 = y; +function precisionFixed(step) { + return Math.max(0, -exponent(Math.abs(step))); } -function areaRingEnd$1() { - areaPoint$1(x00, y00); +function precisionPrefix(step, value) { + return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); } -var x0$2 = Infinity, - y0$2 = x0$2, - x1 = -x0$2, - y1 = x1; +function precisionRound(step, max) { + step = Math.abs(step), max = Math.abs(max) - step; + return Math.max(0, exponent(max) - exponent(step)) + 1; +} -var boundsStream$1 = { - point: boundsPoint$1, - lineStart: noop, - lineEnd: noop, - polygonStart: noop, - polygonEnd: noop, - result: function() { - var bounds = [[x0$2, y0$2], [x1, y1]]; - x1 = y1 = -(y0$2 = x0$2 = Infinity); - return bounds; - } -}; +exports.FormatSpecifier = FormatSpecifier; +exports.formatDefaultLocale = defaultLocale; +exports.formatLocale = formatLocale; +exports.formatSpecifier = formatSpecifier; +exports.precisionFixed = precisionFixed; +exports.precisionPrefix = precisionPrefix; +exports.precisionRound = precisionRound; -function boundsPoint$1(x, y) { - if (x < x0$2) x0$2 = x; - if (x > x1) x1 = x; - if (y < y0$2) y0$2 = y; - if (y > y1) y1 = y; -} +Object.defineProperty(exports, '__esModule', { value: true }); -// TODO Enforce positive area for exterior, negative area for interior? +}))); -var X0$1 = 0, - Y0$1 = 0, - Z0$1 = 0, - X1$1 = 0, - Y1$1 = 0, - Z1$1 = 0, - X2$1 = 0, - Y2$1 = 0, - Z2$1 = 0, - x00$1, - y00$1, - x0$3, - y0$3; +},{}],140:[function(_dereq_,module,exports){ +// https://d3js.org/d3-geo-projection/ v2.9.0 Copyright 2020 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-geo'), _dereq_('d3-array')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-geo', 'd3-array'], factory) : +(factory((global.d3 = global.d3 || {}),global.d3,global.d3)); +}(this, (function (exports,d3Geo,d3Array) { 'use strict'; -var centroidStream$1 = { - point: centroidPoint$1, - lineStart: centroidLineStart$1, - lineEnd: centroidLineEnd$1, - polygonStart: function() { - centroidStream$1.lineStart = centroidRingStart$1; - centroidStream$1.lineEnd = centroidRingEnd$1; - }, - polygonEnd: function() { - centroidStream$1.point = centroidPoint$1; - centroidStream$1.lineStart = centroidLineStart$1; - centroidStream$1.lineEnd = centroidLineEnd$1; - }, - result: function() { - var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1] - : Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1] - : Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1] - : [NaN, NaN]; - X0$1 = Y0$1 = Z0$1 = - X1$1 = Y1$1 = Z1$1 = - X2$1 = Y2$1 = Z2$1 = 0; - return centroid; - } -}; +var abs = Math.abs; +var atan = Math.atan; +var atan2 = Math.atan2; +var cos = Math.cos; +var exp = Math.exp; +var floor = Math.floor; +var log = Math.log; +var max = Math.max; +var min = Math.min; +var pow = Math.pow; +var round = Math.round; +var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }; +var sin = Math.sin; +var tan = Math.tan; -function centroidPoint$1(x, y) { - X0$1 += x; - Y0$1 += y; - ++Z0$1; -} +var epsilon = 1e-6; +var epsilon2 = 1e-12; +var pi = Math.PI; +var halfPi = pi / 2; +var quarterPi = pi / 4; +var sqrt1_2 = Math.SQRT1_2; +var sqrt2 = sqrt(2); +var sqrtPi = sqrt(pi); +var tau = pi * 2; +var degrees = 180 / pi; +var radians = pi / 180; -function centroidLineStart$1() { - centroidStream$1.point = centroidPointFirstLine; +function sinci(x) { + return x ? x / Math.sin(x) : 1; } -function centroidPointFirstLine(x, y) { - centroidStream$1.point = centroidPointLine; - centroidPoint$1(x0$3 = x, y0$3 = y); +function asin(x) { + return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x); } -function centroidPointLine(x, y) { - var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy); - X1$1 += z * (x0$3 + x) / 2; - Y1$1 += z * (y0$3 + y) / 2; - Z1$1 += z; - centroidPoint$1(x0$3 = x, y0$3 = y); +function acos(x) { + return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); } -function centroidLineEnd$1() { - centroidStream$1.point = centroidPoint$1; +function sqrt(x) { + return x > 0 ? Math.sqrt(x) : 0; } -function centroidRingStart$1() { - centroidStream$1.point = centroidPointFirstRing; +function tanh(x) { + x = exp(2 * x); + return (x - 1) / (x + 1); } -function centroidRingEnd$1() { - centroidPointRing(x00$1, y00$1); +function sinh(x) { + return (exp(x) - exp(-x)) / 2; } -function centroidPointFirstRing(x, y) { - centroidStream$1.point = centroidPointRing; - centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y); +function cosh(x) { + return (exp(x) + exp(-x)) / 2; } -function centroidPointRing(x, y) { - var dx = x - x0$3, - dy = y - y0$3, - z = sqrt(dx * dx + dy * dy); - - X1$1 += z * (x0$3 + x) / 2; - Y1$1 += z * (y0$3 + y) / 2; - Z1$1 += z; - - z = y0$3 * x - x0$3 * y; - X2$1 += z * (x0$3 + x); - Y2$1 += z * (y0$3 + y); - Z2$1 += z * 3; - centroidPoint$1(x0$3 = x, y0$3 = y); +function arsinh(x) { + return log(x + sqrt(x * x + 1)); } -function PathContext(context) { - this._context = context; +function arcosh(x) { + return log(x + sqrt(x * x - 1)); } -PathContext.prototype = { - _radius: 4.5, - pointRadius: function(_) { - return this._radius = _, this; - }, - polygonStart: function() { - this._line = 0; - }, - polygonEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._line === 0) this._context.closePath(); - this._point = NaN; - }, - point: function(x, y) { - switch (this._point) { - case 0: { - this._context.moveTo(x, y); - this._point = 1; - break; - } - case 1: { - this._context.lineTo(x, y); - break; - } - default: { - this._context.moveTo(x + this._radius, y); - this._context.arc(x, y, this._radius, 0, tau); - break; - } - } - }, - result: noop -}; - -var lengthSum$1 = adder(), - lengthRing, - x00$2, - y00$2, - x0$4, - y0$4; +function airyRaw(beta) { + var tanBeta_2 = tan(beta / 2), + b = 2 * log(cos(beta / 2)) / (tanBeta_2 * tanBeta_2); -var lengthStream$1 = { - point: noop, - lineStart: function() { - lengthStream$1.point = lengthPointFirst$1; - }, - lineEnd: function() { - if (lengthRing) lengthPoint$1(x00$2, y00$2); - lengthStream$1.point = noop; - }, - polygonStart: function() { - lengthRing = true; - }, - polygonEnd: function() { - lengthRing = null; - }, - result: function() { - var length = +lengthSum$1; - lengthSum$1.reset(); - return length; + function forward(x, y) { + var cosx = cos(x), + cosy = cos(y), + siny = sin(y), + cosz = cosy * cosx, + k = -((1 - cosz ? log((1 + cosz) / 2) / (1 - cosz) : -0.5) + b / (1 + cosz)); + return [k * cosy * sin(x), k * siny]; } -}; -function lengthPointFirst$1(x, y) { - lengthStream$1.point = lengthPoint$1; - x00$2 = x0$4 = x, y00$2 = y0$4 = y; + forward.invert = function(x, y) { + var r = sqrt(x * x + y * y), + z = -beta / 2, + i = 50, delta; + if (!r) return [0, 0]; + do { + var z_2 = z / 2, + cosz_2 = cos(z_2), + sinz_2 = sin(z_2), + tanz_2 = sinz_2 / cosz_2, + lnsecz_2 = -log(abs(cosz_2)); + z -= delta = (2 / tanz_2 * lnsecz_2 - b * tanz_2 - r) / (-lnsecz_2 / (sinz_2 * sinz_2) + 1 - b / (2 * cosz_2 * cosz_2)) * (cosz_2 < 0 ? 0.7 : 1); + } while (abs(delta) > epsilon && --i > 0); + var sinz = sin(z); + return [atan2(x * sinz, r * cos(z)), asin(y * sinz / r)]; + }; + + return forward; } -function lengthPoint$1(x, y) { - x0$4 -= x, y0$4 -= y; - lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4)); - x0$4 = x, y0$4 = y; +function airy() { + var beta = halfPi, + m = d3Geo.geoProjectionMutator(airyRaw), + p = m(beta); + + p.radius = function(_) { + return arguments.length ? m(beta = _ * radians) : beta * degrees; + }; + + return p + .scale(179.976) + .clipAngle(147); } -function PathString() { - this._string = []; +function aitoffRaw(x, y) { + var cosy = cos(y), sincia = sinci(acos(cosy * cos(x /= 2))); + return [2 * cosy * sin(x) * sincia, sin(y) * sincia]; } -PathString.prototype = { - _radius: 4.5, - _circle: circle$1(4.5), - pointRadius: function(_) { - if ((_ = +_) !== this._radius) this._radius = _, this._circle = null; - return this; - }, - polygonStart: function() { - this._line = 0; - }, - polygonEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._line === 0) this._string.push("Z"); - this._point = NaN; - }, - point: function(x, y) { - switch (this._point) { - case 0: { - this._string.push("M", x, ",", y); - this._point = 1; - break; - } - case 1: { - this._string.push("L", x, ",", y); - break; - } - default: { - if (this._circle == null) this._circle = circle$1(this._radius); - this._string.push("M", x, ",", y, this._circle); - break; - } - } - }, - result: function() { - if (this._string.length) { - var result = this._string.join(""); - this._string = []; - return result; - } else { - return null; - } - } +// Abort if [x, y] is not within an ellipse centered at [0, 0] with +// semi-major axis pi and semi-minor axis pi/2. +aitoffRaw.invert = function(x, y) { + if (x * x + 4 * y * y > pi * pi + epsilon) return; + var x1 = x, y1 = y, i = 25; + do { + var sinx = sin(x1), + sinx_2 = sin(x1 / 2), + cosx_2 = cos(x1 / 2), + siny = sin(y1), + cosy = cos(y1), + sin_2y = sin(2 * y1), + sin2y = siny * siny, + cos2y = cosy * cosy, + sin2x_2 = sinx_2 * sinx_2, + c = 1 - cos2y * cosx_2 * cosx_2, + e = c ? acos(cosy * cosx_2) * sqrt(f = 1 / c) : f = 0, + f, + fx = 2 * e * cosy * sinx_2 - x, + fy = e * siny - y, + dxdx = f * (cos2y * sin2x_2 + e * cosy * cosx_2 * sin2y), + dxdy = f * (0.5 * sinx * sin_2y - e * 2 * siny * sinx_2), + dydx = f * 0.25 * (sin_2y * sinx_2 - e * siny * cos2y * sinx), + dydy = f * (sin2y * cosx_2 + e * sin2x_2 * cosy), + z = dxdy * dydx - dydy * dxdx; + if (!z) break; + var dx = (fy * dxdy - fx * dydy) / z, + dy = (fx * dydx - fy * dxdx) / z; + x1 -= dx, y1 -= dy; + } while ((abs(dx) > epsilon || abs(dy) > epsilon) && --i > 0); + return [x1, y1]; }; -function circle$1(radius) { - return "m0," + radius - + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius - + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius - + "z"; +function aitoff() { + return d3Geo.geoProjection(aitoffRaw) + .scale(152.63); } -function index(projection, context) { - var pointRadius = 4.5, - projectionStream, - contextStream; +function armadilloRaw(phi0) { + var sinPhi0 = sin(phi0), + cosPhi0 = cos(phi0), + sPhi0 = phi0 >= 0 ? 1 : -1, + tanPhi0 = tan(sPhi0 * phi0), + k = (1 + sinPhi0 - cosPhi0) / 2; - function path(object) { - if (object) { - if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); - geoStream(object, projectionStream(contextStream)); - } - return contextStream.result(); + function forward(lambda, phi) { + var cosPhi = cos(phi), + cosLambda = cos(lambda /= 2); + return [ + (1 + cosPhi) * sin(lambda), + (sPhi0 * phi > -atan2(cosLambda, tanPhi0) - 1e-3 ? 0 : -sPhi0 * 10) + k + sin(phi) * cosPhi0 - (1 + cosPhi) * sinPhi0 * cosLambda // TODO D3 core should allow null or [NaN, NaN] to be returned. + ]; } - path.area = function(object) { - geoStream(object, projectionStream(areaStream$1)); - return areaStream$1.result(); - }; - - path.measure = function(object) { - geoStream(object, projectionStream(lengthStream$1)); - return lengthStream$1.result(); - }; - - path.bounds = function(object) { - geoStream(object, projectionStream(boundsStream$1)); - return boundsStream$1.result(); + forward.invert = function(x, y) { + var lambda = 0, + phi = 0, + i = 50; + do { + var cosLambda = cos(lambda), + sinLambda = sin(lambda), + cosPhi = cos(phi), + sinPhi = sin(phi), + A = 1 + cosPhi, + fx = A * sinLambda - x, + fy = k + sinPhi * cosPhi0 - A * sinPhi0 * cosLambda - y, + dxdLambda = A * cosLambda / 2, + dxdPhi = -sinLambda * sinPhi, + dydLambda = sinPhi0 * A * sinLambda / 2, + dydPhi = cosPhi0 * cosPhi + sinPhi0 * cosLambda * sinPhi, + denominator = dxdPhi * dydLambda - dydPhi * dxdLambda, + dLambda = (fy * dxdPhi - fx * dydPhi) / denominator / 2, + dPhi = (fx * dydLambda - fy * dxdLambda) / denominator; + if (abs(dPhi) > 2) dPhi /= 2; + lambda -= dLambda, phi -= dPhi; + } while ((abs(dLambda) > epsilon || abs(dPhi) > epsilon) && --i > 0); + return sPhi0 * phi > -atan2(cos(lambda), tanPhi0) - 1e-3 ? [lambda * 2, phi] : null; }; - path.centroid = function(object) { - geoStream(object, projectionStream(centroidStream$1)); - return centroidStream$1.result(); - }; + return forward; +} - path.projection = function(_) { - return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection; - }; +function armadillo() { + var phi0 = 20 * radians, + sPhi0 = phi0 >= 0 ? 1 : -1, + tanPhi0 = tan(sPhi0 * phi0), + m = d3Geo.geoProjectionMutator(armadilloRaw), + p = m(phi0), + stream_ = p.stream; - path.context = function(_) { - if (!arguments.length) return context; - contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _); - if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); - return path; + p.parallel = function(_) { + if (!arguments.length) return phi0 * degrees; + tanPhi0 = tan((sPhi0 = (phi0 = _ * radians) >= 0 ? 1 : -1) * phi0); + return m(phi0); }; - path.pointRadius = function(_) { - if (!arguments.length) return pointRadius; - pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); - return path; + p.stream = function(stream) { + var rotate = p.rotate(), + rotateStream = stream_(stream), + sphereStream = (p.rotate([0, 0]), stream_(stream)), + precision = p.precision(); + p.rotate(rotate); + rotateStream.sphere = function() { + sphereStream.polygonStart(), sphereStream.lineStart(); + for (var lambda = sPhi0 * -180; sPhi0 * lambda < 180; lambda += sPhi0 * 90) + sphereStream.point(lambda, sPhi0 * 90); + if (phi0) while (sPhi0 * (lambda -= 3 * sPhi0 * precision) >= -180) { + sphereStream.point(lambda, sPhi0 * -atan2(cos(lambda * radians / 2), tanPhi0) * degrees); + } + sphereStream.lineEnd(), sphereStream.polygonEnd(); + }; + return rotateStream; }; - return path.projection(projection).context(context); + return p + .scale(218.695) + .center([0, 28.0974]); } -function transform(methods) { - return { - stream: transformer(methods) - }; +function augustRaw(lambda, phi) { + var tanPhi = tan(phi / 2), + k = sqrt(1 - tanPhi * tanPhi), + c = 1 + k * cos(lambda /= 2), + x = sin(lambda) * k / c, + y = tanPhi / c, + x2 = x * x, + y2 = y * y; + return [ + 4 / 3 * x * (3 + x2 - 3 * y2), + 4 / 3 * y * (3 + 3 * x2 - y2) + ]; } -function transformer(methods) { - return function(stream) { - var s = new TransformStream; - for (var key in methods) s[key] = methods[key]; - s.stream = stream; - return s; - }; +augustRaw.invert = function(x, y) { + x *= 3 / 8, y *= 3 / 8; + if (!x && abs(y) > 1) return null; + var x2 = x * x, + y2 = y * y, + s = 1 + x2 + y2, + sin3Eta = sqrt((s - sqrt(s * s - 4 * y * y)) / 2), + eta = asin(sin3Eta) / 3, + xi = sin3Eta ? arcosh(abs(y / sin3Eta)) / 3 : arsinh(abs(x)) / 3, + cosEta = cos(eta), + coshXi = cosh(xi), + d = coshXi * coshXi - cosEta * cosEta; + return [ + sign(x) * 2 * atan2(sinh(xi) * cosEta, 0.25 - d), + sign(y) * 2 * atan2(coshXi * sin(eta), 0.25 + d) + ]; +}; + +function august() { + return d3Geo.geoProjection(augustRaw) + .scale(66.1603); } -function TransformStream() {} +var sqrt8 = sqrt(8), + phi0 = log(1 + sqrt2); -TransformStream.prototype = { - constructor: TransformStream, - point: function(x, y) { this.stream.point(x, y); }, - sphere: function() { this.stream.sphere(); }, - lineStart: function() { this.stream.lineStart(); }, - lineEnd: function() { this.stream.lineEnd(); }, - polygonStart: function() { this.stream.polygonStart(); }, - polygonEnd: function() { this.stream.polygonEnd(); } +function bakerRaw(lambda, phi) { + var phi0 = abs(phi); + return phi0 < quarterPi + ? [lambda, log(tan(quarterPi + phi / 2))] + : [lambda * cos(phi0) * (2 * sqrt2 - 1 / sin(phi0)), sign(phi) * (2 * sqrt2 * (phi0 - quarterPi) - log(tan(phi0 / 2)))]; +} + +bakerRaw.invert = function(x, y) { + if ((y0 = abs(y)) < phi0) return [x, 2 * atan(exp(y)) - halfPi]; + var phi = quarterPi, i = 25, delta, y0; + do { + var cosPhi_2 = cos(phi / 2), tanPhi_2 = tan(phi / 2); + phi -= delta = (sqrt8 * (phi - quarterPi) - log(tanPhi_2) - y0) / (sqrt8 - cosPhi_2 * cosPhi_2 / (2 * tanPhi_2)); + } while (abs(delta) > epsilon2 && --i > 0); + return [x / (cos(phi) * (sqrt8 - 1 / sin(phi))), sign(y) * phi]; }; -function fit(projection, fitBounds, object) { - var clip = projection.clipExtent && projection.clipExtent(); - projection.scale(150).translate([0, 0]); - if (clip != null) projection.clipExtent(null); - geoStream(object, projection.stream(boundsStream$1)); - fitBounds(boundsStream$1.result()); - if (clip != null) projection.clipExtent(clip); - return projection; +function baker() { + return d3Geo.geoProjection(bakerRaw) + .scale(112.314); } -function fitExtent(projection, extent, object) { - return fit(projection, function(b) { - var w = extent[1][0] - extent[0][0], - h = extent[1][1] - extent[0][1], - k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), - x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, - y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2; - projection.scale(150 * k).translate([x, y]); - }, object); +function berghausRaw(lobes) { + var k = 2 * pi / lobes; + + function forward(lambda, phi) { + var p = d3Geo.geoAzimuthalEquidistantRaw(lambda, phi); + if (abs(lambda) > halfPi) { // back hemisphere + var theta = atan2(p[1], p[0]), + r = sqrt(p[0] * p[0] + p[1] * p[1]), + theta0 = k * round((theta - halfPi) / k) + halfPi, + alpha = atan2(sin(theta -= theta0), 2 - cos(theta)); // angle relative to lobe end + theta = theta0 + asin(pi / r * sin(alpha)) - alpha; + p[0] = r * cos(theta); + p[1] = r * sin(theta); + } + return p; + } + + forward.invert = function(x, y) { + var r = sqrt(x * x + y * y); + if (r > halfPi) { + var theta = atan2(y, x), + theta0 = k * round((theta - halfPi) / k) + halfPi, + s = theta > theta0 ? -1 : 1, + A = r * cos(theta0 - theta), + cotAlpha = 1 / tan(s * acos((A - pi) / sqrt(pi * (pi - 2 * A) + r * r))); + theta = theta0 + 2 * atan((cotAlpha + s * sqrt(cotAlpha * cotAlpha - 3)) / 3); + x = r * cos(theta), y = r * sin(theta); + } + return d3Geo.geoAzimuthalEquidistantRaw.invert(x, y); + }; + + return forward; } -function fitSize(projection, size, object) { - return fitExtent(projection, [[0, 0], size], object); +function berghaus() { + var lobes = 5, + m = d3Geo.geoProjectionMutator(berghausRaw), + p = m(lobes), + projectionStream = p.stream, + epsilon$$1 = 1e-2, + cr = -cos(epsilon$$1 * radians), + sr = sin(epsilon$$1 * radians); + + p.lobes = function(_) { + return arguments.length ? m(lobes = +_) : lobes; + }; + + p.stream = function(stream) { + var rotate = p.rotate(), + rotateStream = projectionStream(stream), + sphereStream = (p.rotate([0, 0]), projectionStream(stream)); + p.rotate(rotate); + rotateStream.sphere = function() { + sphereStream.polygonStart(), sphereStream.lineStart(); + for (var i = 0, delta = 360 / lobes, delta0 = 2 * pi / lobes, phi = 90 - 180 / lobes, phi0 = halfPi; i < lobes; ++i, phi -= delta, phi0 -= delta0) { + sphereStream.point(atan2(sr * cos(phi0), cr) * degrees, asin(sr * sin(phi0)) * degrees); + if (phi < -90) { + sphereStream.point(-90, -180 - phi - epsilon$$1); + sphereStream.point(-90, -180 - phi + epsilon$$1); + } else { + sphereStream.point(90, phi + epsilon$$1); + sphereStream.point(90, phi - epsilon$$1); + } + } + sphereStream.lineEnd(), sphereStream.polygonEnd(); + }; + return rotateStream; + }; + + return p + .scale(87.8076) + .center([0, 17.1875]) + .clipAngle(180 - 1e-3); } -function fitWidth(projection, width, object) { - return fit(projection, function(b) { - var w = +width, - k = w / (b[1][0] - b[0][0]), - x = (w - k * (b[1][0] + b[0][0])) / 2, - y = -k * b[0][1]; - projection.scale(150 * k).translate([x, y]); - }, object); +function hammerRaw(A, B) { + if (arguments.length < 2) B = A; + if (B === 1) return d3Geo.geoAzimuthalEqualAreaRaw; + if (B === Infinity) return hammerQuarticAuthalicRaw; + + function forward(lambda, phi) { + var coordinates = d3Geo.geoAzimuthalEqualAreaRaw(lambda / B, phi); + coordinates[0] *= A; + return coordinates; + } + + forward.invert = function(x, y) { + var coordinates = d3Geo.geoAzimuthalEqualAreaRaw.invert(x / A, y); + coordinates[0] *= B; + return coordinates; + }; + + return forward; } -function fitHeight(projection, height, object) { - return fit(projection, function(b) { - var h = +height, - k = h / (b[1][1] - b[0][1]), - x = -k * b[0][0], - y = (h - k * (b[1][1] + b[0][1])) / 2; - projection.scale(150 * k).translate([x, y]); - }, object); +function hammerQuarticAuthalicRaw(lambda, phi) { + return [ + lambda * cos(phi) / cos(phi /= 2), + 2 * sin(phi) + ]; } -var maxDepth = 16, // maximum depth of subdivision - cosMinDistance = cos(30 * radians); // cos(minimum angular distance) +hammerQuarticAuthalicRaw.invert = function(x, y) { + var phi = 2 * asin(y / 2); + return [ + x * cos(phi / 2) / cos(phi), + phi + ]; +}; -function resample(project, delta2) { - return +delta2 ? resample$1(project, delta2) : resampleNone(project); +function hammer() { + var B = 2, + m = d3Geo.geoProjectionMutator(hammerRaw), + p = m(B); + + p.coefficient = function(_) { + if (!arguments.length) return B; + return m(B = +_); + }; + + return p + .scale(169.529); } -function resampleNone(project) { - return transformer({ - point: function(x, y) { - x = project(x, y); - this.stream.point(x[0], x[1]); - } - }); +// Approximate Newton-Raphson +// Solve f(x) = y, start from x +function solve(f, y, x) { + var steps = 100, delta, f0, f1; + x = x === undefined ? 0 : +x; + y = +y; + do { + f0 = f(x); + f1 = f(x + epsilon); + if (f0 === f1) f1 = f0 + epsilon; + x -= delta = (-1 * epsilon * (f0 - y)) / (f0 - f1); + } while (steps-- > 0 && abs(delta) > epsilon); + return steps < 0 ? NaN : x; } -function resample$1(project, delta2) { +// Approximate Newton-Raphson in 2D +// Solve f(a,b) = [x,y] +function solve2d(f, MAX_ITERATIONS, eps) { + if (MAX_ITERATIONS === undefined) MAX_ITERATIONS = 40; + if (eps === undefined) eps = epsilon2; + return function(x, y, a, b) { + var err2, da, db; + a = a === undefined ? 0 : +a; + b = b === undefined ? 0 : +b; + for (var i = 0; i < MAX_ITERATIONS; i++) { + var p = f(a, b), + // diffs + tx = p[0] - x, + ty = p[1] - y; + if (abs(tx) < eps && abs(ty) < eps) break; // we're there! - function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) { - var dx = x1 - x0, - dy = y1 - y0, - d2 = dx * dx + dy * dy; - if (d2 > 4 * delta2 && depth--) { - var a = a0 + a1, - b = b0 + b1, - c = c0 + c1, - m = sqrt(a * a + b * b + c * c), - phi2 = asin(c /= m), - lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a), - p = project(lambda2, phi2), - x2 = p[0], - y2 = p[1], - dx2 = x2 - x0, - dy2 = y2 - y0, - dz = dy * dx2 - dx * dy2; - if (dz * dz / d2 > delta2 // perpendicular projected distance - || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end - || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance - resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream); - stream.point(x2, y2); - resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream); + // backtrack if we overshot + var h = tx * tx + ty * ty; + if (h > err2) { + a -= da /= 2; + b -= db /= 2; + continue; } - } - } - return function(stream) { - var lambda00, x00, y00, a00, b00, c00, // first point - lambda0, x0, y0, a0, b0, c0; // previous point - - var resampleStream = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; }, - polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; } - }; + err2 = h; - function point(x, y) { - x = project(x, y); - stream.point(x[0], x[1]); + // partial derivatives + var ea = (a > 0 ? -1 : 1) * eps, + eb = (b > 0 ? -1 : 1) * eps, + pa = f(a + ea, b), + pb = f(a, b + eb), + dxa = (pa[0] - p[0]) / ea, + dya = (pa[1] - p[1]) / ea, + dxb = (pb[0] - p[0]) / eb, + dyb = (pb[1] - p[1]) / eb, + // determinant + D = dyb * dxa - dya * dxb, + // newton step — or half-step for small D + l = (abs(D) < 0.5 ? 0.5 : 1) / D; + da = (ty * dxb - tx * dyb) * l; + db = (tx * dya - ty * dxa) * l; + a += da; + b += db; + if (abs(da) < eps && abs(db) < eps) break; // we're crawling } + return [a, b]; + }; +} - function lineStart() { - x0 = NaN; - resampleStream.point = linePoint; - stream.lineStart(); - } +// Bertin 1953 as a modified Briesemeister +// https://bl.ocks.org/Fil/5b9ee9636dfb6ffa53443c9006beb642 +function bertin1953Raw() { + var hammer$$1 = hammerRaw(1.68, 2), + fu = 1.4, k = 12; - function linePoint(lambda, phi) { - var c = cartesian([lambda, phi]), p = project(lambda, phi); - resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); - stream.point(x0, y0); - } + function forward(lambda, phi) { - function lineEnd() { - resampleStream.point = point; - stream.lineEnd(); + if (lambda + phi < -fu) { + var u = (lambda - phi + 1.6) * (lambda + phi + fu) / 8; + lambda += u; + phi -= 0.8 * u * sin(phi + pi / 2); } - function ringStart() { - lineStart(); - resampleStream.point = ringPoint; - resampleStream.lineEnd = ringEnd; - } + var r = hammer$$1(lambda, phi); - function ringPoint(lambda, phi) { - linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; - resampleStream.point = linePoint; - } + var d = (1 - cos(lambda * phi)) / k; - function ringEnd() { - resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream); - resampleStream.lineEnd = lineEnd; - lineEnd(); + if (r[1] < 0) { + r[0] *= 1 + d; + } + if (r[1] > 0) { + r[1] *= 1 + d / 1.5 * r[0] * r[0]; } - return resampleStream; - }; + return r; + } + + forward.invert = solve2d(forward); + return forward; } -var transformRadians = transformer({ - point: function(x, y) { - this.stream.point(x * radians, y * radians); - } -}); +function bertin() { + // this projection should not be rotated + return d3Geo.geoProjection(bertin1953Raw()) + .rotate([-16.5, -42]) + .scale(176.57) + .center([7.93, 0.09]); +} -function transformRotate(rotate) { - return transformer({ - point: function(x, y) { - var r = rotate(x, y); - return this.stream.point(r[0], r[1]); - } - }); +function mollweideBromleyTheta(cp, phi) { + var cpsinPhi = cp * sin(phi), i = 30, delta; + do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi)); + while (abs(delta) > epsilon && --i > 0); + return phi / 2; } -function scaleTranslate(k, dx, dy, sx, sy) { - function transform(x, y) { - x *= sx; y *= sy; - return [dx + k * x, dy - k * y]; +function mollweideBromleyRaw(cx, cy, cp) { + + function forward(lambda, phi) { + return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)]; } - transform.invert = function(x, y) { - return [(x - dx) / k * sx, (dy - y) / k * sy]; + + forward.invert = function(x, y) { + return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)]; }; - return transform; + + return forward; } -function scaleTranslateRotate(k, dx, dy, sx, sy, alpha) { - var cosAlpha = cos(alpha), - sinAlpha = sin(alpha), - a = cosAlpha * k, - b = sinAlpha * k, - ai = cosAlpha / k, - bi = sinAlpha / k, - ci = (sinAlpha * dy - cosAlpha * dx) / k, - fi = (sinAlpha * dx + cosAlpha * dy) / k; - function transform(x, y) { - x *= sx; y *= sy; - return [a * x - b * y + dx, dy - b * x - a * y]; - } - transform.invert = function(x, y) { - return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)]; - }; - return transform; -} +var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi); -function projection(project) { - return projectionMutator(function() { return project; })(); +function mollweide() { + return d3Geo.geoProjection(mollweideRaw) + .scale(169.529); } -function projectionMutator(projectAt) { - var project, - k = 150, // scale - x = 480, y = 250, // translate - lambda = 0, phi = 0, // center - deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate - alpha = 0, // post-rotate angle - sx = 1, // reflectX - sy = 1, // reflectX - theta = null, preclip = clipAntimeridian, // pre-clip angle - x0 = null, y0, x1, y1, postclip = identity, // post-clip extent - delta2 = 0.5, // precision - projectResample, - projectTransform, - projectRotateTransform, - cache, - cacheStream; - - function projection(point) { - return projectRotateTransform(point[0] * radians, point[1] * radians); - } - - function invert(point) { - point = projectRotateTransform.invert(point[0], point[1]); - return point && [point[0] * degrees, point[1] * degrees]; - } - - projection.stream = function(stream) { - return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream))))); - }; - - projection.preclip = function(_) { - return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip; - }; - - projection.postclip = function(_) { - return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip; - }; - - projection.clipAngle = function(_) { - return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees; - }; - - projection.clipExtent = function(_) { - return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]]; - }; - - projection.scale = function(_) { - return arguments.length ? (k = +_, recenter()) : k; - }; - - projection.translate = function(_) { - return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y]; - }; - - projection.center = function(_) { - return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees]; - }; +var k = 2.00276, + w = 1.11072; - projection.rotate = function(_) { - return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees]; - }; +function boggsRaw(lambda, phi) { + var theta = mollweideBromleyTheta(pi, phi); + return [k * lambda / (1 / cos(phi) + w / cos(theta)), (phi + sqrt2 * sin(theta)) / k]; +} - projection.angle = function(_) { - return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees; - }; +boggsRaw.invert = function(x, y) { + var ky = k * y, theta = y < 0 ? -quarterPi : quarterPi, i = 25, delta, phi; + do { + phi = ky - sqrt2 * sin(theta); + theta -= delta = (sin(2 * theta) + 2 * theta - pi * sin(phi)) / (2 * cos(2 * theta) + 2 + pi * cos(phi) * sqrt2 * cos(theta)); + } while (abs(delta) > epsilon && --i > 0); + phi = ky - sqrt2 * sin(theta); + return [x * (1 / cos(phi) + w / cos(theta)) / k, phi]; +}; - projection.reflectX = function(_) { - return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0; - }; +function boggs() { + return d3Geo.geoProjection(boggsRaw) + .scale(160.857); +} - projection.reflectY = function(_) { - return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0; - }; +function parallel1(projectAt) { + var phi0 = 0, + m = d3Geo.geoProjectionMutator(projectAt), + p = m(phi0); - projection.precision = function(_) { - return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2); + p.parallel = function(_) { + return arguments.length ? m(phi0 = _ * radians) : phi0 * degrees; }; - projection.fitExtent = function(extent, object) { - return fitExtent(projection, extent, object); - }; + return p; +} - projection.fitSize = function(size, object) { - return fitSize(projection, size, object); - }; +function sinusoidalRaw(lambda, phi) { + return [lambda * cos(phi), phi]; +} - projection.fitWidth = function(width, object) { - return fitWidth(projection, width, object); - }; +sinusoidalRaw.invert = function(x, y) { + return [x / cos(y), y]; +}; - projection.fitHeight = function(height, object) { - return fitHeight(projection, height, object); - }; +function sinusoidal() { + return d3Geo.geoProjection(sinusoidalRaw) + .scale(152.63); +} - function recenter() { - var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), - transform = (alpha ? scaleTranslateRotate : scaleTranslate)(k, x - center[0], y - center[1], sx, sy, alpha); - rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma); - projectTransform = compose(project, transform); - projectRotateTransform = compose(rotate, projectTransform); - projectResample = resample(projectTransform, delta2); - return reset(); - } +function bonneRaw(phi0) { + if (!phi0) return sinusoidalRaw; + var cotPhi0 = 1 / tan(phi0); - function reset() { - cache = cacheStream = null; - return projection; + function forward(lambda, phi) { + var rho = cotPhi0 + phi0 - phi, + e = rho ? lambda * cos(phi) / rho : rho; + return [rho * sin(e), cotPhi0 - rho * cos(e)]; } - return function() { - project = projectAt.apply(this, arguments); - projection.invert = project.invert && invert; - return recenter(); + forward.invert = function(x, y) { + var rho = sqrt(x * x + (y = cotPhi0 - y) * y), + phi = cotPhi0 + phi0 - rho; + return [rho / cos(phi) * atan2(x, y), phi]; }; -} - -function conicProjection(projectAt) { - var phi0 = 0, - phi1 = pi / 3, - m = projectionMutator(projectAt), - p = m(phi0, phi1); - p.parallels = function(_) { - return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees]; - }; + return forward; +} - return p; +function bonne() { + return parallel1(bonneRaw) + .scale(123.082) + .center([0, 26.1441]) + .parallel(45); } -function cylindricalEqualAreaRaw(phi0) { - var cosPhi0 = cos(phi0); +function bottomleyRaw(sinPsi) { function forward(lambda, phi) { - return [lambda * cosPhi0, sin(phi) / cosPhi0]; + var rho = halfPi - phi, + eta = rho ? lambda * sinPsi * sin(rho) / rho : rho; + return [rho * sin(eta) / sinPsi, halfPi - rho * cos(eta)]; } forward.invert = function(x, y) { - return [x / cosPhi0, asin(y * cosPhi0)]; + var x1 = x * sinPsi, + y1 = halfPi - y, + rho = sqrt(x1 * x1 + y1 * y1), + eta = atan2(x1, y1); + return [(rho ? rho / sin(rho) : 1) * eta / sinPsi, halfPi - rho]; }; return forward; } -function conicEqualAreaRaw(y0, y1) { - var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2; - - // Are the parallels symmetrical around the Equator? - if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0); +function bottomley() { + var sinPsi = 0.5, + m = d3Geo.geoProjectionMutator(bottomleyRaw), + p = m(sinPsi); - var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n; + p.fraction = function(_) { + return arguments.length ? m(sinPsi = +_) : sinPsi; + }; - function project(x, y) { - var r = sqrt(c - 2 * n * sin(y)) / n; - return [r * sin(x *= n), r0 - r * cos(x)]; - } + return p + .scale(158.837); +} - project.invert = function(x, y) { - var r0y = r0 - y, - l = atan2(x, abs(r0y)) * sign(r0y); - if (r0y * n < 0) - l -= pi * sign(x) * sign(r0y); - return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))]; - }; +var bromleyRaw = mollweideBromleyRaw(1, 4 / pi, pi); - return project; +function bromley() { + return d3Geo.geoProjection(bromleyRaw) + .scale(152.63); } -function conicEqualArea() { - return conicProjection(conicEqualAreaRaw) - .scale(155.424) - .center([0, 33.6442]); +// Azimuthal distance. +function distance(dPhi, c1, s1, c2, s2, dLambda) { + var cosdLambda = cos(dLambda), r; + if (abs(dPhi) > 1 || abs(dLambda) > 1) { + r = acos(s1 * s2 + c1 * c2 * cosdLambda); + } else { + var sindPhi = sin(dPhi / 2), sindLambda = sin(dLambda / 2); + r = 2 * asin(sqrt(sindPhi * sindPhi + c1 * c2 * sindLambda * sindLambda)); + } + return abs(r) > epsilon ? [r, atan2(c2 * sin(dLambda), c1 * s2 - s1 * c2 * cosdLambda)] : [0, 0]; } -function albers() { - return conicEqualArea() - .parallels([29.5, 45.5]) - .scale(1070) - .translate([480, 250]) - .rotate([96, 0]) - .center([-0.6, 38.7]); +// Angle opposite a, and contained between sides of lengths b and c. +function angle(b, c, a) { + return acos((b * b + c * c - a * a) / (2 * b * c)); } -// The projections must have mutually exclusive clip regions on the sphere, -// as this will avoid emitting interleaving lines and polygons. -function multiplex(streams) { - var n = streams.length; - return { - point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); }, - sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); }, - lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); }, - lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); }, - polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); }, - polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); } - }; +// Normalize longitude. +function longitude(lambda) { + return lambda - 2 * pi * floor((lambda + pi) / (2 * pi)); } -// A composite projection for the United States, configured by default for -// 960×500. The projection also works quite well at 960×600 if you change the -// scale to 1285 and adjust the translate accordingly. The set of standard -// parallels for each region comes from USGS, which is published here: -// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers -function albersUsa() { - var cache, - cacheStream, - lower48 = albers(), lower48Point, - alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338 - hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007 - point, pointStream = {point: function(x, y) { point = [x, y]; }}; +function chamberlinRaw(p0, p1, p2) { + var points = [ + [p0[0], p0[1], sin(p0[1]), cos(p0[1])], + [p1[0], p1[1], sin(p1[1]), cos(p1[1])], + [p2[0], p2[1], sin(p2[1]), cos(p2[1])] + ]; - function albersUsa(coordinates) { - var x = coordinates[0], y = coordinates[1]; - return point = null, - (lower48Point.point(x, y), point) - || (alaskaPoint.point(x, y), point) - || (hawaiiPoint.point(x, y), point); + for (var a = points[2], b, i = 0; i < 3; ++i, a = b) { + b = points[i]; + a.v = distance(b[1] - a[1], a[3], a[2], b[3], b[2], b[0] - a[0]); + a.point = [0, 0]; } - albersUsa.invert = function(coordinates) { - var k = lower48.scale(), - t = lower48.translate(), - x = (coordinates[0] - t[0]) / k, - y = (coordinates[1] - t[1]) / k; - return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska - : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii - : lower48).invert(coordinates); - }; - - albersUsa.stream = function(stream) { - return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]); - }; - - albersUsa.precision = function(_) { - if (!arguments.length) return lower48.precision(); - lower48.precision(_), alaska.precision(_), hawaii.precision(_); - return reset(); - }; - - albersUsa.scale = function(_) { - if (!arguments.length) return lower48.scale(); - lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_); - return albersUsa.translate(lower48.translate()); - }; - - albersUsa.translate = function(_) { - if (!arguments.length) return lower48.translate(); - var k = lower48.scale(), x = +_[0], y = +_[1]; - - lower48Point = lower48 - .translate(_) - .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]]) - .stream(pointStream); - - alaskaPoint = alaska - .translate([x - 0.307 * k, y + 0.201 * k]) - .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]]) - .stream(pointStream); + var beta0 = angle(points[0].v[0], points[2].v[0], points[1].v[0]), + beta1 = angle(points[0].v[0], points[1].v[0], points[2].v[0]), + beta2 = pi - beta0; - hawaiiPoint = hawaii - .translate([x - 0.205 * k, y + 0.212 * k]) - .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]]) - .stream(pointStream); + points[2].point[1] = 0; + points[0].point[0] = -(points[1].point[0] = points[0].v[0] / 2); - return reset(); - }; + var mean = [ + points[2].point[0] = points[0].point[0] + points[2].v[0] * cos(beta0), + 2 * (points[0].point[1] = points[1].point[1] = points[2].v[0] * sin(beta0)) + ]; - albersUsa.fitExtent = function(extent, object) { - return fitExtent(albersUsa, extent, object); - }; + function forward(lambda, phi) { + var sinPhi = sin(phi), + cosPhi = cos(phi), + v = new Array(3), i; - albersUsa.fitSize = function(size, object) { - return fitSize(albersUsa, size, object); - }; + // Compute distance and azimuth from control points. + for (i = 0; i < 3; ++i) { + var p = points[i]; + v[i] = distance(phi - p[1], p[3], p[2], cosPhi, sinPhi, lambda - p[0]); + if (!v[i][0]) return p.point; + v[i][1] = longitude(v[i][1] - p.v[1]); + } - albersUsa.fitWidth = function(width, object) { - return fitWidth(albersUsa, width, object); - }; + // Arithmetic mean of interception points. + var point = mean.slice(); + for (i = 0; i < 3; ++i) { + var j = i == 2 ? 0 : i + 1; + var a = angle(points[i].v[0], v[i][0], v[j][0]); + if (v[i][1] < 0) a = -a; - albersUsa.fitHeight = function(height, object) { - return fitHeight(albersUsa, height, object); - }; + if (!i) { + point[0] += v[i][0] * cos(a); + point[1] -= v[i][0] * sin(a); + } else if (i == 1) { + a = beta1 - a; + point[0] -= v[i][0] * cos(a); + point[1] -= v[i][0] * sin(a); + } else { + a = beta2 - a; + point[0] += v[i][0] * cos(a); + point[1] += v[i][0] * sin(a); + } + } - function reset() { - cache = cacheStream = null; - return albersUsa; + point[0] /= 3, point[1] /= 3; + return point; } - return albersUsa.scale(1070); + return forward; } -function azimuthalRaw(scale) { - return function(x, y) { - var cx = cos(x), - cy = cos(y), - k = scale(cx * cy); - return [ - k * cy * sin(x), - k * sin(y) - ]; - } +function pointRadians(p) { + return p[0] *= radians, p[1] *= radians, p; } -function azimuthalInvert(angle) { - return function(x, y) { - var z = sqrt(x * x + y * y), - c = angle(z), - sc = sin(c), - cc = cos(c); - return [ - atan2(x * sc, z * cc), - asin(z && y * sc / z) - ]; - } +function chamberlinAfrica() { + return chamberlin([0, 22], [45, 22], [22.5, -22]) + .scale(380) + .center([22.5, 2]); } -var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) { - return sqrt(2 / (1 + cxcy)); -}); - -azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) { - return 2 * asin(z / 2); -}); - -function azimuthalEqualArea() { - return projection(azimuthalEqualAreaRaw) - .scale(124.75) - .clipAngle(180 - 1e-3); -} +function chamberlin(p0, p1, p2) { // TODO order matters! + var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: [p0, p1, p2]}), + R = [-c[0], -c[1]], + r = d3Geo.geoRotation(R), + f = chamberlinRaw(pointRadians(r(p0)), pointRadians(r(p1)), pointRadians(r(p2))); + f.invert = solve2d(f); + var p = d3Geo.geoProjection(f).rotate(R), + center = p.center; -var azimuthalEquidistantRaw = azimuthalRaw(function(c) { - return (c = acos(c)) && c / sin(c); -}); + delete p.rotate; -azimuthalEquidistantRaw.invert = azimuthalInvert(function(z) { - return z; -}); + p.center = function(_) { + return arguments.length ? center(r(_)) : r.invert(center()); + }; -function azimuthalEquidistant() { - return projection(azimuthalEquidistantRaw) - .scale(79.4188) - .clipAngle(180 - 1e-3); + return p + .clipAngle(90); } -function mercatorRaw(lambda, phi) { - return [lambda, log(tan((halfPi + phi) / 2))]; +function collignonRaw(lambda, phi) { + var alpha = sqrt(1 - sin(phi)); + return [(2 / sqrtPi) * lambda * alpha, sqrtPi * (1 - alpha)]; } -mercatorRaw.invert = function(x, y) { - return [x, 2 * atan(exp(y)) - halfPi]; +collignonRaw.invert = function(x, y) { + var lambda = (lambda = y / sqrtPi - 1) * lambda; + return [lambda > 0 ? x * sqrt(pi / lambda) / 2 : 0, asin(1 - lambda)]; }; -function mercator() { - return mercatorProjection(mercatorRaw) - .scale(961 / tau); +function collignon() { + return d3Geo.geoProjection(collignonRaw) + .scale(95.6464) + .center([0, 30]); } -function mercatorProjection(project) { - var m = projection(project), - center = m.center, - scale = m.scale, - translate = m.translate, - clipExtent = m.clipExtent, - x0 = null, y0, x1, y1; // clip extent +function craigRaw(phi0) { + var tanPhi0 = tan(phi0); - m.scale = function(_) { - return arguments.length ? (scale(_), reclip()) : scale(); - }; + function forward(lambda, phi) { + return [lambda, (lambda ? lambda / sin(lambda) : 1) * (sin(phi) * cos(lambda) - tanPhi0 * cos(phi))]; + } - m.translate = function(_) { - return arguments.length ? (translate(_), reclip()) : translate(); + forward.invert = tanPhi0 ? function(x, y) { + if (x) y *= sin(x) / x; + var cosLambda = cos(x); + return [x, 2 * atan2(sqrt(cosLambda * cosLambda + tanPhi0 * tanPhi0 - y * y) - cosLambda, tanPhi0 - y)]; + } : function(x, y) { + return [x, asin(x ? y * tan(x) / x : y)]; }; - m.center = function(_) { - return arguments.length ? (center(_), reclip()) : center(); - }; + return forward; +} - m.clipExtent = function(_) { - return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]]; - }; +function craig() { + return parallel1(craigRaw) + .scale(249.828) + .clipAngle(90); +} - function reclip() { - var k = pi * scale(), - t = m(rotation(m.rotate()).invert([0, 0])); - return clipExtent(x0 == null - ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw - ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]] - : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]); - } +var sqrt3 = sqrt(3); - return reclip(); +function crasterRaw(lambda, phi) { + return [sqrt3 * lambda * (2 * cos(2 * phi / 3) - 1) / sqrtPi, sqrt3 * sqrtPi * sin(phi / 3)]; } -function tany(y) { - return tan((halfPi + y) / 2); -} +crasterRaw.invert = function(x, y) { + var phi = 3 * asin(y / (sqrt3 * sqrtPi)); + return [sqrtPi * x / (sqrt3 * (2 * cos(2 * phi / 3) - 1)), phi]; +}; -function conicConformalRaw(y0, y1) { - var cy0 = cos(y0), - n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)), - f = cy0 * pow(tany(y0), n) / n; +function craster() { + return d3Geo.geoProjection(crasterRaw) + .scale(156.19); +} - if (!n) return mercatorRaw; +function cylindricalEqualAreaRaw(phi0) { + var cosPhi0 = cos(phi0); - function project(x, y) { - if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; } - else { if (y > halfPi - epsilon) y = halfPi - epsilon; } - var r = f / pow(tany(y), n); - return [r * sin(n * x), f - r * cos(n * x)]; + function forward(lambda, phi) { + return [lambda * cosPhi0, sin(phi) / cosPhi0]; } - project.invert = function(x, y) { - var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy), - l = atan2(x, abs(fy)) * sign(fy); - if (fy * n < 0) - l -= pi * sign(x) * sign(fy); - return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi]; + forward.invert = function(x, y) { + return [x / cosPhi0, asin(y * cosPhi0)]; }; - return project; -} - -function conicConformal() { - return conicProjection(conicConformalRaw) - .scale(109.5) - .parallels([30, 30]); -} - -function equirectangularRaw(lambda, phi) { - return [lambda, phi]; + return forward; } -equirectangularRaw.invert = equirectangularRaw; - -function equirectangular() { - return projection(equirectangularRaw) - .scale(152.63); +function cylindricalEqualArea() { + return parallel1(cylindricalEqualAreaRaw) + .parallel(38.58) // acos(sqrt(width / height / pi)) * radians + .scale(195.044); // width / (sqrt(width / height / pi) * 2 * pi) } -function conicEquidistantRaw(y0, y1) { - var cy0 = cos(y0), - n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0), - g = cy0 / n + y0; - - if (abs(n) < epsilon) return equirectangularRaw; +function cylindricalStereographicRaw(phi0) { + var cosPhi0 = cos(phi0); - function project(x, y) { - var gy = g - y, nx = n * x; - return [gy * sin(nx), g - gy * cos(nx)]; + function forward(lambda, phi) { + return [lambda * cosPhi0, (1 + cosPhi0) * tan(phi / 2)]; } - project.invert = function(x, y) { - var gy = g - y, - l = atan2(x, abs(gy)) * sign(gy); - if (gy * n < 0) - l -= pi * sign(x) * sign(gy); - return [l / n, g - sign(n) * sqrt(x * x + gy * gy)]; + forward.invert = function(x, y) { + return [x / cosPhi0, atan(y / (1 + cosPhi0)) * 2]; }; - return project; + return forward; } -function conicEquidistant() { - return conicProjection(conicEquidistantRaw) - .scale(131.154) - .center([0, 13.9389]); +function cylindricalStereographic() { + return parallel1(cylindricalStereographicRaw) + .scale(124.75); } -var A1 = 1.340264, - A2 = -0.081106, - A3 = 0.000893, - A4 = 0.003796, - M = sqrt(3) / 2, - iterations = 12; - -function equalEarthRaw(lambda, phi) { - var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2; +function eckert1Raw(lambda, phi) { + var alpha = sqrt(8 / (3 * pi)); return [ - lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))), - l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) + alpha * lambda * (1 - abs(phi) / pi), + alpha * phi ]; } -equalEarthRaw.invert = function(x, y) { - var l = y, l2 = l * l, l6 = l2 * l2 * l2; - for (var i = 0, delta, fy, fpy; i < iterations; ++i) { - fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y; - fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2); - l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2; - if (abs(delta) < epsilon2) break; - } +eckert1Raw.invert = function(x, y) { + var alpha = sqrt(8 / (3 * pi)), + phi = y / alpha; return [ - M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l), - asin(sin(l) / M) + x / (alpha * (1 - abs(phi) / pi)), + phi ]; }; -function equalEarth() { - return projection(equalEarthRaw) - .scale(177.158); -} - -function gnomonicRaw(x, y) { - var cy = cos(y), k = cos(x) * cy; - return [cy * sin(x) / k, sin(y) / k]; +function eckert1() { + return d3Geo.geoProjection(eckert1Raw) + .scale(165.664); } -gnomonicRaw.invert = azimuthalInvert(atan); - -function gnomonic() { - return projection(gnomonicRaw) - .scale(144.049) - .clipAngle(60); +function eckert2Raw(lambda, phi) { + var alpha = sqrt(4 - 3 * sin(abs(phi))); + return [ + 2 / sqrt(6 * pi) * lambda * alpha, + sign(phi) * sqrt(2 * pi / 3) * (2 - alpha) + ]; } -function identity$1() { - var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect - alpha = 0, ca, sa, // angle - x0 = null, y0, x1, y1, // clip extent - kx = 1, ky = 1, - transform = transformer({ - point: function(x, y) { - var p = projection([x, y]); - this.stream.point(p[0], p[1]); - } - }), - postclip = identity, - cache, - cacheStream; - - function reset() { - kx = k * sx; - ky = k * sy; - cache = cacheStream = null; - return projection; - } - - function projection (p) { - var x = p[0] * kx, y = p[1] * ky; - if (alpha) { - var t = y * ca - x * sa; - x = x * ca + y * sa; - y = t; - } - return [x + tx, y + ty]; - } - projection.invert = function(p) { - var x = p[0] - tx, y = p[1] - ty; - if (alpha) { - var t = y * ca + x * sa; - x = x * ca - y * sa; - y = t; - } - return [x / kx, y / ky]; - }; - projection.stream = function(stream) { - return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream)); - }; - projection.postclip = function(_) { - return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip; - }; - projection.clipExtent = function(_) { - return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]]; - }; - projection.scale = function(_) { - return arguments.length ? (k = +_, reset()) : k; - }; - projection.translate = function(_) { - return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty]; - }; - projection.angle = function(_) { - return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees; - }; - projection.reflectX = function(_) { - return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0; - }; - projection.reflectY = function(_) { - return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0; - }; - projection.fitExtent = function(extent, object) { - return fitExtent(projection, extent, object); - }; - projection.fitSize = function(size, object) { - return fitSize(projection, size, object); - }; - projection.fitWidth = function(width, object) { - return fitWidth(projection, width, object); - }; - projection.fitHeight = function(height, object) { - return fitHeight(projection, height, object); - }; +eckert2Raw.invert = function(x, y) { + var alpha = 2 - abs(y) / sqrt(2 * pi / 3); + return [ + x * sqrt(6 * pi) / (2 * alpha), + sign(y) * asin((4 - alpha * alpha) / 3) + ]; +}; - return projection; +function eckert2() { + return d3Geo.geoProjection(eckert2Raw) + .scale(165.664); } -function naturalEarth1Raw(lambda, phi) { - var phi2 = phi * phi, phi4 = phi2 * phi2; +function eckert3Raw(lambda, phi) { + var k = sqrt(pi * (4 + pi)); return [ - lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))), - phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) + 2 / k * lambda * (1 + sqrt(1 - 4 * phi * phi / (pi * pi))), + 4 / k * phi ]; } -naturalEarth1Raw.invert = function(x, y) { - var phi = y, i = 25, delta; - do { - var phi2 = phi * phi, phi4 = phi2 * phi2; - phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) / - (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4))); - } while (abs(delta) > epsilon && --i > 0); +eckert3Raw.invert = function(x, y) { + var k = sqrt(pi * (4 + pi)) / 2; return [ - x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))), - phi + x * k / (1 + sqrt(1 - y * y * (4 + pi) / (4 * pi))), + y * k / 2 ]; }; -function naturalEarth1() { - return projection(naturalEarth1Raw) - .scale(175.295); +function eckert3() { + return d3Geo.geoProjection(eckert3Raw) + .scale(180.739); } -function orthographicRaw(x, y) { - return [cos(y) * sin(x), sin(y)]; +function eckert4Raw(lambda, phi) { + var k = (2 + halfPi) * sin(phi); + phi /= 2; + for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) { + var cosPhi = cos(phi); + phi -= delta = (phi + sin(phi) * (cosPhi + 2) - k) / (2 * cosPhi * (1 + cosPhi)); + } + return [ + 2 / sqrt(pi * (4 + pi)) * lambda * (1 + cos(phi)), + 2 * sqrt(pi / (4 + pi)) * sin(phi) + ]; } -orthographicRaw.invert = azimuthalInvert(asin); +eckert4Raw.invert = function(x, y) { + var A = y * sqrt((4 + pi) / pi) / 2, + k = asin(A), + c = cos(k); + return [ + x / (2 / sqrt(pi * (4 + pi)) * (1 + c)), + asin((k + A * (c + 2)) / (2 + halfPi)) + ]; +}; -function orthographic() { - return projection(orthographicRaw) - .scale(249.5) - .clipAngle(90 + epsilon); +function eckert4() { + return d3Geo.geoProjection(eckert4Raw) + .scale(180.739); } -function stereographicRaw(x, y) { - var cy = cos(y), k = 1 + cos(x) * cy; - return [cy * sin(x) / k, sin(y) / k]; +function eckert5Raw(lambda, phi) { + return [ + lambda * (1 + cos(phi)) / sqrt(2 + pi), + 2 * phi / sqrt(2 + pi) + ]; } -stereographicRaw.invert = azimuthalInvert(function(z) { - return 2 * atan(z); -}); +eckert5Raw.invert = function(x, y) { + var k = sqrt(2 + pi), + phi = y * k / 2; + return [ + k * x / (1 + cos(phi)), + phi + ]; +}; -function stereographic() { - return projection(stereographicRaw) - .scale(250) - .clipAngle(142); +function eckert5() { + return d3Geo.geoProjection(eckert5Raw) + .scale(173.044); } -function transverseMercatorRaw(lambda, phi) { - return [log(tan((halfPi + phi) / 2)), -lambda]; +function eckert6Raw(lambda, phi) { + var k = (1 + halfPi) * sin(phi); + for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) { + phi -= delta = (phi + sin(phi) - k) / (1 + cos(phi)); + } + k = sqrt(2 + pi); + return [ + lambda * (1 + cos(phi)) / k, + 2 * phi / k + ]; } -transverseMercatorRaw.invert = function(x, y) { - return [-y, 2 * atan(exp(x)) - halfPi]; +eckert6Raw.invert = function(x, y) { + var j = 1 + halfPi, + k = sqrt(j / 2); + return [ + x * 2 * k / (1 + cos(y *= k)), + asin((y + sin(y)) / j) + ]; }; -function transverseMercator() { - var m = mercatorProjection(transverseMercatorRaw), - center = m.center, - rotate = m.rotate; - - m.center = function(_) { - return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]); - }; +function eckert6() { + return d3Geo.geoProjection(eckert6Raw) + .scale(173.044); +} - m.rotate = function(_) { - return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]); - }; +var eisenlohrK = 3 + 2 * sqrt2; - return rotate([0, 0, 90]) - .scale(159.155); +function eisenlohrRaw(lambda, phi) { + var s0 = sin(lambda /= 2), + c0 = cos(lambda), + k = sqrt(cos(phi)), + c1 = cos(phi /= 2), + t = sin(phi) / (c1 + sqrt2 * c0 * k), + c = sqrt(2 / (1 + t * t)), + v = sqrt((sqrt2 * c1 + (c0 + s0) * k) / (sqrt2 * c1 + (c0 - s0) * k)); + return [ + eisenlohrK * (c * (v - 1 / v) - 2 * log(v)), + eisenlohrK * (c * t * (v + 1 / v) - 2 * atan(t)) + ]; } -exports.geoAlbers = albers; -exports.geoAlbersUsa = albersUsa; -exports.geoArea = area; -exports.geoAzimuthalEqualArea = azimuthalEqualArea; -exports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw; -exports.geoAzimuthalEquidistant = azimuthalEquidistant; -exports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw; -exports.geoBounds = bounds; -exports.geoCentroid = centroid; -exports.geoCircle = circle; -exports.geoClipAntimeridian = clipAntimeridian; -exports.geoClipCircle = clipCircle; -exports.geoClipExtent = extent; -exports.geoClipRectangle = clipRectangle; -exports.geoConicConformal = conicConformal; -exports.geoConicConformalRaw = conicConformalRaw; -exports.geoConicEqualArea = conicEqualArea; -exports.geoConicEqualAreaRaw = conicEqualAreaRaw; -exports.geoConicEquidistant = conicEquidistant; -exports.geoConicEquidistantRaw = conicEquidistantRaw; -exports.geoContains = contains; -exports.geoDistance = distance; -exports.geoEqualEarth = equalEarth; -exports.geoEqualEarthRaw = equalEarthRaw; -exports.geoEquirectangular = equirectangular; -exports.geoEquirectangularRaw = equirectangularRaw; -exports.geoGnomonic = gnomonic; -exports.geoGnomonicRaw = gnomonicRaw; -exports.geoGraticule = graticule; -exports.geoGraticule10 = graticule10; -exports.geoIdentity = identity$1; -exports.geoInterpolate = interpolate; -exports.geoLength = length; -exports.geoMercator = mercator; -exports.geoMercatorRaw = mercatorRaw; -exports.geoNaturalEarth1 = naturalEarth1; -exports.geoNaturalEarth1Raw = naturalEarth1Raw; -exports.geoOrthographic = orthographic; -exports.geoOrthographicRaw = orthographicRaw; -exports.geoPath = index; -exports.geoProjection = projection; -exports.geoProjectionMutator = projectionMutator; -exports.geoRotation = rotation; -exports.geoStereographic = stereographic; -exports.geoStereographicRaw = stereographicRaw; -exports.geoStream = geoStream; -exports.geoTransform = transform; -exports.geoTransverseMercator = transverseMercator; -exports.geoTransverseMercatorRaw = transverseMercatorRaw; - -Object.defineProperty(exports, '__esModule', { value: true }); +eisenlohrRaw.invert = function(x, y) { + if (!(p = augustRaw.invert(x / 1.2, y * 1.065))) return null; + var lambda = p[0], phi = p[1], i = 20, p; + x /= eisenlohrK, y /= eisenlohrK; + do { + var _0 = lambda / 2, + _1 = phi / 2, + s0 = sin(_0), + c0 = cos(_0), + s1 = sin(_1), + c1 = cos(_1), + cos1 = cos(phi), + k = sqrt(cos1), + t = s1 / (c1 + sqrt2 * c0 * k), + t2 = t * t, + c = sqrt(2 / (1 + t2)), + v0 = (sqrt2 * c1 + (c0 + s0) * k), + v1 = (sqrt2 * c1 + (c0 - s0) * k), + v2 = v0 / v1, + v = sqrt(v2), + vm1v = v - 1 / v, + vp1v = v + 1 / v, + fx = c * vm1v - 2 * log(v) - x, + fy = c * t * vp1v - 2 * atan(t) - y, + deltatDeltaLambda = s1 && sqrt1_2 * k * s0 * t2 / s1, + deltatDeltaPhi = (sqrt2 * c0 * c1 + k) / (2 * (c1 + sqrt2 * c0 * k) * (c1 + sqrt2 * c0 * k) * k), + deltacDeltat = -0.5 * t * c * c * c, + deltacDeltaLambda = deltacDeltat * deltatDeltaLambda, + deltacDeltaPhi = deltacDeltat * deltatDeltaPhi, + A = (A = 2 * c1 + sqrt2 * k * (c0 - s0)) * A * v, + deltavDeltaLambda = (sqrt2 * c0 * c1 * k + cos1) / A, + deltavDeltaPhi = -(sqrt2 * s0 * s1) / (k * A), + deltaxDeltaLambda = vm1v * deltacDeltaLambda - 2 * deltavDeltaLambda / v + c * (deltavDeltaLambda + deltavDeltaLambda / v2), + deltaxDeltaPhi = vm1v * deltacDeltaPhi - 2 * deltavDeltaPhi / v + c * (deltavDeltaPhi + deltavDeltaPhi / v2), + deltayDeltaLambda = t * vp1v * deltacDeltaLambda - 2 * deltatDeltaLambda / (1 + t2) + c * vp1v * deltatDeltaLambda + c * t * (deltavDeltaLambda - deltavDeltaLambda / v2), + deltayDeltaPhi = t * vp1v * deltacDeltaPhi - 2 * deltatDeltaPhi / (1 + t2) + c * vp1v * deltatDeltaPhi + c * t * (deltavDeltaPhi - deltavDeltaPhi / v2), + denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda; + if (!denominator) break; + var deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator, + deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator; + lambda -= deltaLambda; + phi = max(-halfPi, min(halfPi, phi - deltaPhi)); + } while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0); + return abs(abs(phi) - halfPi) < epsilon ? [0, phi] : i && [lambda, phi]; +}; -}))); +function eisenlohr() { + return d3Geo.geoProjection(eisenlohrRaw) + .scale(62.5271); +} -},{"d3-array":63}],71:[function(_dereq_,module,exports){ -// https://d3js.org/d3-hierarchy/ v1.1.9 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {})); -}(this, function (exports) { 'use strict'; +var faheyK = cos(35 * radians); -function defaultSeparation(a, b) { - return a.parent === b.parent ? 1 : 2; +function faheyRaw(lambda, phi) { + var t = tan(phi / 2); + return [lambda * faheyK * sqrt(1 - t * t), (1 + faheyK) * t]; } -function meanX(children) { - return children.reduce(meanXReduce, 0) / children.length; -} +faheyRaw.invert = function(x, y) { + var t = y / (1 + faheyK); + return [x && x / (faheyK * sqrt(1 - t * t)), 2 * atan(t)]; +}; -function meanXReduce(x, c) { - return x + c.x; +function fahey() { + return d3Geo.geoProjection(faheyRaw) + .scale(137.152); } -function maxY(children) { - return 1 + children.reduce(maxYReduce, 0); +function foucautRaw(lambda, phi) { + var k = phi / 2, cosk = cos(k); + return [ 2 * lambda / sqrtPi * cos(phi) * cosk * cosk, sqrtPi * tan(k)]; } -function maxYReduce(y, c) { - return Math.max(y, c.y); -} +foucautRaw.invert = function(x, y) { + var k = atan(y / sqrtPi), cosk = cos(k), phi = 2 * k; + return [x * sqrtPi / 2 / (cos(phi) * cosk * cosk), phi]; +}; -function leafLeft(node) { - var children; - while (children = node.children) node = children[0]; - return node; +function foucaut() { + return d3Geo.geoProjection(foucautRaw) + .scale(135.264); } -function leafRight(node) { - var children; - while (children = node.children) node = children[children.length - 1]; - return node; -} - -function cluster() { - var separation = defaultSeparation, - dx = 1, - dy = 1, - nodeSize = false; - - function cluster(root) { - var previousNode, - x = 0; +function foucautSinusoidalRaw(alpha) { + var beta = 1 - alpha, + equatorial = raw(pi, 0)[0] - raw(-pi, 0)[0], + polar = raw(0, halfPi)[1] - raw(0, -halfPi)[1], + ratio = sqrt(2 * polar / equatorial); - // First walk, computing the initial x & y values. - root.eachAfter(function(node) { - var children = node.children; - if (children) { - node.x = meanX(children); - node.y = maxY(children); - } else { - node.x = previousNode ? x += separation(node, previousNode) : 0; - node.y = 0; - previousNode = node; - } - }); + function raw(lambda, phi) { + var cosphi = cos(phi), + sinphi = sin(phi); + return [ + cosphi / (beta + alpha * cosphi) * lambda, + beta * phi + alpha * sinphi + ]; + } - var left = leafLeft(root), - right = leafRight(root), - x0 = left.x - separation(left, right) / 2, - x1 = right.x + separation(right, left) / 2; + function forward(lambda, phi) { + var p = raw(lambda, phi); + return [p[0] * ratio, p[1] / ratio]; + } - // Second walk, normalizing x & y to the desired size. - return root.eachAfter(nodeSize ? function(node) { - node.x = (node.x - root.x) * dx; - node.y = (root.y - node.y) * dy; - } : function(node) { - node.x = (node.x - x0) / (x1 - x0) * dx; - node.y = (1 - (root.y ? node.y / root.y : 1)) * dy; - }); + function forwardMeridian(phi) { + return forward(0, phi)[1]; } - cluster.separation = function(x) { - return arguments.length ? (separation = x, cluster) : separation; + forward.invert = function(x, y) { + var phi = solve(forwardMeridian, y), + lambda = x / ratio * (alpha + beta / cos(phi)); + return [lambda, phi]; }; - cluster.size = function(x) { - return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]); - }; + return forward; +} - cluster.nodeSize = function(x) { - return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null); - }; +function foucautSinusoidal() { + var alpha = 0.5, + m = d3Geo.geoProjectionMutator(foucautSinusoidalRaw), + p = m(alpha); - return cluster; -} + p.alpha = function(_) { + return arguments.length ? m(alpha = +_) : alpha; + }; -function count(node) { - var sum = 0, - children = node.children, - i = children && children.length; - if (!i) sum = 1; - else while (--i >= 0) sum += children[i].value; - node.value = sum; + return p + .scale(168.725); } -function node_count() { - return this.eachAfter(count); +function gilbertForward(point) { + return [point[0] / 2, asin(tan(point[1] / 2 * radians)) * degrees]; } -function node_each(callback) { - var node = this, current, next = [node], children, i, n; - do { - current = next.reverse(), next = []; - while (node = current.pop()) { - callback(node), children = node.children; - if (children) for (i = 0, n = children.length; i < n; ++i) { - next.push(children[i]); - } - } - } while (next.length); - return this; +function gilbertInvert(point) { + return [point[0] * 2, 2 * atan(sin(point[1] * radians)) * degrees]; } -function node_eachBefore(callback) { - var node = this, nodes = [node], children, i; - while (node = nodes.pop()) { - callback(node), children = node.children; - if (children) for (i = children.length - 1; i >= 0; --i) { - nodes.push(children[i]); - } - } - return this; -} +function gilbert(projectionType) { + if (projectionType == null) projectionType = d3Geo.geoOrthographic; + var projection = projectionType(), + equirectangular = d3Geo.geoEquirectangular().scale(degrees).precision(0).clipAngle(null).translate([0, 0]); // antimeridian cutting -function node_eachAfter(callback) { - var node = this, nodes = [node], next = [], children, i, n; - while (node = nodes.pop()) { - next.push(node), children = node.children; - if (children) for (i = 0, n = children.length; i < n; ++i) { - nodes.push(children[i]); - } - } - while (node = next.pop()) { - callback(node); + function gilbert(point) { + return projection(gilbertForward(point)); } - return this; -} -function node_sum(value) { - return this.eachAfter(function(node) { - var sum = +value(node.data) || 0, - children = node.children, - i = children && children.length; - while (--i >= 0) sum += children[i].value; - node.value = sum; - }); -} + if (projection.invert) gilbert.invert = function(point) { + return gilbertInvert(projection.invert(point)); + }; -function node_sort(compare) { - return this.eachBefore(function(node) { - if (node.children) { - node.children.sort(compare); - } - }); -} + gilbert.stream = function(stream) { + var s1 = projection.stream(stream), s0 = equirectangular.stream({ + point: function(lambda, phi) { s1.point(lambda / 2, asin(tan(-phi / 2 * radians)) * degrees); }, + lineStart: function() { s1.lineStart(); }, + lineEnd: function() { s1.lineEnd(); }, + polygonStart: function() { s1.polygonStart(); }, + polygonEnd: function() { s1.polygonEnd(); } + }); + s0.sphere = s1.sphere; + return s0; + }; -function node_path(end) { - var start = this, - ancestor = leastCommonAncestor(start, end), - nodes = [start]; - while (start !== ancestor) { - start = start.parent; - nodes.push(start); - } - var k = nodes.length; - while (end !== ancestor) { - nodes.splice(k, 0, end); - end = end.parent; + function property(name) { + gilbert[name] = function() { + return arguments.length ? (projection[name].apply(projection, arguments), gilbert) : projection[name](); + }; } - return nodes; -} -function leastCommonAncestor(a, b) { - if (a === b) return a; - var aNodes = a.ancestors(), - bNodes = b.ancestors(), - c = null; - a = aNodes.pop(); - b = bNodes.pop(); - while (a === b) { - c = a; - a = aNodes.pop(); - b = bNodes.pop(); - } - return c; -} + gilbert.rotate = function(_) { + return arguments.length ? (equirectangular.rotate(_), gilbert) : equirectangular.rotate(); + }; -function node_ancestors() { - var node = this, nodes = [node]; - while (node = node.parent) { - nodes.push(node); - } - return nodes; -} + gilbert.center = function(_) { + return arguments.length ? (projection.center(gilbertForward(_)), gilbert) : gilbertInvert(projection.center()); + }; -function node_descendants() { - var nodes = []; - this.each(function(node) { - nodes.push(node); - }); - return nodes; -} + property("angle"); + property("clipAngle"); + property("clipExtent"); + property("fitExtent"); + property("fitHeight"); + property("fitSize"); + property("fitWidth"); + property("scale"); + property("translate"); + property("precision"); -function node_leaves() { - var leaves = []; - this.eachBefore(function(node) { - if (!node.children) { - leaves.push(node); - } - }); - return leaves; + return gilbert + .scale(249.5); } -function node_links() { - var root = this, links = []; - root.each(function(node) { - if (node !== root) { // Don’t include the root’s parent, if any. - links.push({source: node.parent, target: node}); - } - }); - return links; -} +function gingeryRaw(rho, n) { + var k = 2 * pi / n, + rho2 = rho * rho; -function hierarchy(data, children) { - var root = new Node(data), - valued = +data.value && (root.value = data.value), - node, - nodes = [root], - child, - childs, - i, - n; + function forward(lambda, phi) { + var p = d3Geo.geoAzimuthalEquidistantRaw(lambda, phi), + x = p[0], + y = p[1], + r2 = x * x + y * y; - if (children == null) children = defaultChildren; + if (r2 > rho2) { + var r = sqrt(r2), + theta = atan2(y, x), + theta0 = k * round(theta / k), + alpha = theta - theta0, + rhoCosAlpha = rho * cos(alpha), + k_ = (rho * sin(alpha) - alpha * sin(rhoCosAlpha)) / (halfPi - rhoCosAlpha), + s_ = gingeryLength(alpha, k_), + e = (pi - rho) / gingeryIntegrate(s_, rhoCosAlpha, pi); - while (node = nodes.pop()) { - if (valued) node.value = +node.data.value; - if ((childs = children(node.data)) && (n = childs.length)) { - node.children = new Array(n); - for (i = n - 1; i >= 0; --i) { - nodes.push(child = node.children[i] = new Node(childs[i])); - child.parent = node; - child.depth = node.depth + 1; - } + x = r; + var i = 50, delta; + do { + x -= delta = (rho + gingeryIntegrate(s_, rhoCosAlpha, x) * e - r) / (s_(x) * e); + } while (abs(delta) > epsilon && --i > 0); + + y = alpha * sin(x); + if (x < halfPi) y -= k_ * (x - halfPi); + + var s = sin(theta0), + c = cos(theta0); + p[0] = x * c - y * s; + p[1] = x * s + y * c; } + return p; } - return root.eachBefore(computeHeight); -} + forward.invert = function(x, y) { + var r2 = x * x + y * y; + if (r2 > rho2) { + var r = sqrt(r2), + theta = atan2(y, x), + theta0 = k * round(theta / k), + dTheta = theta - theta0; -function node_copy() { - return hierarchy(this).eachBefore(copyData); -} + x = r * cos(dTheta); + y = r * sin(dTheta); -function defaultChildren(d) { - return d.children; -} + var x_halfPi = x - halfPi, + sinx = sin(x), + alpha = y / sinx, + delta = x < halfPi ? Infinity : 0, + i = 10; -function copyData(node) { - node.data = node.data.data; + while (true) { + var rhosinAlpha = rho * sin(alpha), + rhoCosAlpha = rho * cos(alpha), + sinRhoCosAlpha = sin(rhoCosAlpha), + halfPi_RhoCosAlpha = halfPi - rhoCosAlpha, + k_ = (rhosinAlpha - alpha * sinRhoCosAlpha) / halfPi_RhoCosAlpha, + s_ = gingeryLength(alpha, k_); + + if (abs(delta) < epsilon2 || !--i) break; + + alpha -= delta = (alpha * sinx - k_ * x_halfPi - y) / ( + sinx - x_halfPi * 2 * ( + halfPi_RhoCosAlpha * (rhoCosAlpha + alpha * rhosinAlpha * cos(rhoCosAlpha) - sinRhoCosAlpha) - + rhosinAlpha * (rhosinAlpha - alpha * sinRhoCosAlpha) + ) / (halfPi_RhoCosAlpha * halfPi_RhoCosAlpha)); + } + r = rho + gingeryIntegrate(s_, rhoCosAlpha, x) * (pi - rho) / gingeryIntegrate(s_, rhoCosAlpha, pi); + theta = theta0 + alpha; + x = r * cos(theta); + y = r * sin(theta); + } + return d3Geo.geoAzimuthalEquidistantRaw.invert(x, y); + }; + + return forward; } -function computeHeight(node) { - var height = 0; - do node.height = height; - while ((node = node.parent) && (node.height < ++height)); +function gingeryLength(alpha, k) { + return function(x) { + var y_ = alpha * cos(x); + if (x < halfPi) y_ -= k; + return sqrt(1 + y_ * y_); + }; } -function Node(data) { - this.data = data; - this.depth = - this.height = 0; - this.parent = null; +// Numerical integration: trapezoidal rule. +function gingeryIntegrate(f, a, b) { + var n = 50, + h = (b - a) / n, + s = f(a) + f(b); + for (var i = 1, x = a; i < n; ++i) s += 2 * f(x += h); + return s * 0.5 * h; } -Node.prototype = hierarchy.prototype = { - constructor: Node, - count: node_count, - each: node_each, - eachAfter: node_eachAfter, - eachBefore: node_eachBefore, - sum: node_sum, - sort: node_sort, - path: node_path, - ancestors: node_ancestors, - descendants: node_descendants, - leaves: node_leaves, - links: node_links, - copy: node_copy -}; +function gingery() { + var n = 6, + rho = 30 * radians, + cRho = cos(rho), + sRho = sin(rho), + m = d3Geo.geoProjectionMutator(gingeryRaw), + p = m(rho, n), + stream_ = p.stream, + epsilon$$1 = 1e-2, + cr = -cos(epsilon$$1 * radians), + sr = sin(epsilon$$1 * radians); -var slice = Array.prototype.slice; + p.radius = function(_) { + if (!arguments.length) return rho * degrees; + cRho = cos(rho = _ * radians); + sRho = sin(rho); + return m(rho, n); + }; -function shuffle(array) { - var m = array.length, - t, - i; + p.lobes = function(_) { + if (!arguments.length) return n; + return m(rho, n = +_); + }; - while (m) { - i = Math.random() * m-- | 0; - t = array[m]; - array[m] = array[i]; - array[i] = t; - } + p.stream = function(stream) { + var rotate = p.rotate(), + rotateStream = stream_(stream), + sphereStream = (p.rotate([0, 0]), stream_(stream)); + p.rotate(rotate); + rotateStream.sphere = function() { + sphereStream.polygonStart(), sphereStream.lineStart(); + for (var i = 0, delta = 2 * pi / n, phi = 0; i < n; ++i, phi -= delta) { + sphereStream.point(atan2(sr * cos(phi), cr) * degrees, asin(sr * sin(phi)) * degrees); + sphereStream.point(atan2(sRho * cos(phi - delta / 2), cRho) * degrees, asin(sRho * sin(phi - delta / 2)) * degrees); + } + sphereStream.lineEnd(), sphereStream.polygonEnd(); + }; + return rotateStream; + }; - return array; + return p + .rotate([90, -40]) + .scale(91.7095) + .clipAngle(180 - 1e-3); } -function enclose(circles) { - var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e; +function ginzburgPolyconicRaw(a, b, c, d, e, f, g, h) { + if (arguments.length < 8) h = 0; - while (i < n) { - p = circles[i]; - if (e && enclosesWeak(e, p)) ++i; - else e = encloseBasis(B = extendBasis(B, p)), i = 0; + function forward(lambda, phi) { + if (!phi) return [a * lambda / pi, 0]; + var phi2 = phi * phi, + xB = a + phi2 * (b + phi2 * (c + phi2 * d)), + yB = phi * (e - 1 + phi2 * (f - h + phi2 * g)), + m = (xB * xB + yB * yB) / (2 * yB), + alpha = lambda * asin(xB / m) / pi; + return [m * sin(alpha), phi * (1 + phi2 * h) + m * (1 - cos(alpha))]; } - return e; -} + forward.invert = function(x, y) { + var lambda = pi * x / a, + phi = y, + deltaLambda, deltaPhi, i = 50; + do { + var phi2 = phi * phi, + xB = a + phi2 * (b + phi2 * (c + phi2 * d)), + yB = phi * (e - 1 + phi2 * (f - h + phi2 * g)), + p = xB * xB + yB * yB, + q = 2 * yB, + m = p / q, + m2 = m * m, + dAlphadLambda = asin(xB / m) / pi, + alpha = lambda * dAlphadLambda, + xB2 = xB * xB, + dxBdPhi = (2 * b + phi2 * (4 * c + phi2 * 6 * d)) * phi, + dyBdPhi = e + phi2 * (3 * f + phi2 * 5 * g), + dpdPhi = 2 * (xB * dxBdPhi + yB * (dyBdPhi - 1)), + dqdPhi = 2 * (dyBdPhi - 1), + dmdPhi = (dpdPhi * q - p * dqdPhi) / (q * q), + cosAlpha = cos(alpha), + sinAlpha = sin(alpha), + mcosAlpha = m * cosAlpha, + msinAlpha = m * sinAlpha, + dAlphadPhi = ((lambda / pi) * (1 / sqrt(1 - xB2 / m2)) * (dxBdPhi * m - xB * dmdPhi)) / m2, + fx = msinAlpha - x, + fy = phi * (1 + phi2 * h) + m - mcosAlpha - y, + deltaxDeltaPhi = dmdPhi * sinAlpha + mcosAlpha * dAlphadPhi, + deltaxDeltaLambda = mcosAlpha * dAlphadLambda, + deltayDeltaPhi = 1 + dmdPhi - (dmdPhi * cosAlpha - msinAlpha * dAlphadPhi), + deltayDeltaLambda = msinAlpha * dAlphadLambda, + denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda; + if (!denominator) break; + lambda -= deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator; + phi -= deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator; + } while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0); + return [lambda, phi]; + }; -function extendBasis(B, p) { - var i, j; + return forward; +} - if (enclosesWeakAll(p, B)) return [p]; +var ginzburg4Raw = ginzburgPolyconicRaw(2.8284, -1.6988, 0.75432, -0.18071, 1.76003, -0.38914, 0.042555); - // If we get here then B must have at least one element. - for (i = 0; i < B.length; ++i) { - if (enclosesNot(p, B[i]) - && enclosesWeakAll(encloseBasis2(B[i], p), B)) { - return [B[i], p]; - } - } +function ginzburg4() { + return d3Geo.geoProjection(ginzburg4Raw) + .scale(149.995); +} - // If we get here then B must have at least two elements. - for (i = 0; i < B.length - 1; ++i) { - for (j = i + 1; j < B.length; ++j) { - if (enclosesNot(encloseBasis2(B[i], B[j]), p) - && enclosesNot(encloseBasis2(B[i], p), B[j]) - && enclosesNot(encloseBasis2(B[j], p), B[i]) - && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) { - return [B[i], B[j], p]; - } - } - } +var ginzburg5Raw = ginzburgPolyconicRaw(2.583819, -0.835827, 0.170354, -0.038094, 1.543313, -0.411435,0.082742); - // If we get here then something is very wrong. - throw new Error; +function ginzburg5() { + return d3Geo.geoProjection(ginzburg5Raw) + .scale(153.93); } -function enclosesNot(a, b) { - var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y; - return dr < 0 || dr * dr < dx * dx + dy * dy; -} +var ginzburg6Raw = ginzburgPolyconicRaw(5 / 6 * pi, -0.62636, -0.0344, 0, 1.3493, -0.05524, 0, 0.045); -function enclosesWeak(a, b) { - var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y; - return dr > 0 && dr * dr > dx * dx + dy * dy; +function ginzburg6() { + return d3Geo.geoProjection(ginzburg6Raw) + .scale(130.945); } -function enclosesWeakAll(a, B) { - for (var i = 0; i < B.length; ++i) { - if (!enclosesWeak(a, B[i])) { - return false; - } - } - return true; +function ginzburg8Raw(lambda, phi) { + var lambda2 = lambda * lambda, + phi2 = phi * phi; + return [ + lambda * (1 - 0.162388 * phi2) * (0.87 - 0.000952426 * lambda2 * lambda2), + phi * (1 + phi2 / 12) + ]; } -function encloseBasis(B) { - switch (B.length) { - case 1: return encloseBasis1(B[0]); - case 2: return encloseBasis2(B[0], B[1]); - case 3: return encloseBasis3(B[0], B[1], B[2]); - } -} +ginzburg8Raw.invert = function(x, y) { + var lambda = x, + phi = y, + i = 50, delta; + do { + var phi2 = phi * phi; + phi -= delta = (phi * (1 + phi2 / 12) - y) / (1 + phi2 / 4); + } while (abs(delta) > epsilon && --i > 0); + i = 50; + x /= 1 -0.162388 * phi2; + do { + var lambda4 = (lambda4 = lambda * lambda) * lambda4; + lambda -= delta = (lambda * (0.87 - 0.000952426 * lambda4) - x) / (0.87 - 0.00476213 * lambda4); + } while (abs(delta) > epsilon && --i > 0); + return [lambda, phi]; +}; -function encloseBasis1(a) { - return { - x: a.x, - y: a.y, - r: a.r - }; +function ginzburg8() { + return d3Geo.geoProjection(ginzburg8Raw) + .scale(131.747); } -function encloseBasis2(a, b) { - var x1 = a.x, y1 = a.y, r1 = a.r, - x2 = b.x, y2 = b.y, r2 = b.r, - x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1, - l = Math.sqrt(x21 * x21 + y21 * y21); - return { - x: (x1 + x2 + x21 / l * r21) / 2, - y: (y1 + y2 + y21 / l * r21) / 2, - r: (l + r1 + r2) / 2 - }; -} +var ginzburg9Raw = ginzburgPolyconicRaw(2.6516, -0.76534, 0.19123, -0.047094, 1.36289, -0.13965,0.031762); -function encloseBasis3(a, b, c) { - var x1 = a.x, y1 = a.y, r1 = a.r, - x2 = b.x, y2 = b.y, r2 = b.r, - x3 = c.x, y3 = c.y, r3 = c.r, - a2 = x1 - x2, - a3 = x1 - x3, - b2 = y1 - y2, - b3 = y1 - y3, - c2 = r2 - r1, - c3 = r3 - r1, - d1 = x1 * x1 + y1 * y1 - r1 * r1, - d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2, - d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3, - ab = a3 * b2 - a2 * b3, - xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1, - xb = (b3 * c2 - b2 * c3) / ab, - ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1, - yb = (a2 * c3 - a3 * c2) / ab, - A = xb * xb + yb * yb - 1, - B = 2 * (r1 + xa * xb + ya * yb), - C = xa * xa + ya * ya - r1 * r1, - r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B); - return { - x: x1 + xa + xb * r, - y: y1 + ya + yb * r, - r: r - }; +function ginzburg9() { + return d3Geo.geoProjection(ginzburg9Raw) + .scale(131.087); } -function place(b, a, c) { - var dx = b.x - a.x, x, a2, - dy = b.y - a.y, y, b2, - d2 = dx * dx + dy * dy; - if (d2) { - a2 = a.r + c.r, a2 *= a2; - b2 = b.r + c.r, b2 *= b2; - if (a2 > b2) { - x = (d2 + b2 - a2) / (2 * d2); - y = Math.sqrt(Math.max(0, b2 / d2 - x * x)); - c.x = b.x - x * dx - y * dy; - c.y = b.y - x * dy + y * dx; - } else { - x = (d2 + a2 - b2) / (2 * d2); - y = Math.sqrt(Math.max(0, a2 / d2 - x * x)); - c.x = a.x + x * dx - y * dy; - c.y = a.y + x * dy + y * dx; - } - } else { - c.x = a.x + c.r; - c.y = a.y; +function squareRaw(project) { + var dx = project(halfPi, 0)[0] - project(-halfPi, 0)[0]; + + function projectSquare(lambda, phi) { + var s = lambda > 0 ? -0.5 : 0.5, + point = project(lambda + s * pi, phi); + point[0] -= s * dx; + return point; } -} -function intersects(a, b) { - var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y; - return dr > 0 && dr * dr > dx * dx + dy * dy; -} + if (project.invert) projectSquare.invert = function(x, y) { + var s = x > 0 ? -0.5 : 0.5, + location = project.invert(x + s * dx, y), + lambda = location[0] - s * pi; + if (lambda < -pi) lambda += 2 * pi; + else if (lambda > pi) lambda -= 2 * pi; + location[0] = lambda; + return location; + }; -function score(node) { - var a = node._, - b = node.next._, - ab = a.r + b.r, - dx = (a.x * b.r + b.x * a.r) / ab, - dy = (a.y * b.r + b.y * a.r) / ab; - return dx * dx + dy * dy; + return projectSquare; } -function Node$1(circle) { - this._ = circle; - this.next = null; - this.previous = null; +function gringortenRaw(lambda, phi) { + var sLambda = sign(lambda), + sPhi = sign(phi), + cosPhi = cos(phi), + x = cos(lambda) * cosPhi, + y = sin(lambda) * cosPhi, + z = sin(sPhi * phi); + lambda = abs(atan2(y, z)); + phi = asin(x); + if (abs(lambda - halfPi) > epsilon) lambda %= halfPi; + var point = gringortenHexadecant(lambda > pi / 4 ? halfPi - lambda : lambda, phi); + if (lambda > pi / 4) z = point[0], point[0] = -point[1], point[1] = -z; + return (point[0] *= sLambda, point[1] *= -sPhi, point); } -function packEnclose(circles) { - if (!(n = circles.length)) return 0; - - var a, b, c, n, aa, ca, i, j, k, sj, sk; - - // Place the first circle. - a = circles[0], a.x = 0, a.y = 0; - if (!(n > 1)) return a.r; +gringortenRaw.invert = function(x, y) { + if (abs(x) > 1) x = sign(x) * 2 - x; + if (abs(y) > 1) y = sign(y) * 2 - y; + var sx = sign(x), + sy = sign(y), + x0 = -sx * x, + y0 = -sy * y, + t = y0 / x0 < 1, + p = gringortenHexadecantInvert(t ? y0 : x0, t ? x0 : y0), + lambda = p[0], + phi = p[1], + cosPhi = cos(phi); + if (t) lambda = -halfPi - lambda; + return [sx * (atan2(sin(lambda) * cosPhi, -sin(phi)) + pi), sy * asin(cos(lambda) * cosPhi)]; +}; - // Place the second circle. - b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0; - if (!(n > 2)) return a.r + b.r; +function gringortenHexadecant(lambda, phi) { + if (phi === halfPi) return [0, 0]; - // Place the third circle. - place(b, a, c = circles[2]); + var sinPhi = sin(phi), + r = sinPhi * sinPhi, + r2 = r * r, + j = 1 + r2, + k = 1 + 3 * r2, + q = 1 - r2, + z = asin(1 / sqrt(j)), + v = q + r * j * z, + p2 = (1 - sinPhi) / v, + p = sqrt(p2), + a2 = p2 * j, + a = sqrt(a2), + h = p * q, + x, + i; - // Initialize the front-chain using the first three circles a, b and c. - a = new Node$1(a), b = new Node$1(b), c = new Node$1(c); - a.next = c.previous = b; - b.next = a.previous = c; - c.next = b.previous = a; + if (lambda === 0) return [0, -(h + r * a)]; - // Attempt to place each remaining circle… - pack: for (i = 3; i < n; ++i) { - place(a._, b._, c = circles[i]), c = new Node$1(c); + var cosPhi = cos(phi), + secPhi = 1 / cosPhi, + drdPhi = 2 * sinPhi * cosPhi, + dvdPhi = (-3 * r + z * k) * drdPhi, + dp2dPhi = (-v * cosPhi - (1 - sinPhi) * dvdPhi) / (v * v), + dpdPhi = (0.5 * dp2dPhi) / p, + dhdPhi = q * dpdPhi - 2 * r * p * drdPhi, + dra2dPhi = r * j * dp2dPhi + p2 * k * drdPhi, + mu = -secPhi * drdPhi, + nu = -secPhi * dra2dPhi, + zeta = -2 * secPhi * dhdPhi, + lambda1 = 4 * lambda / pi, + delta; - // Find the closest intersecting circle on the front-chain, if any. - // “Closeness” is determined by linear distance along the front-chain. - // “Ahead” or “behind” is likewise determined by linear distance. - j = b.next, k = a.previous, sj = b._.r, sk = a._.r; + // Slower but accurate bisection method. + if (lambda > 0.222 * pi || phi < pi / 4 && lambda > 0.175 * pi) { + x = (h + r * sqrt(a2 * (1 + r2) - h * h)) / (1 + r2); + if (lambda > pi / 4) return [x, x]; + var x1 = x, x0 = 0.5 * x; + x = 0.5 * (x0 + x1), i = 50; do { - if (sj <= sk) { - if (intersects(j._, c._)) { - b = j, a.next = b, b.previous = a, --i; - continue pack; - } - sj += j._.r, j = j.next; - } else { - if (intersects(k._, c._)) { - a = k, a.next = b, b.previous = a, --i; - continue pack; - } - sk += k._.r, k = k.previous; - } - } while (j !== k.next); - - // Success! Insert the new circle c between a and b. - c.previous = a, c.next = b, a.next = b.previous = b = c; + var g = sqrt(a2 - x * x), + f = (x * (zeta + mu * g) + nu * asin(x / a)) - lambda1; + if (!f) break; + if (f < 0) x0 = x; + else x1 = x; + x = 0.5 * (x0 + x1); + } while (abs(x1 - x0) > epsilon && --i > 0); + } - // Compute the new closest circle pair to the centroid. - aa = score(a); - while ((c = c.next) !== b) { - if ((ca = score(c)) < aa) { - a = c, aa = ca; - } - } - b = a.next; + // Newton-Raphson. + else { + x = epsilon, i = 25; + do { + var x2 = x * x, + g2 = sqrt(a2 - x2), + zetaMug = zeta + mu * g2, + f2 = x * zetaMug + nu * asin(x / a) - lambda1, + df = zetaMug + (nu - mu * x2) / g2; + x -= delta = g2 ? f2 / df : 0; + } while (abs(delta) > epsilon && --i > 0); } - // Compute the enclosing circle of the front chain. - a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a); + return [x, -h - r * sqrt(a2 - x * x)]; +} - // Translate the circles to put the enclosing circle around the origin. - for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y; +function gringortenHexadecantInvert(x, y) { + var x0 = 0, + x1 = 1, + r = 0.5, + i = 50; - return c.r; -} + while (true) { + var r2 = r * r, + sinPhi = sqrt(r), + z = asin(1 / sqrt(1 + r2)), + v = (1 - r2) + r * (1 + r2) * z, + p2 = (1 - sinPhi) / v, + p = sqrt(p2), + a2 = p2 * (1 + r2), + h = p * (1 - r2), + g2 = a2 - x * x, + g = sqrt(g2), + y0 = y + h + r * g; + if (abs(x1 - x0) < epsilon2 || --i === 0 || y0 === 0) break; + if (y0 > 0) x0 = r; + else x1 = r; + r = 0.5 * (x0 + x1); + } -function siblings(circles) { - packEnclose(circles); - return circles; -} + if (!i) return null; -function optional(f) { - return f == null ? null : required(f); -} + var phi = asin(sinPhi), + cosPhi = cos(phi), + secPhi = 1 / cosPhi, + drdPhi = 2 * sinPhi * cosPhi, + dvdPhi = (-3 * r + z * (1 + 3 * r2)) * drdPhi, + dp2dPhi = (-v * cosPhi - (1 - sinPhi) * dvdPhi) / (v * v), + dpdPhi = 0.5 * dp2dPhi / p, + dhdPhi = (1 - r2) * dpdPhi - 2 * r * p * drdPhi, + zeta = -2 * secPhi * dhdPhi, + mu = -secPhi * drdPhi, + nu = -secPhi * (r * (1 + r2) * dp2dPhi + p2 * (1 + 3 * r2) * drdPhi); -function required(f) { - if (typeof f !== "function") throw new Error; - return f; + return [pi / 4 * (x * (zeta + mu * g) + nu * asin(x / sqrt(a2))), phi]; } -function constantZero() { - return 0; +function gringorten() { + return d3Geo.geoProjection(squareRaw(gringortenRaw)) + .scale(239.75); } -function constant(x) { - return function() { - return x; - }; +// Returns [sn, cn, dn](u + iv|m). +function ellipticJi(u, v, m) { + var a, b, c; + if (!u) { + b = ellipticJ(v, 1 - m); + return [ + [0, b[0] / b[1]], + [1 / b[1], 0], + [b[2] / b[1], 0] + ]; + } + a = ellipticJ(u, m); + if (!v) return [[a[0], 0], [a[1], 0], [a[2], 0]]; + b = ellipticJ(v, 1 - m); + c = b[1] * b[1] + m * a[0] * a[0] * b[0] * b[0]; + return [ + [a[0] * b[2] / c, a[1] * a[2] * b[0] * b[1] / c], + [a[1] * b[1] / c, -a[0] * a[2] * b[0] * b[2] / c], + [a[2] * b[1] * b[2] / c, -m * a[0] * a[1] * b[0] / c] + ]; } -function defaultRadius(d) { - return Math.sqrt(d.value); -} +// Returns [sn, cn, dn, ph](u|m). +function ellipticJ(u, m) { + var ai, b, phi, t, twon; + if (m < epsilon) { + t = sin(u); + b = cos(u); + ai = m * (u - t * b) / 4; + return [ + t - ai * b, + b + ai * t, + 1 - m * t * t / 2, + u - ai + ]; + } + if (m >= 1 - epsilon) { + ai = (1 - m) / 4; + b = cosh(u); + t = tanh(u); + phi = 1 / b; + twon = b * sinh(u); + return [ + t + ai * (twon - u) / (b * b), + phi - ai * t * phi * (twon - u), + phi + ai * t * phi * (twon + u), + 2 * atan(exp(u)) - halfPi + ai * (twon - u) / b + ]; + } -function index() { - var radius = null, - dx = 1, - dy = 1, - padding = constantZero; + var a = [1, 0, 0, 0, 0, 0, 0, 0, 0], + c = [sqrt(m), 0, 0, 0, 0, 0, 0, 0, 0], + i = 0; + b = sqrt(1 - m); + twon = 1; - function pack(root) { - root.x = dx / 2, root.y = dy / 2; - if (radius) { - root.eachBefore(radiusLeaf(radius)) - .eachAfter(packChildren(padding, 0.5)) - .eachBefore(translateChild(1)); - } else { - root.eachBefore(radiusLeaf(defaultRadius)) - .eachAfter(packChildren(constantZero, 1)) - .eachAfter(packChildren(padding, root.r / Math.min(dx, dy))) - .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r))); - } - return root; + while (abs(c[i] / a[i]) > epsilon && i < 8) { + ai = a[i++]; + c[i] = (ai - b) / 2; + a[i] = (ai + b) / 2; + b = sqrt(ai * b); + twon *= 2; } - pack.radius = function(x) { - return arguments.length ? (radius = optional(x), pack) : radius; - }; - - pack.size = function(x) { - return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy]; - }; + phi = twon * a[i] * u; + do { + t = c[i] * sin(b = phi) / a[i]; + phi = (asin(t) + phi) / 2; + } while (--i); - pack.padding = function(x) { - return arguments.length ? (padding = typeof x === "function" ? x : constant(+x), pack) : padding; - }; + return [sin(phi), t = cos(phi), t / cos(phi - b), phi]; +} - return pack; +// Calculate F(phi+iPsi|m). +// See Abramowitz and Stegun, 17.4.11. +function ellipticFi(phi, psi, m) { + var r = abs(phi), + i = abs(psi), + sinhPsi = sinh(i); + if (r) { + var cscPhi = 1 / sin(r), + cotPhi2 = 1 / (tan(r) * tan(r)), + b = -(cotPhi2 + m * (sinhPsi * sinhPsi * cscPhi * cscPhi) - 1 + m), + c = (m - 1) * cotPhi2, + cotLambda2 = (-b + sqrt(b * b - 4 * c)) / 2; + return [ + ellipticF(atan(1 / sqrt(cotLambda2)), m) * sign(phi), + ellipticF(atan(sqrt((cotLambda2 / cotPhi2 - 1) / m)), 1 - m) * sign(psi) + ]; + } + return [ + 0, + ellipticF(atan(sinhPsi), 1 - m) * sign(psi) + ]; } -function radiusLeaf(radius) { - return function(node) { - if (!node.children) { - node.r = Math.max(0, +radius(node) || 0); - } - }; +// Calculate F(phi|m) where m = k² = sin²α. +// See Abramowitz and Stegun, 17.6.7. +function ellipticF(phi, m) { + if (!m) return phi; + if (m === 1) return log(tan(phi / 2 + quarterPi)); + var a = 1, + b = sqrt(1 - m), + c = sqrt(m); + for (var i = 0; abs(c) > epsilon; i++) { + if (phi % pi) { + var dPhi = atan(b * tan(phi) / a); + if (dPhi < 0) dPhi += pi; + phi += dPhi + ~~(phi / pi) * pi; + } else phi += phi; + c = (a + b) / 2; + b = sqrt(a * b); + c = ((a = c) - b) / 2; + } + return phi / (pow(2, i) * a); } -function packChildren(padding, k) { - return function(node) { - if (children = node.children) { - var children, - i, - n = children.length, - r = padding(node) * k || 0, - e; +function guyouRaw(lambda, phi) { + var k_ = (sqrt2 - 1) / (sqrt2 + 1), + k = sqrt(1 - k_ * k_), + K = ellipticF(halfPi, k * k), + f = -1, + psi = log(tan(pi / 4 + abs(phi) / 2)), + r = exp(f * psi) / sqrt(k_), + at = guyouComplexAtan(r * cos(f * lambda), r * sin(f * lambda)), + t = ellipticFi(at[0], at[1], k * k); + return [-t[1], (phi >= 0 ? 1 : -1) * (0.5 * K - t[0])]; +} - if (r) for (i = 0; i < n; ++i) children[i].r += r; - e = packEnclose(children); - if (r) for (i = 0; i < n; ++i) children[i].r -= r; - node.r = e + r; - } - }; +function guyouComplexAtan(x, y) { + var x2 = x * x, + y_1 = y + 1, + t = 1 - x2 - y * y; + return [ + 0.5 * ((x >= 0 ? halfPi : -halfPi) - atan2(t, 2 * x)), + -0.25 * log(t * t + 4 * x2) +0.5 * log(y_1 * y_1 + x2) + ]; } -function translateChild(k) { - return function(node) { - var parent = node.parent; - node.r *= k; - if (parent) { - node.x = parent.x + k * node.x; - node.y = parent.y + k * node.y; - } - }; +function guyouComplexDivide(a, b) { + var denominator = b[0] * b[0] + b[1] * b[1]; + return [ + (a[0] * b[0] + a[1] * b[1]) / denominator, + (a[1] * b[0] - a[0] * b[1]) / denominator + ]; } -function roundNode(node) { - node.x0 = Math.round(node.x0); - node.y0 = Math.round(node.y0); - node.x1 = Math.round(node.x1); - node.y1 = Math.round(node.y1); +guyouRaw.invert = function(x, y) { + var k_ = (sqrt2 - 1) / (sqrt2 + 1), + k = sqrt(1 - k_ * k_), + K = ellipticF(halfPi, k * k), + f = -1, + j = ellipticJi(0.5 * K - y, -x, k * k), + tn = guyouComplexDivide(j[0], j[1]), + lambda = atan2(tn[1], tn[0]) / f; + return [ + lambda, + 2 * atan(exp(0.5 / f * log(k_ * tn[0] * tn[0] + k_ * tn[1] * tn[1]))) - halfPi + ]; +}; + +function guyou() { + return d3Geo.geoProjection(squareRaw(guyouRaw)) + .scale(151.496); } -function treemapDice(parent, x0, y0, x1, y1) { - var nodes = parent.children, - node, - i = -1, - n = nodes.length, - k = parent.value && (x1 - x0) / parent.value; +function hammerRetroazimuthalRaw(phi0) { + var sinPhi0 = sin(phi0), + cosPhi0 = cos(phi0), + rotate = hammerRetroazimuthalRotation(phi0); - while (++i < n) { - node = nodes[i], node.y0 = y0, node.y1 = y1; - node.x0 = x0, node.x1 = x0 += node.value * k; + rotate.invert = hammerRetroazimuthalRotation(-phi0); + + function forward(lambda, phi) { + var p = rotate(lambda, phi); + lambda = p[0], phi = p[1]; + var sinPhi = sin(phi), + cosPhi = cos(phi), + cosLambda = cos(lambda), + z = acos(sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosLambda), + sinz = sin(z), + K = abs(sinz) > epsilon ? z / sinz : 1; + return [ + K * cosPhi0 * sin(lambda), + (abs(lambda) > halfPi ? K : -K) // rotate for back hemisphere + * (sinPhi0 * cosPhi - cosPhi0 * sinPhi * cosLambda) + ]; } + + forward.invert = function(x, y) { + var rho = sqrt(x * x + y * y), + sinz = -sin(rho), + cosz = cos(rho), + a = rho * cosz, + b = -y * sinz, + c = rho * sinPhi0, + d = sqrt(a * a + b * b - c * c), + phi = atan2(a * c + b * d, b * c - a * d), + lambda = (rho > halfPi ? -1 : 1) * atan2(x * sinz, rho * cos(phi) * cosz + y * sin(phi) * sinz); + return rotate.invert(lambda, phi); + }; + + return forward; } -function partition() { - var dx = 1, - dy = 1, - padding = 0, - round = false; +// Latitudinal rotation by phi0. +// Temporary hack until D3 supports arbitrary small-circle clipping origins. +function hammerRetroazimuthalRotation(phi0) { + var sinPhi0 = sin(phi0), + cosPhi0 = cos(phi0); - function partition(root) { - var n = root.height + 1; - root.x0 = - root.y0 = padding; - root.x1 = dx; - root.y1 = dy / n; - root.eachBefore(positionNode(dy, n)); - if (round) root.eachBefore(roundNode); - return root; - } + return function(lambda, phi) { + var cosPhi = cos(phi), + x = cos(lambda) * cosPhi, + y = sin(lambda) * cosPhi, + z = sin(phi); + return [ + atan2(y, x * cosPhi0 - z * sinPhi0), + asin(z * cosPhi0 + x * sinPhi0) + ]; + }; +} - function positionNode(dy, n) { - return function(node) { - if (node.children) { - treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n); - } - var x0 = node.x0, - y0 = node.y0, - x1 = node.x1 - padding, - y1 = node.y1 - padding; - if (x1 < x0) x0 = x1 = (x0 + x1) / 2; - if (y1 < y0) y0 = y1 = (y0 + y1) / 2; - node.x0 = x0; - node.y0 = y0; - node.x1 = x1; - node.y1 = y1; +function hammerRetroazimuthal() { + var phi0 = 0, + m = d3Geo.geoProjectionMutator(hammerRetroazimuthalRaw), + p = m(phi0), + rotate_ = p.rotate, + stream_ = p.stream, + circle = d3Geo.geoCircle(); + + p.parallel = function(_) { + if (!arguments.length) return phi0 * degrees; + var r = p.rotate(); + return m(phi0 = _ * radians).rotate(r); + }; + + // Temporary hack; see hammerRetroazimuthalRotation. + p.rotate = function(_) { + if (!arguments.length) return (_ = rotate_.call(p), _[1] += phi0 * degrees, _); + rotate_.call(p, [_[0], _[1] - phi0 * degrees]); + circle.center([-_[0], -_[1]]); + return p; + }; + + p.stream = function(stream) { + stream = stream_(stream); + stream.sphere = function() { + stream.polygonStart(); + var epsilon$$1 = 1e-2, + ring = circle.radius(90 - epsilon$$1)().coordinates[0], + n = ring.length - 1, + i = -1, + p; + stream.lineStart(); + while (++i < n) stream.point((p = ring[i])[0], p[1]); + stream.lineEnd(); + ring = circle.radius(90 + epsilon$$1)().coordinates[0]; + n = ring.length - 1; + stream.lineStart(); + while (--i >= 0) stream.point((p = ring[i])[0], p[1]); + stream.lineEnd(); + stream.polygonEnd(); }; + return stream; + }; + + return p + .scale(79.4187) + .parallel(45) + .clipAngle(180 - 1e-3); +} + +var K = 3, + healpixParallel = asin(1 - 1 / K) * degrees, + healpixLambert = cylindricalEqualAreaRaw(0); + +function healpixRaw(H) { + var phi0 = healpixParallel * radians, + dx = collignonRaw(pi, phi0)[0] - collignonRaw(-pi, phi0)[0], + y0 = healpixLambert(0, phi0)[1], + y1 = collignonRaw(0, phi0)[1], + dy1 = sqrtPi - y1, + k = tau / H, + w = 4 / tau, + h = y0 + (dy1 * dy1 * 4) / tau; + + function forward(lambda, phi) { + var point, + phi2 = abs(phi); + if (phi2 > phi0) { + var i = min(H - 1, max(0, floor((lambda + pi) / k))); + lambda += pi * (H - 1) / H - i * k; + point = collignonRaw(lambda, phi2); + point[0] = point[0] * tau / dx - tau * (H - 1) / (2 * H) + i * tau / H; + point[1] = y0 + (point[1] - y1) * 4 * dy1 / tau; + if (phi < 0) point[1] = -point[1]; + } else { + point = healpixLambert(lambda, phi); + } + point[0] *= w, point[1] /= h; + return point; } - partition.round = function(x) { - return arguments.length ? (round = !!x, partition) : round; + forward.invert = function(x, y) { + x /= w, y *= h; + var y2 = abs(y); + if (y2 > y0) { + var i = min(H - 1, max(0, floor((x + pi) / k))); + x = (x + pi * (H - 1) / H - i * k) * dx / tau; + var point = collignonRaw.invert(x, 0.25 * (y2 - y0) * tau / dy1 + y1); + point[0] -= pi * (H - 1) / H - i * k; + if (y < 0) point[1] = -point[1]; + return point; + } + return healpixLambert.invert(x, y); }; - partition.size = function(x) { - return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy]; + return forward; +} + +function sphereTop(x, i) { + return [x, i & 1 ? 90 - epsilon : healpixParallel]; +} + +function sphereBottom(x, i) { + return [x, i & 1 ? -90 + epsilon : -healpixParallel]; +} + +function sphereNudge(d) { + return [d[0] * (1 - epsilon), d[1]]; +} + +function sphere(step) { + var c = [].concat( + d3Array.range(-180, 180 + step / 2, step).map(sphereTop), + d3Array.range(180, -180 - step / 2, -step).map(sphereBottom) + ); + return { + type: "Polygon", + coordinates: [step === 180 ? c.map(sphereNudge) : c] }; +} - partition.padding = function(x) { - return arguments.length ? (padding = +x, partition) : padding; +function healpix() { + var H = 4, + m = d3Geo.geoProjectionMutator(healpixRaw), + p = m(H), + stream_ = p.stream; + + p.lobes = function(_) { + return arguments.length ? m(H = +_) : H; }; - return partition; + p.stream = function(stream) { + var rotate = p.rotate(), + rotateStream = stream_(stream), + sphereStream = (p.rotate([0, 0]), stream_(stream)); + p.rotate(rotate); + rotateStream.sphere = function() { d3Geo.geoStream(sphere(180 / H), sphereStream); }; + return rotateStream; + }; + + return p + .scale(239.75); } -var keyPrefix = "$", // Protect against keys like “__proto__”. - preroot = {depth: -1}, - ambiguous = {}; +function hillRaw(K) { + var L = 1 + K, + sinBt = sin(1 / L), + Bt = asin(sinBt), + A = 2 * sqrt(pi / (B = pi + 4 * Bt * L)), + B, + rho0 = 0.5 * A * (L + sqrt(K * (2 + K))), + K2 = K * K, + L2 = L * L; -function defaultId(d) { - return d.id; + function forward(lambda, phi) { + var t = 1 - sin(phi), + rho, + omega; + if (t && t < 2) { + var theta = halfPi - phi, i = 25, delta; + do { + var sinTheta = sin(theta), + cosTheta = cos(theta), + Bt_Bt1 = Bt + atan2(sinTheta, L - cosTheta), + C = 1 + L2 - 2 * L * cosTheta; + theta -= delta = (theta - K2 * Bt - L * sinTheta + C * Bt_Bt1 -0.5 * t * B) / (2 * L * sinTheta * Bt_Bt1); + } while (abs(delta) > epsilon2 && --i > 0); + rho = A * sqrt(C); + omega = lambda * Bt_Bt1 / pi; + } else { + rho = A * (K + t); + omega = lambda * Bt / pi; + } + return [ + rho * sin(omega), + rho0 - rho * cos(omega) + ]; + } + + forward.invert = function(x, y) { + var rho2 = x * x + (y -= rho0) * y, + cosTheta = (1 + L2 - rho2 / (A * A)) / (2 * L), + theta = acos(cosTheta), + sinTheta = sin(theta), + Bt_Bt1 = Bt + atan2(sinTheta, L - cosTheta); + return [ + asin(x / sqrt(rho2)) * pi / Bt_Bt1, + asin(1 - 2 * (theta - K2 * Bt - L * sinTheta + (1 + L2 - 2 * L * cosTheta) * Bt_Bt1) / B) + ]; + }; + + return forward; } -function defaultParentId(d) { - return d.parentId; +function hill() { + var K = 1, + m = d3Geo.geoProjectionMutator(hillRaw), + p = m(K); + + p.ratio = function(_) { + return arguments.length ? m(K = +_) : K; + }; + + return p + .scale(167.774) + .center([0, 18.67]); } -function stratify() { - var id = defaultId, - parentId = defaultParentId; +var sinuMollweidePhi = 0.7109889596207567; - function stratify(data) { - var d, - i, - n = data.length, - root, - parent, - node, - nodes = new Array(n), - nodeId, - nodeKey, - nodeByKey = {}; +var sinuMollweideY = 0.0528035274542; - for (i = 0; i < n; ++i) { - d = data[i], node = nodes[i] = new Node(d); - if ((nodeId = id(d, i, data)) != null && (nodeId += "")) { - nodeKey = keyPrefix + (node.id = nodeId); - nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node; - } - } +function sinuMollweideRaw(lambda, phi) { + return phi > -sinuMollweidePhi + ? (lambda = mollweideRaw(lambda, phi), lambda[1] += sinuMollweideY, lambda) + : sinusoidalRaw(lambda, phi); +} - for (i = 0; i < n; ++i) { - node = nodes[i], nodeId = parentId(data[i], i, data); - if (nodeId == null || !(nodeId += "")) { - if (root) throw new Error("multiple roots"); - root = node; - } else { - parent = nodeByKey[keyPrefix + nodeId]; - if (!parent) throw new Error("missing: " + nodeId); - if (parent === ambiguous) throw new Error("ambiguous: " + nodeId); - if (parent.children) parent.children.push(node); - else parent.children = [node]; - node.parent = parent; - } - } +sinuMollweideRaw.invert = function(x, y) { + return y > -sinuMollweidePhi + ? mollweideRaw.invert(x, y - sinuMollweideY) + : sinusoidalRaw.invert(x, y); +}; - if (!root) throw new Error("no root"); - root.parent = preroot; - root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight); - root.parent = null; - if (n > 0) throw new Error("cycle"); +function sinuMollweide() { + return d3Geo.geoProjection(sinuMollweideRaw) + .rotate([-20, -55]) + .scale(164.263) + .center([0, -5.4036]); +} - return root; +function homolosineRaw(lambda, phi) { + return abs(phi) > sinuMollweidePhi + ? (lambda = mollweideRaw(lambda, phi), lambda[1] -= phi > 0 ? sinuMollweideY : -sinuMollweideY, lambda) + : sinusoidalRaw(lambda, phi); +} + +homolosineRaw.invert = function(x, y) { + return abs(y) > sinuMollweidePhi + ? mollweideRaw.invert(x, y + (y > 0 ? sinuMollweideY : -sinuMollweideY)) + : sinusoidalRaw.invert(x, y); +}; + +function homolosine() { + return d3Geo.geoProjection(homolosineRaw) + .scale(152.63); +} + +function hufnagelRaw(a, b, psiMax, ratio) { + var k = sqrt( + (4 * pi) / + (2 * psiMax + + (1 + a - b / 2) * sin(2 * psiMax) + + ((a + b) / 2) * sin(4 * psiMax) + + (b / 2) * sin(6 * psiMax)) + ), + c = sqrt( + ratio * + sin(psiMax) * + sqrt((1 + a * cos(2 * psiMax) + b * cos(4 * psiMax)) / (1 + a + b)) + ), + M = psiMax * mapping(1); + + function radius(psi) { + return sqrt(1 + a * cos(2 * psi) + b * cos(4 * psi)); } - stratify.id = function(x) { - return arguments.length ? (id = required(x), stratify) : id; + function mapping(t) { + var psi = t * psiMax; + return ( + (2 * psi + + (1 + a - b / 2) * sin(2 * psi) + + ((a + b) / 2) * sin(4 * psi) + + (b / 2) * sin(6 * psi)) / + psiMax + ); + } + + function inversemapping(psi) { + return radius(psi) * sin(psi); + } + + var forward = function(lambda, phi) { + var psi = psiMax * solve(mapping, (M * sin(phi)) / psiMax, phi / pi); + if (isNaN(psi)) psi = psiMax * sign(phi); + var kr = k * radius(psi); + return [((kr * c * lambda) / pi) * cos(psi), (kr / c) * sin(psi)]; }; - stratify.parentId = function(x) { - return arguments.length ? (parentId = required(x), stratify) : parentId; + forward.invert = function(x, y) { + var psi = solve(inversemapping, (y * c) / k); + return [ + (x * pi) / (cos(psi) * k * c * radius(psi)), + asin((psiMax * mapping(psi / psiMax)) / M) + ]; }; - return stratify; -} + if (psiMax === 0) { + k = sqrt(ratio / pi); + forward = function(lambda, phi) { + return [lambda * k, sin(phi) / k]; + }; + forward.invert = function(x, y) { + return [x / k, asin(y * k)]; + }; + } -function defaultSeparation$1(a, b) { - return a.parent === b.parent ? 1 : 2; + return forward; } -// function radialSeparation(a, b) { -// return (a.parent === b.parent ? 1 : 2) / a.depth; -// } +function hufnagel() { + var a = 1, + b = 0, + psiMax = 45 * radians, + ratio = 2, + mutate = d3Geo.geoProjectionMutator(hufnagelRaw), + projection = mutate(a, b, psiMax, ratio); -// This function is used to traverse the left contour of a subtree (or -// subforest). It returns the successor of v on this contour. This successor is -// either given by the leftmost child of v or by the thread of v. The function -// returns null if and only if v is on the highest level of its subtree. -function nextLeft(v) { - var children = v.children; - return children ? children[0] : v.t; + projection.a = function(_) { + return arguments.length ? mutate((a = +_), b, psiMax, ratio) : a; + }; + projection.b = function(_) { + return arguments.length ? mutate(a, (b = +_), psiMax, ratio) : b; + }; + projection.psiMax = function(_) { + return arguments.length + ? mutate(a, b, (psiMax = +_ * radians), ratio) + : psiMax * degrees; + }; + projection.ratio = function(_) { + return arguments.length ? mutate(a, b, psiMax, (ratio = +_)) : ratio; + }; + + return projection.scale(180.739); } -// This function works analogously to nextLeft. -function nextRight(v) { - var children = v.children; - return children ? children[children.length - 1] : v.t; +// https://github.com/scijs/integrate-adaptive-simpson + +// This algorithm adapted from pseudocode in: +// http://www.math.utk.edu/~ccollins/refs/Handouts/rich.pdf +function adsimp (f, a, b, fa, fm, fb, V0, tol, maxdepth, depth, state) { + if (state.nanEncountered) { + return NaN; + } + + var h, f1, f2, sl, sr, s2, m, V1, V2, err; + + h = b - a; + f1 = f(a + h * 0.25); + f2 = f(b - h * 0.25); + + // Simple check for NaN: + if (isNaN(f1)) { + state.nanEncountered = true; + return; + } + + // Simple check for NaN: + if (isNaN(f2)) { + state.nanEncountered = true; + return; + } + + sl = h * (fa + 4 * f1 + fm) / 12; + sr = h * (fm + 4 * f2 + fb) / 12; + s2 = sl + sr; + err = (s2 - V0) / 15; + + if (depth > maxdepth) { + state.maxDepthCount++; + return s2 + err; + } else if (Math.abs(err) < tol) { + return s2 + err; + } else { + m = a + h * 0.5; + + V1 = adsimp(f, a, m, fa, f1, fm, sl, tol * 0.5, maxdepth, depth + 1, state); + + if (isNaN(V1)) { + state.nanEncountered = true; + return NaN; + } + + V2 = adsimp(f, m, b, fm, f2, fb, sr, tol * 0.5, maxdepth, depth + 1, state); + + if (isNaN(V2)) { + state.nanEncountered = true; + return NaN; + } + + return V1 + V2; + } } -// Shifts the current subtree rooted at w+. This is done by increasing -// prelim(w+) and mod(w+) by shift. -function moveSubtree(wm, wp, shift) { - var change = shift / (wp.i - wm.i); - wp.c -= change; - wp.s += shift; - wm.c += change; - wp.z += shift; - wp.m += shift; +function integrate (f, a, b, tol, maxdepth) { + var state = { + maxDepthCount: 0, + nanEncountered: false + }; + + if (tol === undefined) { + tol = 1e-8; + } + if (maxdepth === undefined) { + maxdepth = 20; + } + + var fa = f(a); + var fm = f(0.5 * (a + b)); + var fb = f(b); + + var V0 = (fa + 4 * fm + fb) * (b - a) / 6; + + var result = adsimp(f, a, b, fa, fm, fb, V0, tol, maxdepth, 1, state); + +/* + if (state.maxDepthCount > 0 && console && console.warn) { + console.warn('integrate-adaptive-simpson: Warning: maximum recursion depth (' + maxdepth + ') reached ' + state.maxDepthCount + ' times'); + } + + if (state.nanEncountered && console && console.warn) { + console.warn('integrate-adaptive-simpson: Warning: NaN encountered. Halting early.'); + } +*/ + + return result; } -// All other shifts, applied to the smaller subtrees between w- and w+, are -// performed by this function. To prepare the shifts, we have to adjust -// change(w+), shift(w+), and change(w-). -function executeShifts(v) { - var shift = 0, - change = 0, - children = v.children, - i = children.length, - w; - while (--i >= 0) { - w = children[i]; - w.z += shift; - w.m += shift; - shift += w.s + (change += w.c); +function hyperellipticalRaw(alpha, k, gamma) { + + function elliptic (f) { + return alpha + (1 - alpha) * pow(1 - pow(f, k), 1 / k); + } + + function z(f) { + return integrate(elliptic, 0, f, 1e-4); + } + + var G = 1 / z(1), + n = 1000, + m = (1 + 1e-8) * G, + approx = []; + for (var i = 0; i <= n; i++) + approx.push(z(i / n) * m); + + function Y(sinphi) { + var rmin = 0, rmax = n, r = n >> 1; + do { + if (approx[r] > sinphi) rmax = r; else rmin = r; + r = (rmin + rmax) >> 1; + } while (r > rmin); + var u = approx[r + 1] - approx[r]; + if (u) u = (sinphi - approx[r + 1]) / u; + return (r + 1 + u) / n; } + + var ratio = 2 * Y(1) / pi * G / gamma; + + var forward = function(lambda, phi) { + var y = Y(abs(sin(phi))), + x = elliptic(y) * lambda; + y /= ratio; + return [ x, (phi >= 0) ? y : -y ]; + }; + + forward.invert = function(x, y) { + var phi; + y *= ratio; + if (abs(y) < 1) phi = sign(y) * asin(z(abs(y)) * G); + return [ x / elliptic(abs(y)), phi ]; + }; + + return forward; } -// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise, -// returns the specified (default) ancestor. -function nextAncestor(vim, v, ancestor) { - return vim.a.parent === v.parent ? vim.a : ancestor; +function hyperelliptical() { + var alpha = 0, + k = 2.5, + gamma = 1.183136, // affine = sqrt(2 * gamma / pi) = 0.8679 + m = d3Geo.geoProjectionMutator(hyperellipticalRaw), + p = m(alpha, k, gamma); + + p.alpha = function(_) { + return arguments.length ? m(alpha = +_, k, gamma) : alpha; + }; + + p.k = function(_) { + return arguments.length ? m(alpha, k = +_, gamma) : k; + }; + + p.gamma = function(_) { + return arguments.length ? m(alpha, k, gamma = +_) : gamma; + }; + + return p + .scale(152.63); } -function TreeNode(node, i) { - this._ = node; - this.parent = null; - this.children = null; - this.A = null; // default ancestor - this.a = this; // ancestor - this.z = 0; // prelim - this.m = 0; // mod - this.c = 0; // change - this.s = 0; // shift - this.t = null; // thread - this.i = i; // number +function pointEqual(a, b) { + return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon; } -TreeNode.prototype = Object.create(Node.prototype); +function interpolateLine(coordinates, m) { + var i = -1, + n = coordinates.length, + p0 = coordinates[0], + p1, + dx, + dy, + resampled = []; + while (++i < n) { + p1 = coordinates[i]; + dx = (p1[0] - p0[0]) / m; + dy = (p1[1] - p0[1]) / m; + for (var j = 0; j < m; ++j) resampled.push([p0[0] + j * dx, p0[1] + j * dy]); + p0 = p1; + } + resampled.push(p1); + return resampled; +} -function treeRoot(root) { - var tree = new TreeNode(root, 0), - node, - nodes = [tree], - child, - children, - i, - n; +function interpolateSphere(lobes) { + var coordinates = [], + lobe, + lambda0, phi0, phi1, + lambda2, phi2, + i, n = lobes[0].length; - while (node = nodes.pop()) { - if (children = node._.children) { - node.children = new Array(n = children.length); - for (i = n - 1; i >= 0; --i) { - nodes.push(child = node.children[i] = new TreeNode(children[i], i)); - child.parent = node; - } - } + // Northern Hemisphere + for (i = 0; i < n; ++i) { + lobe = lobes[0][i]; + lambda0 = lobe[0][0], phi0 = lobe[0][1], phi1 = lobe[1][1]; + lambda2 = lobe[2][0], phi2 = lobe[2][1]; + coordinates.push(interpolateLine([ + [lambda0 + epsilon, phi0 + epsilon], + [lambda0 + epsilon, phi1 - epsilon], + [lambda2 - epsilon, phi1 - epsilon], + [lambda2 - epsilon, phi2 + epsilon] + ], 30)); } - (tree.parent = new TreeNode(null, 0)).children = [tree]; - return tree; + // Southern Hemisphere + for (i = lobes[1].length - 1; i >= 0; --i) { + lobe = lobes[1][i]; + lambda0 = lobe[0][0], phi0 = lobe[0][1], phi1 = lobe[1][1]; + lambda2 = lobe[2][0], phi2 = lobe[2][1]; + coordinates.push(interpolateLine([ + [lambda2 - epsilon, phi2 - epsilon], + [lambda2 - epsilon, phi1 + epsilon], + [lambda0 + epsilon, phi1 + epsilon], + [lambda0 + epsilon, phi0 - epsilon] + ], 30)); + } + + return { + type: "Polygon", + coordinates: [d3Array.merge(coordinates)] + }; } -// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm -function tree() { - var separation = defaultSeparation$1, - dx = 1, - dy = 1, - nodeSize = null; +function interrupt(project, lobes, inverse) { + var sphere, bounds; - function tree(root) { - var t = treeRoot(root); + function forward(lambda, phi) { + var sign$$1 = phi < 0 ? -1 : +1, lobe = lobes[+(phi < 0)]; + for (var i = 0, n = lobe.length - 1; i < n && lambda > lobe[i][2][0]; ++i); + var p = project(lambda - lobe[i][1][0], phi); + p[0] += project(lobe[i][1][0], sign$$1 * phi > sign$$1 * lobe[i][0][1] ? lobe[i][0][1] : phi)[0]; + return p; + } - // Compute the layout using Buchheim et al.’s algorithm. - t.eachAfter(firstWalk), t.parent.m = -t.z; - t.eachBefore(secondWalk); + if (inverse) { + forward.invert = inverse(forward); + } else if (project.invert) { + forward.invert = function(x, y) { + var bound = bounds[+(y < 0)], lobe = lobes[+(y < 0)]; + for (var i = 0, n = bound.length; i < n; ++i) { + var b = bound[i]; + if (b[0][0] <= x && x < b[1][0] && b[0][1] <= y && y < b[1][1]) { + var p = project.invert(x - project(lobe[i][1][0], 0)[0], y); + p[0] += lobe[i][1][0]; + return pointEqual(forward(p[0], p[1]), [x, y]) ? p : null; + } + } + }; + } - // If a fixed node size is specified, scale x and y. - if (nodeSize) root.eachBefore(sizeNode); + var p = d3Geo.geoProjection(forward), + stream_ = p.stream; - // If a fixed tree size is specified, scale x and y based on the extent. - // Compute the left-most, right-most, and depth-most nodes for extents. - else { - var left = root, - right = root, - bottom = root; - root.eachBefore(function(node) { - if (node.x < left.x) left = node; - if (node.x > right.x) right = node; - if (node.depth > bottom.depth) bottom = node; + p.stream = function(stream) { + var rotate = p.rotate(), + rotateStream = stream_(stream), + sphereStream = (p.rotate([0, 0]), stream_(stream)); + p.rotate(rotate); + rotateStream.sphere = function() { d3Geo.geoStream(sphere, sphereStream); }; + return rotateStream; + }; + + p.lobes = function(_) { + if (!arguments.length) return lobes.map(function(lobe) { + return lobe.map(function(l) { + return [ + [l[0][0] * degrees, l[0][1] * degrees], + [l[1][0] * degrees, l[1][1] * degrees], + [l[2][0] * degrees, l[2][1] * degrees] + ]; }); - var s = left === right ? 1 : separation(left, right) / 2, - tx = s - left.x, - kx = dx / (right.x + s + tx), - ky = dy / (bottom.depth || 1); - root.eachBefore(function(node) { - node.x = (node.x + tx) * kx; - node.y = node.depth * ky; + }); + + sphere = interpolateSphere(_); + + lobes = _.map(function(lobe) { + return lobe.map(function(l) { + return [ + [l[0][0] * radians, l[0][1] * radians], + [l[1][0] * radians, l[1][1] * radians], + [l[2][0] * radians, l[2][1] * radians] + ]; + }); + }); + + bounds = lobes.map(function(lobe) { + return lobe.map(function(l) { + var x0 = project(l[0][0], l[0][1])[0], + x1 = project(l[2][0], l[2][1])[0], + y0 = project(l[1][0], l[0][1])[1], + y1 = project(l[1][0], l[1][1])[1], + t; + if (y0 > y1) t = y0, y0 = y1, y1 = t; + return [[x0, y0], [x1, y1]]; }); + }); + + return p; + }; + + if (lobes != null) p.lobes(lobes); + + return p; +} + +var lobes = [[ // northern hemisphere + [[-180, 0], [-100, 90], [ -40, 0]], + [[ -40, 0], [ 30, 90], [ 180, 0]] +], [ // southern hemisphere + [[-180, 0], [-160, -90], [-100, 0]], + [[-100, 0], [ -60, -90], [ -20, 0]], + [[ -20, 0], [ 20, -90], [ 80, 0]], + [[ 80, 0], [ 140, -90], [ 180, 0]] +]]; + +function boggs$1() { + return interrupt(boggsRaw, lobes) + .scale(160.857); +} + +var lobes$1 = [[ // northern hemisphere + [[-180, 0], [-100, 90], [ -40, 0]], + [[ -40, 0], [ 30, 90], [ 180, 0]] +], [ // southern hemisphere + [[-180, 0], [-160, -90], [-100, 0]], + [[-100, 0], [ -60, -90], [ -20, 0]], + [[ -20, 0], [ 20, -90], [ 80, 0]], + [[ 80, 0], [ 140, -90], [ 180, 0]] +]]; + +function homolosine$1() { + return interrupt(homolosineRaw, lobes$1) + .scale(152.63); +} + +var lobes$2 = [[ // northern hemisphere + [[-180, 0], [-100, 90], [ -40, 0]], + [[ -40, 0], [ 30, 90], [ 180, 0]] +], [ // southern hemisphere + [[-180, 0], [-160, -90], [-100, 0]], + [[-100, 0], [ -60, -90], [ -20, 0]], + [[ -20, 0], [ 20, -90], [ 80, 0]], + [[ 80, 0], [ 140, -90], [ 180, 0]] +]]; + +function mollweide$1() { + return interrupt(mollweideRaw, lobes$2) + .scale(169.529); +} + +var lobes$3 = [[ // northern hemisphere + [[-180, 0], [ -90, 90], [ 0, 0]], + [[ 0, 0], [ 90, 90], [ 180, 0]] +], [ // southern hemisphere + [[-180, 0], [ -90, -90], [ 0, 0]], + [[ 0, 0], [ 90, -90], [ 180, 0]] +]]; + +function mollweideHemispheres() { + return interrupt(mollweideRaw, lobes$3) + .scale(169.529) + .rotate([20, 0]); +} + +var lobes$4 = [[ // northern hemisphere + [[-180, 35], [ -30, 90], [ 0, 35]], + [[ 0, 35], [ 30, 90], [ 180, 35]] +], [ // southern hemisphere + [[-180, -10], [-102, -90], [ -65, -10]], + [[ -65, -10], [ 5, -90], [ 77, -10]], + [[ 77, -10], [ 103, -90], [ 180, -10]] +]]; + +function sinuMollweide$1() { + return interrupt(sinuMollweideRaw, lobes$4, solve2d) + .rotate([-20, -55]) + .scale(164.263) + .center([0, -5.4036]); +} + +var lobes$5 = [[ // northern hemisphere + [[-180, 0], [-110, 90], [ -40, 0]], + [[ -40, 0], [ 0, 90], [ 40, 0]], + [[ 40, 0], [ 110, 90], [ 180, 0]] +], [ // southern hemisphere + [[-180, 0], [-110, -90], [ -40, 0]], + [[ -40, 0], [ 0, -90], [ 40, 0]], + [[ 40, 0], [ 110, -90], [ 180, 0]] +]]; + +function sinusoidal$1() { + return interrupt(sinusoidalRaw, lobes$5) + .scale(152.63) + .rotate([-20, 0]); +} + +function kavrayskiy7Raw(lambda, phi) { + return [3 / tau * lambda * sqrt(pi * pi / 3 - phi * phi), phi]; +} + +kavrayskiy7Raw.invert = function(x, y) { + return [tau / 3 * x / sqrt(pi * pi / 3 - y * y), y]; +}; + +function kavrayskiy7() { + return d3Geo.geoProjection(kavrayskiy7Raw) + .scale(158.837); +} + +function lagrangeRaw(n) { + + function forward(lambda, phi) { + if (abs(abs(phi) - halfPi) < epsilon) return [0, phi < 0 ? -2 : 2]; + var sinPhi = sin(phi), + v = pow((1 + sinPhi) / (1 - sinPhi), n / 2), + c = 0.5 * (v + 1 / v) + cos(lambda *= n); + return [ + 2 * sin(lambda) / c, + (v - 1 / v) / c + ]; + } + + forward.invert = function(x, y) { + var y0 = abs(y); + if (abs(y0 - 2) < epsilon) return x ? null : [0, sign(y) * halfPi]; + if (y0 > 2) return null; + + x /= 2, y /= 2; + var x2 = x * x, + y2 = y * y, + t = 2 * y / (1 + x2 + y2); // tanh(nPhi) + t = pow((1 + t) / (1 - t), 1 / n); + return [ + atan2(2 * x, 1 - x2 - y2) / n, + asin((t - 1) / (t + 1)) + ]; + }; + + return forward; +} + +function lagrange() { + var n = 0.5, + m = d3Geo.geoProjectionMutator(lagrangeRaw), + p = m(n); + + p.spacing = function(_) { + return arguments.length ? m(n = +_) : n; + }; + + return p + .scale(124.75); +} + +var pi_sqrt2 = pi / sqrt2; + +function larriveeRaw(lambda, phi) { + return [ + lambda * (1 + sqrt(cos(phi))) / 2, + phi / (cos(phi / 2) * cos(lambda / 6)) + ]; +} + +larriveeRaw.invert = function(x, y) { + var x0 = abs(x), + y0 = abs(y), + lambda = epsilon, + phi = halfPi; + if (y0 < pi_sqrt2) phi *= y0 / pi_sqrt2; + else lambda += 6 * acos(pi_sqrt2 / y0); + for (var i = 0; i < 25; i++) { + var sinPhi = sin(phi), + sqrtcosPhi = sqrt(cos(phi)), + sinPhi_2 = sin(phi / 2), + cosPhi_2 = cos(phi / 2), + sinLambda_6 = sin(lambda / 6), + cosLambda_6 = cos(lambda / 6), + f0 = 0.5 * lambda * (1 + sqrtcosPhi) - x0, + f1 = phi / (cosPhi_2 * cosLambda_6) - y0, + df0dPhi = sqrtcosPhi ? -0.25 * lambda * sinPhi / sqrtcosPhi : 0, + df0dLambda = 0.5 * (1 + sqrtcosPhi), + df1dPhi = (1 + 0.5 * phi * sinPhi_2 / cosPhi_2) / (cosPhi_2 * cosLambda_6), + df1dLambda = (phi / cosPhi_2) * (sinLambda_6 / 6) / (cosLambda_6 * cosLambda_6), + denom = df0dPhi * df1dLambda - df1dPhi * df0dLambda, + dPhi = (f0 * df1dLambda - f1 * df0dLambda) / denom, + dLambda = (f1 * df0dPhi - f0 * df1dPhi) / denom; + phi -= dPhi; + lambda -= dLambda; + if (abs(dPhi) < epsilon && abs(dLambda) < epsilon) break; + } + return [x < 0 ? -lambda : lambda, y < 0 ? -phi : phi]; +}; + +function larrivee() { + return d3Geo.geoProjection(larriveeRaw) + .scale(97.2672); +} + +function laskowskiRaw(lambda, phi) { + var lambda2 = lambda * lambda, phi2 = phi * phi; + return [ + lambda * (0.975534 + phi2 * (-0.119161 + lambda2 * -0.0143059 + phi2 * -0.0547009)), + phi * (1.00384 + lambda2 * (0.0802894 + phi2 * -0.02855 + lambda2 * 0.000199025) + phi2 * (0.0998909 + phi2 * -0.0491032)) + ]; +} + +laskowskiRaw.invert = function(x, y) { + var lambda = sign(x) * pi, + phi = y / 2, + i = 50; + do { + var lambda2 = lambda * lambda, + phi2 = phi * phi, + lambdaPhi = lambda * phi, + fx = lambda * (0.975534 + phi2 * (-0.119161 + lambda2 * -0.0143059 + phi2 * -0.0547009)) - x, + fy = phi * (1.00384 + lambda2 * (0.0802894 + phi2 * -0.02855 + lambda2 * 0.000199025) + phi2 * (0.0998909 + phi2 * -0.0491032)) - y, + deltaxDeltaLambda = 0.975534 - phi2 * (0.119161 + 3 * lambda2 * 0.0143059 + phi2 * 0.0547009), + deltaxDeltaPhi = -lambdaPhi * (2 * 0.119161 + 4 * 0.0547009 * phi2 + 2 * 0.0143059 * lambda2), + deltayDeltaLambda = lambdaPhi * (2 * 0.0802894 + 4 * 0.000199025 * lambda2 + 2 * -0.02855 * phi2), + deltayDeltaPhi = 1.00384 + lambda2 * (0.0802894 + 0.000199025 * lambda2) + phi2 * (3 * (0.0998909 - 0.02855 * lambda2) - 5 * 0.0491032 * phi2), + denominator = deltaxDeltaPhi * deltayDeltaLambda - deltayDeltaPhi * deltaxDeltaLambda, + deltaLambda = (fy * deltaxDeltaPhi - fx * deltayDeltaPhi) / denominator, + deltaPhi = (fx * deltayDeltaLambda - fy * deltaxDeltaLambda) / denominator; + lambda -= deltaLambda, phi -= deltaPhi; + } while ((abs(deltaLambda) > epsilon || abs(deltaPhi) > epsilon) && --i > 0); + return i && [lambda, phi]; +}; + +function laskowski() { + return d3Geo.geoProjection(laskowskiRaw) + .scale(139.98); +} + +function littrowRaw(lambda, phi) { + return [ + sin(lambda) / cos(phi), + tan(phi) * cos(lambda) + ]; +} + +littrowRaw.invert = function(x, y) { + var x2 = x * x, + y2 = y * y, + y2_1 = y2 + 1, + x2_y2_1 = x2 + y2_1, + cosPhi = x + ? sqrt1_2 * sqrt((x2_y2_1 - sqrt(x2_y2_1 * x2_y2_1 - 4 * x2)) / x2) + : 1 / sqrt(y2_1); + return [ + asin(x * cosPhi), + sign(y) * acos(cosPhi) + ]; +}; + +function littrow() { + return d3Geo.geoProjection(littrowRaw) + .scale(144.049) + .clipAngle(90 - 1e-3); +} + +function loximuthalRaw(phi0) { + var cosPhi0 = cos(phi0), + tanPhi0 = tan(quarterPi + phi0 / 2); + + function forward(lambda, phi) { + var y = phi - phi0, + x = abs(y) < epsilon ? lambda * cosPhi0 + : abs(x = quarterPi + phi / 2) < epsilon || abs(abs(x) - halfPi) < epsilon + ? 0 : lambda * y / log(tan(x) / tanPhi0); + return [x, y]; + } + + forward.invert = function(x, y) { + var lambda, + phi = y + phi0; + return [ + abs(y) < epsilon ? x / cosPhi0 + : (abs(lambda = quarterPi + phi / 2) < epsilon || abs(abs(lambda) - halfPi) < epsilon) ? 0 + : x * log(tan(lambda) / tanPhi0) / y, + phi + ]; + }; + + return forward; +} + +function loximuthal() { + return parallel1(loximuthalRaw) + .parallel(40) + .scale(158.837); +} + +function millerRaw(lambda, phi) { + return [lambda, 1.25 * log(tan(quarterPi + 0.4 * phi))]; +} + +millerRaw.invert = function(x, y) { + return [x, 2.5 * atan(exp(0.8 * y)) - 0.625 * pi]; +}; + +function miller() { + return d3Geo.geoProjection(millerRaw) + .scale(108.318); +} + +function modifiedStereographicRaw(C) { + var m = C.length - 1; + + function forward(lambda, phi) { + var cosPhi = cos(phi), + k = 2 / (1 + cosPhi * cos(lambda)), + zr = k * cosPhi * sin(lambda), + zi = k * sin(phi), + i = m, + w = C[i], + ar = w[0], + ai = w[1], + t; + while (--i >= 0) { + w = C[i]; + ar = w[0] + zr * (t = ar) - zi * ai; + ai = w[1] + zr * ai + zi * t; + } + ar = zr * (t = ar) - zi * ai; + ai = zr * ai + zi * t; + return [ar, ai]; + } + + forward.invert = function(x, y) { + var i = 20, + zr = x, + zi = y; + do { + var j = m, + w = C[j], + ar = w[0], + ai = w[1], + br = 0, + bi = 0, + t; + + while (--j >= 0) { + w = C[j]; + br = ar + zr * (t = br) - zi * bi; + bi = ai + zr * bi + zi * t; + ar = w[0] + zr * (t = ar) - zi * ai; + ai = w[1] + zr * ai + zi * t; + } + br = ar + zr * (t = br) - zi * bi; + bi = ai + zr * bi + zi * t; + ar = zr * (t = ar) - zi * ai - x; + ai = zr * ai + zi * t - y; + + var denominator = br * br + bi * bi, deltar, deltai; + zr -= deltar = (ar * br + ai * bi) / denominator; + zi -= deltai = (ai * br - ar * bi) / denominator; + } while (abs(deltar) + abs(deltai) > epsilon * epsilon && --i > 0); + + if (i) { + var rho = sqrt(zr * zr + zi * zi), + c = 2 * atan(rho * 0.5), + sinc = sin(c); + return [atan2(zr * sinc, rho * cos(c)), rho ? asin(zi * sinc / rho) : 0]; + } + }; + + return forward; +} + +var alaska = [[0.9972523, 0], [0.0052513, -0.0041175], [0.0074606, 0.0048125], [-0.0153783, -0.1968253], [0.0636871, -0.1408027], [0.3660976, -0.2937382]], + gs48 = [[0.98879, 0], [0, 0], [-0.050909, 0], [0, 0], [0.075528, 0]], + gs50 = [[0.9842990, 0], [0.0211642, 0.0037608], [-0.1036018, -0.0575102], [-0.0329095, -0.0320119], [0.0499471, 0.1223335], [0.0260460, 0.0899805], [0.0007388, -0.1435792], [0.0075848, -0.1334108], [-0.0216473, 0.0776645], [-0.0225161, 0.0853673]], + miller$1 = [[0.9245, 0], [0, 0], [0.01943, 0]], + lee = [[0.721316, 0], [0, 0], [-0.00881625, -0.00617325]]; + +function modifiedStereographicAlaska() { + return modifiedStereographic(alaska, [152, -64]) + .scale(1400) + .center([-160.908, 62.4864]) + .clipAngle(30) + .angle(7.8); +} + +function modifiedStereographicGs48() { + return modifiedStereographic(gs48, [95, -38]) + .scale(1000) + .clipAngle(55) + .center([-96.5563, 38.8675]); +} + +function modifiedStereographicGs50() { + return modifiedStereographic(gs50, [120, -45]) + .scale(359.513) + .clipAngle(55) + .center([-117.474, 53.0628]); +} + +function modifiedStereographicMiller() { + return modifiedStereographic(miller$1, [-20, -18]) + .scale(209.091) + .center([20, 16.7214]) + .clipAngle(82); +} + +function modifiedStereographicLee() { + return modifiedStereographic(lee, [165, 10]) + .scale(250) + .clipAngle(130) + .center([-165, -10]); +} + +function modifiedStereographic(coefficients, rotate) { + var p = d3Geo.geoProjection(modifiedStereographicRaw(coefficients)).rotate(rotate).clipAngle(90), + r = d3Geo.geoRotation(rotate), + center = p.center; + + delete p.rotate; + + p.center = function(_) { + return arguments.length ? center(r(_)) : r.invert(center()); + }; + + return p; +} + +var sqrt6 = sqrt(6), + sqrt7 = sqrt(7); + +function mtFlatPolarParabolicRaw(lambda, phi) { + var theta = asin(7 * sin(phi) / (3 * sqrt6)); + return [ + sqrt6 * lambda * (2 * cos(2 * theta / 3) - 1) / sqrt7, + 9 * sin(theta / 3) / sqrt7 + ]; +} + +mtFlatPolarParabolicRaw.invert = function(x, y) { + var theta = 3 * asin(y * sqrt7 / 9); + return [ + x * sqrt7 / (sqrt6 * (2 * cos(2 * theta / 3) - 1)), + asin(sin(theta) * 3 * sqrt6 / 7) + ]; +}; + +function mtFlatPolarParabolic() { + return d3Geo.geoProjection(mtFlatPolarParabolicRaw) + .scale(164.859); +} + +function mtFlatPolarQuarticRaw(lambda, phi) { + var k = (1 + sqrt1_2) * sin(phi), + theta = phi; + for (var i = 0, delta; i < 25; i++) { + theta -= delta = (sin(theta / 2) + sin(theta) - k) / (0.5 * cos(theta / 2) + cos(theta)); + if (abs(delta) < epsilon) break; + } + return [ + lambda * (1 + 2 * cos(theta) / cos(theta / 2)) / (3 * sqrt2), + 2 * sqrt(3) * sin(theta / 2) / sqrt(2 + sqrt2) + ]; +} + +mtFlatPolarQuarticRaw.invert = function(x, y) { + var sinTheta_2 = y * sqrt(2 + sqrt2) / (2 * sqrt(3)), + theta = 2 * asin(sinTheta_2); + return [ + 3 * sqrt2 * x / (1 + 2 * cos(theta) / cos(theta / 2)), + asin((sinTheta_2 + sin(theta)) / (1 + sqrt1_2)) + ]; +}; + +function mtFlatPolarQuartic() { + return d3Geo.geoProjection(mtFlatPolarQuarticRaw) + .scale(188.209); +} + +function mtFlatPolarSinusoidalRaw(lambda, phi) { + var A = sqrt(6 / (4 + pi)), + k = (1 + pi / 4) * sin(phi), + theta = phi / 2; + for (var i = 0, delta; i < 25; i++) { + theta -= delta = (theta / 2 + sin(theta) - k) / (0.5 + cos(theta)); + if (abs(delta) < epsilon) break; + } + return [ + A * (0.5 + cos(theta)) * lambda / 1.5, + A * theta + ]; +} + +mtFlatPolarSinusoidalRaw.invert = function(x, y) { + var A = sqrt(6 / (4 + pi)), + theta = y / A; + if (abs(abs(theta) - halfPi) < epsilon) theta = theta < 0 ? -halfPi : halfPi; + return [ + 1.5 * x / (A * (0.5 + cos(theta))), + asin((theta / 2 + sin(theta)) / (1 + pi / 4)) + ]; +}; + +function mtFlatPolarSinusoidal() { + return d3Geo.geoProjection(mtFlatPolarSinusoidalRaw) + .scale(166.518); +} + +function naturalEarth2Raw(lambda, phi) { + var phi2 = phi * phi, phi4 = phi2 * phi2, phi6 = phi2 * phi4; + return [ + lambda * (0.84719 - 0.13063 * phi2 + phi6 * phi6 * (-0.04515 + 0.05494 * phi2 - 0.02326 * phi4 + 0.00331 * phi6)), + phi * (1.01183 + phi4 * phi4 * (-0.02625 + 0.01926 * phi2 - 0.00396 * phi4)) + ]; +} + +naturalEarth2Raw.invert = function(x, y) { + var phi = y, i = 25, delta, phi2, phi4, phi6; + do { + phi2 = phi * phi; phi4 = phi2 * phi2; + phi -= delta = ((phi * (1.01183 + phi4 * phi4 * (-0.02625 + 0.01926 * phi2 - 0.00396 * phi4))) - y) / + (1.01183 + phi4 * phi4 * ((9 * -0.02625) + (11 * 0.01926) * phi2 + (13 * -0.00396) * phi4)); + } while (abs(delta) > epsilon2 && --i > 0); + phi2 = phi * phi; phi4 = phi2 * phi2; phi6 = phi2 * phi4; + return [ + x / (0.84719 - 0.13063 * phi2 + phi6 * phi6 * (-0.04515 + 0.05494 * phi2 - 0.02326 * phi4 + 0.00331 * phi6)), + phi + ]; +}; + +function naturalEarth2() { + return d3Geo.geoProjection(naturalEarth2Raw) + .scale(175.295); +} + +function nellHammerRaw(lambda, phi) { + return [ + lambda * (1 + cos(phi)) / 2, + 2 * (phi - tan(phi / 2)) + ]; +} + +nellHammerRaw.invert = function(x, y) { + var p = y / 2; + for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; ++i) { + var c = cos(y / 2); + y -= delta = (y - tan(y / 2) - p) / (1 - 0.5 / (c * c)); + } + return [ + 2 * x / (1 + cos(y)), + y + ]; +}; + +function nellHammer() { + return d3Geo.geoProjection(nellHammerRaw) + .scale(152.63); +} + +var lobes$6 = [[ // northern hemisphere + [[-180, 0], [-90, 90], [ 0, 0]], + [[ 0, 0], [ 90, 90], [ 180, 0]] +], [ // southern hemisphere + [[-180, 0], [-90, -90], [ 0, 0]], + [[ 0, 0], [ 90, -90], [180, 0]] +]]; + +function quarticAuthalic() { + return interrupt(hammerRaw(Infinity), lobes$6) + .rotate([20, 0]) + .scale(152.63); +} + +// Based on Torben Jansen's implementation +// https://beta.observablehq.com/@toja/nicolosi-globular-projection +// https://beta.observablehq.com/@toja/nicolosi-globular-inverse + +function nicolosiRaw(lambda, phi) { + var sinPhi = sin(phi), + q = cos(phi), + s = sign(lambda); + + if (lambda === 0 || abs(phi) === halfPi) return [0, phi]; + else if (phi === 0) return [lambda, 0]; + else if (abs(lambda) === halfPi) return [lambda * q, halfPi * sinPhi]; + + var b = pi / (2 * lambda) - (2 * lambda) / pi, + c = (2 * phi) / pi, + d = (1 - c * c) / (sinPhi - c); + + var b2 = b * b, + d2 = d * d, + b2d2 = 1 + b2 / d2, + d2b2 = 1 + d2 / b2; + + var M = ((b * sinPhi) / d - b / 2) / b2d2, + N = ((d2 * sinPhi) / b2 + d / 2) / d2b2, + m = M * M + (q * q) / b2d2, + n = N * N - ((d2 * sinPhi * sinPhi) / b2 + d * sinPhi - 1) / d2b2; + + return [ + halfPi * (M + sqrt(m) * s), + halfPi * (N + sqrt(n < 0 ? 0 : n) * sign(-phi * b) * s) + ]; +} + +nicolosiRaw.invert = function(x, y) { + + x /= halfPi; + y /= halfPi; + + var x2 = x * x, + y2 = y * y, + x2y2 = x2 + y2, + pi2 = pi * pi; + + return [ + x ? (x2y2 -1 + sqrt((1 - x2y2) * (1 - x2y2) + 4 * x2)) / (2 * x) * halfPi : 0, + solve(function(phi) { + return ( + x2y2 * (pi * sin(phi) - 2 * phi) * pi + + 4 * phi * phi * (y - sin(phi)) + + 2 * pi * phi - + pi2 * y + ); + }, 0) + ]; +}; + +function nicolosi() { + return d3Geo.geoProjection(nicolosiRaw) + .scale(127.267); +} + +// Based on Java implementation by Bojan Savric. +// https://github.com/OSUCartography/JMapProjLib/blob/master/src/com/jhlabs/map/proj/PattersonProjection.java + +var pattersonK1 = 1.0148, + pattersonK2 = 0.23185, + pattersonK3 = -0.14499, + pattersonK4 = 0.02406, + pattersonC1 = pattersonK1, + pattersonC2 = 5 * pattersonK2, + pattersonC3 = 7 * pattersonK3, + pattersonC4 = 9 * pattersonK4, + pattersonYmax = 1.790857183; + +function pattersonRaw(lambda, phi) { + var phi2 = phi * phi; + return [ + lambda, + phi * (pattersonK1 + phi2 * phi2 * (pattersonK2 + phi2 * (pattersonK3 + pattersonK4 * phi2))) + ]; +} + +pattersonRaw.invert = function(x, y) { + if (y > pattersonYmax) y = pattersonYmax; + else if (y < -pattersonYmax) y = -pattersonYmax; + var yc = y, delta; + + do { // Newton-Raphson + var y2 = yc * yc; + yc -= delta = ((yc * (pattersonK1 + y2 * y2 * (pattersonK2 + y2 * (pattersonK3 + pattersonK4 * y2)))) - y) / (pattersonC1 + y2 * y2 * (pattersonC2 + y2 * (pattersonC3 + pattersonC4 * y2))); + } while (abs(delta) > epsilon); + + return [x, yc]; +}; + +function patterson() { + return d3Geo.geoProjection(pattersonRaw) + .scale(139.319); +} + +function polyconicRaw(lambda, phi) { + if (abs(phi) < epsilon) return [lambda, 0]; + var tanPhi = tan(phi), + k = lambda * sin(phi); + return [ + sin(k) / tanPhi, + phi + (1 - cos(k)) / tanPhi + ]; +} + +polyconicRaw.invert = function(x, y) { + if (abs(y) < epsilon) return [x, 0]; + var k = x * x + y * y, + phi = y * 0.5, + i = 10, delta; + do { + var tanPhi = tan(phi), + secPhi = 1 / cos(phi), + j = k - 2 * y * phi + phi * phi; + phi -= delta = (tanPhi * j + 2 * (phi - y)) / (2 + j * secPhi * secPhi + 2 * (phi - y) * tanPhi); + } while (abs(delta) > epsilon && --i > 0); + tanPhi = tan(phi); + return [ + (abs(y) < abs(phi + 1 / tanPhi) ? asin(x * tanPhi) : sign(y) * sign(x) * (acos(abs(x * tanPhi)) + halfPi)) / sin(phi), + phi + ]; +}; + +function polyconic() { + return d3Geo.geoProjection(polyconicRaw) + .scale(103.74); +} + +// Note: 6-element arrays are used to denote the 3x3 affine transform matrix: +// [a, b, c, +// d, e, f, +// 0, 0, 1] - this redundant row is left out. + +// Transform matrix for [a0, a1] -> [b0, b1]. +function matrix(a, b) { + var u = subtract(a[1], a[0]), + v = subtract(b[1], b[0]), + phi = angle$1(u, v), + s = length(u) / length(v); + + return multiply([ + 1, 0, a[0][0], + 0, 1, a[0][1] + ], multiply([ + s, 0, 0, + 0, s, 0 + ], multiply([ + cos(phi), sin(phi), 0, + -sin(phi), cos(phi), 0 + ], [ + 1, 0, -b[0][0], + 0, 1, -b[0][1] + ]))); +} + +// Inverts a transform matrix. +function inverse(m) { + var k = 1 / (m[0] * m[4] - m[1] * m[3]); + return [ + k * m[4], -k * m[1], k * (m[1] * m[5] - m[2] * m[4]), + -k * m[3], k * m[0], k * (m[2] * m[3] - m[0] * m[5]) + ]; +} + +// Multiplies two 3x2 matrices. +function multiply(a, b) { + return [ + a[0] * b[0] + a[1] * b[3], + a[0] * b[1] + a[1] * b[4], + a[0] * b[2] + a[1] * b[5] + a[2], + a[3] * b[0] + a[4] * b[3], + a[3] * b[1] + a[4] * b[4], + a[3] * b[2] + a[4] * b[5] + a[5] + ]; +} + +// Subtracts 2D vectors. +function subtract(a, b) { + return [a[0] - b[0], a[1] - b[1]]; +} + +// Magnitude of a 2D vector. +function length(v) { + return sqrt(v[0] * v[0] + v[1] * v[1]); +} + +// Angle between two 2D vectors. +function angle$1(a, b) { + return atan2(a[0] * b[1] - a[1] * b[0], a[0] * b[0] + a[1] * b[1]); +} + +// Creates a polyhedral projection. +// * root: a spanning tree of polygon faces. Nodes are automatically +// augmented with a transform matrix. +// * face: a function that returns the appropriate node for a given {lambda, phi} +// point (radians). +// * r: rotation angle for root face [deprecated by .angle()]. +function polyhedral(root, face, r) { + + recurse(root, {transform: null}); + + function recurse(node, parent) { + node.edges = faceEdges(node.face); + // Find shared edge. + if (parent.face) { + var shared = node.shared = sharedEdge(node.face, parent.face), + m = matrix(shared.map(parent.project), shared.map(node.project)); + node.transform = parent.transform ? multiply(parent.transform, m) : m; + // Replace shared edge in parent edges array. + var edges = parent.edges; + for (var i = 0, n = edges.length; i < n; ++i) { + if (pointEqual$1(shared[0], edges[i][1]) && pointEqual$1(shared[1], edges[i][0])) edges[i] = node; + if (pointEqual$1(shared[0], edges[i][0]) && pointEqual$1(shared[1], edges[i][1])) edges[i] = node; + } + edges = node.edges; + for (i = 0, n = edges.length; i < n; ++i) { + if (pointEqual$1(shared[0], edges[i][0]) && pointEqual$1(shared[1], edges[i][1])) edges[i] = parent; + if (pointEqual$1(shared[0], edges[i][1]) && pointEqual$1(shared[1], edges[i][0])) edges[i] = parent; + } + } else { + node.transform = parent.transform; + } + if (node.children) { + node.children.forEach(function(child) { + recurse(child, node); + }); + } + return node; + } + + function forward(lambda, phi) { + var node = face(lambda, phi), + point = node.project([lambda * degrees, phi * degrees]), + t; + if (t = node.transform) { + return [ + t[0] * point[0] + t[1] * point[1] + t[2], + -(t[3] * point[0] + t[4] * point[1] + t[5]) + ]; + } + point[1] = -point[1]; + return point; + } + + // Naive inverse! A faster solution would use bounding boxes, or even a + // polygonal quadtree. + if (hasInverse(root)) forward.invert = function(x, y) { + var coordinates = faceInvert(root, [x, -y]); + return coordinates && (coordinates[0] *= radians, coordinates[1] *= radians, coordinates); + }; + + function faceInvert(node, coordinates) { + var invert = node.project.invert, + t = node.transform, + point = coordinates; + if (t) { + t = inverse(t); + point = [ + t[0] * point[0] + t[1] * point[1] + t[2], + (t[3] * point[0] + t[4] * point[1] + t[5]) + ]; + } + if (invert && node === faceDegrees(p = invert(point))) return p; + var p, + children = node.children; + for (var i = 0, n = children && children.length; i < n; ++i) { + if (p = faceInvert(children[i], coordinates)) return p; + } + } + + function faceDegrees(coordinates) { + return face(coordinates[0] * radians, coordinates[1] * radians); + } + + var proj = d3Geo.geoProjection(forward), + stream_ = proj.stream; + + proj.stream = function(stream) { + var rotate = proj.rotate(), + rotateStream = stream_(stream), + sphereStream = (proj.rotate([0, 0]), stream_(stream)); + proj.rotate(rotate); + rotateStream.sphere = function() { + sphereStream.polygonStart(); + sphereStream.lineStart(); + outline(sphereStream, root); + sphereStream.lineEnd(); + sphereStream.polygonEnd(); + }; + return rotateStream; + }; + + return proj.angle(r == null ? -30 : r * degrees); +} + +function outline(stream, node, parent) { + var point, + edges = node.edges, + n = edges.length, + edge, + multiPoint = {type: "MultiPoint", coordinates: node.face}, + notPoles = node.face.filter(function(d) { return abs(d[1]) !== 90; }), + b = d3Geo.geoBounds({type: "MultiPoint", coordinates: notPoles}), + inside = false, + j = -1, + dx = b[1][0] - b[0][0]; + // TODO + var c = dx === 180 || dx === 360 + ? [(b[0][0] + b[1][0]) / 2, (b[0][1] + b[1][1]) / 2] + : d3Geo.geoCentroid(multiPoint); + // First find the shared edge… + if (parent) while (++j < n) { + if (edges[j] === parent) break; + } + ++j; + for (var i = 0; i < n; ++i) { + edge = edges[(i + j) % n]; + if (Array.isArray(edge)) { + if (!inside) { + stream.point((point = d3Geo.geoInterpolate(edge[0], c)(epsilon))[0], point[1]); + inside = true; + } + stream.point((point = d3Geo.geoInterpolate(edge[1], c)(epsilon))[0], point[1]); + } else { + inside = false; + if (edge !== parent) outline(stream, edge, node); + } + } +} + +// Tests equality of two spherical points. +function pointEqual$1(a, b) { + return a && b && a[0] === b[0] && a[1] === b[1]; +} + +// Finds a shared edge given two clockwise polygons. +function sharedEdge(a, b) { + var x, y, n = a.length, found = null; + for (var i = 0; i < n; ++i) { + x = a[i]; + for (var j = b.length; --j >= 0;) { + y = b[j]; + if (x[0] === y[0] && x[1] === y[1]) { + if (found) return [found, x]; + found = x; + } + } + } +} + +// Converts an array of n face vertices to an array of n + 1 edges. +function faceEdges(face) { + var n = face.length, + edges = []; + for (var a = face[n - 1], i = 0; i < n; ++i) edges.push([a, a = face[i]]); + return edges; +} + +function hasInverse(node) { + return node.project.invert || node.children && node.children.some(hasInverse); +} + +// TODO generate on-the-fly to avoid external modification. +var octahedron = [ + [0, 90], + [-90, 0], [0, 0], [90, 0], [180, 0], + [0, -90] +]; + +var octahedron$1 = [ + [0, 2, 1], + [0, 3, 2], + [5, 1, 2], + [5, 2, 3], + [0, 1, 4], + [0, 4, 3], + [5, 4, 1], + [5, 3, 4] +].map(function(face) { + return face.map(function(i) { + return octahedron[i]; + }); +}); + +function butterfly(faceProjection) { + + faceProjection = faceProjection || function(face) { + var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: face}); + return d3Geo.geoGnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]); + }; + + var faces = octahedron$1.map(function(face) { + return {face: face, project: faceProjection(face)}; + }); + + [-1, 0, 0, 1, 0, 1, 4, 5].forEach(function(d, i) { + var node = faces[d]; + node && (node.children || (node.children = [])).push(faces[i]); + }); + + return polyhedral(faces[0], function(lambda, phi) { + return faces[lambda < -pi / 2 ? phi < 0 ? 6 : 4 + : lambda < 0 ? phi < 0 ? 2 : 0 + : lambda < pi / 2 ? phi < 0 ? 3 : 1 + : phi < 0 ? 7 : 5]; + }) + .angle(-30) + .scale(101.858) + .center([0, 45]); +} + +var kx = 2 / sqrt(3); + +function collignonK(a, b) { + var p = collignonRaw(a, b); + return [p[0] * kx, p[1]]; +} + +collignonK.invert = function(x,y) { + return collignonRaw.invert(x / kx, y); +}; + +function collignon$1(faceProjection) { + + faceProjection = faceProjection || function(face) { + var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: face}); + return d3Geo.geoProjection(collignonK).translate([0, 0]).scale(1).rotate(c[1] > 0 ? [-c[0], 0] : [180 - c[0], 180]); + }; + + var faces = octahedron$1.map(function(face) { + return {face: face, project: faceProjection(face)}; + }); + + [-1, 0, 0, 1, 0, 1, 4, 5].forEach(function(d, i) { + var node = faces[d]; + node && (node.children || (node.children = [])).push(faces[i]); + }); + + return polyhedral(faces[0], function(lambda, phi) { + return faces[lambda < -pi / 2 ? phi < 0 ? 6 : 4 + : lambda < 0 ? phi < 0 ? 2 : 0 + : lambda < pi / 2 ? phi < 0 ? 3 : 1 + : phi < 0 ? 7 : 5]; + }) + .angle(-30) + .scale(121.906) + .center([0, 48.5904]); +} + +function waterman(faceProjection) { + + faceProjection = faceProjection || function(face) { + var c = face.length === 6 ? d3Geo.geoCentroid({type: "MultiPoint", coordinates: face}) : face[0]; + return d3Geo.geoGnomonic().scale(1).translate([0, 0]).rotate([-c[0], -c[1]]); + }; + + var w5 = octahedron$1.map(function(face) { + var xyz = face.map(cartesian), + n = xyz.length, + a = xyz[n - 1], + b, + hexagon = []; + for (var i = 0; i < n; ++i) { + b = xyz[i]; + hexagon.push(spherical([ + a[0] * 0.9486832980505138 + b[0] * 0.31622776601683794, + a[1] * 0.9486832980505138 + b[1] * 0.31622776601683794, + a[2] * 0.9486832980505138 + b[2] * 0.31622776601683794 + ]), spherical([ + b[0] * 0.9486832980505138 + a[0] * 0.31622776601683794, + b[1] * 0.9486832980505138 + a[1] * 0.31622776601683794, + b[2] * 0.9486832980505138 + a[2] * 0.31622776601683794 + ])); + a = b; + } + return hexagon; + }); + + var cornerNormals = []; + + var parents = [-1, 0, 0, 1, 0, 1, 4, 5]; + + w5.forEach(function(hexagon, j) { + var face = octahedron$1[j], + n = face.length, + normals = cornerNormals[j] = []; + for (var i = 0; i < n; ++i) { + w5.push([ + face[i], + hexagon[(i * 2 + 2) % (2 * n)], + hexagon[(i * 2 + 1) % (2 * n)] + ]); + parents.push(j); + normals.push(cross( + cartesian(hexagon[(i * 2 + 2) % (2 * n)]), + cartesian(hexagon[(i * 2 + 1) % (2 * n)]) + )); + } + }); + + var faces = w5.map(function(face) { + return { + project: faceProjection(face), + face: face + }; + }); + + parents.forEach(function(d, i) { + var parent = faces[d]; + parent && (parent.children || (parent.children = [])).push(faces[i]); + }); + + function face(lambda, phi) { + var cosphi = cos(phi), + p = [cosphi * cos(lambda), cosphi * sin(lambda), sin(phi)]; + + var hexagon = lambda < -pi / 2 ? phi < 0 ? 6 : 4 + : lambda < 0 ? phi < 0 ? 2 : 0 + : lambda < pi / 2 ? phi < 0 ? 3 : 1 + : phi < 0 ? 7 : 5; + + var n = cornerNormals[hexagon]; + + return faces[dot(n[0], p) < 0 ? 8 + 3 * hexagon + : dot(n[1], p) < 0 ? 8 + 3 * hexagon + 1 + : dot(n[2], p) < 0 ? 8 + 3 * hexagon + 2 + : hexagon]; + } + + return polyhedral(faces[0], face) + .angle(-30) + .scale(110.625) + .center([0,45]); +} + +function dot(a, b) { + for (var i = 0, n = a.length, s = 0; i < n; ++i) s += a[i] * b[i]; + return s; +} + +function cross(a, b) { + return [ + a[1] * b[2] - a[2] * b[1], + a[2] * b[0] - a[0] * b[2], + a[0] * b[1] - a[1] * b[0] + ]; +} + +// Converts 3D Cartesian to spherical coordinates (degrees). +function spherical(cartesian) { + return [ + atan2(cartesian[1], cartesian[0]) * degrees, + asin(max(-1, min(1, cartesian[2]))) * degrees + ]; +} + +// Converts spherical coordinates (degrees) to 3D Cartesian. +function cartesian(coordinates) { + var lambda = coordinates[0] * radians, + phi = coordinates[1] * radians, + cosphi = cos(phi); + return [ + cosphi * cos(lambda), + cosphi * sin(lambda), + sin(phi) + ]; +} + +function noop() {} + +function clockwise(ring) { + if ((n = ring.length) < 4) return false; + var i = 0, + n, + area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1]; + while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1]; + return area <= 0; +} + +function contains(ring, point) { + var x = point[0], + y = point[1], + contains = false; + for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) { + var pi = ring[i], xi = pi[0], yi = pi[1], + pj = ring[j], xj = pj[0], yj = pj[1]; + if (((yi > y) ^ (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi)) contains = !contains; + } + return contains; +} + +function index(object, projection) { + var stream = projection.stream, project; + if (!stream) throw new Error("invalid projection"); + switch (object && object.type) { + case "Feature": project = projectFeature; break; + case "FeatureCollection": project = projectFeatureCollection; break; + default: project = projectGeometry; break; + } + return project(object, stream); +} + +function projectFeatureCollection(o, stream) { + return { + type: "FeatureCollection", + features: o.features.map(function(f) { + return projectFeature(f, stream); + }) + }; +} + +function projectFeature(o, stream) { + return { + type: "Feature", + id: o.id, + properties: o.properties, + geometry: projectGeometry(o.geometry, stream) + }; +} + +function projectGeometryCollection(o, stream) { + return { + type: "GeometryCollection", + geometries: o.geometries.map(function(o) { + return projectGeometry(o, stream); + }) + }; +} + +function projectGeometry(o, stream) { + if (!o) return null; + if (o.type === "GeometryCollection") return projectGeometryCollection(o, stream); + var sink; + switch (o.type) { + case "Point": sink = sinkPoint; break; + case "MultiPoint": sink = sinkPoint; break; + case "LineString": sink = sinkLine; break; + case "MultiLineString": sink = sinkLine; break; + case "Polygon": sink = sinkPolygon; break; + case "MultiPolygon": sink = sinkPolygon; break; + case "Sphere": sink = sinkPolygon; break; + default: return null; + } + d3Geo.geoStream(o, stream(sink)); + return sink.result(); +} + +var points = [], + lines = []; + +var sinkPoint = { + point: function(x, y) { + points.push([x, y]); + }, + result: function() { + var result = !points.length ? null + : points.length < 2 ? {type: "Point", coordinates: points[0]} + : {type: "MultiPoint", coordinates: points}; + points = []; + return result; + } +}; + +var sinkLine = { + lineStart: noop, + point: function(x, y) { + points.push([x, y]); + }, + lineEnd: function() { + if (points.length) lines.push(points), points = []; + }, + result: function() { + var result = !lines.length ? null + : lines.length < 2 ? {type: "LineString", coordinates: lines[0]} + : {type: "MultiLineString", coordinates: lines}; + lines = []; + return result; + } +}; + +var sinkPolygon = { + polygonStart: noop, + lineStart: noop, + point: function(x, y) { + points.push([x, y]); + }, + lineEnd: function() { + var n = points.length; + if (n) { + do points.push(points[0].slice()); while (++n < 4); + lines.push(points), points = []; + } + }, + polygonEnd: noop, + result: function() { + if (!lines.length) return null; + var polygons = [], + holes = []; + + // https://github.com/d3/d3/issues/1558 + lines.forEach(function(ring) { + if (clockwise(ring)) polygons.push([ring]); + else holes.push(ring); + }); + + holes.forEach(function(hole) { + var point = hole[0]; + polygons.some(function(polygon) { + if (contains(polygon[0], point)) { + polygon.push(hole); + return true; + } + }) || polygons.push([hole]); + }); + + lines = []; + + return !polygons.length ? null + : polygons.length > 1 ? {type: "MultiPolygon", coordinates: polygons} + : {type: "Polygon", coordinates: polygons[0]}; + } +}; + +function quincuncial(project) { + var dx = project(halfPi, 0)[0] - project(-halfPi, 0)[0]; + + function projectQuincuncial(lambda, phi) { + var t = abs(lambda) < halfPi, + p = project(t ? lambda : lambda > 0 ? lambda - pi : lambda + pi, phi), + x = (p[0] - p[1]) * sqrt1_2, + y = (p[0] + p[1]) * sqrt1_2; + if (t) return [x, y]; + var d = dx * sqrt1_2, + s = x > 0 ^ y > 0 ? -1 : 1; + return [s * x - sign(y) * d, s * y - sign(x) * d]; + } + + if (project.invert) projectQuincuncial.invert = function(x0, y0) { + var x = (x0 + y0) * sqrt1_2, + y = (y0 - x0) * sqrt1_2, + t = abs(x) < 0.5 * dx && abs(y) < 0.5 * dx; + + if (!t) { + var d = dx * sqrt1_2, + s = x > 0 ^ y > 0 ? -1 : 1, + x1 = -s * x0 + (y > 0 ? 1 : -1) * d, + y1 = -s * y0 + (x > 0 ? 1 : -1) * d; + x = (-x1 - y1) * sqrt1_2; + y = (x1 - y1) * sqrt1_2; + } + + var p = project.invert(x, y); + if (!t) p[0] += x > 0 ? pi : -pi; + return p; + }; + + return d3Geo.geoProjection(projectQuincuncial) + .rotate([-90, -90, 45]) + .clipAngle(180 - 1e-3); +} + +function gringorten$1() { + return quincuncial(gringortenRaw) + .scale(176.423); +} + +function peirce() { + return quincuncial(guyouRaw) + .scale(111.48); +} + +function quantize(input, digits) { + if (!(0 <= (digits = +digits) && digits <= 20)) throw new Error("invalid digits"); + + function quantizePoint(input) { + var n = input.length, i = 2, output = new Array(n); + output[0] = +input[0].toFixed(digits); + output[1] = +input[1].toFixed(digits); + while (i < n) output[i] = input[i], ++i; + return output; + } + + function quantizePoints(input) { + return input.map(quantizePoint); + } + + function quantizePointsNoDuplicates(input) { + var point0 = quantizePoint(input[0]); + var output = [point0]; + for (var i = 1; i < input.length; i++) { + var point = quantizePoint(input[i]); + if (point.length > 2 || point[0] != point0[0] || point[1] != point0[1]) { + output.push(point); + point0 = point; + } + } + if (output.length === 1 && input.length > 1) { + output.push(quantizePoint(input[input.length - 1])); + } + return output; + } + + function quantizePolygon(input) { + return input.map(quantizePointsNoDuplicates); + } + + function quantizeGeometry(input) { + if (input == null) return input; + var output; + switch (input.type) { + case "GeometryCollection": output = {type: "GeometryCollection", geometries: input.geometries.map(quantizeGeometry)}; break; + case "Point": output = {type: "Point", coordinates: quantizePoint(input.coordinates)}; break; + case "MultiPoint": output = {type: input.type, coordinates: quantizePoints(input.coordinates)}; break; + case "LineString": output = {type: input.type, coordinates: quantizePointsNoDuplicates(input.coordinates)}; break; + case "MultiLineString": case "Polygon": output = {type: input.type, coordinates: quantizePolygon(input.coordinates)}; break; + case "MultiPolygon": output = {type: "MultiPolygon", coordinates: input.coordinates.map(quantizePolygon)}; break; + default: return input; + } + if (input.bbox != null) output.bbox = input.bbox; + return output; + } + + function quantizeFeature(input) { + var output = {type: "Feature", properties: input.properties, geometry: quantizeGeometry(input.geometry)}; + if (input.id != null) output.id = input.id; + if (input.bbox != null) output.bbox = input.bbox; + return output; + } + + if (input != null) switch (input.type) { + case "Feature": return quantizeFeature(input); + case "FeatureCollection": { + var output = {type: "FeatureCollection", features: input.features.map(quantizeFeature)}; + if (input.bbox != null) output.bbox = input.bbox; + return output; + } + default: return quantizeGeometry(input); + } + + return input; +} + +function rectangularPolyconicRaw(phi0) { + var sinPhi0 = sin(phi0); + + function forward(lambda, phi) { + var A = sinPhi0 ? tan(lambda * sinPhi0 / 2) / sinPhi0 : lambda / 2; + if (!phi) return [2 * A, -phi0]; + var E = 2 * atan(A * sin(phi)), + cotPhi = 1 / tan(phi); + return [ + sin(E) * cotPhi, + phi + (1 - cos(E)) * cotPhi - phi0 + ]; + } + + // TODO return null for points outside outline. + forward.invert = function(x, y) { + if (abs(y += phi0) < epsilon) return [sinPhi0 ? 2 * atan(sinPhi0 * x / 2) / sinPhi0 : x, 0]; + var k = x * x + y * y, + phi = 0, + i = 10, delta; + do { + var tanPhi = tan(phi), + secPhi = 1 / cos(phi), + j = k - 2 * y * phi + phi * phi; + phi -= delta = (tanPhi * j + 2 * (phi - y)) / (2 + j * secPhi * secPhi + 2 * (phi - y) * tanPhi); + } while (abs(delta) > epsilon && --i > 0); + var E = x * (tanPhi = tan(phi)), + A = tan(abs(y) < abs(phi + 1 / tanPhi) ? asin(E) * 0.5 : acos(E) * 0.5 + pi / 4) / sin(phi); + return [ + sinPhi0 ? 2 * atan(sinPhi0 * A) / sinPhi0 : 2 * A, + phi + ]; + }; + + return forward; +} + +function rectangularPolyconic() { + return parallel1(rectangularPolyconicRaw) + .scale(131.215); +} + +var K$1 = [ + [0.9986, -0.062], + [1.0000, 0.0000], + [0.9986, 0.0620], + [0.9954, 0.1240], + [0.9900, 0.1860], + [0.9822, 0.2480], + [0.9730, 0.3100], + [0.9600, 0.3720], + [0.9427, 0.4340], + [0.9216, 0.4958], + [0.8962, 0.5571], + [0.8679, 0.6176], + [0.8350, 0.6769], + [0.7986, 0.7346], + [0.7597, 0.7903], + [0.7186, 0.8435], + [0.6732, 0.8936], + [0.6213, 0.9394], + [0.5722, 0.9761], + [0.5322, 1.0000] +]; + +K$1.forEach(function(d) { + d[1] *= 1.0144; +}); + +function robinsonRaw(lambda, phi) { + var i = min(18, abs(phi) * 36 / pi), + i0 = floor(i), + di = i - i0, + ax = (k = K$1[i0])[0], + ay = k[1], + bx = (k = K$1[++i0])[0], + by = k[1], + cx = (k = K$1[min(19, ++i0)])[0], + cy = k[1], + k; + return [ + lambda * (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2), + (phi > 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) + ]; +} + +robinsonRaw.invert = function(x, y) { + var yy = y / halfPi, + phi = yy * 90, + i = min(18, abs(phi / 5)), + i0 = max(0, floor(i)); + do { + var ay = K$1[i0][1], + by = K$1[i0 + 1][1], + cy = K$1[min(19, i0 + 2)][1], + u = cy - ay, + v = cy - 2 * by + ay, + t = 2 * (abs(yy) - by) / u, + c = v / u, + di = t * (1 - c * t * (1 - 2 * c * t)); + if (di >= 0 || i0 === 1) { + phi = (y >= 0 ? 5 : -5) * (di + i); + var j = 50, delta; + do { + i = min(18, abs(phi) / 5); + i0 = floor(i); + di = i - i0; + ay = K$1[i0][1]; + by = K$1[i0 + 1][1]; + cy = K$1[min(19, i0 + 2)][1]; + phi -= (delta = (y >= 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) - y) * degrees; + } while (abs(delta) > epsilon2 && --j > 0); + break; + } + } while (--i0 >= 0); + var ax = K$1[i0][0], + bx = K$1[i0 + 1][0], + cx = K$1[min(19, i0 + 2)][0]; + return [ + x / (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2), + phi * radians + ]; +}; + +function robinson() { + return d3Geo.geoProjection(robinsonRaw) + .scale(152.63); +} + +function satelliteVerticalRaw(P) { + function forward(lambda, phi) { + var cosPhi = cos(phi), + k = (P - 1) / (P - cosPhi * cos(lambda)); + return [ + k * cosPhi * sin(lambda), + k * sin(phi) + ]; + } + + forward.invert = function(x, y) { + var rho2 = x * x + y * y, + rho = sqrt(rho2), + sinc = (P - sqrt(1 - rho2 * (P + 1) / (P - 1))) / ((P - 1) / rho + rho / (P - 1)); + return [ + atan2(x * sinc, rho * sqrt(1 - sinc * sinc)), + rho ? asin(y * sinc / rho) : 0 + ]; + }; + + return forward; +} + +function satelliteRaw(P, omega) { + var vertical = satelliteVerticalRaw(P); + if (!omega) return vertical; + var cosOmega = cos(omega), + sinOmega = sin(omega); + + function forward(lambda, phi) { + var coordinates = vertical(lambda, phi), + y = coordinates[1], + A = y * sinOmega / (P - 1) + cosOmega; + return [ + coordinates[0] * cosOmega / A, + y / A + ]; + } + + forward.invert = function(x, y) { + var k = (P - 1) / (P - 1 - y * sinOmega); + return vertical.invert(k * x, k * y * cosOmega); + }; + + return forward; +} + +function satellite() { + var distance = 2, + omega = 0, + m = d3Geo.geoProjectionMutator(satelliteRaw), + p = m(distance, omega); + + // As a multiple of radius. + p.distance = function(_) { + if (!arguments.length) return distance; + return m(distance = +_, omega); + }; + + p.tilt = function(_) { + if (!arguments.length) return omega * degrees; + return m(distance, omega = _ * radians); + }; + + return p + .scale(432.147) + .clipAngle(acos(1 / distance) * degrees - 1e-6); +} + +var epsilon$1 = 1e-4, + epsilonInverse = 1e4, + x0 = -180, x0e = x0 + epsilon$1, + x1 = 180, x1e = x1 - epsilon$1, + y0 = -90, y0e = y0 + epsilon$1, + y1 = 90, y1e = y1 - epsilon$1; + +function nonempty(coordinates) { + return coordinates.length > 0; +} + +function quantize$1(x) { + return Math.floor(x * epsilonInverse) / epsilonInverse; +} + +function normalizePoint(y) { + return y === y0 || y === y1 ? [0, y] : [x0, quantize$1(y)]; // pole or antimeridian? +} + +function clampPoint(p) { + var x = p[0], y = p[1], clamped = false; + if (x <= x0e) x = x0, clamped = true; + else if (x >= x1e) x = x1, clamped = true; + if (y <= y0e) y = y0, clamped = true; + else if (y >= y1e) y = y1, clamped = true; + return clamped ? [x, y] : p; +} + +function clampPoints(points) { + return points.map(clampPoint); +} + +// For each ring, detect where it crosses the antimeridian or pole. +function extractFragments(rings, polygon, fragments) { + for (var j = 0, m = rings.length; j < m; ++j) { + var ring = rings[j].slice(); + + // By default, assume that this ring doesn’t need any stitching. + fragments.push({index: -1, polygon: polygon, ring: ring}); + + for (var i = 0, n = ring.length; i < n; ++i) { + var point = ring[i], + x = point[0], + y = point[1]; + + // If this is an antimeridian or polar point… + if (x <= x0e || x >= x1e || y <= y0e || y >= y1e) { + ring[i] = clampPoint(point); + + // Advance through any antimeridian or polar points… + for (var k = i + 1; k < n; ++k) { + var pointk = ring[k], + xk = pointk[0], + yk = pointk[1]; + if (xk > x0e && xk < x1e && yk > y0e && yk < y1e) break; + } + + // If this was just a single antimeridian or polar point, + // we don’t need to cut this ring into a fragment; + // we can just leave it as-is. + if (k === i + 1) continue; + + // Otherwise, if this is not the first point in the ring, + // cut the current fragment so that it ends at the current point. + // The current point is also normalized for later joining. + if (i) { + var fragmentBefore = {index: -1, polygon: polygon, ring: ring.slice(0, i + 1)}; + fragmentBefore.ring[fragmentBefore.ring.length - 1] = normalizePoint(y); + fragments[fragments.length - 1] = fragmentBefore; + } + + // If the ring started with an antimeridian fragment, + // we can ignore that fragment entirely. + else fragments.pop(); + + // If the remainder of the ring is an antimeridian fragment, + // move on to the next ring. + if (k >= n) break; + + // Otherwise, add the remaining ring fragment and continue. + fragments.push({index: -1, polygon: polygon, ring: ring = ring.slice(k - 1)}); + ring[0] = normalizePoint(ring[0][1]); + i = -1; + n = ring.length; + } + } + } +} + +// Now stitch the fragments back together into rings. +function stitchFragments(fragments) { + var i, n = fragments.length; + + // To connect the fragments start-to-end, create a simple index by end. + var fragmentByStart = {}, + fragmentByEnd = {}, + fragment, + start, + startFragment, + end, + endFragment; + + // For each fragment… + for (i = 0; i < n; ++i) { + fragment = fragments[i]; + start = fragment.ring[0]; + end = fragment.ring[fragment.ring.length - 1]; + + // If this fragment is closed, add it as a standalone ring. + if (start[0] === end[0] && start[1] === end[1]) { + fragment.polygon.push(fragment.ring); + fragments[i] = null; + continue; + } + + fragment.index = i; + fragmentByStart[start] = fragmentByEnd[end] = fragment; + } + + // For each open fragment… + for (i = 0; i < n; ++i) { + fragment = fragments[i]; + if (fragment) { + start = fragment.ring[0]; + end = fragment.ring[fragment.ring.length - 1]; + startFragment = fragmentByEnd[start]; + endFragment = fragmentByStart[end]; + + delete fragmentByStart[start]; + delete fragmentByEnd[end]; + + // If this fragment is closed, add it as a standalone ring. + if (start[0] === end[0] && start[1] === end[1]) { + fragment.polygon.push(fragment.ring); + continue; + } + + if (startFragment) { + delete fragmentByEnd[start]; + delete fragmentByStart[startFragment.ring[0]]; + startFragment.ring.pop(); // drop the shared coordinate + fragments[startFragment.index] = null; + fragment = {index: -1, polygon: startFragment.polygon, ring: startFragment.ring.concat(fragment.ring)}; + + if (startFragment === endFragment) { + // Connect both ends to this single fragment to create a ring. + fragment.polygon.push(fragment.ring); + } else { + fragment.index = n++; + fragments.push(fragmentByStart[fragment.ring[0]] = fragmentByEnd[fragment.ring[fragment.ring.length - 1]] = fragment); + } + } else if (endFragment) { + delete fragmentByStart[end]; + delete fragmentByEnd[endFragment.ring[endFragment.ring.length - 1]]; + fragment.ring.pop(); // drop the shared coordinate + fragment = {index: n++, polygon: endFragment.polygon, ring: fragment.ring.concat(endFragment.ring)}; + fragments[endFragment.index] = null; + fragments.push(fragmentByStart[fragment.ring[0]] = fragmentByEnd[fragment.ring[fragment.ring.length - 1]] = fragment); + } else { + fragment.ring.push(fragment.ring[0]); // close ring + fragment.polygon.push(fragment.ring); + } + } + } +} + +function stitchFeature(input) { + var output = {type: "Feature", geometry: stitchGeometry(input.geometry)}; + if (input.id != null) output.id = input.id; + if (input.bbox != null) output.bbox = input.bbox; + if (input.properties != null) output.properties = input.properties; + return output; +} + +function stitchGeometry(input) { + if (input == null) return input; + var output, fragments, i, n; + switch (input.type) { + case "GeometryCollection": output = {type: "GeometryCollection", geometries: input.geometries.map(stitchGeometry)}; break; + case "Point": output = {type: "Point", coordinates: clampPoint(input.coordinates)}; break; + case "MultiPoint": case "LineString": output = {type: input.type, coordinates: clampPoints(input.coordinates)}; break; + case "MultiLineString": output = {type: "MultiLineString", coordinates: input.coordinates.map(clampPoints)}; break; + case "Polygon": { + var polygon = []; + extractFragments(input.coordinates, polygon, fragments = []); + stitchFragments(fragments); + output = {type: "Polygon", coordinates: polygon}; + break; + } + case "MultiPolygon": { + fragments = [], i = -1, n = input.coordinates.length; + var polygons = new Array(n); + while (++i < n) extractFragments(input.coordinates[i], polygons[i] = [], fragments); + stitchFragments(fragments); + output = {type: "MultiPolygon", coordinates: polygons.filter(nonempty)}; + break; + } + default: return input; + } + if (input.bbox != null) output.bbox = input.bbox; + return output; +} + +function stitch(input) { + if (input == null) return input; + switch (input.type) { + case "Feature": return stitchFeature(input); + case "FeatureCollection": { + var output = {type: "FeatureCollection", features: input.features.map(stitchFeature)}; + if (input.bbox != null) output.bbox = input.bbox; + return output; + } + default: return stitchGeometry(input); + } +} + +function timesRaw(lambda, phi) { + var t = tan(phi / 2), + s = sin(quarterPi * t); + return [ + lambda * (0.74482 - 0.34588 * s * s), + 1.70711 * t + ]; +} + +timesRaw.invert = function(x, y) { + var t = y / 1.70711, + s = sin(quarterPi * t); + return [ + x / (0.74482 - 0.34588 * s * s), + 2 * atan(t) + ]; +}; + +function times() { + return d3Geo.geoProjection(timesRaw) + .scale(146.153); +} + +// Compute the origin as the midpoint of the two reference points. +// Rotate one of the reference points by the origin. +// Apply the spherical law of sines to compute gamma rotation. +function twoPoint(raw, p0, p1) { + var i = d3Geo.geoInterpolate(p0, p1), + o = i(0.5), + a = d3Geo.geoRotation([-o[0], -o[1]])(p0), + b = i.distance / 2, + y = -asin(sin(a[1] * radians) / sin(b)), + R = [-o[0], -o[1], -(a[0] > 0 ? pi - y : y) * degrees], + p = d3Geo.geoProjection(raw(b)).rotate(R), + r = d3Geo.geoRotation(R), + center = p.center; + + delete p.rotate; + + p.center = function(_) { + return arguments.length ? center(r(_)) : r.invert(center()); + }; + + return p + .clipAngle(90); +} + +function twoPointAzimuthalRaw(d) { + var cosd = cos(d); + + function forward(lambda, phi) { + var coordinates = d3Geo.geoGnomonicRaw(lambda, phi); + coordinates[0] *= cosd; + return coordinates; + } + + forward.invert = function(x, y) { + return d3Geo.geoGnomonicRaw.invert(x / cosd, y); + }; + + return forward; +} + +function twoPointAzimuthalUsa() { + return twoPointAzimuthal([-158, 21.5], [-77, 39]) + .clipAngle(60) + .scale(400); +} + +function twoPointAzimuthal(p0, p1) { + return twoPoint(twoPointAzimuthalRaw, p0, p1); +} + +// TODO clip to ellipse +function twoPointEquidistantRaw(z0) { + if (!(z0 *= 2)) return d3Geo.geoAzimuthalEquidistantRaw; + var lambdaa = -z0 / 2, + lambdab = -lambdaa, + z02 = z0 * z0, + tanLambda0 = tan(lambdab), + S = 0.5 / sin(lambdab); + + function forward(lambda, phi) { + var za = acos(cos(phi) * cos(lambda - lambdaa)), + zb = acos(cos(phi) * cos(lambda - lambdab)), + ys = phi < 0 ? -1 : 1; + za *= za, zb *= zb; + return [ + (za - zb) / (2 * z0), + ys * sqrt(4 * z02 * zb - (z02 - za + zb) * (z02 - za + zb)) / (2 * z0) + ]; + } + + forward.invert = function(x, y) { + var y2 = y * y, + cosza = cos(sqrt(y2 + (t = x + lambdaa) * t)), + coszb = cos(sqrt(y2 + (t = x + lambdab) * t)), + t, + d; + return [ + atan2(d = cosza - coszb, t = (cosza + coszb) * tanLambda0), + (y < 0 ? -1 : 1) * acos(sqrt(t * t + d * d) * S) + ]; + }; + + return forward; +} + +function twoPointEquidistantUsa() { + return twoPointEquidistant([-158, 21.5], [-77, 39]) + .clipAngle(130) + .scale(122.571); +} + +function twoPointEquidistant(p0, p1) { + return twoPoint(twoPointEquidistantRaw, p0, p1); +} + +function vanDerGrintenRaw(lambda, phi) { + if (abs(phi) < epsilon) return [lambda, 0]; + var sinTheta = abs(phi / halfPi), + theta = asin(sinTheta); + if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, sign(phi) * pi * tan(theta / 2)]; + var cosTheta = cos(theta), + A = abs(pi / lambda - lambda / pi) / 2, + A2 = A * A, + G = cosTheta / (sinTheta + cosTheta - 1), + P = G * (2 / sinTheta - 1), + P2 = P * P, + P2_A2 = P2 + A2, + G_P2 = G - P2, + Q = A2 + G; + return [ + sign(lambda) * pi * (A * G_P2 + sqrt(A2 * G_P2 * G_P2 - P2_A2 * (G * G - P2))) / P2_A2, + sign(phi) * pi * (P * Q - A * sqrt((A2 + 1) * P2_A2 - Q * Q)) / P2_A2 + ]; +} + +vanDerGrintenRaw.invert = function(x, y) { + if (abs(y) < epsilon) return [x, 0]; + if (abs(x) < epsilon) return [0, halfPi * sin(2 * atan(y / pi))]; + var x2 = (x /= pi) * x, + y2 = (y /= pi) * y, + x2_y2 = x2 + y2, + z = x2_y2 * x2_y2, + c1 = -abs(y) * (1 + x2_y2), + c2 = c1 - 2 * y2 + x2, + c3 = -2 * c1 + 1 + 2 * y2 + z, + d = y2 / c3 + (2 * c2 * c2 * c2 / (c3 * c3 * c3) - 9 * c1 * c2 / (c3 * c3)) / 27, + a1 = (c1 - c2 * c2 / (3 * c3)) / c3, + m1 = 2 * sqrt(-a1 / 3), + theta1 = acos(3 * d / (a1 * m1)) / 3; + return [ + pi * (x2_y2 - 1 + sqrt(1 + 2 * (x2 - y2) + z)) / (2 * x), + sign(y) * pi * (-m1 * cos(theta1 + pi / 3) - c2 / (3 * c3)) + ]; +}; + +function vanDerGrinten() { + return d3Geo.geoProjection(vanDerGrintenRaw) + .scale(79.4183); +} + +function vanDerGrinten2Raw(lambda, phi) { + if (abs(phi) < epsilon) return [lambda, 0]; + var sinTheta = abs(phi / halfPi), + theta = asin(sinTheta); + if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, sign(phi) * pi * tan(theta / 2)]; + var cosTheta = cos(theta), + A = abs(pi / lambda - lambda / pi) / 2, + A2 = A * A, + x1 = cosTheta * (sqrt(1 + A2) - A * cosTheta) / (1 + A2 * sinTheta * sinTheta); + return [ + sign(lambda) * pi * x1, + sign(phi) * pi * sqrt(1 - x1 * (2 * A + x1)) + ]; +} + +vanDerGrinten2Raw.invert = function(x, y) { + if (!x) return [0, halfPi * sin(2 * atan(y / pi))]; + var x1 = abs(x / pi), + A = (1 - x1 * x1 - (y /= pi) * y) / (2 * x1), + A2 = A * A, + B = sqrt(A2 + 1); + return [ + sign(x) * pi * (B - A), + sign(y) * halfPi * sin(2 * atan2(sqrt((1 - 2 * A * x1) * (A + B) - x1), sqrt(B + A + x1))) + ]; +}; + +function vanDerGrinten2() { + return d3Geo.geoProjection(vanDerGrinten2Raw) + .scale(79.4183); +} + +function vanDerGrinten3Raw(lambda, phi) { + if (abs(phi) < epsilon) return [lambda, 0]; + var sinTheta = phi / halfPi, + theta = asin(sinTheta); + if (abs(lambda) < epsilon || abs(abs(phi) - halfPi) < epsilon) return [0, pi * tan(theta / 2)]; + var A = (pi / lambda - lambda / pi) / 2, + y1 = sinTheta / (1 + cos(theta)); + return [ + pi * (sign(lambda) * sqrt(A * A + 1 - y1 * y1) - A), + pi * y1 + ]; +} + +vanDerGrinten3Raw.invert = function(x, y) { + if (!y) return [x, 0]; + var y1 = y / pi, + A = (pi * pi * (1 - y1 * y1) - x * x) / (2 * pi * x); + return [ + x ? pi * (sign(x) * sqrt(A * A + 1) - A) : 0, + halfPi * sin(2 * atan(y1)) + ]; +}; + +function vanDerGrinten3() { + return d3Geo.geoProjection(vanDerGrinten3Raw) + .scale(79.4183); +} + +function vanDerGrinten4Raw(lambda, phi) { + if (!phi) return [lambda, 0]; + var phi0 = abs(phi); + if (!lambda || phi0 === halfPi) return [0, phi]; + var B = phi0 / halfPi, + B2 = B * B, + C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)), + C2 = C * C, + BC = B * C, + B_C2 = B2 + C2 + 2 * BC, + B_3C = B + 3 * C, + lambda0 = lambda / halfPi, + lambda1 = lambda0 + 1 / lambda0, + D = sign(abs(lambda) - halfPi) * sqrt(lambda1 * lambda1 - 4), + D2 = D * D, + F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + 12 * BC * C2 + 4 * C2 * C2), + x1 = (D * (B_C2 + C2 - 1) + 2 * sqrt(F)) / (4 * B_C2 + D2); + return [ + sign(lambda) * halfPi * x1, + sign(phi) * halfPi * sqrt(1 + D * abs(x1) - x1 * x1) + ]; +} + +vanDerGrinten4Raw.invert = function(x, y) { + var delta; + if (!x || !y) return [x, y]; + y /= pi; + var x1 = sign(x) * x / halfPi, + D = (x1 * x1 - 1 + 4 * y * y) / abs(x1), + D2 = D * D, + B = 2 * y, + i = 50; + do { + var B2 = B * B, + C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)), + C_ = (3 * B - B2 * B - 10) / (2 * B2 * B), + C2 = C * C, + BC = B * C, + B_C = B + C, + B_C2 = B_C * B_C, + B_3C = B + 3 * C, + F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + C2 * (12 * BC + 4 * C2)), + F_ = -2 * B_C * (4 * BC * C2 + (1 - 4 * B2 + 3 * B2 * B2) * (1 + C_) + C2 * (-6 + 14 * B2 - D2 + (-8 + 8 * B2 - 2 * D2) * C_) + BC * (-8 + 12 * B2 + (-10 + 10 * B2 - D2) * C_)), + sqrtF = sqrt(F), + f = D * (B_C2 + C2 - 1) + 2 * sqrtF - x1 * (4 * B_C2 + D2), + f_ = D * (2 * C * C_ + 2 * B_C * (1 + C_)) + F_ / sqrtF - 8 * B_C * (D * (-1 + C2 + B_C2) + 2 * sqrtF) * (1 + C_) / (D2 + 4 * B_C2); + B -= delta = f / f_; + } while (delta > epsilon && --i > 0); + return [ + sign(x) * (sqrt(D * D + 4) + D) * pi / 4, + halfPi * B + ]; +}; + +function vanDerGrinten4() { + return d3Geo.geoProjection(vanDerGrinten4Raw) + .scale(127.16); +} + +function wagnerFormula(cx, cy, m1, m2, n) { + function forward(lambda, phi) { + var s = m1 * sin(m2 * phi), + c0 = sqrt(1 - s * s), + c1 = sqrt(2 / (1 + c0 * cos(lambda *= n))); + return [ + cx * c0 * c1 * sin(lambda), + cy * s * c1 + ]; + } + + forward.invert = function(x, y) { + var t1 = x / cx, + t2 = y / cy, + p = sqrt(t1 * t1 + t2 * t2), + c = 2 * asin(p / 2); + return [ + atan2(x * tan(c), cx * p) / n, + p && asin(y * sin(c) / (cy * m1 * p)) / m2 + ]; + }; + + return forward; +} + +function wagnerRaw(poleline, parallels, inflation, ratio) { + // 60 is always used as reference parallel + var phi1 = pi / 3; + + // sanitizing the input values + // poleline and parallels may approximate but never equal 0 + poleline = max(poleline, epsilon); + parallels = max(parallels, epsilon); + // poleline must be <= 90; parallels may approximate but never equal 180 + poleline = min(poleline, halfPi); + parallels = min(parallels, pi - epsilon); + // 0 <= inflation <= 99.999 + inflation = max(inflation, 0); + inflation = min(inflation, 100 - epsilon); + // ratio > 0. + // sensible values, i.e. something that renders a map which still can be + // recognized as world map, are e.g. 20 <= ratio <= 1000. + ratio = max(ratio, epsilon); + + // convert values from boehm notation + // areal inflation e.g. from 0 to 1 or 20 to 1.2: + var vinflation = inflation/100 + 1; + // axial ratio e.g. from 200 to 2: + var vratio = ratio / 100; + // the other ones are a bit more complicated... + var m2 = acos(vinflation * cos(phi1)) / phi1, + m1 = sin(poleline) / sin(m2 * halfPi), + n = parallels / pi, + k = sqrt(vratio * sin(poleline / 2) / sin(parallels / 2)), + cx = k / sqrt(n * m1 * m2), + cy = 1 / (k * sqrt(n * m1 * m2)); + + return wagnerFormula(cx, cy, m1, m2, n); +} + +function wagner() { + // default values generate wagner8 + var poleline = 65 * radians, + parallels = 60 * radians, + inflation = 20, + ratio = 200, + mutate = d3Geo.geoProjectionMutator(wagnerRaw), + projection = mutate(poleline, parallels, inflation, ratio); + + projection.poleline = function(_) { + return arguments.length ? mutate(poleline = +_ * radians, parallels, inflation, ratio) : poleline * degrees; + }; + + projection.parallels = function(_) { + return arguments.length ? mutate(poleline, parallels = +_ * radians, inflation, ratio) : parallels * degrees; + }; + projection.inflation = function(_) { + return arguments.length ? mutate(poleline, parallels, inflation = +_, ratio) : inflation; + }; + projection.ratio = function(_) { + return arguments.length ? mutate(poleline, parallels, inflation, ratio = +_) : ratio; + }; + + return projection + .scale(163.775); +} + +function wagner7() { + return wagner() + .poleline(65) + .parallels(60) + .inflation(0) + .ratio(200) + .scale(172.633); +} + +var A = 4 * pi + 3 * sqrt(3), + B = 2 * sqrt(2 * pi * sqrt(3) / A); + +var wagner4Raw = mollweideBromleyRaw(B * sqrt(3) / pi, B, A / 6); + +function wagner4() { + return d3Geo.geoProjection(wagner4Raw) + .scale(176.84); +} + +function wagner6Raw(lambda, phi) { + return [lambda * sqrt(1 - 3 * phi * phi / (pi * pi)), phi]; +} + +wagner6Raw.invert = function(x, y) { + return [x / sqrt(1 - 3 * y * y / (pi * pi)), y]; +}; + +function wagner6() { + return d3Geo.geoProjection(wagner6Raw) + .scale(152.63); +} + +function wiechelRaw(lambda, phi) { + var cosPhi = cos(phi), + sinPhi = cos(lambda) * cosPhi, + sin1_Phi = 1 - sinPhi, + cosLambda = cos(lambda = atan2(sin(lambda) * cosPhi, -sin(phi))), + sinLambda = sin(lambda); + cosPhi = sqrt(1 - sinPhi * sinPhi); + return [ + sinLambda * cosPhi - cosLambda * sin1_Phi, + -cosLambda * cosPhi - sinLambda * sin1_Phi + ]; +} + +wiechelRaw.invert = function(x, y) { + var w = (x * x + y * y) / -2, + k = sqrt(-w * (2 + w)), + b = y * w + x * k, + a = x * w - y * k, + D = sqrt(a * a + b * b); + return [ + atan2(k * b, D * (1 + w)), + D ? -asin(k * a / D) : 0 + ]; +}; + +function wiechel() { + return d3Geo.geoProjection(wiechelRaw) + .rotate([0, -90, 45]) + .scale(124.75) + .clipAngle(180 - 1e-3); +} + +function winkel3Raw(lambda, phi) { + var coordinates = aitoffRaw(lambda, phi); + return [ + (coordinates[0] + lambda / halfPi) / 2, + (coordinates[1] + phi) / 2 + ]; +} + +winkel3Raw.invert = function(x, y) { + var lambda = x, phi = y, i = 25; + do { + var cosphi = cos(phi), + sinphi = sin(phi), + sin_2phi = sin(2 * phi), + sin2phi = sinphi * sinphi, + cos2phi = cosphi * cosphi, + sinlambda = sin(lambda), + coslambda_2 = cos(lambda / 2), + sinlambda_2 = sin(lambda / 2), + sin2lambda_2 = sinlambda_2 * sinlambda_2, + C = 1 - cos2phi * coslambda_2 * coslambda_2, + E = C ? acos(cosphi * coslambda_2) * sqrt(F = 1 / C) : F = 0, + F, + fx = 0.5 * (2 * E * cosphi * sinlambda_2 + lambda / halfPi) - x, + fy = 0.5 * (E * sinphi + phi) - y, + dxdlambda = 0.5 * F * (cos2phi * sin2lambda_2 + E * cosphi * coslambda_2 * sin2phi) + 0.5 / halfPi, + dxdphi = F * (sinlambda * sin_2phi / 4 - E * sinphi * sinlambda_2), + dydlambda = 0.125 * F * (sin_2phi * sinlambda_2 - E * sinphi * cos2phi * sinlambda), + dydphi = 0.5 * F * (sin2phi * coslambda_2 + E * sin2lambda_2 * cosphi) + 0.5, + denominator = dxdphi * dydlambda - dydphi * dxdlambda, + dlambda = (fy * dxdphi - fx * dydphi) / denominator, + dphi = (fx * dydlambda - fy * dxdlambda) / denominator; + lambda -= dlambda, phi -= dphi; + } while ((abs(dlambda) > epsilon || abs(dphi) > epsilon) && --i > 0); + return [lambda, phi]; +}; + +function winkel3() { + return d3Geo.geoProjection(winkel3Raw) + .scale(158.837); +} + +exports.geoNaturalEarth = d3Geo.geoNaturalEarth1; +exports.geoNaturalEarthRaw = d3Geo.geoNaturalEarth1Raw; +exports.geoAiry = airy; +exports.geoAiryRaw = airyRaw; +exports.geoAitoff = aitoff; +exports.geoAitoffRaw = aitoffRaw; +exports.geoArmadillo = armadillo; +exports.geoArmadilloRaw = armadilloRaw; +exports.geoAugust = august; +exports.geoAugustRaw = augustRaw; +exports.geoBaker = baker; +exports.geoBakerRaw = bakerRaw; +exports.geoBerghaus = berghaus; +exports.geoBerghausRaw = berghausRaw; +exports.geoBertin1953 = bertin; +exports.geoBertin1953Raw = bertin1953Raw; +exports.geoBoggs = boggs; +exports.geoBoggsRaw = boggsRaw; +exports.geoBonne = bonne; +exports.geoBonneRaw = bonneRaw; +exports.geoBottomley = bottomley; +exports.geoBottomleyRaw = bottomleyRaw; +exports.geoBromley = bromley; +exports.geoBromleyRaw = bromleyRaw; +exports.geoChamberlin = chamberlin; +exports.geoChamberlinRaw = chamberlinRaw; +exports.geoChamberlinAfrica = chamberlinAfrica; +exports.geoCollignon = collignon; +exports.geoCollignonRaw = collignonRaw; +exports.geoCraig = craig; +exports.geoCraigRaw = craigRaw; +exports.geoCraster = craster; +exports.geoCrasterRaw = crasterRaw; +exports.geoCylindricalEqualArea = cylindricalEqualArea; +exports.geoCylindricalEqualAreaRaw = cylindricalEqualAreaRaw; +exports.geoCylindricalStereographic = cylindricalStereographic; +exports.geoCylindricalStereographicRaw = cylindricalStereographicRaw; +exports.geoEckert1 = eckert1; +exports.geoEckert1Raw = eckert1Raw; +exports.geoEckert2 = eckert2; +exports.geoEckert2Raw = eckert2Raw; +exports.geoEckert3 = eckert3; +exports.geoEckert3Raw = eckert3Raw; +exports.geoEckert4 = eckert4; +exports.geoEckert4Raw = eckert4Raw; +exports.geoEckert5 = eckert5; +exports.geoEckert5Raw = eckert5Raw; +exports.geoEckert6 = eckert6; +exports.geoEckert6Raw = eckert6Raw; +exports.geoEisenlohr = eisenlohr; +exports.geoEisenlohrRaw = eisenlohrRaw; +exports.geoFahey = fahey; +exports.geoFaheyRaw = faheyRaw; +exports.geoFoucaut = foucaut; +exports.geoFoucautRaw = foucautRaw; +exports.geoFoucautSinusoidal = foucautSinusoidal; +exports.geoFoucautSinusoidalRaw = foucautSinusoidalRaw; +exports.geoGilbert = gilbert; +exports.geoGingery = gingery; +exports.geoGingeryRaw = gingeryRaw; +exports.geoGinzburg4 = ginzburg4; +exports.geoGinzburg4Raw = ginzburg4Raw; +exports.geoGinzburg5 = ginzburg5; +exports.geoGinzburg5Raw = ginzburg5Raw; +exports.geoGinzburg6 = ginzburg6; +exports.geoGinzburg6Raw = ginzburg6Raw; +exports.geoGinzburg8 = ginzburg8; +exports.geoGinzburg8Raw = ginzburg8Raw; +exports.geoGinzburg9 = ginzburg9; +exports.geoGinzburg9Raw = ginzburg9Raw; +exports.geoGringorten = gringorten; +exports.geoGringortenRaw = gringortenRaw; +exports.geoGuyou = guyou; +exports.geoGuyouRaw = guyouRaw; +exports.geoHammer = hammer; +exports.geoHammerRaw = hammerRaw; +exports.geoHammerRetroazimuthal = hammerRetroazimuthal; +exports.geoHammerRetroazimuthalRaw = hammerRetroazimuthalRaw; +exports.geoHealpix = healpix; +exports.geoHealpixRaw = healpixRaw; +exports.geoHill = hill; +exports.geoHillRaw = hillRaw; +exports.geoHomolosine = homolosine; +exports.geoHomolosineRaw = homolosineRaw; +exports.geoHufnagel = hufnagel; +exports.geoHufnagelRaw = hufnagelRaw; +exports.geoHyperelliptical = hyperelliptical; +exports.geoHyperellipticalRaw = hyperellipticalRaw; +exports.geoInterrupt = interrupt; +exports.geoInterruptedBoggs = boggs$1; +exports.geoInterruptedHomolosine = homolosine$1; +exports.geoInterruptedMollweide = mollweide$1; +exports.geoInterruptedMollweideHemispheres = mollweideHemispheres; +exports.geoInterruptedSinuMollweide = sinuMollweide$1; +exports.geoInterruptedSinusoidal = sinusoidal$1; +exports.geoKavrayskiy7 = kavrayskiy7; +exports.geoKavrayskiy7Raw = kavrayskiy7Raw; +exports.geoLagrange = lagrange; +exports.geoLagrangeRaw = lagrangeRaw; +exports.geoLarrivee = larrivee; +exports.geoLarriveeRaw = larriveeRaw; +exports.geoLaskowski = laskowski; +exports.geoLaskowskiRaw = laskowskiRaw; +exports.geoLittrow = littrow; +exports.geoLittrowRaw = littrowRaw; +exports.geoLoximuthal = loximuthal; +exports.geoLoximuthalRaw = loximuthalRaw; +exports.geoMiller = miller; +exports.geoMillerRaw = millerRaw; +exports.geoModifiedStereographic = modifiedStereographic; +exports.geoModifiedStereographicRaw = modifiedStereographicRaw; +exports.geoModifiedStereographicAlaska = modifiedStereographicAlaska; +exports.geoModifiedStereographicGs48 = modifiedStereographicGs48; +exports.geoModifiedStereographicGs50 = modifiedStereographicGs50; +exports.geoModifiedStereographicMiller = modifiedStereographicMiller; +exports.geoModifiedStereographicLee = modifiedStereographicLee; +exports.geoMollweide = mollweide; +exports.geoMollweideRaw = mollweideRaw; +exports.geoMtFlatPolarParabolic = mtFlatPolarParabolic; +exports.geoMtFlatPolarParabolicRaw = mtFlatPolarParabolicRaw; +exports.geoMtFlatPolarQuartic = mtFlatPolarQuartic; +exports.geoMtFlatPolarQuarticRaw = mtFlatPolarQuarticRaw; +exports.geoMtFlatPolarSinusoidal = mtFlatPolarSinusoidal; +exports.geoMtFlatPolarSinusoidalRaw = mtFlatPolarSinusoidalRaw; +exports.geoNaturalEarth2 = naturalEarth2; +exports.geoNaturalEarth2Raw = naturalEarth2Raw; +exports.geoNellHammer = nellHammer; +exports.geoNellHammerRaw = nellHammerRaw; +exports.geoInterruptedQuarticAuthalic = quarticAuthalic; +exports.geoNicolosi = nicolosi; +exports.geoNicolosiRaw = nicolosiRaw; +exports.geoPatterson = patterson; +exports.geoPattersonRaw = pattersonRaw; +exports.geoPolyconic = polyconic; +exports.geoPolyconicRaw = polyconicRaw; +exports.geoPolyhedral = polyhedral; +exports.geoPolyhedralButterfly = butterfly; +exports.geoPolyhedralCollignon = collignon$1; +exports.geoPolyhedralWaterman = waterman; +exports.geoProject = index; +exports.geoGringortenQuincuncial = gringorten$1; +exports.geoPeirceQuincuncial = peirce; +exports.geoPierceQuincuncial = peirce; +exports.geoQuantize = quantize; +exports.geoQuincuncial = quincuncial; +exports.geoRectangularPolyconic = rectangularPolyconic; +exports.geoRectangularPolyconicRaw = rectangularPolyconicRaw; +exports.geoRobinson = robinson; +exports.geoRobinsonRaw = robinsonRaw; +exports.geoSatellite = satellite; +exports.geoSatelliteRaw = satelliteRaw; +exports.geoSinuMollweide = sinuMollweide; +exports.geoSinuMollweideRaw = sinuMollweideRaw; +exports.geoSinusoidal = sinusoidal; +exports.geoSinusoidalRaw = sinusoidalRaw; +exports.geoStitch = stitch; +exports.geoTimes = times; +exports.geoTimesRaw = timesRaw; +exports.geoTwoPointAzimuthal = twoPointAzimuthal; +exports.geoTwoPointAzimuthalRaw = twoPointAzimuthalRaw; +exports.geoTwoPointAzimuthalUsa = twoPointAzimuthalUsa; +exports.geoTwoPointEquidistant = twoPointEquidistant; +exports.geoTwoPointEquidistantRaw = twoPointEquidistantRaw; +exports.geoTwoPointEquidistantUsa = twoPointEquidistantUsa; +exports.geoVanDerGrinten = vanDerGrinten; +exports.geoVanDerGrintenRaw = vanDerGrintenRaw; +exports.geoVanDerGrinten2 = vanDerGrinten2; +exports.geoVanDerGrinten2Raw = vanDerGrinten2Raw; +exports.geoVanDerGrinten3 = vanDerGrinten3; +exports.geoVanDerGrinten3Raw = vanDerGrinten3Raw; +exports.geoVanDerGrinten4 = vanDerGrinten4; +exports.geoVanDerGrinten4Raw = vanDerGrinten4Raw; +exports.geoWagner = wagner; +exports.geoWagner7 = wagner7; +exports.geoWagnerRaw = wagnerRaw; +exports.geoWagner4 = wagner4; +exports.geoWagner4Raw = wagner4Raw; +exports.geoWagner6 = wagner6; +exports.geoWagner6Raw = wagner6Raw; +exports.geoWiechel = wiechel; +exports.geoWiechelRaw = wiechelRaw; +exports.geoWinkel3 = winkel3; +exports.geoWinkel3Raw = winkel3Raw; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + +},{"d3-array":134,"d3-geo":141}],141:[function(_dereq_,module,exports){ +// https://d3js.org/d3-geo/ v1.12.1 Copyright 2020 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-array')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); +}(this, (function (exports, d3Array) { 'use strict'; + +// Adds floating point numbers with twice the normal precision. +// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and +// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3) +// 305–363 (1997). +// Code adapted from GeographicLib by Charles F. F. Karney, +// http://geographiclib.sourceforge.net/ + +function adder() { + return new Adder; +} + +function Adder() { + this.reset(); +} + +Adder.prototype = { + constructor: Adder, + reset: function() { + this.s = // rounded value + this.t = 0; // exact error + }, + add: function(y) { + add(temp, y, this.t); + add(this, temp.s, this.s); + if (this.s) this.t += temp.t; + else this.s = temp.t; + }, + valueOf: function() { + return this.s; + } +}; + +var temp = new Adder; + +function add(adder, a, b) { + var x = adder.s = a + b, + bv = x - a, + av = x - bv; + adder.t = (a - av) + (b - bv); +} + +var epsilon = 1e-6; +var epsilon2 = 1e-12; +var pi = Math.PI; +var halfPi = pi / 2; +var quarterPi = pi / 4; +var tau = pi * 2; + +var degrees = 180 / pi; +var radians = pi / 180; + +var abs = Math.abs; +var atan = Math.atan; +var atan2 = Math.atan2; +var cos = Math.cos; +var ceil = Math.ceil; +var exp = Math.exp; +var log = Math.log; +var pow = Math.pow; +var sin = Math.sin; +var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }; +var sqrt = Math.sqrt; +var tan = Math.tan; + +function acos(x) { + return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); +} + +function asin(x) { + return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x); +} + +function haversin(x) { + return (x = sin(x / 2)) * x; +} + +function noop() {} + +function streamGeometry(geometry, stream) { + if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) { + streamGeometryType[geometry.type](geometry, stream); + } +} + +var streamObjectType = { + Feature: function(object, stream) { + streamGeometry(object.geometry, stream); + }, + FeatureCollection: function(object, stream) { + var features = object.features, i = -1, n = features.length; + while (++i < n) streamGeometry(features[i].geometry, stream); + } +}; + +var streamGeometryType = { + Sphere: function(object, stream) { + stream.sphere(); + }, + Point: function(object, stream) { + object = object.coordinates; + stream.point(object[0], object[1], object[2]); + }, + MultiPoint: function(object, stream) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]); + }, + LineString: function(object, stream) { + streamLine(object.coordinates, stream, 0); + }, + MultiLineString: function(object, stream) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) streamLine(coordinates[i], stream, 0); + }, + Polygon: function(object, stream) { + streamPolygon(object.coordinates, stream); + }, + MultiPolygon: function(object, stream) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) streamPolygon(coordinates[i], stream); + }, + GeometryCollection: function(object, stream) { + var geometries = object.geometries, i = -1, n = geometries.length; + while (++i < n) streamGeometry(geometries[i], stream); + } +}; + +function streamLine(coordinates, stream, closed) { + var i = -1, n = coordinates.length - closed, coordinate; + stream.lineStart(); + while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]); + stream.lineEnd(); +} + +function streamPolygon(coordinates, stream) { + var i = -1, n = coordinates.length; + stream.polygonStart(); + while (++i < n) streamLine(coordinates[i], stream, 1); + stream.polygonEnd(); +} + +function geoStream(object, stream) { + if (object && streamObjectType.hasOwnProperty(object.type)) { + streamObjectType[object.type](object, stream); + } else { + streamGeometry(object, stream); + } +} + +var areaRingSum = adder(); + +var areaSum = adder(), + lambda00, + phi00, + lambda0, + cosPhi0, + sinPhi0; + +var areaStream = { + point: noop, + lineStart: noop, + lineEnd: noop, + polygonStart: function() { + areaRingSum.reset(); + areaStream.lineStart = areaRingStart; + areaStream.lineEnd = areaRingEnd; + }, + polygonEnd: function() { + var areaRing = +areaRingSum; + areaSum.add(areaRing < 0 ? tau + areaRing : areaRing); + this.lineStart = this.lineEnd = this.point = noop; + }, + sphere: function() { + areaSum.add(tau); + } +}; + +function areaRingStart() { + areaStream.point = areaPointFirst; +} + +function areaRingEnd() { + areaPoint(lambda00, phi00); +} + +function areaPointFirst(lambda, phi) { + areaStream.point = areaPoint; + lambda00 = lambda, phi00 = phi; + lambda *= radians, phi *= radians; + lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi); +} + +function areaPoint(lambda, phi) { + lambda *= radians, phi *= radians; + phi = phi / 2 + quarterPi; // half the angular distance from south pole + + // Spherical excess E for a spherical triangle with vertices: south pole, + // previous point, current point. Uses a formula derived from Cagnoli’s + // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2). + var dLambda = lambda - lambda0, + sdLambda = dLambda >= 0 ? 1 : -1, + adLambda = sdLambda * dLambda, + cosPhi = cos(phi), + sinPhi = sin(phi), + k = sinPhi0 * sinPhi, + u = cosPhi0 * cosPhi + k * cos(adLambda), + v = k * sdLambda * sin(adLambda); + areaRingSum.add(atan2(v, u)); + + // Advance the previous points. + lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi; +} + +function area(object) { + areaSum.reset(); + geoStream(object, areaStream); + return areaSum * 2; +} + +function spherical(cartesian) { + return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])]; +} + +function cartesian(spherical) { + var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi); + return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)]; +} + +function cartesianDot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} + +function cartesianCross(a, b) { + return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; +} + +// TODO return a +function cartesianAddInPlace(a, b) { + a[0] += b[0], a[1] += b[1], a[2] += b[2]; +} + +function cartesianScale(vector, k) { + return [vector[0] * k, vector[1] * k, vector[2] * k]; +} + +// TODO return d +function cartesianNormalizeInPlace(d) { + var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); + d[0] /= l, d[1] /= l, d[2] /= l; +} + +var lambda0$1, phi0, lambda1, phi1, // bounds + lambda2, // previous lambda-coordinate + lambda00$1, phi00$1, // first point + p0, // previous 3D point + deltaSum = adder(), + ranges, + range; + +var boundsStream = { + point: boundsPoint, + lineStart: boundsLineStart, + lineEnd: boundsLineEnd, + polygonStart: function() { + boundsStream.point = boundsRingPoint; + boundsStream.lineStart = boundsRingStart; + boundsStream.lineEnd = boundsRingEnd; + deltaSum.reset(); + areaStream.polygonStart(); + }, + polygonEnd: function() { + areaStream.polygonEnd(); + boundsStream.point = boundsPoint; + boundsStream.lineStart = boundsLineStart; + boundsStream.lineEnd = boundsLineEnd; + if (areaRingSum < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90); + else if (deltaSum > epsilon) phi1 = 90; + else if (deltaSum < -epsilon) phi0 = -90; + range[0] = lambda0$1, range[1] = lambda1; + }, + sphere: function() { + lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90); + } +}; + +function boundsPoint(lambda, phi) { + ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]); + if (phi < phi0) phi0 = phi; + if (phi > phi1) phi1 = phi; +} + +function linePoint(lambda, phi) { + var p = cartesian([lambda * radians, phi * radians]); + if (p0) { + var normal = cartesianCross(p0, p), + equatorial = [normal[1], -normal[0], 0], + inflection = cartesianCross(equatorial, normal); + cartesianNormalizeInPlace(inflection); + inflection = spherical(inflection); + var delta = lambda - lambda2, + sign = delta > 0 ? 1 : -1, + lambdai = inflection[0] * degrees * sign, + phii, + antimeridian = abs(delta) > 180; + if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) { + phii = inflection[1] * degrees; + if (phii > phi1) phi1 = phii; + } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) { + phii = -inflection[1] * degrees; + if (phii < phi0) phi0 = phii; + } else { + if (phi < phi0) phi0 = phi; + if (phi > phi1) phi1 = phi; + } + if (antimeridian) { + if (lambda < lambda2) { + if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda; + } else { + if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda; + } + } else { + if (lambda1 >= lambda0$1) { + if (lambda < lambda0$1) lambda0$1 = lambda; + if (lambda > lambda1) lambda1 = lambda; + } else { + if (lambda > lambda2) { + if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda; + } else { + if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda; + } + } + } + } else { + ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]); + } + if (phi < phi0) phi0 = phi; + if (phi > phi1) phi1 = phi; + p0 = p, lambda2 = lambda; +} + +function boundsLineStart() { + boundsStream.point = linePoint; +} + +function boundsLineEnd() { + range[0] = lambda0$1, range[1] = lambda1; + boundsStream.point = boundsPoint; + p0 = null; +} + +function boundsRingPoint(lambda, phi) { + if (p0) { + var delta = lambda - lambda2; + deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta); + } else { + lambda00$1 = lambda, phi00$1 = phi; + } + areaStream.point(lambda, phi); + linePoint(lambda, phi); +} + +function boundsRingStart() { + areaStream.lineStart(); +} + +function boundsRingEnd() { + boundsRingPoint(lambda00$1, phi00$1); + areaStream.lineEnd(); + if (abs(deltaSum) > epsilon) lambda0$1 = -(lambda1 = 180); + range[0] = lambda0$1, range[1] = lambda1; + p0 = null; +} + +// Finds the left-right distance between two longitudes. +// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want +// the distance between ±180° to be 360°. +function angle(lambda0, lambda1) { + return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1; +} + +function rangeCompare(a, b) { + return a[0] - b[0]; +} + +function rangeContains(range, x) { + return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; +} + +function bounds(feature) { + var i, n, a, b, merged, deltaMax, delta; + + phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity); + ranges = []; + geoStream(feature, boundsStream); + + // First, sort ranges by their minimum longitudes. + if (n = ranges.length) { + ranges.sort(rangeCompare); + + // Then, merge any ranges that overlap. + for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) { + b = ranges[i]; + if (rangeContains(a, b[0]) || rangeContains(a, b[1])) { + if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; + if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; + } else { + merged.push(a = b); + } + } + + // Finally, find the largest gap between the merged ranges. + // The final bounding box will be the inverse of this gap. + for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) { + b = merged[i]; + if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0$1 = b[0], lambda1 = a[1]; + } + } + + ranges = range = null; + + return lambda0$1 === Infinity || phi0 === Infinity + ? [[NaN, NaN], [NaN, NaN]] + : [[lambda0$1, phi0], [lambda1, phi1]]; +} + +var W0, W1, + X0, Y0, Z0, + X1, Y1, Z1, + X2, Y2, Z2, + lambda00$2, phi00$2, // first point + x0, y0, z0; // previous point + +var centroidStream = { + sphere: noop, + point: centroidPoint, + lineStart: centroidLineStart, + lineEnd: centroidLineEnd, + polygonStart: function() { + centroidStream.lineStart = centroidRingStart; + centroidStream.lineEnd = centroidRingEnd; + }, + polygonEnd: function() { + centroidStream.lineStart = centroidLineStart; + centroidStream.lineEnd = centroidLineEnd; + } +}; + +// Arithmetic mean of Cartesian vectors. +function centroidPoint(lambda, phi) { + lambda *= radians, phi *= radians; + var cosPhi = cos(phi); + centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)); +} + +function centroidPointCartesian(x, y, z) { + ++W0; + X0 += (x - X0) / W0; + Y0 += (y - Y0) / W0; + Z0 += (z - Z0) / W0; +} + +function centroidLineStart() { + centroidStream.point = centroidLinePointFirst; +} + +function centroidLinePointFirst(lambda, phi) { + lambda *= radians, phi *= radians; + var cosPhi = cos(phi); + x0 = cosPhi * cos(lambda); + y0 = cosPhi * sin(lambda); + z0 = sin(phi); + centroidStream.point = centroidLinePoint; + centroidPointCartesian(x0, y0, z0); +} + +function centroidLinePoint(lambda, phi) { + lambda *= radians, phi *= radians; + var cosPhi = cos(phi), + x = cosPhi * cos(lambda), + y = cosPhi * sin(lambda), + z = sin(phi), + w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); + W1 += w; + X1 += w * (x0 + (x0 = x)); + Y1 += w * (y0 + (y0 = y)); + Z1 += w * (z0 + (z0 = z)); + centroidPointCartesian(x0, y0, z0); +} + +function centroidLineEnd() { + centroidStream.point = centroidPoint; +} + +// See J. E. Brock, The Inertia Tensor for a Spherical Triangle, +// J. Applied Mechanics 42, 239 (1975). +function centroidRingStart() { + centroidStream.point = centroidRingPointFirst; +} + +function centroidRingEnd() { + centroidRingPoint(lambda00$2, phi00$2); + centroidStream.point = centroidPoint; +} + +function centroidRingPointFirst(lambda, phi) { + lambda00$2 = lambda, phi00$2 = phi; + lambda *= radians, phi *= radians; + centroidStream.point = centroidRingPoint; + var cosPhi = cos(phi); + x0 = cosPhi * cos(lambda); + y0 = cosPhi * sin(lambda); + z0 = sin(phi); + centroidPointCartesian(x0, y0, z0); +} + +function centroidRingPoint(lambda, phi) { + lambda *= radians, phi *= radians; + var cosPhi = cos(phi), + x = cosPhi * cos(lambda), + y = cosPhi * sin(lambda), + z = sin(phi), + cx = y0 * z - z0 * y, + cy = z0 * x - x0 * z, + cz = x0 * y - y0 * x, + m = sqrt(cx * cx + cy * cy + cz * cz), + w = asin(m), // line weight = angle + v = m && -w / m; // area weight multiplier + X2 += v * cx; + Y2 += v * cy; + Z2 += v * cz; + W1 += w; + X1 += w * (x0 + (x0 = x)); + Y1 += w * (y0 + (y0 = y)); + Z1 += w * (z0 + (z0 = z)); + centroidPointCartesian(x0, y0, z0); +} + +function centroid(object) { + W0 = W1 = + X0 = Y0 = Z0 = + X1 = Y1 = Z1 = + X2 = Y2 = Z2 = 0; + geoStream(object, centroidStream); + + var x = X2, + y = Y2, + z = Z2, + m = x * x + y * y + z * z; + + // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid. + if (m < epsilon2) { + x = X1, y = Y1, z = Z1; + // If the feature has zero length, fall back to arithmetic mean of point vectors. + if (W1 < epsilon) x = X0, y = Y0, z = Z0; + m = x * x + y * y + z * z; + // If the feature still has an undefined ccentroid, then return. + if (m < epsilon2) return [NaN, NaN]; + } + + return [atan2(y, x) * degrees, asin(z / sqrt(m)) * degrees]; +} + +function constant(x) { + return function() { + return x; + }; +} + +function compose(a, b) { + + function compose(x, y) { + return x = a(x, y), b(x[0], x[1]); + } + + if (a.invert && b.invert) compose.invert = function(x, y) { + return x = b.invert(x, y), x && a.invert(x[0], x[1]); + }; + + return compose; +} + +function rotationIdentity(lambda, phi) { + return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi]; +} + +rotationIdentity.invert = rotationIdentity; + +function rotateRadians(deltaLambda, deltaPhi, deltaGamma) { + return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) + : rotationLambda(deltaLambda)) + : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) + : rotationIdentity); +} + +function forwardRotationLambda(deltaLambda) { + return function(lambda, phi) { + return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi]; + }; +} + +function rotationLambda(deltaLambda) { + var rotation = forwardRotationLambda(deltaLambda); + rotation.invert = forwardRotationLambda(-deltaLambda); + return rotation; +} + +function rotationPhiGamma(deltaPhi, deltaGamma) { + var cosDeltaPhi = cos(deltaPhi), + sinDeltaPhi = sin(deltaPhi), + cosDeltaGamma = cos(deltaGamma), + sinDeltaGamma = sin(deltaGamma); + + function rotation(lambda, phi) { + var cosPhi = cos(phi), + x = cos(lambda) * cosPhi, + y = sin(lambda) * cosPhi, + z = sin(phi), + k = z * cosDeltaPhi + x * sinDeltaPhi; + return [ + atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi), + asin(k * cosDeltaGamma + y * sinDeltaGamma) + ]; + } + + rotation.invert = function(lambda, phi) { + var cosPhi = cos(phi), + x = cos(lambda) * cosPhi, + y = sin(lambda) * cosPhi, + z = sin(phi), + k = z * cosDeltaGamma - y * sinDeltaGamma; + return [ + atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi), + asin(k * cosDeltaPhi - x * sinDeltaPhi) + ]; + }; + + return rotation; +} + +function rotation(rotate) { + rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0); + + function forward(coordinates) { + coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians); + return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates; + } + + forward.invert = function(coordinates) { + coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians); + return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates; + }; + + return forward; +} + +// Generates a circle centered at [0°, 0°], with a given radius and precision. +function circleStream(stream, radius, delta, direction, t0, t1) { + if (!delta) return; + var cosRadius = cos(radius), + sinRadius = sin(radius), + step = direction * delta; + if (t0 == null) { + t0 = radius + direction * tau; + t1 = radius - step / 2; + } else { + t0 = circleRadius(cosRadius, t0); + t1 = circleRadius(cosRadius, t1); + if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau; + } + for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) { + point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]); + stream.point(point[0], point[1]); + } +} + +// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0]. +function circleRadius(cosRadius, point) { + point = cartesian(point), point[0] -= cosRadius; + cartesianNormalizeInPlace(point); + var radius = acos(-point[1]); + return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau; +} + +function circle() { + var center = constant([0, 0]), + radius = constant(90), + precision = constant(6), + ring, + rotate, + stream = {point: point}; + + function point(x, y) { + ring.push(x = rotate(x, y)); + x[0] *= degrees, x[1] *= degrees; + } + + function circle() { + var c = center.apply(this, arguments), + r = radius.apply(this, arguments) * radians, + p = precision.apply(this, arguments) * radians; + ring = []; + rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert; + circleStream(stream, r, p, 1); + c = {type: "Polygon", coordinates: [ring]}; + ring = rotate = null; + return c; + } + + circle.center = function(_) { + return arguments.length ? (center = typeof _ === "function" ? _ : constant([+_[0], +_[1]]), circle) : center; + }; + + circle.radius = function(_) { + return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), circle) : radius; + }; + + circle.precision = function(_) { + return arguments.length ? (precision = typeof _ === "function" ? _ : constant(+_), circle) : precision; + }; + + return circle; +} + +function clipBuffer() { + var lines = [], + line; + return { + point: function(x, y, m) { + line.push([x, y, m]); + }, + lineStart: function() { + lines.push(line = []); + }, + lineEnd: noop, + rejoin: function() { + if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); + }, + result: function() { + var result = lines; + lines = []; + line = null; + return result; + } + }; +} + +function pointEqual(a, b) { + return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon; +} + +function Intersection(point, points, other, entry) { + this.x = point; + this.z = points; + this.o = other; // another intersection + this.e = entry; // is an entry? + this.v = false; // visited + this.n = this.p = null; // next & previous +} + +// A generalized polygon clipping algorithm: given a polygon that has been cut +// into its visible line segments, and rejoins the segments by interpolating +// along the clip edge. +function clipRejoin(segments, compareIntersection, startInside, interpolate, stream) { + var subject = [], + clip = [], + i, + n; + + segments.forEach(function(segment) { + if ((n = segment.length - 1) <= 0) return; + var n, p0 = segment[0], p1 = segment[n], x; + + if (pointEqual(p0, p1)) { + if (!p0[2] && !p1[2]) { + stream.lineStart(); + for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]); + stream.lineEnd(); + return; + } + // handle degenerate cases by moving the point + p1[0] += 2 * epsilon; + } + + subject.push(x = new Intersection(p0, segment, null, true)); + clip.push(x.o = new Intersection(p0, null, x, false)); + subject.push(x = new Intersection(p1, segment, null, false)); + clip.push(x.o = new Intersection(p1, null, x, true)); + }); + + if (!subject.length) return; + + clip.sort(compareIntersection); + link(subject); + link(clip); + + for (i = 0, n = clip.length; i < n; ++i) { + clip[i].e = startInside = !startInside; + } + + var start = subject[0], + points, + point; + + while (1) { + // Find first unvisited intersection. + var current = start, + isSubject = true; + while (current.v) if ((current = current.n) === start) return; + points = current.z; + stream.lineStart(); + do { + current.v = current.o.v = true; + if (current.e) { + if (isSubject) { + for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.n.x, 1, stream); + } + current = current.n; + } else { + if (isSubject) { + points = current.p.z; + for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.p.x, -1, stream); + } + current = current.p; + } + current = current.o; + points = current.z; + isSubject = !isSubject; + } while (!current.v); + stream.lineEnd(); + } +} + +function link(array) { + if (!(n = array.length)) return; + var n, + i = 0, + a = array[0], + b; + while (++i < n) { + a.n = b = array[i]; + b.p = a; + a = b; + } + a.n = b = array[0]; + b.p = a; +} + +var sum = adder(); + +function longitude(point) { + if (abs(point[0]) <= pi) + return point[0]; + else + return sign(point[0]) * ((abs(point[0]) + pi) % tau - pi); +} + +function polygonContains(polygon, point) { + var lambda = longitude(point), + phi = point[1], + sinPhi = sin(phi), + normal = [sin(lambda), -cos(lambda), 0], + angle = 0, + winding = 0; + + sum.reset(); + + if (sinPhi === 1) phi = halfPi + epsilon; + else if (sinPhi === -1) phi = -halfPi - epsilon; + + for (var i = 0, n = polygon.length; i < n; ++i) { + if (!(m = (ring = polygon[i]).length)) continue; + var ring, + m, + point0 = ring[m - 1], + lambda0 = longitude(point0), + phi0 = point0[1] / 2 + quarterPi, + sinPhi0 = sin(phi0), + cosPhi0 = cos(phi0); + + for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) { + var point1 = ring[j], + lambda1 = longitude(point1), + phi1 = point1[1] / 2 + quarterPi, + sinPhi1 = sin(phi1), + cosPhi1 = cos(phi1), + delta = lambda1 - lambda0, + sign = delta >= 0 ? 1 : -1, + absDelta = sign * delta, + antimeridian = absDelta > pi, + k = sinPhi0 * sinPhi1; + + sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta))); + angle += antimeridian ? delta + sign * tau : delta; + + // Are the longitudes either side of the point’s meridian (lambda), + // and are the latitudes smaller than the parallel (phi)? + if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) { + var arc = cartesianCross(cartesian(point0), cartesian(point1)); + cartesianNormalizeInPlace(arc); + var intersection = cartesianCross(normal, arc); + cartesianNormalizeInPlace(intersection); + var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]); + if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) { + winding += antimeridian ^ delta >= 0 ? 1 : -1; + } + } + } + } + + // First, determine whether the South pole is inside or outside: + // + // It is inside if: + // * the polygon winds around it in a clockwise direction. + // * the polygon does not (cumulatively) wind around it, but has a negative + // (counter-clockwise) area. + // + // Second, count the (signed) number of times a segment crosses a lambda + // from the point to the South pole. If it is zero, then the point is the + // same side as the South pole. + + return (angle < -epsilon || angle < epsilon && sum < -epsilon) ^ (winding & 1); +} + +function clip(pointVisible, clipLine, interpolate, start) { + return function(sink) { + var line = clipLine(sink), + ringBuffer = clipBuffer(), + ringSink = clipLine(ringBuffer), + polygonStarted = false, + polygon, + segments, + ring; + + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + clip.point = pointRing; + clip.lineStart = ringStart; + clip.lineEnd = ringEnd; + segments = []; + polygon = []; + }, + polygonEnd: function() { + clip.point = point; + clip.lineStart = lineStart; + clip.lineEnd = lineEnd; + segments = d3Array.merge(segments); + var startInside = polygonContains(polygon, start); + if (segments.length) { + if (!polygonStarted) sink.polygonStart(), polygonStarted = true; + clipRejoin(segments, compareIntersection, startInside, interpolate, sink); + } else if (startInside) { + if (!polygonStarted) sink.polygonStart(), polygonStarted = true; + sink.lineStart(); + interpolate(null, null, 1, sink); + sink.lineEnd(); + } + if (polygonStarted) sink.polygonEnd(), polygonStarted = false; + segments = polygon = null; + }, + sphere: function() { + sink.polygonStart(); + sink.lineStart(); + interpolate(null, null, 1, sink); + sink.lineEnd(); + sink.polygonEnd(); + } + }; + + function point(lambda, phi) { + if (pointVisible(lambda, phi)) sink.point(lambda, phi); + } + + function pointLine(lambda, phi) { + line.point(lambda, phi); + } + + function lineStart() { + clip.point = pointLine; + line.lineStart(); + } + + function lineEnd() { + clip.point = point; + line.lineEnd(); + } + + function pointRing(lambda, phi) { + ring.push([lambda, phi]); + ringSink.point(lambda, phi); + } + + function ringStart() { + ringSink.lineStart(); + ring = []; + } + + function ringEnd() { + pointRing(ring[0][0], ring[0][1]); + ringSink.lineEnd(); + + var clean = ringSink.clean(), + ringSegments = ringBuffer.result(), + i, n = ringSegments.length, m, + segment, + point; + + ring.pop(); + polygon.push(ring); + ring = null; + + if (!n) return; + + // No intersections. + if (clean & 1) { + segment = ringSegments[0]; + if ((m = segment.length - 1) > 0) { + if (!polygonStarted) sink.polygonStart(), polygonStarted = true; + sink.lineStart(); + for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]); + sink.lineEnd(); + } + return; + } + + // Rejoin connected segments. + // TODO reuse ringBuffer.rejoin()? + if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); + + segments.push(ringSegments.filter(validSegment)); + } + + return clip; + }; +} + +function validSegment(segment) { + return segment.length > 1; +} + +// Intersections are sorted along the clip edge. For both antimeridian cutting +// and circle clipping, the same comparison is used. +function compareIntersection(a, b) { + return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1]) + - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]); +} + +var clipAntimeridian = clip( + function() { return true; }, + clipAntimeridianLine, + clipAntimeridianInterpolate, + [-pi, -halfPi] +); + +// Takes a line and cuts into visible segments. Return values: 0 - there were +// intersections or the line was empty; 1 - no intersections; 2 - there were +// intersections, and the first and last segments should be rejoined. +function clipAntimeridianLine(stream) { + var lambda0 = NaN, + phi0 = NaN, + sign0 = NaN, + clean; // no intersections + + return { + lineStart: function() { + stream.lineStart(); + clean = 1; + }, + point: function(lambda1, phi1) { + var sign1 = lambda1 > 0 ? pi : -pi, + delta = abs(lambda1 - lambda0); + if (abs(delta - pi) < epsilon) { // line crosses a pole + stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi); + stream.point(sign0, phi0); + stream.lineEnd(); + stream.lineStart(); + stream.point(sign1, phi0); + stream.point(lambda1, phi0); + clean = 0; + } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian + if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies + if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon; + phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1); + stream.point(sign0, phi0); + stream.lineEnd(); + stream.lineStart(); + stream.point(sign1, phi0); + clean = 0; + } + stream.point(lambda0 = lambda1, phi0 = phi1); + sign0 = sign1; + }, + lineEnd: function() { + stream.lineEnd(); + lambda0 = phi0 = NaN; + }, + clean: function() { + return 2 - clean; // if intersections, rejoin first and last segments + } + }; +} + +function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) { + var cosPhi0, + cosPhi1, + sinLambda0Lambda1 = sin(lambda0 - lambda1); + return abs(sinLambda0Lambda1) > epsilon + ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1) + - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0)) + / (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) + : (phi0 + phi1) / 2; +} + +function clipAntimeridianInterpolate(from, to, direction, stream) { + var phi; + if (from == null) { + phi = direction * halfPi; + stream.point(-pi, phi); + stream.point(0, phi); + stream.point(pi, phi); + stream.point(pi, 0); + stream.point(pi, -phi); + stream.point(0, -phi); + stream.point(-pi, -phi); + stream.point(-pi, 0); + stream.point(-pi, phi); + } else if (abs(from[0] - to[0]) > epsilon) { + var lambda = from[0] < to[0] ? pi : -pi; + phi = direction * lambda / 2; + stream.point(-lambda, phi); + stream.point(0, phi); + stream.point(lambda, phi); + } else { + stream.point(to[0], to[1]); + } +} + +function clipCircle(radius) { + var cr = cos(radius), + delta = 6 * radians, + smallRadius = cr > 0, + notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case + + function interpolate(from, to, direction, stream) { + circleStream(stream, radius, delta, direction, from, to); + } + + function visible(lambda, phi) { + return cos(lambda) * cos(phi) > cr; + } + + // Takes a line and cuts into visible segments. Return values used for polygon + // clipping: 0 - there were intersections or the line was empty; 1 - no + // intersections 2 - there were intersections, and the first and last segments + // should be rejoined. + function clipLine(stream) { + var point0, // previous point + c0, // code for previous point + v0, // visibility of previous point + v00, // visibility of first point + clean; // no intersections + return { + lineStart: function() { + v00 = v0 = false; + clean = 1; + }, + point: function(lambda, phi) { + var point1 = [lambda, phi], + point2, + v = visible(lambda, phi), + c = smallRadius + ? v ? 0 : code(lambda, phi) + : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0; + if (!point0 && (v00 = v0 = v)) stream.lineStart(); + if (v !== v0) { + point2 = intersect(point0, point1); + if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) + point1[2] = 1; + } + if (v !== v0) { + clean = 0; + if (v) { + // outside going in + stream.lineStart(); + point2 = intersect(point1, point0); + stream.point(point2[0], point2[1]); + } else { + // inside going out + point2 = intersect(point0, point1); + stream.point(point2[0], point2[1], 2); + stream.lineEnd(); + } + point0 = point2; + } else if (notHemisphere && point0 && smallRadius ^ v) { + var t; + // If the codes for two points are different, or are both zero, + // and there this segment intersects with the small circle. + if (!(c & c0) && (t = intersect(point1, point0, true))) { + clean = 0; + if (smallRadius) { + stream.lineStart(); + stream.point(t[0][0], t[0][1]); + stream.point(t[1][0], t[1][1]); + stream.lineEnd(); + } else { + stream.point(t[1][0], t[1][1]); + stream.lineEnd(); + stream.lineStart(); + stream.point(t[0][0], t[0][1], 3); + } + } + } + if (v && (!point0 || !pointEqual(point0, point1))) { + stream.point(point1[0], point1[1]); + } + point0 = point1, v0 = v, c0 = c; + }, + lineEnd: function() { + if (v0) stream.lineEnd(); + point0 = null; + }, + // Rejoin first and last segments if there were intersections and the first + // and last points were visible. + clean: function() { + return clean | ((v00 && v0) << 1); + } + }; + } + + // Intersects the great circle between a and b with the clip circle. + function intersect(a, b, two) { + var pa = cartesian(a), + pb = cartesian(b); + + // We have two planes, n1.p = d1 and n2.p = d2. + // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2). + var n1 = [1, 0, 0], // normal + n2 = cartesianCross(pa, pb), + n2n2 = cartesianDot(n2, n2), + n1n2 = n2[0], // cartesianDot(n1, n2), + determinant = n2n2 - n1n2 * n1n2; + + // Two polar points. + if (!determinant) return !two && a; + + var c1 = cr * n2n2 / determinant, + c2 = -cr * n1n2 / determinant, + n1xn2 = cartesianCross(n1, n2), + A = cartesianScale(n1, c1), + B = cartesianScale(n2, c2); + cartesianAddInPlace(A, B); + + // Solve |p(t)|^2 = 1. + var u = n1xn2, + w = cartesianDot(A, u), + uu = cartesianDot(u, u), + t2 = w * w - uu * (cartesianDot(A, A) - 1); + + if (t2 < 0) return; + + var t = sqrt(t2), + q = cartesianScale(u, (-w - t) / uu); + cartesianAddInPlace(q, A); + q = spherical(q); + + if (!two) return q; + + // Two intersection points. + var lambda0 = a[0], + lambda1 = b[0], + phi0 = a[1], + phi1 = b[1], + z; + + if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z; + + var delta = lambda1 - lambda0, + polar = abs(delta - pi) < epsilon, + meridian = polar || delta < epsilon; + + if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z; + + // Check that the first point is between a and b. + if (meridian + ? polar + ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1) + : phi0 <= q[1] && q[1] <= phi1 + : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) { + var q1 = cartesianScale(u, (-w + t) / uu); + cartesianAddInPlace(q1, A); + return [q, spherical(q1)]; + } + } + + // Generates a 4-bit vector representing the location of a point relative to + // the small circle's bounding box. + function code(lambda, phi) { + var r = smallRadius ? radius : pi - radius, + code = 0; + if (lambda < -r) code |= 1; // left + else if (lambda > r) code |= 2; // right + if (phi < -r) code |= 4; // below + else if (phi > r) code |= 8; // above + return code; + } + + return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]); +} + +function clipLine(a, b, x0, y0, x1, y1) { + var ax = a[0], + ay = a[1], + bx = b[0], + by = b[1], + t0 = 0, + t1 = 1, + dx = bx - ax, + dy = by - ay, + r; + + r = x0 - ax; + if (!dx && r > 0) return; + r /= dx; + if (dx < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dx > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + + r = x1 - ax; + if (!dx && r < 0) return; + r /= dx; + if (dx < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dx > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + + r = y0 - ay; + if (!dy && r > 0) return; + r /= dy; + if (dy < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dy > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + + r = y1 - ay; + if (!dy && r < 0) return; + r /= dy; + if (dy < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dy > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + + if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy; + if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy; + return true; +} + +var clipMax = 1e9, clipMin = -clipMax; + +// TODO Use d3-polygon’s polygonContains here for the ring check? +// TODO Eliminate duplicate buffering in clipBuffer and polygon.push? + +function clipRectangle(x0, y0, x1, y1) { + + function visible(x, y) { + return x0 <= x && x <= x1 && y0 <= y && y <= y1; + } + + function interpolate(from, to, direction, stream) { + var a = 0, a1 = 0; + if (from == null + || (a = corner(from, direction)) !== (a1 = corner(to, direction)) + || comparePoint(from, to) < 0 ^ direction > 0) { + do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); + while ((a = (a + direction + 4) % 4) !== a1); + } else { + stream.point(to[0], to[1]); + } + } + + function corner(p, direction) { + return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3 + : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1 + : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0 + : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon + } + + function compareIntersection(a, b) { + return comparePoint(a.x, b.x); + } + + function comparePoint(a, b) { + var ca = corner(a, 1), + cb = corner(b, 1); + return ca !== cb ? ca - cb + : ca === 0 ? b[1] - a[1] + : ca === 1 ? a[0] - b[0] + : ca === 2 ? a[1] - b[1] + : b[0] - a[0]; + } + + return function(stream) { + var activeStream = stream, + bufferStream = clipBuffer(), + segments, + polygon, + ring, + x__, y__, v__, // first point + x_, y_, v_, // previous point + first, + clean; + + var clipStream = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: polygonStart, + polygonEnd: polygonEnd + }; + + function point(x, y) { + if (visible(x, y)) activeStream.point(x, y); + } + + function polygonInside() { + var winding = 0; + + for (var i = 0, n = polygon.length; i < n; ++i) { + for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) { + a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1]; + if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; } + else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; } + } + } + + return winding; + } + + // Buffer geometry within a polygon and then clip it en masse. + function polygonStart() { + activeStream = bufferStream, segments = [], polygon = [], clean = true; + } + + function polygonEnd() { + var startInside = polygonInside(), + cleanInside = clean && startInside, + visible = (segments = d3Array.merge(segments)).length; + if (cleanInside || visible) { + stream.polygonStart(); + if (cleanInside) { + stream.lineStart(); + interpolate(null, null, 1, stream); + stream.lineEnd(); + } + if (visible) { + clipRejoin(segments, compareIntersection, startInside, interpolate, stream); + } + stream.polygonEnd(); + } + activeStream = stream, segments = polygon = ring = null; + } + + function lineStart() { + clipStream.point = linePoint; + if (polygon) polygon.push(ring = []); + first = true; + v_ = false; + x_ = y_ = NaN; + } + + // TODO rather than special-case polygons, simply handle them separately. + // Ideally, coincident intersection points should be jittered to avoid + // clipping issues. + function lineEnd() { + if (segments) { + linePoint(x__, y__); + if (v__ && v_) bufferStream.rejoin(); + segments.push(bufferStream.result()); + } + clipStream.point = point; + if (v_) activeStream.lineEnd(); + } + + function linePoint(x, y) { + var v = visible(x, y); + if (polygon) ring.push([x, y]); + if (first) { + x__ = x, y__ = y, v__ = v; + first = false; + if (v) { + activeStream.lineStart(); + activeStream.point(x, y); + } + } else { + if (v && v_) activeStream.point(x, y); + else { + var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], + b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))]; + if (clipLine(a, b, x0, y0, x1, y1)) { + if (!v_) { + activeStream.lineStart(); + activeStream.point(a[0], a[1]); + } + activeStream.point(b[0], b[1]); + if (!v) activeStream.lineEnd(); + clean = false; + } else if (v) { + activeStream.lineStart(); + activeStream.point(x, y); + clean = false; + } + } + } + x_ = x, y_ = y, v_ = v; + } + + return clipStream; + }; +} + +function extent() { + var x0 = 0, + y0 = 0, + x1 = 960, + y1 = 500, + cache, + cacheStream, + clip; + + return clip = { + stream: function(stream) { + return cache && cacheStream === stream ? cache : cache = clipRectangle(x0, y0, x1, y1)(cacheStream = stream); + }, + extent: function(_) { + return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]]; + } + }; +} + +var lengthSum = adder(), + lambda0$2, + sinPhi0$1, + cosPhi0$1; + +var lengthStream = { + sphere: noop, + point: noop, + lineStart: lengthLineStart, + lineEnd: noop, + polygonStart: noop, + polygonEnd: noop +}; + +function lengthLineStart() { + lengthStream.point = lengthPointFirst; + lengthStream.lineEnd = lengthLineEnd; +} + +function lengthLineEnd() { + lengthStream.point = lengthStream.lineEnd = noop; +} + +function lengthPointFirst(lambda, phi) { + lambda *= radians, phi *= radians; + lambda0$2 = lambda, sinPhi0$1 = sin(phi), cosPhi0$1 = cos(phi); + lengthStream.point = lengthPoint; +} + +function lengthPoint(lambda, phi) { + lambda *= radians, phi *= radians; + var sinPhi = sin(phi), + cosPhi = cos(phi), + delta = abs(lambda - lambda0$2), + cosDelta = cos(delta), + sinDelta = sin(delta), + x = cosPhi * sinDelta, + y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta, + z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta; + lengthSum.add(atan2(sqrt(x * x + y * y), z)); + lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi; +} + +function length(object) { + lengthSum.reset(); + geoStream(object, lengthStream); + return +lengthSum; +} + +var coordinates = [null, null], + object = {type: "LineString", coordinates: coordinates}; + +function distance(a, b) { + coordinates[0] = a; + coordinates[1] = b; + return length(object); +} + +var containsObjectType = { + Feature: function(object, point) { + return containsGeometry(object.geometry, point); + }, + FeatureCollection: function(object, point) { + var features = object.features, i = -1, n = features.length; + while (++i < n) if (containsGeometry(features[i].geometry, point)) return true; + return false; + } +}; + +var containsGeometryType = { + Sphere: function() { + return true; + }, + Point: function(object, point) { + return containsPoint(object.coordinates, point); + }, + MultiPoint: function(object, point) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) if (containsPoint(coordinates[i], point)) return true; + return false; + }, + LineString: function(object, point) { + return containsLine(object.coordinates, point); + }, + MultiLineString: function(object, point) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) if (containsLine(coordinates[i], point)) return true; + return false; + }, + Polygon: function(object, point) { + return containsPolygon(object.coordinates, point); + }, + MultiPolygon: function(object, point) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) if (containsPolygon(coordinates[i], point)) return true; + return false; + }, + GeometryCollection: function(object, point) { + var geometries = object.geometries, i = -1, n = geometries.length; + while (++i < n) if (containsGeometry(geometries[i], point)) return true; + return false; + } +}; + +function containsGeometry(geometry, point) { + return geometry && containsGeometryType.hasOwnProperty(geometry.type) + ? containsGeometryType[geometry.type](geometry, point) + : false; +} + +function containsPoint(coordinates, point) { + return distance(coordinates, point) === 0; +} + +function containsLine(coordinates, point) { + var ao, bo, ab; + for (var i = 0, n = coordinates.length; i < n; i++) { + bo = distance(coordinates[i], point); + if (bo === 0) return true; + if (i > 0) { + ab = distance(coordinates[i], coordinates[i - 1]); + if ( + ab > 0 && + ao <= ab && + bo <= ab && + (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < epsilon2 * ab + ) + return true; + } + ao = bo; + } + return false; +} + +function containsPolygon(coordinates, point) { + return !!polygonContains(coordinates.map(ringRadians), pointRadians(point)); +} + +function ringRadians(ring) { + return ring = ring.map(pointRadians), ring.pop(), ring; +} + +function pointRadians(point) { + return [point[0] * radians, point[1] * radians]; +} + +function contains(object, point) { + return (object && containsObjectType.hasOwnProperty(object.type) + ? containsObjectType[object.type] + : containsGeometry)(object, point); +} + +function graticuleX(y0, y1, dy) { + var y = d3Array.range(y0, y1 - epsilon, dy).concat(y1); + return function(x) { return y.map(function(y) { return [x, y]; }); }; +} + +function graticuleY(x0, x1, dx) { + var x = d3Array.range(x0, x1 - epsilon, dx).concat(x1); + return function(y) { return x.map(function(x) { return [x, y]; }); }; +} + +function graticule() { + var x1, x0, X1, X0, + y1, y0, Y1, Y0, + dx = 10, dy = dx, DX = 90, DY = 360, + x, y, X, Y, + precision = 2.5; + + function graticule() { + return {type: "MultiLineString", coordinates: lines()}; + } + + function lines() { + return d3Array.range(ceil(X0 / DX) * DX, X1, DX).map(X) + .concat(d3Array.range(ceil(Y0 / DY) * DY, Y1, DY).map(Y)) + .concat(d3Array.range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x)) + .concat(d3Array.range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y)); + } + + graticule.lines = function() { + return lines().map(function(coordinates) { return {type: "LineString", coordinates: coordinates}; }); + }; + + graticule.outline = function() { + return { + type: "Polygon", + coordinates: [ + X(X0).concat( + Y(Y1).slice(1), + X(X1).reverse().slice(1), + Y(Y0).reverse().slice(1)) + ] + }; + }; + + graticule.extent = function(_) { + if (!arguments.length) return graticule.extentMinor(); + return graticule.extentMajor(_).extentMinor(_); + }; + + graticule.extentMajor = function(_) { + if (!arguments.length) return [[X0, Y0], [X1, Y1]]; + X0 = +_[0][0], X1 = +_[1][0]; + Y0 = +_[0][1], Y1 = +_[1][1]; + if (X0 > X1) _ = X0, X0 = X1, X1 = _; + if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; + return graticule.precision(precision); + }; + + graticule.extentMinor = function(_) { + if (!arguments.length) return [[x0, y0], [x1, y1]]; + x0 = +_[0][0], x1 = +_[1][0]; + y0 = +_[0][1], y1 = +_[1][1]; + if (x0 > x1) _ = x0, x0 = x1, x1 = _; + if (y0 > y1) _ = y0, y0 = y1, y1 = _; + return graticule.precision(precision); + }; + + graticule.step = function(_) { + if (!arguments.length) return graticule.stepMinor(); + return graticule.stepMajor(_).stepMinor(_); + }; + + graticule.stepMajor = function(_) { + if (!arguments.length) return [DX, DY]; + DX = +_[0], DY = +_[1]; + return graticule; + }; + + graticule.stepMinor = function(_) { + if (!arguments.length) return [dx, dy]; + dx = +_[0], dy = +_[1]; + return graticule; + }; + + graticule.precision = function(_) { + if (!arguments.length) return precision; + precision = +_; + x = graticuleX(y0, y1, 90); + y = graticuleY(x0, x1, precision); + X = graticuleX(Y0, Y1, 90); + Y = graticuleY(X0, X1, precision); + return graticule; + }; + + return graticule + .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]]) + .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]); +} + +function graticule10() { + return graticule()(); +} + +function interpolate(a, b) { + var x0 = a[0] * radians, + y0 = a[1] * radians, + x1 = b[0] * radians, + y1 = b[1] * radians, + cy0 = cos(y0), + sy0 = sin(y0), + cy1 = cos(y1), + sy1 = sin(y1), + kx0 = cy0 * cos(x0), + ky0 = cy0 * sin(x0), + kx1 = cy1 * cos(x1), + ky1 = cy1 * sin(x1), + d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))), + k = sin(d); + + var interpolate = d ? function(t) { + var B = sin(t *= d) / k, + A = sin(d - t) / k, + x = A * kx0 + B * kx1, + y = A * ky0 + B * ky1, + z = A * sy0 + B * sy1; + return [ + atan2(y, x) * degrees, + atan2(z, sqrt(x * x + y * y)) * degrees + ]; + } : function() { + return [x0 * degrees, y0 * degrees]; + }; + + interpolate.distance = d; + + return interpolate; +} + +function identity(x) { + return x; +} + +var areaSum$1 = adder(), + areaRingSum$1 = adder(), + x00, + y00, + x0$1, + y0$1; + +var areaStream$1 = { + point: noop, + lineStart: noop, + lineEnd: noop, + polygonStart: function() { + areaStream$1.lineStart = areaRingStart$1; + areaStream$1.lineEnd = areaRingEnd$1; + }, + polygonEnd: function() { + areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop; + areaSum$1.add(abs(areaRingSum$1)); + areaRingSum$1.reset(); + }, + result: function() { + var area = areaSum$1 / 2; + areaSum$1.reset(); + return area; + } +}; + +function areaRingStart$1() { + areaStream$1.point = areaPointFirst$1; +} + +function areaPointFirst$1(x, y) { + areaStream$1.point = areaPoint$1; + x00 = x0$1 = x, y00 = y0$1 = y; +} + +function areaPoint$1(x, y) { + areaRingSum$1.add(y0$1 * x - x0$1 * y); + x0$1 = x, y0$1 = y; +} + +function areaRingEnd$1() { + areaPoint$1(x00, y00); +} + +var x0$2 = Infinity, + y0$2 = x0$2, + x1 = -x0$2, + y1 = x1; + +var boundsStream$1 = { + point: boundsPoint$1, + lineStart: noop, + lineEnd: noop, + polygonStart: noop, + polygonEnd: noop, + result: function() { + var bounds = [[x0$2, y0$2], [x1, y1]]; + x1 = y1 = -(y0$2 = x0$2 = Infinity); + return bounds; + } +}; + +function boundsPoint$1(x, y) { + if (x < x0$2) x0$2 = x; + if (x > x1) x1 = x; + if (y < y0$2) y0$2 = y; + if (y > y1) y1 = y; +} + +// TODO Enforce positive area for exterior, negative area for interior? + +var X0$1 = 0, + Y0$1 = 0, + Z0$1 = 0, + X1$1 = 0, + Y1$1 = 0, + Z1$1 = 0, + X2$1 = 0, + Y2$1 = 0, + Z2$1 = 0, + x00$1, + y00$1, + x0$3, + y0$3; + +var centroidStream$1 = { + point: centroidPoint$1, + lineStart: centroidLineStart$1, + lineEnd: centroidLineEnd$1, + polygonStart: function() { + centroidStream$1.lineStart = centroidRingStart$1; + centroidStream$1.lineEnd = centroidRingEnd$1; + }, + polygonEnd: function() { + centroidStream$1.point = centroidPoint$1; + centroidStream$1.lineStart = centroidLineStart$1; + centroidStream$1.lineEnd = centroidLineEnd$1; + }, + result: function() { + var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1] + : Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1] + : Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1] + : [NaN, NaN]; + X0$1 = Y0$1 = Z0$1 = + X1$1 = Y1$1 = Z1$1 = + X2$1 = Y2$1 = Z2$1 = 0; + return centroid; + } +}; + +function centroidPoint$1(x, y) { + X0$1 += x; + Y0$1 += y; + ++Z0$1; +} + +function centroidLineStart$1() { + centroidStream$1.point = centroidPointFirstLine; +} + +function centroidPointFirstLine(x, y) { + centroidStream$1.point = centroidPointLine; + centroidPoint$1(x0$3 = x, y0$3 = y); +} + +function centroidPointLine(x, y) { + var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy); + X1$1 += z * (x0$3 + x) / 2; + Y1$1 += z * (y0$3 + y) / 2; + Z1$1 += z; + centroidPoint$1(x0$3 = x, y0$3 = y); +} + +function centroidLineEnd$1() { + centroidStream$1.point = centroidPoint$1; +} + +function centroidRingStart$1() { + centroidStream$1.point = centroidPointFirstRing; +} + +function centroidRingEnd$1() { + centroidPointRing(x00$1, y00$1); +} + +function centroidPointFirstRing(x, y) { + centroidStream$1.point = centroidPointRing; + centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y); +} + +function centroidPointRing(x, y) { + var dx = x - x0$3, + dy = y - y0$3, + z = sqrt(dx * dx + dy * dy); + + X1$1 += z * (x0$3 + x) / 2; + Y1$1 += z * (y0$3 + y) / 2; + Z1$1 += z; + + z = y0$3 * x - x0$3 * y; + X2$1 += z * (x0$3 + x); + Y2$1 += z * (y0$3 + y); + Z2$1 += z * 3; + centroidPoint$1(x0$3 = x, y0$3 = y); +} + +function PathContext(context) { + this._context = context; +} + +PathContext.prototype = { + _radius: 4.5, + pointRadius: function(_) { + return this._radius = _, this; + }, + polygonStart: function() { + this._line = 0; + }, + polygonEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._point = 0; + }, + lineEnd: function() { + if (this._line === 0) this._context.closePath(); + this._point = NaN; + }, + point: function(x, y) { + switch (this._point) { + case 0: { + this._context.moveTo(x, y); + this._point = 1; + break; + } + case 1: { + this._context.lineTo(x, y); + break; + } + default: { + this._context.moveTo(x + this._radius, y); + this._context.arc(x, y, this._radius, 0, tau); + break; + } + } + }, + result: noop +}; + +var lengthSum$1 = adder(), + lengthRing, + x00$2, + y00$2, + x0$4, + y0$4; + +var lengthStream$1 = { + point: noop, + lineStart: function() { + lengthStream$1.point = lengthPointFirst$1; + }, + lineEnd: function() { + if (lengthRing) lengthPoint$1(x00$2, y00$2); + lengthStream$1.point = noop; + }, + polygonStart: function() { + lengthRing = true; + }, + polygonEnd: function() { + lengthRing = null; + }, + result: function() { + var length = +lengthSum$1; + lengthSum$1.reset(); + return length; + } +}; + +function lengthPointFirst$1(x, y) { + lengthStream$1.point = lengthPoint$1; + x00$2 = x0$4 = x, y00$2 = y0$4 = y; +} + +function lengthPoint$1(x, y) { + x0$4 -= x, y0$4 -= y; + lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4)); + x0$4 = x, y0$4 = y; +} + +function PathString() { + this._string = []; +} + +PathString.prototype = { + _radius: 4.5, + _circle: circle$1(4.5), + pointRadius: function(_) { + if ((_ = +_) !== this._radius) this._radius = _, this._circle = null; + return this; + }, + polygonStart: function() { + this._line = 0; + }, + polygonEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._point = 0; + }, + lineEnd: function() { + if (this._line === 0) this._string.push("Z"); + this._point = NaN; + }, + point: function(x, y) { + switch (this._point) { + case 0: { + this._string.push("M", x, ",", y); + this._point = 1; + break; + } + case 1: { + this._string.push("L", x, ",", y); + break; + } + default: { + if (this._circle == null) this._circle = circle$1(this._radius); + this._string.push("M", x, ",", y, this._circle); + break; + } + } + }, + result: function() { + if (this._string.length) { + var result = this._string.join(""); + this._string = []; + return result; + } else { + return null; + } + } +}; + +function circle$1(radius) { + return "m0," + radius + + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + + "z"; +} + +function index(projection, context) { + var pointRadius = 4.5, + projectionStream, + contextStream; + + function path(object) { + if (object) { + if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); + geoStream(object, projectionStream(contextStream)); + } + return contextStream.result(); + } + + path.area = function(object) { + geoStream(object, projectionStream(areaStream$1)); + return areaStream$1.result(); + }; + + path.measure = function(object) { + geoStream(object, projectionStream(lengthStream$1)); + return lengthStream$1.result(); + }; + + path.bounds = function(object) { + geoStream(object, projectionStream(boundsStream$1)); + return boundsStream$1.result(); + }; + + path.centroid = function(object) { + geoStream(object, projectionStream(centroidStream$1)); + return centroidStream$1.result(); + }; + + path.projection = function(_) { + return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection; + }; + + path.context = function(_) { + if (!arguments.length) return context; + contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _); + if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); + return path; + }; + + path.pointRadius = function(_) { + if (!arguments.length) return pointRadius; + pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); + return path; + }; + + return path.projection(projection).context(context); +} + +function transform(methods) { + return { + stream: transformer(methods) + }; +} + +function transformer(methods) { + return function(stream) { + var s = new TransformStream; + for (var key in methods) s[key] = methods[key]; + s.stream = stream; + return s; + }; +} + +function TransformStream() {} + +TransformStream.prototype = { + constructor: TransformStream, + point: function(x, y) { this.stream.point(x, y); }, + sphere: function() { this.stream.sphere(); }, + lineStart: function() { this.stream.lineStart(); }, + lineEnd: function() { this.stream.lineEnd(); }, + polygonStart: function() { this.stream.polygonStart(); }, + polygonEnd: function() { this.stream.polygonEnd(); } +}; + +function fit(projection, fitBounds, object) { + var clip = projection.clipExtent && projection.clipExtent(); + projection.scale(150).translate([0, 0]); + if (clip != null) projection.clipExtent(null); + geoStream(object, projection.stream(boundsStream$1)); + fitBounds(boundsStream$1.result()); + if (clip != null) projection.clipExtent(clip); + return projection; +} + +function fitExtent(projection, extent, object) { + return fit(projection, function(b) { + var w = extent[1][0] - extent[0][0], + h = extent[1][1] - extent[0][1], + k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), + x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, + y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2; + projection.scale(150 * k).translate([x, y]); + }, object); +} + +function fitSize(projection, size, object) { + return fitExtent(projection, [[0, 0], size], object); +} + +function fitWidth(projection, width, object) { + return fit(projection, function(b) { + var w = +width, + k = w / (b[1][0] - b[0][0]), + x = (w - k * (b[1][0] + b[0][0])) / 2, + y = -k * b[0][1]; + projection.scale(150 * k).translate([x, y]); + }, object); +} + +function fitHeight(projection, height, object) { + return fit(projection, function(b) { + var h = +height, + k = h / (b[1][1] - b[0][1]), + x = -k * b[0][0], + y = (h - k * (b[1][1] + b[0][1])) / 2; + projection.scale(150 * k).translate([x, y]); + }, object); +} + +var maxDepth = 16, // maximum depth of subdivision + cosMinDistance = cos(30 * radians); // cos(minimum angular distance) + +function resample(project, delta2) { + return +delta2 ? resample$1(project, delta2) : resampleNone(project); +} + +function resampleNone(project) { + return transformer({ + point: function(x, y) { + x = project(x, y); + this.stream.point(x[0], x[1]); + } + }); +} + +function resample$1(project, delta2) { + + function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) { + var dx = x1 - x0, + dy = y1 - y0, + d2 = dx * dx + dy * dy; + if (d2 > 4 * delta2 && depth--) { + var a = a0 + a1, + b = b0 + b1, + c = c0 + c1, + m = sqrt(a * a + b * b + c * c), + phi2 = asin(c /= m), + lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a), + p = project(lambda2, phi2), + x2 = p[0], + y2 = p[1], + dx2 = x2 - x0, + dy2 = y2 - y0, + dz = dy * dx2 - dx * dy2; + if (dz * dz / d2 > delta2 // perpendicular projected distance + || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end + || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance + resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream); + stream.point(x2, y2); + resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream); + } + } + } + return function(stream) { + var lambda00, x00, y00, a00, b00, c00, // first point + lambda0, x0, y0, a0, b0, c0; // previous point + + var resampleStream = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; }, + polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; } + }; + + function point(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + } + + function lineStart() { + x0 = NaN; + resampleStream.point = linePoint; + stream.lineStart(); + } + + function linePoint(lambda, phi) { + var c = cartesian([lambda, phi]), p = project(lambda, phi); + resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); + stream.point(x0, y0); + } + + function lineEnd() { + resampleStream.point = point; + stream.lineEnd(); + } + + function ringStart() { + lineStart(); + resampleStream.point = ringPoint; + resampleStream.lineEnd = ringEnd; + } + + function ringPoint(lambda, phi) { + linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; + resampleStream.point = linePoint; + } + + function ringEnd() { + resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream); + resampleStream.lineEnd = lineEnd; + lineEnd(); + } + + return resampleStream; + }; +} + +var transformRadians = transformer({ + point: function(x, y) { + this.stream.point(x * radians, y * radians); + } +}); + +function transformRotate(rotate) { + return transformer({ + point: function(x, y) { + var r = rotate(x, y); + return this.stream.point(r[0], r[1]); + } + }); +} + +function scaleTranslate(k, dx, dy, sx, sy) { + function transform(x, y) { + x *= sx; y *= sy; + return [dx + k * x, dy - k * y]; + } + transform.invert = function(x, y) { + return [(x - dx) / k * sx, (dy - y) / k * sy]; + }; + return transform; +} + +function scaleTranslateRotate(k, dx, dy, sx, sy, alpha) { + var cosAlpha = cos(alpha), + sinAlpha = sin(alpha), + a = cosAlpha * k, + b = sinAlpha * k, + ai = cosAlpha / k, + bi = sinAlpha / k, + ci = (sinAlpha * dy - cosAlpha * dx) / k, + fi = (sinAlpha * dx + cosAlpha * dy) / k; + function transform(x, y) { + x *= sx; y *= sy; + return [a * x - b * y + dx, dy - b * x - a * y]; + } + transform.invert = function(x, y) { + return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)]; + }; + return transform; +} + +function projection(project) { + return projectionMutator(function() { return project; })(); +} + +function projectionMutator(projectAt) { + var project, + k = 150, // scale + x = 480, y = 250, // translate + lambda = 0, phi = 0, // center + deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate + alpha = 0, // post-rotate angle + sx = 1, // reflectX + sy = 1, // reflectX + theta = null, preclip = clipAntimeridian, // pre-clip angle + x0 = null, y0, x1, y1, postclip = identity, // post-clip extent + delta2 = 0.5, // precision + projectResample, + projectTransform, + projectRotateTransform, + cache, + cacheStream; + + function projection(point) { + return projectRotateTransform(point[0] * radians, point[1] * radians); + } + + function invert(point) { + point = projectRotateTransform.invert(point[0], point[1]); + return point && [point[0] * degrees, point[1] * degrees]; + } + + projection.stream = function(stream) { + return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream))))); + }; + + projection.preclip = function(_) { + return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip; + }; + + projection.postclip = function(_) { + return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip; + }; + + projection.clipAngle = function(_) { + return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees; + }; + + projection.clipExtent = function(_) { + return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]]; + }; + + projection.scale = function(_) { + return arguments.length ? (k = +_, recenter()) : k; + }; + + projection.translate = function(_) { + return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y]; + }; + + projection.center = function(_) { + return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees]; + }; + + projection.rotate = function(_) { + return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees]; + }; + + projection.angle = function(_) { + return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees; + }; + + projection.reflectX = function(_) { + return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0; + }; + + projection.reflectY = function(_) { + return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0; + }; + + projection.precision = function(_) { + return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2); + }; + + projection.fitExtent = function(extent, object) { + return fitExtent(projection, extent, object); + }; + + projection.fitSize = function(size, object) { + return fitSize(projection, size, object); + }; + + projection.fitWidth = function(width, object) { + return fitWidth(projection, width, object); + }; + + projection.fitHeight = function(height, object) { + return fitHeight(projection, height, object); + }; + + function recenter() { + var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), + transform = (alpha ? scaleTranslateRotate : scaleTranslate)(k, x - center[0], y - center[1], sx, sy, alpha); + rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma); + projectTransform = compose(project, transform); + projectRotateTransform = compose(rotate, projectTransform); + projectResample = resample(projectTransform, delta2); + return reset(); + } + + function reset() { + cache = cacheStream = null; + return projection; + } + + return function() { + project = projectAt.apply(this, arguments); + projection.invert = project.invert && invert; + return recenter(); + }; +} + +function conicProjection(projectAt) { + var phi0 = 0, + phi1 = pi / 3, + m = projectionMutator(projectAt), + p = m(phi0, phi1); + + p.parallels = function(_) { + return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees]; + }; + + return p; +} + +function cylindricalEqualAreaRaw(phi0) { + var cosPhi0 = cos(phi0); + + function forward(lambda, phi) { + return [lambda * cosPhi0, sin(phi) / cosPhi0]; + } + + forward.invert = function(x, y) { + return [x / cosPhi0, asin(y * cosPhi0)]; + }; + + return forward; +} + +function conicEqualAreaRaw(y0, y1) { + var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2; + + // Are the parallels symmetrical around the Equator? + if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0); + + var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n; + + function project(x, y) { + var r = sqrt(c - 2 * n * sin(y)) / n; + return [r * sin(x *= n), r0 - r * cos(x)]; + } + + project.invert = function(x, y) { + var r0y = r0 - y, + l = atan2(x, abs(r0y)) * sign(r0y); + if (r0y * n < 0) + l -= pi * sign(x) * sign(r0y); + return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))]; + }; + + return project; +} + +function conicEqualArea() { + return conicProjection(conicEqualAreaRaw) + .scale(155.424) + .center([0, 33.6442]); +} + +function albers() { + return conicEqualArea() + .parallels([29.5, 45.5]) + .scale(1070) + .translate([480, 250]) + .rotate([96, 0]) + .center([-0.6, 38.7]); +} + +// The projections must have mutually exclusive clip regions on the sphere, +// as this will avoid emitting interleaving lines and polygons. +function multiplex(streams) { + var n = streams.length; + return { + point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); }, + sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); }, + lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); }, + lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); }, + polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); }, + polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); } + }; +} + +// A composite projection for the United States, configured by default for +// 960×500. The projection also works quite well at 960×600 if you change the +// scale to 1285 and adjust the translate accordingly. The set of standard +// parallels for each region comes from USGS, which is published here: +// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers +function albersUsa() { + var cache, + cacheStream, + lower48 = albers(), lower48Point, + alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338 + hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007 + point, pointStream = {point: function(x, y) { point = [x, y]; }}; + + function albersUsa(coordinates) { + var x = coordinates[0], y = coordinates[1]; + return point = null, + (lower48Point.point(x, y), point) + || (alaskaPoint.point(x, y), point) + || (hawaiiPoint.point(x, y), point); + } + + albersUsa.invert = function(coordinates) { + var k = lower48.scale(), + t = lower48.translate(), + x = (coordinates[0] - t[0]) / k, + y = (coordinates[1] - t[1]) / k; + return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska + : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii + : lower48).invert(coordinates); + }; + + albersUsa.stream = function(stream) { + return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]); + }; + + albersUsa.precision = function(_) { + if (!arguments.length) return lower48.precision(); + lower48.precision(_), alaska.precision(_), hawaii.precision(_); + return reset(); + }; + + albersUsa.scale = function(_) { + if (!arguments.length) return lower48.scale(); + lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_); + return albersUsa.translate(lower48.translate()); + }; + + albersUsa.translate = function(_) { + if (!arguments.length) return lower48.translate(); + var k = lower48.scale(), x = +_[0], y = +_[1]; + + lower48Point = lower48 + .translate(_) + .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]]) + .stream(pointStream); + + alaskaPoint = alaska + .translate([x - 0.307 * k, y + 0.201 * k]) + .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]]) + .stream(pointStream); + + hawaiiPoint = hawaii + .translate([x - 0.205 * k, y + 0.212 * k]) + .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]]) + .stream(pointStream); + + return reset(); + }; + + albersUsa.fitExtent = function(extent, object) { + return fitExtent(albersUsa, extent, object); + }; + + albersUsa.fitSize = function(size, object) { + return fitSize(albersUsa, size, object); + }; + + albersUsa.fitWidth = function(width, object) { + return fitWidth(albersUsa, width, object); + }; + + albersUsa.fitHeight = function(height, object) { + return fitHeight(albersUsa, height, object); + }; + + function reset() { + cache = cacheStream = null; + return albersUsa; + } + + return albersUsa.scale(1070); +} + +function azimuthalRaw(scale) { + return function(x, y) { + var cx = cos(x), + cy = cos(y), + k = scale(cx * cy); + return [ + k * cy * sin(x), + k * sin(y) + ]; + } +} + +function azimuthalInvert(angle) { + return function(x, y) { + var z = sqrt(x * x + y * y), + c = angle(z), + sc = sin(c), + cc = cos(c); + return [ + atan2(x * sc, z * cc), + asin(z && y * sc / z) + ]; + } +} + +var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) { + return sqrt(2 / (1 + cxcy)); +}); + +azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) { + return 2 * asin(z / 2); +}); + +function azimuthalEqualArea() { + return projection(azimuthalEqualAreaRaw) + .scale(124.75) + .clipAngle(180 - 1e-3); +} + +var azimuthalEquidistantRaw = azimuthalRaw(function(c) { + return (c = acos(c)) && c / sin(c); +}); + +azimuthalEquidistantRaw.invert = azimuthalInvert(function(z) { + return z; +}); + +function azimuthalEquidistant() { + return projection(azimuthalEquidistantRaw) + .scale(79.4188) + .clipAngle(180 - 1e-3); +} + +function mercatorRaw(lambda, phi) { + return [lambda, log(tan((halfPi + phi) / 2))]; +} + +mercatorRaw.invert = function(x, y) { + return [x, 2 * atan(exp(y)) - halfPi]; +}; + +function mercator() { + return mercatorProjection(mercatorRaw) + .scale(961 / tau); +} + +function mercatorProjection(project) { + var m = projection(project), + center = m.center, + scale = m.scale, + translate = m.translate, + clipExtent = m.clipExtent, + x0 = null, y0, x1, y1; // clip extent + + m.scale = function(_) { + return arguments.length ? (scale(_), reclip()) : scale(); + }; + + m.translate = function(_) { + return arguments.length ? (translate(_), reclip()) : translate(); + }; + + m.center = function(_) { + return arguments.length ? (center(_), reclip()) : center(); + }; + + m.clipExtent = function(_) { + return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]]; + }; + + function reclip() { + var k = pi * scale(), + t = m(rotation(m.rotate()).invert([0, 0])); + return clipExtent(x0 == null + ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw + ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]] + : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]); + } + + return reclip(); +} + +function tany(y) { + return tan((halfPi + y) / 2); +} + +function conicConformalRaw(y0, y1) { + var cy0 = cos(y0), + n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)), + f = cy0 * pow(tany(y0), n) / n; + + if (!n) return mercatorRaw; + + function project(x, y) { + if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; } + else { if (y > halfPi - epsilon) y = halfPi - epsilon; } + var r = f / pow(tany(y), n); + return [r * sin(n * x), f - r * cos(n * x)]; + } + + project.invert = function(x, y) { + var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy), + l = atan2(x, abs(fy)) * sign(fy); + if (fy * n < 0) + l -= pi * sign(x) * sign(fy); + return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi]; + }; + + return project; +} + +function conicConformal() { + return conicProjection(conicConformalRaw) + .scale(109.5) + .parallels([30, 30]); +} + +function equirectangularRaw(lambda, phi) { + return [lambda, phi]; +} + +equirectangularRaw.invert = equirectangularRaw; + +function equirectangular() { + return projection(equirectangularRaw) + .scale(152.63); +} + +function conicEquidistantRaw(y0, y1) { + var cy0 = cos(y0), + n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0), + g = cy0 / n + y0; + + if (abs(n) < epsilon) return equirectangularRaw; + + function project(x, y) { + var gy = g - y, nx = n * x; + return [gy * sin(nx), g - gy * cos(nx)]; + } + + project.invert = function(x, y) { + var gy = g - y, + l = atan2(x, abs(gy)) * sign(gy); + if (gy * n < 0) + l -= pi * sign(x) * sign(gy); + return [l / n, g - sign(n) * sqrt(x * x + gy * gy)]; + }; + + return project; +} + +function conicEquidistant() { + return conicProjection(conicEquidistantRaw) + .scale(131.154) + .center([0, 13.9389]); +} + +var A1 = 1.340264, + A2 = -0.081106, + A3 = 0.000893, + A4 = 0.003796, + M = sqrt(3) / 2, + iterations = 12; + +function equalEarthRaw(lambda, phi) { + var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2; + return [ + lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))), + l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) + ]; +} + +equalEarthRaw.invert = function(x, y) { + var l = y, l2 = l * l, l6 = l2 * l2 * l2; + for (var i = 0, delta, fy, fpy; i < iterations; ++i) { + fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y; + fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2); + l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2; + if (abs(delta) < epsilon2) break; + } + return [ + M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l), + asin(sin(l) / M) + ]; +}; + +function equalEarth() { + return projection(equalEarthRaw) + .scale(177.158); +} + +function gnomonicRaw(x, y) { + var cy = cos(y), k = cos(x) * cy; + return [cy * sin(x) / k, sin(y) / k]; +} + +gnomonicRaw.invert = azimuthalInvert(atan); + +function gnomonic() { + return projection(gnomonicRaw) + .scale(144.049) + .clipAngle(60); +} + +function identity$1() { + var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect + alpha = 0, ca, sa, // angle + x0 = null, y0, x1, y1, // clip extent + kx = 1, ky = 1, + transform = transformer({ + point: function(x, y) { + var p = projection([x, y]); + this.stream.point(p[0], p[1]); + } + }), + postclip = identity, + cache, + cacheStream; + + function reset() { + kx = k * sx; + ky = k * sy; + cache = cacheStream = null; + return projection; + } + + function projection (p) { + var x = p[0] * kx, y = p[1] * ky; + if (alpha) { + var t = y * ca - x * sa; + x = x * ca + y * sa; + y = t; + } + return [x + tx, y + ty]; + } + projection.invert = function(p) { + var x = p[0] - tx, y = p[1] - ty; + if (alpha) { + var t = y * ca + x * sa; + x = x * ca - y * sa; + y = t; + } + return [x / kx, y / ky]; + }; + projection.stream = function(stream) { + return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream)); + }; + projection.postclip = function(_) { + return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip; + }; + projection.clipExtent = function(_) { + return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]]; + }; + projection.scale = function(_) { + return arguments.length ? (k = +_, reset()) : k; + }; + projection.translate = function(_) { + return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty]; + }; + projection.angle = function(_) { + return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees; + }; + projection.reflectX = function(_) { + return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0; + }; + projection.reflectY = function(_) { + return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0; + }; + projection.fitExtent = function(extent, object) { + return fitExtent(projection, extent, object); + }; + projection.fitSize = function(size, object) { + return fitSize(projection, size, object); + }; + projection.fitWidth = function(width, object) { + return fitWidth(projection, width, object); + }; + projection.fitHeight = function(height, object) { + return fitHeight(projection, height, object); + }; + + return projection; +} + +function naturalEarth1Raw(lambda, phi) { + var phi2 = phi * phi, phi4 = phi2 * phi2; + return [ + lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))), + phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) + ]; +} + +naturalEarth1Raw.invert = function(x, y) { + var phi = y, i = 25, delta; + do { + var phi2 = phi * phi, phi4 = phi2 * phi2; + phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) / + (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4))); + } while (abs(delta) > epsilon && --i > 0); + return [ + x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))), + phi + ]; +}; + +function naturalEarth1() { + return projection(naturalEarth1Raw) + .scale(175.295); +} + +function orthographicRaw(x, y) { + return [cos(y) * sin(x), sin(y)]; +} + +orthographicRaw.invert = azimuthalInvert(asin); + +function orthographic() { + return projection(orthographicRaw) + .scale(249.5) + .clipAngle(90 + epsilon); +} + +function stereographicRaw(x, y) { + var cy = cos(y), k = 1 + cos(x) * cy; + return [cy * sin(x) / k, sin(y) / k]; +} + +stereographicRaw.invert = azimuthalInvert(function(z) { + return 2 * atan(z); +}); + +function stereographic() { + return projection(stereographicRaw) + .scale(250) + .clipAngle(142); +} + +function transverseMercatorRaw(lambda, phi) { + return [log(tan((halfPi + phi) / 2)), -lambda]; +} + +transverseMercatorRaw.invert = function(x, y) { + return [-y, 2 * atan(exp(x)) - halfPi]; +}; + +function transverseMercator() { + var m = mercatorProjection(transverseMercatorRaw), + center = m.center, + rotate = m.rotate; + + m.center = function(_) { + return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]); + }; + + m.rotate = function(_) { + return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]); + }; + + return rotate([0, 0, 90]) + .scale(159.155); +} + +exports.geoAlbers = albers; +exports.geoAlbersUsa = albersUsa; +exports.geoArea = area; +exports.geoAzimuthalEqualArea = azimuthalEqualArea; +exports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw; +exports.geoAzimuthalEquidistant = azimuthalEquidistant; +exports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw; +exports.geoBounds = bounds; +exports.geoCentroid = centroid; +exports.geoCircle = circle; +exports.geoClipAntimeridian = clipAntimeridian; +exports.geoClipCircle = clipCircle; +exports.geoClipExtent = extent; +exports.geoClipRectangle = clipRectangle; +exports.geoConicConformal = conicConformal; +exports.geoConicConformalRaw = conicConformalRaw; +exports.geoConicEqualArea = conicEqualArea; +exports.geoConicEqualAreaRaw = conicEqualAreaRaw; +exports.geoConicEquidistant = conicEquidistant; +exports.geoConicEquidistantRaw = conicEquidistantRaw; +exports.geoContains = contains; +exports.geoDistance = distance; +exports.geoEqualEarth = equalEarth; +exports.geoEqualEarthRaw = equalEarthRaw; +exports.geoEquirectangular = equirectangular; +exports.geoEquirectangularRaw = equirectangularRaw; +exports.geoGnomonic = gnomonic; +exports.geoGnomonicRaw = gnomonicRaw; +exports.geoGraticule = graticule; +exports.geoGraticule10 = graticule10; +exports.geoIdentity = identity$1; +exports.geoInterpolate = interpolate; +exports.geoLength = length; +exports.geoMercator = mercator; +exports.geoMercatorRaw = mercatorRaw; +exports.geoNaturalEarth1 = naturalEarth1; +exports.geoNaturalEarth1Raw = naturalEarth1Raw; +exports.geoOrthographic = orthographic; +exports.geoOrthographicRaw = orthographicRaw; +exports.geoPath = index; +exports.geoProjection = projection; +exports.geoProjectionMutator = projectionMutator; +exports.geoRotation = rotation; +exports.geoStereographic = stereographic; +exports.geoStereographicRaw = stereographicRaw; +exports.geoStream = geoStream; +exports.geoTransform = transform; +exports.geoTransverseMercator = transverseMercator; +exports.geoTransverseMercatorRaw = transverseMercatorRaw; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + +},{"d3-array":134}],142:[function(_dereq_,module,exports){ +// https://d3js.org/d3-hierarchy/ v1.1.9 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; + +function defaultSeparation(a, b) { + return a.parent === b.parent ? 1 : 2; +} + +function meanX(children) { + return children.reduce(meanXReduce, 0) / children.length; +} + +function meanXReduce(x, c) { + return x + c.x; +} + +function maxY(children) { + return 1 + children.reduce(maxYReduce, 0); +} + +function maxYReduce(y, c) { + return Math.max(y, c.y); +} + +function leafLeft(node) { + var children; + while (children = node.children) node = children[0]; + return node; +} + +function leafRight(node) { + var children; + while (children = node.children) node = children[children.length - 1]; + return node; +} + +function cluster() { + var separation = defaultSeparation, + dx = 1, + dy = 1, + nodeSize = false; + + function cluster(root) { + var previousNode, + x = 0; + + // First walk, computing the initial x & y values. + root.eachAfter(function(node) { + var children = node.children; + if (children) { + node.x = meanX(children); + node.y = maxY(children); + } else { + node.x = previousNode ? x += separation(node, previousNode) : 0; + node.y = 0; + previousNode = node; + } + }); + + var left = leafLeft(root), + right = leafRight(root), + x0 = left.x - separation(left, right) / 2, + x1 = right.x + separation(right, left) / 2; + + // Second walk, normalizing x & y to the desired size. + return root.eachAfter(nodeSize ? function(node) { + node.x = (node.x - root.x) * dx; + node.y = (root.y - node.y) * dy; + } : function(node) { + node.x = (node.x - x0) / (x1 - x0) * dx; + node.y = (1 - (root.y ? node.y / root.y : 1)) * dy; + }); + } + + cluster.separation = function(x) { + return arguments.length ? (separation = x, cluster) : separation; + }; + + cluster.size = function(x) { + return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]); + }; + + cluster.nodeSize = function(x) { + return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null); + }; + + return cluster; +} + +function count(node) { + var sum = 0, + children = node.children, + i = children && children.length; + if (!i) sum = 1; + else while (--i >= 0) sum += children[i].value; + node.value = sum; +} + +function node_count() { + return this.eachAfter(count); +} + +function node_each(callback) { + var node = this, current, next = [node], children, i, n; + do { + current = next.reverse(), next = []; + while (node = current.pop()) { + callback(node), children = node.children; + if (children) for (i = 0, n = children.length; i < n; ++i) { + next.push(children[i]); + } + } + } while (next.length); + return this; +} + +function node_eachBefore(callback) { + var node = this, nodes = [node], children, i; + while (node = nodes.pop()) { + callback(node), children = node.children; + if (children) for (i = children.length - 1; i >= 0; --i) { + nodes.push(children[i]); + } + } + return this; +} + +function node_eachAfter(callback) { + var node = this, nodes = [node], next = [], children, i, n; + while (node = nodes.pop()) { + next.push(node), children = node.children; + if (children) for (i = 0, n = children.length; i < n; ++i) { + nodes.push(children[i]); + } + } + while (node = next.pop()) { + callback(node); + } + return this; +} + +function node_sum(value) { + return this.eachAfter(function(node) { + var sum = +value(node.data) || 0, + children = node.children, + i = children && children.length; + while (--i >= 0) sum += children[i].value; + node.value = sum; + }); +} + +function node_sort(compare) { + return this.eachBefore(function(node) { + if (node.children) { + node.children.sort(compare); + } + }); +} + +function node_path(end) { + var start = this, + ancestor = leastCommonAncestor(start, end), + nodes = [start]; + while (start !== ancestor) { + start = start.parent; + nodes.push(start); + } + var k = nodes.length; + while (end !== ancestor) { + nodes.splice(k, 0, end); + end = end.parent; + } + return nodes; +} + +function leastCommonAncestor(a, b) { + if (a === b) return a; + var aNodes = a.ancestors(), + bNodes = b.ancestors(), + c = null; + a = aNodes.pop(); + b = bNodes.pop(); + while (a === b) { + c = a; + a = aNodes.pop(); + b = bNodes.pop(); + } + return c; +} + +function node_ancestors() { + var node = this, nodes = [node]; + while (node = node.parent) { + nodes.push(node); + } + return nodes; +} + +function node_descendants() { + var nodes = []; + this.each(function(node) { + nodes.push(node); + }); + return nodes; +} + +function node_leaves() { + var leaves = []; + this.eachBefore(function(node) { + if (!node.children) { + leaves.push(node); + } + }); + return leaves; +} + +function node_links() { + var root = this, links = []; + root.each(function(node) { + if (node !== root) { // Don’t include the root’s parent, if any. + links.push({source: node.parent, target: node}); + } + }); + return links; +} + +function hierarchy(data, children) { + var root = new Node(data), + valued = +data.value && (root.value = data.value), + node, + nodes = [root], + child, + childs, + i, + n; + + if (children == null) children = defaultChildren; + + while (node = nodes.pop()) { + if (valued) node.value = +node.data.value; + if ((childs = children(node.data)) && (n = childs.length)) { + node.children = new Array(n); + for (i = n - 1; i >= 0; --i) { + nodes.push(child = node.children[i] = new Node(childs[i])); + child.parent = node; + child.depth = node.depth + 1; + } + } + } + + return root.eachBefore(computeHeight); +} + +function node_copy() { + return hierarchy(this).eachBefore(copyData); +} + +function defaultChildren(d) { + return d.children; +} + +function copyData(node) { + node.data = node.data.data; +} + +function computeHeight(node) { + var height = 0; + do node.height = height; + while ((node = node.parent) && (node.height < ++height)); +} + +function Node(data) { + this.data = data; + this.depth = + this.height = 0; + this.parent = null; +} + +Node.prototype = hierarchy.prototype = { + constructor: Node, + count: node_count, + each: node_each, + eachAfter: node_eachAfter, + eachBefore: node_eachBefore, + sum: node_sum, + sort: node_sort, + path: node_path, + ancestors: node_ancestors, + descendants: node_descendants, + leaves: node_leaves, + links: node_links, + copy: node_copy +}; + +var slice = Array.prototype.slice; + +function shuffle(array) { + var m = array.length, + t, + i; + + while (m) { + i = Math.random() * m-- | 0; + t = array[m]; + array[m] = array[i]; + array[i] = t; + } + + return array; +} + +function enclose(circles) { + var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e; + + while (i < n) { + p = circles[i]; + if (e && enclosesWeak(e, p)) ++i; + else e = encloseBasis(B = extendBasis(B, p)), i = 0; + } + + return e; +} + +function extendBasis(B, p) { + var i, j; + + if (enclosesWeakAll(p, B)) return [p]; + + // If we get here then B must have at least one element. + for (i = 0; i < B.length; ++i) { + if (enclosesNot(p, B[i]) + && enclosesWeakAll(encloseBasis2(B[i], p), B)) { + return [B[i], p]; + } + } + + // If we get here then B must have at least two elements. + for (i = 0; i < B.length - 1; ++i) { + for (j = i + 1; j < B.length; ++j) { + if (enclosesNot(encloseBasis2(B[i], B[j]), p) + && enclosesNot(encloseBasis2(B[i], p), B[j]) + && enclosesNot(encloseBasis2(B[j], p), B[i]) + && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) { + return [B[i], B[j], p]; + } + } + } + + // If we get here then something is very wrong. + throw new Error; +} + +function enclosesNot(a, b) { + var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y; + return dr < 0 || dr * dr < dx * dx + dy * dy; +} + +function enclosesWeak(a, b) { + var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y; + return dr > 0 && dr * dr > dx * dx + dy * dy; +} + +function enclosesWeakAll(a, B) { + for (var i = 0; i < B.length; ++i) { + if (!enclosesWeak(a, B[i])) { + return false; + } + } + return true; +} + +function encloseBasis(B) { + switch (B.length) { + case 1: return encloseBasis1(B[0]); + case 2: return encloseBasis2(B[0], B[1]); + case 3: return encloseBasis3(B[0], B[1], B[2]); + } +} + +function encloseBasis1(a) { + return { + x: a.x, + y: a.y, + r: a.r + }; +} + +function encloseBasis2(a, b) { + var x1 = a.x, y1 = a.y, r1 = a.r, + x2 = b.x, y2 = b.y, r2 = b.r, + x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1, + l = Math.sqrt(x21 * x21 + y21 * y21); + return { + x: (x1 + x2 + x21 / l * r21) / 2, + y: (y1 + y2 + y21 / l * r21) / 2, + r: (l + r1 + r2) / 2 + }; +} + +function encloseBasis3(a, b, c) { + var x1 = a.x, y1 = a.y, r1 = a.r, + x2 = b.x, y2 = b.y, r2 = b.r, + x3 = c.x, y3 = c.y, r3 = c.r, + a2 = x1 - x2, + a3 = x1 - x3, + b2 = y1 - y2, + b3 = y1 - y3, + c2 = r2 - r1, + c3 = r3 - r1, + d1 = x1 * x1 + y1 * y1 - r1 * r1, + d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2, + d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3, + ab = a3 * b2 - a2 * b3, + xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1, + xb = (b3 * c2 - b2 * c3) / ab, + ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1, + yb = (a2 * c3 - a3 * c2) / ab, + A = xb * xb + yb * yb - 1, + B = 2 * (r1 + xa * xb + ya * yb), + C = xa * xa + ya * ya - r1 * r1, + r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B); + return { + x: x1 + xa + xb * r, + y: y1 + ya + yb * r, + r: r + }; +} + +function place(b, a, c) { + var dx = b.x - a.x, x, a2, + dy = b.y - a.y, y, b2, + d2 = dx * dx + dy * dy; + if (d2) { + a2 = a.r + c.r, a2 *= a2; + b2 = b.r + c.r, b2 *= b2; + if (a2 > b2) { + x = (d2 + b2 - a2) / (2 * d2); + y = Math.sqrt(Math.max(0, b2 / d2 - x * x)); + c.x = b.x - x * dx - y * dy; + c.y = b.y - x * dy + y * dx; + } else { + x = (d2 + a2 - b2) / (2 * d2); + y = Math.sqrt(Math.max(0, a2 / d2 - x * x)); + c.x = a.x + x * dx - y * dy; + c.y = a.y + x * dy + y * dx; + } + } else { + c.x = a.x + c.r; + c.y = a.y; + } +} + +function intersects(a, b) { + var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y; + return dr > 0 && dr * dr > dx * dx + dy * dy; +} + +function score(node) { + var a = node._, + b = node.next._, + ab = a.r + b.r, + dx = (a.x * b.r + b.x * a.r) / ab, + dy = (a.y * b.r + b.y * a.r) / ab; + return dx * dx + dy * dy; +} + +function Node$1(circle) { + this._ = circle; + this.next = null; + this.previous = null; +} + +function packEnclose(circles) { + if (!(n = circles.length)) return 0; + + var a, b, c, n, aa, ca, i, j, k, sj, sk; + + // Place the first circle. + a = circles[0], a.x = 0, a.y = 0; + if (!(n > 1)) return a.r; + + // Place the second circle. + b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0; + if (!(n > 2)) return a.r + b.r; + + // Place the third circle. + place(b, a, c = circles[2]); + + // Initialize the front-chain using the first three circles a, b and c. + a = new Node$1(a), b = new Node$1(b), c = new Node$1(c); + a.next = c.previous = b; + b.next = a.previous = c; + c.next = b.previous = a; + + // Attempt to place each remaining circle… + pack: for (i = 3; i < n; ++i) { + place(a._, b._, c = circles[i]), c = new Node$1(c); + + // Find the closest intersecting circle on the front-chain, if any. + // “Closeness” is determined by linear distance along the front-chain. + // “Ahead” or “behind” is likewise determined by linear distance. + j = b.next, k = a.previous, sj = b._.r, sk = a._.r; + do { + if (sj <= sk) { + if (intersects(j._, c._)) { + b = j, a.next = b, b.previous = a, --i; + continue pack; + } + sj += j._.r, j = j.next; + } else { + if (intersects(k._, c._)) { + a = k, a.next = b, b.previous = a, --i; + continue pack; + } + sk += k._.r, k = k.previous; + } + } while (j !== k.next); + + // Success! Insert the new circle c between a and b. + c.previous = a, c.next = b, a.next = b.previous = b = c; + + // Compute the new closest circle pair to the centroid. + aa = score(a); + while ((c = c.next) !== b) { + if ((ca = score(c)) < aa) { + a = c, aa = ca; + } + } + b = a.next; + } + + // Compute the enclosing circle of the front chain. + a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a); + + // Translate the circles to put the enclosing circle around the origin. + for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y; + + return c.r; +} + +function siblings(circles) { + packEnclose(circles); + return circles; +} + +function optional(f) { + return f == null ? null : required(f); +} + +function required(f) { + if (typeof f !== "function") throw new Error; + return f; +} + +function constantZero() { + return 0; +} + +function constant(x) { + return function() { + return x; + }; +} + +function defaultRadius(d) { + return Math.sqrt(d.value); +} + +function index() { + var radius = null, + dx = 1, + dy = 1, + padding = constantZero; + + function pack(root) { + root.x = dx / 2, root.y = dy / 2; + if (radius) { + root.eachBefore(radiusLeaf(radius)) + .eachAfter(packChildren(padding, 0.5)) + .eachBefore(translateChild(1)); + } else { + root.eachBefore(radiusLeaf(defaultRadius)) + .eachAfter(packChildren(constantZero, 1)) + .eachAfter(packChildren(padding, root.r / Math.min(dx, dy))) + .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r))); + } + return root; + } + + pack.radius = function(x) { + return arguments.length ? (radius = optional(x), pack) : radius; + }; + + pack.size = function(x) { + return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy]; + }; + + pack.padding = function(x) { + return arguments.length ? (padding = typeof x === "function" ? x : constant(+x), pack) : padding; + }; + + return pack; +} + +function radiusLeaf(radius) { + return function(node) { + if (!node.children) { + node.r = Math.max(0, +radius(node) || 0); + } + }; +} + +function packChildren(padding, k) { + return function(node) { + if (children = node.children) { + var children, + i, + n = children.length, + r = padding(node) * k || 0, + e; + + if (r) for (i = 0; i < n; ++i) children[i].r += r; + e = packEnclose(children); + if (r) for (i = 0; i < n; ++i) children[i].r -= r; + node.r = e + r; + } + }; +} + +function translateChild(k) { + return function(node) { + var parent = node.parent; + node.r *= k; + if (parent) { + node.x = parent.x + k * node.x; + node.y = parent.y + k * node.y; + } + }; +} + +function roundNode(node) { + node.x0 = Math.round(node.x0); + node.y0 = Math.round(node.y0); + node.x1 = Math.round(node.x1); + node.y1 = Math.round(node.y1); +} + +function treemapDice(parent, x0, y0, x1, y1) { + var nodes = parent.children, + node, + i = -1, + n = nodes.length, + k = parent.value && (x1 - x0) / parent.value; + + while (++i < n) { + node = nodes[i], node.y0 = y0, node.y1 = y1; + node.x0 = x0, node.x1 = x0 += node.value * k; + } +} + +function partition() { + var dx = 1, + dy = 1, + padding = 0, + round = false; + + function partition(root) { + var n = root.height + 1; + root.x0 = + root.y0 = padding; + root.x1 = dx; + root.y1 = dy / n; + root.eachBefore(positionNode(dy, n)); + if (round) root.eachBefore(roundNode); + return root; + } + + function positionNode(dy, n) { + return function(node) { + if (node.children) { + treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n); + } + var x0 = node.x0, + y0 = node.y0, + x1 = node.x1 - padding, + y1 = node.y1 - padding; + if (x1 < x0) x0 = x1 = (x0 + x1) / 2; + if (y1 < y0) y0 = y1 = (y0 + y1) / 2; + node.x0 = x0; + node.y0 = y0; + node.x1 = x1; + node.y1 = y1; + }; + } + + partition.round = function(x) { + return arguments.length ? (round = !!x, partition) : round; + }; + + partition.size = function(x) { + return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy]; + }; + + partition.padding = function(x) { + return arguments.length ? (padding = +x, partition) : padding; + }; + + return partition; +} + +var keyPrefix = "$", // Protect against keys like “__proto__”. + preroot = {depth: -1}, + ambiguous = {}; + +function defaultId(d) { + return d.id; +} + +function defaultParentId(d) { + return d.parentId; +} + +function stratify() { + var id = defaultId, + parentId = defaultParentId; + + function stratify(data) { + var d, + i, + n = data.length, + root, + parent, + node, + nodes = new Array(n), + nodeId, + nodeKey, + nodeByKey = {}; + + for (i = 0; i < n; ++i) { + d = data[i], node = nodes[i] = new Node(d); + if ((nodeId = id(d, i, data)) != null && (nodeId += "")) { + nodeKey = keyPrefix + (node.id = nodeId); + nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node; + } + } + + for (i = 0; i < n; ++i) { + node = nodes[i], nodeId = parentId(data[i], i, data); + if (nodeId == null || !(nodeId += "")) { + if (root) throw new Error("multiple roots"); + root = node; + } else { + parent = nodeByKey[keyPrefix + nodeId]; + if (!parent) throw new Error("missing: " + nodeId); + if (parent === ambiguous) throw new Error("ambiguous: " + nodeId); + if (parent.children) parent.children.push(node); + else parent.children = [node]; + node.parent = parent; + } + } + + if (!root) throw new Error("no root"); + root.parent = preroot; + root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight); + root.parent = null; + if (n > 0) throw new Error("cycle"); + + return root; + } + + stratify.id = function(x) { + return arguments.length ? (id = required(x), stratify) : id; + }; + + stratify.parentId = function(x) { + return arguments.length ? (parentId = required(x), stratify) : parentId; + }; + + return stratify; +} + +function defaultSeparation$1(a, b) { + return a.parent === b.parent ? 1 : 2; +} + +// function radialSeparation(a, b) { +// return (a.parent === b.parent ? 1 : 2) / a.depth; +// } + +// This function is used to traverse the left contour of a subtree (or +// subforest). It returns the successor of v on this contour. This successor is +// either given by the leftmost child of v or by the thread of v. The function +// returns null if and only if v is on the highest level of its subtree. +function nextLeft(v) { + var children = v.children; + return children ? children[0] : v.t; +} + +// This function works analogously to nextLeft. +function nextRight(v) { + var children = v.children; + return children ? children[children.length - 1] : v.t; +} + +// Shifts the current subtree rooted at w+. This is done by increasing +// prelim(w+) and mod(w+) by shift. +function moveSubtree(wm, wp, shift) { + var change = shift / (wp.i - wm.i); + wp.c -= change; + wp.s += shift; + wm.c += change; + wp.z += shift; + wp.m += shift; +} + +// All other shifts, applied to the smaller subtrees between w- and w+, are +// performed by this function. To prepare the shifts, we have to adjust +// change(w+), shift(w+), and change(w-). +function executeShifts(v) { + var shift = 0, + change = 0, + children = v.children, + i = children.length, + w; + while (--i >= 0) { + w = children[i]; + w.z += shift; + w.m += shift; + shift += w.s + (change += w.c); + } +} + +// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise, +// returns the specified (default) ancestor. +function nextAncestor(vim, v, ancestor) { + return vim.a.parent === v.parent ? vim.a : ancestor; +} + +function TreeNode(node, i) { + this._ = node; + this.parent = null; + this.children = null; + this.A = null; // default ancestor + this.a = this; // ancestor + this.z = 0; // prelim + this.m = 0; // mod + this.c = 0; // change + this.s = 0; // shift + this.t = null; // thread + this.i = i; // number +} + +TreeNode.prototype = Object.create(Node.prototype); + +function treeRoot(root) { + var tree = new TreeNode(root, 0), + node, + nodes = [tree], + child, + children, + i, + n; + + while (node = nodes.pop()) { + if (children = node._.children) { + node.children = new Array(n = children.length); + for (i = n - 1; i >= 0; --i) { + nodes.push(child = node.children[i] = new TreeNode(children[i], i)); + child.parent = node; + } + } + } + + (tree.parent = new TreeNode(null, 0)).children = [tree]; + return tree; +} + +// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm +function tree() { + var separation = defaultSeparation$1, + dx = 1, + dy = 1, + nodeSize = null; + + function tree(root) { + var t = treeRoot(root); + + // Compute the layout using Buchheim et al.’s algorithm. + t.eachAfter(firstWalk), t.parent.m = -t.z; + t.eachBefore(secondWalk); + + // If a fixed node size is specified, scale x and y. + if (nodeSize) root.eachBefore(sizeNode); + + // If a fixed tree size is specified, scale x and y based on the extent. + // Compute the left-most, right-most, and depth-most nodes for extents. + else { + var left = root, + right = root, + bottom = root; + root.eachBefore(function(node) { + if (node.x < left.x) left = node; + if (node.x > right.x) right = node; + if (node.depth > bottom.depth) bottom = node; + }); + var s = left === right ? 1 : separation(left, right) / 2, + tx = s - left.x, + kx = dx / (right.x + s + tx), + ky = dy / (bottom.depth || 1); + root.eachBefore(function(node) { + node.x = (node.x + tx) * kx; + node.y = node.depth * ky; + }); + } + + return root; + } + + // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is + // applied recursively to the children of v, as well as the function + // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the + // node v is placed to the midpoint of its outermost children. + function firstWalk(v) { + var children = v.children, + siblings = v.parent.children, + w = v.i ? siblings[v.i - 1] : null; + if (children) { + executeShifts(v); + var midpoint = (children[0].z + children[children.length - 1].z) / 2; + if (w) { + v.z = w.z + separation(v._, w._); + v.m = v.z - midpoint; + } else { + v.z = midpoint; + } + } else if (w) { + v.z = w.z + separation(v._, w._); + } + v.parent.A = apportion(v, w, v.parent.A || siblings[0]); + } + + // Computes all real x-coordinates by summing up the modifiers recursively. + function secondWalk(v) { + v._.x = v.z + v.parent.m; + v.m += v.parent.m; + } + + // The core of the algorithm. Here, a new subtree is combined with the + // previous subtrees. Threads are used to traverse the inside and outside + // contours of the left and right subtree up to the highest common level. The + // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the + // superscript o means outside and i means inside, the subscript - means left + // subtree and + means right subtree. For summing up the modifiers along the + // contour, we use respective variables si+, si-, so-, and so+. Whenever two + // nodes of the inside contours conflict, we compute the left one of the + // greatest uncommon ancestors using the function ANCESTOR and call MOVE + // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees. + // Finally, we add a new thread (if necessary). + function apportion(v, w, ancestor) { + if (w) { + var vip = v, + vop = v, + vim = w, + vom = vip.parent.children[0], + sip = vip.m, + sop = vop.m, + sim = vim.m, + som = vom.m, + shift; + while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) { + vom = nextLeft(vom); + vop = nextRight(vop); + vop.a = v; + shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); + if (shift > 0) { + moveSubtree(nextAncestor(vim, v, ancestor), v, shift); + sip += shift; + sop += shift; + } + sim += vim.m; + sip += vip.m; + som += vom.m; + sop += vop.m; + } + if (vim && !nextRight(vop)) { + vop.t = vim; + vop.m += sim - sop; + } + if (vip && !nextLeft(vom)) { + vom.t = vip; + vom.m += sip - som; + ancestor = v; + } + } + return ancestor; + } + + function sizeNode(node) { + node.x *= dx; + node.y = node.depth * dy; + } + + tree.separation = function(x) { + return arguments.length ? (separation = x, tree) : separation; + }; + + tree.size = function(x) { + return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]); + }; + + tree.nodeSize = function(x) { + return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null); + }; + + return tree; +} + +function treemapSlice(parent, x0, y0, x1, y1) { + var nodes = parent.children, + node, + i = -1, + n = nodes.length, + k = parent.value && (y1 - y0) / parent.value; + + while (++i < n) { + node = nodes[i], node.x0 = x0, node.x1 = x1; + node.y0 = y0, node.y1 = y0 += node.value * k; + } +} + +var phi = (1 + Math.sqrt(5)) / 2; + +function squarifyRatio(ratio, parent, x0, y0, x1, y1) { + var rows = [], + nodes = parent.children, + row, + nodeValue, + i0 = 0, + i1 = 0, + n = nodes.length, + dx, dy, + value = parent.value, + sumValue, + minValue, + maxValue, + newRatio, + minRatio, + alpha, + beta; + + while (i0 < n) { + dx = x1 - x0, dy = y1 - y0; + + // Find the next non-empty node. + do sumValue = nodes[i1++].value; while (!sumValue && i1 < n); + minValue = maxValue = sumValue; + alpha = Math.max(dy / dx, dx / dy) / (value * ratio); + beta = sumValue * sumValue * alpha; + minRatio = Math.max(maxValue / beta, beta / minValue); + + // Keep adding nodes while the aspect ratio maintains or improves. + for (; i1 < n; ++i1) { + sumValue += nodeValue = nodes[i1].value; + if (nodeValue < minValue) minValue = nodeValue; + if (nodeValue > maxValue) maxValue = nodeValue; + beta = sumValue * sumValue * alpha; + newRatio = Math.max(maxValue / beta, beta / minValue); + if (newRatio > minRatio) { sumValue -= nodeValue; break; } + minRatio = newRatio; + } + + // Position and record the row orientation. + rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)}); + if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1); + else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1); + value -= sumValue, i0 = i1; + } + + return rows; +} + +var squarify = (function custom(ratio) { + + function squarify(parent, x0, y0, x1, y1) { + squarifyRatio(ratio, parent, x0, y0, x1, y1); + } + + squarify.ratio = function(x) { + return custom((x = +x) > 1 ? x : 1); + }; + + return squarify; +})(phi); + +function index$1() { + var tile = squarify, + round = false, + dx = 1, + dy = 1, + paddingStack = [0], + paddingInner = constantZero, + paddingTop = constantZero, + paddingRight = constantZero, + paddingBottom = constantZero, + paddingLeft = constantZero; + + function treemap(root) { + root.x0 = + root.y0 = 0; + root.x1 = dx; + root.y1 = dy; + root.eachBefore(positionNode); + paddingStack = [0]; + if (round) root.eachBefore(roundNode); + return root; + } + + function positionNode(node) { + var p = paddingStack[node.depth], + x0 = node.x0 + p, + y0 = node.y0 + p, + x1 = node.x1 - p, + y1 = node.y1 - p; + if (x1 < x0) x0 = x1 = (x0 + x1) / 2; + if (y1 < y0) y0 = y1 = (y0 + y1) / 2; + node.x0 = x0; + node.y0 = y0; + node.x1 = x1; + node.y1 = y1; + if (node.children) { + p = paddingStack[node.depth + 1] = paddingInner(node) / 2; + x0 += paddingLeft(node) - p; + y0 += paddingTop(node) - p; + x1 -= paddingRight(node) - p; + y1 -= paddingBottom(node) - p; + if (x1 < x0) x0 = x1 = (x0 + x1) / 2; + if (y1 < y0) y0 = y1 = (y0 + y1) / 2; + tile(node, x0, y0, x1, y1); + } + } + + treemap.round = function(x) { + return arguments.length ? (round = !!x, treemap) : round; + }; + + treemap.size = function(x) { + return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy]; + }; + + treemap.tile = function(x) { + return arguments.length ? (tile = required(x), treemap) : tile; + }; + + treemap.padding = function(x) { + return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner(); + }; + + treemap.paddingInner = function(x) { + return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap) : paddingInner; + }; + + treemap.paddingOuter = function(x) { + return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop(); + }; + + treemap.paddingTop = function(x) { + return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap) : paddingTop; + }; + + treemap.paddingRight = function(x) { + return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap) : paddingRight; + }; + + treemap.paddingBottom = function(x) { + return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap) : paddingBottom; + }; + + treemap.paddingLeft = function(x) { + return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap) : paddingLeft; + }; + + return treemap; +} + +function binary(parent, x0, y0, x1, y1) { + var nodes = parent.children, + i, n = nodes.length, + sum, sums = new Array(n + 1); + + for (sums[0] = sum = i = 0; i < n; ++i) { + sums[i + 1] = sum += nodes[i].value; + } + + partition(0, n, parent.value, x0, y0, x1, y1); + + function partition(i, j, value, x0, y0, x1, y1) { + if (i >= j - 1) { + var node = nodes[i]; + node.x0 = x0, node.y0 = y0; + node.x1 = x1, node.y1 = y1; + return; + } + + var valueOffset = sums[i], + valueTarget = (value / 2) + valueOffset, + k = i + 1, + hi = j - 1; + + while (k < hi) { + var mid = k + hi >>> 1; + if (sums[mid] < valueTarget) k = mid + 1; + else hi = mid; + } + + if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k; + + var valueLeft = sums[k] - valueOffset, + valueRight = value - valueLeft; + + if ((x1 - x0) > (y1 - y0)) { + var xk = (x0 * valueRight + x1 * valueLeft) / value; + partition(i, k, valueLeft, x0, y0, xk, y1); + partition(k, j, valueRight, xk, y0, x1, y1); + } else { + var yk = (y0 * valueRight + y1 * valueLeft) / value; + partition(i, k, valueLeft, x0, y0, x1, yk); + partition(k, j, valueRight, x0, yk, x1, y1); + } + } +} + +function sliceDice(parent, x0, y0, x1, y1) { + (parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1); +} + +var resquarify = (function custom(ratio) { + + function resquarify(parent, x0, y0, x1, y1) { + if ((rows = parent._squarify) && (rows.ratio === ratio)) { + var rows, + row, + nodes, + i, + j = -1, + n, + m = rows.length, + value = parent.value; + + while (++j < m) { + row = rows[j], nodes = row.children; + for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value; + if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value); + else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1); + value -= row.value; + } + } else { + parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1); + rows.ratio = ratio; + } + } + + resquarify.ratio = function(x) { + return custom((x = +x) > 1 ? x : 1); + }; + + return resquarify; +})(phi); + +exports.cluster = cluster; +exports.hierarchy = hierarchy; +exports.pack = index; +exports.packEnclose = enclose; +exports.packSiblings = siblings; +exports.partition = partition; +exports.stratify = stratify; +exports.tree = tree; +exports.treemap = index$1; +exports.treemapBinary = binary; +exports.treemapDice = treemapDice; +exports.treemapResquarify = resquarify; +exports.treemapSlice = treemapSlice; +exports.treemapSliceDice = sliceDice; +exports.treemapSquarify = squarify; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{}],143:[function(_dereq_,module,exports){ +// https://d3js.org/d3-interpolate/ v1.4.0 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-color')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); +}(this, function (exports, d3Color) { 'use strict'; + +function basis(t1, v0, v1, v2, v3) { + var t2 = t1 * t1, t3 = t2 * t1; + return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + + (4 - 6 * t2 + 3 * t3) * v1 + + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + + t3 * v3) / 6; +} + +function basis$1(values) { + var n = values.length - 1; + return function(t) { + var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), + v1 = values[i], + v2 = values[i + 1], + v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, + v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} + +function basisClosed(values) { + var n = values.length; + return function(t) { + var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), + v0 = values[(i + n - 1) % n], + v1 = values[i % n], + v2 = values[(i + 1) % n], + v3 = values[(i + 2) % n]; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} + +function constant(x) { + return function() { + return x; + }; +} + +function linear(a, d) { + return function(t) { + return a + t * d; + }; +} + +function exponential(a, b, y) { + return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { + return Math.pow(a + t * b, y); + }; +} + +function hue(a, b) { + var d = b - a; + return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); +} + +function gamma(y) { + return (y = +y) === 1 ? nogamma : function(a, b) { + return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a); + }; +} + +function nogamma(a, b) { + var d = b - a; + return d ? linear(a, d) : constant(isNaN(a) ? b : a); +} + +var rgb = (function rgbGamma(y) { + var color = gamma(y); + + function rgb(start, end) { + var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r), + g = color(start.g, end.g), + b = color(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + + rgb.gamma = rgbGamma; + + return rgb; +})(1); + +function rgbSpline(spline) { + return function(colors) { + var n = colors.length, + r = new Array(n), + g = new Array(n), + b = new Array(n), + i, color; + for (i = 0; i < n; ++i) { + color = d3Color.rgb(colors[i]); + r[i] = color.r || 0; + g[i] = color.g || 0; + b[i] = color.b || 0; + } + r = spline(r); + g = spline(g); + b = spline(b); + color.opacity = 1; + return function(t) { + color.r = r(t); + color.g = g(t); + color.b = b(t); + return color + ""; + }; + }; +} + +var rgbBasis = rgbSpline(basis$1); +var rgbBasisClosed = rgbSpline(basisClosed); + +function numberArray(a, b) { + if (!b) b = []; + var n = a ? Math.min(b.length, a.length) : 0, + c = b.slice(), + i; + return function(t) { + for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; + return c; + }; +} + +function isNumberArray(x) { + return ArrayBuffer.isView(x) && !(x instanceof DataView); +} + +function array(a, b) { + return (isNumberArray(b) ? numberArray : genericArray)(a, b); +} + +function genericArray(a, b) { + var nb = b ? b.length : 0, + na = a ? Math.min(nb, a.length) : 0, + x = new Array(na), + c = new Array(nb), + i; + + for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); + for (; i < nb; ++i) c[i] = b[i]; + + return function(t) { + for (i = 0; i < na; ++i) c[i] = x[i](t); + return c; + }; +} + +function date(a, b) { + var d = new Date; + return a = +a, b = +b, function(t) { + return d.setTime(a * (1 - t) + b * t), d; + }; +} + +function number(a, b) { + return a = +a, b = +b, function(t) { + return a * (1 - t) + b * t; + }; +} + +function object(a, b) { + var i = {}, + c = {}, + k; + + if (a === null || typeof a !== "object") a = {}; + if (b === null || typeof b !== "object") b = {}; + + for (k in b) { + if (k in a) { + i[k] = value(a[k], b[k]); + } else { + c[k] = b[k]; + } + } + + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; +} + +var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, + reB = new RegExp(reA.source, "g"); + +function zero(b) { + return function() { + return b; + }; +} + +function one(b) { + return function(t) { + return b(t) + ""; + }; +} + +function string(a, b) { + var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b + am, // current match in a + bm, // current match in b + bs, // string preceding current number in b, if any + i = -1, // index in s + s = [], // string constants and placeholders + q = []; // number interpolators + + // Coerce inputs to strings. + a = a + "", b = b + ""; + + // Interpolate pairs of numbers in a & b. + while ((am = reA.exec(a)) + && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { // a string precedes the next number in b + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match + if (s[i]) s[i] += bm; // coalesce with previous string + else s[++i] = bm; + } else { // interpolate non-matching numbers + s[++i] = null; + q.push({i: i, x: number(am, bm)}); + } + bi = reB.lastIndex; + } + + // Add remains of b. + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + + // Special optimization for only a single match. + // Otherwise, interpolate each of the numbers and rejoin the string. + return s.length < 2 ? (q[0] + ? one(q[0].x) + : zero(b)) + : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); +} + +function value(a, b) { + var t = typeof b, c; + return b == null || t === "boolean" ? constant(b) + : (t === "number" ? number + : t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb) : string) + : b instanceof d3Color.color ? rgb + : b instanceof Date ? date + : isNumberArray(b) ? numberArray + : Array.isArray(b) ? genericArray + : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object + : number)(a, b); +} + +function discrete(range) { + var n = range.length; + return function(t) { + return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; + }; +} + +function hue$1(a, b) { + var i = hue(+a, +b); + return function(t) { + var x = i(t); + return x - 360 * Math.floor(x / 360); + }; +} + +function round(a, b) { + return a = +a, b = +b, function(t) { + return Math.round(a * (1 - t) + b * t); + }; +} + +var degrees = 180 / Math.PI; + +var identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; + +function decompose(a, b, c, d, e, f) { + var scaleX, scaleY, skewX; + if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; + if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; + if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; + if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; + return { + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * degrees, + skewX: Math.atan(skewX) * degrees, + scaleX: scaleX, + scaleY: scaleY + }; +} + +var cssNode, + cssRoot, + cssView, + svgNode; + +function parseCss(value) { + if (value === "none") return identity; + if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; + cssNode.style.transform = value; + value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); + cssRoot.removeChild(cssNode); + value = value.slice(7, -1).split(","); + return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); +} + +function parseSvg(value) { + if (value == null) return identity; + if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); + svgNode.setAttribute("transform", value); + if (!(value = svgNode.transform.baseVal.consolidate())) return identity; + value = value.matrix; + return decompose(value.a, value.b, value.c, value.d, value.e, value.f); +} + +function interpolateTransform(parse, pxComma, pxParen, degParen) { + + function pop(s) { + return s.length ? s.pop() + " " : ""; + } + + function translate(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push("translate(", null, pxComma, null, pxParen); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb || yb) { + s.push("translate(" + xb + pxComma + yb + pxParen); + } + } + + function rotate(a, b, s, q) { + if (a !== b) { + if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path + q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "rotate(" + b + degParen); + } + } + + function skewX(a, b, s, q) { + if (a !== b) { + q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "skewX(" + b + degParen); + } + } + + function scale(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push(pop(s) + "scale(", null, ",", null, ")"); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb !== 1 || yb !== 1) { + s.push(pop(s) + "scale(" + xb + "," + yb + ")"); + } + } + + return function(a, b) { + var s = [], // string constants and placeholders + q = []; // number interpolators + a = parse(a), b = parse(b); + translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); + rotate(a.rotate, b.rotate, s, q); + skewX(a.skewX, b.skewX, s, q); + scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); + a = b = null; // gc + return function(t) { + var i = -1, n = q.length, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + }; +} + +var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); +var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); + +var rho = Math.SQRT2, + rho2 = 2, + rho4 = 4, + epsilon2 = 1e-12; + +function cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; +} + +function sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; +} + +function tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); +} + +// p0 = [ux0, uy0, w0] +// p1 = [ux1, uy1, w1] +function zoom(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], + ux1 = p1[0], uy1 = p1[1], w1 = p1[2], + dx = ux1 - ux0, + dy = uy1 - uy0, + d2 = dx * dx + dy * dy, + i, + S; + + // Special case for u0 ≅ u1. + if (d2 < epsilon2) { + S = Math.log(w1 / w0) / rho; + i = function(t) { + return [ + ux0 + t * dx, + uy0 + t * dy, + w0 * Math.exp(rho * t * S) + ]; + }; + } + + // General case. + else { + var d1 = Math.sqrt(d2), + b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), + b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), + r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), + r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); + S = (r1 - r0) / rho; + i = function(t) { + var s = t * S, + coshr0 = cosh(r0), + u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); + return [ + ux0 + u * dx, + uy0 + u * dy, + w0 * coshr0 / cosh(rho * s + r0) + ]; + }; + } + + i.duration = S * 1000; + + return i; +} + +function hsl(hue) { + return function(start, end) { + var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h), + s = nogamma(start.s, end.s), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } +} + +var hsl$1 = hsl(hue); +var hslLong = hsl(nogamma); + +function lab(start, end) { + var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l), + a = nogamma(start.a, end.a), + b = nogamma(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.l = l(t); + start.a = a(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; +} + +function hcl(hue) { + return function(start, end) { + var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h), + c = nogamma(start.c, end.c), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.c = c(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } +} + +var hcl$1 = hcl(hue); +var hclLong = hcl(nogamma); + +function cubehelix(hue) { + return (function cubehelixGamma(y) { + y = +y; + + function cubehelix(start, end) { + var h = hue((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h), + s = nogamma(start.s, end.s), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(Math.pow(t, y)); + start.opacity = opacity(t); + return start + ""; + }; + } + + cubehelix.gamma = cubehelixGamma; + + return cubehelix; + })(1); +} + +var cubehelix$1 = cubehelix(hue); +var cubehelixLong = cubehelix(nogamma); + +function piecewise(interpolate, values) { + var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); + while (i < n) I[i] = interpolate(v, v = values[++i]); + return function(t) { + var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); + return I[i](t - i); + }; +} + +function quantize(interpolator, n) { + var samples = new Array(n); + for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); + return samples; +} + +exports.interpolate = value; +exports.interpolateArray = array; +exports.interpolateBasis = basis$1; +exports.interpolateBasisClosed = basisClosed; +exports.interpolateCubehelix = cubehelix$1; +exports.interpolateCubehelixLong = cubehelixLong; +exports.interpolateDate = date; +exports.interpolateDiscrete = discrete; +exports.interpolateHcl = hcl$1; +exports.interpolateHclLong = hclLong; +exports.interpolateHsl = hsl$1; +exports.interpolateHslLong = hslLong; +exports.interpolateHue = hue$1; +exports.interpolateLab = lab; +exports.interpolateNumber = number; +exports.interpolateNumberArray = numberArray; +exports.interpolateObject = object; +exports.interpolateRgb = rgb; +exports.interpolateRgbBasis = rgbBasis; +exports.interpolateRgbBasisClosed = rgbBasisClosed; +exports.interpolateRound = round; +exports.interpolateString = string; +exports.interpolateTransformCss = interpolateTransformCss; +exports.interpolateTransformSvg = interpolateTransformSvg; +exports.interpolateZoom = zoom; +exports.piecewise = piecewise; +exports.quantize = quantize; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{"d3-color":136}],144:[function(_dereq_,module,exports){ +// https://d3js.org/d3-path/ v1.0.9 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; + +var pi = Math.PI, + tau = 2 * pi, + epsilon = 1e-6, + tauEpsilon = tau - epsilon; + +function Path() { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null; // end of current subpath + this._ = ""; +} + +function path() { + return new Path; +} + +Path.prototype = path.prototype = { + constructor: Path, + moveTo: function(x, y) { + this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y); + }, + closePath: function() { + if (this._x1 !== null) { + this._x1 = this._x0, this._y1 = this._y0; + this._ += "Z"; + } + }, + lineTo: function(x, y) { + this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y); + }, + quadraticCurveTo: function(x1, y1, x, y) { + this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y); + }, + bezierCurveTo: function(x1, y1, x2, y2, x, y) { + this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y); + }, + arcTo: function(x1, y1, x2, y2, r) { + x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; + var x0 = this._x1, + y0 = this._y1, + x21 = x2 - x1, + y21 = y2 - y1, + x01 = x0 - x1, + y01 = y0 - y1, + l01_2 = x01 * x01 + y01 * y01; + + // Is the radius negative? Error. + if (r < 0) throw new Error("negative radius: " + r); + + // Is this path empty? Move to (x1,y1). + if (this._x1 === null) { + this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); + } + + // Or, is (x1,y1) coincident with (x0,y0)? Do nothing. + else if (!(l01_2 > epsilon)); + + // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear? + // Equivalently, is (x1,y1) coincident with (x2,y2)? + // Or, is the radius zero? Line to (x1,y1). + else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { + this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); + } + + // Otherwise, draw an arc! + else { + var x20 = x2 - x0, + y20 = y2 - y0, + l21_2 = x21 * x21 + y21 * y21, + l20_2 = x20 * x20 + y20 * y20, + l21 = Math.sqrt(l21_2), + l01 = Math.sqrt(l01_2), + l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), + t01 = l / l01, + t21 = l / l21; + + // If the start tangent is not coincident with (x0,y0), line to. + if (Math.abs(t01 - 1) > epsilon) { + this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); + } + + this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); + } + }, + arc: function(x, y, r, a0, a1, ccw) { + x = +x, y = +y, r = +r, ccw = !!ccw; + var dx = r * Math.cos(a0), + dy = r * Math.sin(a0), + x0 = x + dx, + y0 = y + dy, + cw = 1 ^ ccw, + da = ccw ? a0 - a1 : a1 - a0; + + // Is the radius negative? Error. + if (r < 0) throw new Error("negative radius: " + r); + + // Is this path empty? Move to (x0,y0). + if (this._x1 === null) { + this._ += "M" + x0 + "," + y0; + } + + // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0). + else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { + this._ += "L" + x0 + "," + y0; + } + + // Is this arc empty? We’re done. + if (!r) return; + + // Does the angle go the wrong way? Flip the direction. + if (da < 0) da = da % tau + tau; + + // Is this a complete circle? Draw two arcs to complete the circle. + if (da > tauEpsilon) { + this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); + } + + // Is this arc non-empty? Draw an arc! + else if (da > epsilon) { + this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)); + } + }, + rect: function(x, y, w, h) { + this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z"; + }, + toString: function() { + return this._; + } +}; + +exports.path = path; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{}],145:[function(_dereq_,module,exports){ +// https://d3js.org/d3-quadtree/ v1.0.7 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; + +function tree_add(d) { + var x = +this._x.call(null, d), + y = +this._y.call(null, d); + return add(this.cover(x, y), x, y, d); +} + +function add(tree, x, y, d) { + if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points + + var parent, + node = tree._root, + leaf = {data: d}, + x0 = tree._x0, + y0 = tree._y0, + x1 = tree._x1, + y1 = tree._y1, + xm, + ym, + xp, + yp, + right, + bottom, + i, + j; + + // If the tree is empty, initialize the root as a leaf. + if (!node) return tree._root = leaf, tree; + + // Find the existing leaf for the new point, or add it. + while (node.length) { + if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; + if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; + if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree; + } + + // Is the new point is exactly coincident with the existing point? + xp = +tree._x.call(null, node.data); + yp = +tree._y.call(null, node.data); + if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree; + + // Otherwise, split the leaf node until the old and new point are separated. + do { + parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4); + if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; + if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; + } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm))); + return parent[j] = node, parent[i] = leaf, tree; +} + +function addAll(data) { + var d, i, n = data.length, + x, + y, + xz = new Array(n), + yz = new Array(n), + x0 = Infinity, + y0 = Infinity, + x1 = -Infinity, + y1 = -Infinity; + + // Compute the points and their extent. + for (i = 0; i < n; ++i) { + if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue; + xz[i] = x; + yz[i] = y; + if (x < x0) x0 = x; + if (x > x1) x1 = x; + if (y < y0) y0 = y; + if (y > y1) y1 = y; + } + + // If there were no (valid) points, abort. + if (x0 > x1 || y0 > y1) return this; + + // Expand the tree to cover the new points. + this.cover(x0, y0).cover(x1, y1); + + // Add the new points. + for (i = 0; i < n; ++i) { + add(this, xz[i], yz[i], data[i]); + } + + return this; +} + +function tree_cover(x, y) { + if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points + + var x0 = this._x0, + y0 = this._y0, + x1 = this._x1, + y1 = this._y1; + + // If the quadtree has no extent, initialize them. + // Integer extent are necessary so that if we later double the extent, + // the existing quadrant boundaries don’t change due to floating point error! + if (isNaN(x0)) { + x1 = (x0 = Math.floor(x)) + 1; + y1 = (y0 = Math.floor(y)) + 1; + } + + // Otherwise, double repeatedly to cover. + else { + var z = x1 - x0, + node = this._root, + parent, + i; + + while (x0 > x || x >= x1 || y0 > y || y >= y1) { + i = (y < y0) << 1 | (x < x0); + parent = new Array(4), parent[i] = node, node = parent, z *= 2; + switch (i) { + case 0: x1 = x0 + z, y1 = y0 + z; break; + case 1: x0 = x1 - z, y1 = y0 + z; break; + case 2: x1 = x0 + z, y0 = y1 - z; break; + case 3: x0 = x1 - z, y0 = y1 - z; break; + } + } + + if (this._root && this._root.length) this._root = node; + } + + this._x0 = x0; + this._y0 = y0; + this._x1 = x1; + this._y1 = y1; + return this; +} + +function tree_data() { + var data = []; + this.visit(function(node) { + if (!node.length) do data.push(node.data); while (node = node.next) + }); + return data; +} + +function tree_extent(_) { + return arguments.length + ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1]) + : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]]; +} + +function Quad(node, x0, y0, x1, y1) { + this.node = node; + this.x0 = x0; + this.y0 = y0; + this.x1 = x1; + this.y1 = y1; +} + +function tree_find(x, y, radius) { + var data, + x0 = this._x0, + y0 = this._y0, + x1, + y1, + x2, + y2, + x3 = this._x1, + y3 = this._y1, + quads = [], + node = this._root, + q, + i; + + if (node) quads.push(new Quad(node, x0, y0, x3, y3)); + if (radius == null) radius = Infinity; + else { + x0 = x - radius, y0 = y - radius; + x3 = x + radius, y3 = y + radius; + radius *= radius; + } + + while (q = quads.pop()) { + + // Stop searching if this quadrant can’t contain a closer node. + if (!(node = q.node) + || (x1 = q.x0) > x3 + || (y1 = q.y0) > y3 + || (x2 = q.x1) < x0 + || (y2 = q.y1) < y0) continue; + + // Bisect the current quadrant. + if (node.length) { + var xm = (x1 + x2) / 2, + ym = (y1 + y2) / 2; + + quads.push( + new Quad(node[3], xm, ym, x2, y2), + new Quad(node[2], x1, ym, xm, y2), + new Quad(node[1], xm, y1, x2, ym), + new Quad(node[0], x1, y1, xm, ym) + ); + + // Visit the closest quadrant first. + if (i = (y >= ym) << 1 | (x >= xm)) { + q = quads[quads.length - 1]; + quads[quads.length - 1] = quads[quads.length - 1 - i]; + quads[quads.length - 1 - i] = q; + } + } + + // Visit this point. (Visiting coincident points isn’t necessary!) + else { + var dx = x - +this._x.call(null, node.data), + dy = y - +this._y.call(null, node.data), + d2 = dx * dx + dy * dy; + if (d2 < radius) { + var d = Math.sqrt(radius = d2); + x0 = x - d, y0 = y - d; + x3 = x + d, y3 = y + d; + data = node.data; + } + } + } + + return data; +} + +function tree_remove(d) { + if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points + + var parent, + node = this._root, + retainer, + previous, + next, + x0 = this._x0, + y0 = this._y0, + x1 = this._x1, + y1 = this._y1, + x, + y, + xm, + ym, + right, + bottom, + i, + j; + + // If the tree is empty, initialize the root as a leaf. + if (!node) return this; + + // Find the leaf node for the point. + // While descending, also retain the deepest parent with a non-removed sibling. + if (node.length) while (true) { + if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; + if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; + if (!(parent = node, node = node[i = bottom << 1 | right])) return this; + if (!node.length) break; + if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i; + } + + // Find the point to remove. + while (node.data !== d) if (!(previous = node, node = node.next)) return this; + if (next = node.next) delete node.next; + + // If there are multiple coincident points, remove just the point. + if (previous) return (next ? previous.next = next : delete previous.next), this; + + // If this is the root point, remove it. + if (!parent) return this._root = next, this; + + // Remove this leaf. + next ? parent[i] = next : delete parent[i]; + + // If the parent now contains exactly one leaf, collapse superfluous parents. + if ((node = parent[0] || parent[1] || parent[2] || parent[3]) + && node === (parent[3] || parent[2] || parent[1] || parent[0]) + && !node.length) { + if (retainer) retainer[j] = node; + else this._root = node; + } + + return this; +} + +function removeAll(data) { + for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]); + return this; +} + +function tree_root() { + return this._root; +} + +function tree_size() { + var size = 0; + this.visit(function(node) { + if (!node.length) do ++size; while (node = node.next) + }); + return size; +} + +function tree_visit(callback) { + var quads = [], q, node = this._root, child, x0, y0, x1, y1; + if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1)); + while (q = quads.pop()) { + if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) { + var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; + if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1)); + if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1)); + if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym)); + if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym)); + } + } + return this; +} + +function tree_visitAfter(callback) { + var quads = [], next = [], q; + if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1)); + while (q = quads.pop()) { + var node = q.node; + if (node.length) { + var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; + if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym)); + if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym)); + if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1)); + if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1)); + } + next.push(q); + } + while (q = next.pop()) { + callback(q.node, q.x0, q.y0, q.x1, q.y1); + } + return this; +} + +function defaultX(d) { + return d[0]; +} + +function tree_x(_) { + return arguments.length ? (this._x = _, this) : this._x; +} + +function defaultY(d) { + return d[1]; +} + +function tree_y(_) { + return arguments.length ? (this._y = _, this) : this._y; +} + +function quadtree(nodes, x, y) { + var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN); + return nodes == null ? tree : tree.addAll(nodes); +} + +function Quadtree(x, y, x0, y0, x1, y1) { + this._x = x; + this._y = y; + this._x0 = x0; + this._y0 = y0; + this._x1 = x1; + this._y1 = y1; + this._root = undefined; +} + +function leaf_copy(leaf) { + var copy = {data: leaf.data}, next = copy; + while (leaf = leaf.next) next = next.next = {data: leaf.data}; + return copy; +} + +var treeProto = quadtree.prototype = Quadtree.prototype; + +treeProto.copy = function() { + var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), + node = this._root, + nodes, + child; + + if (!node) return copy; + + if (!node.length) return copy._root = leaf_copy(node), copy; + + nodes = [{source: node, target: copy._root = new Array(4)}]; + while (node = nodes.pop()) { + for (var i = 0; i < 4; ++i) { + if (child = node.source[i]) { + if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)}); + else node.target[i] = leaf_copy(child); + } + } + } + + return copy; +}; + +treeProto.add = tree_add; +treeProto.addAll = addAll; +treeProto.cover = tree_cover; +treeProto.data = tree_data; +treeProto.extent = tree_extent; +treeProto.find = tree_find; +treeProto.remove = tree_remove; +treeProto.removeAll = removeAll; +treeProto.root = tree_root; +treeProto.size = tree_size; +treeProto.visit = tree_visit; +treeProto.visitAfter = tree_visitAfter; +treeProto.x = tree_x; +treeProto.y = tree_y; + +exports.quadtree = quadtree; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{}],146:[function(_dereq_,module,exports){ +// https://d3js.org/d3-shape/ v1.3.7 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-path')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-path'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); +}(this, function (exports, d3Path) { 'use strict'; + +function constant(x) { + return function constant() { + return x; + }; +} + +var abs = Math.abs; +var atan2 = Math.atan2; +var cos = Math.cos; +var max = Math.max; +var min = Math.min; +var sin = Math.sin; +var sqrt = Math.sqrt; + +var epsilon = 1e-12; +var pi = Math.PI; +var halfPi = pi / 2; +var tau = 2 * pi; + +function acos(x) { + return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); +} + +function asin(x) { + return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x); +} + +function arcInnerRadius(d) { + return d.innerRadius; +} + +function arcOuterRadius(d) { + return d.outerRadius; +} + +function arcStartAngle(d) { + return d.startAngle; +} + +function arcEndAngle(d) { + return d.endAngle; +} + +function arcPadAngle(d) { + return d && d.padAngle; // Note: optional! +} + +function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { + var x10 = x1 - x0, y10 = y1 - y0, + x32 = x3 - x2, y32 = y3 - y2, + t = y32 * x10 - x32 * y10; + if (t * t < epsilon) return; + t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; + return [x0 + t * x10, y0 + t * y10]; +} + +// Compute perpendicular offset line of length rc. +// http://mathworld.wolfram.com/Circle-LineIntersection.html +function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { + var x01 = x0 - x1, + y01 = y0 - y1, + lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), + ox = lo * y01, + oy = -lo * x01, + x11 = x0 + ox, + y11 = y0 + oy, + x10 = x1 + ox, + y10 = y1 + oy, + x00 = (x11 + x10) / 2, + y00 = (y11 + y10) / 2, + dx = x10 - x11, + dy = y10 - y11, + d2 = dx * dx + dy * dy, + r = r1 - rc, + D = x11 * y10 - x10 * y11, + d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)), + cx0 = (D * dy - dx * d) / d2, + cy0 = (-D * dx - dy * d) / d2, + cx1 = (D * dy + dx * d) / d2, + cy1 = (-D * dx + dy * d) / d2, + dx0 = cx0 - x00, + dy0 = cy0 - y00, + dx1 = cx1 - x00, + dy1 = cy1 - y00; + + // Pick the closer of the two intersection points. + // TODO Is there a faster way to determine which intersection to use? + if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; + + return { + cx: cx0, + cy: cy0, + x01: -ox, + y01: -oy, + x11: cx0 * (r1 / r - 1), + y11: cy0 * (r1 / r - 1) + }; +} + +function arc() { + var innerRadius = arcInnerRadius, + outerRadius = arcOuterRadius, + cornerRadius = constant(0), + padRadius = null, + startAngle = arcStartAngle, + endAngle = arcEndAngle, + padAngle = arcPadAngle, + context = null; + + function arc() { + var buffer, + r, + r0 = +innerRadius.apply(this, arguments), + r1 = +outerRadius.apply(this, arguments), + a0 = startAngle.apply(this, arguments) - halfPi, + a1 = endAngle.apply(this, arguments) - halfPi, + da = abs(a1 - a0), + cw = a1 > a0; + + if (!context) context = buffer = d3Path.path(); + + // Ensure that the outer radius is always larger than the inner radius. + if (r1 < r0) r = r1, r1 = r0, r0 = r; + + // Is it a point? + if (!(r1 > epsilon)) context.moveTo(0, 0); + + // Or is it a circle or annulus? + else if (da > tau - epsilon) { + context.moveTo(r1 * cos(a0), r1 * sin(a0)); + context.arc(0, 0, r1, a0, a1, !cw); + if (r0 > epsilon) { + context.moveTo(r0 * cos(a1), r0 * sin(a1)); + context.arc(0, 0, r0, a1, a0, cw); + } + } + + // Or is it a circular or annular sector? + else { + var a01 = a0, + a11 = a1, + a00 = a0, + a10 = a1, + da0 = da, + da1 = da, + ap = padAngle.apply(this, arguments) / 2, + rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), + rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), + rc0 = rc, + rc1 = rc, + t0, + t1; + + // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0. + if (rp > epsilon) { + var p0 = asin(rp / r0 * sin(ap)), + p1 = asin(rp / r1 * sin(ap)); + if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0; + else da0 = 0, a00 = a10 = (a0 + a1) / 2; + if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1; + else da1 = 0, a01 = a11 = (a0 + a1) / 2; + } + + var x01 = r1 * cos(a01), + y01 = r1 * sin(a01), + x10 = r0 * cos(a10), + y10 = r0 * sin(a10); + + // Apply rounded corners? + if (rc > epsilon) { + var x11 = r1 * cos(a11), + y11 = r1 * sin(a11), + x00 = r0 * cos(a00), + y00 = r0 * sin(a00), + oc; + + // Restrict the corner radius according to the sector angle. + if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { + var ax = x01 - oc[0], + ay = y01 - oc[1], + bx = x11 - oc[0], + by = y11 - oc[1], + kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), + lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); + rc0 = min(rc, (r0 - lc) / (kc - 1)); + rc1 = min(rc, (r1 - lc) / (kc + 1)); + } + } + + // Is the sector collapsed to a line? + if (!(da1 > epsilon)) context.moveTo(x01, y01); + + // Does the sector’s outer ring have rounded corners? + else if (rc1 > epsilon) { + t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); + t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); + + context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01); + + // Have the corners merged? + if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); + + // Otherwise, draw the two corners and the ring. + else { + context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw); + context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw); + context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw); + } + } + + // Or is the outer ring just a circular arc? + else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); + + // Is there no inner ring, and it’s a circular sector? + // Or perhaps it’s an annular sector collapsed due to padding? + if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10); + + // Does the sector’s inner ring (or point) have rounded corners? + else if (rc0 > epsilon) { + t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); + t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); + + context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01); + + // Have the corners merged? + if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); + + // Otherwise, draw the two corners and the ring. + else { + context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw); + context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw); + context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw); + } + } + + // Or is the inner ring just a circular arc? + else context.arc(0, 0, r0, a10, a00, cw); + } + + context.closePath(); + + if (buffer) return context = null, buffer + "" || null; + } + + arc.centroid = function() { + var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, + a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2; + return [cos(a) * r, sin(a) * r]; + }; + + arc.innerRadius = function(_) { + return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius; + }; + + arc.outerRadius = function(_) { + return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius; + }; + + arc.cornerRadius = function(_) { + return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius; + }; + + arc.padRadius = function(_) { + return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius; + }; + + arc.startAngle = function(_) { + return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle; + }; + + arc.endAngle = function(_) { + return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle; + }; + + arc.padAngle = function(_) { + return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle; + }; + + arc.context = function(_) { + return arguments.length ? ((context = _ == null ? null : _), arc) : context; + }; + + return arc; +} + +function Linear(context) { + this._context = context; +} + +Linear.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._point = 0; + }, + lineEnd: function() { + if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; + case 1: this._point = 2; // proceed + default: this._context.lineTo(x, y); break; + } + } +}; + +function curveLinear(context) { + return new Linear(context); +} + +function x(p) { + return p[0]; +} + +function y(p) { + return p[1]; +} + +function line() { + var x$1 = x, + y$1 = y, + defined = constant(true), + context = null, + curve = curveLinear, + output = null; + + function line(data) { + var i, + n = data.length, + d, + defined0 = false, + buffer; + + if (context == null) output = curve(buffer = d3Path.path()); + + for (i = 0; i <= n; ++i) { + if (!(i < n && defined(d = data[i], i, data)) === defined0) { + if (defined0 = !defined0) output.lineStart(); + else output.lineEnd(); + } + if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data)); + } + + if (buffer) return output = null, buffer + "" || null; + } + + line.x = function(_) { + return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1; + }; + + line.y = function(_) { + return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1; + }; + + line.defined = function(_) { + return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined; + }; + + line.curve = function(_) { + return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; + }; + + line.context = function(_) { + return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; + }; + + return line; +} + +function area() { + var x0 = x, + x1 = null, + y0 = constant(0), + y1 = y, + defined = constant(true), + context = null, + curve = curveLinear, + output = null; + + function area(data) { + var i, + j, + k, + n = data.length, + d, + defined0 = false, + buffer, + x0z = new Array(n), + y0z = new Array(n); + + if (context == null) output = curve(buffer = d3Path.path()); + + for (i = 0; i <= n; ++i) { + if (!(i < n && defined(d = data[i], i, data)) === defined0) { + if (defined0 = !defined0) { + j = i; + output.areaStart(); + output.lineStart(); + } else { + output.lineEnd(); + output.lineStart(); + for (k = i - 1; k >= j; --k) { + output.point(x0z[k], y0z[k]); + } + output.lineEnd(); + output.areaEnd(); + } + } + if (defined0) { + x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); + output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); + } + } + + if (buffer) return output = null, buffer + "" || null; + } + + function arealine() { + return line().defined(defined).curve(curve).context(context); + } + + area.x = function(_) { + return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0; + }; + + area.x0 = function(_) { + return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0; + }; + + area.x1 = function(_) { + return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1; + }; + + area.y = function(_) { + return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0; + }; + + area.y0 = function(_) { + return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0; + }; + + area.y1 = function(_) { + return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : y1; + }; + + area.lineX0 = + area.lineY0 = function() { + return arealine().x(x0).y(y0); + }; + + area.lineY1 = function() { + return arealine().x(x0).y(y1); + }; + + area.lineX1 = function() { + return arealine().x(x1).y(y0); + }; + + area.defined = function(_) { + return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), area) : defined; + }; + + area.curve = function(_) { + return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; + }; + + area.context = function(_) { + return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; + }; + + return area; +} + +function descending(a, b) { + return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; +} + +function identity(d) { + return d; +} + +function pie() { + var value = identity, + sortValues = descending, + sort = null, + startAngle = constant(0), + endAngle = constant(tau), + padAngle = constant(0); + + function pie(data) { + var i, + n = data.length, + j, + k, + sum = 0, + index = new Array(n), + arcs = new Array(n), + a0 = +startAngle.apply(this, arguments), + da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)), + a1, + p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), + pa = p * (da < 0 ? -1 : 1), + v; + + for (i = 0; i < n; ++i) { + if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) { + sum += v; + } + } + + // Optionally sort the arcs by previously-computed values or by data. + if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); }); + else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); }); + + // Compute the arcs! They are stored in the original data's order. + for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) { + j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = { + data: data[j], + index: i, + value: v, + startAngle: a0, + endAngle: a1, + padAngle: p + }; + } + + return arcs; + } + + pie.value = function(_) { + return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value; + }; + + pie.sortValues = function(_) { + return arguments.length ? (sortValues = _, sort = null, pie) : sortValues; + }; + + pie.sort = function(_) { + return arguments.length ? (sort = _, sortValues = null, pie) : sort; + }; + + pie.startAngle = function(_) { + return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle; + }; + + pie.endAngle = function(_) { + return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle; + }; + + pie.padAngle = function(_) { + return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle; + }; + + return pie; +} + +var curveRadialLinear = curveRadial(curveLinear); + +function Radial(curve) { + this._curve = curve; +} + +Radial.prototype = { + areaStart: function() { + this._curve.areaStart(); + }, + areaEnd: function() { + this._curve.areaEnd(); + }, + lineStart: function() { + this._curve.lineStart(); + }, + lineEnd: function() { + this._curve.lineEnd(); + }, + point: function(a, r) { + this._curve.point(r * Math.sin(a), r * -Math.cos(a)); + } +}; + +function curveRadial(curve) { + + function radial(context) { + return new Radial(curve(context)); + } + + radial._curve = curve; + + return radial; +} + +function lineRadial(l) { + var c = l.curve; + + l.angle = l.x, delete l.x; + l.radius = l.y, delete l.y; + + l.curve = function(_) { + return arguments.length ? c(curveRadial(_)) : c()._curve; + }; + + return l; +} + +function lineRadial$1() { + return lineRadial(line().curve(curveRadialLinear)); +} + +function areaRadial() { + var a = area().curve(curveRadialLinear), + c = a.curve, + x0 = a.lineX0, + x1 = a.lineX1, + y0 = a.lineY0, + y1 = a.lineY1; + + a.angle = a.x, delete a.x; + a.startAngle = a.x0, delete a.x0; + a.endAngle = a.x1, delete a.x1; + a.radius = a.y, delete a.y; + a.innerRadius = a.y0, delete a.y0; + a.outerRadius = a.y1, delete a.y1; + a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0; + a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1; + a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0; + a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1; + + a.curve = function(_) { + return arguments.length ? c(curveRadial(_)) : c()._curve; + }; + + return a; +} + +function pointRadial(x, y) { + return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)]; +} + +var slice = Array.prototype.slice; + +function linkSource(d) { + return d.source; +} + +function linkTarget(d) { + return d.target; +} + +function link(curve) { + var source = linkSource, + target = linkTarget, + x$1 = x, + y$1 = y, + context = null; + + function link() { + var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv); + if (!context) context = buffer = d3Path.path(); + curve(context, +x$1.apply(this, (argv[0] = s, argv)), +y$1.apply(this, argv), +x$1.apply(this, (argv[0] = t, argv)), +y$1.apply(this, argv)); + if (buffer) return context = null, buffer + "" || null; + } + + link.source = function(_) { + return arguments.length ? (source = _, link) : source; + }; + + link.target = function(_) { + return arguments.length ? (target = _, link) : target; + }; + + link.x = function(_) { + return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), link) : x$1; + }; + + link.y = function(_) { + return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), link) : y$1; + }; + + link.context = function(_) { + return arguments.length ? ((context = _ == null ? null : _), link) : context; + }; + + return link; +} + +function curveHorizontal(context, x0, y0, x1, y1) { + context.moveTo(x0, y0); + context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1); +} + +function curveVertical(context, x0, y0, x1, y1) { + context.moveTo(x0, y0); + context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1); +} + +function curveRadial$1(context, x0, y0, x1, y1) { + var p0 = pointRadial(x0, y0), + p1 = pointRadial(x0, y0 = (y0 + y1) / 2), + p2 = pointRadial(x1, y0), + p3 = pointRadial(x1, y1); + context.moveTo(p0[0], p0[1]); + context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]); +} + +function linkHorizontal() { + return link(curveHorizontal); +} + +function linkVertical() { + return link(curveVertical); +} + +function linkRadial() { + var l = link(curveRadial$1); + l.angle = l.x, delete l.x; + l.radius = l.y, delete l.y; + return l; +} + +var circle = { + draw: function(context, size) { + var r = Math.sqrt(size / pi); + context.moveTo(r, 0); + context.arc(0, 0, r, 0, tau); + } +}; + +var cross = { + draw: function(context, size) { + var r = Math.sqrt(size / 5) / 2; + context.moveTo(-3 * r, -r); + context.lineTo(-r, -r); + context.lineTo(-r, -3 * r); + context.lineTo(r, -3 * r); + context.lineTo(r, -r); + context.lineTo(3 * r, -r); + context.lineTo(3 * r, r); + context.lineTo(r, r); + context.lineTo(r, 3 * r); + context.lineTo(-r, 3 * r); + context.lineTo(-r, r); + context.lineTo(-3 * r, r); + context.closePath(); + } +}; + +var tan30 = Math.sqrt(1 / 3), + tan30_2 = tan30 * 2; + +var diamond = { + draw: function(context, size) { + var y = Math.sqrt(size / tan30_2), + x = y * tan30; + context.moveTo(0, -y); + context.lineTo(x, 0); + context.lineTo(0, y); + context.lineTo(-x, 0); + context.closePath(); + } +}; + +var ka = 0.89081309152928522810, + kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10), + kx = Math.sin(tau / 10) * kr, + ky = -Math.cos(tau / 10) * kr; + +var star = { + draw: function(context, size) { + var r = Math.sqrt(size * ka), + x = kx * r, + y = ky * r; + context.moveTo(0, -r); + context.lineTo(x, y); + for (var i = 1; i < 5; ++i) { + var a = tau * i / 5, + c = Math.cos(a), + s = Math.sin(a); + context.lineTo(s * r, -c * r); + context.lineTo(c * x - s * y, s * x + c * y); + } + context.closePath(); + } +}; + +var square = { + draw: function(context, size) { + var w = Math.sqrt(size), + x = -w / 2; + context.rect(x, x, w, w); + } +}; + +var sqrt3 = Math.sqrt(3); + +var triangle = { + draw: function(context, size) { + var y = -Math.sqrt(size / (sqrt3 * 3)); + context.moveTo(0, y * 2); + context.lineTo(-sqrt3 * y, -y); + context.lineTo(sqrt3 * y, -y); + context.closePath(); + } +}; + +var c = -0.5, + s = Math.sqrt(3) / 2, + k = 1 / Math.sqrt(12), + a = (k / 2 + 1) * 3; + +var wye = { + draw: function(context, size) { + var r = Math.sqrt(size / a), + x0 = r / 2, + y0 = r * k, + x1 = x0, + y1 = r * k + r, + x2 = -x1, + y2 = y1; + context.moveTo(x0, y0); + context.lineTo(x1, y1); + context.lineTo(x2, y2); + context.lineTo(c * x0 - s * y0, s * x0 + c * y0); + context.lineTo(c * x1 - s * y1, s * x1 + c * y1); + context.lineTo(c * x2 - s * y2, s * x2 + c * y2); + context.lineTo(c * x0 + s * y0, c * y0 - s * x0); + context.lineTo(c * x1 + s * y1, c * y1 - s * x1); + context.lineTo(c * x2 + s * y2, c * y2 - s * x2); + context.closePath(); + } +}; + +var symbols = [ + circle, + cross, + diamond, + square, + star, + triangle, + wye +]; + +function symbol() { + var type = constant(circle), + size = constant(64), + context = null; + + function symbol() { + var buffer; + if (!context) context = buffer = d3Path.path(); + type.apply(this, arguments).draw(context, +size.apply(this, arguments)); + if (buffer) return context = null, buffer + "" || null; + } + + symbol.type = function(_) { + return arguments.length ? (type = typeof _ === "function" ? _ : constant(_), symbol) : type; + }; + + symbol.size = function(_) { + return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size; + }; + + symbol.context = function(_) { + return arguments.length ? (context = _ == null ? null : _, symbol) : context; + }; + + return symbol; +} + +function noop() {} + +function point(that, x, y) { + that._context.bezierCurveTo( + (2 * that._x0 + that._x1) / 3, + (2 * that._y0 + that._y1) / 3, + (that._x0 + 2 * that._x1) / 3, + (that._y0 + 2 * that._y1) / 3, + (that._x0 + 4 * that._x1 + x) / 6, + (that._y0 + 4 * that._y1 + y) / 6 + ); +} + +function Basis(context) { + this._context = context; +} + +Basis.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = + this._y0 = this._y1 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 3: point(this, this._x1, this._y1); // proceed + case 2: this._context.lineTo(this._x1, this._y1); break; + } + if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; + case 1: this._point = 2; break; + case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed + default: point(this, x, y); break; + } + this._x0 = this._x1, this._x1 = x; + this._y0 = this._y1, this._y1 = y; + } +}; + +function basis(context) { + return new Basis(context); +} + +function BasisClosed(context) { + this._context = context; +} + +BasisClosed.prototype = { + areaStart: noop, + areaEnd: noop, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = + this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x2, this._y2); + this._context.closePath(); + break; + } + case 2: { + this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); + this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x2, this._y2); + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + break; + } + } + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; this._x2 = x, this._y2 = y; break; + case 1: this._point = 2; this._x3 = x, this._y3 = y; break; + case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break; + default: point(this, x, y); break; + } + this._x0 = this._x1, this._x1 = x; + this._y0 = this._y1, this._y1 = y; + } +}; + +function basisClosed(context) { + return new BasisClosed(context); +} + +function BasisOpen(context) { + this._context = context; +} + +BasisOpen.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = + this._y0 = this._y1 = NaN; + this._point = 0; + }, + lineEnd: function() { + if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; break; + case 1: this._point = 2; break; + case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break; + case 3: this._point = 4; // proceed + default: point(this, x, y); break; + } + this._x0 = this._x1, this._x1 = x; + this._y0 = this._y1, this._y1 = y; + } +}; + +function basisOpen(context) { + return new BasisOpen(context); +} + +function Bundle(context, beta) { + this._basis = new Basis(context); + this._beta = beta; +} + +Bundle.prototype = { + lineStart: function() { + this._x = []; + this._y = []; + this._basis.lineStart(); + }, + lineEnd: function() { + var x = this._x, + y = this._y, + j = x.length - 1; + + if (j > 0) { + var x0 = x[0], + y0 = y[0], + dx = x[j] - x0, + dy = y[j] - y0, + i = -1, + t; + + while (++i <= j) { + t = i / j; + this._basis.point( + this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), + this._beta * y[i] + (1 - this._beta) * (y0 + t * dy) + ); + } + } + + this._x = this._y = null; + this._basis.lineEnd(); + }, + point: function(x, y) { + this._x.push(+x); + this._y.push(+y); + } +}; + +var bundle = (function custom(beta) { + + function bundle(context) { + return beta === 1 ? new Basis(context) : new Bundle(context, beta); + } + + bundle.beta = function(beta) { + return custom(+beta); + }; + + return bundle; +})(0.85); + +function point$1(that, x, y) { + that._context.bezierCurveTo( + that._x1 + that._k * (that._x2 - that._x0), + that._y1 + that._k * (that._y2 - that._y0), + that._x2 + that._k * (that._x1 - x), + that._y2 + that._k * (that._y1 - y), + that._x2, + that._y2 + ); +} + +function Cardinal(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; +} + +Cardinal.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = + this._y0 = this._y1 = this._y2 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 2: this._context.lineTo(this._x2, this._y2); break; + case 3: point$1(this, this._x1, this._y1); break; + } + if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; + case 1: this._point = 2; this._x1 = x, this._y1 = y; break; + case 2: this._point = 3; // proceed + default: point$1(this, x, y); break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + } +}; + +var cardinal = (function custom(tension) { + + function cardinal(context) { + return new Cardinal(context, tension); + } + + cardinal.tension = function(tension) { + return custom(+tension); + }; + + return cardinal; +})(0); + +function CardinalClosed(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; +} + +CardinalClosed.prototype = { + areaStart: noop, + areaEnd: noop, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = + this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + this.point(this._x5, this._y5); + break; + } + } + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; this._x3 = x, this._y3 = y; break; + case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break; + case 2: this._point = 3; this._x5 = x, this._y5 = y; break; + default: point$1(this, x, y); break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + } +}; + +var cardinalClosed = (function custom(tension) { + + function cardinal(context) { + return new CardinalClosed(context, tension); + } + + cardinal.tension = function(tension) { + return custom(+tension); + }; + + return cardinal; +})(0); + +function CardinalOpen(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; +} + +CardinalOpen.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = + this._y0 = this._y1 = this._y2 = NaN; + this._point = 0; + }, + lineEnd: function() { + if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; break; + case 1: this._point = 2; break; + case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; + case 3: this._point = 4; // proceed + default: point$1(this, x, y); break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + } +}; + +var cardinalOpen = (function custom(tension) { + + function cardinal(context) { + return new CardinalOpen(context, tension); + } + + cardinal.tension = function(tension) { + return custom(+tension); + }; + + return cardinal; +})(0); + +function point$2(that, x, y) { + var x1 = that._x1, + y1 = that._y1, + x2 = that._x2, + y2 = that._y2; + + if (that._l01_a > epsilon) { + var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, + n = 3 * that._l01_a * (that._l01_a + that._l12_a); + x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; + y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; + } + + if (that._l23_a > epsilon) { + var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, + m = 3 * that._l23_a * (that._l23_a + that._l12_a); + x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m; + y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m; + } + + that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2); +} + +function CatmullRom(context, alpha) { + this._context = context; + this._alpha = alpha; +} + +CatmullRom.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = + this._y0 = this._y1 = this._y2 = NaN; + this._l01_a = this._l12_a = this._l23_a = + this._l01_2a = this._l12_2a = this._l23_2a = + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 2: this._context.lineTo(this._x2, this._y2); break; + case 3: this.point(this._x2, this._y2); break; + } + if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + + if (this._point) { + var x23 = this._x2 - x, + y23 = this._y2 - y; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + + switch (this._point) { + case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; + case 1: this._point = 2; break; + case 2: this._point = 3; // proceed + default: point$2(this, x, y); break; + } + + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + } +}; + +var catmullRom = (function custom(alpha) { + + function catmullRom(context) { + return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); + } + + catmullRom.alpha = function(alpha) { + return custom(+alpha); + }; + + return catmullRom; +})(0.5); + +function CatmullRomClosed(context, alpha) { + this._context = context; + this._alpha = alpha; +} + +CatmullRomClosed.prototype = { + areaStart: noop, + areaEnd: noop, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = + this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; + this._l01_a = this._l12_a = this._l23_a = + this._l01_2a = this._l12_2a = this._l23_2a = + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + this.point(this._x5, this._y5); + break; + } + } + }, + point: function(x, y) { + x = +x, y = +y; + + if (this._point) { + var x23 = this._x2 - x, + y23 = this._y2 - y; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + + switch (this._point) { + case 0: this._point = 1; this._x3 = x, this._y3 = y; break; + case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break; + case 2: this._point = 3; this._x5 = x, this._y5 = y; break; + default: point$2(this, x, y); break; + } + + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + } +}; + +var catmullRomClosed = (function custom(alpha) { + + function catmullRom(context) { + return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); + } + + catmullRom.alpha = function(alpha) { + return custom(+alpha); + }; + + return catmullRom; +})(0.5); + +function CatmullRomOpen(context, alpha) { + this._context = context; + this._alpha = alpha; +} + +CatmullRomOpen.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = + this._y0 = this._y1 = this._y2 = NaN; + this._l01_a = this._l12_a = this._l23_a = + this._l01_2a = this._l12_2a = this._l23_2a = + this._point = 0; + }, + lineEnd: function() { + if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + + if (this._point) { + var x23 = this._x2 - x, + y23 = this._y2 - y; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + + switch (this._point) { + case 0: this._point = 1; break; + case 1: this._point = 2; break; + case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; + case 3: this._point = 4; // proceed + default: point$2(this, x, y); break; + } + + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + } +}; + +var catmullRomOpen = (function custom(alpha) { + + function catmullRom(context) { + return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); + } + + catmullRom.alpha = function(alpha) { + return custom(+alpha); + }; + + return catmullRom; +})(0.5); + +function LinearClosed(context) { + this._context = context; +} + +LinearClosed.prototype = { + areaStart: noop, + areaEnd: noop, + lineStart: function() { + this._point = 0; + }, + lineEnd: function() { + if (this._point) this._context.closePath(); + }, + point: function(x, y) { + x = +x, y = +y; + if (this._point) this._context.lineTo(x, y); + else this._point = 1, this._context.moveTo(x, y); + } +}; + +function linearClosed(context) { + return new LinearClosed(context); +} + +function sign(x) { + return x < 0 ? -1 : 1; +} + +// Calculate the slopes of the tangents (Hermite-type interpolation) based on +// the following paper: Steffen, M. 1990. A Simple Method for Monotonic +// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO. +// NOV(II), P. 443, 1990. +function slope3(that, x2, y2) { + var h0 = that._x1 - that._x0, + h1 = x2 - that._x1, + s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), + s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), + p = (s0 * h1 + s1 * h0) / (h0 + h1); + return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; +} + +// Calculate a one-sided slope. +function slope2(that, t) { + var h = that._x1 - that._x0; + return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; +} + +// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations +// "you can express cubic Hermite interpolation in terms of cubic Bézier curves +// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1". +function point$3(that, t0, t1) { + var x0 = that._x0, + y0 = that._y0, + x1 = that._x1, + y1 = that._y1, + dx = (x1 - x0) / 3; + that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1); +} + +function MonotoneX(context) { + this._context = context; +} + +MonotoneX.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = + this._y0 = this._y1 = + this._t0 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 2: this._context.lineTo(this._x1, this._y1); break; + case 3: point$3(this, this._t0, slope2(this, this._t0)); break; + } + if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x, y) { + var t1 = NaN; + + x = +x, y = +y; + if (x === this._x1 && y === this._y1) return; // Ignore coincident points. + switch (this._point) { + case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; + case 1: this._point = 2; break; + case 2: this._point = 3; point$3(this, slope2(this, t1 = slope3(this, x, y)), t1); break; + default: point$3(this, this._t0, t1 = slope3(this, x, y)); break; + } + + this._x0 = this._x1, this._x1 = x; + this._y0 = this._y1, this._y1 = y; + this._t0 = t1; + } +}; + +function MonotoneY(context) { + this._context = new ReflectContext(context); +} + +(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) { + MonotoneX.prototype.point.call(this, y, x); +}; + +function ReflectContext(context) { + this._context = context; +} + +ReflectContext.prototype = { + moveTo: function(x, y) { this._context.moveTo(y, x); }, + closePath: function() { this._context.closePath(); }, + lineTo: function(x, y) { this._context.lineTo(y, x); }, + bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); } +}; + +function monotoneX(context) { + return new MonotoneX(context); +} + +function monotoneY(context) { + return new MonotoneY(context); +} + +function Natural(context) { + this._context = context; +} + +Natural.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x = []; + this._y = []; + }, + lineEnd: function() { + var x = this._x, + y = this._y, + n = x.length; + + if (n) { + this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]); + if (n === 2) { + this._context.lineTo(x[1], y[1]); + } else { + var px = controlPoints(x), + py = controlPoints(y); + for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { + this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]); + } + } + } + + if (this._line || (this._line !== 0 && n === 1)) this._context.closePath(); + this._line = 1 - this._line; + this._x = this._y = null; + }, + point: function(x, y) { + this._x.push(+x); + this._y.push(+y); + } +}; + +// See https://www.particleincell.com/2012/bezier-splines/ for derivation. +function controlPoints(x) { + var i, + n = x.length - 1, + m, + a = new Array(n), + b = new Array(n), + r = new Array(n); + a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1]; + for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1]; + a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n]; + for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1]; + a[n - 1] = r[n - 1] / b[n - 1]; + for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i]; + b[n - 1] = (x[n] + a[n - 1]) / 2; + for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1]; + return [a, b]; +} + +function natural(context) { + return new Natural(context); +} + +function Step(context, t) { + this._context = context; + this._t = t; +} + +Step.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x = this._y = NaN; + this._point = 0; + }, + lineEnd: function() { + if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); + if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); + if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; + }, + point: function(x, y) { + x = +x, y = +y; + switch (this._point) { + case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; + case 1: this._point = 2; // proceed + default: { + if (this._t <= 0) { + this._context.lineTo(this._x, y); + this._context.lineTo(x, y); + } else { + var x1 = this._x * (1 - this._t) + x * this._t; + this._context.lineTo(x1, this._y); + this._context.lineTo(x1, y); + } + break; + } + } + this._x = x, this._y = y; + } +}; + +function step(context) { + return new Step(context, 0.5); +} + +function stepBefore(context) { + return new Step(context, 0); +} + +function stepAfter(context) { + return new Step(context, 1); +} + +function none(series, order) { + if (!((n = series.length) > 1)) return; + for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) { + s0 = s1, s1 = series[order[i]]; + for (j = 0; j < m; ++j) { + s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1]; + } + } +} + +function none$1(series) { + var n = series.length, o = new Array(n); + while (--n >= 0) o[n] = n; + return o; +} + +function stackValue(d, key) { + return d[key]; +} + +function stack() { + var keys = constant([]), + order = none$1, + offset = none, + value = stackValue; + + function stack(data) { + var kz = keys.apply(this, arguments), + i, + m = data.length, + n = kz.length, + sz = new Array(n), + oz; + + for (i = 0; i < n; ++i) { + for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) { + si[j] = sij = [0, +value(data[j], ki, j, data)]; + sij.data = data[j]; + } + si.key = ki; + } + + for (i = 0, oz = order(sz); i < n; ++i) { + sz[oz[i]].index = i; + } + + offset(sz, oz); + return sz; + } + + stack.keys = function(_) { + return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys; + }; + + stack.value = function(_) { + return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value; + }; + + stack.order = function(_) { + return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order; + }; + + stack.offset = function(_) { + return arguments.length ? (offset = _ == null ? none : _, stack) : offset; + }; + + return stack; +} + +function expand(series, order) { + if (!((n = series.length) > 0)) return; + for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) { + for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0; + if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y; + } + none(series, order); +} + +function diverging(series, order) { + if (!((n = series.length) > 0)) return; + for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) { + for (yp = yn = 0, i = 0; i < n; ++i) { + if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) { + d[0] = yp, d[1] = yp += dy; + } else if (dy < 0) { + d[1] = yn, d[0] = yn += dy; + } else { + d[0] = 0, d[1] = dy; + } + } + } +} + +function silhouette(series, order) { + if (!((n = series.length) > 0)) return; + for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) { + for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0; + s0[j][1] += s0[j][0] = -y / 2; + } + none(series, order); +} + +function wiggle(series, order) { + if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return; + for (var y = 0, j = 1, s0, m, n; j < m; ++j) { + for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) { + var si = series[order[i]], + sij0 = si[j][1] || 0, + sij1 = si[j - 1][1] || 0, + s3 = (sij0 - sij1) / 2; + for (var k = 0; k < i; ++k) { + var sk = series[order[k]], + skj0 = sk[j][1] || 0, + skj1 = sk[j - 1][1] || 0; + s3 += skj0 - skj1; + } + s1 += sij0, s2 += s3 * sij0; + } + s0[j - 1][1] += s0[j - 1][0] = y; + if (s1) y -= s2 / s1; + } + s0[j - 1][1] += s0[j - 1][0] = y; + none(series, order); +} + +function appearance(series) { + var peaks = series.map(peak); + return none$1(series).sort(function(a, b) { return peaks[a] - peaks[b]; }); +} + +function peak(series) { + var i = -1, j = 0, n = series.length, vi, vj = -Infinity; + while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i; + return j; +} + +function ascending(series) { + var sums = series.map(sum); + return none$1(series).sort(function(a, b) { return sums[a] - sums[b]; }); +} + +function sum(series) { + var s = 0, i = -1, n = series.length, v; + while (++i < n) if (v = +series[i][1]) s += v; + return s; +} + +function descending$1(series) { + return ascending(series).reverse(); +} + +function insideOut(series) { + var n = series.length, + i, + j, + sums = series.map(sum), + order = appearance(series), + top = 0, + bottom = 0, + tops = [], + bottoms = []; + + for (i = 0; i < n; ++i) { + j = order[i]; + if (top < bottom) { + top += sums[j]; + tops.push(j); + } else { + bottom += sums[j]; + bottoms.push(j); + } + } + + return bottoms.reverse().concat(tops); +} + +function reverse(series) { + return none$1(series).reverse(); +} + +exports.arc = arc; +exports.area = area; +exports.areaRadial = areaRadial; +exports.curveBasis = basis; +exports.curveBasisClosed = basisClosed; +exports.curveBasisOpen = basisOpen; +exports.curveBundle = bundle; +exports.curveCardinal = cardinal; +exports.curveCardinalClosed = cardinalClosed; +exports.curveCardinalOpen = cardinalOpen; +exports.curveCatmullRom = catmullRom; +exports.curveCatmullRomClosed = catmullRomClosed; +exports.curveCatmullRomOpen = catmullRomOpen; +exports.curveLinear = curveLinear; +exports.curveLinearClosed = linearClosed; +exports.curveMonotoneX = monotoneX; +exports.curveMonotoneY = monotoneY; +exports.curveNatural = natural; +exports.curveStep = step; +exports.curveStepAfter = stepAfter; +exports.curveStepBefore = stepBefore; +exports.line = line; +exports.lineRadial = lineRadial$1; +exports.linkHorizontal = linkHorizontal; +exports.linkRadial = linkRadial; +exports.linkVertical = linkVertical; +exports.pie = pie; +exports.pointRadial = pointRadial; +exports.radialArea = areaRadial; +exports.radialLine = lineRadial$1; +exports.stack = stack; +exports.stackOffsetDiverging = diverging; +exports.stackOffsetExpand = expand; +exports.stackOffsetNone = none; +exports.stackOffsetSilhouette = silhouette; +exports.stackOffsetWiggle = wiggle; +exports.stackOrderAppearance = appearance; +exports.stackOrderAscending = ascending; +exports.stackOrderDescending = descending$1; +exports.stackOrderInsideOut = insideOut; +exports.stackOrderNone = none$1; +exports.stackOrderReverse = reverse; +exports.symbol = symbol; +exports.symbolCircle = circle; +exports.symbolCross = cross; +exports.symbolDiamond = diamond; +exports.symbolSquare = square; +exports.symbolStar = star; +exports.symbolTriangle = triangle; +exports.symbolWye = wye; +exports.symbols = symbols; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{"d3-path":144}],147:[function(_dereq_,module,exports){ +// https://d3js.org/d3-time-format/ v2.2.3 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-time')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); +}(this, function (exports, d3Time) { 'use strict'; + +function localDate(d) { + if (0 <= d.y && d.y < 100) { + var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); + date.setFullYear(d.y); + return date; + } + return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); +} + +function utcDate(d) { + if (0 <= d.y && d.y < 100) { + var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); + date.setUTCFullYear(d.y); + return date; + } + return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); +} + +function newDate(y, m, d) { + return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0}; +} + +function formatLocale(locale) { + var locale_dateTime = locale.dateTime, + locale_date = locale.date, + locale_time = locale.time, + locale_periods = locale.periods, + locale_weekdays = locale.days, + locale_shortWeekdays = locale.shortDays, + locale_months = locale.months, + locale_shortMonths = locale.shortMonths; + + var periodRe = formatRe(locale_periods), + periodLookup = formatLookup(locale_periods), + weekdayRe = formatRe(locale_weekdays), + weekdayLookup = formatLookup(locale_weekdays), + shortWeekdayRe = formatRe(locale_shortWeekdays), + shortWeekdayLookup = formatLookup(locale_shortWeekdays), + monthRe = formatRe(locale_months), + monthLookup = formatLookup(locale_months), + shortMonthRe = formatRe(locale_shortMonths), + shortMonthLookup = formatLookup(locale_shortMonths); + + var formats = { + "a": formatShortWeekday, + "A": formatWeekday, + "b": formatShortMonth, + "B": formatMonth, + "c": null, + "d": formatDayOfMonth, + "e": formatDayOfMonth, + "f": formatMicroseconds, + "H": formatHour24, + "I": formatHour12, + "j": formatDayOfYear, + "L": formatMilliseconds, + "m": formatMonthNumber, + "M": formatMinutes, + "p": formatPeriod, + "q": formatQuarter, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, + "S": formatSeconds, + "u": formatWeekdayNumberMonday, + "U": formatWeekNumberSunday, + "V": formatWeekNumberISO, + "w": formatWeekdayNumberSunday, + "W": formatWeekNumberMonday, + "x": null, + "X": null, + "y": formatYear, + "Y": formatFullYear, + "Z": formatZone, + "%": formatLiteralPercent + }; + + var utcFormats = { + "a": formatUTCShortWeekday, + "A": formatUTCWeekday, + "b": formatUTCShortMonth, + "B": formatUTCMonth, + "c": null, + "d": formatUTCDayOfMonth, + "e": formatUTCDayOfMonth, + "f": formatUTCMicroseconds, + "H": formatUTCHour24, + "I": formatUTCHour12, + "j": formatUTCDayOfYear, + "L": formatUTCMilliseconds, + "m": formatUTCMonthNumber, + "M": formatUTCMinutes, + "p": formatUTCPeriod, + "q": formatUTCQuarter, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, + "S": formatUTCSeconds, + "u": formatUTCWeekdayNumberMonday, + "U": formatUTCWeekNumberSunday, + "V": formatUTCWeekNumberISO, + "w": formatUTCWeekdayNumberSunday, + "W": formatUTCWeekNumberMonday, + "x": null, + "X": null, + "y": formatUTCYear, + "Y": formatUTCFullYear, + "Z": formatUTCZone, + "%": formatLiteralPercent + }; + + var parses = { + "a": parseShortWeekday, + "A": parseWeekday, + "b": parseShortMonth, + "B": parseMonth, + "c": parseLocaleDateTime, + "d": parseDayOfMonth, + "e": parseDayOfMonth, + "f": parseMicroseconds, + "H": parseHour24, + "I": parseHour24, + "j": parseDayOfYear, + "L": parseMilliseconds, + "m": parseMonthNumber, + "M": parseMinutes, + "p": parsePeriod, + "q": parseQuarter, + "Q": parseUnixTimestamp, + "s": parseUnixTimestampSeconds, + "S": parseSeconds, + "u": parseWeekdayNumberMonday, + "U": parseWeekNumberSunday, + "V": parseWeekNumberISO, + "w": parseWeekdayNumberSunday, + "W": parseWeekNumberMonday, + "x": parseLocaleDate, + "X": parseLocaleTime, + "y": parseYear, + "Y": parseFullYear, + "Z": parseZone, + "%": parseLiteralPercent + }; + + // These recursive directive definitions must be deferred. + formats.x = newFormat(locale_date, formats); + formats.X = newFormat(locale_time, formats); + formats.c = newFormat(locale_dateTime, formats); + utcFormats.x = newFormat(locale_date, utcFormats); + utcFormats.X = newFormat(locale_time, utcFormats); + utcFormats.c = newFormat(locale_dateTime, utcFormats); + + function newFormat(specifier, formats) { + return function(date) { + var string = [], + i = -1, + j = 0, + n = specifier.length, + c, + pad, + format; + + if (!(date instanceof Date)) date = new Date(+date); + + while (++i < n) { + if (specifier.charCodeAt(i) === 37) { + string.push(specifier.slice(j, i)); + if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i); + else pad = c === "e" ? " " : "0"; + if (format = formats[c]) c = format(date, pad); + string.push(c); + j = i + 1; + } + } + + string.push(specifier.slice(j, i)); + return string.join(""); + }; + } + + function newParse(specifier, Z) { + return function(string) { + var d = newDate(1900, undefined, 1), + i = parseSpecifier(d, specifier, string += "", 0), + week, day; + if (i != string.length) return null; + + // If a UNIX timestamp is specified, return it. + if ("Q" in d) return new Date(d.Q); + if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0)); + + // If this is utcParse, never use the local timezone. + if (Z && !("Z" in d)) d.Z = 0; + + // The am-pm flag is 0 for AM, and 1 for PM. + if ("p" in d) d.H = d.H % 12 + d.p * 12; + + // If the month was not specified, inherit from the quarter. + if (d.m === undefined) d.m = "q" in d ? d.q : 0; + + // Convert day-of-week and week-of-year to day-of-year. + if ("V" in d) { + if (d.V < 1 || d.V > 53) return null; + if (!("w" in d)) d.w = 1; + if ("Z" in d) { + week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); + week = day > 4 || day === 0 ? d3Time.utcMonday.ceil(week) : d3Time.utcMonday(week); + week = d3Time.utcDay.offset(week, (d.V - 1) * 7); + d.y = week.getUTCFullYear(); + d.m = week.getUTCMonth(); + d.d = week.getUTCDate() + (d.w + 6) % 7; + } else { + week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); + week = day > 4 || day === 0 ? d3Time.timeMonday.ceil(week) : d3Time.timeMonday(week); + week = d3Time.timeDay.offset(week, (d.V - 1) * 7); + d.y = week.getFullYear(); + d.m = week.getMonth(); + d.d = week.getDate() + (d.w + 6) % 7; + } + } else if ("W" in d || "U" in d) { + if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; + day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); + d.m = 0; + d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; + } + + // If a time zone is specified, all fields are interpreted as UTC and then + // offset according to the specified time zone. + if ("Z" in d) { + d.H += d.Z / 100 | 0; + d.M += d.Z % 100; + return utcDate(d); + } + + // Otherwise, all fields are in local time. + return localDate(d); + }; + } + + function parseSpecifier(d, specifier, string, j) { + var i = 0, + n = specifier.length, + m = string.length, + c, + parse; + + while (i < n) { + if (j >= m) return -1; + c = specifier.charCodeAt(i++); + if (c === 37) { + c = specifier.charAt(i++); + parse = parses[c in pads ? specifier.charAt(i++) : c]; + if (!parse || ((j = parse(d, string, j)) < 0)) return -1; + } else if (c != string.charCodeAt(j++)) { + return -1; + } + } + + return j; + } + + function parsePeriod(d, string, i) { + var n = periodRe.exec(string.slice(i)); + return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1; + } + + function parseShortWeekday(d, string, i) { + var n = shortWeekdayRe.exec(string.slice(i)); + return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; + } + + function parseWeekday(d, string, i) { + var n = weekdayRe.exec(string.slice(i)); + return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; + } + + function parseShortMonth(d, string, i) { + var n = shortMonthRe.exec(string.slice(i)); + return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1; + } + + function parseMonth(d, string, i) { + var n = monthRe.exec(string.slice(i)); + return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1; + } + + function parseLocaleDateTime(d, string, i) { + return parseSpecifier(d, locale_dateTime, string, i); + } + + function parseLocaleDate(d, string, i) { + return parseSpecifier(d, locale_date, string, i); + } + + function parseLocaleTime(d, string, i) { + return parseSpecifier(d, locale_time, string, i); + } + + function formatShortWeekday(d) { + return locale_shortWeekdays[d.getDay()]; + } + + function formatWeekday(d) { + return locale_weekdays[d.getDay()]; + } + + function formatShortMonth(d) { + return locale_shortMonths[d.getMonth()]; + } + + function formatMonth(d) { + return locale_months[d.getMonth()]; + } + + function formatPeriod(d) { + return locale_periods[+(d.getHours() >= 12)]; + } + + function formatQuarter(d) { + return 1 + ~~(d.getMonth() / 3); + } + + function formatUTCShortWeekday(d) { + return locale_shortWeekdays[d.getUTCDay()]; + } + + function formatUTCWeekday(d) { + return locale_weekdays[d.getUTCDay()]; + } + + function formatUTCShortMonth(d) { + return locale_shortMonths[d.getUTCMonth()]; + } + + function formatUTCMonth(d) { + return locale_months[d.getUTCMonth()]; + } + + function formatUTCPeriod(d) { + return locale_periods[+(d.getUTCHours() >= 12)]; + } + + function formatUTCQuarter(d) { + return 1 + ~~(d.getUTCMonth() / 3); + } + + return { + format: function(specifier) { + var f = newFormat(specifier += "", formats); + f.toString = function() { return specifier; }; + return f; + }, + parse: function(specifier) { + var p = newParse(specifier += "", false); + p.toString = function() { return specifier; }; + return p; + }, + utcFormat: function(specifier) { + var f = newFormat(specifier += "", utcFormats); + f.toString = function() { return specifier; }; + return f; + }, + utcParse: function(specifier) { + var p = newParse(specifier += "", true); + p.toString = function() { return specifier; }; + return p; + } + }; +} + +var pads = {"-": "", "_": " ", "0": "0"}, + numberRe = /^\s*\d+/, // note: ignores next directive + percentRe = /^%/, + requoteRe = /[\\^$*+?|[\]().{}]/g; + +function pad(value, fill, width) { + var sign = value < 0 ? "-" : "", + string = (sign ? -value : value) + "", + length = string.length; + return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); +} + +function requote(s) { + return s.replace(requoteRe, "\\$&"); +} + +function formatRe(names) { + return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); +} + +function formatLookup(names) { + var map = {}, i = -1, n = names.length; + while (++i < n) map[names[i].toLowerCase()] = i; + return map; +} + +function parseWeekdayNumberSunday(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 1)); + return n ? (d.w = +n[0], i + n[0].length) : -1; +} + +function parseWeekdayNumberMonday(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 1)); + return n ? (d.u = +n[0], i + n[0].length) : -1; +} + +function parseWeekNumberSunday(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.U = +n[0], i + n[0].length) : -1; +} + +function parseWeekNumberISO(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.V = +n[0], i + n[0].length) : -1; +} + +function parseWeekNumberMonday(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.W = +n[0], i + n[0].length) : -1; +} + +function parseFullYear(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 4)); + return n ? (d.y = +n[0], i + n[0].length) : -1; +} + +function parseYear(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1; +} + +function parseZone(d, string, i) { + var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6)); + return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; +} + +function parseQuarter(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 1)); + return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; +} + +function parseMonthNumber(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.m = n[0] - 1, i + n[0].length) : -1; +} + +function parseDayOfMonth(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.d = +n[0], i + n[0].length) : -1; +} + +function parseDayOfYear(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 3)); + return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; +} + +function parseHour24(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.H = +n[0], i + n[0].length) : -1; +} + +function parseMinutes(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.M = +n[0], i + n[0].length) : -1; +} + +function parseSeconds(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 2)); + return n ? (d.S = +n[0], i + n[0].length) : -1; +} + +function parseMilliseconds(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 3)); + return n ? (d.L = +n[0], i + n[0].length) : -1; +} + +function parseMicroseconds(d, string, i) { + var n = numberRe.exec(string.slice(i, i + 6)); + return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1; +} + +function parseLiteralPercent(d, string, i) { + var n = percentRe.exec(string.slice(i, i + 1)); + return n ? i + n[0].length : -1; +} + +function parseUnixTimestamp(d, string, i) { + var n = numberRe.exec(string.slice(i)); + return n ? (d.Q = +n[0], i + n[0].length) : -1; +} + +function parseUnixTimestampSeconds(d, string, i) { + var n = numberRe.exec(string.slice(i)); + return n ? (d.s = +n[0], i + n[0].length) : -1; +} + +function formatDayOfMonth(d, p) { + return pad(d.getDate(), p, 2); +} + +function formatHour24(d, p) { + return pad(d.getHours(), p, 2); +} + +function formatHour12(d, p) { + return pad(d.getHours() % 12 || 12, p, 2); +} + +function formatDayOfYear(d, p) { + return pad(1 + d3Time.timeDay.count(d3Time.timeYear(d), d), p, 3); +} + +function formatMilliseconds(d, p) { + return pad(d.getMilliseconds(), p, 3); +} + +function formatMicroseconds(d, p) { + return formatMilliseconds(d, p) + "000"; +} + +function formatMonthNumber(d, p) { + return pad(d.getMonth() + 1, p, 2); +} + +function formatMinutes(d, p) { + return pad(d.getMinutes(), p, 2); +} + +function formatSeconds(d, p) { + return pad(d.getSeconds(), p, 2); +} + +function formatWeekdayNumberMonday(d) { + var day = d.getDay(); + return day === 0 ? 7 : day; +} + +function formatWeekNumberSunday(d, p) { + return pad(d3Time.timeSunday.count(d3Time.timeYear(d) - 1, d), p, 2); +} + +function formatWeekNumberISO(d, p) { + var day = d.getDay(); + d = (day >= 4 || day === 0) ? d3Time.timeThursday(d) : d3Time.timeThursday.ceil(d); + return pad(d3Time.timeThursday.count(d3Time.timeYear(d), d) + (d3Time.timeYear(d).getDay() === 4), p, 2); +} + +function formatWeekdayNumberSunday(d) { + return d.getDay(); +} + +function formatWeekNumberMonday(d, p) { + return pad(d3Time.timeMonday.count(d3Time.timeYear(d) - 1, d), p, 2); +} + +function formatYear(d, p) { + return pad(d.getFullYear() % 100, p, 2); +} + +function formatFullYear(d, p) { + return pad(d.getFullYear() % 10000, p, 4); +} + +function formatZone(d) { + var z = d.getTimezoneOffset(); + return (z > 0 ? "-" : (z *= -1, "+")) + + pad(z / 60 | 0, "0", 2) + + pad(z % 60, "0", 2); +} + +function formatUTCDayOfMonth(d, p) { + return pad(d.getUTCDate(), p, 2); +} + +function formatUTCHour24(d, p) { + return pad(d.getUTCHours(), p, 2); +} + +function formatUTCHour12(d, p) { + return pad(d.getUTCHours() % 12 || 12, p, 2); +} + +function formatUTCDayOfYear(d, p) { + return pad(1 + d3Time.utcDay.count(d3Time.utcYear(d), d), p, 3); +} + +function formatUTCMilliseconds(d, p) { + return pad(d.getUTCMilliseconds(), p, 3); +} + +function formatUTCMicroseconds(d, p) { + return formatUTCMilliseconds(d, p) + "000"; +} + +function formatUTCMonthNumber(d, p) { + return pad(d.getUTCMonth() + 1, p, 2); +} + +function formatUTCMinutes(d, p) { + return pad(d.getUTCMinutes(), p, 2); +} + +function formatUTCSeconds(d, p) { + return pad(d.getUTCSeconds(), p, 2); +} + +function formatUTCWeekdayNumberMonday(d) { + var dow = d.getUTCDay(); + return dow === 0 ? 7 : dow; +} + +function formatUTCWeekNumberSunday(d, p) { + return pad(d3Time.utcSunday.count(d3Time.utcYear(d) - 1, d), p, 2); +} + +function formatUTCWeekNumberISO(d, p) { + var day = d.getUTCDay(); + d = (day >= 4 || day === 0) ? d3Time.utcThursday(d) : d3Time.utcThursday.ceil(d); + return pad(d3Time.utcThursday.count(d3Time.utcYear(d), d) + (d3Time.utcYear(d).getUTCDay() === 4), p, 2); +} + +function formatUTCWeekdayNumberSunday(d) { + return d.getUTCDay(); +} + +function formatUTCWeekNumberMonday(d, p) { + return pad(d3Time.utcMonday.count(d3Time.utcYear(d) - 1, d), p, 2); +} + +function formatUTCYear(d, p) { + return pad(d.getUTCFullYear() % 100, p, 2); +} + +function formatUTCFullYear(d, p) { + return pad(d.getUTCFullYear() % 10000, p, 4); +} + +function formatUTCZone() { + return "+0000"; +} + +function formatLiteralPercent() { + return "%"; +} + +function formatUnixTimestamp(d) { + return +d; +} + +function formatUnixTimestampSeconds(d) { + return Math.floor(+d / 1000); +} + +var locale; + +defaultLocale({ + dateTime: "%x, %X", + date: "%-m/%-d/%Y", + time: "%-I:%M:%S %p", + 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"] +}); + +function defaultLocale(definition) { + locale = formatLocale(definition); + exports.timeFormat = locale.format; + exports.timeParse = locale.parse; + exports.utcFormat = locale.utcFormat; + exports.utcParse = locale.utcParse; + return locale; +} + +var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ"; + +function formatIsoNative(date) { + return date.toISOString(); +} + +var formatIso = Date.prototype.toISOString + ? formatIsoNative + : exports.utcFormat(isoSpecifier); + +function parseIsoNative(string) { + var date = new Date(string); + return isNaN(date) ? null : date; +} + +var parseIso = +new Date("2000-01-01T00:00:00.000Z") + ? parseIsoNative + : exports.utcParse(isoSpecifier); + +exports.isoFormat = formatIso; +exports.isoParse = parseIso; +exports.timeFormatDefaultLocale = defaultLocale; +exports.timeFormatLocale = formatLocale; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{"d3-time":148}],148:[function(_dereq_,module,exports){ +// https://d3js.org/d3-time/ v1.1.0 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; + +var t0 = new Date, + t1 = new Date; + +function newInterval(floori, offseti, count, field) { + + function interval(date) { + return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date; + } + + interval.floor = function(date) { + return floori(date = new Date(+date)), date; + }; + + interval.ceil = function(date) { + return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date; + }; + + interval.round = function(date) { + var d0 = interval(date), + d1 = interval.ceil(date); + return date - d0 < d1 - date ? d0 : d1; + }; + + interval.offset = function(date, step) { + return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date; + }; + + interval.range = function(start, stop, step) { + var range = [], previous; + start = interval.ceil(start); + step = step == null ? 1 : Math.floor(step); + if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date + do range.push(previous = new Date(+start)), offseti(start, step), floori(start); + while (previous < start && start < stop); + return range; + }; + + interval.filter = function(test) { + return newInterval(function(date) { + if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1); + }, function(date, step) { + if (date >= date) { + if (step < 0) while (++step <= 0) { + while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty + } else while (--step >= 0) { + while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty + } + } + }); + }; + + if (count) { + interval.count = function(start, end) { + t0.setTime(+start), t1.setTime(+end); + floori(t0), floori(t1); + return Math.floor(count(t0, t1)); + }; + + interval.every = function(step) { + step = Math.floor(step); + return !isFinite(step) || !(step > 0) ? null + : !(step > 1) ? interval + : interval.filter(field + ? function(d) { return field(d) % step === 0; } + : function(d) { return interval.count(0, d) % step === 0; }); + }; + } + + return interval; +} + +var millisecond = newInterval(function() { + // noop +}, function(date, step) { + date.setTime(+date + step); +}, function(start, end) { + return end - start; +}); + +// An optimized implementation for this simple case. +millisecond.every = function(k) { + k = Math.floor(k); + if (!isFinite(k) || !(k > 0)) return null; + if (!(k > 1)) return millisecond; + return newInterval(function(date) { + date.setTime(Math.floor(date / k) * k); + }, function(date, step) { + date.setTime(+date + step * k); + }, function(start, end) { + return (end - start) / k; + }); +}; +var milliseconds = millisecond.range; + +var durationSecond = 1e3; +var durationMinute = 6e4; +var durationHour = 36e5; +var durationDay = 864e5; +var durationWeek = 6048e5; + +var second = newInterval(function(date) { + date.setTime(date - date.getMilliseconds()); +}, function(date, step) { + date.setTime(+date + step * durationSecond); +}, function(start, end) { + return (end - start) / durationSecond; +}, function(date) { + return date.getUTCSeconds(); +}); +var seconds = second.range; + +var minute = newInterval(function(date) { + date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond); +}, function(date, step) { + date.setTime(+date + step * durationMinute); +}, function(start, end) { + return (end - start) / durationMinute; +}, function(date) { + return date.getMinutes(); +}); +var minutes = minute.range; + +var hour = newInterval(function(date) { + date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute); +}, function(date, step) { + date.setTime(+date + step * durationHour); +}, function(start, end) { + return (end - start) / durationHour; +}, function(date) { + return date.getHours(); +}); +var hours = hour.range; + +var day = newInterval(function(date) { + date.setHours(0, 0, 0, 0); +}, function(date, step) { + date.setDate(date.getDate() + step); +}, function(start, end) { + return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay; +}, function(date) { + return date.getDate() - 1; +}); +var days = day.range; + +function weekday(i) { + return newInterval(function(date) { + date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7); + date.setHours(0, 0, 0, 0); + }, function(date, step) { + date.setDate(date.getDate() + step * 7); + }, function(start, end) { + return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek; + }); +} + +var sunday = weekday(0); +var monday = weekday(1); +var tuesday = weekday(2); +var wednesday = weekday(3); +var thursday = weekday(4); +var friday = weekday(5); +var saturday = weekday(6); + +var sundays = sunday.range; +var mondays = monday.range; +var tuesdays = tuesday.range; +var wednesdays = wednesday.range; +var thursdays = thursday.range; +var fridays = friday.range; +var saturdays = saturday.range; + +var month = newInterval(function(date) { + date.setDate(1); + date.setHours(0, 0, 0, 0); +}, function(date, step) { + date.setMonth(date.getMonth() + step); +}, function(start, end) { + return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; +}, function(date) { + return date.getMonth(); +}); +var months = month.range; + +var year = newInterval(function(date) { + date.setMonth(0, 1); + date.setHours(0, 0, 0, 0); +}, function(date, step) { + date.setFullYear(date.getFullYear() + step); +}, function(start, end) { + return end.getFullYear() - start.getFullYear(); +}, function(date) { + return date.getFullYear(); +}); + +// An optimized implementation for this simple case. +year.every = function(k) { + return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) { + date.setFullYear(Math.floor(date.getFullYear() / k) * k); + date.setMonth(0, 1); + date.setHours(0, 0, 0, 0); + }, function(date, step) { + date.setFullYear(date.getFullYear() + step * k); + }); +}; +var years = year.range; + +var utcMinute = newInterval(function(date) { + date.setUTCSeconds(0, 0); +}, function(date, step) { + date.setTime(+date + step * durationMinute); +}, function(start, end) { + return (end - start) / durationMinute; +}, function(date) { + return date.getUTCMinutes(); +}); +var utcMinutes = utcMinute.range; + +var utcHour = newInterval(function(date) { + date.setUTCMinutes(0, 0, 0); +}, function(date, step) { + date.setTime(+date + step * durationHour); +}, function(start, end) { + return (end - start) / durationHour; +}, function(date) { + return date.getUTCHours(); +}); +var utcHours = utcHour.range; + +var utcDay = newInterval(function(date) { + date.setUTCHours(0, 0, 0, 0); +}, function(date, step) { + date.setUTCDate(date.getUTCDate() + step); +}, function(start, end) { + return (end - start) / durationDay; +}, function(date) { + return date.getUTCDate() - 1; +}); +var utcDays = utcDay.range; + +function utcWeekday(i) { + return newInterval(function(date) { + date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7); + date.setUTCHours(0, 0, 0, 0); + }, function(date, step) { + date.setUTCDate(date.getUTCDate() + step * 7); + }, function(start, end) { + return (end - start) / durationWeek; + }); +} + +var utcSunday = utcWeekday(0); +var utcMonday = utcWeekday(1); +var utcTuesday = utcWeekday(2); +var utcWednesday = utcWeekday(3); +var utcThursday = utcWeekday(4); +var utcFriday = utcWeekday(5); +var utcSaturday = utcWeekday(6); + +var utcSundays = utcSunday.range; +var utcMondays = utcMonday.range; +var utcTuesdays = utcTuesday.range; +var utcWednesdays = utcWednesday.range; +var utcThursdays = utcThursday.range; +var utcFridays = utcFriday.range; +var utcSaturdays = utcSaturday.range; + +var utcMonth = newInterval(function(date) { + date.setUTCDate(1); + date.setUTCHours(0, 0, 0, 0); +}, function(date, step) { + date.setUTCMonth(date.getUTCMonth() + step); +}, function(start, end) { + return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; +}, function(date) { + return date.getUTCMonth(); +}); +var utcMonths = utcMonth.range; + +var utcYear = newInterval(function(date) { + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); +}, function(date, step) { + date.setUTCFullYear(date.getUTCFullYear() + step); +}, function(start, end) { + return end.getUTCFullYear() - start.getUTCFullYear(); +}, function(date) { + return date.getUTCFullYear(); +}); + +// An optimized implementation for this simple case. +utcYear.every = function(k) { + return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) { + date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k); + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); + }, function(date, step) { + date.setUTCFullYear(date.getUTCFullYear() + step * k); + }); +}; +var utcYears = utcYear.range; + +exports.timeDay = day; +exports.timeDays = days; +exports.timeFriday = friday; +exports.timeFridays = fridays; +exports.timeHour = hour; +exports.timeHours = hours; +exports.timeInterval = newInterval; +exports.timeMillisecond = millisecond; +exports.timeMilliseconds = milliseconds; +exports.timeMinute = minute; +exports.timeMinutes = minutes; +exports.timeMonday = monday; +exports.timeMondays = mondays; +exports.timeMonth = month; +exports.timeMonths = months; +exports.timeSaturday = saturday; +exports.timeSaturdays = saturdays; +exports.timeSecond = second; +exports.timeSeconds = seconds; +exports.timeSunday = sunday; +exports.timeSundays = sundays; +exports.timeThursday = thursday; +exports.timeThursdays = thursdays; +exports.timeTuesday = tuesday; +exports.timeTuesdays = tuesdays; +exports.timeWednesday = wednesday; +exports.timeWednesdays = wednesdays; +exports.timeWeek = sunday; +exports.timeWeeks = sundays; +exports.timeYear = year; +exports.timeYears = years; +exports.utcDay = utcDay; +exports.utcDays = utcDays; +exports.utcFriday = utcFriday; +exports.utcFridays = utcFridays; +exports.utcHour = utcHour; +exports.utcHours = utcHours; +exports.utcMillisecond = millisecond; +exports.utcMilliseconds = milliseconds; +exports.utcMinute = utcMinute; +exports.utcMinutes = utcMinutes; +exports.utcMonday = utcMonday; +exports.utcMondays = utcMondays; +exports.utcMonth = utcMonth; +exports.utcMonths = utcMonths; +exports.utcSaturday = utcSaturday; +exports.utcSaturdays = utcSaturdays; +exports.utcSecond = second; +exports.utcSeconds = seconds; +exports.utcSunday = utcSunday; +exports.utcSundays = utcSundays; +exports.utcThursday = utcThursday; +exports.utcThursdays = utcThursdays; +exports.utcTuesday = utcTuesday; +exports.utcTuesdays = utcTuesdays; +exports.utcWednesday = utcWednesday; +exports.utcWednesdays = utcWednesdays; +exports.utcWeek = utcSunday; +exports.utcWeeks = utcSundays; +exports.utcYear = utcYear; +exports.utcYears = utcYears; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{}],149:[function(_dereq_,module,exports){ +arguments[4][148][0].apply(exports,arguments) +},{"dup":148}],150:[function(_dereq_,module,exports){ +// https://d3js.org/d3-timer/ v1.0.10 Copyright 2019 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = global || self, factory(global.d3 = global.d3 || {})); +}(this, function (exports) { 'use strict'; + +var frame = 0, // is an animation frame pending? + timeout = 0, // is a timeout pending? + interval = 0, // are any timers active? + pokeDelay = 1000, // how frequently we check for clock skew + taskHead, + taskTail, + clockLast = 0, + clockNow = 0, + clockSkew = 0, + clock = typeof performance === "object" && performance.now ? performance : Date, + setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; + +function now() { + return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); +} + +function clearNow() { + clockNow = 0; +} + +function Timer() { + this._call = + this._time = + this._next = null; +} + +Timer.prototype = timer.prototype = { + constructor: Timer, + restart: function(callback, delay, time) { + if (typeof callback !== "function") throw new TypeError("callback is not a function"); + time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); + if (!this._next && taskTail !== this) { + if (taskTail) taskTail._next = this; + else taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time; + sleep(); + }, + stop: function() { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + } +}; + +function timer(callback, delay, time) { + var t = new Timer; + t.restart(callback, delay, time); + return t; +} + +function timerFlush() { + now(); // Get the current time, if not already set. + ++frame; // Pretend we’ve set an alarm, if we haven’t already. + var t = taskHead, e; + while (t) { + if ((e = clockNow - t._time) >= 0) t._call.call(null, e); + t = t._next; + } + --frame; +} + +function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + frame = timeout = 0; + try { + timerFlush(); + } finally { + frame = 0; + nap(); + clockNow = 0; + } +} + +function poke() { + var now = clock.now(), delay = now - clockLast; + if (delay > pokeDelay) clockSkew -= delay, clockLast = now; +} + +function nap() { + var t0, t1 = taskHead, t2, time = Infinity; + while (t1) { + if (t1._call) { + if (time > t1._time) time = t1._time; + t0 = t1, t1 = t1._next; + } else { + t2 = t1._next, t1._next = null; + t1 = t0 ? t0._next = t2 : taskHead = t2; + } + } + taskTail = t0; + sleep(time); +} + +function sleep(time) { + if (frame) return; // Soonest alarm already set, or will be. + if (timeout) timeout = clearTimeout(timeout); + var delay = time - clockNow; // Strictly less than if we recomputed clockNow. + if (delay > 24) { + if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); + if (interval) interval = clearInterval(interval); + } else { + if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); + frame = 1, setFrame(wake); + } +} + +function timeout$1(callback, delay, time) { + var t = new Timer; + delay = delay == null ? 0 : +delay; + t.restart(function(elapsed) { + t.stop(); + callback(elapsed + delay); + }, delay, time); + return t; +} + +function interval$1(callback, delay, time) { + var t = new Timer, total = delay; + if (delay == null) return t.restart(callback, delay, time), t; + delay = +delay, time = time == null ? now() : +time; + t.restart(function tick(elapsed) { + elapsed += total; + t.restart(tick, total += delay, time); + callback(elapsed); + }, delay, time); + return t; +} + +exports.interval = interval$1; +exports.now = now; +exports.timeout = timeout$1; +exports.timer = timer; +exports.timerFlush = timerFlush; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); + +},{}],151:[function(_dereq_,module,exports){ +module.exports = function () { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) return arguments[i]; + } +}; + +},{}],152:[function(_dereq_,module,exports){ +"use strict" + +var ch = _dereq_("incremental-convex-hull") +var uniq = _dereq_("uniq") + +module.exports = triangulate + +function LiftedPoint(p, i) { + this.point = p + this.index = i +} + +function compareLifted(a, b) { + var ap = a.point + var bp = b.point + var d = ap.length + for(var i=0; i= 2) { + return false + } + } + cell[j] = v + } + return true + }) + } else { + hull = hull.filter(function(cell) { + for(var i=0; i<=d; ++i) { + var v = dindex[cell[i]] + if(v < 0) { + return false + } + cell[i] = v + } + return true + }) + } + + if(d & 1) { + for(var i=0; i>> 31 +} + +module.exports.exponent = function(n) { + var b = module.exports.hi(n) + return ((b<<1) >>> 21) - 1023 +} + +module.exports.fraction = function(n) { + var lo = module.exports.lo(n) + var hi = module.exports.hi(n) + var b = hi & ((1<<20) - 1) + if(hi & 0x7ff00000) { + b += (1<<20) + } + return [lo, b] +} + +module.exports.denormalized = function(n) { + var hi = module.exports.hi(n) + return !(hi & 0x7ff00000) +} +}).call(this)}).call(this,_dereq_("buffer").Buffer) +},{"buffer":105}],154:[function(_dereq_,module,exports){ +module.exports = function(dtype) { + switch (dtype) { + case 'int8': + return Int8Array + case 'int16': + return Int16Array + case 'int32': + return Int32Array + case 'uint8': + return Uint8Array + case 'uint16': + return Uint16Array + case 'uint32': + return Uint32Array + case 'float32': + return Float32Array + case 'float64': + return Float64Array + case 'array': + return Array + case 'uint8_clamped': + return Uint8ClampedArray + } +} + +},{}],155:[function(_dereq_,module,exports){ +"use strict" + +function dupe_array(count, value, i) { + var c = count[i]|0 + if(c <= 0) { + return [] + } + var result = new Array(c), j + if(i === count.length-1) { + for(j=0; j 0) { + return dupe_number(count|0, value) + } + break + case "object": + if(typeof (count.length) === "number") { + return dupe_array(count, value, 0) + } + break + } + return [] +} + +module.exports = dupe +},{}],156:[function(_dereq_,module,exports){ +"use strict" + +module.exports = edgeToAdjacency + +var uniq = _dereq_("uniq") + +function edgeToAdjacency(edges, numVertices) { + var numEdges = edges.length + if(typeof numVertices !== "number") { + numVertices = 0 + for(var i=0; i= minId; + }); + } + } + + function adjacencyStructureSCC(from) { + // Make subgraph starting from vertex minId + subgraph(from); + var g = edges; + + // Find strongly connected components using Tarjan algorithm + var sccs = tarjan(g); + + // Filter out trivial connected components (ie. made of one node) + var ccs = sccs.components.filter(function(scc) { + return scc.length > 1; + }); + + // Find least vertex + var leastVertex = Infinity; + var leastVertexComponent; + for(var i = 0; i < ccs.length; i++) { + for(var j = 0; j < ccs[i].length; j++) { + if(ccs[i][j] < leastVertex) { + leastVertex = ccs[i][j]; + leastVertexComponent = i; + } + } + } + + var cc = ccs[leastVertexComponent]; + + if(!cc) return false; + + // Return the adjacency list of first component + var adjList = edges.map(function(l, index) { + if(cc.indexOf(index) === -1) return []; + return l.filter(function(i) { + return cc.indexOf(i) !== -1; + }); + }); + + return { + leastVertex: leastVertex, + adjList: adjList + }; + } + + s = 0; + var n = edges.length; + while(s < n) { + // find strong component with least vertex in + // subgraph starting from vertex `s` + var p = adjacencyStructureSCC(s); + + // Its least vertex + s = p.leastVertex; + // Its adjacency list + Ak = p.adjList; + + if(Ak) { + for(var i = 0; i < Ak.length; i++) { + for(var j = 0; j < Ak[i].length; j++) { + var vertexId = Ak[i][j]; + blocked[+vertexId] = false; + B[vertexId] = {}; + } + } + circuit(s); + s = s + 1; + } else { + s = n; + } + + } + + if(cb) { + return; + } else { + return circuits; + } +}; + +},{"strongly-connected-components":467}],158:[function(_dereq_,module,exports){ +"use strict" + +module.exports = extractPlanes + +function extractPlanes(M, zNear, zFar) { + var z = zNear || 0.0 + var zf = zFar || 1.0 + return [ + [ M[12] + M[0], M[13] + M[1], M[14] + M[2], M[15] + M[3] ], + [ M[12] - M[0], M[13] - M[1], M[14] - M[2], M[15] - M[3] ], + [ M[12] + M[4], M[13] + M[5], M[14] + M[6], M[15] + M[7] ], + [ M[12] - M[4], M[13] - M[5], M[14] - M[6], M[15] - M[7] ], + [ z*M[12] + M[8], z*M[13] + M[9], z*M[14] + M[10], z*M[15] + M[11] ], + [ zf*M[12] - M[8], zf*M[13] - M[9], zf*M[14] - M[10], zf*M[15] - M[11] ] + ] +} +},{}],159:[function(_dereq_,module,exports){ +/** + * inspired by is-number + * but significantly simplified and sped up by ignoring number and string constructors + * ie these return false: + * new Number(1) + * new String('1') + */ + +'use strict'; + +var allBlankCharCodes = _dereq_('is-string-blank'); + +module.exports = function(n) { + var type = typeof n; + if(type === 'string') { + var original = n; + n = +n; + // whitespace strings cast to zero - filter them out + if(n===0 && allBlankCharCodes(original)) return false; + } + else if(type !== 'number') return false; + + return n - n < 1; +}; + +},{"is-string-blank":354}],160:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createFilteredVector + +var cubicHermite = _dereq_('cubic-hermite') +var bsearch = _dereq_('binary-search-bounds') + +function clamp(lo, hi, x) { + return Math.min(hi, Math.max(lo, x)) +} + +function FilteredVector(state0, velocity0, t0) { + this.dimension = state0.length + this.bounds = [ new Array(this.dimension), new Array(this.dimension) ] + for(var i=0; i= n-1) { + var ptr = state.length-1 + var tf = t - time[n-1] + for(var i=0; i= n-1) { + var ptr = state.length-1 + var tf = t - time[n-1] + for(var i=0; i=0; --i) { + if(velocity[--ptr]) { + return false + } + } + return true +} + +proto.jump = function(t) { + var t0 = this.lastT() + var d = this.dimension + if(t < t0 || arguments.length !== d+1) { + return + } + var state = this._state + var velocity = this._velocity + var ptr = state.length-this.dimension + var bounds = this.bounds + var lo = bounds[0] + var hi = bounds[1] + this._time.push(t0, t) + for(var j=0; j<2; ++j) { + for(var i=0; i0; --i) { + state.push(clamp(lo[i-1], hi[i-1], arguments[i])) + velocity.push(0) + } +} + +proto.push = function(t) { + var t0 = this.lastT() + var d = this.dimension + if(t < t0 || arguments.length !== d+1) { + return + } + var state = this._state + var velocity = this._velocity + var ptr = state.length-this.dimension + var dt = t - t0 + var bounds = this.bounds + var lo = bounds[0] + var hi = bounds[1] + var sf = (dt > 1e-6) ? 1/dt : 0 + this._time.push(t) + for(var i=d; i>0; --i) { + var xc = clamp(lo[i-1], hi[i-1], arguments[i]) + state.push(xc) + velocity.push((xc - state[ptr++]) * sf) + } +} + +proto.set = function(t) { + var d = this.dimension + if(t < this.lastT() || arguments.length !== d+1) { + return + } + var state = this._state + var velocity = this._velocity + var bounds = this.bounds + var lo = bounds[0] + var hi = bounds[1] + this._time.push(t) + for(var i=d; i>0; --i) { + state.push(clamp(lo[i-1], hi[i-1], arguments[i])) + velocity.push(0) + } +} + +proto.move = function(t) { + var t0 = this.lastT() + var d = this.dimension + if(t <= t0 || arguments.length !== d+1) { + return + } + var state = this._state + var velocity = this._velocity + var statePtr = state.length - this.dimension + var bounds = this.bounds + var lo = bounds[0] + var hi = bounds[1] + var dt = t - t0 + var sf = (dt > 1e-6) ? 1/dt : 0.0 + this._time.push(t) + for(var i=d; i>0; --i) { + var dx = arguments[i] + state.push(clamp(lo[i-1], hi[i-1], state[statePtr++] + dx)) + velocity.push(dx * sf) + } +} + +proto.idle = function(t) { + var t0 = this.lastT() + if(t < t0) { + return + } + var d = this.dimension + var state = this._state + var velocity = this._velocity + var statePtr = state.length-d + var bounds = this.bounds + var lo = bounds[0] + var hi = bounds[1] + var dt = t - t0 + this._time.push(t) + for(var i=d-1; i>=0; --i) { + state.push(clamp(lo[i], hi[i], state[statePtr] + dt * velocity[statePtr])) + velocity.push(0) + statePtr += 1 + } +} + +function getZero(d) { + var result = new Array(d) + for(var i=0; i=0; --s) { + var n = n_stack[s] + if(d_stack[s] <= 0) { + n_stack[s] = new RBNode(n._color, n.key, n.value, n_stack[s+1], n.right, n._count+1) + } else { + n_stack[s] = new RBNode(n._color, n.key, n.value, n.left, n_stack[s+1], n._count+1) + } + } + //Rebalance tree using rotations + //console.log("start insert", key, d_stack) + for(var s=n_stack.length-1; s>1; --s) { + var p = n_stack[s-1] + var n = n_stack[s] + if(p._color === BLACK || n._color === BLACK) { + break + } + var pp = n_stack[s-2] + if(pp.left === p) { + if(p.left === n) { + var y = pp.right + if(y && y._color === RED) { + //console.log("LLr") + p._color = BLACK + pp.right = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("LLb") + pp._color = RED + pp.left = p.right + p._color = BLACK + p.right = pp + n_stack[s-2] = p + n_stack[s-1] = n + recount(pp) + recount(p) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.left === pp) { + ppp.left = p + } else { + ppp.right = p + } + } + break + } + } else { + var y = pp.right + if(y && y._color === RED) { + //console.log("LRr") + p._color = BLACK + pp.right = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("LRb") + p.right = n.left + pp._color = RED + pp.left = n.right + n._color = BLACK + n.left = p + n.right = pp + n_stack[s-2] = n + n_stack[s-1] = p + recount(pp) + recount(p) + recount(n) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.left === pp) { + ppp.left = n + } else { + ppp.right = n + } + } + break + } + } + } else { + if(p.right === n) { + var y = pp.left + if(y && y._color === RED) { + //console.log("RRr", y.key) + p._color = BLACK + pp.left = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("RRb") + pp._color = RED + pp.right = p.left + p._color = BLACK + p.left = pp + n_stack[s-2] = p + n_stack[s-1] = n + recount(pp) + recount(p) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.right === pp) { + ppp.right = p + } else { + ppp.left = p + } + } + break + } + } else { + var y = pp.left + if(y && y._color === RED) { + //console.log("RLr") + p._color = BLACK + pp.left = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("RLb") + p.left = n.right + pp._color = RED + pp.right = n.left + n._color = BLACK + n.right = p + n.left = pp + n_stack[s-2] = n + n_stack[s-1] = p + recount(pp) + recount(p) + recount(n) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.right === pp) { + ppp.right = n + } else { + ppp.left = n + } + } + break + } + } + } + } + //Return new tree + n_stack[0]._color = BLACK + return new RedBlackTree(cmp, n_stack[0]) +} + + +//Visit all nodes inorder +function doVisitFull(visit, node) { + if(node.left) { + var v = doVisitFull(visit, node.left) + if(v) { return v } + } + var v = visit(node.key, node.value) + if(v) { return v } + if(node.right) { + return doVisitFull(visit, node.right) + } +} + +//Visit half nodes in order +function doVisitHalf(lo, compare, visit, node) { + var l = compare(lo, node.key) + if(l <= 0) { + if(node.left) { + var v = doVisitHalf(lo, compare, visit, node.left) + if(v) { return v } + } + var v = visit(node.key, node.value) + if(v) { return v } + } + if(node.right) { + return doVisitHalf(lo, compare, visit, node.right) + } +} + +//Visit all nodes within a range +function doVisit(lo, hi, compare, visit, node) { + var l = compare(lo, node.key) + var h = compare(hi, node.key) + var v + if(l <= 0) { + if(node.left) { + v = doVisit(lo, hi, compare, visit, node.left) + if(v) { return v } + } + if(h > 0) { + v = visit(node.key, node.value) + if(v) { return v } + } + } + if(h > 0 && node.right) { + return doVisit(lo, hi, compare, visit, node.right) + } +} + + +proto.forEach = function rbTreeForEach(visit, lo, hi) { + if(!this.root) { + return + } + switch(arguments.length) { + case 1: + return doVisitFull(visit, this.root) + break + + case 2: + return doVisitHalf(lo, this._compare, visit, this.root) + break + + case 3: + if(this._compare(lo, hi) >= 0) { + return + } + return doVisit(lo, hi, this._compare, visit, this.root) + break + } +} + +//First item in list +Object.defineProperty(proto, "begin", { + get: function() { + var stack = [] + var n = this.root + while(n) { + stack.push(n) + n = n.left + } + return new RedBlackTreeIterator(this, stack) + } +}) + +//Last item in list +Object.defineProperty(proto, "end", { + get: function() { + var stack = [] + var n = this.root + while(n) { + stack.push(n) + n = n.right + } + return new RedBlackTreeIterator(this, stack) + } +}) + +//Find the ith item in the tree +proto.at = function(idx) { + if(idx < 0) { + return new RedBlackTreeIterator(this, []) + } + var n = this.root + var stack = [] + while(true) { + stack.push(n) + if(n.left) { + if(idx < n.left._count) { + n = n.left + continue + } + idx -= n.left._count + } + if(!idx) { + return new RedBlackTreeIterator(this, stack) + } + idx -= 1 + if(n.right) { + if(idx >= n.right._count) { + break + } + n = n.right + } else { + break + } + } + return new RedBlackTreeIterator(this, []) +} + +proto.ge = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d <= 0) { + last_ptr = stack.length + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.gt = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d < 0) { + last_ptr = stack.length + } + if(d < 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.lt = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d > 0) { + last_ptr = stack.length + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.le = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d >= 0) { + last_ptr = stack.length + } + if(d < 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +//Finds the item with key if it exists +proto.find = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d === 0) { + return new RedBlackTreeIterator(this, stack) + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + return new RedBlackTreeIterator(this, []) +} + +//Removes item with key from tree +proto.remove = function(key) { + var iter = this.find(key) + if(iter) { + return iter.remove() + } + return this +} + +//Returns the item at `key` +proto.get = function(key) { + var cmp = this._compare + var n = this.root + while(n) { + var d = cmp(key, n.key) + if(d === 0) { + return n.value + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + return +} + +//Iterator for red black tree +function RedBlackTreeIterator(tree, stack) { + this.tree = tree + this._stack = stack +} + +var iproto = RedBlackTreeIterator.prototype + +//Test if iterator is valid +Object.defineProperty(iproto, "valid", { + get: function() { + return this._stack.length > 0 + } +}) + +//Node of the iterator +Object.defineProperty(iproto, "node", { + get: function() { + if(this._stack.length > 0) { + return this._stack[this._stack.length-1] + } + return null + }, + enumerable: true +}) + +//Makes a copy of an iterator +iproto.clone = function() { + return new RedBlackTreeIterator(this.tree, this._stack.slice()) +} + +//Swaps two nodes +function swapNode(n, v) { + n.key = v.key + n.value = v.value + n.left = v.left + n.right = v.right + n._color = v._color + n._count = v._count +} + +//Fix up a double black node in a tree +function fixDoubleBlack(stack) { + var n, p, s, z + for(var i=stack.length-1; i>=0; --i) { + n = stack[i] + if(i === 0) { + n._color = BLACK + return + } + //console.log("visit node:", n.key, i, stack[i].key, stack[i-1].key) + p = stack[i-1] + if(p.left === n) { + //console.log("left child") + s = p.right + if(s.right && s.right._color === RED) { + //console.log("case 1: right sibling child red") + s = p.right = cloneNode(s) + z = s.right = cloneNode(s.right) + p.right = s.left + s.left = p + s.right = z + s._color = p._color + n._color = BLACK + p._color = BLACK + z._color = BLACK + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = s + } else { + pp.right = s + } + } + stack[i-1] = s + return + } else if(s.left && s.left._color === RED) { + //console.log("case 1: left sibling child red") + s = p.right = cloneNode(s) + z = s.left = cloneNode(s.left) + p.right = z.left + s.left = z.right + z.left = p + z.right = s + z._color = p._color + p._color = BLACK + s._color = BLACK + n._color = BLACK + recount(p) + recount(s) + recount(z) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = z + } else { + pp.right = z + } + } + stack[i-1] = z + return + } + if(s._color === BLACK) { + if(p._color === RED) { + //console.log("case 2: black sibling, red parent", p.right.value) + p._color = BLACK + p.right = repaint(RED, s) + return + } else { + //console.log("case 2: black sibling, black parent", p.right.value) + p.right = repaint(RED, s) + continue + } + } else { + //console.log("case 3: red sibling") + s = cloneNode(s) + p.right = s.left + s.left = p + s._color = p._color + p._color = RED + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = s + } else { + pp.right = s + } + } + stack[i-1] = s + stack[i] = p + if(i+1 < stack.length) { + stack[i+1] = n + } else { + stack.push(n) + } + i = i+2 + } + } else { + //console.log("right child") + s = p.left + if(s.left && s.left._color === RED) { + //console.log("case 1: left sibling child red", p.value, p._color) + s = p.left = cloneNode(s) + z = s.left = cloneNode(s.left) + p.left = s.right + s.right = p + s.left = z + s._color = p._color + n._color = BLACK + p._color = BLACK + z._color = BLACK + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = s + } else { + pp.left = s + } + } + stack[i-1] = s + return + } else if(s.right && s.right._color === RED) { + //console.log("case 1: right sibling child red") + s = p.left = cloneNode(s) + z = s.right = cloneNode(s.right) + p.left = z.right + s.right = z.left + z.right = p + z.left = s + z._color = p._color + p._color = BLACK + s._color = BLACK + n._color = BLACK + recount(p) + recount(s) + recount(z) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = z + } else { + pp.left = z + } + } + stack[i-1] = z + return + } + if(s._color === BLACK) { + if(p._color === RED) { + //console.log("case 2: black sibling, red parent") + p._color = BLACK + p.left = repaint(RED, s) + return + } else { + //console.log("case 2: black sibling, black parent") + p.left = repaint(RED, s) + continue + } + } else { + //console.log("case 3: red sibling") + s = cloneNode(s) + p.left = s.right + s.right = p + s._color = p._color + p._color = RED + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = s + } else { + pp.left = s + } + } + stack[i-1] = s + stack[i] = p + if(i+1 < stack.length) { + stack[i+1] = n + } else { + stack.push(n) + } + i = i+2 + } + } + } +} + +//Removes item at iterator from tree +iproto.remove = function() { + var stack = this._stack + if(stack.length === 0) { + return this.tree + } + //First copy path to node + var cstack = new Array(stack.length) + var n = stack[stack.length-1] + cstack[cstack.length-1] = new RBNode(n._color, n.key, n.value, n.left, n.right, n._count) + for(var i=stack.length-2; i>=0; --i) { + var n = stack[i] + if(n.left === stack[i+1]) { + cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) + } else { + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + } + + //Get node + n = cstack[cstack.length-1] + //console.log("start remove: ", n.value) + + //If not leaf, then swap with previous node + if(n.left && n.right) { + //console.log("moving to leaf") + + //First walk to previous leaf + var split = cstack.length + n = n.left + while(n.right) { + cstack.push(n) + n = n.right + } + //Copy path to leaf + var v = cstack[split-1] + cstack.push(new RBNode(n._color, v.key, v.value, n.left, n.right, n._count)) + cstack[split-1].key = n.key + cstack[split-1].value = n.value + + //Fix up stack + for(var i=cstack.length-2; i>=split; --i) { + n = cstack[i] + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + cstack[split-1].left = cstack[split] + } + //console.log("stack=", cstack.map(function(v) { return v.value })) + + //Remove leaf node + n = cstack[cstack.length-1] + if(n._color === RED) { + //Easy case: removing red leaf + //console.log("RED leaf") + var p = cstack[cstack.length-2] + if(p.left === n) { + p.left = null + } else if(p.right === n) { + p.right = null + } + cstack.pop() + for(var i=0; i 0) { + return this._stack[this._stack.length-1].key + } + return + }, + enumerable: true +}) + +//Returns value +Object.defineProperty(iproto, "value", { + get: function() { + if(this._stack.length > 0) { + return this._stack[this._stack.length-1].value + } + return + }, + enumerable: true +}) + + +//Returns the position of this iterator in the sorted list +Object.defineProperty(iproto, "index", { + get: function() { + var idx = 0 + var stack = this._stack + if(stack.length === 0) { + var r = this.tree.root + if(r) { + return r._count + } + return 0 + } else if(stack[stack.length-1].left) { + idx = stack[stack.length-1].left._count + } + for(var s=stack.length-2; s>=0; --s) { + if(stack[s+1] === stack[s].right) { + ++idx + if(stack[s].left) { + idx += stack[s].left._count + } + } + } + return idx + }, + enumerable: true +}) + +//Advances iterator to next element in list +iproto.next = function() { + var stack = this._stack + if(stack.length === 0) { + return + } + var n = stack[stack.length-1] + if(n.right) { + n = n.right + while(n) { + stack.push(n) + n = n.left + } + } else { + stack.pop() + while(stack.length > 0 && stack[stack.length-1].right === n) { + n = stack[stack.length-1] + stack.pop() + } + } +} + +//Checks if iterator is at end of tree +Object.defineProperty(iproto, "hasNext", { + get: function() { + var stack = this._stack + if(stack.length === 0) { + return false + } + if(stack[stack.length-1].right) { + return true + } + for(var s=stack.length-1; s>0; --s) { + if(stack[s-1].left === stack[s]) { + return true + } + } + return false + } +}) + +//Update value +iproto.update = function(value) { + var stack = this._stack + if(stack.length === 0) { + throw new Error("Can't update empty node!") + } + var cstack = new Array(stack.length) + var n = stack[stack.length-1] + cstack[cstack.length-1] = new RBNode(n._color, n.key, value, n.left, n.right, n._count) + for(var i=stack.length-2; i>=0; --i) { + n = stack[i] + if(n.left === stack[i+1]) { + cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) + } else { + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + } + return new RedBlackTree(this.tree._compare, cstack[0]) +} + +//Moves iterator backward one element +iproto.prev = function() { + var stack = this._stack + if(stack.length === 0) { + return + } + var n = stack[stack.length-1] + if(n.left) { + n = n.left + while(n) { + stack.push(n) + n = n.right + } + } else { + stack.pop() + while(stack.length > 0 && stack[stack.length-1].left === n) { + n = stack[stack.length-1] + stack.pop() + } + } +} + +//Checks if iterator is at start of tree +Object.defineProperty(iproto, "hasPrev", { + get: function() { + var stack = this._stack + if(stack.length === 0) { + return false + } + if(stack[stack.length-1].left) { + return true + } + for(var s=stack.length-1; s>0; --s) { + if(stack[s-1].right === stack[s]) { + return true + } + } + return false + } +}) + +//Default comparison function +function defaultCompare(a, b) { + if(a < b) { + return -1 + } + if(a > b) { + return 1 + } + return 0 +} + +//Build a tree +function createRBTree(compare) { + return new RedBlackTree(compare || defaultCompare, null) +} +},{}],162:[function(_dereq_,module,exports){ +module.exports = getCanvasContext +function getCanvasContext (type, opts) { + if (typeof type !== 'string') { + throw new TypeError('must specify type string') + } + + opts = opts || {} + + if (typeof document === 'undefined' && !opts.canvas) { + return null // check for Node + } + + var canvas = opts.canvas || document.createElement('canvas') + if (typeof opts.width === 'number') { + canvas.width = opts.width + } + if (typeof opts.height === 'number') { + canvas.height = opts.height + } + + var attribs = opts + var gl + try { + var names = [ type ] + // prefix GL contexts + if (type.indexOf('webgl') === 0) { + names.push('experimental-' + type) + } + + for (var i = 0; i < names.length; i++) { + gl = canvas.getContext(names[i], attribs) + if (gl) return gl + } + } catch (e) { + gl = null + } + return (gl || null) // ensure null on fail +} + +},{}],163:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createAxes + +var createText = _dereq_('./lib/text.js') +var createLines = _dereq_('./lib/lines.js') +var createBackground = _dereq_('./lib/background.js') +var getCubeProperties = _dereq_('./lib/cube.js') +var Ticks = _dereq_('./lib/ticks.js') + +var identity = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]) + +function copyVec3(a, b) { + a[0] = b[0] + a[1] = b[1] + a[2] = b[2] + return a +} + +function Axes(gl) { + this.gl = gl + + this.pixelRatio = 1 + + this.bounds = [ [-10, -10, -10], + [ 10, 10, 10] ] + this.ticks = [ [], [], [] ] + this.autoTicks = true + this.tickSpacing = [ 1, 1, 1 ] + + this.tickEnable = [ true, true, true ] + this.tickFont = [ 'sans-serif', 'sans-serif', 'sans-serif' ] + this.tickSize = [ 12, 12, 12 ] + this.tickAngle = [ 0, 0, 0 ] + this.tickAlign = [ 'auto', 'auto', 'auto' ] + 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 = [ true, true, true ] + this.labelFont = 'sans-serif' + this.labelSize = [ 20, 20, 20 ] + this.labelAngle = [ 0, 0, 0 ] + this.labelAlign = [ 'auto', 'auto', 'auto' ] + this.labelColor = [ [0,0,0,1], [0,0,0,1], [0,0,0,1] ] + this.labelPad = [ 10, 10, 10 ] + + this.lineEnable = [ true, true, true ] + this.lineMirror = [ false, false, false ] + this.lineWidth = [ 1, 1, 1 ] + this.lineColor = [ [0,0,0,1], [0,0,0,1], [0,0,0,1] ] + + this.lineTickEnable = [ true, true, true ] + this.lineTickMirror = [ false, false, false ] + 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 = [ true, true, true ] + this.gridWidth = [ 1, 1, 1 ] + this.gridColor = [ [0,0,0,1], [0,0,0,1], [0,0,0,1] ] + + this.zeroEnable = [ true, true, true ] + this.zeroLineColor = [ [0,0,0,1], [0,0,0,1], [0,0,0,1] ] + this.zeroLineWidth = [ 2, 2, 2 ] + + this.backgroundEnable = [ false, false, false ] + this.backgroundColor = [ [0.8, 0.8, 0.8, 0.5], + [0.8, 0.8, 0.8, 0.5], + [0.8, 0.8, 0.8, 0.5] ] + + this._firstInit = true + this._text = null + this._lines = null + this._background = createBackground(gl) +} + +var proto = Axes.prototype + +proto.update = function(options) { + options = options || {} + + //Option parsing helper functions + function parseOption(nest, cons, name) { + if(name in options) { + var opt = options[name] + var prev = this[name] + var next + if(nest ? (Array.isArray(opt) && Array.isArray(opt[0])) : + Array.isArray(opt) ) { + this[name] = next = [ cons(opt[0]), cons(opt[1]), cons(opt[2]) ] + } else { + this[name] = next = [ cons(opt), cons(opt), cons(opt) ] + } + for(var i=0; i<3; ++i) { + if(next[i] !== prev[i]) { + return true + } + } + } + return false + } + + var NUMBER = parseOption.bind(this, false, Number) + var BOOLEAN = parseOption.bind(this, false, Boolean) + var STRING = parseOption.bind(this, false, String) + var COLOR = parseOption.bind(this, true, function(v) { + if(Array.isArray(v)) { + if(v.length === 3) { + return [ +v[0], +v[1], +v[2], 1.0 ] + } else if(v.length === 4) { + return [ +v[0], +v[1], +v[2], +v[3] ] + } + } + return [ 0, 0, 0, 1 ] + }) + + //Tick marks and bounds + var nextTicks + var ticksUpdate = false + var boundsChanged = false + if('bounds' in options) { + var bounds = options.bounds +i_loop: + for(var i=0; i<2; ++i) { + for(var j=0; j<3; ++j) { + if(bounds[i][j] !== this.bounds[i][j]) { + boundsChanged = true + } + this.bounds[i][j] = bounds[i][j] + } + } + } + if('ticks' in options) { + nextTicks = options.ticks + ticksUpdate = true + this.autoTicks = false + for(var i=0; i<3; ++i) { + this.tickSpacing[i] = 0.0 + } + } else if(NUMBER('tickSpacing')) { + this.autoTicks = true + boundsChanged = true + } + + if(this._firstInit) { + if(!('ticks' in options || 'tickSpacing' in options)) { + this.autoTicks = true + } + + //Force tick recomputation on first update + boundsChanged = true + ticksUpdate = true + this._firstInit = false + } + + if(boundsChanged && this.autoTicks) { + nextTicks = Ticks.create(this.bounds, this.tickSpacing) + ticksUpdate = true + } + + //Compare next ticks to previous ticks, only update if needed + if(ticksUpdate) { + for(var i=0; i<3; ++i) { + nextTicks[i].sort(function(a,b) { + return a.x-b.x + }) + } + if(Ticks.equal(nextTicks, this.ticks)) { + ticksUpdate = false + } else { + this.ticks = nextTicks + } + } + + //Parse tick properties + BOOLEAN('tickEnable') + if(STRING('tickFont')) { + ticksUpdate = true //If font changes, must rebuild vbo + } + NUMBER('tickSize') + NUMBER('tickAngle') + NUMBER('tickPad') + COLOR('tickColor') + + //Axis labels + var labelUpdate = STRING('labels') + if(STRING('labelFont')) { + labelUpdate = true + } + BOOLEAN('labelEnable') + NUMBER('labelSize') + NUMBER('labelPad') + COLOR('labelColor') + + //Axis lines + BOOLEAN('lineEnable') + BOOLEAN('lineMirror') + NUMBER('lineWidth') + COLOR('lineColor') + + //Axis line ticks + BOOLEAN('lineTickEnable') + BOOLEAN('lineTickMirror') + NUMBER('lineTickLength') + NUMBER('lineTickWidth') + COLOR('lineTickColor') + + //Grid lines + BOOLEAN('gridEnable') + NUMBER('gridWidth') + COLOR('gridColor') + + //Zero line + BOOLEAN('zeroEnable') + COLOR('zeroLineColor') + NUMBER('zeroLineWidth') + + //Background + BOOLEAN('backgroundEnable') + COLOR('backgroundColor') + + //Update text if necessary + if(!this._text) { + this._text = createText( + this.gl, + this.bounds, + this.labels, + this.labelFont, + this.ticks, + this.tickFont) + } else if(this._text && (labelUpdate || ticksUpdate)) { + this._text.update( + this.bounds, + this.labels, + this.labelFont, + this.ticks, + this.tickFont) + } + + //Update lines if necessary + if(this._lines && ticksUpdate) { + this._lines.dispose() + this._lines = null + } + if(!this._lines) { + this._lines = createLines(this.gl, this.bounds, this.ticks) + } +} + +function OffsetInfo() { + this.primalOffset = [0,0,0] + this.primalMinor = [0,0,0] + this.mirrorOffset = [0,0,0] + this.mirrorMinor = [0,0,0] +} + +var LINE_OFFSET = [ new OffsetInfo(), new OffsetInfo(), new OffsetInfo() ] + +function computeLineOffset(result, i, bounds, cubeEdges, cubeAxis) { + var primalOffset = result.primalOffset + var primalMinor = result.primalMinor + var dualOffset = result.mirrorOffset + var dualMinor = result.mirrorMinor + var e = cubeEdges[i] + + //Calculate offsets + for(var j=0; j<3; ++j) { + if(i === j) { + continue + } + var a = primalOffset, + b = dualOffset, + c = primalMinor, + d = dualMinor + if(e & (1< 0) { + c[j] = -1 + d[j] = 0 + } else { + c[j] = 0 + d[j] = +1 + } + } +} + +var CUBE_ENABLE = [0,0,0] +var DEFAULT_PARAMS = { + model: identity, + view: identity, + projection: identity, + _ortho: false +} + +proto.isOpaque = function() { + return true +} + +proto.isTransparent = function() { + return false +} + +proto.drawTransparent = function(params) {} + +var ALIGN_OPTION_AUTO = 0 // i.e. as defined in the shader the text would rotate to stay upwards range: [-90,90] + +var PRIMAL_MINOR = [0,0,0] +var MIRROR_MINOR = [0,0,0] +var PRIMAL_OFFSET = [0,0,0] + +proto.draw = function(params) { + params = params || DEFAULT_PARAMS + + var gl = this.gl + + //Geometry for camera and axes + var model = params.model || identity + var view = params.view || identity + var projection = params.projection || identity + var bounds = this.bounds + var isOrtho = params._ortho || false + + //Unpack axis info + var cubeParams = getCubeProperties(model, view, projection, bounds, isOrtho) + var cubeEdges = cubeParams.cubeEdges + var cubeAxis = cubeParams.axis + + var cx = view[12] + var cy = view[13] + var cz = view[14] + var cw = view[15] + + var orthoFix = (isOrtho) ? 2 : 1 // double up padding for orthographic ticks & labels + var pixelScaleF = orthoFix * this.pixelRatio * (projection[3]*cx + projection[7]*cy + projection[11]*cz + projection[15]*cw) / gl.drawingBufferHeight + + for(var i=0; i<3; ++i) { + this.lastCubeProps.cubeEdges[i] = cubeEdges[i] + this.lastCubeProps.axis[i] = cubeAxis[i] + } + + //Compute axis info + var lineOffset = LINE_OFFSET + for(var i=0; i<3; ++i) { + computeLineOffset( + LINE_OFFSET[i], + i, + this.bounds, + cubeEdges, + cubeAxis) + } + + //Set up state parameters + var gl = this.gl + + //Draw background first + var cubeEnable = CUBE_ENABLE + for(var i=0; i<3; ++i) { + if(this.backgroundEnable[i]) { + cubeEnable[i] = cubeAxis[i] + } else { + cubeEnable[i] = 0 + } + } + + this._background.draw( + model, + view, + projection, + bounds, + cubeEnable, + this.backgroundColor) + + //Draw lines + this._lines.bind( + model, + view, + projection, + this) + + //First draw grid lines and zero lines + for(var i=0; i<3; ++i) { + var x = [0,0,0] + if(cubeAxis[i] > 0) { + x[i] = bounds[1][i] + } else { + x[i] = bounds[0][i] + } + + //Draw grid lines + for(var j=0; j<2; ++j) { + var u = (i + 1 + j) % 3 + var v = (i + 1 + (j^1)) % 3 + if(this.gridEnable[u]) { + this._lines.drawGrid(u, v, this.bounds, x, this.gridColor[u], this.gridWidth[u]*this.pixelRatio) + } + } + + //Draw zero lines (need to do this AFTER all grid lines are drawn) + for(var j=0; j<2; ++j) { + var u = (i + 1 + j) % 3 + var v = (i + 1 + (j^1)) % 3 + if(this.zeroEnable[v]) { + //Check if zero line in bounds + if(Math.min(bounds[0][v], bounds[1][v]) <= 0 && Math.max(bounds[0][v], bounds[1][v]) >= 0) { + this._lines.drawZero(u, v, this.bounds, x, this.zeroLineColor[v], this.zeroLineWidth[v]*this.pixelRatio) + } + } + } + } + + //Then draw axis lines and tick marks + for(var i=0; i<3; ++i) { + + //Draw axis lines + if(this.lineEnable[i]) { + this._lines.drawAxisLine(i, this.bounds, lineOffset[i].primalOffset, this.lineColor[i], this.lineWidth[i]*this.pixelRatio) + } + if(this.lineMirror[i]) { + this._lines.drawAxisLine(i, this.bounds, lineOffset[i].mirrorOffset, this.lineColor[i], this.lineWidth[i]*this.pixelRatio) + } + + //Compute minor axes + var primalMinor = copyVec3(PRIMAL_MINOR, lineOffset[i].primalMinor) + var mirrorMinor = copyVec3(MIRROR_MINOR, lineOffset[i].mirrorMinor) + var tickLength = this.lineTickLength + for(var j=0; j<3; ++j) { + var scaleFactor = pixelScaleF / model[5*j] + primalMinor[j] *= tickLength[j] * scaleFactor + mirrorMinor[j] *= tickLength[j] * scaleFactor + } + + + + //Draw axis line ticks + if(this.lineTickEnable[i]) { + this._lines.drawAxisTicks(i, lineOffset[i].primalOffset, primalMinor, this.lineTickColor[i], this.lineTickWidth[i]*this.pixelRatio) + } + if(this.lineTickMirror[i]) { + this._lines.drawAxisTicks(i, lineOffset[i].mirrorOffset, mirrorMinor, this.lineTickColor[i], this.lineTickWidth[i]*this.pixelRatio) + } + } + this._lines.unbind() + + //Draw text sprites + this._text.bind( + model, + view, + projection, + this.pixelRatio) + + var alignOpt // options in shader are from this list {-1, 0, 1, 2, 3, ..., n} + // -1: backward compatible + // 0: raw data + // 1: auto align, free angles + // 2: auto align, horizontal or vertical + //3-n: auto align, round to n directions e.g. 12 -> round to angles with 30-degree steps + + var hv_ratio = 0.5 // can have an effect on the ratio between horizontals and verticals when using option 2 + + var enableAlign + var alignDir + + function alignTo(i) { + alignDir = [0,0,0] + alignDir[i] = 1 + } + + function solveTickAlignments(i, minor, major) { + + var i1 = (i + 1) % 3 + var i2 = (i + 2) % 3 + + var A = minor[i1] + var B = minor[i2] + var C = major[i1] + var D = major[i2] + + if ((A > 0) && (D > 0)) { alignTo(i1); return; } + else if ((A > 0) && (D < 0)) { alignTo(i1); return; } + else if ((A < 0) && (D > 0)) { alignTo(i1); return; } + else if ((A < 0) && (D < 0)) { alignTo(i1); return; } + else if ((B > 0) && (C > 0)) { alignTo(i2); return; } + else if ((B > 0) && (C < 0)) { alignTo(i2); return; } + else if ((B < 0) && (C > 0)) { alignTo(i2); return; } + else if ((B < 0) && (C < 0)) { alignTo(i2); return; } + } + + for(var i=0; i<3; ++i) { + + var minor = lineOffset[i].primalMinor + var major = lineOffset[i].mirrorMinor + + var offset = copyVec3(PRIMAL_OFFSET, lineOffset[i].primalOffset) + + for(var j=0; j<3; ++j) { + if(this.lineTickEnable[i]) { + offset[j] += pixelScaleF * minor[j] * Math.max(this.lineTickLength[j], 0) / model[5*j] + } + } + + var axis = [0,0,0] + axis[i] = 1 + + //Draw tick text + if(this.tickEnable[i]) { + + if(this.tickAngle[i] === -3600) { + this.tickAngle[i] = 0 + this.tickAlign[i] = 'auto' + } else { + this.tickAlign[i] = -1 + } + + enableAlign = 1; + + alignOpt = [this.tickAlign[i], hv_ratio, enableAlign] + if(alignOpt[0] === 'auto') alignOpt[0] = ALIGN_OPTION_AUTO + else alignOpt[0] = parseInt('' + alignOpt[0]) + + alignDir = [0,0,0] + solveTickAlignments(i, minor, major) + + //Add tick padding + for(var j=0; j<3; ++j) { + offset[j] += pixelScaleF * minor[j] * this.tickPad[j] / model[5*j] + } + + //Draw axis + this._text.drawTicks( + i, + this.tickSize[i], + this.tickAngle[i], + offset, + this.tickColor[i], + axis, + alignDir, + alignOpt) + } + + //Draw labels + if(this.labelEnable[i]) { + + enableAlign = 0 + alignDir = [0,0,0] + if(this.labels[i].length > 4) { // for large label axis enable alignDir to axis + alignTo(i) + enableAlign = 1 + } + + alignOpt = [this.labelAlign[i], hv_ratio, enableAlign] + if(alignOpt[0] === 'auto') alignOpt[0] = ALIGN_OPTION_AUTO + else alignOpt[0] = parseInt('' + alignOpt[0]) + + //Add label padding + for(var j=0; j<3; ++j) { + offset[j] += pixelScaleF * minor[j] * this.labelPad[j] / model[5*j] + } + offset[i] += 0.5 * (bounds[0][i] + bounds[1][i]) + + //Draw axis + this._text.drawLabel( + i, + this.labelSize[i], + this.labelAngle[i], + offset, + this.labelColor[i], + [0,0,0], + alignDir, + alignOpt) + } + } + + this._text.unbind() +} + +proto.dispose = function() { + this._text.dispose() + this._lines.dispose() + this._background.dispose() + this._lines = null + this._text = null + this._background = null + this.gl = null +} + +function createAxes(gl, options) { + var axes = new Axes(gl) + axes.update(options) + return axes +} + +},{"./lib/background.js":164,"./lib/cube.js":165,"./lib/lines.js":166,"./lib/text.js":168,"./lib/ticks.js":169}],164:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createBackgroundCube + +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createShader = _dereq_('./shaders').bg + +function BackgroundCube(gl, buffer, vao, shader) { + this.gl = gl + this.buffer = buffer + this.vao = vao + this.shader = shader +} + +var proto = BackgroundCube.prototype + +proto.draw = function(model, view, projection, bounds, enable, colors) { + var needsBG = false + for(var i=0; i<3; ++i) { + needsBG = needsBG || enable[i] + } + if(!needsBG) { + return + } + + var gl = this.gl + + gl.enable(gl.POLYGON_OFFSET_FILL) + gl.polygonOffset(1, 2) + + this.shader.bind() + this.shader.uniforms = { + model: model, + view: view, + projection: projection, + bounds: bounds, + enable: enable, + colors: colors + } + this.vao.bind() + this.vao.draw(this.gl.TRIANGLES, 36) + this.vao.unbind() + + gl.disable(gl.POLYGON_OFFSET_FILL) +} + +proto.dispose = function() { + this.vao.dispose() + this.buffer.dispose() + this.shader.dispose() +} + +function createBackgroundCube(gl) { + //Create cube vertices + var vertices = [] + var indices = [] + var ptr = 0 + for(var d=0; d<3; ++d) { + var u = (d+1) % 3 + var v = (d+2) % 3 + var x = [0,0,0] + var c = [0,0,0] + for(var s=-1; s<=1; s+=2) { + indices.push(ptr, ptr+2, ptr+1, + ptr+1, ptr+2, ptr+3) + x[d] = s + c[d] = s + for(var i=-1; i<=1; i+=2) { + x[u] = i + for(var j=-1; j<=1; j+=2) { + x[v] = j + vertices.push(x[0], x[1], x[2], + c[0], c[1], c[2]) + ptr += 1 + } + } + //Swap u and v + var tt = u + u = v + v = tt + } + } + + //Allocate buffer and vertex array + var buffer = createBuffer(gl, new Float32Array(vertices)) + var elements = createBuffer(gl, new Uint16Array(indices), gl.ELEMENT_ARRAY_BUFFER) + var vao = createVAO(gl, [ + { + buffer: buffer, + type: gl.FLOAT, + size: 3, + offset: 0, + stride: 24 + }, + { + buffer: buffer, + type: gl.FLOAT, + size: 3, + offset: 12, + stride: 24 + } + ], elements) + + //Create shader object + var shader = createShader(gl) + shader.attributes.position.location = 0 + shader.attributes.normal.location = 1 + + return new BackgroundCube(gl, buffer, vao, shader) +} + +},{"./shaders":167,"gl-buffer":171,"gl-vao":261}],165:[function(_dereq_,module,exports){ +"use strict" + +module.exports = getCubeEdges + +var bits = _dereq_('bit-twiddle') +var multiply = _dereq_('gl-mat4/multiply') +var splitPoly = _dereq_('split-polygon') +var orient = _dereq_('robust-orientation') + +var mvp = new Array(16) +var pCubeVerts = new Array(8) +var cubeVerts = new Array(8) +var x = new Array(3) +var zero3 = [0,0,0] + +;(function() { + for(var i=0; i<8; ++i) { + pCubeVerts[i] =[1,1,1,1] + cubeVerts[i] = [1,1,1] + } +})() + + +function transformHg(result, x, mat) { + for(var i=0; i<4; ++i) { + result[i] = mat[12+i] + for(var j=0; j<3; ++j) { + result[i] += x[j]*mat[4*j+i] + } + } +} + +var FRUSTUM_PLANES = [ + [ 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] +] + +function polygonArea(p) { + for(var i=0; i o0) { + closest |= 1< o0) { + closest |= 1< cubeVerts[i][1]) { + bottom = i + } + } + + //Find left/right neighbors of bottom vertex + var left = -1 + for(var i=0; i<3; ++i) { + var idx = bottom ^ (1< cubeVerts[right][0]) { + right = idx + } + } + + //Determine edge axis coordinates + var cubeEdges = CUBE_EDGES + cubeEdges[0] = cubeEdges[1] = cubeEdges[2] = 0 + cubeEdges[bits.log2(left^bottom)] = bottom&left + cubeEdges[bits.log2(bottom^right)] = bottom&right + var top = right ^ 7 + if(top === closest || top === farthest) { + top = left ^ 7 + cubeEdges[bits.log2(right^top)] = top&right + } else { + cubeEdges[bits.log2(left^top)] = top&left + } + + //Determine visible faces + var axis = CUBE_AXIS + var cutCorner = closest + for(var d=0; d<3; ++d) { + if(cutCorner & (1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]) +var textFrag = glslify(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]) +exports.text = function(gl) { + return createShader(gl, textVert, textFrag, null, [ + {name: 'position', type: 'vec3'} + ]) +} + +var bgVert = glslify(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]) +var bgFrag = glslify(["precision highp 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}"]) +exports.bg = function(gl) { + return createShader(gl, bgVert, bgFrag, null, [ + {name: 'position', type: 'vec3'}, + {name: 'normal', type: 'vec3'} + ]) +} + +},{"gl-shader":242,"glslify":342}],168:[function(_dereq_,module,exports){ +(function (process){(function (){ +"use strict" + +module.exports = createTextSprites + +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var vectorizeText = _dereq_('vectorize-text') +var createShader = _dereq_('./shaders').text + +var globals = window || process.global || {} +var __TEXT_CACHE = globals.__TEXT_CACHE || {} +globals.__TEXT_CACHE = {} + +//Vertex buffer format for text is: +// +/// [x,y,z] = Spatial coordinate +// + +var VERTEX_SIZE = 3 + +function TextSprites( + gl, + shader, + buffer, + vao) { + this.gl = gl + this.shader = shader + this.buffer = buffer + this.vao = vao + this.tickOffset = + this.tickCount = + this.labelOffset = + this.labelCount = null +} + +var proto = TextSprites.prototype + +//Bind textures for rendering +var SHAPE = [0,0] +proto.bind = function(model, view, projection, pixelScale) { + this.vao.bind() + this.shader.bind() + var uniforms = this.shader.uniforms + uniforms.model = model + uniforms.view = view + uniforms.projection = projection + uniforms.pixelScale = pixelScale + SHAPE[0] = this.gl.drawingBufferWidth + SHAPE[1] = this.gl.drawingBufferHeight + this.shader.uniforms.resolution = SHAPE +} + +proto.unbind = function() { + this.vao.unbind() +} + +proto.update = function(bounds, labels, labelFont, ticks, tickFont) { + var data = [] + + function addItem(t, text, font, size, lineSpacing, styletags) { + var fontcache = __TEXT_CACHE[font] + if(!fontcache) { + fontcache = __TEXT_CACHE[font] = {} + } + var mesh = fontcache[text] + if(!mesh) { + mesh = fontcache[text] = tryVectorizeText(text, { + triangles: true, + font: font, + textAlign: 'center', + textBaseline: 'middle', + lineSpacing: lineSpacing, + styletags: styletags + }) + } + var scale = (size || 12) / 12 + var positions = mesh.positions + var cells = mesh.cells + for(var i=0, nc=cells.length; i=0; --j) { + var p = positions[c[j]] + data.push(scale*p[0], -scale*p[1], t) + } + } + } + + //Generate sprites for all 3 axes, store data in texture atlases + var tickOffset = [0,0,0] + var tickCount = [0,0,0] + var labelOffset = [0,0,0] + var labelCount = [0,0,0] + var lineSpacing = 1.25 + var styletags = { + breaklines:true, + bolds: true, + italics: true, + subscripts:true, + superscripts:true + } + for(var d=0; d<3; ++d) { + + //Generate label + labelOffset[d] = (data.length/VERTEX_SIZE)|0 + addItem( + 0.5*(bounds[0][d]+bounds[1][d]), + labels[d], + labelFont[d], + 12, // labelFontSize + lineSpacing, + styletags + ) + labelCount[d] = ((data.length/VERTEX_SIZE)|0) - labelOffset[d] + + //Generate sprites for tick marks + tickOffset[d] = (data.length/VERTEX_SIZE)|0 + for(var i=0; i= 0) { + sigFigs = stepStr.length - u - 1 + } + var shift = Math.pow(10, sigFigs) + var x = Math.round(spacing * i * shift) + var xstr = x + "" + if(xstr.indexOf("e") >= 0) { + return xstr + } + var xi = x / shift, xf = x % shift + if(x < 0) { + xi = -Math.ceil(xi)|0 + xf = (-xf)|0 + } else { + xi = Math.floor(xi)|0 + xf = xf|0 + } + var xis = "" + xi + if(x < 0) { + xis = "-" + xis + } + if(sigFigs) { + var xs = "" + xf + while(xs.length < sigFigs) { + xs = "0" + xs + } + return xis + "." + xs + } else { + return xis + } +} + +function defaultTicks(bounds, tickSpacing) { + var array = [] + for(var d=0; d<3; ++d) { + var ticks = [] + var m = 0.5*(bounds[0][d]+bounds[1][d]) + for(var t=0; t*tickSpacing[d]<=bounds[1][d]; ++t) { + ticks.push({x: t*tickSpacing[d], text: prettyPrint(tickSpacing[d], t)}) + } + for(var t=-1; t*tickSpacing[d]>=bounds[0][d]; --t) { + ticks.push({x: t*tickSpacing[d], text: prettyPrint(tickSpacing[d], t)}) + } + array.push(ticks) + } + return array +} + +function ticksEqual(ticksA, ticksB) { + for(var i=0; i<3; ++i) { + if(ticksA[i].length !== ticksB[i].length) { + return false + } + for(var j=0; j len) { + throw new Error("gl-buffer: If resizing buffer, must not specify offset") + } + gl.bufferSubData(type, offset, data) + return len +} + +function makeScratchTypeArray(array, dtype) { + var res = pool.malloc(array.length, dtype) + var n = array.length + for(var i=0; i=0; --i) { + if(stride[i] !== n) { + return false + } + n *= shape[i] + } + return true +} + +proto.update = function(array, offset) { + if(typeof offset !== "number") { + offset = -1 + } + this.bind() + if(typeof array === "object" && typeof array.shape !== "undefined") { //ndarray + var dtype = array.dtype + if(SUPPORTED_TYPES.indexOf(dtype) < 0) { + dtype = "float32" + } + if(this.type === this.gl.ELEMENT_ARRAY_BUFFER) { + var ext = gl.getExtension('OES_element_index_uint') + if(ext && dtype !== "uint16") { + dtype = "uint32" + } else { + dtype = "uint16" + } + } + if(dtype === array.dtype && isPacked(array.shape, array.stride)) { + if(array.offset === 0 && array.data.length === array.shape[0]) { + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, array.data, offset) + } else { + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, array.data.subarray(array.offset, array.shape[0]), offset) + } + } else { + var tmp = pool.malloc(array.size, dtype) + var ndt = ndarray(tmp, array.shape) + ops.assign(ndt, array) + if(offset < 0) { + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, tmp, offset) + } else { + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, tmp.subarray(0, array.size), offset) + } + pool.free(tmp) + } + } else if(Array.isArray(array)) { //Vanilla array + var t + if(this.type === this.gl.ELEMENT_ARRAY_BUFFER) { + t = makeScratchTypeArray(array, "uint16") + } else { + t = makeScratchTypeArray(array, "float32") + } + if(offset < 0) { + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, t, offset) + } else { + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, t.subarray(0, array.length), offset) + } + pool.free(t) + } else if(typeof array === "object" && typeof array.length === "number") { //Typed array + this.length = updateTypeArray(this.gl, this.type, this.length, this.usage, array, offset) + } else if(typeof array === "number" || array === undefined) { //Number/default + if(offset >= 0) { + throw new Error("gl-buffer: Cannot specify offset when resizing buffer") + } + array = array | 0 + if(array <= 0) { + array = 1 + } + this.gl.bufferData(this.type, array|0, this.usage) + this.length = array + } else { //Error, case should not happen + throw new Error("gl-buffer: Invalid data type") + } +} + +function createBuffer(gl, data, type, usage) { + type = type || gl.ARRAY_BUFFER + usage = usage || gl.DYNAMIC_DRAW + if(type !== gl.ARRAY_BUFFER && type !== gl.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(usage !== gl.DYNAMIC_DRAW && usage !== gl.STATIC_DRAW && usage !== gl.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 handle = gl.createBuffer() + var result = new GLBuffer(gl, type, handle, 0, usage) + result.update(data) + return result +} + +module.exports = createBuffer + +},{"ndarray":376,"ndarray-ops":371,"typedarray-pool":477}],172:[function(_dereq_,module,exports){ +"use strict"; + +var vec3 = _dereq_('gl-vec3'); + +module.exports = function(vectorfield, bounds) { + var positions = vectorfield.positions; + var vectors = vectorfield.vectors; + var geo = { + positions: [], + vertexIntensity: [], + vertexIntensityBounds: vectorfield.vertexIntensityBounds, + vectors: [], + cells: [], + coneOffset: vectorfield.coneOffset, + colormap: vectorfield.colormap + }; + + if (vectorfield.positions.length === 0) { + if (bounds) { + bounds[0] = [0,0,0]; + bounds[1] = [0,0,0]; + } + return geo; + } + + // Compute bounding box for the dataset. + // Compute maximum velocity for the dataset to use for scaling the cones. + var maxNorm = 0; + var minX = Infinity, maxX = -Infinity; + var minY = Infinity, maxY = -Infinity; + var minZ = Infinity, maxZ = -Infinity; + var p2 = null; + var u2 = null; + var positionVectors = []; + var vectorScale = Infinity; + var skipIt = false; + for (var i = 0; i < positions.length; i++) { + var p = positions[i]; + minX = Math.min(p[0], minX); + maxX = Math.max(p[0], maxX); + minY = Math.min(p[1], minY); + maxY = Math.max(p[1], maxY); + minZ = Math.min(p[2], minZ); + maxZ = Math.max(p[2], maxZ); + var u = vectors[i]; + + if (vec3.length(u) > maxNorm) { + maxNorm = vec3.length(u); + } + if (i) { + // Find vector scale [w/ units of time] using "successive" positions + // (not "adjacent" with would be O(n^2)), + // + // The vector scale corresponds to the minimum "time" to travel across two + // two adjacent positions at the average velocity of those two adjacent positions + + var q = (2 * vec3.distance(p2, p) / (vec3.length(u2) + vec3.length(u))); + if(q) { + vectorScale = Math.min(vectorScale, q); + skipIt = false; + } else { + skipIt = true; + } + } + if(!skipIt) { + p2 = p; + u2 = u; + } + positionVectors.push(u); + } + var minV = [minX, minY, minZ]; + var maxV = [maxX, maxY, maxZ]; + if (bounds) { + bounds[0] = minV; + bounds[1] = maxV; + } + if (maxNorm === 0) { + maxNorm = 1; + } + + // Inverted max norm would map vector with norm maxNorm to 1 coord space units in length + var invertedMaxNorm = 1 / maxNorm; + + if (!isFinite(vectorScale)) { + vectorScale = 1.0; + } + geo.vectorScale = vectorScale; + + var coneScale = vectorfield.coneSize || 0.5; + + if (vectorfield.absoluteConeSize) { + coneScale = vectorfield.absoluteConeSize * invertedMaxNorm; + } + + geo.coneScale = coneScale; + + // Build the cone model. + for (var i = 0, j = 0; i < positions.length; i++) { + var p = positions[i]; + var x = p[0], y = p[1], z = p[2]; + var d = positionVectors[i]; + var intensity = vec3.length(d) * invertedMaxNorm; + for (var k = 0, l = 8; k < l; k++) { + geo.positions.push([x, y, z, j++]); + geo.positions.push([x, y, z, j++]); + geo.positions.push([x, y, z, j++]); + geo.positions.push([x, y, z, j++]); + geo.positions.push([x, y, z, j++]); + geo.positions.push([x, y, z, j++]); + + geo.vectors.push(d); + geo.vectors.push(d); + geo.vectors.push(d); + geo.vectors.push(d); + geo.vectors.push(d); + geo.vectors.push(d); + + geo.vertexIntensity.push(intensity, intensity, intensity); + geo.vertexIntensity.push(intensity, intensity, intensity); + + var m = geo.positions.length; + geo.cells.push([m-6, m-5, m-4], [m-3, m-2, m-1]); + } + } + + return geo; +}; + +var shaders = _dereq_('./lib/shaders'); +module.exports.createMesh = _dereq_('./create_mesh'); +module.exports.createConeMesh = function(gl, params) { + return module.exports.createMesh(gl, params, { + shaders: shaders, + traceType: 'cone' + }); +} + +},{"./create_mesh":173,"./lib/shaders":174,"gl-vec3":280}],173:[function(_dereq_,module,exports){ +'use strict' + +var createShader = _dereq_('gl-shader') +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createTexture = _dereq_('gl-texture2d') +var multiply = _dereq_('gl-mat4/multiply') +var invert = _dereq_('gl-mat4/invert') +var ndarray = _dereq_('ndarray') +var colormap = _dereq_('colormap') + +var IDENTITY = [ + 1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] + +function VectorMesh(gl + , texture + , triShader + , pickShader + , trianglePositions + , triangleVectors + , triangleIds + , triangleColors + , triangleUVs + , triangleVAO + , traceType) { + + this.gl = gl + this.pixelRatio = 1 + this.cells = [] + this.positions = [] + this.intensity = [] + this.texture = texture + this.dirty = true + + this.triShader = triShader + this.pickShader = pickShader + + this.trianglePositions = trianglePositions + this.triangleVectors = triangleVectors + this.triangleColors = triangleColors + this.triangleUVs = triangleUVs + this.triangleIds = triangleIds + this.triangleVAO = triangleVAO + this.triangleCount = 0 + + this.pickId = 1 + this.bounds = [ + [ Infinity, Infinity, Infinity], + [-Infinity,-Infinity,-Infinity] ] + this.clipBounds = [ + [-Infinity,-Infinity,-Infinity], + [ Infinity, Infinity, Infinity] ] + + this.lightPosition = [1e5, 1e5, 0] + this.ambientLight = 0.8 + this.diffuseLight = 0.8 + this.specularLight = 2.0 + this.roughness = 0.5 + this.fresnel = 1.5 + + this.opacity = 1 + + this.traceType = traceType + this.tubeScale = 1 // used in streamtube + this.coneScale = 2 // used in cone + this.vectorScale = 1 // used in cone + this.coneOffset = 0.25 // used in cone + + this._model = IDENTITY + this._view = IDENTITY + this._projection = IDENTITY + this._resolution = [1,1] +} + +var proto = VectorMesh.prototype + +proto.isOpaque = function() { + return this.opacity >= 1 +} + +proto.isTransparent = function() { + return this.opacity < 1 +} + +proto.pickSlots = 1 + +proto.setPickBase = function(id) { + this.pickId = id +} + +function genColormap(param) { + var colors = colormap({ + colormap: param + , nshades: 256 + , format: 'rgba' + }) + + var result = new Uint8Array(256*4) + for(var i=0; i<256; ++i) { + var c = colors[i] + for(var j=0; j<3; ++j) { + result[4*i+j] = c[j] + } + result[4*i+3] = c[3]*255 + } + + return ndarray(result, [256,256,4], [4,0,1]) +} + +function takeZComponent(array) { + var n = array.length + var result = new Array(n) + for(var i=0; i 0) { + var shader = this.triShader + shader.bind() + shader.uniforms = uniforms + + this.triangleVAO.bind() + gl.drawArrays(gl.TRIANGLES, 0, this.triangleCount*3) + this.triangleVAO.unbind() + } +} + +proto.drawPick = function(params) { + params = params || {} + + var gl = this.gl + + var model = params.model || IDENTITY + var view = params.view || IDENTITY + var projection = params.projection || IDENTITY + + var clipBounds = [[-1e6,-1e6,-1e6],[1e6,1e6,1e6]] + for(var i=0; i<3; ++i) { + clipBounds[0][i] = Math.max(clipBounds[0][i], this.clipBounds[0][i]) + clipBounds[1][i] = Math.min(clipBounds[1][i], this.clipBounds[1][i]) + } + + //Save camera parameters + this._model = [].slice.call(model) + this._view = [].slice.call(view) + this._projection = [].slice.call(projection) + this._resolution = [gl.drawingBufferWidth, gl.drawingBufferHeight] + + var uniforms = { + model: model, + view: view, + projection: projection, + clipBounds: clipBounds, + + tubeScale: this.tubeScale, + vectorScale: this.vectorScale, + coneScale: this.coneScale, + coneOffset: this.coneOffset, + + pickId: this.pickId / 255.0, + } + + var shader = this.pickShader + shader.bind() + shader.uniforms = uniforms + + if(this.triangleCount > 0) { + this.triangleVAO.bind() + gl.drawArrays(gl.TRIANGLES, 0, this.triangleCount*3) + this.triangleVAO.unbind() + } +} + + +proto.pick = function(pickData) { + if(!pickData) { + return null + } + if(pickData.id !== this.pickId) { + return null + } + + var cellId = pickData.value[0] + 256*pickData.value[1] + 65536*pickData.value[2] + var cell = this.cells[cellId] + var pos = this.positions[cell[1]].slice(0, 3) + + var result = { + position: pos, + dataCoordinate: pos, + index: Math.floor(cell[1] / 48) + } + + + if(this.traceType === 'cone') { + result.index = Math.floor(cell[1] / 48) + } else if(this.traceType === 'streamtube') { + result.intensity = this.intensity[cell[1]] + result.velocity = this.vectors[cell[1]].slice(0, 3) + result.divergence = this.vectors[cell[1]][3] + result.index = cellId + } + + return result +} + + +proto.dispose = function() { + this.texture.dispose() + + this.triShader.dispose() + this.pickShader.dispose() + + this.triangleVAO.dispose() + this.trianglePositions.dispose() + this.triangleVectors.dispose() + this.triangleColors.dispose() + this.triangleUVs.dispose() + this.triangleIds.dispose() +} + +function createMeshShader(gl, shaders) { + var shader = createShader(gl, + shaders.meshShader.vertex, + shaders.meshShader.fragment, + null, + shaders.meshShader.attributes + ) + + shader.attributes.position.location = 0 + shader.attributes.color.location = 2 + shader.attributes.uv.location = 3 + shader.attributes.vector.location = 4 + return shader +} + + +function createPickShader(gl, shaders) { + var shader = createShader(gl, + shaders.pickShader.vertex, + shaders.pickShader.fragment, + null, + shaders.pickShader.attributes + ) + + shader.attributes.position.location = 0 + shader.attributes.id.location = 1 + shader.attributes.vector.location = 4 + return shader +} + + +function createVectorMesh(gl, params, opts) { + var shaders = opts.shaders + + if (arguments.length === 1) { + params = gl + gl = params.gl + } + + + var triShader = createMeshShader(gl, shaders) + var pickShader = createPickShader(gl, shaders) + var meshTexture = createTexture(gl, + ndarray(new Uint8Array([255,255,255,255]), [1,1,4])) + meshTexture.generateMipmap() + meshTexture.minFilter = gl.LINEAR_MIPMAP_LINEAR + meshTexture.magFilter = gl.LINEAR + + var trianglePositions = createBuffer(gl) + var triangleVectors = createBuffer(gl) + var triangleColors = createBuffer(gl) + var triangleUVs = createBuffer(gl) + var triangleIds = createBuffer(gl) + var triangleVAO = createVAO(gl, [ + { buffer: trianglePositions, + type: gl.FLOAT, + size: 4 + }, + { buffer: triangleIds, + type: gl.UNSIGNED_BYTE, + size: 4, + normalized: true + }, + { buffer: triangleColors, + type: gl.FLOAT, + size: 4 + }, + { buffer: triangleUVs, + type: gl.FLOAT, + size: 2 + }, + { buffer: triangleVectors, + type: gl.FLOAT, + size: 4 + } + ]) + + var mesh = new VectorMesh(gl + , meshTexture + , triShader + , pickShader + , trianglePositions + , triangleVectors + , triangleIds + , triangleColors + , triangleUVs + , triangleVAO + , opts.traceType || 'cone' + ) + + mesh.update(params) + + return mesh +} + +module.exports = createVectorMesh + +},{"colormap":124,"gl-buffer":171,"gl-mat4/invert":203,"gl-mat4/multiply":205,"gl-shader":242,"gl-texture2d":257,"gl-vao":261,"ndarray":376}],174:[function(_dereq_,module,exports){ +var glslify = _dereq_('glslify') + +var triVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) +var triFragSrc = glslify(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]) +var pickVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]) +var pickFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]) + +exports.meshShader = { + vertex: triVertSrc, + fragment: triFragSrc, + attributes: [ + {name: 'position', type: 'vec4'}, + {name: 'color', type: 'vec4'}, + {name: 'uv', type: 'vec2'}, + {name: 'vector', type: 'vec3'} + ] +} +exports.pickShader = { + vertex: pickVertSrc, + fragment: pickFragSrc, + attributes: [ + {name: 'position', type: 'vec4'}, + {name: 'id', type: 'vec4'}, + {name: 'vector', type: 'vec3'} + ] +} + +},{"glslify":342}],175:[function(_dereq_,module,exports){ +module.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', + 34000: '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' +} + +},{}],176:[function(_dereq_,module,exports){ +var gl10 = _dereq_('./1.0/numbers') + +module.exports = function lookupConstant (number) { + return gl10[number] +} + +},{"./1.0/numbers":175}],177:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createErrorBars + +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createShader = _dereq_('./shaders/index') + +var IDENTITY = [1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] + +function ErrorBars(gl, buffer, vao, shader) { + this.gl = gl + this.shader = shader + this.buffer = buffer + this.vao = vao + this.pixelRatio = 1 + this.bounds = [[ Infinity, Infinity, Infinity], [-Infinity,-Infinity,-Infinity]] + this.clipBounds = [[-Infinity,-Infinity,-Infinity], [ Infinity, Infinity, Infinity]] + this.lineWidth = [1,1,1] + this.capSize = [10,10,10] + this.lineCount = [0,0,0] + this.lineOffset = [0,0,0] + this.opacity = 1 + this.hasAlpha = false +} + +var proto = ErrorBars.prototype + +proto.isOpaque = function() { + return !this.hasAlpha +} + +proto.isTransparent = function() { + return this.hasAlpha +} + +proto.drawTransparent = proto.draw = function(cameraParams) { + var gl = this.gl + var uniforms = this.shader.uniforms + + this.shader.bind() + var view = uniforms.view = cameraParams.view || IDENTITY + var projection = uniforms.projection = cameraParams.projection || IDENTITY + uniforms.model = cameraParams.model || IDENTITY + uniforms.clipBounds = this.clipBounds + uniforms.opacity = this.opacity + + + var cx = view[12] + var cy = view[13] + var cz = view[14] + var cw = view[15] + + var isOrtho = cameraParams._ortho || false + var orthoFix = (isOrtho) ? 2 : 1 // double up padding for orthographic ticks & labels + var pixelScaleF = orthoFix * this.pixelRatio * (projection[3]*cx + projection[7]*cy + projection[11]*cz + projection[15]*cw) / gl.drawingBufferHeight + + this.vao.bind() + for(var i=0; i<3; ++i) { + gl.lineWidth(this.lineWidth[i] * this.pixelRatio) + uniforms.capSize = this.capSize[i] * pixelScaleF + if (this.lineCount[i]) { + gl.drawArrays(gl.LINES, this.lineOffset[i], this.lineCount[i]) + } + } + this.vao.unbind() +} + +function updateBounds(bounds, point) { + for(var i=0; i<3; ++i) { + bounds[0][i] = Math.min(bounds[0][i], point[i]) + bounds[1][i] = Math.max(bounds[1][i], point[i]) + } +} + +var FACE_TABLE = (function(){ + var table = new Array(3) + for(var d=0; d<3; ++d) { + var row = [] + for(var j=1; j<=2; ++j) { + for(var s=-1; s<=1; s+=2) { + var u = (j+d) % 3 + var y = [0,0,0] + y[u] = s + row.push(y) + } + } + table[d] = row + } + return table +})() + + +function emitFace(verts, x, c, d) { + var offsets = FACE_TABLE[d] + for(var i=0; i 0) { + var x = p.slice() + x[j] += e[1][j] + verts.push(p[0], p[1], p[2], + c[0], c[1], c[2], c[3], + 0, 0, 0, + x[0], x[1], x[2], + c[0], c[1], c[2], c[3], + 0, 0, 0) + updateBounds(this.bounds, x) + vertexCount += 2 + emitFace(verts, x, c, j) + } + } + this.lineCount[j] = vertexCount - this.lineOffset[j] + } + this.buffer.update(verts) + } +} + +proto.dispose = function() { + this.shader.dispose() + this.buffer.dispose() + this.vao.dispose() +} + +function createErrorBars(options) { + var gl = options.gl + var buffer = createBuffer(gl) + var vao = createVAO(gl, [ + { + buffer: buffer, + type: gl.FLOAT, + size: 3, + offset: 0, + stride: 40 + }, + { + buffer: buffer, + type: gl.FLOAT, + size: 4, + offset: 12, + stride: 40 + }, + { + buffer: buffer, + type: gl.FLOAT, + size: 3, + offset: 28, + stride: 40 + } + ]) + + var shader = createShader(gl) + shader.attributes.position.location = 0 + shader.attributes.color.location = 1 + shader.attributes.offset.location = 2 + + var result = new ErrorBars(gl, buffer, vao, shader) + result.update(options) + return result +} + +},{"./shaders/index":179,"gl-buffer":171,"gl-vao":261}],178:[function(_dereq_,module,exports){ +module.exports = function(strings) { + if (typeof strings === 'string') strings = [strings] + var exprs = [].slice.call(arguments,1) + var parts = [] + for (var i = 0; i < strings.length-1; i++) { + parts.push(strings[i], exprs[i] || '') + } + parts.push(strings[i]) + return parts.join('') +} + +},{}],179:[function(_dereq_,module,exports){ +'use strict' + +var glslify = _dereq_('glslify') +var createShader = _dereq_('gl-shader') + +var vertSrc = glslify(["precision highp 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}"]) +var fragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]) + +module.exports = function(gl) { + return createShader(gl, vertSrc, fragSrc, null, [ + {name: 'position', type: 'vec3'}, + {name: 'color', type: 'vec4'}, + {name: 'offset', type: 'vec3'} + ]) +} + +},{"gl-shader":242,"glslify":178}],180:[function(_dereq_,module,exports){ +'use strict' + +var createTexture = _dereq_('gl-texture2d') + +module.exports = createFBO + +var colorAttachmentArrays = null +var FRAMEBUFFER_UNSUPPORTED +var FRAMEBUFFER_INCOMPLETE_ATTACHMENT +var FRAMEBUFFER_INCOMPLETE_DIMENSIONS +var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT + +function saveFBOState(gl) { + var fbo = gl.getParameter(gl.FRAMEBUFFER_BINDING) + var rbo = gl.getParameter(gl.RENDERBUFFER_BINDING) + var tex = gl.getParameter(gl.TEXTURE_BINDING_2D) + return [fbo, rbo, tex] +} + +function restoreFBOState(gl, data) { + gl.bindFramebuffer(gl.FRAMEBUFFER, data[0]) + gl.bindRenderbuffer(gl.RENDERBUFFER, data[1]) + gl.bindTexture(gl.TEXTURE_2D, data[2]) +} + +function lazyInitColorAttachments(gl, ext) { + var maxColorAttachments = gl.getParameter(ext.MAX_COLOR_ATTACHMENTS_WEBGL) + colorAttachmentArrays = new Array(maxColorAttachments + 1) + for(var i=0; i<=maxColorAttachments; ++i) { + var x = new Array(maxColorAttachments) + for(var j=0; j 1) { + ext.drawBuffersWEBGL(colorAttachmentArrays[numColors]) + } + + //Allocate depth/stencil buffers + var WEBGL_depth_texture = gl.getExtension('WEBGL_depth_texture') + if(WEBGL_depth_texture) { + if(useStencil) { + fbo.depth = initTexture(gl, width, height, + WEBGL_depth_texture.UNSIGNED_INT_24_8_WEBGL, + gl.DEPTH_STENCIL, + gl.DEPTH_STENCIL_ATTACHMENT) + } else if(useDepth) { + fbo.depth = initTexture(gl, width, height, + gl.UNSIGNED_SHORT, + gl.DEPTH_COMPONENT, + gl.DEPTH_ATTACHMENT) + } + } else { + if(useDepth && useStencil) { + fbo._depth_rb = initRenderBuffer(gl, width, height, gl.DEPTH_STENCIL, gl.DEPTH_STENCIL_ATTACHMENT) + } else if(useDepth) { + fbo._depth_rb = initRenderBuffer(gl, width, height, gl.DEPTH_COMPONENT16, gl.DEPTH_ATTACHMENT) + } else if(useStencil) { + fbo._depth_rb = initRenderBuffer(gl, width, height, gl.STENCIL_INDEX, gl.STENCIL_ATTACHMENT) + } + } + + //Check frame buffer state + var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER) + if(status !== gl.FRAMEBUFFER_COMPLETE) { + + //Release all partially allocated resources + fbo._destroyed = true + + //Release all resources + gl.bindFramebuffer(gl.FRAMEBUFFER, null) + gl.deleteFramebuffer(fbo.handle) + fbo.handle = null + if(fbo.depth) { + fbo.depth.dispose() + fbo.depth = null + } + if(fbo._depth_rb) { + gl.deleteRenderbuffer(fbo._depth_rb) + fbo._depth_rb = null + } + for(var i=0; i maxFBOSize || + h < 0 || h > maxFBOSize) { + throw new Error('gl-fbo: Can\'t resize FBO, invalid dimensions') + } + + //Update shape + fbo._shape[0] = w + fbo._shape[1] = h + + //Save framebuffer state + var state = saveFBOState(gl) + + //Resize framebuffer attachments + for(var i=0; i maxFBOSize || height < 0 || height > maxFBOSize) { + throw new Error('gl-fbo: Parameters are too large for FBO') + } + + //Handle each option type + options = options || {} + + //Figure out number of color buffers to use + var numColors = 1 + if('color' in options) { + numColors = Math.max(options.color|0, 0) + if(numColors < 0) { + throw new Error('gl-fbo: Must specify a nonnegative number of colors') + } + if(numColors > 1) { + //Check if multiple render targets supported + if(!WEBGL_draw_buffers) { + throw new Error('gl-fbo: Multiple draw buffer extension not supported') + } else if(numColors > gl.getParameter(WEBGL_draw_buffers.MAX_COLOR_ATTACHMENTS_WEBGL)) { + throw new Error('gl-fbo: Context does not support ' + numColors + ' draw buffers') + } + } + } + + //Determine whether to use floating point textures + var colorType = gl.UNSIGNED_BYTE + var OES_texture_float = gl.getExtension('OES_texture_float') + if(options.float && numColors > 0) { + if(!OES_texture_float) { + throw new Error('gl-fbo: Context does not support floating point textures') + } + colorType = gl.FLOAT + } else if(options.preferFloat && numColors > 0) { + if(OES_texture_float) { + colorType = gl.FLOAT + } + } + + //Check if we should use depth buffer + var useDepth = true + if('depth' in options) { + useDepth = !!options.depth + } + + //Check if we should use a stencil buffer + var useStencil = false + if('stencil' in options) { + useStencil = !!options.stencil + } + + return new Framebuffer( + gl, + width, + height, + colorType, + numColors, + useDepth, + useStencil, + WEBGL_draw_buffers) +} + +},{"gl-texture2d":257}],181:[function(_dereq_,module,exports){ + +var sprintf = _dereq_('sprintf-js').sprintf; +var glConstants = _dereq_('gl-constants/lookup'); +var shaderName = _dereq_('glsl-shader-name'); +var addLineNumbers = _dereq_('add-line-numbers'); + +module.exports = formatCompilerError; + +function formatCompilerError(errLog, src, type) { + "use strict"; + + var name = shaderName(src) || 'of unknown name (see npm glsl-shader-name)'; + + var typeName = 'unknown type'; + if (type !== undefined) { + typeName = type === glConstants.FRAGMENT_SHADER ? 'fragment' : 'vertex' + } + + var longForm = sprintf('Error compiling %s shader %s:\n', typeName, name); + var shortForm = sprintf("%s%s", longForm, errLog); + + var errorStrings = errLog.split('\n'); + var errors = {}; + + for (var i = 0; i < errorStrings.length; i++) { + var errorString = errorStrings[i]; + if (errorString === '' || errorString === "\0") continue; + var lineNo = parseInt(errorString.split(':')[2]); + if (isNaN(lineNo)) { + throw new Error(sprintf('Could not parse error: %s', errorString)); + } + errors[lineNo] = errorString; + } + + var lines = addLineNumbers(src).split('\n'); + + for (var i = 0; i < lines.length; i++) { + if (!errors[i+3] && !errors[i+2] && !errors[i+1]) continue; + var line = lines[i]; + longForm += line + '\n'; + if (errors[i+1]) { + var e = errors[i+1]; + e = e.substr(e.split(':', 3).join(':').length + 1).trim(); + longForm += sprintf('^^^ %s\n\n', e); + } + } + + return { + long: longForm.trim(), + short: shortForm.trim() + }; +} + + +},{"add-line-numbers":65,"gl-constants/lookup":176,"glsl-shader-name":334,"sprintf-js":446}],182:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createHeatmap2D + +var bsearch = _dereq_('binary-search-bounds') +var iota = _dereq_('iota-array') +var pool = _dereq_('typedarray-pool') +var createShader = _dereq_('gl-shader') +var createBuffer = _dereq_('gl-buffer') + +var shaders = _dereq_('./lib/shaders') + +function GLHeatmap2D ( + plot, + shader, + pickShader, + positionBuffer, + weightBuffer, + colorBuffer, + idBuffer) { + this.plot = plot + this.shader = shader + this.pickShader = pickShader + this.positionBuffer = positionBuffer + this.weightBuffer = weightBuffer + this.colorBuffer = colorBuffer + this.idBuffer = idBuffer + this.xData = [] + this.yData = [] + this.shape = [0, 0] + this.bounds = [Infinity, Infinity, -Infinity, -Infinity] + this.pickOffset = 0 +} + +var proto = GLHeatmap2D.prototype + +var WEIGHTS = [ + 0, 0, + 1, 0, + 0, 1, + 1, 0, + 1, 1, + 0, 1 +] + +proto.draw = (function () { + var MATRIX = [ + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + ] + + return function () { + var plot = this.plot + var shader = this.shader + var bounds = this.bounds + var numVertices = this.numVertices + + if (numVertices <= 0) { + return + } + + var gl = plot.gl + var dataBox = plot.dataBox + + var boundX = bounds[2] - bounds[0] + var boundY = bounds[3] - bounds[1] + var dataX = dataBox[2] - dataBox[0] + var dataY = dataBox[3] - dataBox[1] + + MATRIX[0] = 2.0 * boundX / dataX + MATRIX[4] = 2.0 * boundY / dataY + MATRIX[6] = 2.0 * (bounds[0] - dataBox[0]) / dataX - 1.0 + MATRIX[7] = 2.0 * (bounds[1] - dataBox[1]) / dataY - 1.0 + + shader.bind() + + var uniforms = shader.uniforms + uniforms.viewTransform = MATRIX + + uniforms.shape = this.shape + + var attributes = shader.attributes + this.positionBuffer.bind() + attributes.position.pointer() + + this.weightBuffer.bind() + attributes.weight.pointer(gl.UNSIGNED_BYTE, false) + + this.colorBuffer.bind() + attributes.color.pointer(gl.UNSIGNED_BYTE, true) + + gl.drawArrays(gl.TRIANGLES, 0, numVertices) + } +})() + +proto.drawPick = (function () { + var MATRIX = [ + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + ] + + var PICK_VECTOR = [0, 0, 0, 0] + + return function (pickOffset) { + var plot = this.plot + var shader = this.pickShader + var bounds = this.bounds + var numVertices = this.numVertices + + if (numVertices <= 0) { + return + } + + var gl = plot.gl + var dataBox = plot.dataBox + + var boundX = bounds[2] - bounds[0] + var boundY = bounds[3] - bounds[1] + var dataX = dataBox[2] - dataBox[0] + var dataY = dataBox[3] - dataBox[1] + + MATRIX[0] = 2.0 * boundX / dataX + MATRIX[4] = 2.0 * boundY / dataY + MATRIX[6] = 2.0 * (bounds[0] - dataBox[0]) / dataX - 1.0 + MATRIX[7] = 2.0 * (bounds[1] - dataBox[1]) / dataY - 1.0 + + for (var i = 0; i < 4; ++i) { + PICK_VECTOR[i] = (pickOffset >> (i * 8)) & 0xff + } + + this.pickOffset = pickOffset + + shader.bind() + + var uniforms = shader.uniforms + uniforms.viewTransform = MATRIX + uniforms.pickOffset = PICK_VECTOR + uniforms.shape = this.shape + + var attributes = shader.attributes + this.positionBuffer.bind() + attributes.position.pointer() + + this.weightBuffer.bind() + attributes.weight.pointer(gl.UNSIGNED_BYTE, false) + + this.idBuffer.bind() + attributes.pickId.pointer(gl.UNSIGNED_BYTE, false) + + gl.drawArrays(gl.TRIANGLES, 0, numVertices) + + return pickOffset + this.shape[0] * this.shape[1] + } +})() + +proto.pick = function (x, y, value) { + var pickOffset = this.pickOffset + var pointCount = this.shape[0] * this.shape[1] + if (value < pickOffset || value >= pickOffset + pointCount) { + return null + } + var pointId = value - pickOffset + var xData = this.xData + var yData = this.yData + return { + object: this, + pointId: pointId, + dataCoord: [ + xData[pointId % this.shape[0]], + yData[(pointId / this.shape[0]) | 0]] + } +} + +proto.update = function (options) { + options = options || {} + + var shape = options.shape || [0, 0] + + var x = options.x || iota(shape[0]) + var y = options.y || iota(shape[1]) + var z = options.z || new Float32Array(shape[0] * shape[1]) + + var isSmooth = options.zsmooth !== false + + this.xData = x + this.yData = y + + var colorLevels = options.colorLevels || [0] + var colorValues = options.colorValues || [0, 0, 0, 1] + var colorCount = colorLevels.length + + var bounds = this.bounds + var lox, loy, hix, hiy + if (isSmooth) { + lox = bounds[0] = x[0] + loy = bounds[1] = y[0] + hix = bounds[2] = x[x.length - 1] + hiy = bounds[3] = y[y.length - 1] + } else { + // To get squares to centre on data values + lox = bounds[0] = x[0] + (x[1] - x[0]) / 2 // starting x value + loy = bounds[1] = y[0] + (y[1] - y[0]) / 2 // starting y value + + // Bounds needs to add half a square on each end + hix = bounds[2] = x[x.length - 1] + (x[x.length - 1] - x[x.length - 2]) / 2 + hiy = bounds[3] = y[y.length - 1] + (y[y.length - 1] - y[y.length - 2]) / 2 + + // N.B. Resolution = 1 / range + } + var xs = 1.0 / (hix - lox) + var ys = 1.0 / (hiy - loy) + + var numX = shape[0] + var numY = shape[1] + + this.shape = [numX, numY] + + var numVerts = ( + isSmooth ? (numX - 1) * (numY - 1) : numX * numY + ) * (WEIGHTS.length >>> 1) + + this.numVertices = numVerts + + var colors = pool.mallocUint8(numVerts * 4) + var positions = pool.mallocFloat32(numVerts * 2) + var weights = pool.mallocUint8 (numVerts * 2) + var ids = pool.mallocUint32(numVerts) + + var ptr = 0 + + var ni = isSmooth ? numX - 1 : numX + var nj = isSmooth ? numY - 1 : numY + + for (var j = 0; j < nj; ++j) { + var yc0, yc1 + + if (isSmooth) { + yc0 = ys * (y[j] - loy) + yc1 = ys * (y[j + 1] - loy) + } else { + yc0 = j < numY - 1 ? ys * (y[j] - (y[j + 1] - y[j])/2 - loy) : ys * (y[j] - (y[j] - y[j - 1])/2 - loy) + yc1 = j < numY - 1 ? ys * (y[j] + (y[j + 1] - y[j])/2 - loy) : ys * (y[j] + (y[j] - y[j - 1])/2 - loy) + } + + for (var i = 0; i < ni; ++i) { + var xc0, xc1 + + if (isSmooth) { + xc0 = xs * (x[i] - lox) + xc1 = xs * (x[i + 1] - lox) + } else { + xc0 = i < numX - 1 ? xs * (x[i] - (x[i + 1] - x[i])/2 - lox) : xs * (x[i] - (x[i] - x[i - 1])/2 - lox) + xc1 = i < numX - 1 ? xs * (x[i] + (x[i + 1] - x[i])/2 - lox) : xs * (x[i] + (x[i] - x[i - 1])/2 - lox) + } + + for (var dd = 0; dd < WEIGHTS.length; dd += 2) { + var dx = WEIGHTS[dd] + var dy = WEIGHTS[dd + 1] + var offset = isSmooth ? (j + dy) * numX + (i + dx) : j * numX + i + var zc = z[offset] + var colorIdx = bsearch.le(colorLevels, zc) + var r, g, b, a + if (colorIdx < 0) { + r = colorValues[0] + g = colorValues[1] + b = colorValues[2] + a = colorValues[3] + } else if (colorIdx === colorCount - 1) { + r = colorValues[4 * colorCount - 4] + g = colorValues[4 * colorCount - 3] + b = colorValues[4 * colorCount - 2] + a = colorValues[4 * colorCount - 1] + } else { + var t = (zc - colorLevels[colorIdx]) / + (colorLevels[colorIdx + 1] - colorLevels[colorIdx]) + var ti = 1.0 - t + var i0 = 4 * colorIdx + var i1 = 4 * (colorIdx + 1) + r = ti * colorValues[i0] + t * colorValues[i1] + g = ti * colorValues[i0 + 1] + t * colorValues[i1 + 1] + b = ti * colorValues[i0 + 2] + t * colorValues[i1 + 2] + a = ti * colorValues[i0 + 3] + t * colorValues[i1 + 3] + } + + colors[4 * ptr] = 255 * r + colors[4 * ptr + 1] = 255 * g + colors[4 * ptr + 2] = 255 * b + colors[4 * ptr + 3] = 255 * a + + positions[2*ptr] = xc0*.5 + xc1*.5; + positions[2*ptr+1] = yc0*.5 + yc1*.5; + + weights[2*ptr] = dx; + weights[2*ptr+1] = dy; + + ids[ptr] = j * numX + i + + ptr += 1 + } + } + } + + this.positionBuffer.update(positions) + this.weightBuffer.update(weights) + this.colorBuffer.update(colors) + this.idBuffer.update(ids) + + pool.free(positions) + pool.free(colors) + pool.free(weights) + pool.free(ids) +} + +proto.dispose = function () { + this.shader.dispose() + this.pickShader.dispose() + this.positionBuffer.dispose() + this.weightBuffer.dispose() + this.colorBuffer.dispose() + this.idBuffer.dispose() + this.plot.removeObject(this) +} + +function createHeatmap2D (plot, options) { + var gl = plot.gl + + var shader = createShader(gl, shaders.vertex, shaders.fragment) + var pickShader = createShader(gl, shaders.pickVertex, shaders.pickFragment) + + var positionBuffer = createBuffer(gl) + var weightBuffer = createBuffer(gl) + var colorBuffer = createBuffer(gl) + var idBuffer = createBuffer(gl) + + var heatmap = new GLHeatmap2D( + plot, + shader, + pickShader, + positionBuffer, + weightBuffer, + colorBuffer, + idBuffer) + + heatmap.update(options) + plot.addObject(heatmap) + + return heatmap +} + +},{"./lib/shaders":183,"binary-search-bounds":92,"gl-buffer":171,"gl-shader":242,"iota-array":349,"typedarray-pool":477}],183:[function(_dereq_,module,exports){ +'use strict' + +var glslify = _dereq_('glslify') + +module.exports = { + fragment: glslify(["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: glslify(["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: glslify(["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: glslify(["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"]) +} + +},{"glslify":342}],184:[function(_dereq_,module,exports){ +var glslify = _dereq_('glslify') +var createShader = _dereq_('gl-shader') + +var vertSrc = glslify(["precision highp 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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]) +var forwardFrag = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]) +var pickFrag = glslify(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]) + +var ATTRIBUTES = [ + {name: 'position', type: 'vec3'}, + {name: 'nextPosition', type: 'vec3'}, + {name: 'arcLength', type: 'float'}, + {name: 'lineWidth', type: 'float'}, + {name: 'color', type: 'vec4'} +] + +exports.createShader = function(gl) { + return createShader(gl, vertSrc, forwardFrag, null, ATTRIBUTES) +} + +exports.createPickShader = function(gl) { + return createShader(gl, vertSrc, pickFrag, null, ATTRIBUTES) +} + +},{"gl-shader":242,"glslify":186}],185:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createLinePlot + +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createTexture = _dereq_('gl-texture2d') + +var UINT8_VIEW = new Uint8Array(4) +var FLOAT_VIEW = new Float32Array(UINT8_VIEW.buffer) +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.js +function unpackFloat(x, y, z, w) { + UINT8_VIEW[0] = w + UINT8_VIEW[1] = z + UINT8_VIEW[2] = y + UINT8_VIEW[3] = x + return FLOAT_VIEW[0] +} + +var bsearch = _dereq_('binary-search-bounds') +var ndarray = _dereq_('ndarray') +var shaders = _dereq_('./lib/shaders') + +var createShader = shaders.createShader +var createPickShader = shaders.createPickShader + +var identity = [1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1] + +function distance (a, b) { + var s = 0.0 + for (var i = 0; i < 3; ++i) { + var d = a[i] - b[i] + s += d * d + } + return Math.sqrt(s) +} + +function filterClipBounds (bounds) { + var result = [[-1e6, -1e6, -1e6], [1e6, 1e6, 1e6]] + for (var i = 0; i < 3; ++i) { + result[0][i] = Math.max(bounds[0][i], result[0][i]) + result[1][i] = Math.min(bounds[1][i], result[1][i]) + } + return result +} + +function PickResult (tau, position, index, dataCoordinate) { + this.arcLength = tau + this.position = position + this.index = index + this.dataCoordinate = dataCoordinate +} + +function LinePlot (gl, shader, pickShader, buffer, vao, texture) { + this.gl = gl + this.shader = shader + this.pickShader = pickShader + this.buffer = buffer + this.vao = vao + this.clipBounds = [ + [ -Infinity, -Infinity, -Infinity ], + [ Infinity, Infinity, Infinity ]] + this.points = [] + this.arcLength = [] + this.vertexCount = 0 + this.bounds = [[0, 0, 0], [0, 0, 0]] + this.pickId = 0 + this.lineWidth = 1 + this.texture = texture + this.dashScale = 1 + this.opacity = 1 + this.hasAlpha = false + this.dirty = true + this.pixelRatio = 1 +} + +var proto = LinePlot.prototype + +proto.isTransparent = function () { + return this.hasAlpha +} + +proto.isOpaque = function () { + return !this.hasAlpha +} + +proto.pickSlots = 1 + +proto.setPickBase = function (id) { + this.pickId = id +} + +proto.drawTransparent = proto.draw = function (camera) { + if (!this.vertexCount) return + var gl = this.gl + var shader = this.shader + var vao = this.vao + shader.bind() + shader.uniforms = { + model: camera.model || identity, + view: camera.view || identity, + projection: camera.projection || identity, + clipBounds: filterClipBounds(this.clipBounds), + dashTexture: this.texture.bind(), + dashScale: this.dashScale / this.arcLength[this.arcLength.length - 1], + opacity: this.opacity, + screenShape: [gl.drawingBufferWidth, gl.drawingBufferHeight], + pixelRatio: this.pixelRatio + } + vao.bind() + vao.draw(gl.TRIANGLE_STRIP, this.vertexCount) + vao.unbind() +} + +proto.drawPick = function (camera) { + if (!this.vertexCount) return + var gl = this.gl + var shader = this.pickShader + var vao = this.vao + shader.bind() + shader.uniforms = { + model: camera.model || identity, + view: camera.view || identity, + projection: camera.projection || identity, + pickId: this.pickId, + clipBounds: filterClipBounds(this.clipBounds), + screenShape: [gl.drawingBufferWidth, gl.drawingBufferHeight], + pixelRatio: this.pixelRatio + } + vao.bind() + vao.draw(gl.TRIANGLE_STRIP, this.vertexCount) + vao.unbind() +} + +proto.update = function (options) { + var i, j + + this.dirty = true + + var connectGaps = !!options.connectGaps + + if ('dashScale' in options) { + this.dashScale = options.dashScale + } + + this.hasAlpha = false // default to no transparent draw + if ('opacity' in options) { + this.opacity = +options.opacity + if(this.opacity < 1) { + this.hasAlpha = true; + } + } + + // Recalculate buffer data + var buffer = [] + var arcLengthArray = [] + var pointArray = [] + var arcLength = 0.0 + var vertexCount = 0 + var bounds = [ + [ Infinity, Infinity, Infinity ], + [ -Infinity, -Infinity, -Infinity ]] + + var positions = options.position || options.positions + if (positions) { + + // Default color + var colors = options.color || options.colors || [0, 0, 0, 1] + + var lineWidth = options.lineWidth || 1 + + var hadGap = false + + fill_loop: + for (i = 1; i < positions.length; ++i) { + var a = positions[i - 1] + var b = positions[i] + + arcLengthArray.push(arcLength) + pointArray.push(a.slice()) + + for (j = 0; j < 3; ++j) { + if (isNaN(a[j]) || isNaN(b[j]) || + !isFinite(a[j]) || !isFinite(b[j])) { + + if (!connectGaps && buffer.length > 0) { + for (var k = 0; k < 24; ++k) { + buffer.push(buffer[buffer.length - 12]) + } + vertexCount += 2 + hadGap = true + } + + continue fill_loop + } + bounds[0][j] = Math.min(bounds[0][j], a[j], b[j]) + bounds[1][j] = Math.max(bounds[1][j], a[j], b[j]) + } + + var acolor, bcolor + if (Array.isArray(colors[0])) { + acolor = (colors.length > i - 1) ? colors[i - 1] : // using index value + (colors.length > 0) ? colors[colors.length - 1] : // using last item + [0, 0, 0, 1]; // using black + + bcolor = (colors.length > i) ? colors[i] : // using index value + (colors.length > 0) ? colors[colors.length - 1] : // using last item + [0, 0, 0, 1]; // using black + } else { + acolor = bcolor = colors + } + + if (acolor.length === 3) { + acolor = [acolor[0], acolor[1], acolor[2], 1] + } + if (bcolor.length === 3) { + bcolor = [bcolor[0], bcolor[1], bcolor[2], 1] + } + + if(!this.hasAlpha && acolor[3] < 1) this.hasAlpha = true + + var w0 + if (Array.isArray(lineWidth)) { + w0 = (lineWidth.length > i - 1) ? lineWidth[i - 1] : // using index value + (lineWidth.length > 0) ? lineWidth[lineWidth.length - 1] : // using last item + [0, 0, 0, 1]; // using black + } else { + w0 = lineWidth + } + + var t0 = arcLength + arcLength += distance(a, b) + + if (hadGap) { + for (j = 0; j < 2; ++j) { + buffer.push( + a[0], a[1], a[2], b[0], b[1], b[2], t0, w0, acolor[0], acolor[1], acolor[2], acolor[3]) + } + vertexCount += 2 + hadGap = false + } + + buffer.push( + a[0], a[1], a[2], b[0], b[1], b[2], t0, w0, acolor[0], acolor[1], acolor[2], acolor[3], + a[0], a[1], a[2], b[0], b[1], b[2], t0, -w0, acolor[0], acolor[1], acolor[2], acolor[3], + b[0], b[1], b[2], a[0], a[1], a[2], arcLength, -w0, bcolor[0], bcolor[1], bcolor[2], bcolor[3], + b[0], b[1], b[2], a[0], a[1], a[2], arcLength, w0, bcolor[0], bcolor[1], bcolor[2], bcolor[3]) + + vertexCount += 4 + } + } + this.buffer.update(buffer) + + arcLengthArray.push(arcLength) + pointArray.push(positions[positions.length - 1].slice()) + + this.bounds = bounds + + this.vertexCount = vertexCount + + this.points = pointArray + this.arcLength = arcLengthArray + + if ('dashes' in options) { + var dashArray = options.dashes + + // Calculate prefix sum + var prefixSum = dashArray.slice() + prefixSum.unshift(0) + for (i = 1; i < prefixSum.length; ++i) { + prefixSum[i] = prefixSum[i - 1] + prefixSum[i] + } + + var dashTexture = ndarray(new Array(256 * 4), [256, 1, 4]) + for (i = 0; i < 256; ++i) { + for (j = 0; j < 4; ++j) { + dashTexture.set(i, 0, j, 0) + } + if (bsearch.le(prefixSum, prefixSum[prefixSum.length - 1] * i / 255.0) & 1) { + dashTexture.set(i, 0, 0, 0) + } else { + dashTexture.set(i, 0, 0, 255) + } + } + + this.texture.setPixels(dashTexture) + } +} + +proto.dispose = function () { + this.shader.dispose() + this.vao.dispose() + this.buffer.dispose() +} + +proto.pick = function (selection) { + if (!selection) { + return null + } + if (selection.id !== this.pickId) { + return null + } + var tau = unpackFloat( + selection.value[0], + selection.value[1], + selection.value[2], + 0) + var index = bsearch.le(this.arcLength, tau) + if (index < 0) { + return null + } + if (index === this.arcLength.length - 1) { + return new PickResult( + this.arcLength[this.arcLength.length - 1], + this.points[this.points.length - 1].slice(), + index) + } + var a = this.points[index] + var b = this.points[Math.min(index + 1, this.points.length - 1)] + var t = (tau - this.arcLength[index]) / (this.arcLength[index + 1] - this.arcLength[index]) + var ti = 1.0 - t + var x = [0, 0, 0] + for (var i = 0; i < 3; ++i) { + x[i] = ti * a[i] + t * b[i] + } + var dataIndex = Math.min((t < 0.5) ? index : (index + 1), this.points.length - 1) + return new PickResult( + tau, + x, + dataIndex, + this.points[dataIndex]) +} + +function createLinePlot (options) { + var gl = options.gl || (options.scene && options.scene.gl) + + var shader = createShader(gl) + shader.attributes.position.location = 0 + shader.attributes.nextPosition.location = 1 + shader.attributes.arcLength.location = 2 + shader.attributes.lineWidth.location = 3 + shader.attributes.color.location = 4 + + var pickShader = createPickShader(gl) + pickShader.attributes.position.location = 0 + pickShader.attributes.nextPosition.location = 1 + pickShader.attributes.arcLength.location = 2 + pickShader.attributes.lineWidth.location = 3 + pickShader.attributes.color.location = 4 + + var buffer = createBuffer(gl) + var vao = createVAO(gl, [ + { + 'buffer': buffer, + 'size': 3, + 'offset': 0, + 'stride': 48 + }, + { + 'buffer': buffer, + 'size': 3, + 'offset': 12, + 'stride': 48 + }, + { + 'buffer': buffer, + 'size': 1, + 'offset': 24, + 'stride': 48 + }, + { + 'buffer': buffer, + 'size': 1, + 'offset': 28, + 'stride': 48 + }, + { + 'buffer': buffer, + 'size': 4, + 'offset': 32, + 'stride': 48 + } + ]) + + // Create texture for dash pattern + var defaultTexture = ndarray(new Array(256 * 4), [256, 1, 4]) + for (var i = 0; i < 256 * 4; ++i) { + defaultTexture.data[i] = 255 + } + var texture = createTexture(gl, defaultTexture) + texture.wrap = gl.REPEAT + + var linePlot = new LinePlot(gl, shader, pickShader, buffer, vao, texture) + linePlot.update(options) + return linePlot +} + +},{"./lib/shaders":184,"binary-search-bounds":92,"gl-buffer":171,"gl-texture2d":257,"gl-vao":261,"ndarray":376}],186:[function(_dereq_,module,exports){ +arguments[4][178][0].apply(exports,arguments) +},{"dup":178}],187:[function(_dereq_,module,exports){ +module.exports = adjoint; + +/** + * Calculates the adjugate of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +function adjoint(out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + + out[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + out[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + out[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + out[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + out[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + out[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + out[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + return out; +}; +},{}],188:[function(_dereq_,module,exports){ +module.exports = clone; + +/** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param {mat4} a matrix to clone + * @returns {mat4} a new 4x4 matrix + */ +function clone(a) { + var out = new Float32Array(16); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; +},{}],189:[function(_dereq_,module,exports){ +module.exports = copy; + +/** + * Copy the values from one mat4 to another + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; +},{}],190:[function(_dereq_,module,exports){ +module.exports = create; + +/** + * Creates a new identity mat4 + * + * @returns {mat4} a new 4x4 matrix + */ +function create() { + var out = new Float32Array(16); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +}; +},{}],191:[function(_dereq_,module,exports){ +module.exports = determinant; + +/** + * Calculates the determinant of a mat4 + * + * @param {mat4} a the source matrix + * @returns {Number} determinant of a + */ +function determinant(a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], + + b00 = a00 * a11 - a01 * a10, + b01 = a00 * a12 - a02 * a10, + b02 = a00 * a13 - a03 * a10, + b03 = a01 * a12 - a02 * a11, + b04 = a01 * a13 - a03 * a11, + b05 = a02 * a13 - a03 * a12, + b06 = a20 * a31 - a21 * a30, + b07 = a20 * a32 - a22 * a30, + b08 = a20 * a33 - a23 * a30, + b09 = a21 * a32 - a22 * a31, + b10 = a21 * a33 - a23 * a31, + b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +}; +},{}],192:[function(_dereq_,module,exports){ +module.exports = fromQuat; + +/** + * Creates a matrix from a quaternion rotation. + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @returns {mat4} out + */ +function fromQuat(out, q) { + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + yx = y * x2, + yy = y * y2, + zx = z * x2, + zy = z * y2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2; + + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return out; +}; +},{}],193:[function(_dereq_,module,exports){ +module.exports = fromRotation + +/** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest) + * mat4.rotate(dest, dest, rad, axis) + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @param {vec3} axis the axis to rotate around + * @returns {mat4} out + */ +function fromRotation(out, rad, axis) { + var s, c, t + var x = axis[0] + var y = axis[1] + var z = axis[2] + var len = Math.sqrt(x * x + y * y + z * z) + + if (Math.abs(len) < 0.000001) { + return null + } + + len = 1 / len + x *= len + y *= len + z *= len + + s = Math.sin(rad) + c = Math.cos(rad) + t = 1 - c + + // Perform rotation-specific matrix multiplication + out[0] = x * x * t + c + out[1] = y * x * t + z * s + out[2] = z * x * t - y * s + out[3] = 0 + out[4] = x * y * t - z * s + out[5] = y * y * t + c + out[6] = z * y * t + x * s + out[7] = 0 + out[8] = x * z * t + y * s + out[9] = y * z * t - x * s + out[10] = z * z * t + c + out[11] = 0 + out[12] = 0 + out[13] = 0 + out[14] = 0 + out[15] = 1 + return out +} + +},{}],194:[function(_dereq_,module,exports){ +module.exports = fromRotationTranslation; + +/** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {vec3} v Translation vector + * @returns {mat4} out + */ +function fromRotationTranslation(out, q, v) { + // Quaternion math + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + xy = x * y2, + xz = x * z2, + yy = y * y2, + yz = y * z2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + + return out; +}; +},{}],195:[function(_dereq_,module,exports){ +module.exports = fromScaling + +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest) + * mat4.scale(dest, dest, vec) + * + * @param {mat4} out mat4 receiving operation result + * @param {vec3} v Scaling vector + * @returns {mat4} out + */ +function fromScaling(out, v) { + out[0] = v[0] + out[1] = 0 + out[2] = 0 + out[3] = 0 + out[4] = 0 + out[5] = v[1] + out[6] = 0 + out[7] = 0 + out[8] = 0 + out[9] = 0 + out[10] = v[2] + out[11] = 0 + out[12] = 0 + out[13] = 0 + out[14] = 0 + out[15] = 1 + return out +} + +},{}],196:[function(_dereq_,module,exports){ +module.exports = fromTranslation + +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest) + * mat4.translate(dest, dest, vec) + * + * @param {mat4} out mat4 receiving operation result + * @param {vec3} v Translation vector + * @returns {mat4} out + */ +function fromTranslation(out, v) { + out[0] = 1 + out[1] = 0 + out[2] = 0 + out[3] = 0 + out[4] = 0 + out[5] = 1 + out[6] = 0 + out[7] = 0 + out[8] = 0 + out[9] = 0 + out[10] = 1 + out[11] = 0 + out[12] = v[0] + out[13] = v[1] + out[14] = v[2] + out[15] = 1 + return out +} + +},{}],197:[function(_dereq_,module,exports){ +module.exports = fromXRotation + +/** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest) + * mat4.rotateX(dest, dest, rad) + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +function fromXRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad) + + // Perform axis-specific matrix multiplication + out[0] = 1 + out[1] = 0 + out[2] = 0 + out[3] = 0 + out[4] = 0 + out[5] = c + out[6] = s + out[7] = 0 + out[8] = 0 + out[9] = -s + out[10] = c + out[11] = 0 + out[12] = 0 + out[13] = 0 + out[14] = 0 + out[15] = 1 + return out +} +},{}],198:[function(_dereq_,module,exports){ +module.exports = fromYRotation + +/** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest) + * mat4.rotateY(dest, dest, rad) + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +function fromYRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad) + + // Perform axis-specific matrix multiplication + out[0] = c + out[1] = 0 + out[2] = -s + out[3] = 0 + out[4] = 0 + out[5] = 1 + out[6] = 0 + out[7] = 0 + out[8] = s + out[9] = 0 + out[10] = c + out[11] = 0 + out[12] = 0 + out[13] = 0 + out[14] = 0 + out[15] = 1 + return out +} +},{}],199:[function(_dereq_,module,exports){ +module.exports = fromZRotation + +/** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest) + * mat4.rotateZ(dest, dest, rad) + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +function fromZRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad) + + // Perform axis-specific matrix multiplication + out[0] = c + out[1] = s + out[2] = 0 + out[3] = 0 + out[4] = -s + out[5] = c + out[6] = 0 + out[7] = 0 + out[8] = 0 + out[9] = 0 + out[10] = 1 + out[11] = 0 + out[12] = 0 + out[13] = 0 + out[14] = 0 + out[15] = 1 + return out +} +},{}],200:[function(_dereq_,module,exports){ +module.exports = frustum; + +/** + * Generates a frustum matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Number} left Left bound of the frustum + * @param {Number} right Right bound of the frustum + * @param {Number} bottom Bottom bound of the frustum + * @param {Number} top Top bound of the frustum + * @param {Number} near Near bound of the frustum + * @param {Number} far Far bound of the frustum + * @returns {mat4} out + */ +function frustum(out, left, right, bottom, top, near, far) { + var rl = 1 / (right - left), + tb = 1 / (top - bottom), + nf = 1 / (near - far); + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + return out; +}; +},{}],201:[function(_dereq_,module,exports){ +module.exports = identity; + +/** + * Set a mat4 to the identity matrix + * + * @param {mat4} out the receiving matrix + * @returns {mat4} out + */ +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +}; +},{}],202:[function(_dereq_,module,exports){ +module.exports = { + create: _dereq_('./create') + , clone: _dereq_('./clone') + , copy: _dereq_('./copy') + , identity: _dereq_('./identity') + , transpose: _dereq_('./transpose') + , invert: _dereq_('./invert') + , adjoint: _dereq_('./adjoint') + , determinant: _dereq_('./determinant') + , multiply: _dereq_('./multiply') + , translate: _dereq_('./translate') + , scale: _dereq_('./scale') + , rotate: _dereq_('./rotate') + , rotateX: _dereq_('./rotateX') + , rotateY: _dereq_('./rotateY') + , rotateZ: _dereq_('./rotateZ') + , fromRotation: _dereq_('./fromRotation') + , fromRotationTranslation: _dereq_('./fromRotationTranslation') + , fromScaling: _dereq_('./fromScaling') + , fromTranslation: _dereq_('./fromTranslation') + , fromXRotation: _dereq_('./fromXRotation') + , fromYRotation: _dereq_('./fromYRotation') + , fromZRotation: _dereq_('./fromZRotation') + , fromQuat: _dereq_('./fromQuat') + , frustum: _dereq_('./frustum') + , perspective: _dereq_('./perspective') + , perspectiveFromFieldOfView: _dereq_('./perspectiveFromFieldOfView') + , ortho: _dereq_('./ortho') + , lookAt: _dereq_('./lookAt') + , str: _dereq_('./str') +} + +},{"./adjoint":187,"./clone":188,"./copy":189,"./create":190,"./determinant":191,"./fromQuat":192,"./fromRotation":193,"./fromRotationTranslation":194,"./fromScaling":195,"./fromTranslation":196,"./fromXRotation":197,"./fromYRotation":198,"./fromZRotation":199,"./frustum":200,"./identity":201,"./invert":203,"./lookAt":204,"./multiply":205,"./ortho":206,"./perspective":207,"./perspectiveFromFieldOfView":208,"./rotate":209,"./rotateX":210,"./rotateY":211,"./rotateZ":212,"./scale":213,"./str":214,"./translate":215,"./transpose":216}],203:[function(_dereq_,module,exports){ +module.exports = invert; + +/** + * Inverts a mat4 + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +function invert(out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], + + b00 = a00 * a11 - a01 * a10, + b01 = a00 * a12 - a02 * a10, + b02 = a00 * a13 - a03 * a10, + b03 = a01 * a12 - a02 * a11, + b04 = a01 * a13 - a03 * a11, + b05 = a02 * a13 - a03 * a12, + b06 = a20 * a31 - a21 * a30, + b07 = a20 * a32 - a22 * a30, + b08 = a20 * a33 - a23 * a30, + b09 = a21 * a32 - a22 * a31, + b10 = a21 * a33 - a23 * a31, + b11 = a22 * a33 - a23 * a32, + + // Calculate the determinant + det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return out; +}; +},{}],204:[function(_dereq_,module,exports){ +var identity = _dereq_('./identity'); + +module.exports = lookAt; + +/** + * Generates a look-at matrix with the given eye position, focal point, and up axis + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {vec3} eye Position of the viewer + * @param {vec3} center Point the viewer is looking at + * @param {vec3} up vec3 pointing up + * @returns {mat4} out + */ +function lookAt(out, eye, center, up) { + var x0, x1, x2, y0, y1, y2, z0, z1, z2, len, + eyex = eye[0], + eyey = eye[1], + eyez = eye[2], + upx = up[0], + upy = up[1], + upz = up[2], + centerx = center[0], + centery = center[1], + centerz = center[2]; + + if (Math.abs(eyex - centerx) < 0.000001 && + Math.abs(eyey - centery) < 0.000001 && + Math.abs(eyez - centerz) < 0.000001) { + return identity(out); + } + + z0 = eyex - centerx; + z1 = eyey - centery; + z2 = eyez - centerz; + + len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + + x0 = upy * z2 - upz * z1; + x1 = upz * z0 - upx * z2; + x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + y0 = z1 * x2 - z2 * x1; + y1 = z2 * x0 - z0 * x2; + y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return out; +}; +},{"./identity":201}],205:[function(_dereq_,module,exports){ +module.exports = multiply; + +/** + * Multiplies two mat4's + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ +function multiply(out, a, b) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + + // Cache only the current line of the second matrix + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; + out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7]; + out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11]; + out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15]; + out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + return out; +}; +},{}],206:[function(_dereq_,module,exports){ +module.exports = ortho; + +/** + * Generates a orthogonal projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} left Left bound of the frustum + * @param {number} right Right bound of the frustum + * @param {number} bottom Bottom bound of the frustum + * @param {number} top Top bound of the frustum + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ +function ortho(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right), + bt = 1 / (bottom - top), + nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; +}; +},{}],207:[function(_dereq_,module,exports){ +module.exports = perspective; + +/** + * Generates a perspective projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fovy Vertical field of view in radians + * @param {number} aspect Aspect ratio. typically viewport width/height + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ +function perspective(out, fovy, aspect, near, far) { + var f = 1.0 / Math.tan(fovy / 2), + nf = 1 / (near - far); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + return out; +}; +},{}],208:[function(_dereq_,module,exports){ +module.exports = perspectiveFromFieldOfView; + +/** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ +function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI/180.0), + downTan = Math.tan(fov.downDegrees * Math.PI/180.0), + leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0), + rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0), + xScale = 2.0 / (leftTan + rightTan), + yScale = 2.0 / (upTan + downTan); + + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = ((upTan - downTan) * yScale * 0.5); + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = (far * near) / (near - far); + out[15] = 0.0; + return out; +} + + +},{}],209:[function(_dereq_,module,exports){ +module.exports = rotate; + +/** + * Rotates a mat4 by the given angle + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @param {vec3} axis the axis to rotate around + * @returns {mat4} out + */ +function rotate(out, a, rad, axis) { + var x = axis[0], y = axis[1], z = axis[2], + len = Math.sqrt(x * x + y * y + z * z), + s, c, t, + a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23, + b00, b01, b02, + b10, b11, b12, + b20, b21, b22; + + if (Math.abs(len) < 0.000001) { return null; } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + + a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; + a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; + a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; + + // Construct the elements of the rotation matrix + b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s; + b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s; + b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; +}; +},{}],210:[function(_dereq_,module,exports){ +module.exports = rotateX; + +/** + * Rotates a matrix by the given angle around the X axis + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +function rotateX(out, a, rad) { + var s = Math.sin(rad), + c = Math.cos(rad), + a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7], + a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + + if (a !== out) { // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; +}; +},{}],211:[function(_dereq_,module,exports){ +module.exports = rotateY; + +/** + * Rotates a matrix by the given angle around the Y axis + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +function rotateY(out, a, rad) { + var s = Math.sin(rad), + c = Math.cos(rad), + a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3], + a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + + if (a !== out) { // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; +}; +},{}],212:[function(_dereq_,module,exports){ +module.exports = rotateZ; + +/** + * Rotates a matrix by the given angle around the Z axis + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +function rotateZ(out, a, rad) { + var s = Math.sin(rad), + c = Math.cos(rad), + a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3], + a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + + if (a !== out) { // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; +}; +},{}],213:[function(_dereq_,module,exports){ +module.exports = scale; + +/** + * Scales the mat4 by the dimensions in the given vec3 + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to scale + * @param {vec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ +function scale(out, a, v) { + var x = v[0], y = v[1], z = v[2]; + + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; +},{}],214:[function(_dereq_,module,exports){ +module.exports = str; + +/** + * Returns a string representation of a mat4 + * + * @param {mat4} mat matrix to represent as a string + * @returns {String} string representation of the matrix + */ +function str(a) { + return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + + a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; +}; +},{}],215:[function(_dereq_,module,exports){ +module.exports = translate; + +/** + * Translate a mat4 by the given vector + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to translate + * @param {vec3} v vector to translate by + * @returns {mat4} out + */ +function translate(out, a, v) { + var x = v[0], y = v[1], z = v[2], + a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; + a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; + a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; + + out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03; + out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13; + out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23; + + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; +}; +},{}],216:[function(_dereq_,module,exports){ +module.exports = transpose; + +/** + * Transpose the values of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], a02 = a[2], a03 = a[3], + a12 = a[6], a13 = a[7], + a23 = a[11]; + + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; } + + return out; +}; +},{}],217:[function(_dereq_,module,exports){ +'use strict' - return root; - } +var barycentric = _dereq_('barycentric') +var closestPointToTriangle = _dereq_('polytope-closest-point/lib/closest_point_2d.js') - // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is - // applied recursively to the children of v, as well as the function - // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the - // node v is placed to the midpoint of its outermost children. - function firstWalk(v) { - var children = v.children, - siblings = v.parent.children, - w = v.i ? siblings[v.i - 1] : null; - if (children) { - executeShifts(v); - var midpoint = (children[0].z + children[children.length - 1].z) / 2; - if (w) { - v.z = w.z + separation(v._, w._); - v.m = v.z - midpoint; - } else { - v.z = midpoint; - } - } else if (w) { - v.z = w.z + separation(v._, w._); +module.exports = closestPointToPickLocation + +function xformMatrix(m, v) { + var out = [0,0,0,0] + for(var i=0; i<4; ++i) { + for(var j=0; j<4; ++j) { + out[j] += m[4*i + j] * v[i] } - v.parent.A = apportion(v, w, v.parent.A || siblings[0]); } + return out +} - // Computes all real x-coordinates by summing up the modifiers recursively. - function secondWalk(v) { - v._.x = v.z + v.parent.m; - v.m += v.parent.m; +function projectVertex(v, model, view, projection, resolution) { + var p = xformMatrix(projection, + xformMatrix(view, + xformMatrix(model, [v[0], v[1], v[2], 1]))) + for(var i=0; i<3; ++i) { + p[i] /= p[3] } + return [ 0.5 * resolution[0] * (1.0+p[0]), 0.5 * resolution[1] * (1.0-p[1]) ] +} - // The core of the algorithm. Here, a new subtree is combined with the - // previous subtrees. Threads are used to traverse the inside and outside - // contours of the left and right subtree up to the highest common level. The - // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the - // superscript o means outside and i means inside, the subscript - means left - // subtree and + means right subtree. For summing up the modifiers along the - // contour, we use respective variables si+, si-, so-, and so+. Whenever two - // nodes of the inside contours conflict, we compute the left one of the - // greatest uncommon ancestors using the function ANCESTOR and call MOVE - // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees. - // Finally, we add a new thread (if necessary). - function apportion(v, w, ancestor) { - if (w) { - var vip = v, - vop = v, - vim = w, - vom = vip.parent.children[0], - sip = vip.m, - sop = vop.m, - sim = vim.m, - som = vom.m, - shift; - while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) { - vom = nextLeft(vom); - vop = nextRight(vop); - vop.a = v; - shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); - if (shift > 0) { - moveSubtree(nextAncestor(vim, v, ancestor), v, shift); - sip += shift; - sop += shift; - } - sim += vim.m; - sip += vip.m; - som += vom.m; - sop += vop.m; - } - if (vim && !nextRight(vop)) { - vop.t = vim; - vop.m += sim - sop; - } - if (vip && !nextLeft(vom)) { - vom.t = vip; - vom.m += sip - som; - ancestor = v; - } +function barycentricCoord(simplex, point) { + if(simplex.length === 2) { + var d0 = 0.0 + var d1 = 0.0 + for(var i=0; i<2; ++i) { + d0 += Math.pow(point[i] - simplex[0][i], 2) + d1 += Math.pow(point[i] - simplex[1][i], 2) } - return ancestor; - } - - function sizeNode(node) { - node.x *= dx; - node.y = node.depth * dy; + d0 = Math.sqrt(d0) + d1 = Math.sqrt(d1) + if(d0+d1 < 1e-6) { + return [1,0] + } + return [d1/(d0+d1),d0/(d1+d0)] + } else if(simplex.length === 3) { + var closestPoint = [0,0] + closestPointToTriangle(simplex[0], simplex[1], simplex[2], point, closestPoint) + return barycentric(simplex, closestPoint) } - - tree.separation = function(x) { - return arguments.length ? (separation = x, tree) : separation; - }; - - tree.size = function(x) { - return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]); - }; - - tree.nodeSize = function(x) { - return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null); - }; - - return tree; + return [] } -function treemapSlice(parent, x0, y0, x1, y1) { - var nodes = parent.children, - node, - i = -1, - n = nodes.length, - k = parent.value && (y1 - y0) / parent.value; - - while (++i < n) { - node = nodes[i], node.x0 = x0, node.x1 = x1; - node.y0 = y0, node.y1 = y0 += node.value * k; +function interpolate(simplex, weights) { + var result = [0,0,0] + for(var i=0; i maxValue) maxValue = nodeValue; - beta = sumValue * sumValue * alpha; - newRatio = Math.max(maxValue / beta, beta / minValue); - if (newRatio > minRatio) { sumValue -= nodeValue; break; } - minRatio = newRatio; + var closestIndex = 0 + var closestDist = Infinity + for(var i=0; i 1.0001) { + return null + } + s += weights[i] + } + if(Math.abs(s - 1.0) > 0.001) { + return null } + return [closestIndex, interpolate(simplex, weights), weights] +} +},{"barycentric":74,"polytope-closest-point/lib/closest_point_2d.js":397}],218:[function(_dereq_,module,exports){ +var glslify = _dereq_('glslify') + +var triVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]) +var triFragSrc = glslify(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]) +var edgeVertSrc = glslify(["precision highp 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}"]) +var edgeFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]) +var pointVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]) +var pointFragSrc = glslify(["precision highp 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}"]) +var pickVertSrc = glslify(["precision highp 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}"]) +var pickFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]) +var pickPointVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]) +var contourVertSrc = glslify(["precision highp 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}"]) +var contourFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]) + +exports.meshShader = { + vertex: triVertSrc, + fragment: triFragSrc, + attributes: [ + {name: 'position', type: 'vec3'}, + {name: 'normal', type: 'vec3'}, + {name: 'color', type: 'vec4'}, + {name: 'uv', type: 'vec2'} + ] +} +exports.wireShader = { + vertex: edgeVertSrc, + fragment: edgeFragSrc, + attributes: [ + {name: 'position', type: 'vec3'}, + {name: 'color', type: 'vec4'}, + {name: 'uv', type: 'vec2'} + ] +} +exports.pointShader = { + vertex: pointVertSrc, + fragment: pointFragSrc, + attributes: [ + {name: 'position', type: 'vec3'}, + {name: 'color', type: 'vec4'}, + {name: 'uv', type: 'vec2'}, + {name: 'pointSize', type: 'float'} + ] +} +exports.pickShader = { + vertex: pickVertSrc, + fragment: pickFragSrc, + attributes: [ + {name: 'position', type: 'vec3'}, + {name: 'id', type: 'vec4'} + ] +} +exports.pointPickShader = { + vertex: pickPointVertSrc, + fragment: pickFragSrc, + attributes: [ + {name: 'position', type: 'vec3'}, + {name: 'pointSize', type: 'float'}, + {name: 'id', type: 'vec4'} + ] +} +exports.contourShader = { + vertex: contourVertSrc, + fragment: contourFragSrc, + attributes: [ + {name: 'position', type: 'vec3'} + ] +} + +},{"glslify":342}],219:[function(_dereq_,module,exports){ +'use strict' - return rows; +var DEFAULT_VERTEX_NORMALS_EPSILON = 1e-6; // may be too large if triangles are very small +var DEFAULT_FACE_NORMALS_EPSILON = 1e-6; + +var createShader = _dereq_('gl-shader') +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createTexture = _dereq_('gl-texture2d') +var normals = _dereq_('normals') +var multiply = _dereq_('gl-mat4/multiply') +var invert = _dereq_('gl-mat4/invert') +var ndarray = _dereq_('ndarray') +var colormap = _dereq_('colormap') +var getContour = _dereq_('simplicial-complex-contour') +var pool = _dereq_('typedarray-pool') +var shaders = _dereq_('./lib/shaders') +var closestPoint = _dereq_('./lib/closest-point') + +var meshShader = shaders.meshShader +var wireShader = shaders.wireShader +var pointShader = shaders.pointShader +var pickShader = shaders.pickShader +var pointPickShader = shaders.pointPickShader +var contourShader = shaders.contourShader + +var IDENTITY = [ + 1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] + + +function SimplicialMesh(gl + , texture + , triShader + , lineShader + , pointShader + , pickShader + , pointPickShader + , contourShader + , trianglePositions + , triangleIds + , triangleColors + , triangleUVs + , triangleNormals + , triangleVAO + , edgePositions + , edgeIds + , edgeColors + , edgeUVs + , edgeVAO + , pointPositions + , pointIds + , pointColors + , pointUVs + , pointSizes + , pointVAO + , contourPositions + , contourVAO) { + + this.gl = gl + this.pixelRatio = 1 + this.cells = [] + this.positions = [] + this.intensity = [] + this.texture = texture + this.dirty = true + + this.triShader = triShader + this.lineShader = lineShader + this.pointShader = pointShader + this.pickShader = pickShader + this.pointPickShader = pointPickShader + this.contourShader = contourShader + + this.trianglePositions = trianglePositions + this.triangleColors = triangleColors + this.triangleNormals = triangleNormals + this.triangleUVs = triangleUVs + this.triangleIds = triangleIds + this.triangleVAO = triangleVAO + this.triangleCount = 0 + + this.lineWidth = 1 + this.edgePositions = edgePositions + this.edgeColors = edgeColors + this.edgeUVs = edgeUVs + this.edgeIds = edgeIds + this.edgeVAO = edgeVAO + this.edgeCount = 0 + + this.pointPositions = pointPositions + this.pointColors = pointColors + this.pointUVs = pointUVs + this.pointSizes = pointSizes + this.pointIds = pointIds + this.pointVAO = pointVAO + this.pointCount = 0 + + this.contourLineWidth = 1 + this.contourPositions = contourPositions + this.contourVAO = contourVAO + this.contourCount = 0 + this.contourColor = [0,0,0] + this.contourEnable = true + + this.pickVertex = true; + this.pickId = 1 + this.bounds = [ + [ Infinity, Infinity, Infinity], + [-Infinity,-Infinity,-Infinity] ] + this.clipBounds = [ + [-Infinity,-Infinity,-Infinity], + [ Infinity, Infinity, Infinity] ] + + this.lightPosition = [1e5, 1e5, 0] + this.ambientLight = 0.8 + this.diffuseLight = 0.8 + this.specularLight = 2.0 + this.roughness = 0.5 + this.fresnel = 1.5 + + this.opacity = 1.0 + this.hasAlpha = false + this.opacityscale = false + + this._model = IDENTITY + this._view = IDENTITY + this._projection = IDENTITY + this._resolution = [1,1] +} + +var proto = SimplicialMesh.prototype + +proto.isOpaque = function() { + return !this.hasAlpha +} + +proto.isTransparent = function() { + return this.hasAlpha +} + +proto.pickSlots = 1 + +proto.setPickBase = function(id) { + this.pickId = id +} + +function getOpacityFromScale(ratio, opacityscale) { + + if(!opacityscale) return 1 + if(!opacityscale.length) return 1 + + for(var i = 0; i < opacityscale.length; ++i) { + if(opacityscale.length < 2) return 1 + if(opacityscale[i][0] === ratio) return opacityscale[i][1] + if(opacityscale[i][0] > ratio && i > 0) { + var d = (opacityscale[i][0] - ratio) / (opacityscale[i][0] - opacityscale[i - 1][0]) + return opacityscale[i][1] * (1 - d) + d * opacityscale[i - 1][1] + } + } + + return 1 } -var squarify = (function custom(ratio) { +function genColormap(param, opacityscale) { + var colors = colormap({ + colormap: param + , nshades: 256 + , format: 'rgba' + }) - function squarify(parent, x0, y0, x1, y1) { - squarifyRatio(ratio, parent, x0, y0, x1, y1); + var result = new Uint8Array(256*4) + for(var i=0; i<256; ++i) { + var c = colors[i] + for(var j=0; j<3; ++j) { + result[4*i+j] = c[j] + } + if(!opacityscale) { + result[4*i+3] = 255 * c[3] + } else { + result[4*i+3] = 255 * getOpacityFromScale(i / 255.0, opacityscale) + } } - squarify.ratio = function(x) { - return custom((x = +x) > 1 ? x : 1); - }; - - return squarify; -})(phi); - -function index$1() { - var tile = squarify, - round = false, - dx = 1, - dy = 1, - paddingStack = [0], - paddingInner = constantZero, - paddingTop = constantZero, - paddingRight = constantZero, - paddingBottom = constantZero, - paddingLeft = constantZero; + return ndarray(result, [256,256,4], [4,0,1]) +} - function treemap(root) { - root.x0 = - root.y0 = 0; - root.x1 = dx; - root.y1 = dy; - root.eachBefore(positionNode); - paddingStack = [0]; - if (round) root.eachBefore(roundNode); - return root; +function takeZComponent(array) { + var n = array.length + var result = new Array(n) + for(var i=0; i= j - 1) { - var node = nodes[i]; - node.x0 = x0, node.y0 = y0; - node.x1 = x1, node.y1 = y1; - return; - } - - var valueOffset = sums[i], - valueTarget = (value / 2) + valueOffset, - k = i + 1, - hi = j - 1; - - while (k < hi) { - var mid = k + hi >>> 1; - if (sums[mid] < valueTarget) k = mid + 1; - else hi = mid; - } - - if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k; + //Compute colors + var vertexColors = params.vertexColors + var cellColors = params.cellColors + var meshColor = params.meshColor || [1,1,1,1] - var valueLeft = sums[k] - valueOffset, - valueRight = value - valueLeft; + //UVs + var vertexUVs = params.vertexUVs + var vertexIntensity = params.vertexIntensity + var cellUVs = params.cellUVs + var cellIntensity = params.cellIntensity - if ((x1 - x0) > (y1 - y0)) { - var xk = (x0 * valueRight + x1 * valueLeft) / value; - partition(i, k, valueLeft, x0, y0, xk, y1); - partition(k, j, valueRight, xk, y0, x1, y1); + var intensityLo = Infinity + var intensityHi = -Infinity + if(!vertexUVs && !cellUVs) { + if(vertexIntensity) { + if(params.vertexIntensityBounds) { + intensityLo = +params.vertexIntensityBounds[0] + intensityHi = +params.vertexIntensityBounds[1] + } else { + for(var i=0; i 1 ? x : 1); - }; - - return resquarify; -})(phi); - -exports.cluster = cluster; -exports.hierarchy = hierarchy; -exports.pack = index; -exports.packEnclose = enclose; -exports.packSiblings = siblings; -exports.partition = partition; -exports.stratify = stratify; -exports.tree = tree; -exports.treemap = index$1; -exports.treemapBinary = binary; -exports.treemapDice = treemapDice; -exports.treemapResquarify = resquarify; -exports.treemapSlice = treemapSlice; -exports.treemapSliceDice = sliceDice; -exports.treemapSquarify = squarify; - -Object.defineProperty(exports, '__esModule', { value: true }); - -})); - -},{}],72:[function(_dereq_,module,exports){ -// https://d3js.org/d3-interpolate/ v1.4.0 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-color')) : -typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); -}(this, function (exports, d3Color) { 'use strict'; - -function basis(t1, v0, v1, v2, v3) { - var t2 = t1 * t1, t3 = t2 * t1; - return ((1 - 3 * t1 + 3 * t2 - t3) * v0 - + (4 - 6 * t2 + 3 * t3) * v1 - + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 - + t3 * v3) / 6; -} + //Pack cells into buffers + var triangleCount = 0 + var edgeCount = 0 + var pointCount = 0 -function basis$1(values) { - var n = values.length - 1; - return function(t) { - var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), - v1 = values[i], - v2 = values[i + 1], - v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, - v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} +fill_loop: + for(var i=0; i 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); -} + var uv + if(vertexUVs) { + uv = vertexUVs[v] + } else if(vertexIntensity) { + uv = [ + (vertexIntensity[v] - intensityLo) / + (intensityHi - intensityLo), 0] + } else if(cellUVs) { + uv = cellUVs[i] + } else if(cellIntensity) { + uv = [ + (cellIntensity[i] - intensityLo) / + (intensityHi - intensityLo), 0] + } else { + uv = [ + (p[2] - intensityLo) / + (intensityHi - intensityLo), 0] + } + pUVs.push(uv[0], uv[1]) -function gamma(y) { - return (y = +y) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a); - }; -} + if(pointSizes) { + pSiz.push(pointSizes[v]) + } else { + pSiz.push(meshPointSize) + } -function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : constant(isNaN(a) ? b : a); -} + pIds.push(i) -var rgb = (function rgbGamma(y) { - var color = gamma(y); + pointCount += 1 + break - function rgb(start, end) { - var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } + case 2: - rgb.gamma = rgbGamma; + //Check NaNs + for(var j=0; j<2; ++j) { + var v = cell[j] + var p = positions[v] + for(var k=0; k<3; ++k) { + if(isNaN(p[k]) || !isFinite(p[k])) { + continue fill_loop + } + } + } - return rgb; -})(1); + for(var j=0; j<2; ++j) { + var v = cell[j] + var p = positions[v] -function rgbSpline(spline) { - return function(colors) { - var n = colors.length, - r = new Array(n), - g = new Array(n), - b = new Array(n), - i, color; - for (i = 0; i < n; ++i) { - color = d3Color.rgb(colors[i]); - r[i] = color.r || 0; - g[i] = color.g || 0; - b[i] = color.b || 0; - } - r = spline(r); - g = spline(g); - b = spline(b); - color.opacity = 1; - return function(t) { - color.r = r(t); - color.g = g(t); - color.b = b(t); - return color + ""; - }; - }; -} + ePos.push(p[0], p[1], p[2]) -var rgbBasis = rgbSpline(basis$1); -var rgbBasisClosed = rgbSpline(basisClosed); + var c + if(vertexColors) { + c = vertexColors[v] + } else if(cellColors) { + c = cellColors[i] + } else { + c = meshColor + } + if(this.opacityscale && vertexIntensity) { + tCol.push(c[0], c[1], c[2], + this.opacity * getOpacityFromScale( + (vertexIntensity[v] - intensityLo) / (intensityHi - intensityLo), + this.opacityscale + ) + ) + } else if(c.length === 3) { + eCol.push(c[0], c[1], c[2], this.opacity) + } else { + eCol.push(c[0], c[1], c[2], c[3] * this.opacity) + if(c[3] < 1) this.hasAlpha = true + } -function numberArray(a, b) { - if (!b) b = []; - var n = a ? Math.min(b.length, a.length) : 0, - c = b.slice(), - i; - return function(t) { - for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; - return c; - }; -} + var uv + if(vertexUVs) { + uv = vertexUVs[v] + } else if(vertexIntensity) { + uv = [ + (vertexIntensity[v] - intensityLo) / + (intensityHi - intensityLo), 0] + } else if(cellUVs) { + uv = cellUVs[i] + } else if(cellIntensity) { + uv = [ + (cellIntensity[i] - intensityLo) / + (intensityHi - intensityLo), 0] + } else { + uv = [ + (p[2] - intensityLo) / + (intensityHi - intensityLo), 0] + } + eUVs.push(uv[0], uv[1]) -function isNumberArray(x) { - return ArrayBuffer.isView(x) && !(x instanceof DataView); -} + eIds.push(i) + } + edgeCount += 1 + break -function array(a, b) { - return (isNumberArray(b) ? numberArray : genericArray)(a, b); -} + case 3: + //Check NaNs + for(var j=0; j<3; ++j) { + var v = cell[j] + var p = positions[v] + for(var k=0; k<3; ++k) { + if(isNaN(p[k]) || !isFinite(p[k])) { + continue fill_loop + } + } + } -function genericArray(a, b) { - var nb = b ? b.length : 0, - na = a ? Math.min(nb, a.length) : 0, - x = new Array(na), - c = new Array(nb), - i; + for(var j=0; j<3; ++j) { + var v = cell[2 - j] - for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); - for (; i < nb; ++i) c[i] = b[i]; + var p = positions[v] + tPos.push(p[0], p[1], p[2]) - return function(t) { - for (i = 0; i < na; ++i) c[i] = x[i](t); - return c; - }; -} + var c + if(vertexColors) { + c = vertexColors[v] + } else if(cellColors) { + c = cellColors[i] + } else { + c = meshColor + } -function date(a, b) { - var d = new Date; - return a = +a, b = +b, function(t) { - return d.setTime(a * (1 - t) + b * t), d; - }; -} + if(!c) { + tCol.push(0.5,0.5,0.5,1) + } else if(this.opacityscale && vertexIntensity) { + tCol.push(c[0], c[1], c[2], + this.opacity * getOpacityFromScale( + (vertexIntensity[v] - intensityLo) / (intensityHi - intensityLo), + this.opacityscale + ) + ) + } else if(c.length === 3) { + tCol.push(c[0], c[1], c[2], this.opacity) + } else { + tCol.push(c[0], c[1], c[2], c[3] * this.opacity) + if(c[3] < 1) this.hasAlpha = true + } -function number(a, b) { - return a = +a, b = +b, function(t) { - return a * (1 - t) + b * t; - }; -} + var uv + if(vertexUVs) { + uv = vertexUVs[v] + } else if(vertexIntensity) { + uv = [ + (vertexIntensity[v] - intensityLo) / + (intensityHi - intensityLo), 0] + } else if(cellUVs) { + uv = cellUVs[i] + } else if(cellIntensity) { + uv = [ + (cellIntensity[i] - intensityLo) / + (intensityHi - intensityLo), 0] + } else { + uv = [ + (p[2] - intensityLo) / + (intensityHi - intensityLo), 0] + } + tUVs.push(uv[0], uv[1]) -function object(a, b) { - var i = {}, - c = {}, - k; + var q + if(vertexNormals) { + q = vertexNormals[v] + } else { + q = cellNormals[i] + } + tNor.push(q[0], q[1], q[2]) - if (a === null || typeof a !== "object") a = {}; - if (b === null || typeof b !== "object") b = {}; + tIds.push(i) + } + triangleCount += 1 + break - for (k in b) { - if (k in a) { - i[k] = value(a[k], b[k]); - } else { - c[k] = b[k]; + default: + break } } - return function(t) { - for (k in i) c[k] = i[k](t); - return c; - }; -} + this.pointCount = pointCount + this.edgeCount = edgeCount + this.triangleCount = triangleCount -var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, "g"); + this.pointPositions.update(pPos) + this.pointColors.update(pCol) + this.pointUVs.update(pUVs) + this.pointSizes.update(pSiz) + this.pointIds.update(new Uint32Array(pIds)) -function zero(b) { - return function() { - return b; - }; -} + this.edgePositions.update(ePos) + this.edgeColors.update(eCol) + this.edgeUVs.update(eUVs) + this.edgeIds.update(new Uint32Array(eIds)) -function one(b) { - return function(t) { - return b(t) + ""; - }; + this.trianglePositions.update(tPos) + this.triangleColors.update(tCol) + this.triangleUVs.update(tUVs) + this.triangleNormals.update(tNor) + this.triangleIds.update(new Uint32Array(tIds)) } -function string(a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b - am, // current match in a - bm, // current match in b - bs, // string preceding current number in b, if any - i = -1, // index in s - s = [], // string constants and placeholders - q = []; // number interpolators - - // Coerce inputs to strings. - a = a + "", b = b + ""; - - // Interpolate pairs of numbers in a & b. - while ((am = reA.exec(a)) - && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match - if (s[i]) s[i] += bm; // coalesce with previous string - else s[++i] = bm; - } else { // interpolate non-matching numbers - s[++i] = null; - q.push({i: i, x: number(am, bm)}); - } - bi = reB.lastIndex; - } +proto.drawTransparent = proto.draw = function(params) { + params = params || {} + var gl = this.gl + var model = params.model || IDENTITY + var view = params.view || IDENTITY + var projection = params.projection || IDENTITY - // Add remains of b. - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; + var clipBounds = [[-1e6,-1e6,-1e6],[1e6,1e6,1e6]] + for(var i=0; i<3; ++i) { + clipBounds[0][i] = Math.max(clipBounds[0][i], this.clipBounds[0][i]) + clipBounds[1][i] = Math.min(clipBounds[1][i], this.clipBounds[1][i]) } - // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - return s.length < 2 ? (q[0] - ? one(q[0].x) - : zero(b)) - : (b = q.length, function(t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }); -} - -function value(a, b) { - var t = typeof b, c; - return b == null || t === "boolean" ? constant(b) - : (t === "number" ? number - : t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb) : string) - : b instanceof d3Color.color ? rgb - : b instanceof Date ? date - : isNumberArray(b) ? numberArray - : Array.isArray(b) ? genericArray - : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object - : number)(a, b); -} - -function discrete(range) { - var n = range.length; - return function(t) { - return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; - }; -} + var uniforms = { + model: model, + view: view, + projection: projection, + inverseModel: IDENTITY.slice(), -function hue$1(a, b) { - var i = hue(+a, +b); - return function(t) { - var x = i(t); - return x - 360 * Math.floor(x / 360); - }; -} + clipBounds: clipBounds, -function round(a, b) { - return a = +a, b = +b, function(t) { - return Math.round(a * (1 - t) + b * t); - }; -} + kambient: this.ambientLight, + kdiffuse: this.diffuseLight, + kspecular: this.specularLight, + roughness: this.roughness, + fresnel: this.fresnel, -var degrees = 180 / Math.PI; + eyePosition: [0,0,0], + lightPosition: [0,0,0], -var identity = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; + contourColor: this.contourColor, -function decompose(a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; - if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY - }; -} + texture: 0 + } -var cssNode, - cssRoot, - cssView, - svgNode; + uniforms.inverseModel = invert(uniforms.inverseModel, uniforms.model) -function parseCss(value) { - if (value === "none") return identity; - if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; - cssNode.style.transform = value; - value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); - cssRoot.removeChild(cssNode); - value = value.slice(7, -1).split(","); - return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); -} + gl.disable(gl.CULL_FACE) -function parseSvg(value) { - if (value == null) return identity; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); -} + this.texture.bind(0) -function interpolateTransform(parse, pxComma, pxParen, degParen) { + var invCameraMatrix = new Array(16) + multiply(invCameraMatrix, uniforms.view, uniforms.model) + multiply(invCameraMatrix, uniforms.projection, invCameraMatrix) + invert(invCameraMatrix, invCameraMatrix) - function pop(s) { - return s.length ? s.pop() + " " : ""; + for(var i=0; i<3; ++i) { + uniforms.eyePosition[i] = invCameraMatrix[12+i] / invCameraMatrix[15] } - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push("translate(", null, pxComma, null, pxParen); - q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } + var w = invCameraMatrix[15] + for(var i=0; i<3; ++i) { + w += this.lightPosition[i] * invCameraMatrix[4*i+3] } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path - q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); + for(var i=0; i<3; ++i) { + var s = invCameraMatrix[12+i] + for(var j=0; j<3; ++j) { + s += invCameraMatrix[4*j+i] * this.lightPosition[j] } + uniforms.lightPosition[i] = s / w } - function skewX(a, b, s, q) { - if (a !== b) { - q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } + if(this.triangleCount > 0) { + var shader = this.triShader + shader.bind() + shader.uniforms = uniforms + + this.triangleVAO.bind() + gl.drawArrays(gl.TRIANGLES, 0, this.triangleCount*3) + this.triangleVAO.unbind() } - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } + if(this.edgeCount > 0 && this.lineWidth > 0) { + var shader = this.lineShader + shader.bind() + shader.uniforms = uniforms + + this.edgeVAO.bind() + gl.lineWidth(this.lineWidth * this.pixelRatio) + gl.drawArrays(gl.LINES, 0, this.edgeCount*2) + this.edgeVAO.unbind() } - return function(a, b) { - var s = [], // string constants and placeholders - q = []; // number interpolators - a = parse(a), b = parse(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }; - }; -} + if(this.pointCount > 0) { + var shader = this.pointShader + shader.bind() + shader.uniforms = uniforms -var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); -var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); + this.pointVAO.bind() + gl.drawArrays(gl.POINTS, 0, this.pointCount) + this.pointVAO.unbind() + } -var rho = Math.SQRT2, - rho2 = 2, - rho4 = 4, - epsilon2 = 1e-12; + if(this.contourEnable && this.contourCount > 0 && this.contourLineWidth > 0) { + var shader = this.contourShader + shader.bind() + shader.uniforms = uniforms -function cosh(x) { - return ((x = Math.exp(x)) + 1 / x) / 2; + this.contourVAO.bind() + gl.drawArrays(gl.LINES, 0, this.contourCount) + this.contourVAO.unbind() + } } -function sinh(x) { - return ((x = Math.exp(x)) - 1 / x) / 2; -} +proto.drawPick = function(params) { + params = params || {} -function tanh(x) { - return ((x = Math.exp(2 * x)) - 1) / (x + 1); -} + var gl = this.gl -// p0 = [ux0, uy0, w0] -// p1 = [ux1, uy1, w1] -function zoom(p0, p1) { - var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], - ux1 = p1[0], uy1 = p1[1], w1 = p1[2], - dx = ux1 - ux0, - dy = uy1 - uy0, - d2 = dx * dx + dy * dy, - i, - S; + var model = params.model || IDENTITY + var view = params.view || IDENTITY + var projection = params.projection || IDENTITY - // Special case for u0 ≅ u1. - if (d2 < epsilon2) { - S = Math.log(w1 / w0) / rho; - i = function(t) { - return [ - ux0 + t * dx, - uy0 + t * dy, - w0 * Math.exp(rho * t * S) - ]; - }; + var clipBounds = [[-1e6,-1e6,-1e6],[1e6,1e6,1e6]] + for(var i=0; i<3; ++i) { + clipBounds[0][i] = Math.max(clipBounds[0][i], this.clipBounds[0][i]) + clipBounds[1][i] = Math.min(clipBounds[1][i], this.clipBounds[1][i]) } - // General case. - else { - var d1 = Math.sqrt(d2), - b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), - b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), - r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), - r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); - S = (r1 - r0) / rho; - i = function(t) { - var s = t * S, - coshr0 = cosh(r0), - u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); - return [ - ux0 + u * dx, - uy0 + u * dy, - w0 * coshr0 / cosh(rho * s + r0) - ]; - }; + //Save camera parameters + this._model = [].slice.call(model) + this._view = [].slice.call(view) + this._projection = [].slice.call(projection) + this._resolution = [gl.drawingBufferWidth, gl.drawingBufferHeight] + + var uniforms = { + model: model, + view: view, + projection: projection, + clipBounds: clipBounds, + pickId: this.pickId / 255.0, } - i.duration = S * 1000; + var shader = this.pickShader + shader.bind() + shader.uniforms = uniforms - return i; -} + if(this.triangleCount > 0) { + this.triangleVAO.bind() + gl.drawArrays(gl.TRIANGLES, 0, this.triangleCount*3) + this.triangleVAO.unbind() + } -function hsl(hue) { - return function(start, end) { - var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h), - s = nogamma(start.s, end.s), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.s = s(t); - start.l = l(t); - start.opacity = opacity(t); - return start + ""; - }; + if(this.edgeCount > 0) { + this.edgeVAO.bind() + gl.lineWidth(this.lineWidth * this.pixelRatio) + gl.drawArrays(gl.LINES, 0, this.edgeCount*2) + this.edgeVAO.unbind() } -} -var hsl$1 = hsl(hue); -var hslLong = hsl(nogamma); + if(this.pointCount > 0) { + var shader = this.pointPickShader + shader.bind() + shader.uniforms = uniforms -function lab(start, end) { - var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l), - a = nogamma(start.a, end.a), - b = nogamma(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.l = l(t); - start.a = a(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; + this.pointVAO.bind() + gl.drawArrays(gl.POINTS, 0, this.pointCount) + this.pointVAO.unbind() + } } -function hcl(hue) { - return function(start, end) { - var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h), - c = nogamma(start.c, end.c), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.c = c(t); - start.l = l(t); - start.opacity = opacity(t); - return start + ""; - }; + +proto.pick = function(pickData) { + if(!pickData) { + return null + } + if(pickData.id !== this.pickId) { + return null } -} -var hcl$1 = hcl(hue); -var hclLong = hcl(nogamma); + var cellId = pickData.value[0] + 256*pickData.value[1] + 65536*pickData.value[2] + var cell = this.cells[cellId] + var positions = this.positions -function cubehelix(hue) { - return (function cubehelixGamma(y) { - y = +y; + var simplex = new Array(cell.length) + for(var i=0; i epsilon)); + lo[0] = loX + lo[1] = loY + hi[0] = hiX + hi[1] = hiY - // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear? - // Equivalently, is (x1,y1) coincident with (x2,y2)? - // Or, is the radius zero? Line to (x1,y1). - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { - this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); - } + shader.uniforms.lo = lo + shader.uniforms.hi = hi + shader.uniforms.color = color - // Otherwise, draw an arc! - else { - var x20 = x2 - x0, - y20 = y2 - y0, - l21_2 = x21 * x21 + y21 * y21, - l20_2 = x20 * x20 + y20 * y20, - l21 = Math.sqrt(l21_2), - l01 = Math.sqrt(l01_2), - l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), - t01 = l / l01, - t21 = l / l21; + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4) + } +}()) - // If the start tangent is not coincident with (x0,y0), line to. - if (Math.abs(t01 - 1) > epsilon) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); - } +proto.dispose = function() { + this.vbo.dispose() + this.shader.dispose() +} - this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); - } - }, - arc: function(x, y, r, a0, a1, ccw) { - x = +x, y = +y, r = +r, ccw = !!ccw; - var dx = r * Math.cos(a0), - dy = r * Math.sin(a0), - x0 = x + dx, - y0 = y + dy, - cw = 1 ^ ccw, - da = ccw ? a0 - a1 : a1 - a0; +function createBoxes(plot) { + var gl = plot.gl + var vbo = createBuffer(gl, [ + 0,0, + 0,1, + 1,0, + 1,1]) + var shader = createShader(gl, shaders.boxVert, shaders.lineFrag) + return new Boxes(plot, vbo, shader) +} - // Is the radius negative? Error. - if (r < 0) throw new Error("negative radius: " + r); +},{"./shaders":223,"gl-buffer":171,"gl-shader":242}],221:[function(_dereq_,module,exports){ +'use strict' - // Is this path empty? Move to (x0,y0). - if (this._x1 === null) { - this._ += "M" + x0 + "," + y0; - } +module.exports = createGrid - // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0). - else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { - this._ += "L" + x0 + "," + y0; - } +var createBuffer = _dereq_('gl-buffer') +var createShader = _dereq_('gl-shader') +var bsearch = _dereq_('binary-search-bounds') +var shaders = _dereq_('./shaders') - // Is this arc empty? We’re done. - if (!r) return; +function Grid(plot, vbo, shader, tickShader) { + this.plot = plot + this.vbo = vbo + this.shader = shader + this.tickShader = tickShader + this.ticks = [[], []] +} - // Does the angle go the wrong way? Flip the direction. - if (da < 0) da = da % tau + tau; +function compareTickNum(a, b) { + return a - b +} - // Is this a complete circle? Draw two arcs to complete the circle. - if (da > tauEpsilon) { - this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); +var proto = Grid.prototype + +proto.draw = (function() { + + var DATA_SHIFT = [0,0] + var DATA_SCALE = [0,0] + var DATA_AXIS = [0,0] + + return function() { + var plot = this.plot + var vbo = this.vbo + var shader = this.shader + var ticks = this.ticks + var gl = plot.gl + var bounds = plot._tickBounds + var dataBox = plot.dataBox + var viewPixels = plot.viewBox + var lineWidth = plot.gridLineWidth + var gridColor = plot.gridLineColor + var gridEnable = plot.gridLineEnable + var pixelRatio = plot.pixelRatio + + for(var i=0; i<2; ++i) { + var lo = bounds[i] + var hi = bounds[i+2] + var boundScale = hi - lo + var dataCenter = 0.5 * (dataBox[i+2] + dataBox[i]) + var dataWidth = dataBox[i+2] - dataBox[i] + DATA_SCALE[i] = 2.0 * boundScale / dataWidth + DATA_SHIFT[i] = 2.0 * (lo - dataCenter) / dataWidth + } + + shader.bind() + vbo.bind() + shader.attributes.dataCoord.pointer() + shader.uniforms.dataShift = DATA_SHIFT + shader.uniforms.dataScale = DATA_SCALE + + var offset = 0 + for(var i=0; i<2; ++i) { + DATA_AXIS[0] = DATA_AXIS[1] = 0 + DATA_AXIS[i] = 1 + shader.uniforms.dataAxis = DATA_AXIS + shader.uniforms.lineWidth = lineWidth[i] / (viewPixels[i+2] - viewPixels[i]) * pixelRatio + shader.uniforms.color = gridColor[i] + + var size = ticks[i].length * 6 + if(gridEnable[i] && size) { + gl.drawArrays(gl.TRIANGLES, offset, size) + } + offset += size } + } +})() - // Is this arc non-empty? Draw an arc! - else if (da > epsilon) { - this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)); +proto.drawTickMarks = (function() { + var DATA_SHIFT = [0,0] + var DATA_SCALE = [0,0] + var X_AXIS = [1,0] + var Y_AXIS = [0,1] + var SCR_OFFSET = [0,0] + var TICK_SCALE = [0,0] + + return function() { + var plot = this.plot + var vbo = this.vbo + var shader = this.tickShader + var ticks = this.ticks + var gl = plot.gl + var bounds = plot._tickBounds + var dataBox = plot.dataBox + var viewBox = plot.viewBox + var pixelRatio = plot.pixelRatio + var screenBox = plot.screenBox + + var screenWidth = screenBox[2] - screenBox[0] + var screenHeight = screenBox[3] - screenBox[1] + var viewWidth = viewBox[2] - viewBox[0] + var viewHeight = viewBox[3] - viewBox[1] + + for(var i=0; i<2; ++i) { + var lo = bounds[i] + var hi = bounds[i+2] + var boundScale = hi - lo + var dataCenter = 0.5 * (dataBox[i+2] + dataBox[i]) + var dataWidth = (dataBox[i+2] - dataBox[i]) + DATA_SCALE[i] = 2.0 * boundScale / dataWidth + DATA_SHIFT[i] = 2.0 * (lo - dataCenter) / dataWidth + } + + DATA_SCALE[0] *= viewWidth / screenWidth + DATA_SHIFT[0] *= viewWidth / screenWidth + + DATA_SCALE[1] *= viewHeight / screenHeight + DATA_SHIFT[1] *= viewHeight / screenHeight + + shader.bind() + vbo.bind() + + shader.attributes.dataCoord.pointer() + + var uniforms = shader.uniforms + uniforms.dataShift = DATA_SHIFT + uniforms.dataScale = DATA_SCALE + + var tickMarkLength = plot.tickMarkLength + var tickMarkWidth = plot.tickMarkWidth + var tickMarkColor = plot.tickMarkColor + + var xTicksOffset = 0 + var yTicksOffset = ticks[0].length * 6 + + var xStart = Math.min(bsearch.ge(ticks[0], (dataBox[0] - bounds[0]) / (bounds[2] - bounds[0]), compareTickNum), ticks[0].length) + var xEnd = Math.min(bsearch.gt(ticks[0], (dataBox[2] - bounds[0]) / (bounds[2] - bounds[0]), compareTickNum), ticks[0].length) + var xOffset = xTicksOffset + 6 * xStart + var xCount = 6 * Math.max(0, xEnd - xStart) + + var yStart = Math.min(bsearch.ge(ticks[1], (dataBox[1] - bounds[1]) / (bounds[3] - bounds[1]), compareTickNum), ticks[1].length) + var yEnd = Math.min(bsearch.gt(ticks[1], (dataBox[3] - bounds[1]) / (bounds[3] - bounds[1]), compareTickNum), ticks[1].length) + var yOffset = yTicksOffset + 6 * yStart + var yCount = 6 * Math.max(0, yEnd - yStart) + + SCR_OFFSET[0] = 2.0 * (viewBox[0] - tickMarkLength[1]) / screenWidth - 1.0 + SCR_OFFSET[1] = (viewBox[3] + viewBox[1]) / screenHeight - 1.0 + TICK_SCALE[0] = tickMarkLength[1] * pixelRatio / screenWidth + TICK_SCALE[1] = tickMarkWidth[1] * pixelRatio / screenHeight + + if(yCount) { + uniforms.color = tickMarkColor[1] + uniforms.tickScale = TICK_SCALE + uniforms.dataAxis = Y_AXIS + uniforms.screenOffset = SCR_OFFSET + gl.drawArrays(gl.TRIANGLES, yOffset, yCount) + } + + SCR_OFFSET[0] = (viewBox[2] + viewBox[0]) / screenWidth - 1.0 + SCR_OFFSET[1] = 2.0 * (viewBox[1] - tickMarkLength[0]) / screenHeight - 1.0 + TICK_SCALE[0] = tickMarkWidth[0] * pixelRatio / screenWidth + TICK_SCALE[1] = tickMarkLength[0] * pixelRatio / screenHeight + + if(xCount) { + uniforms.color = tickMarkColor[0] + uniforms.tickScale = TICK_SCALE + uniforms.dataAxis = X_AXIS + uniforms.screenOffset = SCR_OFFSET + gl.drawArrays(gl.TRIANGLES, xOffset, xCount) + } + + SCR_OFFSET[0] = 2.0 * (viewBox[2] + tickMarkLength[3]) / screenWidth - 1.0 + SCR_OFFSET[1] = (viewBox[3] + viewBox[1]) / screenHeight - 1.0 + TICK_SCALE[0] = tickMarkLength[3] * pixelRatio / screenWidth + TICK_SCALE[1] = tickMarkWidth[3] * pixelRatio / screenHeight + + if(yCount) { + uniforms.color = tickMarkColor[3] + uniforms.tickScale = TICK_SCALE + uniforms.dataAxis = Y_AXIS + uniforms.screenOffset = SCR_OFFSET + gl.drawArrays(gl.TRIANGLES, yOffset, yCount) + } + + SCR_OFFSET[0] = (viewBox[2] + viewBox[0]) / screenWidth - 1.0 + SCR_OFFSET[1] = 2.0 * (viewBox[3] + tickMarkLength[2]) / screenHeight - 1.0 + TICK_SCALE[0] = tickMarkWidth[2] * pixelRatio / screenWidth + TICK_SCALE[1] = tickMarkLength[2] * pixelRatio / screenHeight + + if(xCount) { + uniforms.color = tickMarkColor[2] + uniforms.tickScale = TICK_SCALE + uniforms.dataAxis = X_AXIS + uniforms.screenOffset = SCR_OFFSET + gl.drawArrays(gl.TRIANGLES, xOffset, xCount) + } + } +})() + +proto.update = (function() { + var OFFSET_X = [1, 1, -1, -1, 1, -1] + var OFFSET_Y = [1, -1, 1, 1, -1, -1] + + return function(options) { + var ticks = options.ticks + var bounds = options.bounds + var data = new Float32Array(6 * 3 * (ticks[0].length + ticks[1].length)) + + var zeroLineEnable = this.plot.zeroLineEnable + + var ptr = 0 + var gridTicks = [[], []] + for(var dim=0; dim<2; ++dim) { + var localTicks = gridTicks[dim] + var axisTicks = ticks[dim] + var lo = bounds[dim] + var hi = bounds[dim+2] + for(var i=0; i= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; - if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; - if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree; + start[0] = startX + start[1] = startY + end[0] = endX + end[1] = endY + + shader.uniforms.start = start + shader.uniforms.end = end + shader.uniforms.width = width * plot.pixelRatio + shader.uniforms.color = color + + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4) } +}()) - // Is the new point is exactly coincident with the existing point? - xp = +tree._x.call(null, node.data); - yp = +tree._y.call(null, node.data); - if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree; +proto.dispose = function() { + this.vbo.dispose() + this.shader.dispose() +} - // Otherwise, split the leaf node until the old and new point are separated. - do { - parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4); - if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; - if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; - } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm))); - return parent[j] = node, parent[i] = leaf, tree; +function createLines(plot) { + var gl = plot.gl + var vbo = createBuffer(gl, [ + -1,-1, + -1,1, + 1,-1, + 1,1]) + var shader = createShader(gl, shaders.lineVert, shaders.lineFrag) + var lines = new Lines(plot, vbo, shader) + return lines } -function addAll(data) { - var d, i, n = data.length, - x, - y, - xz = new Array(n), - yz = new Array(n), - x0 = Infinity, - y0 = Infinity, - x1 = -Infinity, - y1 = -Infinity; +},{"./shaders":223,"gl-buffer":171,"gl-shader":242}],223:[function(_dereq_,module,exports){ +'use strict' - // Compute the points and their extent. - for (i = 0; i < n; ++i) { - if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue; - xz[i] = x; - yz[i] = y; - if (x < x0) x0 = x; - if (x > x1) x1 = x; - if (y < y0) y0 = y; - if (y > y1) y1 = y; - } +var glslify = _dereq_('glslify') - // If there were no (valid) points, abort. - if (x0 > x1 || y0 > y1) return this; +var FRAGMENT = glslify(["precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n"]) - // Expand the tree to cover the new points. - this.cover(x0, y0).cover(x1, y1); +module.exports = { + lineVert: glslify(["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: FRAGMENT, + textVert: glslify(["#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: FRAGMENT, + gridVert: glslify(["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: FRAGMENT, + boxVert: glslify(["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: glslify(["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"]) +} + +},{"glslify":225}],224:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createTextElements + +var createBuffer = _dereq_('gl-buffer') +var createShader = _dereq_('gl-shader') +var getText = _dereq_('text-cache') +var bsearch = _dereq_('binary-search-bounds') +var shaders = _dereq_('./shaders') + +function TextElements(plot, vbo, shader) { + this.plot = plot + this.vbo = vbo + this.shader = shader + this.tickOffset = [[],[]] + this.tickX = [[],[]] + this.labelOffset = [0,0] + this.labelCount = [0,0] +} + +var proto = TextElements.prototype + +proto.drawTicks = (function() { + var DATA_AXIS = [0,0] + var SCREEN_OFFSET = [0,0] + var ZERO_2 = [0,0] + + return function(axis) { + var plot = this.plot + var shader = this.shader + var tickX = this.tickX[axis] + var tickOffset = this.tickOffset[axis] + var gl = plot.gl + var viewBox = plot.viewBox + var dataBox = plot.dataBox + var screenBox = plot.screenBox + var pixelRatio = plot.pixelRatio + var tickEnable = plot.tickEnable + var tickPad = plot.tickPad + var textColor = plot.tickColor + var textAngle = plot.tickAngle + // todo check if this should be used (now unused) + // var tickLength = plot.tickMarkLength + + var labelEnable = plot.labelEnable + var labelPad = plot.labelPad + var labelColor = plot.labelColor + var labelAngle = plot.labelAngle + var labelOffset = this.labelOffset[axis] + var labelCount = this.labelCount[axis] + + var start = bsearch.lt(tickX, dataBox[axis]) + var end = bsearch.le(tickX, dataBox[axis+2]) + + DATA_AXIS[0] = DATA_AXIS[1] = 0 + DATA_AXIS[axis] = 1 + + SCREEN_OFFSET[axis] = (viewBox[2+axis] + viewBox[axis]) / (screenBox[2+axis] - screenBox[axis]) - 1.0 + + var screenScale = 2.0 / screenBox[2+(axis^1)] - screenBox[axis^1] + + SCREEN_OFFSET[axis^1] = screenScale * viewBox[axis^1] - 1.0 + if(tickEnable[axis]) { + SCREEN_OFFSET[axis^1] -= screenScale * pixelRatio * tickPad[axis] + if(start < end && tickOffset[end] > tickOffset[start]) { + shader.uniforms.dataAxis = DATA_AXIS + shader.uniforms.screenOffset = SCREEN_OFFSET + shader.uniforms.color = textColor[axis] + shader.uniforms.angle = textAngle[axis] + gl.drawArrays( + gl.TRIANGLES, + tickOffset[start], + tickOffset[end] - tickOffset[start]) + } + } + if(labelEnable[axis] && labelCount) { + SCREEN_OFFSET[axis^1] -= screenScale * pixelRatio * labelPad[axis] + shader.uniforms.dataAxis = ZERO_2 + shader.uniforms.screenOffset = SCREEN_OFFSET + shader.uniforms.color = labelColor[axis] + shader.uniforms.angle = labelAngle[axis] + gl.drawArrays( + gl.TRIANGLES, + labelOffset, + labelCount) + } + + SCREEN_OFFSET[axis^1] = screenScale * viewBox[2+(axis^1)] - 1.0 + if(tickEnable[axis+2]) { + SCREEN_OFFSET[axis^1] += screenScale * pixelRatio * tickPad[axis+2] + if(start < end && tickOffset[end] > tickOffset[start]) { + shader.uniforms.dataAxis = DATA_AXIS + shader.uniforms.screenOffset = SCREEN_OFFSET + shader.uniforms.color = textColor[axis+2] + shader.uniforms.angle = textAngle[axis+2] + gl.drawArrays( + gl.TRIANGLES, + tickOffset[start], + tickOffset[end] - tickOffset[start]) + } + } + if(labelEnable[axis+2] && labelCount) { + SCREEN_OFFSET[axis^1] += screenScale * pixelRatio * labelPad[axis+2] + shader.uniforms.dataAxis = ZERO_2 + shader.uniforms.screenOffset = SCREEN_OFFSET + shader.uniforms.color = labelColor[axis+2] + shader.uniforms.angle = labelAngle[axis+2] + gl.drawArrays( + gl.TRIANGLES, + labelOffset, + labelCount) + } - // Add the new points. - for (i = 0; i < n; ++i) { - add(this, xz[i], yz[i], data[i]); } +})() - return this; -} +proto.drawTitle = (function() { + var DATA_AXIS = [0,0] + var SCREEN_OFFSET = [0,0] -function tree_cover(x, y) { - if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points + return function() { + var plot = this.plot + var shader = this.shader + var gl = plot.gl + var screenBox = plot.screenBox + var titleCenter = plot.titleCenter + var titleAngle = plot.titleAngle + var titleColor = plot.titleColor + var pixelRatio = plot.pixelRatio - var x0 = this._x0, - y0 = this._y0, - x1 = this._x1, - y1 = this._y1; + if(!this.titleCount) { + return + } - // If the quadtree has no extent, initialize them. - // Integer extent are necessary so that if we later double the extent, - // the existing quadrant boundaries don’t change due to floating point error! - if (isNaN(x0)) { - x1 = (x0 = Math.floor(x)) + 1; - y1 = (y0 = Math.floor(y)) + 1; + for(var i=0; i<2; ++i) { + SCREEN_OFFSET[i] = 2.0 * (titleCenter[i]*pixelRatio - screenBox[i]) / + (screenBox[2+i] - screenBox[i]) - 1 + } + + shader.bind() + shader.uniforms.dataAxis = DATA_AXIS + shader.uniforms.screenOffset = SCREEN_OFFSET + shader.uniforms.angle = titleAngle + shader.uniforms.color = titleColor + + gl.drawArrays(gl.TRIANGLES, this.titleOffset, this.titleCount) } +})() - // Otherwise, double repeatedly to cover. - else { - var z = x1 - x0, - node = this._root, - parent, - i; +proto.bind = (function() { + var DATA_SHIFT = [0,0] + var DATA_SCALE = [0,0] + var TEXT_SCALE = [0,0] - while (x0 > x || x >= x1 || y0 > y || y >= y1) { - i = (y < y0) << 1 | (x < x0); - parent = new Array(4), parent[i] = node, node = parent, z *= 2; - switch (i) { - case 0: x1 = x0 + z, y1 = y0 + z; break; - case 1: x0 = x1 - z, y1 = y0 + z; break; - case 2: x1 = x0 + z, y0 = y1 - z; break; - case 3: x0 = x1 - z, y0 = y1 - z; break; + return function() { + var plot = this.plot + var shader = this.shader + var bounds = plot._tickBounds + var dataBox = plot.dataBox + var screenBox = plot.screenBox + var viewBox = plot.viewBox + + shader.bind() + + //Set up coordinate scaling uniforms + for(var i=0; i<2; ++i) { + + var lo = bounds[i] + var hi = bounds[i+2] + var boundScale = hi - lo + var dataCenter = 0.5 * (dataBox[i+2] + dataBox[i]) + var dataWidth = (dataBox[i+2] - dataBox[i]) + + var viewLo = viewBox[i] + var viewHi = viewBox[i+2] + var viewScale = viewHi - viewLo + var screenLo = screenBox[i] + var screenHi = screenBox[i+2] + var screenScale = screenHi - screenLo + + DATA_SCALE[i] = 2.0 * boundScale / dataWidth * viewScale / screenScale + DATA_SHIFT[i] = 2.0 * (lo - dataCenter) / dataWidth * viewScale / screenScale + } + + TEXT_SCALE[1] = 2.0 * plot.pixelRatio / (screenBox[3] - screenBox[1]) + TEXT_SCALE[0] = TEXT_SCALE[1] * (screenBox[3] - screenBox[1]) / (screenBox[2] - screenBox[0]) + + shader.uniforms.dataScale = DATA_SCALE + shader.uniforms.dataShift = DATA_SHIFT + shader.uniforms.textScale = TEXT_SCALE + + //Set attributes + this.vbo.bind() + shader.attributes.textCoordinate.pointer() + } +})() + +proto.update = function(options) { + var vertices = [] + var axesTicks = options.ticks + var bounds = options.bounds + var i, j, k, data, scale, dimension + + for(dimension=0; dimension<2; ++dimension) { + var offsets = [Math.floor(vertices.length/3)], tickX = [-Infinity] + + //Copy vertices over to buffer + var ticks = axesTicks[dimension] + for(i=0; i x3 - || (y1 = q.y0) > y3 - || (x2 = q.x1) < x0 - || (y2 = q.y1) < y0) continue; +var createGrid = _dereq_('./lib/grid') +var createText = _dereq_('./lib/text') +var createLine = _dereq_('./lib/line') +var createBox = _dereq_('./lib/box') - // Bisect the current quadrant. - if (node.length) { - var xm = (x1 + x2) / 2, - ym = (y1 + y2) / 2; +function GLPlot2D(gl, pickBuffer) { + this.gl = gl + this.pickBuffer = pickBuffer - quads.push( - new Quad(node[3], xm, ym, x2, y2), - new Quad(node[2], x1, ym, xm, y2), - new Quad(node[1], xm, y1, x2, ym), - new Quad(node[0], x1, y1, xm, ym) - ); + this.screenBox = [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight] + this.viewBox = [0, 0, 0, 0] + this.dataBox = [-10, -10, 10, 10] - // Visit the closest quadrant first. - if (i = (y >= ym) << 1 | (x >= xm)) { - q = quads[quads.length - 1]; - quads[quads.length - 1] = quads[quads.length - 1 - i]; - quads[quads.length - 1 - i] = q; + this.gridLineEnable = [true,true] + 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 = [true,true,true,true] + 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.0*Math.PI/2] + this.labelEnable = [true,true,true,true] + this.labelColor = [[0,0,0,1], + [0,0,0,1], + [0,0,0,1], + [0,0,0,1]] + + this.titleCenter = [0,0] + this.titleEnable = true + this.titleAngle = 0 + this.titleColor = [0,0,0,1] + + this.borderColor = [0,0,0,0] + this.backgroundColor = [0,0,0,0] + + this.zeroLineEnable = [true, true] + this.zeroLineWidth = [4, 4] + this.zeroLineColor = [[0, 0, 0, 1],[0, 0, 0, 1]] + + this.borderLineEnable = [true,true,true,true] + this.borderLineWidth = [2,2,2,2] + this.borderLineColor = [[0,0,0,1], + [0,0,0,1], + [0,0,0,1], + [0,0,0,1]] + + //Drawing parameters + this.grid = null + this.text = null + this.line = null + this.box = null + this.objects = [] + this.overlays = [] + + this._tickBounds = [Infinity, Infinity, -Infinity, -Infinity] + + this.static = false + + this.dirty = false + this.pickDirty = false + this.pickDelay = 120 + this.pickRadius = 10 + this._pickTimeout = null + this._drawPick = this.drawPick.bind(this) + + this._depthCounter = 0 +} + +var proto = GLPlot2D.prototype + +proto.setDirty = function() { + this.dirty = this.pickDirty = true +} + +proto.setOverlayDirty = function() { + this.dirty = true +} + +proto.nextDepthValue = function() { + return (this._depthCounter++) / 65536.0 +} + +function lerp(a, b, t) { + var s = 0.5 * (t + 1.0) + return Math.floor((1.0-s)*a + s*b)|0 +} + +proto.draw = (function() { +var TICK_MARK_BOX = [0,0,0,0] +return function() { + var gl = this.gl + var screenBox = this.screenBox + var viewPixels = this.viewBox + var dataBox = this.dataBox + var pixelRatio = this.pixelRatio + var grid = this.grid + var line = this.line + var text = this.text + var objects = this.objects + + this._depthCounter = 0 + + if(this.pickDirty) { + if(this._pickTimeout) { + clearTimeout(this._pickTimeout) + } + this.pickDirty = false + this._pickTimeout = setTimeout(this._drawPick, this.pickDelay) + } + + if(!this.dirty) { + return + } + this.dirty = false + + gl.bindFramebuffer(gl.FRAMEBUFFER, null) + + //Turn on scissor + gl.enable(gl.SCISSOR_TEST) + + //Turn off depth buffer + gl.disable(gl.DEPTH_TEST) + gl.depthFunc(gl.LESS) + gl.depthMask(false) + + //Configure premultiplied alpha blending + gl.enable(gl.BLEND) + gl.blendEquation(gl.FUNC_ADD, gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + + //Draw border + if (this.borderColor) { + gl.scissor( + screenBox[0], + screenBox[1], + screenBox[2]-screenBox[0], + screenBox[3]-screenBox[1]) + var borderColor = this.borderColor + gl.clearColor( + borderColor[0]*borderColor[3], + borderColor[1]*borderColor[3], + borderColor[2]*borderColor[3], + borderColor[3]) + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) + } + + //Draw center pane + gl.scissor( + viewPixels[0], + viewPixels[1], + viewPixels[2]-viewPixels[0], + viewPixels[3]-viewPixels[1]) + gl.viewport( + viewPixels[0], + viewPixels[1], + viewPixels[2]-viewPixels[0], + viewPixels[3]-viewPixels[1]) + var backgroundColor = this.backgroundColor + gl.clearColor( + backgroundColor[0]*backgroundColor[3], + backgroundColor[1]*backgroundColor[3], + backgroundColor[2]*backgroundColor[3], + backgroundColor[3]) + gl.clear(gl.COLOR_BUFFER_BIT) + + //Draw grid + grid.draw() + + //Draw zero lines separately + var zeroLineEnable = this.zeroLineEnable + var zeroLineColor = this.zeroLineColor + var zeroLineWidth = this.zeroLineWidth + if(zeroLineEnable[0] || zeroLineEnable[1]) { + line.bind() + for(var i=0; i<2; ++i) { + if(!zeroLineEnable[i] || + !(dataBox[i] <= 0 && dataBox[i+2] >= 0)) { + continue } - } - // Visit this point. (Visiting coincident points isn’t necessary!) - else { - var dx = x - +this._x.call(null, node.data), - dy = y - +this._y.call(null, node.data), - d2 = dx * dx + dy * dy; - if (d2 < radius) { - var d = Math.sqrt(radius = d2); - x0 = x - d, y0 = y - d; - x3 = x + d, y3 = y + d; - data = node.data; + var zeroIntercept = screenBox[i] - + dataBox[i] * (screenBox[i+2] - screenBox[i]) / (dataBox[i+2] - dataBox[i]) + + if(i === 0) { + line.drawLine( + zeroIntercept, screenBox[1], zeroIntercept, screenBox[3], + zeroLineWidth[i], + zeroLineColor[i]) + } else { + line.drawLine( + screenBox[0], zeroIntercept, screenBox[2], zeroIntercept, + zeroLineWidth[i], + zeroLineColor[i]) } } } - return data; + //Draw traces + for(var i=0; i= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; - if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; - if (!(parent = node, node = node[i = bottom << 1 | right])) return this; - if (!node.length) break; - if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i; + this._pickTimeout = null + pickBuffer.begin() + + var pickOffset = 1 + var objects = this.objects + for(var i=0; i=0; --i) { + this.objects[i].dispose() } - while (q = next.pop()) { - callback(q.node, q.x0, q.y0, q.x1, q.y1); + this.objects.length = 0 + for(var i=this.overlays.length-1; i>=0; --i) { + this.overlays[i].dispose() } - return this; -} + this.overlays.length = 0 -function defaultX(d) { - return d[0]; + this.gl = null } -function tree_x(_) { - return arguments.length ? (this._x = _, this) : this._x; +proto.addObject = function(object) { + if(this.objects.indexOf(object) < 0) { + this.objects.push(object) + this.setDirty() + } } -function defaultY(d) { - return d[1]; +proto.removeObject = function(object) { + var objects = this.objects + for(var i=0; i 1 ? 0 : x < -1 ? pi : Math.acos(x); -} + if(keyBindingMode === false) return -function asin(x) { - return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x); + var rotate = keyBindingMode === 'rotate' + var pan = keyBindingMode === 'pan' + var zoom = keyBindingMode === 'zoom' + + var ctrl = !!mods.control + var alt = !!mods.alt + var shift = !!mods.shift + var left = !!(buttons & 1) + var right = !!(buttons & 2) + var middle = !!(buttons & 4) + + var scale = 1.0 / element.clientHeight + var dx = scale * (x - camera._lastX) + var dy = scale * (y - camera._lastY) + + var flipX = camera.flipX ? 1 : -1 + var flipY = camera.flipY ? 1 : -1 + + var drot = Math.PI * camera.rotateSpeed + + var t = now() + + if(camera._lastX !== -1 && camera._lastY !== -1) { + if((rotate && left && !ctrl && !alt && !shift) || (left && !ctrl && !alt && shift)) { + // Rotate + view.rotate(t, flipX * drot * dx, -flipY * drot * dy, 0) + } + + if((pan && left && !ctrl && !alt && !shift) || right || (left && ctrl && !alt && !shift)) { + // Pan + view.pan(t, -camera.translateSpeed * dx * distance, camera.translateSpeed * dy * distance, 0) + } + + if((zoom && left && !ctrl && !alt && !shift) || middle || (left && !ctrl && alt && !shift)) { + // Zoom + var kzoom = -camera.zoomSpeed * dy / window.innerHeight * (t - view.lastT()) * 100 + view.pan(t, 0, 0, distance * (Math.exp(kzoom) - 1)) + } + } + + camera._lastX = x + camera._lastY = y + camera._lastMods = mods + + return true + } + + camera.wheelListener = mouseWheel(element, function(dx, dy) { + // TODO remove now that we can disable scroll via scrollZoom? + if(camera.keyBindingMode === false) return + if(!camera.enableWheel) return + + var flipX = camera.flipX ? 1 : -1 + var flipY = camera.flipY ? 1 : -1 + var t = now() + if(Math.abs(dx) > Math.abs(dy)) { + view.rotate(t, 0, 0, -dx * flipX * Math.PI * camera.rotateSpeed / window.innerWidth) + } else { + if(!camera._ortho) { + var kzoom = -camera.zoomSpeed * flipY * dy / window.innerHeight * (t - view.lastT()) / 20.0 + view.pan(t, 0, 0, distance * (Math.exp(kzoom) - 1)) + } + } + }, true) + } + + camera.enableMouseListeners() + + return camera } -function arcInnerRadius(d) { - return d.innerRadius; +},{"3d-view":51,"has-passive-events":344,"mouse-change":363,"mouse-event-offset":364,"mouse-wheel":366,"right-now":421}],228:[function(_dereq_,module,exports){ +var glslify = _dereq_('glslify') +var createShader = _dereq_('gl-shader') + +var vertSrc = glslify(["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}"]) +var fragSrc = glslify(["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}"]) + +module.exports = function(gl) { + return createShader(gl, vertSrc, fragSrc, null, [ { name: 'position', type: 'vec2'}]) } -function arcOuterRadius(d) { - return d.outerRadius; +},{"gl-shader":242,"glslify":342}],229:[function(_dereq_,module,exports){ +'use strict' + +var createCamera = _dereq_('./camera.js') +var createAxes = _dereq_('gl-axes3d') +var axesRanges = _dereq_('gl-axes3d/properties') +var createSpikes = _dereq_('gl-spikes3d') +var createSelect = _dereq_('gl-select-static') +var createFBO = _dereq_('gl-fbo') +var drawTriangle = _dereq_('a-big-triangle') +var mouseChange = _dereq_('mouse-change') +var perspective = _dereq_('gl-mat4/perspective') +var ortho = _dereq_('gl-mat4/ortho') +var createShader = _dereq_('./lib/shader') +var isMobile = _dereq_('is-mobile')({ tablet: true, featureDetect: true }) + +module.exports = { + createScene: createScene, + createCamera: createCamera } -function arcStartAngle(d) { - return d.startAngle; +function MouseSelect() { + this.mouse = [-1,-1] + this.screen = null + this.distance = Infinity + this.index = null + this.dataCoordinate = null + this.dataPosition = null + this.object = null + this.data = null } -function arcEndAngle(d) { - return d.endAngle; +function getContext(canvas, options) { + var gl = null + try { + gl = canvas.getContext('webgl', options) + if(!gl) { + gl = canvas.getContext('experimental-webgl', options) + } + } catch(e) { + return null + } + return gl } -function arcPadAngle(d) { - return d && d.padAngle; // Note: optional! +function roundUpPow10(x) { + var y = Math.round(Math.log(Math.abs(x)) / Math.log(10)) + if(y < 0) { + var base = Math.round(Math.pow(10, -y)) + return Math.ceil(x*base) / base + } else if(y > 0) { + var base = Math.round(Math.pow(10, y)) + return Math.ceil(x/base) * base + } + return Math.ceil(x) } -function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { - var x10 = x1 - x0, y10 = y1 - y0, - x32 = x3 - x2, y32 = y3 - y2, - t = y32 * x10 - x32 * y10; - if (t * t < epsilon) return; - t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; - return [x0 + t * x10, y0 + t * y10]; +function defaultBool(x) { + if(typeof x === 'boolean') { + return x + } + return true } -// Compute perpendicular offset line of length rc. -// http://mathworld.wolfram.com/Circle-LineIntersection.html -function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { - var x01 = x0 - x1, - y01 = y0 - y1, - lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), - ox = lo * y01, - oy = -lo * x01, - x11 = x0 + ox, - y11 = y0 + oy, - x10 = x1 + ox, - y10 = y1 + oy, - x00 = (x11 + x10) / 2, - y00 = (y11 + y10) / 2, - dx = x10 - x11, - dy = y10 - y11, - d2 = dx * dx + dy * dy, - r = r1 - rc, - D = x11 * y10 - x10 * y11, - d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)), - cx0 = (D * dy - dx * d) / d2, - cy0 = (-D * dx - dy * d) / d2, - cx1 = (D * dy + dx * d) / d2, - cy1 = (-D * dx + dy * d) / d2, - dx0 = cx0 - x00, - dy0 = cy0 - y00, - dx1 = cx1 - x00, - dy1 = cy1 - y00; +function createScene(options) { + options = options || {} + options.camera = options.camera || {} - // Pick the closer of the two intersection points. - // TODO Is there a faster way to determine which intersection to use? - if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; + var canvas = options.canvas + if(!canvas) { + canvas = document.createElement('canvas') + if(options.container) { + var container = options.container + container.appendChild(canvas) + } else { + document.body.appendChild(canvas) + } + } - return { - cx: cx0, - cy: cy0, - x01: -ox, - y01: -oy, - x11: cx0 * (r1 / r - 1), - y11: cy0 * (r1 / r - 1) - }; -} + var gl = options.gl + if(!gl) { + if(options.glOptions) { + isMobile = !!options.glOptions.preserveDrawingBuffer + } -function arc() { - var innerRadius = arcInnerRadius, - outerRadius = arcOuterRadius, - cornerRadius = constant(0), - padRadius = null, - startAngle = arcStartAngle, - endAngle = arcEndAngle, - padAngle = arcPadAngle, - context = null; + gl = getContext(canvas, + options.glOptions || { + premultipliedAlpha: true, + antialias: true, + preserveDrawingBuffer: isMobile + }) + } + if(!gl) { + throw new Error('webgl not supported') + } - function arc() { - var buffer, - r, - r0 = +innerRadius.apply(this, arguments), - r1 = +outerRadius.apply(this, arguments), - a0 = startAngle.apply(this, arguments) - halfPi, - a1 = endAngle.apply(this, arguments) - halfPi, - da = abs(a1 - a0), - cw = a1 > a0; + //Initial bounds + var bounds = options.bounds || [[-10,-10,-10], [10,10,10]] - if (!context) context = buffer = d3Path.path(); + //Create selection + var selection = new MouseSelect() - // Ensure that the outer radius is always larger than the inner radius. - if (r1 < r0) r = r1, r1 = r0, r0 = r; + //Accumulation buffer + var accumBuffer = createFBO(gl, + gl.drawingBufferWidth, gl.drawingBufferHeight, { + preferFloat: !isMobile + }) - // Is it a point? - if (!(r1 > epsilon)) context.moveTo(0, 0); + var accumShader = createShader(gl) - // Or is it a circle or annulus? - else if (da > tau - epsilon) { - context.moveTo(r1 * cos(a0), r1 * sin(a0)); - context.arc(0, 0, r1, a0, a1, !cw); - if (r0 > epsilon) { - context.moveTo(r0 * cos(a1), r0 * sin(a1)); - context.arc(0, 0, r0, a1, a0, cw); + var isOrtho = + (options.cameraObject && options.cameraObject._ortho === true) || + (options.camera.projection && options.camera.projection.type === 'orthographic') || + false + + //Create a camera + var cameraOptions = { + eye: options.camera.eye || [2,0,0], + center: options.camera.center || [0,0,0], + up: options.camera.up || [0,1,0], + zoomMin: options.camera.zoomMax || 0.1, + zoomMax: options.camera.zoomMin || 100, + mode: options.camera.mode || 'turntable', + _ortho: isOrtho + } + + //Create axes + var axesOptions = options.axes || {} + var axes = createAxes(gl, axesOptions) + axes.enable = !axesOptions.disable + + //Create spikes + var spikeOptions = options.spikes || {} + var spikes = createSpikes(gl, spikeOptions) + + //Object list is empty initially + var objects = [] + var pickBufferIds = [] + var pickBufferCount = [] + var pickBuffers = [] + + //Dirty flag, skip redraw if scene static + var dirty = true + var pickDirty = true + + var projection = new Array(16) + var model = new Array(16) + + var cameraParams = { + view: null, + projection: projection, + model: model, + _ortho: false + } + + var pickDirty = true + + var viewShape = [ gl.drawingBufferWidth, gl.drawingBufferHeight ] + + var camera = options.cameraObject || createCamera(canvas, cameraOptions) + + //Create scene object + var scene = { + gl: gl, + contextLost: false, + pixelRatio: options.pixelRatio || 1, + canvas: canvas, + selection: selection, + camera: camera, + axes: axes, + axesPixels: null, + spikes: spikes, + bounds: bounds, + objects: objects, + shape: viewShape, + aspect: options.aspectRatio || [1,1,1], + pickRadius: options.pickRadius || 10, + zNear: options.zNear || 0.01, + zFar: options.zFar || 1000, + fovy: options.fovy || Math.PI/4, + clearColor: options.clearColor || [0,0,0,0], + autoResize: defaultBool(options.autoResize), + autoBounds: defaultBool(options.autoBounds), + autoScale: !!options.autoScale, + autoCenter: defaultBool(options.autoCenter), + clipToBounds: defaultBool(options.clipToBounds), + snapToData: !!options.snapToData, + onselect: options.onselect || null, + onrender: options.onrender || null, + onclick: options.onclick || null, + cameraParams: cameraParams, + oncontextloss: null, + mouseListener: null, + _stopped: false, + + getAspectratio: function() { + return { + x: this.aspect[0], + y: this.aspect[1], + z: this.aspect[2] } + }, + + setAspectratio: function(aspectratio) { + this.aspect[0] = aspectratio.x + this.aspect[1] = aspectratio.y + this.aspect[2] = aspectratio.z + pickDirty = true + }, + + setBounds: function(axisIndex, range) { + this.bounds[0][axisIndex] = range.min + this.bounds[1][axisIndex] = range.max + }, + + setClearColor: function(clearColor) { + this.clearColor = clearColor + }, + + clearRGBA: function() { + this.gl.clearColor( + this.clearColor[0], + this.clearColor[1], + this.clearColor[2], + this.clearColor[3] + ) + + this.gl.clear( + this.gl.COLOR_BUFFER_BIT | + this.gl.DEPTH_BUFFER_BIT + ) } + } - // Or is it a circular or annular sector? - else { - var a01 = a0, - a11 = a1, - a00 = a0, - a10 = a1, - da0 = da, - da1 = da, - ap = padAngle.apply(this, arguments) / 2, - rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), - rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), - rc0 = rc, - rc1 = rc, - t0, - t1; + var pickShape = [ (gl.drawingBufferWidth/scene.pixelRatio)|0, (gl.drawingBufferHeight/scene.pixelRatio)|0 ] - // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0. - if (rp > epsilon) { - var p0 = asin(rp / r0 * sin(ap)), - p1 = asin(rp / r1 * sin(ap)); - if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0; - else da0 = 0, a00 = a10 = (a0 + a1) / 2; - if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1; - else da1 = 0, a01 = a11 = (a0 + a1) / 2; + function resizeListener() { + if(scene._stopped) { + return + } + if(!scene.autoResize) { + return + } + var parent = canvas.parentNode + var width = 1 + var height = 1 + if(parent && parent !== document.body) { + width = parent.clientWidth + height = parent.clientHeight + } else { + width = window.innerWidth + height = window.innerHeight + } + var nextWidth = Math.ceil(width * scene.pixelRatio)|0 + var nextHeight = Math.ceil(height * scene.pixelRatio)|0 + if(nextWidth !== canvas.width || nextHeight !== canvas.height) { + canvas.width = nextWidth + canvas.height = nextHeight + var style = canvas.style + style.position = style.position || 'absolute' + style.left = '0px' + style.top = '0px' + style.width = width + 'px' + style.height = height + 'px' + dirty = true + } + } + if(scene.autoResize) { + resizeListener() + } + window.addEventListener('resize', resizeListener) + + function reallocPickIds() { + var numObjs = objects.length + var numPick = pickBuffers.length + for(var i=0; i 0 && pickBufferCount[numPick-1] === 0) { + pickBufferCount.pop() + pickBuffers.pop().dispose() + } + } - var x01 = r1 * cos(a01), - y01 = r1 * sin(a01), - x10 = r0 * cos(a10), - y10 = r0 * sin(a10); + scene.update = function(options) { - // Apply rounded corners? - if (rc > epsilon) { - var x11 = r1 * cos(a11), - y11 = r1 * sin(a11), - x00 = r0 * cos(a00), - y00 = r0 * sin(a00), - oc; + if(scene._stopped) { + return + } + options = options || {} + dirty = true + pickDirty = true + } - // Restrict the corner radius according to the sector angle. - if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { - var ax = x01 - oc[0], - ay = y01 - oc[1], - bx = x11 - oc[0], - by = y11 - oc[1], - kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), - lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); - rc0 = min(rc, (r0 - lc) / (kc - 1)); - rc1 = min(rc, (r1 - lc) / (kc + 1)); + scene.add = function(obj) { + if(scene._stopped) { + return + } + obj.axes = axes + objects.push(obj) + pickBufferIds.push(-1) + dirty = true + pickDirty = true + reallocPickIds() + } + + scene.remove = function(obj) { + if(scene._stopped) { + return + } + var idx = objects.indexOf(obj) + if(idx < 0) { + return + } + objects.splice(idx, 1) + pickBufferIds.pop() + dirty = true + pickDirty = true + reallocPickIds() + } + + scene.dispose = function() { + if(scene._stopped) { + return + } + + scene._stopped = true + + window.removeEventListener('resize', resizeListener) + canvas.removeEventListener('webglcontextlost', checkContextLoss) + scene.mouseListener.enabled = false + + if(scene.contextLost) { + return + } + + //Destroy objects + axes.dispose() + spikes.dispose() + for(var i=0; i selection.distance) { + continue + } + for(var j=0; j epsilon)) context.moveTo(x01, y01); + if(prevObj && prevObj !== selection.object) { + if(prevObj.highlight) { + prevObj.highlight(null) + } + dirty = true + } + if(selection.object) { + if(selection.object.highlight) { + selection.object.highlight(selection.data) + } + dirty = true + } - // Does the sector’s outer ring have rounded corners? - else if (rc1 > epsilon) { - t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); - t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); + change = change || (selection.object !== prevObj) + if(change && scene.onselect) { + scene.onselect(selection) + } - context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01); + if((buttons & 1) && !(scene._prevButtons & 1) && scene.onclick) { + scene.onclick(selection) + } + scene._prevButtons = buttons + }) + } - // Have the corners merged? - if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); + function checkContextLoss() { + if(scene.contextLost) { + return true + } + if(gl.isContextLost()) { + scene.contextLost = true + scene.mouseListener.enabled = false + scene.selection.object = null + if(scene.oncontextloss) { + scene.oncontextloss() + } + } + } - // Otherwise, draw the two corners and the ring. - else { - context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw); - context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw); - context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw); + canvas.addEventListener('webglcontextlost', checkContextLoss) + + //Render the scene for mouse picking + function renderPick() { + if(checkContextLoss()) { + return + } + + gl.colorMask(true, true, true, true) + gl.depthMask(true) + gl.disable(gl.BLEND) + gl.enable(gl.DEPTH_TEST) + gl.depthFunc(gl.LEQUAL) + + var numObjs = objects.length + var numPick = pickBuffers.length + for(var j=0; j epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10); + var prevBounds = [nBounds[0].slice(), nBounds[1].slice()] - // Does the sector’s inner ring (or point) have rounded corners? - else if (rc0 > epsilon) { - t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); - t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); + function redraw() { + if(checkContextLoss()) { + return + } - context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01); + resizeListener() - // Have the corners merged? - if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); + //Tick camera + var cameraMoved = scene.camera.tick() + cameraParams.view = scene.camera.matrix + dirty = dirty || cameraMoved + pickDirty = pickDirty || cameraMoved - // Otherwise, draw the two corners and the ring. - else { - context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw); - context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw); - context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw); + //Set pixel ratio + axes.pixelRatio = scene.pixelRatio + spikes.pixelRatio = scene.pixelRatio + + //Check if any objects changed, recalculate bounds + var numObjs = objects.length + var lo = nBounds[0] + var hi = nBounds[1] + lo[0] = lo[1] = lo[2] = Infinity + hi[0] = hi[1] = hi[2] = -Infinity + for(var i=0; i 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"]) +exports.pickVertex = glslify(["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"]) +exports.pickFragment = glslify(["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"]) + +},{"glslify":342}],231:[function(_dereq_,module,exports){ +'use strict' + +var createShader = _dereq_('gl-shader') +var createBuffer = _dereq_('gl-buffer') + +var pool = _dereq_('typedarray-pool') + +var SHADERS = _dereq_('./lib/shader') + +module.exports = createPointcloud2D + +function Pointcloud2D(plot, offsetBuffer, pickBuffer, shader, pickShader) { + this.plot = plot + this.offsetBuffer = offsetBuffer + this.pickBuffer = pickBuffer + this.shader = shader + this.pickShader = pickShader + this.sizeMin = 0.5 + this.sizeMinCap = 2 + this.sizeMax = 20 + this.areaRatio = 1.0 + this.pointCount = 0 + this.color = [1, 0, 0, 1] + this.borderColor = [0, 0, 0, 1] + this.blend = false + this.pickOffset = 0 + this.points = null } -function line() { - var x$1 = x, - y$1 = y, - defined = constant(true), - context = null, - curve = curveLinear, - output = null; +var proto = Pointcloud2D.prototype - function line(data) { - var i, - n = data.length, - d, - defined0 = false, - buffer; +proto.dispose = function() { + this.shader.dispose() + this.pickShader.dispose() + this.offsetBuffer.dispose() + this.pickBuffer.dispose() + this.plot.removeObject(this) +} - if (context == null) output = curve(buffer = d3Path.path()); +proto.update = function(options) { - for (i = 0; i <= n; ++i) { - if (!(i < n && defined(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) output.lineStart(); - else output.lineEnd(); - } - if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data)); - } + var i - if (buffer) return output = null, buffer + "" || null; + options = options || {} + + function dflt(opt, value) { + if(opt in options) { + return options[opt] + } + return value } - line.x = function(_) { - return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1; - }; + this.sizeMin = dflt('sizeMin', 0.5) + // this.sizeMinCap = dflt('sizeMinCap', 2) + this.sizeMax = dflt('sizeMax', 20) + this.color = dflt('color', [1, 0, 0, 1]).slice() + this.areaRatio = dflt('areaRatio', 1) + this.borderColor = dflt('borderColor', [0, 0, 0, 1]).slice() + this.blend = dflt('blend', false) - line.y = function(_) { - return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1; - }; + //Update point data - line.defined = function(_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined; - }; + // Attempt straight-through processing (STP) to avoid allocation and copy + // TODO eventually abstract out STP logic, maybe into `pool` or a layer above + var pointCount = options.positions.length >>> 1 + var dataStraightThrough = options.positions instanceof Float32Array + var idStraightThrough = options.idToIndex instanceof Int32Array && options.idToIndex.length >= pointCount // permit larger to help reuse - line.curve = function(_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; - }; + var data = options.positions + var packed = dataStraightThrough ? data : pool.mallocFloat32(data.length) + var packedId = idStraightThrough ? options.idToIndex : pool.mallocInt32(pointCount) - line.context = function(_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; - }; + if(!dataStraightThrough) { + packed.set(data) + } - return line; -} + if(!idStraightThrough) { + packed.set(data) + for(i = 0; i < pointCount; i++) { + packedId[i] = i + } + } -function area() { - var x0 = x, - x1 = null, - y0 = constant(0), - y1 = y, - defined = constant(true), - context = null, - curve = curveLinear, - output = null; + this.points = data - function area(data) { - var i, - j, - k, - n = data.length, - d, - defined0 = false, - buffer, - x0z = new Array(n), - y0z = new Array(n); + this.offsetBuffer.update(packed) + this.pickBuffer.update(packedId) - if (context == null) output = curve(buffer = d3Path.path()); + if(!dataStraightThrough) { + pool.free(packed) + } - for (i = 0; i <= n; ++i) { - if (!(i < n && defined(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) { - j = i; - output.areaStart(); - output.lineStart(); - } else { - output.lineEnd(); - output.lineStart(); - for (k = i - 1; k >= j; --k) { - output.point(x0z[k], y0z[k]); - } - output.lineEnd(); - output.areaEnd(); - } - } - if (defined0) { - x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); - output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); - } - } + if(!idStraightThrough) { + pool.free(packedId) + } - if (buffer) return output = null, buffer + "" || null; + this.pointCount = pointCount + this.pickOffset = 0 +} + +function count(points, dataBox) { + var visiblePointCountEstimate = 0 + var length = points.length >>> 1 + var i + for(i = 0; i < length; i++) { + var x = points[i * 2] + var y = points[i * 2 + 1] + if(x >= dataBox[0] && x <= dataBox[2] && y >= dataBox[1] && y <= dataBox[3]) + visiblePointCountEstimate++ } + return visiblePointCountEstimate +} - function arealine() { - return line().defined(defined).curve(curve).context(context); +proto.unifiedDraw = (function() { + var MATRIX = [1, 0, 0, + 0, 1, 0, + 0, 0, 1] + var PICK_VEC4 = [0, 0, 0, 0] +return function(pickOffset) { + var pick = pickOffset !== void(0) + + var shader = pick ? this.pickShader : this.shader + var gl = this.plot.gl + var dataBox = this.plot.dataBox + + if(this.pointCount === 0) { + return pickOffset } - area.x = function(_) { - return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0; - }; + var dataX = dataBox[2] - dataBox[0] + var dataY = dataBox[3] - dataBox[1] - area.x0 = function(_) { - return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0; - }; + var visiblePointCountEstimate = count(this.points, dataBox) + var basicPointSize = this.plot.pickPixelRatio * Math.max(Math.min(this.sizeMinCap, this.sizeMin), Math.min(this.sizeMax, this.sizeMax / Math.pow(visiblePointCountEstimate, 0.33333))) - area.x1 = function(_) { - return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1; - }; + MATRIX[0] = 2.0 / dataX + MATRIX[4] = 2.0 / dataY + MATRIX[6] = -2.0 * dataBox[0] / dataX - 1.0 + MATRIX[7] = -2.0 * dataBox[1] / dataY - 1.0 - area.y = function(_) { - return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0; - }; + this.offsetBuffer.bind() - area.y0 = function(_) { - return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0; - }; + shader.bind() + shader.attributes.position.pointer() + shader.uniforms.matrix = MATRIX + shader.uniforms.color = this.color + shader.uniforms.borderColor = this.borderColor + shader.uniforms.pointCloud = basicPointSize < 5 + shader.uniforms.pointSize = basicPointSize + shader.uniforms.centerFraction = Math.min(1, Math.max(0, Math.sqrt(1 - this.areaRatio))) - area.y1 = function(_) { - return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : y1; - }; + if(pick) { - area.lineX0 = - area.lineY0 = function() { - return arealine().x(x0).y(y0); - }; + PICK_VEC4[0] = ( pickOffset & 0xff) + PICK_VEC4[1] = ((pickOffset >> 8) & 0xff) + PICK_VEC4[2] = ((pickOffset >> 16) & 0xff) + PICK_VEC4[3] = ((pickOffset >> 24) & 0xff) - area.lineY1 = function() { - return arealine().x(x0).y(y1); - }; + this.pickBuffer.bind() + shader.attributes.pickId.pointer(gl.UNSIGNED_BYTE) + shader.uniforms.pickOffset = PICK_VEC4 + this.pickOffset = pickOffset + } - area.lineX1 = function() { - return arealine().x(x1).y(y0); - }; + // Worth switching these off, but we can't make assumptions about other + // renderers, so let's restore it after each draw + var blend = gl.getParameter(gl.BLEND) + var dither = gl.getParameter(gl.DITHER) - area.defined = function(_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), area) : defined; - }; + if(blend && !this.blend) + gl.disable(gl.BLEND) + if(dither) + gl.disable(gl.DITHER) - area.curve = function(_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; - }; + gl.drawArrays(gl.POINTS, 0, this.pointCount) - area.context = function(_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; - }; + if(blend && !this.blend) + gl.enable(gl.BLEND) + if(dither) + gl.enable(gl.DITHER) - return area; + return pickOffset + this.pointCount } +})() -function descending(a, b) { - return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; +proto.draw = proto.unifiedDraw +proto.drawPick = proto.unifiedDraw + +proto.pick = function(x, y, value) { + var pickOffset = this.pickOffset + var pointCount = this.pointCount + if(value < pickOffset || value >= pickOffset + pointCount) { + return null + } + var pointId = value - pickOffset + var points = this.points + return { + object: this, + pointId: pointId, + dataCoord: [points[2 * pointId], points[2 * pointId + 1] ] + } } -function identity(d) { - return d; +function createPointcloud2D(plot, options) { + var gl = plot.gl + var buffer = createBuffer(gl) + var pickBuffer = createBuffer(gl) + var shader = createShader(gl, SHADERS.pointVertex, SHADERS.pointFragment) + var pickShader = createShader(gl, SHADERS.pickVertex, SHADERS.pickFragment) + + var result = new Pointcloud2D(plot, buffer, pickBuffer, shader, pickShader) + result.update(options) + + //Register with plot + plot.addObject(result) + + return result } -function pie() { - var value = identity, - sortValues = descending, - sort = null, - startAngle = constant(0), - endAngle = constant(tau), - padAngle = constant(0); +},{"./lib/shader":230,"gl-buffer":171,"gl-shader":242,"typedarray-pool":477}],232:[function(_dereq_,module,exports){ +module.exports = slerp - function pie(data) { - var i, - n = data.length, - j, - k, - sum = 0, - index = new Array(n), - arcs = new Array(n), - a0 = +startAngle.apply(this, arguments), - da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)), - a1, - p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), - pa = p * (da < 0 ? -1 : 1), - v; +/** + * Performs a spherical linear interpolation between two quat + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {quat} out + */ +function slerp (out, a, b, t) { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + + var ax = a[0], ay = a[1], az = a[2], aw = a[3], + bx = b[0], by = b[1], bz = b[2], bw = b[3] + + var omega, cosom, sinom, scale0, scale1 + + // calc cosine + cosom = ax * bx + ay * by + az * bz + aw * bw + // adjust signs (if necessary) + if (cosom < 0.0) { + cosom = -cosom + bx = -bx + by = -by + bz = -bz + bw = -bw + } + // calculate coefficients + if ((1.0 - cosom) > 0.000001) { + // standard case (slerp) + omega = Math.acos(cosom) + sinom = Math.sin(omega) + scale0 = Math.sin((1.0 - t) * omega) / sinom + scale1 = Math.sin(t * omega) / sinom + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t + scale1 = t + } + // calculate final values + out[0] = scale0 * ax + scale1 * bx + out[1] = scale0 * ay + scale1 * by + out[2] = scale0 * az + scale1 * bz + out[3] = scale0 * aw + scale1 * bw - for (i = 0; i < n; ++i) { - if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) { - sum += v; - } - } + return out +} - // Optionally sort the arcs by previously-computed values or by data. - if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); }); - else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); }); +},{}],233:[function(_dereq_,module,exports){ +'use strict'; - // Compute the arcs! They are stored in the original data's order. - for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) { - j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = { - data: data[j], - index: i, - value: v, - startAngle: a0, - endAngle: a1, - padAngle: p - }; - } +module.exports = function(a){ + return (!a && a !== 0) ? '' : a.toString(); +} - return arcs; +},{}],234:[function(_dereq_,module,exports){ +"use strict" + +var vectorizeText = _dereq_("vectorize-text") + +module.exports = getGlyph + +var GLYPH_CACHE = {} + +function getGlyph(symbol, font, pixelRatio) { + var fontCache = GLYPH_CACHE[font] + if(!fontCache) { + fontCache = GLYPH_CACHE[font] = {} + } + if(symbol in fontCache) { + return fontCache[symbol] } - pie.value = function(_) { - return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value; - }; + var config = { + textAlign: "center", + textBaseline: "middle", + lineHeight: 1.0, + font: font, + lineSpacing: 1.25, + styletags: { + breaklines:true, + bolds: true, + italics: true, + subscripts:true, + superscripts:true + } + } - pie.sortValues = function(_) { - return arguments.length ? (sortValues = _, sort = null, pie) : sortValues; - }; + //Get line and triangle meshes for glyph + config.triangles = true + var triSymbol = vectorizeText(symbol, config) + config.triangles = false + var lineSymbol = vectorizeText(symbol, config) - pie.sort = function(_) { - return arguments.length ? (sort = _, sortValues = null, pie) : sort; - }; + var i, j - pie.startAngle = function(_) { - return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle; - }; + if(pixelRatio && pixelRatio !== 1) { + for(i = 0; i < triSymbol.positions.length; ++i){ + for(j = 0; j < triSymbol.positions[i].length; ++j){ + triSymbol.positions[i][j] /= pixelRatio; + } + } - pie.endAngle = function(_) { - return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle; - }; + for(i = 0; i < lineSymbol.positions.length; ++i){ + for(j = 0; j < lineSymbol.positions[i].length; ++j){ + lineSymbol.positions[i][j] /= pixelRatio; + } + } + } - pie.padAngle = function(_) { - return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle; - }; + //Calculate bounding box + var bounds = [[Infinity,Infinity], [-Infinity,-Infinity]] + var n = lineSymbol.positions.length + for(i = 0; i < n; ++i) { + var p = lineSymbol.positions[i] + for(j=0; j<2; ++j) { + bounds[0][j] = Math.min(bounds[0][j], p[j]) + bounds[1][j] = Math.max(bounds[1][j], p[j]) + } + } - return pie; + //Save cached symbol + return fontCache[symbol] = [triSymbol, lineSymbol, bounds] } +},{"vectorize-text":481}],235:[function(_dereq_,module,exports){ +var createShaderWrapper = _dereq_('gl-shader') +var glslify = _dereq_('glslify') -var curveRadialLinear = curveRadial(curveLinear); +var perspectiveVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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}"]) +var orthographicVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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}"]) +var projectionVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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"]) +var drawFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]) +var pickFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]) -function Radial(curve) { - this._curve = curve; -} +var ATTRIBUTES = [ + {name: 'position', type: 'vec3'}, + {name: 'color', type: 'vec4'}, + {name: 'glyph', type: 'vec2'}, + {name: 'id', type: 'vec4'} +] -Radial.prototype = { - areaStart: function() { - this._curve.areaStart(); +var perspective = { + vertex: perspectiveVertSrc, + fragment: drawFragSrc, + attributes: ATTRIBUTES }, - areaEnd: function() { - this._curve.areaEnd(); + ortho = { + vertex: orthographicVertSrc, + fragment: drawFragSrc, + attributes: ATTRIBUTES }, - lineStart: function() { - this._curve.lineStart(); + project = { + vertex: projectionVertSrc, + fragment: drawFragSrc, + attributes: ATTRIBUTES }, - lineEnd: function() { - this._curve.lineEnd(); + pickPerspective = { + vertex: perspectiveVertSrc, + fragment: pickFragSrc, + attributes: ATTRIBUTES }, - point: function(a, r) { - this._curve.point(r * Math.sin(a), r * -Math.cos(a)); - } -}; - -function curveRadial(curve) { - - function radial(context) { - return new Radial(curve(context)); + pickOrtho = { + vertex: orthographicVertSrc, + fragment: pickFragSrc, + attributes: ATTRIBUTES + }, + pickProject = { + vertex: projectionVertSrc, + fragment: pickFragSrc, + attributes: ATTRIBUTES } - radial._curve = curve; +function createShader(gl, src) { + var shader = createShaderWrapper(gl, src) + var attr = shader.attributes + attr.position.location = 0 + attr.color.location = 1 + attr.glyph.location = 2 + attr.id.location = 3 + return shader +} - return radial; +exports.createPerspective = function(gl) { + return createShader(gl, perspective) +} +exports.createOrtho = function(gl) { + return createShader(gl, ortho) +} +exports.createProject = function(gl) { + return createShader(gl, project) +} +exports.createPickPerspective = function(gl) { + return createShader(gl, pickPerspective) +} +exports.createPickOrtho = function(gl) { + return createShader(gl, pickOrtho) +} +exports.createPickProject = function(gl) { + return createShader(gl, pickProject) } -function lineRadial(l) { - var c = l.curve; +},{"gl-shader":242,"glslify":236}],236:[function(_dereq_,module,exports){ +arguments[4][178][0].apply(exports,arguments) +},{"dup":178}],237:[function(_dereq_,module,exports){ +'use strict' - l.angle = l.x, delete l.x; - l.radius = l.y, delete l.y; +var isAllBlank = _dereq_('is-string-blank') +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var pool = _dereq_('typedarray-pool') +var mat4mult = _dereq_('gl-mat4/multiply') +var shaders = _dereq_('./lib/shaders') +var getGlyph = _dereq_('./lib/glyphs') +var getSimpleString = _dereq_('./lib/get-simple-string') - l.curve = function(_) { - return arguments.length ? c(curveRadial(_)) : c()._curve; - }; +var IDENTITY = [1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] - return l; +module.exports = createPointCloud + +function transformMat4(x, m) { + var x0 = x[0] + var x1 = x[1] + var x2 = x[2] + var x3 = x[3] + x[0] = m[0] * x0 + m[4] * x1 + m[8] * x2 + m[12] * x3 + x[1] = m[1] * x0 + m[5] * x1 + m[9] * x2 + m[13] * x3 + x[2] = m[2] * x0 + m[6] * x1 + m[10] * x2 + m[14] * x3 + x[3] = m[3] * x0 + m[7] * x1 + m[11] * x2 + m[15] * x3 + return x } -function lineRadial$1() { - return lineRadial(line().curve(curveRadialLinear)); +function project(p, v, m, x) { + transformMat4(x, x, m) + transformMat4(x, x, v) + return transformMat4(x, x, p) } -function areaRadial() { - var a = area().curve(curveRadialLinear), - c = a.curve, - x0 = a.lineX0, - x1 = a.lineX1, - y0 = a.lineY0, - y1 = a.lineY1; +function ScatterPlotPickResult(index, position) { + this.index = index + this.dataCoordinate = this.position = position +} - a.angle = a.x, delete a.x; - a.startAngle = a.x0, delete a.x0; - a.endAngle = a.x1, delete a.x1; - a.radius = a.y, delete a.y; - a.innerRadius = a.y0, delete a.y0; - a.outerRadius = a.y1, delete a.y1; - a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0; - a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1; - a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0; - a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1; +function fixOpacity(a) { + if(a === true) return 1 + if(a > 1) return 1 + return a +} - a.curve = function(_) { - return arguments.length ? c(curveRadial(_)) : c()._curve; - }; +function PointCloud( + gl, + shader, + orthoShader, + projectShader, + pointBuffer, + colorBuffer, + glyphBuffer, + idBuffer, + vao, + pickPerspectiveShader, + pickOrthoShader, + pickProjectShader) { - return a; -} + this.gl = gl -function pointRadial(x, y) { - return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)]; -} + this.pixelRatio = 1 -var slice = Array.prototype.slice; + this.shader = shader + this.orthoShader = orthoShader + this.projectShader = projectShader -function linkSource(d) { - return d.source; -} + this.pointBuffer = pointBuffer + this.colorBuffer = colorBuffer + this.glyphBuffer = glyphBuffer + this.idBuffer = idBuffer + this.vao = vao + this.vertexCount = 0 + this.lineVertexCount = 0 -function linkTarget(d) { - return d.target; -} + this.opacity = 1 + this.hasAlpha = false -function link(curve) { - var source = linkSource, - target = linkTarget, - x$1 = x, - y$1 = y, - context = null; + this.lineWidth = 0 + this.projectScale = [2.0/3.0, 2.0/3.0, 2.0/3.0] + this.projectOpacity = [1, 1, 1] + this.projectHasAlpha = false - function link() { - var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv); - if (!context) context = buffer = d3Path.path(); - curve(context, +x$1.apply(this, (argv[0] = s, argv)), +y$1.apply(this, argv), +x$1.apply(this, (argv[0] = t, argv)), +y$1.apply(this, argv)); - if (buffer) return context = null, buffer + "" || null; - } + this.pickId = 0 + this.pickPerspectiveShader = pickPerspectiveShader + this.pickOrthoShader = pickOrthoShader + this.pickProjectShader = pickProjectShader + this.points = [] - link.source = function(_) { - return arguments.length ? (source = _, link) : source; - }; + this._selectResult = new ScatterPlotPickResult(0, [0,0,0]) - link.target = function(_) { - return arguments.length ? (target = _, link) : target; - }; + this.useOrtho = true + this.bounds = [[ Infinity,Infinity,Infinity], + [-Infinity,-Infinity,-Infinity]] - link.x = function(_) { - return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), link) : x$1; - }; + //Axes projections + this.axesProject = [ true, true, true ] + this.axesBounds = [[-Infinity,-Infinity,-Infinity], + [ Infinity, Infinity, Infinity]] - link.y = function(_) { - return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), link) : y$1; - }; + this.highlightId = [1,1,1,1] + this.highlightScale = 2 - link.context = function(_) { - return arguments.length ? ((context = _ == null ? null : _), link) : context; - }; + this.clipBounds = [[-Infinity,-Infinity,-Infinity], + [ Infinity, Infinity, Infinity]] - return link; + this.dirty = true } -function curveHorizontal(context, x0, y0, x1, y1) { - context.moveTo(x0, y0); - context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1); +var proto = PointCloud.prototype + +proto.pickSlots = 1 + +proto.setPickBase = function(pickBase) { + this.pickId = pickBase } -function curveVertical(context, x0, y0, x1, y1) { - context.moveTo(x0, y0); - context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1); +proto.isTransparent = function() { + if(this.hasAlpha) { + return true + } + for(var i=0; i<3; ++i) { + if(this.axesProject[i] && this.projectHasAlpha) { + return true + } + } + return false } -function curveRadial$1(context, x0, y0, x1, y1) { - var p0 = pointRadial(x0, y0), - p1 = pointRadial(x0, y0 = (y0 + y1) / 2), - p2 = pointRadial(x1, y0), - p3 = pointRadial(x1, y1); - context.moveTo(p0[0], p0[1]); - context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]); +proto.isOpaque = function() { + if(!this.hasAlpha) { + return true + } + for(var i=0; i<3; ++i) { + if(this.axesProject[i] && !this.projectHasAlpha) { + return true + } + } + return false } -function linkHorizontal() { - return link(curveHorizontal); +var VIEW_SHAPE = [0,0] +var U_VEC = [0,0,0] +var V_VEC = [0,0,0] +var MU_VEC = [0,0,0,1] +var MV_VEC = [0,0,0,1] +var SCRATCH_MATRIX = IDENTITY.slice() +var SCRATCH_VEC = [0,0,0] +var CLIP_BOUNDS = [[0,0,0], [0,0,0]] + +function zeroVec(a) { + a[0] = a[1] = a[2] = 0 + return a } -function linkVertical() { - return link(curveVertical); +function augment(hg, af) { + hg[0] = af[0] + hg[1] = af[1] + hg[2] = af[2] + hg[3] = 1 + return hg } -function linkRadial() { - var l = link(curveRadial$1); - l.angle = l.x, delete l.x; - l.radius = l.y, delete l.y; - return l; +function setComponent(out, v, i, x) { + out[0] = v[0] + out[1] = v[1] + out[2] = v[2] + out[i] = x + return out } -var circle = { - draw: function(context, size) { - var r = Math.sqrt(size / pi); - context.moveTo(r, 0); - context.arc(0, 0, r, 0, tau); +function getClipBounds(bounds) { + var result = CLIP_BOUNDS + for(var i=0; i<2; ++i) { + for(var j=0; j<3; ++j) { + result[i][j] = Math.max(Math.min(bounds[i][j], 1e8), -1e8) + } } -}; + return result +} -var cross = { - draw: function(context, size) { - var r = Math.sqrt(size / 5) / 2; - context.moveTo(-3 * r, -r); - context.lineTo(-r, -r); - context.lineTo(-r, -3 * r); - context.lineTo(r, -3 * r); - context.lineTo(r, -r); - context.lineTo(3 * r, -r); - context.lineTo(3 * r, r); - context.lineTo(r, r); - context.lineTo(r, 3 * r); - context.lineTo(-r, 3 * r); - context.lineTo(-r, r); - context.lineTo(-3 * r, r); - context.closePath(); - } -}; +function drawProject(shader, points, camera, pixelRatio) { + var axesProject = points.axesProject -var tan30 = Math.sqrt(1 / 3), - tan30_2 = tan30 * 2; + var gl = points.gl + var uniforms = shader.uniforms + var model = camera.model || IDENTITY + var view = camera.view || IDENTITY + var projection = camera.projection || IDENTITY + var bounds = points.axesBounds + var clipBounds = getClipBounds(points.clipBounds) -var diamond = { - draw: function(context, size) { - var y = Math.sqrt(size / tan30_2), - x = y * tan30; - context.moveTo(0, -y); - context.lineTo(x, 0); - context.lineTo(0, y); - context.lineTo(-x, 0); - context.closePath(); + var cubeAxis + if(points.axes && points.axes.lastCubeProps) { + cubeAxis = points.axes.lastCubeProps.axis + } else { + cubeAxis = [1,1,1] } -}; -var ka = 0.89081309152928522810, - kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10), - kx = Math.sin(tau / 10) * kr, - ky = -Math.cos(tau / 10) * kr; + VIEW_SHAPE[0] = 2.0/gl.drawingBufferWidth + VIEW_SHAPE[1] = 2.0/gl.drawingBufferHeight -var star = { - draw: function(context, size) { - var r = Math.sqrt(size * ka), - x = kx * r, - y = ky * r; - context.moveTo(0, -r); - context.lineTo(x, y); - for (var i = 1; i < 5; ++i) { - var a = tau * i / 5, - c = Math.cos(a), - s = Math.sin(a); - context.lineTo(s * r, -c * r); - context.lineTo(c * x - s * y, s * x + c * y); + shader.bind() + uniforms.view = view + uniforms.projection = projection + uniforms.screenSize = VIEW_SHAPE + uniforms.highlightId = points.highlightId + uniforms.highlightScale = points.highlightScale + uniforms.clipBounds = clipBounds + uniforms.pickGroup = points.pickId / 255.0 + uniforms.pixelRatio = pixelRatio + + for(var i=0; i<3; ++i) { + if(!axesProject[i]) { + continue } - context.closePath(); - } -}; -var square = { - draw: function(context, size) { - var w = Math.sqrt(size), - x = -w / 2; - context.rect(x, x, w, w); - } -}; + uniforms.scale = points.projectScale[i] + uniforms.opacity = points.projectOpacity[i] -var sqrt3 = Math.sqrt(3); + //Project model matrix + var pmodel = SCRATCH_MATRIX + for(var j=0; j<16; ++j) { + pmodel[j] = 0 + } + for(var j=0; j<4; ++j) { + pmodel[5*j] = 1 + } + pmodel[5*i] = 0 + if(cubeAxis[i] < 0) { + pmodel[12+i] = bounds[0][i] + } else { + pmodel[12+i] = bounds[1][i] + } + mat4mult(pmodel, model, pmodel) + uniforms.model = pmodel -var triangle = { - draw: function(context, size) { - var y = -Math.sqrt(size / (sqrt3 * 3)); - context.moveTo(0, y * 2); - context.lineTo(-sqrt3 * y, -y); - context.lineTo(sqrt3 * y, -y); - context.closePath(); - } -}; + //Compute initial axes + var u = (i+1)%3 + var v = (i+2)%3 + var du = zeroVec(U_VEC) + var dv = zeroVec(V_VEC) + du[u] = 1 + dv[v] = 1 -var c = -0.5, - s = Math.sqrt(3) / 2, - k = 1 / Math.sqrt(12), - a = (k / 2 + 1) * 3; + //Align orientation relative to viewer + var mdu = project(projection, view, model, augment(MU_VEC, du)) + var mdv = project(projection, view, model, augment(MV_VEC, dv)) + if(Math.abs(mdu[1]) > Math.abs(mdv[1])) { + var tmp = mdu + mdu = mdv + mdv = tmp + tmp = du + du = dv + dv = tmp + var t = u + u = v + v = t + } + if(mdu[0] < 0) { + du[u] = -1 + } + if(mdv[1] > 0) { + dv[v] = -1 + } + var su = 0.0 + var sv = 0.0 + for(var j=0; j<4; ++j) { + su += Math.pow(model[4*u+j], 2) + sv += Math.pow(model[4*v+j], 2) + } + du[u] /= Math.sqrt(su) + dv[v] /= Math.sqrt(sv) + uniforms.axes[0] = du + uniforms.axes[1] = dv -var wye = { - draw: function(context, size) { - var r = Math.sqrt(size / a), - x0 = r / 2, - y0 = r * k, - x1 = x0, - y1 = r * k + r, - x2 = -x1, - y2 = y1; - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - context.lineTo(c * x0 - s * y0, s * x0 + c * y0); - context.lineTo(c * x1 - s * y1, s * x1 + c * y1); - context.lineTo(c * x2 - s * y2, s * x2 + c * y2); - context.lineTo(c * x0 + s * y0, c * y0 - s * x0); - context.lineTo(c * x1 + s * y1, c * y1 - s * x1); - context.lineTo(c * x2 + s * y2, c * y2 - s * x2); - context.closePath(); + //Update fragment clip bounds + uniforms.fragClipBounds[0] = setComponent(SCRATCH_VEC, clipBounds[0], i, -1e8) + uniforms.fragClipBounds[1] = setComponent(SCRATCH_VEC, clipBounds[1], i, 1e8) + + points.vao.bind() + + //Draw interior + points.vao.draw(gl.TRIANGLES, points.vertexCount) + + //Draw edges + if(points.lineWidth > 0) { + gl.lineWidth(points.lineWidth * pixelRatio) + points.vao.draw(gl.LINES, points.lineVertexCount, points.vertexCount) + } + + points.vao.unbind() } -}; +} -var symbols = [ - circle, - cross, - diamond, - square, - star, - triangle, - wye -]; -function symbol() { - var type = constant(circle), - size = constant(64), - context = null; +var NEG_INFINITY3 = [-1e8, -1e8, -1e8] +var POS_INFINITY3 = [1e8, 1e8, 1e8] +var CLIP_GROUP = [NEG_INFINITY3, POS_INFINITY3] - function symbol() { - var buffer; - if (!context) context = buffer = d3Path.path(); - type.apply(this, arguments).draw(context, +size.apply(this, arguments)); - if (buffer) return context = null, buffer + "" || null; +function drawFull(shader, pshader, points, camera, pixelRatio, transparent, forceDraw) { + var gl = points.gl + + if(transparent === points.projectHasAlpha || forceDraw) { + drawProject(pshader, points, camera, pixelRatio) } - symbol.type = function(_) { - return arguments.length ? (type = typeof _ === "function" ? _ : constant(_), symbol) : type; - }; + if(transparent === points.hasAlpha || forceDraw) { - symbol.size = function(_) { - return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size; - }; + shader.bind() + var uniforms = shader.uniforms - symbol.context = function(_) { - return arguments.length ? (context = _ == null ? null : _, symbol) : context; - }; + uniforms.model = camera.model || IDENTITY + uniforms.view = camera.view || IDENTITY + uniforms.projection = camera.projection || IDENTITY - return symbol; -} + VIEW_SHAPE[0] = 2.0/gl.drawingBufferWidth + VIEW_SHAPE[1] = 2.0/gl.drawingBufferHeight + uniforms.screenSize = VIEW_SHAPE -function noop() {} + uniforms.highlightId = points.highlightId + uniforms.highlightScale = points.highlightScale -function point(that, x, y) { - that._context.bezierCurveTo( - (2 * that._x0 + that._x1) / 3, - (2 * that._y0 + that._y1) / 3, - (that._x0 + 2 * that._x1) / 3, - (that._y0 + 2 * that._y1) / 3, - (that._x0 + 4 * that._x1 + x) / 6, - (that._y0 + 4 * that._y1 + y) / 6 - ); -} + uniforms.fragClipBounds = CLIP_GROUP + uniforms.clipBounds = points.axes.bounds -function Basis(context) { - this._context = context; -} + uniforms.opacity = points.opacity + uniforms.pickGroup = points.pickId / 255.0 -Basis.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = - this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 3: point(this, this._x1, this._y1); // proceed - case 2: this._context.lineTo(this._x1, this._y1); break; - } - if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x, y) { - x = +x, y = +y; - switch (this._point) { - case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; - case 1: this._point = 2; break; - case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed - default: point(this, x, y); break; + uniforms.pixelRatio = pixelRatio + + points.vao.bind() + + //Draw interior + points.vao.draw(gl.TRIANGLES, points.vertexCount) + + //Draw edges + if(points.lineWidth > 0) { + gl.lineWidth(points.lineWidth * pixelRatio) + points.vao.draw(gl.LINES, points.lineVertexCount, points.vertexCount) } - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; + + points.vao.unbind() } -}; -function basis(context) { - return new Basis(context); + } -function BasisClosed(context) { - this._context = context; +proto.draw = function(camera) { + var shader = this.useOrtho ? this.orthoShader : this.shader + drawFull(shader, this.projectShader, this, camera, this.pixelRatio, false, false) } -BasisClosed.prototype = { - areaStart: noop, - areaEnd: noop, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = - this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x2, this._y2); - this._context.closePath(); - break; - } - case 2: { - this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); - this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x2, this._y2); - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - break; - } - } - }, - point: function(x, y) { - x = +x, y = +y; - switch (this._point) { - case 0: this._point = 1; this._x2 = x, this._y2 = y; break; - case 1: this._point = 2; this._x3 = x, this._y3 = y; break; - case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break; - default: point(this, x, y); break; - } - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; +proto.drawTransparent = function(camera) { + var shader = this.useOrtho ? this.orthoShader : this.shader + drawFull(shader, this.projectShader, this, camera, this.pixelRatio, true, false) +} + +proto.drawPick = function(camera) { + var shader = this.useOrtho ? this.pickOrthoShader : this.pickPerspectiveShader + drawFull(shader, this.pickProjectShader, this, camera, 1, true, true) +} + +proto.pick = function(selected) { + if(!selected) { + return null + } + if(selected.id !== this.pickId) { + return null + } + var x = selected.value[2] + (selected.value[1]<<8) + (selected.value[0]<<16) + if(x >= this.pointCount || x < 0) { + return null } -}; -function basisClosed(context) { - return new BasisClosed(context); + //Unpack result + var coord = this.points[x] + var result = this._selectResult + result.index = x + for(var i=0; i<3; ++i) { + result.position[i] = result.dataCoordinate[i] = coord[i] + } + return result } -function BasisOpen(context) { - this._context = context; +proto.highlight = function(selection) { + if(!selection) { + this.highlightId = [1,1,1,1] + } else { + var pointId = selection.index + var a0 = pointId &0xff + var a1 = (pointId>>8) &0xff + var a2 = (pointId>>16)&0xff + this.highlightId = [a0/255.0, a1/255.0, a2/255.0, 0] + } } -BasisOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = - this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x, y) { - x = +x, y = +y; - switch (this._point) { - case 0: this._point = 1; break; - case 1: this._point = 2; break; - case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break; - case 3: this._point = 4; // proceed - default: point(this, x, y); break; +function get_glyphData(glyphs, index, font, pixelRatio) { + var str + + // use the data if presented in an array + if(Array.isArray(glyphs)) { + if(index < glyphs.length) { + str = glyphs[index] + } else { + str = undefined } - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; + } else { + str = glyphs } -}; -function basisOpen(context) { - return new BasisOpen(context); -} + str = getSimpleString(str) // this would handle undefined cases -function Bundle(context, beta) { - this._basis = new Basis(context); - this._beta = beta; + var visible = true + if(isAllBlank(str)) { + str = '▼' // Note: this special character may have minimum number of surfaces + visible = false + } + + var glyph = getGlyph(str, font, pixelRatio) + + return { mesh:glyph[0], + lines:glyph[1], + bounds:glyph[2], + visible:visible }; } -Bundle.prototype = { - lineStart: function() { - this._x = []; - this._y = []; - this._basis.lineStart(); - }, - lineEnd: function() { - var x = this._x, - y = this._y, - j = x.length - 1; - if (j > 0) { - var x0 = x[0], - y0 = y[0], - dx = x[j] - x0, - dy = y[j] - y0, - i = -1, - t; - while (++i <= j) { - t = i / j; - this._basis.point( - this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), - this._beta * y[i] + (1 - this._beta) * (y0 + t * dy) - ); +proto.update = function(options) { + + options = options || {} + + if('perspective' in options) { + this.useOrtho = !options.perspective + } + if('orthographic' in options) { + this.useOrtho = !!options.orthographic + } + if('lineWidth' in options) { + this.lineWidth = options.lineWidth + } + if('project' in options) { + if(Array.isArray(options.project)) { + this.axesProject = options.project + } else { + var v = !!options.project + this.axesProject = [v,v,v] + } + } + if('projectScale' in options) { + if(Array.isArray(options.projectScale)) { + this.projectScale = options.projectScale.slice() + } else { + var s = +options.projectScale + this.projectScale = [s,s,s] + } + } + + this.projectHasAlpha = false // default to no transparent draw + if('projectOpacity' in options) { + if(Array.isArray(options.projectOpacity)) { + this.projectOpacity = options.projectOpacity.slice() + } else { + var s = +options.projectOpacity + this.projectOpacity = [s,s,s] + } + for(var i=0; i<3; ++i) { + this.projectOpacity[i] = fixOpacity(this.projectOpacity[i]); + if(this.projectOpacity[i] < 1) { + this.projectHasAlpha = true; } } + } - this._x = this._y = null; - this._basis.lineEnd(); - }, - point: function(x, y) { - this._x.push(+x); - this._y.push(+y); + this.hasAlpha = false // default to no transparent draw + if('opacity' in options) { + this.opacity = fixOpacity(options.opacity) + if(this.opacity < 1) { + this.hasAlpha = true; + } } -}; -var bundle = (function custom(beta) { + //Set dirty flag + this.dirty = true - function bundle(context) { - return beta === 1 ? new Basis(context) : new Bundle(context, beta); + //Create new buffers + var points = options.position + + //Text font + var font = options.font || 'normal' + var alignment = options.alignment || [0,0] + + var alignmentX; + var alignmentY; + if (alignment.length === 2) { + alignmentX = alignment[0] + alignmentY = alignment[1] + } else { + alignmentX = [] + alignmentY = [] + for (var i = 0; i < alignment.length; ++i) { + alignmentX[i] = alignment[i][0] + alignmentY[i] = alignment[i][1] + } } - bundle.beta = function(beta) { - return custom(+beta); - }; + //Bounds + var lowerBound = [ Infinity, Infinity, Infinity] + var upperBound = [-Infinity,-Infinity,-Infinity] - return bundle; -})(0.85); + //Unpack options + var glyphs = options.glyph + var colors = options.color + var sizes = options.size + var angles = options.angle + var lineColors = options.lineColor -function point$1(that, x, y) { - that._context.bezierCurveTo( - that._x1 + that._k * (that._x2 - that._x0), - that._y1 + that._k * (that._y2 - that._y0), - that._x2 + that._k * (that._x1 - x), - that._y2 + that._k * (that._y1 - y), - that._x2, - that._y2 - ); -} + //Picking geometry + var pickCounter = -1 -function Cardinal(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} + //First do pass to compute buffer sizes + var triVertexCount = 0 + var lineVertexCount = 0 -Cardinal.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = - this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: this._context.lineTo(this._x2, this._y2); break; - case 3: point$1(this, this._x1, this._y1); break; - } - if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x, y) { - x = +x, y = +y; - switch (this._point) { - case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; - case 1: this._point = 2; this._x1 = x, this._y1 = y; break; - case 2: this._point = 3; // proceed - default: point$1(this, x, y); break; + var numPoints = 0; + + if(points.length) { + + //Count number of points and buffer size + numPoints = points.length + + count_loop: + for(var i=0; i 0) { + var triOffset = 0 + var lineOffset = triVertexCount + var color = [0,0,0,1] + var lineColor = [0,0,0,1] - return cardinal; -})(0); + var isColorArray = Array.isArray(colors) && Array.isArray(colors[0]) + var isLineColorArray = Array.isArray(lineColors) && Array.isArray(lineColors[0]) -function CardinalClosed(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} + fill_loop: + for(var i=0; i 0) ? (1 - glyphBounds[0][0]) : + (textOffsetX < 0) ? (1 + glyphBounds[1][0]) : 1; + + textOffsetY *= (textOffsetY > 0) ? (1 - glyphBounds[0][1]) : + (textOffsetY < 0) ? (1 + glyphBounds[1][1]) : 1; + + var textOffset = [textOffsetX, textOffsetY] + + //Write out inner marker + var cells = glyphMesh.cells || [] + var verts = glyphMesh.positions || [] + + for(var j=0; j epsilon) { - var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, - n = 3 * that._l01_a * (that._l01_a + that._l12_a); - x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; - y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; + if(this.innerFill) { + boxes.drawBox(loX, loY, hiX, hiY, innerColor) } - if (that._l23_a > epsilon) { - var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, - m = 3 * that._l23_a * (that._l23_a + that._l12_a); - x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m; - y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m; + //Draw border + if(lineWidth > 0) { + + //Draw border + var w = lineWidth * pixelRatio + boxes.drawBox(loX-w, loY-w, hiX+w, loY+w, borderColor) + boxes.drawBox(loX-w, hiY-w, hiX+w, hiY+w, borderColor) + boxes.drawBox(loX-w, loY-w, loX+w, hiY+w, borderColor) + boxes.drawBox(hiX-w, loY-w, hiX+w, hiY+w, borderColor) } +} - that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2); +proto.update = function(options) { + options = options || {} + + this.innerFill = !!options.innerFill + this.outerFill = !!options.outerFill + this.innerColor = (options.innerColor || [0,0,0,0.5]).slice() + this.outerColor = (options.outerColor || [0,0,0,0.5]).slice() + this.borderColor = (options.borderColor || [0,0,0,1]).slice() + this.borderWidth = options.borderWidth || 0 + this.selectBox = (options.selectBox || this.selectBox).slice() } -function CatmullRom(context, alpha) { - this._context = context; - this._alpha = alpha; +proto.dispose = function() { + this.boxBuffer.dispose() + this.boxShader.dispose() + this.plot.removeOverlay(this) +} + +function createSelectBox(plot, options) { + var gl = plot.gl + var buffer = createBuffer(gl, [ + 0, 0, + 0, 1, + 1, 0, + 1, 1 ]) + var shader = createShader(gl, SHADERS.boxVertex, SHADERS.boxFragment) + var selectBox = new SelectBox(plot, buffer, shader) + selectBox.update(options) + plot.addOverlay(selectBox) + return selectBox +} + +},{"./lib/shaders":238,"gl-buffer":171,"gl-shader":242}],241:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createSelectBuffer + +var createFBO = _dereq_('gl-fbo') +var pool = _dereq_('typedarray-pool') +var ndarray = _dereq_('ndarray') +var nextPow2 = _dereq_('bit-twiddle').nextPow2 + +var selectRange = function(arr, x, y) { + var closestD2 = 1e8 + var closestX = -1 + var closestY = -1 + + var ni = arr.shape[0] + var nj = arr.shape[1] + for(var i = 0; i < ni; i++) { + for(var j = 0; j < nj; j++) { + var r = arr.get(i, j, 0) + var g = arr.get(i, j, 1) + var b = arr.get(i, j, 2) + var a = arr.get(i, j, 3) + + if(r < 255 || g < 255 || b < 255 || a < 255) { + var dx = x - i + var dy = y - j + var d2 = dx*dx + dy*dy + if(d2 < closestD2) { + closestD2 = d2 + closestX = i + closestY = j + } + } + } + } + + return [closestX, closestY, closestD2] } -CatmullRom.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = - this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = - this._l01_2a = this._l12_2a = this._l23_2a = - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: this._context.lineTo(this._x2, this._y2); break; - case 3: this.point(this._x2, this._y2); break; +function SelectResult(x, y, id, value, distance) { + this.coord = [x, y] + this.id = id + this.value = value + this.distance = distance +} + +function SelectBuffer(gl, fbo, buffer) { + this.gl = gl + this.fbo = fbo + this.buffer = buffer + this._readTimeout = null + var self = this + + this._readCallback = function() { + if(!self.gl) { + return } - if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); - this._line = 1 - this._line; + fbo.bind() + gl.readPixels(0,0,fbo.shape[0],fbo.shape[1],gl.RGBA,gl.UNSIGNED_BYTE,self.buffer) + self._readTimeout = null + } +} + +var proto = SelectBuffer.prototype + +Object.defineProperty(proto, 'shape', { + get: function() { + if(!this.gl) { + return [0,0] + } + return this.fbo.shape.slice() }, - point: function(x, y) { - x = +x, y = +y; + set: function(v) { + if(!this.gl) { + return + } + this.fbo.shape = v + var c = this.fbo.shape[0] + var r = this.fbo.shape[1] + if(r*c*4 > this.buffer.length) { + pool.free(this.buffer) + var buffer = this.buffer = pool.mallocUint8(nextPow2(r*c*4)) + for(var i=0; i oldAttribCount) { + for(i = oldAttribCount; i < newAttribCount; i++) { + this.gl.enableVertexAttribArray(i) + } + } else if(oldAttribCount > newAttribCount) { + for(i = newAttribCount; i < oldAttribCount; i++) { + this.gl.disableVertexAttribArray(i) } + } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + this.gl.lastAttribCount = newAttribCount + + this.gl.useProgram(this.program) +} + +proto.dispose = function() { + + // disabling vertex attributes so new shader starts with zero + // and it's also useful if all shaders are disposed but the + // gl context is reused for subsequent replotting + var oldAttribCount = this.gl.lastAttribCount + for (var i = 0; i < oldAttribCount; i++) { + this.gl.disableVertexAttribArray(i) } -}; + this.gl.lastAttribCount = 0 -var catmullRomClosed = (function custom(alpha) { + if(this._fref) { + this._fref.dispose() + } + if(this._vref) { + this._vref.dispose() + } + this.attributes = + this.types = + this.vertShader = + this.fragShader = + this.program = + this._relink = + this._fref = + this._vref = null +} - function catmullRom(context) { - return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); +function compareAttributes(a, b) { + if(a.name < b.name) { + return -1 } + return 1 +} - catmullRom.alpha = function(alpha) { - return custom(+alpha); - }; +//Update export hook for glslify-live +proto.update = function( + vertSource + , fragSource + , uniforms + , attributes) { - return catmullRom; -})(0.5); + //If only one object passed, assume glslify style output + if(!fragSource || arguments.length === 1) { + var obj = vertSource + vertSource = obj.vertex + fragSource = obj.fragment + uniforms = obj.uniforms + attributes = obj.attributes + } -function CatmullRomOpen(context, alpha) { - this._context = context; - this._alpha = alpha; -} + var wrapper = this + var gl = wrapper.gl -CatmullRomOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = - this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = - this._l01_2a = this._l12_2a = this._l23_2a = - this._point = 0; - }, - lineEnd: function() { - if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x, y) { - x = +x, y = +y; + //Compile vertex and fragment shaders + var pvref = wrapper._vref + wrapper._vref = shaderCache.shader(gl, gl.VERTEX_SHADER, vertSource) + if(pvref) { + pvref.dispose() + } + wrapper.vertShader = wrapper._vref.shader + var pfref = this._fref + wrapper._fref = shaderCache.shader(gl, gl.FRAGMENT_SHADER, fragSource) + if(pfref) { + pfref.dispose() + } + wrapper.fragShader = wrapper._fref.shader - if (this._point) { - var x23 = this._x2 - x, - y23 = this._y2 - y; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } + //If uniforms/attributes is not specified, use RT reflection + if(!uniforms || !attributes) { - switch (this._point) { - case 0: this._point = 1; break; - case 1: this._point = 2; break; - case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; - case 3: this._point = 4; // proceed - default: point$2(this, x, y); break; + //Create initial test program + var testProgram = gl.createProgram() + gl.attachShader(testProgram, wrapper.fragShader) + gl.attachShader(testProgram, wrapper.vertShader) + gl.linkProgram(testProgram) + if(!gl.getProgramParameter(testProgram, gl.LINK_STATUS)) { + var errLog = gl.getProgramInfoLog(testProgram) + throw new GLError(errLog, 'Error linking program:' + errLog) } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; + //Load data from runtime + uniforms = uniforms || runtime.uniforms(gl, testProgram) + attributes = attributes || runtime.attributes(gl, testProgram) + + //Release test program + gl.deleteProgram(testProgram) } -}; -var catmullRomOpen = (function custom(alpha) { + //Sort attributes lexicographically + // overrides undefined WebGL behavior for attribute locations + attributes = attributes.slice() + attributes.sort(compareAttributes) - function catmullRom(context) { - return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); + //Convert attribute types, read out locations + var attributeUnpacked = [] + var attributeNames = [] + var attributeLocations = [] + var i + for(i=0; i= 0) { + var size = attr.type.charAt(attr.type.length-1)|0 + var locVector = new Array(size) + for(var j=0; j= 0) { + curLocation += 1 + } + attributeLocations[i] = curLocation + } + } - return catmullRom; -})(0.5); + //Rebuild program and recompute all uniform locations + var uniformLocations = new Array(uniforms.length) + function relink() { + wrapper.program = shaderCache.program( + gl + , wrapper._vref + , wrapper._fref + , attributeNames + , attributeLocations) -function LinearClosed(context) { - this._context = context; -} + for(var i=0; i= 0) { + var d = type.charCodeAt(type.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type for attribute ' + name + ': ' + type) + } + addVectorAttribute( + gl + , wrapper + , locs[0] + , locations + , d + , obj + , name) + } else if(type.indexOf('mat') >= 0) { + var d = type.charCodeAt(type.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type for attribute ' + name + ': ' + type) + } + addMatrixAttribute( + gl + , wrapper + , locs + , locations + , d + , obj + , name) + } else { + throw new GLError('', 'Unknown data type for attribute ' + name + ': ' + type) + } + break + } + } + return obj } -function monotoneY(context) { - return new MonotoneY(context); +},{"./GLError":243}],245:[function(_dereq_,module,exports){ +'use strict' + +var coallesceUniforms = _dereq_('./reflect') +var GLError = _dereq_("./GLError") + +module.exports = createUniformWrapper + +//Binds a function and returns a value +function identity(x) { + return function() { + return x + } } -function Natural(context) { - this._context = context; +function makeVector(length, fill) { + var result = new Array(length) + for(var i=0; i 4) { + throw new GLError('', 'Invalid data type') + } + switch(t.charAt(0)) { + case 'b': + case 'i': + gl['uniform' + d + 'iv'](locations[idx], objPath) + break + case 'v': + gl['uniform' + d + 'fv'](locations[idx], objPath) + break + default: + throw new GLError('', 'Unrecognized data type for vector ' + name + ': ' + t) + } + } else if(t.indexOf('mat') === 0 && t.length === 4) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + t) + } + gl['uniformMatrix' + d + 'fv'](locations[idx], false, objPath) + break + } else { + throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + t) + } + } + } + } + } + } + + function enumerateIndices(prefix, type) { + if(typeof type !== 'object') { + return [ [prefix, type] ] + } + var indices = [] + for(var id in type) { + var prop = type[id] + var tprefix = prefix + if(parseInt(id) + '' === id) { + tprefix += '[' + id + ']' } else { - var px = controlPoints(x), - py = controlPoints(y); - for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { - this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]); + tprefix += '.' + id + } + if(typeof prop === 'object') { + indices.push.apply(indices, enumerateIndices(tprefix, prop)) + } else { + indices.push([tprefix, prop]) + } + } + return indices + } + + + function defaultValue(type) { + switch(type) { + case 'bool': + return false + case 'int': + case 'sampler2D': + case 'samplerCube': + return 0 + case 'float': + return 0.0 + default: + var vidx = type.indexOf('vec') + if(0 <= vidx && vidx <= 1 && type.length === 4 + vidx) { + var d = type.charCodeAt(type.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type') + } + if(type.charAt(0) === 'b') { + return makeVector(d, false) + } + return makeVector(d, 0) + } else if(type.indexOf('mat') === 0 && type.length === 4) { + var d = type.charCodeAt(type.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + type) + } + return makeVector(d*d, 0) + } else { + throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + type) } + } + } + + function storeProperty(obj, prop, type) { + if(typeof type === 'object') { + var child = processObject(type) + Object.defineProperty(obj, prop, { + get: identity(child), + set: makeSetter(type), + enumerable: true, + configurable: false + }) + } else { + if(locations[type]) { + Object.defineProperty(obj, prop, { + get: makeGetter(type), + set: makeSetter(type), + enumerable: true, + configurable: false + }) + } else { + obj[prop] = defaultValue(uniforms[type].type) } } + } - if (this._line || (this._line !== 0 && n === 1)) this._context.closePath(); - this._line = 1 - this._line; - this._x = this._y = null; - }, - point: function(x, y) { - this._x.push(+x); - this._y.push(+y); + function processObject(obj) { + var result + if(Array.isArray(obj)) { + result = new Array(obj.length) + for(var i=0; i= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i]; - b[n - 1] = (x[n] + a[n - 1]) / 2; - for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1]; - return [a, b]; + //Return data + var coallesced = coallesceUniforms(uniforms, true) + return { + get: identity(processObject(coallesced)), + set: makeSetter(coallesced), + enumerable: true, + configurable: true + } } -function natural(context) { - return new Natural(context); -} +},{"./GLError":243,"./reflect":246}],246:[function(_dereq_,module,exports){ +'use strict' -function Step(context, t) { - this._context = context; - this._t = t; -} +module.exports = makeReflectTypes -Step.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = this._y = NaN; - this._point = 0; - }, - lineEnd: function() { - if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); - if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); - if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; - }, - point: function(x, y) { - x = +x, y = +y; - switch (this._point) { - case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; - case 1: this._point = 2; // proceed - default: { - if (this._t <= 0) { - this._context.lineTo(this._x, y); - this._context.lineTo(x, y); +//Construct type info for reflection. +// +// This iterates over the flattened list of uniform type values and smashes them into a JSON object. +// +// The leaves of the resulting object are either indices or type strings representing primitive glslify types +function makeReflectTypes(uniforms, useIndex) { + var obj = {} + for(var i=0; i 1) { + if(!(x[0] in o)) { + o[x[0]] = [] + } + o = o[x[0]] + for(var k=1; k 1) { + for(var j=0; j 1)) return; - for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) { - s0 = s1, s1 = series[order[i]]; - for (j = 0; j < m; ++j) { - s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1]; +function runtimeAttributes(gl, program) { + var numAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES) + var result = [] + for(var i=0; i= 0) o[n] = n; - return o; -} +},{}],248:[function(_dereq_,module,exports){ +'use strict' -function stackValue(d, key) { - return d[key]; -} +exports.shader = getShaderReference +exports.program = createProgram -function stack() { - var keys = constant([]), - order = none$1, - offset = none, - value = stackValue; +var GLError = _dereq_("./GLError") +var formatCompilerError = _dereq_('gl-format-compiler-error'); - function stack(data) { - var kz = keys.apply(this, arguments), - i, - m = data.length, - n = kz.length, - sz = new Array(n), - oz; +var weakMap = typeof WeakMap === 'undefined' ? _dereq_('weakmap-shim') : WeakMap +var CACHE = new weakMap() - for (i = 0; i < n; ++i) { - for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) { - si[j] = sij = [0, +value(data[j], ki, j, data)]; - sij.data = data[j]; - } - si.key = ki; - } +var SHADER_COUNTER = 0 - for (i = 0, oz = order(sz); i < n; ++i) { - sz[oz[i]].index = i; - } +function ShaderReference(id, src, type, shader, programs, count, cache) { + this.id = id + this.src = src + this.type = type + this.shader = shader + this.count = count + this.programs = [] + this.cache = cache +} - offset(sz, oz); - return sz; - } +ShaderReference.prototype.dispose = function() { + if(--this.count === 0) { + var cache = this.cache + var gl = cache.gl - stack.keys = function(_) { - return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys; - }; + //Remove program references + var programs = this.programs + for(var i=0, n=programs.length; i 0)) return; - for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) { - for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0; - if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y; +function linkProgram(gl, vshader, fshader, attribs, locations) { + var program = gl.createProgram() + gl.attachShader(program, vshader) + gl.attachShader(program, fshader) + for(var i=0; i 0)) return; - for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) { - for (yp = yn = 0, i = 0; i < n; ++i) { - if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) { - d[0] = yp, d[1] = yp += dy; - } else if (dy < 0) { - d[1] = yn, d[0] = yn += dy; - } else { - d[0] = 0, d[1] = dy; - } - } +proto.getProgram = function(vref, fref, attribs, locations) { + var token = [vref.id, fref.id, attribs.join(':'), locations.join(':')].join('@') + var prog = this.programs[token] + if(!prog || !this.gl.isProgram(prog)) { + this.programs[token] = prog = linkProgram( + this.gl, + vref.shader, + fref.shader, + attribs, + locations) + vref.programs.push(token) + fref.programs.push(token) } + return prog } -function silhouette(series, order) { - if (!((n = series.length) > 0)) return; - for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) { - for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0; - s0[j][1] += s0[j][0] = -y / 2; +function getCache(gl) { + var ctxCache = CACHE.get(gl) + if(!ctxCache) { + ctxCache = new ContextCache(gl) + CACHE.set(gl, ctxCache) } - none(series, order); + return ctxCache } -function wiggle(series, order) { - if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return; - for (var y = 0, j = 1, s0, m, n; j < m; ++j) { - for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) { - var si = series[order[i]], - sij0 = si[j][1] || 0, - sij1 = si[j - 1][1] || 0, - s3 = (sij0 - sij1) / 2; - for (var k = 0; k < i; ++k) { - var sk = series[order[k]], - skj0 = sk[j][1] || 0, - skj1 = sk[j - 1][1] || 0; - s3 += skj0 - skj1; - } - s1 += sij0, s2 += s3 * sij0; +function getShaderReference(gl, type, src) { + return getCache(gl).getShaderReference(type, src) +} + +function createProgram(gl, vref, fref, attribs, locations) { + return getCache(gl).getProgram(vref, fref, attribs, locations) +} + +},{"./GLError":243,"gl-format-compiler-error":181,"weakmap-shim":486}],249:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createSpikes2D + +function GLSpikes2D(plot) { + this.plot = plot + this.enable = [true, true, false, false] + 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 = [Infinity, Infinity] +} + +var proto = GLSpikes2D.prototype + +proto.update = function(options) { + options = options || {} + this.enable = (options.enable || [true,true,false,false]).slice() + this.width = (options.width || [1,1,1,1]).slice() + this.color = (options.color || [ + [0,0,0,1], + [0,0,0,1], + [0,0,0,1], + [0,0,0,1]]).map(function(x) { return x.slice() }) + this.center = (options.center || [Infinity,Infinity]).slice() + this.plot.setOverlayDirty() +} + +proto.draw = function() { + var spikeEnable = this.enable + var spikeWidth = this.width + var spikeColor = this.color + var spikeCenter = this.center + var plot = this.plot + var line = plot.line + + var dataBox = plot.dataBox + var viewPixels = plot.viewBox + + line.bind() + + if(dataBox[0] <= spikeCenter[0] && spikeCenter[0] <= dataBox[2] && + dataBox[1] <= spikeCenter[1] && spikeCenter[1] <= dataBox[3]) { + + var centerX = viewPixels[0] + (spikeCenter[0] - dataBox[0]) / (dataBox[2] - dataBox[0]) * (viewPixels[2] - viewPixels[0]) + var centerY = viewPixels[1] + (spikeCenter[1] - dataBox[1]) / (dataBox[3] - dataBox[1]) * (viewPixels[3] - viewPixels[1]) + + if(spikeEnable[0]) { + line.drawLine( + centerX, centerY, + viewPixels[0], centerY, + spikeWidth[0], spikeColor[0]) + } + if(spikeEnable[1]) { + line.drawLine( + centerX, centerY, + centerX, viewPixels[1], + spikeWidth[1], spikeColor[1]) + } + if(spikeEnable[2]) { + line.drawLine( + centerX, centerY, + viewPixels[2], centerY, + spikeWidth[2], spikeColor[2]) + } + if(spikeEnable[3]) { + line.drawLine( + centerX, centerY, + centerX, viewPixels[3], + spikeWidth[3], spikeColor[3]) } - s0[j - 1][1] += s0[j - 1][0] = y; - if (s1) y -= s2 / s1; } - s0[j - 1][1] += s0[j - 1][0] = y; - none(series, order); } -function appearance(series) { - var peaks = series.map(peak); - return none$1(series).sort(function(a, b) { return peaks[a] - peaks[b]; }); +proto.dispose = function() { + this.plot.removeOverlay(this) } -function peak(series) { - var i = -1, j = 0, n = series.length, vi, vj = -Infinity; - while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i; - return j; +function createSpikes2D(plot, options) { + var spikes = new GLSpikes2D(plot) + spikes.update(options) + plot.addOverlay(spikes) + return spikes } -function ascending(series) { - var sums = series.map(sum); - return none$1(series).sort(function(a, b) { return sums[a] - sums[b]; }); +},{}],250:[function(_dereq_,module,exports){ +'use strict' + +var glslify = _dereq_('glslify') +var createShader = _dereq_('gl-shader') + +var vertSrc = glslify(["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"]) +var fragSrc = glslify(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]) + +module.exports = function(gl) { + return createShader(gl, vertSrc, fragSrc, null, [ + {name: 'position', type: 'vec3'}, + {name: 'color', type: 'vec3'}, + {name: 'weight', type: 'float'} + ]) } -function sum(series) { - var s = 0, i = -1, n = series.length, v; - while (++i < n) if (v = +series[i][1]) s += v; - return s; +},{"gl-shader":242,"glslify":342}],251:[function(_dereq_,module,exports){ +'use strict' + +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createShader = _dereq_('./shaders/index') + +module.exports = createSpikes + +var identity = [1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] + +function AxisSpikes(gl, buffer, vao, shader) { + this.gl = gl + this.buffer = buffer + this.vao = vao + this.shader = shader + this.pixelRatio = 1 + this.bounds = [[-1000,-1000,-1000], [1000,1000,1000]] + 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 = [true,true,true] + this.drawSides = [true,true,true] + this.axes = null } -function descending$1(series) { - return ascending(series).reverse(); +var proto = AxisSpikes.prototype + +var OUTER_FACE = [0,0,0] +var INNER_FACE = [0,0,0] + +var SHAPE = [0,0] + +proto.isTransparent = function() { + return false } -function insideOut(series) { - var n = series.length, - i, - j, - sums = series.map(sum), - order = appearance(series), - top = 0, - bottom = 0, - tops = [], - bottoms = []; +proto.drawTransparent = function(camera) {} - for (i = 0; i < n; ++i) { - j = order[i]; - if (top < bottom) { - top += sums[j]; - tops.push(j); +proto.draw = function(camera) { + var gl = this.gl + var vao = this.vao + var shader = this.shader + + vao.bind() + shader.bind() + + var model = camera.model || identity + var view = camera.view || identity + var projection = camera.projection || identity + + var axis + if(this.axes) { + axis = this.axes.lastCubeProps.axis + } + + var outerFace = OUTER_FACE + var innerFace = INNER_FACE + for(var i=0; i<3; ++i) { + if(axis && axis[i] < 0) { + outerFace[i] = this.bounds[0][i] + innerFace[i] = this.bounds[1][i] } else { - bottom += sums[j]; - bottoms.push(j); + outerFace[i] = this.bounds[1][i] + innerFace[i] = this.bounds[0][i] } } - return bottoms.reverse().concat(tops); + SHAPE[0] = gl.drawingBufferWidth + SHAPE[1] = gl.drawingBufferHeight + + shader.uniforms.model = model + shader.uniforms.view = view + shader.uniforms.projection = projection + shader.uniforms.coordinates = [this.position, outerFace, innerFace] + shader.uniforms.colors = this.colors + shader.uniforms.screenShape = SHAPE + + for(var i=0; i<3; ++i) { + shader.uniforms.lineWidth = this.lineWidth[i] * this.pixelRatio + if(this.enabled[i]) { + vao.draw(gl.TRIANGLES, 6, 6*i) + if(this.drawSides[i]) { + vao.draw(gl.TRIANGLES, 12, 18+12*i) + } + } + } + + vao.unbind() } -function reverse(series) { - return none$1(series).reverse(); +proto.update = function(options) { + if(!options) { + return + } + if("bounds" in options) { + this.bounds = options.bounds + } + if("position" in options) { + this.position = options.position + } + if("lineWidth" in options) { + this.lineWidth = options.lineWidth + } + if("colors" in options) { + this.colors = options.colors + } + if("enabled" in options) { + this.enabled = options.enabled + } + if("drawSides" in options) { + this.drawSides = options.drawSides + } } -exports.arc = arc; -exports.area = area; -exports.areaRadial = areaRadial; -exports.curveBasis = basis; -exports.curveBasisClosed = basisClosed; -exports.curveBasisOpen = basisOpen; -exports.curveBundle = bundle; -exports.curveCardinal = cardinal; -exports.curveCardinalClosed = cardinalClosed; -exports.curveCardinalOpen = cardinalOpen; -exports.curveCatmullRom = catmullRom; -exports.curveCatmullRomClosed = catmullRomClosed; -exports.curveCatmullRomOpen = catmullRomOpen; -exports.curveLinear = curveLinear; -exports.curveLinearClosed = linearClosed; -exports.curveMonotoneX = monotoneX; -exports.curveMonotoneY = monotoneY; -exports.curveNatural = natural; -exports.curveStep = step; -exports.curveStepAfter = stepAfter; -exports.curveStepBefore = stepBefore; -exports.line = line; -exports.lineRadial = lineRadial$1; -exports.linkHorizontal = linkHorizontal; -exports.linkRadial = linkRadial; -exports.linkVertical = linkVertical; -exports.pie = pie; -exports.pointRadial = pointRadial; -exports.radialArea = areaRadial; -exports.radialLine = lineRadial$1; -exports.stack = stack; -exports.stackOffsetDiverging = diverging; -exports.stackOffsetExpand = expand; -exports.stackOffsetNone = none; -exports.stackOffsetSilhouette = silhouette; -exports.stackOffsetWiggle = wiggle; -exports.stackOrderAppearance = appearance; -exports.stackOrderAscending = ascending; -exports.stackOrderDescending = descending$1; -exports.stackOrderInsideOut = insideOut; -exports.stackOrderNone = none$1; -exports.stackOrderReverse = reverse; -exports.symbol = symbol; -exports.symbolCircle = circle; -exports.symbolCross = cross; -exports.symbolDiamond = diamond; -exports.symbolSquare = square; -exports.symbolStar = star; -exports.symbolTriangle = triangle; -exports.symbolWye = wye; -exports.symbols = symbols; +proto.dispose = function() { + this.vao.dispose() + this.buffer.dispose() + this.shader.dispose() +} -Object.defineProperty(exports, '__esModule', { value: true }); -})); -},{"d3-path":73}],76:[function(_dereq_,module,exports){ -// https://d3js.org/d3-time-format/ v2.2.3 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, _dereq_('d3-time')) : -typeof define === 'function' && define.amd ? define(['exports', 'd3-time'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {}, global.d3)); -}(this, function (exports, d3Time) { 'use strict'; +function createSpikes(gl, options) { + //Create buffers + var data = [ ] -function localDate(d) { - if (0 <= d.y && d.y < 100) { - var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); - date.setFullYear(d.y); - return date; + function line(x,y,z,i,l,h) { + var row = [x,y,z, 0,0,0, 1] + row[i+3] = 1 + row[i] = l + data.push.apply(data, row) + row[6] = -1 + data.push.apply(data, row) + row[i] = h + data.push.apply(data, row) + data.push.apply(data, row) + row[6] = 1 + data.push.apply(data, row) + row[i] = l + data.push.apply(data, row) } - return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); -} -function utcDate(d) { - if (0 <= d.y && d.y < 100) { - var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); - date.setUTCFullYear(d.y); - return date; + line(0,0,0, 0, 0, 1) + line(0,0,0, 1, 0, 1) + line(0,0,0, 2, 0, 1) + + line(1,0,0, 1, -1,1) + line(1,0,0, 2, -1,1) + + line(0,1,0, 0, -1,1) + line(0,1,0, 2, -1,1) + + line(0,0,1, 0, -1,1) + line(0,0,1, 1, -1,1) + + var buffer = createBuffer(gl, data) + var vao = createVAO(gl, [{ + type: gl.FLOAT, + buffer: buffer, + size: 3, + offset: 0, + stride: 28 + }, { + type: gl.FLOAT, + buffer: buffer, + size: 3, + offset: 12, + stride: 28 + }, { + type: gl.FLOAT, + buffer: buffer, + size: 1, + offset: 24, + stride: 28 + }]) + + //Create shader + var shader = createShader(gl) + shader.attributes.position.location = 0 + shader.attributes.color.location = 1 + shader.attributes.weight.location = 2 + + //Create spike object + var spikes = new AxisSpikes(gl, buffer, vao, shader) + + //Set parameters + spikes.update(options) + + //Return resulting object + return spikes +} + +},{"./shaders/index":250,"gl-buffer":171,"gl-vao":261}],252:[function(_dereq_,module,exports){ +var glslify = _dereq_('glslify') + +var triVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) +var triFragSrc = glslify(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]) +var pickVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]) +var pickFragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]) + +exports.meshShader = { + vertex: triVertSrc, + fragment: triFragSrc, + attributes: [ + {name: 'position', type: 'vec4'}, + {name: 'color', type: 'vec4'}, + {name: 'uv', type: 'vec2'}, + {name: 'vector', type: 'vec4'} + ] +} +exports.pickShader = { + vertex: pickVertSrc, + fragment: pickFragSrc, + attributes: [ + {name: 'position', type: 'vec4'}, + {name: 'id', type: 'vec4'}, + {name: 'vector', type: 'vec4'} + ] +} + +},{"glslify":253}],253:[function(_dereq_,module,exports){ +arguments[4][178][0].apply(exports,arguments) +},{"dup":178}],254:[function(_dereq_,module,exports){ +"use strict"; + +var vec3 = _dereq_('gl-vec3'); +var vec4 = _dereq_('gl-vec4'); +var GRID_TYPES = ['xyz', 'xzy', 'yxz', 'yzx', 'zxy', 'zyx']; + +var streamToTube = function(stream, maxDivergence, minDistance, maxNorm) { + var points = stream.points; + var velocities = stream.velocities; + var divergences = stream.divergences; + + var verts = []; + var faces = []; + var vectors = []; + var previousVerts = []; + var currentVerts = []; + var intensities = []; + var previousIntensity = 0; + var currentIntensity = 0; + var currentVector = vec4.create(); + var previousVector = vec4.create(); + + var facets = 8; + + for (var i = 0; i < points.length; i++) { + var p = points[i]; + var fwd = velocities[i]; + var r = divergences[i]; + if (maxDivergence === 0) { + r = minDistance * 0.05; + } + currentIntensity = vec3.length(fwd) / maxNorm; + + currentVector = vec4.create(); + vec3.copy(currentVector, fwd); + currentVector[3] = r; + + for (var a = 0; a < facets; a++) { + currentVerts[a] = [p[0], p[1], p[2], a]; + } + if (previousVerts.length > 0) { + for (var a = 0; a < facets; a++) { + var a1 = (a+1) % facets; + verts.push( + previousVerts[a], + currentVerts[a], + currentVerts[a1], + + currentVerts[a1], + previousVerts[a1], + previousVerts[a] + ); + vectors.push( + previousVector, + currentVector, + currentVector, + + currentVector, + previousVector, + previousVector + ); + intensities.push( + previousIntensity, + currentIntensity, + currentIntensity, + + currentIntensity, + previousIntensity, + previousIntensity + ); + + var len = verts.length; + faces.push( + [len-6, len-5, len-4], + [len-3, len-2, len-1] + ); + } + } + var tmp1 = previousVerts; + previousVerts = currentVerts; + currentVerts = tmp1; + + var tmp2 = previousVector; + previousVector = currentVector; + currentVector = tmp2; + + var tmp3 = previousIntensity; + previousIntensity = currentIntensity; + currentIntensity = tmp3; + } + return { + positions: verts, + cells: faces, + vectors: vectors, + vertexIntensity: intensities + }; +}; + +var createTubes = function(streams, colormap, maxDivergence, minDistance) { + + var maxNorm = 0; + for (var i=0; i v) return i-1; } - return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); -} + return i; +}; -function newDate(y, m, d) { - return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0}; +var clamp = function(v, min, max) { + return v < min ? min : (v > max ? max : v); +}; + +var sampleMeshgrid = function(point, vectorField, gridInfo) { + var vectors = vectorField.vectors; + var meshgrid = vectorField.meshgrid; + + var x = point[0]; + var y = point[1]; + var z = point[2]; + + var w = meshgrid[0].length; + var h = meshgrid[1].length; + var d = meshgrid[2].length; + + // Find the index of the nearest smaller value in the meshgrid for each coordinate of (x,y,z). + // The nearest smaller value index for x is the index x0 such that + // meshgrid[0][x0] < x and for all x1 > x0, meshgrid[0][x1] >= x. + var x0 = findLastSmallerIndex(meshgrid[0], x); + var y0 = findLastSmallerIndex(meshgrid[1], y); + var z0 = findLastSmallerIndex(meshgrid[2], z); + + // Get the nearest larger meshgrid value indices. + // From the above "nearest smaller value", we know that + // meshgrid[0][x0] < x + // meshgrid[0][x0+1] >= x + var x1 = x0 + 1; + var y1 = y0 + 1; + var z1 = z0 + 1; + + x0 = clamp(x0, 0, w-1); + x1 = clamp(x1, 0, w-1); + y0 = clamp(y0, 0, h-1); + y1 = clamp(y1, 0, h-1); + z0 = clamp(z0, 0, d-1); + z1 = clamp(z1, 0, d-1); + + // Reject points outside the meshgrid, return a zero vector. + if (x0 < 0 || y0 < 0 || z0 < 0 || x1 > w-1 || y1 > h-1 || z1 > d-1) { + return vec3.create(); + } + + // Normalize point coordinates to 0..1 scaling factor between x0 and x1. + var mX0 = meshgrid[0][x0]; + var mX1 = meshgrid[0][x1]; + var mY0 = meshgrid[1][y0]; + var mY1 = meshgrid[1][y1]; + var mZ0 = meshgrid[2][z0]; + var mZ1 = meshgrid[2][z1]; + var xf = (x - mX0) / (mX1 - mX0); + var yf = (y - mY0) / (mY1 - mY0); + var zf = (z - mZ0) / (mZ1 - mZ0); + + if (!isFinite(xf)) xf = 0.5; + if (!isFinite(yf)) yf = 0.5; + if (!isFinite(zf)) zf = 0.5; + + var x0off; + var x1off; + var y0off; + var y1off; + var z0off; + var z1off; + + if(gridInfo.reversedX) { + x0 = w - 1 - x0; + x1 = w - 1 - x1; + } + + if(gridInfo.reversedY) { + y0 = h - 1 - y0; + y1 = h - 1 - y1; + } + + if(gridInfo.reversedZ) { + z0 = d - 1 - z0; + z1 = d - 1 - z1; + } + + switch(gridInfo.filled) { + case 5: // 'zyx' + z0off = z0; + z1off = z1; + y0off = y0*d; + y1off = y1*d; + x0off = x0*d*h; + x1off = x1*d*h; + break; + + case 4: // 'zxy' + z0off = z0; + z1off = z1; + x0off = x0*d; + x1off = x1*d; + y0off = y0*d*w; + y1off = y1*d*w; + break; + + case 3: // 'yzx' + y0off = y0; + y1off = y1; + z0off = z0*h; + z1off = z1*h; + x0off = x0*h*d; + x1off = x1*h*d; + break; + + case 2: // 'yxz' + y0off = y0; + y1off = y1; + x0off = x0*h; + x1off = x1*h; + z0off = z0*h*w; + z1off = z1*h*w; + break; + + case 1: // 'xzy' + x0off = x0; + x1off = x1; + z0off = z0*w; + z1off = z1*w; + y0off = y0*w*d; + y1off = y1*w*d; + break; + + default: // case 0: // 'xyz' + x0off = x0; + x1off = x1; + y0off = y0*w; + y1off = y1*w; + z0off = z0*w*h; + z1off = z1*w*h; + break; + } + + // Sample data vectors around the (x,y,z) point. + var v000 = vectors[x0off + y0off + z0off]; + var v001 = vectors[x0off + y0off + z1off]; + var v010 = vectors[x0off + y1off + z0off]; + var v011 = vectors[x0off + y1off + z1off]; + var v100 = vectors[x1off + y0off + z0off]; + var v101 = vectors[x1off + y0off + z1off]; + var v110 = vectors[x1off + y1off + z0off]; + var v111 = vectors[x1off + y1off + z1off]; + + var c00 = vec3.create(); + var c01 = vec3.create(); + var c10 = vec3.create(); + var c11 = vec3.create(); + + vec3.lerp(c00, v000, v100, xf); + vec3.lerp(c01, v001, v101, xf); + vec3.lerp(c10, v010, v110, xf); + vec3.lerp(c11, v011, v111, xf); + + var c0 = vec3.create(); + var c1 = vec3.create(); + + vec3.lerp(c0, c00, c10, yf); + vec3.lerp(c1, c01, c11, yf); + + var c = vec3.create(); + + vec3.lerp(c, c0, c1, zf); + + return c; +}; + + +var vabs = function(dst, v) { + var x = v[0]; + var y = v[1]; + var z = v[2]; + dst[0] = x < 0 ? -x : x; + dst[1] = y < 0 ? -y : y; + dst[2] = z < 0 ? -z : z; + return dst; +}; + +var findMinSeparation = function(xs) { + var minSeparation = Infinity; + xs.sort(function(a, b) { return a - b; }); + var len = xs.length; + for (var i=1; i maxX || + y < minY || y > maxY || + z < minZ || z > maxZ + ); + }; + + var boundsSize = vec3.distance(bounds[0], bounds[1]); + var maxStepSize = 10 * boundsSize / maxLength; + var maxStepSizeSq = maxStepSize * maxStepSize; + + var minDistance = 1; + var maxDivergence = 0; // For component-wise divergence vec3.create(); + + // In case we need to do component-wise divergence visualization + // var tmp = vec3.create(); + + var len = positions.length; + if (len > 1) { + minDistance = calculateMinPositionDistance(positions); + } + + for (var i = 0; i < len; i++) { + var p = vec3.create(); + vec3.copy(p, positions[i]); + + var stream = [p]; + var velocities = []; + var v = getVelocity(p); + var op = p; + velocities.push(v); + + var divergences = []; + + var dv = getDivergence(p, v); + var dvLength = vec3.length(dv); + if (isFinite(dvLength) && dvLength > maxDivergence) { + maxDivergence = dvLength; + } + // In case we need to do component-wise divergence visualization + // vec3.max(maxDivergence, maxDivergence, vabs(tmp, dv)); + divergences.push(dvLength); + + streams.push({points: stream, velocities: velocities, divergences: divergences}); + + var j = 0; + + while (j < maxLength * 100 && stream.length < maxLength && inBounds(p)) { + j++; + var np = vec3.clone(v); + var sqLen = vec3.squaredLength(np); + if (sqLen === 0) { + break; + } else if (sqLen > maxStepSizeSq) { + vec3.scale(np, np, maxStepSize / Math.sqrt(sqLen)); + } + vec3.add(np, np, p); + + v = getVelocity(np); + + if (vec3.squaredDistance(op, np) - maxStepSizeSq > -0.0001 * maxStepSizeSq) { + stream.push(np); + op = np; + velocities.push(v); + var dv = getDivergence(np, v); + var dvLength = vec3.length(dv); + if (isFinite(dvLength) && dvLength > maxDivergence) { + maxDivergence = dvLength; + } + // In case we need to do component-wise divergence visualization + //vec3.max(maxDivergence, maxDivergence, vabs(tmp, dv)); + divergences.push(dvLength); + } + + p = np; + } + } + + var tubes = createTubes(streams, vectorField.colormap, maxDivergence, minDistance); + + if (absoluteTubeSize) { + tubes.tubeScale = absoluteTubeSize; + } else { + // Avoid division by zero. + if (maxDivergence === 0) { + maxDivergence = 1; + } + tubes.tubeScale = tubeSize * 0.5 * minDistance / maxDivergence; + } + + return tubes; +}; + +var shaders = _dereq_('./lib/shaders'); +var createMesh = _dereq_('gl-cone3d').createMesh; +module.exports.createTubeMesh = function(gl, params) { + return createMesh(gl, params, { + shaders: shaders, + traceType: 'streamtube' + }); } -function formatLocale(locale) { - var locale_dateTime = locale.dateTime, - locale_date = locale.date, - locale_time = locale.time, - locale_periods = locale.periods, - locale_weekdays = locale.days, - locale_shortWeekdays = locale.shortDays, - locale_months = locale.months, - locale_shortMonths = locale.shortMonths; +},{"./lib/shaders":252,"gl-cone3d":172,"gl-vec3":280,"gl-vec4":316}],255:[function(_dereq_,module,exports){ +var createShader = _dereq_('gl-shader') +var glslify = _dereq_('glslify') + +var vertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]) +var fragSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]) +var contourVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]) +var pickSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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"]) + +exports.createShader = function (gl) { + var shader = createShader(gl, vertSrc, fragSrc, null, [ + {name: 'uv', type: 'vec4'}, + {name: 'f', type: 'vec3'}, + {name: 'normal', type: 'vec3'} + ]) + shader.attributes.uv.location = 0 + shader.attributes.f.location = 1 + shader.attributes.normal.location = 2 + return shader +} +exports.createPickShader = function (gl) { + var shader = createShader(gl, vertSrc, pickSrc, null, [ + {name: 'uv', type: 'vec4'}, + {name: 'f', type: 'vec3'}, + {name: 'normal', type: 'vec3'} + ]) + shader.attributes.uv.location = 0 + shader.attributes.f.location = 1 + shader.attributes.normal.location = 2 + return shader +} +exports.createContourShader = function (gl) { + var shader = createShader(gl, contourVertSrc, fragSrc, null, [ + {name: 'uv', type: 'vec4'}, + {name: 'f', type: 'float'} + ]) + shader.attributes.uv.location = 0 + shader.attributes.f.location = 1 + return shader +} +exports.createPickContourShader = function (gl) { + var shader = createShader(gl, contourVertSrc, pickSrc, null, [ + {name: 'uv', type: 'vec4'}, + {name: 'f', type: 'float'} + ]) + shader.attributes.uv.location = 0 + shader.attributes.f.location = 1 + return shader +} + +},{"gl-shader":242,"glslify":342}],256:[function(_dereq_,module,exports){ +'use strict' - var periodRe = formatRe(locale_periods), - periodLookup = formatLookup(locale_periods), - weekdayRe = formatRe(locale_weekdays), - weekdayLookup = formatLookup(locale_weekdays), - shortWeekdayRe = formatRe(locale_shortWeekdays), - shortWeekdayLookup = formatLookup(locale_shortWeekdays), - monthRe = formatRe(locale_months), - monthLookup = formatLookup(locale_months), - shortMonthRe = formatRe(locale_shortMonths), - shortMonthLookup = formatLookup(locale_shortMonths); +module.exports = createSurfacePlot + +var bits = _dereq_('bit-twiddle') +var createBuffer = _dereq_('gl-buffer') +var createVAO = _dereq_('gl-vao') +var createTexture = _dereq_('gl-texture2d') +var pool = _dereq_('typedarray-pool') +var colormap = _dereq_('colormap') +var ops = _dereq_('ndarray-ops') +var pack = _dereq_('ndarray-pack') +var ndarray = _dereq_('ndarray') +var surfaceNets = _dereq_('surface-nets') +var multiply = _dereq_('gl-mat4/multiply') +var invert = _dereq_('gl-mat4/invert') +var bsearch = _dereq_('binary-search-bounds') +var gradient = _dereq_('ndarray-gradient') +var shaders = _dereq_('./lib/shaders') + +var createShader = shaders.createShader +var createContourShader = shaders.createContourShader +var createPickShader = shaders.createPickShader +var createPickContourShader = shaders.createPickContourShader + +var SURFACE_VERTEX_SIZE = 4 * (4 + 3 + 3) + +var IDENTITY = [ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 ] + +var QUAD = [ + [0, 0], + [0, 1], + [1, 0], + [1, 1], + [1, 0], + [0, 1] +] + +var PERMUTATIONS = [ + [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 i = 0; i < 3; ++i) { + var p = PERMUTATIONS[i] + var u = (i + 1) % 3 + var v = (i + 2) % 3 + p[u + 0] = 1 + p[v + 3] = 1 + p[i + 6] = 1 + } +})() + +function SurfacePickResult (position, index, uv, level, dataCoordinate) { + this.position = position + this.index = index + this.uv = uv + this.level = level + this.dataCoordinate = dataCoordinate +} + +var N_COLORS = 256 + +function SurfacePlot ( + gl, + shape, + bounds, + shader, + pickShader, + coordinates, + vao, + colorMap, + contourShader, + contourPickShader, + contourBuffer, + contourVAO, + dynamicBuffer, + dynamicVAO, + objectOffset) { + this.gl = gl + this.shape = shape + this.bounds = bounds + this.objectOffset = objectOffset + this.intensityBounds = [] + + this._shader = shader + this._pickShader = pickShader + this._coordinateBuffer = coordinates + this._vao = vao + this._colorMap = colorMap + + this._contourShader = contourShader + this._contourPickShader = contourPickShader + this._contourBuffer = contourBuffer + this._contourVAO = contourVAO + this._contourOffsets = [[], [], []] + this._contourCounts = [[], [], []] + this._vertexCount = 0 + + this._pickResult = new SurfacePickResult([0, 0, 0], [0, 0], [0, 0], [0, 0, 0], [0, 0, 0]) + + this._dynamicBuffer = dynamicBuffer + this._dynamicVAO = dynamicVAO + 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 = [[0.5, 0.5, 0.5, 1], [0.5, 0.5, 0.5, 1], [0.5, 0.5, 0.5, 1]] + + this.showContour = true + this.showSurface = true + + this.enableHighlight = [true, true, true] + this.highlightColor = [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]] + this.highlightTint = [ 1, 1, 1 ] + this.highlightLevel = [-1, -1, -1] + + // Dynamic contour options + this.enableDynamic = [ true, true, true ] + 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 = [[Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]] + this.surfaceProject = [ false, false, false ] + this.contourProject = [[ false, false, false ], + [ false, false, false ], + [ false, false, false ]] - var formats = { - "a": formatShortWeekday, - "A": formatWeekday, - "b": formatShortMonth, - "B": formatMonth, - "c": null, - "d": formatDayOfMonth, - "e": formatDayOfMonth, - "f": formatMicroseconds, - "H": formatHour24, - "I": formatHour12, - "j": formatDayOfYear, - "L": formatMilliseconds, - "m": formatMonthNumber, - "M": formatMinutes, - "p": formatPeriod, - "q": formatQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatSeconds, - "u": formatWeekdayNumberMonday, - "U": formatWeekNumberSunday, - "V": formatWeekNumberISO, - "w": formatWeekdayNumberSunday, - "W": formatWeekNumberMonday, - "x": null, - "X": null, - "y": formatYear, - "Y": formatFullYear, - "Z": formatZone, - "%": formatLiteralPercent - }; + this.colorBounds = [ false, false ] - var utcFormats = { - "a": formatUTCShortWeekday, - "A": formatUTCWeekday, - "b": formatUTCShortMonth, - "B": formatUTCMonth, - "c": null, - "d": formatUTCDayOfMonth, - "e": formatUTCDayOfMonth, - "f": formatUTCMicroseconds, - "H": formatUTCHour24, - "I": formatUTCHour12, - "j": formatUTCDayOfYear, - "L": formatUTCMilliseconds, - "m": formatUTCMonthNumber, - "M": formatUTCMinutes, - "p": formatUTCPeriod, - "q": formatUTCQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatUTCSeconds, - "u": formatUTCWeekdayNumberMonday, - "U": formatUTCWeekNumberSunday, - "V": formatUTCWeekNumberISO, - "w": formatUTCWeekdayNumberSunday, - "W": formatUTCWeekNumberMonday, - "x": null, - "X": null, - "y": formatUTCYear, - "Y": formatUTCFullYear, - "Z": formatUTCZone, - "%": formatLiteralPercent - }; + // Store xyz fields, need this for picking + this._field = [ + ndarray(pool.mallocFloat(1024), [0, 0]), + ndarray(pool.mallocFloat(1024), [0, 0]), + ndarray(pool.mallocFloat(1024), [0, 0]) ] - var parses = { - "a": parseShortWeekday, - "A": parseWeekday, - "b": parseShortMonth, - "B": parseMonth, - "c": parseLocaleDateTime, - "d": parseDayOfMonth, - "e": parseDayOfMonth, - "f": parseMicroseconds, - "H": parseHour24, - "I": parseHour24, - "j": parseDayOfYear, - "L": parseMilliseconds, - "m": parseMonthNumber, - "M": parseMinutes, - "p": parsePeriod, - "q": parseQuarter, - "Q": parseUnixTimestamp, - "s": parseUnixTimestampSeconds, - "S": parseSeconds, - "u": parseWeekdayNumberMonday, - "U": parseWeekNumberSunday, - "V": parseWeekNumberISO, - "w": parseWeekdayNumberSunday, - "W": parseWeekNumberMonday, - "x": parseLocaleDate, - "X": parseLocaleTime, - "y": parseYear, - "Y": parseFullYear, - "Z": parseZone, - "%": parseLiteralPercent - }; + this.pickId = 1 + this.clipBounds = [[-Infinity, -Infinity, -Infinity], [Infinity, Infinity, Infinity]] + + this.snapToData = false + + this.pixelRatio = 1 + + this.opacity = 1.0 + + this.lightPosition = [10, 10000, 0] + this.ambientLight = 0.8 + this.diffuseLight = 0.8 + this.specularLight = 2.0 + this.roughness = 0.5 + this.fresnel = 1.5 + this.vertexColor = 0 + + this.dirty = true +} + +var proto = SurfacePlot.prototype + +proto.genColormap = function (name, opacityscale) { + var hasAlpha = false + + var x = pack([colormap({ + colormap: name, + nshades: N_COLORS, + format: 'rgba' + }).map(function (c, i) { + var a = opacityscale ? getOpacityFromScale(i / 255.0, opacityscale) : c[3] + if(a < 1) hasAlpha = true + return [c[0], c[1], c[2], 255 * a] + })]) + ops.divseq(x, 255.0) + + this.hasAlphaScale = hasAlpha + return x +} - // These recursive directive definitions must be deferred. - formats.x = newFormat(locale_date, formats); - formats.X = newFormat(locale_time, formats); - formats.c = newFormat(locale_dateTime, formats); - utcFormats.x = newFormat(locale_date, utcFormats); - utcFormats.X = newFormat(locale_time, utcFormats); - utcFormats.c = newFormat(locale_dateTime, utcFormats); +proto.isTransparent = function () { + return this.opacity < 1 || this.hasAlphaScale +} - function newFormat(specifier, formats) { - return function(date) { - var string = [], - i = -1, - j = 0, - n = specifier.length, - c, - pad, - format; +proto.isOpaque = function () { + return !this.isTransparent() +} - if (!(date instanceof Date)) date = new Date(+date); +proto.pickSlots = 1 - while (++i < n) { - if (specifier.charCodeAt(i) === 37) { - string.push(specifier.slice(j, i)); - if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i); - else pad = c === "e" ? " " : "0"; - if (format = formats[c]) c = format(date, pad); - string.push(c); - j = i + 1; - } - } +proto.setPickBase = function (id) { + this.pickId = id +} - string.push(specifier.slice(j, i)); - return string.join(""); - }; - } +function getOpacityFromScale(ratio, opacityscale) { // copied form gl-mesh3d + if(!opacityscale) return 1 + if(!opacityscale.length) return 1 - function newParse(specifier, Z) { - return function(string) { - var d = newDate(1900, undefined, 1), - i = parseSpecifier(d, specifier, string += "", 0), - week, day; - if (i != string.length) return null; + for(var i = 0; i < opacityscale.length; ++i) { + if(opacityscale.length < 2) return 1 + if(opacityscale[i][0] === ratio) return opacityscale[i][1] + if(opacityscale[i][0] > ratio && i > 0) { + var d = (opacityscale[i][0] - ratio) / (opacityscale[i][0] - opacityscale[i - 1][0]) + return opacityscale[i][1] * (1 - d) + d * opacityscale[i - 1][1] + } + } - // If a UNIX timestamp is specified, return it. - if ("Q" in d) return new Date(d.Q); - if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0)); + return 1 +} - // If this is utcParse, never use the local timezone. - if (Z && !("Z" in d)) d.Z = 0; +var ZERO_VEC = [0, 0, 0] - // The am-pm flag is 0 for AM, and 1 for PM. - if ("p" in d) d.H = d.H % 12 + d.p * 12; +var PROJECT_DATA = { + showSurface: false, + showContour: false, + projections: [IDENTITY.slice(), IDENTITY.slice(), IDENTITY.slice()], + clipBounds: [ + [[0, 0, 0], [0, 0, 0]], + [[0, 0, 0], [0, 0, 0]], + [[0, 0, 0], [0, 0, 0]]] +} - // If the month was not specified, inherit from the quarter. - if (d.m === undefined) d.m = "q" in d ? d.q : 0; +function computeProjectionData (camera, obj) { + var i, j, k - // Convert day-of-week and week-of-year to day-of-year. - if ("V" in d) { - if (d.V < 1 || d.V > 53) return null; - if (!("w" in d)) d.w = 1; - if ("Z" in d) { - week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); - week = day > 4 || day === 0 ? d3Time.utcMonday.ceil(week) : d3Time.utcMonday(week); - week = d3Time.utcDay.offset(week, (d.V - 1) * 7); - d.y = week.getUTCFullYear(); - d.m = week.getUTCMonth(); - d.d = week.getUTCDate() + (d.w + 6) % 7; - } else { - week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); - week = day > 4 || day === 0 ? d3Time.timeMonday.ceil(week) : d3Time.timeMonday(week); - week = d3Time.timeDay.offset(week, (d.V - 1) * 7); - d.y = week.getFullYear(); - d.m = week.getMonth(); - d.d = week.getDate() + (d.w + 6) % 7; - } - } else if ("W" in d || "U" in d) { - if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; - day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); - d.m = 0; - d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; - } + // Compute cube properties + var cubeAxis = (obj.axes && obj.axes.lastCubeProps.axis) || ZERO_VEC - // If a time zone is specified, all fields are interpreted as UTC and then - // offset according to the specified time zone. - if ("Z" in d) { - d.H += d.Z / 100 | 0; - d.M += d.Z % 100; - return utcDate(d); - } + var showSurface = obj.showSurface + var showContour = obj.showContour - // Otherwise, all fields are in local time. - return localDate(d); - }; + for (i = 0; i < 3; ++i) { + showSurface = showSurface || obj.surfaceProject[i] + for (j = 0; j < 3; ++j) { + showContour = showContour || obj.contourProject[i][j] + } } - function parseSpecifier(d, specifier, string, j) { - var i = 0, - n = specifier.length, - m = string.length, - c, - parse; + for (i = 0; i < 3; ++i) { + // Construct projection onto axis + var axisSquish = PROJECT_DATA.projections[i] + for (j = 0; j < 16; ++j) { + axisSquish[j] = 0 + } + for (j = 0; j < 4; ++j) { + axisSquish[5 * j] = 1 + } + axisSquish[5 * i] = 0 + axisSquish[12 + i] = obj.axesBounds[+(cubeAxis[i] > 0)][i] + multiply(axisSquish, camera.model, axisSquish) - while (i < n) { - if (j >= m) return -1; - c = specifier.charCodeAt(i++); - if (c === 37) { - c = specifier.charAt(i++); - parse = parses[c in pads ? specifier.charAt(i++) : c]; - if (!parse || ((j = parse(d, string, j)) < 0)) return -1; - } else if (c != string.charCodeAt(j++)) { - return -1; + var nclipBounds = PROJECT_DATA.clipBounds[i] + for (k = 0; k < 2; ++k) { + for (j = 0; j < 3; ++j) { + nclipBounds[k][j] = camera.clipBounds[k][j] } } - - return j; + nclipBounds[0][i] = -1e8 + nclipBounds[1][i] = 1e8 } - function parsePeriod(d, string, i) { - var n = periodRe.exec(string.slice(i)); - return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } + PROJECT_DATA.showSurface = showSurface + PROJECT_DATA.showContour = showContour - function parseShortWeekday(d, string, i) { - var n = shortWeekdayRe.exec(string.slice(i)); - return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } + return PROJECT_DATA +} - function parseWeekday(d, string, i) { - var n = weekdayRe.exec(string.slice(i)); - return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } +var UNIFORMS = { + model: IDENTITY, + view: IDENTITY, + projection: IDENTITY, + inverseModel: IDENTITY.slice(), + lowerBound: [0, 0, 0], + upperBound: [0, 0, 0], + colorMap: 0, + clipBounds: [[0, 0, 0], [0, 0, 0]], + height: 0.0, + contourTint: 0, + contourColor: [0, 0, 0, 1], + permutation: [1, 0, 0, 0, 1, 0, 0, 0, 1], + zOffset: -1e-4, + objectOffset: [0, 0, 0], + kambient: 1, + kdiffuse: 1, + kspecular: 1, + lightPosition: [1000, 1000, 1000], + eyePosition: [0, 0, 0], + roughness: 1, + fresnel: 1, + opacity: 1, + vertexColor: 0 +} - function parseShortMonth(d, string, i) { - var n = shortMonthRe.exec(string.slice(i)); - return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } +var MATRIX_INVERSE = IDENTITY.slice() +var DEFAULT_PERM = [1, 0, 0, 0, 1, 0, 0, 0, 1] - function parseMonth(d, string, i) { - var n = monthRe.exec(string.slice(i)); - return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } +function drawCore (params, transparent) { + params = params || {} + var gl = this.gl - function parseLocaleDateTime(d, string, i) { - return parseSpecifier(d, locale_dateTime, string, i); - } + gl.disable(gl.CULL_FACE) - function parseLocaleDate(d, string, i) { - return parseSpecifier(d, locale_date, string, i); - } + this._colorMap.bind(0) - function parseLocaleTime(d, string, i) { - return parseSpecifier(d, locale_time, string, i); - } + var uniforms = UNIFORMS + uniforms.model = params.model || IDENTITY + uniforms.view = params.view || IDENTITY + uniforms.projection = params.projection || IDENTITY + uniforms.lowerBound = [this.bounds[0][0], this.bounds[0][1], this.colorBounds[0] || this.bounds[0][2]] + uniforms.upperBound = [this.bounds[1][0], this.bounds[1][1], this.colorBounds[1] || this.bounds[1][2]] + uniforms.objectOffset = this.objectOffset + uniforms.contourColor = this.contourColor[0] - function formatShortWeekday(d) { - return locale_shortWeekdays[d.getDay()]; - } + uniforms.inverseModel = invert(uniforms.inverseModel, uniforms.model) - function formatWeekday(d) { - return locale_weekdays[d.getDay()]; + for (var i = 0; i < 2; ++i) { + var clipClamped = uniforms.clipBounds[i] + for (var j = 0; j < 3; ++j) { + clipClamped[j] = Math.min(Math.max(this.clipBounds[i][j], -1e8), 1e8) + } } - function formatShortMonth(d) { - return locale_shortMonths[d.getMonth()]; - } + uniforms.kambient = this.ambientLight + uniforms.kdiffuse = this.diffuseLight + uniforms.kspecular = this.specularLight - function formatMonth(d) { - return locale_months[d.getMonth()]; - } + uniforms.roughness = this.roughness + uniforms.fresnel = this.fresnel + uniforms.opacity = this.opacity - function formatPeriod(d) { - return locale_periods[+(d.getHours() >= 12)]; - } + uniforms.height = 0.0 + uniforms.permutation = DEFAULT_PERM - function formatQuarter(d) { - return 1 + ~~(d.getMonth() / 3); - } + uniforms.vertexColor = this.vertexColor - function formatUTCShortWeekday(d) { - return locale_shortWeekdays[d.getUTCDay()]; - } + // Compute camera matrix inverse + var invCameraMatrix = MATRIX_INVERSE + multiply(invCameraMatrix, uniforms.view, uniforms.model) + multiply(invCameraMatrix, uniforms.projection, invCameraMatrix) + invert(invCameraMatrix, invCameraMatrix) - function formatUTCWeekday(d) { - return locale_weekdays[d.getUTCDay()]; + for (i = 0; i < 3; ++i) { + uniforms.eyePosition[i] = invCameraMatrix[12 + i] / invCameraMatrix[15] } - function formatUTCShortMonth(d) { - return locale_shortMonths[d.getUTCMonth()]; + var w = invCameraMatrix[15] + for (i = 0; i < 3; ++i) { + w += this.lightPosition[i] * invCameraMatrix[4 * i + 3] } - - function formatUTCMonth(d) { - return locale_months[d.getUTCMonth()]; + for (i = 0; i < 3; ++i) { + var s = invCameraMatrix[12 + i] + for (j = 0; j < 3; ++j) { + s += invCameraMatrix[4 * j + i] * this.lightPosition[j] + } + uniforms.lightPosition[i] = s / w } - function formatUTCPeriod(d) { - return locale_periods[+(d.getUTCHours() >= 12)]; - } + var projectData = computeProjectionData(uniforms, this) - function formatUTCQuarter(d) { - return 1 + ~~(d.getUTCMonth() / 3); + if (projectData.showSurface) { + // Set up uniforms + this._shader.bind() + this._shader.uniforms = uniforms + + // Draw it + this._vao.bind() + + if (this.showSurface && this._vertexCount) { + this._vao.draw(gl.TRIANGLES, this._vertexCount) + } + + // Draw projections of surface + for (i = 0; i < 3; ++i) { + if (!this.surfaceProject[i] || !this.vertexCount) { + continue + } + this._shader.uniforms.model = projectData.projections[i] + this._shader.uniforms.clipBounds = projectData.clipBounds[i] + this._vao.draw(gl.TRIANGLES, this._vertexCount) + } + + this._vao.unbind() } - return { - format: function(specifier) { - var f = newFormat(specifier += "", formats); - f.toString = function() { return specifier; }; - return f; - }, - parse: function(specifier) { - var p = newParse(specifier += "", false); - p.toString = function() { return specifier; }; - return p; - }, - utcFormat: function(specifier) { - var f = newFormat(specifier += "", utcFormats); - f.toString = function() { return specifier; }; - return f; - }, - utcParse: function(specifier) { - var p = newParse(specifier += "", true); - p.toString = function() { return specifier; }; - return p; + if (projectData.showContour) { + var shader = this._contourShader + + // Don't apply lighting to contours + uniforms.kambient = 1.0 + uniforms.kdiffuse = 0.0 + uniforms.kspecular = 0.0 + uniforms.opacity = 1.0 + + shader.bind() + shader.uniforms = uniforms + + // Draw contour lines + var vao = this._contourVAO + vao.bind() + + // Draw contour levels + for (i = 0; i < 3; ++i) { + shader.uniforms.permutation = PERMUTATIONS[i] + gl.lineWidth(this.contourWidth[i] * this.pixelRatio) + + for (j = 0; j < this.contourLevels[i].length; ++j) { + if (j === this.highlightLevel[i]) { + shader.uniforms.contourColor = this.highlightColor[i] + shader.uniforms.contourTint = this.highlightTint[i] + } else if (j === 0 || (j - 1) === this.highlightLevel[i]) { + shader.uniforms.contourColor = this.contourColor[i] + shader.uniforms.contourTint = this.contourTint[i] + } + if (!this._contourCounts[i][j]) { + continue + } + + shader.uniforms.height = this.contourLevels[i][j] + vao.draw(gl.LINES, this._contourCounts[i][j], this._contourOffsets[i][j]) + } } - }; -} -var pads = {"-": "", "_": " ", "0": "0"}, - numberRe = /^\s*\d+/, // note: ignores next directive - percentRe = /^%/, - requoteRe = /[\\^$*+?|[\]().{}]/g; + // Draw projections of surface + for (i = 0; i < 3; ++i) { + shader.uniforms.model = projectData.projections[i] + shader.uniforms.clipBounds = projectData.clipBounds[i] + for (j = 0; j < 3; ++j) { + if (!this.contourProject[i][j]) { + continue + } + shader.uniforms.permutation = PERMUTATIONS[j] + gl.lineWidth(this.contourWidth[j] * this.pixelRatio) + for (var k = 0; k < this.contourLevels[j].length; ++k) { + if (k === this.highlightLevel[j]) { + shader.uniforms.contourColor = this.highlightColor[j] + shader.uniforms.contourTint = this.highlightTint[j] + } else if (k === 0 || (k - 1) === this.highlightLevel[j]) { + shader.uniforms.contourColor = this.contourColor[j] + shader.uniforms.contourTint = this.contourTint[j] + } + if (!this._contourCounts[j][k]) { + continue + } -function pad(value, fill, width) { - var sign = value < 0 ? "-" : "", - string = (sign ? -value : value) + "", - length = string.length; - return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); -} + shader.uniforms.height = this.contourLevels[j][k] + vao.draw(gl.LINES, this._contourCounts[j][k], this._contourOffsets[j][k]) + } + } + } -function requote(s) { - return s.replace(requoteRe, "\\$&"); -} + vao.unbind() -function formatRe(names) { - return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); -} + // Draw dynamic contours + vao = this._dynamicVAO + vao.bind() -function formatLookup(names) { - var map = {}, i = -1, n = names.length; - while (++i < n) map[names[i].toLowerCase()] = i; - return map; -} + // Draw contour levels + for (i = 0; i < 3; ++i) { + if (this._dynamicCounts[i] === 0) { + continue + } -function parseWeekdayNumberSunday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 1)); - return n ? (d.w = +n[0], i + n[0].length) : -1; -} + shader.uniforms.model = uniforms.model + shader.uniforms.clipBounds = uniforms.clipBounds + shader.uniforms.permutation = PERMUTATIONS[i] + gl.lineWidth(this.dynamicWidth[i] * this.pixelRatio) -function parseWeekdayNumberMonday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 1)); - return n ? (d.u = +n[0], i + n[0].length) : -1; -} + shader.uniforms.contourColor = this.dynamicColor[i] + shader.uniforms.contourTint = this.dynamicTint[i] + shader.uniforms.height = this.dynamicLevel[i] + vao.draw(gl.LINES, this._dynamicCounts[i], this._dynamicOffsets[i]) -function parseWeekNumberSunday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.U = +n[0], i + n[0].length) : -1; -} + for (j = 0; j < 3; ++j) { + if (!this.contourProject[j][i]) { + continue + } -function parseWeekNumberISO(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.V = +n[0], i + n[0].length) : -1; -} + shader.uniforms.model = projectData.projections[j] + shader.uniforms.clipBounds = projectData.clipBounds[j] + vao.draw(gl.LINES, this._dynamicCounts[i], this._dynamicOffsets[i]) + } + } -function parseWeekNumberMonday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.W = +n[0], i + n[0].length) : -1; + vao.unbind() + } } -function parseFullYear(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 4)); - return n ? (d.y = +n[0], i + n[0].length) : -1; +proto.draw = function (params) { + return drawCore.call(this, params, false) } -function parseYear(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1; +proto.drawTransparent = function (params) { + return drawCore.call(this, params, true) } -function parseZone(d, string, i) { - var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6)); - return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; +var PICK_UNIFORMS = { + model: IDENTITY, + view: IDENTITY, + projection: IDENTITY, + inverseModel: IDENTITY, + clipBounds: [[0, 0, 0], [0, 0, 0]], + height: 0.0, + shape: [0, 0], + pickId: 0, + lowerBound: [0, 0, 0], + upperBound: [0, 0, 0], + zOffset: 0.0, + objectOffset: [0, 0, 0], + permutation: [1, 0, 0, 0, 1, 0, 0, 0, 1], + lightPosition: [0, 0, 0], + eyePosition: [0, 0, 0] } -function parseQuarter(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 1)); - return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; -} +proto.drawPick = function (params) { + params = params || {} + var gl = this.gl + gl.disable(gl.CULL_FACE) -function parseMonthNumber(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.m = n[0] - 1, i + n[0].length) : -1; -} + var uniforms = PICK_UNIFORMS + uniforms.model = params.model || IDENTITY + uniforms.view = params.view || IDENTITY + uniforms.projection = params.projection || IDENTITY + uniforms.shape = this._field[2].shape + uniforms.pickId = this.pickId / 255.0 + uniforms.lowerBound = this.bounds[0] + uniforms.upperBound = this.bounds[1] + uniforms.objectOffset = this.objectOffset + uniforms.permutation = DEFAULT_PERM -function parseDayOfMonth(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.d = +n[0], i + n[0].length) : -1; -} + for (var i = 0; i < 2; ++i) { + var clipClamped = uniforms.clipBounds[i] + for (var j = 0; j < 3; ++j) { + clipClamped[j] = Math.min(Math.max(this.clipBounds[i][j], -1e8), 1e8) + } + } -function parseDayOfYear(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 3)); - return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; -} + var projectData = computeProjectionData(uniforms, this) -function parseHour24(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.H = +n[0], i + n[0].length) : -1; -} + if (projectData.showSurface) { + // Set up uniforms + this._pickShader.bind() + this._pickShader.uniforms = uniforms -function parseMinutes(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.M = +n[0], i + n[0].length) : -1; -} + // Draw it + this._vao.bind() + this._vao.draw(gl.TRIANGLES, this._vertexCount) -function parseSeconds(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.S = +n[0], i + n[0].length) : -1; -} + // Draw projections of surface + for (i = 0; i < 3; ++i) { + if (!this.surfaceProject[i]) { + continue + } + this._pickShader.uniforms.model = projectData.projections[i] + this._pickShader.uniforms.clipBounds = projectData.clipBounds[i] + this._vao.draw(gl.TRIANGLES, this._vertexCount) + } -function parseMilliseconds(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 3)); - return n ? (d.L = +n[0], i + n[0].length) : -1; -} + this._vao.unbind() + } -function parseMicroseconds(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 6)); - return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1; -} + if (projectData.showContour) { + var shader = this._contourPickShader -function parseLiteralPercent(d, string, i) { - var n = percentRe.exec(string.slice(i, i + 1)); - return n ? i + n[0].length : -1; -} + shader.bind() + shader.uniforms = uniforms -function parseUnixTimestamp(d, string, i) { - var n = numberRe.exec(string.slice(i)); - return n ? (d.Q = +n[0], i + n[0].length) : -1; -} + var vao = this._contourVAO + vao.bind() -function parseUnixTimestampSeconds(d, string, i) { - var n = numberRe.exec(string.slice(i)); - return n ? (d.s = +n[0], i + n[0].length) : -1; -} + for (j = 0; j < 3; ++j) { + gl.lineWidth(this.contourWidth[j] * this.pixelRatio) + shader.uniforms.permutation = PERMUTATIONS[j] + for (i = 0; i < this.contourLevels[j].length; ++i) { + if (this._contourCounts[j][i]) { + shader.uniforms.height = this.contourLevels[j][i] + vao.draw(gl.LINES, this._contourCounts[j][i], this._contourOffsets[j][i]) + } + } + } -function formatDayOfMonth(d, p) { - return pad(d.getDate(), p, 2); -} + // Draw projections of surface + for (i = 0; i < 3; ++i) { + shader.uniforms.model = projectData.projections[i] + shader.uniforms.clipBounds = projectData.clipBounds[i] -function formatHour24(d, p) { - return pad(d.getHours(), p, 2); -} + for (j = 0; j < 3; ++j) { + if (!this.contourProject[i][j]) { + continue + } -function formatHour12(d, p) { - return pad(d.getHours() % 12 || 12, p, 2); -} + shader.uniforms.permutation = PERMUTATIONS[j] + gl.lineWidth(this.contourWidth[j] * this.pixelRatio) + for (var k = 0; k < this.contourLevels[j].length; ++k) { + if (this._contourCounts[j][k]) { + shader.uniforms.height = this.contourLevels[j][k] + vao.draw(gl.LINES, this._contourCounts[j][k], this._contourOffsets[j][k]) + } + } + } + } -function formatDayOfYear(d, p) { - return pad(1 + d3Time.timeDay.count(d3Time.timeYear(d), d), p, 3); + vao.unbind() + } } -function formatMilliseconds(d, p) { - return pad(d.getMilliseconds(), p, 3); -} +proto.pick = function (selection) { + if (!selection) { + return null + } -function formatMicroseconds(d, p) { - return formatMilliseconds(d, p) + "000"; -} + if (selection.id !== this.pickId) { + return null + } -function formatMonthNumber(d, p) { - return pad(d.getMonth() + 1, p, 2); -} + var shape = this._field[2].shape -function formatMinutes(d, p) { - return pad(d.getMinutes(), p, 2); -} + var result = this._pickResult -function formatSeconds(d, p) { - return pad(d.getSeconds(), p, 2); -} + // Compute uv coordinate + var x = shape[0] * (selection.value[0] + (selection.value[2] >> 4) / 16.0) / 255.0 + var ix = Math.floor(x) + var fx = x - ix -function formatWeekdayNumberMonday(d) { - var day = d.getDay(); - return day === 0 ? 7 : day; -} + var y = shape[1] * (selection.value[1] + (selection.value[2] & 15) / 16.0) / 255.0 + var iy = Math.floor(y) + var fy = y - iy -function formatWeekNumberSunday(d, p) { - return pad(d3Time.timeSunday.count(d3Time.timeYear(d) - 1, d), p, 2); -} + ix += 1 + iy += 1 -function formatWeekNumberISO(d, p) { - var day = d.getDay(); - d = (day >= 4 || day === 0) ? d3Time.timeThursday(d) : d3Time.timeThursday.ceil(d); - return pad(d3Time.timeThursday.count(d3Time.timeYear(d), d) + (d3Time.timeYear(d).getDay() === 4), p, 2); -} + // Compute xyz coordinate + var pos = result.position + pos[0] = pos[1] = pos[2] = 0 + for (var dx = 0; dx < 2; ++dx) { + var s = dx ? fx : 1.0 - fx + for (var dy = 0; dy < 2; ++dy) { + var t = dy ? fy : 1.0 - fy -function formatWeekdayNumberSunday(d) { - return d.getDay(); -} + var r = ix + dx + var c = iy + dy + var w = s * t -function formatWeekNumberMonday(d, p) { - return pad(d3Time.timeMonday.count(d3Time.timeYear(d) - 1, d), p, 2); -} + for (var i = 0; i < 3; ++i) { + pos[i] += this._field[i].get(r, c) * w + } + } + } -function formatYear(d, p) { - return pad(d.getFullYear() % 100, p, 2); -} + // Find closest level + var levelIndex = this._pickResult.level + for (var j = 0; j < 3; ++j) { + levelIndex[j] = bsearch.le(this.contourLevels[j], pos[j]) + if (levelIndex[j] < 0) { + if (this.contourLevels[j].length > 0) { + levelIndex[j] = 0 + } + } else if (levelIndex[j] < this.contourLevels[j].length - 1) { + var a = this.contourLevels[j][levelIndex[j]] + var b = this.contourLevels[j][levelIndex[j] + 1] + if (Math.abs(a - pos[j]) > Math.abs(b - pos[j])) { + levelIndex[j] += 1 + } + } + } -function formatFullYear(d, p) { - return pad(d.getFullYear() % 10000, p, 4); -} + result.index[0] = fx < 0.5 ? ix : (ix + 1) + result.index[1] = fy < 0.5 ? iy : (iy + 1) -function formatZone(d) { - var z = d.getTimezoneOffset(); - return (z > 0 ? "-" : (z *= -1, "+")) - + pad(z / 60 | 0, "0", 2) - + pad(z % 60, "0", 2); -} + result.uv[0] = x / shape[0] + result.uv[1] = y / shape[1] -function formatUTCDayOfMonth(d, p) { - return pad(d.getUTCDate(), p, 2); -} + for (i = 0; i < 3; ++i) { + result.dataCoordinate[i] = this._field[i].get(result.index[0], result.index[1]) + } -function formatUTCHour24(d, p) { - return pad(d.getUTCHours(), p, 2); + return result } -function formatUTCHour12(d, p) { - return pad(d.getUTCHours() % 12 || 12, p, 2); -} +proto.padField = function(dstField, srcField) { + var srcShape = srcField.shape.slice() + var dstShape = dstField.shape.slice() -function formatUTCDayOfYear(d, p) { - return pad(1 + d3Time.utcDay.count(d3Time.utcYear(d), d), p, 3); -} + // Center + ops.assign(dstField.lo(1, 1).hi(srcShape[0], srcShape[1]), srcField) -function formatUTCMilliseconds(d, p) { - return pad(d.getUTCMilliseconds(), p, 3); + // Edges + ops.assign(dstField.lo(1).hi(srcShape[0], 1), + srcField.hi(srcShape[0], 1)) + ops.assign(dstField.lo(1, dstShape[1] - 1).hi(srcShape[0], 1), + srcField.lo(0, srcShape[1] - 1).hi(srcShape[0], 1)) + ops.assign(dstField.lo(0, 1).hi(1, srcShape[1]), + srcField.hi(1)) + ops.assign(dstField.lo(dstShape[0] - 1, 1).hi(1, srcShape[1]), + srcField.lo(srcShape[0] - 1)) + // Corners + dstField.set(0, 0, srcField.get(0, 0)) + dstField.set(0, dstShape[1] - 1, srcField.get(0, srcShape[1] - 1)) + dstField.set(dstShape[0] - 1, 0, srcField.get(srcShape[0] - 1, 0)) + dstField.set(dstShape[0] - 1, dstShape[1] - 1, srcField.get(srcShape[0] - 1, srcShape[1] - 1)) } -function formatUTCMicroseconds(d, p) { - return formatUTCMilliseconds(d, p) + "000"; +function handleArray (param, ctor) { + if (Array.isArray(param)) { + return [ ctor(param[0]), ctor(param[1]), ctor(param[2]) ] + } + return [ ctor(param), ctor(param), ctor(param) ] } -function formatUTCMonthNumber(d, p) { - return pad(d.getUTCMonth() + 1, p, 2); +function toColor (x) { + if (Array.isArray(x)) { + if (x.length === 3) { + return [x[0], x[1], x[2], 1] + } + return [x[0], x[1], x[2], x[3]] + } + return [0, 0, 0, 1] } -function formatUTCMinutes(d, p) { - return pad(d.getUTCMinutes(), p, 2); +function handleColor (param) { + if (Array.isArray(param)) { + if (Array.isArray(param)) { + return [ + toColor(param[0]), + toColor(param[1]), + toColor(param[2]) ] + } else { + var c = toColor(param) + return [ + c.slice(), + c.slice(), + c.slice() ] + } + } } -function formatUTCSeconds(d, p) { - return pad(d.getUTCSeconds(), p, 2); -} +proto.update = function (params) { + params = params || {} -function formatUTCWeekdayNumberMonday(d) { - var dow = d.getUTCDay(); - return dow === 0 ? 7 : dow; -} + this.objectOffset = params.objectOffset || this.objectOffset -function formatUTCWeekNumberSunday(d, p) { - return pad(d3Time.utcSunday.count(d3Time.utcYear(d) - 1, d), p, 2); -} + this.dirty = true -function formatUTCWeekNumberISO(d, p) { - var day = d.getUTCDay(); - d = (day >= 4 || day === 0) ? d3Time.utcThursday(d) : d3Time.utcThursday.ceil(d); - return pad(d3Time.utcThursday.count(d3Time.utcYear(d), d) + (d3Time.utcYear(d).getUTCDay() === 4), p, 2); -} + if ('contourWidth' in params) { + this.contourWidth = handleArray(params.contourWidth, Number) + } + if ('showContour' in params) { + this.showContour = handleArray(params.showContour, Boolean) + } + if ('showSurface' in params) { + this.showSurface = !!params.showSurface + } + if ('contourTint' in params) { + this.contourTint = handleArray(params.contourTint, Boolean) + } + if ('contourColor' in params) { + this.contourColor = handleColor(params.contourColor) + } + if ('contourProject' in params) { + this.contourProject = handleArray(params.contourProject, function (x) { + return handleArray(x, Boolean) + }) + } + if ('surfaceProject' in params) { + this.surfaceProject = params.surfaceProject + } + if ('dynamicColor' in params) { + this.dynamicColor = handleColor(params.dynamicColor) + } + if ('dynamicTint' in params) { + this.dynamicTint = handleArray(params.dynamicTint, Number) + } + if ('dynamicWidth' in params) { + this.dynamicWidth = handleArray(params.dynamicWidth, Number) + } + if ('opacity' in params) { + this.opacity = params.opacity + } + if('opacityscale' in params) { + this.opacityscale = params.opacityscale + } + if ('colorBounds' in params) { + this.colorBounds = params.colorBounds + } + if ('vertexColor' in params) { + this.vertexColor = params.vertexColor ? 1 : 0; + } + if ('colormap' in params) { + this._colorMap.setPixels(this.genColormap(params.colormap, this.opacityscale)) + } -function formatUTCWeekdayNumberSunday(d) { - return d.getUTCDay(); -} + var field = params.field || (params.coords && params.coords[2]) || null + var levelsChanged = false -function formatUTCWeekNumberMonday(d, p) { - return pad(d3Time.utcMonday.count(d3Time.utcYear(d) - 1, d), p, 2); -} + if (!field) { + if (this._field[2].shape[0] || this._field[2].shape[2]) { + field = this._field[2].lo(1, 1).hi(this._field[2].shape[0] - 2, this._field[2].shape[1] - 2) + } else { + field = this._field[2].hi(0, 0) + } + } -function formatUTCYear(d, p) { - return pad(d.getUTCFullYear() % 100, p, 2); -} + // Update field + if ('field' in params || 'coords' in params) { + var fsize = (field.shape[0] + 2) * (field.shape[1] + 2) -function formatUTCFullYear(d, p) { - return pad(d.getUTCFullYear() % 10000, p, 4); -} + // Resize if necessary + if (fsize > this._field[2].data.length) { + pool.freeFloat(this._field[2].data) + this._field[2].data = pool.mallocFloat(bits.nextPow2(fsize)) + } -function formatUTCZone() { - return "+0000"; -} + // Pad field + this._field[2] = ndarray(this._field[2].data, [field.shape[0] + 2, field.shape[1] + 2]) + this.padField(this._field[2], field) -function formatLiteralPercent() { - return "%"; -} + // Save shape of field + this.shape = field.shape.slice() + var shape = this.shape -function formatUnixTimestamp(d) { - return +d; -} + // Resize coordinate fields if necessary + for (var i = 0; i < 2; ++i) { + if (this._field[2].size > this._field[i].data.length) { + pool.freeFloat(this._field[i].data) + this._field[i].data = pool.mallocFloat(this._field[2].size) + } + this._field[i] = ndarray(this._field[i].data, [shape[0] + 2, shape[1] + 2]) + } -function formatUnixTimestampSeconds(d) { - return Math.floor(+d / 1000); -} + // Generate x/y coordinates + if (params.coords) { + var coords = params.coords + if (!Array.isArray(coords) || coords.length !== 3) { + throw new Error('gl-surface: invalid coordinates for x/y') + } + for (i = 0; i < 2; ++i) { + var coord = coords[i] + for (j = 0; j < 2; ++j) { + if (coord.shape[j] !== shape[j]) { + throw new Error('gl-surface: coords have incorrect shape') + } + } + this.padField(this._field[i], coord) + } + } else if (params.ticks) { + var ticks = params.ticks + if (!Array.isArray(ticks) || ticks.length !== 2) { + throw new Error('gl-surface: invalid ticks') + } + for (i = 0; i < 2; ++i) { + var tick = ticks[i] + if (Array.isArray(tick) || tick.length) { + tick = ndarray(tick) + } + if (tick.shape[0] !== shape[i]) { + throw new Error('gl-surface: invalid tick length') + } + // Make a copy view of the tick array + var tick2 = ndarray(tick.data, shape) + tick2.stride[i] = tick.stride[0] + tick2.stride[i ^ 1] = 0 -var locale; + // Fill in field array + this.padField(this._field[i], tick2) + } + } else { + for (i = 0; i < 2; ++i) { + var offset = [0, 0] + offset[i] = 1 + this._field[i] = ndarray(this._field[i].data, [shape[0] + 2, shape[1] + 2], offset, 0) + } + this._field[0].set(0, 0, 0) + for (var j = 0; j < shape[0]; ++j) { + this._field[0].set(j + 1, 0, j) + } + this._field[0].set(shape[0] + 1, 0, shape[0] - 1) + this._field[1].set(0, 0, 0) + for (j = 0; j < shape[1]; ++j) { + this._field[1].set(0, j + 1, j) + } + this._field[1].set(0, shape[1] + 1, shape[1] - 1) + } -defaultLocale({ - dateTime: "%x, %X", - date: "%-m/%-d/%Y", - time: "%-I:%M:%S %p", - 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"] -}); + // Save shape + var fields = this._field -function defaultLocale(definition) { - locale = formatLocale(definition); - exports.timeFormat = locale.format; - exports.timeParse = locale.parse; - exports.utcFormat = locale.utcFormat; - exports.utcParse = locale.utcParse; - return locale; -} + // Compute surface normals + var dfields = ndarray(pool.mallocFloat(fields[2].size * 3 * 2), [3, shape[0] + 2, shape[1] + 2, 2]) + for (i = 0; i < 3; ++i) { + gradient(dfields.pick(i), fields[i], 'mirror') + } + var normals = ndarray(pool.mallocFloat(fields[2].size * 3), [shape[0] + 2, shape[1] + 2, 3]) + for (i = 0; i < shape[0] + 2; ++i) { + for (j = 0; j < shape[1] + 2; ++j) { + var dxdu = dfields.get(0, i, j, 0) + var dxdv = dfields.get(0, i, j, 1) + var dydu = dfields.get(1, i, j, 0) + var dydv = dfields.get(1, i, j, 1) + var dzdu = dfields.get(2, i, j, 0) + var dzdv = dfields.get(2, i, j, 1) + + var nx = dydu * dzdv - dydv * dzdu + var ny = dzdu * dxdv - dzdv * dxdu + var nz = dxdu * dydv - dxdv * dydu + + var nl = Math.sqrt(nx * nx + ny * ny + nz * nz) + if (nl < 1e-8) { + nl = Math.max(Math.abs(nx), Math.abs(ny), Math.abs(nz)) + if (nl < 1e-8) { + nz = 1.0 + ny = nx = 0.0 + nl = 1.0 + } else { + nl = 1.0 / nl + } + } else { + nl = 1.0 / Math.sqrt(nl) + } -var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ"; + normals.set(i, j, 0, nx * nl) + normals.set(i, j, 1, ny * nl) + normals.set(i, j, 2, nz * nl) + } + } + pool.free(dfields.data) + + // Initialize surface + var lo = [ Infinity, Infinity, Infinity ] + var hi = [ -Infinity, -Infinity, -Infinity ] + var lo_intensity = Infinity + var hi_intensity = -Infinity + var count = (shape[0] - 1) * (shape[1] - 1) * 6 + var tverts = pool.mallocFloat(bits.nextPow2(10 * count)) + var tptr = 0 + var vertexCount = 0 + for (i = 0; i < shape[0] - 1; ++i) { + j_loop: + for (j = 0; j < shape[1] - 1; ++j) { + // Test for NaNs + for (var dx = 0; dx < 2; ++dx) { + for (var dy = 0; dy < 2; ++dy) { + for (var k = 0; k < 3; ++k) { + var f = this._field[k].get(1 + i + dx, 1 + j + dy) + if (isNaN(f) || !isFinite(f)) { + continue j_loop + } + } + } + } + for (k = 0; k < 6; ++k) { + var r = i + QUAD[k][0] + var c = j + QUAD[k][1] -function formatIsoNative(date) { - return date.toISOString(); -} + var tx = this._field[0].get(r + 1, c + 1) + var ty = this._field[1].get(r + 1, c + 1) + f = this._field[2].get(r + 1, c + 1) -var formatIso = Date.prototype.toISOString - ? formatIsoNative - : exports.utcFormat(isoSpecifier); + nx = normals.get(r + 1, c + 1, 0) + ny = normals.get(r + 1, c + 1, 1) + nz = normals.get(r + 1, c + 1, 2) -function parseIsoNative(string) { - var date = new Date(string); - return isNaN(date) ? null : date; -} + if (params.intensity) { + vf = params.intensity.get(r, c) + } -var parseIso = +new Date("2000-01-01T00:00:00.000Z") - ? parseIsoNative - : exports.utcParse(isoSpecifier); + var vf = (params.intensity) ? + params.intensity.get(r, c) : + f + this.objectOffset[2]; + + tverts[tptr++] = r + tverts[tptr++] = c + tverts[tptr++] = tx + tverts[tptr++] = ty + tverts[tptr++] = f + tverts[tptr++] = 0 + tverts[tptr++] = vf + tverts[tptr++] = nx + tverts[tptr++] = ny + tverts[tptr++] = nz + + lo[0] = Math.min(lo[0], tx + this.objectOffset[0]) + lo[1] = Math.min(lo[1], ty + this.objectOffset[1]) + lo[2] = Math.min(lo[2], f + this.objectOffset[2]) + lo_intensity = Math.min(lo_intensity, vf) + + hi[0] = Math.max(hi[0], tx + this.objectOffset[0]) + hi[1] = Math.max(hi[1], ty + this.objectOffset[1]) + hi[2] = Math.max(hi[2], f + this.objectOffset[2]) + hi_intensity = Math.max(hi_intensity, vf) + + vertexCount += 1 + } + } + } -exports.isoFormat = formatIso; -exports.isoParse = parseIso; -exports.timeFormatDefaultLocale = defaultLocale; -exports.timeFormatLocale = formatLocale; + if (params.intensityBounds) { + lo_intensity = +params.intensityBounds[0] + hi_intensity = +params.intensityBounds[1] + } -Object.defineProperty(exports, '__esModule', { value: true }); + // Scale all vertex intensities + for (i = 6; i < tptr; i += 10) { + tverts[i] = (tverts[i] - lo_intensity) / (hi_intensity - lo_intensity) + } -})); + this._vertexCount = vertexCount + this._coordinateBuffer.update(tverts.subarray(0, tptr)) + pool.freeFloat(tverts) + pool.free(normals.data) -},{"d3-time":77}],77:[function(_dereq_,module,exports){ -// https://d3js.org/d3-time/ v1.1.0 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {})); -}(this, function (exports) { 'use strict'; + // Update bounds + this.bounds = [lo, hi] -var t0 = new Date, - t1 = new Date; + // Save intensity + this.intensity = params.intensity || this._field[2] -function newInterval(floori, offseti, count, field) { + if(this.intensityBounds[0] !== lo_intensity || this.intensityBounds[1] !== hi_intensity) { + levelsChanged = true + } - function interval(date) { - return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date; + // Save intensity bound + this.intensityBounds = [lo_intensity, hi_intensity] } - interval.floor = function(date) { - return floori(date = new Date(+date)), date; - }; + // Update level crossings + if ('levels' in params) { + var levels = params.levels + if (!Array.isArray(levels[0])) { + levels = [ [], [], levels ] + } else { + levels = levels.slice() + } + for (i = 0; i < 3; ++i) { + levels[i] = levels[i].slice() + levels[i].sort(function (a, b) { + return a - b + }) + } + for (i = 0; i < 3; ++i) { + for (j = 0; j < levels[i].length; ++j) { + levels[i][j] -= this.objectOffset[i] + } + } + change_test: + for (i = 0; i < 3; ++i) { + if (levels[i].length !== this.contourLevels[i].length) { + levelsChanged = true + break + } + for (j = 0; j < levels[i].length; ++j) { + if (levels[i][j] !== this.contourLevels[i][j]) { + levelsChanged = true + break change_test + } + } + } + this.contourLevels = levels + } - interval.ceil = function(date) { - return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date; - }; + if (levelsChanged) { + fields = this._field + shape = this.shape - interval.round = function(date) { - var d0 = interval(date), - d1 = interval.ceil(date); - return date - d0 < d1 - date ? d0 : d1; - }; + // Update contour lines + var contourVerts = [] - interval.offset = function(date, step) { - return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date; - }; + for (var dim = 0; dim < 3; ++dim) { + var contourLevel = this.contourLevels[dim] - interval.range = function(start, stop, step) { - var range = [], previous; - start = interval.ceil(start); - step = step == null ? 1 : Math.floor(step); - if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date - do range.push(previous = new Date(+start)), offseti(start, step), floori(start); - while (previous < start && start < stop); - return range; - }; + var levelOffsets = [] + var levelCounts = [] - interval.filter = function(test) { - return newInterval(function(date) { - if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1); - }, function(date, step) { - if (date >= date) { - if (step < 0) while (++step <= 0) { - while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty - } else while (--step >= 0) { - while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty + var parts = [0, 0, 0] + + for (i = 0; i < contourLevel.length; ++i) { + var graph = surfaceNets(this._field[dim], contourLevel[i]) + + levelOffsets.push((contourVerts.length / 5) | 0) + vertexCount = 0 + + edge_loop: + for (j = 0; j < graph.cells.length; ++j) { + var e = graph.cells[j] + for (k = 0; k < 2; ++k) { + var p = graph.positions[e[k]] + + var x = p[0] + var ix = Math.floor(x) | 0 + var fx = x - ix + + var y = p[1] + var iy = Math.floor(y) | 0 + var fy = y - iy + + var hole = false + axis_loop: + for (var axis = 0; axis < 3; ++axis) { + parts[axis] = 0.0 + var iu = (dim + axis + 1) % 3 + for (dx = 0; dx < 2; ++dx) { + var s = dx ? fx : 1.0 - fx + r = Math.min(Math.max(ix + dx, 0), shape[0]) | 0 + for (dy = 0; dy < 2; ++dy) { + var t = dy ? fy : 1.0 - fy + c = Math.min(Math.max(iy + dy, 0), shape[1]) | 0 + + if (axis < 2) { + f = this._field[iu].get(r, c) + } else { + f = (this.intensity.get(r, c) - this.intensityBounds[0]) / (this.intensityBounds[1] - this.intensityBounds[0]) + } + if (!isFinite(f) || isNaN(f)) { + hole = true + break axis_loop + } + + var w = s * t + parts[axis] += w * f + } + } + } + + if (!hole) { + contourVerts.push( + parts[0], + parts[1], + p[0], + p[1], + parts[2] + ) + vertexCount += 1 + } else { + if (k > 0) { + // If we already added first edge, pop off verts + for (var l = 0; l < 5; ++l) { + contourVerts.pop() + } + vertexCount -= 1 + } + continue edge_loop + } + } } + levelCounts.push(vertexCount) } - }); - }; - if (count) { - interval.count = function(start, end) { - t0.setTime(+start), t1.setTime(+end); - floori(t0), floori(t1); - return Math.floor(count(t0, t1)); - }; + // Store results + this._contourOffsets[dim] = levelOffsets + this._contourCounts[dim] = levelCounts - interval.every = function(step) { - step = Math.floor(step); - return !isFinite(step) || !(step > 0) ? null - : !(step > 1) ? interval - : interval.filter(field - ? function(d) { return field(d) % step === 0; } - : function(d) { return interval.count(0, d) % step === 0; }); - }; + } + + var floatBuffer = pool.mallocFloat(contourVerts.length) + for (i = 0; i < contourVerts.length; ++i) { + floatBuffer[i] = contourVerts[i] + } + this._contourBuffer.update(floatBuffer) + pool.freeFloat(floatBuffer) } +} - return interval; +proto.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 i = 0; i < 3; ++i) { + pool.freeFloat(this._field[i].data) + } } -var millisecond = newInterval(function() { - // noop -}, function(date, step) { - date.setTime(+date + step); -}, function(start, end) { - return end - start; -}); +proto.highlight = function (selection) { + var i -// An optimized implementation for this simple case. -millisecond.every = function(k) { - k = Math.floor(k); - if (!isFinite(k) || !(k > 0)) return null; - if (!(k > 1)) return millisecond; - return newInterval(function(date) { - date.setTime(Math.floor(date / k) * k); - }, function(date, step) { - date.setTime(+date + step * k); - }, function(start, end) { - return (end - start) / k; - }); -}; -var milliseconds = millisecond.range; + if (!selection) { + this._dynamicCounts = [0, 0, 0] + this.dyanamicLevel = [NaN, NaN, NaN] + this.highlightLevel = [-1, -1, -1] + return + } -var durationSecond = 1e3; -var durationMinute = 6e4; -var durationHour = 36e5; -var durationDay = 864e5; -var durationWeek = 6048e5; + for (i = 0; i < 3; ++i) { + if (this.enableHighlight[i]) { + this.highlightLevel[i] = selection.level[i] + } else { + this.highlightLevel[i] = -1 + } + } -var second = newInterval(function(date) { - date.setTime(date - date.getMilliseconds()); -}, function(date, step) { - date.setTime(+date + step * durationSecond); -}, function(start, end) { - return (end - start) / durationSecond; -}, function(date) { - return date.getUTCSeconds(); -}); -var seconds = second.range; + var levels + if (this.snapToData) { + levels = selection.dataCoordinate + } else { + levels = selection.position + } + for (i = 0; i < 3; ++i) { + levels[i] -= this.objectOffset[i] + } + if ((!this.enableDynamic[0] || levels[0] === this.dynamicLevel[0]) && + (!this.enableDynamic[1] || levels[1] === this.dynamicLevel[1]) && + (!this.enableDynamic[2] || levels[2] === this.dynamicLevel[2])) { + return + } -var minute = newInterval(function(date) { - date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond); -}, function(date, step) { - date.setTime(+date + step * durationMinute); -}, function(start, end) { - return (end - start) / durationMinute; -}, function(date) { - return date.getMinutes(); -}); -var minutes = minute.range; + var vertexCount = 0 + var shape = this.shape + var scratchBuffer = pool.mallocFloat(12 * shape[0] * shape[1]) -var hour = newInterval(function(date) { - date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute); -}, function(date, step) { - date.setTime(+date + step * durationHour); -}, function(start, end) { - return (end - start) / durationHour; -}, function(date) { - return date.getHours(); -}); -var hours = hour.range; + for (var d = 0; d < 3; ++d) { + if (!this.enableDynamic[d]) { + this.dynamicLevel[d] = NaN + this._dynamicCounts[d] = 0 + continue + } -var day = newInterval(function(date) { - date.setHours(0, 0, 0, 0); -}, function(date, step) { - date.setDate(date.getDate() + step); -}, function(start, end) { - return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay; -}, function(date) { - return date.getDate() - 1; -}); -var days = day.range; + this.dynamicLevel[d] = levels[d] -function weekday(i) { - return newInterval(function(date) { - date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7); - date.setHours(0, 0, 0, 0); - }, function(date, step) { - date.setDate(date.getDate() + step * 7); - }, function(start, end) { - return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek; - }); -} + var u = (d + 1) % 3 + var v = (d + 2) % 3 -var sunday = weekday(0); -var monday = weekday(1); -var tuesday = weekday(2); -var wednesday = weekday(3); -var thursday = weekday(4); -var friday = weekday(5); -var saturday = weekday(6); + var f = this._field[d] + var g = this._field[u] + var h = this._field[v] -var sundays = sunday.range; -var mondays = monday.range; -var tuesdays = tuesday.range; -var wednesdays = wednesday.range; -var thursdays = thursday.range; -var fridays = friday.range; -var saturdays = saturday.range; + var graph = surfaceNets(f, levels[d]) + var edges = graph.cells + var positions = graph.positions -var month = newInterval(function(date) { - date.setDate(1); - date.setHours(0, 0, 0, 0); -}, function(date, step) { - date.setMonth(date.getMonth() + step); -}, function(start, end) { - return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; -}, function(date) { - return date.getMonth(); -}); -var months = month.range; + this._dynamicOffsets[d] = vertexCount -var year = newInterval(function(date) { - date.setMonth(0, 1); - date.setHours(0, 0, 0, 0); -}, function(date, step) { - date.setFullYear(date.getFullYear() + step); -}, function(start, end) { - return end.getFullYear() - start.getFullYear(); -}, function(date) { - return date.getFullYear(); -}); + for (i = 0; i < edges.length; ++i) { + var e = edges[i] + for (var j = 0; j < 2; ++j) { + var p = positions[e[j]] -// An optimized implementation for this simple case. -year.every = function(k) { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) { - date.setFullYear(Math.floor(date.getFullYear() / k) * k); - date.setMonth(0, 1); - date.setHours(0, 0, 0, 0); - }, function(date, step) { - date.setFullYear(date.getFullYear() + step * k); - }); -}; -var years = year.range; + var x = +p[0] + var ix = x | 0 + var jx = Math.min(ix + 1, shape[0]) | 0 + var fx = x - ix + var hx = 1.0 - fx -var utcMinute = newInterval(function(date) { - date.setUTCSeconds(0, 0); -}, function(date, step) { - date.setTime(+date + step * durationMinute); -}, function(start, end) { - return (end - start) / durationMinute; -}, function(date) { - return date.getUTCMinutes(); -}); -var utcMinutes = utcMinute.range; + var y = +p[1] + var iy = y | 0 + var jy = Math.min(iy + 1, shape[1]) | 0 + var fy = y - iy + var hy = 1.0 - fy -var utcHour = newInterval(function(date) { - date.setUTCMinutes(0, 0, 0); -}, function(date, step) { - date.setTime(+date + step * durationHour); -}, function(start, end) { - return (end - start) / durationHour; -}, function(date) { - return date.getUTCHours(); -}); -var utcHours = utcHour.range; + var w00 = hx * hy + var w01 = hx * fy + var w10 = fx * hy + var w11 = fx * fy -var utcDay = newInterval(function(date) { - date.setUTCHours(0, 0, 0, 0); -}, function(date, step) { - date.setUTCDate(date.getUTCDate() + step); -}, function(start, end) { - return (end - start) / durationDay; -}, function(date) { - return date.getUTCDate() - 1; -}); -var utcDays = utcDay.range; + var cu = w00 * g.get(ix, iy) + + w01 * g.get(ix, jy) + + w10 * g.get(jx, iy) + + w11 * g.get(jx, jy) -function utcWeekday(i) { - return newInterval(function(date) { - date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7); - date.setUTCHours(0, 0, 0, 0); - }, function(date, step) { - date.setUTCDate(date.getUTCDate() + step * 7); - }, function(start, end) { - return (end - start) / durationWeek; - }); + var cv = w00 * h.get(ix, iy) + + w01 * h.get(ix, jy) + + w10 * h.get(jx, iy) + + w11 * h.get(jx, jy) + + if (isNaN(cu) || isNaN(cv)) { + if (j) { + vertexCount -= 1 + } + break + } + + scratchBuffer[2 * vertexCount + 0] = cu + scratchBuffer[2 * vertexCount + 1] = cv + + vertexCount += 1 + } + } + + this._dynamicCounts[d] = vertexCount - this._dynamicOffsets[d] + } + + this._dynamicBuffer.update(scratchBuffer.subarray(0, 2 * vertexCount)) + pool.freeFloat(scratchBuffer) } -var utcSunday = utcWeekday(0); -var utcMonday = utcWeekday(1); -var utcTuesday = utcWeekday(2); -var utcWednesday = utcWeekday(3); -var utcThursday = utcWeekday(4); -var utcFriday = utcWeekday(5); -var utcSaturday = utcWeekday(6); +function createSurfacePlot (params) { + var gl = params.gl -var utcSundays = utcSunday.range; -var utcMondays = utcMonday.range; -var utcTuesdays = utcTuesday.range; -var utcWednesdays = utcWednesday.range; -var utcThursdays = utcThursday.range; -var utcFridays = utcFriday.range; -var utcSaturdays = utcSaturday.range; + var shader = createShader(gl) + var pickShader = createPickShader(gl) + var contourShader = createContourShader(gl) + var contourPickShader = createPickContourShader(gl) -var utcMonth = newInterval(function(date) { - date.setUTCDate(1); - date.setUTCHours(0, 0, 0, 0); -}, function(date, step) { - date.setUTCMonth(date.getUTCMonth() + step); -}, function(start, end) { - return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; -}, function(date) { - return date.getUTCMonth(); -}); -var utcMonths = utcMonth.range; + var coordinateBuffer = createBuffer(gl) + var vao = createVAO(gl, [ + { buffer: coordinateBuffer, + size: 4, + stride: SURFACE_VERTEX_SIZE, + offset: 0 + }, + { buffer: coordinateBuffer, + size: 3, + stride: SURFACE_VERTEX_SIZE, + offset: 16 + }, + { + buffer: coordinateBuffer, + size: 3, + stride: SURFACE_VERTEX_SIZE, + offset: 28 + } + ]) -var utcYear = newInterval(function(date) { - date.setUTCMonth(0, 1); - date.setUTCHours(0, 0, 0, 0); -}, function(date, step) { - date.setUTCFullYear(date.getUTCFullYear() + step); -}, function(start, end) { - return end.getUTCFullYear() - start.getUTCFullYear(); -}, function(date) { - return date.getUTCFullYear(); -}); + var contourBuffer = createBuffer(gl) + var contourVAO = createVAO(gl, [ + { + buffer: contourBuffer, + size: 4, + stride: 20, + offset: 0 + }, + { + buffer: contourBuffer, + size: 1, + stride: 20, + offset: 16 + } + ]) -// An optimized implementation for this simple case. -utcYear.every = function(k) { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) { - date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k); - date.setUTCMonth(0, 1); - date.setUTCHours(0, 0, 0, 0); - }, function(date, step) { - date.setUTCFullYear(date.getUTCFullYear() + step * k); - }); -}; -var utcYears = utcYear.range; + var dynamicBuffer = createBuffer(gl) + var dynamicVAO = createVAO(gl, [ + { + buffer: dynamicBuffer, + size: 2, + type: gl.FLOAT + }]) + + var cmap = createTexture(gl, 1, N_COLORS, gl.RGBA, gl.UNSIGNED_BYTE) + cmap.minFilter = gl.LINEAR + cmap.magFilter = gl.LINEAR + + var surface = new SurfacePlot( + gl, + [0, 0], // shape + [[0, 0, 0], [0, 0, 0]], // bounds + shader, + pickShader, + coordinateBuffer, + vao, + cmap, + contourShader, + contourPickShader, + contourBuffer, + contourVAO, + dynamicBuffer, + dynamicVAO, + [0, 0, 0] // objectOffset + ) -exports.timeDay = day; -exports.timeDays = days; -exports.timeFriday = friday; -exports.timeFridays = fridays; -exports.timeHour = hour; -exports.timeHours = hours; -exports.timeInterval = newInterval; -exports.timeMillisecond = millisecond; -exports.timeMilliseconds = milliseconds; -exports.timeMinute = minute; -exports.timeMinutes = minutes; -exports.timeMonday = monday; -exports.timeMondays = mondays; -exports.timeMonth = month; -exports.timeMonths = months; -exports.timeSaturday = saturday; -exports.timeSaturdays = saturdays; -exports.timeSecond = second; -exports.timeSeconds = seconds; -exports.timeSunday = sunday; -exports.timeSundays = sundays; -exports.timeThursday = thursday; -exports.timeThursdays = thursdays; -exports.timeTuesday = tuesday; -exports.timeTuesdays = tuesdays; -exports.timeWednesday = wednesday; -exports.timeWednesdays = wednesdays; -exports.timeWeek = sunday; -exports.timeWeeks = sundays; -exports.timeYear = year; -exports.timeYears = years; -exports.utcDay = utcDay; -exports.utcDays = utcDays; -exports.utcFriday = utcFriday; -exports.utcFridays = utcFridays; -exports.utcHour = utcHour; -exports.utcHours = utcHours; -exports.utcMillisecond = millisecond; -exports.utcMilliseconds = milliseconds; -exports.utcMinute = utcMinute; -exports.utcMinutes = utcMinutes; -exports.utcMonday = utcMonday; -exports.utcMondays = utcMondays; -exports.utcMonth = utcMonth; -exports.utcMonths = utcMonths; -exports.utcSaturday = utcSaturday; -exports.utcSaturdays = utcSaturdays; -exports.utcSecond = second; -exports.utcSeconds = seconds; -exports.utcSunday = utcSunday; -exports.utcSundays = utcSundays; -exports.utcThursday = utcThursday; -exports.utcThursdays = utcThursdays; -exports.utcTuesday = utcTuesday; -exports.utcTuesdays = utcTuesdays; -exports.utcWednesday = utcWednesday; -exports.utcWednesdays = utcWednesdays; -exports.utcWeek = utcSunday; -exports.utcWeeks = utcSundays; -exports.utcYear = utcYear; -exports.utcYears = utcYears; + var nparams = { + levels: [[], [], []] + } + for (var id in params) { + nparams[id] = params[id] + } + nparams.colormap = nparams.colormap || 'jet' -Object.defineProperty(exports, '__esModule', { value: true }); + surface.update(nparams) -})); + return surface +} + +},{"./lib/shaders":255,"binary-search-bounds":92,"bit-twiddle":93,"colormap":124,"gl-buffer":171,"gl-mat4/invert":203,"gl-mat4/multiply":205,"gl-texture2d":257,"gl-vao":261,"ndarray":376,"ndarray-gradient":369,"ndarray-ops":371,"ndarray-pack":372,"surface-nets":468,"typedarray-pool":477}],257:[function(_dereq_,module,exports){ +'use strict' + +var ndarray = _dereq_('ndarray') +var ops = _dereq_('ndarray-ops') +var pool = _dereq_('typedarray-pool') + +module.exports = createTexture2D + +var linearTypes = null +var filterTypes = null +var wrapTypes = null + +function lazyInitLinearTypes(gl) { + linearTypes = [ + gl.LINEAR, + gl.NEAREST_MIPMAP_LINEAR, + gl.LINEAR_MIPMAP_NEAREST, + gl.LINEAR_MIPMAP_NEAREST + ] + filterTypes = [ + gl.NEAREST, + gl.LINEAR, + gl.NEAREST_MIPMAP_NEAREST, + gl.NEAREST_MIPMAP_LINEAR, + gl.LINEAR_MIPMAP_NEAREST, + gl.LINEAR_MIPMAP_LINEAR + ] + wrapTypes = [ + gl.REPEAT, + gl.CLAMP_TO_EDGE, + gl.MIRRORED_REPEAT + ] +} + +function acceptTextureDOM (obj) { + return ( + ('undefined' != typeof HTMLCanvasElement && obj instanceof HTMLCanvasElement) || + ('undefined' != typeof HTMLImageElement && obj instanceof HTMLImageElement) || + ('undefined' != typeof HTMLVideoElement && obj instanceof HTMLVideoElement) || + ('undefined' != typeof ImageData && obj instanceof ImageData)) +} + +var convertFloatToUint8 = function(out, inp) { + ops.muls(out, inp, 255.0) +} + +function reshapeTexture(tex, w, h) { + var gl = tex.gl + var maxSize = gl.getParameter(gl.MAX_TEXTURE_SIZE) + if(w < 0 || w > maxSize || h < 0 || h > maxSize) { + throw new Error('gl-texture2d: Invalid texture size') + } + tex._shape = [w, h] + tex.bind() + gl.texImage2D(gl.TEXTURE_2D, 0, tex.format, w, h, 0, tex.format, tex.type, null) + tex._mipLevels = [0] + return tex +} + +function Texture2D(gl, handle, width, height, format, type) { + this.gl = gl + this.handle = handle + this.format = format + this.type = type + this._shape = [width, height] + this._mipLevels = [0] + this._magFilter = gl.NEAREST + this._minFilter = gl.NEAREST + this._wrapS = gl.CLAMP_TO_EDGE + this._wrapT = gl.CLAMP_TO_EDGE + this._anisoSamples = 1 + + var parent = this + var wrapVector = [this._wrapS, this._wrapT] + Object.defineProperties(wrapVector, [ + { + get: function() { + return parent._wrapS + }, + set: function(v) { + return parent.wrapS = v + } + }, + { + get: function() { + return parent._wrapT + }, + set: function(v) { + return parent.wrapT = v + } + } + ]) + this._wrapVector = wrapVector + + var shapeVector = [this._shape[0], this._shape[1]] + Object.defineProperties(shapeVector, [ + { + get: function() { + return parent._shape[0] + }, + set: function(v) { + return parent.width = v + } + }, + { + get: function() { + return parent._shape[1] + }, + set: function(v) { + return parent.height = v + } + } + ]) + this._shapeVector = shapeVector +} + +var proto = Texture2D.prototype + +Object.defineProperties(proto, { + minFilter: { + get: function() { + return this._minFilter + }, + set: function(v) { + this.bind() + var gl = this.gl + if(this.type === gl.FLOAT && linearTypes.indexOf(v) >= 0) { + if(!gl.getExtension('OES_texture_float_linear')) { + v = gl.NEAREST + } + } + if(filterTypes.indexOf(v) < 0) { + throw new Error('gl-texture2d: Unknown filter mode ' + v) + } + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, v) + return this._minFilter = v + } + }, + magFilter: { + get: function() { + return this._magFilter + }, + set: function(v) { + this.bind() + var gl = this.gl + if(this.type === gl.FLOAT && linearTypes.indexOf(v) >= 0) { + if(!gl.getExtension('OES_texture_float_linear')) { + v = gl.NEAREST + } + } + if(filterTypes.indexOf(v) < 0) { + throw new Error('gl-texture2d: Unknown filter mode ' + v) + } + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, v) + return this._magFilter = v + } + }, + mipSamples: { + get: function() { + return this._anisoSamples + }, + set: function(i) { + var psamples = this._anisoSamples + this._anisoSamples = Math.max(i, 1)|0 + if(psamples !== this._anisoSamples) { + var ext = this.gl.getExtension('EXT_texture_filter_anisotropic') + if(ext) { + this.gl.texParameterf(this.gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, this._anisoSamples) + } + } + return this._anisoSamples + } + }, + wrapS: { + get: function() { + return this._wrapS + }, + set: function(v) { + this.bind() + if(wrapTypes.indexOf(v) < 0) { + throw new Error('gl-texture2d: Unknown wrap mode ' + v) + } + this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_WRAP_S, v) + return this._wrapS = v + } + }, + wrapT: { + get: function() { + return this._wrapT + }, + set: function(v) { + this.bind() + if(wrapTypes.indexOf(v) < 0) { + throw new Error('gl-texture2d: Unknown wrap mode ' + v) + } + this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_WRAP_T, v) + return this._wrapT = v + } + }, + wrap: { + get: function() { + return this._wrapVector + }, + set: function(v) { + if(!Array.isArray(v)) { + v = [v,v] + } + if(v.length !== 2) { + throw new Error('gl-texture2d: Must specify wrap mode for rows and columns') + } + for(var i=0; i<2; ++i) { + if(wrapTypes.indexOf(v[i]) < 0) { + throw new Error('gl-texture2d: Unknown wrap mode ' + v) + } + } + this._wrapS = v[0] + this._wrapT = v[1] -},{}],78:[function(_dereq_,module,exports){ -arguments[4][77][0].apply(exports,arguments) -},{"dup":77}],79:[function(_dereq_,module,exports){ -// https://d3js.org/d3-timer/ v1.0.10 Copyright 2019 Mike Bostock -(function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : -typeof define === 'function' && define.amd ? define(['exports'], factory) : -(global = global || self, factory(global.d3 = global.d3 || {})); -}(this, function (exports) { 'use strict'; + var gl = this.gl + this.bind() + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this._wrapS) + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this._wrapT) -var frame = 0, // is an animation frame pending? - timeout = 0, // is a timeout pending? - interval = 0, // are any timers active? - pokeDelay = 1000, // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = typeof performance === "object" && performance.now ? performance : Date, - setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; + return v + } + }, + shape: { + get: function() { + return this._shapeVector + }, + set: function(x) { + if(!Array.isArray(x)) { + x = [x|0,x|0] + } else { + if(x.length !== 2) { + throw new Error('gl-texture2d: Invalid texture shape') + } + } + reshapeTexture(this, x[0]|0, x[1]|0) + return [x[0]|0, x[1]|0] + } + }, + width: { + get: function() { + return this._shape[0] + }, + set: function(w) { + w = w|0 + reshapeTexture(this, w, this._shape[1]) + return w + } + }, + height: { + get: function() { + return this._shape[1] + }, + set: function(h) { + h = h|0 + reshapeTexture(this, this._shape[0], h) + return h + } + } +}) -function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); +proto.bind = function(unit) { + var gl = this.gl + if(unit !== undefined) { + gl.activeTexture(gl.TEXTURE0 + (unit|0)) + } + gl.bindTexture(gl.TEXTURE_2D, this.handle) + if(unit !== undefined) { + return (unit|0) + } + return gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0 } -function clearNow() { - clockNow = 0; +proto.dispose = function() { + this.gl.deleteTexture(this.handle) } -function Timer() { - this._call = - this._time = - this._next = null; +proto.generateMipmap = function() { + this.bind() + this.gl.generateMipmap(this.gl.TEXTURE_2D) + + //Update mip levels + var l = Math.min(this._shape[0], this._shape[1]) + for(var i=0; l>0; ++i, l>>>=1) { + if(this._mipLevels.indexOf(i) < 0) { + this._mipLevels.push(i) + } + } } -Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; +proto.setPixels = function(data, x_off, y_off, mip_level) { + var gl = this.gl + this.bind() + if(Array.isArray(x_off)) { + mip_level = y_off + y_off = x_off[1]|0 + x_off = x_off[0]|0 + } else { + x_off = x_off || 0 + y_off = y_off || 0 + } + mip_level = mip_level || 0 + var directData = acceptTextureDOM(data) ? data : data.raw + if(directData) { + var needsMip = this._mipLevels.indexOf(mip_level) < 0 + if(needsMip) { + gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, directData) + this._mipLevels.push(mip_level) + } else { + gl.texSubImage2D(gl.TEXTURE_2D, mip_level, x_off, y_off, this.format, this.type, directData) } - this._call = callback; - this._time = time; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); + } else if(data.shape && data.stride && data.data) { + if(data.shape.length < 2 || + x_off + data.shape[1] > this._shape[1]>>>mip_level || + y_off + data.shape[0] > this._shape[0]>>>mip_level || + x_off < 0 || + y_off < 0) { + throw new Error('gl-texture2d: Texture dimensions are out of bounds') } + texSubImageArray(gl, x_off, y_off, mip_level, this.format, this.type, this._mipLevels, data) + } else { + throw new Error('gl-texture2d: Unsupported data type') } -}; +} -function timer(callback, delay, time) { - var t = new Timer; - t.restart(callback, delay, time); - return t; + +function isPacked(shape, stride) { + if(shape.length === 3) { + return (stride[2] === 1) && + (stride[1] === shape[0]*shape[2]) && + (stride[0] === shape[2]) + } + return (stride[0] === 1) && + (stride[1] === shape[0]) } -function timerFlush() { - now(); // Get the current time, if not already set. - ++frame; // Pretend we’ve set an alarm, if we haven’t already. - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(null, e); - t = t._next; +function texSubImageArray(gl, x_off, y_off, mip_level, cformat, ctype, mipLevels, array) { + var dtype = array.dtype + var shape = array.shape.slice() + if(shape.length < 2 || shape.length > 3) { + throw new Error('gl-texture2d: Invalid ndarray, must be 2d or 3d') + } + var type = 0, format = 0 + var packed = isPacked(shape, array.stride.slice()) + if(dtype === 'float32') { + type = gl.FLOAT + } else if(dtype === 'float64') { + type = gl.FLOAT + packed = false + dtype = 'float32' + } else if(dtype === 'uint8') { + type = gl.UNSIGNED_BYTE + } else { + type = gl.UNSIGNED_BYTE + packed = false + dtype = 'uint8' + } + var channels = 1 + if(shape.length === 2) { + format = gl.LUMINANCE + shape = [shape[0], shape[1], 1] + array = ndarray(array.data, shape, [array.stride[0], array.stride[1], 1], array.offset) + } else if(shape.length === 3) { + if(shape[2] === 1) { + format = gl.ALPHA + } else if(shape[2] === 2) { + format = gl.LUMINANCE_ALPHA + } else if(shape[2] === 3) { + format = gl.RGB + } else if(shape[2] === 4) { + format = gl.RGBA + } else { + throw new Error('gl-texture2d: Invalid shape for pixel coords') + } + channels = shape[2] + } else { + throw new Error('gl-texture2d: Invalid shape for texture') + } + //For 1-channel textures allow conversion between formats + if((format === gl.LUMINANCE || format === gl.ALPHA) && + (cformat === gl.LUMINANCE || cformat === gl.ALPHA)) { + format = cformat + } + if(format !== cformat) { + throw new Error('gl-texture2d: Incompatible texture format for setPixels') + } + var size = array.size + var needsMip = mipLevels.indexOf(mip_level) < 0 + if(needsMip) { + mipLevels.push(mip_level) + } + if(type === ctype && packed) { + //Array data types are compatible, can directly copy into texture + if(array.offset === 0 && array.data.length === size) { + if(needsMip) { + gl.texImage2D(gl.TEXTURE_2D, mip_level, cformat, shape[0], shape[1], 0, cformat, ctype, array.data) + } else { + gl.texSubImage2D(gl.TEXTURE_2D, mip_level, x_off, y_off, shape[0], shape[1], cformat, ctype, array.data) + } + } else { + if(needsMip) { + gl.texImage2D(gl.TEXTURE_2D, mip_level, cformat, shape[0], shape[1], 0, cformat, ctype, array.data.subarray(array.offset, array.offset+size)) + } else { + gl.texSubImage2D(gl.TEXTURE_2D, mip_level, x_off, y_off, shape[0], shape[1], cformat, ctype, array.data.subarray(array.offset, array.offset+size)) + } + } + } else { + //Need to do type conversion to pack data into buffer + var pack_buffer + if(ctype === gl.FLOAT) { + pack_buffer = pool.mallocFloat32(size) + } else { + pack_buffer = pool.mallocUint8(size) + } + var pack_view = ndarray(pack_buffer, shape, [shape[2], shape[2]*shape[0], 1]) + if(type === gl.FLOAT && ctype === gl.UNSIGNED_BYTE) { + convertFloatToUint8(pack_view, array) + } else { + ops.assign(pack_view, array) + } + if(needsMip) { + gl.texImage2D(gl.TEXTURE_2D, mip_level, cformat, shape[0], shape[1], 0, cformat, ctype, pack_buffer.subarray(0, size)) + } else { + gl.texSubImage2D(gl.TEXTURE_2D, mip_level, x_off, y_off, shape[0], shape[1], cformat, ctype, pack_buffer.subarray(0, size)) + } + if(ctype === gl.FLOAT) { + pool.freeFloat32(pack_buffer) + } else { + pool.freeUint8(pack_buffer) + } } - --frame; } -function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame = timeout = 0; - try { - timerFlush(); - } finally { - frame = 0; - nap(); - clockNow = 0; +function initTexture(gl) { + var tex = gl.createTexture() + gl.bindTexture(gl.TEXTURE_2D, tex) + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST) + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST) + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE) + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE) + return tex +} + +function createTextureShape(gl, width, height, format, type) { + var maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE) + if(width < 0 || width > maxTextureSize || height < 0 || height > maxTextureSize) { + throw new Error('gl-texture2d: Invalid texture shape') + } + if(type === gl.FLOAT && !gl.getExtension('OES_texture_float')) { + throw new Error('gl-texture2d: Floating point textures not supported on this platform') } + var tex = initTexture(gl) + gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, type, null) + return new Texture2D(gl, tex, width, height, format, type) } -function poke() { - var now = clock.now(), delay = now - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now; +function createTextureDOM(gl, directData, width, height, format, type) { + var tex = initTexture(gl) + gl.texImage2D(gl.TEXTURE_2D, 0, format, format, type, directData) + return new Texture2D(gl, tex, width, height, format, type) } -function nap() { - var t0, t1 = taskHead, t2, time = Infinity; - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - t0 = t1, t1 = t1._next; +//Creates a texture from an ndarray +function createTextureArray(gl, array) { + var dtype = array.dtype + var shape = array.shape.slice() + var maxSize = gl.getParameter(gl.MAX_TEXTURE_SIZE) + if(shape[0] < 0 || shape[0] > maxSize || shape[1] < 0 || shape[1] > maxSize) { + throw new Error('gl-texture2d: Invalid texture size') + } + var packed = isPacked(shape, array.stride.slice()) + var type = 0 + if(dtype === 'float32') { + type = gl.FLOAT + } else if(dtype === 'float64') { + type = gl.FLOAT + packed = false + dtype = 'float32' + } else if(dtype === 'uint8') { + type = gl.UNSIGNED_BYTE + } else { + type = gl.UNSIGNED_BYTE + packed = false + dtype = 'uint8' + } + var format = 0 + if(shape.length === 2) { + format = gl.LUMINANCE + shape = [shape[0], shape[1], 1] + array = ndarray(array.data, shape, [array.stride[0], array.stride[1], 1], array.offset) + } else if(shape.length === 3) { + if(shape[2] === 1) { + format = gl.ALPHA + } else if(shape[2] === 2) { + format = gl.LUMINANCE_ALPHA + } else if(shape[2] === 3) { + format = gl.RGB + } else if(shape[2] === 4) { + format = gl.RGBA } else { - t2 = t1._next, t1._next = null; - t1 = t0 ? t0._next = t2 : taskHead = t2; + throw new Error('gl-texture2d: Invalid shape for pixel coords') + } + } else { + throw new Error('gl-texture2d: Invalid shape for texture') + } + if(type === gl.FLOAT && !gl.getExtension('OES_texture_float')) { + type = gl.UNSIGNED_BYTE + packed = false + } + var buffer, buf_store + var size = array.size + if(!packed) { + var stride = [shape[2], shape[2]*shape[0], 1] + buf_store = pool.malloc(size, dtype) + var buf_array = ndarray(buf_store, shape, stride, 0) + if((dtype === 'float32' || dtype === 'float64') && type === gl.UNSIGNED_BYTE) { + convertFloatToUint8(buf_array, array) + } else { + ops.assign(buf_array, array) } + buffer = buf_store.subarray(0, size) + } else if (array.offset === 0 && array.data.length === size) { + buffer = array.data + } else { + buffer = array.data.subarray(array.offset, array.offset + size) } - taskTail = t0; - sleep(time); + var tex = initTexture(gl) + gl.texImage2D(gl.TEXTURE_2D, 0, format, shape[0], shape[1], 0, format, type, buffer) + if(!packed) { + pool.free(buf_store) + } + return new Texture2D(gl, tex, shape[0], shape[1], format, type) } -function sleep(time) { - if (frame) return; // Soonest alarm already set, or will be. - if (timeout) timeout = clearTimeout(timeout); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - if (delay > 24) { - if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); - if (interval) interval = clearInterval(interval); - } else { - if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); - frame = 1, setFrame(wake); +function createTexture2D(gl) { + if(arguments.length <= 1) { + throw new Error('gl-texture2d: Missing arguments for texture2d constructor') + } + if(!linearTypes) { + lazyInitLinearTypes(gl) + } + if(typeof arguments[1] === 'number') { + return createTextureShape(gl, arguments[1], arguments[2], arguments[3]||gl.RGBA, arguments[4]||gl.UNSIGNED_BYTE) } + if(Array.isArray(arguments[1])) { + return createTextureShape(gl, arguments[1][0]|0, arguments[1][1]|0, arguments[2]||gl.RGBA, arguments[3]||gl.UNSIGNED_BYTE) + } + if(typeof arguments[1] === 'object') { + var obj = arguments[1] + var directData = acceptTextureDOM(obj) ? obj : obj.raw + if (directData) { + return createTextureDOM(gl, directData, obj.width|0, obj.height|0, arguments[2]||gl.RGBA, arguments[3]||gl.UNSIGNED_BYTE) + } else if(obj.shape && obj.data && obj.stride) { + return createTextureArray(gl, obj) + } + } + throw new Error('gl-texture2d: Invalid arguments for texture2d constructor') } -function timeout$1(callback, delay, time) { - var t = new Timer; - delay = delay == null ? 0 : +delay; - t.restart(function(elapsed) { - t.stop(); - callback(elapsed + delay); - }, delay, time); - return t; -} +},{"ndarray":376,"ndarray-ops":371,"typedarray-pool":477}],258:[function(_dereq_,module,exports){ +"use strict" -function interval$1(callback, delay, time) { - var t = new Timer, total = delay; - if (delay == null) return t.restart(callback, delay, time), t; - delay = +delay, time = time == null ? now() : +time; - t.restart(function tick(elapsed) { - elapsed += total; - t.restart(tick, total += delay, time); - callback(elapsed); - }, delay, time); - return t; +function doBind(gl, elements, attributes) { + if(elements) { + elements.bind() + } else { + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null) + } + var nattribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS)|0 + if(attributes) { + if(attributes.length > nattribs) { + throw new Error("gl-vao: Too many vertex attributes") + } + for(var i=0; i= minId; - }); - } - } +function VAONative(gl, ext, handle) { + this.gl = gl + this._ext = ext + this.handle = handle + this._attribs = [] + this._useElements = false + this._elementsType = gl.UNSIGNED_SHORT +} - function adjacencyStructureSCC(from) { - // Make subgraph starting from vertex minId - subgraph(from); - var g = edges; +VAONative.prototype.bind = function() { + this._ext.bindVertexArrayOES(this.handle) + for(var i=0; i 1; - }); +VAONative.prototype.dispose = function() { + this._ext.deleteVertexArrayOES(this.handle) +} - // Find least vertex - var leastVertex = Infinity; - var leastVertexComponent; - for(var i = 0; i < ccs.length; i++) { - for(var j = 0; j < ccs[i].length; j++) { - if(ccs[i][j] < leastVertex) { - leastVertex = ccs[i][j]; - leastVertexComponent = i; - } - } - } +VAONative.prototype.update = function(attributes, elements, elementsType) { + this.bind() + bindAttribs(this.gl, elements, attributes) + this.unbind() + this._attribs.length = 0 + if(attributes) + for(var i=0; i - * but significantly simplified and sped up by ignoring number and string constructors - * ie these return false: - * new Number(1) - * new String('1') + * Adds two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out */ +function add(out, a, b) { + out[0] = a[0] + b[0] + out[1] = a[1] + b[1] + out[2] = a[2] + b[2] + return out +} +},{}],263:[function(_dereq_,module,exports){ +module.exports = angle -'use strict'; - -var allBlankCharCodes = _dereq_('is-string-blank'); - -module.exports = function(n) { - var type = typeof n; - if(type === 'string') { - var original = n; - n = +n; - // whitespace strings cast to zero - filter them out - if(n===0 && allBlankCharCodes(original)) return false; - } - else if(type !== 'number') return false; +var fromValues = _dereq_('./fromValues') +var normalize = _dereq_('./normalize') +var dot = _dereq_('./dot') - return n - n < 1; -}; +/** + * Get the angle between two 3D vectors + * @param {vec3} a The first operand + * @param {vec3} b The second operand + * @returns {Number} The angle in radians + */ +function angle(a, b) { + var tempA = fromValues(a[0], a[1], a[2]) + var tempB = fromValues(b[0], b[1], b[2]) + + normalize(tempA, tempA) + normalize(tempB, tempB) + + var cosine = dot(tempA, tempB) + + if(cosine > 1.0){ + return 0 + } else { + return Math.acos(cosine) + } +} -},{"is-string-blank":118}],82:[function(_dereq_,module,exports){ -module.exports = adjoint; +},{"./dot":273,"./fromValues":279,"./normalize":290}],264:[function(_dereq_,module,exports){ +module.exports = ceil /** - * Calculates the adjugate of a mat4 + * Math.ceil the components of a vec3 * - * @param {mat4} out the receiving matrix - * @param {mat4} a the source matrix - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a vector to ceil + * @returns {vec3} out */ -function adjoint(out, a) { - var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], - a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], - a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], - a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; +function ceil(out, a) { + out[0] = Math.ceil(a[0]) + out[1] = Math.ceil(a[1]) + out[2] = Math.ceil(a[2]) + return out +} - out[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - out[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - out[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - out[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - out[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - out[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - out[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - return out; -}; -},{}],83:[function(_dereq_,module,exports){ +},{}],265:[function(_dereq_,module,exports){ module.exports = clone; /** - * Creates a new mat4 initialized with values from an existing matrix + * Creates a new vec3 initialized with values from an existing vector * - * @param {mat4} a matrix to clone - * @returns {mat4} a new 4x4 matrix + * @param {vec3} a vector to clone + * @returns {vec3} a new 3D vector */ function clone(a) { - var out = new Float32Array(16); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -}; -},{}],84:[function(_dereq_,module,exports){ + var out = new Float32Array(3) + out[0] = a[0] + out[1] = a[1] + out[2] = a[2] + return out +} +},{}],266:[function(_dereq_,module,exports){ module.exports = copy; /** - * Copy the values from one mat4 to another + * Copy the values from one vec3 to another * - * @param {mat4} out the receiving matrix - * @param {mat4} a the source matrix - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a the source vector + * @returns {vec3} out */ function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -}; -},{}],85:[function(_dereq_,module,exports){ + out[0] = a[0] + out[1] = a[1] + out[2] = a[2] + return out +} +},{}],267:[function(_dereq_,module,exports){ module.exports = create; /** - * Creates a new identity mat4 + * Creates a new, empty vec3 * - * @returns {mat4} a new 4x4 matrix + * @returns {vec3} a new 3D vector */ function create() { - var out = new Float32Array(16); - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -}; -},{}],86:[function(_dereq_,module,exports){ -module.exports = determinant; + var out = new Float32Array(3) + out[0] = 0 + out[1] = 0 + out[2] = 0 + return out +} +},{}],268:[function(_dereq_,module,exports){ +module.exports = cross; /** - * Calculates the determinant of a mat4 + * Computes the cross product of two vec3's * - * @param {mat4} a the source matrix - * @returns {Number} determinant of a + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out */ -function determinant(a) { - var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], - a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], - a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], - a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], +function cross(out, a, b) { + var ax = a[0], ay = a[1], az = a[2], + bx = b[0], by = b[1], bz = b[2] - b00 = a00 * a11 - a01 * a10, - b01 = a00 * a12 - a02 * a10, - b02 = a00 * a13 - a03 * a10, - b03 = a01 * a12 - a02 * a11, - b04 = a01 * a13 - a03 * a11, - b05 = a02 * a13 - a03 * a12, - b06 = a20 * a31 - a21 * a30, - b07 = a20 * a32 - a22 * a30, - b08 = a20 * a33 - a23 * a30, - b09 = a21 * a32 - a22 * a31, - b10 = a21 * a33 - a23 * a31, - b11 = a22 * a33 - a23 * a32; + out[0] = ay * bz - az * by + out[1] = az * bx - ax * bz + out[2] = ax * by - ay * bx + return out +} +},{}],269:[function(_dereq_,module,exports){ +module.exports = _dereq_('./distance') - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; -}; -},{}],87:[function(_dereq_,module,exports){ -module.exports = fromQuat; +},{"./distance":270}],270:[function(_dereq_,module,exports){ +module.exports = distance; /** - * Creates a matrix from a quaternion rotation. + * Calculates the euclidian distance between two vec3's * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @returns {mat4} out + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {Number} distance between a and b */ -function fromQuat(out, q) { - var x = q[0], y = q[1], z = q[2], w = q[3], - x2 = x + x, - y2 = y + y, - z2 = z + z, - - xx = x * x2, - yx = y * x2, - yy = y * y2, - zx = z * x2, - zy = z * y2, - zz = z * z2, - wx = w * x2, - wy = w * y2, - wz = w * z2; +function distance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2] + return Math.sqrt(x*x + y*y + z*z) +} +},{}],271:[function(_dereq_,module,exports){ +module.exports = _dereq_('./divide') - out[0] = 1 - yy - zz; - out[1] = yx + wz; - out[2] = zx - wy; - out[3] = 0; +},{"./divide":272}],272:[function(_dereq_,module,exports){ +module.exports = divide; - out[4] = yx - wz; - out[5] = 1 - xx - zz; - out[6] = zy + wx; - out[7] = 0; +/** + * Divides two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +function divide(out, a, b) { + out[0] = a[0] / b[0] + out[1] = a[1] / b[1] + out[2] = a[2] / b[2] + return out +} +},{}],273:[function(_dereq_,module,exports){ +module.exports = dot; - out[8] = zx + wy; - out[9] = zy - wx; - out[10] = 1 - xx - yy; - out[11] = 0; +/** + * Calculates the dot product of two vec3's + * + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {Number} dot product of a and b + */ +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] +} +},{}],274:[function(_dereq_,module,exports){ +module.exports = 0.000001 - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; +},{}],275:[function(_dereq_,module,exports){ +module.exports = equals - return out; -}; -},{}],88:[function(_dereq_,module,exports){ -module.exports = fromRotation +var EPSILON = _dereq_('./epsilon') /** - * Creates a matrix from a given angle around a given axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest) - * mat4.rotate(dest, dest, rad, axis) + * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @param {vec3} axis the axis to rotate around - * @returns {mat4} out + * @param {vec3} a The first vector. + * @param {vec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. */ -function fromRotation(out, rad, axis) { - var s, c, t - var x = axis[0] - var y = axis[1] - var z = axis[2] - var len = Math.sqrt(x * x + y * y + z * z) +function equals(a, b) { + var a0 = a[0] + var a1 = a[1] + var a2 = a[2] + var b0 = b[0] + var b1 = b[1] + var b2 = b[2] + return (Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))) +} - if (Math.abs(len) < 0.000001) { - return null - } +},{"./epsilon":274}],276:[function(_dereq_,module,exports){ +module.exports = exactEquals - len = 1 / len - x *= len - y *= len - z *= len +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {vec3} a The first vector. + * @param {vec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] +} - s = Math.sin(rad) - c = Math.cos(rad) - t = 1 - c +},{}],277:[function(_dereq_,module,exports){ +module.exports = floor - // Perform rotation-specific matrix multiplication - out[0] = x * x * t + c - out[1] = y * x * t + z * s - out[2] = z * x * t - y * s - out[3] = 0 - out[4] = x * y * t - z * s - out[5] = y * y * t + c - out[6] = z * y * t + x * s - out[7] = 0 - out[8] = x * z * t + y * s - out[9] = y * z * t - x * s - out[10] = z * z * t + c - out[11] = 0 - out[12] = 0 - out[13] = 0 - out[14] = 0 - out[15] = 1 +/** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to floor + * @returns {vec3} out + */ +function floor(out, a) { + out[0] = Math.floor(a[0]) + out[1] = Math.floor(a[1]) + out[2] = Math.floor(a[2]) return out } -},{}],89:[function(_dereq_,module,exports){ -module.exports = fromRotationTranslation; +},{}],278:[function(_dereq_,module,exports){ +module.exports = forEach; + +var vec = _dereq_('./create')() /** - * Creates a matrix from a quaternion rotation and vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * var quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * Perform some operation over an array of vec3s. * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {vec3} v Translation vector - * @returns {mat4} out + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function */ -function fromRotationTranslation(out, q, v) { - // Quaternion math - var x = q[0], y = q[1], z = q[2], w = q[3], - x2 = x + x, - y2 = y + y, - z2 = z + z, +function forEach(a, stride, offset, count, fn, arg) { + var i, l + if(!stride) { + stride = 3 + } - xx = x * x2, - xy = x * y2, - xz = x * z2, - yy = y * y2, - yz = y * z2, - zz = z * z2, - wx = w * x2, - wy = w * y2, - wz = w * z2; + if(!offset) { + offset = 0 + } + + if(count) { + l = Math.min((count * stride) + offset, a.length) + } else { + l = a.length + } - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - - return out; -}; -},{}],90:[function(_dereq_,module,exports){ -module.exports = fromScaling + for(i = offset; i < l; i += stride) { + vec[0] = a[i] + vec[1] = a[i+1] + vec[2] = a[i+2] + fn(vec, vec, arg) + a[i] = vec[0] + a[i+1] = vec[1] + a[i+2] = vec[2] + } + + return a +} +},{"./create":267}],279:[function(_dereq_,module,exports){ +module.exports = fromValues; /** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat4.identity(dest) - * mat4.scale(dest, dest, vec) + * Creates a new vec3 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} a new 3D vector + */ +function fromValues(x, y, z) { + var out = new Float32Array(3) + out[0] = x + out[1] = y + out[2] = z + return out +} +},{}],280:[function(_dereq_,module,exports){ +module.exports = { + EPSILON: _dereq_('./epsilon') + , create: _dereq_('./create') + , clone: _dereq_('./clone') + , angle: _dereq_('./angle') + , fromValues: _dereq_('./fromValues') + , copy: _dereq_('./copy') + , set: _dereq_('./set') + , equals: _dereq_('./equals') + , exactEquals: _dereq_('./exactEquals') + , add: _dereq_('./add') + , subtract: _dereq_('./subtract') + , sub: _dereq_('./sub') + , multiply: _dereq_('./multiply') + , mul: _dereq_('./mul') + , divide: _dereq_('./divide') + , div: _dereq_('./div') + , min: _dereq_('./min') + , max: _dereq_('./max') + , floor: _dereq_('./floor') + , ceil: _dereq_('./ceil') + , round: _dereq_('./round') + , scale: _dereq_('./scale') + , scaleAndAdd: _dereq_('./scaleAndAdd') + , distance: _dereq_('./distance') + , dist: _dereq_('./dist') + , squaredDistance: _dereq_('./squaredDistance') + , sqrDist: _dereq_('./sqrDist') + , length: _dereq_('./length') + , len: _dereq_('./len') + , squaredLength: _dereq_('./squaredLength') + , sqrLen: _dereq_('./sqrLen') + , negate: _dereq_('./negate') + , inverse: _dereq_('./inverse') + , normalize: _dereq_('./normalize') + , dot: _dereq_('./dot') + , cross: _dereq_('./cross') + , lerp: _dereq_('./lerp') + , random: _dereq_('./random') + , transformMat4: _dereq_('./transformMat4') + , transformMat3: _dereq_('./transformMat3') + , transformQuat: _dereq_('./transformQuat') + , rotateX: _dereq_('./rotateX') + , rotateY: _dereq_('./rotateY') + , rotateZ: _dereq_('./rotateZ') + , forEach: _dereq_('./forEach') +} + +},{"./add":262,"./angle":263,"./ceil":264,"./clone":265,"./copy":266,"./create":267,"./cross":268,"./dist":269,"./distance":270,"./div":271,"./divide":272,"./dot":273,"./epsilon":274,"./equals":275,"./exactEquals":276,"./floor":277,"./forEach":278,"./fromValues":279,"./inverse":281,"./len":282,"./length":283,"./lerp":284,"./max":285,"./min":286,"./mul":287,"./multiply":288,"./negate":289,"./normalize":290,"./random":291,"./rotateX":292,"./rotateY":293,"./rotateZ":294,"./round":295,"./scale":296,"./scaleAndAdd":297,"./set":298,"./sqrDist":299,"./sqrLen":300,"./squaredDistance":301,"./squaredLength":302,"./sub":303,"./subtract":304,"./transformMat3":305,"./transformMat4":306,"./transformQuat":307}],281:[function(_dereq_,module,exports){ +module.exports = inverse; + +/** + * Returns the inverse of the components of a vec3 * - * @param {mat4} out mat4 receiving operation result - * @param {vec3} v Scaling vector - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a vector to invert + * @returns {vec3} out */ -function fromScaling(out, v) { - out[0] = v[0] - out[1] = 0 - out[2] = 0 - out[3] = 0 - out[4] = 0 - out[5] = v[1] - out[6] = 0 - out[7] = 0 - out[8] = 0 - out[9] = 0 - out[10] = v[2] - out[11] = 0 - out[12] = 0 - out[13] = 0 - out[14] = 0 - out[15] = 1 +function inverse(out, a) { + out[0] = 1.0 / a[0] + out[1] = 1.0 / a[1] + out[2] = 1.0 / a[2] return out } +},{}],282:[function(_dereq_,module,exports){ +module.exports = _dereq_('./length') -},{}],91:[function(_dereq_,module,exports){ -module.exports = fromTranslation +},{"./length":283}],283:[function(_dereq_,module,exports){ +module.exports = length; /** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest) - * mat4.translate(dest, dest, vec) + * Calculates the length of a vec3 * - * @param {mat4} out mat4 receiving operation result - * @param {vec3} v Translation vector - * @returns {mat4} out + * @param {vec3} a vector to calculate length of + * @returns {Number} length of a */ -function fromTranslation(out, v) { - out[0] = 1 - out[1] = 0 - out[2] = 0 - out[3] = 0 - out[4] = 0 - out[5] = 1 - out[6] = 0 - out[7] = 0 - out[8] = 0 - out[9] = 0 - out[10] = 1 - out[11] = 0 - out[12] = v[0] - out[13] = v[1] - out[14] = v[2] - out[15] = 1 - return out +function length(a) { + var x = a[0], + y = a[1], + z = a[2] + return Math.sqrt(x*x + y*y + z*z) } +},{}],284:[function(_dereq_,module,exports){ +module.exports = lerp; -},{}],92:[function(_dereq_,module,exports){ -module.exports = fromXRotation +/** + * Performs a linear interpolation between two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec3} out + */ +function lerp(out, a, b, t) { + var ax = a[0], + ay = a[1], + az = a[2] + out[0] = ax + t * (b[0] - ax) + out[1] = ay + t * (b[1] - ay) + out[2] = az + t * (b[2] - az) + return out +} +},{}],285:[function(_dereq_,module,exports){ +module.exports = max; /** - * Creates a matrix from the given angle around the X axis - * This is equivalent to (but much faster than): + * Returns the maximum of two vec3's * - * mat4.identity(dest) - * mat4.rotateX(dest, dest, rad) - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out */ -function fromXRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad) - - // Perform axis-specific matrix multiplication - out[0] = 1 - out[1] = 0 - out[2] = 0 - out[3] = 0 - out[4] = 0 - out[5] = c - out[6] = s - out[7] = 0 - out[8] = 0 - out[9] = -s - out[10] = c - out[11] = 0 - out[12] = 0 - out[13] = 0 - out[14] = 0 - out[15] = 1 +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]) + out[1] = Math.max(a[1], b[1]) + out[2] = Math.max(a[2], b[2]) return out } -},{}],93:[function(_dereq_,module,exports){ -module.exports = fromYRotation +},{}],286:[function(_dereq_,module,exports){ +module.exports = min; /** - * Creates a matrix from the given angle around the Y axis - * This is equivalent to (but much faster than): + * Returns the minimum of two vec3's * - * mat4.identity(dest) - * mat4.rotateY(dest, dest, rad) + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]) + out[1] = Math.min(a[1], b[1]) + out[2] = Math.min(a[2], b[2]) + return out +} +},{}],287:[function(_dereq_,module,exports){ +module.exports = _dereq_('./multiply') + +},{"./multiply":288}],288:[function(_dereq_,module,exports){ +module.exports = multiply; + +/** + * Multiplies two vec3's * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out */ -function fromYRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad) +function multiply(out, a, b) { + out[0] = a[0] * b[0] + out[1] = a[1] * b[1] + out[2] = a[2] * b[2] + return out +} +},{}],289:[function(_dereq_,module,exports){ +module.exports = negate; - // Perform axis-specific matrix multiplication - out[0] = c - out[1] = 0 - out[2] = -s - out[3] = 0 - out[4] = 0 - out[5] = 1 - out[6] = 0 - out[7] = 0 - out[8] = s - out[9] = 0 - out[10] = c - out[11] = 0 - out[12] = 0 - out[13] = 0 - out[14] = 0 - out[15] = 1 +/** + * Negates the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to negate + * @returns {vec3} out + */ +function negate(out, a) { + out[0] = -a[0] + out[1] = -a[1] + out[2] = -a[2] return out } -},{}],94:[function(_dereq_,module,exports){ -module.exports = fromZRotation +},{}],290:[function(_dereq_,module,exports){ +module.exports = normalize; /** - * Creates a matrix from the given angle around the Z axis - * This is equivalent to (but much faster than): + * Normalize a vec3 * - * mat4.identity(dest) - * mat4.rotateZ(dest, dest, rad) + * @param {vec3} out the receiving vector + * @param {vec3} a vector to normalize + * @returns {vec3} out + */ +function normalize(out, a) { + var x = a[0], + y = a[1], + z = a[2] + var len = x*x + y*y + z*z + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len) + out[0] = a[0] * len + out[1] = a[1] * len + out[2] = a[2] * len + } + return out +} +},{}],291:[function(_dereq_,module,exports){ +module.exports = random; + +/** + * Generates a random vector with the given scale * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec3} out */ -function fromZRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad) +function random(out, scale) { + scale = scale || 1.0 - // Perform axis-specific matrix multiplication - out[0] = c - out[1] = s - out[2] = 0 - out[3] = 0 - out[4] = -s - out[5] = c - out[6] = 0 - out[7] = 0 - out[8] = 0 - out[9] = 0 - out[10] = 1 - out[11] = 0 - out[12] = 0 - out[13] = 0 - out[14] = 0 - out[15] = 1 + var r = Math.random() * 2.0 * Math.PI + var z = (Math.random() * 2.0) - 1.0 + var zScale = Math.sqrt(1.0-z*z) * scale + + out[0] = Math.cos(r) * zScale + out[1] = Math.sin(r) * zScale + out[2] = z * scale return out } -},{}],95:[function(_dereq_,module,exports){ -module.exports = frustum; +},{}],292:[function(_dereq_,module,exports){ +module.exports = rotateX; /** - * Generates a frustum matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Number} left Left bound of the frustum - * @param {Number} right Right bound of the frustum - * @param {Number} bottom Bottom bound of the frustum - * @param {Number} top Top bound of the frustum - * @param {Number} near Near bound of the frustum - * @param {Number} far Far bound of the frustum - * @returns {mat4} out + * Rotate a 3D vector around the x-axis + * @param {vec3} out The receiving vec3 + * @param {vec3} a The vec3 point to rotate + * @param {vec3} b The origin of the rotation + * @param {Number} c The angle of rotation + * @returns {vec3} out */ -function frustum(out, left, right, bottom, top, near, far) { - var rl = 1 / (right - left), - tb = 1 / (top - bottom), - nf = 1 / (near - far); - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - return out; -}; -},{}],96:[function(_dereq_,module,exports){ -module.exports = identity; +function rotateX(out, a, b, c){ + var by = b[1] + var bz = b[2] + + // Translate point to the origin + var py = a[1] - by + var pz = a[2] - bz + + var sc = Math.sin(c) + var cc = Math.cos(c) + + // perform rotation and translate to correct position + out[0] = a[0] + out[1] = by + py * cc - pz * sc + out[2] = bz + py * sc + pz * cc + + return out +} + +},{}],293:[function(_dereq_,module,exports){ +module.exports = rotateY; /** - * Set a mat4 to the identity matrix + * Rotate a 3D vector around the y-axis + * @param {vec3} out The receiving vec3 + * @param {vec3} a The vec3 point to rotate + * @param {vec3} b The origin of the rotation + * @param {Number} c The angle of rotation + * @returns {vec3} out + */ +function rotateY(out, a, b, c){ + var bx = b[0] + var bz = b[2] + + // translate point to the origin + var px = a[0] - bx + var pz = a[2] - bz + + var sc = Math.sin(c) + var cc = Math.cos(c) + + // perform rotation and translate to correct position + out[0] = bx + pz * sc + px * cc + out[1] = a[1] + out[2] = bz + pz * cc - px * sc + + return out +} + +},{}],294:[function(_dereq_,module,exports){ +module.exports = rotateZ; + +/** + * Rotate a 3D vector around the z-axis + * @param {vec3} out The receiving vec3 + * @param {vec3} a The vec3 point to rotate + * @param {vec3} b The origin of the rotation + * @param {Number} c The angle of rotation + * @returns {vec3} out + */ +function rotateZ(out, a, b, c){ + var bx = b[0] + var by = b[1] + + //Translate point to the origin + var px = a[0] - bx + var py = a[1] - by + + var sc = Math.sin(c) + var cc = Math.cos(c) + + // perform rotation and translate to correct position + out[0] = bx + px * cc - py * sc + out[1] = by + px * sc + py * cc + out[2] = a[2] + + return out +} + +},{}],295:[function(_dereq_,module,exports){ +module.exports = round + +/** + * Math.round the components of a vec3 * - * @param {mat4} out the receiving matrix - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a vector to round + * @returns {vec3} out */ -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -}; -},{}],97:[function(_dereq_,module,exports){ -module.exports = { - create: _dereq_('./create') - , clone: _dereq_('./clone') - , copy: _dereq_('./copy') - , identity: _dereq_('./identity') - , transpose: _dereq_('./transpose') - , invert: _dereq_('./invert') - , adjoint: _dereq_('./adjoint') - , determinant: _dereq_('./determinant') - , multiply: _dereq_('./multiply') - , translate: _dereq_('./translate') - , scale: _dereq_('./scale') - , rotate: _dereq_('./rotate') - , rotateX: _dereq_('./rotateX') - , rotateY: _dereq_('./rotateY') - , rotateZ: _dereq_('./rotateZ') - , fromRotation: _dereq_('./fromRotation') - , fromRotationTranslation: _dereq_('./fromRotationTranslation') - , fromScaling: _dereq_('./fromScaling') - , fromTranslation: _dereq_('./fromTranslation') - , fromXRotation: _dereq_('./fromXRotation') - , fromYRotation: _dereq_('./fromYRotation') - , fromZRotation: _dereq_('./fromZRotation') - , fromQuat: _dereq_('./fromQuat') - , frustum: _dereq_('./frustum') - , perspective: _dereq_('./perspective') - , perspectiveFromFieldOfView: _dereq_('./perspectiveFromFieldOfView') - , ortho: _dereq_('./ortho') - , lookAt: _dereq_('./lookAt') - , str: _dereq_('./str') +function round(out, a) { + out[0] = Math.round(a[0]) + out[1] = Math.round(a[1]) + out[2] = Math.round(a[2]) + return out } -},{"./adjoint":82,"./clone":83,"./copy":84,"./create":85,"./determinant":86,"./fromQuat":87,"./fromRotation":88,"./fromRotationTranslation":89,"./fromScaling":90,"./fromTranslation":91,"./fromXRotation":92,"./fromYRotation":93,"./fromZRotation":94,"./frustum":95,"./identity":96,"./invert":98,"./lookAt":99,"./multiply":100,"./ortho":101,"./perspective":102,"./perspectiveFromFieldOfView":103,"./rotate":104,"./rotateX":105,"./rotateY":106,"./rotateZ":107,"./scale":108,"./str":109,"./translate":110,"./transpose":111}],98:[function(_dereq_,module,exports){ -module.exports = invert; +},{}],296:[function(_dereq_,module,exports){ +module.exports = scale; /** - * Inverts a mat4 + * Scales a vec3 by a scalar number * - * @param {mat4} out the receiving matrix - * @param {mat4} a the source matrix - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec3} out */ -function invert(out, a) { - var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], - a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], - a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], - a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], +function scale(out, a, b) { + out[0] = a[0] * b + out[1] = a[1] * b + out[2] = a[2] * b + return out +} +},{}],297:[function(_dereq_,module,exports){ +module.exports = scaleAndAdd; - b00 = a00 * a11 - a01 * a10, - b01 = a00 * a12 - a02 * a10, - b02 = a00 * a13 - a03 * a10, - b03 = a01 * a12 - a02 * a11, - b04 = a01 * a13 - a03 * a11, - b05 = a02 * a13 - a03 * a12, - b06 = a20 * a31 - a21 * a30, - b07 = a20 * a32 - a22 * a30, - b08 = a20 * a33 - a23 * a30, - b09 = a21 * a32 - a22 * a31, - b10 = a21 * a33 - a23 * a31, - b11 = a22 * a33 - a23 * a32, +/** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec3} out + */ +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale) + out[1] = a[1] + (b[1] * scale) + out[2] = a[2] + (b[2] * scale) + return out +} +},{}],298:[function(_dereq_,module,exports){ +module.exports = set; - // Calculate the determinant - det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +/** + * Set the components of a vec3 to the given values + * + * @param {vec3} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} out + */ +function set(out, x, y, z) { + out[0] = x + out[1] = y + out[2] = z + return out +} +},{}],299:[function(_dereq_,module,exports){ +module.exports = _dereq_('./squaredDistance') - if (!det) { - return null; - } - det = 1.0 / det; +},{"./squaredDistance":301}],300:[function(_dereq_,module,exports){ +module.exports = _dereq_('./squaredLength') - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; +},{"./squaredLength":302}],301:[function(_dereq_,module,exports){ +module.exports = squaredDistance; - return out; -}; -},{}],99:[function(_dereq_,module,exports){ -var identity = _dereq_('./identity'); +/** + * Calculates the squared euclidian distance between two vec3's + * + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {Number} squared distance between a and b + */ +function squaredDistance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2] + return x*x + y*y + z*z +} +},{}],302:[function(_dereq_,module,exports){ +module.exports = squaredLength; + +/** + * Calculates the squared length of a vec3 + * + * @param {vec3} a vector to calculate squared length of + * @returns {Number} squared length of a + */ +function squaredLength(a) { + var x = a[0], + y = a[1], + z = a[2] + return x*x + y*y + z*z +} +},{}],303:[function(_dereq_,module,exports){ +module.exports = _dereq_('./subtract') -module.exports = lookAt; +},{"./subtract":304}],304:[function(_dereq_,module,exports){ +module.exports = subtract; /** - * Generates a look-at matrix with the given eye position, focal point, and up axis + * Subtracts vector b from vector a * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {vec3} eye Position of the viewer - * @param {vec3} center Point the viewer is looking at - * @param {vec3} up vec3 pointing up - * @returns {mat4} out + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out */ -function lookAt(out, eye, center, up) { - var x0, x1, x2, y0, y1, y2, z0, z1, z2, len, - eyex = eye[0], - eyey = eye[1], - eyez = eye[2], - upx = up[0], - upy = up[1], - upz = up[2], - centerx = center[0], - centery = center[1], - centerz = center[2]; +function subtract(out, a, b) { + out[0] = a[0] - b[0] + out[1] = a[1] - b[1] + out[2] = a[2] - b[2] + return out +} +},{}],305:[function(_dereq_,module,exports){ +module.exports = transformMat3; - if (Math.abs(eyex - centerx) < 0.000001 && - Math.abs(eyey - centery) < 0.000001 && - Math.abs(eyez - centerz) < 0.000001) { - return identity(out); - } +/** + * Transforms the vec3 with a mat3. + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to transform + * @param {mat4} m the 3x3 matrix to transform with + * @returns {vec3} out + */ +function transformMat3(out, a, m) { + var x = a[0], y = a[1], z = a[2] + out[0] = x * m[0] + y * m[3] + z * m[6] + out[1] = x * m[1] + y * m[4] + z * m[7] + out[2] = x * m[2] + y * m[5] + z * m[8] + return out +} +},{}],306:[function(_dereq_,module,exports){ +module.exports = transformMat4; - z0 = eyex - centerx; - z1 = eyey - centery; - z2 = eyez - centerz; +/** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to transform + * @param {mat4} m matrix to transform with + * @returns {vec3} out + */ +function transformMat4(out, a, m) { + var x = a[0], y = a[1], z = a[2], + w = m[3] * x + m[7] * y + m[11] * z + m[15] + w = w || 1.0 + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w + return out +} +},{}],307:[function(_dereq_,module,exports){ +module.exports = transformQuat; - len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - z0 *= len; - z1 *= len; - z2 *= len; +/** + * Transforms the vec3 with a quat + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to transform + * @param {quat} q quaternion to transform with + * @returns {vec3} out + */ +function transformQuat(out, a, q) { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - x0 = upy * z2 - upz * z1; - x1 = upz * z0 - upx * z2; - x2 = upx * z1 - upy * z0; - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - if (!len) { - x0 = 0; - x1 = 0; - x2 = 0; - } else { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } + var x = a[0], y = a[1], z = a[2], + qx = q[0], qy = q[1], qz = q[2], qw = q[3], - y0 = z1 * x2 - z2 * x1; - y1 = z2 * x0 - z0 * x2; - y2 = z0 * x1 - z1 * x0; + // calculate quat * vec + ix = qw * x + qy * z - qz * y, + iy = qw * y + qz * x - qx * z, + iz = qw * z + qx * y - qy * x, + iw = -qx * x - qy * y - qz * z - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - if (!len) { - y0 = 0; - y1 = 0; - y2 = 0; - } else { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } + // calculate result * inverse quat + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx + return out +} +},{}],308:[function(_dereq_,module,exports){ +module.exports = add - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; +/** + * Adds two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +function add (out, a, b) { + out[0] = a[0] + b[0] + out[1] = a[1] + b[1] + out[2] = a[2] + b[2] + out[3] = a[3] + b[3] + return out +} - return out; -}; -},{"./identity":96}],100:[function(_dereq_,module,exports){ -module.exports = multiply; +},{}],309:[function(_dereq_,module,exports){ +module.exports = clone /** - * Multiplies two mat4's + * Creates a new vec4 initialized with values from an existing vector * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param {vec4} a vector to clone + * @returns {vec4} a new 4D vector */ -function multiply(out, a, b) { - var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], - a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], - a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], - a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; - - // Cache only the current line of the second matrix - var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; - out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - - b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7]; - out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - - b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11]; - out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33; +function clone (a) { + var out = new Float32Array(4) + out[0] = a[0] + out[1] = a[1] + out[2] = a[2] + out[3] = a[3] + return out +} - b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15]; - out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30; - out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31; - out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32; - out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; - return out; -}; -},{}],101:[function(_dereq_,module,exports){ -module.exports = ortho; +},{}],310:[function(_dereq_,module,exports){ +module.exports = copy /** - * Generates a orthogonal projection matrix with the given bounds + * Copy the values from one vec4 to another * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} left Left bound of the frustum - * @param {number} right Right bound of the frustum - * @param {number} bottom Bottom bound of the frustum - * @param {number} top Top bound of the frustum - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out + * @param {vec4} out the receiving vector + * @param {vec4} a the source vector + * @returns {vec4} out */ -function ortho(out, left, right, bottom, top, near, far) { - var lr = 1 / (left - right), - bt = 1 / (bottom - top), - nf = 1 / (near - far); - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - return out; -}; -},{}],102:[function(_dereq_,module,exports){ -module.exports = perspective; +function copy (out, a) { + out[0] = a[0] + out[1] = a[1] + out[2] = a[2] + out[3] = a[3] + return out +} + +},{}],311:[function(_dereq_,module,exports){ +module.exports = create /** - * Generates a perspective projection matrix with the given bounds + * Creates a new, empty vec4 * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} fovy Vertical field of view in radians - * @param {number} aspect Aspect ratio. typically viewport width/height - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out + * @returns {vec4} a new 4D vector */ -function perspective(out, fovy, aspect, near, far) { - var f = 1.0 / Math.tan(fovy / 2), - nf = 1 / (near - far); - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - return out; -}; -},{}],103:[function(_dereq_,module,exports){ -module.exports = perspectiveFromFieldOfView; +function create () { + var out = new Float32Array(4) + out[0] = 0 + out[1] = 0 + out[2] = 0 + out[3] = 0 + return out +} + +},{}],312:[function(_dereq_,module,exports){ +module.exports = distance /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Calculates the euclidian distance between two vec4's * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {Number} distance between a and b */ -function perspectiveFromFieldOfView(out, fov, near, far) { - var upTan = Math.tan(fov.upDegrees * Math.PI/180.0), - downTan = Math.tan(fov.downDegrees * Math.PI/180.0), - leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0), - rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0), - xScale = 2.0 / (leftTan + rightTan), - yScale = 2.0 / (upTan + downTan); - - out[0] = xScale; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - out[4] = 0.0; - out[5] = yScale; - out[6] = 0.0; - out[7] = 0.0; - out[8] = -((leftTan - rightTan) * xScale * 0.5); - out[9] = ((upTan - downTan) * yScale * 0.5); - out[10] = far / (near - far); - out[11] = -1.0; - out[12] = 0.0; - out[13] = 0.0; - out[14] = (far * near) / (near - far); - out[15] = 0.0; - return out; +function distance (a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2], + w = b[3] - a[3] + return Math.sqrt(x * x + y * y + z * z + w * w) } +},{}],313:[function(_dereq_,module,exports){ +module.exports = divide -},{}],104:[function(_dereq_,module,exports){ -module.exports = rotate; +/** + * Divides two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +function divide (out, a, b) { + out[0] = a[0] / b[0] + out[1] = a[1] / b[1] + out[2] = a[2] / b[2] + out[3] = a[3] / b[3] + return out +} + +},{}],314:[function(_dereq_,module,exports){ +module.exports = dot /** - * Rotates a mat4 by the given angle + * Calculates the dot product of two vec4's * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @param {vec3} axis the axis to rotate around - * @returns {mat4} out + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {Number} dot product of a and b */ -function rotate(out, a, rad, axis) { - var x = axis[0], y = axis[1], z = axis[2], - len = Math.sqrt(x * x + y * y + z * z), - s, c, t, - a00, a01, a02, a03, - a10, a11, a12, a13, - a20, a21, a22, a23, - b00, b01, b02, - b10, b11, b12, - b20, b21, b22; - - if (Math.abs(len) < 0.000001) { return null; } - - len = 1 / len; - x *= len; - y *= len; - z *= len; +function dot (a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3] +} - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; +},{}],315:[function(_dereq_,module,exports){ +module.exports = fromValues - a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; - a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; - a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; +/** + * Creates a new vec4 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} a new 4D vector + */ +function fromValues (x, y, z, w) { + var out = new Float32Array(4) + out[0] = x + out[1] = y + out[2] = z + out[3] = w + return out +} - // Construct the elements of the rotation matrix - b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s; - b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s; - b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c; +},{}],316:[function(_dereq_,module,exports){ +module.exports = { + create: _dereq_('./create'), + clone: _dereq_('./clone'), + fromValues: _dereq_('./fromValues'), + copy: _dereq_('./copy'), + set: _dereq_('./set'), + add: _dereq_('./add'), + subtract: _dereq_('./subtract'), + multiply: _dereq_('./multiply'), + divide: _dereq_('./divide'), + min: _dereq_('./min'), + max: _dereq_('./max'), + scale: _dereq_('./scale'), + scaleAndAdd: _dereq_('./scaleAndAdd'), + distance: _dereq_('./distance'), + squaredDistance: _dereq_('./squaredDistance'), + length: _dereq_('./length'), + squaredLength: _dereq_('./squaredLength'), + negate: _dereq_('./negate'), + inverse: _dereq_('./inverse'), + normalize: _dereq_('./normalize'), + dot: _dereq_('./dot'), + lerp: _dereq_('./lerp'), + random: _dereq_('./random'), + transformMat4: _dereq_('./transformMat4'), + transformQuat: _dereq_('./transformQuat') +} + +},{"./add":308,"./clone":309,"./copy":310,"./create":311,"./distance":312,"./divide":313,"./dot":314,"./fromValues":315,"./inverse":317,"./length":318,"./lerp":319,"./max":320,"./min":321,"./multiply":322,"./negate":323,"./normalize":324,"./random":325,"./scale":326,"./scaleAndAdd":327,"./set":328,"./squaredDistance":329,"./squaredLength":330,"./subtract":331,"./transformMat4":332,"./transformQuat":333}],317:[function(_dereq_,module,exports){ +module.exports = inverse - // Perform rotation-specific matrix multiplication - out[0] = a00 * b00 + a10 * b01 + a20 * b02; - out[1] = a01 * b00 + a11 * b01 + a21 * b02; - out[2] = a02 * b00 + a12 * b01 + a22 * b02; - out[3] = a03 * b00 + a13 * b01 + a23 * b02; - out[4] = a00 * b10 + a10 * b11 + a20 * b12; - out[5] = a01 * b10 + a11 * b11 + a21 * b12; - out[6] = a02 * b10 + a12 * b11 + a22 * b12; - out[7] = a03 * b10 + a13 * b11 + a23 * b12; - out[8] = a00 * b20 + a10 * b21 + a20 * b22; - out[9] = a01 * b20 + a11 * b21 + a21 * b22; - out[10] = a02 * b20 + a12 * b21 + a22 * b22; - out[11] = a03 * b20 + a13 * b21 + a23 * b22; +/** + * Returns the inverse of the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to invert + * @returns {vec4} out + */ +function inverse (out, a) { + out[0] = 1.0 / a[0] + out[1] = 1.0 / a[1] + out[2] = 1.0 / a[2] + out[3] = 1.0 / a[3] + return out +} - if (a !== out) { // If the source and destination differ, copy the unchanged last row - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } - return out; -}; -},{}],105:[function(_dereq_,module,exports){ -module.exports = rotateX; +},{}],318:[function(_dereq_,module,exports){ +module.exports = length /** - * Rotates a matrix by the given angle around the X axis + * Calculates the length of a vec4 * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param {vec4} a vector to calculate length of + * @returns {Number} length of a */ -function rotateX(out, a, rad) { - var s = Math.sin(rad), - c = Math.cos(rad), - a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7], - a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - - if (a !== out) { // If the source and destination differ, copy the unchanged rows - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } +function length (a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3] + return Math.sqrt(x * x + y * y + z * z + w * w) +} - // Perform axis-specific matrix multiplication - out[4] = a10 * c + a20 * s; - out[5] = a11 * c + a21 * s; - out[6] = a12 * c + a22 * s; - out[7] = a13 * c + a23 * s; - out[8] = a20 * c - a10 * s; - out[9] = a21 * c - a11 * s; - out[10] = a22 * c - a12 * s; - out[11] = a23 * c - a13 * s; - return out; -}; -},{}],106:[function(_dereq_,module,exports){ -module.exports = rotateY; +},{}],319:[function(_dereq_,module,exports){ +module.exports = lerp /** - * Rotates a matrix by the given angle around the Y axis + * Performs a linear interpolation between two vec4's * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec4} out */ -function rotateY(out, a, rad) { - var s = Math.sin(rad), - c = Math.cos(rad), - a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3], - a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; +function lerp (out, a, b, t) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3] + out[0] = ax + t * (b[0] - ax) + out[1] = ay + t * (b[1] - ay) + out[2] = az + t * (b[2] - az) + out[3] = aw + t * (b[3] - aw) + return out +} - if (a !== out) { // If the source and destination differ, copy the unchanged rows - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } +},{}],320:[function(_dereq_,module,exports){ +module.exports = max - // Perform axis-specific matrix multiplication - out[0] = a00 * c - a20 * s; - out[1] = a01 * c - a21 * s; - out[2] = a02 * c - a22 * s; - out[3] = a03 * c - a23 * s; - out[8] = a00 * s + a20 * c; - out[9] = a01 * s + a21 * c; - out[10] = a02 * s + a22 * c; - out[11] = a03 * s + a23 * c; - return out; -}; -},{}],107:[function(_dereq_,module,exports){ -module.exports = rotateZ; +/** + * Returns the maximum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +function max (out, a, b) { + out[0] = Math.max(a[0], b[0]) + out[1] = Math.max(a[1], b[1]) + out[2] = Math.max(a[2], b[2]) + out[3] = Math.max(a[3], b[3]) + return out +} + +},{}],321:[function(_dereq_,module,exports){ +module.exports = min /** - * Rotates a matrix by the given angle around the Z axis + * Returns the minimum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +function min (out, a, b) { + out[0] = Math.min(a[0], b[0]) + out[1] = Math.min(a[1], b[1]) + out[2] = Math.min(a[2], b[2]) + out[3] = Math.min(a[3], b[3]) + return out +} + +},{}],322:[function(_dereq_,module,exports){ +module.exports = multiply + +/** + * Multiplies two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +function multiply (out, a, b) { + out[0] = a[0] * b[0] + out[1] = a[1] * b[1] + out[2] = a[2] * b[2] + out[3] = a[3] * b[3] + return out +} + +},{}],323:[function(_dereq_,module,exports){ +module.exports = negate + +/** + * Negates the components of a vec4 * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param {vec4} out the receiving vector + * @param {vec4} a vector to negate + * @returns {vec4} out */ -function rotateZ(out, a, rad) { - var s = Math.sin(rad), - c = Math.cos(rad), - a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3], - a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; +function negate (out, a) { + out[0] = -a[0] + out[1] = -a[1] + out[2] = -a[2] + out[3] = -a[3] + return out +} - if (a !== out) { // If the source and destination differ, copy the unchanged last row - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } +},{}],324:[function(_dereq_,module,exports){ +module.exports = normalize - // Perform axis-specific matrix multiplication - out[0] = a00 * c + a10 * s; - out[1] = a01 * c + a11 * s; - out[2] = a02 * c + a12 * s; - out[3] = a03 * c + a13 * s; - out[4] = a10 * c - a00 * s; - out[5] = a11 * c - a01 * s; - out[6] = a12 * c - a02 * s; - out[7] = a13 * c - a03 * s; - return out; -}; -},{}],108:[function(_dereq_,module,exports){ -module.exports = scale; +/** + * Normalize a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to normalize + * @returns {vec4} out + */ +function normalize (out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3] + var len = x * x + y * y + z * z + w * w + if (len > 0) { + len = 1 / Math.sqrt(len) + out[0] = x * len + out[1] = y * len + out[2] = z * len + out[3] = w * len + } + return out +} + +},{}],325:[function(_dereq_,module,exports){ +var vecNormalize = _dereq_('./normalize') +var vecScale = _dereq_('./scale') + +module.exports = random /** - * Scales the mat4 by the dimensions in the given vec3 - * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to scale - * @param {vec3} v the vec3 to scale the matrix by - * @returns {mat4} out - **/ -function scale(out, a, v) { - var x = v[0], y = v[1], z = v[2]; + * Generates a random vector with the given scale + * + * @param {vec4} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec4} out + */ +function random (out, scale) { + scale = scale || 1.0 + + // TODO: This is a pretty awful way of doing this. Find something better. + out[0] = Math.random() + out[1] = Math.random() + out[2] = Math.random() + out[3] = Math.random() + vecNormalize(out, out) + vecScale(out, out, scale) + return out +} - out[0] = a[0] * x; - out[1] = a[1] * x; - out[2] = a[2] * x; - out[3] = a[3] * x; - out[4] = a[4] * y; - out[5] = a[5] * y; - out[6] = a[6] * y; - out[7] = a[7] * y; - out[8] = a[8] * z; - out[9] = a[9] * z; - out[10] = a[10] * z; - out[11] = a[11] * z; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -}; -},{}],109:[function(_dereq_,module,exports){ -module.exports = str; +},{"./normalize":324,"./scale":326}],326:[function(_dereq_,module,exports){ +module.exports = scale /** - * Returns a string representation of a mat4 + * Scales a vec4 by a scalar number + * + * @param {vec4} out the receiving vector + * @param {vec4} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec4} out + */ +function scale (out, a, b) { + out[0] = a[0] * b + out[1] = a[1] * b + out[2] = a[2] * b + out[3] = a[3] * b + return out +} + +},{}],327:[function(_dereq_,module,exports){ +module.exports = scaleAndAdd + +/** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec4} out + */ +function scaleAndAdd (out, a, b, scale) { + out[0] = a[0] + (b[0] * scale) + out[1] = a[1] + (b[1] * scale) + out[2] = a[2] + (b[2] * scale) + out[3] = a[3] + (b[3] * scale) + return out +} + +},{}],328:[function(_dereq_,module,exports){ +module.exports = set + +/** + * Set the components of a vec4 to the given values + * + * @param {vec4} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} out + */ +function set (out, x, y, z, w) { + out[0] = x + out[1] = y + out[2] = z + out[3] = w + return out +} + +},{}],329:[function(_dereq_,module,exports){ +module.exports = squaredDistance + +/** + * Calculates the squared euclidian distance between two vec4's * - * @param {mat4} mat matrix to represent as a string - * @returns {String} string representation of the matrix + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {Number} squared distance between a and b */ -function str(a) { - return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + - a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + - a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + - a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; -}; -},{}],110:[function(_dereq_,module,exports){ -module.exports = translate; +function squaredDistance (a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2], + w = b[3] - a[3] + return x * x + y * y + z * z + w * w +} + +},{}],330:[function(_dereq_,module,exports){ +module.exports = squaredLength /** - * Translate a mat4 by the given vector + * Calculates the squared length of a vec4 * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to translate - * @param {vec3} v vector to translate by - * @returns {mat4} out + * @param {vec4} a vector to calculate squared length of + * @returns {Number} squared length of a */ -function translate(out, a, v) { - var x = v[0], y = v[1], z = v[2], - a00, a01, a02, a03, - a10, a11, a12, a13, - a20, a21, a22, a23; +function squaredLength (a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3] + return x * x + y * y + z * z + w * w +} - if (a === out) { - out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - } else { - a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; - a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; - a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; +},{}],331:[function(_dereq_,module,exports){ +module.exports = subtract - out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03; - out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13; - out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23; +/** + * Subtracts vector b from vector a + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +function subtract (out, a, b) { + out[0] = a[0] - b[0] + out[1] = a[1] - b[1] + out[2] = a[2] - b[2] + out[3] = a[3] - b[3] + return out +} - out[12] = a00 * x + a10 * y + a20 * z + a[12]; - out[13] = a01 * x + a11 * y + a21 * z + a[13]; - out[14] = a02 * x + a12 * y + a22 * z + a[14]; - out[15] = a03 * x + a13 * y + a23 * z + a[15]; - } +},{}],332:[function(_dereq_,module,exports){ +module.exports = transformMat4 - return out; -}; -},{}],111:[function(_dereq_,module,exports){ -module.exports = transpose; +/** + * Transforms the vec4 with a mat4. + * + * @param {vec4} out the receiving vector + * @param {vec4} a the vector to transform + * @param {mat4} m matrix to transform with + * @returns {vec4} out + */ +function transformMat4 (out, a, m) { + var x = a[0], y = a[1], z = a[2], w = a[3] + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w + return out +} + +},{}],333:[function(_dereq_,module,exports){ +module.exports = transformQuat /** - * Transpose the values of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {mat4} a the source matrix - * @returns {mat4} out - */ -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], a02 = a[2], a03 = a[3], - a12 = a[6], a13 = a[7], - a23 = a[11]; + * Transforms the vec4 with a quat + * + * @param {vec4} out the receiving vector + * @param {vec4} a the vector to transform + * @param {quat} q quaternion to transform with + * @returns {vec4} out + */ +function transformQuat (out, a, q) { + var x = a[0], y = a[1], z = a[2], + qx = q[0], qy = q[1], qz = q[2], qw = q[3], + + // calculate quat * vec + ix = qw * x + qy * z - qz * y, + iy = qw * y + qz * x - qx * z, + iz = qw * z + qx * y - qy * x, + iw = -qx * x - qy * y - qz * z + + // calculate result * inverse quat + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx + out[3] = a[3] + return out +} - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a01; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a02; - out[9] = a12; - out[11] = a[14]; - out[12] = a03; - out[13] = a13; - out[14] = a23; - } else { - out[0] = a[0]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a[1]; - out[5] = a[5]; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a[2]; - out[9] = a[6]; - out[10] = a[10]; - out[11] = a[14]; - out[12] = a[3]; - out[13] = a[7]; - out[14] = a[11]; - out[15] = a[15]; - } - - return out; -}; -},{}],112:[function(_dereq_,module,exports){ +},{}],334:[function(_dereq_,module,exports){ +var tokenize = _dereq_('glsl-tokenizer') +var atob = _dereq_('atob-lite') + +module.exports = getName + +function getName(src) { + var tokens = Array.isArray(src) + ? src + : tokenize(src) + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] + if (token.type !== 'preprocessor') continue + var match = token.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/) + if (!match) continue + if (!match[2]) continue + + var b64 = match[1] + var name = match[2] + + return (b64 ? atob(name) : name).trim() + } +} + +},{"atob-lite":73,"glsl-tokenizer":341}],335:[function(_dereq_,module,exports){ +module.exports = tokenize + +var literals100 = _dereq_('./lib/literals') + , operators = _dereq_('./lib/operators') + , builtins100 = _dereq_('./lib/builtins') + , literals300es = _dereq_('./lib/literals-300es') + , builtins300es = _dereq_('./lib/builtins-300es') + +var NORMAL = 999 // <-- never emitted + , TOKEN = 9999 // <-- never emitted + , BLOCK_COMMENT = 0 + , LINE_COMMENT = 1 + , PREPROCESSOR = 2 + , OPERATOR = 3 + , INTEGER = 4 + , FLOAT = 5 + , IDENT = 6 + , BUILTIN = 7 + , KEYWORD = 8 + , WHITESPACE = 9 + , EOF = 10 + , HEX = 11 + +var map = [ + 'block-comment' + , 'line-comment' + , 'preprocessor' + , 'operator' + , 'integer' + , 'float' + , 'ident' + , 'builtin' + , 'keyword' + , 'whitespace' + , 'eof' + , 'integer' +] + +function tokenize(opt) { + var i = 0 + , total = 0 + , mode = NORMAL + , c + , last + , content = [] + , tokens = [] + , token_idx = 0 + , token_offs = 0 + , line = 1 + , col = 0 + , start = 0 + , isnum = false + , isoperator = false + , input = '' + , len + + opt = opt || {} + var allBuiltins = builtins100 + var allLiterals = literals100 + if (opt.version === '300 es') { + allBuiltins = builtins300es + allLiterals = literals300es + } + + // cache by name + var builtinsDict = {}, literalsDict = {} + for (var i = 0; i < allBuiltins.length; i++) { + builtinsDict[allBuiltins[i]] = true + } + for (var i = 0; i < allLiterals.length; i++) { + literalsDict[allLiterals[i]] = true + } + + return function(data) { + tokens = [] + if (data !== null) return write(data) + return end() + } + + function token(data) { + if (data.length) { + tokens.push({ + type: map[mode] + , data: data + , position: start + , line: line + , column: col + }) + } + } + + function write(chunk) { + i = 0 + + if (chunk.toString) chunk = chunk.toString() + + input += chunk.replace(/\r\n/g, '\n') + len = input.length + + + var last + + while(c = input[i], i < len) { + last = i + + switch(mode) { + case BLOCK_COMMENT: i = block_comment(); break + case LINE_COMMENT: i = line_comment(); break + case PREPROCESSOR: i = preprocessor(); break + case OPERATOR: i = operator(); break + case INTEGER: i = integer(); break + case HEX: i = hex(); break + case FLOAT: i = decimal(); break + case TOKEN: i = readtoken(); break + case WHITESPACE: i = whitespace(); break + case NORMAL: i = normal(); break + } + + if(last !== i) { + switch(input[last]) { + case '\n': col = 0; ++line; break + default: ++col; break + } + } + } + + total += i + input = input.slice(i) + return tokens + } + + function end(chunk) { + if(content.length) { + token(content.join('')) + } + + mode = EOF + token('(eof)') + return tokens + } + + function normal() { + content = content.length ? [] : content + + if(last === '/' && c === '*') { + start = total + i - 1 + mode = BLOCK_COMMENT + last = c + return i + 1 + } + + if(last === '/' && c === '/') { + start = total + i - 1 + mode = LINE_COMMENT + last = c + return i + 1 + } + + if(c === '#') { + mode = PREPROCESSOR + start = total + i + return i + } + + if(/\s/.test(c)) { + mode = WHITESPACE + start = total + i + return i + } + + isnum = /\d/.test(c) + isoperator = /[^\w_]/.test(c) + + start = total + i + mode = isnum ? INTEGER : isoperator ? OPERATOR : TOKEN + return i + } + + function whitespace() { + if(/[^\s]/g.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + content.push(c) + last = c + return i + 1 + } + + function preprocessor() { + if((c === '\r' || c === '\n') && last !== '\\') { + token(content.join('')) + mode = NORMAL + return i + } + content.push(c) + last = c + return i + 1 + } + + function line_comment() { + return preprocessor() + } + + function block_comment() { + if(c === '/' && last === '*') { + content.push(c) + token(content.join('')) + mode = NORMAL + return i + 1 + } + + content.push(c) + last = c + return i + 1 + } + + function operator() { + if(last === '.' && /\d/.test(c)) { + mode = FLOAT + return i + } + + if(last === '/' && c === '*') { + mode = BLOCK_COMMENT + return i + } + + if(last === '/' && c === '/') { + mode = LINE_COMMENT + return i + } + + if(c === '.' && content.length) { + while(determine_operator(content)); + + mode = FLOAT + return i + } + + if(c === ';' || c === ')' || c === '(') { + if(content.length) while(determine_operator(content)); + token(c) + mode = NORMAL + return i + 1 + } + + var is_composite_operator = content.length === 2 && c !== '=' + if(/[\w_\d\s]/.test(c) || is_composite_operator) { + while(determine_operator(content)); + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function determine_operator(buf) { + var j = 0 + , idx + , res + + do { + idx = operators.indexOf(buf.slice(0, buf.length + j).join('')) + res = operators[idx] + + if(idx === -1) { + if(j-- + buf.length > 0) continue + res = buf.slice(0, 1).join('') + } + + token(res) + + start += res.length + content = content.slice(res.length) + return content.length + } while(1) + } + + function hex() { + if(/[^a-fA-F0-9]/.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function integer() { + if(c === '.') { + content.push(c) + mode = FLOAT + last = c + return i + 1 + } + + if(/[eE]/.test(c)) { + content.push(c) + mode = FLOAT + last = c + return i + 1 + } + + if(c === 'x' && content.length === 1 && content[0] === '0') { + mode = HEX + content.push(c) + last = c + return i + 1 + } + + if(/[^\d]/.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function decimal() { + if(c === 'f') { + content.push(c) + last = c + i += 1 + } + + if(/[eE]/.test(c)) { + content.push(c) + last = c + return i + 1 + } + + if ((c === '-' || c === '+') && /[eE]/.test(last)) { + content.push(c) + last = c + return i + 1 + } + + if(/[^\d]/.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function readtoken() { + if(/[^\d\w_]/.test(c)) { + var contentstr = content.join('') + if(literalsDict[contentstr]) { + mode = KEYWORD + } else if(builtinsDict[contentstr]) { + mode = BUILTIN + } else { + mode = IDENT + } + token(content.join('')) + mode = NORMAL + return i + } + content.push(c) + last = c + return i + 1 + } +} + +},{"./lib/builtins":337,"./lib/builtins-300es":336,"./lib/literals":339,"./lib/literals-300es":338,"./lib/operators":340}],336:[function(_dereq_,module,exports){ +// 300es builtins/reserved words that were previously valid in v100 +var v100 = _dereq_('./builtins') + +// The texture2D|Cube functions have been removed +// And the gl_ features are updated +v100 = v100.slice().filter(function (b) { + return !/^(gl\_|texture)/.test(b) +}) + +module.exports = v100.concat([ + // the updated gl_ constants + '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' + + // other builtins + , '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":337}],337:[function(_dereq_,module,exports){ +module.exports = [ + // Keep this list sorted + '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' +] + +},{}],338:[function(_dereq_,module,exports){ +var v100 = _dereq_('./literals') + +module.exports = v100.slice().concat([ + 'layout' + , 'centroid' + , 'smooth' + , 'case' + , 'mat2x2' + , 'mat2x3' + , 'mat2x4' + , 'mat3x2' + , 'mat3x3' + , 'mat3x4' + , 'mat4x2' + , 'mat4x3' + , 'mat4x4' + , '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":339}],339:[function(_dereq_,module,exports){ +module.exports = [ + // current + 'precision' + , 'highp' + , 'mediump' + , 'lowp' + , 'attribute' + , 'const' + , 'uniform' + , 'varying' + , 'break' + , 'continue' + , 'do' + , 'for' + , 'while' + , 'if' + , 'else' + , 'in' + , 'out' + , 'inout' + , 'float' + , 'int' + , 'uint' + , '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' + + // future + , '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' +] + +},{}],340:[function(_dereq_,module,exports){ +module.exports = [ + '<<=' + , '>>=' + , '++' + , '--' + , '<<' + , '>>' + , '<=' + , '>=' + , '==' + , '!=' + , '&&' + , '||' + , '+=' + , '-=' + , '*=' + , '/=' + , '%=' + , '&=' + , '^^' + , '^=' + , '|=' + , '(' + , ')' + , '[' + , ']' + , '.' + , '!' + , '~' + , '*' + , '/' + , '%' + , '+' + , '-' + , '<' + , '>' + , '&' + , '^' + , '|' + , '?' + , ':' + , '=' + , ',' + , ';' + , '{' + , '}' +] + +},{}],341:[function(_dereq_,module,exports){ +var tokenize = _dereq_('./index') + +module.exports = tokenizeString + +function tokenizeString(str, opt) { + var generator = tokenize(opt) + var tokens = [] + + tokens = tokens.concat(generator(str)) + tokens = tokens.concat(generator(null)) + + return tokens +} + +},{"./index":335}],342:[function(_dereq_,module,exports){ +arguments[4][178][0].apply(exports,arguments) +},{"dup":178}],343:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict' @@ -34768,7 +61083,7 @@ else { module.exports = hasHover }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"is-browser":116}],113:[function(_dereq_,module,exports){ +},{"is-browser":350}],344:[function(_dereq_,module,exports){ 'use strict' var isBrowser = _dereq_('is-browser') @@ -34794,7 +61109,7 @@ function detect() { module.exports = isBrowser && detect() -},{"is-browser":116}],114:[function(_dereq_,module,exports){ +},{"is-browser":350}],345:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -34880,7 +61195,447 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],115:[function(_dereq_,module,exports){ +},{}],346:[function(_dereq_,module,exports){ +"use strict" + +//High level idea: +// 1. Use Clarkson's incremental construction to find convex hull +// 2. Point location in triangulation by jump and walk + +module.exports = incrementalConvexHull + +var orient = _dereq_("robust-orientation") +var compareCell = _dereq_("simplicial-complex").compareCells + +function Simplex(vertices, adjacent, boundary) { + this.vertices = vertices + this.adjacent = adjacent + this.boundary = boundary + this.lastVisited = -1 +} + +Simplex.prototype.flip = function() { + var t = this.vertices[0] + this.vertices[0] = this.vertices[1] + this.vertices[1] = t + var u = this.adjacent[0] + this.adjacent[0] = this.adjacent[1] + this.adjacent[1] = u +} + +function GlueFacet(vertices, cell, index) { + this.vertices = vertices + this.cell = cell + this.index = index +} + +function compareGlue(a, b) { + return compareCell(a.vertices, b.vertices) +} + +function wrapper(test) { + return function() { + var tuple = this.tuple + return test.apply(this, tuple) + } +} + +function bakeOrient(d) { + var test = orient[d+1] + if(!test) { + test = orient + } + return wrapper(test) +} + +var BAKED = [] + +function Triangulation(dimension, vertices, simplices) { + this.dimension = dimension + this.vertices = vertices + this.simplices = simplices + this.interior = simplices.filter(function(c) { + return !c.boundary + }) + + this.tuple = new Array(dimension+1) + for(var i=0; i<=dimension; ++i) { + this.tuple[i] = this.vertices[i] + } + + var o = BAKED[dimension] + if(!o) { + o = BAKED[dimension] = bakeOrient(dimension) + } + this.orient = o +} + +var proto = Triangulation.prototype + +//Degenerate situation where we are on boundary, but coplanar to face +proto.handleBoundaryDegeneracy = function(cell, point) { + var d = this.dimension + var n = this.vertices.length - 1 + var tuple = this.tuple + var verts = this.vertices + + //Dumb solution: Just do dfs from boundary cell until we find any peak, or terminate + var toVisit = [ cell ] + cell.lastVisited = -n + while(toVisit.length > 0) { + cell = toVisit.pop() + var cellAdj = cell.adjacent + for(var i=0; i<=d; ++i) { + var neighbor = cellAdj[i] + if(!neighbor.boundary || neighbor.lastVisited <= -n) { + continue + } + var nv = neighbor.vertices + for(var j=0; j<=d; ++j) { + var vv = nv[j] + if(vv < 0) { + tuple[j] = point + } else { + tuple[j] = verts[vv] + } + } + var o = this.orient() + if(o > 0) { + return neighbor + } + neighbor.lastVisited = -n + if(o === 0) { + toVisit.push(neighbor) + } + } + } + return null +} + +proto.walk = function(point, random) { + //Alias local properties + var n = this.vertices.length - 1 + var d = this.dimension + var verts = this.vertices + var tuple = this.tuple + + //Compute initial jump cell + var initIndex = random ? (this.interior.length * Math.random())|0 : (this.interior.length-1) + var cell = this.interior[ initIndex ] + + //Start walking +outerLoop: + while(!cell.boundary) { + var cellVerts = cell.vertices + var cellAdj = cell.adjacent + + for(var i=0; i<=d; ++i) { + tuple[i] = verts[cellVerts[i]] + } + cell.lastVisited = n + + //Find farthest adjacent cell + for(var i=0; i<=d; ++i) { + var neighbor = cellAdj[i] + if(neighbor.lastVisited >= n) { + continue + } + var prev = tuple[i] + tuple[i] = point + var o = this.orient() + tuple[i] = prev + if(o < 0) { + cell = neighbor + continue outerLoop + } else { + if(!neighbor.boundary) { + neighbor.lastVisited = n + } else { + neighbor.lastVisited = -n + } + } + } + return + } + + return cell +} + +proto.addPeaks = function(point, cell) { + var n = this.vertices.length - 1 + var d = this.dimension + var verts = this.vertices + var tuple = this.tuple + var interior = this.interior + var simplices = this.simplices + + //Walking finished at boundary, time to add peaks + var tovisit = [ cell ] + + //Stretch initial boundary cell into a peak + cell.lastVisited = n + cell.vertices[cell.vertices.indexOf(-1)] = n + cell.boundary = false + interior.push(cell) + + //Record a list of all new boundaries created by added peaks so we can glue them together when we are all done + var glueFacets = [] + + //Do a traversal of the boundary walking outward from starting peak + while(tovisit.length > 0) { + //Pop off peak and walk over adjacent cells + var cell = tovisit.pop() + var cellVerts = cell.vertices + var cellAdj = cell.adjacent + var indexOfN = cellVerts.indexOf(n) + if(indexOfN < 0) { + continue + } + + for(var i=0; i<=d; ++i) { + if(i === indexOfN) { + continue + } + + //For each boundary neighbor of the cell + var neighbor = cellAdj[i] + if(!neighbor.boundary || neighbor.lastVisited >= n) { + continue + } + + var nv = neighbor.vertices + + //Test if neighbor is a peak + if(neighbor.lastVisited !== -n) { + //Compute orientation of p relative to each boundary peak + var indexOfNeg1 = 0 + for(var j=0; j<=d; ++j) { + if(nv[j] < 0) { + indexOfNeg1 = j + tuple[j] = point + } else { + tuple[j] = verts[nv[j]] + } + } + var o = this.orient() + + //Test if neighbor cell is also a peak + if(o > 0) { + nv[indexOfNeg1] = n + neighbor.boundary = false + interior.push(neighbor) + tovisit.push(neighbor) + neighbor.lastVisited = n + continue + } else { + neighbor.lastVisited = -n + } + } + + var na = neighbor.adjacent + + //Otherwise, replace neighbor with new face + var vverts = cellVerts.slice() + var vadj = cellAdj.slice() + var ncell = new Simplex(vverts, vadj, true) + simplices.push(ncell) + + //Connect to neighbor + var opposite = na.indexOf(cell) + if(opposite < 0) { + continue + } + na[opposite] = ncell + vadj[indexOfN] = neighbor + + //Connect to cell + vverts[i] = -1 + vadj[i] = cell + cellAdj[i] = ncell + + //Flip facet + ncell.flip() + + //Add to glue list + for(var j=0; j<=d; ++j) { + var uu = vverts[j] + if(uu < 0 || uu === n) { + continue + } + var nface = new Array(d-1) + var nptr = 0 + for(var k=0; k<=d; ++k) { + var vv = vverts[k] + if(vv < 0 || k === j) { + continue + } + nface[nptr++] = vv + } + glueFacets.push(new GlueFacet(nface, ncell, j)) + } + } + } + + //Glue boundary facets together + glueFacets.sort(compareGlue) + + for(var i=0; i+1= 0) { + bcell[ptr++] = cv[j] + } else { + parity = j&1 + } + } + if(parity === (d&1)) { + var t = bcell[0] + bcell[0] = bcell[1] + bcell[1] = t + } + boundary.push(bcell) + } + } + return boundary +} + +function incrementalConvexHull(points, randomSearch) { + var n = points.length + if(n === 0) { + throw new Error("Must have at least d+1 points") + } + var d = points[0].length + if(n <= d) { + throw new Error("Must input at least d+1 points") + } + + //FIXME: This could be degenerate, but need to select d+1 non-coplanar points to bootstrap process + var initialSimplex = points.slice(0, d+1) + + //Make sure initial simplex is positively oriented + var o = orient.apply(void 0, initialSimplex) + if(o === 0) { + throw new Error("Input not in general position") + } + var initialCoords = new Array(d+1) + for(var i=0; i<=d; ++i) { + initialCoords[i] = i + } + if(o < 0) { + initialCoords[0] = 1 + initialCoords[1] = 0 + } + + //Create initial topological index, glue pointers together (kind of messy) + var initialCell = new Simplex(initialCoords, new Array(d+1), false) + var boundary = initialCell.adjacent + var list = new Array(d+2) + for(var i=0; i<=d; ++i) { + var verts = initialCoords.slice() + for(var j=0; j<=d; ++j) { + if(j === i) { + verts[j] = -1 + } + } + var t = verts[0] + verts[0] = verts[1] + verts[1] = t + var cell = new Simplex(verts, new Array(d+1), true) + boundary[i] = cell + list[i] = cell + } + list[d+1] = initialCell + for(var i=0; i<=d; ++i) { + var verts = boundary[i].vertices + var adj = boundary[i].adjacent + for(var j=0; j<=d; ++j) { + var v = verts[j] + if(v < 0) { + adj[j] = initialCell + continue + } + for(var k=0; k<=d; ++k) { + if(boundary[k].vertices.indexOf(v) < 0) { + adj[j] = boundary[k] + } + } + } + } + + //Initialize triangles + var triangles = new Triangulation(d, initialSimplex, list) + + //Insert remaining points + var useRandom = !!randomSearch + for(var i=d+1; i 3*(weight+1)) { + rebuildWithInterval(this, interval) + } else { + this.left.insert(interval) + } + } else { + this.left = createIntervalTree([interval]) + } + } else if(interval[0] > this.mid) { + if(this.right) { + if(4*(this.right.count+1) > 3*(weight+1)) { + rebuildWithInterval(this, interval) + } else { + this.right.insert(interval) + } + } else { + this.right = createIntervalTree([interval]) + } + } else { + var l = bounds.ge(this.leftPoints, interval, compareBegin) + var r = bounds.ge(this.rightPoints, interval, compareEnd) + this.leftPoints.splice(l, 0, interval) + this.rightPoints.splice(r, 0, interval) + } +} + +proto.remove = function(interval) { + var weight = this.count - this.leftPoints + if(interval[1] < this.mid) { + if(!this.left) { + return NOT_FOUND + } + var rw = this.right ? this.right.count : 0 + if(4 * rw > 3 * (weight-1)) { + return rebuildWithoutInterval(this, interval) + } + var r = this.left.remove(interval) + if(r === EMPTY) { + this.left = null + this.count -= 1 + return SUCCESS + } else if(r === SUCCESS) { + this.count -= 1 + } + return r + } else if(interval[0] > this.mid) { + if(!this.right) { + return NOT_FOUND + } + var lw = this.left ? this.left.count : 0 + if(4 * lw > 3 * (weight-1)) { + return rebuildWithoutInterval(this, interval) + } + var r = this.right.remove(interval) + if(r === EMPTY) { + this.right = null + this.count -= 1 + return SUCCESS + } else if(r === SUCCESS) { + this.count -= 1 + } + return r + } else { + if(this.count === 1) { + if(this.leftPoints[0] === interval) { + return EMPTY + } else { + return NOT_FOUND + } + } + if(this.leftPoints.length === 1 && this.leftPoints[0] === interval) { + if(this.left && this.right) { + var p = this + var n = this.left + while(n.right) { + p = n + n = n.right + } + if(p === this) { + n.right = this.right + } else { + var l = this.left + var r = this.right + p.count -= n.count + p.right = n.left + n.left = l + n.right = r + } + copy(this, n) + this.count = (this.left?this.left.count:0) + (this.right?this.right.count:0) + this.leftPoints.length + } else if(this.left) { + copy(this, this.left) + } else { + copy(this, this.right) + } + return SUCCESS + } + for(var l = bounds.ge(this.leftPoints, interval, compareBegin); l=0 && arr[i][1] >= lo; --i) { + var r = cb(arr[i]) + if(r) { return r } + } +} + +function reportRange(arr, cb) { + for(var i=0; i this.mid) { + if(this.right) { + var r = this.right.queryPoint(x, cb) + if(r) { return r } + } + return reportRightRange(this.rightPoints, x, cb) + } else { + return reportRange(this.leftPoints, cb) + } +} + +proto.queryInterval = function(lo, hi, cb) { + if(lo < this.mid && this.left) { + var r = this.left.queryInterval(lo, hi, cb) + if(r) { return r } + } + if(hi > this.mid && this.right) { + var r = this.right.queryInterval(lo, hi, cb) + if(r) { return r } + } + if(hi < this.mid) { + return reportLeftRange(this.leftPoints, hi, cb) + } else if(lo > this.mid) { + return reportRightRange(this.rightPoints, lo, cb) + } else { + return reportRange(this.leftPoints, cb) + } +} + +function compareNumbers(a, b) { + return a - b +} + +function compareBegin(a, b) { + var d = a[0] - b[0] + if(d) { return d } + return a[1] - b[1] +} + +function compareEnd(a, b) { + var d = a[1] - b[1] + if(d) { return d } + return a[0] - b[0] +} + +function createIntervalTree(intervals) { + if(intervals.length === 0) { + return null + } + var pts = [] + for(var i=0; i>1] + + var leftIntervals = [] + var rightIntervals = [] + var centerIntervals = [] + for(var i=0; i + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} + +},{}],352:[function(_dereq_,module,exports){ 'use strict' module.exports = isMobile @@ -34948,7 +62105,16 @@ function isMobile (opts) { return result } -},{}],118:[function(_dereq_,module,exports){ +},{}],353:[function(_dereq_,module,exports){ +'use strict'; +var toString = Object.prototype.toString; + +module.exports = function (x) { + var prototype; + return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); +}; + +},{}],354:[function(_dereq_,module,exports){ 'use strict'; /** @@ -34985,7 +62151,12 @@ module.exports = function(str){ return true; } -},{}],119:[function(_dereq_,module,exports){ +},{}],355:[function(_dereq_,module,exports){ +function lerp(v0, v1, t) { + return v0*(1-t)+v1*t +} +module.exports = lerp +},{}],356:[function(_dereq_,module,exports){ /* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v1.10.1/LICENSE.txt */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : @@ -77767,7 +104938,801 @@ return mapboxgl; }))); -},{}],120:[function(_dereq_,module,exports){ +},{}],357:[function(_dereq_,module,exports){ +/*jshint unused:true*/ +/* +Input: matrix ; a 4x4 matrix +Output: translation ; a 3 component vector + scale ; a 3 component vector + skew ; skew factors XY,XZ,YZ represented as a 3 component vector + perspective ; a 4 component vector + quaternion ; a 4 component vector +Returns false if the matrix cannot be decomposed, true if it can + + +References: +https://github.com/kamicane/matrix3d/blob/master/lib/Matrix3d.js +https://github.com/ChromiumWebApps/chromium/blob/master/ui/gfx/transform_util.cc +http://www.w3.org/TR/css3-transforms/#decomposing-a-3d-matrix +*/ + +var normalize = _dereq_('./normalize') + +var create = _dereq_('gl-mat4/create') +var clone = _dereq_('gl-mat4/clone') +var determinant = _dereq_('gl-mat4/determinant') +var invert = _dereq_('gl-mat4/invert') +var transpose = _dereq_('gl-mat4/transpose') +var vec3 = { + length: _dereq_('gl-vec3/length'), + normalize: _dereq_('gl-vec3/normalize'), + dot: _dereq_('gl-vec3/dot'), + cross: _dereq_('gl-vec3/cross') +} + +var tmp = create() +var perspectiveMatrix = create() +var tmpVec4 = [0, 0, 0, 0] +var row = [ [0,0,0], [0,0,0], [0,0,0] ] +var pdum3 = [0,0,0] + +module.exports = function decomposeMat4(matrix, translation, scale, skew, perspective, quaternion) { + if (!translation) translation = [0,0,0] + if (!scale) scale = [0,0,0] + if (!skew) skew = [0,0,0] + if (!perspective) perspective = [0,0,0,1] + if (!quaternion) quaternion = [0,0,0,1] + + //normalize, if not possible then bail out early + if (!normalize(tmp, matrix)) + return false + + // perspectiveMatrix is used to solve for perspective, but it also provides + // an easy way to test for singularity of the upper 3x3 component. + clone(perspectiveMatrix, tmp) + + perspectiveMatrix[3] = 0 + perspectiveMatrix[7] = 0 + perspectiveMatrix[11] = 0 + perspectiveMatrix[15] = 1 + + // If the perspectiveMatrix is not invertible, we are also unable to + // decompose, so we'll bail early. Constant taken from SkMatrix44::invert. + if (Math.abs(determinant(perspectiveMatrix) < 1e-8)) + return false + + var a03 = tmp[3], a13 = tmp[7], a23 = tmp[11], + a30 = tmp[12], a31 = tmp[13], a32 = tmp[14], a33 = tmp[15] + + // First, isolate perspective. + if (a03 !== 0 || a13 !== 0 || a23 !== 0) { + tmpVec4[0] = a03 + tmpVec4[1] = a13 + tmpVec4[2] = a23 + tmpVec4[3] = a33 + + // Solve the equation by inverting perspectiveMatrix and multiplying + // rightHandSide by the inverse. + // resuing the perspectiveMatrix here since it's no longer needed + var ret = invert(perspectiveMatrix, perspectiveMatrix) + if (!ret) return false + transpose(perspectiveMatrix, perspectiveMatrix) + + //multiply by transposed inverse perspective matrix, into perspective vec4 + vec4multMat4(perspective, tmpVec4, perspectiveMatrix) + } else { + //no perspective + perspective[0] = perspective[1] = perspective[2] = 0 + perspective[3] = 1 + } + + // Next take care of translation + translation[0] = a30 + translation[1] = a31 + translation[2] = a32 + + // Now get scale and shear. 'row' is a 3 element array of 3 component vectors + mat3from4(row, tmp) + + // Compute X scale factor and normalize first row. + scale[0] = vec3.length(row[0]) + vec3.normalize(row[0], row[0]) + + // Compute XY shear factor and make 2nd row orthogonal to 1st. + skew[0] = vec3.dot(row[0], row[1]) + combine(row[1], row[1], row[0], 1.0, -skew[0]) + + // Now, compute Y scale and normalize 2nd row. + scale[1] = vec3.length(row[1]) + vec3.normalize(row[1], row[1]) + skew[0] /= scale[1] + + // Compute XZ and YZ shears, orthogonalize 3rd row + skew[1] = vec3.dot(row[0], row[2]) + combine(row[2], row[2], row[0], 1.0, -skew[1]) + skew[2] = vec3.dot(row[1], row[2]) + combine(row[2], row[2], row[1], 1.0, -skew[2]) + + // Next, get Z scale and normalize 3rd row. + scale[2] = vec3.length(row[2]) + vec3.normalize(row[2], row[2]) + skew[1] /= scale[2] + skew[2] /= scale[2] + + + // At this point, the matrix (in rows) is orthonormal. + // Check for a coordinate system flip. If the determinant + // is -1, then negate the matrix and the scaling factors. + vec3.cross(pdum3, row[1], row[2]) + if (vec3.dot(row[0], pdum3) < 0) { + for (var i = 0; i < 3; i++) { + scale[i] *= -1; + row[i][0] *= -1 + row[i][1] *= -1 + row[i][2] *= -1 + } + } + + // Now, get the rotations out + quaternion[0] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0)) + quaternion[1] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0)) + quaternion[2] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0)) + quaternion[3] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0)) + + if (row[2][1] > row[1][2]) + quaternion[0] = -quaternion[0] + if (row[0][2] > row[2][0]) + quaternion[1] = -quaternion[1] + if (row[1][0] > row[0][1]) + quaternion[2] = -quaternion[2] + return true +} + +//will be replaced by gl-vec4 eventually +function vec4multMat4(out, a, m) { + var x = a[0], y = a[1], z = a[2], w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; +} + +//gets upper-left of a 4x4 matrix into a 3x3 of vectors +function mat3from4(out, mat4x4) { + out[0][0] = mat4x4[0] + out[0][1] = mat4x4[1] + out[0][2] = mat4x4[2] + + out[1][0] = mat4x4[4] + out[1][1] = mat4x4[5] + out[1][2] = mat4x4[6] + + out[2][0] = mat4x4[8] + out[2][1] = mat4x4[9] + out[2][2] = mat4x4[10] +} + +function combine(out, a, b, scale1, scale2) { + out[0] = a[0] * scale1 + b[0] * scale2 + out[1] = a[1] * scale1 + b[1] * scale2 + out[2] = a[2] * scale1 + b[2] * scale2 +} +},{"./normalize":358,"gl-mat4/clone":188,"gl-mat4/create":190,"gl-mat4/determinant":191,"gl-mat4/invert":203,"gl-mat4/transpose":216,"gl-vec3/cross":268,"gl-vec3/dot":273,"gl-vec3/length":283,"gl-vec3/normalize":290}],358:[function(_dereq_,module,exports){ +module.exports = function normalize(out, mat) { + var m44 = mat[15] + // Cannot normalize. + if (m44 === 0) + return false + var scale = 1 / m44 + for (var i=0; i<16; i++) + out[i] = mat[i] * scale + return true +} +},{}],359:[function(_dereq_,module,exports){ +var lerp = _dereq_('gl-vec3/lerp') + +var recompose = _dereq_('mat4-recompose') +var decompose = _dereq_('mat4-decompose') +var determinant = _dereq_('gl-mat4/determinant') +var slerp = _dereq_('quat-slerp') + +var state0 = state() +var state1 = state() +var tmp = state() + +module.exports = interpolate +function interpolate(out, start, end, alpha) { + if (determinant(start) === 0 || determinant(end) === 0) + return false + + //decompose the start and end matrices into individual components + var r0 = decompose(start, state0.translate, state0.scale, state0.skew, state0.perspective, state0.quaternion) + var r1 = decompose(end, state1.translate, state1.scale, state1.skew, state1.perspective, state1.quaternion) + if (!r0 || !r1) + return false + + + //now lerp/slerp the start and end components into a temporary lerp(tmptranslate, state0.translate, state1.translate, alpha) + lerp(tmp.translate, state0.translate, state1.translate, alpha) + lerp(tmp.skew, state0.skew, state1.skew, alpha) + lerp(tmp.scale, state0.scale, state1.scale, alpha) + lerp(tmp.perspective, state0.perspective, state1.perspective, alpha) + slerp(tmp.quaternion, state0.quaternion, state1.quaternion, alpha) + + //and recompose into our 'out' matrix + recompose(out, tmp.translate, tmp.scale, tmp.skew, tmp.perspective, tmp.quaternion) + return true +} + +function state() { + return { + translate: vec3(), + scale: vec3(1), + skew: vec3(), + perspective: vec4(), + quaternion: vec4() + } +} + +function vec3(n) { + return [n||0,n||0,n||0] +} + +function vec4() { + return [0,0,0,1] +} +},{"gl-mat4/determinant":191,"gl-vec3/lerp":284,"mat4-decompose":357,"mat4-recompose":360,"quat-slerp":414}],360:[function(_dereq_,module,exports){ +/* +Input: translation ; a 3 component vector + scale ; a 3 component vector + skew ; skew factors XY,XZ,YZ represented as a 3 component vector + perspective ; a 4 component vector + quaternion ; a 4 component vector +Output: matrix ; a 4x4 matrix + +From: http://www.w3.org/TR/css3-transforms/#recomposing-to-a-3d-matrix +*/ + +var mat4 = { + identity: _dereq_('gl-mat4/identity'), + translate: _dereq_('gl-mat4/translate'), + multiply: _dereq_('gl-mat4/multiply'), + create: _dereq_('gl-mat4/create'), + scale: _dereq_('gl-mat4/scale'), + fromRotationTranslation: _dereq_('gl-mat4/fromRotationTranslation') +} + +var rotationMatrix = mat4.create() +var temp = mat4.create() + +module.exports = function recomposeMat4(matrix, translation, scale, skew, perspective, quaternion) { + mat4.identity(matrix) + + //apply translation & rotation + mat4.fromRotationTranslation(matrix, quaternion, translation) + + //apply perspective + matrix[3] = perspective[0] + matrix[7] = perspective[1] + matrix[11] = perspective[2] + matrix[15] = perspective[3] + + // apply skew + // temp is a identity 4x4 matrix initially + mat4.identity(temp) + + if (skew[2] !== 0) { + temp[9] = skew[2] + mat4.multiply(matrix, matrix, temp) + } + + if (skew[1] !== 0) { + temp[9] = 0 + temp[8] = skew[1] + mat4.multiply(matrix, matrix, temp) + } + + if (skew[0] !== 0) { + temp[8] = 0 + temp[4] = skew[0] + mat4.multiply(matrix, matrix, temp) + } + + //apply scale + mat4.scale(matrix, matrix, scale) + return matrix +} +},{"gl-mat4/create":190,"gl-mat4/fromRotationTranslation":194,"gl-mat4/identity":201,"gl-mat4/multiply":205,"gl-mat4/scale":213,"gl-mat4/translate":215}],361:[function(_dereq_,module,exports){ +'use strict' + +var bsearch = _dereq_('binary-search-bounds') +var m4interp = _dereq_('mat4-interpolate') +var invert44 = _dereq_('gl-mat4/invert') +var rotateX = _dereq_('gl-mat4/rotateX') +var rotateY = _dereq_('gl-mat4/rotateY') +var rotateZ = _dereq_('gl-mat4/rotateZ') +var lookAt = _dereq_('gl-mat4/lookAt') +var translate = _dereq_('gl-mat4/translate') +var scale = _dereq_('gl-mat4/scale') +var normalize = _dereq_('gl-vec3/normalize') + +var DEFAULT_CENTER = [0,0,0] + +module.exports = createMatrixCameraController + +function MatrixCameraController(initialMatrix) { + this._components = initialMatrix.slice() + this._time = [0] + this.prevMatrix = initialMatrix.slice() + this.nextMatrix = initialMatrix.slice() + this.computedMatrix = initialMatrix.slice() + this.computedInverse = initialMatrix.slice() + this.computedEye = [0,0,0] + this.computedUp = [0,0,0] + this.computedCenter = [0,0,0] + this.computedRadius = [0] + this._limits = [-Infinity, Infinity] +} + +var proto = MatrixCameraController.prototype + +proto.recalcMatrix = function(t) { + var time = this._time + var tidx = bsearch.le(time, t) + var mat = this.computedMatrix + if(tidx < 0) { + return + } + var comps = this._components + if(tidx === time.length-1) { + var ptr = 16*tidx + for(var i=0; i<16; ++i) { + mat[i] = comps[ptr++] + } + } else { + var dt = (time[tidx+1] - time[tidx]) + var ptr = 16*tidx + var prev = this.prevMatrix + var allEqual = true + for(var i=0; i<16; ++i) { + prev[i] = comps[ptr++] + } + var next = this.nextMatrix + for(var i=0; i<16; ++i) { + next[i] = comps[ptr++] + allEqual = allEqual && (prev[i] === next[i]) + } + if(dt < 1e-6 || allEqual) { + for(var i=0; i<16; ++i) { + mat[i] = prev[i] + } + } else { + m4interp(mat, prev, next, (t - time[tidx])/dt) + } + } + + var up = this.computedUp + up[0] = mat[1] + up[1] = mat[5] + up[2] = mat[9] + normalize(up, up) + + var imat = this.computedInverse + invert44(imat, mat) + var eye = this.computedEye + var w = imat[15] + eye[0] = imat[12]/w + eye[1] = imat[13]/w + eye[2] = imat[14]/w + + var center = this.computedCenter + var radius = Math.exp(this.computedRadius[0]) + for(var i=0; i<3; ++i) { + center[i] = eye[i] - mat[2+4*i] * radius + } +} + +proto.idle = function(t) { + if(t < this.lastT()) { + return + } + var mc = this._components + var ptr = mc.length-16 + for(var i=0; i<16; ++i) { + mc.push(mc[ptr++]) + } + this._time.push(t) +} + +proto.flush = function(t) { + var idx = bsearch.gt(this._time, t) - 2 + if(idx < 0) { + return + } + this._time.splice(0, idx) + this._components.splice(0, 16*idx) +} + +proto.lastT = function() { + return this._time[this._time.length-1] +} + +proto.lookAt = function(t, eye, center, up) { + this.recalcMatrix(t) + eye = eye || this.computedEye + center = center || DEFAULT_CENTER + up = up || this.computedUp + this.setMatrix(t, lookAt(this.computedMatrix, eye, center, up)) + var d2 = 0.0 + for(var i=0; i<3; ++i) { + d2 += Math.pow(center[i] - eye[i], 2) + } + d2 = Math.log(Math.sqrt(d2)) + this.computedRadius[0] = d2 +} + +proto.rotate = function(t, yaw, pitch, roll) { + this.recalcMatrix(t) + var mat = this.computedInverse + if(yaw) rotateY(mat, mat, yaw) + if(pitch) rotateX(mat, mat, pitch) + if(roll) rotateZ(mat, mat, roll) + this.setMatrix(t, invert44(this.computedMatrix, mat)) +} + +var tvec = [0,0,0] + +proto.pan = function(t, dx, dy, dz) { + tvec[0] = -(dx || 0.0) + tvec[1] = -(dy || 0.0) + tvec[2] = -(dz || 0.0) + this.recalcMatrix(t) + var mat = this.computedInverse + translate(mat, mat, tvec) + this.setMatrix(t, invert44(mat, mat)) +} + +proto.translate = function(t, dx, dy, dz) { + tvec[0] = dx || 0.0 + tvec[1] = dy || 0.0 + tvec[2] = dz || 0.0 + this.recalcMatrix(t) + var mat = this.computedMatrix + translate(mat, mat, tvec) + this.setMatrix(t, mat) +} + +proto.setMatrix = function(t, mat) { + if(t < this.lastT()) { + return + } + this._time.push(t) + for(var i=0; i<16; ++i) { + this._components.push(mat[i]) + } +} + +proto.setDistance = function(t, d) { + this.computedRadius[0] = d +} + +proto.setDistanceLimits = function(a,b) { + var lim = this._limits + lim[0] = a + lim[1] = b +} + +proto.getDistanceLimits = function(out) { + var lim = this._limits + if(out) { + out[0] = lim[0] + out[1] = lim[1] + return out + } + return lim +} + +function createMatrixCameraController(options) { + options = options || {} + var matrix = options.matrix || + [1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] + return new MatrixCameraController(matrix) +} + +},{"binary-search-bounds":92,"gl-mat4/invert":203,"gl-mat4/lookAt":204,"gl-mat4/rotateX":210,"gl-mat4/rotateY":211,"gl-mat4/rotateZ":212,"gl-mat4/scale":213,"gl-mat4/translate":215,"gl-vec3/normalize":290,"mat4-interpolate":359}],362:[function(_dereq_,module,exports){ +'use strict' + +module.exports = monotoneConvexHull2D + +var orient = _dereq_('robust-orientation')[3] + +function monotoneConvexHull2D(points) { + var n = points.length + + if(n < 3) { + var result = new Array(n) + for(var i=0; i 1 && orient( + points[lower[m-2]], + points[lower[m-1]], + p) <= 0) { + m -= 1 + lower.pop() + } + lower.push(idx) + + //Insert into upper list + m = upper.length + while(m > 1 && orient( + points[upper[m-2]], + points[upper[m-1]], + p) >= 0) { + m -= 1 + upper.pop() + } + upper.push(idx) + } + + //Merge lists together + var result = new Array(upper.length + lower.length - 2) + var ptr = 0 + for(var i=0, nl=lower.length; i0; --j) { + result[ptr++] = upper[j] + } + + //Return result + return result +} +},{"robust-orientation":427}],363:[function(_dereq_,module,exports){ +'use strict' + +module.exports = mouseListen + +var mouse = _dereq_('mouse-event') + +function mouseListen (element, callback) { + if (!callback) { + callback = element + element = window + } + + var buttonState = 0 + var x = 0 + var y = 0 + var mods = { + shift: false, + alt: false, + control: false, + meta: false + } + var attached = false + + function updateMods (ev) { + var changed = false + if ('altKey' in ev) { + changed = changed || ev.altKey !== mods.alt + mods.alt = !!ev.altKey + } + if ('shiftKey' in ev) { + changed = changed || ev.shiftKey !== mods.shift + mods.shift = !!ev.shiftKey + } + if ('ctrlKey' in ev) { + changed = changed || ev.ctrlKey !== mods.control + mods.control = !!ev.ctrlKey + } + if ('metaKey' in ev) { + changed = changed || ev.metaKey !== mods.meta + mods.meta = !!ev.metaKey + } + return changed + } + + function handleEvent (nextButtons, ev) { + var nextX = mouse.x(ev) + var nextY = mouse.y(ev) + if ('buttons' in ev) { + nextButtons = ev.buttons | 0 + } + if (nextButtons !== buttonState || + nextX !== x || + nextY !== y || + updateMods(ev)) { + buttonState = nextButtons | 0 + x = nextX || 0 + y = nextY || 0 + callback && callback(buttonState, x, y, mods) + } + } + + function clearState (ev) { + handleEvent(0, ev) + } + + function handleBlur () { + if (buttonState || + x || + y || + mods.shift || + mods.alt || + mods.meta || + mods.control) { + x = y = 0 + buttonState = 0 + mods.shift = mods.alt = mods.control = mods.meta = false + callback && callback(0, 0, 0, mods) + } + } + + function handleMods (ev) { + if (updateMods(ev)) { + callback && callback(buttonState, x, y, mods) + } + } + + function handleMouseMove (ev) { + if (mouse.buttons(ev) === 0) { + handleEvent(0, ev) + } else { + handleEvent(buttonState, ev) + } + } + + function handleMouseDown (ev) { + handleEvent(buttonState | mouse.buttons(ev), ev) + } + + function handleMouseUp (ev) { + handleEvent(buttonState & ~mouse.buttons(ev), ev) + } + + function attachListeners () { + if (attached) { + return + } + attached = true + + element.addEventListener('mousemove', handleMouseMove) + + element.addEventListener('mousedown', handleMouseDown) + + element.addEventListener('mouseup', handleMouseUp) + + element.addEventListener('mouseleave', clearState) + element.addEventListener('mouseenter', clearState) + element.addEventListener('mouseout', clearState) + element.addEventListener('mouseover', clearState) + + element.addEventListener('blur', handleBlur) + + element.addEventListener('keyup', handleMods) + element.addEventListener('keydown', handleMods) + element.addEventListener('keypress', handleMods) + + if (element !== window) { + window.addEventListener('blur', handleBlur) + + window.addEventListener('keyup', handleMods) + window.addEventListener('keydown', handleMods) + window.addEventListener('keypress', handleMods) + } + } + + function detachListeners () { + if (!attached) { + return + } + attached = false + + element.removeEventListener('mousemove', handleMouseMove) + + element.removeEventListener('mousedown', handleMouseDown) + + element.removeEventListener('mouseup', handleMouseUp) + + element.removeEventListener('mouseleave', clearState) + element.removeEventListener('mouseenter', clearState) + element.removeEventListener('mouseout', clearState) + element.removeEventListener('mouseover', clearState) + + element.removeEventListener('blur', handleBlur) + + element.removeEventListener('keyup', handleMods) + element.removeEventListener('keydown', handleMods) + element.removeEventListener('keypress', handleMods) + + if (element !== window) { + window.removeEventListener('blur', handleBlur) + + window.removeEventListener('keyup', handleMods) + window.removeEventListener('keydown', handleMods) + window.removeEventListener('keypress', handleMods) + } + } + + // Attach listeners + attachListeners() + + var result = { + element: element + } + + Object.defineProperties(result, { + enabled: { + get: function () { return attached }, + set: function (f) { + if (f) { + attachListeners() + } else { + detachListeners() + } + }, + enumerable: true + }, + buttons: { + get: function () { return buttonState }, + enumerable: true + }, + x: { + get: function () { return x }, + enumerable: true + }, + y: { + get: function () { return y }, + enumerable: true + }, + mods: { + get: function () { return mods }, + enumerable: true + } + }) + + return result +} + +},{"mouse-event":365}],364:[function(_dereq_,module,exports){ var rootPosition = { left: 0, top: 0 } module.exports = mouseEventOffset @@ -77794,7 +105759,111 @@ function getBoundingClientOffset (element) { } } -},{}],121:[function(_dereq_,module,exports){ +},{}],365:[function(_dereq_,module,exports){ +'use strict' + +function mouseButtons(ev) { + if(typeof ev === 'object') { + if('buttons' in ev) { + return ev.buttons + } else if('which' in ev) { + var b = ev.which + if(b === 2) { + return 4 + } else if(b === 3) { + return 2 + } else if(b > 0) { + return 1<<(b-1) + } + } else if('button' in ev) { + var b = ev.button + if(b === 1) { + return 4 + } else if(b === 2) { + return 2 + } else if(b >= 0) { + return 1< 0) { + i1 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } + } + p0 += u0_1 + X = 0 + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + for (i1 = 2; i1 < s1; ++i1) { + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } + } + if (i1 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_1 + } + } + freeUint32(V) + freeUint32(P) + } + }, + "false,1,0": function anonymous(vertex, face, phase, mallocUint32, freeUint32) { + return function extractContour1_0(a0, x0, x1, x2) { + var s0 = a0.shape[0] | 0, + s1 = a0.shape[1] | 0, + d0 = a0.data, + o0 = a0.offset | 0, + t0_0 = a0.stride[0] | 0, + t0_1 = a0.stride[1] | 0, + p0 = o0, + c0_0, + d0_1 = -t0_0 | 0, + c0_1 = 0, + d0_2 = -t0_1 | 0, + c0_2 = 0, + d0_3 = (-t0_0 - t0_1) | 0, + c0_3 = 0, + u0_1 = t0_1 | 0, + u0_0 = (t0_0 - t0_1 * s1) | 0, + i0 = 0, + i1 = 0, + N = 0, + Q = (2 * s1) | 0, + P = mallocUint32(Q), + V = mallocUint32(Q), + X = 0, + b0 = 0, + e2 = -1 | 0, + y2 = -1 | 0, + b2 = 0, + e1 = -s1 | 0, + y1 = s1 | 0, + b1 = 0, + e3 = (-s1 - 1) | 0, + y3 = (s1 - 1) | 0, + b3 = 0, + v0 = 0, + T = 0 + for (i1 = 0; i1 < s1; ++i1) { + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + } + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + if (s1 > 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + } + } + p0 += u0_0 + X = 0 + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + for (i0 = 2; i0 < s0; ++i0) { + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + if (s1 > 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + } + } + if (i0 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_0 + } + } + freeUint32(V) + freeUint32(P) + } + }, +} + +//Generates the surface procedure +function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, order, typesig) { + var key = [typesig, order].join(',') + var proc = allFns[key] + + return proc( + vertexFunc, + faceFunc, + phaseFunc, + pool.mallocUint32, + pool.freeUint32) +} + +function createSurfaceExtractor(args) { + function error(msg) { + throw new Error("ndarray-extract-contour: " + msg) + } + if(typeof args !== "object") { + error("Must specify arguments") + } + var order = args.order + if(!Array.isArray(order)) { + error("Must specify order") + } + var arrays = args.arrayArguments||1 + if(arrays < 1) { + error("Must have at least one array argument") + } + var scalars = args.scalarArguments||0 + if(scalars < 0) { + error("Scalar arg count must be > 0") + } + if(typeof args.vertex !== "function") { + error("Must specify vertex creation function") + } + if(typeof args.cell !== "function") { + error("Must specify cell creation function") + } + if(typeof args.phase !== "function") { + error("Must specify phase function") + } + var getters = args.getters || [] + var typesig = new Array(arrays) + for(var i=0; i= 0) { + typesig[i] = true + } else { + typesig[i] = false + } + } + return compileSurfaceProcedure( + args.vertex, + args.cell, + args.phase, + scalars, + order, + typesig) +} +},{"typedarray-pool":477}],369:[function(_dereq_,module,exports){ +'use strict' + +var dup = _dereq_('dup') + +var CACHED_CWiseOp = { + zero: function(SS, a0, t0, p0) { + var s0 = SS[0], t0p0 = t0[0] + p0 |= 0 + var i0 = 0, d0s0 = t0p0 + for (i0 = 0; i0 < s0; ++i0) { + a0[p0] = 0 + p0 += d0s0 + } + }, + + fdTemplate1: function(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], t0p0 = t0[0], t1p0 = t1[0], q0 = -1 * t0p0, q1 = t0p0 + p0 |= 0 + p1 |= 0 + var i0 = 0, d0s0 = t0p0, d1s0 = t1p0 + for (i0 = 0; i0 < s0; ++i0) { + a1[p1] = 0.5 * (a0[p0 + q0] - a0[p0 + q1]) + p0 += d0s0 + p1 += d1s0 + } + }, + + fdTemplate2: function(SS, a0, t0, p0, a1, t1, p1, a2, t2, p2) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1], t2p0 = t2[0], t2p1 = t2[1], q0 = -1 * t0p0, q1 = t0p0, q2 = -1 * t0p1, q3 = t0p1 + p0 |= 0 + p1 |= 0 + p2 |= 0 + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1), d2s0 = t2p1, d2s1 = (t2p0 - s1 * t2p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a1[p1] = 0.5 * (a0[p0 + q0] - a0[p0 + q1]); a2[p2] = 0.5 * (a0[p0 + q2] - a0[p0 + q3]) + p0 += d0s0 + p1 += d1s0 + p2 += d2s0 + } + p0 += d0s1 + p1 += d1s1 + p2 += d2s1 + } + } +} + +var CACHED_thunk = { + cdiff: function(compile) { + var CACHED = {} + return function cdiff_cwise_thunk(array0, array1, array2) { + var t0 = array0.dtype, r0 = array0.order, t1 = array1.dtype, r1 = array1.order, t2 = array2.dtype, r2 = array2.order, type = [t0, r0.join(), t1, r1.join(), t2, r2.join()].join(), proc = CACHED[type] + if (!proc) { CACHED[type] = proc = compile([t0, r0, t1, r1, t2, r2]) } return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, array1.data, array1.stride, array1.offset | 0, array2.data, array2.stride, array2.offset | 0) + } + }, + + zero: function(compile) { + var CACHED = {} + return function zero_cwise_thunk(array0) { + var t0 = array0.dtype, r0 = array0.order, type = [t0, r0.join()].join(), proc = CACHED[type] + if (!proc) { CACHED[type] = proc = compile([t0, r0]) } return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0) + } + }, + + fdTemplate1: function(compile) { + var CACHED = {} + return function fdTemplate1_cwise_thunk(array0, array1) { + var t0 = array0.dtype, r0 = array0.order, t1 = array1.dtype, r1 = array1.order, type = [t0, r0.join(), t1, r1.join()].join(), proc = CACHED[type] + if (!proc) { CACHED[type] = proc = compile([t0, r0, t1, r1]) } return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, array1.data, array1.stride, array1.offset | 0) + } + }, + + fdTemplate2: function(compile) { + var CACHED = {} + return function fdTemplate2_cwise_thunk(array0, array1, array4) { + var t0 = array0.dtype, r0 = array0.order, t1 = array1.dtype, r1 = array1.order, t4 = array4.dtype, r4 = array4.order, type = [t0, r0.join(), t1, r1.join(), t4, r4.join()].join(), proc = CACHED[type] + if (!proc) { CACHED[type] = proc = compile([t0, r0, t1, r1, t4, r4]) } return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, array1.data, array1.stride, array1.offset | 0, array4.data, array4.stride, array4.offset | 0) + } + }, +} + +function createThunk(proc) { + var thunk = CACHED_thunk[proc.funcName] + return thunk(compile.bind(undefined, proc)) +} + +function compile(proc) { + return CACHED_CWiseOp[proc.funcName] +} + +function cwiseCompiler(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + + +var TEMPLATE_CACHE = {} +var GRADIENT_CACHE = {} + +var EmptyProc = { + body: "", + args: [], + thisVars: [], + localVars: [] +} + +var centralDiff = cwiseCompiler({ + funcName: 'cdiff' +}) + +var zeroOut = cwiseCompiler({ + funcName: 'zero' +}) + +function generateTemplate(d) { + if(d in TEMPLATE_CACHE) { + return TEMPLATE_CACHE[d] + } + return TEMPLATE_CACHE[d] = cwiseCompiler({ + funcName: 'fdTemplate' + d + }) +} + +function CACHED_link(diff, zero, grad1, grad2) { + return function(dst, src) { + var s = src.shape.slice() + if (1 && s[0] > 2 && s[1] > 2) { + grad2( + src + .pick(-1, -1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 0) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2) + ) + } + if (1 && s[1] > 2) { + grad1( + src + .pick(0, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(0, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(0, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) + } + if (1 && s[1] > 2) { + grad1( + src + .pick(s[0] - 1, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(s[0] - 1, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(s[0] - 1, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) + } + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, 0) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, 0, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, 0, 1) + .lo(1) + .hi(s[0] - 2) + ) + } + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, s[1] - 1) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, s[1] - 1, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, s[1] - 1, 1) + .lo(1) + .hi(s[0] - 2) + ) + } + dst.set(0, 0, 0, 0) + dst.set(0, 0, 1, 0) + dst.set(s[0] - 1, 0, 0, 0) + dst.set(s[0] - 1, 0, 1, 0) + dst.set(0, s[1] - 1, 0, 0) + dst.set(0, s[1] - 1, 1, 0) + dst.set(s[0] - 1, s[1] - 1, 0, 0) + dst.set(s[0] - 1, s[1] - 1, 1, 0) + return dst + } +} + + +function generateGradient(boundaryConditions) { + var token = boundaryConditions.join() + var proc = GRADIENT_CACHE[token] + if(proc) { + return proc + } + + var d = boundaryConditions.length + + var linkArgs = [ centralDiff, zeroOut ] + for(var i=1; i<=d; ++i) { + linkArgs.push(generateTemplate(i)) + } + + var link = CACHED_link + + var proc = link.apply(void 0, linkArgs) + + GRADIENT_CACHE[token] = proc + return proc +} + +module.exports = function gradient(out, inp, bc) { + if(!Array.isArray(bc)) { + if(typeof bc === 'string') { + bc = dup(inp.dimension, bc) + } else { + bc = dup(inp.dimension, 'clamp') + } + } + if(inp.size === 0) { + return out + } + if(inp.dimension === 0) { + out.set(0) + return out + } + var cached = generateGradient(bc) + return cached(out, inp) +} +},{"dup":155}],370:[function(_dereq_,module,exports){ +"use strict" + +function interp1d(arr, x) { + var ix = Math.floor(x) + , fx = x - ix + , s0 = 0 <= ix && ix < arr.shape[0] + , s1 = 0 <= ix+1 && ix+1 < arr.shape[0] + , w0 = s0 ? +arr.get(ix) : 0.0 + , w1 = s1 ? +arr.get(ix+1) : 0.0 + return (1.0-fx)*w0 + fx*w1 +} + +function interp2d(arr, x, y) { + var ix = Math.floor(x) + , fx = x - ix + , s0 = 0 <= ix && ix < arr.shape[0] + , s1 = 0 <= ix+1 && ix+1 < arr.shape[0] + , iy = Math.floor(y) + , fy = y - iy + , t0 = 0 <= iy && iy < arr.shape[1] + , t1 = 0 <= iy+1 && iy+1 < arr.shape[1] + , w00 = s0&&t0 ? arr.get(ix ,iy ) : 0.0 + , w01 = s0&&t1 ? arr.get(ix ,iy+1) : 0.0 + , w10 = s1&&t0 ? arr.get(ix+1,iy ) : 0.0 + , w11 = s1&&t1 ? arr.get(ix+1,iy+1) : 0.0 + return (1.0-fy) * ((1.0-fx)*w00 + fx*w10) + fy * ((1.0-fx)*w01 + fx*w11) +} + +function interp3d(arr, x, y, z) { + var ix = Math.floor(x) + , fx = x - ix + , s0 = 0 <= ix && ix < arr.shape[0] + , s1 = 0 <= ix+1 && ix+1 < arr.shape[0] + , iy = Math.floor(y) + , fy = y - iy + , t0 = 0 <= iy && iy < arr.shape[1] + , t1 = 0 <= iy+1 && iy+1 < arr.shape[1] + , iz = Math.floor(z) + , fz = z - iz + , u0 = 0 <= iz && iz < arr.shape[2] + , u1 = 0 <= iz+1 && iz+1 < arr.shape[2] + , w000 = s0&&t0&&u0 ? arr.get(ix,iy,iz) : 0.0 + , w010 = s0&&t1&&u0 ? arr.get(ix,iy+1,iz) : 0.0 + , w100 = s1&&t0&&u0 ? arr.get(ix+1,iy,iz) : 0.0 + , w110 = s1&&t1&&u0 ? arr.get(ix+1,iy+1,iz) : 0.0 + , w001 = s0&&t0&&u1 ? arr.get(ix,iy,iz+1) : 0.0 + , w011 = s0&&t1&&u1 ? arr.get(ix,iy+1,iz+1) : 0.0 + , w101 = s1&&t0&&u1 ? arr.get(ix+1,iy,iz+1) : 0.0 + , w111 = s1&&t1&&u1 ? arr.get(ix+1,iy+1,iz+1) : 0.0 + return (1.0-fz) * ((1.0-fy) * ((1.0-fx)*w000 + fx*w100) + fy * ((1.0-fx)*w010 + fx*w110)) + fz * ((1.0-fy) * ((1.0-fx)*w001 + fx*w101) + fy * ((1.0-fx)*w011 + fx*w111)) +} + +function interpNd(arr) { + var d = arr.shape.length|0 + , ix = new Array(d) + , fx = new Array(d) + , s0 = new Array(d) + , s1 = new Array(d) + , i, t + for(i=0; i 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] * Y0 + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + }, + 'float32,1,0,float32,1,0': function () { + return function assign_cwise_loop_1s0m2f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + }, + 'float32,1,0,float32,0,1': function () { + return function assign_cwise_loop_1s0m0f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[1] | 0; j0 > 0;) { + if (j0 < 64) { + s1 = j0 + j0 = 0 + } else { + s1 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + p0 = (offset0 + j0 * t0p1 + j1 * t0p0) + p1 = (offset1 + j0 * t1p1 + j1 * t1p0) + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + } + } + }, + 'uint8,2,0,1,uint8,1,2,0': function () { + return function assign_cwise_loop_2s0s1m0u8(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[2] | 0; j0 > 0;) { + if (j0 < 64) { + s2 = j0 + j0 = 0 + } else { + s2 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j0 * t0p2 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j0 * t1p2 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + } + }, + 'uint8,2,0,1,array,2,0,1': function () { + return function assign_cwise_loop_2s0s1m3u8a(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + }, +} + +//Generates a cwise operator +function generateCWiseOp(proc, typesig) { + var key = typesig.join(',') + var f = CACHED_CWiseOp[key] + return f() +} + +var compile = generateCWiseOp + +var CACHED_thunk = { + mul: function (compile) { + var CACHED = {} + return function mul_cwise_thunk(array0, array1, array2) { + var t0 = array0.dtype, + r0 = array0.order, + t1 = array1.dtype, + r1 = array1.order, + t2 = array2.dtype, + r2 = array2.order, + type = [t0, r0.join(), t1, r1.join(), t2, r2.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0, t1, r1, t2, r2]) + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + array1.data, + array1.stride, + array1.offset | 0, + array2.data, + array2.stride, + array2.offset | 0 + ) + } + }, + muls: function (compile) { + var CACHED = {} + return function muls_cwise_thunk(array0, array1, scalar2) { + var t0 = array0.dtype, + r0 = array0.order, + t1 = array1.dtype, + r1 = array1.order, + type = [t0, r0.join(), t1, r1.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0, t1, r1]) + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + array1.data, + array1.stride, + array1.offset | 0, + scalar2 + ) + } + }, + mulseq: function (compile) { + var CACHED = {} + return function mulseq_cwise_thunk(array0, scalar1) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar1) + } + }, + div: function (compile) { + var CACHED = {} + return function div_cwise_thunk(array0, array1, array2) { + var t0 = array0.dtype, + r0 = array0.order, + t1 = array1.dtype, + r1 = array1.order, + t2 = array2.dtype, + r2 = array2.order, + type = [t0, r0.join(), t1, r1.join(), t2, r2.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0, t1, r1, t2, r2]) + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + array1.data, + array1.stride, + array1.offset | 0, + array2.data, + array2.stride, + array2.offset | 0 + ) + } + }, + divs: function (compile) { + var CACHED = {} + return function divs_cwise_thunk(array0, array1, scalar2) { + var t0 = array0.dtype, + r0 = array0.order, + t1 = array1.dtype, + r1 = array1.order, + type = [t0, r0.join(), t1, r1.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0, t1, r1]) + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + array1.data, + array1.stride, + array1.offset | 0, + scalar2 + ) + } + }, + divseq: function (compile) { + var CACHED = {} + return function divseq_cwise_thunk(array0, scalar1) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar1) + } + }, + assign: function (compile) { + var CACHED = {} + return function assign_cwise_thunk(array0, array1) { + var t0 = array0.dtype, + r0 = array0.order, + t1 = array1.dtype, + r1 = array1.order, + type = [t0, r0.join(), t1, r1.join()].join(), + proc = CACHED[type] + if (!proc) { + CACHED[type] = proc = compile([t0, r0, t1, r1]) + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + array1.data, + array1.stride, + array1.offset | 0 + ) + } + }, +} + +function createThunk(proc) { + var thunk = CACHED_thunk[proc.funcName] + return thunk(compile.bind(undefined, proc)) +} + +function makeOp(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +var assign_ops = { + mul: "*", + div: "/", +} +;(function(){ + for(var id in assign_ops) { + exports[id] = makeOp({ + funcName: id + }) + exports[id+"s"] = makeOp({ + funcName: id+"s" + }) + exports[id+"seq"] = makeOp({ + funcName: id+"seq" + }) + } +})(); + +exports.assign = makeOp({ + funcName: "assign" }) + +},{}],372:[function(_dereq_,module,exports){ +"use strict" + +var ndarray = _dereq_("ndarray") +var do_convert = _dereq_("./doConvert.js") + +module.exports = function convert(arr, result) { + var shape = [], c = arr, sz = 1 + while(Array.isArray(c)) { + shape.push(c.length) + sz *= c.length + c = c[0] + } + if(shape.length === 0) { + return ndarray() + } + if(!result) { + result = ndarray(new Float64Array(sz), shape) + } + do_convert(result, arr) + return result +} + +},{"./doConvert.js":373,"ndarray":376}],373:[function(_dereq_,module,exports){ +"use strict" + +function CwiseOp() { + return function (SS, a0, t0, p0, Y0) { + var s0 = SS[0], + s1 = SS[1], + s2 = SS[2], + t0p0 = t0[0], + t0p1 = t0[1], + t0p2 = t0[2], + index = [0, 0, 0]; + p0 |= 0; + var i0 = 0, + i1 = 0, + i2 = 0, + d0s0 = t0p2, + d0s1 = t0p1 - s2 * t0p2, + d0s2 = t0p0 - s1 * t0p1; + for (i2 = 0; i2 < s0; ++i2) { + for (i1 = 0; i1 < s1; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + { + var _inline_1_v = Y0, + _inline_1_i; + for ( + _inline_1_i = 0; + _inline_1_i < index.length - 1; + ++_inline_1_i + ) { + _inline_1_v = _inline_1_v[index[_inline_1_i]]; + } + a0[p0] = _inline_1_v[index[index.length - 1]]; + } + p0 += d0s0; + ++index[2]; + } + p0 += d0s1; + index[2] -= s2; + ++index[1]; + } + p0 += d0s2; + index[1] -= s1; + ++index[0]; + } + }; +} + +//Generates a cwise operator +function generateCWiseOp() { + return CwiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {}; + return function convert_cwise_thunk(array0, scalar1) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type]; + if (!proc) { + CACHED[type] = proc = compile([t0, r0]); + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + scalar1 + ); + }; +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ + funcName: "convert" +}); + +},{}],374:[function(_dereq_,module,exports){ +"use strict" + +var pool = _dereq_("typedarray-pool") + +function getMallocFree(dtype) { + switch(dtype) { + case "uint32": + return [pool.mallocUint32, pool.freeUint32] + default: + return null + } +} + +var CACHED_insertionSort = { + "uint32,1,0": function (malloc, free) { + return function ndarrayInsertionSort1d0uint32(left, right, data, offset, s0, s1, n0, n1, d1, e1, f1) { + var i, + j, + cptr, + ptr = left * s0 + offset, + i1, + scratch = malloc(n1), + dptr, + sptr, + a, + b + for (i = left + 1; i <= right; ++i) { + j = i + ptr += s0 + cptr = ptr + dptr = 0 + sptr = ptr + for (i1 = 0; i1 < n1; ++i1) { + scratch[dptr++] = data[sptr] + sptr += d1 + } + __g: while (j-- > left) { + dptr = 0 + sptr = cptr - s0 + __l: for (i1 = 0; i1 < n1; ++i1) { + a = data[sptr] + b = scratch[dptr] + if (a < b) { + break __g + } + if (a > b) { + break __l + } + sptr += e1 + dptr += f1 + } + dptr = cptr + sptr = cptr - s0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = data[sptr] + dptr += d1 + sptr += d1 + } + cptr -= s0 + } + dptr = cptr + sptr = 0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = scratch[sptr++] + dptr += d1 + } + } + free(scratch) + } + }, +} + +function createInsertionSort(order, dtype) { + var allocator = getMallocFree(dtype) + var key = [dtype, order].join(',') + var result = CACHED_insertionSort[key] + + if(allocator) { + return result(allocator[0], allocator[1]) + } else { + return result() + } +} + +var CACHED_quickSort = { + "uint32,1,0": function (insertionSort, malloc, free) { + return function ndarrayQuickSort1d0uint32(left, right, data, offset, s0, s1, n0, n1, d1, e1, f1) { + var 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, + i1, + b_ptr0, + b_ptr1, + b_ptr2, + b_ptr3, + b_ptr4, + b_ptr5, + b_ptr6, + b_ptr7, + ptr3, + ptr4, + ptr5, + ptr6, + ptr7, + pivot_ptr, + ptr_shift, + elementSize = n1, + pivot1 = malloc(elementSize), + pivot2 = malloc(elementSize) + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + ptr_shift = offset + __l1: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el2 + el2 = tmp0 + break __l1 + } + if (comp < 0) { + break __l1 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l2: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l2 + } + if (comp < 0) { + break __l2 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l3: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el3 + el3 = tmp0 + break __l3 + } + if (comp < 0) { + break __l3 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l4: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l4 + } + if (comp < 0) { + break __l4 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l5: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el4 + el4 = tmp0 + break __l5 + } + if (comp < 0) { + break __l5 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el3 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l6: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el3 + el3 = el4 + el4 = tmp0 + break __l6 + } + if (comp < 0) { + break __l6 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l7: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el5 + el5 = tmp0 + break __l7 + } + if (comp < 0) { + break __l7 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l8: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l8 + } + if (comp < 0) { + break __l8 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l9: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l9 + } + if (comp < 0) { + break __l9 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + b_ptr2 = s0 * el3 + b_ptr3 = s0 * el4 + b_ptr4 = s0 * el5 + b_ptr5 = s0 * index1 + b_ptr6 = s0 * index3 + b_ptr7 = s0 * index5 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + ptr3 = b_ptr3 + ptr_shift + ptr4 = b_ptr4 + ptr_shift + ptr5 = b_ptr5 + ptr_shift + ptr6 = b_ptr6 + ptr_shift + ptr7 = b_ptr7 + ptr_shift + pivot1[pivot_ptr] = data[ptr1] + pivot2[pivot_ptr] = data[ptr3] + pivots_are_equal = pivots_are_equal && pivot1[pivot_ptr] === pivot2[pivot_ptr] + x = data[ptr0] + y = data[ptr2] + z = data[ptr4] + data[ptr5] = x + data[ptr6] = y + data[ptr7] = z + ++pivot_ptr + ptr_shift += d1 + } + b_ptr0 = s0 * index2 + b_ptr1 = s0 * left + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + b_ptr0 = s0 * index4 + b_ptr1 = s0 * right + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + if (pivots_are_equal) { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l10: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l10 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + continue + } + if (comp < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l11: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l11 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + great-- + } else if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + break + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + break + } + } + } + } + } else { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l12: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l12 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l13: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l13 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 > 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l14: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l14 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l15: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l15 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } + } + b_ptr0 = s0 * left + b_ptr1 = s0 * (less - 1) + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + data[ptr1] = pivot1[pivot_ptr] + ++pivot_ptr + ptr_shift += d1 + } + b_ptr0 = s0 * right + b_ptr1 = s0 * (great + 1) + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + data[ptr1] = pivot2[pivot_ptr] + ++pivot_ptr + ptr_shift += d1 + } + if (less - 2 - left <= 32) { + insertionSort(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) + } else { + ndarrayQuickSort1d0uint32(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) + } + if (right - (great + 2) <= 32) { + insertionSort(great + 2, right, data, offset, s0, s1, n0, n1, d1, e1, f1) + } else { + ndarrayQuickSort1d0uint32(great + 2, right, data, offset, s0, s1, n0, n1, d1, e1, f1) + } + if (pivots_are_equal) { + free(pivot1) + free(pivot2) + return + } + if (less < index1 && great > index5) { + __l16: while (true) { + ptr0 = offset + less * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot1[pivot_ptr]) { + break __l16 + } + ++pivot_ptr + ptr0 += d1 + } + ++less + } + __l17: while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot2[pivot_ptr]) { + break __l17 + } + ++pivot_ptr + ptr0 += d1 + } + --great + } + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l18: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l18 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 === 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l19: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l19 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 === 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l20: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l20 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l21: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l21 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } + } + free(pivot1) + free(pivot2) + if (great - less <= 32) { + insertionSort(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) + } else { + ndarrayQuickSort1d0uint32(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) + } + } + }, +} + +function createQuickSort(order, dtype, insertionSort) { + var allocator = getMallocFree(dtype) + var key = [dtype, order].join(',') + var result = CACHED_quickSort[key] + + if(order.length > 1 && allocator) { + return result(insertionSort, allocator[0], allocator[1]) + } else { + return result(insertionSort) + } +} + +var CACHED_sort = { + "uint32,1,0": function (insertionSort, quickSort) { + return function (array) { + var data = array.data, + offset = array.offset | 0, + shape = array.shape, + stride = array.stride, + s0 = stride[0] | 0, + n0 = shape[0] | 0, + s1 = stride[1] | 0, + n1 = shape[1] | 0, + d1 = s1, + e1 = s1, + f1 = 1 + if (n0 <= 32) { + insertionSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) + } else { + quickSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) + } + } + }, +} + +function compileSort(order, dtype) { + var key = [dtype, order].join(',') + var result = CACHED_sort[key] + + var insertionSort = createInsertionSort(order, dtype) + var quickSort = createQuickSort(order, dtype, insertionSort) + return result(insertionSort, quickSort) +} + +module.exports = compileSort +},{"typedarray-pool":477}],375:[function(_dereq_,module,exports){ +"use strict" + +var compile = _dereq_("./lib/compile_sort.js") +var CACHE = {} + +function sort(array) { + var order = array.order + var dtype = array.dtype + var typeSig = [order, dtype ] + var typeName = typeSig.join(":") + var compiled = CACHE[typeName] + if(!compiled) { + CACHE[typeName] = compiled = compile(order, dtype) + } + compiled(array) + return array +} + +module.exports = sort +},{"./lib/compile_sort.js":374}],376:[function(_dereq_,module,exports){ +var isBuffer = _dereq_("is-buffer") + +var hasTypedArrays = ((typeof Float64Array) !== "undefined") + +function compare1st(a, b) { + return a[0] - b[0] +} + +function order() { + var stride = this.stride + var terms = new Array(stride.length) + var i + for(i=0; i= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + return new View(this.data, a0, c0, b) + } + proto.step = function step(i0) { + var a0 = this.shape[0], + b0 = this.stride[0], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + return new View(this.data, a0, b0, c) + } + proto.transpose = function transpose(i0) { + i0 = i0 === undefined ? 0 : i0 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], b[i0], this.offset) + } + proto.pick = function pick(i0) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], stride[0], offset) + } + }, + 2: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, c0, c1, d) { + this.data = a + this.shape = [b0, b1] + this.stride = [c0, c1] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 2 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + return Math.abs(this.stride[0]) > Math.abs(this.stride[1]) ? [1, 0] : [0, 1] + }, + }) + proto.set = function set(i0, i1, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] = v) + } + proto.get = function get(i0, i1) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] + } + proto.index = function index(i0, i1) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + } + proto.hi = function hi(i0, i1) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + this.stride[0], + this.stride[1], + this.offset + ) + } + proto.lo = function lo(i0, i1) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + c0 = this.stride[0], + c1 = this.stride[1] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + return new View(this.data, a0, a1, c0, c1, b) + } + proto.step = function step(i0, i1) { + var a0 = this.shape[0], + a1 = this.shape[1], + b0 = this.stride[0], + b1 = this.stride[1], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + return new View(this.data, a0, a1, b0, b1, c) + } + proto.transpose = function transpose(i0, i1) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], b[i0], b[i1], this.offset) + } + proto.pick = function pick(i0, i1) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], stride[0], stride[1], offset) + } + }, + 3: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, c0, c1, c2, d) { + this.data = a + this.shape = [b0, b1, b2] + this.stride = [c0, c1, c2] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 3 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + 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] + } + }, + }) + proto.set = function set(i0, i1, i2, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] = v) + } + proto.get = function get(i0, i1, i2) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] + } + proto.index = function index(i0, i1, i2) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + } + proto.hi = function hi(i0, i1, i2) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + return new View(this.data, a0, a1, a2, c0, c1, c2, b) + } + proto.step = function step(i0, i1, i2) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + return new View(this.data, a0, a1, a2, b0, b1, b2, c) + } + proto.transpose = function transpose(i0, i1, i2) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], b[i0], b[i1], b[i2], this.offset) + } + proto.pick = function pick(i0, i1, i2) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], stride[0], stride[1], stride[2], offset) + } + }, + 4: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, c0, c1, c2, c3, d) { + this.data = a + this.shape = [b0, b1, b2, b3] + this.stride = [c0, c1, c2, c3] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 4 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] = v) + } + proto.get = function get(i0, i1, i2, i3) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] + } + proto.index = function index(i0, i1, i2, i3) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3 + } + proto.hi = function hi(i0, i1, i2, i3) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + return new View(this.data, a0, a1, a2, a3, c0, c1, c2, c3, b) + } + proto.step = function step(i0, i1, i2, i3) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + return new View(this.data, a0, a1, a2, a3, b0, b1, b2, b3, c) + } + proto.transpose = function transpose(i0, i1, i2, i3) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], b[i0], b[i1], b[i2], b[i3], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], shape[3], stride[0], stride[1], stride[2], stride[3], offset) + } + }, + 5: function anonymous(dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, b4, c0, c1, c2, c3, c4, d) { + this.data = a + this.shape = [b0, b1, b2, b3, b4] + this.stride = [c0, c1, c2, c3, c4] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 5 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] * this.shape[4] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, i4, v) { + return dtype === "generic" + ? this.data.set( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4, + v + ) + : (this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] = v) + } + proto.get = function get(i0, i1, i2, i3, i4) { + return dtype === "generic" + ? this.data.get( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + : this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] + } + proto.index = function index(i0, i1, i2, i3, i4) { + return ( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + } + proto.hi = function hi(i0, i1, i2, i3, i4) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + typeof i4 !== "number" || i4 < 0 ? this.shape[4] : i4 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.stride[4], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3, i4) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3], + c4 = this.stride[4] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + if (typeof i4 === "number" && i4 >= 0) { + d = i4 | 0 + b += c4 * d + a4 -= d + } + return new View(this.data, a0, a1, a2, a3, a4, c0, c1, c2, c3, c4, b) + } + proto.step = function step(i0, i1, i2, i3, i4) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + b4 = this.stride[4], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + if (typeof i4 === "number") { + d = i4 | 0 + if (d < 0) { + c += b4 * (a4 - 1) + a4 = ceil(-a4 / d) + } else { + a4 = ceil(a4 / d) + } + b4 *= d + } + return new View(this.data, a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, c) + } + proto.transpose = function transpose(i0, i1, i2, i3, i4) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + i4 = i4 === undefined ? 4 : i4 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], a[i4], b[i0], b[i1], b[i2], b[i3], b[i4], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3, i4) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + if (typeof i4 === "number" && i4 >= 0) { + c = (c + this.stride[4] * i4) | 0 + } else { + a.push(this.shape[4]) + b.push(this.stride[4]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View( + data, + shape[0], + shape[1], + shape[2], + shape[3], + shape[4], + stride[0], + stride[1], + stride[2], + stride[3], + stride[4], + offset + ) + } + }, +} + + +function compileConstructor(inType, inDimension) { + var dKey = inDimension === -1 ? 'T' : String(inDimension) + + var procedure = allFns[dKey] + if(inDimension === -1) { + return procedure(inType) + } else if(inDimension === 0) { + return procedure(inType, CACHED_CONSTRUCTORS[inType][0]) + } + return procedure(inType, CACHED_CONSTRUCTORS[inType], order) +} + +function arrayDType(data) { + if(isBuffer(data)) { + return "buffer" + } + if(hasTypedArrays) { + switch(Object.prototype.toString.call(data)) { + 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 Uint8ClampedArray]": + return "uint8_clamped" + case "[object Uint8Array]": + return "uint8" + case "[object Uint16Array]": + return "uint16" + case "[object Uint32Array]": + return "uint32" + case "[object BigInt64Array]": + return "bigint64" + case "[object BigUint64Array]": + return "biguint64" + } + } + if(Array.isArray(data)) { + return "array" + } + return "generic" +} + +var CACHED_CONSTRUCTORS = { + "generic":[], + "buffer":[], + "array":[], + + // typed arrays + "float32":[], + "float64":[], + "int8":[], + "int16":[], + "int32":[], + "uint8_clamped":[], + "uint8":[], + "uint16":[], + "uint32":[], + "bigint64": [], + "biguint64": [] +} + +;(function() { + for(var id in CACHED_CONSTRUCTORS) { + CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1)) + } +}); + +function wrappedNDArrayCtor(data, shape, stride, offset) { + if(data === undefined) { + var ctor = CACHED_CONSTRUCTORS.array[0] + return ctor([]) + } else if(typeof data === "number") { + data = [data] + } + if(shape === undefined) { + shape = [ data.length ] + } + var d = shape.length + if(stride === undefined) { + stride = new Array(d) + for(var i=d-1, sz=1; i>=0; --i) { + stride[i] = sz + sz *= shape[i] + } + } + if(offset === undefined) { + offset = 0 + for(var i=0; i>>0 + +module.exports = nextafter + +function nextafter(x, y) { + if(isNaN(x) || isNaN(y)) { + return NaN + } + if(x === y) { + return x + } + if(x === 0) { + if(y < 0) { + return -SMALLEST_DENORM + } else { + return SMALLEST_DENORM + } + } + var hi = doubleBits.hi(x) + var lo = doubleBits.lo(x) + if((y > x) === (x > 0)) { + if(lo === UINT_MAX) { + hi += 1 + lo = 0 + } else { + lo += 1 + } + } else { + if(lo === 0) { + lo = UINT_MAX + hi -= 1 + } else { + lo -= 1 + } + } + return doubleBits.pack(lo, hi) +} +},{"double-bits":153}],378:[function(_dereq_,module,exports){ +var DEFAULT_NORMALS_EPSILON = 1e-6; +var DEFAULT_FACE_EPSILON = 1e-6; + +//Estimate the vertex normals of a mesh +exports.vertexNormals = function(faces, positions, specifiedEpsilon) { + + var N = positions.length; + var normals = new Array(N); + var epsilon = specifiedEpsilon === void(0) ? DEFAULT_NORMALS_EPSILON : specifiedEpsilon; + + //Initialize normal array + for(var i=0; i epsilon) { + var norm = normals[c]; + var w = 1.0 / Math.sqrt(m01 * m21); + for(var k=0; k<3; ++k) { + var u = (k+1)%3; + var v = (k+2)%3; + norm[k] += w * (d21[u] * d01[v] - d21[v] * d01[u]); + } + } + } + } + + //Scale all normals to unit length + for(var i=0; i epsilon) { + var w = 1.0 / Math.sqrt(m); + for(var k=0; k<3; ++k) { + norm[k] *= w; + } + } else { + for(var k=0; k<3; ++k) { + norm[k] = 0.0; + } + } + } + + //Return the resulting set of patches + return normals; +} + +//Compute face normals of a mesh +exports.faceNormals = function(faces, positions, specifiedEpsilon) { + + var N = faces.length; + var normals = new Array(N); + var epsilon = specifiedEpsilon === void(0) ? DEFAULT_FACE_EPSILON : specifiedEpsilon; + + for(var i=0; i epsilon) { + l = 1.0 / Math.sqrt(l); + } else { + l = 0.0; + } + for(var j=0; j<3; ++j) { + n[j] *= l; + } + normals[i] = n; + } + return normals; +} + + + +},{}],379:[function(_dereq_,module,exports){ /* object-assign (c) Sindre Sorhus @@ -78263,7 +109540,459 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],123:[function(_dereq_,module,exports){ +},{}],380:[function(_dereq_,module,exports){ +'use strict' + +module.exports = quatFromFrame + +function quatFromFrame( + out, + rx, ry, rz, + ux, uy, uz, + fx, fy, fz) { + var tr = rx + uy + fz + if(l > 0) { + var l = Math.sqrt(tr + 1.0) + out[0] = 0.5 * (uz - fy) / l + out[1] = 0.5 * (fx - rz) / l + out[2] = 0.5 * (ry - uy) / l + out[3] = 0.5 * l + } else { + var tf = Math.max(rx, uy, fz) + var l = Math.sqrt(2 * tf - tr + 1.0) + if(rx >= tf) { + //x y z order + out[0] = 0.5 * l + out[1] = 0.5 * (ux + ry) / l + out[2] = 0.5 * (fx + rz) / l + out[3] = 0.5 * (uz - fy) / l + } else if(uy >= tf) { + //y z x order + out[0] = 0.5 * (ry + ux) / l + out[1] = 0.5 * l + out[2] = 0.5 * (fy + uz) / l + out[3] = 0.5 * (fx - rz) / l + } else { + //z x y order + out[0] = 0.5 * (rz + fx) / l + out[1] = 0.5 * (uz + fy) / l + out[2] = 0.5 * l + out[3] = 0.5 * (ry - ux) / l + } + } + return out +} +},{}],381:[function(_dereq_,module,exports){ +'use strict' + +module.exports = createOrbitController + +var filterVector = _dereq_('filtered-vector') +var lookAt = _dereq_('gl-mat4/lookAt') +var mat4FromQuat = _dereq_('gl-mat4/fromQuat') +var invert44 = _dereq_('gl-mat4/invert') +var quatFromFrame = _dereq_('./lib/quatFromFrame') + +function len3(x,y,z) { + return Math.sqrt(Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2)) +} + +function len4(w,x,y,z) { + return Math.sqrt(Math.pow(w,2) + Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2)) +} + +function normalize4(out, a) { + var ax = a[0] + var ay = a[1] + var az = a[2] + var aw = a[3] + var al = len4(ax, ay, az, aw) + if(al > 1e-6) { + out[0] = ax/al + out[1] = ay/al + out[2] = az/al + out[3] = aw/al + } else { + out[0] = out[1] = out[2] = 0.0 + out[3] = 1.0 + } +} + +function OrbitCameraController(initQuat, initCenter, initRadius) { + this.radius = filterVector([initRadius]) + this.center = filterVector(initCenter) + this.rotation = filterVector(initQuat) + + this.computedRadius = this.radius.curve(0) + this.computedCenter = this.center.curve(0) + this.computedRotation = this.rotation.curve(0) + this.computedUp = [0.1,0,0] + this.computedEye = [0.1,0,0] + this.computedMatrix = [0.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + + this.recalcMatrix(0) +} + +var proto = OrbitCameraController.prototype + +proto.lastT = function() { + return Math.max( + this.radius.lastT(), + this.center.lastT(), + this.rotation.lastT()) +} + +proto.recalcMatrix = function(t) { + this.radius.curve(t) + this.center.curve(t) + this.rotation.curve(t) + + var quat = this.computedRotation + normalize4(quat, quat) + + var mat = this.computedMatrix + mat4FromQuat(mat, quat) + + var center = this.computedCenter + var eye = this.computedEye + var up = this.computedUp + var radius = Math.exp(this.computedRadius[0]) + + eye[0] = center[0] + radius * mat[2] + eye[1] = center[1] + radius * mat[6] + eye[2] = center[2] + radius * mat[10] + up[0] = mat[1] + up[1] = mat[5] + up[2] = mat[9] + + for(var i=0; i<3; ++i) { + var rr = 0.0 + for(var j=0; j<3; ++j) { + rr += mat[i+4*j] * eye[j] + } + mat[12+i] = -rr + } +} + +proto.getMatrix = function(t, result) { + this.recalcMatrix(t) + var m = this.computedMatrix + if(result) { + for(var i=0; i<16; ++i) { + result[i] = m[i] + } + return result + } + return m +} + +proto.idle = function(t) { + this.center.idle(t) + this.radius.idle(t) + this.rotation.idle(t) +} + +proto.flush = function(t) { + this.center.flush(t) + this.radius.flush(t) + this.rotation.flush(t) +} + +proto.pan = function(t, dx, dy, dz) { + dx = dx || 0.0 + dy = dy || 0.0 + dz = dz || 0.0 + + this.recalcMatrix(t) + var mat = this.computedMatrix + + var ux = mat[1] + var uy = mat[5] + var uz = mat[9] + var ul = len3(ux, uy, uz) + ux /= ul + uy /= ul + uz /= ul + + var rx = mat[0] + var ry = mat[4] + var rz = mat[8] + var ru = rx * ux + ry * uy + rz * uz + rx -= ux * ru + ry -= uy * ru + rz -= uz * ru + var rl = len3(rx, ry, rz) + rx /= rl + ry /= rl + rz /= rl + + var fx = mat[2] + var fy = mat[6] + var fz = mat[10] + var fu = fx * ux + fy * uy + fz * uz + var fr = fx * rx + fy * ry + fz * rz + fx -= fu * ux + fr * rx + fy -= fu * uy + fr * ry + fz -= fu * uz + fr * rz + var fl = len3(fx, fy, fz) + fx /= fl + fy /= fl + fz /= fl + + var vx = rx * dx + ux * dy + var vy = ry * dx + uy * dy + var vz = rz * dx + uz * dy + + this.center.move(t, vx, vy, vz) + + //Update z-component of radius + var radius = Math.exp(this.computedRadius[0]) + radius = Math.max(1e-4, radius + dz) + this.radius.set(t, Math.log(radius)) +} + +proto.rotate = function(t, dx, dy, dz) { + this.recalcMatrix(t) + + dx = dx||0.0 + dy = dy||0.0 + + var mat = this.computedMatrix + + var rx = mat[0] + var ry = mat[4] + var rz = mat[8] + + var ux = mat[1] + var uy = mat[5] + var uz = mat[9] + + var fx = mat[2] + var fy = mat[6] + var fz = mat[10] + + var qx = dx * rx + dy * ux + var qy = dx * ry + dy * uy + var qz = dx * rz + dy * uz + + var bx = -(fy * qz - fz * qy) + var by = -(fz * qx - fx * qz) + var bz = -(fx * qy - fy * qx) + var bw = Math.sqrt(Math.max(0.0, 1.0 - Math.pow(bx,2) - Math.pow(by,2) - Math.pow(bz,2))) + var bl = len4(bx, by, bz, bw) + if(bl > 1e-6) { + bx /= bl + by /= bl + bz /= bl + bw /= bl + } else { + bx = by = bz = 0.0 + bw = 1.0 + } + + var rotation = this.computedRotation + var ax = rotation[0] + var ay = rotation[1] + var az = rotation[2] + var aw = rotation[3] + + var cx = ax*bw + aw*bx + ay*bz - az*by + var cy = ay*bw + aw*by + az*bx - ax*bz + var cz = az*bw + aw*bz + ax*by - ay*bx + var cw = aw*bw - ax*bx - ay*by - az*bz + + //Apply roll + if(dz) { + bx = fx + by = fy + bz = fz + var s = Math.sin(dz) / len3(bx, by, bz) + bx *= s + by *= s + bz *= s + bw = Math.cos(dx) + cx = cx*bw + cw*bx + cy*bz - cz*by + cy = cy*bw + cw*by + cz*bx - cx*bz + cz = cz*bw + cw*bz + cx*by - cy*bx + cw = cw*bw - cx*bx - cy*by - cz*bz + } + + var cl = len4(cx, cy, cz, cw) + if(cl > 1e-6) { + cx /= cl + cy /= cl + cz /= cl + cw /= cl + } else { + cx = cy = cz = 0.0 + cw = 1.0 + } + + this.rotation.set(t, cx, cy, cz, cw) +} + +proto.lookAt = function(t, eye, center, up) { + this.recalcMatrix(t) + + center = center || this.computedCenter + eye = eye || this.computedEye + up = up || this.computedUp + + var mat = this.computedMatrix + lookAt(mat, eye, center, up) + + var rotation = this.computedRotation + quatFromFrame(rotation, + mat[0], mat[1], mat[2], + mat[4], mat[5], mat[6], + mat[8], mat[9], mat[10]) + normalize4(rotation, rotation) + this.rotation.set(t, rotation[0], rotation[1], rotation[2], rotation[3]) + + var fl = 0.0 + for(var i=0; i<3; ++i) { + fl += Math.pow(center[i] - eye[i], 2) + } + this.radius.set(t, 0.5 * Math.log(Math.max(fl, 1e-6))) + + this.center.set(t, center[0], center[1], center[2]) +} + +proto.translate = function(t, dx, dy, dz) { + this.center.move(t, + dx||0.0, + dy||0.0, + dz||0.0) +} + +proto.setMatrix = function(t, matrix) { + + var rotation = this.computedRotation + quatFromFrame(rotation, + matrix[0], matrix[1], matrix[2], + matrix[4], matrix[5], matrix[6], + matrix[8], matrix[9], matrix[10]) + normalize4(rotation, rotation) + this.rotation.set(t, rotation[0], rotation[1], rotation[2], rotation[3]) + + var mat = this.computedMatrix + invert44(mat, matrix) + var w = mat[15] + if(Math.abs(w) > 1e-6) { + var cx = mat[12]/w + var cy = mat[13]/w + var cz = mat[14]/w + + this.recalcMatrix(t) + var r = Math.exp(this.computedRadius[0]) + this.center.set(t, cx-mat[2]*r, cy-mat[6]*r, cz-mat[10]*r) + this.radius.idle(t) + } else { + this.center.idle(t) + this.radius.idle(t) + } +} + +proto.setDistance = function(t, d) { + if(d > 0) { + this.radius.set(t, Math.log(d)) + } +} + +proto.setDistanceLimits = function(lo, hi) { + if(lo > 0) { + lo = Math.log(lo) + } else { + lo = -Infinity + } + if(hi > 0) { + hi = Math.log(hi) + } else { + hi = Infinity + } + hi = Math.max(hi, lo) + this.radius.bounds[0][0] = lo + this.radius.bounds[1][0] = hi +} + +proto.getDistanceLimits = function(out) { + var bounds = this.radius.bounds + if(out) { + out[0] = Math.exp(bounds[0][0]) + out[1] = Math.exp(bounds[1][0]) + return out + } + return [ Math.exp(bounds[0][0]), Math.exp(bounds[1][0]) ] +} + +proto.toJSON = function() { + this.recalcMatrix(this.lastT()) + return { + 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] + } +} + +proto.fromJSON = function(options) { + var t = this.lastT() + var c = options.center + if(c) { + this.center.set(t, c[0], c[1], c[2]) + } + var r = options.rotation + if(r) { + this.rotation.set(t, r[0], r[1], r[2], r[3]) + } + var d = options.distance + if(d && d > 0) { + this.radius.set(t, Math.log(d)) + } + this.setDistanceLimits(options.zoomMin, options.zoomMax) +} + +function createOrbitController(options) { + options = options || {} + var center = options.center || [0,0,0] + var rotation = options.rotation || [0,0,0,1] + var radius = options.radius || 1.0 + + center = [].slice.call(center, 0, 3) + rotation = [].slice.call(rotation, 0, 4) + normalize4(rotation, rotation) + + var result = new OrbitCameraController( + rotation, + center, + Math.log(radius)) + + result.setDistanceLimits(options.zoomMin, options.zoomMax) + + if('eye' in options || 'up' in options) { + result.lookAt(0, options.eye, options.center, options.up) + } + + return result +} +},{"./lib/quatFromFrame":380,"filtered-vector":160,"gl-mat4/fromQuat":192,"gl-mat4/invert":203,"gl-mat4/lookAt":204}],382:[function(_dereq_,module,exports){ +/*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var repeat = _dereq_('repeat-string'); + +module.exports = function padLeft(str, num, ch) { + ch = typeof ch !== 'undefined' ? (ch + '') : ' '; + return repeat(ch, num) + str; +}; +},{"repeat-string":420}],383:[function(_dereq_,module,exports){ module.exports = parse @@ -78322,7 +110051,562 @@ function parseValues(args) { return numbers ? numbers.map(Number) : [] } -},{}],124:[function(_dereq_,module,exports){ +},{}],384:[function(_dereq_,module,exports){ +module.exports = function parseUnit(str, out) { + if (!out) + out = [ 0, '' ] + + str = String(str) + var num = parseFloat(str, 10) + out[0] = num + out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' + return out +} +},{}],385:[function(_dereq_,module,exports){ +"use strict" + +module.exports = planarDual + +var compareAngle = _dereq_("compare-angle") + +function planarDual(cells, positions) { + + var numVertices = positions.length|0 + var numEdges = cells.length + var adj = [new Array(numVertices), new Array(numVertices)] + for(var i=0; i 0) { + nextCell = adj[i][b][0] + nextDir = i + break + } + } + nextVertex = nextCell[nextDir^1] + + for(var dir=0; dir<2; ++dir) { + var nbhd = adj[dir][b] + for(var k=0; k 0) { + nextCell = e + nextVertex = p + nextDir = dir + } + } + } + if(noCut) { + return nextVertex + } + if(nextCell) { + cut(nextCell, nextDir) + } + return nextVertex + } + + function extractCycle(v, dir) { + var e0 = adj[dir][v][0] + var cycle = [v] + cut(e0, dir) + var u = e0[dir^1] + var d0 = dir + while(true) { + while(u !== v) { + cycle.push(u) + u = next(cycle[cycle.length-2], u, false) + } + if(adj[0][v].length + adj[1][v].length === 0) { + break + } + var a = cycle[cycle.length-1] + var b = v + var c = cycle[1] + var d = next(a, b, true) + if(compareAngle(positions[a], positions[b], positions[c], positions[d]) < 0) { + break + } + cycle.push(v) + u = next(a, b) + } + return cycle + } + + function shouldGlue(pcycle, ncycle) { + return (ncycle[1] === ncycle[ncycle.length-1]) + } + + for(var i=0; i 0) { + var ni = adj[0][i].length + var ncycle = extractCycle(i,j) + if(shouldGlue(pcycle, ncycle)) { + //Glue together trivial cycles + pcycle.push.apply(pcycle, ncycle) + } else { + if(pcycle.length > 0) { + cycles.push(pcycle) + } + pcycle = ncycle + } + } + if(pcycle.length > 0) { + cycles.push(pcycle) + } + } + } + + //Combine paths and loops together + return cycles +} +},{"compare-angle":125}],386:[function(_dereq_,module,exports){ +'use strict' + +module.exports = trimLeaves + +var e2a = _dereq_('edges-to-adjacency-list') + +function trimLeaves(edges, positions) { + var adj = e2a(edges, positions.length) + var live = new Array(positions.length) + var nbhd = new Array(positions.length) + + var dead = [] + for(var i=0; i 0) { + var v = dead.pop() + live[v] = false + var n = adj[v] + for(var i=0; i 0 + } + + //Extract all clockwise faces + faces = faces.filter(ccw) + + //Detect which loops are contained in one another to handle parent-of relation + var numFaces = faces.length + var parent = new Array(numFaces) + var containment = new Array(numFaces) + for(var i=0; i 0) { + var top = toVisit.pop() + var nbhd = fadj[top] + uniq(nbhd, function(a,b) { + return a-b + }) + var nnbhr = nbhd.length + var p = parity[top] + var polyline + if(p === 0) { + var c = faces[top] + polyline = [c] + } + for(var i=0; i= 0) { + continue + } + parity[f] = p^1 + toVisit.push(f) + if(p === 0) { + var c = faces[f] + if(!sharedBoundary(c)) { + c.reverse() + polyline.push(c) + } + } + } + if(p === 0) { + result.push(polyline) + } + } + + return result +} +},{"./lib/trim-leaves":386,"edges-to-adjacency-list":156,"planar-dual":385,"point-in-big-polygon":388,"robust-sum":432,"two-product":475,"uniq":479}],388:[function(_dereq_,module,exports){ +module.exports = preprocessPolygon + +var orient = _dereq_('robust-orientation')[3] +var makeSlabs = _dereq_('slab-decomposition') +var makeIntervalTree = _dereq_('interval-tree-1d') +var bsearch = _dereq_('binary-search-bounds') + +function visitInterval() { + return true +} + +function intervalSearch(table) { + return function(x, y) { + var tree = table[x] + if(tree) { + return !!tree.queryPoint(y, visitInterval) + } + return false + } +} + +function buildVerticalIndex(segments) { + var table = {} + for(var i=0; i 0 && coordinates[bucket] === p[0]) { + root = slabs[bucket-1] + } else { + return 1 + } + } + var lastOrientation = 1 + while(root) { + var s = root.key + var o = orient(p, s[0], s[1]) + if(s[0][0] < s[1][0]) { + if(o < 0) { + root = root.left + } else if(o > 0) { + lastOrientation = -1 + root = root.right + } else { + return 0 + } + } else { + if(o > 0) { + root = root.left + } else if(o < 0) { + lastOrientation = 1 + root = root.right + } else { + return 0 + } + } + } + return lastOrientation + } +} + +function classifyEmpty(p) { + return 1 +} + +function createClassifyVertical(testVertical) { + return function classify(p) { + if(testVertical(p[0], p[1])) { + return 0 + } + return 1 + } +} + +function createClassifyPointDegen(testVertical, testNormal) { + return function classify(p) { + if(testVertical(p[0], p[1])) { + return 0 + } + return testNormal(p) + } +} + +function preprocessPolygon(loops) { + //Compute number of loops + var numLoops = loops.length + + //Unpack segments + var segments = [] + var vsegments = [] + var ptr = 0 + for(var i=0; i= a00) { + s = 1.0; + sqrDistance = a00 + 2.0*b0 + c; + } else { + s = -b0/a00; + sqrDistance = b0*s + c; + } + } else { + s = 0; + if (b1 >= 0) { + t = 0; + sqrDistance = c; + } else if (-b1 >= a11) { + t = 1; + sqrDistance = a11 + 2.0*b1 + c; + } else { + t = -b1/a11; + sqrDistance = b1*t + c; + } + } + } else { // region 3 + s = 0; + if (b1 >= 0) { + t = 0; + sqrDistance = c; + } else if (-b1 >= a11) { + t = 1; + sqrDistance = a11 + 2.0*b1 + c; + } else { + t = -b1/a11; + sqrDistance = b1*t + c; + } + } + } else if (t < 0) { // region 5 + t = 0; + if (b0 >= 0) { + s = 0; + sqrDistance = c; + } else if (-b0 >= a00) { + s = 1; + sqrDistance = a00 + 2.0*b0 + c; + } else { + s = -b0/a00; + sqrDistance = b0*s + c; + } + } else { // region 0 + // minimum at interior point + var invDet = 1.0 / det; + s *= invDet; + t *= invDet; + sqrDistance = s*(a00*s + a01*t + 2.0*b0) + t*(a01*s + a11*t + 2.0*b1) + c; + } + } else { + var tmp0, tmp1, numer, denom; + + if (s < 0) { // region 2 + tmp0 = a01 + b0; + tmp1 = a11 + b1; + if (tmp1 > tmp0) { + numer = tmp1 - tmp0; + denom = a00 - 2.0*a01 + a11; + if (numer >= denom) { + s = 1; + t = 0; + sqrDistance = a00 + 2.0*b0 + c; + } else { + s = numer/denom; + t = 1 - s; + sqrDistance = s*(a00*s + a01*t + 2.0*b0) + + t*(a01*s + a11*t + 2.0*b1) + c; + } + } else { + s = 0; + if (tmp1 <= 0) { + t = 1; + sqrDistance = a11 + 2.0*b1 + c; + } else if (b1 >= 0) { + t = 0; + sqrDistance = c; + } else { + t = -b1/a11; + sqrDistance = b1*t + c; + } + } + } else if (t < 0) { // region 6 + tmp0 = a01 + b1; + tmp1 = a00 + b0; + if (tmp1 > tmp0) { + numer = tmp1 - tmp0; + denom = a00 - 2.0*a01 + a11; + if (numer >= denom) { + t = 1; + s = 0; + sqrDistance = a11 + 2.0*b1 + c; + } else { + t = numer/denom; + s = 1 - t; + sqrDistance = s*(a00*s + a01*t + 2.0*b0) + + t*(a01*s + a11*t + 2.0*b1) + c; + } + } else { + t = 0; + if (tmp1 <= 0) { + s = 1; + sqrDistance = a00 + 2.0*b0 + c; + } else if (b0 >= 0) { + s = 0; + sqrDistance = c; + } else { + s = -b0/a00; + sqrDistance = b0*s + c; + } + } + } else { // region 1 + numer = a11 + b1 - a01 - b0; + if (numer <= 0) { + s = 0; + t = 1; + sqrDistance = a11 + 2.0*b1 + c; + } else { + denom = a00 - 2.0*a01 + a11; + if (numer >= denom) { + s = 1; + t = 0; + sqrDistance = a00 + 2.0*b0 + c; + } else { + s = numer/denom; + t = 1 - s; + sqrDistance = s*(a00*s + a01*t + 2.0*b0) + + t*(a01*s + a11*t + 2.0*b1) + c; + } + } + } + } + var u = 1.0 - s - t; + for(var i=0; i 0) { + var f = cells[ptr-1] + if(compareCell(c, f) === 0 && + orientation(f) !== o) { + ptr -= 1 + continue + } + } + cells[ptr++] = c + } + cells.length = ptr + return cells +} + +},{"cell-orientation":111,"compare-cell":126,"compare-oriented-cell":127}],420:[function(_dereq_,module,exports){ +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Results cache + */ + +var res = ''; +var cache; + +/** + * Expose `repeat` + */ + +module.exports = repeat; + +/** + * Repeat the given `string` the specified `number` + * of times. + * + * **Example:** + * + * ```js + * var repeat = require('repeat-string'); + * repeat('A', 5); + * //=> AAAAA + * ``` + * + * @param {String} `string` The string to repeat + * @param {Number} `number` The number of times to repeat the string + * @return {String} Repeated string + * @api public + */ + +function repeat(str, num) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + // cover common, quick use cases + if (num === 1) return str; + if (num === 2) return str + str; + + var max = str.length * num; + if (cache !== str || typeof cache === 'undefined') { + cache = str; + res = ''; + } else if (res.length >= max) { + return res.substr(0, max); + } + + while (max > res.length && num > 1) { + if (num & 1) { + res += str; + } + + num >>= 1; + str += str; + } + + res += str; + res = res.substr(0, max); + return res; +} + +},{}],421:[function(_dereq_,module,exports){ +(function (global){(function (){ +module.exports = + global.performance && + global.performance.now ? function now() { + return performance.now() + } : Date.now || function now() { + return +new Date + } + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],422:[function(_dereq_,module,exports){ +"use strict" + +module.exports = compressExpansion + +function compressExpansion(e) { + var m = e.length + var Q = e[e.length-1] + var bottom = m + for(var i=m-2; i>=0; --i) { + var a = Q + var b = e[i] + Q = a + b + var bv = Q - a + var q = b - bv + if(q) { + e[--bottom] = Q + Q = q + } + } + var top = 0 + for(var i=bottom; i 0) { + if(r <= 0) { + return det + } else { + s = l + r + } + } else if(l < 0) { + if(r >= 0) { + return det + } else { + s = -(l + r) + } + } else { + return det + } + var tol = ERRBOUND3 * s + if(det >= tol || det <= -tol) { + return det + } + return orientation3Exact(a, b, c) + }, + function orientation4(a,b,c,d) { + var adx = a[0] - d[0] + var bdx = b[0] - d[0] + var cdx = c[0] - d[0] + var ady = a[1] - d[1] + var bdy = b[1] - d[1] + var cdy = c[1] - d[1] + var adz = a[2] - d[2] + var bdz = b[2] - d[2] + var cdz = c[2] - d[2] + var bdxcdy = bdx * cdy + var cdxbdy = cdx * bdy + var cdxady = cdx * ady + var adxcdy = adx * cdy + var adxbdy = adx * bdy + var bdxady = bdx * ady + var det = adz * (bdxcdy - cdxbdy) + + bdz * (cdxady - adxcdy) + + cdz * (adxbdy - bdxady) + var permanent = (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) + + (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) + + (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz) + var tol = ERRBOUND4 * permanent + if ((det > tol) || (-det > tol)) { + return det + } + return orientation4Exact(a,b,c,d) + } +] + +function slowOrient(args) { + var proc = CACHED[args.length] + if(!proc) { + proc = CACHED[args.length] = orientation(args.length) + } + return proc.apply(undefined, args) +} + +function proc (slow, o0, o1, o2, o3, o4, o5) { + return function getOrientation(a0, a1, a2, a3, a4) { + switch (arguments.length) { + case 0: + case 1: + return 0; + case 2: + return o2(a0, a1) + case 3: + return o3(a0, a1, a2) + case 4: + return o4(a0, a1, a2, a3) + case 5: + return o5(a0, a1, a2, a3, a4) + } + + var s = new Array(arguments.length) + for (var i = 0; i < arguments.length; ++i) { + s[i] = arguments[i] + } + return slow(s) + } +} + +function generateOrientationProc() { + while(CACHED.length <= NUM_EXPAND) { + CACHED.push(orientation(CACHED.length)) + } + module.exports = proc.apply(undefined, [slowOrient].concat(CACHED)) + for(var i=0; i<=NUM_EXPAND; ++i) { + module.exports[i] = CACHED[i] + } +} + +generateOrientationProc() +},{"robust-scale":429,"robust-subtract":431,"robust-sum":432,"two-product":475}],428:[function(_dereq_,module,exports){ +"use strict" + +var robustSum = _dereq_("robust-sum") +var robustScale = _dereq_("robust-scale") + +module.exports = robustProduct + +function robustProduct(a, b) { + if(a.length === 1) { + return robustScale(b, a[0]) + } + if(b.length === 1) { + return robustScale(a, b[0]) + } + if(a.length === 0 || b.length === 0) { + return [0] + } + var r = [0] + if(a.length < b.length) { + for(var i=0; i 0 && y0 > 0) || (x0 < 0 && y0 < 0)) { + return false + } + + var x1 = orient(b0, a0, a1) + var y1 = orient(b1, a0, a1) + if((x1 > 0 && y1 > 0) || (x1 < 0 && y1 < 0)) { + return false + } + + //Check for degenerate collinear case + if(x0 === 0 && y0 === 0 && x1 === 0 && y1 === 0) { + return checkCollinear(a0, a1, b0, b1) + } + + return true +} +},{"robust-orientation":427}],431:[function(_dereq_,module,exports){ +"use strict" + +module.exports = robustSubtract + +//Easy case: Add two scalars +function scalarScalar(a, b) { + var x = a + b + var bv = x - a + var av = x - bv + var br = b - bv + var ar = a - av + var y = ar + br + if(y) { + return [y, x] + } + return [x] +} + +function robustSubtract(e, f) { + var ne = e.length|0 + var nf = f.length|0 + if(ne === 1 && nf === 1) { + return scalarScalar(e[0], -f[0]) + } + var n = ne + nf + var g = new Array(n) + var count = 0 + var eptr = 0 + var fptr = 0 + var abs = Math.abs + var ei = e[eptr] + var ea = abs(ei) + var fi = -f[fptr] + var fa = abs(fi) + var a, b + if(ea < fa) { + b = ei + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + ea = abs(ei) + } + } else { + b = fi + fptr += 1 + if(fptr < nf) { + fi = -f[fptr] + fa = abs(fi) + } + } + if((eptr < ne && ea < fa) || (fptr >= nf)) { + a = ei + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + ea = abs(ei) + } + } else { + a = fi + fptr += 1 + if(fptr < nf) { + fi = -f[fptr] + fa = abs(fi) + } + } + var x = a + b + var bv = x - a + var y = b - bv + var q0 = y + var q1 = x + var _x, _bv, _av, _br, _ar + while(eptr < ne && fptr < nf) { + if(ea < fa) { + a = ei + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + ea = abs(ei) + } + } else { + a = fi + fptr += 1 + if(fptr < nf) { + fi = -f[fptr] + fa = abs(fi) + } + } + b = q0 + x = a + b + bv = x - a + y = b - bv + if(y) { + g[count++] = y + } + _x = q1 + x + _bv = _x - q1 + _av = _x - _bv + _br = x - _bv + _ar = q1 - _av + q0 = _ar + _br + q1 = _x + } + while(eptr < ne) { + a = ei + b = q0 + x = a + b + bv = x - a + y = b - bv + if(y) { + g[count++] = y + } + _x = q1 + x + _bv = _x - q1 + _av = _x - _bv + _br = x - _bv + _ar = q1 - _av + q0 = _ar + _br + q1 = _x + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + } + } + while(fptr < nf) { + a = fi + b = q0 + x = a + b + bv = x - a + y = b - bv + if(y) { + g[count++] = y + } + _x = q1 + x + _bv = _x - q1 + _av = _x - _bv + _br = x - _bv + _ar = q1 - _av + q0 = _ar + _br + q1 = _x + fptr += 1 + if(fptr < nf) { + fi = -f[fptr] + } + } + if(q0) { + g[count++] = q0 + } + if(q1) { + g[count++] = q1 + } + if(!count) { + g[count++] = 0.0 + } + g.length = count + return g +} +},{}],432:[function(_dereq_,module,exports){ +"use strict" + +module.exports = linearExpansionSum + +//Easy case: Add two scalars +function scalarScalar(a, b) { + var x = a + b + var bv = x - a + var av = x - bv + var br = b - bv + var ar = a - av + var y = ar + br + if(y) { + return [y, x] + } + return [x] +} + +function linearExpansionSum(e, f) { + var ne = e.length|0 + var nf = f.length|0 + if(ne === 1 && nf === 1) { + return scalarScalar(e[0], f[0]) + } + var n = ne + nf + var g = new Array(n) + var count = 0 + var eptr = 0 + var fptr = 0 + var abs = Math.abs + var ei = e[eptr] + var ea = abs(ei) + var fi = f[fptr] + var fa = abs(fi) + var a, b + if(ea < fa) { + b = ei + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + ea = abs(ei) + } + } else { + b = fi + fptr += 1 + if(fptr < nf) { + fi = f[fptr] + fa = abs(fi) + } + } + if((eptr < ne && ea < fa) || (fptr >= nf)) { + a = ei + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + ea = abs(ei) + } + } else { + a = fi + fptr += 1 + if(fptr < nf) { + fi = f[fptr] + fa = abs(fi) + } + } + var x = a + b + var bv = x - a + var y = b - bv + var q0 = y + var q1 = x + var _x, _bv, _av, _br, _ar + while(eptr < ne && fptr < nf) { + if(ea < fa) { + a = ei + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + ea = abs(ei) + } + } else { + a = fi + fptr += 1 + if(fptr < nf) { + fi = f[fptr] + fa = abs(fi) + } + } + b = q0 + x = a + b + bv = x - a + y = b - bv + if(y) { + g[count++] = y + } + _x = q1 + x + _bv = _x - q1 + _av = _x - _bv + _br = x - _bv + _ar = q1 - _av + q0 = _ar + _br + q1 = _x + } + while(eptr < ne) { + a = ei + b = q0 + x = a + b + bv = x - a + y = b - bv + if(y) { + g[count++] = y + } + _x = q1 + x + _bv = _x - q1 + _av = _x - _bv + _br = x - _bv + _ar = q1 - _av + q0 = _ar + _br + q1 = _x + eptr += 1 + if(eptr < ne) { + ei = e[eptr] + } + } + while(fptr < nf) { + a = fi + b = q0 + x = a + b + bv = x - a + y = b - bv + if(y) { + g[count++] = y + } + _x = q1 + x + _bv = _x - q1 + _av = _x - _bv + _br = x - _bv + _ar = q1 - _av + q0 = _ar + _br + q1 = _x + fptr += 1 + if(fptr < nf) { + fi = f[fptr] + } + } + if(q0) { + g[count++] = q0 + } + if(q1) { + g[count++] = q1 + } + if(!count) { + g[count++] = 0.0 + } + g.length = count + return g +} +},{}],433:[function(_dereq_,module,exports){ /* eslint-disable node/no-deprecated-api */ var buffer = _dereq_('buffer') var Buffer = buffer.Buffer @@ -81589,7 +115280,1820 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":61}],149:[function(_dereq_,module,exports){ +},{"buffer":105}],434:[function(_dereq_,module,exports){ +"use strict" + +module.exports = function signum(x) { + if(x < 0) { return -1 } + if(x > 0) { return 1 } + return 0.0 +} +},{}],435:[function(_dereq_,module,exports){ +'use strict' + +module.exports = boundary + +var bnd = _dereq_('boundary-cells') +var reduce = _dereq_('reduce-simplicial-complex') + +function boundary(cells) { + return reduce(bnd(cells)) +} + +},{"boundary-cells":95,"reduce-simplicial-complex":419}],436:[function(_dereq_,module,exports){ +'use strict' + +module.exports = extractContour + +var ndarray = _dereq_('ndarray') +var pool = _dereq_('typedarray-pool') +var ndsort = _dereq_('ndarray-sort') + +var contourAlgorithm = _dereq_('./lib/codegen') + +function getDimension(cells) { + var numCells = cells.length + var d = 0 + for(var i=0; i> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour0d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + } + return R + } + return getContour0d + }, + function cellPolygonizer_1() { + 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 getContour1d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R + } + return getContour1d + }, + function cellPolygonizer_2() { + 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 getContour2d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R + } + return getContour2d + }, + function cellPolygonizer_3() { + 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 getContour3d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 4) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + (S[c[3]] << 3) + if (M === 0 || M === 15) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])]) + break + case 2: + R.push([B(C, E, c[1], c[2]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])]) + break + case 3: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])], [B(C, E, c[1], c[3]), B(C, E, c[1], c[2]), B(C, E, c[0], c[3])]) + break + case 4: + R.push([B(C, E, c[2], c[0]), B(C, E, c[2], c[1]), B(C, E, c[2], c[3])]) + break + case 5: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[0], c[3])], [B(C, E, c[2], c[1]), B(C, E, c[2], c[3]), B(C, E, c[0], c[3])]) + break + case 6: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])], [B(C, E, c[2], c[3]), B(C, E, c[2], c[0]), B(C, E, c[1], c[3])]) + break + case 7: + R.push([B(C, E, c[0], c[3]), B(C, E, c[1], c[3]), B(C, E, c[2], c[3])]) + break + case 8: + R.push([B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[3], c[2])]) + break + case 9: + R.push([B(C, E, c[3], c[1]), B(C, E, c[0], c[1]), B(C, E, c[0], c[2])], [B(C, E, c[3], c[2]), B(C, E, c[3], c[1]), B(C, E, c[0], c[2])]) + break + case 10: + R.push([B(C, E, c[1], c[0]), B(C, E, c[3], c[0]), B(C, E, c[1], c[2])], [B(C, E, c[3], c[0]), B(C, E, c[3], c[2]), B(C, E, c[1], c[2])]) + break + case 11: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[3], c[2])]) + break + case 12: + R.push([B(C, E, c[3], c[0]), B(C, E, c[2], c[0]), B(C, E, c[2], c[1])], [B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[2], c[1])]) + break + case 13: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[3], c[1])]) + break + case 14: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[3], c[0])]) + break + case 15: + break + } + } else if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R + } + return getContour3d + } +] + +function getPolygonizer(d) { + return allFns[d](); +} + +},{}],438:[function(_dereq_,module,exports){ +"use strict"; "use restrict"; + +var bits = _dereq_("bit-twiddle") + , UnionFind = _dereq_("union-find") + +//Returns the dimension of a cell complex +function dimension(cells) { + var d = 0 + , max = Math.max + for(var i=0, il=cells.length; i> 1 + , s = compareCells(cells[mid], c) + if(s <= 0) { + if(s === 0) { + r = mid + } + lo = mid + 1 + } else if(s > 0) { + hi = mid - 1 + } + } + return r +} +exports.findCell = findCell; + +//Builds an index for an n-cell. This is more general than dual, but less efficient +function incidence(from_cells, to_cells) { + var index = new Array(from_cells.length) + for(var i=0, il=index.length; i= from_cells.length || compareCells(from_cells[idx], b) !== 0) { + break + } + } + } + } + return index +} +exports.incidence = incidence + +//Computes the dual of the mesh. This is basically an optimized version of buildIndex for the situation where from_cells is just the list of vertices +function dual(cells, vertex_count) { + if(!vertex_count) { + return incidence(unique(skeleton(cells, 0)), cells, 0) + } + var res = new Array(vertex_count) + for(var i=0; i>> k) & 1) { + b.push(c[k]) + } + } + result.push(b) + } + } + return normalize(result) +} +exports.explode = explode + +//Enumerates all of the n-cells of a cell complex +function skeleton(cells, n) { + if(n < 0) { + return [] + } + var result = [] + , k0 = (1<<(n+1))-1 + for(var i=0; i> 1 + } + return (i >> 1) - 1 + } + + //Bubble element i down the heap + function heapDown(i) { + var w = heapWeight(i) + while(true) { + var tw = w + var left = 2*i + 1 + var right = 2*(i + 1) + var next = i + if(left < heapCount) { + var lw = heapWeight(left) + if(lw < tw) { + next = left + tw = lw + } + } + if(right < heapCount) { + var rw = heapWeight(right) + if(rw < tw) { + next = right + } + } + if(next === i) { + return i + } + heapSwap(i, next) + i = next + } + } + + //Bubbles element i up the heap + function heapUp(i) { + var w = heapWeight(i) + while(i > 0) { + var parent = heapParent(i) + if(parent >= 0) { + var pw = heapWeight(parent) + if(w < pw) { + heapSwap(i, parent) + i = parent + continue + } + } + return i + } + } + + //Pop minimum element + function heapPop() { + if(heapCount > 0) { + var head = heap[0] + heapSwap(0, heapCount-1) + heapCount -= 1 + heapDown(0) + return head + } + return -1 + } + + //Update heap item i + function heapUpdate(i, w) { + var a = heap[i] + if(weights[a] === w) { + return i + } + weights[a] = -Infinity + heapUp(i) + heapPop() + weights[a] = w + heapCount += 1 + return heapUp(heapCount-1) + } + + //Kills a vertex (assume vertex already removed from heap) + function kill(i) { + if(dead[i]) { + return + } + //Kill vertex + dead[i] = true + //Fixup topology + var s = inv[i] + var t = outv[i] + if(inv[t] >= 0) { + inv[t] = s + } + if(outv[s] >= 0) { + outv[s] = t + } + + //Update weights on s and t + if(index[s] >= 0) { + heapUpdate(index[s], computeWeight(s)) + } + if(index[t] >= 0) { + heapUpdate(index[t], computeWeight(t)) + } + } + + //Initialize weights and heap + var heap = [] + var index = new Array(n) + for(var i=0; i>1; i>=0; --i) { + heapDown(i) + } + + //Kill vertices + while(true) { + var hmin = heapPop() + if((hmin < 0) || (weights[hmin] > minArea)) { + break + } + kill(hmin) + } + + //Build collapsed vertex table + var npositions = [] + for(var i=0; i= 0 && tout >= 0 && tin !== tout) { + var cin = index[tin] + var cout = index[tout] + if(cin !== cout) { + ncells.push([ cin, cout ]) + } + } + }) + + //Normalize result + sc.unique(sc.normalize(ncells)) + + //Return final list of cells + return { + positions: npositions, + edges: ncells + } +} +},{"robust-orientation":427,"simplicial-complex":440}],443:[function(_dereq_,module,exports){ +"use strict" + +module.exports = orderSegments + +var orient = _dereq_("robust-orientation") + +function horizontalOrder(a, b) { + var bl, br + if(b[0][0] < b[1][0]) { + bl = b[0] + br = b[1] + } else if(b[0][0] > b[1][0]) { + bl = b[1] + br = b[0] + } else { + var alo = Math.min(a[0][1], a[1][1]) + var ahi = Math.max(a[0][1], a[1][1]) + var blo = Math.min(b[0][1], b[1][1]) + var bhi = Math.max(b[0][1], b[1][1]) + if(ahi < blo) { + return ahi - blo + } + if(alo > bhi) { + return alo - bhi + } + return ahi - bhi + } + var al, ar + if(a[0][1] < a[1][1]) { + al = a[0] + ar = a[1] + } else { + al = a[1] + ar = a[0] + } + var d = orient(br, bl, al) + if(d) { + return d + } + d = orient(br, bl, ar) + if(d) { + return d + } + return ar - br +} + +function orderSegments(b, a) { + var al, ar + if(a[0][0] < a[1][0]) { + al = a[0] + ar = a[1] + } else if(a[0][0] > a[1][0]) { + al = a[1] + ar = a[0] + } else { + return horizontalOrder(a, b) + } + var bl, br + if(b[0][0] < b[1][0]) { + bl = b[0] + br = b[1] + } else if(b[0][0] > b[1][0]) { + bl = b[1] + br = b[0] + } else { + return -horizontalOrder(b, a) + } + var d1 = orient(al, ar, br) + var d2 = orient(al, ar, bl) + if(d1 < 0) { + if(d2 <= 0) { + return d1 + } + } else if(d1 > 0) { + if(d2 >= 0) { + return d1 + } + } else if(d2) { + return d2 + } + d1 = orient(br, bl, ar) + d2 = orient(br, bl, al) + if(d1 < 0) { + if(d2 <= 0) { + return d1 + } + } else if(d1 > 0) { + if(d2 >= 0) { + return d1 + } + } else if(d2) { + return d2 + } + return ar[0] - br[0] +} +},{"robust-orientation":427}],444:[function(_dereq_,module,exports){ +"use strict" + +module.exports = createSlabDecomposition + +var bounds = _dereq_("binary-search-bounds") +var createRBTree = _dereq_("functional-red-black-tree") +var orient = _dereq_("robust-orientation") +var orderSegments = _dereq_("./lib/order-segments") + +function SlabDecomposition(slabs, coordinates, horizontal) { + this.slabs = slabs + this.coordinates = coordinates + this.horizontal = horizontal +} + +var proto = SlabDecomposition.prototype + +function compareHorizontal(e, y) { + return e.y - y +} + +function searchBucket(root, p) { + var lastNode = null + while(root) { + var seg = root.key + var l, r + if(seg[0][0] < seg[1][0]) { + l = seg[0] + r = seg[1] + } else { + l = seg[1] + r = seg[0] + } + var o = orient(l, r, p) + if(o < 0) { + root = root.left + } else if(o > 0) { + if(p[0] !== seg[1][0]) { + lastNode = root + root = root.right + } else { + var val = searchBucket(root.right, p) + if(val) { + return val + } + root = root.left + } + } else { + if(p[0] !== seg[1][0]) { + return root + } else { + var val = searchBucket(root.right, p) + if(val) { + return val + } + root = root.left + } + } + } + return lastNode +} + +proto.castUp = function(p) { + var bucket = bounds.le(this.coordinates, p[0]) + if(bucket < 0) { + return -1 + } + var root = this.slabs[bucket] + var hitNode = searchBucket(this.slabs[bucket], p) + var lastHit = -1 + if(hitNode) { + lastHit = hitNode.value + } + //Edge case: need to handle horizontal segments (sucks) + if(this.coordinates[bucket] === p[0]) { + var lastSegment = null + if(hitNode) { + lastSegment = hitNode.key + } + if(bucket > 0) { + var otherHitNode = searchBucket(this.slabs[bucket-1], p) + if(otherHitNode) { + if(lastSegment) { + if(orderSegments(otherHitNode.key, lastSegment) > 0) { + lastSegment = otherHitNode.key + lastHit = otherHitNode.value + } + } else { + lastHit = otherHitNode.value + lastSegment = otherHitNode.key + } + } + } + var horiz = this.horizontal[bucket] + if(horiz.length > 0) { + var hbucket = bounds.ge(horiz, p[1], compareHorizontal) + if(hbucket < horiz.length) { + var e = horiz[hbucket] + if(p[1] === e.y) { + if(e.closed) { + return e.index + } else { + while(hbucket < horiz.length-1 && horiz[hbucket+1].y === p[1]) { + hbucket = hbucket+1 + e = horiz[hbucket] + if(e.closed) { + return e.index + } + } + if(e.y === p[1] && !e.start) { + hbucket = hbucket+1 + if(hbucket >= horiz.length) { + return lastHit + } + e = horiz[hbucket] + } + } + } + //Check if e is above/below last segment + if(e.start) { + if(lastSegment) { + var o = orient(lastSegment[0], lastSegment[1], [p[0], e.y]) + if(lastSegment[0][0] > lastSegment[1][0]) { + o = -o + } + if(o > 0) { + lastHit = e.index + } + } else { + lastHit = e.index + } + } else if(e.y !== p[1]) { + lastHit = e.index + } + } + } + } + return lastHit +} + +function IntervalSegment(y, index, start, closed) { + this.y = y + this.index = index + this.start = start + this.closed = closed +} + +function Event(x, segment, create, index) { + this.x = x + this.segment = segment + this.create = create + this.index = index +} + + +function createSlabDecomposition(segments) { + var numSegments = segments.length + var numEvents = 2 * numSegments + var events = new Array(numEvents) + for(var i=0; i 1.0) { + t = 1.0 + } + var ti = 1.0 - t + var n = a.length + var r = new Array(n) + for(var i=0; i 0) || (a > 0 && b < 0)) { + var p = lerpW(s, b, t, a) + pos.push(p) + neg.push(p.slice()) + } + if(b < 0) { + neg.push(t.slice()) + } else if(b > 0) { + pos.push(t.slice()) + } else { + pos.push(t.slice()) + neg.push(t.slice()) + } + a = b + } + return { positive: pos, negative: neg } +} + +function positive(points, plane) { + var pos = [] + var a = planeT(points[points.length-1], plane) + for(var s=points[points.length-1], t=points[0], i=0; i 0) || (a > 0 && b < 0)) { + pos.push(lerpW(s, b, t, a)) + } + if(b >= 0) { + pos.push(t.slice()) + } + a = b + } + return pos +} + +function negative(points, plane) { + var neg = [] + var a = planeT(points[points.length-1], plane) + for(var s=points[points.length-1], t=points[0], i=0; i 0) || (a > 0 && b < 0)) { + neg.push(lerpW(s, b, t, a)) + } + if(b <= 0) { + neg.push(t.slice()) + } + a = b + } + return neg +} +},{"robust-dot-product":424,"robust-sum":432}],446:[function(_dereq_,module,exports){ +/* global window, exports, define */ + +!function() { + 'use strict' + + var re = { + not_string: /[^s]/, + not_bool: /[^t]/, + not_type: /[^T]/, + not_primitive: /[^v]/, + number: /[diefg]/, + numeric_arg: /[bcdiefguxX]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[+-]/ + } + + function sprintf(key) { + // `arguments` is not an array, but should be fine for this call + return sprintf_format(sprintf_parse(key), arguments) + } + + function vsprintf(fmt, argv) { + return sprintf.apply(null, [fmt].concat(argv || [])) + } + + function sprintf_format(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign + for (i = 0; i < tree_length; i++) { + if (typeof parse_tree[i] === 'string') { + output += parse_tree[i] + } + else if (typeof parse_tree[i] === 'object') { + ph = parse_tree[i] // convenience purposes only + if (ph.keys) { // keyword argument + arg = argv[cursor] + for (k = 0; k < ph.keys.length; k++) { + if (arg == undefined) { + throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) + } + arg = arg[ph.keys[k]] + } + } + else if (ph.param_no) { // positional argument (explicit) + arg = argv[ph.param_no] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { + arg = arg() + } + + if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { + throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) + } + + if (re.number.test(ph.type)) { + is_positive = arg >= 0 + } + + switch (ph.type) { + case 'b': + arg = parseInt(arg, 10).toString(2) + break + case 'c': + arg = String.fromCharCode(parseInt(arg, 10)) + break + case 'd': + case 'i': + arg = parseInt(arg, 10) + break + case 'j': + arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) + break + case 'e': + arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() + break + case 'f': + arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) + break + case 'g': + arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) + break + case 'o': + arg = (parseInt(arg, 10) >>> 0).toString(8) + break + case 's': + arg = String(arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 't': + arg = String(!!arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'T': + arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'u': + arg = parseInt(arg, 10) >>> 0 + break + case 'v': + arg = arg.valueOf() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'x': + arg = (parseInt(arg, 10) >>> 0).toString(16) + break + case 'X': + arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() + break + } + if (re.json.test(ph.type)) { + output += arg + } + else { + if (re.number.test(ph.type) && (!is_positive || ph.sign)) { + sign = is_positive ? '+' : '-' + arg = arg.toString().replace(re.sign, '') + } + else { + sign = '' + } + pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' + pad_length = ph.width - (sign + arg).length + pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' + output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) + } + } + } + return output + } + + var sprintf_cache = Object.create(null) + + function sprintf_parse(fmt) { + if (sprintf_cache[fmt]) { + return sprintf_cache[fmt] + } + + var _fmt = fmt, match, parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree.push(match[0]) + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree.push('%') + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + var field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + } + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') + } + + parse_tree.push( + { + placeholder: match[0], + param_no: match[1], + keys: match[2], + sign: match[3], + pad_char: match[4], + align: match[5], + width: match[6], + precision: match[7], + type: match[8] + } + ) + } + else { + throw new SyntaxError('[sprintf] unexpected placeholder') + } + _fmt = _fmt.substring(match[0].length) + } + return sprintf_cache[fmt] = parse_tree + } + + /** + * export to either browser or node.js + */ + /* eslint-disable quote-props */ + if (typeof exports !== 'undefined') { + exports['sprintf'] = sprintf + exports['vsprintf'] = vsprintf + } + if (typeof window !== 'undefined') { + window['sprintf'] = sprintf + window['vsprintf'] = vsprintf + + if (typeof define === 'function' && define['amd']) { + define(function() { + return { + 'sprintf': sprintf, + 'vsprintf': vsprintf + } + }) + } + } + /* eslint-enable quote-props */ +}(); // eslint-disable-line + +},{}],447:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -81720,7 +117224,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":60,"inherits":115,"readable-stream/lib/_stream_duplex.js":151,"readable-stream/lib/_stream_passthrough.js":152,"readable-stream/lib/_stream_readable.js":153,"readable-stream/lib/_stream_transform.js":154,"readable-stream/lib/_stream_writable.js":155,"readable-stream/lib/internal/streams/end-of-stream.js":159,"readable-stream/lib/internal/streams/pipeline.js":161}],150:[function(_dereq_,module,exports){ +},{"events":104,"inherits":347,"readable-stream/lib/_stream_duplex.js":449,"readable-stream/lib/_stream_passthrough.js":450,"readable-stream/lib/_stream_readable.js":451,"readable-stream/lib/_stream_transform.js":452,"readable-stream/lib/_stream_writable.js":453,"readable-stream/lib/internal/streams/end-of-stream.js":457,"readable-stream/lib/internal/streams/pipeline.js":459}],448:[function(_dereq_,module,exports){ 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } @@ -81849,7 +117353,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; -},{}],151:[function(_dereq_,module,exports){ +},{}],449:[function(_dereq_,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -81991,7 +117495,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); }).call(this)}).call(this,_dereq_('_process')) -},{"./_stream_readable":153,"./_stream_writable":155,"_process":147,"inherits":115}],152:[function(_dereq_,module,exports){ +},{"./_stream_readable":451,"./_stream_writable":453,"_process":413,"inherits":347}],450:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -82031,7 +117535,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":154,"inherits":115}],153:[function(_dereq_,module,exports){ +},{"./_stream_transform":452,"inherits":347}],451:[function(_dereq_,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -83158,7 +118662,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":150,"./_stream_duplex":151,"./internal/streams/async_iterator":156,"./internal/streams/buffer_list":157,"./internal/streams/destroy":158,"./internal/streams/from":160,"./internal/streams/state":162,"./internal/streams/stream":163,"_process":147,"buffer":61,"events":60,"inherits":115,"string_decoder/":164,"util":59}],154:[function(_dereq_,module,exports){ +},{"../errors":448,"./_stream_duplex":449,"./internal/streams/async_iterator":454,"./internal/streams/buffer_list":455,"./internal/streams/destroy":456,"./internal/streams/from":458,"./internal/streams/state":460,"./internal/streams/stream":461,"_process":413,"buffer":105,"events":104,"inherits":347,"string_decoder/":462,"util":103}],452:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -83360,7 +118864,7 @@ function done(stream, er, data) { if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } -},{"../errors":150,"./_stream_duplex":151,"inherits":115}],155:[function(_dereq_,module,exports){ +},{"../errors":448,"./_stream_duplex":449,"inherits":347}],453:[function(_dereq_,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -84060,7 +119564,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":150,"./_stream_duplex":151,"./internal/streams/destroy":158,"./internal/streams/state":162,"./internal/streams/stream":163,"_process":147,"buffer":61,"inherits":115,"util-deprecate":173}],156:[function(_dereq_,module,exports){ +},{"../errors":448,"./_stream_duplex":449,"./internal/streams/destroy":456,"./internal/streams/state":460,"./internal/streams/stream":461,"_process":413,"buffer":105,"inherits":347,"util-deprecate":480}],454:[function(_dereq_,module,exports){ (function (process){(function (){ 'use strict'; @@ -84270,7 +119774,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat module.exports = createReadableStreamAsyncIterator; }).call(this)}).call(this,_dereq_('_process')) -},{"./end-of-stream":159,"_process":147}],157:[function(_dereq_,module,exports){ +},{"./end-of-stream":457,"_process":413}],455:[function(_dereq_,module,exports){ 'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -84481,7 +119985,7 @@ function () { return BufferList; }(); -},{"buffer":61,"util":59}],158:[function(_dereq_,module,exports){ +},{"buffer":105,"util":103}],456:[function(_dereq_,module,exports){ (function (process){(function (){ 'use strict'; // undocumented cb() API, needed for core, not for public API @@ -84589,7 +120093,7 @@ module.exports = { errorOrDestroy: errorOrDestroy }; }).call(this)}).call(this,_dereq_('_process')) -},{"_process":147}],159:[function(_dereq_,module,exports){ +},{"_process":413}],457:[function(_dereq_,module,exports){ // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -84694,12 +120198,12 @@ function eos(stream, opts, callback) { } module.exports = eos; -},{"../../../errors":150}],160:[function(_dereq_,module,exports){ +},{"../../../errors":448}],458:[function(_dereq_,module,exports){ module.exports = function () { throw new Error('Readable.from is not available in the browser') }; -},{}],161:[function(_dereq_,module,exports){ +},{}],459:[function(_dereq_,module,exports){ // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -84797,7 +120301,7 @@ function pipeline() { } module.exports = pipeline; -},{"../../../errors":150,"./end-of-stream":159}],162:[function(_dereq_,module,exports){ +},{"../../../errors":448,"./end-of-stream":457}],460:[function(_dereq_,module,exports){ 'use strict'; var ERR_INVALID_OPT_VALUE = _dereq_('../../../errors').codes.ERR_INVALID_OPT_VALUE; @@ -84825,10 +120329,10 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark: getHighWaterMark }; -},{"../../../errors":150}],163:[function(_dereq_,module,exports){ +},{"../../../errors":448}],461:[function(_dereq_,module,exports){ module.exports = _dereq_('events').EventEmitter; -},{"events":60}],164:[function(_dereq_,module,exports){ +},{"events":104}],462:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -85125,7 +120629,7 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":148}],165:[function(_dereq_,module,exports){ +},{"safe-buffer":433}],463:[function(_dereq_,module,exports){ (function (process,Buffer){(function (){ /** @@ -85428,7 +120932,7 @@ function trampoline (fn) { } }).call(this)}).call(this,_dereq_('_process'),_dereq_("buffer").Buffer) -},{"_process":147,"assert":54,"buffer":61,"debug":166}],166:[function(_dereq_,module,exports){ +},{"_process":413,"assert":69,"buffer":105,"debug":464}],464:[function(_dereq_,module,exports){ (function (process){(function (){ /** * This is the web browser implementation of `debug()`. @@ -85617,7 +121121,7 @@ function localstorage() { } }).call(this)}).call(this,_dereq_('_process')) -},{"./debug":167,"_process":147}],167:[function(_dereq_,module,exports){ +},{"./debug":465,"_process":413}],465:[function(_dereq_,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -85821,7 +121325,7 @@ function coerce(val) { return val; } -},{"ms":168}],168:[function(_dereq_,module,exports){ +},{"ms":466}],466:[function(_dereq_,module,exports){ /** * Helpers. */ @@ -85975,7 +121479,7 @@ function plural(ms, n, name) { return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],169:[function(_dereq_,module,exports){ +},{}],467:[function(_dereq_,module,exports){ "use strict" module.exports = stronglyConnectedComponents @@ -86091,7 +121595,1702 @@ function stronglyConnectedComponents(adjList) { return {components: components, adjacencyList: sccAdjList} } -},{}],170:[function(_dereq_,module,exports){ +},{}],468:[function(_dereq_,module,exports){ +"use strict" + +module.exports = surfaceNets + +var generateContourExtractor = _dereq_("ndarray-extract-contour") +var zeroCrossings = _dereq_("zero-crossings") + +var F1_6 = 1 / 6 +var F5_6 = 5 / 6 +var F7_18 = 7 / 18 +var F1_14 = 1 / 14 +var F3_14 = 3 / 14 +var F5_14 = 5 / 14 +var F9_14 = 9 / 14 +var F11_18 = 11 / 18 + +var allFns = { + "2d": function (genContour, order, dtype) { + var contour = genContour({ + order: order, + scalarArguments: 3, + getters: dtype === "generic" ? [0] : undefined, + phase: function phaseFunc(p, a, b, c) { + return (p > c) | 0; + }, + vertex: function vertexFunc(d0, d1, v0, v1, v2, v3, p0, p1, p2, p3, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3)) | 0; + if (m === 0 || m === 15) { + return; + } + switch (m) { + case 0: + a.push([d0 - 0.5, d1 - 0.5]); + break; + case 1: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.25 - (0.25 * (v2 + v0 - 2 * c)) / (v0 - v2)]); + break; + case 2: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.25 - (0.25 * (v3 + v1 - 2 * c)) / (v1 - v3)]); + break; + case 3: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3)]); + break; + case 4: + a.push([d0 - 0.25 - (0.25 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.75 - (0.25 * (-v2 - v0 + 2 * c)) / (v2 - v0)]); + break; + case 5: + a.push([d0 - 0.5 - (0.5 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5]); + break; + case 6: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3)]); + break; + case 7: + a.push([d0 - 0.75 - (0.25 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.75 - (0.25 * (v3 + v1 - 2 * c)) / (v1 - v3)]); + break; + case 8: + a.push([d0 - 0.75 - (0.25 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.75 - (0.25 * (-v3 - v1 + 2 * c)) / (v3 - v1)]); + break; + case 9: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1)]); + break; + case 10: + a.push([d0 - 0.5 - (0.5 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5]); + break; + case 11: + a.push([d0 - 0.25 - (0.25 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.75 - (0.25 * (v2 + v0 - 2 * c)) / (v0 - v2)]); + break; + case 12: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1)]); + break; + case 13: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.25 - (0.25 * (-v3 - v1 + 2 * c)) / (v3 - v1)]); + break; + case 14: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.25 - (0.25 * (-v2 - v0 + 2 * c)) / (v2 - v0)]); + break; + case 15: + a.push([d0 - 0.5, d1 - 0.5]); + break; + } + }, + cell: function cellFunc(v0, v1, c0, c1, p0, p1, a, b, c) { + if (p0) { + b.push([v0, v1]); + } else { + b.push([v1, v0]); + } + }, + }); + return function (array, level) { + var verts = [], + cells = []; + contour(array, verts, cells, level); + return { positions: verts, cells: cells }; + }; + }, + "3d": function (genContour, order, dtype) { + var contour = genContour({ + order: order, + scalarArguments: 3, + getters: dtype === "generic" ? [0] : undefined, + phase: function phaseFunc(p, a, b, c) { + return (p > c) | 0; + }, + vertex: function vertexFunc(d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3) + (p4 << 4) + (p5 << 5) + (p6 << 6) + (p7 << 7)) | 0; + if (m === 0 || m === 255) { + return; + } + switch (m >>> 7) { + case 0: + vExtra0(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + case 1: + vExtra1(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + } + }, + cell: function cellFunc(v0, v1, v2, v3, c0, c1, p0, p1, a, b, c) { + if (p0) { + b.push([v3, v2, v0], [v0, v1, v3]); + } else { + b.push([v0, v2, v3], [v3, v1, v0]); + } + }, + }); + return function (array, level) { + var verts = [], + cells = []; + contour(array, verts, cells, level); + return { positions: verts, cells: cells }; + }; + function vExtra0(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; + case 1: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 3: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 4: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 5: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 6: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 7: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 8: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 9: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 10: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 11: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 12: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 13: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 14: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 15: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (v4 + v0 + v5 + v1 + v6 + v2 + v7 + v3 - 8 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 16: + a.push([ + d0 - F1_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 17: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 18: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 19: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 20: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 21: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 22: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 23: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 24: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 25: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 26: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 28: + a.push([ + d0 - F5_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 30: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v4 - v0 + v1 - v5 + v2 - v6 + v3 - v7), + ]); + break; + case 31: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 32: + a.push([ + d0 - F5_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 33: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 34: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 35: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 36: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 37: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 38: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 40: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 41: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 42: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 43: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 44: + a.push([ + d0 - F9_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 45: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 46: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 47: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 48: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 49: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 50: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 51: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (v2 + v0 + v3 + v1 + v6 + v4 + v7 + v5 - 8 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5]); + break; + case 52: + a.push([ + d0 - F5_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 54: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v2 - v0 + v1 - v3 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 55: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 56: + a.push([ + d0 - F9_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 57: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 58: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 59: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 60: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + v7 + v5)) / (v2 - v0 + v3 - v1 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + v7 + v3)) / (v4 - v0 + v5 - v1 + v2 - v6 + v3 - v7)]); + break; + case 61: + a.push([ + d0 - F9_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 62: + a.push([ + d0 - F5_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 63: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 64: + a.push([ + d0 - F1_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 65: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 66: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 67: + a.push([ + d0 - F5_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 68: + a.push([d0 - 0.25 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 69: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 70: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 71: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 72: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 73: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 75: + a.push([ + d0 - 0.375 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 76: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 77: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 78: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 79: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 80: + a.push([d0 - 0.25 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 81: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 82: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 83: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 84: + a.push([d0 - 0.3 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 85: + a.push([d0 - 0.5 - (0.5 * (v1 + v0 + v3 + v2 + v5 + v4 + v7 + v6 - 8 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5]); + break; + case 86: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v1 - v0 + v2 - v3 + v4 - v5 + v6 - v7), + d1 - 0.375 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 87: + a.push([d0 - 0.7 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 88: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v3 - v2 + v4 - v5 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 90: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + v7 + v6)) / (v1 - v0 + v3 - v2 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + v7 + v3)) / (v4 - v0 + v1 - v5 + v6 - v2 + v3 - v7)]); + break; + case 91: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 92: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 93: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 94: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 95: + a.push([d0 - 0.75 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 96: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 97: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 99: + a.push([ + d0 - 0.375 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.375 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 102: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + v7 + v6)) / (v1 - v0 + v2 - v3 + v5 - v4 + v6 - v7), d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + v7 + v5)) / (v2 - v0 + v1 - v3 + v6 - v4 + v5 - v7), d2 - 0.5]); + break; + case 103: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 104: + a.push([ + d0 - F11_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 105: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + v7 + v6)) / (v0 - v1 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + v7 + v5)) / (v0 - v2 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + v7 + v3)) / (v0 - v4 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 106: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + v7 + v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.625 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 107: + a.push([ + d0 - F7_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 108: + a.push([ + d0 - 0.625 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + v7 + v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 109: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 110: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 111: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 112: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 113: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 114: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 115: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 116: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 117: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 119: + a.push([d0 - 0.75 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 120: + a.push([ + d0 - 0.625 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + v7 + v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 121: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 122: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 123: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 124: + a.push([ + d0 - F9_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 126: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 127: + a.push([ + d0 - F5_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + } + } + function vExtra1(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([ + d0 - F5_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 1: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 3: + a.push([ + d0 - F9_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 4: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 5: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 6: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 7: + a.push([ + d0 - 0.625 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + v6 + v2 + -v7 - v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 8: + a.push([d0 - 0.75 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 9: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 10: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 11: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 12: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 13: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 14: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 15: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 16: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 17: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 18: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 19: + a.push([ + d0 - 0.625 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + v6 + v4 + -v7 - v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 20: + a.push([ + d0 - F7_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 21: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + v5 + v4 + -v7 - v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.625 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 22: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 + -v7 - v6)) / (v1 - v0 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 + -v7 - v5)) / (v2 - v0 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 + -v7 - v3)) / (v4 - v0 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 23: + a.push([ + d0 - F11_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 24: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 25: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + -v7 - v6)) / (v0 - v1 + v3 - v2 + v4 - v5 + v7 - v6), d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + -v7 - v5)) / (v0 - v2 + v3 - v1 + v4 - v6 + v7 - v5), d2 - 0.5]); + break; + case 26: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.375 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 28: + a.push([ + d0 - 0.375 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 30: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 31: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 32: + a.push([d0 - 0.75 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 33: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 34: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 35: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 36: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 37: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + -v7 - v6)) / (v0 - v1 + v2 - v3 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + -v7 - v3)) / (v0 - v4 + v5 - v1 + v2 - v6 + v7 - v3)]); + break; + case 38: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v2 - v3 + v5 - v4 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 40: + a.push([d0 - 0.7 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 41: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v0 - v1 + v3 - v2 + v5 - v4 + v7 - v6), + d1 - 0.375 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 42: + a.push([d0 - 0.5 - (0.5 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 8 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5]); + break; + case 43: + a.push([d0 - 0.3 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 44: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 45: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 46: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 47: + a.push([d0 - 0.25 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 48: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 49: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 50: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 51: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 52: + a.push([ + d0 - 0.375 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 54: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 55: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 56: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 57: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 58: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 59: + a.push([d0 - 0.25 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 60: + a.push([ + d0 - F5_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 61: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 62: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 63: + a.push([ + d0 - F1_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 64: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 65: + a.push([ + d0 - F5_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 66: + a.push([ + d0 - F9_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 67: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + -v7 - v5)) / (v0 - v2 + v1 - v3 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + -v7 - v3)) / (v0 - v4 + v1 - v5 + v6 - v2 + v7 - v3)]); + break; + case 68: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 69: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 70: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 71: + a.push([ + d0 - F9_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 72: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 73: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v0 - v2 + v3 - v1 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 75: + a.push([ + d0 - F5_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 76: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 8 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5]); + break; + case 77: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 78: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 79: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 80: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 81: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 82: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 83: + a.push([ + d0 - F9_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 84: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 85: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 86: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 87: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 88: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 90: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 91: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 92: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 93: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 94: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 95: + a.push([ + d0 - F5_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 96: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 97: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v0 - v4 + v5 - v1 + v6 - v2 + v7 - v3), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 99: + a.push([ + d0 - F5_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 102: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 103: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 104: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 105: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 106: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 107: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 108: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 109: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 110: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 111: + a.push([ + d0 - F1_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 112: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 8 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 113: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 114: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 115: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 116: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 117: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 119: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 120: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 121: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 122: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 123: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 124: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 126: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 127: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; + } + } + }, +} + +function buildSurfaceNets(order, dtype) { + var inKey = order.length + 'd' + var fn = allFns[inKey] + if(fn) return fn(generateContourExtractor, order, dtype) +} + +//1D case: Need to handle specially +function mesh1D(array, level) { + var zc = zeroCrossings(array, level) + var n = zc.length + var npos = new Array(n) + var ncel = new Array(n) + for(var i=0; i0) { + shapeX += 0.02 + } + } + + var data = new Float32Array(bufferSize) + var ptr = 0 + var xOffset = -0.5 * shapeX + for(var i=0; i Math.max(vy, vz)) { + u[2] = 1 + } else if(vy > Math.max(vx, vz)) { + u[0] = 1 + } else { + u[1] = 1 + } + + var vv = 0 + var uv = 0 + for(var i=0; i<3; ++i ) { + vv += v[i] * v[i] + uv += u[i] * v[i] + } + for(var i=0; i<3; ++i) { + u[i] -= (uv / vv) * v[i] + } + normalize3(u, u) + return u +} + +function TurntableController(zoomMin, zoomMax, center, up, right, radius, theta, phi) { + this.center = filterVector(center) + this.up = filterVector(up) + this.right = filterVector(right) + this.radius = filterVector([radius]) + this.angle = filterVector([theta, phi]) + this.angle.bounds = [[-Infinity,-Math.PI/2], [Infinity,Math.PI/2]] + this.setDistanceLimits(zoomMin, zoomMax) + + 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 i=0; i<16; ++i) { + this.computedMatrix[i] = 0.5 + } + + this.recalcMatrix(0) +} + +var proto = TurntableController.prototype + +proto.setDistanceLimits = function(minDist, maxDist) { + if(minDist > 0) { + minDist = Math.log(minDist) + } else { + minDist = -Infinity + } + if(maxDist > 0) { + maxDist = Math.log(maxDist) + } else { + maxDist = Infinity + } + maxDist = Math.max(maxDist, minDist) + this.radius.bounds[0][0] = minDist + this.radius.bounds[1][0] = maxDist +} + +proto.getDistanceLimits = function(out) { + var bounds = this.radius.bounds[0] + if(out) { + out[0] = Math.exp(bounds[0][0]) + out[1] = Math.exp(bounds[1][0]) + return out + } + return [ Math.exp(bounds[0][0]), Math.exp(bounds[1][0]) ] +} + +proto.recalcMatrix = function(t) { + //Recompute curves + this.center.curve(t) + this.up.curve(t) + this.right.curve(t) + this.radius.curve(t) + this.angle.curve(t) + + //Compute frame for camera matrix + var up = this.computedUp + var right = this.computedRight + var uu = 0.0 + var ur = 0.0 + for(var i=0; i<3; ++i) { + ur += up[i] * right[i] + uu += up[i] * up[i] + } + var ul = Math.sqrt(uu) + var rr = 0.0 + for(var i=0; i<3; ++i) { + right[i] -= up[i] * ur / uu + rr += right[i] * right[i] + up[i] /= ul + } + var rl = Math.sqrt(rr) + for(var i=0; i<3; ++i) { + right[i] /= rl + } + + //Compute toward vector + var toward = this.computedToward + cross(toward, up, right) + normalize3(toward, toward) + + //Compute angular parameters + var radius = Math.exp(this.computedRadius[0]) + var theta = this.computedAngle[0] + var phi = this.computedAngle[1] + + var ctheta = Math.cos(theta) + var stheta = Math.sin(theta) + var cphi = Math.cos(phi) + var sphi = Math.sin(phi) + + var center = this.computedCenter + + var wx = ctheta * cphi + var wy = stheta * cphi + var wz = sphi + + var sx = -ctheta * sphi + var sy = -stheta * sphi + var sz = cphi + + var eye = this.computedEye + var mat = this.computedMatrix + for(var i=0; i<3; ++i) { + var x = wx * right[i] + wy * toward[i] + wz * up[i] + mat[4*i+1] = sx * right[i] + sy * toward[i] + sz * up[i] + mat[4*i+2] = x + mat[4*i+3] = 0.0 + } + + var ax = mat[1] + var ay = mat[5] + var az = mat[9] + var bx = mat[2] + var by = mat[6] + var bz = mat[10] + var cx = ay * bz - az * by + var cy = az * bx - ax * bz + var cz = ax * by - ay * bx + var cl = len3(cx, cy, cz) + cx /= cl + cy /= cl + cz /= cl + mat[0] = cx + mat[4] = cy + mat[8] = cz + + for(var i=0; i<3; ++i) { + eye[i] = center[i] + mat[2+4*i]*radius + } + + for(var i=0; i<3; ++i) { + var rr = 0.0 + for(var j=0; j<3; ++j) { + rr += mat[i+4*j] * eye[j] + } + mat[12+i] = -rr + } + mat[15] = 1.0 +} + +proto.getMatrix = function(t, result) { + this.recalcMatrix(t) + var mat = this.computedMatrix + if(result) { + for(var i=0; i<16; ++i) { + result[i] = mat[i] + } + return result + } + return mat +} + +var zAxis = [0,0,0] +proto.rotate = function(t, dtheta, dphi, droll) { + this.angle.move(t, dtheta, dphi) + if(droll) { + this.recalcMatrix(t) + + var mat = this.computedMatrix + zAxis[0] = mat[2] + zAxis[1] = mat[6] + zAxis[2] = mat[10] + + var up = this.computedUp + var right = this.computedRight + var toward = this.computedToward + + for(var i=0; i<3; ++i) { + mat[4*i] = up[i] + mat[4*i+1] = right[i] + mat[4*i+2] = toward[i] + } + rotateM(mat, mat, droll, zAxis) + for(var i=0; i<3; ++i) { + up[i] = mat[4*i] + right[i] = mat[4*i+1] + } + + this.up.set(t, up[0], up[1], up[2]) + this.right.set(t, right[0], right[1], right[2]) + } +} + +proto.pan = function(t, dx, dy, dz) { + dx = dx || 0.0 + dy = dy || 0.0 + dz = dz || 0.0 + + this.recalcMatrix(t) + var mat = this.computedMatrix + + var dist = Math.exp(this.computedRadius[0]) + + var ux = mat[1] + var uy = mat[5] + var uz = mat[9] + var ul = len3(ux, uy, uz) + ux /= ul + uy /= ul + uz /= ul + + var rx = mat[0] + var ry = mat[4] + var rz = mat[8] + var ru = rx * ux + ry * uy + rz * uz + rx -= ux * ru + ry -= uy * ru + rz -= uz * ru + var rl = len3(rx, ry, rz) + rx /= rl + ry /= rl + rz /= rl + + var vx = rx * dx + ux * dy + var vy = ry * dx + uy * dy + var vz = rz * dx + uz * dy + this.center.move(t, vx, vy, vz) + + //Update z-component of radius + var radius = Math.exp(this.computedRadius[0]) + radius = Math.max(1e-4, radius + dz) + this.radius.set(t, Math.log(radius)) +} + +proto.translate = function(t, dx, dy, dz) { + this.center.move(t, + dx||0.0, + dy||0.0, + dz||0.0) +} + +//Recenters the coordinate axes +proto.setMatrix = function(t, mat, axes, noSnap) { + + //Get the axes for tare + var ushift = 1 + if(typeof axes === 'number') { + ushift = (axes)|0 + } + if(ushift < 0 || ushift > 3) { + ushift = 1 + } + var vshift = (ushift + 2) % 3 + var fshift = (ushift + 1) % 3 + + //Recompute state for new t value + if(!mat) { + this.recalcMatrix(t) + mat = this.computedMatrix + } + + //Get right and up vectors + var ux = mat[ushift] + var uy = mat[ushift+4] + var uz = mat[ushift+8] + if(!noSnap) { + var ul = len3(ux, uy, uz) + ux /= ul + uy /= ul + uz /= ul + } else { + var ax = Math.abs(ux) + var ay = Math.abs(uy) + var az = Math.abs(uz) + var am = Math.max(ax,ay,az) + if(ax === am) { + ux = (ux < 0) ? -1 : 1 + uy = uz = 0 + } else if(az === am) { + uz = (uz < 0) ? -1 : 1 + ux = uy = 0 + } else { + uy = (uy < 0) ? -1 : 1 + ux = uz = 0 + } + } + + var rx = mat[vshift] + var ry = mat[vshift+4] + var rz = mat[vshift+8] + var ru = rx * ux + ry * uy + rz * uz + rx -= ux * ru + ry -= uy * ru + rz -= uz * ru + var rl = len3(rx, ry, rz) + rx /= rl + ry /= rl + rz /= rl + + var fx = uy * rz - uz * ry + var fy = uz * rx - ux * rz + var fz = ux * ry - uy * rx + var fl = len3(fx, fy, fz) + fx /= fl + fy /= fl + fz /= fl + + this.center.jump(t, ex, ey, ez) + this.radius.idle(t) + this.up.jump(t, ux, uy, uz) + this.right.jump(t, rx, ry, rz) + + var phi, theta + if(ushift === 2) { + var cx = mat[1] + var cy = mat[5] + var cz = mat[9] + var cr = cx * rx + cy * ry + cz * rz + var cf = cx * fx + cy * fy + cz * fz + if(tu < 0) { + phi = -Math.PI/2 + } else { + phi = Math.PI/2 + } + theta = Math.atan2(cf, cr) + } else { + var tx = mat[2] + var ty = mat[6] + var tz = mat[10] + var tu = tx * ux + ty * uy + tz * uz + var tr = tx * rx + ty * ry + tz * rz + var tf = tx * fx + ty * fy + tz * fz + + phi = Math.asin(clamp1(tu)) + theta = Math.atan2(tf, tr) + } + + this.angle.jump(t, theta, phi) + + this.recalcMatrix(t) + var dx = mat[2] + var dy = mat[6] + var dz = mat[10] + + var imat = this.computedMatrix + invert44(imat, mat) + var w = imat[15] + var ex = imat[12] / w + var ey = imat[13] / w + var ez = imat[14] / w + + var gs = Math.exp(this.computedRadius[0]) + this.center.jump(t, ex-dx*gs, ey-dy*gs, ez-dz*gs) +} + +proto.lastT = function() { + return Math.max( + this.center.lastT(), + this.up.lastT(), + this.right.lastT(), + this.radius.lastT(), + this.angle.lastT()) +} + +proto.idle = function(t) { + this.center.idle(t) + this.up.idle(t) + this.right.idle(t) + this.radius.idle(t) + this.angle.idle(t) +} + +proto.flush = function(t) { + this.center.flush(t) + this.up.flush(t) + this.right.flush(t) + this.radius.flush(t) + this.angle.flush(t) +} + +proto.setDistance = function(t, d) { + if(d > 0) { + this.radius.set(t, Math.log(d)) + } +} + +proto.lookAt = function(t, eye, center, up) { + this.recalcMatrix(t) + + eye = eye || this.computedEye + center = center || this.computedCenter + up = up || this.computedUp + + var ux = up[0] + var uy = up[1] + var uz = up[2] + var ul = len3(ux, uy, uz) + if(ul < 1e-6) { + return + } + ux /= ul + uy /= ul + uz /= ul + + var tx = eye[0] - center[0] + var ty = eye[1] - center[1] + var tz = eye[2] - center[2] + var tl = len3(tx, ty, tz) + if(tl < 1e-6) { + return + } + tx /= tl + ty /= tl + tz /= tl + + var right = this.computedRight + var rx = right[0] + var ry = right[1] + var rz = right[2] + var ru = ux*rx + uy*ry + uz*rz + rx -= ru * ux + ry -= ru * uy + rz -= ru * uz + var rl = len3(rx, ry, rz) + + if(rl < 0.01) { + rx = uy * tz - uz * ty + ry = uz * tx - ux * tz + rz = ux * ty - uy * tx + rl = len3(rx, ry, rz) + if(rl < 1e-6) { + return + } + } + rx /= rl + ry /= rl + rz /= rl + + this.up.set(t, ux, uy, uz) + this.right.set(t, rx, ry, rz) + this.center.set(t, center[0], center[1], center[2]) + this.radius.set(t, Math.log(tl)) + + var fx = uy * rz - uz * ry + var fy = uz * rx - ux * rz + var fz = ux * ry - uy * rx + var fl = len3(fx, fy, fz) + fx /= fl + fy /= fl + fz /= fl + + var tu = ux*tx + uy*ty + uz*tz + var tr = rx*tx + ry*ty + rz*tz + var tf = fx*tx + fy*ty + fz*tz + + var phi = Math.asin(clamp1(tu)) + var theta = Math.atan2(tf, tr) + + var angleState = this.angle._state + var lastTheta = angleState[angleState.length-1] + var lastPhi = angleState[angleState.length-2] + lastTheta = lastTheta % (2.0 * Math.PI) + var dp = Math.abs(lastTheta + 2.0 * Math.PI - theta) + var d0 = Math.abs(lastTheta - theta) + var dn = Math.abs(lastTheta - 2.0 * Math.PI - theta) + if(dp < d0) { + lastTheta += 2.0 * Math.PI + } + if(dn < d0) { + lastTheta -= 2.0 * Math.PI + } + + this.angle.jump(this.angle.lastT(), lastTheta, lastPhi) + this.angle.set(t, theta, phi) +} + +function createTurntableController(options) { + options = options || {} + + var center = options.center || [0,0,0] + var up = options.up || [0,1,0] + var right = options.right || findOrthoPair(up) + var radius = options.radius || 1.0 + var theta = options.theta || 0.0 + var phi = options.phi || 0.0 + + center = [].slice.call(center, 0, 3) + + up = [].slice.call(up, 0, 3) + normalize3(up, up) + + right = [].slice.call(right, 0, 3) + normalize3(right, right) + + if('eye' in options) { + var eye = options.eye + var toward = [ + eye[0]-center[0], + eye[1]-center[1], + eye[2]-center[2] + ] + cross(right, toward, up) + if(len3(right[0], right[1], right[2]) < 1e-6) { + right = findOrthoPair(up) + } else { + normalize3(right, right) + } + + radius = len3(toward[0], toward[1], toward[2]) + + var ut = dot3(up, toward) / radius + var rt = dot3(right, toward) / radius + phi = Math.acos(ut) + theta = Math.acos(rt) + } + + //Use logarithmic coordinates for radius + radius = Math.log(radius) + + //Return the controller + return new TurntableController( + options.zoomMin, + options.zoomMax, + center, + up, + right, + radius, + theta, + phi) +} +},{"filtered-vector":160,"gl-mat4/invert":203,"gl-mat4/rotate":209,"gl-vec3/cross":268,"gl-vec3/dot":273,"gl-vec3/normalize":290}],475:[function(_dereq_,module,exports){ +"use strict" + +module.exports = twoProduct + +var SPLITTER = +(Math.pow(2, 27) + 1.0) + +function twoProduct(a, b, result) { + var x = a * b + + var c = SPLITTER * a + var abig = c - a + var ahi = c - abig + var alo = a - ahi + + var d = SPLITTER * b + var bbig = d - b + var bhi = d - bbig + var blo = b - bhi + + var err1 = x - (ahi * bhi) + var err2 = err1 - (alo * bhi) + var err3 = err2 - (ahi * blo) + + var y = alo * blo - err3 + + if(result) { + result[0] = y + result[1] = x + return result + } + + return [ y, x ] +} +},{}],476:[function(_dereq_,module,exports){ +"use strict" + +module.exports = fastTwoSum + +function fastTwoSum(a, b, result) { + var x = a + b + var bv = x - a + var av = x - bv + var br = b - bv + var ar = a - av + if(result) { + result[0] = ar + br + result[1] = x + return result + } + return [ar+br, x] +} +},{}],477:[function(_dereq_,module,exports){ +(function (global){(function (){ +'use strict' + +var bits = _dereq_('bit-twiddle') +var dup = _dereq_('dup') +var Buffer = _dereq_('buffer').Buffer + +//Legacy pool support +if(!global.__TYPEDARRAY_POOL) { + global.__TYPEDARRAY_POOL = { + UINT8 : dup([32, 0]) + , UINT16 : dup([32, 0]) + , UINT32 : dup([32, 0]) + , BIGUINT64 : dup([32, 0]) + , INT8 : dup([32, 0]) + , INT16 : dup([32, 0]) + , INT32 : dup([32, 0]) + , BIGINT64 : dup([32, 0]) + , FLOAT : dup([32, 0]) + , DOUBLE : dup([32, 0]) + , DATA : dup([32, 0]) + , UINT8C : dup([32, 0]) + , BUFFER : dup([32, 0]) + } +} + +var hasUint8C = (typeof Uint8ClampedArray) !== 'undefined' +var hasBigUint64 = (typeof BigUint64Array) !== 'undefined' +var hasBigInt64 = (typeof BigInt64Array) !== 'undefined' +var POOL = global.__TYPEDARRAY_POOL + +//Upgrade pool +if(!POOL.UINT8C) { + POOL.UINT8C = dup([32, 0]) +} +if(!POOL.BIGUINT64) { + POOL.BIGUINT64 = dup([32, 0]) +} +if(!POOL.BIGINT64) { + POOL.BIGINT64 = dup([32, 0]) +} +if(!POOL.BUFFER) { + POOL.BUFFER = dup([32, 0]) +} + +//New technique: Only allocate from ArrayBufferView and Buffer +var DATA = POOL.DATA + , BUFFER = POOL.BUFFER + +exports.free = function free(array) { + if(Buffer.isBuffer(array)) { + BUFFER[bits.log2(array.length)].push(array) + } else { + if(Object.prototype.toString.call(array) !== '[object ArrayBuffer]') { + array = array.buffer + } + if(!array) { + return + } + var n = array.length || array.byteLength + var log_n = bits.log2(n)|0 + DATA[log_n].push(array) + } +} + +function freeArrayBuffer(buffer) { + if(!buffer) { + return + } + var n = buffer.length || buffer.byteLength + var log_n = bits.log2(n) + DATA[log_n].push(buffer) +} + +function freeTypedArray(array) { + freeArrayBuffer(array.buffer) +} + +exports.freeUint8 = +exports.freeUint16 = +exports.freeUint32 = +exports.freeBigUint64 = +exports.freeInt8 = +exports.freeInt16 = +exports.freeInt32 = +exports.freeBigInt64 = +exports.freeFloat32 = +exports.freeFloat = +exports.freeFloat64 = +exports.freeDouble = +exports.freeUint8Clamped = +exports.freeDataView = freeTypedArray + +exports.freeArrayBuffer = freeArrayBuffer + +exports.freeBuffer = function freeBuffer(array) { + BUFFER[bits.log2(array.length)].push(array) +} + +exports.malloc = function malloc(n, dtype) { + if(dtype === undefined || dtype === 'arraybuffer') { + return mallocArrayBuffer(n) + } else { + switch(dtype) { + case 'uint8': + return mallocUint8(n) + case 'uint16': + return mallocUint16(n) + case 'uint32': + return mallocUint32(n) + case 'int8': + return mallocInt8(n) + case 'int16': + return mallocInt16(n) + case 'int32': + return mallocInt32(n) + case 'float': + case 'float32': + return mallocFloat(n) + case 'double': + case 'float64': + return mallocDouble(n) + case 'uint8_clamped': + return mallocUint8Clamped(n) + case 'bigint64': + return mallocBigInt64(n) + case 'biguint64': + return mallocBigUint64(n) + case 'buffer': + return mallocBuffer(n) + case 'data': + case 'dataview': + return mallocDataView(n) + + default: + return null + } + } + return null +} + +function mallocArrayBuffer(n) { + var n = bits.nextPow2(n) + var log_n = bits.log2(n) + var d = DATA[log_n] + if(d.length > 0) { + return d.pop() + } + return new ArrayBuffer(n) +} +exports.mallocArrayBuffer = mallocArrayBuffer + +function mallocUint8(n) { + return new Uint8Array(mallocArrayBuffer(n), 0, n) +} +exports.mallocUint8 = mallocUint8 + +function mallocUint16(n) { + return new Uint16Array(mallocArrayBuffer(2*n), 0, n) +} +exports.mallocUint16 = mallocUint16 + +function mallocUint32(n) { + return new Uint32Array(mallocArrayBuffer(4*n), 0, n) +} +exports.mallocUint32 = mallocUint32 + +function mallocInt8(n) { + return new Int8Array(mallocArrayBuffer(n), 0, n) +} +exports.mallocInt8 = mallocInt8 + +function mallocInt16(n) { + return new Int16Array(mallocArrayBuffer(2*n), 0, n) +} +exports.mallocInt16 = mallocInt16 + +function mallocInt32(n) { + return new Int32Array(mallocArrayBuffer(4*n), 0, n) +} +exports.mallocInt32 = mallocInt32 + +function mallocFloat(n) { + return new Float32Array(mallocArrayBuffer(4*n), 0, n) +} +exports.mallocFloat32 = exports.mallocFloat = mallocFloat + +function mallocDouble(n) { + return new Float64Array(mallocArrayBuffer(8*n), 0, n) +} +exports.mallocFloat64 = exports.mallocDouble = mallocDouble + +function mallocUint8Clamped(n) { + if(hasUint8C) { + return new Uint8ClampedArray(mallocArrayBuffer(n), 0, n) + } else { + return mallocUint8(n) + } +} +exports.mallocUint8Clamped = mallocUint8Clamped + +function mallocBigUint64(n) { + if(hasBigUint64) { + return new BigUint64Array(mallocArrayBuffer(8*n), 0, n) + } else { + return null; + } +} +exports.mallocBigUint64 = mallocBigUint64 + +function mallocBigInt64(n) { + if (hasBigInt64) { + return new BigInt64Array(mallocArrayBuffer(8*n), 0, n) + } else { + return null; + } +} +exports.mallocBigInt64 = mallocBigInt64 + +function mallocDataView(n) { + return new DataView(mallocArrayBuffer(n), 0, n) +} +exports.mallocDataView = mallocDataView + +function mallocBuffer(n) { + n = bits.nextPow2(n) + var log_n = bits.log2(n) + var cache = BUFFER[log_n] + if(cache.length > 0) { + return cache.pop() + } + return new Buffer(n) +} +exports.mallocBuffer = mallocBuffer + +exports.clearCache = function clearCache() { + for(var i=0; i<32; ++i) { + POOL.UINT8[i].length = 0 + POOL.UINT16[i].length = 0 + POOL.UINT32[i].length = 0 + POOL.INT8[i].length = 0 + POOL.INT16[i].length = 0 + POOL.INT32[i].length = 0 + POOL.FLOAT[i].length = 0 + POOL.DOUBLE[i].length = 0 + POOL.BIGUINT64[i].length = 0 + POOL.BIGINT64[i].length = 0 + POOL.UINT8C[i].length = 0 + DATA[i].length = 0 + BUFFER[i].length = 0 + } +} + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"bit-twiddle":93,"buffer":105,"dup":155}],478:[function(_dereq_,module,exports){ +"use strict"; "use restrict"; + +module.exports = UnionFind; + +function UnionFind(count) { + this.roots = new Array(count); + this.ranks = new Array(count); + + for(var i=0; i" + var clsTag = "" + + var nOPN = opnTag.length + var nCLS = clsTag.length + + var isRecursive = (TAG_CHR[0] === CHR_super0) || + (TAG_CHR[0] === CHR_sub0); + + var a = 0 + var b = -nCLS + while (a > -1) { + a = str.indexOf(opnTag, a) + if(a === -1) break + + b = str.indexOf(clsTag, a + nOPN) + if(b === -1) break + + if(b <= a) break + + for(var i = a; i < b + nCLS; ++i){ + if((i < a + nOPN) || (i >= b)) { + map[i] = null + str = str.substr(0, i) + " " + str.substr(i + 1) + } else { + if(map[i] !== null) { + var pos = map[i].indexOf(TAG_CHR[0]) + if(pos === -1) { + map[i] += TAG_CHR + } else { // i.e. to handle multiple sub/super-scripts + if(isRecursive) { + // i.e to increase the sub/sup number + map[i] = map[i].substr(0, pos + 1) + (1 + parseInt(map[i][pos + 1])) + map[i].substr(pos + 2) + } + } + } + } + } + + var start = a + nOPN + var remainingStr = str.substr(start, b - start) + + var c = remainingStr.indexOf(opnTag) + if(c !== -1) a = c + else a = b + nCLS + } + + return map +} + +function transformPositions(positions, options, size) { + var align = options.textAlign || "start" + var baseline = options.textBaseline || "alphabetic" + + var lo = [1<<30, 1<<30] + var hi = [0,0] + var n = positions.length + for(var i=0; i/g, '\n') // replace
tags with \n in the string + } else { + rawString = rawString.replace(/\/g, ' ') // don't accept
tags in the input and replace with space in this case + } + + var activeStyle = "" + var map = [] + for(j = 0; j < rawString.length; ++j) { + map[j] = activeStyle + } + + if(styletags.bolds === true) map = parseTag(TAG_bold, CHR_bold, rawString, map) + if(styletags.italics === true) map = parseTag(TAG_italic, CHR_italic, rawString, map) + if(styletags.superscripts === true) map = parseTag(TAG_super, CHR_super, rawString, map) + if(styletags.subscripts === true) map = parseTag(TAG_sub, CHR_sub, rawString, map) + + var allStyles = [] + var plainText = "" + for(j = 0; j < rawString.length; ++j) { + if(map[j] !== null) { + plainText += rawString[j] + allStyles.push(map[j]) + } + } + + var allTexts = plainText.split('\n') + + var numberOfLines = allTexts.length + var lineHeight = Math.round(lineSpacing * fontSize) + var offsetX = fontSize + var offsetY = fontSize * 2 + var maxWidth = 0 + var minHeight = numberOfLines * lineHeight + offsetY + + if(canvas.height < minHeight) { + canvas.height = minHeight + } + + context.fillStyle = "#000" + context.fillRect(0, 0, canvas.width, canvas.height) + + context.fillStyle = "#fff" + var i, j, xPos, yPos, zPos + var nDone = 0 + + var buffer = "" + function writeBuffer() { + if(buffer !== "") { + var delta = context.measureText(buffer).width + + context.fillText(buffer, offsetX + xPos, offsetY + yPos) + xPos += delta + } + } + + function getTextFontSize() { + return "" + Math.round(zPos) + "px "; + } + + function changeStyle(oldStyle, newStyle) { + var ctxFont = "" + context.font; + + if(styletags.subscripts === true) { + var oldIndex_Sub = oldStyle.indexOf(CHR_sub0); + var newIndex_Sub = newStyle.indexOf(CHR_sub0); + + var oldSub = (oldIndex_Sub > -1) ? parseInt(oldStyle[1 + oldIndex_Sub]) : 0; + var newSub = (newIndex_Sub > -1) ? parseInt(newStyle[1 + newIndex_Sub]) : 0; + + if(oldSub !== newSub) { + ctxFont = ctxFont.replace(getTextFontSize(), "?px ") + zPos *= Math.pow(0.75, (newSub - oldSub)) + ctxFont = ctxFont.replace("?px ", getTextFontSize()) + } + yPos += 0.25 * lineHeight * (newSub - oldSub); + } + + if(styletags.superscripts === true) { + var oldIndex_Super = oldStyle.indexOf(CHR_super0); + var newIndex_Super = newStyle.indexOf(CHR_super0); + + var oldSuper = (oldIndex_Super > -1) ? parseInt(oldStyle[1 + oldIndex_Super]) : 0; + var newSuper = (newIndex_Super > -1) ? parseInt(newStyle[1 + newIndex_Super]) : 0; + + if(oldSuper !== newSuper) { + ctxFont = ctxFont.replace(getTextFontSize(), "?px ") + zPos *= Math.pow(0.75, (newSuper - oldSuper)) + ctxFont = ctxFont.replace("?px ", getTextFontSize()) + } + yPos -= 0.25 * lineHeight * (newSuper - oldSuper); + } + + if(styletags.bolds === true) { + var wasBold = (oldStyle.indexOf(CHR_bold) > -1) + var is_Bold = (newStyle.indexOf(CHR_bold) > -1) + + if(!wasBold && is_Bold) { + if(wasItalic) { + ctxFont = ctxFont.replace("italic ", "italic bold ") + } else { + ctxFont = "bold " + ctxFont + } + } + if(wasBold && !is_Bold) { + ctxFont = ctxFont.replace("bold ", '') + } + } + + if(styletags.italics === true) { + var wasItalic = (oldStyle.indexOf(CHR_italic) > -1) + var is_Italic = (newStyle.indexOf(CHR_italic) > -1) + + if(!wasItalic && is_Italic) { + ctxFont = "italic " + ctxFont + } + if(wasItalic && !is_Italic) { + ctxFont = ctxFont.replace("italic ", '') + } + } + context.font = ctxFont + } + + for(i = 0; i < numberOfLines; ++i) { + var txt = allTexts[i] + '\n' + xPos = 0 + yPos = i * lineHeight + zPos = fontSize + + buffer = "" + + for(j = 0; j < txt.length; ++j) { + var style = (j + nDone < allStyles.length) ? allStyles[j + nDone] : allStyles[allStyles.length - 1] + if(activeStyle === style) { + buffer += txt[j] + } else { + writeBuffer() + buffer = txt[j] + + if(style !== undefined) { + changeStyle(activeStyle, style) + activeStyle = style + } + } + } + writeBuffer() + + nDone += txt.length + + var width = Math.round(xPos + 2 * offsetX) | 0 + if(maxWidth < width) maxWidth = width + } + + //Cut pixels from image + var xCut = maxWidth + var yCut = offsetY + lineHeight * numberOfLines + var pixels = ndarray(context.getImageData(0, 0, xCut, yCut).data, [yCut, xCut, 4]) + return pixels.pick(-1, -1, 0).transpose(1, 0) +} + +function getContour(pixels, doSimplify) { + var contour = surfaceNets(pixels, 128) + if(doSimplify) { + return simplify(contour.cells, contour.positions, 0.25) + } + return { + edges: contour.cells, + positions: contour.positions + } +} + +function processPixelsImpl(pixels, options, size, simplify) { + //Extract contour + var contour = getContour(pixels, simplify) + + //Apply warp to positions + var positions = transformPositions(contour.positions, options, size) + var edges = contour.edges + var flip = "ccw" === options.orientation + + //Clean up the PSLG, resolve self intersections, etc. + cleanPSLG(positions, edges) + + //If triangulate flag passed, triangulate the result + if(options.polygons || options.polygon || options.polyline) { + var result = toPolygonCrappy(edges, positions) + var nresult = new Array(result.length) + for(var i=0; i 0) size = + options.size + + if(options.lineSpacing && + options.lineSpacing > 0) lineSpacing = + options.lineSpacing + + if(options.styletags && + options.styletags.breaklines) styletags.breaklines = + options.styletags.breaklines ? true : false + + if(options.styletags && + options.styletags.bolds) styletags.bolds = + options.styletags.bolds ? true : false + + if(options.styletags && + options.styletags.italics) styletags.italics = + options.styletags.italics ? true : false + + if(options.styletags && + options.styletags.subscripts) styletags.subscripts = + options.styletags.subscripts ? true : false + + if(options.styletags && + options.styletags.superscripts) styletags.superscripts = + options.styletags.superscripts ? true : false + } + + context.font = [ + options.fontStyle, + options.fontVariant, + options.fontWeight, + size + "px", + options.font + ].filter(function(d) {return d}).join(" ") + context.textAlign = "start" + context.textBaseline = "alphabetic" + context.direction = "ltr" + + var pixels = getPixels(canvas, context, str, size, lineSpacing, styletags) + + return processPixels(pixels, options, size) +} + +},{"cdt2d":106,"clean-pslg":115,"ndarray":376,"planar-graph-to-polyline":387,"simplify-planar-graph":442,"surface-nets":468}],483:[function(_dereq_,module,exports){ +// Copyright (C) 2011 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Install a leaky WeakMap emulation on platforms that + * don't provide a built-in one. + * + *

Assumes that an ES5 platform where, if {@code WeakMap} is + * already present, then it conforms to the anticipated ES6 + * specification. To run this file on an ES5 or almost ES5 + * implementation where the {@code WeakMap} specification does not + * quite conform, run repairES5.js first. + * + *

Even though WeakMapModule is not global, the linter thinks it + * is, which is why it is in the overrides list below. + * + *

NOTE: Before using this WeakMap emulation in a non-SES + * environment, see the note below about hiddenRecord. + * + * @author Mark S. Miller + * @requires crypto, ArrayBuffer, Uint8Array, navigator, console + * @overrides WeakMap, ses, Proxy + * @overrides WeakMapModule + */ + +/** + * This {@code WeakMap} emulation is observably equivalent to the + * ES-Harmony WeakMap, but with leakier garbage collection properties. + * + *

As with true WeakMaps, in this emulation, a key does not + * retain maps indexed by that key and (crucially) a map does not + * retain the keys it indexes. A map by itself also does not retain + * the values associated with that map. + * + *

However, the values associated with a key in some map are + * retained so long as that key is retained and those associations are + * not overridden. For example, when used to support membranes, all + * values exported from a given membrane will live for the lifetime + * they would have had in the absence of an interposed membrane. Even + * when the membrane is revoked, all objects that would have been + * reachable in the absence of revocation will still be reachable, as + * far as the GC can tell, even though they will no longer be relevant + * to ongoing computation. + * + *

The API implemented here is approximately the API as implemented + * in FF6.0a1 and agreed to by MarkM, Andreas Gal, and Dave Herman, + * rather than the offially approved proposal page. TODO(erights): + * upgrade the ecmascript WeakMap proposal page to explain this API + * change and present to EcmaScript committee for their approval. + * + *

The first difference between the emulation here and that in + * FF6.0a1 is the presence of non enumerable {@code get___, has___, + * set___, and delete___} methods on WeakMap instances to represent + * what would be the hidden internal properties of a primitive + * implementation. Whereas the FF6.0a1 WeakMap.prototype methods + * require their {@code this} to be a genuine WeakMap instance (i.e., + * an object of {@code [[Class]]} "WeakMap}), since there is nothing + * unforgeable about the pseudo-internal method names used here, + * nothing prevents these emulated prototype methods from being + * applied to non-WeakMaps with pseudo-internal methods of the same + * names. + * + *

Another difference is that our emulated {@code + * WeakMap.prototype} is not itself a WeakMap. A problem with the + * current FF6.0a1 API is that WeakMap.prototype is itself a WeakMap + * providing ambient mutability and an ambient communications + * channel. Thus, if a WeakMap is already present and has this + * problem, repairES5.js wraps it in a safe wrappper in order to + * prevent access to this channel. (See + * PATCH_MUTABLE_FROZEN_WEAKMAP_PROTO in repairES5.js). + */ + +/** + * If this is a full secureable ES5 platform and the ES-Harmony {@code WeakMap} is + * absent, install an approximate emulation. + * + *

If WeakMap is present but cannot store some objects, use our approximate + * emulation as a wrapper. + * + *

If this is almost a secureable ES5 platform, then WeakMap.js + * should be run after repairES5.js. + * + *

See {@code WeakMap} for documentation of the garbage collection + * properties of this WeakMap emulation. + */ +(function WeakMapModule() { + "use strict"; + + if (typeof ses !== 'undefined' && ses.ok && !ses.ok()) { + // already too broken, so give up + return; + } + + /** + * In some cases (current Firefox), we must make a choice betweeen a + * WeakMap which is capable of using all varieties of host objects as + * keys and one which is capable of safely using proxies as keys. See + * comments below about HostWeakMap and DoubleWeakMap for details. + * + * This function (which is a global, not exposed to guests) marks a + * WeakMap as permitted to do what is necessary to index all host + * objects, at the cost of making it unsafe for proxies. + * + * Do not apply this function to anything which is not a genuine + * fresh WeakMap. + */ + function weakMapPermitHostObjects(map) { + // identity of function used as a secret -- good enough and cheap + if (map.permitHostObjects___) { + map.permitHostObjects___(weakMapPermitHostObjects); + } + } + if (typeof ses !== 'undefined') { + ses.weakMapPermitHostObjects = weakMapPermitHostObjects; + } + + // IE 11 has no Proxy but has a broken WeakMap such that we need to patch + // it using DoubleWeakMap; this flag tells DoubleWeakMap so. + var doubleWeakMapCheckSilentFailure = false; + + // Check if there is already a good-enough WeakMap implementation, and if so + // exit without replacing it. + if (typeof WeakMap === 'function') { + var HostWeakMap = WeakMap; + // There is a WeakMap -- is it good enough? + if (typeof navigator !== 'undefined' && + /Firefox/.test(navigator.userAgent)) { + // We're now *assuming not*, because as of this writing (2013-05-06) + // Firefox's WeakMaps have a miscellany of objects they won't accept, and + // we don't want to make an exhaustive list, and testing for just one + // will be a problem if that one is fixed alone (as they did for Event). + + // If there is a platform that we *can* reliably test on, here's how to + // do it: + // var problematic = ... ; + // var testHostMap = new HostWeakMap(); + // try { + // testHostMap.set(problematic, 1); // Firefox 20 will throw here + // if (testHostMap.get(problematic) === 1) { + // return; + // } + // } catch (e) {} + + } else { + // IE 11 bug: WeakMaps silently fail to store frozen objects. + var testMap = new HostWeakMap(); + var testObject = Object.freeze({}); + testMap.set(testObject, 1); + if (testMap.get(testObject) !== 1) { + doubleWeakMapCheckSilentFailure = true; + // Fall through to installing our WeakMap. + } else { + module.exports = WeakMap; + return; + } + } + } + + var hop = Object.prototype.hasOwnProperty; + var gopn = Object.getOwnPropertyNames; + var defProp = Object.defineProperty; + var isExtensible = Object.isExtensible; + + /** + * Security depends on HIDDEN_NAME being both unguessable and + * undiscoverable by untrusted code. + * + *

Given the known weaknesses of Math.random() on existing + * browsers, it does not generate unguessability we can be confident + * of. + * + *

It is the monkey patching logic in this file that is intended + * to ensure undiscoverability. The basic idea is that there are + * three fundamental means of discovering properties of an object: + * The for/in loop, Object.keys(), and Object.getOwnPropertyNames(), + * as well as some proposed ES6 extensions that appear on our + * whitelist. The first two only discover enumerable properties, and + * we only use HIDDEN_NAME to name a non-enumerable property, so the + * only remaining threat should be getOwnPropertyNames and some + * proposed ES6 extensions that appear on our whitelist. We monkey + * patch them to remove HIDDEN_NAME from the list of properties they + * returns. + * + *

TODO(erights): On a platform with built-in Proxies, proxies + * could be used to trap and thereby discover the HIDDEN_NAME, so we + * need to monkey patch Proxy.create, Proxy.createFunction, etc, in + * order to wrap the provided handler with the real handler which + * filters out all traps using HIDDEN_NAME. + * + *

TODO(erights): Revisit Mike Stay's suggestion that we use an + * encapsulated function at a not-necessarily-secret name, which + * uses the Stiegler shared-state rights amplification pattern to + * reveal the associated value only to the WeakMap in which this key + * is associated with that value. Since only the key retains the + * function, the function can also remember the key without causing + * leakage of the key, so this doesn't violate our general gc + * goals. In addition, because the name need not be a guarded + * secret, we could efficiently handle cross-frame frozen keys. + */ + var HIDDEN_NAME_PREFIX = 'weakmap:'; + var HIDDEN_NAME = HIDDEN_NAME_PREFIX + 'ident:' + Math.random() + '___'; + + if (typeof crypto !== 'undefined' && + typeof crypto.getRandomValues === 'function' && + typeof ArrayBuffer === 'function' && + typeof Uint8Array === 'function') { + var ab = new ArrayBuffer(25); + var u8s = new Uint8Array(ab); + crypto.getRandomValues(u8s); + HIDDEN_NAME = HIDDEN_NAME_PREFIX + 'rand:' + + Array.prototype.map.call(u8s, function(u8) { + return (u8 % 36).toString(36); + }).join('') + '___'; + } + + function isNotHiddenName(name) { + return !( + name.substr(0, HIDDEN_NAME_PREFIX.length) == HIDDEN_NAME_PREFIX && + name.substr(name.length - 3) === '___'); + } + + /** + * Monkey patch getOwnPropertyNames to avoid revealing the + * HIDDEN_NAME. + * + *

The ES5.1 spec requires each name to appear only once, but as + * of this writing, this requirement is controversial for ES6, so we + * made this code robust against this case. If the resulting extra + * search turns out to be expensive, we can probably relax this once + * ES6 is adequately supported on all major browsers, iff no browser + * versions we support at that time have relaxed this constraint + * without providing built-in ES6 WeakMaps. + */ + defProp(Object, 'getOwnPropertyNames', { + value: function fakeGetOwnPropertyNames(obj) { + return gopn(obj).filter(isNotHiddenName); + } + }); + + /** + * getPropertyNames is not in ES5 but it is proposed for ES6 and + * does appear in our whitelist, so we need to clean it too. + */ + if ('getPropertyNames' in Object) { + var originalGetPropertyNames = Object.getPropertyNames; + defProp(Object, 'getPropertyNames', { + value: function fakeGetPropertyNames(obj) { + return originalGetPropertyNames(obj).filter(isNotHiddenName); + } + }); + } + + /** + *

To treat objects as identity-keys with reasonable efficiency + * on ES5 by itself (i.e., without any object-keyed collections), we + * need to add a hidden property to such key objects when we + * can. This raises several issues: + *

    + *
  • Arranging to add this property to objects before we lose the + * chance, and + *
  • Hiding the existence of this new property from most + * JavaScript code. + *
  • Preventing certification theft, where one object is + * created falsely claiming to be the key of an association + * actually keyed by another object. + *
  • Preventing value theft, where untrusted code with + * access to a key object but not a weak map nevertheless + * obtains access to the value associated with that key in that + * weak map. + *
+ * We do so by + *
    + *
  • Making the name of the hidden property unguessable, so "[]" + * indexing, which we cannot intercept, cannot be used to access + * a property without knowing the name. + *
  • Making the hidden property non-enumerable, so we need not + * worry about for-in loops or {@code Object.keys}, + *
  • monkey patching those reflective methods that would + * prevent extensions, to add this hidden property first, + *
  • monkey patching those methods that would reveal this + * hidden property. + *
+ * Unfortunately, because of same-origin iframes, we cannot reliably + * add this hidden property before an object becomes + * non-extensible. Instead, if we encounter a non-extensible object + * without a hidden record that we can detect (whether or not it has + * a hidden record stored under a name secret to us), then we just + * use the key object itself to represent its identity in a brute + * force leaky map stored in the weak map, losing all the advantages + * of weakness for these. + */ + function getHiddenRecord(key) { + if (key !== Object(key)) { + throw new TypeError('Not an object: ' + key); + } + var hiddenRecord = key[HIDDEN_NAME]; + if (hiddenRecord && hiddenRecord.key === key) { return hiddenRecord; } + if (!isExtensible(key)) { + // Weak map must brute force, as explained in doc-comment above. + return void 0; + } + + // The hiddenRecord and the key point directly at each other, via + // the "key" and HIDDEN_NAME properties respectively. The key + // field is for quickly verifying that this hidden record is an + // own property, not a hidden record from up the prototype chain. + // + // NOTE: Because this WeakMap emulation is meant only for systems like + // SES where Object.prototype is frozen without any numeric + // properties, it is ok to use an object literal for the hiddenRecord. + // This has two advantages: + // * It is much faster in a performance critical place + // * It avoids relying on Object.create(null), which had been + // problematic on Chrome 28.0.1480.0. See + // https://code.google.com/p/google-caja/issues/detail?id=1687 + hiddenRecord = { key: key }; + + // When using this WeakMap emulation on platforms where + // Object.prototype might not be frozen and Object.create(null) is + // reliable, use the following two commented out lines instead. + // hiddenRecord = Object.create(null); + // hiddenRecord.key = key; + + // Please contact us if you need this to work on platforms where + // Object.prototype might not be frozen and + // Object.create(null) might not be reliable. + + try { + defProp(key, HIDDEN_NAME, { + value: hiddenRecord, + writable: false, + enumerable: false, + configurable: false + }); + return hiddenRecord; + } catch (error) { + // Under some circumstances, isExtensible seems to misreport whether + // the HIDDEN_NAME can be defined. + // The circumstances have not been isolated, but at least affect + // Node.js v0.10.26 on TravisCI / Linux, but not the same version of + // Node.js on OS X. + return void 0; + } + } + + /** + * Monkey patch operations that would make their argument + * non-extensible. + * + *

The monkey patched versions throw a TypeError if their + * argument is not an object, so it should only be done to functions + * that should throw a TypeError anyway if their argument is not an + * object. + */ + (function(){ + var oldFreeze = Object.freeze; + defProp(Object, 'freeze', { + value: function identifyingFreeze(obj) { + getHiddenRecord(obj); + return oldFreeze(obj); + } + }); + var oldSeal = Object.seal; + defProp(Object, 'seal', { + value: function identifyingSeal(obj) { + getHiddenRecord(obj); + return oldSeal(obj); + } + }); + var oldPreventExtensions = Object.preventExtensions; + defProp(Object, 'preventExtensions', { + value: function identifyingPreventExtensions(obj) { + getHiddenRecord(obj); + return oldPreventExtensions(obj); + } + }); + })(); + + function constFunc(func) { + func.prototype = null; + return Object.freeze(func); + } + + var calledAsFunctionWarningDone = false; + function calledAsFunctionWarning() { + // Future ES6 WeakMap is currently (2013-09-10) expected to reject WeakMap() + // but we used to permit it and do it ourselves, so warn only. + if (!calledAsFunctionWarningDone && typeof console !== 'undefined') { + calledAsFunctionWarningDone = true; + console.warn('WeakMap should be invoked as new WeakMap(), not ' + + 'WeakMap(). This will be an error in the future.'); + } + } + + var nextId = 0; + + var OurWeakMap = function() { + if (!(this instanceof OurWeakMap)) { // approximate test for new ...() + calledAsFunctionWarning(); + } + + // We are currently (12/25/2012) never encountering any prematurely + // non-extensible keys. + var keys = []; // brute force for prematurely non-extensible keys. + var values = []; // brute force for corresponding values. + var id = nextId++; + + function get___(key, opt_default) { + var index; + var hiddenRecord = getHiddenRecord(key); + if (hiddenRecord) { + return id in hiddenRecord ? hiddenRecord[id] : opt_default; + } else { + index = keys.indexOf(key); + return index >= 0 ? values[index] : opt_default; + } + } + + function has___(key) { + var hiddenRecord = getHiddenRecord(key); + if (hiddenRecord) { + return id in hiddenRecord; + } else { + return keys.indexOf(key) >= 0; + } + } + + function set___(key, value) { + var index; + var hiddenRecord = getHiddenRecord(key); + if (hiddenRecord) { + hiddenRecord[id] = value; + } else { + index = keys.indexOf(key); + if (index >= 0) { + values[index] = value; + } else { + // Since some browsers preemptively terminate slow turns but + // then continue computing with presumably corrupted heap + // state, we here defensively get keys.length first and then + // use it to update both the values and keys arrays, keeping + // them in sync. + index = keys.length; + values[index] = value; + // If we crash here, values will be one longer than keys. + keys[index] = key; + } + } + return this; + } + + function delete___(key) { + var hiddenRecord = getHiddenRecord(key); + var index, lastIndex; + if (hiddenRecord) { + return id in hiddenRecord && delete hiddenRecord[id]; + } else { + index = keys.indexOf(key); + if (index < 0) { + return false; + } + // Since some browsers preemptively terminate slow turns but + // then continue computing with potentially corrupted heap + // state, we here defensively get keys.length first and then use + // it to update both the keys and the values array, keeping + // them in sync. We update the two with an order of assignments, + // such that any prefix of these assignments will preserve the + // key/value correspondence, either before or after the delete. + // Note that this needs to work correctly when index === lastIndex. + lastIndex = keys.length - 1; + keys[index] = void 0; + // If we crash here, there's a void 0 in the keys array, but + // no operation will cause a "keys.indexOf(void 0)", since + // getHiddenRecord(void 0) will always throw an error first. + values[index] = values[lastIndex]; + // If we crash here, values[index] cannot be found here, + // because keys[index] is void 0. + keys[index] = keys[lastIndex]; + // If index === lastIndex and we crash here, then keys[index] + // is still void 0, since the aliasing killed the previous key. + keys.length = lastIndex; + // If we crash here, keys will be one shorter than values. + values.length = lastIndex; + return true; + } + } + + return Object.create(OurWeakMap.prototype, { + get___: { value: constFunc(get___) }, + has___: { value: constFunc(has___) }, + set___: { value: constFunc(set___) }, + delete___: { value: constFunc(delete___) } + }); + }; + + OurWeakMap.prototype = Object.create(Object.prototype, { + get: { + /** + * Return the value most recently associated with key, or + * opt_default if none. + */ + value: function get(key, opt_default) { + return this.get___(key, opt_default); + }, + writable: true, + configurable: true + }, + + has: { + /** + * Is there a value associated with key in this WeakMap? + */ + value: function has(key) { + return this.has___(key); + }, + writable: true, + configurable: true + }, + + set: { + /** + * Associate value with key in this WeakMap, overwriting any + * previous association if present. + */ + value: function set(key, value) { + return this.set___(key, value); + }, + writable: true, + configurable: true + }, + + 'delete': { + /** + * Remove any association for key in this WeakMap, returning + * whether there was one. + * + *

Note that the boolean return here does not work like the + * {@code delete} operator. The {@code delete} operator returns + * whether the deletion succeeds at bringing about a state in + * which the deleted property is absent. The {@code delete} + * operator therefore returns true if the property was already + * absent, whereas this {@code delete} method returns false if + * the association was already absent. + */ + value: function remove(key) { + return this.delete___(key); + }, + writable: true, + configurable: true + } + }); + + if (typeof HostWeakMap === 'function') { + (function() { + // If we got here, then the platform has a WeakMap but we are concerned + // that it may refuse to store some key types. Therefore, make a map + // implementation which makes use of both as possible. + + // In this mode we are always using double maps, so we are not proxy-safe. + // This combination does not occur in any known browser, but we had best + // be safe. + if (doubleWeakMapCheckSilentFailure && typeof Proxy !== 'undefined') { + Proxy = undefined; + } + + function DoubleWeakMap() { + if (!(this instanceof OurWeakMap)) { // approximate test for new ...() + calledAsFunctionWarning(); + } + + // Preferable, truly weak map. + var hmap = new HostWeakMap(); + + // Our hidden-property-based pseudo-weak-map. Lazily initialized in the + // 'set' implementation; thus we can avoid performing extra lookups if + // we know all entries actually stored are entered in 'hmap'. + var omap = undefined; + + // Hidden-property maps are not compatible with proxies because proxies + // can observe the hidden name and either accidentally expose it or fail + // to allow the hidden property to be set. Therefore, we do not allow + // arbitrary WeakMaps to switch to using hidden properties, but only + // those which need the ability, and unprivileged code is not allowed + // to set the flag. + // + // (Except in doubleWeakMapCheckSilentFailure mode in which case we + // disable proxies.) + var enableSwitching = false; + + function dget(key, opt_default) { + if (omap) { + return hmap.has(key) ? hmap.get(key) + : omap.get___(key, opt_default); + } else { + return hmap.get(key, opt_default); + } + } + + function dhas(key) { + return hmap.has(key) || (omap ? omap.has___(key) : false); + } + + var dset; + if (doubleWeakMapCheckSilentFailure) { + dset = function(key, value) { + hmap.set(key, value); + if (!hmap.has(key)) { + if (!omap) { omap = new OurWeakMap(); } + omap.set(key, value); + } + return this; + }; + } else { + dset = function(key, value) { + if (enableSwitching) { + try { + hmap.set(key, value); + } catch (e) { + if (!omap) { omap = new OurWeakMap(); } + omap.set___(key, value); + } + } else { + hmap.set(key, value); + } + return this; + }; + } + + function ddelete(key) { + var result = !!hmap['delete'](key); + if (omap) { return omap.delete___(key) || result; } + return result; + } + + return Object.create(OurWeakMap.prototype, { + get___: { value: constFunc(dget) }, + has___: { value: constFunc(dhas) }, + set___: { value: constFunc(dset) }, + delete___: { value: constFunc(ddelete) }, + permitHostObjects___: { value: constFunc(function(token) { + if (token === weakMapPermitHostObjects) { + enableSwitching = true; + } else { + throw new Error('bogus call to permitHostObjects___'); + } + })} + }); + } + DoubleWeakMap.prototype = OurWeakMap.prototype; + module.exports = DoubleWeakMap; + + // define .constructor to hide OurWeakMap ctor + Object.defineProperty(WeakMap.prototype, 'constructor', { + value: WeakMap, + enumerable: false, // as default .constructor is + configurable: true, + writable: true + }); + })(); + } else { + // There is no host WeakMap, so we must use the emulation. + + // Emulated WeakMaps are incompatible with native proxies (because proxies + // can observe the hidden name), so we must disable Proxy usage (in + // ArrayLike and Domado, currently). + if (typeof Proxy !== 'undefined') { + Proxy = undefined; + } + + module.exports = OurWeakMap; + } +})(); + +},{}],484:[function(_dereq_,module,exports){ +var hiddenStore = _dereq_('./hidden-store.js'); + +module.exports = createStore; + +function createStore() { + var key = {}; + + return function (obj) { + if ((typeof obj !== 'object' || obj === null) && + typeof obj !== 'function' + ) { + throw new Error('Weakmap-shim: Key must be object') + } + + var store = obj.valueOf(key); + return store && store.identity === key ? + store : hiddenStore(obj, key); + }; +} + +},{"./hidden-store.js":485}],485:[function(_dereq_,module,exports){ +module.exports = hiddenStore; + +function hiddenStore(obj, key) { + var store = { identity: key }; + var valueOf = obj.valueOf; + + Object.defineProperty(obj, "valueOf", { + value: function (value) { + return value !== key ? + valueOf.apply(this, arguments) : store; + }, + writable: true + }); + + return store; +} + +},{}],486:[function(_dereq_,module,exports){ +// Original - @Gozola. +// https://gist.github.com/Gozala/1269991 +// This is a reimplemented version (with a few bug fixes). + +var createStore = _dereq_('./create-store.js'); + +module.exports = weakMap; + +function weakMap() { + var privates = createStore(); + + return { + 'get': function (key, fallback) { + var store = privates(key) + return store.hasOwnProperty('value') ? + store.value : fallback + }, + 'set': function (key, value) { + privates(key).value = value; + return this; + }, + 'has': function(key) { + return 'value' in privates(key); + }, + 'delete': function (key) { + return delete privates(key).value; + } + } +} + +},{"./create-store.js":484}],487:[function(_dereq_,module,exports){ +var getContext = _dereq_('get-canvas-context') + +module.exports = function getWebGLContext (opt) { + return getContext('webgl', opt) +} + +},{"get-canvas-context":162}],488:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -88681,7 +128189,7 @@ function toSolar(yearOrDate, monthOrResult, day, isIntercalaryOrResult, result) } -},{"../main":188,"object-assign":122}],175:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],489:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -88865,7 +128373,7 @@ assign(CopticCalendar.prototype, { main.calendars.coptic = CopticCalendar; -},{"../main":188,"object-assign":122}],176:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],490:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -89093,7 +128601,7 @@ var centuries = { main.calendars.discworld = DiscworldCalendar; -},{"../main":188,"object-assign":122}],177:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],491:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -89277,7 +128785,7 @@ assign(EthiopianCalendar.prototype, { main.calendars.ethiopian = EthiopianCalendar; -},{"../main":188,"object-assign":122}],178:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],492:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -89551,7 +129059,7 @@ function mod(a, b) { main.calendars.hebrew = HebrewCalendar; -},{"../main":188,"object-assign":122}],179:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],493:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -89732,7 +129240,7 @@ assign(IslamicCalendar.prototype, { main.calendars.islamic = IslamicCalendar; -},{"../main":188,"object-assign":122}],180:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],494:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -89915,7 +129423,7 @@ assign(JulianCalendar.prototype, { main.calendars.julian = JulianCalendar; -},{"../main":188,"object-assign":122}],181:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],495:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -90210,7 +129718,7 @@ function amod(a, b) { main.calendars.mayan = MayanCalendar; -},{"../main":188,"object-assign":122}],182:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],496:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -90390,7 +129898,7 @@ assign(NanakshahiCalendar.prototype, { main.calendars.nanakshahi = NanakshahiCalendar; -},{"../main":188,"object-assign":122}],183:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],497:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -90813,7 +130321,7 @@ assign(NepaliCalendar.prototype, { main.calendars.nepali = NepaliCalendar; -},{"../main":188,"object-assign":122}],184:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],498:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -91003,7 +130511,7 @@ main.calendars.persian = PersianCalendar; main.calendars.jalali = PersianCalendar; -},{"../main":188,"object-assign":122}],185:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],499:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -91189,7 +130697,7 @@ assign(TaiwanCalendar.prototype, { main.calendars.taiwan = TaiwanCalendar; -},{"../main":188,"object-assign":122}],186:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],500:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -91375,7 +130883,7 @@ assign(ThaiCalendar.prototype, { main.calendars.thai = ThaiCalendar; -},{"../main":188,"object-assign":122}],187:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],501:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -91740,7 +131248,7 @@ var ummalqura_dat = [ 79990]; -},{"../main":188,"object-assign":122}],188:[function(_dereq_,module,exports){ +},{"../main":502,"object-assign":379}],502:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -92645,7 +132153,7 @@ _exports.baseCalendar = BaseCalendar; _exports.calendars.gregorian = GregorianCalendar; -},{"object-assign":122}],189:[function(_dereq_,module,exports){ +},{"object-assign":379}],503:[function(_dereq_,module,exports){ /* * World Calendars * https://github.com/alexcjohnson/world-calendars @@ -93147,7 +132655,83 @@ assign(main.baseCalendar.prototype, { }); -},{"./main":188,"object-assign":122}],190:[function(_dereq_,module,exports){ +},{"./main":502,"object-assign":379}],504:[function(_dereq_,module,exports){ +"use strict" + +function CWiseOp() { + return function(SS, a0, t0, p0, Y0, Y1) { + var s0 = SS[0], + t0p0 = t0[0], + index = [0], + q0 = t0p0 + p0 |= 0 + var i0 = 0, + d0s0 = t0p0 + for (i0 = 0; i0 < s0; ++i0) { + { + var da = a0[p0] - Y1 + var db = a0[p0 + q0] - Y1 + if (da >= 0 !== db >= 0) { + Y0.push(index[0] + 0.5 + (0.5 * (da + db)) / (da - db)) + } + } + p0 += d0s0 + ++index[0] + } + } +} + +//Generates a cwise operator +function generateCWiseOp() { + return CWiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {} + return function zeroCrossings_cwise_thunk(array0, scalar2, scalar3) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar2, scalar3) + } +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ + funcName: 'zeroCrossings' +}) + +},{}],505:[function(_dereq_,module,exports){ +"use strict" + +module.exports = findZeroCrossings + +var core = _dereq_("./lib/zc-core") + +function findZeroCrossings(array, level) { + var cross = [] + level = +level || 0.0 + core(array.hi(array.shape[0]-1), cross, level) + return cross +} +},{"./lib/zc-core":504}],506:[function(_dereq_,module,exports){ 'use strict'; /** @@ -93210,7 +132794,7 @@ module.exports = [ } ]; -},{}],191:[function(_dereq_,module,exports){ +},{}],507:[function(_dereq_,module,exports){ 'use strict'; var ARROWPATHS = _dereq_('./arrow_paths'); @@ -93498,7 +133082,7 @@ module.exports = templatedArray('annotation', { } }); -},{"../../constants/axis_placeable_objects":314,"../../plot_api/plot_template":379,"../../plots/cartesian/constants":397,"../../plots/font_attributes":419,"./arrow_paths":190}],192:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":630,"../../plot_api/plot_template":700,"../../plots/cartesian/constants":718,"../../plots/font_attributes":740,"./arrow_paths":506}],508:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -93580,7 +133164,7 @@ function calcAxisExpansion(ann, ax) { ann._extremes[axId] = extremes; } -},{"../../lib":342,"../../plots/cartesian/axes":390,"./draw":197}],193:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"./draw":513}],509:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -93710,7 +133294,7 @@ function clickData2r(d, ax) { return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d); } -},{"../../lib":342,"../../plot_api/plot_template":379,"../../registry":452}],194:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../registry":788}],510:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -93781,7 +133365,7 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo coerce('captureevents', !!hoverText); }; -},{"../../lib":342,"../color":208}],195:[function(_dereq_,module,exports){ +},{"../../lib":661,"../color":524}],511:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -93835,7 +133419,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":367,"fast-isnumeric":81}],196:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":688,"fast-isnumeric":159}],512:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -93934,7 +133518,7 @@ function handleAnnotationDefaults(annIn, annOut, fullLayout) { } } -},{"../../lib":342,"../../plots/array_container_defaults":385,"../../plots/cartesian/axes":390,"./attributes":191,"./common_defaults":194}],197:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/array_container_defaults":706,"../../plots/cartesian/axes":711,"./attributes":507,"./common_defaults":510}],513:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -94687,7 +134271,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) { } else annText.call(textLayout); } -},{"../../lib":342,"../../lib/setcursor":362,"../../lib/svg_text_utils":365,"../../plot_api/plot_template":379,"../../plots/cartesian/axes":390,"../../plots/plots":438,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"../fx":248,"./draw_arrow_head":198,"@plotly/d3":44}],198:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/setcursor":681,"../../lib/svg_text_utils":686,"../../plot_api/plot_template":700,"../../plots/cartesian/axes":711,"../../plots/plots":774,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"../fx":564,"./draw_arrow_head":514,"@plotly/d3":54}],514:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -94834,7 +134418,7 @@ module.exports = function drawArrowHead(el3, ends, options) { if(doEnd) drawhead(headStyle, end, endRot, scale); }; -},{"../../lib":342,"../color":208,"./arrow_paths":190,"@plotly/d3":44}],199:[function(_dereq_,module,exports){ +},{"../../lib":661,"../color":524,"./arrow_paths":506,"@plotly/d3":54}],515:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -94859,7 +134443,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":403,"./attributes":191,"./calc_autorange":192,"./click":193,"./convert_coords":195,"./defaults":196,"./draw":197}],200:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":724,"./attributes":507,"./calc_autorange":508,"./click":509,"./convert_coords":511,"./defaults":512,"./draw":513}],516:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -94928,7 +134512,7 @@ module.exports = overrideAll(templatedArray('annotation', { // zref: 'z' }), 'calc', 'from-root'); -},{"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../annotations/attributes":191}],201:[function(_dereq_,module,exports){ +},{"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../annotations/attributes":507}],517:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -94985,7 +134569,7 @@ function mockAnnAxes(ann, scene) { }; } -},{"../../lib":342,"../../plots/cartesian/axes":390}],202:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711}],518:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -95053,7 +134637,7 @@ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) { } } -},{"../../lib":342,"../../plots/array_container_defaults":385,"../../plots/cartesian/axes":390,"../annotations/common_defaults":194,"./attributes":200}],203:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/array_container_defaults":706,"../../plots/cartesian/axes":711,"../annotations/common_defaults":510,"./attributes":516}],519:[function(_dereq_,module,exports){ 'use strict'; var drawRaw = _dereq_('../annotations/draw').drawRaw; @@ -95097,7 +134681,7 @@ module.exports = function draw(scene) { } }; -},{"../../plots/gl3d/project":428,"../annotations/draw":197}],204:[function(_dereq_,module,exports){ +},{"../../plots/gl3d/project":762,"../annotations/draw":513}],520:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -95137,7 +134721,7 @@ function includeGL3D(layoutIn, layoutOut) { } } -},{"../../lib":342,"../../registry":452,"./attributes":200,"./convert":201,"./defaults":202,"./draw":203}],205:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"./attributes":516,"./convert":517,"./defaults":518,"./draw":519}],521:[function(_dereq_,module,exports){ 'use strict'; // a trimmed down version of: @@ -95162,7 +134746,7 @@ _dereq_('world-calendars/dist/calendars/taiwan'); _dereq_('world-calendars/dist/calendars/thai'); _dereq_('world-calendars/dist/calendars/ummalqura'); -},{"world-calendars/dist/calendars/chinese":174,"world-calendars/dist/calendars/coptic":175,"world-calendars/dist/calendars/discworld":176,"world-calendars/dist/calendars/ethiopian":177,"world-calendars/dist/calendars/hebrew":178,"world-calendars/dist/calendars/islamic":179,"world-calendars/dist/calendars/julian":180,"world-calendars/dist/calendars/mayan":181,"world-calendars/dist/calendars/nanakshahi":182,"world-calendars/dist/calendars/nepali":183,"world-calendars/dist/calendars/persian":184,"world-calendars/dist/calendars/taiwan":185,"world-calendars/dist/calendars/thai":186,"world-calendars/dist/calendars/ummalqura":187,"world-calendars/dist/main":188,"world-calendars/dist/plus":189}],206:[function(_dereq_,module,exports){ +},{"world-calendars/dist/calendars/chinese":488,"world-calendars/dist/calendars/coptic":489,"world-calendars/dist/calendars/discworld":490,"world-calendars/dist/calendars/ethiopian":491,"world-calendars/dist/calendars/hebrew":492,"world-calendars/dist/calendars/islamic":493,"world-calendars/dist/calendars/julian":494,"world-calendars/dist/calendars/mayan":495,"world-calendars/dist/calendars/nanakshahi":496,"world-calendars/dist/calendars/nepali":497,"world-calendars/dist/calendars/persian":498,"world-calendars/dist/calendars/taiwan":499,"world-calendars/dist/calendars/thai":500,"world-calendars/dist/calendars/ummalqura":501,"world-calendars/dist/main":502,"world-calendars/dist/plus":503}],522:[function(_dereq_,module,exports){ 'use strict'; var calendars = _dereq_('./calendars'); @@ -95428,7 +135012,7 @@ module.exports = { worldCalFmt: worldCalFmt }; -},{"../../constants/numerical":319,"../../lib":342,"./calendars":205}],207:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"./calendars":521}],523:[function(_dereq_,module,exports){ 'use strict'; @@ -95460,7 +135044,7 @@ exports.borderLine = '#BEC8D9'; // gives back exactly lightLine if the other colors are defaults. exports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4); -},{}],208:[function(_dereq_,module,exports){ +},{}],524:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -95626,7 +135210,7 @@ function cleanOne(val) { return 'rgb(' + rgbStr + ')'; } -},{"../../lib/array":325,"./attributes":207,"fast-isnumeric":81,"tinycolor2":171}],209:[function(_dereq_,module,exports){ +},{"../../lib/array":643,"./attributes":523,"fast-isnumeric":159,"tinycolor2":471}],525:[function(_dereq_,module,exports){ 'use strict'; var axesAttrs = _dereq_('../../plots/cartesian/layout_attributes'); @@ -95773,7 +135357,7 @@ module.exports = overrideAll({ } }, 'colorbars', 'from-root'); -},{"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plots/cartesian/layout_attributes":405,"../../plots/font_attributes":419}],210:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/cartesian/layout_attributes":726,"../../plots/font_attributes":740}],526:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -95793,7 +135377,7 @@ module.exports = { } }; -},{}],211:[function(_dereq_,module,exports){ +},{}],527:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -95863,7 +135447,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) { coerce('title.side'); }; -},{"../../lib":342,"../../plot_api/plot_template":379,"../../plots/cartesian/tick_label_defaults":412,"../../plots/cartesian/tick_mark_defaults":413,"../../plots/cartesian/tick_value_defaults":414,"./attributes":209}],212:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../plots/cartesian/tick_label_defaults":733,"../../plots/cartesian/tick_mark_defaults":734,"../../plots/cartesian/tick_value_defaults":735,"./attributes":525}],528:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -96590,7 +136174,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":313,"../../lib":342,"../../lib/extend":333,"../../lib/setcursor":362,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../plots/cartesian/axis_defaults":392,"../../plots/cartesian/layout_attributes":405,"../../plots/cartesian/position_defaults":408,"../../plots/plots":438,"../../registry":452,"../color":208,"../colorscale/helpers":219,"../dragelement":227,"../drawing":230,"../titles":306,"./constants":210,"@plotly/d3":44,"tinycolor2":171}],213:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../lib":661,"../../lib/extend":651,"../../lib/setcursor":681,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../plots/cartesian/axis_defaults":713,"../../plots/cartesian/layout_attributes":726,"../../plots/cartesian/position_defaults":729,"../../plots/plots":774,"../../registry":788,"../color":524,"../colorscale/helpers":535,"../dragelement":543,"../drawing":546,"../titles":622,"./constants":526,"@plotly/d3":54,"tinycolor2":471}],529:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -96600,7 +136184,7 @@ module.exports = function hasColorbar(container) { return Lib.isPlainObject(container.colorbar); }; -},{"../../lib":342}],214:[function(_dereq_,module,exports){ +},{"../../lib":661}],530:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -96614,7 +136198,7 @@ module.exports = { hasColorbar: _dereq_('./has_colorbar') }; -},{"./attributes":209,"./defaults":211,"./draw":212,"./has_colorbar":213}],215:[function(_dereq_,module,exports){ +},{"./attributes":525,"./defaults":527,"./draw":528,"./has_colorbar":529}],531:[function(_dereq_,module,exports){ 'use strict'; var colorbarAttrs = _dereq_('../colorbar/attributes'); @@ -96795,7 +136379,7 @@ module.exports = function colorScaleAttrs(context, opts) { return attrs; }; -},{"../../lib/regex":358,"../../lib/sort_object_keys":363,"../colorbar/attributes":209,"./scales.js":223}],216:[function(_dereq_,module,exports){ +},{"../../lib/regex":677,"../../lib/sort_object_keys":683,"../colorbar/attributes":525,"./scales.js":539}],532:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -96866,7 +136450,7 @@ module.exports = function calc(gd, trace, opts) { } }; -},{"../../lib":342,"./helpers":219,"fast-isnumeric":81}],217:[function(_dereq_,module,exports){ +},{"../../lib":661,"./helpers":535,"fast-isnumeric":159}],533:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -96935,7 +136519,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":342,"./helpers":219}],218:[function(_dereq_,module,exports){ +},{"../../lib":661,"./helpers":535}],534:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -97052,7 +136636,7 @@ module.exports = function colorScaleDefaults(parentContIn, parentContOut, layout } }; -},{"../../lib":342,"../../registry":452,"../colorbar/defaults":211,"../colorbar/has_colorbar":213,"./scales":223,"fast-isnumeric":81}],219:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"../colorbar/defaults":527,"../colorbar/has_colorbar":529,"./scales":539,"fast-isnumeric":159}],535:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -97284,7 +136868,7 @@ module.exports = { makeColorScaleFuncFromTrace: makeColorScaleFuncFromTrace }; -},{"../../lib":342,"../color":208,"./scales":223,"@plotly/d3":44,"fast-isnumeric":81,"tinycolor2":171}],220:[function(_dereq_,module,exports){ +},{"../../lib":661,"../color":524,"./scales":539,"@plotly/d3":54,"fast-isnumeric":159,"tinycolor2":471}],536:[function(_dereq_,module,exports){ 'use strict'; var scales = _dereq_('./scales'); @@ -97318,7 +136902,7 @@ module.exports = { makeColorScaleFuncFromTrace: helpers.makeColorScaleFuncFromTrace }; -},{"./attributes":215,"./calc":216,"./cross_trace_defaults":217,"./defaults":218,"./helpers":219,"./layout_attributes":221,"./layout_defaults":222,"./scales":223}],221:[function(_dereq_,module,exports){ +},{"./attributes":531,"./calc":532,"./cross_trace_defaults":533,"./defaults":534,"./helpers":535,"./layout_attributes":537,"./layout_defaults":538,"./scales":539}],537:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -97364,7 +136948,7 @@ module.exports = { })) }; -},{"../../lib/extend":333,"./attributes":215,"./scales":223}],222:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"./attributes":531,"./scales":539}],538:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -97407,7 +136991,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { } }; -},{"../../lib":342,"../../plot_api/plot_template":379,"./defaults":218,"./layout_attributes":221}],223:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"./defaults":534,"./layout_attributes":537}],539:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -97603,7 +137187,7 @@ module.exports = { isValid: isValidScale }; -},{"tinycolor2":171}],224:[function(_dereq_,module,exports){ +},{"tinycolor2":471}],540:[function(_dereq_,module,exports){ 'use strict'; @@ -97627,7 +137211,7 @@ module.exports = function align(v, dv, v0, v1, anchor) { return vc; }; -},{}],225:[function(_dereq_,module,exports){ +},{}],541:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -97656,7 +137240,7 @@ module.exports = function getCursor(x, y, xanchor, yanchor) { return cursorset[y][x]; }; -},{"../../lib":342}],226:[function(_dereq_,module,exports){ +},{"../../lib":661}],542:[function(_dereq_,module,exports){ 'use strict'; exports.selectMode = function(dragmode) { @@ -97707,7 +137291,7 @@ exports.selectingOrDrawing = function(dragmode) { ); }; -},{}],227:[function(_dereq_,module,exports){ +},{}],543:[function(_dereq_,module,exports){ 'use strict'; var mouseOffset = _dereq_('mouse-event-offset'); @@ -97991,7 +137575,7 @@ function pointerOffset(e) { ); } -},{"../../lib":342,"../../plots/cartesian/constants":397,"./align":224,"./cursor":225,"./unhover":228,"has-hover":112,"has-passive-events":113,"mouse-event-offset":120}],228:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/constants":718,"./align":540,"./cursor":541,"./unhover":544,"has-hover":343,"has-passive-events":344,"mouse-event-offset":364}],544:[function(_dereq_,module,exports){ 'use strict'; var Events = _dereq_('../../lib/events'); @@ -98038,7 +137622,7 @@ unhover.raw = function raw(gd, evt) { } }; -},{"../../lib/dom":331,"../../lib/events":332,"../../lib/throttle":366,"../fx/constants":242}],229:[function(_dereq_,module,exports){ +},{"../../lib/dom":649,"../../lib/events":650,"../../lib/throttle":687,"../fx/constants":558}],545:[function(_dereq_,module,exports){ 'use strict'; exports.dash = { @@ -98100,7 +137684,7 @@ exports.pattern = { editType: 'style', }; -},{}],230:[function(_dereq_,module,exports){ +},{}],546:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -99544,7 +139128,7 @@ drawing.setTextPointsScale = function(selection, xScale, yScale) { }); }; -},{"../../components/fx/helpers":244,"../../constants/alignment":313,"../../constants/interactions":318,"../../constants/xmlns_namespaces":320,"../../lib":342,"../../lib/svg_text_utils":365,"../../registry":452,"../../traces/scatter/make_bubble_size_func":722,"../../traces/scatter/subtypes":730,"../color":208,"../colorscale":220,"./symbol_defs":231,"@plotly/d3":44,"fast-isnumeric":81,"tinycolor2":171}],231:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":560,"../../constants/alignment":629,"../../constants/interactions":636,"../../constants/xmlns_namespaces":638,"../../lib":661,"../../lib/svg_text_utils":686,"../../registry":788,"../../traces/scatter/make_bubble_size_func":1081,"../../traces/scatter/subtypes":1089,"../color":524,"../colorscale":536,"./symbol_defs":547,"@plotly/d3":54,"fast-isnumeric":159,"tinycolor2":471}],547:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -100099,7 +139683,7 @@ module.exports = { } }; -},{"@plotly/d3":44}],232:[function(_dereq_,module,exports){ +},{"@plotly/d3":54}],548:[function(_dereq_,module,exports){ 'use strict'; @@ -100182,7 +139766,7 @@ module.exports = { } }; -},{}],233:[function(_dereq_,module,exports){ +},{}],549:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -100260,7 +139844,7 @@ function calcOneAxis(calcTrace, trace, axis, coord) { baseExtremes.max = baseExtremes.max.concat(extremes.max); } -},{"../../lib":342,"../../plots/cartesian/axes":390,"../../registry":452,"./compute_error":234,"fast-isnumeric":81}],234:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../../registry":788,"./compute_error":550,"fast-isnumeric":159}],550:[function(_dereq_,module,exports){ 'use strict'; @@ -100352,7 +139936,7 @@ function makeComputeErrorValue(type, value) { } } -},{}],235:[function(_dereq_,module,exports){ +},{}],551:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -100419,7 +140003,7 @@ module.exports = function(traceIn, traceOut, defaultColor, opts) { } }; -},{"../../lib":342,"../../plot_api/plot_template":379,"../../registry":452,"./attributes":232,"fast-isnumeric":81}],236:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../registry":788,"./attributes":548,"fast-isnumeric":159}],552:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -100480,7 +140064,7 @@ function hoverInfo(calcPoint, trace, hoverPoint) { } } -},{"../../lib":342,"../../plot_api/edit_types":372,"./attributes":232,"./calc":233,"./compute_error":234,"./defaults":235,"./plot":237,"./style":238}],237:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/edit_types":693,"./attributes":548,"./calc":549,"./compute_error":550,"./defaults":551,"./plot":553,"./style":554}],553:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -100643,7 +140227,7 @@ function errorCoords(d, xa, ya) { return out; } -},{"../../traces/scatter/subtypes":730,"../drawing":230,"@plotly/d3":44,"fast-isnumeric":81}],238:[function(_dereq_,module,exports){ +},{"../../traces/scatter/subtypes":1089,"../drawing":546,"@plotly/d3":54,"fast-isnumeric":159}],554:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -100671,7 +140255,7 @@ module.exports = function style(traces) { }); }; -},{"../color":208,"@plotly/d3":44}],239:[function(_dereq_,module,exports){ +},{"../color":524,"@plotly/d3":54}],555:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -100696,7 +140280,7 @@ module.exports = { } }; -},{"../../lib/extend":333,"../../plots/font_attributes":419,"./layout_attributes":249}],240:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/font_attributes":740,"./layout_attributes":565}],556:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -100747,7 +140331,7 @@ function paste(traceAttr, cd, cdAttr, fn) { } } -},{"../../lib":342,"../../registry":452}],241:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788}],557:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -100776,7 +140360,7 @@ module.exports = function click(gd, evt, subplot) { } }; -},{"../../registry":452,"./hover":245}],242:[function(_dereq_,module,exports){ +},{"../../registry":788,"./hover":561}],558:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -100800,7 +140384,7 @@ module.exports = { HOVERID: '-hover' }; -},{}],243:[function(_dereq_,module,exports){ +},{}],559:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -100818,7 +140402,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleHoverLabelDefaults(traceIn, traceOut, coerce, opts); }; -},{"../../lib":342,"./attributes":239,"./hoverlabel_defaults":246}],244:[function(_dereq_,module,exports){ +},{"../../lib":661,"./attributes":555,"./hoverlabel_defaults":562}],560:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -101072,7 +140656,7 @@ exports.isXYhover = function(hovermode) { return !!xyHoverMode[hovermode]; }; -},{"../../lib":342}],245:[function(_dereq_,module,exports){ +},{"../../lib":661}],561:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -101966,7 +141550,7 @@ function createHoverText(hoverData, opts) { var ya = c0.ya; var axLetter = hovermode.charAt(0); var t0 = c0[axLetter + 'Label']; - var outerContainerBB = outerContainer.getBoundingClientRect(); + var outerContainerBB = getBoundingClientRect(gd, outerContainer); var outerTop = outerContainerBB.top; var outerWidth = outerContainerBB.width; var outerHeight = outerContainerBB.height; @@ -102041,7 +141625,7 @@ function createHoverText(hoverData, opts) { label.attr('transform', ''); - var tbb = ltext.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, ltext.node()); var lx, ly; if(hovermode === 'x') { @@ -102134,7 +141718,7 @@ function createHoverText(hoverData, opts) { var dummy = Drawing.tester.append('text') .text(s.text()) .call(Drawing.font, commonLabelFont); - var dummyBB = dummy.node().getBoundingClientRect(); + var dummyBB = getBoundingClientRect(gd, dummy.node()); if(Math.round(dummyBB.width) < Math.round(tbb.width)) { s.attr('x', ltx - dummyBB.width); } @@ -102223,7 +141807,7 @@ function createHoverText(hoverData, opts) { // Position the hover var legendContainer = container.select('g.legend'); - var tbb = legendContainer.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, legendContainer.node()); var tWidth = tbb.width + 2 * HOVERTEXTPAD; var tHeight = tbb.height + 2 * HOVERTEXTPAD; var winningPoint = hoverData[0]; @@ -102388,7 +141972,7 @@ function createHoverText(hoverData, opts) { .call(svgTextUtils.positionText, 0, 0) .call(svgTextUtils.convertToTspans, gd); - var t2bb = tx2.node().getBoundingClientRect(); + var t2bb = getBoundingClientRect(gd, tx2.node()); tx2width = t2bb.width + 2 * HOVERTEXTPAD; tx2height = t2bb.height + 2 * HOVERTEXTPAD; } else { @@ -102401,22 +141985,26 @@ function createHoverText(hoverData, opts) { stroke: contrastColor }); - var tbb = tx.node().getBoundingClientRect(); var htx = d.xa._offset + (d.x0 + d.x1) / 2; var hty = d.ya._offset + (d.y0 + d.y1) / 2; var dx = Math.abs(d.x1 - d.x0); var dy = Math.abs(d.y1 - d.y0); - var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width; - var anchorStartOK, anchorEndOK; - d.ty0 = outerTop - tbb.top; - d.bx = tbb.width + 2 * HOVERTEXTPAD; - d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height); + var tbb = getBoundingClientRect(gd, tx.node()); + var tbbWidth = tbb.width / fullLayout._invScaleX; + var tbbHeight = tbb.height / fullLayout._invScaleY; + + d.ty0 = (outerTop - tbb.top) / fullLayout._invScaleY; + d.bx = tbbWidth + 2 * HOVERTEXTPAD; + d.by = Math.max(tbbHeight + 2 * HOVERTEXTPAD, tx2height); d.anchor = 'start'; - d.txwidth = tbb.width; + d.txwidth = tbbWidth; d.tx2width = tx2width; d.offset = 0; + var txTotalWidth = (tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width) * fullLayout._invScaleX; + var anchorStartOK, anchorEndOK; + if(rotateLabels) { d.pos = htx; anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight; @@ -103176,7 +142764,37 @@ function getCoord(axLetter, winningPoint, fullLayout) { function getTopOffset(gd) { return gd.offsetTop + gd.clientTop; } function getLeftOffset(gd) { return gd.offsetLeft + gd.clientLeft; } -},{"../../lib":342,"../../lib/events":332,"../../lib/override_cursor":353,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"../legend/defaults":260,"../legend/draw":261,"./constants":242,"./helpers":244,"@plotly/d3":44,"fast-isnumeric":81,"tinycolor2":171}],246:[function(_dereq_,module,exports){ +function getBoundingClientRect(gd, node) { + var fullLayout = gd._fullLayout; + + var rect = node.getBoundingClientRect(); + + var x0 = rect.x; + var y0 = rect.y; + var x1 = x0 + rect.width; + var y1 = y0 + rect.height; + + var A = Lib.apply3DTransform(fullLayout._invTransform)(x0, y0); + var B = Lib.apply3DTransform(fullLayout._invTransform)(x1, y1); + + var Ax = A[0]; + var Ay = A[1]; + var Bx = B[0]; + var By = B[1]; + + return { + x: Ax, + y: Ay, + width: Bx - Ax, + height: By - Ay, + top: Math.min(Ay, By), + left: Math.min(Ax, Bx), + right: Math.max(Ax, Bx), + bottom: Math.max(Ay, By), + }; +} + +},{"../../lib":661,"../../lib/events":650,"../../lib/override_cursor":672,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"../legend/defaults":576,"../legend/draw":577,"./constants":558,"./helpers":560,"@plotly/d3":54,"fast-isnumeric":159,"tinycolor2":471}],562:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -103214,7 +142832,7 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts coerce('hoverlabel.align', opts.align); }; -},{"../../lib":342,"../color":208,"./helpers":244}],247:[function(_dereq_,module,exports){ +},{"../../lib":661,"../color":524,"./helpers":560}],563:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -103232,7 +142850,7 @@ module.exports = function handleHoverModeDefaults(layoutIn, layoutOut) { return coerce('hovermode'); }; -},{"../../lib":342,"./layout_attributes":249}],248:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":565}],564:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -103303,7 +142921,7 @@ function castHoverinfo(trace, fullLayout, ptNumber) { return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce); } -},{"../../lib":342,"../dragelement":227,"./attributes":239,"./calc":240,"./click":241,"./constants":242,"./defaults":243,"./helpers":244,"./hover":245,"./layout_attributes":249,"./layout_defaults":250,"./layout_global_defaults":251,"@plotly/d3":44}],249:[function(_dereq_,module,exports){ +},{"../../lib":661,"../dragelement":543,"./attributes":555,"./calc":556,"./click":557,"./constants":558,"./defaults":559,"./helpers":560,"./hover":561,"./layout_attributes":565,"./layout_defaults":566,"./layout_global_defaults":567,"@plotly/d3":54}],565:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -103391,7 +143009,7 @@ module.exports = { } }; -},{"../../plots/font_attributes":419,"./constants":242}],250:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":740,"./constants":558}],566:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -103430,7 +143048,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":342,"./hoverlabel_defaults":246,"./hovermode_defaults":247,"./layout_attributes":249}],251:[function(_dereq_,module,exports){ +},{"../../lib":661,"./hoverlabel_defaults":562,"./hovermode_defaults":563,"./layout_attributes":565}],567:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -103445,7 +143063,7 @@ module.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":342,"./hoverlabel_defaults":246,"./layout_attributes":249}],252:[function(_dereq_,module,exports){ +},{"../../lib":661,"./hoverlabel_defaults":562,"./layout_attributes":565}],568:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -103788,7 +143406,7 @@ module.exports = { contentDefaults: contentDefaults }; -},{"../../lib":342,"../../lib/regex":358,"../../plot_api/plot_template":379,"../../plots/cartesian/constants":397,"../../plots/domain":418}],253:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/regex":677,"../../plot_api/plot_template":700,"../../plots/cartesian/constants":718,"../../plots/domain":739}],569:[function(_dereq_,module,exports){ 'use strict'; var cartesianConstants = _dereq_('../../plots/cartesian/constants'); @@ -103890,7 +143508,7 @@ module.exports = templatedArray('image', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":314,"../../plot_api/plot_template":379,"../../plots/cartesian/constants":397}],254:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":630,"../../plot_api/plot_template":700,"../../plots/cartesian/constants":718}],570:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -103962,7 +143580,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":367,"fast-isnumeric":81}],255:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":688,"fast-isnumeric":159}],571:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -104019,7 +143637,7 @@ function imageDefaults(imageIn, imageOut, fullLayout) { return imageOut; } -},{"../../lib":342,"../../plots/array_container_defaults":385,"../../plots/cartesian/axes":390,"./attributes":253}],256:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/array_container_defaults":706,"../../plots/cartesian/axes":711,"./attributes":569}],572:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -104269,7 +143887,7 @@ module.exports = function draw(gd) { } }; -},{"../../constants/xmlns_namespaces":320,"../../plots/cartesian/axes":390,"../../plots/cartesian/axis_ids":394,"../drawing":230,"@plotly/d3":44}],257:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":638,"../../plots/cartesian/axes":711,"../../plots/cartesian/axis_ids":715,"../drawing":546,"@plotly/d3":54}],573:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -104285,7 +143903,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":403,"./attributes":253,"./convert_coords":254,"./defaults":255,"./draw":256}],258:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":724,"./attributes":569,"./convert_coords":570,"./defaults":571,"./draw":572}],574:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -104411,7 +144029,7 @@ module.exports = { editType: 'legend' }; -},{"../../plots/font_attributes":419,"../color/attributes":207}],259:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":740,"../color/attributes":523}],575:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -104427,7 +144045,7 @@ module.exports = { itemGap: 5 }; -},{}],260:[function(_dereq_,module,exports){ +},{}],576:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -104560,7 +144178,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":342,"../../plot_api/plot_template":379,"../../plots/layout_attributes":429,"../../registry":452,"./attributes":258,"./helpers":264}],261:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../plots/layout_attributes":765,"../../registry":788,"./attributes":574,"./helpers":580}],577:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -105385,7 +145003,7 @@ function getYanchor(legendObj) { 'top'; } -},{"../../constants/alignment":313,"../../lib":342,"../../lib/events":332,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"./constants":259,"./get_legend_data":262,"./handle_click":263,"./helpers":264,"./style":266,"@plotly/d3":44}],262:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../lib":661,"../../lib/events":650,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"./constants":575,"./get_legend_data":578,"./handle_click":579,"./helpers":580,"./style":582,"@plotly/d3":54}],578:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -105561,7 +145179,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../registry":452,"./helpers":264}],263:[function(_dereq_,module,exports){ +},{"../../registry":788,"./helpers":580}],579:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -105803,7 +145421,7 @@ module.exports = function handleClick(g, gd, numClicks) { } }; -},{"../../lib":342,"../../registry":452}],264:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788}],580:[function(_dereq_,module,exports){ 'use strict'; exports.isGrouped = function isGrouped(legendLayout) { @@ -105818,7 +145436,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{}],265:[function(_dereq_,module,exports){ +},{}],581:[function(_dereq_,module,exports){ 'use strict'; @@ -105833,7 +145451,7 @@ module.exports = { style: _dereq_('./style') }; -},{"./attributes":258,"./defaults":260,"./draw":261,"./style":266}],266:[function(_dereq_,module,exports){ +},{"./attributes":574,"./defaults":576,"./draw":577,"./style":582}],582:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -106520,7 +146138,7 @@ function dimAttr(v, dflt, max) { return v; } -},{"../../lib":342,"../../registry":452,"../../traces/pie/helpers":688,"../../traces/pie/style_one":694,"../../traces/scatter/subtypes":730,"../color":208,"../colorscale/helpers":219,"../drawing":230,"./constants":259,"@plotly/d3":44}],267:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"../../traces/pie/helpers":1043,"../../traces/pie/style_one":1049,"../../traces/scatter/subtypes":1089,"../color":524,"../colorscale/helpers":535,"../drawing":546,"./constants":575,"@plotly/d3":54}],583:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -106564,7 +146182,7 @@ module.exports = { } }; -},{"./constants":269}],268:[function(_dereq_,module,exports){ +},{"./constants":585}],584:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -107316,7 +146934,7 @@ function resetView(gd, subplotType) { Registry.call('_guiRelayout', gd, aObj); } -},{"../../fonts/ploticon":322,"../../lib":342,"../../plots/cartesian/axis_ids":394,"../../plots/plots":438,"../../registry":452,"../shapes/draw":292}],269:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":640,"../../lib":661,"../../plots/cartesian/axis_ids":715,"../../plots/plots":774,"../../registry":788,"../shapes/draw":608}],585:[function(_dereq_,module,exports){ 'use strict'; var modeBarButtons = _dereq_('./buttons'); @@ -107359,7 +146977,7 @@ module.exports = { foreButtons: foreButtons }; -},{"./buttons":268}],270:[function(_dereq_,module,exports){ +},{"./buttons":584}],586:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -107385,7 +147003,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('remove'); }; -},{"../../lib":342,"../../plot_api/plot_template":379,"../color":208,"./attributes":267}],271:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../color":524,"./attributes":583}],587:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -107398,7 +147016,7 @@ module.exports = { manage: _dereq_('./manage') }; -},{"./attributes":267,"./defaults":270,"./manage":272}],272:[function(_dereq_,module,exports){ +},{"./attributes":583,"./defaults":586,"./manage":588}],588:[function(_dereq_,module,exports){ 'use strict'; var axisIds = _dereq_('../../plots/cartesian/axis_ids'); @@ -107753,7 +147371,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plots/cartesian/axis_ids":394,"../../registry":452,"../../traces/scatter/subtypes":730,"../fx/helpers":244,"./buttons":268,"./constants":269,"./modebar":273}],273:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axis_ids":715,"../../registry":788,"../../traces/scatter/subtypes":1089,"../fx/helpers":560,"./buttons":584,"./constants":585,"./modebar":589}],589:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -108090,7 +147708,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../fonts/ploticon":322,"../../lib":342,"@plotly/d3":44,"fast-isnumeric":81}],274:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":640,"../../lib":661,"@plotly/d3":54,"fast-isnumeric":159}],590:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -108188,7 +147806,7 @@ module.exports = { editType: 'plot' }; -},{"../../plot_api/plot_template":379,"../../plots/font_attributes":419,"../color/attributes":207}],275:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":700,"../../plots/font_attributes":740,"../color/attributes":523}],591:[function(_dereq_,module,exports){ 'use strict'; @@ -108209,7 +147827,7 @@ module.exports = { darkAmount: 10 }; -},{}],276:[function(_dereq_,module,exports){ +},{}],592:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -108293,7 +147911,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":342,"../../plot_api/plot_template":379,"../../plots/array_container_defaults":385,"../color":208,"./attributes":274,"./constants":275}],277:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../plots/array_container_defaults":706,"../color":524,"./attributes":590,"./constants":591}],593:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -108540,7 +148158,7 @@ function reposition(gd, buttons, opts, axName, selector) { selector.attr('transform', strTranslate(lx, ly)); } -},{"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/cartesian/axis_ids":394,"../../plots/plots":438,"../../registry":452,"../color":208,"../drawing":230,"./constants":275,"./get_update_object":278,"@plotly/d3":44}],278:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/cartesian/axis_ids":715,"../../plots/plots":774,"../../registry":788,"../color":524,"../drawing":546,"./constants":591,"./get_update_object":594,"@plotly/d3":54}],594:[function(_dereq_,module,exports){ 'use strict'; var d3Time = _dereq_('d3-time'); @@ -108589,7 +148207,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"../../lib":342,"d3-time":78}],279:[function(_dereq_,module,exports){ +},{"../../lib":661,"d3-time":149}],595:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -108608,7 +148226,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":274,"./defaults":276,"./draw":277}],280:[function(_dereq_,module,exports){ +},{"./attributes":590,"./defaults":592,"./draw":593}],596:[function(_dereq_,module,exports){ 'use strict'; var colorAttributes = _dereq_('../color/attributes'); @@ -108660,7 +148278,7 @@ module.exports = { editType: 'calc' }; -},{"../color/attributes":207}],281:[function(_dereq_,module,exports){ +},{"../color/attributes":523}],597:[function(_dereq_,module,exports){ 'use strict'; var listAxes = _dereq_('../../plots/cartesian/axis_ids').list; @@ -108686,7 +148304,7 @@ module.exports = function calcAutorange(gd) { } }; -},{"../../plots/cartesian/autorange":389,"../../plots/cartesian/axis_ids":394,"./constants":282}],282:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/autorange":710,"../../plots/cartesian/axis_ids":715,"./constants":598}],598:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -108734,7 +148352,7 @@ module.exports = { extraPad: 15 }; -},{}],283:[function(_dereq_,module,exports){ +},{}],599:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -108812,7 +148430,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName) { containerOut._input = containerIn; }; -},{"../../lib":342,"../../plot_api/plot_template":379,"../../plots/cartesian/axis_ids":394,"./attributes":280,"./oppaxis_attributes":287}],284:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../plots/cartesian/axis_ids":715,"./attributes":596,"./oppaxis_attributes":603}],600:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -109448,7 +149066,7 @@ function drawGrabbers(rangeSlider, gd, axisOpts, opts) { grabAreaMax.attr('height', opts._height); } -},{"../../lib":342,"../../lib/setcursor":362,"../../plots/cartesian":404,"../../plots/cartesian/axis_ids":394,"../../plots/plots":438,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"../titles":306,"./constants":282,"@plotly/d3":44}],285:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/setcursor":681,"../../plots/cartesian":725,"../../plots/cartesian/axis_ids":715,"../../plots/plots":774,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"../titles":622,"./constants":598,"@plotly/d3":54}],601:[function(_dereq_,module,exports){ 'use strict'; var axisIDs = _dereq_('../../plots/cartesian/axis_ids'); @@ -109515,7 +149133,7 @@ exports.autoMarginOpts = function(gd, ax) { }; }; -},{"../../constants/alignment":313,"../../lib/svg_text_utils":365,"../../plots/cartesian/axis_ids":394,"./constants":282}],286:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../lib/svg_text_utils":686,"../../plots/cartesian/axis_ids":715,"./constants":598}],602:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -109546,7 +149164,7 @@ module.exports = { autoMarginOpts: helpers.autoMarginOpts }; -},{"../../lib":342,"./attributes":280,"./calc_autorange":281,"./defaults":283,"./draw":284,"./helpers":285,"./oppaxis_attributes":287}],287:[function(_dereq_,module,exports){ +},{"../../lib":661,"./attributes":596,"./calc_autorange":597,"./defaults":599,"./draw":600,"./helpers":601,"./oppaxis_attributes":603}],603:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -109572,7 +149190,7 @@ module.exports = { editType: 'calc' }; -},{}],288:[function(_dereq_,module,exports){ +},{}],604:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -109682,7 +149300,7 @@ module.exports = templatedArray('shape', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":314,"../../lib/extend":333,"../../plot_api/plot_template":379,"../../traces/scatter/attributes":705,"../annotations/attributes":191,"../drawing/attributes":229}],289:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":630,"../../lib/extend":651,"../../plot_api/plot_template":700,"../../traces/scatter/attributes":1064,"../annotations/attributes":507,"../drawing/attributes":545}],605:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -109794,7 +149412,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":342,"../../plots/cartesian/axes":390,"./constants":290,"./helpers":299}],290:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"./constants":606,"./helpers":615}],606:[function(_dereq_,module,exports){ 'use strict'; @@ -109849,7 +149467,7 @@ module.exports = { } }; -},{}],291:[function(_dereq_,module,exports){ +},{}],607:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -109971,7 +149589,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) { } } -},{"../../lib":342,"../../plots/array_container_defaults":385,"../../plots/cartesian/axes":390,"./attributes":288,"./helpers":299}],292:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/array_container_defaults":706,"../../plots/cartesian/axes":711,"./attributes":604,"./helpers":615}],608:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -110736,7 +150354,7 @@ function eraseActiveShape(gd) { } } -},{"../../lib":342,"../../lib/setcursor":362,"../../plot_api/plot_template":379,"../../plots/cartesian/axes":390,"../../plots/cartesian/handle_outline":401,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"./constants":290,"./draw_newshape/display_outlines":296,"./draw_newshape/helpers":297,"./helpers":299}],293:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/setcursor":681,"../../plot_api/plot_template":700,"../../plots/cartesian/axes":711,"../../plots/cartesian/handle_outline":722,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"./constants":606,"./draw_newshape/display_outlines":612,"./draw_newshape/helpers":613,"./helpers":615}],609:[function(_dereq_,module,exports){ 'use strict'; var dash = _dereq_('../../drawing/attributes').dash; @@ -110812,7 +150430,7 @@ module.exports = { } }; -},{"../../../lib/extend":333,"../../drawing/attributes":229}],294:[function(_dereq_,module,exports){ +},{"../../../lib/extend":651,"../../drawing/attributes":545}],610:[function(_dereq_,module,exports){ 'use strict'; var CIRCLE_SIDES = 32; // should be divisible by 4 @@ -110828,7 +150446,7 @@ module.exports = { SQRT2: Math.sqrt(2) }; -},{}],295:[function(_dereq_,module,exports){ +},{}],611:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../color'); @@ -110851,7 +150469,7 @@ module.exports = function supplyDrawNewShapeDefaults(layoutIn, layoutOut, coerce coerce('activeshape.opacity'); }; -},{"../../color":208}],296:[function(_dereq_,module,exports){ +},{"../../color":524}],612:[function(_dereq_,module,exports){ 'use strict'; var dragElement = _dereq_('../../dragelement'); @@ -111137,7 +150755,7 @@ function recordPositions(polygonsOut, polygonsIn) { return polygonsOut; } -},{"../../../plots/cartesian/handle_outline":401,"../../../registry":452,"../../dragelement":227,"../../dragelement/helpers":226,"./constants":294,"./helpers":297,"./newshapes":298}],297:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":722,"../../../registry":788,"../../dragelement":543,"../../dragelement/helpers":542,"./constants":610,"./helpers":613,"./newshapes":614}],613:[function(_dereq_,module,exports){ 'use strict'; var parseSvgPath = _dereq_('parse-svg-path'); @@ -111466,7 +151084,7 @@ exports.ellipseOver = function(pos) { }; }; -},{"../../../plots/cartesian/helpers":402,"./constants":294,"parse-svg-path":123}],298:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/helpers":723,"./constants":610,"parse-svg-path":383}],614:[function(_dereq_,module,exports){ 'use strict'; var dragHelpers = _dereq_('../../dragelement/helpers'); @@ -111716,7 +151334,7 @@ function fixDatesForPaths(polygons, xaxis, yaxis) { return polygons; } -},{"../../../plots/cartesian/handle_outline":401,"../../../plots/cartesian/helpers":402,"../../dragelement/helpers":226,"./constants":294,"./helpers":297}],299:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":722,"../../../plots/cartesian/helpers":723,"../../dragelement/helpers":542,"./constants":610,"./helpers":613}],615:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -111865,7 +151483,7 @@ exports.makeOptionsAndPlotinfo = function(gd, index) { }; }; -},{"../../lib":342,"./constants":290}],300:[function(_dereq_,module,exports){ +},{"../../lib":661,"./constants":606}],616:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -111884,7 +151502,7 @@ module.exports = { drawOne: drawModule.drawOne }; -},{"../../plots/cartesian/include_components":403,"./attributes":288,"./calc_autorange":289,"./defaults":291,"./draw":292,"./draw_newshape/defaults":295}],301:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":724,"./attributes":604,"./calc_autorange":605,"./defaults":607,"./draw":608,"./draw_newshape/defaults":611}],617:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -112058,7 +151676,7 @@ module.exports = overrideAll(templatedArray('slider', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../plots/animation_attributes":384,"../../plots/font_attributes":419,"../../plots/pad_attributes":437,"./constants":302}],302:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../plots/animation_attributes":705,"../../plots/font_attributes":740,"../../plots/pad_attributes":773,"./constants":618}],618:[function(_dereq_,module,exports){ 'use strict'; @@ -112143,7 +151761,7 @@ module.exports = { currentValueInset: 0, }; -},{}],303:[function(_dereq_,module,exports){ +},{}],619:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -112250,7 +151868,7 @@ function stepDefaults(valueIn, valueOut) { } } -},{"../../lib":342,"../../plots/array_container_defaults":385,"./attributes":301,"./constants":302}],304:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/array_container_defaults":706,"./attributes":617,"./constants":618}],620:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -112884,7 +152502,7 @@ function drawRail(sliderGroup, sliderOpts) { ); } -},{"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"../../plot_api/plot_template":379,"../../plots/plots":438,"../color":208,"../drawing":230,"./constants":302,"@plotly/d3":44}],305:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"../../plot_api/plot_template":700,"../../plots/plots":774,"../color":524,"../drawing":546,"./constants":618,"@plotly/d3":54}],621:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -112899,7 +152517,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":301,"./constants":302,"./defaults":303,"./draw":304}],306:[function(_dereq_,module,exports){ +},{"./attributes":617,"./constants":618,"./defaults":619,"./draw":620}],622:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -113158,7 +152776,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":313,"../../constants/interactions":318,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../../registry":452,"../color":208,"../drawing":230,"@plotly/d3":44,"fast-isnumeric":81}],307:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../constants/interactions":636,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../../registry":788,"../color":524,"../drawing":546,"@plotly/d3":54,"fast-isnumeric":159}],623:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -113281,7 +152899,7 @@ module.exports = overrideAll(templatedArray('updatemenu', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../plots/font_attributes":419,"../../plots/pad_attributes":437,"../color/attributes":207}],308:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../plots/font_attributes":740,"../../plots/pad_attributes":773,"../color/attributes":523}],624:[function(_dereq_,module,exports){ 'use strict'; @@ -113353,7 +152971,7 @@ module.exports = { } }; -},{}],309:[function(_dereq_,module,exports){ +},{}],625:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -113428,7 +153046,7 @@ function buttonDefaults(buttonIn, buttonOut) { } } -},{"../../lib":342,"../../plots/array_container_defaults":385,"./attributes":307,"./constants":308}],310:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/array_container_defaults":706,"./attributes":623,"./constants":624}],626:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -114070,9 +153688,9 @@ function removeAllButtons(gButton, newMenuIndexAttr) { .selectAll('g.' + constants.dropdownButtonClassName).remove(); } -},{"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"../../plot_api/plot_template":379,"../../plots/plots":438,"../color":208,"../drawing":230,"./constants":308,"./scrollbox":312,"@plotly/d3":44}],311:[function(_dereq_,module,exports){ -arguments[4][305][0].apply(exports,arguments) -},{"./attributes":307,"./constants":308,"./defaults":309,"./draw":310,"dup":305}],312:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"../../plot_api/plot_template":700,"../../plots/plots":774,"../color":524,"../drawing":546,"./constants":624,"./scrollbox":628,"@plotly/d3":54}],627:[function(_dereq_,module,exports){ +arguments[4][621][0].apply(exports,arguments) +},{"./attributes":623,"./constants":624,"./defaults":625,"./draw":626,"dup":621}],628:[function(_dereq_,module,exports){ 'use strict'; module.exports = ScrollBox; @@ -114529,7 +154147,7 @@ ScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) } }; -},{"../../lib":342,"../color":208,"../drawing":230,"@plotly/d3":44}],313:[function(_dereq_,module,exports){ +},{"../../lib":661,"../color":524,"../drawing":546,"@plotly/d3":54}],629:[function(_dereq_,module,exports){ 'use strict'; // fraction of some size to get to a named position @@ -114586,7 +154204,7 @@ module.exports = { } }; -},{}],314:[function(_dereq_,module,exports){ +},{}],630:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -114609,7 +154227,7 @@ module.exports = { } }; -},{}],315:[function(_dereq_,module,exports){ +},{}],631:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -114623,7 +154241,7 @@ module.exports = { } }; -},{}],316:[function(_dereq_,module,exports){ +},{}],632:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -114631,7 +154249,7 @@ module.exports = { DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format' }; -},{}],317:[function(_dereq_,module,exports){ +},{}],633:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -114661,7 +154279,33 @@ module.exports = { } }; -},{}],318:[function(_dereq_,module,exports){ +},{}],634:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + solid: [[], 0], + dot: [[0.5, 1], 200], + dash: [[0.5, 1], 50], + longdash: [[0.5, 1], 10], + dashdot: [[0.5, 0.625, 0.875, 1], 50], + longdashdot: [[0.5, 0.7, 0.8, 1], 10] +}; + +},{}],635:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + circle: '●', + 'circle-open': '○', + square: '■', + 'square-open': '□', + diamond: '◆', + 'diamond-open': '◇', + cross: '+', + x: '❌' +}; + +},{}],636:[function(_dereq_,module,exports){ 'use strict'; @@ -114676,7 +154320,7 @@ module.exports = { DESELECTDIM: 0.2 }; -},{}],319:[function(_dereq_,module,exports){ +},{}],637:[function(_dereq_,module,exports){ 'use strict'; @@ -114741,7 +154385,7 @@ module.exports = { MINUS_SIGN: '\u2212' }; -},{}],320:[function(_dereq_,module,exports){ +},{}],638:[function(_dereq_,module,exports){ 'use strict'; @@ -114756,7 +154400,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],321:[function(_dereq_,module,exports){ +},{}],639:[function(_dereq_,module,exports){ 'use strict'; exports.version = _dereq_('./version').version; @@ -114840,7 +154484,7 @@ exports.Fx = { exports.Snapshot = _dereq_('./snapshot'); exports.PlotSchema = _dereq_('./plot_api/plot_schema'); -},{"../build/plotcss":1,"./components/annotations":199,"./components/annotations3d":204,"./components/colorbar":214,"./components/colorscale":220,"./components/errorbars":236,"./components/fx":248,"./components/grid":252,"./components/images":257,"./components/legend":265,"./components/modebar":271,"./components/rangeselector":279,"./components/rangeslider":286,"./components/shapes":300,"./components/sliders":305,"./components/updatemenus":311,"./fonts/ploticon":322,"./locale-en":370,"./locale-en-us":369,"./plot_api":374,"./plot_api/plot_schema":378,"./plots/plots":438,"./registry":452,"./snapshot":457,"./traces/scatter":717,"./version":840,"native-promise-only":121}],322:[function(_dereq_,module,exports){ +},{"../build/plotcss":1,"./components/annotations":515,"./components/annotations3d":520,"./components/colorbar":530,"./components/colorscale":536,"./components/errorbars":552,"./components/fx":564,"./components/grid":568,"./components/images":573,"./components/legend":581,"./components/modebar":587,"./components/rangeselector":595,"./components/rangeslider":602,"./components/shapes":616,"./components/sliders":621,"./components/updatemenus":627,"./fonts/ploticon":640,"./locale-en":691,"./locale-en-us":690,"./plot_api":695,"./plot_api/plot_schema":699,"./plots/plots":774,"./registry":788,"./snapshot":793,"./traces/scatter":1076,"./version":1219,"native-promise-only":367}],640:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -115012,7 +154656,7 @@ module.exports = { } }; -},{}],323:[function(_dereq_,module,exports){ +},{}],641:[function(_dereq_,module,exports){ 'use strict'; @@ -115067,7 +154711,7 @@ exports.isBottomAnchor = function isBottomAnchor(opts) { ); }; -},{}],324:[function(_dereq_,module,exports){ +},{}],642:[function(_dereq_,module,exports){ 'use strict'; var modModule = _dereq_('./mod'); @@ -115300,7 +154944,7 @@ module.exports = { pathAnnulus: pathAnnulus }; -},{"./mod":349}],325:[function(_dereq_,module,exports){ +},{"./mod":668}],643:[function(_dereq_,module,exports){ 'use strict'; var isArray = Array.isArray; @@ -115442,7 +155086,7 @@ function _rowLength(z, fn, len0) { return 0; } -},{}],326:[function(_dereq_,module,exports){ +},{}],644:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -115466,7 +155110,7 @@ module.exports = function cleanNumber(v) { return BADNUM; }; -},{"../constants/numerical":319,"fast-isnumeric":81}],327:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"fast-isnumeric":159}],645:[function(_dereq_,module,exports){ 'use strict'; /** @@ -115486,7 +155130,7 @@ module.exports = function clearGlCanvases(gd) { } }; -},{}],328:[function(_dereq_,module,exports){ +},{}],646:[function(_dereq_,module,exports){ 'use strict'; /** @@ -115501,7 +155145,7 @@ module.exports = function clearResponsive(gd) { } }; -},{}],329:[function(_dereq_,module,exports){ +},{}],647:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -115946,7 +155590,7 @@ function validate(value, opts) { } exports.validate = validate; -},{"../components/color":208,"../components/colorscale/scales":223,"../constants/interactions":318,"../plots/attributes":386,"./array":325,"./mod":349,"./nested_property":350,"./regex":358,"fast-isnumeric":81,"tinycolor2":171}],330:[function(_dereq_,module,exports){ +},{"../components/color":524,"../components/colorscale/scales":539,"../constants/interactions":636,"../plots/attributes":707,"./array":643,"./mod":668,"./nested_property":669,"./regex":677,"fast-isnumeric":159,"tinycolor2":471}],648:[function(_dereq_,module,exports){ 'use strict'; var timeFormat = _dereq_('d3-time-format').timeFormat; @@ -116550,7 +156194,7 @@ exports.findExactDates = function(data, calendar) { }; }; -},{"../constants/numerical":319,"../registry":452,"./loggers":346,"./mod":349,"d3-time-format":76,"fast-isnumeric":81}],331:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"../registry":788,"./loggers":665,"./mod":668,"d3-time-format":147,"fast-isnumeric":159}],649:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -116720,7 +156364,7 @@ module.exports = { equalDomRects: equalDomRects }; -},{"./loggers":346,"./matrix":348,"@plotly/d3":44,"gl-mat4":97}],332:[function(_dereq_,module,exports){ +},{"./loggers":665,"./matrix":667,"@plotly/d3":54,"gl-mat4":202}],650:[function(_dereq_,module,exports){ 'use strict'; /* global jQuery:false */ @@ -116884,7 +156528,7 @@ var Events = { module.exports = Events; -},{"events":60}],333:[function(_dereq_,module,exports){ +},{"events":104}],651:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('./is_plain_object.js'); @@ -116989,7 +156633,7 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { return target; } -},{"./is_plain_object.js":343}],334:[function(_dereq_,module,exports){ +},{"./is_plain_object.js":662}],652:[function(_dereq_,module,exports){ 'use strict'; @@ -117031,7 +156675,7 @@ module.exports = function filterUnique(array) { return out; }; -},{}],335:[function(_dereq_,module,exports){ +},{}],653:[function(_dereq_,module,exports){ 'use strict'; /** Filter out object items with visible !== true @@ -117071,7 +156715,7 @@ function isCalcData(cont) { ); } -},{}],336:[function(_dereq_,module,exports){ +},{}],654:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -117448,7 +157092,7 @@ module.exports = { computeBbox: computeBbox }; -},{"./identity":340,"./is_plain_object":343,"./loggers":346,"./nested_property":350,"./polygon":354,"@plotly/d3":44,"@turf/area":45,"@turf/bbox":48,"@turf/centroid":51,"country-regex":62}],337:[function(_dereq_,module,exports){ +},{"./identity":659,"./is_plain_object":662,"./loggers":665,"./nested_property":669,"./polygon":673,"@plotly/d3":54,"@turf/area":55,"@turf/bbox":58,"@turf/centroid":61,"country-regex":132}],655:[function(_dereq_,module,exports){ 'use strict'; var BADNUM = _dereq_('../constants/numerical').BADNUM; @@ -117556,7 +157200,7 @@ exports.makeBlank = function() { }; }; -},{"../constants/numerical":319}],338:[function(_dereq_,module,exports){ +},{"../constants/numerical":637}],656:[function(_dereq_,module,exports){ 'use strict'; var mod = _dereq_('./mod').mod; @@ -117792,7 +157436,100 @@ exports.findPointOnPath = function findPointOnPath(path, val, coord, opts) { return pt; }; -},{"./mod":349}],339:[function(_dereq_,module,exports){ +},{"./mod":668}],657:[function(_dereq_,module,exports){ +'use strict'; + +var isNumeric = _dereq_('fast-isnumeric'); +var tinycolor = _dereq_('tinycolor2'); +var rgba = _dereq_('color-normalize'); + +var Colorscale = _dereq_('../components/colorscale'); +var colorDflt = _dereq_('../components/color/attributes').defaultLine; +var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; + +var colorDfltRgba = rgba(colorDflt); +var opacityDflt = 1; + +function calculateColor(colorIn, opacityIn) { + var colorOut = colorIn; + colorOut[3] *= opacityIn; + return colorOut; +} + +function validateColor(colorIn) { + if(isNumeric(colorIn)) return colorDfltRgba; + + var colorOut = rgba(colorIn); + + return colorOut.length ? colorOut : colorDfltRgba; +} + +function validateOpacity(opacityIn) { + return isNumeric(opacityIn) ? opacityIn : opacityDflt; +} + +function formatColor(containerIn, opacityIn, len) { + var colorIn = containerIn.color; + var isArrayColorIn = isArrayOrTypedArray(colorIn); + var isArrayOpacityIn = isArrayOrTypedArray(opacityIn); + var cOpts = Colorscale.extractOpts(containerIn); + var colorOut = []; + + var sclFunc, getColor, getOpacity, colori, opacityi; + + if(cOpts.colorscale !== undefined) { + sclFunc = Colorscale.makeColorScaleFuncFromTrace(containerIn); + } else { + sclFunc = validateColor; + } + + if(isArrayColorIn) { + getColor = function(c, i) { + // FIXME: there is double work, considering that sclFunc does the opposite + return c[i] === undefined ? colorDfltRgba : rgba(sclFunc(c[i])); + }; + } else getColor = validateColor; + + if(isArrayOpacityIn) { + getOpacity = function(o, i) { + return o[i] === undefined ? opacityDflt : validateOpacity(o[i]); + }; + } else getOpacity = validateOpacity; + + if(isArrayColorIn || isArrayOpacityIn) { + for(var i = 0; i < len; i++) { + colori = getColor(colorIn, i); + opacityi = getOpacity(opacityIn, i); + colorOut[i] = calculateColor(colori, opacityi); + } + } else colorOut = calculateColor(rgba(colorIn), opacityIn); + + return colorOut; +} + +function parseColorScale(cont) { + var cOpts = Colorscale.extractOpts(cont); + + var colorscale = cOpts.colorscale; + if(cOpts.reversescale) colorscale = Colorscale.flipScale(cOpts.colorscale); + + return colorscale.map(function(elem) { + var index = elem[0]; + var color = tinycolor(elem[1]); + var rgb = color.toRgb(); + return { + index: index, + rgb: [rgb.r, rgb.g, rgb.b, rgb.a] + }; + }); +} + +module.exports = { + formatColor: formatColor, + parseColorScale: parseColorScale +}; + +},{"../components/color/attributes":523,"../components/colorscale":536,"./array":643,"color-normalize":118,"fast-isnumeric":159,"tinycolor2":471}],658:[function(_dereq_,module,exports){ 'use strict'; var identity = _dereq_('./identity'); @@ -117820,7 +157557,7 @@ module.exports = { unwrap: function(d) {return d[0];} }; -},{"./identity":340}],340:[function(_dereq_,module,exports){ +},{"./identity":659}],659:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -117828,7 +157565,7 @@ module.exports = { module.exports = function identity(d) { return d; }; -},{}],341:[function(_dereq_,module,exports){ +},{}],660:[function(_dereq_,module,exports){ 'use strict'; module.exports = function incrementNumeric(x, delta) { @@ -117861,7 +157598,7 @@ module.exports = function incrementNumeric(x, delta) { return newX; }; -},{}],342:[function(_dereq_,module,exports){ +},{}],661:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -119249,7 +158986,7 @@ lib.getPositionFromD3Event = function() { } }; -},{"../constants/numerical":319,"./anchor_utils":323,"./angles":324,"./array":325,"./clean_number":326,"./clear_responsive":328,"./coerce":329,"./dates":330,"./dom":331,"./extend":333,"./filter_unique":334,"./filter_visible":335,"./geometry2d":338,"./identity":340,"./increment":341,"./is_plain_object":343,"./keyed_container":344,"./localize":345,"./loggers":346,"./make_trace_groups":347,"./matrix":348,"./mod":349,"./nested_property":350,"./noop":351,"./notifier":352,"./preserve_drawing_buffer":355,"./push_unique":356,"./regex":358,"./relative_attr":359,"./relink_private":360,"./search":361,"./sort_object_keys":363,"./stats":364,"./throttle":366,"./to_log_range":367,"@plotly/d3":44,"d3-format":68,"d3-time-format":76,"fast-isnumeric":81}],343:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"./anchor_utils":641,"./angles":642,"./array":643,"./clean_number":644,"./clear_responsive":646,"./coerce":647,"./dates":648,"./dom":649,"./extend":651,"./filter_unique":652,"./filter_visible":653,"./geometry2d":656,"./identity":659,"./increment":660,"./is_plain_object":662,"./keyed_container":663,"./localize":664,"./loggers":665,"./make_trace_groups":666,"./matrix":667,"./mod":668,"./nested_property":669,"./noop":670,"./notifier":671,"./preserve_drawing_buffer":674,"./push_unique":675,"./regex":677,"./relative_attr":678,"./relink_private":679,"./search":680,"./sort_object_keys":683,"./stats":684,"./throttle":687,"./to_log_range":688,"@plotly/d3":54,"d3-format":139,"d3-time-format":147,"fast-isnumeric":159}],662:[function(_dereq_,module,exports){ 'use strict'; // more info: http://stackoverflow.com/questions/18531624/isplainobject-thing @@ -119268,7 +159005,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],344:[function(_dereq_,module,exports){ +},{}],663:[function(_dereq_,module,exports){ 'use strict'; var nestedProperty = _dereq_('./nested_property'); @@ -119453,7 +159190,7 @@ module.exports = function keyedContainer(baseObj, path, keyName, valueName) { return obj; }; -},{"./nested_property":350}],345:[function(_dereq_,module,exports){ +},{"./nested_property":669}],664:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -119500,7 +159237,7 @@ module.exports = function localize(gd, s) { return s; }; -},{"../registry":452}],346:[function(_dereq_,module,exports){ +},{"../registry":788}],665:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-console */ @@ -119577,7 +159314,7 @@ loggers.error = function() { } }; -},{"../plot_api/plot_config":377,"./notifier":352}],347:[function(_dereq_,module,exports){ +},{"../plot_api/plot_config":698,"./notifier":671}],666:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -119612,7 +159349,7 @@ module.exports = function makeTraceGroups(traceLayer, cdModule, cls) { return traces; }; -},{"@plotly/d3":44}],348:[function(_dereq_,module,exports){ +},{"@plotly/d3":54}],667:[function(_dereq_,module,exports){ 'use strict'; var mat4X4 = _dereq_('gl-mat4'); @@ -119755,7 +159492,7 @@ exports.inverseTransformMatrix = function(m) { ]; }; -},{"gl-mat4":97}],349:[function(_dereq_,module,exports){ +},{"gl-mat4":202}],668:[function(_dereq_,module,exports){ 'use strict'; /** @@ -119782,7 +159519,7 @@ module.exports = { modHalf: modHalf }; -},{}],350:[function(_dereq_,module,exports){ +},{}],669:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -120019,7 +159756,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"./array":325,"fast-isnumeric":81}],351:[function(_dereq_,module,exports){ +},{"./array":643,"fast-isnumeric":159}],670:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -120027,7 +159764,7 @@ function badContainer(container, propStr, propParts) { module.exports = function noop() {}; -},{}],352:[function(_dereq_,module,exports){ +},{}],671:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -120106,7 +159843,7 @@ module.exports = function(text, displayLength) { }); }; -},{"@plotly/d3":44,"fast-isnumeric":81}],353:[function(_dereq_,module,exports){ +},{"@plotly/d3":54,"fast-isnumeric":159}],672:[function(_dereq_,module,exports){ 'use strict'; var setCursor = _dereq_('./setcursor'); @@ -120145,7 +159882,7 @@ module.exports = function overrideCursor(el3, csr) { } }; -},{"./setcursor":362}],354:[function(_dereq_,module,exports){ +},{"./setcursor":681}],673:[function(_dereq_,module,exports){ 'use strict'; var dot = _dereq_('./matrix').dot; @@ -120388,7 +160125,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"../constants/numerical":319,"./matrix":348}],355:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"./matrix":667}],674:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -120450,7 +160187,7 @@ function getUserAgent() { return ua; } -},{"fast-isnumeric":81,"is-mobile":117}],356:[function(_dereq_,module,exports){ +},{"fast-isnumeric":159,"is-mobile":352}],675:[function(_dereq_,module,exports){ 'use strict'; /** @@ -120480,7 +160217,7 @@ module.exports = function pushUnique(array, item) { return array; }; -},{}],357:[function(_dereq_,module,exports){ +},{}],676:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -120672,7 +160409,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../lib":342,"../plot_api/plot_config":377}],358:[function(_dereq_,module,exports){ +},{"../lib":661,"../plot_api/plot_config":698}],677:[function(_dereq_,module,exports){ 'use strict'; /* @@ -120694,7 +160431,7 @@ exports.counter = function(head, tail, openEnded, matchBeginning) { return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail); }; -},{}],359:[function(_dereq_,module,exports){ +},{}],678:[function(_dereq_,module,exports){ 'use strict'; // ASCEND: chop off the last nesting level - either [] or . - to ascend @@ -120738,7 +160475,7 @@ module.exports = function(baseAttr, relativeAttr) { return baseAttr + relativeAttr; }; -},{}],360:[function(_dereq_,module,exports){ +},{}],679:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; @@ -120786,7 +160523,7 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { } }; -},{"./array":325,"./is_plain_object":343}],361:[function(_dereq_,module,exports){ +},{"./array":643,"./is_plain_object":662}],680:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -120978,7 +160715,7 @@ exports.findIndexOfMin = function(arr, fn) { return ind; }; -},{"../constants/numerical":319,"./identity":340,"./loggers":346,"fast-isnumeric":81}],362:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"./identity":659,"./loggers":665,"fast-isnumeric":159}],681:[function(_dereq_,module,exports){ 'use strict'; // works with our CSS cursor classes (see css/_cursor.scss) @@ -120992,14 +160729,69 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],363:[function(_dereq_,module,exports){ +},{}],682:[function(_dereq_,module,exports){ +'use strict'; + +var Color = _dereq_('../components/color'); + +var noop = function() {}; + + +/** + * Prints a no webgl error message into the scene container + * @param {scene instance} scene + * + * Expects 'scene' to have property 'container' + * + */ +module.exports = function showNoWebGlMsg(scene) { + for(var prop in scene) { + if(typeof scene[prop] === 'function') scene[prop] = noop; + } + + scene.destroy = function() { + scene.container.parentNode.removeChild(scene.container); + }; + + var div = document.createElement('div'); + div.className = 'no-webgl'; + div.style.cursor = 'pointer'; + div.style.fontSize = '24px'; + div.style.color = Color.defaults[0]; + div.style.position = 'absolute'; + div.style.left = div.style.top = '0px'; + div.style.width = div.style.height = '100%'; + div.style['background-color'] = Color.lightLine; + div.style['z-index'] = 30; + + var p = document.createElement('p'); + p.textContent = 'WebGL is not supported by your browser - visit https://get.webgl.org for more info'; + p.style.position = 'relative'; + p.style.top = '50%'; + p.style.left = '50%'; + p.style.height = '30%'; + p.style.width = '50%'; + p.style.margin = '-15% 0 0 -25%'; + + div.appendChild(p); + scene.container.appendChild(div); + scene.container.style.background = '#FFFFFF'; + scene.container.onclick = function() { + window.open('https://get.webgl.org'); + }; + + // return before setting up camera and onrender methods + return false; +}; + +},{"../components/color":524}],683:[function(_dereq_,module,exports){ 'use strict'; module.exports = function sortObjectKeys(obj) { return Object.keys(obj).sort(); }; -},{}],364:[function(_dereq_,module,exports){ +},{}],684:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -121100,7 +160892,19 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"./array":325,"fast-isnumeric":81}],365:[function(_dereq_,module,exports){ +},{"./array":643,"fast-isnumeric":159}],685:[function(_dereq_,module,exports){ +'use strict'; + +var rgba = _dereq_('color-normalize'); + +function str2RgbaArray(color) { + if(!color) return [0, 0, 0, 1]; + return rgba(color); +} + +module.exports = str2RgbaArray; + +},{"color-normalize":118}],686:[function(_dereq_,module,exports){ 'use strict'; /* global MathJax:false */ @@ -122009,7 +161813,7 @@ exports.makeEditable = function(context, options) { return d3.rebind(context, dispatch, 'on'); }; -},{"../constants/alignment":313,"../constants/xmlns_namespaces":320,"../lib":342,"@plotly/d3":44}],366:[function(_dereq_,module,exports){ +},{"../constants/alignment":629,"../constants/xmlns_namespaces":638,"../lib":661,"@plotly/d3":54}],687:[function(_dereq_,module,exports){ 'use strict'; var timerCache = {}; @@ -122104,7 +161908,7 @@ function _clearTimeout(cache) { } } -},{}],367:[function(_dereq_,module,exports){ +},{}],688:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -122124,7 +161928,7 @@ module.exports = function toLogRange(val, range) { return newVal; }; -},{"fast-isnumeric":81}],368:[function(_dereq_,module,exports){ +},{"fast-isnumeric":159}],689:[function(_dereq_,module,exports){ 'use strict'; var topojsonUtils = module.exports = {}; @@ -122150,7 +161954,7 @@ topojsonUtils.getTopojsonFeatures = function(trace, topojson) { return topojsonFeature(topojson, obj).features; }; -},{"../plots/geo/constants":421,"topojson-client":172}],369:[function(_dereq_,module,exports){ +},{"../plots/geo/constants":742,"topojson-client":473}],690:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -122164,7 +161968,7 @@ module.exports = { } }; -},{}],370:[function(_dereq_,module,exports){ +},{}],691:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -122199,7 +162003,7 @@ module.exports = { } }; -},{}],371:[function(_dereq_,module,exports){ +},{}],692:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -122248,7 +162052,7 @@ module.exports = function containerArrayMatch(astr) { return {array: arrayStr, index: Number(match[1]), property: match[3] || ''}; }; -},{"../registry":452}],372:[function(_dereq_,module,exports){ +},{"../registry":788}],693:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -122363,7 +162167,7 @@ function overrideOne(attr, editTypeOverride, overrideContainers, key) { } } -},{"../lib":342}],373:[function(_dereq_,module,exports){ +},{"../lib":661}],694:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -123057,7 +162861,7 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) { } }; -},{"../components/color":208,"../lib":342,"../plots/cartesian/axis_ids":394,"../plots/plots":438,"../registry":452,"fast-isnumeric":81,"gl-mat4/fromQuat":87}],374:[function(_dereq_,module,exports){ +},{"../components/color":524,"../lib":661,"../plots/cartesian/axis_ids":715,"../plots/plots":774,"../registry":788,"fast-isnumeric":159,"gl-mat4/fromQuat":192}],695:[function(_dereq_,module,exports){ 'use strict'; var main = _dereq_('./plot_api'); @@ -123092,7 +162896,7 @@ var templateApi = _dereq_('./template_api'); exports.makeTemplate = templateApi.makeTemplate; exports.validateTemplate = templateApi.validateTemplate; -},{"../snapshot/download":454,"./plot_api":376,"./template_api":381,"./to_image":382,"./validate":383}],375:[function(_dereq_,module,exports){ +},{"../snapshot/download":790,"./plot_api":697,"./template_api":702,"./to_image":703,"./validate":704}],696:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('../lib/is_plain_object'); @@ -123296,7 +163100,7 @@ exports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, return true; }; -},{"../lib/is_plain_object":343,"../lib/loggers":346,"../lib/noop":351,"../lib/search":361,"../registry":452,"./container_array_match":371}],376:[function(_dereq_,module,exports){ +},{"../lib/is_plain_object":662,"../lib/loggers":665,"../lib/noop":670,"../lib/search":680,"../registry":788,"./container_array_match":692}],697:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -127110,7 +166914,7 @@ exports._guiUpdate = guiEdit(update); exports._storeDirectGUIEdit = _storeDirectGUIEdit; -},{"../components/color":208,"../components/drawing":230,"../constants/xmlns_namespaces":320,"../lib":342,"../lib/events":332,"../lib/queue":357,"../plots/cartesian/axes":390,"../plots/cartesian/constants":397,"../plots/cartesian/graph_interact":400,"../plots/cartesian/select":410,"../plots/plots":438,"../registry":452,"./edit_types":372,"./helpers":373,"./manage_arrays":375,"./plot_config":377,"./plot_schema":378,"./subroutines":380,"@plotly/d3":44,"fast-isnumeric":81,"has-hover":112}],377:[function(_dereq_,module,exports){ +},{"../components/color":524,"../components/drawing":546,"../constants/xmlns_namespaces":638,"../lib":661,"../lib/events":650,"../lib/queue":676,"../plots/cartesian/axes":711,"../plots/cartesian/constants":718,"../plots/cartesian/graph_interact":721,"../plots/cartesian/select":731,"../plots/plots":774,"../registry":788,"./edit_types":693,"./helpers":694,"./manage_arrays":696,"./plot_config":698,"./plot_schema":699,"./subroutines":701,"@plotly/d3":54,"fast-isnumeric":159,"has-hover":343}],698:[function(_dereq_,module,exports){ 'use strict'; /** @@ -127371,7 +167175,7 @@ module.exports = { dfltConfig: dfltConfig }; -},{}],378:[function(_dereq_,module,exports){ +},{}],699:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -128036,7 +167840,7 @@ function insertAttrs(baseAttrs, newAttrs, astr) { np.set(extendDeepAll(np.get() || {}, newAttrs)); } -},{"../lib":342,"../plots/animation_attributes":384,"../plots/attributes":386,"../plots/frame_attributes":420,"../plots/layout_attributes":429,"../registry":452,"./edit_types":372,"./plot_config":377}],379:[function(_dereq_,module,exports){ +},{"../lib":661,"../plots/animation_attributes":705,"../plots/attributes":707,"../plots/frame_attributes":741,"../plots/layout_attributes":765,"../registry":788,"./edit_types":693,"./plot_config":698}],700:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -128335,7 +168139,7 @@ exports.arrayEditor = function(parentIn, containerStr, itemOut) { }; }; -},{"../lib":342,"../plots/attributes":386}],380:[function(_dereq_,module,exports){ +},{"../lib":661,"../plots/attributes":707}],701:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -129051,7 +168855,7 @@ exports.drawMarginPushers = function(gd) { Registry.getComponentMethod('colorbar', 'draw')(gd); }; -},{"../components/color":208,"../components/drawing":230,"../components/modebar":271,"../components/titles":306,"../constants/alignment":313,"../lib":342,"../lib/clear_gl_canvases":327,"../plots/cartesian/autorange":389,"../plots/cartesian/axes":390,"../plots/cartesian/constraints":398,"../plots/plots":438,"../registry":452,"@plotly/d3":44}],381:[function(_dereq_,module,exports){ +},{"../components/color":524,"../components/drawing":546,"../components/modebar":587,"../components/titles":622,"../constants/alignment":629,"../lib":661,"../lib/clear_gl_canvases":645,"../plots/cartesian/autorange":710,"../plots/cartesian/axes":711,"../plots/cartesian/constraints":719,"../plots/plots":774,"../registry":788,"@plotly/d3":54}],702:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -129504,7 +169308,7 @@ function format(opts) { return opts; } -},{"../lib":342,"../plots/attributes":386,"../plots/plots":438,"./plot_config":377,"./plot_schema":378,"./plot_template":379}],382:[function(_dereq_,module,exports){ +},{"../lib":661,"../plots/attributes":707,"../plots/plots":774,"./plot_config":698,"./plot_schema":699,"./plot_template":700}],703:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -129711,7 +169515,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":342,"../plots/plots":438,"../snapshot/helpers":456,"../snapshot/svgtoimg":458,"../snapshot/tosvg":460,"../version":840,"./plot_api":376,"fast-isnumeric":81}],383:[function(_dereq_,module,exports){ +},{"../lib":661,"../plots/plots":774,"../snapshot/helpers":792,"../snapshot/svgtoimg":794,"../snapshot/tosvg":796,"../version":1219,"./plot_api":697,"fast-isnumeric":159}],704:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -130134,7 +169938,7 @@ function convertPathToAttributeString(path) { return astr; } -},{"../lib":342,"../plots/plots":438,"./plot_config":377,"./plot_schema":378}],384:[function(_dereq_,module,exports){ +},{"../lib":661,"../plots/plots":774,"./plot_config":698,"./plot_schema":699}],705:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -130222,7 +170026,7 @@ module.exports = { } }; -},{}],385:[function(_dereq_,module,exports){ +},{}],706:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -130309,7 +170113,7 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut return contOut; }; -},{"../lib":342,"../plot_api/plot_template":379}],386:[function(_dereq_,module,exports){ +},{"../lib":661,"../plot_api/plot_template":700}],707:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -130431,7 +170235,7 @@ module.exports = { } }; -},{"../components/fx/attributes":239,"./font_attributes":419}],387:[function(_dereq_,module,exports){ +},{"../components/fx/attributes":555,"./font_attributes":740}],708:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -130526,7 +170330,7 @@ module.exports = function alignPeriod(trace, ax, axLetter, vals) { }; }; -},{"../../constants/numerical":319,"../../lib":342,"fast-isnumeric":81}],388:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"fast-isnumeric":159}],709:[function(_dereq_,module,exports){ 'use strict'; @@ -130543,7 +170347,7 @@ module.exports = { } }; -},{}],389:[function(_dereq_,module,exports){ +},{}],710:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -131170,7 +170974,7 @@ function goodNumber(v) { function lessOrEqual(v0, v1) { return v0 <= v1; } function greaterOrEqual(v0, v1) { return v0 >= v1; } -},{"../../components/drawing":230,"../../constants/numerical":319,"../../lib":342,"../../registry":452,"./axis_ids":394,"@plotly/d3":44,"fast-isnumeric":81}],390:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../constants/numerical":637,"../../lib":661,"../../registry":788,"./axis_ids":715,"@plotly/d3":54,"fast-isnumeric":159}],711:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -135012,7 +174816,7 @@ function hideCounterAxisInsideTickLabels(ax, opts) { } } -},{"../../components/color":208,"../../components/drawing":230,"../../components/titles":306,"../../constants/alignment":313,"../../constants/numerical":319,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../../registry":452,"./autorange":389,"./axis_autotype":391,"./axis_ids":394,"./clean_ticks":396,"./layout_attributes":405,"./set_convert":411,"@plotly/d3":44,"fast-isnumeric":81}],391:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../components/titles":622,"../../constants/alignment":629,"../../constants/numerical":637,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../../registry":788,"./autorange":710,"./axis_autotype":712,"./axis_ids":715,"./clean_ticks":717,"./layout_attributes":726,"./set_convert":732,"@plotly/d3":54,"fast-isnumeric":159}],712:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -135134,7 +174938,7 @@ function multiCategory(a) { return isArrayOrTypedArray(a[0]) && isArrayOrTypedArray(a[1]); } -},{"../../constants/numerical":319,"../../lib":342,"fast-isnumeric":81}],392:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"fast-isnumeric":159}],713:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -135446,7 +175250,7 @@ function indexOfDay(v) { ]; } -},{"../../lib":342,"../../registry":452,"../array_container_defaults":385,"./category_order_defaults":395,"./constants":397,"./layout_attributes":405,"./line_grid_defaults":407,"./set_convert":411,"./tick_label_defaults":412,"./tick_mark_defaults":413,"./tick_value_defaults":414,"fast-isnumeric":81}],393:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"../array_container_defaults":706,"./category_order_defaults":716,"./constants":718,"./layout_attributes":726,"./line_grid_defaults":728,"./set_convert":732,"./tick_label_defaults":733,"./tick_mark_defaults":734,"./tick_value_defaults":735,"fast-isnumeric":159}],714:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../../constants/docs'); @@ -135495,7 +175299,7 @@ module.exports = { descriptionWithDates: descriptionWithDates }; -},{"../../constants/docs":316}],394:[function(_dereq_,module,exports){ +},{"../../constants/docs":632}],715:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -135643,7 +175447,7 @@ exports.isLinked = function(fullLayout, axId) { ); }; -},{"../../registry":452,"./constants":397}],395:[function(_dereq_,module,exports){ +},{"../../registry":788,"./constants":718}],716:[function(_dereq_,module,exports){ 'use strict'; function findCategories(ax, opts) { @@ -135729,7 +175533,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],396:[function(_dereq_,module,exports){ +},{}],717:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -135813,7 +175617,7 @@ exports.tick0 = function(tick0, axType, calendar, dtick) { return isNumeric(tick0) ? Number(tick0) : 0; }; -},{"../../constants/numerical":319,"../../lib":342,"fast-isnumeric":81}],397:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"fast-isnumeric":159}],718:[function(_dereq_,module,exports){ 'use strict'; var counterRegex = _dereq_('../../lib/regex').counter; @@ -135897,7 +175701,7 @@ module.exports = { } }; -},{"../../lib/regex":358}],398:[function(_dereq_,module,exports){ +},{"../../lib/regex":677}],719:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -136540,7 +176344,7 @@ function updateDomain(ax, factor) { ax.setScale(); } -},{"../../constants/alignment":313,"../../constants/numerical":319,"../../lib":342,"./autorange":389,"./axis_ids":394,"./layout_attributes":405,"./scale_zoom":409,"./set_convert":411}],399:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629,"../../constants/numerical":637,"../../lib":661,"./autorange":710,"./axis_ids":715,"./layout_attributes":726,"./scale_zoom":730,"./set_convert":732}],720:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -137872,7 +177676,7 @@ module.exports = { attachWheelEventHandler: attachWheelEventHandler }; -},{"../../components/color":208,"../../components/dragelement":227,"../../components/dragelement/helpers":226,"../../components/drawing":230,"../../components/fx":248,"../../constants/alignment":313,"../../lib":342,"../../lib/clear_gl_canvases":327,"../../lib/setcursor":362,"../../lib/svg_text_utils":365,"../../plot_api/subroutines":380,"../../registry":452,"../plots":438,"./axes":390,"./axis_ids":394,"./constants":397,"./scale_zoom":409,"./select":410,"@plotly/d3":44,"has-passive-events":113,"tinycolor2":171}],400:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/dragelement":543,"../../components/dragelement/helpers":542,"../../components/drawing":546,"../../components/fx":564,"../../constants/alignment":629,"../../lib":661,"../../lib/clear_gl_canvases":645,"../../lib/setcursor":681,"../../lib/svg_text_utils":686,"../../plot_api/subroutines":701,"../../registry":788,"../plots":774,"./axes":711,"./axis_ids":715,"./constants":718,"./scale_zoom":730,"./select":731,"@plotly/d3":54,"has-passive-events":344,"tinycolor2":471}],721:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -138031,7 +177835,7 @@ exports.updateFx = function(gd) { setCursor(fullLayout._draggers, cursor); }; -},{"../../components/dragelement":227,"../../components/fx":248,"../../lib/setcursor":362,"./constants":397,"./dragbox":399,"@plotly/d3":44}],401:[function(_dereq_,module,exports){ +},{"../../components/dragelement":543,"../../components/fx":564,"../../lib/setcursor":681,"./constants":718,"./dragbox":720,"@plotly/d3":54}],722:[function(_dereq_,module,exports){ 'use strict'; function clearOutlineControllers(gd) { @@ -138058,7 +177862,7 @@ module.exports = { clearSelect: clearSelect }; -},{}],402:[function(_dereq_,module,exports){ +},{}],723:[function(_dereq_,module,exports){ 'use strict'; var strTranslate = _dereq_('../../lib').strTranslate; @@ -138106,7 +177910,7 @@ module.exports = { getTransform: getTransform }; -},{"../../lib":342}],403:[function(_dereq_,module,exports){ +},{"../../lib":661}],724:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -138175,7 +177979,7 @@ module.exports = function makeIncludeComponents(containerArrayName) { }; }; -},{"../../lib":342,"../../registry":452,"./axis_ids":394}],404:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"./axis_ids":715}],725:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -138784,7 +178588,7 @@ exports.toSVG = function(gd) { exports.updateFx = _dereq_('./graph_interact').updateFx; -},{"../../components/drawing":230,"../../constants/xmlns_namespaces":320,"../../lib":342,"../../registry":452,"../get_data":427,"../plots":438,"./attributes":388,"./axis_ids":394,"./constants":397,"./graph_interact":400,"./layout_attributes":405,"./layout_defaults":406,"./transition_axes":415,"@plotly/d3":44}],405:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../constants/xmlns_namespaces":638,"../../lib":661,"../../registry":788,"../get_data":748,"../plots":774,"./attributes":709,"./axis_ids":715,"./constants":718,"./graph_interact":721,"./layout_attributes":726,"./layout_defaults":727,"./transition_axes":736,"@plotly/d3":54}],726:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../font_attributes'); @@ -139345,7 +179149,7 @@ module.exports = { } }; -},{"../../components/color/attributes":207,"../../components/drawing/attributes":229,"../../constants/numerical":319,"../../lib/extend":333,"../../plot_api/plot_template":379,"../../plots/cartesian/axis_format_attributes":393,"../font_attributes":419,"./constants":397}],406:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../components/drawing/attributes":545,"../../constants/numerical":637,"../../lib/extend":651,"../../plot_api/plot_template":700,"../../plots/cartesian/axis_format_attributes":714,"../font_attributes":740,"./constants":718}],727:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -139723,7 +179527,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":208,"../../components/fx/helpers":244,"../../components/fx/hovermode_defaults":247,"../../lib":342,"../../plot_api/plot_template":379,"../../registry":452,"../layout_attributes":429,"./axis_defaults":392,"./axis_ids":394,"./constants":397,"./constraints":398,"./layout_attributes":405,"./position_defaults":408,"./type_defaults":416}],407:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx/helpers":560,"../../components/fx/hovermode_defaults":563,"../../lib":661,"../../plot_api/plot_template":700,"../../registry":788,"../layout_attributes":765,"./axis_defaults":713,"./axis_ids":715,"./constants":718,"./constraints":719,"./layout_attributes":726,"./position_defaults":729,"./type_defaults":737}],728:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -139780,7 +179584,7 @@ module.exports = function handleLineGridDefaults(containerIn, containerOut, coer } }; -},{"../../components/color/attributes":207,"../../lib":342,"tinycolor2":171}],408:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib":661,"tinycolor2":471}],729:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -139859,7 +179663,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":342,"fast-isnumeric":81}],409:[function(_dereq_,module,exports){ +},{"../../lib":661,"fast-isnumeric":159}],730:[function(_dereq_,module,exports){ 'use strict'; var FROM_BL = _dereq_('../../constants/alignment').FROM_BL; @@ -139879,7 +179683,7 @@ module.exports = function scaleZoom(ax, factor, centerFraction) { ax.setScale(); }; -},{"../../constants/alignment":313}],410:[function(_dereq_,module,exports){ +},{"../../constants/alignment":629}],731:[function(_dereq_,module,exports){ 'use strict'; var polybool = _dereq_('polybooljs'); @@ -140813,7 +180617,7 @@ module.exports = { selectOnClick: selectOnClick }; -},{"../../components/color":208,"../../components/dragelement/helpers":226,"../../components/drawing":230,"../../components/fx":248,"../../components/fx/helpers":244,"../../components/shapes/draw_newshape/display_outlines":296,"../../components/shapes/draw_newshape/helpers":297,"../../components/shapes/draw_newshape/newshapes":298,"../../lib":342,"../../lib/clear_gl_canvases":327,"../../lib/polygon":354,"../../lib/throttle":366,"../../plot_api/subroutines":380,"../../registry":452,"./axis_ids":394,"./constants":397,"./handle_outline":401,"./helpers":402,"polybooljs":124}],411:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/dragelement/helpers":542,"../../components/drawing":546,"../../components/fx":564,"../../components/fx/helpers":560,"../../components/shapes/draw_newshape/display_outlines":612,"../../components/shapes/draw_newshape/helpers":613,"../../components/shapes/draw_newshape/newshapes":614,"../../lib":661,"../../lib/clear_gl_canvases":645,"../../lib/polygon":673,"../../lib/throttle":687,"../../plot_api/subroutines":701,"../../registry":788,"./axis_ids":715,"./constants":718,"./handle_outline":722,"./helpers":723,"polybooljs":389}],732:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -141777,7 +181581,7 @@ module.exports = function setConvert(ax, fullLayout) { delete ax._forceTick0; }; -},{"../../constants/numerical":319,"../../lib":342,"./axis_ids":394,"./constants":397,"@plotly/d3":44,"d3-time-format":76,"fast-isnumeric":81}],412:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"./axis_ids":715,"./constants":718,"@plotly/d3":54,"d3-time-format":147,"fast-isnumeric":159}],733:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -141895,7 +181699,7 @@ function tickformatstopDefaults(valueIn, valueOut) { } } -},{"../../components/color":208,"../../lib":342,"../array_container_defaults":385,"./layout_attributes":405}],413:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../array_container_defaults":706,"./layout_attributes":726}],734:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -141919,7 +181723,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":342,"./layout_attributes":405}],414:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":726}],735:[function(_dereq_,module,exports){ 'use strict'; var cleanTicks = _dereq_('./clean_ticks'); @@ -141958,7 +181762,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"../../lib":342,"./clean_ticks":396}],415:[function(_dereq_,module,exports){ +},{"../../lib":661,"./clean_ticks":717}],736:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -142163,7 +181967,7 @@ module.exports = function transitionAxes(gd, edits, transitionOpts, makeOnComple return Promise.resolve(); }; -},{"../../components/drawing":230,"../../lib":342,"../../registry":452,"./axes":390,"@plotly/d3":44}],416:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../registry":788,"./axes":711,"@plotly/d3":54}],737:[function(_dereq_,module,exports){ 'use strict'; var traceIs = _dereq_('../../registry').traceIs; @@ -142295,7 +182099,7 @@ function isBoxWithoutPositionCoords(trace, axLetter) { ); } -},{"../../registry":452,"./axis_autotype":391}],417:[function(_dereq_,module,exports){ +},{"../../registry":788,"./axis_autotype":712}],738:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -142714,7 +182518,7 @@ function crawl(attrs, callback, path, depth) { }); } -},{"../lib":342,"../registry":452}],418:[function(_dereq_,module,exports){ +},{"../lib":661,"../registry":788}],739:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../lib/extend').extendFlat; @@ -142811,7 +182615,7 @@ exports.defaults = function(containerOut, layout, coerce, dfltDomains) { if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice(); }; -},{"../lib/extend":333}],419:[function(_dereq_,module,exports){ +},{"../lib/extend":651}],740:[function(_dereq_,module,exports){ 'use strict'; /* @@ -142863,7 +182667,7 @@ module.exports = function(opts) { return attrs; }; -},{}],420:[function(_dereq_,module,exports){ +},{}],741:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -142889,7 +182693,7 @@ module.exports = { } }; -},{}],421:[function(_dereq_,module,exports){ +},{}],742:[function(_dereq_,module,exports){ 'use strict'; // projection names to d3 function name @@ -143147,7 +182951,7 @@ exports.layerNameToAdjective = { frame: 'frame' }; -},{}],422:[function(_dereq_,module,exports){ +},{}],743:[function(_dereq_,module,exports){ 'use strict'; /* global PlotlyGeoAssets:false */ @@ -143935,7 +183739,7 @@ function makeRangeBox(lon, lat) { }; } -},{"../../components/color":208,"../../components/dragelement":227,"../../components/drawing":230,"../../components/fx":248,"../../lib":342,"../../lib/geo_location_utils":336,"../../lib/topojson_utils":368,"../../registry":452,"../cartesian/autorange":389,"../cartesian/axes":390,"../cartesian/select":410,"../plots":438,"./constants":421,"./zoom":426,"@plotly/d3":44,"d3-geo":70,"d3-geo-projection":69,"topojson-client":172}],423:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/dragelement":543,"../../components/drawing":546,"../../components/fx":564,"../../lib":661,"../../lib/geo_location_utils":654,"../../lib/topojson_utils":689,"../../registry":788,"../cartesian/autorange":710,"../cartesian/axes":711,"../cartesian/select":731,"../plots":774,"./constants":742,"./zoom":747,"@plotly/d3":54,"d3-geo":141,"d3-geo-projection":140,"topojson-client":473}],744:[function(_dereq_,module,exports){ 'use strict'; var getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData; @@ -144019,7 +183823,7 @@ module.exports = { clean: clean }; -},{"../../lib":342,"../../plots/get_data":427,"./geo":422,"./layout_attributes":424,"./layout_defaults":425}],424:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/get_data":748,"./geo":743,"./layout_attributes":745,"./layout_defaults":746}],745:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -144229,7 +184033,7 @@ attrs.uirevision = { editType: 'none', }; -},{"../../components/color/attributes":207,"../../lib/sort_object_keys":363,"../../plot_api/edit_types":372,"../domain":418,"./constants":421}],425:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib/sort_object_keys":683,"../../plot_api/edit_types":693,"../domain":739,"./constants":742}],746:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -144455,7 +184259,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) { } } -},{"../../lib":342,"../get_data":427,"../subplot_defaults":446,"./constants":421,"./layout_attributes":424}],426:[function(_dereq_,module,exports){ +},{"../../lib":661,"../get_data":748,"../subplot_defaults":782,"./constants":742,"./layout_attributes":745}],747:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -144958,7 +184762,7 @@ function d3eventDispatch(target) { return dispatch; } -},{"../../lib":342,"../../registry":452,"@plotly/d3":44}],427:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"@plotly/d3":54}],748:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -145079,7 +184883,2268 @@ exports.getSubplotData = function getSubplotData(data, type, subplotId) { return subplotData; }; -},{"../registry":452,"./cartesian/constants":397}],428:[function(_dereq_,module,exports){ +},{"../registry":788,"./cartesian/constants":718}],749:[function(_dereq_,module,exports){ +'use strict'; + +var mouseChange = _dereq_('mouse-change'); +var mouseWheel = _dereq_('mouse-wheel'); +var mouseOffset = _dereq_('mouse-event-offset'); +var cartesianConstants = _dereq_('../cartesian/constants'); +var hasPassive = _dereq_('has-passive-events'); + +module.exports = createCamera; + +function Camera2D(element, plot) { + this.element = element; + this.plot = plot; + this.mouseListener = null; + this.wheelListener = null; + this.lastInputTime = Date.now(); + this.lastPos = [0, 0]; + this.boxEnabled = false; + this.boxInited = false; + this.boxStart = [0, 0]; + this.boxEnd = [0, 0]; + this.dragStart = [0, 0]; +} + + +function createCamera(scene) { + var element = scene.mouseContainer; + var plot = scene.glplot; + var result = new Camera2D(element, plot); + + function unSetAutoRange() { + scene.xaxis.autorange = false; + scene.yaxis.autorange = false; + } + + function getSubplotConstraint() { + // note: this assumes we only have one x and one y axis on this subplot + // when this constraint is lifted this block won't make sense + var constraints = scene.graphDiv._fullLayout._axisConstraintGroups; + var xaId = scene.xaxis._id; + var yaId = scene.yaxis._id; + for(var i = 0; i < constraints.length; i++) { + if(constraints[i][xaId] !== -1) { + if(constraints[i][yaId] !== -1) return true; + break; + } + } + return false; + } + + result.mouseListener = mouseChange(element, handleInteraction); + + // enable simple touch interactions + element.addEventListener('touchstart', function(ev) { + var xy = mouseOffset(ev.changedTouches[0], element); + handleInteraction(0, xy[0], xy[1]); + handleInteraction(1, xy[0], xy[1]); + + ev.preventDefault(); + }, hasPassive ? {passive: false} : false); + element.addEventListener('touchmove', function(ev) { + ev.preventDefault(); + var xy = mouseOffset(ev.changedTouches[0], element); + handleInteraction(1, xy[0], xy[1]); + + ev.preventDefault(); + }, hasPassive ? {passive: false} : false); + element.addEventListener('touchend', function(ev) { + handleInteraction(0, result.lastPos[0], result.lastPos[1]); + + ev.preventDefault(); + }, hasPassive ? {passive: false} : false); + + function handleInteraction(buttons, x, y) { + var dataBox = scene.calcDataBox(); + var viewBox = plot.viewBox; + + var lastX = result.lastPos[0]; + var lastY = result.lastPos[1]; + + var MINDRAG = cartesianConstants.MINDRAG * plot.pixelRatio; + var MINZOOM = cartesianConstants.MINZOOM * plot.pixelRatio; + + var dx, dy; + + x *= plot.pixelRatio; + y *= plot.pixelRatio; + + // mouseChange gives y about top; convert to about bottom + y = (viewBox[3] - viewBox[1]) - y; + + function updateRange(i0, start, end) { + var range0 = Math.min(start, end); + var range1 = Math.max(start, end); + + if(range0 !== range1) { + dataBox[i0] = range0; + dataBox[i0 + 2] = range1; + result.dataBox = dataBox; + scene.setRanges(dataBox); + } else { + scene.selectBox.selectBox = [0, 0, 1, 1]; + scene.glplot.setDirty(); + } + } + + switch(scene.fullLayout.dragmode) { + case 'zoom': + if(buttons) { + var dataX = x / + (viewBox[2] - viewBox[0]) * (dataBox[2] - dataBox[0]) + + dataBox[0]; + var dataY = y / + (viewBox[3] - viewBox[1]) * (dataBox[3] - dataBox[1]) + + dataBox[1]; + + if(!result.boxInited) { + result.boxStart[0] = dataX; + result.boxStart[1] = dataY; + result.dragStart[0] = x; + result.dragStart[1] = y; + } + + result.boxEnd[0] = dataX; + result.boxEnd[1] = dataY; + + // we need to mark the box as initialized right away + // so that we can tell the start and end points apart + result.boxInited = true; + + // but don't actually enable the box until the cursor moves + if(!result.boxEnabled && ( + result.boxStart[0] !== result.boxEnd[0] || + result.boxStart[1] !== result.boxEnd[1]) + ) { + result.boxEnabled = true; + } + + // constrain aspect ratio if the axes require it + var smallDx = Math.abs(result.dragStart[0] - x) < MINZOOM; + var smallDy = Math.abs(result.dragStart[1] - y) < MINZOOM; + if(getSubplotConstraint() && !(smallDx && smallDy)) { + dx = result.boxEnd[0] - result.boxStart[0]; + dy = result.boxEnd[1] - result.boxStart[1]; + var dydx = (dataBox[3] - dataBox[1]) / (dataBox[2] - dataBox[0]); + + if(Math.abs(dx * dydx) > Math.abs(dy)) { + result.boxEnd[1] = result.boxStart[1] + + Math.abs(dx) * dydx * (dy >= 0 ? 1 : -1); + + // gl-select-box clips to the plot area bounds, + // which breaks the axis constraint, so don't allow + // this box to go out of bounds + if(result.boxEnd[1] < dataBox[1]) { + result.boxEnd[1] = dataBox[1]; + result.boxEnd[0] = result.boxStart[0] + + (dataBox[1] - result.boxStart[1]) / Math.abs(dydx); + } else if(result.boxEnd[1] > dataBox[3]) { + result.boxEnd[1] = dataBox[3]; + result.boxEnd[0] = result.boxStart[0] + + (dataBox[3] - result.boxStart[1]) / Math.abs(dydx); + } + } else { + result.boxEnd[0] = result.boxStart[0] + + Math.abs(dy) / dydx * (dx >= 0 ? 1 : -1); + + if(result.boxEnd[0] < dataBox[0]) { + result.boxEnd[0] = dataBox[0]; + result.boxEnd[1] = result.boxStart[1] + + (dataBox[0] - result.boxStart[0]) * Math.abs(dydx); + } else if(result.boxEnd[0] > dataBox[2]) { + result.boxEnd[0] = dataBox[2]; + result.boxEnd[1] = result.boxStart[1] + + (dataBox[2] - result.boxStart[0]) * Math.abs(dydx); + } + } + } else { + // otherwise clamp small changes to the origin so we get 1D zoom + + if(smallDx) result.boxEnd[0] = result.boxStart[0]; + if(smallDy) result.boxEnd[1] = result.boxStart[1]; + } + } else if(result.boxEnabled) { + dx = result.boxStart[0] !== result.boxEnd[0]; + dy = result.boxStart[1] !== result.boxEnd[1]; + if(dx || dy) { + if(dx) { + updateRange(0, result.boxStart[0], result.boxEnd[0]); + scene.xaxis.autorange = false; + } + if(dy) { + updateRange(1, result.boxStart[1], result.boxEnd[1]); + scene.yaxis.autorange = false; + } + scene.relayoutCallback(); + } else { + scene.glplot.setDirty(); + } + result.boxEnabled = false; + result.boxInited = false; + } else if(result.boxInited) { + // if box was inited but button released then - reset the box + + result.boxInited = false; + } + break; + + case 'pan': + result.boxEnabled = false; + result.boxInited = false; + + if(buttons) { + if(!result.panning) { + result.dragStart[0] = x; + result.dragStart[1] = y; + } + + if(Math.abs(result.dragStart[0] - x) < MINDRAG) x = result.dragStart[0]; + if(Math.abs(result.dragStart[1] - y) < MINDRAG) y = result.dragStart[1]; + + dx = (lastX - x) * (dataBox[2] - dataBox[0]) / + (plot.viewBox[2] - plot.viewBox[0]); + dy = (lastY - y) * (dataBox[3] - dataBox[1]) / + (plot.viewBox[3] - plot.viewBox[1]); + + dataBox[0] += dx; + dataBox[2] += dx; + dataBox[1] += dy; + dataBox[3] += dy; + + scene.setRanges(dataBox); + + result.panning = true; + result.lastInputTime = Date.now(); + unSetAutoRange(); + scene.cameraChanged(); + scene.handleAnnotations(); + } else if(result.panning) { + result.panning = false; + scene.relayoutCallback(); + } + break; + } + + result.lastPos[0] = x; + result.lastPos[1] = y; + } + + result.wheelListener = mouseWheel(element, function(dx, dy) { + if(!scene.scrollZoom) return false; + + var dataBox = scene.calcDataBox(); + var viewBox = plot.viewBox; + + var lastX = result.lastPos[0]; + var lastY = result.lastPos[1]; + + var scale = Math.exp(5.0 * dy / (viewBox[3] - viewBox[1])); + + var cx = lastX / + (viewBox[2] - viewBox[0]) * (dataBox[2] - dataBox[0]) + + dataBox[0]; + var cy = lastY / + (viewBox[3] - viewBox[1]) * (dataBox[3] - dataBox[1]) + + dataBox[1]; + + dataBox[0] = (dataBox[0] - cx) * scale + cx; + dataBox[2] = (dataBox[2] - cx) * scale + cx; + dataBox[1] = (dataBox[1] - cy) * scale + cy; + dataBox[3] = (dataBox[3] - cy) * scale + cy; + + scene.setRanges(dataBox); + + result.lastInputTime = Date.now(); + unSetAutoRange(); + scene.cameraChanged(); + scene.handleAnnotations(); + scene.relayoutCallback(); + + return true; + }, true); + + return result; +} + +},{"../cartesian/constants":718,"has-passive-events":344,"mouse-change":363,"mouse-event-offset":364,"mouse-wheel":366}],750:[function(_dereq_,module,exports){ +'use strict'; + +var Axes = _dereq_('../cartesian/axes'); + +var str2RGBArray = _dereq_('../../lib/str2rgbarray'); + +function Axes2DOptions(scene) { + this.scene = scene; + this.gl = scene.gl; + this.pixelRatio = scene.pixelRatio; + + this.screenBox = [0, 0, 1, 1]; + this.viewBox = [0, 0, 1, 1]; + this.dataBox = [-1, -1, 1, 1]; + + this.borderLineEnable = [false, false, false, false]; + 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 = [true, true, false, false]; + 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 = [true, true, false, false]; + this.labelAngle = [0, Math.PI / 2, 0, 3.0 * 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 = true; + this.titleCenter = [0, 0, 0, 0]; + this.titleAngle = 0; + this.titleColor = [0, 0, 0, 1]; + this.titleFont = 'sans-serif'; + this.titleSize = 18; + + this.gridLineEnable = [true, true]; + this.gridLineColor = [ + [0, 0, 0, 0.5], + [0, 0, 0, 0.5] + ]; + this.gridLineWidth = [1, 1]; + + this.zeroLineEnable = [true, true]; + 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; +} + +var proto = Axes2DOptions.prototype; + +var AXES = ['xaxis', 'yaxis']; + +proto.merge = function(options) { + // titles are rendered in SVG + this.titleEnable = false; + this.backgroundColor = str2RGBArray(options.plot_bgcolor); + + var axisName, ax, axTitle, axMirror; + var hasAxisInDfltPos, hasAxisInAltrPos, hasSharedAxis, mirrorLines, mirrorTicks; + var i, j; + + for(i = 0; i < 2; ++i) { + axisName = AXES[i]; + var axisLetter = axisName.charAt(0); + + // get options relevant to this subplot, + // '_name' is e.g. xaxis, xaxis2, yaxis, yaxis4 ... + ax = options[this.scene[axisName]._name]; + + axTitle = ax.title.text === this.scene.fullLayout._dfltTitle[axisLetter] ? '' : ax.title.text; + + for(j = 0; j <= 2; j += 2) { + this.labelEnable[i + j] = false; + this.labels[i + j] = axTitle; + this.labelColor[i + j] = str2RGBArray(ax.title.font.color); + this.labelFont[i + j] = ax.title.font.family; + this.labelSize[i + j] = ax.title.font.size; + this.labelPad[i + j] = this.getLabelPad(axisName, ax); + + this.tickEnable[i + j] = false; + this.tickColor[i + j] = str2RGBArray((ax.tickfont || {}).color); + this.tickAngle[i + j] = (ax.tickangle === 'auto') ? + 0 : + Math.PI * -ax.tickangle / 180; + this.tickPad[i + j] = this.getTickPad(ax); + + this.tickMarkLength[i + j] = 0; + this.tickMarkWidth[i + j] = ax.tickwidth || 0; + this.tickMarkColor[i + j] = str2RGBArray(ax.tickcolor); + + this.borderLineEnable[i + j] = false; + this.borderLineColor[i + j] = str2RGBArray(ax.linecolor); + this.borderLineWidth[i + j] = ax.linewidth || 0; + } + + hasSharedAxis = this.hasSharedAxis(ax); + hasAxisInDfltPos = this.hasAxisInDfltPos(axisName, ax) && !hasSharedAxis; + hasAxisInAltrPos = this.hasAxisInAltrPos(axisName, ax) && !hasSharedAxis; + + axMirror = ax.mirror || false; + mirrorLines = hasSharedAxis ? + (String(axMirror).indexOf('all') !== -1) : // 'all' or 'allticks' + !!axMirror; // all but false + mirrorTicks = hasSharedAxis ? + (axMirror === 'allticks') : + (String(axMirror).indexOf('ticks') !== -1); // 'ticks' or 'allticks' + + // Axis titles and tick labels can only appear of one side of the scene + // and are never show on subplots that share existing axes. + + if(hasAxisInDfltPos) this.labelEnable[i] = true; + else if(hasAxisInAltrPos) this.labelEnable[i + 2] = true; + + if(hasAxisInDfltPos) this.tickEnable[i] = ax.showticklabels; + else if(hasAxisInAltrPos) this.tickEnable[i + 2] = ax.showticklabels; + + // Grid lines and ticks can appear on both sides of the scene + // and can appear on subplot that share existing axes via `ax.mirror`. + + if(hasAxisInDfltPos || mirrorLines) this.borderLineEnable[i] = ax.showline; + if(hasAxisInAltrPos || mirrorLines) this.borderLineEnable[i + 2] = ax.showline; + + if(hasAxisInDfltPos || mirrorTicks) this.tickMarkLength[i] = this.getTickMarkLength(ax); + if(hasAxisInAltrPos || mirrorTicks) this.tickMarkLength[i + 2] = this.getTickMarkLength(ax); + + this.gridLineEnable[i] = ax.showgrid; + this.gridLineColor[i] = str2RGBArray(ax.gridcolor); + this.gridLineWidth[i] = ax.gridwidth; + + this.zeroLineEnable[i] = ax.zeroline; + this.zeroLineColor[i] = str2RGBArray(ax.zerolinecolor); + this.zeroLineWidth[i] = ax.zerolinewidth; + } +}; + +// is an axis shared with an already-drawn subplot ? +proto.hasSharedAxis = function(ax) { + var scene = this.scene; + var subplotIds = scene.fullLayout._subplots.gl2d; + var list = Axes.findSubplotsWithAxis(subplotIds, ax); + + // if index === 0, then the subplot is already drawn as subplots + // are drawn in order. + return (list.indexOf(scene.id) !== 0); +}; + +// has an axis in default position (i.e. bottom/left) ? +proto.hasAxisInDfltPos = function(axisName, ax) { + var axSide = ax.side; + + if(axisName === 'xaxis') return (axSide === 'bottom'); + else if(axisName === 'yaxis') return (axSide === 'left'); +}; + +// has an axis in alternate position (i.e. top/right) ? +proto.hasAxisInAltrPos = function(axisName, ax) { + var axSide = ax.side; + + if(axisName === 'xaxis') return (axSide === 'top'); + else if(axisName === 'yaxis') return (axSide === 'right'); +}; + +proto.getLabelPad = function(axisName, ax) { + var offsetBase = 1.5; + var fontSize = ax.title.font.size; + var showticklabels = ax.showticklabels; + + if(axisName === 'xaxis') { + return (ax.side === 'top') ? + -10 + fontSize * (offsetBase + (showticklabels ? 1 : 0)) : + -10 + fontSize * (offsetBase + (showticklabels ? 0.5 : 0)); + } else if(axisName === 'yaxis') { + return (ax.side === 'right') ? + 10 + fontSize * (offsetBase + (showticklabels ? 1 : 0.5)) : + 10 + fontSize * (offsetBase + (showticklabels ? 0.5 : 0)); + } +}; + +proto.getTickPad = function(ax) { + return (ax.ticks === 'outside') ? 10 + ax.ticklen : 15; +}; + +proto.getTickMarkLength = function(ax) { + if(!ax.ticks) return 0; + + var ticklen = ax.ticklen; + + return (ax.ticks === 'inside') ? -ticklen : ticklen; +}; + + +function createAxes2D(scene) { + return new Axes2DOptions(scene); +} + +module.exports = createAxes2D; + +},{"../../lib/str2rgbarray":685,"../cartesian/axes":711}],751:[function(_dereq_,module,exports){ +'use strict'; + +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; + +var Scene2D = _dereq_('./scene2d'); +var layoutGlobalAttrs = _dereq_('../layout_attributes'); +var xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces'); +var constants = _dereq_('../cartesian/constants'); +var Cartesian = _dereq_('../cartesian'); +var fxAttrs = _dereq_('../../components/fx/layout_attributes'); +var getSubplotData = _dereq_('../get_data').getSubplotData; + +exports.name = 'gl2d'; + +exports.attr = ['xaxis', 'yaxis']; + +exports.idRoot = ['x', 'y']; + +exports.idRegex = constants.idRegex; + +exports.attrRegex = constants.attrRegex; + +exports.attributes = _dereq_('../cartesian/attributes'); + +exports.supplyLayoutDefaults = function(layoutIn, layoutOut, fullData) { + if(!layoutOut._has('cartesian')) { + Cartesian.supplyLayoutDefaults(layoutIn, layoutOut, fullData); + } +}; + +// gl2d uses svg axis attributes verbatim, but overrides editType +// this could potentially be just `layoutAttributes` but it would +// still need special handling somewhere to give it precedence over +// the svg version when both are in use on one plot +exports.layoutAttrOverrides = overrideAll(Cartesian.layoutAttributes, 'plot', 'from-root'); + +// similar overrides for base plot attributes (and those added by components) +exports.baseLayoutAttrOverrides = overrideAll({ + plot_bgcolor: layoutGlobalAttrs.plot_bgcolor, + hoverlabel: fxAttrs.hoverlabel + // dragmode needs calc but only when transitioning TO lasso or select + // so for now it's left inside _relayout + // dragmode: fxAttrs.dragmode +}, 'plot', 'nested'); + +exports.plot = function plot(gd) { + var fullLayout = gd._fullLayout; + var fullData = gd._fullData; + var subplotIds = fullLayout._subplots.gl2d; + + for(var i = 0; i < subplotIds.length; i++) { + var subplotId = subplotIds[i]; + var subplotObj = fullLayout._plots[subplotId]; + var fullSubplotData = getSubplotData(fullData, 'gl2d', subplotId); + + // ref. to corresp. Scene instance + var scene = subplotObj._scene2d; + + // If Scene is not instantiated, create one! + if(scene === undefined) { + scene = new Scene2D({ + id: subplotId, + graphDiv: gd, + container: gd.querySelector('.gl-container'), + staticPlot: gd._context.staticPlot, + plotGlPixelRatio: gd._context.plotGlPixelRatio + }, + fullLayout + ); + + // set ref to Scene instance + subplotObj._scene2d = scene; + } + + scene.plot(fullSubplotData, gd.calcdata, fullLayout, gd.layout); + } +}; + +exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) { + var oldSceneKeys = oldFullLayout._subplots.gl2d || []; + + for(var i = 0; i < oldSceneKeys.length; i++) { + var id = oldSceneKeys[i]; + var oldSubplot = oldFullLayout._plots[id]; + + // old subplot wasn't gl2d; nothing to do + if(!oldSubplot._scene2d) continue; + + // if no traces are present, delete gl2d subplot + var subplotData = getSubplotData(newFullData, 'gl2d', id); + if(subplotData.length === 0) { + oldSubplot._scene2d.destroy(); + delete oldFullLayout._plots[id]; + } + } + + // since we use cartesian interactions, do cartesian clean + Cartesian.clean.apply(this, arguments); +}; + +exports.drawFramework = function(gd) { + if(!gd._context.staticPlot) { + Cartesian.drawFramework(gd); + } +}; + +exports.toSVG = function(gd) { + var fullLayout = gd._fullLayout; + var subplotIds = fullLayout._subplots.gl2d; + + for(var i = 0; i < subplotIds.length; i++) { + var subplot = fullLayout._plots[subplotIds[i]]; + var scene = subplot._scene2d; + + var imageData = scene.toImage('png'); + var image = fullLayout._glimages.append('svg:image'); + + image.attr({ + xmlns: xmlnsNamespaces.svg, + 'xlink:href': imageData, + x: 0, + y: 0, + width: '100%', + height: '100%', + preserveAspectRatio: 'none' + }); + + scene.destroy(); + } +}; + +exports.updateFx = function(gd) { + var fullLayout = gd._fullLayout; + var subplotIds = fullLayout._subplots.gl2d; + + for(var i = 0; i < subplotIds.length; i++) { + var subplotObj = fullLayout._plots[subplotIds[i]]._scene2d; + subplotObj.updateFx(fullLayout.dragmode); + } +}; + +},{"../../components/fx/layout_attributes":565,"../../constants/xmlns_namespaces":638,"../../plot_api/edit_types":693,"../cartesian":725,"../cartesian/attributes":709,"../cartesian/constants":718,"../get_data":748,"../layout_attributes":765,"./scene2d":752}],752:[function(_dereq_,module,exports){ +'use strict'; + +var Registry = _dereq_('../../registry'); +var Axes = _dereq_('../../plots/cartesian/axes'); +var Fx = _dereq_('../../components/fx'); + +var createPlot2D = _dereq_('gl-plot2d'); +var createSpikes = _dereq_('gl-spikes2d'); +var createSelectBox = _dereq_('gl-select-box'); +var getContext = _dereq_('webgl-context'); + +var createOptions = _dereq_('./convert'); +var createCamera = _dereq_('./camera'); +var showNoWebGlMsg = _dereq_('../../lib/show_no_webgl_msg'); +var axisConstraints = _dereq_('../cartesian/constraints'); +var enforceAxisConstraints = axisConstraints.enforce; +var cleanAxisConstraints = axisConstraints.clean; +var doAutoRange = _dereq_('../cartesian/autorange').doAutoRange; + +var dragHelpers = _dereq_('../../components/dragelement/helpers'); +var drawMode = dragHelpers.drawMode; +var selectMode = dragHelpers.selectMode; + +var AXES = ['xaxis', 'yaxis']; +var STATIC_CANVAS, STATIC_CONTEXT; + +var SUBPLOT_PATTERN = _dereq_('../cartesian/constants').SUBPLOT_PATTERN; + + +function Scene2D(options, fullLayout) { + this.container = options.container; + this.graphDiv = options.graphDiv; + this.pixelRatio = options.plotGlPixelRatio || window.devicePixelRatio; + this.id = options.id; + this.staticPlot = !!options.staticPlot; + this.scrollZoom = this.graphDiv._context._scrollZoom.cartesian; + + this.fullData = null; + this.updateRefs(fullLayout); + + this.makeFramework(); + if(this.stopped) return; + + // update options + this.glplotOptions = createOptions(this); + this.glplotOptions.merge(fullLayout); + + // create the plot + this.glplot = createPlot2D(this.glplotOptions); + + // create camera + this.camera = createCamera(this); + + // trace set + this.traces = {}; + + // create axes spikes + this.spikes = createSpikes(this.glplot); + + this.selectBox = createSelectBox(this.glplot, { + innerFill: false, + outerFill: true + }); + + // last button state + this.lastButtonState = 0; + + // last pick result + this.pickResult = null; + + // is the mouse over the plot? + // it's OK if this says true when it's not, so long as + // when we get a mouseout we set it to false before handling + this.isMouseOver = true; + + // flag to stop render loop + this.stopped = false; + + // redraw the plot + this.redraw = this.draw.bind(this); + this.redraw(); +} + +module.exports = Scene2D; + +var proto = Scene2D.prototype; + +proto.makeFramework = function() { + // create canvas and gl context + if(this.staticPlot) { + if(!STATIC_CONTEXT) { + STATIC_CANVAS = document.createElement('canvas'); + + STATIC_CONTEXT = getContext({ + canvas: STATIC_CANVAS, + preserveDrawingBuffer: false, + premultipliedAlpha: true, + antialias: true + }); + + if(!STATIC_CONTEXT) { + throw new Error('Error creating static canvas/context for image server'); + } + } + + this.canvas = STATIC_CANVAS; + this.gl = STATIC_CONTEXT; + } else { + var liveCanvas = this.container.querySelector('.gl-canvas-focus'); + + var gl = getContext({ + canvas: liveCanvas, + preserveDrawingBuffer: true, + premultipliedAlpha: true + }); + + if(!gl) { + showNoWebGlMsg(this); + this.stopped = true; + return; + } + + this.canvas = liveCanvas; + this.gl = gl; + } + + // position the canvas + var canvas = this.canvas; + + canvas.style.width = '100%'; + canvas.style.height = '100%'; + canvas.style.position = 'absolute'; + canvas.style.top = '0px'; + canvas.style.left = '0px'; + canvas.style['pointer-events'] = 'none'; + + this.updateSize(canvas); + + // create SVG container for hover text + var svgContainer = this.svgContainer = document.createElementNS( + 'http://www.w3.org/2000/svg', + 'svg'); + svgContainer.style.position = 'absolute'; + svgContainer.style.top = svgContainer.style.left = '0px'; + svgContainer.style.width = svgContainer.style.height = '100%'; + svgContainer.style['z-index'] = 20; + svgContainer.style['pointer-events'] = 'none'; + + // create div to catch the mouse event + var mouseContainer = this.mouseContainer = document.createElement('div'); + mouseContainer.style.position = 'absolute'; + mouseContainer.style['pointer-events'] = 'auto'; + + this.pickCanvas = this.container.querySelector('.gl-canvas-pick'); + + + // append canvas, hover svg and mouse div to container + var container = this.container; + container.appendChild(svgContainer); + container.appendChild(mouseContainer); + + var self = this; + mouseContainer.addEventListener('mouseout', function() { + self.isMouseOver = false; + self.unhover(); + }); + mouseContainer.addEventListener('mouseover', function() { + self.isMouseOver = true; + }); +}; + +proto.toImage = function(format) { + if(!format) format = 'png'; + + this.stopped = true; + + if(this.staticPlot) this.container.appendChild(STATIC_CANVAS); + + // update canvas size + this.updateSize(this.canvas); + + + // grab context and yank out pixels + var gl = this.glplot.gl; + var w = gl.drawingBufferWidth; + var h = gl.drawingBufferHeight; + + // force redraw + gl.clearColor(1, 1, 1, 0); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + this.glplot.setDirty(); + this.glplot.draw(); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + var pixels = new Uint8Array(w * h * 4); + gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + + // flip pixels + for(var j = 0, k = h - 1; j < k; ++j, --k) { + for(var i = 0; i < w; ++i) { + for(var l = 0; l < 4; ++l) { + var tmp = pixels[4 * (w * j + i) + l]; + pixels[4 * (w * j + i) + l] = pixels[4 * (w * k + i) + l]; + pixels[4 * (w * k + i) + l] = tmp; + } + } + } + + var canvas = document.createElement('canvas'); + canvas.width = w; + canvas.height = h; + + var context = canvas.getContext('2d'); + var imageData = context.createImageData(w, h); + imageData.data.set(pixels); + context.putImageData(imageData, 0, 0); + + var dataURL; + + switch(format) { + case 'jpeg': + dataURL = canvas.toDataURL('image/jpeg'); + break; + case 'webp': + dataURL = canvas.toDataURL('image/webp'); + break; + default: + dataURL = canvas.toDataURL('image/png'); + } + + if(this.staticPlot) this.container.removeChild(STATIC_CANVAS); + + return dataURL; +}; + +proto.updateSize = function(canvas) { + if(!canvas) canvas = this.canvas; + + var pixelRatio = this.pixelRatio; + var fullLayout = this.fullLayout; + + var width = fullLayout.width; + var height = fullLayout.height; + var pixelWidth = Math.ceil(pixelRatio * width) |0; + var pixelHeight = Math.ceil(pixelRatio * height) |0; + + // check for resize + if(canvas.width !== pixelWidth || canvas.height !== pixelHeight) { + canvas.width = pixelWidth; + canvas.height = pixelHeight; + } + + return canvas; +}; + +proto.computeTickMarks = function() { + this.xaxis.setScale(); + this.yaxis.setScale(); + + var nextTicks = [ + Axes.calcTicks(this.xaxis), + Axes.calcTicks(this.yaxis) + ]; + + for(var j = 0; j < 2; ++j) { + for(var i = 0; i < nextTicks[j].length; ++i) { + // coercing tick value (may not be a string) to a string + nextTicks[j][i].text = nextTicks[j][i].text + ''; + } + } + + return nextTicks; +}; + +function compareTicks(a, b) { + for(var i = 0; i < 2; ++i) { + var aticks = a[i]; + var bticks = b[i]; + + if(aticks.length !== bticks.length) return true; + + for(var j = 0; j < aticks.length; ++j) { + if(aticks[j].x !== bticks[j].x) return true; + } + } + + return false; +} + +proto.updateRefs = function(newFullLayout) { + this.fullLayout = newFullLayout; + + var spmatch = this.id.match(SUBPLOT_PATTERN); + var xaxisName = 'xaxis' + spmatch[1]; + var yaxisName = 'yaxis' + spmatch[2]; + + this.xaxis = this.fullLayout[xaxisName]; + this.yaxis = this.fullLayout[yaxisName]; +}; + +proto.relayoutCallback = function() { + var graphDiv = this.graphDiv; + var xaxis = this.xaxis; + var yaxis = this.yaxis; + var layout = graphDiv.layout; + + // make a meaningful value to be passed on to possible 'plotly_relayout' subscriber(s) + var update = {}; + var xrange = update[xaxis._name + '.range'] = xaxis.range.slice(); + var yrange = update[yaxis._name + '.range'] = yaxis.range.slice(); + update[xaxis._name + '.autorange'] = xaxis.autorange; + update[yaxis._name + '.autorange'] = yaxis.autorange; + + Registry.call('_storeDirectGUIEdit', graphDiv.layout, graphDiv._fullLayout._preGUI, update); + + // update the input layout + var xaIn = layout[xaxis._name]; + xaIn.range = xrange; + xaIn.autorange = xaxis.autorange; + + var yaIn = layout[yaxis._name]; + yaIn.range = yrange; + yaIn.autorange = yaxis.autorange; + + // lastInputTime helps determine which one is the latest input (if async) + update.lastInputTime = this.camera.lastInputTime; + graphDiv.emit('plotly_relayout', update); +}; + +proto.cameraChanged = function() { + var camera = this.camera; + + this.glplot.setDataBox(this.calcDataBox()); + + var nextTicks = this.computeTickMarks(); + var curTicks = this.glplotOptions.ticks; + + if(compareTicks(nextTicks, curTicks)) { + this.glplotOptions.ticks = nextTicks; + this.glplotOptions.dataBox = camera.dataBox; + this.glplot.update(this.glplotOptions); + this.handleAnnotations(); + } +}; + +proto.handleAnnotations = function() { + var gd = this.graphDiv; + var annotations = this.fullLayout.annotations; + + for(var i = 0; i < annotations.length; i++) { + var ann = annotations[i]; + + if(ann.xref === this.xaxis._id && ann.yref === this.yaxis._id) { + Registry.getComponentMethod('annotations', 'drawOne')(gd, i); + } + } +}; + +proto.destroy = function() { + if(!this.glplot) return; + + var traces = this.traces; + + if(traces) { + Object.keys(traces).map(function(key) { + traces[key].dispose(); + delete traces[key]; + }); + } + + this.glplot.dispose(); + + this.container.removeChild(this.svgContainer); + this.container.removeChild(this.mouseContainer); + + this.fullData = null; + this.glplot = null; + this.stopped = true; + this.camera.mouseListener.enabled = false; + this.mouseContainer.removeEventListener('wheel', this.camera.wheelListener); + this.camera = null; +}; + +proto.plot = function(fullData, calcData, fullLayout) { + var glplot = this.glplot; + + this.updateRefs(fullLayout); + this.xaxis.clearCalc(); + this.yaxis.clearCalc(); + this.updateTraces(fullData, calcData); + this.updateFx(fullLayout.dragmode); + + var width = fullLayout.width; + var height = fullLayout.height; + + this.updateSize(this.canvas); + + var options = this.glplotOptions; + options.merge(fullLayout); + options.screenBox = [0, 0, width, height]; + + var mockGraphDiv = {_fullLayout: { + _axisConstraintGroups: fullLayout._axisConstraintGroups, + xaxis: this.xaxis, + yaxis: this.yaxis, + _size: fullLayout._size + }}; + + cleanAxisConstraints(mockGraphDiv, this.xaxis); + cleanAxisConstraints(mockGraphDiv, this.yaxis); + + var size = fullLayout._size; + var domainX = this.xaxis.domain; + var domainY = this.yaxis.domain; + + options.viewBox = [ + size.l + domainX[0] * size.w, + size.b + domainY[0] * size.h, + (width - size.r) - (1 - domainX[1]) * size.w, + (height - size.t) - (1 - domainY[1]) * size.h + ]; + + this.mouseContainer.style.width = size.w * (domainX[1] - domainX[0]) + 'px'; + this.mouseContainer.style.height = size.h * (domainY[1] - domainY[0]) + 'px'; + this.mouseContainer.height = size.h * (domainY[1] - domainY[0]); + this.mouseContainer.style.left = size.l + domainX[0] * size.w + 'px'; + this.mouseContainer.style.top = size.t + (1 - domainY[1]) * size.h + 'px'; + + var ax, i; + + for(i = 0; i < 2; ++i) { + ax = this[AXES[i]]; + ax._length = options.viewBox[i + 2] - options.viewBox[i]; + + doAutoRange(this.graphDiv, ax); + ax.setScale(); + } + + enforceAxisConstraints(mockGraphDiv); + + options.ticks = this.computeTickMarks(); + + options.dataBox = this.calcDataBox(); + + options.merge(fullLayout); + glplot.update(options); + + // force redraw so that promise is returned when rendering is completed + this.glplot.draw(); +}; + +proto.calcDataBox = function() { + var xaxis = this.xaxis; + var yaxis = this.yaxis; + var xrange = xaxis.range; + var yrange = yaxis.range; + var xr2l = xaxis.r2l; + var yr2l = yaxis.r2l; + + return [xr2l(xrange[0]), yr2l(yrange[0]), xr2l(xrange[1]), yr2l(yrange[1])]; +}; + +proto.setRanges = function(dataBox) { + var xaxis = this.xaxis; + var yaxis = this.yaxis; + var xl2r = xaxis.l2r; + var yl2r = yaxis.l2r; + + xaxis.range = [xl2r(dataBox[0]), xl2r(dataBox[2])]; + yaxis.range = [yl2r(dataBox[1]), yl2r(dataBox[3])]; +}; + +proto.updateTraces = function(fullData, calcData) { + var traceIds = Object.keys(this.traces); + var i, j, fullTrace; + + this.fullData = fullData; + + // remove empty traces + traceIdLoop: + for(i = 0; i < traceIds.length; i++) { + var oldUid = traceIds[i]; + var oldTrace = this.traces[oldUid]; + + for(j = 0; j < fullData.length; j++) { + fullTrace = fullData[j]; + + if(fullTrace.uid === oldUid && fullTrace.type === oldTrace.type) { + continue traceIdLoop; + } + } + + oldTrace.dispose(); + delete this.traces[oldUid]; + } + + // update / create trace objects + for(i = 0; i < fullData.length; i++) { + fullTrace = fullData[i]; + var calcTrace = calcData[i]; + var traceObj = this.traces[fullTrace.uid]; + + if(traceObj) traceObj.update(fullTrace, calcTrace); + else { + traceObj = fullTrace._module.plot(this, fullTrace, calcTrace); + this.traces[fullTrace.uid] = traceObj; + } + } + + // order object per traces + this.glplot.objects.sort(function(a, b) { + return a._trace.index - b._trace.index; + }); +}; + +proto.updateFx = function(dragmode) { + // switch to svg interactions in lasso/select mode & shape drawing + if(selectMode(dragmode) || drawMode(dragmode)) { + this.pickCanvas.style['pointer-events'] = 'none'; + this.mouseContainer.style['pointer-events'] = 'none'; + } else { + this.pickCanvas.style['pointer-events'] = 'auto'; + this.mouseContainer.style['pointer-events'] = 'auto'; + } + + // set proper cursor + if(dragmode === 'pan') { + this.mouseContainer.style.cursor = 'move'; + } else if(dragmode === 'zoom') { + this.mouseContainer.style.cursor = 'crosshair'; + } else { + this.mouseContainer.style.cursor = null; + } +}; + +proto.emitPointAction = function(nextSelection, eventType) { + var uid = nextSelection.trace.uid; + var ptNumber = nextSelection.pointIndex; + var trace; + + for(var i = 0; i < this.fullData.length; i++) { + if(this.fullData[i].uid === uid) { + trace = this.fullData[i]; + } + } + + var pointData = { + x: nextSelection.traceCoord[0], + y: nextSelection.traceCoord[1], + curveNumber: trace.index, + pointNumber: ptNumber, + data: trace._input, + fullData: this.fullData, + xaxis: this.xaxis, + yaxis: this.yaxis + }; + + Fx.appendArrayPointValue(pointData, trace, ptNumber); + + this.graphDiv.emit(eventType, {points: [pointData]}); +}; + +proto.draw = function() { + if(this.stopped) return; + + requestAnimationFrame(this.redraw); + + var glplot = this.glplot; + var camera = this.camera; + var mouseListener = camera.mouseListener; + var mouseUp = this.lastButtonState === 1 && mouseListener.buttons === 0; + var fullLayout = this.fullLayout; + + this.lastButtonState = mouseListener.buttons; + + this.cameraChanged(); + + var x = mouseListener.x * glplot.pixelRatio; + var y = this.canvas.height - glplot.pixelRatio * mouseListener.y; + + var result; + + if(camera.boxEnabled && fullLayout.dragmode === 'zoom') { + this.selectBox.enabled = true; + + var selectBox = this.selectBox.selectBox = [ + Math.min(camera.boxStart[0], camera.boxEnd[0]), + Math.min(camera.boxStart[1], camera.boxEnd[1]), + Math.max(camera.boxStart[0], camera.boxEnd[0]), + Math.max(camera.boxStart[1], camera.boxEnd[1]) + ]; + + // 1D zoom + for(var i = 0; i < 2; i++) { + if(camera.boxStart[i] === camera.boxEnd[i]) { + selectBox[i] = glplot.dataBox[i]; + selectBox[i + 2] = glplot.dataBox[i + 2]; + } + } + + glplot.setDirty(); + } else if(!camera.panning && this.isMouseOver) { + this.selectBox.enabled = false; + + var size = fullLayout._size; + var domainX = this.xaxis.domain; + var domainY = this.yaxis.domain; + + result = glplot.pick( + (x / glplot.pixelRatio) + size.l + domainX[0] * size.w, + (y / glplot.pixelRatio) - (size.t + (1 - domainY[1]) * size.h) + ); + + var nextSelection = result && result.object._trace.handlePick(result); + + if(nextSelection && mouseUp) { + this.emitPointAction(nextSelection, 'plotly_click'); + } + + if(result && result.object._trace.hoverinfo !== 'skip' && fullLayout.hovermode) { + if(nextSelection && ( + !this.lastPickResult || + this.lastPickResult.traceUid !== nextSelection.trace.uid || + this.lastPickResult.dataCoord[0] !== nextSelection.dataCoord[0] || + this.lastPickResult.dataCoord[1] !== nextSelection.dataCoord[1]) + ) { + var selection = nextSelection; + + this.lastPickResult = { + traceUid: nextSelection.trace ? nextSelection.trace.uid : null, + dataCoord: nextSelection.dataCoord.slice() + }; + this.spikes.update({ center: result.dataCoord }); + + selection.screenCoord = [ + ((glplot.viewBox[2] - glplot.viewBox[0]) * + (result.dataCoord[0] - glplot.dataBox[0]) / + (glplot.dataBox[2] - glplot.dataBox[0]) + glplot.viewBox[0]) / + glplot.pixelRatio, + (this.canvas.height - (glplot.viewBox[3] - glplot.viewBox[1]) * + (result.dataCoord[1] - glplot.dataBox[1]) / + (glplot.dataBox[3] - glplot.dataBox[1]) - glplot.viewBox[1]) / + glplot.pixelRatio + ]; + + // this needs to happen before the next block that deletes traceCoord data + // also it's important to copy, otherwise data is lost by the time event data is read + this.emitPointAction(nextSelection, 'plotly_hover'); + + var trace = this.fullData[selection.trace.index] || {}; + var ptNumber = selection.pointIndex; + var hoverinfo = Fx.castHoverinfo(trace, fullLayout, ptNumber); + + if(hoverinfo && hoverinfo !== 'all') { + var parts = hoverinfo.split('+'); + if(parts.indexOf('x') === -1) selection.traceCoord[0] = undefined; + if(parts.indexOf('y') === -1) selection.traceCoord[1] = undefined; + if(parts.indexOf('z') === -1) selection.traceCoord[2] = undefined; + if(parts.indexOf('text') === -1) selection.textLabel = undefined; + if(parts.indexOf('name') === -1) selection.name = undefined; + } + + Fx.loneHover({ + x: selection.screenCoord[0], + y: selection.screenCoord[1], + xLabel: this.hoverFormatter('xaxis', selection.traceCoord[0]), + yLabel: this.hoverFormatter('yaxis', selection.traceCoord[1]), + zLabel: selection.traceCoord[2], + text: selection.textLabel, + name: selection.name, + color: Fx.castHoverOption(trace, ptNumber, 'bgcolor') || selection.color, + borderColor: Fx.castHoverOption(trace, ptNumber, 'bordercolor'), + fontFamily: Fx.castHoverOption(trace, ptNumber, 'font.family'), + fontSize: Fx.castHoverOption(trace, ptNumber, 'font.size'), + fontColor: Fx.castHoverOption(trace, ptNumber, 'font.color'), + nameLength: Fx.castHoverOption(trace, ptNumber, 'namelength'), + textAlign: Fx.castHoverOption(trace, ptNumber, 'align') + }, { + container: this.svgContainer, + gd: this.graphDiv + }); + } + } + } + + // Remove hover effects if we're not over a point OR + // if we're zooming or panning (in which case result is not set) + if(!result) { + this.unhover(); + } + + glplot.draw(); +}; + +proto.unhover = function() { + if(this.lastPickResult) { + this.spikes.update({}); + this.lastPickResult = null; + this.graphDiv.emit('plotly_unhover'); + Fx.loneUnhover(this.svgContainer); + } +}; + +proto.hoverFormatter = function(axisName, val) { + if(val === undefined) return undefined; + + var axis = this[axisName]; + return Axes.tickText(axis, axis.c2l(val), 'hover').text; +}; + +},{"../../components/dragelement/helpers":542,"../../components/fx":564,"../../lib/show_no_webgl_msg":682,"../../plots/cartesian/axes":711,"../../registry":788,"../cartesian/autorange":710,"../cartesian/constants":718,"../cartesian/constraints":719,"./camera":749,"./convert":750,"gl-plot2d":226,"gl-select-box":240,"gl-spikes2d":249,"webgl-context":487}],753:[function(_dereq_,module,exports){ +'use strict'; + +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; +var fxAttrs = _dereq_('../../components/fx/layout_attributes'); + +var Scene = _dereq_('./scene'); +var getSubplotData = _dereq_('../get_data').getSubplotData; +var Lib = _dereq_('../../lib'); +var xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces'); + +var GL3D = 'gl3d'; +var SCENE = 'scene'; + + +exports.name = GL3D; + +exports.attr = SCENE; + +exports.idRoot = SCENE; + +exports.idRegex = exports.attrRegex = Lib.counterRegex('scene'); + +exports.attributes = _dereq_('./layout/attributes'); + +exports.layoutAttributes = _dereq_('./layout/layout_attributes'); + +exports.baseLayoutAttrOverrides = overrideAll({ + hoverlabel: fxAttrs.hoverlabel +}, 'plot', 'nested'); + +exports.supplyLayoutDefaults = _dereq_('./layout/defaults'); + +exports.plot = function plot(gd) { + var fullLayout = gd._fullLayout; + var fullData = gd._fullData; + var sceneIds = fullLayout._subplots[GL3D]; + + for(var i = 0; i < sceneIds.length; i++) { + var sceneId = sceneIds[i]; + var fullSceneData = getSubplotData(fullData, GL3D, sceneId); + var sceneLayout = fullLayout[sceneId]; + var camera = sceneLayout.camera; + var scene = sceneLayout._scene; + + if(!scene) { + scene = new Scene({ + id: sceneId, + graphDiv: gd, + container: gd.querySelector('.gl-container'), + staticPlot: gd._context.staticPlot, + plotGlPixelRatio: gd._context.plotGlPixelRatio, + camera: camera + }, + fullLayout + ); + + // set ref to Scene instance + sceneLayout._scene = scene; + } + + // save 'initial' camera view settings for modebar button + if(!scene.viewInitial) { + scene.viewInitial = { + up: { + x: camera.up.x, + y: camera.up.y, + z: camera.up.z + }, + eye: { + x: camera.eye.x, + y: camera.eye.y, + z: camera.eye.z + }, + center: { + x: camera.center.x, + y: camera.center.y, + z: camera.center.z + } + }; + } + + scene.plot(fullSceneData, fullLayout, gd.layout); + } +}; + +exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) { + var oldSceneKeys = oldFullLayout._subplots[GL3D] || []; + + for(var i = 0; i < oldSceneKeys.length; i++) { + var oldSceneKey = oldSceneKeys[i]; + + if(!newFullLayout[oldSceneKey] && !!oldFullLayout[oldSceneKey]._scene) { + oldFullLayout[oldSceneKey]._scene.destroy(); + + if(oldFullLayout._infolayer) { + oldFullLayout._infolayer + .selectAll('.annotation-' + oldSceneKey) + .remove(); + } + } + } +}; + +exports.toSVG = function(gd) { + var fullLayout = gd._fullLayout; + var sceneIds = fullLayout._subplots[GL3D]; + var size = fullLayout._size; + + for(var i = 0; i < sceneIds.length; i++) { + var sceneLayout = fullLayout[sceneIds[i]]; + var domain = sceneLayout.domain; + var scene = sceneLayout._scene; + + var imageData = scene.toImage('png'); + var image = fullLayout._glimages.append('svg:image'); + + image.attr({ + xmlns: xmlnsNamespaces.svg, + 'xlink:href': imageData, + x: size.l + size.w * domain.x[0], + y: size.t + size.h * (1 - domain.y[1]), + width: size.w * (domain.x[1] - domain.x[0]), + height: size.h * (domain.y[1] - domain.y[0]), + preserveAspectRatio: 'none' + }); + + scene.destroy(); + } +}; + +// clean scene ids, 'scene1' -> 'scene' +exports.cleanId = function cleanId(id) { + if(!id.match(/^scene[0-9]*$/)) return; + + var sceneNum = id.substr(5); + if(sceneNum === '1') sceneNum = ''; + + return SCENE + sceneNum; +}; + +exports.updateFx = function(gd) { + var fullLayout = gd._fullLayout; + var subplotIds = fullLayout._subplots[GL3D]; + + for(var i = 0; i < subplotIds.length; i++) { + var subplotObj = fullLayout[subplotIds[i]]._scene; + subplotObj.updateFx(fullLayout.dragmode, fullLayout.hovermode); + } +}; + +},{"../../components/fx/layout_attributes":565,"../../constants/xmlns_namespaces":638,"../../lib":661,"../../plot_api/edit_types":693,"../get_data":748,"./layout/attributes":754,"./layout/defaults":758,"./layout/layout_attributes":759,"./scene":763}],754:[function(_dereq_,module,exports){ +'use strict'; + + +module.exports = { + scene: { + valType: 'subplotid', + dflt: 'scene', + editType: 'calc+clearAxisTypes', + } +}; + +},{}],755:[function(_dereq_,module,exports){ +'use strict'; + +var Color = _dereq_('../../../components/color'); +var axesAttrs = _dereq_('../../cartesian/layout_attributes'); +var extendFlat = _dereq_('../../../lib/extend').extendFlat; +var overrideAll = _dereq_('../../../plot_api/edit_types').overrideAll; + +module.exports = overrideAll({ + visible: axesAttrs.visible, + showspikes: { + valType: 'boolean', + dflt: true, + }, + spikesides: { + valType: 'boolean', + dflt: true, + }, + spikethickness: { + valType: 'number', + min: 0, + dflt: 2, + }, + spikecolor: { + valType: 'color', + dflt: Color.defaultLine, + }, + showbackground: { + valType: 'boolean', + dflt: false, + }, + backgroundcolor: { + valType: 'color', + dflt: 'rgba(204, 204, 204, 0.5)', + }, + showaxeslabels: { + valType: 'boolean', + dflt: true, + }, + color: axesAttrs.color, + categoryorder: axesAttrs.categoryorder, + categoryarray: axesAttrs.categoryarray, + title: { + text: axesAttrs.title.text, + font: axesAttrs.title.font + }, + type: extendFlat({}, axesAttrs.type, { + values: ['-', 'linear', 'log', 'date', 'category'] + }), + autotypenumbers: axesAttrs.autotypenumbers, + autorange: axesAttrs.autorange, + rangemode: axesAttrs.rangemode, + range: extendFlat({}, axesAttrs.range, { + items: [ + {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}}, + {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}} + ], + anim: false + }), + // ticks + tickmode: axesAttrs.tickmode, + nticks: axesAttrs.nticks, + tick0: axesAttrs.tick0, + dtick: axesAttrs.dtick, + tickvals: axesAttrs.tickvals, + ticktext: axesAttrs.ticktext, + ticks: axesAttrs.ticks, + mirror: axesAttrs.mirror, + ticklen: axesAttrs.ticklen, + tickwidth: axesAttrs.tickwidth, + tickcolor: axesAttrs.tickcolor, + showticklabels: axesAttrs.showticklabels, + tickfont: axesAttrs.tickfont, + tickangle: axesAttrs.tickangle, + tickprefix: axesAttrs.tickprefix, + showtickprefix: axesAttrs.showtickprefix, + ticksuffix: axesAttrs.ticksuffix, + showticksuffix: axesAttrs.showticksuffix, + showexponent: axesAttrs.showexponent, + exponentformat: axesAttrs.exponentformat, + minexponent: axesAttrs.minexponent, + separatethousands: axesAttrs.separatethousands, + tickformat: axesAttrs.tickformat, + tickformatstops: axesAttrs.tickformatstops, + hoverformat: axesAttrs.hoverformat, + // lines and grids + showline: axesAttrs.showline, + linecolor: axesAttrs.linecolor, + linewidth: axesAttrs.linewidth, + showgrid: axesAttrs.showgrid, + gridcolor: extendFlat({}, axesAttrs.gridcolor, // shouldn't this be on-par with 2D? + {dflt: 'rgb(204, 204, 204)'}), + gridwidth: axesAttrs.gridwidth, + zeroline: axesAttrs.zeroline, + zerolinecolor: axesAttrs.zerolinecolor, + zerolinewidth: axesAttrs.zerolinewidth, + _deprecated: { + title: axesAttrs._deprecated.title, + titlefont: axesAttrs._deprecated.titlefont + } +}, 'plot', 'from-root'); + +},{"../../../components/color":524,"../../../lib/extend":651,"../../../plot_api/edit_types":693,"../../cartesian/layout_attributes":726}],756:[function(_dereq_,module,exports){ +'use strict'; + +var colorMix = _dereq_('tinycolor2').mix; + +var Lib = _dereq_('../../../lib'); +var Template = _dereq_('../../../plot_api/plot_template'); + +var layoutAttributes = _dereq_('./axis_attributes'); +var handleTypeDefaults = _dereq_('../../cartesian/type_defaults'); +var handleAxisDefaults = _dereq_('../../cartesian/axis_defaults'); + +var axesNames = ['xaxis', 'yaxis', 'zaxis']; + +// TODO: hard-coded lightness fraction based on gridline default colors +// that differ from other subplot types. +var gridLightness = 100 * (204 - 0x44) / (255 - 0x44); + +module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { + var containerIn, containerOut; + + function coerce(attr, dflt) { + return Lib.coerce(containerIn, containerOut, layoutAttributes, attr, dflt); + } + + for(var j = 0; j < axesNames.length; j++) { + var axName = axesNames[j]; + containerIn = layoutIn[axName] || {}; + + containerOut = Template.newContainer(layoutOut, axName); + containerOut._id = axName[0] + options.scene; + containerOut._name = axName; + + handleTypeDefaults(containerIn, containerOut, coerce, options); + + handleAxisDefaults( + containerIn, + containerOut, + coerce, + { + font: options.font, + letter: axName[0], + data: options.data, + showGrid: true, + noTickson: true, + noTicklabelmode: true, + noTicklabelposition: true, + noTicklabeloverflow: true, + bgColor: options.bgColor, + calendar: options.calendar + }, + options.fullLayout); + + coerce('gridcolor', colorMix(containerOut.color, options.bgColor, gridLightness).toRgbString()); + coerce('title.text', axName[0]); // shouldn't this be on-par with 2D? + + containerOut.setScale = Lib.noop; + + if(coerce('showspikes')) { + coerce('spikesides'); + coerce('spikethickness'); + coerce('spikecolor', containerOut.color); + } + + coerce('showaxeslabels'); + if(coerce('showbackground')) coerce('backgroundcolor'); + } +}; + +},{"../../../lib":661,"../../../plot_api/plot_template":700,"../../cartesian/axis_defaults":713,"../../cartesian/type_defaults":737,"./axis_attributes":755,"tinycolor2":471}],757:[function(_dereq_,module,exports){ +'use strict'; + +var str2RgbaArray = _dereq_('../../../lib/str2rgbarray'); +var Lib = _dereq_('../../../lib'); + +var AXES_NAMES = ['xaxis', 'yaxis', 'zaxis']; + +function AxesOptions() { + this.bounds = [ + [-10, -10, -10], + [10, 10, 10] + ]; + + this.ticks = [ [], [], [] ]; + this.tickEnable = [ true, true, true ]; + 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 = [ true, true, true ]; + this.labelFont = ['Open Sans', 'Open Sans', 'Open Sans']; + this.labelSize = [ 20, 20, 20 ]; + this.labelColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ]; + this.labelPad = [ 30, 30, 30 ]; + + this.lineEnable = [ true, true, true ]; + this.lineMirror = [ false, false, false ]; + this.lineWidth = [ 1, 1, 1 ]; + this.lineColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ]; + + this.lineTickEnable = [ true, true, true ]; + this.lineTickMirror = [ false, false, false ]; + 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 = [ true, true, true ]; + this.gridWidth = [ 1, 1, 1 ]; + this.gridColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ]; + + this.zeroEnable = [ true, true, true ]; + this.zeroLineColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ]; + this.zeroLineWidth = [ 2, 2, 2 ]; + + this.backgroundEnable = [ true, true, true ]; + this.backgroundColor = [ [0.8, 0.8, 0.8, 0.5], + [0.8, 0.8, 0.8, 0.5], + [0.8, 0.8, 0.8, 0.5] ]; + + // some default values are stored for applying model transforms + this._defaultTickPad = this.tickPad.slice(); + this._defaultLabelPad = this.labelPad.slice(); + this._defaultLineTickLength = this.lineTickLength.slice(); +} + +var proto = AxesOptions.prototype; + +proto.merge = function(fullLayout, sceneLayout) { + var opts = this; + for(var i = 0; i < 3; ++i) { + var axes = sceneLayout[AXES_NAMES[i]]; + + if(!axes.visible) { + opts.tickEnable[i] = false; + opts.labelEnable[i] = false; + opts.lineEnable[i] = false; + opts.lineTickEnable[i] = false; + opts.gridEnable[i] = false; + opts.zeroEnable[i] = false; + opts.backgroundEnable[i] = false; + continue; + } + + // Axes labels + opts.labels[i] = fullLayout._meta ? + Lib.templateString(axes.title.text, fullLayout._meta) : + axes.title.text; + + if('font' in axes.title) { + if(axes.title.font.color) opts.labelColor[i] = str2RgbaArray(axes.title.font.color); + if(axes.title.font.family) opts.labelFont[i] = axes.title.font.family; + if(axes.title.font.size) opts.labelSize[i] = axes.title.font.size; + } + + // Lines + if('showline' in axes) opts.lineEnable[i] = axes.showline; + if('linecolor' in axes) opts.lineColor[i] = str2RgbaArray(axes.linecolor); + if('linewidth' in axes) opts.lineWidth[i] = axes.linewidth; + + if('showgrid' in axes) opts.gridEnable[i] = axes.showgrid; + if('gridcolor' in axes) opts.gridColor[i] = str2RgbaArray(axes.gridcolor); + if('gridwidth' in axes) opts.gridWidth[i] = axes.gridwidth; + + // Remove zeroline if axis type is log + // otherwise the zeroline is incorrectly drawn at 1 on log axes + if(axes.type === 'log') opts.zeroEnable[i] = false; + else if('zeroline' in axes) opts.zeroEnable[i] = axes.zeroline; + if('zerolinecolor' in axes) opts.zeroLineColor[i] = str2RgbaArray(axes.zerolinecolor); + if('zerolinewidth' in axes) opts.zeroLineWidth[i] = axes.zerolinewidth; + + // tick lines + if('ticks' in axes && !!axes.ticks) opts.lineTickEnable[i] = true; + else opts.lineTickEnable[i] = false; + + if('ticklen' in axes) { + opts.lineTickLength[i] = opts._defaultLineTickLength[i] = axes.ticklen; + } + if('tickcolor' in axes) opts.lineTickColor[i] = str2RgbaArray(axes.tickcolor); + if('tickwidth' in axes) opts.lineTickWidth[i] = axes.tickwidth; + if('tickangle' in axes) { + opts.tickAngle[i] = (axes.tickangle === 'auto') ? + -3600 : // i.e. special number to set auto option + Math.PI * -axes.tickangle / 180; + } + + // tick labels + if('showticklabels' in axes) opts.tickEnable[i] = axes.showticklabels; + if('tickfont' in axes) { + if(axes.tickfont.color) opts.tickColor[i] = str2RgbaArray(axes.tickfont.color); + if(axes.tickfont.family) opts.tickFont[i] = axes.tickfont.family; + if(axes.tickfont.size) opts.tickSize[i] = axes.tickfont.size; + } + + if('mirror' in axes) { + if(['ticks', 'all', 'allticks'].indexOf(axes.mirror) !== -1) { + opts.lineTickMirror[i] = true; + opts.lineMirror[i] = true; + } else if(axes.mirror === true) { + opts.lineTickMirror[i] = false; + opts.lineMirror[i] = true; + } else { + opts.lineTickMirror[i] = false; + opts.lineMirror[i] = false; + } + } else opts.lineMirror[i] = false; + + // grid background + if('showbackground' in axes && axes.showbackground !== false) { + opts.backgroundEnable[i] = true; + opts.backgroundColor[i] = str2RgbaArray(axes.backgroundcolor); + } else opts.backgroundEnable[i] = false; + } +}; + + +function createAxesOptions(fullLayout, sceneLayout) { + var result = new AxesOptions(); + result.merge(fullLayout, sceneLayout); + return result; +} + +module.exports = createAxesOptions; + +},{"../../../lib":661,"../../../lib/str2rgbarray":685}],758:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../../lib'); +var Color = _dereq_('../../../components/color'); +var Registry = _dereq_('../../../registry'); + +var handleSubplotDefaults = _dereq_('../../subplot_defaults'); +var supplyGl3dAxisLayoutDefaults = _dereq_('./axis_defaults'); +var layoutAttributes = _dereq_('./layout_attributes'); +var getSubplotData = _dereq_('../../get_data').getSubplotData; + +var GL3D = 'gl3d'; + +module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { + var hasNon3D = layoutOut._basePlotModules.length > 1; + + // some layout-wide attribute are used in all scenes + // if 3D is the only visible plot type + function getDfltFromLayout(attr) { + if(hasNon3D) return; + + var isValid = Lib.validate(layoutIn[attr], layoutAttributes[attr]); + if(isValid) return layoutIn[attr]; + } + + handleSubplotDefaults(layoutIn, layoutOut, fullData, { + type: GL3D, + attributes: layoutAttributes, + handleDefaults: handleGl3dDefaults, + fullLayout: layoutOut, + font: layoutOut.font, + fullData: fullData, + getDfltFromLayout: getDfltFromLayout, + autotypenumbersDflt: layoutOut.autotypenumbers, + paper_bgcolor: layoutOut.paper_bgcolor, + calendar: layoutOut.calendar + }); +}; + +function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { + /* + * Scene numbering proceeds as follows + * scene + * scene2 + * scene3 + * + * and d.scene will be undefined or some number or number string + * + * Also write back a blank scene object to user layout so that some + * attributes like aspectratio can be written back dynamically. + */ + + var bgcolor = coerce('bgcolor'); + var bgColorCombined = Color.combine(bgcolor, opts.paper_bgcolor); + + var cameraKeys = ['up', 'center', 'eye']; + + for(var j = 0; j < cameraKeys.length; j++) { + coerce('camera.' + cameraKeys[j] + '.x'); + coerce('camera.' + cameraKeys[j] + '.y'); + coerce('camera.' + cameraKeys[j] + '.z'); + } + + coerce('camera.projection.type'); + + /* + * coerce to positive number (min 0) but also do not accept 0 (>0 not >=0) + * note that 0's go false with the !! call + */ + var hasAspect = !!coerce('aspectratio.x') && + !!coerce('aspectratio.y') && + !!coerce('aspectratio.z'); + + var defaultAspectMode = hasAspect ? 'manual' : 'auto'; + var aspectMode = coerce('aspectmode', defaultAspectMode); + + /* + * We need aspectratio object in all the Layouts as it is dynamically set + * in the calculation steps, ie, we cant set the correct data now, it happens later. + * We must also account for the case the user sends bad ratio data with 'manual' set + * for the mode. In this case we must force change it here as the default coerce + * misses it above. + */ + if(!hasAspect) { + sceneLayoutIn.aspectratio = sceneLayoutOut.aspectratio = {x: 1, y: 1, z: 1}; + + if(aspectMode === 'manual') sceneLayoutOut.aspectmode = 'auto'; + + /* + * kind of like autorange - we need the calculated aspectmode back in + * the input layout or relayout can cause problems later + */ + sceneLayoutIn.aspectmode = sceneLayoutOut.aspectmode; + } + + var fullGl3dData = getSubplotData(opts.fullData, GL3D, opts.id); + + supplyGl3dAxisLayoutDefaults(sceneLayoutIn, sceneLayoutOut, { + font: opts.font, + scene: opts.id, + data: fullGl3dData, + bgColor: bgColorCombined, + calendar: opts.calendar, + autotypenumbersDflt: opts.autotypenumbersDflt, + fullLayout: opts.fullLayout + }); + + Registry.getComponentMethod('annotations3d', 'handleDefaults')( + sceneLayoutIn, sceneLayoutOut, opts + ); + + var dragmode = opts.getDfltFromLayout('dragmode'); + + if(dragmode !== false) { + if(!dragmode) { + dragmode = 'orbit'; + + if(sceneLayoutIn.camera && + sceneLayoutIn.camera.up) { + var x = sceneLayoutIn.camera.up.x; + var y = sceneLayoutIn.camera.up.y; + var z = sceneLayoutIn.camera.up.z; + + if(z !== 0) { + if(!x || !y || !z) { + dragmode = 'turntable'; + } else if(z / Math.sqrt(x * x + y * y + z * z) > 0.999) { + dragmode = 'turntable'; + } + } + } else { + dragmode = 'turntable'; + } + } + } + + coerce('dragmode', dragmode); + coerce('hovermode', opts.getDfltFromLayout('hovermode')); +} + +},{"../../../components/color":524,"../../../lib":661,"../../../registry":788,"../../get_data":748,"../../subplot_defaults":782,"./axis_defaults":756,"./layout_attributes":759}],759:[function(_dereq_,module,exports){ +'use strict'; + +var gl3dAxisAttrs = _dereq_('./axis_attributes'); +var domainAttrs = _dereq_('../../domain').attributes; +var extendFlat = _dereq_('../../../lib/extend').extendFlat; +var counterRegex = _dereq_('../../../lib').counterRegex; + +function makeCameraVector(x, y, z) { + return { + x: { + valType: 'number', + dflt: x, + editType: 'camera' + }, + y: { + valType: 'number', + dflt: y, + editType: 'camera' + }, + z: { + valType: 'number', + dflt: z, + editType: 'camera' + }, + editType: 'camera' + }; +} + +module.exports = { + _arrayAttrRegexps: [counterRegex('scene', '.annotations', true)], + + bgcolor: { + valType: 'color', + dflt: 'rgba(0,0,0,0)', + editType: 'plot' + }, + camera: { + up: extendFlat(makeCameraVector(0, 0, 1), { + }), + center: extendFlat(makeCameraVector(0, 0, 0), { + }), + eye: extendFlat(makeCameraVector(1.25, 1.25, 1.25), { + }), + projection: { + type: { + valType: 'enumerated', + values: ['perspective', 'orthographic'], + dflt: 'perspective', + editType: 'calc', + }, + editType: 'calc' + }, + editType: 'camera' + }, + domain: domainAttrs({name: 'scene', editType: 'plot'}), + aspectmode: { + valType: 'enumerated', + values: ['auto', 'cube', 'data', 'manual'], + dflt: 'auto', + editType: 'plot', + impliedEdits: { + 'aspectratio.x': undefined, + 'aspectratio.y': undefined, + 'aspectratio.z': undefined + }, + }, + aspectratio: { // must be positive (0's are coerced to 1) + x: { + valType: 'number', + min: 0, + editType: 'plot', + impliedEdits: {'^aspectmode': 'manual'} + }, + y: { + valType: 'number', + min: 0, + editType: 'plot', + impliedEdits: {'^aspectmode': 'manual'} + }, + z: { + valType: 'number', + min: 0, + editType: 'plot', + impliedEdits: {'^aspectmode': 'manual'} + }, + editType: 'plot', + impliedEdits: {aspectmode: 'manual'}, + }, + + xaxis: gl3dAxisAttrs, + yaxis: gl3dAxisAttrs, + zaxis: gl3dAxisAttrs, + + dragmode: { + valType: 'enumerated', + values: ['orbit', 'turntable', 'zoom', 'pan', false], + editType: 'plot', + }, + hovermode: { + valType: 'enumerated', + values: ['closest', false], + dflt: 'closest', + editType: 'modebar', + }, + uirevision: { + valType: 'any', + editType: 'none', + }, + editType: 'plot', + + _deprecated: { + cameraposition: { + valType: 'info_array', + editType: 'camera', + } + } +}; + +},{"../../../lib":661,"../../../lib/extend":651,"../../domain":739,"./axis_attributes":755}],760:[function(_dereq_,module,exports){ +'use strict'; + +var str2RGBArray = _dereq_('../../../lib/str2rgbarray'); + +var AXES_NAMES = ['xaxis', 'yaxis', 'zaxis']; + +function SpikeOptions() { + this.enabled = [true, true, true]; + this.colors = [[0, 0, 0, 1], + [0, 0, 0, 1], + [0, 0, 0, 1]]; + this.drawSides = [true, true, true]; + this.lineWidth = [1, 1, 1]; +} + +var proto = SpikeOptions.prototype; + +proto.merge = function(sceneLayout) { + for(var i = 0; i < 3; ++i) { + var axes = sceneLayout[AXES_NAMES[i]]; + + if(!axes.visible) { + this.enabled[i] = false; + this.drawSides[i] = false; + continue; + } + + this.enabled[i] = axes.showspikes; + this.colors[i] = str2RGBArray(axes.spikecolor); + this.drawSides[i] = axes.spikesides; + this.lineWidth[i] = axes.spikethickness; + } +}; + +function createSpikeOptions(layout) { + var result = new SpikeOptions(); + result.merge(layout); + return result; +} + +module.exports = createSpikeOptions; + +},{"../../../lib/str2rgbarray":685}],761:[function(_dereq_,module,exports){ +/* eslint block-scoped-var: 0*/ +/* eslint no-redeclare: 0*/ + +'use strict'; + +module.exports = computeTickMarks; + +var Axes = _dereq_('../../cartesian/axes'); +var Lib = _dereq_('../../../lib'); + +var AXES_NAMES = ['xaxis', 'yaxis', 'zaxis']; + +var centerPoint = [0, 0, 0]; + +function contourLevelsFromTicks(ticks) { + var result = new Array(3); + for(var i = 0; i < 3; ++i) { + var tlevel = ticks[i]; + var clevel = new Array(tlevel.length); + for(var j = 0; j < tlevel.length; ++j) { + clevel[j] = tlevel[j].x; + } + result[i] = clevel; + } + return result; +} + +function computeTickMarks(scene) { + var axesOptions = scene.axesOptions; + var glRange = scene.glplot.axesPixels; + var sceneLayout = scene.fullSceneLayout; + + var ticks = [[], [], []]; + + for(var i = 0; i < 3; ++i) { + var axes = sceneLayout[AXES_NAMES[i]]; + + axes._length = (glRange[i].hi - glRange[i].lo) * + glRange[i].pixelsPerDataUnit / scene.dataScale[i]; + + if(Math.abs(axes._length) === Infinity || + isNaN(axes._length)) { + ticks[i] = []; + } else { + axes._input_range = axes.range.slice(); + axes.range[0] = (glRange[i].lo) / scene.dataScale[i]; + axes.range[1] = (glRange[i].hi) / scene.dataScale[i]; + axes._m = 1.0 / (scene.dataScale[i] * glRange[i].pixelsPerDataUnit); + + if(axes.range[0] === axes.range[1]) { + axes.range[0] -= 1; + axes.range[1] += 1; + } + // this is necessary to short-circuit the 'y' handling + // in autotick part of calcTicks... Treating all axes as 'y' in this case + // running the autoticks here, then setting + // autoticks to false to get around the 2D handling in calcTicks. + var tickModeCached = axes.tickmode; + if(axes.tickmode === 'auto') { + axes.tickmode = 'linear'; + var nticks = axes.nticks || Lib.constrain((axes._length / 40), 4, 9); + Axes.autoTicks(axes, Math.abs(axes.range[1] - axes.range[0]) / nticks); + } + var dataTicks = Axes.calcTicks(axes, { msUTC: true }); + for(var j = 0; j < dataTicks.length; ++j) { + dataTicks[j].x = dataTicks[j].x * scene.dataScale[i]; + + if(axes.type === 'date') { + dataTicks[j].text = + dataTicks[j].text.replace(/\/g, ' '); + } + } + ticks[i] = dataTicks; + + + axes.tickmode = tickModeCached; + } + } + + axesOptions.ticks = ticks; + + // Calculate tick lengths dynamically + for(var i = 0; i < 3; ++i) { + centerPoint[i] = 0.5 * (scene.glplot.bounds[0][i] + scene.glplot.bounds[1][i]); + for(var j = 0; j < 2; ++j) { + axesOptions.bounds[j][i] = scene.glplot.bounds[j][i]; + } + } + + scene.contourLevels = contourLevelsFromTicks(ticks); +} + +},{"../../../lib":661,"../../cartesian/axes":711}],762:[function(_dereq_,module,exports){ 'use strict'; function xformMatrix(m, v) { @@ -145104,7 +187169,1156 @@ function project(camera, v) { module.exports = project; -},{}],429:[function(_dereq_,module,exports){ +},{}],763:[function(_dereq_,module,exports){ +'use strict'; + +var glPlot3d = _dereq_('gl-plot3d'); +var createCamera = glPlot3d.createCamera; +var createPlot = glPlot3d.createScene; + +var getContext = _dereq_('webgl-context'); +var passiveSupported = _dereq_('has-passive-events'); + +var Registry = _dereq_('../../registry'); +var Lib = _dereq_('../../lib'); +var preserveDrawingBuffer = Lib.preserveDrawingBuffer(); + +var Axes = _dereq_('../../plots/cartesian/axes'); +var Fx = _dereq_('../../components/fx'); + +var str2RGBAarray = _dereq_('../../lib/str2rgbarray'); +var showNoWebGlMsg = _dereq_('../../lib/show_no_webgl_msg'); + +var project = _dereq_('./project'); +var createAxesOptions = _dereq_('./layout/convert'); +var createSpikeOptions = _dereq_('./layout/spikes'); +var computeTickMarks = _dereq_('./layout/tick_marks'); + +var STATIC_CANVAS, STATIC_CONTEXT; + +function Scene(options, fullLayout) { + // create sub container for plot + var sceneContainer = document.createElement('div'); + var plotContainer = options.container; + + // keep a ref to the graph div to fire hover+click events + this.graphDiv = options.graphDiv; + + // create SVG container for hover text + var svgContainer = document.createElementNS( + 'http://www.w3.org/2000/svg', + 'svg'); + svgContainer.style.position = 'absolute'; + svgContainer.style.top = svgContainer.style.left = '0px'; + svgContainer.style.width = svgContainer.style.height = '100%'; + svgContainer.style['z-index'] = 20; + svgContainer.style['pointer-events'] = 'none'; + sceneContainer.appendChild(svgContainer); + this.svgContainer = svgContainer; + + // Tag the container with the sceneID + sceneContainer.id = options.id; + sceneContainer.style.position = 'absolute'; + sceneContainer.style.top = sceneContainer.style.left = '0px'; + sceneContainer.style.width = sceneContainer.style.height = '100%'; + plotContainer.appendChild(sceneContainer); + + this.fullLayout = fullLayout; + this.id = options.id || 'scene'; + this.fullSceneLayout = fullLayout[this.id]; + + // Saved from last call to plot() + this.plotArgs = [ [], {}, {} ]; + + /* + * Move this to calc step? Why does it work here? + */ + this.axesOptions = createAxesOptions(fullLayout, fullLayout[this.id]); + this.spikeOptions = createSpikeOptions(fullLayout[this.id]); + this.container = sceneContainer; + this.staticMode = !!options.staticPlot; + this.pixelRatio = this.pixelRatio || options.plotGlPixelRatio || 2; + + // Coordinate rescaling + this.dataScale = [1, 1, 1]; + + this.contourLevels = [ [], [], [] ]; + + this.convertAnnotations = Registry.getComponentMethod('annotations3d', 'convert'); + this.drawAnnotations = Registry.getComponentMethod('annotations3d', 'draw'); + + this.initializeGLPlot(); +} + +var proto = Scene.prototype; + +proto.prepareOptions = function() { + var scene = this; + + var opts = { + canvas: scene.canvas, + gl: scene.gl, + glOptions: { + preserveDrawingBuffer: preserveDrawingBuffer, + premultipliedAlpha: true, + antialias: true + }, + container: scene.container, + axes: scene.axesOptions, + spikes: scene.spikeOptions, + pickRadius: 10, + snapToData: true, + autoScale: true, + autoBounds: false, + cameraObject: scene.camera, + pixelRatio: scene.pixelRatio + }; + + // for static plots, we reuse the WebGL context + // as WebKit doesn't collect them reliably + if(scene.staticMode) { + if(!STATIC_CONTEXT) { + STATIC_CANVAS = document.createElement('canvas'); + STATIC_CONTEXT = getContext({ + canvas: STATIC_CANVAS, + preserveDrawingBuffer: true, + premultipliedAlpha: true, + antialias: true + }); + if(!STATIC_CONTEXT) { + throw new Error('error creating static canvas/context for image server'); + } + } + + opts.gl = STATIC_CONTEXT; + opts.canvas = STATIC_CANVAS; + } + + return opts; +}; + +var firstInit = true; + +proto.tryCreatePlot = function() { + var scene = this; + + var opts = scene.prepareOptions(); + + var success = true; + + try { + scene.glplot = createPlot(opts); + } catch(e) { + if(scene.staticMode || !firstInit || preserveDrawingBuffer) { + success = false; + } else { // try second time + // enable preserveDrawingBuffer setup + // in case is-mobile not detecting the right device + Lib.warn([ + 'webgl setup failed possibly due to', + 'false preserveDrawingBuffer config.', + 'The mobile/tablet device may not be detected by is-mobile module.', + 'Enabling preserveDrawingBuffer in second attempt to create webgl scene...' + ].join(' ')); + + try { + // invert preserveDrawingBuffer + preserveDrawingBuffer = opts.glOptions.preserveDrawingBuffer = true; + + scene.glplot = createPlot(opts); + } catch(e) { + // revert changes to preserveDrawingBuffer + preserveDrawingBuffer = opts.glOptions.preserveDrawingBuffer = false; + + success = false; + } + } + } + + firstInit = false; + + return success; +}; + +proto.initializeGLCamera = function() { + var scene = this; + var cameraData = scene.fullSceneLayout.camera; + var isOrtho = (cameraData.projection.type === 'orthographic'); + + scene.camera = createCamera(scene.container, { + center: [cameraData.center.x, cameraData.center.y, cameraData.center.z], + eye: [cameraData.eye.x, cameraData.eye.y, cameraData.eye.z], + up: [cameraData.up.x, cameraData.up.y, cameraData.up.z], + _ortho: isOrtho, + zoomMin: 0.01, + zoomMax: 100, + mode: 'orbit' + }); +}; + +proto.initializeGLPlot = function() { + var scene = this; + + scene.initializeGLCamera(); + + var success = scene.tryCreatePlot(); + /* + * createPlot will throw when webgl is not enabled in the client. + * Lets return an instance of the module with all functions noop'd. + * The destroy method - which will remove the container from the DOM + * is overridden with a function that removes the container only. + */ + if(!success) return showNoWebGlMsg(scene); + + // List of scene objects + scene.traces = {}; + + scene.make4thDimension(); + + var gd = scene.graphDiv; + var layout = gd.layout; + + var makeUpdate = function() { + var update = {}; + + if(scene.isCameraChanged(layout)) { + // camera updates + update[scene.id + '.camera'] = scene.getCamera(); + } + + if(scene.isAspectChanged(layout)) { + // scene updates + update[scene.id + '.aspectratio'] = scene.glplot.getAspectratio(); + + if(layout[scene.id].aspectmode !== 'manual') { + scene.fullSceneLayout.aspectmode = + layout[scene.id].aspectmode = + update[scene.id + '.aspectmode'] = 'manual'; + } + } + + return update; + }; + + var relayoutCallback = function(scene) { + if(scene.fullSceneLayout.dragmode === false) return; + + var update = makeUpdate(); + scene.saveLayout(layout); + scene.graphDiv.emit('plotly_relayout', update); + }; + + if(scene.glplot.canvas) { + scene.glplot.canvas.addEventListener('mouseup', function() { + relayoutCallback(scene); + }); + + scene.glplot.canvas.addEventListener('wheel', function(e) { + if(gd._context._scrollZoom.gl3d) { + if(scene.camera._ortho) { + var s = (e.deltaX > e.deltaY) ? 1.1 : 1.0 / 1.1; + var o = scene.glplot.getAspectratio(); + scene.glplot.setAspectratio({ + x: s * o.x, + y: s * o.y, + z: s * o.z + }); + } + + relayoutCallback(scene); + } + }, passiveSupported ? {passive: false} : false); + + scene.glplot.canvas.addEventListener('mousemove', function() { + if(scene.fullSceneLayout.dragmode === false) return; + if(scene.camera.mouseListener.buttons === 0) return; + + var update = makeUpdate(); + scene.graphDiv.emit('plotly_relayouting', update); + }); + + if(!scene.staticMode) { + scene.glplot.canvas.addEventListener('webglcontextlost', function(event) { + if(gd && gd.emit) { + gd.emit('plotly_webglcontextlost', { + event: event, + layer: scene.id + }); + } + }, false); + } + } + + scene.glplot.oncontextloss = function() { + scene.recoverContext(); + }; + + scene.glplot.onrender = function() { + scene.render(); + }; + + return true; +}; + +proto.render = function() { + var scene = this; + var gd = scene.graphDiv; + var trace; + + // update size of svg container + var svgContainer = scene.svgContainer; + var clientRect = scene.container.getBoundingClientRect(); + + gd._fullLayout._calcInverseTransform(gd); + var scaleX = gd._fullLayout._invScaleX; + var scaleY = gd._fullLayout._invScaleY; + var width = clientRect.width * scaleX; + var height = clientRect.height * scaleY; + svgContainer.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height); + svgContainer.setAttributeNS(null, 'width', width); + svgContainer.setAttributeNS(null, 'height', height); + + computeTickMarks(scene); + scene.glplot.axes.update(scene.axesOptions); + + // check if pick has changed + var keys = Object.keys(scene.traces); + var lastPicked = null; + var selection = scene.glplot.selection; + for(var i = 0; i < keys.length; ++i) { + trace = scene.traces[keys[i]]; + if(trace.data.hoverinfo !== 'skip' && trace.handlePick(selection)) { + lastPicked = trace; + } + + if(trace.setContourLevels) trace.setContourLevels(); + } + + function formatter(axLetter, val, hoverformat) { + var ax = scene.fullSceneLayout[axLetter + 'axis']; + + if(ax.type !== 'log') { + val = ax.d2l(val); + } + + return Axes.hoverLabelText(ax, val, hoverformat); + } + + var oldEventData; + + if(lastPicked !== null) { + var pdata = project(scene.glplot.cameraParams, selection.dataCoordinate); + trace = lastPicked.data; + var traceNow = gd._fullData[trace.index]; + var ptNumber = selection.index; + + var labels = { + xLabel: formatter('x', selection.traceCoordinate[0], trace.xhoverformat), + yLabel: formatter('y', selection.traceCoordinate[1], trace.yhoverformat), + zLabel: formatter('z', selection.traceCoordinate[2], trace.zhoverformat) + }; + + var hoverinfo = Fx.castHoverinfo(traceNow, scene.fullLayout, ptNumber); + var hoverinfoParts = (hoverinfo || '').split('+'); + var isHoverinfoAll = hoverinfo && hoverinfo === 'all'; + + if(!traceNow.hovertemplate && !isHoverinfoAll) { + if(hoverinfoParts.indexOf('x') === -1) labels.xLabel = undefined; + if(hoverinfoParts.indexOf('y') === -1) labels.yLabel = undefined; + if(hoverinfoParts.indexOf('z') === -1) labels.zLabel = undefined; + if(hoverinfoParts.indexOf('text') === -1) selection.textLabel = undefined; + if(hoverinfoParts.indexOf('name') === -1) lastPicked.name = undefined; + } + + var tx; + var vectorTx = []; + + if(trace.type === 'cone' || trace.type === 'streamtube') { + labels.uLabel = formatter('x', selection.traceCoordinate[3], trace.uhoverformat); + if(isHoverinfoAll || hoverinfoParts.indexOf('u') !== -1) { + vectorTx.push('u: ' + labels.uLabel); + } + + labels.vLabel = formatter('y', selection.traceCoordinate[4], trace.vhoverformat); + if(isHoverinfoAll || hoverinfoParts.indexOf('v') !== -1) { + vectorTx.push('v: ' + labels.vLabel); + } + + labels.wLabel = formatter('z', selection.traceCoordinate[5], trace.whoverformat); + if(isHoverinfoAll || hoverinfoParts.indexOf('w') !== -1) { + vectorTx.push('w: ' + labels.wLabel); + } + + labels.normLabel = selection.traceCoordinate[6].toPrecision(3); + if(isHoverinfoAll || hoverinfoParts.indexOf('norm') !== -1) { + vectorTx.push('norm: ' + labels.normLabel); + } + if(trace.type === 'streamtube') { + labels.divergenceLabel = selection.traceCoordinate[7].toPrecision(3); + if(isHoverinfoAll || hoverinfoParts.indexOf('divergence') !== -1) { + vectorTx.push('divergence: ' + labels.divergenceLabel); + } + } + if(selection.textLabel) { + vectorTx.push(selection.textLabel); + } + tx = vectorTx.join('
'); + } else if(trace.type === 'isosurface' || trace.type === 'volume') { + labels.valueLabel = Axes.hoverLabelText(scene._mockAxis, scene._mockAxis.d2l(selection.traceCoordinate[3]), trace.valuehoverformat); + vectorTx.push('value: ' + labels.valueLabel); + if(selection.textLabel) { + vectorTx.push(selection.textLabel); + } + tx = vectorTx.join('
'); + } else { + tx = selection.textLabel; + } + + var pointData = { + x: selection.traceCoordinate[0], + y: selection.traceCoordinate[1], + z: selection.traceCoordinate[2], + data: traceNow._input, + fullData: traceNow, + curveNumber: traceNow.index, + pointNumber: ptNumber + }; + + Fx.appendArrayPointValue(pointData, traceNow, ptNumber); + + if(trace._module.eventData) { + pointData = traceNow._module.eventData(pointData, selection, traceNow, {}, ptNumber); + } + + var eventData = {points: [pointData]}; + + if(scene.fullSceneLayout.hovermode) { + var bbox = []; + Fx.loneHover({ + trace: traceNow, + x: (0.5 + 0.5 * pdata[0] / pdata[3]) * width, + y: (0.5 - 0.5 * pdata[1] / pdata[3]) * height, + xLabel: labels.xLabel, + yLabel: labels.yLabel, + zLabel: labels.zLabel, + text: tx, + name: lastPicked.name, + color: Fx.castHoverOption(traceNow, ptNumber, 'bgcolor') || lastPicked.color, + borderColor: Fx.castHoverOption(traceNow, ptNumber, 'bordercolor'), + fontFamily: Fx.castHoverOption(traceNow, ptNumber, 'font.family'), + fontSize: Fx.castHoverOption(traceNow, ptNumber, 'font.size'), + fontColor: Fx.castHoverOption(traceNow, ptNumber, 'font.color'), + nameLength: Fx.castHoverOption(traceNow, ptNumber, 'namelength'), + textAlign: Fx.castHoverOption(traceNow, ptNumber, 'align'), + hovertemplate: Lib.castOption(traceNow, ptNumber, 'hovertemplate'), + hovertemplateLabels: Lib.extendFlat({}, pointData, labels), + eventData: [pointData] + }, { + container: svgContainer, + gd: gd, + inOut_bbox: bbox + }); + + pointData.bbox = bbox[0]; + } + + if(selection.buttons && selection.distance < 5) { + gd.emit('plotly_click', eventData); + } else { + gd.emit('plotly_hover', eventData); + } + + oldEventData = eventData; + } else { + Fx.loneUnhover(svgContainer); + gd.emit('plotly_unhover', oldEventData); + } + + scene.drawAnnotations(scene); +}; + +proto.recoverContext = function() { + var scene = this; + + scene.glplot.dispose(); + + var tryRecover = function() { + if(scene.glplot.gl.isContextLost()) { + requestAnimationFrame(tryRecover); + return; + } + if(!scene.initializeGLPlot()) { + Lib.error('Catastrophic and unrecoverable WebGL error. Context lost.'); + return; + } + scene.plot.apply(scene, scene.plotArgs); + }; + + requestAnimationFrame(tryRecover); +}; + +var axisProperties = [ 'xaxis', 'yaxis', 'zaxis' ]; + +function computeTraceBounds(scene, trace, bounds) { + var fullSceneLayout = scene.fullSceneLayout; + + for(var d = 0; d < 3; d++) { + var axisName = axisProperties[d]; + var axLetter = axisName.charAt(0); + var ax = fullSceneLayout[axisName]; + var coords = trace[axLetter]; + var calendar = trace[axLetter + 'calendar']; + var len = trace['_' + axLetter + 'length']; + + if(!Lib.isArrayOrTypedArray(coords)) { + bounds[0][d] = Math.min(bounds[0][d], 0); + bounds[1][d] = Math.max(bounds[1][d], len - 1); + } else { + var v; + + for(var i = 0; i < (len || coords.length); i++) { + if(Lib.isArrayOrTypedArray(coords[i])) { + for(var j = 0; j < coords[i].length; ++j) { + v = ax.d2l(coords[i][j], 0, calendar); + if(!isNaN(v) && isFinite(v)) { + bounds[0][d] = Math.min(bounds[0][d], v); + bounds[1][d] = Math.max(bounds[1][d], v); + } + } + } else { + v = ax.d2l(coords[i], 0, calendar); + if(!isNaN(v) && isFinite(v)) { + bounds[0][d] = Math.min(bounds[0][d], v); + bounds[1][d] = Math.max(bounds[1][d], v); + } + } + } + } + } +} + +function computeAnnotationBounds(scene, bounds) { + var fullSceneLayout = scene.fullSceneLayout; + var annotations = fullSceneLayout.annotations || []; + + for(var d = 0; d < 3; d++) { + var axisName = axisProperties[d]; + var axLetter = axisName.charAt(0); + var ax = fullSceneLayout[axisName]; + + for(var j = 0; j < annotations.length; j++) { + var ann = annotations[j]; + + if(ann.visible) { + var pos = ax.r2l(ann[axLetter]); + if(!isNaN(pos) && isFinite(pos)) { + bounds[0][d] = Math.min(bounds[0][d], pos); + bounds[1][d] = Math.max(bounds[1][d], pos); + } + } + } + } +} + +proto.plot = function(sceneData, fullLayout, layout) { + var scene = this; + + // Save parameters + scene.plotArgs = [sceneData, fullLayout, layout]; + + if(scene.glplot.contextLost) return; + + var data, trace; + var i, j, axis, axisType; + var fullSceneLayout = fullLayout[scene.id]; + var sceneLayout = layout[scene.id]; + + // Update layout + scene.fullLayout = fullLayout; + scene.fullSceneLayout = fullSceneLayout; + + scene.axesOptions.merge(fullLayout, fullSceneLayout); + scene.spikeOptions.merge(fullSceneLayout); + + // Update camera and camera mode + scene.setViewport(fullSceneLayout); + scene.updateFx(fullSceneLayout.dragmode, fullSceneLayout.hovermode); + scene.camera.enableWheel = scene.graphDiv._context._scrollZoom.gl3d; + + // Update scene background + scene.glplot.setClearColor(str2RGBAarray(fullSceneLayout.bgcolor)); + + // Update axes functions BEFORE updating traces + scene.setConvert(axis); + + // Convert scene data + if(!sceneData) sceneData = []; + else if(!Array.isArray(sceneData)) sceneData = [sceneData]; + + // Compute trace bounding box + var dataBounds = [ + [Infinity, Infinity, Infinity], + [-Infinity, -Infinity, -Infinity] + ]; + + for(i = 0; i < sceneData.length; ++i) { + data = sceneData[i]; + if(data.visible !== true || data._length === 0) continue; + + computeTraceBounds(this, data, dataBounds); + } + computeAnnotationBounds(this, dataBounds); + + var dataScale = [1, 1, 1]; + for(j = 0; j < 3; ++j) { + if(dataBounds[1][j] === dataBounds[0][j]) { + dataScale[j] = 1.0; + } else { + dataScale[j] = 1.0 / (dataBounds[1][j] - dataBounds[0][j]); + } + } + + // Save scale + scene.dataScale = dataScale; + + // after computeTraceBounds where ax._categories are filled in + scene.convertAnnotations(this); + + // Update traces + for(i = 0; i < sceneData.length; ++i) { + data = sceneData[i]; + if(data.visible !== true || data._length === 0) { + continue; + } + trace = scene.traces[data.uid]; + if(trace) { + if(trace.data.type === data.type) { + trace.update(data); + } else { + trace.dispose(); + trace = data._module.plot(this, data); + scene.traces[data.uid] = trace; + } + } else { + trace = data._module.plot(this, data); + scene.traces[data.uid] = trace; + } + trace.name = data.name; + } + + // Remove empty traces + var traceIds = Object.keys(scene.traces); + + traceIdLoop: + for(i = 0; i < traceIds.length; ++i) { + for(j = 0; j < sceneData.length; ++j) { + if(sceneData[j].uid === traceIds[i] && + (sceneData[j].visible === true && sceneData[j]._length !== 0)) { + continue traceIdLoop; + } + } + trace = scene.traces[traceIds[i]]; + trace.dispose(); + delete scene.traces[traceIds[i]]; + } + + // order object per trace index + scene.glplot.objects.sort(function(a, b) { + return a._trace.data.index - b._trace.data.index; + }); + + // Update ranges (needs to be called *after* objects are added due to updates) + var sceneBounds = [[0, 0, 0], [0, 0, 0]]; + var axisDataRange = []; + var axisTypeRatios = {}; + + for(i = 0; i < 3; ++i) { + axis = fullSceneLayout[axisProperties[i]]; + axisType = axis.type; + + if(axisType in axisTypeRatios) { + axisTypeRatios[axisType].acc *= dataScale[i]; + axisTypeRatios[axisType].count += 1; + } else { + axisTypeRatios[axisType] = { + acc: dataScale[i], + count: 1 + }; + } + + if(axis.autorange) { + sceneBounds[0][i] = Infinity; + sceneBounds[1][i] = -Infinity; + + var objects = scene.glplot.objects; + var annotations = scene.fullSceneLayout.annotations || []; + var axLetter = axis._name.charAt(0); + + for(j = 0; j < objects.length; j++) { + var obj = objects[j]; + var objBounds = obj.bounds; + var pad = obj._trace.data._pad || 0; + + if(obj.constructor.name === 'ErrorBars' && axis._lowerLogErrorBound) { + sceneBounds[0][i] = Math.min(sceneBounds[0][i], axis._lowerLogErrorBound); + } else { + sceneBounds[0][i] = Math.min(sceneBounds[0][i], objBounds[0][i] / dataScale[i] - pad); + } + sceneBounds[1][i] = Math.max(sceneBounds[1][i], objBounds[1][i] / dataScale[i] + pad); + } + + for(j = 0; j < annotations.length; j++) { + var ann = annotations[j]; + + // N.B. not taking into consideration the arrowhead + if(ann.visible) { + var pos = axis.r2l(ann[axLetter]); + sceneBounds[0][i] = Math.min(sceneBounds[0][i], pos); + sceneBounds[1][i] = Math.max(sceneBounds[1][i], pos); + } + } + + if('rangemode' in axis && axis.rangemode === 'tozero') { + sceneBounds[0][i] = Math.min(sceneBounds[0][i], 0); + sceneBounds[1][i] = Math.max(sceneBounds[1][i], 0); + } + if(sceneBounds[0][i] > sceneBounds[1][i]) { + sceneBounds[0][i] = -1; + sceneBounds[1][i] = 1; + } else { + var d = sceneBounds[1][i] - sceneBounds[0][i]; + sceneBounds[0][i] -= d / 32.0; + sceneBounds[1][i] += d / 32.0; + } + + if(axis.autorange === 'reversed') { + // swap bounds: + var tmp = sceneBounds[0][i]; + sceneBounds[0][i] = sceneBounds[1][i]; + sceneBounds[1][i] = tmp; + } + } else { + var range = axis.range; + sceneBounds[0][i] = axis.r2l(range[0]); + sceneBounds[1][i] = axis.r2l(range[1]); + } + if(sceneBounds[0][i] === sceneBounds[1][i]) { + sceneBounds[0][i] -= 1; + sceneBounds[1][i] += 1; + } + axisDataRange[i] = sceneBounds[1][i] - sceneBounds[0][i]; + + // Update plot bounds + scene.glplot.setBounds(i, { + min: sceneBounds[0][i] * dataScale[i], + max: sceneBounds[1][i] * dataScale[i] + }); + } + + /* + * Dynamically set the aspect ratio depending on the users aspect settings + */ + var aspectRatio; + var aspectmode = fullSceneLayout.aspectmode; + if(aspectmode === 'cube') { + aspectRatio = [1, 1, 1]; + } else if(aspectmode === 'manual') { + var userRatio = fullSceneLayout.aspectratio; + aspectRatio = [userRatio.x, userRatio.y, userRatio.z]; + } else if(aspectmode === 'auto' || aspectmode === 'data') { + var axesScaleRatio = [1, 1, 1]; + // Compute axis scale per category + for(i = 0; i < 3; ++i) { + axis = fullSceneLayout[axisProperties[i]]; + axisType = axis.type; + var axisRatio = axisTypeRatios[axisType]; + axesScaleRatio[i] = Math.pow(axisRatio.acc, 1.0 / axisRatio.count) / dataScale[i]; + } + + if(aspectmode === 'data') { + aspectRatio = axesScaleRatio; + } else { // i.e. 'auto' option + if( + Math.max.apply(null, axesScaleRatio) / + Math.min.apply(null, axesScaleRatio) <= 4 + ) { + // USE DATA MODE WHEN AXIS RANGE DIMENSIONS ARE RELATIVELY EQUAL + aspectRatio = axesScaleRatio; + } else { + // USE EQUAL MODE WHEN AXIS RANGE DIMENSIONS ARE HIGHLY UNEQUAL + aspectRatio = [1, 1, 1]; + } + } + } else { + throw new Error('scene.js aspectRatio was not one of the enumerated types'); + } + + /* + * Write aspect Ratio back to user data and fullLayout so that it is modifies as user + * manipulates the aspectmode settings and the fullLayout is up-to-date. + */ + fullSceneLayout.aspectratio.x = sceneLayout.aspectratio.x = aspectRatio[0]; + fullSceneLayout.aspectratio.y = sceneLayout.aspectratio.y = aspectRatio[1]; + fullSceneLayout.aspectratio.z = sceneLayout.aspectratio.z = aspectRatio[2]; + + /* + * Finally assign the computed aspecratio to the glplot module. This will have an effect + * on the next render cycle. + */ + scene.glplot.setAspectratio(fullSceneLayout.aspectratio); + + // save 'initial' aspectratio & aspectmode view settings for modebar buttons + if(!scene.viewInitial.aspectratio) { + scene.viewInitial.aspectratio = { + x: fullSceneLayout.aspectratio.x, + y: fullSceneLayout.aspectratio.y, + z: fullSceneLayout.aspectratio.z + }; + } + if(!scene.viewInitial.aspectmode) { + scene.viewInitial.aspectmode = fullSceneLayout.aspectmode; + } + + // Update frame position for multi plots + var domain = fullSceneLayout.domain || null; + var size = fullLayout._size || null; + + if(domain && size) { + var containerStyle = scene.container.style; + containerStyle.position = 'absolute'; + containerStyle.left = (size.l + domain.x[0] * size.w) + 'px'; + containerStyle.top = (size.t + (1 - domain.y[1]) * size.h) + 'px'; + containerStyle.width = (size.w * (domain.x[1] - domain.x[0])) + 'px'; + containerStyle.height = (size.h * (domain.y[1] - domain.y[0])) + 'px'; + } + + // force redraw so that promise is returned when rendering is completed + scene.glplot.redraw(); +}; + +proto.destroy = function() { + var scene = this; + + if(!scene.glplot) return; + scene.camera.mouseListener.enabled = false; + scene.container.removeEventListener('wheel', scene.camera.wheelListener); + scene.camera = null; + scene.glplot.dispose(); + scene.container.parentNode.removeChild(scene.container); + scene.glplot = null; +}; + +// getCameraArrays :: plotly_coords -> gl-plot3d_coords +// inverse of getLayoutCamera +function getCameraArrays(camera) { + return [ + [camera.eye.x, camera.eye.y, camera.eye.z], + [camera.center.x, camera.center.y, camera.center.z], + [camera.up.x, camera.up.y, camera.up.z] + ]; +} + +// getLayoutCamera :: gl-plot3d_coords -> plotly_coords +// inverse of getCameraArrays +function getLayoutCamera(camera) { + return { + up: {x: camera.up[0], y: camera.up[1], z: camera.up[2]}, + center: {x: camera.center[0], y: camera.center[1], z: camera.center[2]}, + eye: {x: camera.eye[0], y: camera.eye[1], z: camera.eye[2]}, + projection: {type: (camera._ortho === true) ? 'orthographic' : 'perspective'} + }; +} + +// get camera position in plotly coords from 'gl-plot3d' coords +proto.getCamera = function() { + var scene = this; + scene.camera.view.recalcMatrix(scene.camera.view.lastT()); + return getLayoutCamera(scene.camera); +}; + +// set gl-plot3d camera position and scene aspects with a set of plotly coords +proto.setViewport = function(sceneLayout) { + var scene = this; + var cameraData = sceneLayout.camera; + + scene.camera.lookAt.apply(this, getCameraArrays(cameraData)); + scene.glplot.setAspectratio(sceneLayout.aspectratio); + + var newOrtho = (cameraData.projection.type === 'orthographic'); + var oldOrtho = scene.camera._ortho; + + if(newOrtho !== oldOrtho) { + scene.glplot.redraw(); // TODO: figure out why we need to redraw here? + scene.glplot.clearRGBA(); + scene.glplot.dispose(); + scene.initializeGLPlot(); + } +}; + +proto.isCameraChanged = function(layout) { + var scene = this; + var cameraData = scene.getCamera(); + var cameraNestedProp = Lib.nestedProperty(layout, scene.id + '.camera'); + var cameraDataLastSave = cameraNestedProp.get(); + + function same(x, y, i, j) { + var vectors = ['up', 'center', 'eye']; + var components = ['x', 'y', 'z']; + return y[vectors[i]] && (x[vectors[i]][components[j]] === y[vectors[i]][components[j]]); + } + + var changed = false; + if(cameraDataLastSave === undefined) { + changed = true; + } else { + for(var i = 0; i < 3; i++) { + for(var j = 0; j < 3; j++) { + if(!same(cameraData, cameraDataLastSave, i, j)) { + changed = true; + break; + } + } + } + + if(!cameraDataLastSave.projection || ( + cameraData.projection && + cameraData.projection.type !== cameraDataLastSave.projection.type)) { + changed = true; + } + } + + return changed; +}; + +proto.isAspectChanged = function(layout) { + var scene = this; + var aspectData = scene.glplot.getAspectratio(); + var aspectNestedProp = Lib.nestedProperty(layout, scene.id + '.aspectratio'); + var aspectDataLastSave = aspectNestedProp.get(); + + return ( + aspectDataLastSave === undefined || ( + aspectDataLastSave.x !== aspectData.x || + aspectDataLastSave.y !== aspectData.y || + aspectDataLastSave.z !== aspectData.z + )); +}; + +// save camera to user layout (i.e. gd.layout) +proto.saveLayout = function(layout) { + var scene = this; + var fullLayout = scene.fullLayout; + + var cameraData; + var cameraNestedProp; + var cameraDataLastSave; + + var aspectData; + var aspectNestedProp; + var aspectDataLastSave; + + var cameraChanged = scene.isCameraChanged(layout); + var aspectChanged = scene.isAspectChanged(layout); + + var hasChanged = cameraChanged || aspectChanged; + if(hasChanged) { + var preGUI = {}; + if(cameraChanged) { + cameraData = scene.getCamera(); + cameraNestedProp = Lib.nestedProperty(layout, scene.id + '.camera'); + cameraDataLastSave = cameraNestedProp.get(); + + preGUI[scene.id + '.camera'] = cameraDataLastSave; + } + if(aspectChanged) { + aspectData = scene.glplot.getAspectratio(); + aspectNestedProp = Lib.nestedProperty(layout, scene.id + '.aspectratio'); + aspectDataLastSave = aspectNestedProp.get(); + + preGUI[scene.id + '.aspectratio'] = aspectDataLastSave; + } + Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, preGUI); + + if(cameraChanged) { + cameraNestedProp.set(cameraData); + + var cameraFullNP = Lib.nestedProperty(fullLayout, scene.id + '.camera'); + cameraFullNP.set(cameraData); + } + + if(aspectChanged) { + aspectNestedProp.set(aspectData); + + var aspectFullNP = Lib.nestedProperty(fullLayout, scene.id + '.aspectratio'); + aspectFullNP.set(aspectData); + + scene.glplot.redraw(); + } + } + + return hasChanged; +}; + +proto.updateFx = function(dragmode, hovermode) { + var scene = this; + var camera = scene.camera; + if(camera) { + // rotate and orbital are synonymous + if(dragmode === 'orbit') { + camera.mode = 'orbit'; + camera.keyBindingMode = 'rotate'; + } else if(dragmode === 'turntable') { + camera.up = [0, 0, 1]; + camera.mode = 'turntable'; + camera.keyBindingMode = 'rotate'; + + // The setter for camera.mode animates the transition to z-up, + // but only if we *don't* explicitly set z-up earlier via the + // relayout. So push `up` back to layout & fullLayout manually now. + var gd = scene.graphDiv; + var fullLayout = gd._fullLayout; + var fullCamera = scene.fullSceneLayout.camera; + var x = fullCamera.up.x; + var y = fullCamera.up.y; + var z = fullCamera.up.z; + // only push `up` back to (full)layout if it's going to change + if(z / Math.sqrt(x * x + y * y + z * z) < 0.999) { + var attr = scene.id + '.camera.up'; + var zUp = {x: 0, y: 0, z: 1}; + var edits = {}; + edits[attr] = zUp; + var layout = gd.layout; + Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, edits); + fullCamera.up = zUp; + Lib.nestedProperty(layout, attr).set(zUp); + } + } else { + // none rotation modes [pan or zoom] + camera.keyBindingMode = dragmode; + } + } + + // to put dragmode and hovermode on the same grounds from relayout + scene.fullSceneLayout.hovermode = hovermode; +}; + +function flipPixels(pixels, w, h) { + for(var i = 0, q = h - 1; i < q; ++i, --q) { + for(var j = 0; j < w; ++j) { + for(var k = 0; k < 4; ++k) { + var a = 4 * (w * i + j) + k; + var b = 4 * (w * q + j) + k; + var tmp = pixels[a]; + pixels[a] = pixels[b]; + pixels[b] = tmp; + } + } + } +} + +function correctRGB(pixels, w, h) { + for(var i = 0; i < h; ++i) { + for(var j = 0; j < w; ++j) { + var k = 4 * (w * i + j); + + var a = pixels[k + 3]; // alpha + if(a > 0) { + var q = 255 / a; + + for(var l = 0; l < 3; ++l) { // RGB + pixels[k + l] = Math.min(q * pixels[k + l], 255); + } + } + } + } +} + +proto.toImage = function(format) { + var scene = this; + + if(!format) format = 'png'; + if(scene.staticMode) scene.container.appendChild(STATIC_CANVAS); + + // Force redraw + scene.glplot.redraw(); + + // Grab context and yank out pixels + var gl = scene.glplot.gl; + var w = gl.drawingBufferWidth; + var h = gl.drawingBufferHeight; + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + var pixels = new Uint8Array(w * h * 4); + gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + flipPixels(pixels, w, h); + correctRGB(pixels, w, h); + + var canvas = document.createElement('canvas'); + canvas.width = w; + canvas.height = h; + var context = canvas.getContext('2d'); + var imageData = context.createImageData(w, h); + imageData.data.set(pixels); + context.putImageData(imageData, 0, 0); + + var dataURL; + + switch(format) { + case 'jpeg': + dataURL = canvas.toDataURL('image/jpeg'); + break; + case 'webp': + dataURL = canvas.toDataURL('image/webp'); + break; + default: + dataURL = canvas.toDataURL('image/png'); + } + + if(scene.staticMode) scene.container.removeChild(STATIC_CANVAS); + + return dataURL; +}; + +proto.setConvert = function() { + var scene = this; + for(var i = 0; i < 3; i++) { + var ax = scene.fullSceneLayout[axisProperties[i]]; + Axes.setConvert(ax, scene.fullLayout); + ax.setScale = Lib.noop; + } +}; + +proto.make4thDimension = function() { + var scene = this; + var gd = scene.graphDiv; + var fullLayout = gd._fullLayout; + + // mock axis for hover formatting + scene._mockAxis = { + type: 'linear', + showexponent: 'all', + exponentformat: 'B' + }; + Axes.setConvert(scene._mockAxis, fullLayout); +}; + +module.exports = Scene; + +},{"../../components/fx":564,"../../lib":661,"../../lib/show_no_webgl_msg":682,"../../lib/str2rgbarray":685,"../../plots/cartesian/axes":711,"../../registry":788,"./layout/convert":757,"./layout/spikes":760,"./layout/tick_marks":761,"./project":762,"gl-plot3d":229,"has-passive-events":344,"webgl-context":487}],764:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = function zip3(x, y, z, len) { + len = len || x.length; + + var result = new Array(len); + for(var i = 0; i < len; i++) { + result[i] = [x[i], y[i], z[i]]; + } + return result; +}; + +},{}],765:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -145331,7 +188545,7 @@ module.exports = { } }; -},{"../components/color/attributes":207,"../components/shapes/draw_newshape/attributes":293,"../lib/extend":333,"./animation_attributes":384,"./font_attributes":419,"./pad_attributes":437}],430:[function(_dereq_,module,exports){ +},{"../components/color/attributes":523,"../components/shapes/draw_newshape/attributes":609,"../lib/extend":651,"./animation_attributes":705,"./font_attributes":740,"./pad_attributes":773}],766:[function(_dereq_,module,exports){ 'use strict'; var sortObjectKeys = _dereq_('../../lib/sort_object_keys'); @@ -145581,7 +188795,7 @@ module.exports = { } }; -},{"../../lib/sort_object_keys":363}],431:[function(_dereq_,module,exports){ +},{"../../lib/sort_object_keys":683}],767:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -145645,7 +188859,7 @@ module.exports = function convertTextOpts(textposition, iconSize) { return { anchor: anchor, offset: offset }; }; -},{"../../lib":342}],432:[function(_dereq_,module,exports){ +},{"../../lib":661}],768:[function(_dereq_,module,exports){ 'use strict'; var mapboxgl = _dereq_('mapbox-gl/dist/mapbox-gl-unminified'); @@ -145922,7 +189136,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/drawing":230,"../../constants/xmlns_namespaces":320,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/get_data":427,"./constants":430,"./layout_attributes":434,"./layout_defaults":435,"./mapbox":436,"@plotly/d3":44,"mapbox-gl/dist/mapbox-gl-unminified":119}],433:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../constants/xmlns_namespaces":638,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/get_data":748,"./constants":766,"./layout_attributes":770,"./layout_defaults":771,"./mapbox":772,"@plotly/d3":54,"mapbox-gl/dist/mapbox-gl-unminified":356}],769:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -146223,7 +189437,7 @@ module.exports = function createMapboxLayer(subplot, index, opts) { return mapboxLayer; }; -},{"../../lib":342,"../../lib/svg_text_utils":365,"./constants":430,"./convert_text_opts":431}],434:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/svg_text_utils":686,"./constants":766,"./convert_text_opts":767}],770:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -146395,7 +189609,7 @@ attrs.uirevision = { editType: 'none', }; -},{"../../components/color":208,"../../lib":342,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../traces/scatter/attributes":705,"../domain":418,"../font_attributes":419,"./constants":430}],435:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../traces/scatter/attributes":1064,"../domain":739,"../font_attributes":740,"./constants":766}],771:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -146495,7 +189709,7 @@ function handleLayerDefaults(layerIn, layerOut) { } } -},{"../../lib":342,"../array_container_defaults":385,"../subplot_defaults":446,"./layout_attributes":434}],436:[function(_dereq_,module,exports){ +},{"../../lib":661,"../array_container_defaults":706,"../subplot_defaults":782,"./layout_attributes":770}],772:[function(_dereq_,module,exports){ 'use strict'; var mapboxgl = _dereq_('mapbox-gl/dist/mapbox-gl-unminified'); @@ -147298,7 +190512,7 @@ function convertCenter(center) { module.exports = Mapbox; -},{"../../components/dragelement":227,"../../components/dragelement/helpers":226,"../../components/fx":248,"../../lib":342,"../../lib/geo_location_utils":336,"../../registry":452,"../cartesian/axes":390,"../cartesian/select":410,"./constants":430,"./layers":433,"mapbox-gl/dist/mapbox-gl-unminified":119}],437:[function(_dereq_,module,exports){ +},{"../../components/dragelement":543,"../../components/dragelement/helpers":542,"../../components/fx":564,"../../lib":661,"../../lib/geo_location_utils":654,"../../registry":788,"../cartesian/axes":711,"../cartesian/select":731,"./constants":766,"./layers":769,"mapbox-gl/dist/mapbox-gl-unminified":356}],773:[function(_dereq_,module,exports){ 'use strict'; /** @@ -147337,7 +190551,7 @@ module.exports = function(opts) { }; }; -},{}],438:[function(_dereq_,module,exports){ +},{}],774:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -150763,7 +193977,7 @@ plots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullD } }; -},{"../components/color":208,"../constants/numerical":319,"../lib":342,"../plot_api/plot_schema":378,"../plot_api/plot_template":379,"../plots/get_data":427,"../registry":452,"./animation_attributes":384,"./attributes":386,"./cartesian/axis_ids":394,"./cartesian/handle_outline":401,"./command":417,"./font_attributes":419,"./frame_attributes":420,"./layout_attributes":429,"@plotly/d3":44,"d3-format":68,"d3-time-format":76,"fast-isnumeric":81}],439:[function(_dereq_,module,exports){ +},{"../components/color":524,"../constants/numerical":637,"../lib":661,"../plot_api/plot_schema":699,"../plot_api/plot_template":700,"../plots/get_data":748,"../registry":788,"./animation_attributes":705,"./attributes":707,"./cartesian/axis_ids":715,"./cartesian/handle_outline":722,"./command":738,"./font_attributes":740,"./frame_attributes":741,"./layout_attributes":765,"@plotly/d3":54,"d3-format":139,"d3-time-format":147,"fast-isnumeric":159}],775:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -150800,7 +194014,7 @@ module.exports = { OFFEDGE: 20 }; -},{}],440:[function(_dereq_,module,exports){ +},{}],776:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -151087,7 +194301,7 @@ module.exports = { pathPolygonAnnulus: pathPolygonAnnulus }; -},{"../../lib":342,"../../lib/polygon":354}],441:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/polygon":673}],777:[function(_dereq_,module,exports){ 'use strict'; var getSubplotCalcData = _dereq_('../get_data').getSubplotCalcData; @@ -151166,7 +194380,7 @@ module.exports = { toSVG: _dereq_('../cartesian').toSVG }; -},{"../../lib":342,"../cartesian":404,"../get_data":427,"./constants":439,"./layout_attributes":442,"./layout_defaults":443,"./polar":444}],442:[function(_dereq_,module,exports){ +},{"../../lib":661,"../cartesian":725,"../get_data":748,"./constants":775,"./layout_attributes":778,"./layout_defaults":779,"./polar":780}],778:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -151421,7 +194635,7 @@ module.exports = { editType: 'calc' }; -},{"../../components/color/attributes":207,"../../lib":342,"../../plot_api/edit_types":372,"../cartesian/layout_attributes":405,"../domain":418}],443:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib":661,"../../plot_api/edit_types":693,"../cartesian/layout_attributes":726,"../domain":739}],779:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -151651,7 +194865,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":208,"../../lib":342,"../../plot_api/plot_template":379,"../cartesian/axis_autotype":391,"../cartesian/category_order_defaults":395,"../cartesian/line_grid_defaults":407,"../cartesian/tick_label_defaults":412,"../cartesian/tick_mark_defaults":413,"../cartesian/tick_value_defaults":414,"../get_data":427,"../subplot_defaults":446,"./constants":439,"./layout_attributes":442,"./set_convert":445}],444:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../plot_api/plot_template":700,"../cartesian/axis_autotype":712,"../cartesian/category_order_defaults":716,"../cartesian/line_grid_defaults":728,"../cartesian/tick_label_defaults":733,"../cartesian/tick_mark_defaults":734,"../cartesian/tick_value_defaults":735,"../get_data":748,"../subplot_defaults":782,"./constants":775,"./layout_attributes":778,"./set_convert":781}],780:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -153088,7 +196302,7 @@ function updateElement(sel, showAttr, attrs) { return sel; } -},{"../../components/color":208,"../../components/dragelement":227,"../../components/drawing":230,"../../components/fx":248,"../../components/titles":306,"../../constants/alignment":313,"../../lib":342,"../../lib/clear_gl_canvases":327,"../../lib/setcursor":362,"../../plot_api/subroutines":380,"../../plots/cartesian/axes":390,"../../registry":452,"../cartesian/autorange":389,"../cartesian/dragbox":399,"../cartesian/select":410,"../cartesian/set_convert":411,"../plots":438,"./constants":439,"./helpers":440,"./set_convert":445,"@plotly/d3":44,"tinycolor2":171}],445:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/dragelement":543,"../../components/drawing":546,"../../components/fx":564,"../../components/titles":622,"../../constants/alignment":629,"../../lib":661,"../../lib/clear_gl_canvases":645,"../../lib/setcursor":681,"../../plot_api/subroutines":701,"../../plots/cartesian/axes":711,"../../registry":788,"../cartesian/autorange":710,"../cartesian/dragbox":720,"../cartesian/select":731,"../cartesian/set_convert":732,"../plots":774,"./constants":775,"./helpers":776,"./set_convert":781,"@plotly/d3":54,"tinycolor2":471}],781:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -153275,7 +196489,7 @@ function setConvertAngular(ax, polarLayout) { }; } -},{"../../lib":342,"../cartesian/set_convert":411}],446:[function(_dereq_,module,exports){ +},{"../../lib":661,"../cartesian/set_convert":732}],782:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -153351,7 +196565,7 @@ module.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, o } }; -},{"../lib":342,"../plot_api/plot_template":379,"./domain":418}],447:[function(_dereq_,module,exports){ +},{"../lib":661,"../plot_api/plot_template":700,"./domain":739}],783:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../constants/docs'); @@ -153432,7 +196646,7 @@ exports.texttemplateAttrs = function(opts, extra) { return texttemplate; }; -},{"../constants/docs":316}],448:[function(_dereq_,module,exports){ +},{"../constants/docs":632}],784:[function(_dereq_,module,exports){ 'use strict'; var Ternary = _dereq_('./ternary'); @@ -153505,7 +196719,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../lib":342,"../../plots/get_data":427,"./layout_attributes":449,"./layout_defaults":450,"./ternary":451}],449:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/get_data":748,"./layout_attributes":785,"./layout_defaults":786,"./ternary":787}],785:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -153595,7 +196809,7 @@ attrs.aaxis.uirevision = attrs.baxis.uirevision = attrs.caxis.uirevision = { editType: 'none', }; -},{"../../components/color/attributes":207,"../../lib/extend":333,"../../plot_api/edit_types":372,"../cartesian/layout_attributes":405,"../domain":418}],450:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib/extend":651,"../../plot_api/edit_types":693,"../cartesian/layout_attributes":726,"../domain":739}],786:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -153719,7 +196933,7 @@ function handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut coerce('layer'); } -},{"../../components/color":208,"../../lib":342,"../../plot_api/plot_template":379,"../cartesian/line_grid_defaults":407,"../cartesian/tick_label_defaults":412,"../cartesian/tick_mark_defaults":413,"../cartesian/tick_value_defaults":414,"../subplot_defaults":446,"./layout_attributes":449}],451:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../plot_api/plot_template":700,"../cartesian/line_grid_defaults":728,"../cartesian/tick_label_defaults":733,"../cartesian/tick_mark_defaults":734,"../cartesian/tick_value_defaults":735,"../subplot_defaults":782,"./layout_attributes":785}],787:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -154491,7 +197705,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":208,"../../components/dragelement":227,"../../components/dragelement/helpers":226,"../../components/drawing":230,"../../components/fx":248,"../../components/titles":306,"../../lib":342,"../../lib/extend":333,"../../registry":452,"../cartesian/axes":390,"../cartesian/constants":397,"../cartesian/select":410,"../cartesian/set_convert":411,"../plots":438,"@plotly/d3":44,"tinycolor2":171}],452:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/dragelement":543,"../../components/dragelement/helpers":542,"../../components/drawing":546,"../../components/fx":564,"../../components/titles":622,"../../lib":661,"../../lib/extend":651,"../../registry":788,"../cartesian/axes":711,"../cartesian/constants":718,"../cartesian/select":731,"../cartesian/set_convert":732,"../plots":774,"@plotly/d3":54,"tinycolor2":471}],788:[function(_dereq_,module,exports){ 'use strict'; var Loggers = _dereq_('./lib/loggers'); @@ -154949,7 +198163,7 @@ function getTraceType(traceType) { return traceType; } -},{"./lib/dom":331,"./lib/extend":333,"./lib/is_plain_object":343,"./lib/loggers":346,"./lib/noop":351,"./lib/push_unique":356,"./plots/attributes":386,"./plots/layout_attributes":429}],453:[function(_dereq_,module,exports){ +},{"./lib/dom":649,"./lib/extend":651,"./lib/is_plain_object":662,"./lib/loggers":665,"./lib/noop":670,"./lib/push_unique":675,"./plots/attributes":707,"./plots/layout_attributes":765}],789:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -155109,7 +198323,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../lib":342,"../registry":452}],454:[function(_dereq_,module,exports){ +},{"../lib":661,"../registry":788}],790:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -155173,7 +198387,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":342,"../plot_api/to_image":382,"./filesaver":455,"./helpers":456}],455:[function(_dereq_,module,exports){ +},{"../lib":661,"../plot_api/to_image":703,"./filesaver":791,"./helpers":792}],791:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -155241,7 +198455,7 @@ function fileSaver(url, name, format) { module.exports = fileSaver; -},{"../lib":342,"./helpers":456}],456:[function(_dereq_,module,exports){ +},{"../lib":661,"./helpers":792}],792:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -155310,7 +198524,7 @@ exports.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; exports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\'svg\'} instead.'; -},{"../registry":452}],457:[function(_dereq_,module,exports){ +},{"../registry":788}],793:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -155327,7 +198541,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":453,"./download":454,"./helpers":456,"./svgtoimg":458,"./toimage":459,"./tosvg":460}],458:[function(_dereq_,module,exports){ +},{"./cloneplot":789,"./download":790,"./helpers":792,"./svgtoimg":794,"./toimage":795,"./tosvg":796}],794:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -155446,7 +198660,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":342,"./helpers":456,"events":60}],459:[function(_dereq_,module,exports){ +},{"../lib":661,"./helpers":792,"events":104}],795:[function(_dereq_,module,exports){ 'use strict'; var EventEmitter = _dereq_('events').EventEmitter; @@ -155515,7 +198729,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":342,"../registry":452,"./cloneplot":453,"./helpers":456,"./svgtoimg":458,"./tosvg":460,"events":60}],460:[function(_dereq_,module,exports){ +},{"../lib":661,"../registry":788,"./cloneplot":789,"./helpers":792,"./svgtoimg":794,"./tosvg":796,"events":104}],796:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -155700,7 +198914,7 @@ module.exports = function toSVG(gd, format, scale) { return s; }; -},{"../components/color":208,"../components/drawing":230,"../constants/xmlns_namespaces":320,"../lib":342,"@plotly/d3":44}],461:[function(_dereq_,module,exports){ +},{"../components/color":524,"../components/drawing":546,"../constants/xmlns_namespaces":638,"../lib":661,"@plotly/d3":54}],797:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -155725,7 +198939,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":342}],462:[function(_dereq_,module,exports){ +},{"../../lib":661}],798:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -155906,7 +199120,7 @@ module.exports = { } }; -},{"../../components/colorscale/attributes":215,"../../components/drawing/attributes":229,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/font_attributes":419,"../../plots/template_attributes":447,"../scatter/attributes":705,"./constants":464}],463:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../components/drawing/attributes":545,"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../../plots/font_attributes":740,"../../plots/template_attributes":783,"../scatter/attributes":1064,"./constants":800}],799:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -155981,7 +199195,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale/calc":216,"../../components/colorscale/helpers":219,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"../scatter/calc_selection":707,"./arrays_to_calcdata":461}],464:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../components/colorscale/helpers":535,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"../scatter/calc_selection":1066,"./arrays_to_calcdata":797}],800:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -155994,7 +199208,7 @@ module.exports = { eventDataKeys: ['value', 'label'] }; -},{}],465:[function(_dereq_,module,exports){ +},{}],801:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -156769,7 +199983,7 @@ module.exports = { setGroupPositions: setGroupPositions }; -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/axes":390,"../../plots/cartesian/constraints":398,"../../registry":452,"./sieve.js":475,"fast-isnumeric":81}],466:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/axes":711,"../../plots/cartesian/constraints":719,"../../registry":788,"./sieve.js":811,"fast-isnumeric":159}],802:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -156948,7 +200162,7 @@ module.exports = { handleText: handleText }; -},{"../../components/color":208,"../../lib":342,"../../plots/cartesian/constraints":398,"../../registry":452,"../scatter/period_defaults":725,"../scatter/xy_defaults":732,"./attributes":462,"./style_defaults":477}],467:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../plots/cartesian/constraints":719,"../../registry":788,"../scatter/period_defaults":1084,"../scatter/xy_defaults":1091,"./attributes":798,"./style_defaults":813}],803:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace) { @@ -156969,7 +200183,7 @@ module.exports = function eventData(out, pt, trace) { return out; }; -},{}],468:[function(_dereq_,module,exports){ +},{}],804:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -157039,7 +200253,7 @@ exports.getLineWidth = function(trace, di) { return w; }; -},{"../../lib":342,"fast-isnumeric":81,"tinycolor2":171}],469:[function(_dereq_,module,exports){ +},{"../../lib":661,"fast-isnumeric":159,"tinycolor2":471}],805:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -157264,7 +200478,7 @@ module.exports = { getTraceColor: getTraceColor }; -},{"../../components/color":208,"../../components/fx":248,"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/axes":390,"../../registry":452,"./helpers":468}],470:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx":564,"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/axes":711,"../../registry":788,"./helpers":804}],806:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -157293,7 +200507,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../scatter/marker_colorbar":723,"./arrays_to_calcdata":461,"./attributes":462,"./calc":463,"./cross_trace_calc":465,"./defaults":466,"./event_data":467,"./hover":469,"./layout_attributes":471,"./layout_defaults":472,"./plot":473,"./select":474,"./style":476}],471:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../scatter/marker_colorbar":1082,"./arrays_to_calcdata":797,"./attributes":798,"./calc":799,"./cross_trace_calc":801,"./defaults":802,"./event_data":803,"./hover":805,"./layout_attributes":807,"./layout_defaults":808,"./plot":809,"./select":810,"./style":812}],807:[function(_dereq_,module,exports){ 'use strict'; @@ -157325,7 +200539,7 @@ module.exports = { } }; -},{}],472:[function(_dereq_,module,exports){ +},{}],808:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -157377,7 +200591,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { coerce('bargroupgap'); }; -},{"../../lib":342,"../../plots/cartesian/axes":390,"../../registry":452,"./layout_attributes":471}],473:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../../registry":788,"./layout_attributes":807}],809:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -158154,7 +201368,7 @@ module.exports = { toMoveInsideBar: toMoveInsideBar }; -},{"../../components/color":208,"../../components/drawing":230,"../../components/fx/helpers":244,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../registry":452,"./attributes":462,"./constants":464,"./helpers":468,"./style":476,"./uniform_text":478,"@plotly/d3":44,"fast-isnumeric":81}],474:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../components/fx/helpers":560,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../registry":788,"./attributes":798,"./constants":800,"./helpers":804,"./style":812,"./uniform_text":814,"@plotly/d3":54,"fast-isnumeric":159}],810:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -158210,7 +201424,7 @@ function getCentroid(d, xa, ya, isHorizontal, isFunnel) { } } -},{}],475:[function(_dereq_,module,exports){ +},{}],811:[function(_dereq_,module,exports){ 'use strict'; module.exports = Sieve; @@ -158319,7 +201533,7 @@ Sieve.prototype.getLabel = function getLabel(position, value) { return prefix + label; }; -},{"../../constants/numerical":319,"../../lib":342}],476:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661}],812:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -158493,7 +201707,7 @@ module.exports = { resizeText: resizeText }; -},{"../../components/color":208,"../../components/drawing":230,"../../lib":342,"../../registry":452,"./attributes":462,"./helpers":468,"./uniform_text":478,"@plotly/d3":44}],477:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../lib":661,"../../registry":788,"./attributes":798,"./helpers":804,"./uniform_text":814,"@plotly/d3":54}],813:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -158525,7 +201739,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, default coerce('unselected.marker.color'); }; -},{"../../components/color":208,"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"../../lib":342}],478:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"../../lib":661}],814:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -158604,7 +201818,7 @@ module.exports = { resizeText: resizeText }; -},{"../../lib":342,"@plotly/d3":44}],479:[function(_dereq_,module,exports){ +},{"../../lib":661,"@plotly/d3":54}],815:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -158659,7 +201873,7 @@ module.exports = { // error_y }; -},{"../../lib/extend":333,"../../plots/template_attributes":447,"../bar/attributes":462,"../scatterpolar/attributes":760}],480:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/template_attributes":783,"../bar/attributes":798,"../scatterpolar/attributes":1125}],816:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -158763,7 +201977,7 @@ module.exports = { crossTraceCalc: crossTraceCalc }; -},{"../../components/colorscale/calc":216,"../../components/colorscale/helpers":219,"../../lib":342,"../../registry":452,"../bar/arrays_to_calcdata":461,"../bar/cross_trace_calc":465,"../scatter/calc_selection":707}],481:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../components/colorscale/helpers":535,"../../lib":661,"../../registry":788,"../bar/arrays_to_calcdata":797,"../bar/cross_trace_calc":801,"../scatter/calc_selection":1066}],817:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -158814,7 +202028,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":342,"../bar/style_defaults":477,"../scatterpolar/defaults":762,"./attributes":479}],482:[function(_dereq_,module,exports){ +},{"../../lib":661,"../bar/style_defaults":813,"../scatterpolar/defaults":1127,"./attributes":815}],818:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -158881,7 +202095,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { return [pointData]; }; -},{"../../components/fx":248,"../../lib":342,"../../plots/polar/helpers":440,"../bar/hover":469,"../scatterpolar/hover":764}],483:[function(_dereq_,module,exports){ +},{"../../components/fx":564,"../../lib":661,"../../plots/polar/helpers":776,"../bar/hover":805,"../scatterpolar/hover":1129}],819:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -158912,7 +202126,7 @@ module.exports = { } }; -},{"../../plots/polar":441,"../bar/select":474,"../bar/style":476,"../scatter/marker_colorbar":723,"../scatterpolar/format_labels":763,"./attributes":479,"./calc":480,"./defaults":481,"./hover":482,"./layout_attributes":484,"./layout_defaults":485,"./plot":486}],484:[function(_dereq_,module,exports){ +},{"../../plots/polar":777,"../bar/select":810,"../bar/style":812,"../scatter/marker_colorbar":1082,"../scatterpolar/format_labels":1128,"./attributes":815,"./calc":816,"./defaults":817,"./hover":818,"./layout_attributes":820,"./layout_defaults":821,"./plot":822}],820:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -158931,7 +202145,7 @@ module.exports = { } }; -},{}],485:[function(_dereq_,module,exports){ +},{}],821:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -158958,7 +202172,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":342,"./layout_attributes":484}],486:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":820}],822:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -159058,7 +202272,7 @@ function makePathFn(subplot) { }; } -},{"../../components/drawing":230,"../../lib":342,"../../plots/polar/helpers":440,"@plotly/d3":44,"fast-isnumeric":81}],487:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../plots/polar/helpers":776,"@plotly/d3":54,"fast-isnumeric":159}],823:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -159293,7 +202507,7 @@ module.exports = { } }; -},{"../../components/color/attributes":207,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../bar/attributes":462,"../scatter/attributes":705}],488:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../bar/attributes":798,"../scatter/attributes":1064}],824:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -159739,7 +202953,7 @@ function computeNotchSpan(cdi, N) { return 1.57 * (cdi.q3 - cdi.q1) / Math.sqrt(N); } -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"fast-isnumeric":81}],489:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"fast-isnumeric":159}],825:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -159964,7 +203178,7 @@ module.exports = { setPositionOffset: setPositionOffset }; -},{"../../lib":342,"../../plots/cartesian/axes":390,"../../plots/cartesian/constraints":398}],490:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../../plots/cartesian/constraints":719}],826:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -160274,7 +203488,7 @@ module.exports = { handlePointsDefaults: handlePointsDefaults }; -},{"../../components/color":208,"../../lib":342,"../../plots/cartesian/axis_autotype":391,"../../registry":452,"../bar/defaults":466,"../scatter/period_defaults":725,"./attributes":487}],491:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../plots/cartesian/axis_autotype":712,"../../registry":788,"../bar/defaults":802,"../scatter/period_defaults":1084,"./attributes":823}],827:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -160291,7 +203505,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],492:[function(_dereq_,module,exports){ +},{}],828:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -160570,7 +203784,7 @@ module.exports = { hoverOnPoints: hoverOnPoints }; -},{"../../components/color":208,"../../components/fx":248,"../../lib":342,"../../plots/cartesian/axes":390}],493:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx":564,"../../lib":661,"../../plots/cartesian/axes":711}],829:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -160596,7 +203810,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"./attributes":487,"./calc":488,"./cross_trace_calc":489,"./defaults":490,"./event_data":491,"./hover":492,"./layout_attributes":494,"./layout_defaults":495,"./plot":496,"./select":497,"./style":498}],494:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./attributes":823,"./calc":824,"./cross_trace_calc":825,"./defaults":826,"./event_data":827,"./hover":828,"./layout_attributes":830,"./layout_defaults":831,"./plot":832,"./select":833,"./style":834}],830:[function(_dereq_,module,exports){ 'use strict'; @@ -160623,7 +203837,7 @@ module.exports = { } }; -},{}],495:[function(_dereq_,module,exports){ +},{}],831:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -160661,7 +203875,7 @@ module.exports = { _supply: _supply }; -},{"../../lib":342,"../../registry":452,"./layout_attributes":494}],496:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"./layout_attributes":830}],832:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -161003,7 +204217,7 @@ module.exports = { plotBoxMean: plotBoxMean }; -},{"../../components/drawing":230,"../../lib":342,"@plotly/d3":44}],497:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"@plotly/d3":54}],833:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -161044,7 +204258,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],498:[function(_dereq_,module,exports){ +},{}],834:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -161110,7 +204324,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/color":208,"../../components/drawing":230,"@plotly/d3":44}],499:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"@plotly/d3":54}],835:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib').extendFlat; @@ -161162,7 +204376,7 @@ module.exports = { hoverlabel: OHLCattrs.hoverlabel, }; -},{"../../lib":342,"../../plots/cartesian/axis_format_attributes":393,"../box/attributes":487,"../ohlc/attributes":666}],500:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axis_format_attributes":714,"../box/attributes":823,"../ohlc/attributes":1021}],836:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -161206,7 +204420,7 @@ function ptFunc(o, h, l, c) { }; } -},{"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"../ohlc/calc":667}],501:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"../ohlc/calc":1022}],837:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -161248,7 +204462,7 @@ function handleDirection(traceIn, traceOut, coerce, direction) { coerce(direction + '.fillcolor', Color.addOpacity(lineColor, 0.5)); } -},{"../../components/color":208,"../../lib":342,"../ohlc/ohlc_defaults":671,"../scatter/period_defaults":725,"./attributes":499}],502:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../ohlc/ohlc_defaults":1026,"../scatter/period_defaults":1084,"./attributes":835}],838:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161272,7 +204486,7 @@ module.exports = { selectPoints: _dereq_('../ohlc/select') }; -},{"../../plots/cartesian":404,"../box/cross_trace_calc":489,"../box/layout_attributes":494,"../box/layout_defaults":495,"../box/plot":496,"../box/style":498,"../ohlc/hover":669,"../ohlc/select":673,"./attributes":499,"./calc":500,"./defaults":501}],503:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../box/cross_trace_calc":825,"../box/layout_attributes":830,"../box/layout_defaults":831,"../box/plot":832,"../box/style":834,"../ohlc/hover":1024,"../ohlc/select":1028,"./attributes":835,"./calc":836,"./defaults":837}],839:[function(_dereq_,module,exports){ 'use strict'; var handleAxisDefaults = _dereq_('./axis_defaults'); @@ -161329,7 +204543,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) { }); } -},{"../../plot_api/plot_template":379,"./axis_defaults":508}],504:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":700,"./axis_defaults":844}],840:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -161368,7 +204582,7 @@ function minMax(a, depth) { return [min, max]; } -},{"../../lib":342}],505:[function(_dereq_,module,exports){ +},{"../../lib":661}],841:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -161440,7 +204654,7 @@ module.exports = { transforms: undefined }; -},{"../../components/color/attributes":207,"../../plots/font_attributes":419,"./axis_attributes":507}],506:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../plots/font_attributes":740,"./axis_attributes":843}],842:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -161539,7 +204753,7 @@ module.exports = function(carpet, carpetcd, a, b) { return segments; }; -},{"../../lib":342}],507:[function(_dereq_,module,exports){ +},{"../../lib":661}],843:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -161850,7 +205064,7 @@ module.exports = { editType: 'calc' }; -},{"../../components/color/attributes":207,"../../plot_api/edit_types":372,"../../plots/cartesian/axis_format_attributes":393,"../../plots/cartesian/layout_attributes":405,"../../plots/font_attributes":419}],508:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../plot_api/edit_types":693,"../../plots/cartesian/axis_format_attributes":714,"../../plots/cartesian/layout_attributes":726,"../../plots/font_attributes":740}],844:[function(_dereq_,module,exports){ 'use strict'; var carpetAttrs = _dereq_('./attributes'); @@ -162070,7 +205284,7 @@ function setAutoType(ax, data) { }); } -},{"../../components/color":208,"../../lib":342,"../../plots/cartesian/axis_autotype":391,"../../plots/cartesian/category_order_defaults":395,"../../plots/cartesian/set_convert":411,"../../plots/cartesian/tick_label_defaults":412,"../../plots/cartesian/tick_value_defaults":414,"../../registry":452,"./attributes":505}],509:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../plots/cartesian/axis_autotype":712,"../../plots/cartesian/category_order_defaults":716,"../../plots/cartesian/set_convert":732,"../../plots/cartesian/tick_label_defaults":733,"../../plots/cartesian/tick_value_defaults":735,"../../registry":788,"./attributes":841}],845:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -162172,7 +205386,7 @@ module.exports = function calc(gd, trace) { return [t]; }; -},{"../../lib":342,"../../plots/cartesian/axes":390,"../heatmap/clean_2d_array":603,"../heatmap/convert_column_xyz":605,"./array_minmax":504,"./calc_clippath":510,"./calc_gridlines":511,"./calc_labels":512,"./cheater_basis":514,"./set_convert":527,"./smooth_fill_2d_array":528}],510:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../heatmap/clean_2d_array":944,"../heatmap/convert_column_xyz":946,"./array_minmax":840,"./calc_clippath":846,"./calc_gridlines":847,"./calc_labels":848,"./cheater_basis":850,"./set_convert":863,"./smooth_fill_2d_array":864}],846:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makeClipPath(xctrl, yctrl, aax, bax) { @@ -162215,7 +205429,7 @@ module.exports = function makeClipPath(xctrl, yctrl, aax, bax) { return segments; }; -},{}],511:[function(_dereq_,module,exports){ +},{}],847:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -162550,7 +205764,7 @@ module.exports = function calcGridlines(trace, axisLetter, crossAxisLetter) { } }; -},{"../../lib/extend":333,"../../plots/cartesian/axes":390}],512:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/cartesian/axes":711}],848:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -162603,7 +205817,7 @@ module.exports = function calcLabels(trace, axis) { } }; -},{"../../lib/extend":333,"../../plots/cartesian/axes":390}],513:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/cartesian/axes":711}],849:[function(_dereq_,module,exports){ 'use strict'; /* @@ -162638,7 +205852,7 @@ module.exports = function makeControlPoints(p0, p1, p2, smoothness) { ]]; }; -},{}],514:[function(_dereq_,module,exports){ +},{}],850:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -162698,7 +205912,7 @@ module.exports = function(a, b, cheaterslope) { return data; }; -},{"../../lib":342}],515:[function(_dereq_,module,exports){ +},{"../../lib":661}],851:[function(_dereq_,module,exports){ 'use strict'; var makeControlPoints = _dereq_('./catmull_rom'); @@ -163042,14 +206256,14 @@ module.exports = function computeControlPoints(xe, ye, x, y, asmoothing, bsmooth return [xe, ye]; }; -},{"../../lib":342,"./catmull_rom":513}],516:[function(_dereq_,module,exports){ +},{"../../lib":661,"./catmull_rom":849}],852:[function(_dereq_,module,exports){ 'use strict'; module.exports = { RELATIVE_CULL_TOLERANCE: 1e-6 }; -},{}],517:[function(_dereq_,module,exports){ +},{}],853:[function(_dereq_,module,exports){ 'use strict'; /* @@ -163193,7 +206407,7 @@ module.exports = function(arrays, asmoothing, bsmoothing) { } }; -},{}],518:[function(_dereq_,module,exports){ +},{}],854:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(arrays, asmoothing, bsmoothing) { @@ -163312,7 +206526,7 @@ module.exports = function(arrays, asmoothing, bsmoothing) { } }; -},{}],519:[function(_dereq_,module,exports){ +},{}],855:[function(_dereq_,module,exports){ 'use strict'; /* @@ -163454,7 +206668,7 @@ module.exports = function(arrays, na, nb, asmoothing, bsmoothing) { } }; -},{}],520:[function(_dereq_,module,exports){ +},{}],856:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -163504,7 +206718,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, dfltColor, fullLayou } }; -},{"../../components/color/attributes":207,"../../lib":342,"./ab_defaults":503,"./attributes":505,"./xy_defaults":529}],521:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib":661,"./ab_defaults":839,"./attributes":841,"./xy_defaults":865}],857:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -163523,7 +206737,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"./attributes":505,"./calc":509,"./defaults":520,"./plot":526}],522:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./attributes":841,"./calc":845,"./defaults":856,"./plot":862}],858:[function(_dereq_,module,exports){ 'use strict'; /* @@ -163551,7 +206765,7 @@ module.exports = function(gd, trace) { return firstAxis; }; -},{}],523:[function(_dereq_,module,exports){ +},{}],859:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makePath(xp, yp, isBicubic) { @@ -163575,7 +206789,7 @@ module.exports = function makePath(xp, yp, isBicubic) { return path.join(isBicubic ? '' : 'L'); }; -},{}],524:[function(_dereq_,module,exports){ +},{}],860:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -163604,7 +206818,7 @@ module.exports = function mapArray(out, data, func) { return out; }; -},{"../../lib":342}],525:[function(_dereq_,module,exports){ +},{"../../lib":661}],861:[function(_dereq_,module,exports){ 'use strict'; module.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) { @@ -163637,7 +206851,7 @@ module.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) { }; }; -},{}],526:[function(_dereq_,module,exports){ +},{}],862:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -163879,7 +207093,7 @@ function drawAxisTitle(gd, layer, trace, t, xy, dxy, axis, xa, ya, labelOrientat titleJoin.exit().remove(); } -},{"../../components/drawing":230,"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"./makepath":523,"./map_1d_array":524,"./orient_text":525,"@plotly/d3":44}],527:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"./makepath":859,"./map_1d_array":860,"./orient_text":861,"@plotly/d3":54}],863:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -164154,7 +207368,7 @@ module.exports = function setConvert(trace) { }; }; -},{"../../lib/search":361,"./compute_control_points":515,"./constants":516,"./create_i_derivative_evaluator":517,"./create_j_derivative_evaluator":518,"./create_spline_evaluator":519}],528:[function(_dereq_,module,exports){ +},{"../../lib/search":680,"./compute_control_points":851,"./constants":852,"./create_i_derivative_evaluator":853,"./create_j_derivative_evaluator":854,"./create_spline_evaluator":855}],864:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -164368,7 +207582,7 @@ module.exports = function smoothFill2dArray(data, a, b) { return data; }; -},{"../../lib":342}],529:[function(_dereq_,module,exports){ +},{"../../lib":661}],865:[function(_dereq_,module,exports){ 'use strict'; var isArray1D = _dereq_('../../lib').isArray1D; @@ -164393,7 +207607,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { return true; }; -},{"../../lib":342}],530:[function(_dereq_,module,exports){ +},{"../../lib":661}],866:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -164470,7 +207684,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/color/attributes":207,"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scattergeo/attributes":741}],531:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scattergeo/attributes":1106}],867:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -164523,7 +207737,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../components/colorscale/calc":216,"../../constants/numerical":319,"../scatter/arrays_to_calcdata":704,"../scatter/calc_selection":707,"fast-isnumeric":81}],532:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../constants/numerical":637,"../scatter/arrays_to_calcdata":1063,"../scatter/calc_selection":1066,"fast-isnumeric":159}],868:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -164571,7 +207785,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../components/colorscale/defaults":218,"../../lib":342,"./attributes":530}],533:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../lib":661,"./attributes":866}],869:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -164588,7 +207802,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],534:[function(_dereq_,module,exports){ +},{}],870:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -164675,7 +207889,7 @@ function makeHoverInfo(pointData, trace, pt) { pointData.extraText = text.join('
'); } -},{"../../lib":342,"../../plots/cartesian/axes":390,"./attributes":530}],535:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"./attributes":866}],871:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -164699,7 +207913,7 @@ module.exports = { } }; -},{"../../plots/geo":423,"../heatmap/colorbar":604,"./attributes":530,"./calc":531,"./defaults":532,"./event_data":533,"./hover":534,"./plot":536,"./select":537,"./style":538}],536:[function(_dereq_,module,exports){ +},{"../../plots/geo":744,"../heatmap/colorbar":945,"./attributes":866,"./calc":867,"./defaults":868,"./event_data":869,"./hover":870,"./plot":872,"./select":873,"./style":874}],872:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -164779,7 +207993,7 @@ module.exports = { plot: plot }; -},{"../../lib":342,"../../lib/geo_location_utils":336,"../../lib/topojson_utils":368,"../../plots/cartesian/autorange":389,"./style":538,"@plotly/d3":44}],537:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../lib/geo_location_utils":654,"../../lib/topojson_utils":689,"../../plots/cartesian/autorange":710,"./style":874,"@plotly/d3":54}],873:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -164820,7 +208034,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],538:[function(_dereq_,module,exports){ +},{}],874:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -164868,7 +208082,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/color":208,"../../components/colorscale":220,"../../components/drawing":230,"@plotly/d3":44}],539:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/colorscale":536,"../../components/drawing":546,"@plotly/d3":54}],875:[function(_dereq_,module,exports){ 'use strict'; var choroplethAttrs = _dereq_('../choropleth/attributes'); @@ -164956,7 +208170,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../choropleth/attributes":530}],540:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../choropleth/attributes":866}],876:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -165104,7 +208318,7 @@ module.exports = { convertOnSelect: convertOnSelect }; -},{"../../components/colorscale":220,"../../components/drawing":230,"../../lib":342,"../../lib/geo_location_utils":336,"../../lib/geojson_utils":337,"fast-isnumeric":81}],541:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../components/drawing":546,"../../lib":661,"../../lib/geo_location_utils":654,"../../lib/geojson_utils":655,"fast-isnumeric":159}],877:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -165147,7 +208361,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../components/colorscale/defaults":218,"../../lib":342,"./attributes":539}],542:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../lib":661,"./attributes":875}],878:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -165200,7 +208414,7 @@ module.exports = { } }; -},{"../../plots/mapbox":432,"../choropleth/calc":531,"../choropleth/event_data":533,"../choropleth/hover":534,"../choropleth/select":537,"../heatmap/colorbar":604,"./attributes":539,"./defaults":541,"./plot":543}],543:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":768,"../choropleth/calc":867,"../choropleth/event_data":869,"../choropleth/hover":870,"../choropleth/select":873,"../heatmap/colorbar":945,"./attributes":875,"./defaults":877,"./plot":879}],879:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert').convert; @@ -165319,7 +208533,411 @@ module.exports = function createChoroplethMapbox(subplot, calcTrace) { return choroplethMapbox; }; -},{"../../plots/mapbox/constants":430,"./convert":540}],544:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":766,"./convert":876}],880:[function(_dereq_,module,exports){ +'use strict'; + +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); +var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; +var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; +var mesh3dAttrs = _dereq_('../mesh3d/attributes'); +var baseAttrs = _dereq_('../../plots/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; + +var attrs = { + x: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + y: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + z: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + + u: { + valType: 'data_array', + editType: 'calc', + }, + v: { + valType: 'data_array', + editType: 'calc', + }, + w: { + valType: 'data_array', + editType: 'calc', + }, + + // TODO add way to specify cone positions independently of the vector field + // provided, similar to MATLAB's coneplot Cx/Cy/Cz meshgrids, + // see https://www.mathworks.com/help/matlab/ref/coneplot.html + // + // Alternatively, if our goal is only to 'fill in gaps' in the vector data, + // we could try to extend the heatmap 'connectgaps' algorithm to 3D. + // From AJ: this particular algorithm which amounts to a Poisson equation, + // both for interpolation and extrapolation - is the right one to use for + // cones too. It makes a field with zero divergence, which is a good + // baseline assumption for vector fields. + // + // cones: { + // // potential attributes to add: + // // + // // - meshmode: 'cartesian-product', 'pts', 'grid' + // // + // // under `meshmode: 'grid'` + // // - (x|y|z)grid.start + // // - (x|y|z)grid.end + // // - (x|y|z)grid.size + // + // x: { + // valType: 'data_array', + // editType: 'calc', + // + // }, + // y: { + // valType: 'data_array', + // editType: 'calc', + // + // }, + // z: { + // valType: 'data_array', + // editType: 'calc', + // + // }, + // + // editType: 'calc', + // + // }, + + sizemode: { + valType: 'enumerated', + values: ['scaled', 'absolute'], + editType: 'calc', + dflt: 'scaled', + }, + sizeref: { + valType: 'number', + editType: 'calc', + min: 0, + }, + + anchor: { + valType: 'enumerated', + editType: 'calc', + values: ['tip', 'tail', 'cm', 'center'], + dflt: 'cm', + }, + + text: { + valType: 'string', + dflt: '', + arrayOk: true, + editType: 'calc', + }, + hovertext: { + valType: 'string', + dflt: '', + arrayOk: true, + editType: 'calc', + }, + + hovertemplate: hovertemplateAttrs({editType: 'calc'}, {keys: ['norm']}), + uhoverformat: axisHoverFormat('u', 1), + vhoverformat: axisHoverFormat('v', 1), + whoverformat: axisHoverFormat('w', 1), + xhoverformat: axisHoverFormat('x'), + yhoverformat: axisHoverFormat('y'), + zhoverformat: axisHoverFormat('z'), + + showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) +}; + +extendFlat(attrs, colorScaleAttrs('', { + colorAttr: 'u/v/w norm', + showScaleDflt: true, + editTypeOverride: 'calc' +})); + +var fromMesh3d = ['opacity', 'lightposition', 'lighting']; + +fromMesh3d.forEach(function(k) { + attrs[k] = mesh3dAttrs[k]; +}); + +attrs.hoverinfo = extendFlat({}, baseAttrs.hoverinfo, { + editType: 'calc', + flags: ['x', 'y', 'z', 'u', 'v', 'w', 'norm', 'text', 'name'], + dflt: 'x+y+z+norm+text+name' +}); + +attrs.transforms = undefined; + +module.exports = attrs; + +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../mesh3d/attributes":1016}],881:[function(_dereq_,module,exports){ +'use strict'; + +var colorscaleCalc = _dereq_('../../components/colorscale/calc'); + +module.exports = function calc(gd, trace) { + var u = trace.u; + var v = trace.v; + var w = trace.w; + var len = Math.min( + trace.x.length, trace.y.length, trace.z.length, + u.length, v.length, w.length + ); + var normMax = -Infinity; + var normMin = Infinity; + + for(var i = 0; i < len; i++) { + var uu = u[i]; + var vv = v[i]; + var ww = w[i]; + var norm = Math.sqrt(uu * uu + vv * vv + ww * ww); + + normMax = Math.max(normMax, norm); + normMin = Math.min(normMin, norm); + } + + trace._len = len; + trace._normMax = normMax; + + colorscaleCalc(gd, trace, { + vals: [normMin, normMax], + containerStr: '', + cLetter: 'c' + }); +}; + +},{"../../components/colorscale/calc":532}],882:[function(_dereq_,module,exports){ +'use strict'; + +var conePlot = _dereq_('gl-cone3d'); +var createConeMesh = _dereq_('gl-cone3d').createConeMesh; + +var simpleMap = _dereq_('../../lib').simpleMap; +var parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale; +var extractOpts = _dereq_('../../components/colorscale').extractOpts; +var zip3 = _dereq_('../../plots/gl3d/zip3'); + +function Cone(scene, uid) { + this.scene = scene; + this.uid = uid; + this.mesh = null; + this.data = null; +} + +var proto = Cone.prototype; + +proto.handlePick = function(selection) { + if(selection.object === this.mesh) { + var selectIndex = selection.index = selection.data.index; + var xx = this.data.x[selectIndex]; + var yy = this.data.y[selectIndex]; + var zz = this.data.z[selectIndex]; + var uu = this.data.u[selectIndex]; + var vv = this.data.v[selectIndex]; + var ww = this.data.w[selectIndex]; + + selection.traceCoordinate = [ + xx, yy, zz, + uu, vv, ww, + Math.sqrt(uu * uu + vv * vv + ww * ww) + ]; + + var text = this.data.hovertext || this.data.text; + if(Array.isArray(text) && text[selectIndex] !== undefined) { + selection.textLabel = text[selectIndex]; + } else if(text) { + selection.textLabel = text; + } + + return true; + } +}; + +var axisName2scaleIndex = {xaxis: 0, yaxis: 1, zaxis: 2}; +var anchor2coneOffset = {tip: 1, tail: 0, cm: 0.25, center: 0.5}; +var anchor2coneSpan = {tip: 1, tail: 1, cm: 0.75, center: 0.5}; + +function convert(scene, trace) { + var sceneLayout = scene.fullSceneLayout; + var dataScale = scene.dataScale; + var coneOpts = {}; + + function toDataCoords(arr, axisName) { + var ax = sceneLayout[axisName]; + var scale = dataScale[axisName2scaleIndex[axisName]]; + return simpleMap(arr, function(v) { return ax.d2l(v) * scale; }); + } + + coneOpts.vectors = zip3( + toDataCoords(trace.u, 'xaxis'), + toDataCoords(trace.v, 'yaxis'), + toDataCoords(trace.w, 'zaxis'), + trace._len + ); + + coneOpts.positions = zip3( + toDataCoords(trace.x, 'xaxis'), + toDataCoords(trace.y, 'yaxis'), + toDataCoords(trace.z, 'zaxis'), + trace._len + ); + + var cOpts = extractOpts(trace); + coneOpts.colormap = parseColorScale(trace); + coneOpts.vertexIntensityBounds = [cOpts.min / trace._normMax, cOpts.max / trace._normMax]; + coneOpts.coneOffset = anchor2coneOffset[trace.anchor]; + + if(trace.sizemode === 'scaled') { + // unitless sizeref + coneOpts.coneSize = trace.sizeref || 0.5; + } else { + // sizeref here has unit of velocity + coneOpts.coneSize = trace.sizeref && trace._normMax ? + trace.sizeref / trace._normMax : + 0.5; + } + + var meshData = conePlot(coneOpts); + + // pass gl-mesh3d lighting attributes + var lp = trace.lightposition; + meshData.lightPosition = [lp.x, lp.y, lp.z]; + meshData.ambient = trace.lighting.ambient; + meshData.diffuse = trace.lighting.diffuse; + meshData.specular = trace.lighting.specular; + meshData.roughness = trace.lighting.roughness; + meshData.fresnel = trace.lighting.fresnel; + meshData.opacity = trace.opacity; + + // stash autorange pad value + trace._pad = anchor2coneSpan[trace.anchor] * meshData.vectorScale * meshData.coneScale * trace._normMax; + + return meshData; +} + +proto.update = function(data) { + this.data = data; + + var meshData = convert(this.scene, data); + this.mesh.update(meshData); +}; + +proto.dispose = function() { + this.scene.glplot.remove(this.mesh); + this.mesh.dispose(); +}; + +function createConeTrace(scene, data) { + var gl = scene.glplot.gl; + + var meshData = convert(scene, data); + var mesh = createConeMesh(gl, meshData); + + var cone = new Cone(scene, data.uid); + cone.mesh = mesh; + cone.data = data; + mesh._trace = cone; + + scene.glplot.add(mesh); + + return cone; +} + +module.exports = createConeTrace; + +},{"../../components/colorscale":536,"../../lib":661,"../../lib/gl_format_color":657,"../../plots/gl3d/zip3":764,"gl-cone3d":172}],883:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); + +var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); +var attributes = _dereq_('./attributes'); + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + var u = coerce('u'); + var v = coerce('v'); + var w = coerce('w'); + + var x = coerce('x'); + var y = coerce('y'); + var z = coerce('z'); + + if( + !u || !u.length || !v || !v.length || !w || !w.length || + !x || !x.length || !y || !y.length || !z || !z.length + ) { + traceOut.visible = false; + return; + } + + coerce('sizeref'); + coerce('sizemode'); + + coerce('anchor'); + + coerce('lighting.ambient'); + coerce('lighting.diffuse'); + coerce('lighting.specular'); + coerce('lighting.roughness'); + coerce('lighting.fresnel'); + coerce('lightposition.x'); + coerce('lightposition.y'); + coerce('lightposition.z'); + + colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}); + + coerce('text'); + coerce('hovertext'); + coerce('hovertemplate'); + coerce('uhoverformat'); + coerce('vhoverformat'); + coerce('whoverformat'); + coerce('xhoverformat'); + coerce('yhoverformat'); + coerce('zhoverformat'); + + // disable 1D transforms (for now) + traceOut._length = null; +}; + +},{"../../components/colorscale/defaults":534,"../../lib":661,"./attributes":880}],884:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + moduleType: 'trace', + name: 'cone', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', 'showLegend'], + + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + calc: _dereq_('./calc'), + plot: _dereq_('./convert'), + eventData: function(out, pt) { + out.norm = pt.traceCoordinate[6]; + return out; + }, + + meta: { + } +}; + +},{"../../plots/gl3d":753,"./attributes":880,"./calc":881,"./convert":882,"./defaults":883}],885:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -165479,7 +209097,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":215,"../../components/drawing/attributes":229,"../../constants/filter_ops":317,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/font_attributes":419,"../heatmap/attributes":601,"../scatter/attributes":705}],545:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../components/drawing/attributes":545,"../../constants/filter_ops":633,"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../../plots/font_attributes":740,"../heatmap/attributes":942,"../scatter/attributes":1064}],886:[function(_dereq_,module,exports){ 'use strict'; var Colorscale = _dereq_('../../components/colorscale'); @@ -165524,7 +209142,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale":220,"../heatmap/calc":602,"./end_plus":555,"./set_contours":563}],546:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../heatmap/calc":943,"./end_plus":896,"./set_contours":904}],887:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(pathinfo, contours) { @@ -165606,7 +209224,7 @@ module.exports = function(pathinfo, contours) { } }; -},{}],547:[function(_dereq_,module,exports){ +},{}],888:[function(_dereq_,module,exports){ 'use strict'; var Colorscale = _dereq_('../../components/colorscale'); @@ -165649,7 +209267,7 @@ module.exports = { calc: calc }; -},{"../../components/colorscale":220,"./end_plus":555,"./make_color_map":560}],548:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"./end_plus":896,"./make_color_map":901}],889:[function(_dereq_,module,exports){ 'use strict'; module.exports = { // some constants to help with marching squares algorithm @@ -165719,7 +209337,7 @@ module.exports = { } }; -},{}],549:[function(_dereq_,module,exports){ +},{}],890:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -165804,7 +209422,7 @@ function handleConstraintValueDefaults(coerce, contours) { } } -},{"../../components/color":208,"../../constants/filter_ops":317,"./label_defaults":559,"fast-isnumeric":81}],550:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../constants/filter_ops":633,"./label_defaults":900,"fast-isnumeric":159}],891:[function(_dereq_,module,exports){ 'use strict'; var filterOps = _dereq_('../../constants/filter_ops'); @@ -165875,7 +209493,7 @@ function makeInequalitySettings(operation) { }; } -},{"../../constants/filter_ops":317,"fast-isnumeric":81}],551:[function(_dereq_,module,exports){ +},{"../../constants/filter_ops":633,"fast-isnumeric":159}],892:[function(_dereq_,module,exports){ 'use strict'; module.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerce2) { @@ -165896,7 +209514,7 @@ module.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerc if(autoContour || !contourSize) coerce('ncontours'); }; -},{}],552:[function(_dereq_,module,exports){ +},{}],893:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -165988,7 +209606,7 @@ function copyPathinfo(pi) { }); } -},{"../../lib":342}],553:[function(_dereq_,module,exports){ +},{"../../lib":661}],894:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -166036,7 +209654,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../lib":342,"../heatmap/xyz_defaults":615,"../scatter/period_defaults":725,"./attributes":544,"./constraint_defaults":549,"./contours_defaults":551,"./style_defaults":565}],554:[function(_dereq_,module,exports){ +},{"../../lib":661,"../heatmap/xyz_defaults":956,"../scatter/period_defaults":1084,"./attributes":885,"./constraint_defaults":890,"./contours_defaults":892,"./style_defaults":906}],895:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -166092,7 +209710,7 @@ module.exports = function emptyPathinfo(contours, plotinfo, cd0) { return pathinfo; }; -},{"../../lib":342,"./constraint_mapping":550,"./end_plus":555}],555:[function(_dereq_,module,exports){ +},{"../../lib":661,"./constraint_mapping":891,"./end_plus":896}],896:[function(_dereq_,module,exports){ 'use strict'; /* @@ -166103,7 +209721,7 @@ module.exports = function endPlus(contours) { return contours.end + contours.size / 1e6; }; -},{}],556:[function(_dereq_,module,exports){ +},{}],897:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -166389,7 +210007,7 @@ function getInterpPx(pi, loc, step) { } } -},{"../../lib":342,"./constants":548}],557:[function(_dereq_,module,exports){ +},{"../../lib":661,"./constants":889}],898:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -166418,7 +210036,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return hoverData; }; -},{"../../components/color":208,"../heatmap/hover":608}],558:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../heatmap/hover":949}],899:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -166438,7 +210056,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"./attributes":544,"./calc":545,"./colorbar":547,"./defaults":553,"./hover":557,"./plot":562,"./style":564}],559:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./attributes":885,"./calc":886,"./colorbar":888,"./defaults":894,"./hover":898,"./plot":903,"./style":905}],900:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -166459,7 +210077,7 @@ module.exports = function handleLabelDefaults(coerce, layout, lineColor, opts) { if(opts.hasHover !== false) coerce('zhoverformat'); }; -},{"../../lib":342}],560:[function(_dereq_,module,exports){ +},{"../../lib":661}],901:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -166535,7 +210153,7 @@ module.exports = function makeColorMap(trace) { ); }; -},{"../../components/colorscale":220,"./end_plus":555,"@plotly/d3":44}],561:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"./end_plus":896,"@plotly/d3":54}],902:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -166619,7 +210237,7 @@ function getMarchingIndex(val, corners) { return (mi === 15) ? 0 : mi; } -},{"./constants":548}],562:[function(_dereq_,module,exports){ +},{"./constants":889}],903:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -167301,7 +210919,7 @@ function makeClipMask(cd0) { return z; } -},{"../../components/colorscale":220,"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../plots/cartesian/set_convert":411,"../heatmap/plot":612,"./close_boundaries":546,"./constants":548,"./convert_to_constraints":552,"./empty_pathinfo":554,"./find_all_paths":556,"./make_crossings":561,"@plotly/d3":44}],563:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../plots/cartesian/set_convert":732,"../heatmap/plot":953,"./close_boundaries":887,"./constants":889,"./convert_to_constraints":893,"./empty_pathinfo":895,"./find_all_paths":897,"./make_crossings":902,"@plotly/d3":54}],904:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -167397,7 +211015,7 @@ function autoContours(start, end, ncontours) { return dummyAx; } -},{"../../lib":342,"../../plots/cartesian/axes":390}],564:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711}],905:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -167469,7 +211087,7 @@ module.exports = function style(gd) { heatmapStyle(gd); }; -},{"../../components/drawing":230,"../heatmap/style":613,"./make_color_map":560,"@plotly/d3":44}],565:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../heatmap/style":954,"./make_color_map":901,"@plotly/d3":54}],906:[function(_dereq_,module,exports){ 'use strict'; var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); @@ -167505,7 +211123,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout, handleLabelDefaults(coerce, layout, lineColor, opts); }; -},{"../../components/colorscale/defaults":218,"./label_defaults":559}],566:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"./label_defaults":900}],907:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -167578,7 +211196,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../contour/attributes":544,"../heatmap/attributes":601}],567:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../contour/attributes":885,"../heatmap/attributes":942}],908:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -167682,7 +211300,7 @@ function heatmappishCalc(gd, trace) { return [cd0]; } -},{"../../components/colorscale/calc":216,"../../lib":342,"../carpet/lookup_carpetid":522,"../contour/set_contours":563,"../heatmap/clean_2d_array":603,"../heatmap/convert_column_xyz":605,"../heatmap/find_empties":607,"../heatmap/interp2d":610,"../heatmap/make_bound_array":611,"./defaults":568}],568:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../lib":661,"../carpet/lookup_carpetid":858,"../contour/set_contours":904,"../heatmap/clean_2d_array":944,"../heatmap/convert_column_xyz":946,"../heatmap/find_empties":948,"../heatmap/interp2d":951,"../heatmap/make_bound_array":952,"./defaults":909}],909:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -167742,7 +211360,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../lib":342,"../contour/constraint_defaults":549,"../contour/contours_defaults":551,"../contour/style_defaults":565,"../heatmap/xyz_defaults":615,"./attributes":566}],569:[function(_dereq_,module,exports){ +},{"../../lib":661,"../contour/constraint_defaults":890,"../contour/contours_defaults":892,"../contour/style_defaults":906,"../heatmap/xyz_defaults":956,"./attributes":907}],910:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -167761,7 +211379,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../contour/colorbar":547,"../contour/style":564,"./attributes":566,"./calc":567,"./defaults":568,"./plot":570}],570:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../contour/colorbar":888,"../contour/style":905,"./attributes":907,"./calc":908,"./defaults":909,"./plot":911}],911:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -168234,7 +211852,7 @@ function joinAllPaths(trace, pi, perimeter, ab2p, carpet, carpetcd, xa, ya) { return fullpath; } -},{"../../components/drawing":230,"../../lib":342,"../carpet/axis_aligned_line":506,"../carpet/lookup_carpetid":522,"../carpet/makepath":523,"../carpet/map_1d_array":524,"../contour/close_boundaries":546,"../contour/constants":548,"../contour/convert_to_constraints":552,"../contour/empty_pathinfo":554,"../contour/find_all_paths":556,"../contour/make_crossings":561,"../contour/plot":562,"@plotly/d3":44}],571:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../carpet/axis_aligned_line":842,"../carpet/lookup_carpetid":858,"../carpet/makepath":859,"../carpet/map_1d_array":860,"../contour/close_boundaries":887,"../contour/constants":889,"../contour/convert_to_constraints":893,"../contour/empty_pathinfo":895,"../contour/find_all_paths":897,"../contour/make_crossings":902,"../contour/plot":903,"@plotly/d3":54}],912:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -168303,7 +211921,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scattermapbox/attributes":751}],572:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scattermapbox/attributes":1116}],913:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -168354,7 +211972,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../components/colorscale/calc":216,"../../constants/numerical":319,"../../lib":342,"fast-isnumeric":81}],573:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../constants/numerical":637,"../../lib":661,"fast-isnumeric":159}],914:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -168462,7 +212080,7 @@ module.exports = function convert(calcTrace) { return opts; }; -},{"../../components/color":208,"../../components/colorscale":220,"../../constants/numerical":319,"../../lib":342,"../../lib/geojson_utils":337,"fast-isnumeric":81}],574:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/colorscale":536,"../../constants/numerical":637,"../../lib":661,"../../lib/geojson_utils":655,"fast-isnumeric":159}],915:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -168496,7 +212114,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":218,"../../lib":342,"./attributes":571}],575:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../lib":661,"./attributes":912}],916:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -168506,7 +212124,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],576:[function(_dereq_,module,exports){ +},{}],917:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -168536,7 +212154,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { return [newPointData]; }; -},{"../../plots/cartesian/axes":390,"../scattermapbox/hover":756}],577:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711,"../scattermapbox/hover":1121}],918:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -168574,7 +212192,7 @@ module.exports = { } }; -},{"../../plots/mapbox":432,"../heatmap/colorbar":604,"../scattermapbox/format_labels":755,"./attributes":571,"./calc":572,"./defaults":574,"./event_data":575,"./hover":576,"./plot":578}],578:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":768,"../heatmap/colorbar":945,"../scattermapbox/format_labels":1120,"./attributes":912,"./calc":913,"./defaults":915,"./event_data":916,"./hover":917,"./plot":919}],919:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert'); @@ -168680,7 +212298,7 @@ module.exports = function createDensityMapbox(subplot, calcTrace) { return densityMapbox; }; -},{"../../plots/mapbox/constants":430,"./convert":573}],579:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":766,"./convert":914}],920:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -168705,7 +212323,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":342}],580:[function(_dereq_,module,exports){ +},{"../../lib":661}],921:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -168806,7 +212424,7 @@ function funnelMarker() { return marker; } -},{"../../components/color":208,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../bar/attributes":462,"../scatter/attributes":705,"./constants":582}],581:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../bar/attributes":798,"../scatter/attributes":1064,"./constants":923}],922:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -168906,7 +212524,7 @@ function fixNum(a) { return (a === BADNUM) ? 0 : a; } -},{"../../constants/numerical":319,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"../scatter/calc_selection":707,"./arrays_to_calcdata":579}],582:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"../scatter/calc_selection":1066,"./arrays_to_calcdata":920}],923:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -168917,7 +212535,7 @@ module.exports = { ] }; -},{}],583:[function(_dereq_,module,exports){ +},{}],924:[function(_dereq_,module,exports){ 'use strict'; var setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions; @@ -168980,7 +212598,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../bar/cross_trace_calc":465}],584:[function(_dereq_,module,exports){ +},{"../bar/cross_trace_calc":801}],925:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -169074,7 +212692,7 @@ module.exports = { crossTraceDefaults: crossTraceDefaults }; -},{"../../components/color":208,"../../lib":342,"../bar/defaults":466,"../scatter/period_defaults":725,"../scatter/xy_defaults":732,"./attributes":580}],585:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../bar/defaults":802,"../scatter/period_defaults":1084,"../scatter/xy_defaults":1091,"./attributes":921}],926:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { @@ -169093,7 +212711,7 @@ module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { return out; }; -},{}],586:[function(_dereq_,module,exports){ +},{}],927:[function(_dereq_,module,exports){ 'use strict'; var opacity = _dereq_('../../components/color').opacity; @@ -169158,7 +212776,7 @@ function getTraceColor(trace, di) { else if(opacity(mlc) && mlw) return mlc; } -},{"../../components/color":208,"../../lib":342,"../bar/hover":469}],587:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../bar/hover":805}],928:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -169184,7 +212802,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../bar/select":474,"./attributes":580,"./calc":581,"./cross_trace_calc":583,"./defaults":584,"./event_data":585,"./hover":586,"./layout_attributes":588,"./layout_defaults":589,"./plot":590,"./style":591}],588:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../bar/select":810,"./attributes":921,"./calc":922,"./cross_trace_calc":924,"./defaults":925,"./event_data":926,"./hover":927,"./layout_attributes":929,"./layout_defaults":930,"./plot":931,"./style":932}],929:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -169209,7 +212827,7 @@ module.exports = { } }; -},{}],589:[function(_dereq_,module,exports){ +},{}],930:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -169238,7 +212856,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":342,"./layout_attributes":588}],590:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":929}],931:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -169399,7 +213017,7 @@ function getXY(di, xa, ya, isHorizontal) { return isHorizontal ? [s, p] : [p, s]; } -},{"../../components/drawing":230,"../../constants/numerical":319,"../../lib":342,"../bar/plot":473,"../bar/uniform_text":478,"@plotly/d3":44}],591:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../constants/numerical":637,"../../lib":661,"../bar/plot":809,"../bar/uniform_text":814,"@plotly/d3":54}],932:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -169456,7 +213074,7 @@ module.exports = { style: style }; -},{"../../components/color":208,"../../components/drawing":230,"../../constants/interactions":318,"../bar/style":476,"../bar/uniform_text":478,"@plotly/d3":44}],592:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../constants/interactions":636,"../bar/style":812,"../bar/uniform_text":814,"@plotly/d3":54}],933:[function(_dereq_,module,exports){ 'use strict'; var pieAttrs = _dereq_('../pie/attributes'); @@ -169544,7 +213162,7 @@ module.exports = { } }; -},{"../../lib/extend":333,"../../plots/attributes":386,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683}],593:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/attributes":707,"../../plots/domain":739,"../../plots/template_attributes":783,"../pie/attributes":1038}],934:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -169559,7 +213177,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":438}],594:[function(_dereq_,module,exports){ +},{"../../plots/plots":774}],935:[function(_dereq_,module,exports){ 'use strict'; var pieCalc = _dereq_('../pie/calc'); @@ -169577,7 +213195,7 @@ module.exports = { crossTraceCalc: crossTraceCalc }; -},{"../pie/calc":685}],595:[function(_dereq_,module,exports){ +},{"../pie/calc":1040}],936:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -169651,7 +213269,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('baseratio'); }; -},{"../../lib":342,"../../plots/domain":418,"../bar/defaults":466,"../pie/defaults":686,"./attributes":592}],596:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/domain":739,"../bar/defaults":802,"../pie/defaults":1041,"./attributes":933}],937:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -169676,7 +213294,7 @@ module.exports = { } }; -},{"../pie/style_one":694,"./attributes":592,"./base_plot":593,"./calc":594,"./defaults":595,"./layout_attributes":597,"./layout_defaults":598,"./plot":599,"./style":600}],597:[function(_dereq_,module,exports){ +},{"../pie/style_one":1049,"./attributes":933,"./base_plot":934,"./calc":935,"./defaults":936,"./layout_attributes":938,"./layout_defaults":939,"./plot":940,"./style":941}],938:[function(_dereq_,module,exports){ 'use strict'; var hiddenlabels = _dereq_('../pie/layout_attributes').hiddenlabels; @@ -169695,7 +213313,7 @@ module.exports = { } }; -},{"../pie/layout_attributes":690}],598:[function(_dereq_,module,exports){ +},{"../pie/layout_attributes":1045}],939:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -169712,7 +213330,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendfunnelareacolors'); }; -},{"../../lib":342,"./layout_attributes":597}],599:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":938}],940:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -170002,7 +213620,7 @@ function setCoords(cd) { } } -},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../bar/plot":473,"../bar/uniform_text":478,"../pie/helpers":688,"../pie/plot":692,"@plotly/d3":44}],600:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../bar/plot":809,"../bar/uniform_text":814,"../pie/helpers":1043,"../pie/plot":1047,"@plotly/d3":54}],941:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -170027,7 +213645,7 @@ module.exports = function style(gd) { }); }; -},{"../bar/uniform_text":478,"../pie/style_one":694,"@plotly/d3":44}],601:[function(_dereq_,module,exports){ +},{"../bar/uniform_text":814,"../pie/style_one":1049,"@plotly/d3":54}],942:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -170119,7 +213737,7 @@ module.exports = extendFlat({ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../scatter/attributes":705}],602:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../scatter/attributes":1064}],943:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -170320,7 +213938,7 @@ function dropZonBreaks(x, y, z) { return newZ; } -},{"../../components/colorscale/calc":216,"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"../../registry":452,"../histogram2d/calc":630,"./clean_2d_array":603,"./convert_column_xyz":605,"./find_empties":607,"./interp2d":610,"./make_bound_array":611}],603:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"../../registry":788,"../histogram2d/calc":975,"./clean_2d_array":944,"./convert_column_xyz":946,"./find_empties":948,"./interp2d":951,"./make_bound_array":952}],944:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -170389,7 +214007,7 @@ module.exports = function clean2dArray(zOld, trace, xa, ya) { return zNew; }; -},{"../../constants/numerical":319,"../../lib":342,"fast-isnumeric":81}],604:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"fast-isnumeric":159}],945:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -170397,7 +214015,7 @@ module.exports = { max: 'zmax' }; -},{}],605:[function(_dereq_,module,exports){ +},{}],946:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -170478,7 +214096,7 @@ module.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name, trace._after2before = after2before; }; -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387}],606:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708}],947:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -170517,7 +214135,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":218,"../../lib":342,"../scatter/period_defaults":725,"./attributes":601,"./style_defaults":614,"./xyz_defaults":615}],607:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../lib":661,"../scatter/period_defaults":1084,"./attributes":942,"./style_defaults":955,"./xyz_defaults":956}],948:[function(_dereq_,module,exports){ 'use strict'; var maxRowLength = _dereq_('../../lib').maxRowLength; @@ -170614,7 +214232,7 @@ module.exports = function findEmpties(z) { return empties.sort(function(a, b) { return b[2] - a[2]; }); }; -},{"../../lib":342}],608:[function(_dereq_,module,exports){ +},{"../../lib":661}],949:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -170747,7 +214365,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { })]; }; -},{"../../components/colorscale":220,"../../components/fx":248,"../../lib":342,"../../plots/cartesian/axes":390}],609:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../components/fx":564,"../../lib":661,"../../plots/cartesian/axes":711}],950:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -170767,7 +214385,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"./attributes":601,"./calc":602,"./colorbar":604,"./defaults":606,"./hover":608,"./plot":612,"./style":613}],610:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./attributes":942,"./calc":943,"./colorbar":945,"./defaults":947,"./hover":949,"./plot":953,"./style":954}],951:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -170892,7 +214510,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../lib":342}],611:[function(_dereq_,module,exports){ +},{"../../lib":661}],952:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -170972,7 +214590,7 @@ module.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks, return arrayOut; }; -},{"../../lib":342,"../../registry":452}],612:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788}],953:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -171368,7 +214986,7 @@ function putColor(pixels, pxIndex, c) { pixels[pxIndex + 3] = Math.round(c[3] * 255); } -},{"../../components/colorscale":220,"../../constants/xmlns_namespaces":320,"../../lib":342,"../../registry":452,"@plotly/d3":44,"tinycolor2":171}],613:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../constants/xmlns_namespaces":638,"../../lib":661,"../../registry":788,"@plotly/d3":54,"tinycolor2":471}],954:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -171380,7 +214998,7 @@ module.exports = function style(gd) { }); }; -},{"@plotly/d3":44}],614:[function(_dereq_,module,exports){ +},{"@plotly/d3":54}],955:[function(_dereq_,module,exports){ 'use strict'; module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) { @@ -171394,7 +215012,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) { coerce('zhoverformat'); }; -},{}],615:[function(_dereq_,module,exports){ +},{}],956:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -171485,7 +215103,241 @@ function isValidZ(z) { return (allRowsAreArrays && oneRowIsFilled && hasOneNumber); } -},{"../../lib":342,"../../registry":452,"fast-isnumeric":81}],616:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"fast-isnumeric":159}],957:[function(_dereq_,module,exports){ +'use strict'; + +var heatmapAttrs = _dereq_('../heatmap/attributes'); +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; + +var commonList = [ + 'z', + 'x', 'x0', 'dx', + 'y', 'y0', 'dy', + 'text', 'transpose', + 'xtype', 'ytype' +]; + +var attrs = {}; + +for(var i = 0; i < commonList.length; i++) { + var k = commonList[i]; + attrs[k] = heatmapAttrs[k]; +} + +attrs.zsmooth = { + valType: 'enumerated', + values: ['fast', false], + dflt: 'fast', + editType: 'calc', +}; + +extendFlat( + attrs, + colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) +); + +module.exports = overrideAll(attrs, 'calc', 'nested'); + +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../heatmap/attributes":942}],958:[function(_dereq_,module,exports){ +'use strict'; + +var createHeatmap2D = _dereq_('gl-heatmap2d'); +var Axes = _dereq_('../../plots/cartesian/axes'); +var str2RGBArray = _dereq_('../../lib/str2rgbarray'); + + +function Heatmap(scene, uid) { + this.scene = scene; + this.uid = uid; + 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 = { + zsmooth: 'fast', + z: [], + x: [], + y: [], + shape: [0, 0], + colorLevels: [0], + colorValues: [0, 0, 0, 1] + }; + + this.heatmap = createHeatmap2D(scene.glplot, this.options); + this.heatmap._trace = this; +} + +var proto = Heatmap.prototype; + +proto.handlePick = function(pickResult) { + var options = this.options; + var shape = options.shape; + var index = pickResult.pointId; + var xIndex = index % shape[0]; + var yIndex = Math.floor(index / shape[0]); + var zIndex = index; + + return { + trace: this, + dataCoord: pickResult.dataCoord, + traceCoord: [ + options.x[xIndex], + options.y[yIndex], + options.z[zIndex] + ], + textLabel: this.textLabels[index], + name: this.name, + pointIndex: [yIndex, xIndex], + hoverinfo: this.hoverinfo + }; +}; + +proto.update = function(fullTrace, calcTrace) { + var calcPt = calcTrace[0]; + + this.index = fullTrace.index; + this.name = fullTrace.name; + this.hoverinfo = fullTrace.hoverinfo; + + // convert z from 2D -> 1D + var z = calcPt.z; + this.options.z = [].concat.apply([], z); + + var rowLen = z[0].length; + var colLen = z.length; + this.options.shape = [rowLen, colLen]; + + this.options.x = calcPt.x; + this.options.y = calcPt.y; + this.options.zsmooth = fullTrace.zsmooth; + + var colorOptions = convertColorscale(fullTrace); + this.options.colorLevels = colorOptions.colorLevels; + this.options.colorValues = colorOptions.colorValues; + + // convert text from 2D -> 1D + this.textLabels = [].concat.apply([], fullTrace.text); + + this.heatmap.update(this.options); + + var xa = this.scene.xaxis; + var ya = this.scene.yaxis; + + var xOpts, yOpts; + if(fullTrace.zsmooth === false) { + // increase padding for discretised heatmap as suggested by Louise Ord + xOpts = { ppad: calcPt.x[1] - calcPt.x[0] }; + yOpts = { ppad: calcPt.y[1] - calcPt.y[0] }; + } + + fullTrace._extremes[xa._id] = Axes.findExtremes(xa, calcPt.x, xOpts); + fullTrace._extremes[ya._id] = Axes.findExtremes(ya, calcPt.y, yOpts); +}; + +proto.dispose = function() { + this.heatmap.dispose(); +}; + +function convertColorscale(fullTrace) { + var scl = fullTrace.colorscale; + var zmin = fullTrace.zmin; + var zmax = fullTrace.zmax; + + var N = scl.length; + var domain = new Array(N); + var range = new Array(4 * N); + + for(var i = 0; i < N; i++) { + var si = scl[i]; + var color = str2RGBArray(si[1]); + + domain[i] = zmin + si[0] * (zmax - zmin); + + for(var j = 0; j < 4; j++) { + range[(4 * i) + j] = color[j]; + } + } + + return { + colorLevels: domain, + colorValues: range + }; +} + +function createHeatmap(scene, fullTrace, calcTrace) { + var plot = new Heatmap(scene, fullTrace.uid); + plot.update(fullTrace, calcTrace); + return plot; +} + +module.exports = createHeatmap; + +},{"../../lib/str2rgbarray":685,"../../plots/cartesian/axes":711,"gl-heatmap2d":182}],959:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); + +var handleXYZDefaults = _dereq_('../heatmap/xyz_defaults'); +var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); +var attributes = _dereq_('./attributes'); + + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + var validData = handleXYZDefaults(traceIn, traceOut, coerce, layout); + if(!validData) { + traceOut.visible = false; + return; + } + + coerce('text'); + coerce('zsmooth'); + + colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); +}; + +},{"../../components/colorscale/defaults":534,"../../lib":661,"../heatmap/xyz_defaults":956,"./attributes":957}],960:[function(_dereq_,module,exports){ +'use strict'; + +var deprecationWarning = [ + '*heatmapgl* trace is deprecated!', + 'Please consider switching to the *heatmap* or *image* trace types.', + 'Alternatively you could contribute/sponsor rewriting this trace type', + 'based on cartesian features and using regl framework.' +].join(' '); + +module.exports = { + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults'), + colorbar: _dereq_('../heatmap/colorbar'), + + calc: _dereq_('../heatmap/calc'), + plot: _dereq_('./convert'), + + moduleType: 'trace', + name: 'heatmapgl', + basePlotModule: _dereq_('../../plots/gl2d'), + categories: ['gl', 'gl2d', '2dMap'], + meta: { + } +}; + +},{"../../plots/gl2d":751,"../heatmap/calc":943,"../heatmap/colorbar":945,"./attributes":957,"./convert":958,"./defaults":959}],961:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -171598,7 +215450,7 @@ module.exports = { } }; -},{"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../bar/attributes":462,"./bin_attributes":618,"./constants":622}],617:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../bar/attributes":798,"./bin_attributes":963,"./constants":967}],962:[function(_dereq_,module,exports){ 'use strict'; @@ -171614,7 +215466,7 @@ module.exports = function doAvg(size, counts) { return total; }; -},{}],618:[function(_dereq_,module,exports){ +},{}],963:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makeBinAttrs(axLetter, match) { @@ -171635,7 +215487,7 @@ module.exports = function makeBinAttrs(axLetter, match) { }; }; -},{}],619:[function(_dereq_,module,exports){ +},{}],964:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -171700,7 +215552,7 @@ module.exports = { } }; -},{"fast-isnumeric":81}],620:[function(_dereq_,module,exports){ +},{"fast-isnumeric":159}],965:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -171867,7 +215719,7 @@ function dateParts(v, pa, calendar) { return parts; } -},{"../../constants/numerical":319,"../../plots/cartesian/axes":390}],621:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../plots/cartesian/axes":711}],966:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -172438,14 +216290,14 @@ module.exports = { calcAllAutoBins: calcAllAutoBins }; -},{"../../lib":342,"../../plots/cartesian/axes":390,"../../registry":452,"../bar/arrays_to_calcdata":461,"./average":617,"./bin_functions":619,"./bin_label_vals":620,"./norm_functions":628,"fast-isnumeric":81}],622:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../../registry":788,"../bar/arrays_to_calcdata":797,"./average":962,"./bin_functions":964,"./bin_label_vals":965,"./norm_functions":973,"fast-isnumeric":159}],967:[function(_dereq_,module,exports){ 'use strict'; module.exports = { eventDataKeys: ['binNumber'] }; -},{}],623:[function(_dereq_,module,exports){ +},{}],968:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -172714,7 +216566,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":342,"../../plots/cartesian/axis_ids":394,"../../plots/cartesian/constraints":398,"../../registry":452,"../bar/defaults":466}],624:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axis_ids":715,"../../plots/cartesian/constraints":719,"../../registry":788,"../bar/defaults":802}],969:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -172782,7 +216634,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":208,"../../lib":342,"../../registry":452,"../bar/style_defaults":477,"./attributes":616}],625:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../registry":788,"../bar/style_defaults":813,"./attributes":961}],970:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -172823,7 +216675,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],626:[function(_dereq_,module,exports){ +},{}],971:[function(_dereq_,module,exports){ 'use strict'; var barHover = _dereq_('../bar/hover').hoverPoints; @@ -172847,7 +216699,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return pts; }; -},{"../../plots/cartesian/axes":390,"../bar/hover":469}],627:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711,"../bar/hover":805}],972:[function(_dereq_,module,exports){ 'use strict'; /** @@ -172888,7 +216740,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../bar/cross_trace_calc":465,"../bar/layout_attributes":471,"../bar/layout_defaults":472,"../bar/plot":473,"../bar/select":474,"../bar/style":476,"../scatter/marker_colorbar":723,"./attributes":616,"./calc":621,"./cross_trace_defaults":623,"./defaults":624,"./event_data":625,"./hover":626}],628:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../bar/cross_trace_calc":801,"../bar/layout_attributes":807,"../bar/layout_defaults":808,"../bar/plot":809,"../bar/select":810,"../bar/style":812,"../scatter/marker_colorbar":1082,"./attributes":961,"./calc":966,"./cross_trace_defaults":968,"./defaults":969,"./event_data":970,"./hover":971}],973:[function(_dereq_,module,exports){ 'use strict'; @@ -172914,7 +216766,7 @@ module.exports = { } }; -},{}],629:[function(_dereq_,module,exports){ +},{}],974:[function(_dereq_,module,exports){ 'use strict'; var histogramAttrs = _dereq_('../histogram/attributes'); @@ -172972,7 +216824,7 @@ module.exports = extendFlat( colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../heatmap/attributes":601,"../histogram/attributes":616,"../histogram/bin_attributes":618}],630:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../heatmap/attributes":942,"../histogram/attributes":961,"../histogram/bin_attributes":963}],975:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -173183,7 +217035,7 @@ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) { return out; } -},{"../../lib":342,"../../plots/cartesian/axes":390,"../histogram/average":617,"../histogram/bin_functions":619,"../histogram/bin_label_vals":620,"../histogram/calc":621,"../histogram/norm_functions":628}],631:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../histogram/average":962,"../histogram/bin_functions":964,"../histogram/bin_label_vals":965,"../histogram/calc":966,"../histogram/norm_functions":973}],976:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -173209,7 +217061,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('yhoverformat'); }; -},{"../../components/colorscale/defaults":218,"../../lib":342,"../heatmap/style_defaults":614,"./attributes":629,"./sample_defaults":634}],632:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../lib":661,"../heatmap/style_defaults":955,"./attributes":974,"./sample_defaults":979}],977:[function(_dereq_,module,exports){ 'use strict'; var heatmapHover = _dereq_('../heatmap/hover'); @@ -173235,7 +217087,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return pts; }; -},{"../../plots/cartesian/axes":390,"../heatmap/hover":608}],633:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711,"../heatmap/hover":949}],978:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -173258,7 +217110,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../heatmap/calc":602,"../heatmap/colorbar":604,"../heatmap/plot":612,"../heatmap/style":613,"../histogram/cross_trace_defaults":623,"../histogram/event_data":625,"./attributes":629,"./defaults":631,"./hover":632}],634:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../heatmap/calc":943,"../heatmap/colorbar":945,"../heatmap/plot":953,"../heatmap/style":954,"../histogram/cross_trace_defaults":968,"../histogram/event_data":970,"./attributes":974,"./defaults":976,"./hover":977}],979:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -173295,7 +217147,7 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout coerce('autobiny'); }; -},{"../../lib":342,"../../registry":452}],635:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788}],980:[function(_dereq_,module,exports){ 'use strict'; var histogram2dAttrs = _dereq_('../histogram2d/attributes'); @@ -173347,7 +217199,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../contour/attributes":544,"../histogram2d/attributes":629}],636:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../contour/attributes":885,"../histogram2d/attributes":974}],981:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -173377,7 +217229,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('yhoverformat'); }; -},{"../../lib":342,"../contour/contours_defaults":551,"../contour/style_defaults":565,"../histogram2d/sample_defaults":634,"./attributes":635}],637:[function(_dereq_,module,exports){ +},{"../../lib":661,"../contour/contours_defaults":892,"../contour/style_defaults":906,"../histogram2d/sample_defaults":979,"./attributes":980}],982:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -173399,7 +217251,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../contour/calc":545,"../contour/colorbar":547,"../contour/hover":557,"../contour/plot":562,"../contour/style":564,"../histogram/cross_trace_defaults":623,"./attributes":635,"./defaults":636}],638:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../contour/calc":886,"../contour/colorbar":888,"../contour/hover":898,"../contour/plot":903,"../contour/style":905,"../histogram/cross_trace_defaults":968,"./attributes":980,"./defaults":981}],983:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -173486,7 +217338,7 @@ module.exports = { domain: domainAttrs({name: 'icicle', trace: true, editType: 'calc'}), }; -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683,"../sunburst/attributes":775,"../treemap/attributes":796,"../treemap/constants":799}],639:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/domain":739,"../../plots/template_attributes":783,"../pie/attributes":1038,"../sunburst/attributes":1145,"../treemap/attributes":1171,"../treemap/constants":1174}],984:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -173501,7 +217353,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":438}],640:[function(_dereq_,module,exports){ +},{"../../plots/plots":774}],985:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('../sunburst/calc'); @@ -173514,7 +217366,7 @@ exports.crossTraceCalc = function(gd) { return calc._runCrossTraceCalc('icicle', gd); }; -},{"../sunburst/calc":777}],641:[function(_dereq_,module,exports){ +},{"../sunburst/calc":1147}],986:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -173617,7 +217469,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/color":208,"../../components/colorscale":220,"../../lib":342,"../../plots/domain":418,"../bar/constants":464,"../bar/defaults":466,"./attributes":638}],642:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/colorscale":536,"../../lib":661,"../../plots/domain":739,"../bar/constants":800,"../bar/defaults":802,"./attributes":983}],987:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -173825,7 +217677,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) { return nextOfPrevEntry; }; -},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../sunburst/fx":780,"../sunburst/helpers":781,"../sunburst/plot":785,"../treemap/constants":799,"./partition":646,"./style":648,"@plotly/d3":44}],643:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../sunburst/fx":1150,"../sunburst/helpers":1151,"../sunburst/plot":1155,"../treemap/constants":1174,"./partition":991,"./style":993,"@plotly/d3":54}],988:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -173852,7 +217704,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":723,"./attributes":638,"./base_plot":639,"./calc":640,"./defaults":641,"./layout_attributes":644,"./layout_defaults":645,"./plot":647,"./style":648}],644:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1082,"./attributes":983,"./base_plot":984,"./calc":985,"./defaults":986,"./layout_attributes":989,"./layout_defaults":990,"./plot":992,"./style":993}],989:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -173867,7 +217719,7 @@ module.exports = { } }; -},{}],645:[function(_dereq_,module,exports){ +},{}],990:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -173881,7 +217733,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendiciclecolors'); }; -},{"../../lib":342,"./layout_attributes":644}],646:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":989}],991:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -173917,7 +217769,7 @@ module.exports = function partition(entry, size, opts) { return result; }; -},{"../treemap/flip_tree":804,"d3-hierarchy":71}],647:[function(_dereq_,module,exports){ +},{"../treemap/flip_tree":1179,"d3-hierarchy":142}],992:[function(_dereq_,module,exports){ 'use strict'; var draw = _dereq_('../treemap/draw'); @@ -173930,7 +217782,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall }); }; -},{"../treemap/draw":801,"./draw_descendants":642}],648:[function(_dereq_,module,exports){ +},{"../treemap/draw":1176,"./draw_descendants":987}],993:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -173973,7 +217825,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":208,"../../lib":342,"../bar/uniform_text":478,"@plotly/d3":44}],649:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../bar/uniform_text":814,"@plotly/d3":54}],994:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -174069,7 +217921,7 @@ module.exports = extendFlat({ transforms: undefined }); -},{"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"./constants":651}],650:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"./constants":996}],995:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -174159,7 +218011,7 @@ function makeScaler(trace) { }; } -},{"../../lib":342,"../../plots/cartesian/axes":390,"./constants":651,"./helpers":654,"fast-isnumeric":81}],651:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"./constants":996,"./helpers":999,"fast-isnumeric":159}],996:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -174225,7 +218077,7 @@ module.exports = { ].join('; ') }; -},{}],652:[function(_dereq_,module,exports){ +},{}],997:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -174275,7 +218127,7 @@ module.exports = function supplyDefaults(traceIn, traceOut) { traceOut._length = null; }; -},{"../../lib":342,"../../snapshot/helpers":456,"./attributes":649,"./constants":651}],653:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../snapshot/helpers":792,"./attributes":994,"./constants":996}],998:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -174289,7 +218141,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],654:[function(_dereq_,module,exports){ +},{}],999:[function(_dereq_,module,exports){ 'use strict'; var probeSync = _dereq_('probe-image-size/sync'); @@ -174302,7 +218154,7 @@ exports.getImageSize = function(src) { return probeSync(buff); }; -},{"../../snapshot/helpers":456,"buffer/":61,"probe-image-size/sync":146}],655:[function(_dereq_,module,exports){ +},{"../../snapshot/helpers":792,"buffer/":105,"probe-image-size/sync":412}],1000:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -174394,7 +218246,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { })]; }; -},{"../../components/fx":248,"../../lib":342,"./constants":651}],656:[function(_dereq_,module,exports){ +},{"../../components/fx":564,"../../lib":661,"./constants":996}],1001:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -174415,7 +218267,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"./attributes":649,"./calc":650,"./defaults":652,"./event_data":653,"./hover":655,"./plot":657,"./style":658}],657:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./attributes":994,"./calc":995,"./defaults":997,"./event_data":998,"./hover":1000,"./plot":1002,"./style":1003}],1002:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -174638,7 +218490,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) { }); }; -},{"../../constants/xmlns_namespaces":320,"../../lib":342,"./constants":651,"@plotly/d3":44}],658:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":638,"../../lib":661,"./constants":996,"@plotly/d3":54}],1003:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -174650,7 +218502,7 @@ module.exports = function style(gd) { }); }; -},{"@plotly/d3":44}],659:[function(_dereq_,module,exports){ +},{"@plotly/d3":54}],1004:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -174903,7 +218755,7 @@ module.exports = { } }; -},{"../../components/color/attributes":207,"../../constants/delta.js":315,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../plots/cartesian/axis_format_attributes":393,"../../plots/cartesian/layout_attributes":405,"../../plots/domain":418,"../../plots/font_attributes":419}],660:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../constants/delta.js":631,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../plots/cartesian/axis_format_attributes":714,"../../plots/cartesian/layout_attributes":726,"../../plots/domain":739,"../../plots/font_attributes":740}],1005:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -174918,7 +218770,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":438}],661:[function(_dereq_,module,exports){ +},{"../../plots/plots":774}],1006:[function(_dereq_,module,exports){ 'use strict'; // var Lib = require('../../lib'); @@ -174947,7 +218799,7 @@ module.exports = { calc: calc }; -},{}],662:[function(_dereq_,module,exports){ +},{}],1007:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -174961,7 +218813,7 @@ module.exports = { horizontalPadding: 10 }; -},{}],663:[function(_dereq_,module,exports){ +},{}],1008:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -175120,7 +218972,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":342,"../../plot_api/plot_template":379,"../../plots/array_container_defaults":385,"../../plots/cartesian/tick_label_defaults":412,"../../plots/cartesian/tick_mark_defaults":413,"../../plots/cartesian/tick_value_defaults":414,"../../plots/domain":418,"./attributes":659,"./constants.js":662}],664:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plot_api/plot_template":700,"../../plots/array_container_defaults":706,"../../plots/cartesian/tick_label_defaults":733,"../../plots/cartesian/tick_mark_defaults":734,"../../plots/cartesian/tick_value_defaults":735,"../../plots/domain":739,"./attributes":1004,"./constants.js":1007}],1009:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -175141,7 +218993,7 @@ module.exports = { } }; -},{"./attributes":659,"./base_plot":660,"./calc":661,"./defaults":663,"./plot":665}],665:[function(_dereq_,module,exports){ +},{"./attributes":1004,"./base_plot":1005,"./calc":1006,"./defaults":1008,"./plot":1010}],1010:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -176015,7 +219867,1864 @@ function cache(trace, name, initialValue, value, key, fn) { return v; } -},{"../../components/color":208,"../../components/drawing":230,"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../plots/cartesian/axis_defaults":392,"../../plots/cartesian/layout_attributes":405,"../../plots/cartesian/position_defaults":408,"./constants":662,"@plotly/d3":44,"d3-interpolate":72}],666:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../plots/cartesian/axis_defaults":713,"../../plots/cartesian/layout_attributes":726,"../../plots/cartesian/position_defaults":729,"./constants":1007,"@plotly/d3":54,"d3-interpolate":143}],1011:[function(_dereq_,module,exports){ +'use strict'; + +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); +var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; +var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; +var meshAttrs = _dereq_('../mesh3d/attributes'); +var baseAttrs = _dereq_('../../plots/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; + +function makeSliceAttr(axLetter) { + return { + show: { + valType: 'boolean', + dflt: false, + }, + locations: { + valType: 'data_array', + dflt: [], + }, + fill: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + } + }; +} + +function makeCapAttr(axLetter) { + return { + show: { + valType: 'boolean', + dflt: true, + }, + fill: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + } + }; +} + +var attrs = module.exports = overrideAll(extendFlat({ + x: { + valType: 'data_array', + }, + y: { + valType: 'data_array', + }, + z: { + valType: 'data_array', + }, + value: { + valType: 'data_array', + }, + isomin: { + valType: 'number', + }, + isomax: { + valType: 'number', + }, + + surface: { + show: { + valType: 'boolean', + dflt: true, + }, + count: { + valType: 'integer', + dflt: 2, + min: 1, + }, + fill: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + }, + pattern: { + valType: 'flaglist', + flags: ['A', 'B', 'C', 'D', 'E'], + extras: ['all', 'odd', 'even'], + dflt: 'all', + } + }, + + spaceframe: { + show: { + valType: 'boolean', + dflt: false, + }, + fill: { + valType: 'number', + min: 0, + max: 1, + dflt: 0.15, + } + }, + + slices: { + x: makeSliceAttr('x'), + y: makeSliceAttr('y'), + z: makeSliceAttr('z') + }, + + caps: { + x: makeCapAttr('x'), + y: makeCapAttr('y'), + z: makeCapAttr('z') + }, + + text: { + valType: 'string', + dflt: '', + arrayOk: true, + }, + hovertext: { + valType: 'string', + dflt: '', + arrayOk: true, + }, + hovertemplate: hovertemplateAttrs(), + xhoverformat: axisHoverFormat('x'), + yhoverformat: axisHoverFormat('y'), + zhoverformat: axisHoverFormat('z'), + valuehoverformat: axisHoverFormat('value', 1), + + showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) +}, + +colorScaleAttrs('', { + colorAttr: '`value`', + showScaleDflt: true, + editTypeOverride: 'calc' +}), { + opacity: meshAttrs.opacity, + lightposition: meshAttrs.lightposition, + lighting: meshAttrs.lighting, + flatshading: meshAttrs.flatshading, + contour: meshAttrs.contour, + + hoverinfo: extendFlat({}, baseAttrs.hoverinfo) +}), 'calc', 'nested'); + +// required defaults to speed up surface normal calculations +attrs.flatshading.dflt = true; attrs.lighting.facenormalsepsilon.dflt = 0; + +attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; +attrs.transforms = undefined; + +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../mesh3d/attributes":1016}],1012:[function(_dereq_,module,exports){ +'use strict'; + +var colorscaleCalc = _dereq_('../../components/colorscale/calc'); +var processGrid = _dereq_('../streamtube/calc').processGrid; +var filter = _dereq_('../streamtube/calc').filter; + +module.exports = function calc(gd, trace) { + trace._len = Math.min( + trace.x.length, + trace.y.length, + trace.z.length, + trace.value.length + ); + + trace._x = filter(trace.x, trace._len); + trace._y = filter(trace.y, trace._len); + trace._z = filter(trace.z, trace._len); + trace._value = filter(trace.value, trace._len); + + var grid = processGrid(trace); + trace._gridFill = grid.fill; + trace._Xs = grid.Xs; + trace._Ys = grid.Ys; + trace._Zs = grid.Zs; + trace._len = grid.len; + + var min = Infinity; + var max = -Infinity; + for(var i = 0; i < trace._len; i++) { + var v = trace._value[i]; + min = Math.min(min, v); + max = Math.max(max, v); + } + + trace._minValues = min; + trace._maxValues = max; + trace._vMin = (trace.isomin === undefined || trace.isomin === null) ? min : trace.isomin; + trace._vMax = (trace.isomax === undefined || trace.isomin === null) ? max : trace.isomax; + + colorscaleCalc(gd, trace, { + vals: [trace._vMin, trace._vMax], + containerStr: '', + cLetter: 'c' + }); +}; + +},{"../../components/colorscale/calc":532,"../streamtube/calc":1141}],1013:[function(_dereq_,module,exports){ +'use strict'; + +var createMesh = _dereq_('gl-mesh3d'); +var parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale; +var str2RgbaArray = _dereq_('../../lib/str2rgbarray'); +var extractOpts = _dereq_('../../components/colorscale').extractOpts; +var zip3 = _dereq_('../../plots/gl3d/zip3'); + +var findNearestOnAxis = function(w, arr) { + for(var q = arr.length - 1; q > 0; q--) { + var min = Math.min(arr[q], arr[q - 1]); + var max = Math.max(arr[q], arr[q - 1]); + if(max > min && min < w && w <= max) { + return { + id: q, + distRatio: (max - w) / (max - min) + }; + } + } + return { + id: 0, + distRatio: 0 + }; +}; + +function IsosurfaceTrace(scene, mesh, uid) { + this.scene = scene; + this.uid = uid; + this.mesh = mesh; + this.name = ''; + this.data = null; + this.showContour = false; +} + +var proto = IsosurfaceTrace.prototype; + +proto.handlePick = function(selection) { + if(selection.object === this.mesh) { + var rawId = selection.data.index; + + var x = this.data._meshX[rawId]; + var y = this.data._meshY[rawId]; + var z = this.data._meshZ[rawId]; + + var height = this.data._Ys.length; + var depth = this.data._Zs.length; + + var i = findNearestOnAxis(x, this.data._Xs).id; + var j = findNearestOnAxis(y, this.data._Ys).id; + var k = findNearestOnAxis(z, this.data._Zs).id; + + var selectIndex = selection.index = k + depth * j + depth * height * i; + + selection.traceCoordinate = [ + this.data._meshX[selectIndex], + this.data._meshY[selectIndex], + this.data._meshZ[selectIndex], + this.data._value[selectIndex] + ]; + + var text = this.data.hovertext || this.data.text; + if(Array.isArray(text) && text[selectIndex] !== undefined) { + selection.textLabel = text[selectIndex]; + } else if(text) { + selection.textLabel = text; + } + + return true; + } +}; + +proto.update = function(data) { + var scene = this.scene; + var layout = scene.fullSceneLayout; + + this.data = generateIsoMeshes(data); + + // Unpack position data + function toDataCoords(axis, coord, scale, calendar) { + return coord.map(function(x) { + return axis.d2l(x, 0, calendar) * scale; + }); + } + + var positions = zip3( + toDataCoords(layout.xaxis, data._meshX, scene.dataScale[0], data.xcalendar), + toDataCoords(layout.yaxis, data._meshY, scene.dataScale[1], data.ycalendar), + toDataCoords(layout.zaxis, data._meshZ, scene.dataScale[2], data.zcalendar)); + + var cells = zip3(data._meshI, data._meshJ, data._meshK); + + var config = { + positions: positions, + cells: cells, + lightPosition: [data.lightposition.x, data.lightposition.y, data.lightposition.z], + ambient: data.lighting.ambient, + diffuse: data.lighting.diffuse, + specular: data.lighting.specular, + roughness: data.lighting.roughness, + fresnel: data.lighting.fresnel, + vertexNormalsEpsilon: data.lighting.vertexnormalsepsilon, + faceNormalsEpsilon: data.lighting.facenormalsepsilon, + opacity: data.opacity, + contourEnable: data.contour.show, + contourColor: str2RgbaArray(data.contour.color).slice(0, 3), + contourWidth: data.contour.width, + useFacetNormals: data.flatshading + }; + + var cOpts = extractOpts(data); + config.vertexIntensity = data._meshIntensity; + config.vertexIntensityBounds = [cOpts.min, cOpts.max]; + config.colormap = parseColorScale(data); + + // Update mesh + this.mesh.update(config); +}; + +proto.dispose = function() { + this.scene.glplot.remove(this.mesh); + this.mesh.dispose(); +}; + +var GRID_TYPES = ['xyz', 'xzy', 'yxz', 'yzx', 'zxy', 'zyx']; + +function generateIsoMeshes(data) { + data._meshI = []; + data._meshJ = []; + data._meshK = []; + + var showSurface = data.surface.show; + var showSpaceframe = data.spaceframe.show; + + var surfaceFill = data.surface.fill; + var spaceframeFill = data.spaceframe.fill; + + var drawingSurface = false; + var drawingSpaceframe = false; + + var numFaces = 0; + var numVertices; + var beginVertextLength; + + var Xs = data._Xs; + var Ys = data._Ys; + var Zs = data._Zs; + + var width = Xs.length; + var height = Ys.length; + var depth = Zs.length; + + var filled = GRID_TYPES.indexOf(data._gridFill.replace(/-/g, '').replace(/\+/g, '')); + + var getIndex = function(i, j, k) { + switch(filled) { + case 5: // 'zyx' + return k + depth * j + depth * height * i; + case 4: // 'zxy' + return k + depth * i + depth * width * j; + case 3: // 'yzx' + return j + height * k + height * depth * i; + case 2: // 'yxz' + return j + height * i + height * width * k; + case 1: // 'xzy' + return i + width * k + width * depth * j; + default: // case 0: // 'xyz' + return i + width * j + width * height * k; + } + }; + + var minValues = data._minValues; + var maxValues = data._maxValues; + + var vMin = data._vMin; + var vMax = data._vMax; + + var allXs; + var allYs; + var allZs; + var allVs; + + function findVertexId(x, y, z) { + // could be used to find the vertex id of previously generated vertex within the group + + var len = allVs.length; + for(var f = beginVertextLength; f < len; f++) { + if( + x === allXs[f] && + y === allYs[f] && + z === allZs[f] + ) { + return f; + } + } + return -1; + } + + function beginGroup() { + beginVertextLength = numVertices; + } + + function emptyVertices() { + allXs = []; + allYs = []; + allZs = []; + allVs = []; + numVertices = 0; + + beginGroup(); + } + + function addVertex(x, y, z, v) { + allXs.push(x); + allYs.push(y); + allZs.push(z); + allVs.push(v); + numVertices++; + + return numVertices - 1; + } + + function addFace(a, b, c) { + data._meshI.push(a); + data._meshJ.push(b); + data._meshK.push(c); + numFaces++; + + return numFaces - 1; + } + + function getCenter(A, B, C) { + var M = []; + for(var i = 0; i < A.length; i++) { + M[i] = (A[i] + B[i] + C[i]) / 3.0; + } + return M; + } + + function getBetween(A, B, r) { + var M = []; + for(var i = 0; i < A.length; i++) { + M[i] = A[i] * (1 - r) + r * B[i]; + } + return M; + } + + var activeFill; + function setFill(fill) { + activeFill = fill; + } + + function createOpenTri(xyzv, abc) { + var A = xyzv[0]; + var B = xyzv[1]; + var C = xyzv[2]; + var G = getCenter(A, B, C); + + var r = Math.sqrt(1 - activeFill); + var p1 = getBetween(G, A, r); + var p2 = getBetween(G, B, r); + var p3 = getBetween(G, C, r); + + var a = abc[0]; + var b = abc[1]; + var c = abc[2]; + + return { + xyzv: [ + [A, B, p2], [p2, p1, A], + [B, C, p3], [p3, p2, B], + [C, A, p1], [p1, p3, C] + ], + abc: [ + [a, b, -1], [-1, -1, a], + [b, c, -1], [-1, -1, b], + [c, a, -1], [-1, -1, c] + ] + }; + } + + function styleIncludes(style, char) { + if(style === 'all' || style === null) return true; + return (style.indexOf(char) > -1); + } + + function mapValue(style, value) { + if(style === null) return value; + return style; + } + + function drawTri(style, xyzv, abc) { + beginGroup(); + + var allXYZVs = [xyzv]; + var allABCs = [abc]; + if(activeFill >= 1) { + allXYZVs = [xyzv]; + allABCs = [abc]; + } else if(activeFill > 0) { + var openTri = createOpenTri(xyzv, abc); + allXYZVs = openTri.xyzv; + allABCs = openTri.abc; + } + + for(var f = 0; f < allXYZVs.length; f++) { + xyzv = allXYZVs[f]; + abc = allABCs[f]; + + var pnts = []; + for(var i = 0; i < 3; i++) { + var x = xyzv[i][0]; + var y = xyzv[i][1]; + var z = xyzv[i][2]; + var v = xyzv[i][3]; + + var id = (abc[i] > -1) ? abc[i] : findVertexId(x, y, z); + if(id > -1) { + pnts[i] = id; + } else { + pnts[i] = addVertex(x, y, z, mapValue(style, v)); + } + } + + addFace(pnts[0], pnts[1], pnts[2]); + } + } + + function drawQuad(style, xyzv, abcd) { + var makeTri = function(i, j, k) { + drawTri(style, [xyzv[i], xyzv[j], xyzv[k]], [abcd[i], abcd[j], abcd[k]]); + }; + + makeTri(0, 1, 2); + makeTri(2, 3, 0); + } + + function drawTetra(style, xyzv, abcd) { + var makeTri = function(i, j, k) { + drawTri(style, [xyzv[i], xyzv[j], xyzv[k]], [abcd[i], abcd[j], abcd[k]]); + }; + + makeTri(0, 1, 2); + makeTri(3, 0, 1); + makeTri(2, 3, 0); + makeTri(1, 2, 3); + } + + function calcIntersection(pointOut, pointIn, min, max) { + var value = pointOut[3]; + + if(value < min) value = min; + if(value > max) value = max; + + var ratio = (pointOut[3] - value) / (pointOut[3] - pointIn[3] + 0.000000001); // we had to add this error to force solve the tiny caps + + var result = []; + for(var s = 0; s < 4; s++) { + result[s] = (1 - ratio) * pointOut[s] + ratio * pointIn[s]; + } + return result; + } + + function inRange(value, min, max) { + return ( + value >= min && + value <= max + ); + } + + function almostInFinalRange(value) { + var vErr = 0.001 * (vMax - vMin); + return ( + value >= vMin - vErr && + value <= vMax + vErr + ); + } + + function getXYZV(indecies) { + var xyzv = []; + for(var q = 0; q < 4; q++) { + var index = indecies[q]; + xyzv.push( + [ + data._x[index], + data._y[index], + data._z[index], + data._value[index] + ] + ); + } + + return xyzv; + } + + var MAX_PASS = 3; + + function tryCreateTri(style, xyzv, abc, min, max, nPass) { + if(!nPass) nPass = 1; + + abc = [-1, -1, -1]; // Note: for the moment we override indices + // to run faster! But it is possible to comment this line + // to reduce the number of vertices. + + var result = false; + + var ok = [ + inRange(xyzv[0][3], min, max), + inRange(xyzv[1][3], min, max), + inRange(xyzv[2][3], min, max) + ]; + + if(!ok[0] && !ok[1] && !ok[2]) { + return false; + } + + var tryDrawTri = function(style, xyzv, abc) { + if( // we check here if the points are in `real` iso-min/max range + almostInFinalRange(xyzv[0][3]) && + almostInFinalRange(xyzv[1][3]) && + almostInFinalRange(xyzv[2][3]) + ) { + drawTri(style, xyzv, abc); + return true; + } else if(nPass < MAX_PASS) { + return tryCreateTri(style, xyzv, abc, vMin, vMax, ++nPass); // i.e. second pass using actual vMin vMax bounds + } + return false; + }; + + if(ok[0] && ok[1] && ok[2]) { + return tryDrawTri(style, xyzv, abc) || result; + } + + var interpolated = false; + + [ + [0, 1, 2], + [2, 0, 1], + [1, 2, 0] + ].forEach(function(e) { + if(ok[e[0]] && ok[e[1]] && !ok[e[2]]) { + var A = xyzv[e[0]]; + var B = xyzv[e[1]]; + var C = xyzv[e[2]]; + + var p1 = calcIntersection(C, A, min, max); + var p2 = calcIntersection(C, B, min, max); + + result = tryDrawTri(style, [p2, p1, A], [-1, -1, abc[e[0]]]) || result; + result = tryDrawTri(style, [A, B, p2], [abc[e[0]], abc[e[1]], -1]) || result; + + interpolated = true; + } + }); + if(interpolated) return result; + + [ + [0, 1, 2], + [1, 2, 0], + [2, 0, 1] + ].forEach(function(e) { + if(ok[e[0]] && !ok[e[1]] && !ok[e[2]]) { + var A = xyzv[e[0]]; + var B = xyzv[e[1]]; + var C = xyzv[e[2]]; + + var p1 = calcIntersection(B, A, min, max); + var p2 = calcIntersection(C, A, min, max); + + result = tryDrawTri(style, [p2, p1, A], [-1, -1, abc[e[0]]]) || result; + + interpolated = true; + } + }); + return result; + } + + function tryCreateTetra(style, abcd, min, max) { + var result = false; + + var xyzv = getXYZV(abcd); + + var ok = [ + inRange(xyzv[0][3], min, max), + inRange(xyzv[1][3], min, max), + inRange(xyzv[2][3], min, max), + inRange(xyzv[3][3], min, max) + ]; + + if(!ok[0] && !ok[1] && !ok[2] && !ok[3]) { + return result; + } + + if(ok[0] && ok[1] && ok[2] && ok[3]) { + if(drawingSpaceframe) { + result = drawTetra(style, xyzv, abcd) || result; + } + return result; + } + + var interpolated = false; + + [ + [0, 1, 2, 3], + [3, 0, 1, 2], + [2, 3, 0, 1], + [1, 2, 3, 0] + ].forEach(function(e) { + if(ok[e[0]] && ok[e[1]] && ok[e[2]] && !ok[e[3]]) { + var A = xyzv[e[0]]; + var B = xyzv[e[1]]; + var C = xyzv[e[2]]; + var D = xyzv[e[3]]; + + if(drawingSpaceframe) { + result = drawTri(style, [A, B, C], [abcd[e[0]], abcd[e[1]], abcd[e[2]]]) || result; + } else { + var p1 = calcIntersection(D, A, min, max); + var p2 = calcIntersection(D, B, min, max); + var p3 = calcIntersection(D, C, min, max); + + result = drawTri(null, [p1, p2, p3], [-1, -1, -1]) || result; + } + + interpolated = true; + } + }); + if(interpolated) return result; + + [ + [0, 1, 2, 3], + [1, 2, 3, 0], + [2, 3, 0, 1], + [3, 0, 1, 2], + [0, 2, 3, 1], + [1, 3, 2, 0] + ].forEach(function(e) { + if(ok[e[0]] && ok[e[1]] && !ok[e[2]] && !ok[e[3]]) { + var A = xyzv[e[0]]; + var B = xyzv[e[1]]; + var C = xyzv[e[2]]; + var D = xyzv[e[3]]; + + var p1 = calcIntersection(C, A, min, max); + var p2 = calcIntersection(C, B, min, max); + var p3 = calcIntersection(D, B, min, max); + var p4 = calcIntersection(D, A, min, max); + + if(drawingSpaceframe) { + result = drawTri(style, [A, p4, p1], [abcd[e[0]], -1, -1]) || result; + result = drawTri(style, [B, p2, p3], [abcd[e[1]], -1, -1]) || result; + } else { + result = drawQuad(null, [p1, p2, p3, p4], [-1, -1, -1, -1]) || result; + } + + interpolated = true; + } + }); + if(interpolated) return result; + + [ + [0, 1, 2, 3], + [1, 2, 3, 0], + [2, 3, 0, 1], + [3, 0, 1, 2] + ].forEach(function(e) { + if(ok[e[0]] && !ok[e[1]] && !ok[e[2]] && !ok[e[3]]) { + var A = xyzv[e[0]]; + var B = xyzv[e[1]]; + var C = xyzv[e[2]]; + var D = xyzv[e[3]]; + + var p1 = calcIntersection(B, A, min, max); + var p2 = calcIntersection(C, A, min, max); + var p3 = calcIntersection(D, A, min, max); + + if(drawingSpaceframe) { + result = drawTri(style, [A, p1, p2], [abcd[e[0]], -1, -1]) || result; + result = drawTri(style, [A, p2, p3], [abcd[e[0]], -1, -1]) || result; + result = drawTri(style, [A, p3, p1], [abcd[e[0]], -1, -1]) || result; + } else { + result = drawTri(null, [p1, p2, p3], [-1, -1, -1]) || result; + } + + interpolated = true; + } + }); + return result; + } + + function addCube(style, p000, p001, p010, p011, p100, p101, p110, p111, min, max) { + var result = false; + + if(drawingSurface) { + if(styleIncludes(style, 'A')) { + result = tryCreateTetra(null, [p000, p001, p010, p100], min, max) || result; + } + if(styleIncludes(style, 'B')) { + result = tryCreateTetra(null, [p001, p010, p011, p111], min, max) || result; + } + if(styleIncludes(style, 'C')) { + result = tryCreateTetra(null, [p001, p100, p101, p111], min, max) || result; + } + if(styleIncludes(style, 'D')) { + result = tryCreateTetra(null, [p010, p100, p110, p111], min, max) || result; + } + if(styleIncludes(style, 'E')) { + result = tryCreateTetra(null, [p001, p010, p100, p111], min, max) || result; + } + } + + if(drawingSpaceframe) { + result = tryCreateTetra(style, [p001, p010, p100, p111], min, max) || result; + } + + return result; + } + + function addRect(style, a, b, c, d, min, max, previousResult) { + return [ + (previousResult[0] === true) ? true : + tryCreateTri(style, getXYZV([a, b, c]), [a, b, c], min, max), + (previousResult[1] === true) ? true : + tryCreateTri(style, getXYZV([c, d, a]), [c, d, a], min, max) + ]; + } + + function begin2dCell(style, p00, p01, p10, p11, min, max, isEven, previousResult) { + // used to create caps and/or slices on exact axis points + if(isEven) { + return addRect(style, p00, p01, p11, p10, min, max, previousResult); + } else { + return addRect(style, p01, p11, p10, p00, min, max, previousResult); + } + } + + function beginSection(style, i, j, k, min, max, distRatios) { + // used to create slices between axis points + + var result = false; + var A, B, C, D; + + var makeSection = function() { + result = tryCreateTri(style, [A, B, C], [-1, -1, -1], min, max) || result; + result = tryCreateTri(style, [C, D, A], [-1, -1, -1], min, max) || result; + }; + + var rX = distRatios[0]; + var rY = distRatios[1]; + var rZ = distRatios[2]; + + if(rX) { + A = getBetween(getXYZV([getIndex(i, j - 0, k - 0)])[0], getXYZV([getIndex(i - 1, j - 0, k - 0)])[0], rX); + B = getBetween(getXYZV([getIndex(i, j - 0, k - 1)])[0], getXYZV([getIndex(i - 1, j - 0, k - 1)])[0], rX); + C = getBetween(getXYZV([getIndex(i, j - 1, k - 1)])[0], getXYZV([getIndex(i - 1, j - 1, k - 1)])[0], rX); + D = getBetween(getXYZV([getIndex(i, j - 1, k - 0)])[0], getXYZV([getIndex(i - 1, j - 1, k - 0)])[0], rX); + makeSection(); + } + + if(rY) { + A = getBetween(getXYZV([getIndex(i - 0, j, k - 0)])[0], getXYZV([getIndex(i - 0, j - 1, k - 0)])[0], rY); + B = getBetween(getXYZV([getIndex(i - 0, j, k - 1)])[0], getXYZV([getIndex(i - 0, j - 1, k - 1)])[0], rY); + C = getBetween(getXYZV([getIndex(i - 1, j, k - 1)])[0], getXYZV([getIndex(i - 1, j - 1, k - 1)])[0], rY); + D = getBetween(getXYZV([getIndex(i - 1, j, k - 0)])[0], getXYZV([getIndex(i - 1, j - 1, k - 0)])[0], rY); + makeSection(); + } + + if(rZ) { + A = getBetween(getXYZV([getIndex(i - 0, j - 0, k)])[0], getXYZV([getIndex(i - 0, j - 0, k - 1)])[0], rZ); + B = getBetween(getXYZV([getIndex(i - 0, j - 1, k)])[0], getXYZV([getIndex(i - 0, j - 1, k - 1)])[0], rZ); + C = getBetween(getXYZV([getIndex(i - 1, j - 1, k)])[0], getXYZV([getIndex(i - 1, j - 1, k - 1)])[0], rZ); + D = getBetween(getXYZV([getIndex(i - 1, j - 0, k)])[0], getXYZV([getIndex(i - 1, j - 0, k - 1)])[0], rZ); + makeSection(); + } + + return result; + } + + function begin3dCell(style, p000, p001, p010, p011, p100, p101, p110, p111, min, max, isEven) { + // used to create spaceframe and/or iso-surfaces + + var cellStyle = style; + if(isEven) { + if(drawingSurface && style === 'even') cellStyle = null; + return addCube(cellStyle, p000, p001, p010, p011, p100, p101, p110, p111, min, max); + } else { + if(drawingSurface && style === 'odd') cellStyle = null; + return addCube(cellStyle, p111, p110, p101, p100, p011, p010, p001, p000, min, max); + } + } + + function draw2dX(style, items, min, max, previousResult) { + var result = []; + var n = 0; + for(var q = 0; q < items.length; q++) { + var i = items[q]; + for(var k = 1; k < depth; k++) { + for(var j = 1; j < height; j++) { + result.push( + begin2dCell(style, + getIndex(i, j - 1, k - 1), + getIndex(i, j - 1, k), + getIndex(i, j, k - 1), + getIndex(i, j, k), + min, + max, + (i + j + k) % 2, + (previousResult && previousResult[n]) ? previousResult[n] : [] + ) + ); + n++; + } + } + } + return result; + } + + function draw2dY(style, items, min, max, previousResult) { + var result = []; + var n = 0; + for(var q = 0; q < items.length; q++) { + var j = items[q]; + for(var i = 1; i < width; i++) { + for(var k = 1; k < depth; k++) { + result.push( + begin2dCell(style, + getIndex(i - 1, j, k - 1), + getIndex(i, j, k - 1), + getIndex(i - 1, j, k), + getIndex(i, j, k), + min, + max, + (i + j + k) % 2, + (previousResult && previousResult[n]) ? previousResult[n] : [] + ) + ); + n++; + } + } + } + return result; + } + + function draw2dZ(style, items, min, max, previousResult) { + var result = []; + var n = 0; + for(var q = 0; q < items.length; q++) { + var k = items[q]; + for(var j = 1; j < height; j++) { + for(var i = 1; i < width; i++) { + result.push( + begin2dCell(style, + getIndex(i - 1, j - 1, k), + getIndex(i - 1, j, k), + getIndex(i, j - 1, k), + getIndex(i, j, k), + min, + max, + (i + j + k) % 2, + (previousResult && previousResult[n]) ? previousResult[n] : [] + ) + ); + n++; + } + } + } + return result; + } + + function draw3d(style, min, max) { + for(var k = 1; k < depth; k++) { + for(var j = 1; j < height; j++) { + for(var i = 1; i < width; i++) { + begin3dCell(style, + getIndex(i - 1, j - 1, k - 1), + getIndex(i - 1, j - 1, k), + getIndex(i - 1, j, k - 1), + getIndex(i - 1, j, k), + getIndex(i, j - 1, k - 1), + getIndex(i, j - 1, k), + getIndex(i, j, k - 1), + getIndex(i, j, k), + min, + max, + (i + j + k) % 2 + ); + } + } + } + } + + function drawSpaceframe(style, min, max) { + drawingSpaceframe = true; + draw3d(style, min, max); + drawingSpaceframe = false; + } + + function drawSurface(style, min, max) { + drawingSurface = true; + draw3d(style, min, max); + drawingSurface = false; + } + + function drawSectionX(style, items, min, max, distRatios, previousResult) { + var result = []; + var n = 0; + for(var q = 0; q < items.length; q++) { + var i = items[q]; + for(var k = 1; k < depth; k++) { + for(var j = 1; j < height; j++) { + result.push( + beginSection(style, i, j, k, min, max, distRatios[q], + (previousResult && previousResult[n]) ? previousResult[n] : [] + ) + ); + n++; + } + } + } + return result; + } + + function drawSectionY(style, items, min, max, distRatios, previousResult) { + var result = []; + var n = 0; + for(var q = 0; q < items.length; q++) { + var j = items[q]; + for(var i = 1; i < width; i++) { + for(var k = 1; k < depth; k++) { + result.push( + beginSection(style, i, j, k, min, max, distRatios[q], + (previousResult && previousResult[n]) ? previousResult[n] : [] + ) + ); + n++; + } + } + } + return result; + } + + function drawSectionZ(style, items, min, max, distRatios, previousResult) { + var result = []; + var n = 0; + for(var q = 0; q < items.length; q++) { + var k = items[q]; + for(var j = 1; j < height; j++) { + for(var i = 1; i < width; i++) { + result.push( + beginSection(style, i, j, k, min, max, distRatios[q], + (previousResult && previousResult[n]) ? previousResult[n] : [] + ) + ); + n++; + } + } + } + return result; + } + + function createRange(a, b) { + var range = []; + for(var q = a; q < b; q++) { + range.push(q); + } + return range; + } + + function insertGridPoints() { + for(var i = 0; i < width; i++) { + for(var j = 0; j < height; j++) { + for(var k = 0; k < depth; k++) { + var index = getIndex(i, j, k); + addVertex( + data._x[index], + data._y[index], + data._z[index], + data._value[index] + ); + } + } + } + } + + function drawAll() { + emptyVertices(); + + // insert grid points + insertGridPoints(); + + var activeStyle = null; + + // draw spaceframes + if(showSpaceframe && spaceframeFill) { + setFill(spaceframeFill); + + drawSpaceframe(activeStyle, vMin, vMax); + } + + // draw iso-surfaces + if(showSurface && surfaceFill) { + setFill(surfaceFill); + + var surfacePattern = data.surface.pattern; + var surfaceCount = data.surface.count; + for(var q = 0; q < surfaceCount; q++) { + var ratio = (surfaceCount === 1) ? 0.5 : q / (surfaceCount - 1); + var level = (1 - ratio) * vMin + ratio * vMax; + + var d1 = Math.abs(level - minValues); + var d2 = Math.abs(level - maxValues); + var ranges = (d1 > d2) ? + [minValues, level] : + [level, maxValues]; + + drawSurface(surfacePattern, ranges[0], ranges[1]); + } + } + + var setupMinMax = [ + [ Math.min(vMin, maxValues), Math.max(vMin, maxValues) ], + [ Math.min(minValues, vMax), Math.max(minValues, vMax) ] + ]; + + ['x', 'y', 'z'].forEach(function(e) { + var preRes = []; + for(var s = 0; s < setupMinMax.length; s++) { + var count = 0; + + var activeMin = setupMinMax[s][0]; + var activeMax = setupMinMax[s][1]; + + // draw slices + var slice = data.slices[e]; + if(slice.show && slice.fill) { + setFill(slice.fill); + + var exactIndices = []; + var ceilIndices = []; + var distRatios = []; + if(slice.locations.length) { + for(var q = 0; q < slice.locations.length; q++) { + var near = findNearestOnAxis( + slice.locations[q], + (e === 'x') ? Xs : + (e === 'y') ? Ys : Zs + ); + + if(near.distRatio === 0) { + exactIndices.push(near.id); + } else if(near.id > 0) { + ceilIndices.push(near.id); + if(e === 'x') { + distRatios.push([near.distRatio, 0, 0]); + } else if(e === 'y') { + distRatios.push([0, near.distRatio, 0]); + } else { + distRatios.push([0, 0, near.distRatio]); + } + } + } + } else { + if(e === 'x') { + exactIndices = createRange(1, width - 1); + } else if(e === 'y') { + exactIndices = createRange(1, height - 1); + } else { + exactIndices = createRange(1, depth - 1); + } + } + + if(ceilIndices.length > 0) { + if(e === 'x') { + preRes[count] = drawSectionX(activeStyle, ceilIndices, activeMin, activeMax, distRatios, preRes[count]); + } else if(e === 'y') { + preRes[count] = drawSectionY(activeStyle, ceilIndices, activeMin, activeMax, distRatios, preRes[count]); + } else { + preRes[count] = drawSectionZ(activeStyle, ceilIndices, activeMin, activeMax, distRatios, preRes[count]); + } + count++; + } + + if(exactIndices.length > 0) { + if(e === 'x') { + preRes[count] = draw2dX(activeStyle, exactIndices, activeMin, activeMax, preRes[count]); + } else if(e === 'y') { + preRes[count] = draw2dY(activeStyle, exactIndices, activeMin, activeMax, preRes[count]); + } else { + preRes[count] = draw2dZ(activeStyle, exactIndices, activeMin, activeMax, preRes[count]); + } + count++; + } + } + + // draw caps + var cap = data.caps[e]; + if(cap.show && cap.fill) { + setFill(cap.fill); + if(e === 'x') { + preRes[count] = draw2dX(activeStyle, [0, width - 1], activeMin, activeMax, preRes[count]); + } else if(e === 'y') { + preRes[count] = draw2dY(activeStyle, [0, height - 1], activeMin, activeMax, preRes[count]); + } else { + preRes[count] = draw2dZ(activeStyle, [0, depth - 1], activeMin, activeMax, preRes[count]); + } + count++; + } + } + }); + + // remove vertices arrays (i.e. grid points) in case no face was created. + if(numFaces === 0) { + emptyVertices(); + } + + data._meshX = allXs; + data._meshY = allYs; + data._meshZ = allZs; + data._meshIntensity = allVs; + + data._Xs = Xs; + data._Ys = Ys; + data._Zs = Zs; + } + + drawAll(); + + return data; +} + +function createIsosurfaceTrace(scene, data) { + var gl = scene.glplot.gl; + var mesh = createMesh({gl: gl}); + var result = new IsosurfaceTrace(scene, mesh, data.uid); + + mesh._trace = result; + result.update(data); + scene.glplot.add(mesh); + return result; +} + +module.exports = { + findNearestOnAxis: findNearestOnAxis, + generateIsoMeshes: generateIsoMeshes, + createIsosurfaceTrace: createIsosurfaceTrace, +}; + +},{"../../components/colorscale":536,"../../lib/gl_format_color":657,"../../lib/str2rgbarray":685,"../../plots/gl3d/zip3":764,"gl-mesh3d":219}],1014:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); +var Registry = _dereq_('../../registry'); +var attributes = _dereq_('./attributes'); +var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); + +function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce); +} + +function supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce) { + var isomin = coerce('isomin'); + var isomax = coerce('isomax'); + + if(isomax !== undefined && isomax !== null && + isomin !== undefined && isomin !== null && + isomin > isomax) { + // applying default values in this case: + traceOut.isomin = null; + traceOut.isomax = null; + } + + var x = coerce('x'); + var y = coerce('y'); + var z = coerce('z'); + var value = coerce('value'); + + if( + !x || !x.length || + !y || !y.length || + !z || !z.length || + !value || !value.length + ) { + traceOut.visible = false; + return; + } + + var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); + handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); + + coerce('valuehoverformat'); + ['x', 'y', 'z'].forEach(function(dim) { + coerce(dim + 'hoverformat'); + + var capDim = 'caps.' + dim; + var showCap = coerce(capDim + '.show'); + if(showCap) { + coerce(capDim + '.fill'); + } + + var sliceDim = 'slices.' + dim; + var showSlice = coerce(sliceDim + '.show'); + if(showSlice) { + coerce(sliceDim + '.fill'); + coerce(sliceDim + '.locations'); + } + }); + + var showSpaceframe = coerce('spaceframe.show'); + if(showSpaceframe) { + coerce('spaceframe.fill'); + } + + var showSurface = coerce('surface.show'); + if(showSurface) { + coerce('surface.count'); + coerce('surface.fill'); + coerce('surface.pattern'); + } + + var showContour = coerce('contour.show'); + if(showContour) { + coerce('contour.color'); + coerce('contour.width'); + } + + // Coerce remaining properties + [ + 'text', + 'hovertext', + 'hovertemplate', + 'lighting.ambient', + 'lighting.diffuse', + 'lighting.specular', + 'lighting.roughness', + 'lighting.fresnel', + 'lighting.vertexnormalsepsilon', + 'lighting.facenormalsepsilon', + 'lightposition.x', + 'lightposition.y', + 'lightposition.z', + 'flatshading', + 'opacity' + ].forEach(function(x) { coerce(x); }); + + colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}); + + // disable 1D transforms (for now) + traceOut._length = null; +} + +module.exports = { + supplyDefaults: supplyDefaults, + supplyIsoDefaults: supplyIsoDefaults +}; + +},{"../../components/colorscale/defaults":534,"../../lib":661,"../../registry":788,"./attributes":1011}],1015:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults').supplyDefaults, + calc: _dereq_('./calc'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + plot: _dereq_('./convert').createIsosurfaceTrace, + + moduleType: 'trace', + name: 'isosurface', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', 'showLegend'], + meta: { + } +}; + +},{"../../plots/gl3d":753,"./attributes":1011,"./calc":1012,"./convert":1013,"./defaults":1014}],1016:[function(_dereq_,module,exports){ +'use strict'; + +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); +var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; +var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; +var surfaceAttrs = _dereq_('../surface/attributes'); +var baseAttrs = _dereq_('../../plots/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; + +module.exports = extendFlat({ + x: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + y: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + z: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + + i: { + valType: 'data_array', + editType: 'calc', + }, + j: { + valType: 'data_array', + editType: 'calc', + + }, + k: { + valType: 'data_array', + editType: 'calc', + + }, + + text: { + valType: 'string', + dflt: '', + arrayOk: true, + editType: 'calc', + }, + hovertext: { + valType: 'string', + dflt: '', + arrayOk: true, + editType: 'calc', + }, + hovertemplate: hovertemplateAttrs({editType: 'calc'}), + + xhoverformat: axisHoverFormat('x'), + yhoverformat: axisHoverFormat('y'), + zhoverformat: axisHoverFormat('z'), + + delaunayaxis: { + valType: 'enumerated', + values: [ 'x', 'y', 'z' ], + dflt: 'z', + editType: 'calc', + }, + + alphahull: { + valType: 'number', + dflt: -1, + editType: 'calc', + }, + + intensity: { + valType: 'data_array', + editType: 'calc', + }, + intensitymode: { + valType: 'enumerated', + values: ['vertex', 'cell'], + dflt: 'vertex', + editType: 'calc', + }, + + // Color field + color: { + valType: 'color', + editType: 'calc', + }, + vertexcolor: { + valType: 'data_array', + editType: 'calc', + }, + facecolor: { + valType: 'data_array', + editType: 'calc', + }, + transforms: undefined +}, + +colorScaleAttrs('', { + colorAttr: '`intensity`', + showScaleDflt: true, + editTypeOverride: 'calc' +}), { + opacity: surfaceAttrs.opacity, + + // Flat shaded mode + flatshading: { + valType: 'boolean', + dflt: false, + editType: 'calc', + }, + + contour: { + show: extendFlat({}, surfaceAttrs.contours.x.show, { + }), + color: surfaceAttrs.contours.x.color, + width: surfaceAttrs.contours.x.width, + editType: 'calc' + }, + + lightposition: { + x: extendFlat({}, surfaceAttrs.lightposition.x, {dflt: 1e5}), + y: extendFlat({}, surfaceAttrs.lightposition.y, {dflt: 1e5}), + z: extendFlat({}, surfaceAttrs.lightposition.z, {dflt: 0}), + editType: 'calc' + }, + lighting: extendFlat({ + vertexnormalsepsilon: { + valType: 'number', + min: 0.00, + max: 1, + dflt: 1e-12, // otherwise finely tessellated things eg. the brain will have no specular light reflection + editType: 'calc', + }, + facenormalsepsilon: { + valType: 'number', + min: 0.00, + max: 1, + dflt: 1e-6, // even the brain model doesn't appear to need finer than this + editType: 'calc', + }, + editType: 'calc' + }, surfaceAttrs.lighting), + + hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {editType: 'calc'}), + showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) +}); + +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../surface/attributes":1157}],1017:[function(_dereq_,module,exports){ +'use strict'; + +var colorscaleCalc = _dereq_('../../components/colorscale/calc'); + +module.exports = function calc(gd, trace) { + if(trace.intensity) { + colorscaleCalc(gd, trace, { + vals: trace.intensity, + containerStr: '', + cLetter: 'c' + }); + } +}; + +},{"../../components/colorscale/calc":532}],1018:[function(_dereq_,module,exports){ +'use strict'; + +var createMesh = _dereq_('gl-mesh3d'); +var triangulate = _dereq_('delaunay-triangulate'); +var alphaShape = _dereq_('alpha-shape'); +var convexHull = _dereq_('convex-hull'); + +var parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale; +var str2RgbaArray = _dereq_('../../lib/str2rgbarray'); +var extractOpts = _dereq_('../../components/colorscale').extractOpts; +var zip3 = _dereq_('../../plots/gl3d/zip3'); + +function Mesh3DTrace(scene, mesh, uid) { + this.scene = scene; + this.uid = uid; + this.mesh = mesh; + this.name = ''; + this.color = '#fff'; + this.data = null; + this.showContour = false; +} + +var proto = Mesh3DTrace.prototype; + +proto.handlePick = function(selection) { + if(selection.object === this.mesh) { + var selectIndex = selection.index = selection.data.index; + + if(selection.data._cellCenter) { + selection.traceCoordinate = selection.data.dataCoordinate; + } else { + selection.traceCoordinate = [ + this.data.x[selectIndex], + this.data.y[selectIndex], + this.data.z[selectIndex] + ]; + } + + var text = this.data.hovertext || this.data.text; + if(Array.isArray(text) && text[selectIndex] !== undefined) { + selection.textLabel = text[selectIndex]; + } else if(text) { + selection.textLabel = text; + } + + return true; + } +}; + +function parseColorArray(colors) { + var b = []; + var len = colors.length; + for(var i = 0; i < len; i++) { + b[i] = str2RgbaArray(colors[i]); + } + return b; +} + +// Unpack position data +function toDataCoords(axis, coord, scale, calendar) { + var b = []; + var len = coord.length; + for(var i = 0; i < len; i++) { + b[i] = axis.d2l(coord[i], 0, calendar) * scale; + } + return b; +} + +// Round indices if passed as floats +function toRoundIndex(a) { + var b = []; + var len = a.length; + for(var i = 0; i < len; i++) { + b[i] = Math.round(a[i]); + } + return b; +} + +function delaunayCells(delaunayaxis, positions) { + var d = ['x', 'y', 'z'].indexOf(delaunayaxis); + var b = []; + var len = positions.length; + for(var i = 0; i < len; i++) { + b[i] = [positions[i][(d + 1) % 3], positions[i][(d + 2) % 3]]; + } + return triangulate(b); +} + +// Validate indices +function hasValidIndices(list, numVertices) { + var len = list.length; + for(var i = 0; i < len; i++) { + if(list[i] <= -0.5 || list[i] >= numVertices - 0.5) { // Note: the indices would be rounded -0.49 is valid. + return false; + } + } + return true; +} + +proto.update = function(data) { + var scene = this.scene; + var layout = scene.fullSceneLayout; + + this.data = data; + + var numVertices = data.x.length; + + var positions = zip3( + toDataCoords(layout.xaxis, data.x, scene.dataScale[0], data.xcalendar), + toDataCoords(layout.yaxis, data.y, scene.dataScale[1], data.ycalendar), + toDataCoords(layout.zaxis, data.z, scene.dataScale[2], data.zcalendar) + ); + + var cells; + if(data.i && data.j && data.k) { + if( + data.i.length !== data.j.length || + data.j.length !== data.k.length || + !hasValidIndices(data.i, numVertices) || + !hasValidIndices(data.j, numVertices) || + !hasValidIndices(data.k, numVertices) + ) { + return; + } + cells = zip3( + toRoundIndex(data.i), + toRoundIndex(data.j), + toRoundIndex(data.k) + ); + } else if(data.alphahull === 0) { + cells = convexHull(positions); + } else if(data.alphahull > 0) { + cells = alphaShape(data.alphahull, positions); + } else { + cells = delaunayCells(data.delaunayaxis, positions); + } + + var config = { + positions: positions, + cells: cells, + lightPosition: [data.lightposition.x, data.lightposition.y, data.lightposition.z], + ambient: data.lighting.ambient, + diffuse: data.lighting.diffuse, + specular: data.lighting.specular, + roughness: data.lighting.roughness, + fresnel: data.lighting.fresnel, + vertexNormalsEpsilon: data.lighting.vertexnormalsepsilon, + faceNormalsEpsilon: data.lighting.facenormalsepsilon, + opacity: data.opacity, + contourEnable: data.contour.show, + contourColor: str2RgbaArray(data.contour.color).slice(0, 3), + contourWidth: data.contour.width, + useFacetNormals: data.flatshading + }; + + if(data.intensity) { + var cOpts = extractOpts(data); + this.color = '#fff'; + var mode = data.intensitymode; + config[mode + 'Intensity'] = data.intensity; + config[mode + 'IntensityBounds'] = [cOpts.min, cOpts.max]; + config.colormap = parseColorScale(data); + } else if(data.vertexcolor) { + this.color = data.vertexcolor[0]; + config.vertexColors = parseColorArray(data.vertexcolor); + } else if(data.facecolor) { + this.color = data.facecolor[0]; + config.cellColors = parseColorArray(data.facecolor); + } else { + this.color = data.color; + config.meshColor = str2RgbaArray(data.color); + } + + // Update mesh + this.mesh.update(config); +}; + +proto.dispose = function() { + this.scene.glplot.remove(this.mesh); + this.mesh.dispose(); +}; + +function createMesh3DTrace(scene, data) { + var gl = scene.glplot.gl; + var mesh = createMesh({gl: gl}); + var result = new Mesh3DTrace(scene, mesh, data.uid); + mesh._trace = result; + result.update(data); + scene.glplot.add(mesh); + return result; +} + +module.exports = createMesh3DTrace; + +},{"../../components/colorscale":536,"../../lib/gl_format_color":657,"../../lib/str2rgbarray":685,"../../plots/gl3d/zip3":764,"alpha-shape":68,"convex-hull":128,"delaunay-triangulate":152,"gl-mesh3d":219}],1019:[function(_dereq_,module,exports){ +'use strict'; + +var Registry = _dereq_('../../registry'); +var Lib = _dereq_('../../lib'); +var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); +var attributes = _dereq_('./attributes'); + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + // read in face/vertex properties + function readComponents(array) { + var ret = array.map(function(attr) { + var result = coerce(attr); + + if(result && Lib.isArrayOrTypedArray(result)) return result; + return null; + }); + + return ret.every(function(x) { + return x && x.length === ret[0].length; + }) && ret; + } + + var coords = readComponents(['x', 'y', 'z']); + if(!coords) { + traceOut.visible = false; + return; + } + + readComponents(['i', 'j', 'k']); + // three indices should be all provided or not + if( + (traceOut.i && (!traceOut.j || !traceOut.k)) || + (traceOut.j && (!traceOut.k || !traceOut.i)) || + (traceOut.k && (!traceOut.i || !traceOut.j)) + ) { + traceOut.visible = false; + return; + } + + var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); + handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); + + // Coerce remaining properties + [ + 'lighting.ambient', + 'lighting.diffuse', + 'lighting.specular', + 'lighting.roughness', + 'lighting.fresnel', + 'lighting.vertexnormalsepsilon', + 'lighting.facenormalsepsilon', + 'lightposition.x', + 'lightposition.y', + 'lightposition.z', + 'flatshading', + 'alphahull', + 'delaunayaxis', + 'opacity' + ].forEach(function(x) { coerce(x); }); + + var showContour = coerce('contour.show'); + if(showContour) { + coerce('contour.color'); + coerce('contour.width'); + } + + if('intensity' in traceIn) { + coerce('intensity'); + coerce('intensitymode'); + colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}); + } else { + traceOut.showscale = false; + + if('facecolor' in traceIn) coerce('facecolor'); + else if('vertexcolor' in traceIn) coerce('vertexcolor'); + else coerce('color', defaultColor); + } + + coerce('text'); + coerce('hovertext'); + coerce('hovertemplate'); + coerce('xhoverformat'); + coerce('yhoverformat'); + coerce('zhoverformat'); + + // disable 1D transforms + // x/y/z should match lengths, and i/j/k should match as well, but + // the two sets have different lengths so transforms wouldn't work. + traceOut._length = null; +}; + +},{"../../components/colorscale/defaults":534,"../../lib":661,"../../registry":788,"./attributes":1016}],1020:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults'), + calc: _dereq_('./calc'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + plot: _dereq_('./convert'), + + moduleType: 'trace', + name: 'mesh3d', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', 'showLegend'], + meta: { + } +}; + +},{"../../plots/gl3d":753,"./attributes":1016,"./calc":1017,"./convert":1018,"./defaults":1019}],1021:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib').extendFlat; @@ -176117,7 +221826,7 @@ module.exports = { }), }; -},{"../../components/drawing/attributes":229,"../../components/fx/attributes":239,"../../constants/delta.js":315,"../../lib":342,"../../plots/cartesian/axis_format_attributes":393,"../scatter/attributes":705}],667:[function(_dereq_,module,exports){ +},{"../../components/drawing/attributes":545,"../../components/fx/attributes":555,"../../constants/delta.js":631,"../../lib":661,"../../plots/cartesian/axis_format_attributes":714,"../scatter/attributes":1064}],1022:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -176290,7 +221999,7 @@ module.exports = { calcCommon: calcCommon }; -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390}],668:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711}],1023:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -176332,7 +222041,7 @@ function handleDirection(traceIn, traceOut, coerce, direction) { coerce(direction + '.line.dash', traceOut.line.dash); } -},{"../../lib":342,"../scatter/period_defaults":725,"./attributes":666,"./ohlc_defaults":671}],669:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/period_defaults":1084,"./attributes":1021,"./ohlc_defaults":1026}],1024:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -176531,7 +222240,7 @@ module.exports = { hoverOnPoints: hoverOnPoints }; -},{"../../components/color":208,"../../components/fx":248,"../../constants/delta.js":315,"../../lib":342,"../../plots/cartesian/axes":390}],670:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx":564,"../../constants/delta.js":631,"../../lib":661,"../../plots/cartesian/axes":711}],1025:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -176551,7 +222260,7 @@ module.exports = { selectPoints: _dereq_('./select') }; -},{"../../plots/cartesian":404,"./attributes":666,"./calc":667,"./defaults":668,"./hover":669,"./plot":672,"./select":673,"./style":674}],671:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./attributes":1021,"./calc":1022,"./defaults":1023,"./hover":1024,"./plot":1027,"./select":1028,"./style":1029}],1026:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -176578,7 +222287,7 @@ module.exports = function handleOHLC(traceIn, traceOut, coerce, layout) { return len; }; -},{"../../lib":342,"../../registry":452}],672:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788}],1027:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -176628,7 +222337,7 @@ module.exports = function plot(gd, plotinfo, cdOHLC, ohlcLayer) { }); }; -},{"../../lib":342,"@plotly/d3":44}],673:[function(_dereq_,module,exports){ +},{"../../lib":661,"@plotly/d3":54}],1028:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -176665,7 +222374,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],674:[function(_dereq_,module,exports){ +},{}],1029:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -176696,7 +222405,7 @@ module.exports = function style(gd, cd, sel) { }); }; -},{"../../components/color":208,"../../components/drawing":230,"@plotly/d3":44}],675:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"@plotly/d3":54}],1030:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -176834,7 +222543,7 @@ module.exports = { showlegend: undefined }; -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/domain":418,"../../plots/font_attributes":419,"../../plots/template_attributes":447}],676:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/domain":739,"../../plots/font_attributes":740,"../../plots/template_attributes":783}],1031:[function(_dereq_,module,exports){ 'use strict'; var getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData; @@ -176861,7 +222570,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/get_data":427,"./plot":681}],677:[function(_dereq_,module,exports){ +},{"../../plots/get_data":748,"./plot":1036}],1032:[function(_dereq_,module,exports){ 'use strict'; // Requirements @@ -177372,7 +223081,7 @@ function isRangePermutation(inds) { return true; } -},{"../../components/colorscale/calc":216,"../../components/colorscale/helpers":219,"../../components/drawing":230,"../../lib":342,"../../lib/filter_unique.js":334,"../../lib/gup":339,"fast-isnumeric":81}],678:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../components/colorscale/helpers":535,"../../components/drawing":546,"../../lib":661,"../../lib/filter_unique.js":652,"../../lib/gup":658,"fast-isnumeric":159}],1033:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -177485,7 +223194,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceFont(coerce, 'tickfont', categoryfontDefault); }; -},{"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"../../lib":342,"../../plots/array_container_defaults":385,"../../plots/domain":418,"../parcoords/merge_length":682,"./attributes":675}],679:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"../../lib":661,"../../plots/array_container_defaults":706,"../../plots/domain":739,"../parcoords/merge_length":1037,"./attributes":1030}],1034:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -177507,7 +223216,7 @@ module.exports = { } }; -},{"./attributes":675,"./base_plot":676,"./calc":677,"./defaults":678,"./plot":681}],680:[function(_dereq_,module,exports){ +},{"./attributes":1030,"./base_plot":1031,"./calc":1032,"./defaults":1033,"./plot":1036}],1035:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -179656,7 +225365,7 @@ function createDimensionViewModel(parcatsViewModel, dimensionModel) { * The parent trace's view model */ -},{"../../components/drawing":230,"../../components/fx":248,"../../lib":342,"../../lib/svg_text_utils":365,"../../plot_api/plot_api":376,"@plotly/d3":44,"d3-interpolate":72,"tinycolor2":171}],681:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../components/fx":564,"../../lib":661,"../../lib/svg_text_utils":686,"../../plot_api/plot_api":697,"@plotly/d3":54,"d3-interpolate":143,"tinycolor2":471}],1036:[function(_dereq_,module,exports){ 'use strict'; @@ -179692,7 +225401,7 @@ module.exports = function plot(graphDiv, parcatsModels, transitionOpts, makeOnCo ); }; -},{"./parcats":680}],682:[function(_dereq_,module,exports){ +},{"./parcats":1035}],1037:[function(_dereq_,module,exports){ 'use strict'; /** @@ -179722,7 +225431,7 @@ module.exports = function(traceOut, dimensions, dataAttr, len) { return len; }; -},{}],683:[function(_dereq_,module,exports){ +},{}],1038:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -179937,7 +225646,7 @@ module.exports = { } }; -},{"../../components/color/attributes":207,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/domain":418,"../../plots/font_attributes":419,"../../plots/template_attributes":447}],684:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/domain":739,"../../plots/font_attributes":740,"../../plots/template_attributes":783}],1039:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -179952,7 +225661,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":438}],685:[function(_dereq_,module,exports){ +},{"../../plots/plots":774}],1040:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -180127,7 +225836,7 @@ module.exports = { generateExtendedColors: generateExtendedColors }; -},{"../../components/color":208,"fast-isnumeric":81,"tinycolor2":171}],686:[function(_dereq_,module,exports){ +},{"../../components/color":524,"fast-isnumeric":159,"tinycolor2":471}],1041:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -180250,7 +225959,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":342,"../../plots/domain":418,"../bar/defaults":466,"./attributes":683,"fast-isnumeric":81}],687:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/domain":739,"../bar/defaults":802,"./attributes":1038,"fast-isnumeric":159}],1042:[function(_dereq_,module,exports){ 'use strict'; var appendArrayMultiPointValues = _dereq_('../../components/fx/helpers').appendArrayMultiPointValues; @@ -180292,7 +226001,7 @@ module.exports = function eventData(pt, trace) { return out; }; -},{"../../components/fx/helpers":244}],688:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":560}],1043:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -180332,7 +226041,7 @@ exports.getRotationAngle = function(rotation) { return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180; }; -},{"../../lib":342}],689:[function(_dereq_,module,exports){ +},{"../../lib":661}],1044:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -180356,7 +226065,7 @@ module.exports = { } }; -},{"./attributes":683,"./base_plot":684,"./calc":685,"./defaults":686,"./layout_attributes":690,"./layout_defaults":691,"./plot":692,"./style":693,"./style_one":694}],690:[function(_dereq_,module,exports){ +},{"./attributes":1038,"./base_plot":1039,"./calc":1040,"./defaults":1041,"./layout_attributes":1045,"./layout_defaults":1046,"./plot":1047,"./style":1048,"./style_one":1049}],1045:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -180375,7 +226084,7 @@ module.exports = { } }; -},{}],691:[function(_dereq_,module,exports){ +},{}],1046:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -180392,7 +226101,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendpiecolors'); }; -},{"../../lib":342,"./layout_attributes":690}],692:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":1045}],1047:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -181572,7 +227281,7 @@ module.exports = { computeTransform: computeTransform }; -},{"../../components/color":208,"../../components/drawing":230,"../../components/fx":248,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../bar/constants":464,"../bar/uniform_text":478,"./event_data":687,"./helpers":688,"@plotly/d3":44}],693:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../components/fx":564,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../bar/constants":800,"../bar/uniform_text":814,"./event_data":1042,"./helpers":1043,"@plotly/d3":54}],1048:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -181597,7 +227306,7 @@ module.exports = function style(gd) { }); }; -},{"../bar/uniform_text":478,"./style_one":694,"@plotly/d3":44}],694:[function(_dereq_,module,exports){ +},{"../bar/uniform_text":814,"./style_one":1049,"@plotly/d3":54}],1049:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -181613,7 +227322,348 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":208,"./helpers":688}],695:[function(_dereq_,module,exports){ +},{"../../components/color":524,"./helpers":1043}],1050:[function(_dereq_,module,exports){ +'use strict'; + +var scatterglAttrs = _dereq_('../scatter/attributes'); + +module.exports = { + x: scatterglAttrs.x, + y: scatterglAttrs.y, + xy: { + valType: 'data_array', + editType: 'calc', + }, + indices: { + valType: 'data_array', + editType: 'calc', + }, + xbounds: { + valType: 'data_array', + editType: 'calc', + }, + ybounds: { + valType: 'data_array', + editType: 'calc', + }, + text: scatterglAttrs.text, + marker: { + color: { + valType: 'color', + arrayOk: false, + + editType: 'calc', + }, + opacity: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + arrayOk: false, + + editType: 'calc', + }, + blend: { + valType: 'boolean', + dflt: null, + + editType: 'calc', + }, + sizemin: { + valType: 'number', + min: 0.1, + max: 2, + dflt: 0.5, + + editType: 'calc', + }, + sizemax: { + valType: 'number', + min: 0.1, + dflt: 20, + + editType: 'calc', + }, + border: { + color: { + valType: 'color', + arrayOk: false, + + editType: 'calc', + }, + arearatio: { + valType: 'number', + min: 0, + max: 1, + dflt: 0, + + editType: 'calc', + }, + editType: 'calc' + }, + editType: 'calc' + }, + transforms: undefined +}; + +},{"../scatter/attributes":1064}],1051:[function(_dereq_,module,exports){ +'use strict'; + +var createPointCloudRenderer = _dereq_('gl-pointcloud2d'); + +var str2RGBArray = _dereq_('../../lib/str2rgbarray'); +var findExtremes = _dereq_('../../plots/cartesian/autorange').findExtremes; +var getTraceColor = _dereq_('../scatter/get_trace_color'); + +function Pointcloud(scene, uid) { + this.scene = scene; + this.uid = uid; + 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: 0.5, + sizemax: 12, + color: [0, 0, 0, 1], + areaRatio: 1, + borderColor: [0, 0, 0, 1] + }; + this.pointcloud = createPointCloudRenderer(scene.glplot, this.pointcloudOptions); + this.pointcloud._trace = this; // scene2d requires this prop +} + +var proto = Pointcloud.prototype; + +proto.handlePick = function(pickResult) { + var index = this.idToIndex[pickResult.pointId]; + + // prefer the readout from XY, if present + return { + trace: this, + dataCoord: pickResult.dataCoord, + traceCoord: this.pickXYData ? + [this.pickXYData[index * 2], this.pickXYData[index * 2 + 1]] : + [this.pickXData[index], this.pickYData[index]], + textLabel: Array.isArray(this.textLabels) ? + this.textLabels[index] : + this.textLabels, + color: this.color, + name: this.name, + pointIndex: index, + hoverinfo: this.hoverinfo + }; +}; + +proto.update = function(options) { + this.index = options.index; + this.textLabels = options.text; + this.name = options.name; + this.hoverinfo = options.hoverinfo; + this.bounds = [Infinity, Infinity, -Infinity, -Infinity]; + + this.updateFast(options); + + this.color = getTraceColor(options, {}); +}; + +proto.updateFast = function(options) { + var x = this.xData = this.pickXData = options.x; + var y = this.yData = this.pickYData = options.y; + var xy = this.pickXYData = options.xy; + + var userBounds = options.xbounds && options.ybounds; + var index = options.indices; + + var len; + var idToIndex; + var positions; + var bounds = this.bounds; + + var xx, yy, i; + + if(xy) { + positions = xy; + + // dividing xy.length by 2 and truncating to integer if xy.length was not even + len = xy.length >>> 1; + + if(userBounds) { + bounds[0] = options.xbounds[0]; + bounds[2] = options.xbounds[1]; + bounds[1] = options.ybounds[0]; + bounds[3] = options.ybounds[1]; + } else { + for(i = 0; i < len; i++) { + xx = positions[i * 2]; + yy = positions[i * 2 + 1]; + + if(xx < bounds[0]) bounds[0] = xx; + if(xx > bounds[2]) bounds[2] = xx; + if(yy < bounds[1]) bounds[1] = yy; + if(yy > bounds[3]) bounds[3] = yy; + } + } + + if(index) { + idToIndex = index; + } else { + idToIndex = new Int32Array(len); + + for(i = 0; i < len; i++) { + idToIndex[i] = i; + } + } + } else { + len = x.length; + + positions = new Float32Array(2 * len); + idToIndex = new Int32Array(len); + + for(i = 0; i < len; i++) { + xx = x[i]; + yy = y[i]; + + idToIndex[i] = i; + + positions[i * 2] = xx; + positions[i * 2 + 1] = yy; + + if(xx < bounds[0]) bounds[0] = xx; + if(xx > bounds[2]) bounds[2] = xx; + if(yy < bounds[1]) bounds[1] = yy; + if(yy > bounds[3]) bounds[3] = yy; + } + } + + this.idToIndex = idToIndex; + this.pointcloudOptions.idToIndex = idToIndex; + + this.pointcloudOptions.positions = positions; + + var markerColor = str2RGBArray(options.marker.color); + var borderColor = str2RGBArray(options.marker.border.color); + var opacity = options.opacity * options.marker.opacity; + + markerColor[3] *= opacity; + this.pointcloudOptions.color = markerColor; + + // detect blending from the number of points, if undefined + // because large data with blending hits performance + var blend = options.marker.blend; + if(blend === null) { + var maxPoints = 100; + blend = x.length < maxPoints || y.length < maxPoints; + } + this.pointcloudOptions.blend = blend; + + borderColor[3] *= opacity; + this.pointcloudOptions.borderColor = borderColor; + + var markerSizeMin = options.marker.sizemin; + var markerSizeMax = Math.max(options.marker.sizemax, options.marker.sizemin); + this.pointcloudOptions.sizeMin = markerSizeMin; + this.pointcloudOptions.sizeMax = markerSizeMax; + this.pointcloudOptions.areaRatio = options.marker.border.arearatio; + + this.pointcloud.update(this.pointcloudOptions); + + // add item for autorange routine + var xa = this.scene.xaxis; + var ya = this.scene.yaxis; + var pad = markerSizeMax / 2 || 0.5; + options._extremes[xa._id] = findExtremes(xa, [bounds[0], bounds[2]], {ppad: pad}); + options._extremes[ya._id] = findExtremes(ya, [bounds[1], bounds[3]], {ppad: pad}); +}; + +proto.dispose = function() { + this.pointcloud.dispose(); +}; + +function createPointcloud(scene, data) { + var plot = new Pointcloud(scene, data.uid); + plot.update(data); + return plot; +} + +module.exports = createPointcloud; + +},{"../../lib/str2rgbarray":685,"../../plots/cartesian/autorange":710,"../scatter/get_trace_color":1074,"gl-pointcloud2d":231}],1052:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); + +var attributes = _dereq_('./attributes'); + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + coerce('x'); + coerce('y'); + + coerce('xbounds'); + coerce('ybounds'); + + if(traceIn.xy && traceIn.xy instanceof Float32Array) { + traceOut.xy = traceIn.xy; + } + + if(traceIn.indices && traceIn.indices instanceof Int32Array) { + traceOut.indices = traceIn.indices; + } + + coerce('text'); + coerce('marker.color', defaultColor); + coerce('marker.opacity'); + coerce('marker.blend'); + coerce('marker.sizemin'); + coerce('marker.sizemax'); + coerce('marker.border.color', defaultColor); + coerce('marker.border.arearatio'); + + // disable 1D transforms - that would defeat the purpose of this trace type, performance! + traceOut._length = null; +}; + +},{"../../lib":661,"./attributes":1050}],1053:[function(_dereq_,module,exports){ +'use strict'; + +var deprecationWarning = [ + '*pointcloud* trace is deprecated!', + 'Please consider switching to the *scattergl* trace type.' +].join(' '); + +module.exports = { + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults'), + + // reuse the Scatter3D 'dummy' calc step so that legends know what to do + calc: _dereq_('../scatter3d/calc'), + plot: _dereq_('./convert'), + + moduleType: 'trace', + name: 'pointcloud', + basePlotModule: _dereq_('../../plots/gl2d'), + categories: ['gl', 'gl2d', 'showLegend'], + meta: { + } +}; + +},{"../../plots/gl2d":751,"../scatter3d/calc":1093,"./attributes":1050,"./convert":1051,"./defaults":1052}],1054:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -181801,7 +227851,7 @@ var attrs = module.exports = overrideAll({ }, 'calc', 'nested'); attrs.transforms = undefined; -},{"../../components/color/attributes":207,"../../components/colorscale/attributes":215,"../../components/fx/attributes":239,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/domain":418,"../../plots/font_attributes":419,"../../plots/template_attributes":447}],696:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":523,"../../components/colorscale/attributes":531,"../../components/fx/attributes":555,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/domain":739,"../../plots/font_attributes":740,"../../plots/template_attributes":783}],1055:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -181932,7 +227982,7 @@ function subplotUpdateFx(gd, index) { dragElement.init(dragOptions); } -},{"../../components/dragelement":227,"../../components/fx/layout_attributes":249,"../../lib":342,"../../lib/setcursor":362,"../../plot_api/edit_types":372,"../../plots/cartesian/select":410,"../../plots/get_data":427,"../../registry":452,"./plot":701}],697:[function(_dereq_,module,exports){ +},{"../../components/dragelement":543,"../../components/fx/layout_attributes":565,"../../lib":661,"../../lib/setcursor":681,"../../plot_api/edit_types":693,"../../plots/cartesian/select":731,"../../plots/get_data":748,"../../registry":788,"./plot":1060}],1056:[function(_dereq_,module,exports){ 'use strict'; var tarjan = _dereq_('strongly-connected-components'); @@ -182113,7 +228163,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale":220,"../../lib":342,"../../lib/gup":339,"strongly-connected-components":169}],698:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../lib":661,"../../lib/gup":658,"strongly-connected-components":467}],1057:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -182136,7 +228186,7 @@ module.exports = { } }; -},{}],699:[function(_dereq_,module,exports){ +},{}],1058:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -182242,7 +228292,7 @@ function concentrationscalesDefaults(In, Out) { coerce('colorscale'); } -},{"../../components/color":208,"../../components/fx/hoverlabel_defaults":246,"../../lib":342,"../../plot_api/plot_template":379,"../../plots/array_container_defaults":385,"../../plots/domain":418,"./attributes":695,"tinycolor2":171}],700:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx/hoverlabel_defaults":562,"../../lib":661,"../../plot_api/plot_template":700,"../../plots/array_container_defaults":706,"../../plots/domain":739,"./attributes":1054,"tinycolor2":471}],1059:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -182260,7 +228310,7 @@ module.exports = { } }; -},{"./attributes":695,"./base_plot":696,"./calc":697,"./defaults":699,"./plot":701,"./select.js":703}],701:[function(_dereq_,module,exports){ +},{"./attributes":1054,"./base_plot":1055,"./calc":1056,"./defaults":1058,"./plot":1060,"./select.js":1062}],1060:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -182629,7 +228679,7 @@ module.exports = function plot(gd, calcData) { ); }; -},{"../../components/color":208,"../../components/fx":248,"../../lib":342,"./constants":698,"./render":702,"@plotly/d3":44}],702:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx":564,"../../lib":661,"./constants":1057,"./render":1061,"@plotly/d3":54}],1061:[function(_dereq_,module,exports){ 'use strict'; var d3Force = _dereq_('d3-force'); @@ -183646,7 +229696,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .ease(c.ease).duration(c.duration); }; -},{"../../components/color":208,"../../components/drawing":230,"../../constants/alignment":313,"../../lib":342,"../../lib/gup":339,"../../lib/svg_text_utils":365,"../../registry":452,"./constants":698,"@plotly/d3":44,"@plotly/d3-sankey":43,"@plotly/d3-sankey-circular":42,"d3-force":67,"d3-interpolate":72,"tinycolor2":171}],703:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../constants/alignment":629,"../../lib":661,"../../lib/gup":658,"../../lib/svg_text_utils":686,"../../registry":788,"./constants":1057,"@plotly/d3":54,"@plotly/d3-sankey":53,"@plotly/d3-sankey-circular":52,"d3-force":138,"d3-interpolate":143,"tinycolor2":471}],1062:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -183676,7 +229726,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],704:[function(_dereq_,module,exports){ +},{}],1063:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -183719,7 +229769,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":342}],705:[function(_dereq_,module,exports){ +},{"../../lib":661}],1064:[function(_dereq_,module,exports){ 'use strict'; var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; @@ -184069,7 +230119,7 @@ module.exports = { }), }; -},{"../../components/colorscale/attributes":215,"../../components/drawing":230,"../../components/drawing/attributes":229,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/font_attributes":419,"../../plots/template_attributes":447,"./constants":709}],706:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../components/drawing":546,"../../components/drawing/attributes":545,"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../../plots/font_attributes":740,"../../plots/template_attributes":783,"./constants":1068}],1065:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -184366,7 +230416,7 @@ module.exports = { getStackOpts: getStackOpts }; -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"./arrays_to_calcdata":704,"./calc_selection":707,"./colorscale_calc":708,"./subtypes":730,"fast-isnumeric":81}],707:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"./arrays_to_calcdata":1063,"./calc_selection":1066,"./colorscale_calc":1067,"./subtypes":1089,"fast-isnumeric":159}],1066:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -184377,7 +230427,7 @@ module.exports = function calcSelection(cd, trace) { } }; -},{"../../lib":342}],708:[function(_dereq_,module,exports){ +},{"../../lib":661}],1067:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -184412,7 +230462,7 @@ module.exports = function calcMarkerColorscale(gd, trace) { } }; -},{"../../components/colorscale/calc":216,"../../components/colorscale/helpers":219,"./subtypes":730}],709:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":532,"../../components/colorscale/helpers":535,"./subtypes":1089}],1068:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -184432,7 +230482,7 @@ module.exports = { eventDataKeys: [] }; -},{}],710:[function(_dereq_,module,exports){ +},{}],1069:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('./calc'); @@ -184604,7 +230654,7 @@ function getInterp(calcTrace, index, position, posAttr) { return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]); } -},{"./calc":706}],711:[function(_dereq_,module,exports){ +},{"./calc":1065}],1070:[function(_dereq_,module,exports){ 'use strict'; @@ -184634,7 +230684,7 @@ module.exports = function crossTraceDefaults(fullData) { } }; -},{}],712:[function(_dereq_,module,exports){ +},{}],1071:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -184721,7 +230771,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":342,"../../registry":452,"./attributes":705,"./constants":709,"./fillcolor_defaults":713,"./line_defaults":718,"./line_shape_defaults":720,"./marker_defaults":724,"./period_defaults":725,"./stack_defaults":728,"./subtypes":730,"./text_defaults":731,"./xy_defaults":732}],713:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788,"./attributes":1064,"./constants":1068,"./fillcolor_defaults":1072,"./line_defaults":1077,"./line_shape_defaults":1079,"./marker_defaults":1083,"./period_defaults":1084,"./stack_defaults":1087,"./subtypes":1089,"./text_defaults":1090,"./xy_defaults":1091}],1072:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -184749,7 +230799,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":208,"../../lib":342}],714:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661}],1073:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -184767,7 +230817,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":390}],715:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711}],1074:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -184807,7 +230857,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":208,"./subtypes":730}],716:[function(_dereq_,module,exports){ +},{"../../components/color":524,"./subtypes":1089}],1075:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -185018,7 +231068,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { } }; -},{"../../components/color":208,"../../components/fx":248,"../../lib":342,"../../registry":452,"./get_trace_color":715}],717:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/fx":564,"../../lib":661,"../../registry":788,"./get_trace_color":1074}],1076:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -185055,7 +231105,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"./arrays_to_calcdata":704,"./attributes":705,"./calc":706,"./cross_trace_calc":710,"./cross_trace_defaults":711,"./defaults":712,"./format_labels":714,"./hover":716,"./marker_colorbar":723,"./plot":726,"./select":727,"./style":729,"./subtypes":730}],718:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"./arrays_to_calcdata":1063,"./attributes":1064,"./calc":1065,"./cross_trace_calc":1069,"./cross_trace_defaults":1070,"./defaults":1071,"./format_labels":1073,"./hover":1075,"./marker_colorbar":1082,"./plot":1085,"./select":1086,"./style":1088,"./subtypes":1089}],1077:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -185078,7 +231128,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, if(!(opts || {}).noDash) coerce('line.dash'); }; -},{"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"../../lib":342}],719:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"../../lib":661}],1078:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -185530,7 +231580,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../constants/numerical":319,"../../lib":342,"./constants":709}],720:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"./constants":1068}],1079:[function(_dereq_,module,exports){ 'use strict'; @@ -185540,7 +231590,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],721:[function(_dereq_,module,exports){ +},{}],1080:[function(_dereq_,module,exports){ 'use strict'; var LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1}; @@ -185622,7 +231672,7 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) { return cdscatterSorted; }; -},{}],722:[function(_dereq_,module,exports){ +},{}],1081:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -185658,7 +231708,7 @@ module.exports = function makeBubbleSizeFn(trace, factor) { }; }; -},{"fast-isnumeric":81}],723:[function(_dereq_,module,exports){ +},{"fast-isnumeric":159}],1082:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -185667,7 +231717,7 @@ module.exports = { max: 'cmax' }; -},{}],724:[function(_dereq_,module,exports){ +},{}],1083:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -185740,7 +231790,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":208,"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"./subtypes":730}],725:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"./subtypes":1089}],1084:[function(_dereq_,module,exports){ 'use strict'; var dateTick0 = _dereq_('../../lib').dateTick0; @@ -185779,7 +231829,7 @@ module.exports = function handlePeriodDefaults(traceIn, traceOut, layout, coerce } }; -},{"../../constants/numerical":319,"../../lib":342}],726:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661}],1085:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -186331,7 +232381,7 @@ function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) { }); } -},{"../../components/drawing":230,"../../lib":342,"../../lib/polygon":354,"../../registry":452,"./line_points":719,"./link_traces":721,"./subtypes":730,"@plotly/d3":44}],727:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../lib/polygon":673,"../../registry":788,"./line_points":1078,"./link_traces":1080,"./subtypes":1089,"@plotly/d3":54}],1086:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -186376,7 +232426,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"./subtypes":730}],728:[function(_dereq_,module,exports){ +},{"./subtypes":1089}],1087:[function(_dereq_,module,exports){ 'use strict'; var perStackAttrs = ['orientation', 'groupnorm', 'stackgaps']; @@ -186473,7 +232523,7 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) } }; -},{}],729:[function(_dereq_,module,exports){ +},{}],1088:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -186535,7 +232585,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/drawing":230,"../../registry":452,"@plotly/d3":44}],730:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../registry":788,"@plotly/d3":54}],1089:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -186565,7 +232615,7 @@ module.exports = { } }; -},{"../../lib":342}],731:[function(_dereq_,module,exports){ +},{"../../lib":661}],1090:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -186586,7 +232636,7 @@ module.exports = function(traceIn, traceOut, layout, coerce, opts) { } }; -},{"../../lib":342}],732:[function(_dereq_,module,exports){ +},{"../../lib":661}],1091:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -186622,7 +232672,890 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) { return len; }; -},{"../../lib":342,"../../registry":452}],733:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../registry":788}],1092:[function(_dereq_,module,exports){ +'use strict'; + +var scatterAttrs = _dereq_('../scatter/attributes'); +var colorAttributes = _dereq_('../../components/colorscale/attributes'); +var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; +var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; +var texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs; +var baseAttrs = _dereq_('../../plots/attributes'); +var DASHES = _dereq_('../../constants/gl3d_dashes'); + +var MARKER_SYMBOLS = _dereq_('../../constants/gl3d_markers'); +var extendFlat = _dereq_('../../lib/extend').extendFlat; +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; +var sortObjectKeys = _dereq_('../../lib/sort_object_keys'); + +var scatterLineAttrs = scatterAttrs.line; +var scatterMarkerAttrs = scatterAttrs.marker; +var scatterMarkerLineAttrs = scatterMarkerAttrs.line; + +var lineAttrs = extendFlat({ + width: scatterLineAttrs.width, + dash: { + valType: 'enumerated', + values: sortObjectKeys(DASHES), + dflt: 'solid', + } +}, colorAttributes('line')); + +function makeProjectionAttr(axLetter) { + return { + show: { + valType: 'boolean', + dflt: false, + }, + opacity: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + }, + scale: { + valType: 'number', + min: 0, + max: 10, + dflt: 2 / 3, + } + }; +} + +var attrs = module.exports = overrideAll({ + x: scatterAttrs.x, + y: scatterAttrs.y, + z: { + valType: 'data_array', + }, + + text: extendFlat({}, scatterAttrs.text, { + }), + texttemplate: texttemplateAttrs({}, { + + }), + hovertext: extendFlat({}, scatterAttrs.hovertext, { + }), + hovertemplate: hovertemplateAttrs(), + + xhoverformat: axisHoverFormat('x'), + yhoverformat: axisHoverFormat('y'), + zhoverformat: axisHoverFormat('z'), + + mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D? + {dflt: 'lines+markers'}), + surfaceaxis: { + valType: 'enumerated', + values: [-1, 0, 1, 2], + dflt: -1, + }, + surfacecolor: { + valType: 'color', + }, + projection: { + x: makeProjectionAttr('x'), + y: makeProjectionAttr('y'), + z: makeProjectionAttr('z') + }, + + connectgaps: scatterAttrs.connectgaps, + line: lineAttrs, + + marker: extendFlat({ // Parity with scatter.js? + symbol: { + valType: 'enumerated', + values: sortObjectKeys(MARKER_SYMBOLS), + dflt: 'circle', + arrayOk: true, + }, + size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}), + sizeref: scatterMarkerAttrs.sizeref, + sizemin: scatterMarkerAttrs.sizemin, + sizemode: scatterMarkerAttrs.sizemode, + opacity: extendFlat({}, scatterMarkerAttrs.opacity, { + arrayOk: false, + }), + colorbar: scatterMarkerAttrs.colorbar, + + line: extendFlat({ + width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false}) + }, + colorAttributes('marker.line') + ) + }, + colorAttributes('marker') + ), + + textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}), + textfont: { + color: scatterAttrs.textfont.color, + size: scatterAttrs.textfont.size, + family: extendFlat({}, scatterAttrs.textfont.family, {arrayOk: false}) + }, + + hoverinfo: extendFlat({}, baseAttrs.hoverinfo) +}, 'calc', 'nested'); + +attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; + +},{"../../components/colorscale/attributes":531,"../../constants/gl3d_dashes":634,"../../constants/gl3d_markers":635,"../../lib/extend":651,"../../lib/sort_object_keys":683,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../scatter/attributes":1064}],1093:[function(_dereq_,module,exports){ +'use strict'; + +var arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata'); +var calcColorscale = _dereq_('../scatter/colorscale_calc'); + +/** + * This is a kludge to put the array attributes into + * calcdata the way Scatter.plot does, so that legends and + * popovers know what to do with them. + */ +module.exports = function calc(gd, trace) { + var cd = [{x: false, y: false, trace: trace, t: {}}]; + + arraysToCalcdata(cd, trace); + calcColorscale(gd, trace); + + return cd; +}; + +},{"../scatter/arrays_to_calcdata":1063,"../scatter/colorscale_calc":1067}],1094:[function(_dereq_,module,exports){ +'use strict'; + +var Registry = _dereq_('../../registry'); + +function calculateAxisErrors(data, params, scaleFactor, axis) { + if(!params || !params.visible) return null; + + var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params); + var result = new Array(data.length); + + for(var i = 0; i < data.length; i++) { + var errors = computeError(+data[i], i); + + if(axis.type === 'log') { + var point = axis.c2l(data[i]); + var min = data[i] - errors[0]; + var max = data[i] + errors[1]; + + result[i] = [ + (axis.c2l(min, true) - point) * scaleFactor, + (axis.c2l(max, true) - point) * scaleFactor + ]; + + // Keep track of the lower error bound which isn't negative! + if(min > 0) { + var lower = axis.c2l(min); + if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower; + axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower); + } + } else { + result[i] = [ + -errors[0] * scaleFactor, + errors[1] * scaleFactor + ]; + } + } + + return result; +} + +function dataLength(array) { + for(var i = 0; i < array.length; i++) { + if(array[i]) return array[i].length; + } + return 0; +} + +function calculateErrors(data, scaleFactor, sceneLayout) { + var errors = [ + calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis), + calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis), + calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis) + ]; + + var n = dataLength(errors); + if(n === 0) return null; + + var errorBounds = new Array(n); + + for(var i = 0; i < n; i++) { + var bound = [[0, 0, 0], [0, 0, 0]]; + + for(var j = 0; j < 3; j++) { + if(errors[j]) { + for(var k = 0; k < 2; k++) { + bound[k][j] = errors[j][i][k]; + } + } + } + + errorBounds[i] = bound; + } + + return errorBounds; +} + +module.exports = calculateErrors; + +},{"../../registry":788}],1095:[function(_dereq_,module,exports){ +'use strict'; + +var createLinePlot = _dereq_('gl-line3d'); +var createScatterPlot = _dereq_('gl-scatter3d'); +var createErrorBars = _dereq_('gl-error3d'); +var createMesh = _dereq_('gl-mesh3d'); +var triangulate = _dereq_('delaunay-triangulate'); + +var Lib = _dereq_('../../lib'); +var str2RgbaArray = _dereq_('../../lib/str2rgbarray'); +var formatColor = _dereq_('../../lib/gl_format_color').formatColor; +var makeBubbleSizeFn = _dereq_('../scatter/make_bubble_size_func'); +var DASH_PATTERNS = _dereq_('../../constants/gl3d_dashes'); +var MARKER_SYMBOLS = _dereq_('../../constants/gl3d_markers'); + +var Axes = _dereq_('../../plots/cartesian/axes'); +var appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue; + +var calculateError = _dereq_('./calc_errors'); + +function LineWithMarkers(scene, uid) { + this.scene = scene; + this.uid = uid; + this.linePlot = null; + this.scatterPlot = null; + this.errorBars = null; + this.textMarkers = null; + this.delaunayMesh = null; + this.color = null; + this.mode = ''; + this.dataPoints = []; + this.axesBounds = [ + [-Infinity, -Infinity, -Infinity], + [Infinity, Infinity, Infinity] + ]; + this.textLabels = null; + this.data = null; +} + +var proto = LineWithMarkers.prototype; + +proto.handlePick = function(selection) { + if(selection.object && + (selection.object === this.linePlot || + selection.object === this.delaunayMesh || + selection.object === this.textMarkers || + selection.object === this.scatterPlot) + ) { + var ind = selection.index = selection.data.index; + + if(selection.object.highlight) { + selection.object.highlight(null); + } + if(this.scatterPlot) { + selection.object = this.scatterPlot; + this.scatterPlot.highlight(selection.data); + } + + selection.textLabel = ''; + if(this.textLabels) { + if(Array.isArray(this.textLabels)) { + if(this.textLabels[ind] || this.textLabels[ind] === 0) { + selection.textLabel = this.textLabels[ind]; + } + } else { + selection.textLabel = this.textLabels; + } + } + + selection.traceCoordinate = [ + this.data.x[ind], + this.data.y[ind], + this.data.z[ind] + ]; + + return true; + } +}; + +function constructDelaunay(points, color, axis) { + var u = (axis + 1) % 3; + var v = (axis + 2) % 3; + var filteredPoints = []; + var filteredIds = []; + var i; + + for(i = 0; i < points.length; ++i) { + var p = points[i]; + if(isNaN(p[u]) || !isFinite(p[u]) || + isNaN(p[v]) || !isFinite(p[v])) { + continue; + } + filteredPoints.push([p[u], p[v]]); + filteredIds.push(i); + } + var cells = triangulate(filteredPoints); + for(i = 0; i < cells.length; ++i) { + var c = cells[i]; + for(var j = 0; j < c.length; ++j) { + c[j] = filteredIds[c[j]]; + } + } + return { + positions: points, + cells: cells, + meshColor: color + }; +} + +function calculateErrorParams(errors) { + var capSize = [0.0, 0.0, 0.0]; + var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; + var lineWidth = [1.0, 1.0, 1.0]; + + for(var i = 0; i < 3; i++) { + var e = errors[i]; + + if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2]; + if(!e || !e.visible) continue; + + capSize[i] = e.width / 2; // ballpark rescaling + color[i] = str2RgbaArray(e.color); + lineWidth[i] = e.thickness; + } + + return {capSize: capSize, color: color, lineWidth: lineWidth}; +} + +function parseAlignmentX(a) { + if(a === null || a === undefined) return 0; + + return (a.indexOf('left') > -1) ? -1 : + (a.indexOf('right') > -1) ? 1 : 0; +} + +function parseAlignmentY(a) { + if(a === null || a === undefined) return 0; + + return (a.indexOf('top') > -1) ? -1 : + (a.indexOf('bottom') > -1) ? 1 : 0; +} + +function calculateTextOffset(tp) { + // Read out text properties + + var defaultAlignmentX = 0; + var defaultAlignmentY = 0; + + var textOffset = [ + defaultAlignmentX, + defaultAlignmentY + ]; + + if(Array.isArray(tp)) { + for(var i = 0; i < tp.length; i++) { + textOffset[i] = [ + defaultAlignmentX, + defaultAlignmentY + ]; + if(tp[i]) { + textOffset[i][0] = parseAlignmentX(tp[i]); + textOffset[i][1] = parseAlignmentY(tp[i]); + } + } + } else { + textOffset[0] = parseAlignmentX(tp); + textOffset[1] = parseAlignmentY(tp); + } + + return textOffset; +} + + +function calculateSize(sizeIn, sizeFn) { + // rough parity with Plotly 2D markers + return sizeFn(sizeIn * 4); +} + +function calculateSymbol(symbolIn) { + return MARKER_SYMBOLS[symbolIn]; +} + +function formatParam(paramIn, len, calculate, dflt, extraFn) { + var paramOut = null; + + if(Lib.isArrayOrTypedArray(paramIn)) { + paramOut = []; + + for(var i = 0; i < len; i++) { + if(paramIn[i] === undefined) paramOut[i] = dflt; + else paramOut[i] = calculate(paramIn[i], extraFn); + } + } else paramOut = calculate(paramIn, Lib.identity); + + return paramOut; +} + + +function convertPlotlyOptions(scene, data) { + var points = []; + var sceneLayout = scene.fullSceneLayout; + var scaleFactor = scene.dataScale; + var xaxis = sceneLayout.xaxis; + var yaxis = sceneLayout.yaxis; + var zaxis = sceneLayout.zaxis; + var marker = data.marker; + var line = data.line; + var x = data.x || []; + var y = data.y || []; + var z = data.z || []; + var len = x.length; + var xcalendar = data.xcalendar; + var ycalendar = data.ycalendar; + var zcalendar = data.zcalendar; + var xc, yc, zc; + var params, i; + var text; + + // Convert points + for(i = 0; i < len; i++) { + // sanitize numbers and apply transforms based on axes.type + xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0]; + yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1]; + zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2]; + + points[i] = [xc, yc, zc]; + } + + // convert text + if(Array.isArray(data.text)) text = data.text; + else if(data.text !== undefined) { + text = new Array(len); + for(i = 0; i < len; i++) text[i] = data.text; + } + + function formatter(axName, val) { + var ax = sceneLayout[axName]; + return Axes.tickText(ax, ax.d2l(val), true).text; + } + + // check texttemplate + var texttemplate = data.texttemplate; + if(texttemplate) { + var fullLayout = scene.fullLayout; + var d3locale = fullLayout._d3locale; + var isArray = Array.isArray(texttemplate); + var N = isArray ? Math.min(texttemplate.length, len) : len; + var txt = isArray ? + function(i) { return texttemplate[i]; } : + function() { return texttemplate; }; + + text = new Array(N); + + for(i = 0; i < N; i++) { + var d = {x: x[i], y: y[i], z: z[i]}; + var labels = { + xLabel: formatter('xaxis', x[i]), + yLabel: formatter('yaxis', y[i]), + zLabel: formatter('zaxis', z[i]) + }; + var pointValues = {}; + appendArrayPointValue(pointValues, data, i); + var meta = data._meta || {}; + text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta); + } + } + + // Build object parameters + params = { + position: points, + mode: data.mode, + text: text + }; + + if('line' in data) { + params.lineColor = formatColor(line, 1, len); + params.lineWidth = line.width; + params.lineDashes = line.dash; + } + + if('marker' in data) { + var sizeFn = makeBubbleSizeFn(data); + + params.scatterColor = formatColor(marker, 1, len); + params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn); + params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●'); + params.scatterLineWidth = marker.line.width; // arrayOk === false + params.scatterLineColor = formatColor(marker.line, 1, len); + params.scatterAngle = 0; + } + + if('textposition' in data) { + params.textOffset = calculateTextOffset(data.textposition); + params.textColor = formatColor(data.textfont, 1, len); + params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12); + params.textFont = data.textfont.family; // arrayOk === false + params.textAngle = 0; + } + + var dims = ['x', 'y', 'z']; + params.project = [false, false, false]; + params.projectScale = [1, 1, 1]; + params.projectOpacity = [1, 1, 1]; + for(i = 0; i < 3; ++i) { + var projection = data.projection[dims[i]]; + if((params.project[i] = projection.show)) { + params.projectOpacity[i] = projection.opacity; + params.projectScale[i] = projection.scale; + } + } + + params.errorBounds = calculateError(data, scaleFactor, sceneLayout); + + var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]); + params.errorColor = errorParams.color; + params.errorLineWidth = errorParams.lineWidth; + params.errorCapSize = errorParams.capSize; + + params.delaunayAxis = data.surfaceaxis; + params.delaunayColor = str2RgbaArray(data.surfacecolor); + + return params; +} + +function _arrayToColor(color) { + if(Lib.isArrayOrTypedArray(color)) { + var c = color[0]; + + if(Lib.isArrayOrTypedArray(c)) color = c; + + return 'rgb(' + color.slice(0, 3).map(function(x) { + return Math.round(x * 255); + }) + ')'; + } + + return null; +} + +function arrayToColor(colors) { + if(!Lib.isArrayOrTypedArray(colors)) { + return null; + } + + if((colors.length === 4) && (typeof colors[0] === 'number')) { + return _arrayToColor(colors); + } + + return colors.map(_arrayToColor); +} + +proto.update = function(data) { + var gl = this.scene.glplot.gl; + var lineOptions; + var scatterOptions; + var errorOptions; + var textOptions; + var dashPattern = DASH_PATTERNS.solid; + + // Save data + this.data = data; + + // Run data conversion + var options = convertPlotlyOptions(this.scene, data); + + if('mode' in options) { + this.mode = options.mode; + } + if('lineDashes' in options) { + if(options.lineDashes in DASH_PATTERNS) { + dashPattern = DASH_PATTERNS[options.lineDashes]; + } + } + + this.color = arrayToColor(options.scatterColor) || + arrayToColor(options.lineColor); + + // Save data points + this.dataPoints = options.position; + + lineOptions = { + gl: this.scene.glplot.gl, + position: options.position, + color: options.lineColor, + lineWidth: options.lineWidth || 1, + dashes: dashPattern[0], + dashScale: dashPattern[1], + opacity: data.opacity, + connectGaps: data.connectgaps + }; + + if(this.mode.indexOf('lines') !== -1) { + if(this.linePlot) this.linePlot.update(lineOptions); + else { + this.linePlot = createLinePlot(lineOptions); + this.linePlot._trace = this; + this.scene.glplot.add(this.linePlot); + } + } else if(this.linePlot) { + this.scene.glplot.remove(this.linePlot); + this.linePlot.dispose(); + this.linePlot = null; + } + + // N.B. marker.opacity must be a scalar for performance + var scatterOpacity = data.opacity; + if(data.marker && data.marker.opacity) scatterOpacity *= data.marker.opacity; + + scatterOptions = { + gl: this.scene.glplot.gl, + position: options.position, + color: options.scatterColor, + size: options.scatterSize, + glyph: options.scatterMarker, + opacity: scatterOpacity, + orthographic: true, + lineWidth: options.scatterLineWidth, + lineColor: options.scatterLineColor, + project: options.project, + projectScale: options.projectScale, + projectOpacity: options.projectOpacity + }; + + if(this.mode.indexOf('markers') !== -1) { + if(this.scatterPlot) this.scatterPlot.update(scatterOptions); + else { + this.scatterPlot = createScatterPlot(scatterOptions); + this.scatterPlot._trace = this; + this.scatterPlot.highlightScale = 1; + this.scene.glplot.add(this.scatterPlot); + } + } else if(this.scatterPlot) { + this.scene.glplot.remove(this.scatterPlot); + this.scatterPlot.dispose(); + this.scatterPlot = null; + } + + textOptions = { + gl: this.scene.glplot.gl, + position: options.position, + glyph: options.text, + color: options.textColor, + size: options.textSize, + angle: options.textAngle, + alignment: options.textOffset, + font: options.textFont, + orthographic: true, + lineWidth: 0, + project: false, + opacity: data.opacity + }; + + this.textLabels = data.hovertext || data.text; + + if(this.mode.indexOf('text') !== -1) { + if(this.textMarkers) this.textMarkers.update(textOptions); + else { + this.textMarkers = createScatterPlot(textOptions); + this.textMarkers._trace = this; + this.textMarkers.highlightScale = 1; + this.scene.glplot.add(this.textMarkers); + } + } else if(this.textMarkers) { + this.scene.glplot.remove(this.textMarkers); + this.textMarkers.dispose(); + this.textMarkers = null; + } + + errorOptions = { + gl: this.scene.glplot.gl, + position: options.position, + color: options.errorColor, + error: options.errorBounds, + lineWidth: options.errorLineWidth, + capSize: options.errorCapSize, + opacity: data.opacity + }; + if(this.errorBars) { + if(options.errorBounds) { + this.errorBars.update(errorOptions); + } else { + this.scene.glplot.remove(this.errorBars); + this.errorBars.dispose(); + this.errorBars = null; + } + } else if(options.errorBounds) { + this.errorBars = createErrorBars(errorOptions); + this.errorBars._trace = this; + this.scene.glplot.add(this.errorBars); + } + + if(options.delaunayAxis >= 0) { + var delaunayOptions = constructDelaunay( + options.position, + options.delaunayColor, + options.delaunayAxis + ); + delaunayOptions.opacity = data.opacity; + + if(this.delaunayMesh) { + this.delaunayMesh.update(delaunayOptions); + } else { + delaunayOptions.gl = gl; + this.delaunayMesh = createMesh(delaunayOptions); + this.delaunayMesh._trace = this; + this.scene.glplot.add(this.delaunayMesh); + } + } else if(this.delaunayMesh) { + this.scene.glplot.remove(this.delaunayMesh); + this.delaunayMesh.dispose(); + this.delaunayMesh = null; + } +}; + +proto.dispose = function() { + if(this.linePlot) { + this.scene.glplot.remove(this.linePlot); + this.linePlot.dispose(); + } + if(this.scatterPlot) { + this.scene.glplot.remove(this.scatterPlot); + this.scatterPlot.dispose(); + } + if(this.errorBars) { + this.scene.glplot.remove(this.errorBars); + this.errorBars.dispose(); + } + if(this.textMarkers) { + this.scene.glplot.remove(this.textMarkers); + this.textMarkers.dispose(); + } + if(this.delaunayMesh) { + this.scene.glplot.remove(this.delaunayMesh); + this.delaunayMesh.dispose(); + } +}; + +function createLineWithMarkers(scene, data) { + var plot = new LineWithMarkers(scene, data.uid); + plot.update(data); + return plot; +} + +module.exports = createLineWithMarkers; + +},{"../../components/fx/helpers":560,"../../constants/gl3d_dashes":634,"../../constants/gl3d_markers":635,"../../lib":661,"../../lib/gl_format_color":657,"../../lib/str2rgbarray":685,"../../plots/cartesian/axes":711,"../scatter/make_bubble_size_func":1081,"./calc_errors":1094,"delaunay-triangulate":152,"gl-error3d":177,"gl-line3d":185,"gl-mesh3d":219,"gl-scatter3d":237}],1096:[function(_dereq_,module,exports){ +'use strict'; + +var Registry = _dereq_('../../registry'); +var Lib = _dereq_('../../lib'); + +var subTypes = _dereq_('../scatter/subtypes'); +var handleMarkerDefaults = _dereq_('../scatter/marker_defaults'); +var handleLineDefaults = _dereq_('../scatter/line_defaults'); +var handleTextDefaults = _dereq_('../scatter/text_defaults'); + +var attributes = _dereq_('./attributes'); + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + var len = handleXYZDefaults(traceIn, traceOut, coerce, layout); + if(!len) { + traceOut.visible = false; + return; + } + + coerce('text'); + coerce('hovertext'); + coerce('hovertemplate'); + coerce('xhoverformat'); + coerce('yhoverformat'); + coerce('zhoverformat'); + + coerce('mode'); + + if(subTypes.hasLines(traceOut)) { + coerce('connectgaps'); + handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce); + } + + if(subTypes.hasMarkers(traceOut)) { + handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true}); + } + + if(subTypes.hasText(traceOut)) { + coerce('texttemplate'); + handleTextDefaults(traceIn, traceOut, layout, coerce, {noSelect: true}); + } + + var lineColor = (traceOut.line || {}).color; + var markerColor = (traceOut.marker || {}).color; + if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor); + + var dims = ['x', 'y', 'z']; + for(var i = 0; i < 3; ++i) { + var projection = 'projection.' + dims[i]; + if(coerce(projection + '.show')) { + coerce(projection + '.opacity'); + coerce(projection + '.scale'); + } + } + + var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults'); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'}); +}; + +function handleXYZDefaults(traceIn, traceOut, coerce, layout) { + var len = 0; + var x = coerce('x'); + var y = coerce('y'); + var z = coerce('z'); + + var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); + handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); + + if(x && y && z) { + // TODO: what happens if one is missing? + len = Math.min(x.length, y.length, z.length); + traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len; + } + + return len; +} + +},{"../../lib":661,"../../registry":788,"../scatter/line_defaults":1077,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1092}],1097:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + plot: _dereq_('./convert'), + attributes: _dereq_('./attributes'), + markerSymbols: _dereq_('../../constants/gl3d_markers'), + supplyDefaults: _dereq_('./defaults'), + colorbar: [ + { + container: 'marker', + min: 'cmin', + max: 'cmax' + }, { + container: 'line', + min: 'cmin', + max: 'cmax' + } + ], + calc: _dereq_('./calc'), + + moduleType: 'trace', + name: 'scatter3d', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'], + meta: { + } +}; + +},{"../../constants/gl3d_markers":635,"../../plots/gl3d":753,"./attributes":1092,"./calc":1093,"./convert":1095,"./defaults":1096}],1098:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -186706,7 +233639,7 @@ module.exports = { hovertemplate: hovertemplateAttrs() }; -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scatter/attributes":705}],734:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scatter/attributes":1064}],1099:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -186756,7 +233689,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../carpet/lookup_carpetid":522,"../scatter/arrays_to_calcdata":704,"../scatter/calc":706,"../scatter/calc_selection":707,"../scatter/colorscale_calc":708,"fast-isnumeric":81}],735:[function(_dereq_,module,exports){ +},{"../carpet/lookup_carpetid":858,"../scatter/arrays_to_calcdata":1063,"../scatter/calc":1065,"../scatter/calc_selection":1066,"../scatter/colorscale_calc":1067,"fast-isnumeric":159}],1100:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -186837,7 +233770,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":342,"../scatter/constants":709,"../scatter/fillcolor_defaults":713,"../scatter/line_defaults":718,"../scatter/line_shape_defaults":720,"../scatter/marker_defaults":724,"../scatter/subtypes":730,"../scatter/text_defaults":731,"./attributes":733}],736:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/constants":1068,"../scatter/fillcolor_defaults":1072,"../scatter/line_defaults":1077,"../scatter/line_shape_defaults":1079,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1098}],1101:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -186850,7 +233783,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],737:[function(_dereq_,module,exports){ +},{}],1102:[function(_dereq_,module,exports){ 'use strict'; module.exports = function formatLabels(cdi, trace) { @@ -186869,7 +233802,7 @@ module.exports = function formatLabels(cdi, trace) { return labels; }; -},{}],738:[function(_dereq_,module,exports){ +},{}],1103:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -186952,7 +233885,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../../lib":342,"../scatter/hover":716}],739:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/hover":1075}],1104:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -186976,7 +233909,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../scatter/marker_colorbar":723,"../scatter/select":727,"../scatter/style":729,"./attributes":733,"./calc":734,"./defaults":735,"./event_data":736,"./format_labels":737,"./hover":738,"./plot":740}],740:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../scatter/marker_colorbar":1082,"../scatter/select":1086,"../scatter/style":1088,"./attributes":1098,"./calc":1099,"./defaults":1100,"./event_data":1101,"./format_labels":1102,"./hover":1103,"./plot":1105}],1105:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -187011,7 +233944,7 @@ module.exports = function plot(gd, plotinfoproxy, data, layer) { } }; -},{"../../components/drawing":230,"../../plots/cartesian/axes":390,"../scatter/plot":726}],741:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../plots/cartesian/axes":711,"../scatter/plot":1085}],1106:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -187109,7 +234042,7 @@ module.exports = overrideAll({ hovertemplate: hovertemplateAttrs(), }, 'calc', 'nested'); -},{"../../components/colorscale/attributes":215,"../../components/drawing/attributes":229,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scatter/attributes":705}],742:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../components/drawing/attributes":545,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scatter/attributes":1064}],1107:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -187168,7 +234101,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../constants/numerical":319,"../../lib":342,"../scatter/arrays_to_calcdata":704,"../scatter/calc_selection":707,"../scatter/colorscale_calc":708,"fast-isnumeric":81}],743:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../scatter/arrays_to_calcdata":1063,"../scatter/calc_selection":1066,"../scatter/colorscale_calc":1067,"fast-isnumeric":159}],1108:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -187243,7 +234176,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":342,"../scatter/fillcolor_defaults":713,"../scatter/line_defaults":718,"../scatter/marker_defaults":724,"../scatter/subtypes":730,"../scatter/text_defaults":731,"./attributes":741}],744:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/fillcolor_defaults":1072,"../scatter/line_defaults":1077,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1106}],1109:[function(_dereq_,module,exports){ 'use strict'; @@ -187261,7 +234194,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],745:[function(_dereq_,module,exports){ +},{}],1110:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -187278,7 +234211,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":390}],746:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711}],1111:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -187382,7 +234315,7 @@ function getExtraText(trace, pt, pointData, labels) { return text.join('
'); } -},{"../../components/fx":248,"../../constants/numerical":319,"../../lib":342,"../scatter/get_trace_color":715,"./attributes":741}],747:[function(_dereq_,module,exports){ +},{"../../components/fx":564,"../../constants/numerical":637,"../../lib":661,"../scatter/get_trace_color":1074,"./attributes":1106}],1112:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -187407,7 +234340,7 @@ module.exports = { } }; -},{"../../plots/geo":423,"../scatter/marker_colorbar":723,"../scatter/style":729,"./attributes":741,"./calc":742,"./defaults":743,"./event_data":744,"./format_labels":745,"./hover":746,"./plot":748,"./select":749,"./style":750}],748:[function(_dereq_,module,exports){ +},{"../../plots/geo":744,"../scatter/marker_colorbar":1082,"../scatter/style":1088,"./attributes":1106,"./calc":1107,"./defaults":1108,"./event_data":1109,"./format_labels":1110,"./hover":1111,"./plot":1113,"./select":1114,"./style":1115}],1113:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -187528,7 +234461,7 @@ module.exports = { plot: plot }; -},{"../../constants/numerical":319,"../../lib":342,"../../lib/geo_location_utils":336,"../../lib/geojson_utils":337,"../../lib/topojson_utils":368,"../../plots/cartesian/autorange":389,"../scatter/calc":706,"../scatter/subtypes":730,"./style":750,"@plotly/d3":44}],749:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../lib/geo_location_utils":654,"../../lib/geojson_utils":655,"../../lib/topojson_utils":689,"../../plots/cartesian/autorange":710,"../scatter/calc":1065,"../scatter/subtypes":1089,"./style":1115,"@plotly/d3":54}],1114:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('../scatter/subtypes'); @@ -187577,7 +234510,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"../../constants/numerical":319,"../scatter/subtypes":730}],750:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../scatter/subtypes":1089}],1115:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -187618,7 +234551,7 @@ function styleTrace(gd, calcTrace) { }); } -},{"../../components/color":208,"../../components/drawing":230,"../scatter/style":729,"@plotly/d3":44}],751:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../scatter/style":1088,"@plotly/d3":54}],1116:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -187712,7 +234645,7 @@ module.exports = overrideAll({ hovertemplate: hovertemplateAttrs(), }, 'calc', 'nested'); -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plots/attributes":386,"../../plots/mapbox/layout_attributes":434,"../../plots/template_attributes":447,"../scatter/attributes":705,"../scattergeo/attributes":741}],752:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/mapbox/layout_attributes":770,"../../plots/template_attributes":783,"../scatter/attributes":1064,"../scattergeo/attributes":1106}],1117:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -188039,7 +234972,7 @@ function isBADNUM(lonlat) { return lonlat[0] === BADNUM; } -},{"../../components/colorscale":220,"../../components/drawing":230,"../../components/fx/helpers":244,"../../constants/numerical":319,"../../lib":342,"../../lib/geojson_utils":337,"../../lib/svg_text_utils":365,"../../plots/mapbox/convert_text_opts":431,"../scatter/make_bubble_size_func":722,"../scatter/subtypes":730,"fast-isnumeric":81}],753:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../components/drawing":546,"../../components/fx/helpers":560,"../../constants/numerical":637,"../../lib":661,"../../lib/geojson_utils":655,"../../lib/svg_text_utils":686,"../../plots/mapbox/convert_text_opts":767,"../scatter/make_bubble_size_func":1081,"../scatter/subtypes":1089,"fast-isnumeric":159}],1118:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -188109,7 +235042,7 @@ function handleLonLatDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../lib":342,"../scatter/fillcolor_defaults":713,"../scatter/line_defaults":718,"../scatter/marker_defaults":724,"../scatter/subtypes":730,"../scatter/text_defaults":731,"./attributes":751}],754:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/fillcolor_defaults":1072,"../scatter/line_defaults":1077,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1116}],1119:[function(_dereq_,module,exports){ 'use strict'; @@ -188120,7 +235053,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],755:[function(_dereq_,module,exports){ +},{}],1120:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -188138,7 +235071,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":390}],756:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711}],1121:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -188246,7 +235179,7 @@ module.exports = { getExtraText: getExtraText }; -},{"../../components/fx":248,"../../constants/numerical":319,"../../lib":342,"../scatter/get_trace_color":715}],757:[function(_dereq_,module,exports){ +},{"../../components/fx":564,"../../constants/numerical":637,"../../lib":661,"../scatter/get_trace_color":1074}],1122:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -188275,7 +235208,7 @@ module.exports = { } }; -},{"../../plots/mapbox":432,"../scatter/marker_colorbar":723,"../scattergeo/calc":742,"./attributes":751,"./defaults":753,"./event_data":754,"./format_labels":755,"./hover":756,"./plot":758,"./select":759}],758:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":768,"../scatter/marker_colorbar":1082,"../scattergeo/calc":1107,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./format_labels":1120,"./hover":1121,"./plot":1123,"./select":1124}],1123:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert'); @@ -188400,7 +235333,7 @@ module.exports = function createScatterMapbox(subplot, calcTrace) { return scatterMapbox; }; -},{"../../plots/mapbox/constants":430,"./convert":752}],759:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":766,"./convert":1117}],1124:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -188447,7 +235380,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"../../constants/numerical":319,"../../lib":342,"../scatter/subtypes":730}],760:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../scatter/subtypes":1089}],1125:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -188543,7 +235476,7 @@ module.exports = { unselected: scatterAttrs.unselected }; -},{"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scatter/attributes":705}],761:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scatter/attributes":1064}],1126:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -188589,7 +235522,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../constants/numerical":319,"../../plots/cartesian/axes":390,"../scatter/arrays_to_calcdata":704,"../scatter/calc":706,"../scatter/calc_selection":707,"../scatter/colorscale_calc":708,"fast-isnumeric":81}],762:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../plots/cartesian/axes":711,"../scatter/arrays_to_calcdata":1063,"../scatter/calc":1065,"../scatter/calc_selection":1066,"../scatter/colorscale_calc":1067,"fast-isnumeric":159}],1127:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -188688,7 +235621,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":342,"../scatter/constants":709,"../scatter/fillcolor_defaults":713,"../scatter/line_defaults":718,"../scatter/line_shape_defaults":720,"../scatter/marker_defaults":724,"../scatter/subtypes":730,"../scatter/text_defaults":731,"./attributes":760}],763:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/constants":1068,"../scatter/fillcolor_defaults":1072,"../scatter/line_defaults":1077,"../scatter/line_shape_defaults":1079,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1125}],1128:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -188722,7 +235655,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../lib":342,"../../plots/cartesian/axes":390}],764:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711}],1129:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -188790,7 +235723,7 @@ module.exports = { makeHoverPointText: makeHoverPointText }; -},{"../scatter/hover":716}],765:[function(_dereq_,module,exports){ +},{"../scatter/hover":1075}],1130:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -188814,7 +235747,7 @@ module.exports = { } }; -},{"../../plots/polar":441,"../scatter/marker_colorbar":723,"../scatter/select":727,"../scatter/style":729,"./attributes":760,"./calc":761,"./defaults":762,"./format_labels":763,"./hover":764,"./plot":766}],766:[function(_dereq_,module,exports){ +},{"../../plots/polar":777,"../scatter/marker_colorbar":1082,"../scatter/select":1086,"../scatter/style":1088,"./attributes":1125,"./calc":1126,"./defaults":1127,"./format_labels":1128,"./hover":1129,"./plot":1131}],1131:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -188856,7 +235789,7 @@ module.exports = function plot(gd, subplot, moduleCalcData) { scatterPlot(gd, plotinfo, moduleCalcData, mlayer); }; -},{"../../constants/numerical":319,"../scatter/plot":726}],767:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../scatter/plot":1085}],1132:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -188948,7 +235881,7 @@ module.exports = { hovertemplate: hovertemplateAttrs(), }; -},{"../../components/colorscale/attributes":215,"../../components/drawing/attributes":229,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scatter/attributes":705}],768:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../components/drawing/attributes":545,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scatter/attributes":1064}],1133:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -189020,7 +235953,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":704,"../scatter/calc":706,"../scatter/calc_selection":707,"../scatter/colorscale_calc":708,"fast-isnumeric":81}],769:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":1063,"../scatter/calc":1065,"../scatter/calc_selection":1066,"../scatter/colorscale_calc":1067,"fast-isnumeric":159}],1134:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -189115,7 +236048,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":342,"../scatter/constants":709,"../scatter/fillcolor_defaults":713,"../scatter/line_defaults":718,"../scatter/line_shape_defaults":720,"../scatter/marker_defaults":724,"../scatter/subtypes":730,"../scatter/text_defaults":731,"./attributes":767}],770:[function(_dereq_,module,exports){ +},{"../../lib":661,"../scatter/constants":1068,"../scatter/fillcolor_defaults":1072,"../scatter/line_defaults":1077,"../scatter/line_shape_defaults":1079,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1132}],1135:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -189139,7 +236072,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],771:[function(_dereq_,module,exports){ +},{}],1136:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -189155,7 +236088,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":390}],772:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":711}],1137:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -189221,7 +236154,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../scatter/hover":716}],773:[function(_dereq_,module,exports){ +},{"../scatter/hover":1075}],1138:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -189245,7 +236178,7 @@ module.exports = { } }; -},{"../../plots/ternary":448,"../scatter/marker_colorbar":723,"../scatter/select":727,"../scatter/style":729,"./attributes":767,"./calc":768,"./defaults":769,"./event_data":770,"./format_labels":771,"./hover":772,"./plot":774}],774:[function(_dereq_,module,exports){ +},{"../../plots/ternary":784,"../scatter/marker_colorbar":1082,"../scatter/select":1086,"../scatter/style":1088,"./attributes":1132,"./calc":1133,"./defaults":1134,"./event_data":1135,"./format_labels":1136,"./hover":1137,"./plot":1139}],1139:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -189269,7 +236202,709 @@ module.exports = function plot(gd, ternary, moduleCalcData) { scatterPlot(gd, plotinfo, moduleCalcData, scatterLayer); }; -},{"../scatter/plot":726}],775:[function(_dereq_,module,exports){ +},{"../scatter/plot":1085}],1140:[function(_dereq_,module,exports){ +'use strict'; + +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); +var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; +var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; +var mesh3dAttrs = _dereq_('../mesh3d/attributes'); +var baseAttrs = _dereq_('../../plots/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; + +var attrs = { + x: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + y: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + z: { + valType: 'data_array', + editType: 'calc+clearAxisTypes', + }, + + u: { + valType: 'data_array', + editType: 'calc', + }, + v: { + valType: 'data_array', + editType: 'calc', + }, + w: { + valType: 'data_array', + editType: 'calc', + }, + + starts: { + x: { + valType: 'data_array', + editType: 'calc', + }, + y: { + valType: 'data_array', + editType: 'calc', + }, + z: { + valType: 'data_array', + editType: 'calc', + }, + editType: 'calc' + }, + + maxdisplayed: { + valType: 'integer', + min: 0, + dflt: 1000, + editType: 'calc', + }, + + // TODO + // + // Should add 'absolute' (like cone traces have), but currently gl-streamtube3d's + // `absoluteTubeSize` doesn't behave well enough for our needs. + // + // 'fixed' would be a nice addition to plot stream 'lines', see + // https://github.com/plotly/plotly.js/commit/812be20750e21e0a1831975001c248d365850f73#r29129877 + // + // sizemode: { + // valType: 'enumerated', + // values: ['scaled', 'absolute', 'fixed'], + // dflt: 'scaled', + // editType: 'calc', + // + // }, + + sizeref: { + valType: 'number', + editType: 'calc', + min: 0, + dflt: 1, + }, + + text: { + valType: 'string', + dflt: '', + editType: 'calc', + }, + hovertext: { + valType: 'string', + dflt: '', + editType: 'calc', + }, + hovertemplate: hovertemplateAttrs({editType: 'calc'}, { + keys: [ + 'tubex', 'tubey', 'tubez', + 'tubeu', 'tubev', 'tubew', + 'norm', 'divergence' + ] + }), + uhoverformat: axisHoverFormat('u', 1), + vhoverformat: axisHoverFormat('v', 1), + whoverformat: axisHoverFormat('w', 1), + xhoverformat: axisHoverFormat('x'), + yhoverformat: axisHoverFormat('y'), + zhoverformat: axisHoverFormat('z'), + + showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) +}; + +extendFlat(attrs, colorScaleAttrs('', { + colorAttr: 'u/v/w norm', + showScaleDflt: true, + editTypeOverride: 'calc' +})); + +var fromMesh3d = ['opacity', 'lightposition', 'lighting']; +fromMesh3d.forEach(function(k) { + attrs[k] = mesh3dAttrs[k]; +}); + +attrs.hoverinfo = extendFlat({}, baseAttrs.hoverinfo, { + editType: 'calc', + flags: ['x', 'y', 'z', 'u', 'v', 'w', 'norm', 'divergence', 'text', 'name'], + dflt: 'x+y+z+norm+text+name' +}); + +attrs.transforms = undefined; + +module.exports = attrs; + +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../mesh3d/attributes":1016}],1141:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); +var colorscaleCalc = _dereq_('../../components/colorscale/calc'); + +function calc(gd, trace) { + trace._len = Math.min( + trace.u.length, + trace.v.length, + trace.w.length, + trace.x.length, + trace.y.length, + trace.z.length + ); + + trace._u = filter(trace.u, trace._len); + trace._v = filter(trace.v, trace._len); + trace._w = filter(trace.w, trace._len); + trace._x = filter(trace.x, trace._len); + trace._y = filter(trace.y, trace._len); + trace._z = filter(trace.z, trace._len); + + var grid = processGrid(trace); + trace._gridFill = grid.fill; + trace._Xs = grid.Xs; + trace._Ys = grid.Ys; + trace._Zs = grid.Zs; + trace._len = grid.len; + + var slen = 0; + var startx, starty, startz; + if(trace.starts) { + startx = filter(trace.starts.x || []); + starty = filter(trace.starts.y || []); + startz = filter(trace.starts.z || []); + slen = Math.min(startx.length, starty.length, startz.length); + } + trace._startsX = startx || []; + trace._startsY = starty || []; + trace._startsZ = startz || []; + + var normMax = 0; + var normMin = Infinity; + var i; + for(i = 0; i < trace._len; i++) { + var u = trace._u[i]; + var v = trace._v[i]; + var w = trace._w[i]; + var norm = Math.sqrt(u * u + v * v + w * w); + + normMax = Math.max(normMax, norm); + normMin = Math.min(normMin, norm); + } + + colorscaleCalc(gd, trace, { + vals: [normMin, normMax], + containerStr: '', + cLetter: 'c' + }); + + for(i = 0; i < slen; i++) { + var sx = startx[i]; + grid.xMax = Math.max(grid.xMax, sx); + grid.xMin = Math.min(grid.xMin, sx); + + var sy = starty[i]; + grid.yMax = Math.max(grid.yMax, sy); + grid.yMin = Math.min(grid.yMin, sy); + + var sz = startz[i]; + grid.zMax = Math.max(grid.zMax, sz); + grid.zMin = Math.min(grid.zMin, sz); + } + + trace._slen = slen; + trace._normMax = normMax; + trace._xbnds = [grid.xMin, grid.xMax]; + trace._ybnds = [grid.yMin, grid.yMax]; + trace._zbnds = [grid.zMin, grid.zMax]; +} + +function processGrid(trace) { + var x = trace._x; + var y = trace._y; + var z = trace._z; + var len = trace._len; + + var i, j, k; + + var xMax = -Infinity; + var xMin = Infinity; + var yMax = -Infinity; + var yMin = Infinity; + var zMax = -Infinity; + var zMin = Infinity; + + var gridFill = ''; + var filledX; + var filledY; + var filledZ; + var firstX, lastX; + var firstY, lastY; + var firstZ, lastZ; + if(len) { + firstX = x[0]; + firstY = y[0]; + firstZ = z[0]; + } + if(len > 1) { + lastX = x[len - 1]; + lastY = y[len - 1]; + lastZ = z[len - 1]; + } + + for(i = 0; i < len; i++) { + xMax = Math.max(xMax, x[i]); + xMin = Math.min(xMin, x[i]); + + yMax = Math.max(yMax, y[i]); + yMin = Math.min(yMin, y[i]); + + zMax = Math.max(zMax, z[i]); + zMin = Math.min(zMin, z[i]); + + if(!filledX && x[i] !== firstX) { + filledX = true; + gridFill += 'x'; + } + if(!filledY && y[i] !== firstY) { + filledY = true; + gridFill += 'y'; + } + if(!filledZ && z[i] !== firstZ) { + filledZ = true; + gridFill += 'z'; + } + } + // fill if not filled - case of having dimension(s) with one item + if(!filledX) gridFill += 'x'; + if(!filledY) gridFill += 'y'; + if(!filledZ) gridFill += 'z'; + + var Xs = distinctVals(trace._x); + var Ys = distinctVals(trace._y); + var Zs = distinctVals(trace._z); + + gridFill = gridFill.replace('x', (firstX > lastX ? '-' : '+') + 'x'); + gridFill = gridFill.replace('y', (firstY > lastY ? '-' : '+') + 'y'); + gridFill = gridFill.replace('z', (firstZ > lastZ ? '-' : '+') + 'z'); + + var empty = function() { + len = 0; + Xs = []; + Ys = []; + Zs = []; + }; + + // Over-specified mesh case, this would error in tube2mesh + if(!len || len < Xs.length * Ys.length * Zs.length) empty(); + + var getArray = function(c) { return c === 'x' ? x : c === 'y' ? y : z; }; + var getVals = function(c) { return c === 'x' ? Xs : c === 'y' ? Ys : Zs; }; + var getDir = function(c) { return c[len - 1] < c[0] ? -1 : 1; }; + + var arrK = getArray(gridFill[1]); + var arrJ = getArray(gridFill[3]); + var arrI = getArray(gridFill[5]); + var nk = getVals(gridFill[1]).length; + var nj = getVals(gridFill[3]).length; + var ni = getVals(gridFill[5]).length; + + var arbitrary = false; + + var getIndex = function(_i, _j, _k) { + return nk * (nj * _i + _j) + _k; + }; + + var dirK = getDir(getArray(gridFill[1])); + var dirJ = getDir(getArray(gridFill[3])); + var dirI = getDir(getArray(gridFill[5])); + + for(i = 0; i < ni - 1; i++) { + for(j = 0; j < nj - 1; j++) { + for(k = 0; k < nk - 1; k++) { + var q000 = getIndex(i, j, k); + var q001 = getIndex(i, j, k + 1); + var q010 = getIndex(i, j + 1, k); + var q100 = getIndex(i + 1, j, k); + + if( + !(arrK[q000] * dirK < arrK[q001] * dirK) || + !(arrJ[q000] * dirJ < arrJ[q010] * dirJ) || + !(arrI[q000] * dirI < arrI[q100] * dirI) + ) { + arbitrary = true; + } + + if(arbitrary) break; + } + if(arbitrary) break; + } + if(arbitrary) break; + } + + if(arbitrary) { + Lib.warn('Encountered arbitrary coordinates! Unable to input data grid.'); + empty(); + } + + return { + xMin: xMin, + yMin: yMin, + zMin: zMin, + xMax: xMax, + yMax: yMax, + zMax: zMax, + Xs: Xs, + Ys: Ys, + Zs: Zs, + len: len, + fill: gridFill + }; +} + +function distinctVals(col) { + return Lib.distinctVals(col).vals; +} + +function filter(arr, len) { + if(len === undefined) len = arr.length; + + // no need for casting typed arrays to numbers + if(Lib.isTypedArray(arr)) return arr.subarray(0, len); + + var values = []; + for(var i = 0; i < len; i++) { + values[i] = +arr[i]; + } + return values; +} + +module.exports = { + calc: calc, + filter: filter, + processGrid: processGrid +}; + +},{"../../components/colorscale/calc":532,"../../lib":661}],1142:[function(_dereq_,module,exports){ +'use strict'; + +var tube2mesh = _dereq_('gl-streamtube3d'); +var createTubeMesh = tube2mesh.createTubeMesh; + +var Lib = _dereq_('../../lib'); +var parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale; +var extractOpts = _dereq_('../../components/colorscale').extractOpts; +var zip3 = _dereq_('../../plots/gl3d/zip3'); + +var axisName2scaleIndex = {xaxis: 0, yaxis: 1, zaxis: 2}; + +function Streamtube(scene, uid) { + this.scene = scene; + this.uid = uid; + this.mesh = null; + this.data = null; +} + +var proto = Streamtube.prototype; + +proto.handlePick = function(selection) { + var sceneLayout = this.scene.fullSceneLayout; + var dataScale = this.scene.dataScale; + + function fromDataScale(v, axisName) { + var ax = sceneLayout[axisName]; + var scale = dataScale[axisName2scaleIndex[axisName]]; + return ax.l2c(v) / scale; + } + + if(selection.object === this.mesh) { + var pos = selection.data.position; + var uvx = selection.data.velocity; + + selection.traceCoordinate = [ + fromDataScale(pos[0], 'xaxis'), + fromDataScale(pos[1], 'yaxis'), + fromDataScale(pos[2], 'zaxis'), + + fromDataScale(uvx[0], 'xaxis'), + fromDataScale(uvx[1], 'yaxis'), + fromDataScale(uvx[2], 'zaxis'), + + // u/v/w norm + selection.data.intensity * this.data._normMax, + // divergence + selection.data.divergence + ]; + + selection.textLabel = this.data.hovertext || this.data.text; + + return true; + } +}; + +function getDfltStartingPositions(vec) { + var len = vec.length; + var s; + + if(len > 2) { + s = vec.slice(1, len - 1); + } else if(len === 2) { + s = [(vec[0] + vec[1]) / 2]; + } else { + s = vec; + } + return s; +} + +function getBoundPads(vec) { + var len = vec.length; + if(len === 1) { + return [0.5, 0.5]; + } else { + return [vec[1] - vec[0], vec[len - 1] - vec[len - 2]]; + } +} + +function convert(scene, trace) { + var sceneLayout = scene.fullSceneLayout; + var dataScale = scene.dataScale; + var len = trace._len; + var tubeOpts = {}; + + function toDataCoords(arr, axisName) { + var ax = sceneLayout[axisName]; + var scale = dataScale[axisName2scaleIndex[axisName]]; + return Lib.simpleMap(arr, function(v) { return ax.d2l(v) * scale; }); + } + + tubeOpts.vectors = zip3( + toDataCoords(trace._u, 'xaxis'), + toDataCoords(trace._v, 'yaxis'), + toDataCoords(trace._w, 'zaxis'), + len + ); + + // Over-specified mesh case, this would error in tube2mesh + if(!len) { + return { + positions: [], + cells: [] + }; + } + + var meshx = toDataCoords(trace._Xs, 'xaxis'); + var meshy = toDataCoords(trace._Ys, 'yaxis'); + var meshz = toDataCoords(trace._Zs, 'zaxis'); + + tubeOpts.meshgrid = [meshx, meshy, meshz]; + tubeOpts.gridFill = trace._gridFill; + + var slen = trace._slen; + if(slen) { + tubeOpts.startingPositions = zip3( + toDataCoords(trace._startsX, 'xaxis'), + toDataCoords(trace._startsY, 'yaxis'), + toDataCoords(trace._startsZ, 'zaxis') + ); + } else { + // Default starting positions: + // + // if len>2, cut xz plane at min-y, + // takes all x/y/z pts on that plane except those on the edges + // to generate "well-defined" tubes, + // + // if len=2, take position halfway between two the pts, + // + // if len=1, take that pt + var sy0 = meshy[0]; + var sx = getDfltStartingPositions(meshx); + var sz = getDfltStartingPositions(meshz); + var startingPositions = new Array(sx.length * sz.length); + var m = 0; + + for(var i = 0; i < sx.length; i++) { + for(var k = 0; k < sz.length; k++) { + startingPositions[m++] = [sx[i], sy0, sz[k]]; + } + } + tubeOpts.startingPositions = startingPositions; + } + + tubeOpts.colormap = parseColorScale(trace); + tubeOpts.tubeSize = trace.sizeref; + tubeOpts.maxLength = trace.maxdisplayed; + + // add some padding around the bounds + // to e.g. allow tubes starting from a slice of the x/y/z mesh + // to go beyond bounds a little bit w/o getting clipped + var xbnds = toDataCoords(trace._xbnds, 'xaxis'); + var ybnds = toDataCoords(trace._ybnds, 'yaxis'); + var zbnds = toDataCoords(trace._zbnds, 'zaxis'); + var xpads = getBoundPads(meshx); + var ypads = getBoundPads(meshy); + var zpads = getBoundPads(meshz); + + var bounds = [ + [xbnds[0] - xpads[0], ybnds[0] - ypads[0], zbnds[0] - zpads[0]], + [xbnds[1] + xpads[1], ybnds[1] + ypads[1], zbnds[1] + zpads[1]] + ]; + + var meshData = tube2mesh(tubeOpts, bounds); + + // N.B. cmin/cmax correspond to the min/max vector norm + // in the u/v/w arrays, which in general is NOT equal to max + // intensity that colors the tubes. + var cOpts = extractOpts(trace); + meshData.vertexIntensityBounds = [cOpts.min / trace._normMax, cOpts.max / trace._normMax]; + + // pass gl-mesh3d lighting attributes + var lp = trace.lightposition; + meshData.lightPosition = [lp.x, lp.y, lp.z]; + meshData.ambient = trace.lighting.ambient; + meshData.diffuse = trace.lighting.diffuse; + meshData.specular = trace.lighting.specular; + meshData.roughness = trace.lighting.roughness; + meshData.fresnel = trace.lighting.fresnel; + meshData.opacity = trace.opacity; + + // stash autorange pad value + trace._pad = meshData.tubeScale * trace.sizeref * 2; + + return meshData; +} + +proto.update = function(data) { + this.data = data; + + var meshData = convert(this.scene, data); + this.mesh.update(meshData); +}; + +proto.dispose = function() { + this.scene.glplot.remove(this.mesh); + this.mesh.dispose(); +}; + +function createStreamtubeTrace(scene, data) { + var gl = scene.glplot.gl; + + var meshData = convert(scene, data); + var mesh = createTubeMesh(gl, meshData); + + var streamtube = new Streamtube(scene, data.uid); + streamtube.mesh = mesh; + streamtube.data = data; + mesh._trace = streamtube; + + scene.glplot.add(mesh); + + return streamtube; +} + +module.exports = createStreamtubeTrace; + +},{"../../components/colorscale":536,"../../lib":661,"../../lib/gl_format_color":657,"../../plots/gl3d/zip3":764,"gl-streamtube3d":254}],1143:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); + +var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); +var attributes = _dereq_('./attributes'); + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + var u = coerce('u'); + var v = coerce('v'); + var w = coerce('w'); + + var x = coerce('x'); + var y = coerce('y'); + var z = coerce('z'); + + if( + !u || !u.length || !v || !v.length || !w || !w.length || + !x || !x.length || !y || !y.length || !z || !z.length + ) { + traceOut.visible = false; + return; + } + + coerce('starts.x'); + coerce('starts.y'); + coerce('starts.z'); + + coerce('maxdisplayed'); + coerce('sizeref'); + + coerce('lighting.ambient'); + coerce('lighting.diffuse'); + coerce('lighting.specular'); + coerce('lighting.roughness'); + coerce('lighting.fresnel'); + coerce('lightposition.x'); + coerce('lightposition.y'); + coerce('lightposition.z'); + + colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}); + + coerce('text'); + coerce('hovertext'); + coerce('hovertemplate'); + coerce('uhoverformat'); + coerce('vhoverformat'); + coerce('whoverformat'); + coerce('xhoverformat'); + coerce('yhoverformat'); + coerce('zhoverformat'); + + // disable 1D transforms (for now) + // x/y/z and u/v/w have matching lengths, + // but they don't have to match with starts.(x|y|z) + traceOut._length = null; +}; + +},{"../../components/colorscale/defaults":534,"../../lib":661,"./attributes":1140}],1144:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + moduleType: 'trace', + name: 'streamtube', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', 'showLegend'], + + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + calc: _dereq_('./calc').calc, + plot: _dereq_('./convert'), + eventData: function(out, pt) { + out.tubex = out.x; + out.tubey = out.y; + out.tubez = out.z; + + out.tubeu = pt.traceCoordinate[3]; + out.tubev = pt.traceCoordinate[4]; + out.tubew = pt.traceCoordinate[5]; + + out.norm = pt.traceCoordinate[6]; + out.divergence = pt.traceCoordinate[7]; + + // Does not correspond to input x/y/z, so delete them + delete out.x; + delete out.y; + delete out.z; + + return out; + }, + + meta: { + } +}; + +},{"../../plots/gl3d":753,"./attributes":1140,"./calc":1141,"./convert":1142,"./defaults":1143}],1145:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -189422,7 +237057,7 @@ module.exports = { domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'}) }; -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683,"./constants":778}],776:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/domain":739,"../../plots/template_attributes":783,"../pie/attributes":1038,"./constants":1148}],1146:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -189437,7 +237072,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":438}],777:[function(_dereq_,module,exports){ +},{"../../plots/plots":774}],1147:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -189758,7 +237393,7 @@ function countDescendants(node, trace, opts) { return nChild; } -},{"../../components/colorscale":220,"../../constants/numerical":319,"../../lib":342,"../pie/calc":685,"d3-hierarchy":71,"fast-isnumeric":81}],778:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../constants/numerical":637,"../../lib":661,"../pie/calc":1040,"d3-hierarchy":142,"fast-isnumeric":159}],1148:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -189778,7 +237413,7 @@ module.exports = { ] }; -},{}],779:[function(_dereq_,module,exports){ +},{}],1149:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -189858,7 +237493,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale":220,"../../lib":342,"../../plots/domain":418,"../bar/defaults":466,"./attributes":775}],780:[function(_dereq_,module,exports){ +},{"../../components/colorscale":536,"../../lib":661,"../../plots/domain":739,"../bar/defaults":802,"./attributes":1145}],1150:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -190174,7 +237809,7 @@ function makeEventData(pt, trace, keys) { return out; } -},{"../../components/fx":248,"../../components/fx/helpers":244,"../../lib":342,"../../lib/events":332,"../../registry":452,"../pie/helpers":688,"./helpers":781,"@plotly/d3":44}],781:[function(_dereq_,module,exports){ +},{"../../components/fx":564,"../../components/fx/helpers":560,"../../lib":661,"../../lib/events":650,"../../registry":788,"../pie/helpers":1043,"./helpers":1151,"@plotly/d3":54}],1151:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -190351,7 +237986,7 @@ exports.formatPercent = function(v, separators) { return tx; }; -},{"../../components/color":208,"../../lib":342,"../../lib/setcursor":362,"../pie/helpers":688}],782:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../../lib/setcursor":681,"../pie/helpers":1043}],1152:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -190378,7 +238013,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":723,"./attributes":775,"./base_plot":776,"./calc":777,"./defaults":779,"./layout_attributes":783,"./layout_defaults":784,"./plot":785,"./style":786}],783:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1082,"./attributes":1145,"./base_plot":1146,"./calc":1147,"./defaults":1149,"./layout_attributes":1153,"./layout_defaults":1154,"./plot":1155,"./style":1156}],1153:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -190393,7 +238028,7 @@ module.exports = { } }; -},{}],784:[function(_dereq_,module,exports){ +},{}],1154:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -190407,7 +238042,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendsunburstcolors'); }; -},{"../../lib":342,"./layout_attributes":783}],785:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":1153}],1155:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -191042,7 +238677,7 @@ function getCoords(r, angle) { return [r * Math.sin(angle), -r * Math.cos(angle)]; } -},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../bar/style":476,"../bar/uniform_text":478,"../pie/helpers":688,"../pie/plot":692,"./constants":778,"./fx":780,"./helpers":781,"./style":786,"@plotly/d3":44,"d3-hierarchy":71,"d3-interpolate":72}],786:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../bar/style":812,"../bar/uniform_text":814,"../pie/helpers":1043,"../pie/plot":1047,"./constants":1148,"./fx":1150,"./helpers":1151,"./style":1156,"@plotly/d3":54,"d3-hierarchy":142,"d3-interpolate":143}],1156:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -191085,7 +238720,1127 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":208,"../../lib":342,"../bar/uniform_text":478,"@plotly/d3":44}],787:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../bar/uniform_text":814,"@plotly/d3":54}],1157:[function(_dereq_,module,exports){ +'use strict'; + +var Color = _dereq_('../../components/color'); +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); +var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; +var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; +var baseAttrs = _dereq_('../../plots/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; + +function makeContourProjAttr(axLetter) { + return { + valType: 'boolean', + dflt: false, + }; +} + +function makeContourAttr(axLetter) { + return { + show: { + valType: 'boolean', + dflt: false, + }, + start: { + valType: 'number', + dflt: null, + editType: 'plot', + // impliedEdits: {'^autocontour': false}, + }, + end: { + valType: 'number', + dflt: null, + editType: 'plot', + // impliedEdits: {'^autocontour': false}, + }, + size: { + valType: 'number', + dflt: null, + min: 0, + editType: 'plot', + // impliedEdits: {'^autocontour': false}, + }, + project: { + x: makeContourProjAttr('x'), + y: makeContourProjAttr('y'), + z: makeContourProjAttr('z') + }, + color: { + valType: 'color', + dflt: Color.defaultLine, + }, + usecolormap: { + valType: 'boolean', + dflt: false, + }, + width: { + valType: 'number', + min: 1, + max: 16, + dflt: 2, + }, + highlight: { + valType: 'boolean', + dflt: true, + }, + highlightcolor: { + valType: 'color', + dflt: Color.defaultLine, + }, + highlightwidth: { + valType: 'number', + min: 1, + max: 16, + dflt: 2, + } + }; +} + +var attrs = module.exports = overrideAll(extendFlat({ + z: { + valType: 'data_array', + }, + x: { + valType: 'data_array', + }, + y: { + valType: 'data_array', + }, + + text: { + valType: 'string', + dflt: '', + arrayOk: true, + }, + hovertext: { + valType: 'string', + dflt: '', + arrayOk: true, + }, + hovertemplate: hovertemplateAttrs(), + + xhoverformat: axisHoverFormat('x'), + yhoverformat: axisHoverFormat('y'), + zhoverformat: axisHoverFormat('z'), + + connectgaps: { + valType: 'boolean', + dflt: false, + editType: 'calc', + }, + + surfacecolor: { + valType: 'data_array', + }, +}, + +colorScaleAttrs('', { + colorAttr: 'z or surfacecolor', + showScaleDflt: true, + autoColorDflt: false, + editTypeOverride: 'calc' +}), { + contours: { + x: makeContourAttr('x'), + y: makeContourAttr('y'), + z: makeContourAttr('z') + }, + hidesurface: { + valType: 'boolean', + dflt: false, + }, + + 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.00, + max: 1.0, + dflt: 0.8, + }, + diffuse: { + valType: 'number', + min: 0.00, + max: 1.00, + dflt: 0.8, + }, + specular: { + valType: 'number', + min: 0.00, + max: 2.00, + dflt: 0.05, + }, + roughness: { + valType: 'number', + min: 0.00, + max: 1.00, + dflt: 0.5, + }, + fresnel: { + valType: 'number', + min: 0.00, + max: 5.00, + dflt: 0.2, + } + }, + + opacity: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + }, + + opacityscale: { + valType: 'any', + editType: 'calc', + }, + + _deprecated: { + zauto: extendFlat({}, colorScaleAttrs.zauto, { + }), + zmin: extendFlat({}, colorScaleAttrs.zmin, { + }), + zmax: extendFlat({}, colorScaleAttrs.zmax, { + }) + }, + + hoverinfo: extendFlat({}, baseAttrs.hoverinfo), + showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}), +}), 'calc', 'nested'); + +attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; +attrs.transforms = undefined; + +},{"../../components/color":524,"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783}],1158:[function(_dereq_,module,exports){ +'use strict'; + +var colorscaleCalc = _dereq_('../../components/colorscale/calc'); + + +// Compute auto-z and autocolorscale if applicable +module.exports = function calc(gd, trace) { + if(trace.surfacecolor) { + colorscaleCalc(gd, trace, { + vals: trace.surfacecolor, + containerStr: '', + cLetter: 'c' + }); + } else { + colorscaleCalc(gd, trace, { + vals: trace.z, + containerStr: '', + cLetter: 'c' + }); + } +}; + +},{"../../components/colorscale/calc":532}],1159:[function(_dereq_,module,exports){ +'use strict'; + +var createSurface = _dereq_('gl-surface3d'); + +var ndarray = _dereq_('ndarray'); +var ndarrayInterp2d = _dereq_('ndarray-linear-interpolate').d2; + +var interp2d = _dereq_('../heatmap/interp2d'); +var findEmpties = _dereq_('../heatmap/find_empties'); + +var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; +var parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale; +var str2RgbaArray = _dereq_('../../lib/str2rgbarray'); +var extractOpts = _dereq_('../../components/colorscale').extractOpts; + +function SurfaceTrace(scene, surface, uid) { + this.scene = scene; + this.uid = uid; + this.surface = surface; + this.data = null; + this.showContour = [false, false, false]; + this.contourStart = [null, null, null]; + this.contourEnd = [null, null, null]; + this.contourSize = [0, 0, 0]; + this.minValues = [Infinity, Infinity, Infinity]; + this.maxValues = [-Infinity, -Infinity, -Infinity]; + this.dataScaleX = 1.0; + this.dataScaleY = 1.0; + this.refineData = true; + this.objectOffset = [0, 0, 0]; +} + +var proto = SurfaceTrace.prototype; + +proto.getXat = function(a, b, calendar, axis) { + var v = ( + (!isArrayOrTypedArray(this.data.x)) ? + a : + (isArrayOrTypedArray(this.data.x[0])) ? + this.data.x[b][a] : + this.data.x[a] + ); + + return (calendar === undefined) ? v : axis.d2l(v, 0, calendar); +}; + +proto.getYat = function(a, b, calendar, axis) { + var v = ( + (!isArrayOrTypedArray(this.data.y)) ? + b : + (isArrayOrTypedArray(this.data.y[0])) ? + this.data.y[b][a] : + this.data.y[b] + ); + + return (calendar === undefined) ? v : axis.d2l(v, 0, calendar); +}; + +proto.getZat = function(a, b, calendar, axis) { + var v = this.data.z[b][a]; + + if(v === null && this.data.connectgaps && this.data._interpolatedZ) { + v = this.data._interpolatedZ[b][a]; + } + + return (calendar === undefined) ? v : axis.d2l(v, 0, calendar); +}; + +proto.handlePick = function(selection) { + if(selection.object === this.surface) { + var xRatio = (selection.data.index[0] - 1) / this.dataScaleX - 1; + var yRatio = (selection.data.index[1] - 1) / this.dataScaleY - 1; + + var j = Math.max(Math.min(Math.round(xRatio), this.data.z[0].length - 1), 0); + var k = Math.max(Math.min(Math.round(yRatio), this.data._ylength - 1), 0); + + selection.index = [j, k]; + + selection.traceCoordinate = [ + this.getXat(j, k), + this.getYat(j, k), + this.getZat(j, k) + ]; + + selection.dataCoordinate = [ + this.getXat(j, k, this.data.xcalendar, this.scene.fullSceneLayout.xaxis), + this.getYat(j, k, this.data.ycalendar, this.scene.fullSceneLayout.yaxis), + this.getZat(j, k, this.data.zcalendar, this.scene.fullSceneLayout.zaxis) + ]; + + for(var i = 0; i < 3; i++) { + var v = selection.dataCoordinate[i]; + if(v !== null && v !== undefined) { + selection.dataCoordinate[i] *= this.scene.dataScale[i]; + } + } + + var text = this.data.hovertext || this.data.text; + if(Array.isArray(text) && text[k] && text[k][j] !== undefined) { + selection.textLabel = text[k][j]; + } else if(text) { + selection.textLabel = text; + } else { + selection.textLabel = ''; + } + + selection.data.dataCoordinate = selection.dataCoordinate.slice(); + + this.surface.highlight(selection.data); + + // Snap spikes to data coordinate + this.scene.glplot.spikes.position = selection.dataCoordinate; + + return true; + } +}; + +function isColormapCircular(colormap) { + var first = colormap[0].rgb; + var last = colormap[colormap.length - 1].rgb; + + return ( + first[0] === last[0] && + first[1] === last[1] && + first[2] === last[2] && + first[3] === last[3] + ); +} + +var shortPrimes = [ + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, + 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, + 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, + 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, + 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, + 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, + 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, + 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, + 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, + 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, + 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, + 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, + 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, + 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, + 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, + 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, + 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, + 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, + 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, + 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, + 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, + 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, + 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, + 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, + 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, + 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, + 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, + 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, + 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, + 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999 +]; + +function getPow(a, b) { + if(a < b) return 0; + var n = 0; + while(Math.floor(a % b) === 0) { + a /= b; + n++; + } + return n; +} + +function getFactors(a) { + var powers = []; + for(var i = 0; i < shortPrimes.length; i++) { + var b = shortPrimes[i]; + powers.push( + getPow(a, b) + ); + } + return powers; +} + +function smallestDivisor(a) { + var A = getFactors(a); + var result = a; + for(var i = 0; i < shortPrimes.length; i++) { + if(A[i] > 0) { + result = shortPrimes[i]; + break; + } + } + return result; +} + +function leastCommonMultiple(a, b) { + if(a < 1 || b < 1) return undefined; + var A = getFactors(a); + var B = getFactors(b); + var n = 1; + for(var i = 0; i < shortPrimes.length; i++) { + n *= Math.pow( + shortPrimes[i], Math.max(A[i], B[i]) + ); + } + return n; +} + +function arrayLCM(A) { + if(A.length === 0) return undefined; + var n = 1; + for(var i = 0; i < A.length; i++) { + n = leastCommonMultiple(n, A[i]); + } + return n; +} + +proto.calcXnums = function(xlen) { + var i; + var nums = []; + for(i = 1; i < xlen; i++) { + var a = this.getXat(i - 1, 0); + var b = this.getXat(i, 0); + + if(b !== a && + a !== undefined && a !== null && + b !== undefined && b !== null) { + nums[i - 1] = Math.abs(b - a); + } else { + nums[i - 1] = 0; + } + } + + var totalDist = 0; + for(i = 1; i < xlen; i++) { + totalDist += nums[i - 1]; + } + + for(i = 1; i < xlen; i++) { + if(nums[i - 1] === 0) { + nums[i - 1] = 1; + } else { + nums[i - 1] = Math.round(totalDist / nums[i - 1]); + } + } + + return nums; +}; + +proto.calcYnums = function(ylen) { + var i; + var nums = []; + for(i = 1; i < ylen; i++) { + var a = this.getYat(0, i - 1); + var b = this.getYat(0, i); + + if(b !== a && + a !== undefined && a !== null && + b !== undefined && b !== null) { + nums[i - 1] = Math.abs(b - a); + } else { + nums[i - 1] = 0; + } + } + + var totalDist = 0; + for(i = 1; i < ylen; i++) { + totalDist += nums[i - 1]; + } + + for(i = 1; i < ylen; i++) { + if(nums[i - 1] === 0) { + nums[i - 1] = 1; + } else { + nums[i - 1] = Math.round(totalDist / nums[i - 1]); + } + } + + return nums; +}; + +var highlyComposites = [1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, 840, 1260]; + +var MIN_RESOLUTION = highlyComposites[9]; +var MAX_RESOLUTION = highlyComposites[13]; + +proto.estimateScale = function(resSrc, axis) { + var nums = (axis === 0) ? + this.calcXnums(resSrc) : + this.calcYnums(resSrc); + + var resDst = 1 + arrayLCM(nums); + + while(resDst < MIN_RESOLUTION) { + resDst *= 2; + } + + while(resDst > MAX_RESOLUTION) { + resDst--; + resDst /= smallestDivisor(resDst); + resDst++; + + if(resDst < MIN_RESOLUTION) { + // resDst = MIN_RESOLUTION; // option 1: use min resolution + resDst = MAX_RESOLUTION; // option 2: use max resolution + } + } + + var scale = Math.round(resDst / resSrc); + return (scale > 1) ? scale : 1; +}; + +// based on Mikola Lysenko's ndarray-homography +// see https://github.com/scijs/ndarray-homography + +function fnHomography(out, inp, X) { + var w = X[8] + X[2] * inp[0] + X[5] * inp[1]; + out[0] = (X[6] + X[0] * inp[0] + X[3] * inp[1]) / w; + out[1] = (X[7] + X[1] * inp[0] + X[4] * inp[1]) / w; + return out; +} + +function homography(dest, src, X) { + warp(dest, src, fnHomography, X); + return dest; +} + +// based on Mikola Lysenko's ndarray-warp +// see https://github.com/scijs/ndarray-warp + +function warp(dest, src, func, X) { + var warped = [0, 0]; + var ni = dest.shape[0]; + var nj = dest.shape[1]; + for(var i = 0; i < ni; i++) { + for(var j = 0; j < nj; j++) { + func(warped, [i, j], X); + dest.set(i, j, ndarrayInterp2d(src, warped[0], warped[1])); + } + } + return dest; +} + +proto.refineCoords = function(coords) { + var scaleW = this.dataScaleX; + var scaleH = this.dataScaleY; + + var width = coords[0].shape[0]; + var height = coords[0].shape[1]; + + var newWidth = Math.floor(coords[0].shape[0] * scaleW + 1) | 0; + var newHeight = Math.floor(coords[0].shape[1] * scaleH + 1) | 0; + + // Pad coords by +1 + var padWidth = 1 + width + 1; + var padHeight = 1 + height + 1; + var padImg = ndarray(new Float32Array(padWidth * padHeight), [padWidth, padHeight]); + var X = [ + 1 / scaleW, 0, 0, + 0, 1 / scaleH, 0, + 0, 0, 1 + ]; + + for(var i = 0; i < coords.length; ++i) { + this.surface.padField(padImg, coords[i]); + + var scaledImg = ndarray(new Float32Array(newWidth * newHeight), [newWidth, newHeight]); + homography(scaledImg, padImg, X); + coords[i] = scaledImg; + } +}; + +function insertIfNewLevel(arr, newValue) { + var found = false; + for(var k = 0; k < arr.length; k++) { + if(newValue === arr[k]) { + found = true; + break; + } + } + if(found === false) arr.push(newValue); +} + +proto.setContourLevels = function() { + var newLevels = [[], [], []]; + var useNewLevels = [false, false, false]; + var needsUpdate = false; + + var i, j, value; + + for(i = 0; i < 3; ++i) { + if(this.showContour[i]) { + needsUpdate = true; + + if( + this.contourSize[i] > 0 && + this.contourStart[i] !== null && + this.contourEnd[i] !== null && + this.contourEnd[i] > this.contourStart[i] + ) { + useNewLevels[i] = true; + + for(j = this.contourStart[i]; j < this.contourEnd[i]; j += this.contourSize[i]) { + value = j * this.scene.dataScale[i]; + + insertIfNewLevel(newLevels[i], value); + } + } + } + } + + if(needsUpdate) { + var allLevels = [[], [], []]; + for(i = 0; i < 3; ++i) { + if(this.showContour[i]) { + allLevels[i] = useNewLevels[i] ? newLevels[i] : this.scene.contourLevels[i]; + } + } + this.surface.update({ levels: allLevels }); + } +}; + +proto.update = function(data) { + var scene = this.scene; + var sceneLayout = scene.fullSceneLayout; + var surface = this.surface; + var colormap = parseColorScale(data); + var scaleFactor = scene.dataScale; + var xlen = data.z[0].length; + var ylen = data._ylength; + var contourLevels = scene.contourLevels; + + // Save data + this.data = data; + + /* + * Fill and transpose zdata. + * Consistent with 'heatmap' and 'contour', plotly 'surface' + * 'z' are such that sub-arrays correspond to y-coords + * and that the sub-array entries correspond to a x-coords, + * which is the transpose of 'gl-surface-plot'. + */ + + var i, j, k, v; + var rawCoords = []; + for(i = 0; i < 3; i++) { + rawCoords[i] = []; + for(j = 0; j < xlen; j++) { + rawCoords[i][j] = []; + /* + for(k = 0; k < ylen; k++) { + rawCoords[i][j][k] = undefined; + } + */ + } + } + + // coords x, y & z + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + rawCoords[0][j][k] = this.getXat(j, k, data.xcalendar, sceneLayout.xaxis); + rawCoords[1][j][k] = this.getYat(j, k, data.ycalendar, sceneLayout.yaxis); + rawCoords[2][j][k] = this.getZat(j, k, data.zcalendar, sceneLayout.zaxis); + } + } + + if(data.connectgaps) { + data._emptypoints = findEmpties(rawCoords[2]); + interp2d(rawCoords[2], data._emptypoints); + + data._interpolatedZ = []; + for(j = 0; j < xlen; j++) { + data._interpolatedZ[j] = []; + for(k = 0; k < ylen; k++) { + data._interpolatedZ[j][k] = rawCoords[2][j][k]; + } + } + } + + // Note: log axes are not defined in surfaces yet. + // but they could be defined here... + + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + v = rawCoords[i][j][k]; + if(v === null || v === undefined) { + rawCoords[i][j][k] = NaN; + } else { + v = rawCoords[i][j][k] *= scaleFactor[i]; + } + } + } + } + + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + v = rawCoords[i][j][k]; + if(v !== null && v !== undefined) { + if(this.minValues[i] > v) { + this.minValues[i] = v; + } + if(this.maxValues[i] < v) { + this.maxValues[i] = v; + } + } + } + } + } + + for(i = 0; i < 3; i++) { + this.objectOffset[i] = 0.5 * (this.minValues[i] + this.maxValues[i]); + } + + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + v = rawCoords[i][j][k]; + if(v !== null && v !== undefined) { + rawCoords[i][j][k] -= this.objectOffset[i]; + } + } + } + } + + // convert processed raw data to Float32 matrices + var coords = [ + ndarray(new Float32Array(xlen * ylen), [xlen, ylen]), + ndarray(new Float32Array(xlen * ylen), [xlen, ylen]), + ndarray(new Float32Array(xlen * ylen), [xlen, ylen]) + ]; + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + coords[i].set(j, k, rawCoords[i][j][k]); + } + } + } + rawCoords = []; // free memory + + var params = { + colormap: colormap, + levels: [[], [], []], + showContour: [true, true, true], + showSurface: !data.hidesurface, + contourProject: [ + [false, false, false], + [false, false, false], + [false, false, false] + ], + 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], + opacityscale: data.opacityscale, + opacity: data.opacity + }; + + var cOpts = extractOpts(data); + params.intensityBounds = [cOpts.min, cOpts.max]; + + // Refine surface color if necessary + if(data.surfacecolor) { + var intensity = ndarray(new Float32Array(xlen * ylen), [xlen, ylen]); + + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + intensity.set(j, k, data.surfacecolor[k][j]); + } + } + + coords.push(intensity); + } else { + // when 'z' is used as 'intensity', + // we must scale its value + params.intensityBounds[0] *= scaleFactor[2]; + params.intensityBounds[1] *= scaleFactor[2]; + } + + if(MAX_RESOLUTION < coords[0].shape[0] || + MAX_RESOLUTION < coords[0].shape[1]) { + this.refineData = false; + } + + if(this.refineData === true) { + this.dataScaleX = this.estimateScale(coords[0].shape[0], 0); + this.dataScaleY = this.estimateScale(coords[0].shape[1], 1); + if(this.dataScaleX !== 1 || this.dataScaleY !== 1) { + this.refineCoords(coords); + } + } + + if(data.surfacecolor) { + params.intensity = coords.pop(); + } + + var highlightEnable = [true, true, true]; + var axis = ['x', 'y', 'z']; + + for(i = 0; i < 3; ++i) { + var contourParams = data.contours[axis[i]]; + highlightEnable[i] = contourParams.highlight; + + params.showContour[i] = contourParams.show || contourParams.highlight; + if(!params.showContour[i]) continue; + + params.contourProject[i] = [ + contourParams.project.x, + contourParams.project.y, + contourParams.project.z + ]; + + if(contourParams.show) { + this.showContour[i] = true; + params.levels[i] = contourLevels[i]; + surface.highlightColor[i] = params.contourColor[i] = str2RgbaArray(contourParams.color); + + if(contourParams.usecolormap) { + surface.highlightTint[i] = params.contourTint[i] = 0; + } else { + surface.highlightTint[i] = params.contourTint[i] = 1; + } + params.contourWidth[i] = contourParams.width; + + this.contourStart[i] = contourParams.start; + this.contourEnd[i] = contourParams.end; + this.contourSize[i] = contourParams.size; + } else { + this.showContour[i] = false; + + this.contourStart[i] = null; + this.contourEnd[i] = null; + this.contourSize[i] = 0; + } + + if(contourParams.highlight) { + params.dynamicColor[i] = str2RgbaArray(contourParams.highlightcolor); + params.dynamicWidth[i] = contourParams.highlightwidth; + } + } + + // see https://github.com/plotly/plotly.js/issues/940 + if(isColormapCircular(colormap)) { + params.vertexColor = true; + } + + params.objectOffset = this.objectOffset; + + params.coords = coords; + surface.update(params); + + surface.visible = data.visible; + surface.enableDynamic = highlightEnable; + surface.enableHighlight = highlightEnable; + + surface.snapToData = true; + + if('lighting' in data) { + surface.ambientLight = data.lighting.ambient; + surface.diffuseLight = data.lighting.diffuse; + surface.specularLight = data.lighting.specular; + surface.roughness = data.lighting.roughness; + surface.fresnel = data.lighting.fresnel; + } + + if('lightposition' in data) { + surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z]; + } +}; + +proto.dispose = function() { + this.scene.glplot.remove(this.surface); + this.surface.dispose(); +}; + +function createSurfaceTrace(scene, data) { + var gl = scene.glplot.gl; + var surface = createSurface({ gl: gl }); + var result = new SurfaceTrace(scene, surface, data.uid); + surface._trace = result; + result.update(data); + scene.glplot.add(surface); + return result; +} + +module.exports = createSurfaceTrace; + +},{"../../components/colorscale":536,"../../lib":661,"../../lib/gl_format_color":657,"../../lib/str2rgbarray":685,"../heatmap/find_empties":948,"../heatmap/interp2d":951,"gl-surface3d":256,"ndarray":376,"ndarray-linear-interpolate":370}],1160:[function(_dereq_,module,exports){ +'use strict'; + +var Registry = _dereq_('../../registry'); +var Lib = _dereq_('../../lib'); + +var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); +var attributes = _dereq_('./attributes'); + +var MIN = 0.1; // Note: often we don't want the data cube to be disappeared + +function createWave(n, minOpacity) { + var arr = []; + var steps = 32; // Max: 256 + for(var i = 0; i < steps; i++) { + var u = i / (steps - 1); + var v = minOpacity + (1 - minOpacity) * (1 - Math.pow(Math.sin(n * u * Math.PI), 2)); + arr.push([ + u, + Math.max(0, Math.min(1, v)) + ]); + } + return arr; +} + +function isValidScaleArray(scl) { + var highestVal = 0; + + if(!Array.isArray(scl) || scl.length < 2) return false; + + if(!scl[0] || !scl[scl.length - 1]) return false; + + if(+scl[0][0] !== 0 || +scl[scl.length - 1][0] !== 1) return false; + + for(var i = 0; i < scl.length; i++) { + var si = scl[i]; + + if(si.length !== 2 || +si[0] < highestVal) { + return false; + } + + highestVal = +si[0]; + } + + return true; +} + +function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + var i, j; + + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + var x = coerce('x'); + var y = coerce('y'); + + var z = coerce('z'); + if(!z || !z.length || + (x ? (x.length < 1) : false) || + (y ? (y.length < 1) : false) + ) { + traceOut.visible = false; + return; + } + + traceOut._xlength = (Array.isArray(x) && Lib.isArrayOrTypedArray(x[0])) ? z.length : z[0].length; + traceOut._ylength = z.length; + + var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); + handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); + + coerce('text'); + coerce('hovertext'); + coerce('hovertemplate'); + coerce('xhoverformat'); + coerce('yhoverformat'); + coerce('zhoverformat'); + + // Coerce remaining properties + [ + 'lighting.ambient', + 'lighting.diffuse', + 'lighting.specular', + 'lighting.roughness', + 'lighting.fresnel', + 'lightposition.x', + 'lightposition.y', + 'lightposition.z', + 'hidesurface', + 'connectgaps', + 'opacity' + ].forEach(function(x) { coerce(x); }); + + var surfaceColor = coerce('surfacecolor'); + + var dims = ['x', 'y', 'z']; + for(i = 0; i < 3; ++i) { + var contourDim = 'contours.' + dims[i]; + var show = coerce(contourDim + '.show'); + var highlight = coerce(contourDim + '.highlight'); + + if(show || highlight) { + for(j = 0; j < 3; ++j) { + coerce(contourDim + '.project.' + dims[j]); + } + } + + if(show) { + coerce(contourDim + '.color'); + coerce(contourDim + '.width'); + coerce(contourDim + '.usecolormap'); + } + + if(highlight) { + coerce(contourDim + '.highlightcolor'); + coerce(contourDim + '.highlightwidth'); + } + + coerce(contourDim + '.start'); + coerce(contourDim + '.end'); + coerce(contourDim + '.size'); + } + + // backward compatibility block + if(!surfaceColor) { + mapLegacy(traceIn, 'zmin', 'cmin'); + mapLegacy(traceIn, 'zmax', 'cmax'); + mapLegacy(traceIn, 'zauto', 'cauto'); + } + + // TODO if contours.?.usecolormap are false and hidesurface is true + // the colorbar shouldn't be shown by default + + colorscaleDefaults( + traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'} + ); + + opacityscaleDefaults(traceIn, traceOut, layout, coerce); + + // disable 1D transforms - currently surface does NOT support column data like heatmap does + // you can use mesh3d for this use case, but not surface + traceOut._length = null; +} + +function opacityscaleDefaults(traceIn, traceOut, layout, coerce) { + var opacityscale = coerce('opacityscale'); + if(opacityscale === 'max') { + traceOut.opacityscale = [[0, MIN], [1, 1]]; + } else if(opacityscale === 'min') { + traceOut.opacityscale = [[0, 1], [1, MIN]]; + } else if(opacityscale === 'extremes') { + traceOut.opacityscale = createWave(1, MIN); + } else if(!isValidScaleArray(opacityscale)) { + traceOut.opacityscale = undefined; + } +} + +function mapLegacy(traceIn, oldAttr, newAttr) { + if(oldAttr in traceIn && !(newAttr in traceIn)) { + traceIn[newAttr] = traceIn[oldAttr]; + } +} + +module.exports = { + supplyDefaults: supplyDefaults, + opacityscaleDefaults: opacityscaleDefaults +}; + +},{"../../components/colorscale/defaults":534,"../../lib":661,"../../registry":788,"./attributes":1157}],1161:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults').supplyDefaults, + colorbar: { + min: 'cmin', + max: 'cmax' + }, + calc: _dereq_('./calc'), + plot: _dereq_('./convert'), + + moduleType: 'trace', + name: 'surface', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', '2dMap', 'showLegend'], + meta: { + } +}; + +},{"../../plots/gl3d":753,"./attributes":1157,"./calc":1158,"./convert":1159,"./defaults":1160}],1162:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../../components/annotations/attributes'); @@ -191222,7 +239977,7 @@ var attrs = module.exports = overrideAll({ }, 'calc', 'from-root'); attrs.transforms = undefined; -},{"../../components/annotations/attributes":191,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plots/cartesian/axis_format_attributes":393,"../../plots/domain":418,"../../plots/font_attributes":419}],788:[function(_dereq_,module,exports){ +},{"../../components/annotations/attributes":507,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/cartesian/axis_format_attributes":714,"../../plots/domain":739,"../../plots/font_attributes":740}],1163:[function(_dereq_,module,exports){ 'use strict'; var getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData; @@ -191246,7 +240001,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/get_data":427,"./plot":795}],789:[function(_dereq_,module,exports){ +},{"../../plots/get_data":748,"./plot":1170}],1164:[function(_dereq_,module,exports){ 'use strict'; var wrap = _dereq_('../../lib/gup').wrap; @@ -191257,7 +240012,7 @@ module.exports = function calc() { return wrap({}); }; -},{"../../lib/gup":339}],790:[function(_dereq_,module,exports){ +},{"../../lib/gup":658}],1165:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -191309,7 +240064,7 @@ module.exports = { } }; -},{}],791:[function(_dereq_,module,exports){ +},{}],1166:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -191496,7 +240251,7 @@ function makeIdentity() { }; } -},{"../../lib/extend":333,"./constants":790,"fast-isnumeric":81}],792:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"./constants":1165,"fast-isnumeric":159}],1167:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -191571,7 +240326,7 @@ function rowFromTo(d) { return [rowFrom, rowTo]; } -},{"../../lib/extend":333}],793:[function(_dereq_,module,exports){ +},{"../../lib/extend":651}],1168:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -191628,7 +240383,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../lib":342,"../../plots/domain":418,"./attributes":787}],794:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/domain":739,"./attributes":1162}],1169:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -191645,7 +240400,7 @@ module.exports = { } }; -},{"./attributes":787,"./base_plot":788,"./calc":789,"./defaults":793,"./plot":795}],795:[function(_dereq_,module,exports){ +},{"./attributes":1162,"./base_plot":1163,"./calc":1164,"./defaults":1168,"./plot":1170}],1170:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -192536,7 +241291,7 @@ function allRowsHeight(rowBlock) { function getBlock(d) {return d.rowBlocks[d.page];} function getRow(l, i) {return l.rows[i - l.firstRowIndex];} -},{"../../components/color":208,"../../components/drawing":230,"../../lib":342,"../../lib/gup":339,"../../lib/svg_text_utils":365,"./constants":790,"./data_preparation_helper":791,"./data_split_helpers":792,"@plotly/d3":44}],796:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../lib":661,"../../lib/gup":658,"../../lib/svg_text_utils":686,"./constants":1165,"./data_preparation_helper":1166,"./data_split_helpers":1167,"@plotly/d3":54}],1171:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -192722,7 +241477,7 @@ module.exports = { domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}), }; -},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683,"../sunburst/attributes":775,"./constants":799}],797:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/domain":739,"../../plots/template_attributes":783,"../pie/attributes":1038,"../sunburst/attributes":1145,"./constants":1174}],1172:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -192737,7 +241492,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":438}],798:[function(_dereq_,module,exports){ +},{"../../plots/plots":774}],1173:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('../sunburst/calc'); @@ -192750,7 +241505,7 @@ exports.crossTraceCalc = function(gd) { return calc._runCrossTraceCalc('treemap', gd); }; -},{"../sunburst/calc":777}],799:[function(_dereq_,module,exports){ +},{"../sunburst/calc":1147}],1174:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -192771,7 +241526,7 @@ module.exports = { gapWithPathbar: 1 // i.e. one pixel }; -},{}],800:[function(_dereq_,module,exports){ +},{}],1175:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -192886,7 +241641,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/color":208,"../../components/colorscale":220,"../../lib":342,"../../plots/domain":418,"../bar/constants":464,"../bar/defaults":466,"./attributes":796}],801:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/colorscale":536,"../../lib":661,"../../plots/domain":739,"../bar/constants":800,"../bar/defaults":802,"./attributes":1171}],1176:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -192957,7 +241712,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall } }; -},{"../bar/style":476,"../bar/uniform_text":478,"../sunburst/helpers":781,"./plot_one":810,"@plotly/d3":44}],802:[function(_dereq_,module,exports){ +},{"../bar/style":812,"../bar/uniform_text":814,"../sunburst/helpers":1151,"./plot_one":1185,"@plotly/d3":54}],1177:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -193127,7 +241882,7 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) { }); }; -},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../sunburst/fx":780,"../sunburst/helpers":781,"./constants":799,"./partition":808,"./style":811,"@plotly/d3":44}],803:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../sunburst/fx":1150,"../sunburst/helpers":1151,"./constants":1174,"./partition":1183,"./style":1186,"@plotly/d3":54}],1178:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -193338,7 +242093,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) { return nextOfPrevEntry; }; -},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../sunburst/fx":780,"../sunburst/helpers":781,"../sunburst/plot":785,"./constants":799,"./partition":808,"./style":811,"@plotly/d3":44}],804:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../sunburst/fx":1150,"../sunburst/helpers":1151,"../sunburst/plot":1155,"./constants":1174,"./partition":1183,"./style":1186,"@plotly/d3":54}],1179:[function(_dereq_,module,exports){ 'use strict'; module.exports = function flipTree(node, size, opts) { @@ -193376,7 +242131,7 @@ module.exports = function flipTree(node, size, opts) { } }; -},{}],805:[function(_dereq_,module,exports){ +},{}],1180:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -193403,7 +242158,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":723,"./attributes":796,"./base_plot":797,"./calc":798,"./defaults":800,"./layout_attributes":806,"./layout_defaults":807,"./plot":809,"./style":811}],806:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1082,"./attributes":1171,"./base_plot":1172,"./calc":1173,"./defaults":1175,"./layout_attributes":1181,"./layout_defaults":1182,"./plot":1184,"./style":1186}],1181:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -193418,7 +242173,7 @@ module.exports = { } }; -},{}],807:[function(_dereq_,module,exports){ +},{}],1182:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -193432,7 +242187,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendtreemapcolors'); }; -},{"../../lib":342,"./layout_attributes":806}],808:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":1181}],1183:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -193496,7 +242251,7 @@ function getTilingMethod(key, squarifyratio) { } } -},{"./flip_tree":804,"d3-hierarchy":71}],809:[function(_dereq_,module,exports){ +},{"./flip_tree":1179,"d3-hierarchy":142}],1184:[function(_dereq_,module,exports){ 'use strict'; var draw = _dereq_('./draw'); @@ -193509,7 +242264,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall }); }; -},{"./draw":801,"./draw_descendants":803}],810:[function(_dereq_,module,exports){ +},{"./draw":1176,"./draw_descendants":1178}],1185:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -194101,7 +242856,7 @@ module.exports = function plotOne(gd, cd, element, transitionOpts, drawDescendan } }; -},{"../../lib":342,"../bar/constants":464,"../bar/plot":473,"../bar/uniform_text":478,"../sunburst/helpers":781,"./constants":799,"./draw_ancestors":802,"@plotly/d3":44,"d3-interpolate":72}],811:[function(_dereq_,module,exports){ +},{"../../lib":661,"../bar/constants":800,"../bar/plot":809,"../bar/uniform_text":814,"../sunburst/helpers":1151,"./constants":1174,"./draw_ancestors":1177,"@plotly/d3":54,"d3-interpolate":143}],1186:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -194195,7 +242950,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":208,"../../lib":342,"../bar/uniform_text":478,"../sunburst/helpers":781,"@plotly/d3":44}],812:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../bar/uniform_text":814,"../sunburst/helpers":1151,"@plotly/d3":54}],1187:[function(_dereq_,module,exports){ 'use strict'; var boxAttrs = _dereq_('../box/attributes'); @@ -194351,7 +243106,7 @@ module.exports = { } }; -},{"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../box/attributes":487}],813:[function(_dereq_,module,exports){ +},{"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../box/attributes":823}],1188:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -194519,7 +243274,7 @@ function calcSpan(trace, cdi, valAxis, bandwidth) { return spanOut; } -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/axes":390,"../box/calc":488,"./helpers":816}],814:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/axes":711,"../box/calc":824,"./helpers":1191}],1189:[function(_dereq_,module,exports){ 'use strict'; var setPositionOffset = _dereq_('../box/cross_trace_calc').setPositionOffset; @@ -194554,7 +243309,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../box/cross_trace_calc":489}],815:[function(_dereq_,module,exports){ +},{"../box/cross_trace_calc":825}],1190:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -194607,7 +243362,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout if(!meanLineVisible) traceOut.meanline = {visible: false}; }; -},{"../../components/color":208,"../../lib":342,"../box/defaults":490,"./attributes":812}],816:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib":661,"../box/defaults":826,"./attributes":1187}],1191:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -194672,7 +243427,7 @@ exports.getKdeValue = function(calcItem, trace, valueDist) { exports.extractVal = function(o) { return o.v; }; -},{"../../lib":342}],817:[function(_dereq_,module,exports){ +},{"../../lib":661}],1192:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -194779,7 +243534,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return closeData; }; -},{"../../lib":342,"../../plots/cartesian/axes":390,"../box/hover":492,"./helpers":816}],818:[function(_dereq_,module,exports){ +},{"../../lib":661,"../../plots/cartesian/axes":711,"../box/hover":828,"./helpers":1191}],1193:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -194804,7 +243559,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../box/defaults":490,"../box/select":497,"../scatter/style":729,"./attributes":812,"./calc":813,"./cross_trace_calc":814,"./defaults":815,"./hover":817,"./layout_attributes":819,"./layout_defaults":820,"./plot":821,"./style":822}],819:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../box/defaults":826,"../box/select":833,"../scatter/style":1088,"./attributes":1187,"./calc":1188,"./cross_trace_calc":1189,"./defaults":1190,"./hover":1192,"./layout_attributes":1194,"./layout_defaults":1195,"./plot":1196,"./style":1197}],1194:[function(_dereq_,module,exports){ 'use strict'; var boxLayoutAttrs = _dereq_('../box/layout_attributes'); @@ -194819,7 +243574,7 @@ module.exports = { }) }; -},{"../../lib":342,"../box/layout_attributes":494}],820:[function(_dereq_,module,exports){ +},{"../../lib":661,"../box/layout_attributes":830}],1195:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -194833,7 +243588,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { boxLayoutDefaults._supply(layoutIn, layoutOut, fullData, coerce, 'violin'); }; -},{"../../lib":342,"../box/layout_defaults":495,"./layout_attributes":819}],821:[function(_dereq_,module,exports){ +},{"../../lib":661,"../box/layout_defaults":831,"./layout_attributes":1194}],1196:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -195015,7 +243770,7 @@ module.exports = function plot(gd, plotinfo, cdViolins, violinLayer) { }); }; -},{"../../components/drawing":230,"../../lib":342,"../box/plot":496,"../scatter/line_points":719,"./helpers":816,"@plotly/d3":44}],822:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../lib":661,"../box/plot":832,"../scatter/line_points":1078,"./helpers":1191,"@plotly/d3":54}],1197:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -195062,7 +243817,236 @@ module.exports = function style(gd) { }); }; -},{"../../components/color":208,"../scatter/style":729,"@plotly/d3":44}],823:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../scatter/style":1088,"@plotly/d3":54}],1198:[function(_dereq_,module,exports){ +'use strict'; + +var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); +var isosurfaceAttrs = _dereq_('../isosurface/attributes'); +var surfaceAttrs = _dereq_('../surface/attributes'); +var baseAttrs = _dereq_('../../plots/attributes'); + +var extendFlat = _dereq_('../../lib/extend').extendFlat; +var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; + +var attrs = module.exports = overrideAll(extendFlat({ + x: isosurfaceAttrs.x, + y: isosurfaceAttrs.y, + z: isosurfaceAttrs.z, + value: isosurfaceAttrs.value, + isomin: isosurfaceAttrs.isomin, + isomax: isosurfaceAttrs.isomax, + surface: isosurfaceAttrs.surface, + spaceframe: { + show: { + valType: 'boolean', + dflt: false, + }, + fill: { + valType: 'number', + min: 0, + max: 1, + dflt: 1, + } + }, + + slices: isosurfaceAttrs.slices, + caps: isosurfaceAttrs.caps, + text: isosurfaceAttrs.text, + hovertext: isosurfaceAttrs.hovertext, + xhoverformat: isosurfaceAttrs.xhoverformat, + yhoverformat: isosurfaceAttrs.yhoverformat, + zhoverformat: isosurfaceAttrs.zhoverformat, + valuehoverformat: isosurfaceAttrs.valuehoverformat, + hovertemplate: isosurfaceAttrs.hovertemplate +}, + +colorScaleAttrs('', { + colorAttr: '`value`', + showScaleDflt: true, + editTypeOverride: 'calc' +}), { + + colorbar: isosurfaceAttrs.colorbar, + opacity: isosurfaceAttrs.opacity, + opacityscale: surfaceAttrs.opacityscale, + + lightposition: isosurfaceAttrs.lightposition, + lighting: isosurfaceAttrs.lighting, + flatshading: isosurfaceAttrs.flatshading, + contour: isosurfaceAttrs.contour, + + hoverinfo: extendFlat({}, baseAttrs.hoverinfo), + showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) +}), 'calc', 'nested'); + +attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; +attrs.transforms = undefined; + +},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../isosurface/attributes":1011,"../surface/attributes":1157}],1199:[function(_dereq_,module,exports){ +'use strict'; + +var createMesh = _dereq_('gl-mesh3d'); + +var parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale; +var str2RgbaArray = _dereq_('../../lib/str2rgbarray'); +var extractOpts = _dereq_('../../components/colorscale').extractOpts; +var zip3 = _dereq_('../../plots/gl3d/zip3'); + +var findNearestOnAxis = _dereq_('../isosurface/convert').findNearestOnAxis; +var generateIsoMeshes = _dereq_('../isosurface/convert').generateIsoMeshes; + +function VolumeTrace(scene, mesh, uid) { + this.scene = scene; + this.uid = uid; + this.mesh = mesh; + this.name = ''; + this.data = null; + this.showContour = false; +} + +var proto = VolumeTrace.prototype; + +proto.handlePick = function(selection) { + if(selection.object === this.mesh) { + var rawId = selection.data.index; + + var x = this.data._meshX[rawId]; + var y = this.data._meshY[rawId]; + var z = this.data._meshZ[rawId]; + + var height = this.data._Ys.length; + var depth = this.data._Zs.length; + + var i = findNearestOnAxis(x, this.data._Xs).id; + var j = findNearestOnAxis(y, this.data._Ys).id; + var k = findNearestOnAxis(z, this.data._Zs).id; + + var selectIndex = selection.index = k + depth * j + depth * height * i; + + selection.traceCoordinate = [ + this.data._meshX[selectIndex], + this.data._meshY[selectIndex], + this.data._meshZ[selectIndex], + this.data._value[selectIndex] + ]; + + var text = this.data.hovertext || this.data.text; + if(Array.isArray(text) && text[selectIndex] !== undefined) { + selection.textLabel = text[selectIndex]; + } else if(text) { + selection.textLabel = text; + } + + return true; + } +}; + +proto.update = function(data) { + var scene = this.scene; + var layout = scene.fullSceneLayout; + + this.data = generateIsoMeshes(data); + + // Unpack position data + function toDataCoords(axis, coord, scale, calendar) { + return coord.map(function(x) { + return axis.d2l(x, 0, calendar) * scale; + }); + } + + var positions = zip3( + toDataCoords(layout.xaxis, data._meshX, scene.dataScale[0], data.xcalendar), + toDataCoords(layout.yaxis, data._meshY, scene.dataScale[1], data.ycalendar), + toDataCoords(layout.zaxis, data._meshZ, scene.dataScale[2], data.zcalendar)); + + var cells = zip3(data._meshI, data._meshJ, data._meshK); + + var config = { + positions: positions, + cells: cells, + lightPosition: [data.lightposition.x, data.lightposition.y, data.lightposition.z], + ambient: data.lighting.ambient, + diffuse: data.lighting.diffuse, + specular: data.lighting.specular, + roughness: data.lighting.roughness, + fresnel: data.lighting.fresnel, + vertexNormalsEpsilon: data.lighting.vertexnormalsepsilon, + faceNormalsEpsilon: data.lighting.facenormalsepsilon, + opacity: data.opacity, + opacityscale: data.opacityscale, + contourEnable: data.contour.show, + contourColor: str2RgbaArray(data.contour.color).slice(0, 3), + contourWidth: data.contour.width, + useFacetNormals: data.flatshading + }; + + var cOpts = extractOpts(data); + config.vertexIntensity = data._meshIntensity; + config.vertexIntensityBounds = [cOpts.min, cOpts.max]; + config.colormap = parseColorScale(data); + + // Update mesh + this.mesh.update(config); +}; + +proto.dispose = function() { + this.scene.glplot.remove(this.mesh); + this.mesh.dispose(); +}; + +function createVolumeTrace(scene, data) { + var gl = scene.glplot.gl; + var mesh = createMesh({gl: gl}); + var result = new VolumeTrace(scene, mesh, data.uid); + + mesh._trace = result; + result.update(data); + scene.glplot.add(mesh); + return result; +} + +module.exports = createVolumeTrace; + +},{"../../components/colorscale":536,"../../lib/gl_format_color":657,"../../lib/str2rgbarray":685,"../../plots/gl3d/zip3":764,"../isosurface/convert":1013,"gl-mesh3d":219}],1200:[function(_dereq_,module,exports){ +'use strict'; + +var Lib = _dereq_('../../lib'); +var attributes = _dereq_('./attributes'); +var supplyIsoDefaults = _dereq_('../isosurface/defaults').supplyIsoDefaults; +var opacityscaleDefaults = _dereq_('../surface/defaults').opacityscaleDefaults; + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce); + + opacityscaleDefaults(traceIn, traceOut, layout, coerce); +}; + +},{"../../lib":661,"../isosurface/defaults":1014,"../surface/defaults":1160,"./attributes":1198}],1201:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + attributes: _dereq_('./attributes'), + supplyDefaults: _dereq_('./defaults'), + calc: _dereq_('../isosurface/calc'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + plot: _dereq_('./convert'), + + moduleType: 'trace', + name: 'volume', + basePlotModule: _dereq_('../../plots/gl3d'), + categories: ['gl3d', 'showLegend'], + meta: { + } +}; + +},{"../../plots/gl3d":753,"../isosurface/calc":1012,"./attributes":1198,"./convert":1199,"./defaults":1200}],1202:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -195195,7 +244179,7 @@ module.exports = { alignmentgroup: barAttrs.alignmentgroup }; -},{"../../components/color":208,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../bar/attributes":462,"../scatter/attributes":705,"./constants":825}],824:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../bar/attributes":798,"../scatter/attributes":1064,"./constants":1204}],1203:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -195305,7 +244289,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"../scatter/calc_selection":707}],825:[function(_dereq_,module,exports){ +},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"../scatter/calc_selection":1066}],1204:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -195316,7 +244300,7 @@ module.exports = { ] }; -},{}],826:[function(_dereq_,module,exports){ +},{}],1205:[function(_dereq_,module,exports){ 'use strict'; var setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions; @@ -195381,7 +244365,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../bar/cross_trace_calc":465}],827:[function(_dereq_,module,exports){ +},{"../bar/cross_trace_calc":801}],1206:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -195484,7 +244468,7 @@ module.exports = { crossTraceDefaults: crossTraceDefaults }; -},{"../../components/color":208,"../../constants/delta.js":315,"../../lib":342,"../bar/defaults":466,"../scatter/period_defaults":725,"../scatter/xy_defaults":732,"./attributes":823}],828:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../constants/delta.js":631,"../../lib":661,"../bar/defaults":802,"../scatter/period_defaults":1084,"../scatter/xy_defaults":1091,"./attributes":1202}],1207:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { @@ -195503,7 +244487,7 @@ module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { return out; }; -},{}],829:[function(_dereq_,module,exports){ +},{}],1208:[function(_dereq_,module,exports){ 'use strict'; var hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText; @@ -195591,7 +244575,7 @@ function getTraceColor(trace, di) { else if(opacity(mlc) && mlw) return mlc; } -},{"../../components/color":208,"../../constants/delta.js":315,"../../plots/cartesian/axes":390,"../bar/hover":469}],830:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../constants/delta.js":631,"../../plots/cartesian/axes":711,"../bar/hover":805}],1209:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -195617,7 +244601,7 @@ module.exports = { } }; -},{"../../plots/cartesian":404,"../bar/select":474,"./attributes":823,"./calc":824,"./cross_trace_calc":826,"./defaults":827,"./event_data":828,"./hover":829,"./layout_attributes":831,"./layout_defaults":832,"./plot":833,"./style":834}],831:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":725,"../bar/select":810,"./attributes":1202,"./calc":1203,"./cross_trace_calc":1205,"./defaults":1206,"./event_data":1207,"./hover":1208,"./layout_attributes":1210,"./layout_defaults":1211,"./plot":1212,"./style":1213}],1210:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -195642,7 +244626,7 @@ module.exports = { } }; -},{}],832:[function(_dereq_,module,exports){ +},{}],1211:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -195671,7 +244655,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":342,"./layout_attributes":831}],833:[function(_dereq_,module,exports){ +},{"../../lib":661,"./layout_attributes":1210}],1212:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -195794,7 +244778,7 @@ function getXY(di, xa, ya, isHorizontal) { return isHorizontal ? [s, p] : [p, s]; } -},{"../../components/drawing":230,"../../constants/numerical":319,"../../lib":342,"../bar/plot":473,"../bar/uniform_text":478,"@plotly/d3":44}],834:[function(_dereq_,module,exports){ +},{"../../components/drawing":546,"../../constants/numerical":637,"../../lib":661,"../bar/plot":809,"../bar/uniform_text":814,"@plotly/d3":54}],1213:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -195847,7 +244831,7 @@ module.exports = { style: style }; -},{"../../components/color":208,"../../components/drawing":230,"../../constants/interactions":318,"../bar/style":476,"../bar/uniform_text":478,"@plotly/d3":44}],835:[function(_dereq_,module,exports){ +},{"../../components/color":524,"../../components/drawing":546,"../../constants/interactions":636,"../bar/style":812,"../bar/uniform_text":814,"@plotly/d3":54}],1214:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../plots/cartesian/axes'); @@ -196251,7 +245235,7 @@ function last(array, indices) { return array[indices[indices.length - 1]]; } -},{"../constants/numerical":319,"../lib":342,"../plot_api/plot_schema":378,"../plots/cartesian/axes":390,"./helpers":838}],836:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"../lib":661,"../plot_api/plot_schema":699,"../plots/cartesian/axes":711,"./helpers":1217}],1215:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -196511,7 +245495,7 @@ function getFilterFunc(opts, d2c, targetCalendar) { } } -},{"../constants/filter_ops":317,"../lib":342,"../plots/cartesian/axes":390,"../registry":452,"./helpers":838}],837:[function(_dereq_,module,exports){ +},{"../constants/filter_ops":633,"../lib":661,"../plots/cartesian/axes":711,"../registry":788,"./helpers":1217}],1216:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -196755,7 +245739,7 @@ function transformOne(trace, state) { return newData; } -},{"../lib":342,"../plot_api/plot_schema":378,"../plots/plots":438,"./helpers":838}],838:[function(_dereq_,module,exports){ +},{"../lib":661,"../plot_api/plot_schema":699,"../plots/plots":774,"./helpers":1217}],1217:[function(_dereq_,module,exports){ 'use strict'; exports.pointsAccessorFunction = function(transforms, opts) { @@ -196773,7 +245757,7 @@ exports.pointsAccessorFunction = function(transforms, opts) { return originalPointsAccessor; }; -},{}],839:[function(_dereq_,module,exports){ +},{}],1218:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -196911,11 +245895,11 @@ function getSortFunc(opts, d2c) { } } -},{"../constants/numerical":319,"../lib":342,"../plots/cartesian/axes":390,"./helpers":838}],840:[function(_dereq_,module,exports){ +},{"../constants/numerical":637,"../lib":661,"../plots/cartesian/axes":711,"./helpers":1217}],1219:[function(_dereq_,module,exports){ 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.4.2'; +exports.version = '2.5.0'; -},{}]},{},[25])(25) +},{}]},{},[27])(27) }); diff --git a/dist/plotly-strict.min.js b/dist/plotly-strict.min.js index 692253eb9ba..cd0a9020af8 100644 --- a/dist/plotly-strict.min.js +++ b/dist/plotly-strict.min.js @@ -1,37 +1,58 @@ /** -* plotly.js (strict - minified) v2.4.2 +* plotly.js (strict - minified) v2.5.0 * Copyright 2012-2021, 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{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return a(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":342}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":835}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":470}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":483}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":493}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":206}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":502}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":521}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":535}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":542}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":558}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":569}],13:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":321}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":577}],15:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":836}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":587}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":596}],18:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":837}],19:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":609}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":627}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":633}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":637}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/icicle")},{"../src/traces/icicle":643}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":656}],25:[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("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./image"),t("./pie"),t("./sunburst"),t("./treemap"),t("./icicle"),t("./funnelarea"),t("./scattergeo"),t("./choropleth"),t("./parcats"),t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./sankey"),t("./indicator"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./barpolar"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./contour":11,"./contourcarpet":12,"./core":13,"./densitymapbox":14,"./filter":15,"./funnel":16,"./funnelarea":17,"./groupby":18,"./heatmap":19,"./histogram":20,"./histogram2d":21,"./histogram2dcontour":22,"./icicle":23,"./image":24,"./indicator":26,"./ohlc":27,"./parcats":28,"./pie":29,"./sankey":30,"./scattercarpet":31,"./scattergeo":32,"./scattermapbox":33,"./scatterpolar":34,"./scatterternary":35,"./sort":36,"./sunburst":37,"./table":38,"./treemap":39,"./violin":40,"./waterfall":41}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":664}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":670}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":679}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":689}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":700}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":739}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":747}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":757}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":765}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":773}],36:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":839}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":782}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":794}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/treemap")},{"../src/traces/treemap":805}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":818}],41:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":830}],42:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-array"),t("d3-collection"),t("d3-shape"),t("elementary-circuits-directed-graph")):a(n.d3=n.d3||{},n.d3,n.d3,n.d3,null)}(this,(function(t,e,r,n,a){"use strict";function i(t){return t.target.depth}function o(t,e){return t.sourceLinks.length?t.depth:e-1}function s(t){return function(){return t}}a=a&&a.hasOwnProperty("default")?a.default:a;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function c(t,e){return p(t.source,e.source)||t.index-e.index}function u(t,e){return p(t.target,e.target)||t.index-e.index}function p(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function f(t){return t.value}function h(t){return(t.y0+t.y1)/2}function d(t){return h(t.source)}function m(t){return h(t.target)}function y(t){return t.index}function g(t){return t.nodes}function v(t){return t.links}function x(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function _(t,e){return e(t)}function b(t,e,r){var n=0;if(null===r){for(var i=[],o=0;o1||a>1)}function A(t,e,r){return t.sort(L),t.forEach((function(n,a){var i,o,s=0;if(H(n,r)&&M(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,a,i){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),A(t.links.filter((function(t){return"top"==t.circularLinkType})),r,i),A(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,i),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+10,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,i)&&M(e))e.circularPathData.leftSmallArcRadius=10+e.width/2,e.circularPathData.leftLargeArcRadius=10+e.width/2,e.circularPathData.rightSmallArcRadius=10+e.width/2,e.circularPathData.rightLargeArcRadius=10+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(P):c.sort(E);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=10+e.width/2+u,e.circularPathData.leftLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(I):c.sort(C),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=10+e.width/2+u,e.circularPathData.rightLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(a,e.source.y1,e.target.y1)+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){var e="";e="top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY;return e}(e);else{var p=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=p(e)}}))}function L(t,e){return D(t)==D(e)?"bottom"==t.circularLinkType?P(t,e):E(t,e):D(e)-D(t)}function E(t,e){return t.y0-e.y0}function P(t,e){return e.y0-t.y0}function C(t,e){return t.y1-e.y1}function I(t,e){return e.y1-t.y1}function D(t){return t.target.column-t.source.column}function z(t){return t.target.x0-t.source.x1}function O(t,e){var r=T(t),n=z(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function R(t,e){var r=T(t),n=z(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function F(t,e,r,n){t.links.forEach((function(a){if(!a.circular&&a.target.column-a.source.column>1){var i=a.source.column+1,o=a.target.column-1,s=1,l=o-i+1;for(s=1;i<=o;i++,s++)t.nodes.forEach((function(o){if(o.column==i){var c,u=s/(l+1),p=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),h=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=p*a.y0+f*a.y0+h*a.y1+d*a.y1,y=m-a.width/2,g=m+a.width/2;y>o.y0&&yo.y0&&go.y1)&&(c=g-o.y0+10,o=B(o,c,e,r),t.nodes.forEach((function(t){_(t,n)!=_(o,n)&&t.column==o.column&&t.y0o.y1&&B(t,c,e,r)})))}}))}}))}function N(t,e){return t.y0>e.y0&&t.y0e.y0&&t.y1e.y1)}function B(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function j(t,e,r,n){t.nodes.forEach((function(a){n&&a.y+(a.y1-a.y0)>e&&(a.y=a.y-(a.y+(a.y1-a.y0)-e));var i=t.links.filter((function(t){return _(t.source,r)==_(a,r)})),o=i.length;o>1&&i.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=R(e,t);return t.y1-r}if(e.target.column>t.target.column)return R(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=a.y0;i.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),i.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function H(t,e){return _(t.source,e)==_(t.target,e)}function G(t,r,n){var a=t.nodes,i=t.links,o=!1,s=!1;if(i.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(a,(function(t){return t.y0})),c=(n-r)/(e.max(a,(function(t){return t.y1}))-l);a.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),i.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}t.sankeyCircular=function(){var t,n,a=0,i=0,_=1,T=1,M=24,A=y,L=o,E=g,P=v,C=32,I=2,D=null;function z(){var t={nodes:E.apply(null,arguments),links:P.apply(null,arguments)};O(t),b(t,A,D),R(t),N(t),w(t,A),B(t,C,A),V(t);for(var e=4,r=0;r0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:i=i>0?i+25+10:i,right:a=a>0?a+25+10:a}}(o),p=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),o=_-a,s=T-i,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return a=a*l+r.left,_=0==r.right?_:_*l,i=i*c+r.top,T*=c,t.nodes.forEach((function(t){t.x0=a+t.column*((_-a-M)/n),t.x1=t.x0+M})),c}(o,u);l*=p,o.links.forEach((function(t){t.width=t.value*l})),c.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==c.length-1&&1==e||0==t.depth&&1==e?(t.y0=T/2-t.value*l,t.y1=t.y0+t.value*l):t.partOfCycle?0==k(t,r)?(t.y0=T/2+n,t.y1=t.y0+t.value*l):"top"==t.circularLinkType?(t.y0=i+n,t.y1=t.y0+t.value*l):(t.y0=T-t.value*l-n,t.y1=t.y0+t.value*l):0==u.top||0==u.bottom?(t.y0=(T-i)/e*n,t.y1=t.y0+t.value*l):(t.y0=(T-i)/2-e/2+n,t.y1=t.y0+t.value*l)}))}))}(l),v();for(var u=1,y=s;y>0;--y)g(u*=.99,l),v();function g(t,r){var n=c.length;c.forEach((function(a){var i=a.length,o=a[0].depth;a.forEach((function(a){var s;if(a.sourceLinks.length||a.targetLinks.length)if(a.partOfCycle&&k(a,r)>0);else if(0==o&&1==i)s=a.y1-a.y0,a.y0=T/2-s/2,a.y1=T/2+s/2;else if(o==n-1&&1==i)s=a.y1-a.y0,a.y0=T/2-s/2,a.y1=T/2+s/2;else{var l=e.mean(a.sourceLinks,m),c=e.mean(a.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-h(a))*t;a.y0+=u,a.y1+=u}}))}))}function v(){c.forEach((function(e){var r,n,a,o=i,s=e.length;for(e.sort(p),a=0;a0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-T)>0)for(o=r.y0-=n,r.y1-=n,a=s-2;a>=0;--a)(n=(r=e[a]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function V(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,a=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=a-t.width/2,a-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return z.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:s(t),z):A},z.nodeAlign=function(t){return arguments.length?(L="function"==typeof t?t:s(t),z):L},z.nodeWidth=function(t){return arguments.length?(M=+t,z):M},z.nodePadding=function(e){return arguments.length?(t=+e,z):t},z.nodes=function(t){return arguments.length?(E="function"==typeof t?t:s(t),z):E},z.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),z):P},z.size=function(t){return arguments.length?(a=i=0,_=+t[0],T=+t[1],z):[_-a,T-i]},z.extent=function(t){return arguments.length?(a=+t[0][0],_=+t[1][0],i=+t[0][1],T=+t[1][1],z):[[a,i],[_,T]]},z.iterations=function(t){return arguments.length?(C=+t,z):C},z.circularLinkGap=function(t){return arguments.length?(I=+t,z):I},z.nodePaddingRatio=function(t){return arguments.length?(n=+t,z):n},z.sortNodes=function(t){return arguments.length?(D=t,z):D},z.update=function(t){return w(t,A),V(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1i&&(_=i);var o=e.min(a,(function(t){return(v-n-(t.length-1)*_)/e.sum(t,u)}));a.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}(),d();for(var i=1,o=M;o>0;--o)l(i*=.99),d(),s(i),d();function s(t){a.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,u)-p(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){a.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,h)/e.sum(r.sourceLinks,u)-p(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){a.forEach((function(t){var e,r,a,i=n,o=t.length;for(t.sort(c),a=0;a0&&(e.y0+=r,e.y1+=r),i=e.y1+_;if((r=i-_-v)>0)for(i=e.y0-=r,e.y1-=r,a=o-2;a>=0;--a)(r=(e=t[a]).y1+_-i)>0&&(e.y0-=r,e.y1-=r),i=e.y0}))}}function C(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return A.update=function(t){return C(t),t},A.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),A):b},A.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),A):w},A.nodeWidth=function(t){return arguments.length?(x=+t,A):x},A.nodePadding=function(t){return arguments.length?(_=+t,A):_},A.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),A):T},A.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),A):k},A.size=function(e){return arguments.length?(t=n=0,a=+e[0],v=+e[1],A):[a-t,v-n]},A.extent=function(e){return arguments.length?(t=+e[0][0],a=+e[1][0],n=+e[0][1],v=+e[1][1],A):[[t,n],[a,v]]},A.iterations=function(t){return arguments.length?(M=+t,A):M},A},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,a)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=i,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":63,"d3-collection":64,"d3-shape":75}],44:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},a=self.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=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}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,p=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){p.call(this,t,e+"",r)}}function f(t,e){return te?1:t>=e?0:NaN}function h(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=f,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var y=m(f);function g(t){return t.length}t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(t){return m(1===t.length?function(e,r){return f(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function _(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.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,a=[],i=x(v(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,c,u,p,f=-1,h=i.length,d=a[s++],m=new b;++f=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,Y),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var Y=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return q(t,this)}}function X(t){return"function"==typeof t?t:function(){return H(t,this)}}Y.select=function(t){var e,r,n,a,i=[];t=Z(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},Y.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=mt.get(e);function c(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=gt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=pt,t.selection.enter.prototype=ft,ft.append=Y.append,ft.empty=Y.empty,ft.node=Y.node,ft.call=Y.call,ft.size=Y.size,ft.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s1?Lt:t<-1?-Lt:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-a,p=l-i,f=u*u+p*p;if(f<1e-12)n=Math.log(c/o)/Dt,r=function(t){return[a+t*u,i+t*p,o*Math.exp(Dt*t*n)]};else{var h=Math.sqrt(f),d=(c*c-o*o+4*f)/(2*o*2*h),m=(c*c-o*o-4*f)/(2*c*2*h),y=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-y)/Dt,r=function(t){var e,r=t*n,s=It(y),l=o/(2*h)*(s*(e=Dt*r+y,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[a+l*u,i+l*p,o*s/It(Dt*r+y)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,c,u,p,f={x:0,y:0,k:1},h=[960,500],d=Rt,m=250,y=0,g="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",_="touchstart.zoom",b=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(g,C).on(Ot+".zoom",D).on("dblclick.zoom",z).on(_,I)}function T(t){return[(t[0]-f.x)/f.k,(t[1]-f.y)/f.k]}function k(t){f.k=Math.max(d[0],Math.min(d[1],t))}function M(t,e){e=function(t){return[t[0]*f.k+f.x,t[1]*f.k+f.y]}(e),f.x+=t[0]-e[0],f.y+=t[1]-e[1]}function A(e,n,a,i){e.__chart__={x:f.x,y:f.y,k:f.k},k(Math.pow(2,i)),M(r=n,a),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-f.x)/f.k})).map(l.invert)),p&&p.domain(u.range().map((function(t){return(t-f.y)/f.k})).map(u.invert))}function L(t){y++||t({type:"zoomstart"})}function E(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function P(t){--y||(t({type:"zoomend"}),r=null)}function C(){var e=this,r=b.of(e,arguments),n=0,a=t.select(o(e)).on(v,l).on(x,c),i=T(t.mouse(e)),s=_t(e);function l(){n=1,M(t.mouse(e),i),E(r)}function c(){a.on(v,null).on(x,null),s(n),P(r)}Oa.call(e),L(r)}function I(){var e,r=this,n=b.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],p=t.select(r),h=_t(r);function d(){var n=t.touches(r);return e=f.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,y).on(c,v),u.push(e);for(var n=t.event.changedTouches,o=0,p=n.length;o1){g=h[0];var x=h[1],_=g[0]-x[0],b=g[1]-x[1];i=_*_+b*b}}function y(){var o,l,c,u,p=t.touches(r);Oa.call(r);for(var f=0,h=p.length;f360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new $t(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Ht?e.l:(e=ie((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Nt(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Nt(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Ft;function qt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Ht(r,Math.cos(t*=Et)*e,Math.sin(t)*e)}function Ht(t,e,r){return this instanceof Ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Ht?new Ht(t.l,t.a,t.b):t instanceof Ut?qt(t.h,t.c,t.l):ie((t=$t(t)).r,t.g,t.b):new Ht(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Vt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},t.lab=Ht;var Gt=18,Yt=Ht.prototype=new Ft;function Zt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new $t(Jt(3.2404542*(a=.95047*Wt(a))-1.5371385*(n=1*Wt(n))-.4985314*(i=1.08883*Wt(i))),Jt(-.969266*a+1.8760108*n+.041556*i),Jt(.0556434*a-.2040259*n+1.0572252*i))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Pt,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Wt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Kt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Jt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function $t(t,e,r){return this instanceof $t?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof $t?new $t(t.r,t.g,t.b):ne(""+t,$t,jt):new $t(t,e,r)}function Qt(t){return new $t(t>>16,t>>8&255,255&t)}function te(t){return Qt(t)+""}Yt.brighter=function(t){return new Ht(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new Ht(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Zt(this.l,this.a,this.b)},t.rgb=$t;var ee=$t.prototype=new Ft;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(se(a[0]),se(a[1]),se(a[2]))}return(i=le.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ae(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Nt(n,a,l)}function ie(t,e,r){var n=Kt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),a=Kt((.2126729*t+.7151522*e+.072175*r)/1);return Ht(116*a-16,500*(n-a),200*(a-Kt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=p:c.onreadystatechange=function(){c.readyState>3&&p()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var i in l)c.setRequestHeader(i,l[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}le.forEach((function(t,e){le.set(t,Qt(e))})),t.functor=ce,t.xhr=ue(P),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=pe(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=function(e){for(var r={},n=t.length,a=0;a=l)return o;if(a)return a=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(me),me=setTimeout(ve,e)),de=0):(de=1,ye(ve))}function xe(){for(var t=Date.now(),e=fe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function _e(){for(var t,e=fe,r=1/0;e;)e.c?(e.t1&&(e=t[i[o-2]],r=t[i[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;i[o++]=s}return i.slice(0,o)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ge.apply(this,arguments)},t.timer.flush=function(){xe(),_e()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=be,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=ce(e),i=ce(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)h.push(t[s[c[n]][2]]);for(n=+p;nkt)s=s.L;else{if(!((a=i-Ve(s,o))>kt)){n>-kt?(e=s.P,r=s):a>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fe(t);if(Ce.insert(e,l),e||r){if(e===r)return Ze(e),r=Fe(e.site),Ce.insert(l,r),l.edge=r.edge=Ke(e.site,l.site),Ye(e),void Ye(r);if(r){Ze(e),Ze(r);var c=e.site,u=c.x,p=c.y,f=t.x-u,h=t.y-p,d=r.site,m=d.x-u,y=d.y-p,g=2*(f*y-h*m),v=f*f+h*h,x=m*m+y*y,_={x:(y*v-h*x)/g+u,y:(f*x-m*v)/g+p};$e(r.edge,c,d,_),l.edge=Ke(c,t,null,_),r.edge=Ke(t,d,null,_),Ye(e),Ye(r)}else l.edge=Ke(e.site,l.site)}}function Ue(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,p=1/i-1/c,f=u/c;return p?(-f+Math.sqrt(f*f-2*p*(u*u/(-2*c)-l+c/2+a-i/2)))/p+n:(n+s)/2}function Ve(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function qe(t){this.site=t,this.edges=[]}function He(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,c=n.y-s,u=i.x-o,p=2*(l*(y=i.y-s)-c*u);if(!(p>=-1e-12)){var f=l*l+c*c,h=u*u+y*y,d=(y*f-c*h)/p,m=(l*h-u*f)/p,y=m+s,g=Oe.pop()||new Ge;g.arc=t,g.site=a,g.x=d+o,g.y=y+Math.sqrt(d*d+m*m),g.cy=y,t.circle=g;for(var v=null,x=De._;x;)if(g.y=s)return;if(f>d){if(i){if(i.y>=c)return}else i={x:y,y:l};r={x:y,y:c}}else{if(i){if(i.y1)if(f>d){if(i){if(i.y>=c)return}else i={x:(l-a)/n,y:l};r={x:(c-a)/n,y:c}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x0)){if(e/=f,f<0){if(e0){if(e>p)return;e>u&&(u=e)}if(e=a-l,f||!(e<0)){if(e/=f,f<0){if(e>p)return;e>u&&(u=e)}else if(f>0){if(e0)){if(e/=h,h<0){if(e0){if(e>p)return;e>u&&(u=e)}if(e=i-c,h||!(e<0)){if(e/=h,h<0){if(e>p)return;e>u&&(u=e)}else if(h>0){if(e0&&(t.a={x:l+u*f,y:c+u*h}),p<1&&(t.b={x:l+p*f,y:c+p*h}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||v(e.a.x-e.b.x)kt||v(a-r)>kt)&&(s.splice(o,0,new Qe(Je(i.site,u,v(n-p)kt?{x:p,y:v(e-p)kt?{x:v(r-d)kt?{x:f,y:v(e-f)kt?{x:v(r-h)=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ir(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ir(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,c=r.edges.sort(He),u=-1,p=c.length,f=c[p-1].edge,h=f.l===l?f.r:f.l;++ui||p>o||f=b)<<1|e>=_,T=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:dr(r,n)})),i=gr.lastIndex;return im&&(m=l.x),l.y>y&&(y=l.y),c.push(l.x),u.push(l.y);else for(p=0;pm&&(m=_),b>y&&(y=b),c.push(_),u.push(b)}var w=m-h,T=y-d;function k(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(v(l-r)+v(c-n)<.01)M(t,e,r,n,a,i,o,s);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,l,c,a,i,o,s),M(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,a,i,o,s)}function M(t,e,r,n,a,i,o,s){var l=.5*(a+o),c=.5*(i+s),u=r>=l,p=n>=c,f=p<<1|u;t.leaf=!1,u?a=l:o=l,p?i=c:s=c,k(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>T?y=d+w:m=h+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+g(t,++p),+x(t,p),h,d,m,y)},visit:function(t){ur(t,A,h,d,m,y)},find:function(t){return pr(A,t[0],t[1],h,d,m,y)}};if(p=-1,null==e){for(;++p=0&&!(n=t.interpolators[a](e,r)););return n}function xr(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Ar(t){return t*t}function Sr(t){return t*t*t}function Lr(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 Er(t){return 1-Math.cos(t*Lt)}function Pr(t){return Math.pow(2,10*(t-1))}function Cr(t){return 1-Math.sqrt(1-t*t)}function Ir(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 Dr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function zr(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=Rr(a),s=Or(a,i),l=Rr(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=br.get(n)||_r,Tr((a=wr.get(a)||P)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return Zt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=Dr,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new zr(e?e.matrix:Fr)})(e)},zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Nr(t){return t.length?t.pop()+",":""}function Br(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:dr(t[0],e[0])},{i:a-2,x:dr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Nr(r)+"rotate(",null,")")-2,x:dr(t,e)})):e&&r.push(Nr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(Nr(r)+"skewX(",null,")")-2,x:dr(t,e)}):e&&r.push(Nr(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Nr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:dr(t[0],e[0])},{i:a-2,x:dr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Nr(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ge(s.tick)),s):n},s.start=function(){var t,e,r,n=g.length,l=v.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(a[n])}function Qr(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(u=c[l]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qr(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&($r(t,(function(t){t.children&&(t.value=0)})),Qr(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function dn(t){return t.reduce(mn,0)}function mn(t,e){return t+e[1]}function yn(t,e){return gn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function gn(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function vn(e){return[t.min(e),t.max(e)]}function xn(t,e){return t.value-e.value}function _n(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function bn(t,e){t._pack_next=e,e._pack_prev=t}function wn(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,c=1/0,u=-1/0,p=1/0,f=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(An(r,n,a=e[2]),x(a),_n(r,a),r._pack_prev=a,_n(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=p[0]&&l<=p[1]&&((s=c[t.bisect(f,l,1,d)-1]).y+=m,s.push(i[o]));return c}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=ce(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return gn(e,t)}:ce(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(xn),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Qr(s,(function(t){t.r=+u(t.value)})),Qr(s,Tn),n){var p=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;Qr(s,(function(t){t.r+=p})),Qr(s,Tn),Qr(s,(function(t){t.r-=p}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++oh.x&&(h=t),t.depth>d.depth&&(d=t)}));var m=r(f,h)/2-f.x,y=n[0]/(h.x+r(h,f)/2+m),g=n[1]/(d.depth||1);$r(u,(function(t){t.x=(t.x+m)*y,t.y=t.depth*g}))}return c}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,p=s.m,f=l.m;s=En(s),i=Ln(i),s&&i;)l=Ln(l),(o=En(o)).a=t,(a=s.z+p-i.z-c+r(s._,i._))>0&&(Pn(Cn(s,t,n),t,a),c+=a,u+=a),p+=s.m,c+=i.m,f+=l.m,u+=o.m;s&&!En(o)&&(o.t=s,o.m+=p-u),i&&!Ln(l)&&(l.t=i,l.m+=c-f,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Jr(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),c=l[0],u=0;Qr(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var p=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),f=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),h=p.x-r(p,f)/2,d=f.x+r(f,p)/2;return Qr(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Jr(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=In,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=c[a-1]),s.area+=r.area,"squarify"!==l||(n=h(s,m))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,m,i,!1),m=Math.min(i.dx,i.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,m,i,!0),s.length=s.area=0),e.forEach(p)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(u(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(d(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(f)}}function h(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*c/n,n/(e*i*c)):1/0}function d(t,e,r,a){var i,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((a||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Rn,s=a?Ur:jr;return i=t(e,r,s,n),o=t(r,e,s,vr),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Dr)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Hn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Vn(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],vr,!1)};t.scale.log=function(){return function t(e,r,n,a){function i(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(i(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((a=t.map(Number)).map(i)),s):a},s.base=function(t){return arguments.length?(r=+t,e.domain(a.map(i)),s):r},s.nice=function(){var t=Fn(a.map(i),n?Math:Gn);return e.domain(t),a=t.map(o),s},s.ticks=function(){var t=zn(a),e=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),p=r%1?2:r;if(isFinite(u-c)){if(n){for(;c0;f--)e.push(o(c)*f);for(c=0;e[c]l;u--);e=e.slice(c,u)}return e},s.copy=function(){return t(e.copy(),r,n,a)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Yn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Yn(r),i=Yn(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return Hn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Vn(n,t))},o.exponent=function(t){return arguments.length?(a=Yn(r=t),i=Yn(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new b;for(var e,i=-1,o=t.length;++i0?a[t-1]:r[0],tp?0:1;if(c=St)return l(c,h)+(s?l(s,1-h):"")+"Z";var d,m,y,g,v,x,_,b,w,T,k,M,A=0,S=0,L=[];if((g=(+o.apply(this,arguments)||0)/2)&&(y=n===$n?Math.sqrt(s*s+c*c):+n.apply(this,arguments),h||(S*=-1),c&&(S=Ct(y/c*Math.sin(g))),s&&(A=Ct(y/s*Math.sin(g)))),c){v=c*Math.cos(u+S),x=c*Math.sin(u+S),_=c*Math.cos(p-S),b=c*Math.sin(p-S);var E=Math.abs(p-u-2*S)<=Mt?0:1;if(S&&aa(v,x,_,b)===h^E){var P=(u+p)/2;v=c*Math.cos(P),x=c*Math.sin(P),_=b=null}}else v=x=0;if(s){w=s*Math.cos(p-A),T=s*Math.sin(p-A),k=s*Math.cos(u+A),M=s*Math.sin(u+A);var C=Math.abs(u-p+2*A)<=Mt?0:1;if(A&&aa(w,T,k,M)===1-h^C){var I=(u+p)/2;w=s*Math.cos(I),T=s*Math.sin(I),k=M=null}}else w=T=0;if(f>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function ia(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,c=-s*i,u=t[0]+l,p=t[1]+c,f=e[0]+l,h=e[1]+c,d=(u+f)/2,m=(p+h)/2,y=f-u,g=h-p,v=y*y+g*g,x=r-n,_=u*h-f*p,b=(g<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-_*_)),w=(_*g-y*b)/v,T=(-_*y-g*b)/v,k=(_*g+y*b)/v,M=(-_*y+g*b)/v,A=w-d,S=T-m,L=k-d,E=M-m;return A*A+S*S>L*L+E*E&&(w=k,T=M),[[w-l,T-c],[w*r/x,T*r/x]]}function oa(){return!0}function sa(t){var e=be,r=we,n=oa,a=ca,i=a.key,o=.7;function s(i){var s,l=[],c=[],u=-1,p=i.length,f=ce(e),h=ce(r);function d(){l.push("M",a(t(c),o))}for(;++u1&&a.push("H",n[0]);return a.join("")},"step-before":pa,"step-after":fa,basis:ma,"basis-open":function(t){if(t.length<4)return ca(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(ya(xa,i)+","+ya(xa,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function ca(t){return t.length>1?t.join("L"):t+"Z"}function ua(t){return t.join("L")+"Z"}function pa(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var c=2;cMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=ce(t),i):r},i.source=function(e){return arguments.length?(t=ce(e),i):t},i.target=function(t){return arguments.length?(e=ce(t),i):e},i.startAngle=function(t){return arguments.length?(n=ce(t),i):n},i.endAngle=function(t){return arguments.length?(a=ce(t),i):a},i},t.svg.diagonal=function(){var t=ka,e=Ma,r=Sa;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ce(e),n):t},n.target=function(t){return arguments.length?(e=ce(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Sa,n=e.projection;return e.projection=function(t){return arguments.length?n(La(r=t)):r},e},t.svg.symbol=function(){var t=Pa,e=Ea;function r(r,n){return(Ia.get(t.call(this,r,n))||Ca)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ce(e),r):t},r.size=function(t){return arguments.length?(e=ce(t),r):e},r};var Ia=t.map({circle:Ca,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*za)),r=e*za;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/Da),r=e*Da/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Da),r=e*Da/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ia.keys();var Da=Math.sqrt(3),za=Math.tan(30*Et);Y.transition=function(t){for(var e,r,n=Na||++Ua,a=Ha(t),i=[],o=Ba||{time:Date.now(),ease:Lr,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--f].call(t,o);if(i>=1)return p.event&&p.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}p||(i=a.time,o=ge((function(t){var e=p.delay;if(o.t=e+i,e<=t)return f(t-e);o.c=f}),0,i),p=u[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}ja.call=Y.call,ja.empty=Y.empty,ja.node=Y.node,ja.size=Y.size,t.transition=function(e,r){return e&&e.transition?Na?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ja,ja.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=Z(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function y(){var p,y,g=this,v=t.select(t.event.target),x=n.of(g,arguments),_=t.select(g),b=v.datum(),w=!/^(n|s)$/.test(b)&&a,T=!/^(e|w)$/.test(b)&&i,k=v.classed("extent"),M=_t(g),A=t.mouse(g),S=t.select(o(g)).on("keydown.brush",P).on("keyup.brush",C);if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",z):S.on("mousemove.brush",I).on("mouseup.brush",z),_.interrupt().selectAll("*").interrupt(),k)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(b){var L=+/w$/.test(b),E=+/^n/.test(b);y=[s[1-L]-A[0],l[1-E]-A[1]],A[0]=s[L],A[1]=l[E]}else t.event.altKey&&(p=A.slice());function P(){32==t.event.keyCode&&(k||(p=null,A[0]-=s[1],A[1]-=l[1],k=2),F())}function C(){32==t.event.keyCode&&2==k&&(A[0]+=s[1],A[1]+=l[1],k=0,F())}function I(){var e=t.mouse(g),r=!1;y&&(e[0]+=y[0],e[1]+=y[1]),k||(t.event.altKey?(p||(p=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=f,r.lengthToDegrees=function(t,e){return h(f(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=h,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(f(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],47:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,c,u,p,f=0,h=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;vc||h>u||d>p)return l=a,c=r,u=h,p=d,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=f,r.lengthToDegrees=function(t,e){return h(f(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=h,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(f(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var a=r.areaFactors[e];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return t/a*i},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],53:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function a(t,e,r){if(null!==t)for(var n,i,o,s,l,c,u,p,f=0,h=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;vc||h>u||d>p)return l=a,c=r,u=h,p=d,void(o=0);var m=n.lineString([l,a],t.properties);if(!1===e(m,r,i,d,o))return!1;o++,l=a}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,a){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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":661}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1214}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":806}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":819}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":829}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":522}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":838}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":857}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":871}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":878}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":884}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":899}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":910}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":639}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":918}],16:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1215}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":928}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":937}],19:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1216}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":950}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":960}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":972}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":978}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":982}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/icicle")},{"../src/traces/icicle":988}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":1001}],27:[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("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./image"),t("./pie"),t("./sunburst"),t("./treemap"),t("./icicle"),t("./funnelarea"),t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./scattergeo"),t("./choropleth"),t("./pointcloud"),t("./heatmapgl"),t("./parcats"),t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./sankey"),t("./indicator"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./barpolar"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./icicle":25,"./image":26,"./indicator":28,"./isosurface":29,"./mesh3d":30,"./ohlc":31,"./parcats":32,"./pie":33,"./pointcloud":34,"./sankey":35,"./scatter3d":36,"./scattercarpet":37,"./scattergeo":38,"./scattermapbox":39,"./scatterpolar":40,"./scatterternary":41,"./sort":42,"./streamtube":43,"./sunburst":44,"./surface":45,"./table":46,"./treemap":47,"./violin":48,"./volume":49,"./waterfall":50}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":1009}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1015}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1020}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1025}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1034}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1044}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1053}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1059}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1097}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1104}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1112}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1122}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1130}],41:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1138}],42:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1218}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1144}],44:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1152}],45:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1161}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1169}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/treemap")},{"../src/traces/treemap":1180}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1193}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1201}],50:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1209}],51:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),f=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:f},c)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(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}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r1||i>1)}function A(t,e,r){return t.sort(E),t.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&M(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),A(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),A(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+10,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,a)&&M(e))e.circularPathData.leftSmallArcRadius=10+e.width/2,e.circularPathData.leftLargeArcRadius=10+e.width/2,e.circularPathData.rightSmallArcRadius=10+e.width/2,e.circularPathData.rightLargeArcRadius=10+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(C):c.sort(L);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=10+e.width/2+u,e.circularPathData.leftLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(I):c.sort(P),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=10+e.width/2+u,e.circularPathData.rightLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){var e="";e="top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY;return e}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function E(t,e){return z(t)==z(e)?"bottom"==t.circularLinkType?C(t,e):L(t,e):z(e)-z(t)}function L(t,e){return t.y0-e.y0}function C(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function I(t,e){return e.y1-t.y1}function z(t){return t.target.column-t.source.column}function D(t){return t.target.x0-t.source.x1}function O(t,e){var r=T(t),n=D(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function R(t,e){var r=T(t),n=D(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function F(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=h*i.y0+f*i.y0+p*i.y1+d*i.y1,g=m-i.width/2,v=m+i.width/2;g>o.y0&&go.y0&&vo.y1)&&(c=v-o.y0+10,o=B(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0o.y1&&B(t,c,e,r)})))}}))}}))}function N(t,e){return t.y0>e.y0&&t.y0e.y0&&t.y1e.y1)}function B(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function j(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return b(t.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=R(e,t);return t.y1-r}if(e.target.column>t.target.column)return R(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function H(t,e){return b(t.source,e)==b(t.target,e)}function G(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}t.sankeyCircular=function(){var t,n,i=0,a=0,b=1,T=1,M=24,A=g,E=o,L=v,C=y,P=32,I=2,z=null;function D(){var t={nodes:L.apply(null,arguments),links:C.apply(null,arguments)};O(t),_(t,A,z),R(t),N(t),w(t,A),B(t,P,A),V(t);for(var e=4,r=0;r0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:a=a>0?a+25+10:a,right:i=i>0?i+25+10:i}}(o),h=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),o=b-i,s=T-a,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return i=i*l+r.left,b=0==r.right?b:b*l,a=a*c+r.top,T*=c,t.nodes.forEach((function(t){t.x0=i+t.column*((b-i-M)/n),t.x1=t.x0+M})),c}(o,u);l*=h,o.links.forEach((function(t){t.width=t.value*l})),c.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==c.length-1&&1==e||0==t.depth&&1==e?(t.y0=T/2-t.value*l,t.y1=t.y0+t.value*l):t.partOfCycle?0==k(t,r)?(t.y0=T/2+n,t.y1=t.y0+t.value*l):"top"==t.circularLinkType?(t.y0=a+n,t.y1=t.y0+t.value*l):(t.y0=T-t.value*l-n,t.y1=t.y0+t.value*l):0==u.top||0==u.bottom?(t.y0=(T-a)/e*n,t.y1=t.y0+t.value*l):(t.y0=(T-a)/2-e/2+n,t.y1=t.y0+t.value*l)}))}))}(l),y();for(var u=1,g=s;g>0;--g)v(u*=.99,l),y();function v(t,r){var n=c.length;c.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&k(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function y(){c.forEach((function(e){var r,n,i,o=a,s=e.length;for(e.sort(h),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-T)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=e[i]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function V(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return D.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:s(t),D):A},D.nodeAlign=function(t){return arguments.length?(E="function"==typeof t?t:s(t),D):E},D.nodeWidth=function(t){return arguments.length?(M=+t,D):M},D.nodePadding=function(e){return arguments.length?(t=+e,D):t},D.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),D):L},D.links=function(t){return arguments.length?(C="function"==typeof t?t:s(t),D):C},D.size=function(t){return arguments.length?(i=a=0,b=+t[0],T=+t[1],D):[b-i,T-a]},D.extent=function(t){return arguments.length?(i=+t[0][0],b=+t[1][0],a=+t[0][1],T=+t[1][1],D):[[i,a],[b,T]]},D.iterations=function(t){return arguments.length?(P=+t,D):P},D.circularLinkGap=function(t){return arguments.length?(I=+t,D):I},D.nodePaddingRatio=function(t){return arguments.length?(n=+t,D):n},D.sortNodes=function(t){return arguments.length?(z=t,D):z},D.update=function(t){return w(t,A),V(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1a&&(b=a);var o=e.min(i,(function(t){return(y-n-(t.length-1)*b)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}(),d();for(var a=1,o=M;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+b;if((r=a-b-y)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}function P(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return A.update=function(t){return P(t),t},A.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),A):_},A.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),A):w},A.nodeWidth=function(t){return arguments.length?(x=+t,A):x},A.nodePadding=function(t){return arguments.length?(b=+t,A):b},A.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),A):T},A.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),A):k},A.size=function(e){return arguments.length?(t=n=0,i=+e[0],y=+e[1],A):[i-t,y-n]},A.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],y=+e[1][1],A):[[t,n],[i,y]]},A.iterations=function(t){return arguments.length?(M=+t,A):M},A},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(y).target(x)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":134,"d3-collection":135,"d3-shape":146}],54:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},i=self.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=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}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function f(t,e){return te?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>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>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=f,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(f);function v(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return f(t(e),r)}:t)},t.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},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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=x(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,h,f=-1,p=a.length,d=i[s++],m=new _;++f=i.length)return e;var n=[],o=a[r++];return e.forEach((function(e,i){n.push({key:e,values:t(i,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,Y),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return q(t,this)}}function X(t){return"function"==typeof t?t:function(){return H(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=Z(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Y.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=mt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?D:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ht,t.selection.enter.prototype=ft,ft.append=Y.append,ft.empty=Y.empty,ft.node=Y.node,ft.call=Y.call,ft.size=Y.size,ft.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s1?Et:t<-1?-Et:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}var zt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-a,f=u*u+h*h;if(f<1e-12)n=Math.log(c/o)/zt,r=function(t){return[i+t*u,a+t*h,o*Math.exp(zt*t*n)]};else{var p=Math.sqrt(f),d=(c*c-o*o+4*f)/(2*o*2*p),m=(c*c-o*o-4*f)/(2*c*2*p),g=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(m*m+1)-m);n=(v-g)/zt,r=function(t){var e,r=t*n,s=It(g),l=o/(2*p)*(s*(e=zt*r+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+l*u,a+l*h,o*s/It(zt*r+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,h,f={x:0,y:0,k:1},p=[960,500],d=Rt,m=250,g=0,v="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(v,P).on(Ot+".zoom",z).on("dblclick.zoom",D).on(b,I)}function T(t){return[(t[0]-f.x)/f.k,(t[1]-f.y)/f.k]}function k(t){f.k=Math.max(d[0],Math.min(d[1],t))}function M(t,e){e=function(t){return[t[0]*f.k+f.x,t[1]*f.k+f.y]}(e),f.x+=t[0]-e[0],f.y+=t[1]-e[1]}function A(e,n,i,a){e.__chart__={x:f.x,y:f.y,k:f.k},k(Math.pow(2,a)),M(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-f.x)/f.k})).map(l.invert)),h&&h.domain(u.range().map((function(t){return(t-f.y)/f.k})).map(u.invert))}function E(t){g++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function C(t){--g||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,l).on(x,c),a=T(t.mouse(e)),s=bt(e);function l(){n=1,M(t.mouse(e),a),L(r)}function c(){i.on(y,null).on(x,null),s(n),C(r)}Oi.call(e),E(r)}function I(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=t.select(r),p=bt(r);function d(){var n=t.touches(r);return e=f.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o1){v=p[0];var x=p[1],b=v[0]-x[0],_=v[1]-x[1];a=b*b+_*_}}function g(){var o,l,c,u,h=t.touches(r);Oi.call(r);for(var f=0,p=h.length;f360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new Qt(a(t+120),a(t),a(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Ht?e.l:(e=ae((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Nt(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Nt(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Ft;function qt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Ht(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Ht(t,e,r){return this instanceof Ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Ht?new Ht(t.l,t.a,t.b):t instanceof Ut?qt(t.h,t.c,t.l):ae((t=Qt(t)).r,t.g,t.b):new Ht(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Vt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},t.lab=Ht;var Gt=18,Yt=Ht.prototype=new Ft;function Zt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new Qt(Jt(3.2404542*(i=.95047*Wt(i))-1.5371385*(n=1*Wt(n))-.4985314*(a=1.08883*Wt(a))),Jt(-.969266*i+1.8760108*n+.041556*a),Jt(.0556434*i-.2040259*n+1.0572252*a))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Wt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Kt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Jt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,jt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}Yt.brighter=function(t){return new Ht(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new Ht(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Zt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Ft;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(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(se(i[0]),se(i[1]),se(i[2]))}return(a=le.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 ie(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+(e0&&l<1?0:n),new Nt(n,i,l)}function ae(t,e,r){var n=Kt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),i=Kt((.2126729*t+.7151522*e+.072175*r)/1);return Ht(116*i-16,500*(n-i),200*(i-Kt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.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=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ce,t.xhr=ue(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=he(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(me),me=setTimeout(ye,e)),de=0):(de=1,ge(ye))}function xe(){for(var t=Date.now(),e=fe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function be(){for(var t,e=fe,r=1/0;e;)e.c?(e.t1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ve.apply(this,arguments)},t.timer.flush=function(){xe(),be()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ce(e),a=ce(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;nkt)s=s.L;else{if(!((i=a-Ve(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fe(t);if(Pe.insert(e,l),e||r){if(e===r)return Ze(e),r=Fe(e.site),Pe.insert(l,r),l.edge=r.edge=Ke(e.site,l.site),Ye(e),void Ye(r);if(r){Ze(e),Ze(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,p=t.y-h,d=r.site,m=d.x-u,g=d.y-h,v=2*(f*g-p*m),y=f*f+p*p,x=m*m+g*g,b={x:(g*y-p*x)/v+u,y:(f*x-m*y)/v+h};Qe(r.edge,c,d,b),l.edge=Ke(c,t,null,b),r.edge=Ke(t,d,null,b),Ye(e),Ye(r)}else l.edge=Ke(e.site,l.site)}}function Ue(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;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function Ve(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function qe(t){this.site=t,this.edges=[]}function He(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(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,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-1e-12)){var f=l*l+c*c,p=u*u+g*g,d=(g*f-c*p)/h,m=(l*p-u*f)/h,g=m+s,v=Oe.pop()||new Ge;v.arc=t,v.site=i,v.x=d+o,v.y=g+Math.sqrt(d*d+m*m),v.cy=g,t.circle=v;for(var y=null,x=ze._;x;)if(v.y=s)return;if(f>d){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(f>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=f,f<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=i-l,f||!(e<0)){if(e/=f,f<0){if(e>h)return;e>u&&(u=e)}else if(f>0){if(e0)){if(e/=p,p<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=a-c,p||!(e<0)){if(e/=p,p<0){if(e>h)return;e>u&&(u=e)}else if(p>0){if(e0&&(t.a={x:l+u*f,y:c+u*p}),h<1&&(t.b={x:l+h*f,y:c+h*p}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)kt||y(i-r)>kt)&&(s.splice(o,0,new $e(Je(a.site,u,y(n-h)kt?{x:h,y:y(e-h)kt?{x:y(r-d)kt?{x:f,y:y(e-f)kt?{x:y(r-p)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ar(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ar(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(He),u=-1,h=c.length,f=c[h-1].edge,p=f.l===l?f.r:f.l;++ua||h>o||f=_)<<1|e>=b,T=w+4;wa&&(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:dr(r,n)})),a=vr.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;hm&&(m=b),_>g&&(g=_),c.push(b),u.push(_)}var w=m-p,T=g-d;function k(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(y(l-r)+y(c-n)<.01)M(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,l,c,i,a,o,s),M(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,i,a,o,s)}function M(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,f=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,k(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?g=d+w:m=p+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+v(t,++h),+x(t,h),p,d,m,g)},visit:function(t){ur(t,A,p,d,m,g)},find:function(t){return hr(A,t[0],t[1],p,d,m,g)}};if(h=-1,null==e){for(;++h=0&&!(n=t.interpolators[i](e,r)););return n}function xr(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Ar(t){return t*t}function Sr(t){return t*t*t}function Er(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 Lr(t){return 1-Math.cos(t*Et)}function Cr(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Ir(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 zr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Dr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Rr(i),s=Or(i,a),l=Rr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=_r.get(n)||br,Tr((i=wr.get(i)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Zt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=zr,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Dr(e?e.matrix:Fr)})(e)},Dr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Nr(t){return t.length?t.pop()+",":""}function Br(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(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:dr(t[0],e[0])},{i:i-2,x:dr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Nr(r)+"rotate(",null,")")-2,x:dr(t,e)})):e&&r.push(Nr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Nr(r)+"skewX(",null,")")-2,x:dr(t,e)}):e&&r.push(Nr(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Nr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:dr(t[0],e[0])},{i:i-2,x:dr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Nr(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ve(s.tick)),s):n},s.start=function(){var t,e,r,n=v.length,l=y.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function $r(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=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return $r(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return 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,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function dn(t){return t.reduce(mn,0)}function mn(t,e){return t+e[1]}function gn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(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 yn(e){return[t.min(e),t.max(e)]}function xn(t,e){return t.value-e.value}function bn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(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 Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,f=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(An(r,n,i=e[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&((s=c[t.bisect(f,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ce(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return vn(e,t)}:ce(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(xn),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+u(t.value)})),$r(s,Tn),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;$r(s,(function(t){t.r+=h})),$r(s,Tn),$r(s,(function(t){t.r-=h}))}return function t(e,r,n,i){var a=e.children;if(e.x=r+=i*e.x,e.y=n+=i*e.y,e.r*=i,a)for(var o=-1,s=a.length;++op.x&&(p=t),t.depth>d.depth&&(d=t)}));var m=r(f,p)/2-f.x,g=n[0]/(p.x+r(p,f)/2+m),v=n[1]/(d.depth||1);Qr(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*v}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=Ln(s),a=En(a),s&&a;)l=En(l),(o=Ln(o)).a=t,(i=s.z+h-a.z-c+r(s._,a._))>0&&(Cn(Pn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!En(l)&&(l.t=a,l.m+=c-f,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Jr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;$r(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var h=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),f=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return $r(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Jr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=In,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(h)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(f)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Rn,s=i?Ur:jr;return a=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return a(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(zr)},l.clamp=function(t){return arguments.length?(i=t,s()):i},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Hn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Vn(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,i){function a(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(a(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((i=t.map(Number)).map(a)),s):i},s.base=function(t){return arguments.length?(r=+t,e.domain(i.map(a)),s):r},s.nice=function(){var t=Fn(i.map(a),n?Math:Gn);return e.domain(t),i=t.map(o),s},s.ticks=function(){var t=Dn(i),e=[],s=t[0],l=t[1],c=Math.floor(a(s)),u=Math.ceil(a(l)),h=r%1?2:r;if(isFinite(u-c)){if(n){for(;c0;f--)e.push(o(c)*f);for(c=0;e[c]l;u--);e=e.slice(c,u)}return e},s.copy=function(){return t(e.copy(),r,n,i)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Yn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=Yn(r),a=Yn(1/r);function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n},o.ticks=function(t){return Hn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Vn(n,t))},o.exponent=function(t){return arguments.length?(i=Yn(r=t),a=Yn(1/r),e.domain(n.map(i)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||("range"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],i=new _;for(var e,a=-1,o=t.length;++a0?i[t-1]:r[0],th?0:1;if(c=St)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,m,g,v,y,x,b,_,w,T,k,M,A=0,S=0,E=[];if((v=(+o.apply(this,arguments)||0)/2)&&(g=n===Qn?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Pt(g/c*Math.sin(v))),s&&(A=Pt(g/s*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(h-S),_=c*Math.sin(h-S);var L=Math.abs(h-u-2*S)<=Mt?0:1;if(S&&ii(y,x,b,_)===p^L){var C=(u+h)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(s){w=s*Math.cos(h-A),T=s*Math.sin(h-A),k=s*Math.cos(u+A),M=s*Math.sin(u+A);var P=Math.abs(u-h+2*A)<=Mt?0:1;if(A&&ii(w,T,k,M)===1-p^P){var I=(u+h)/2;w=s*Math.cos(I),T=s*Math.sin(I),k=M=null}}else w=T=0;if(f>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function ai(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,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,p=e[1]+c,d=(u+f)/2,m=(h+p)/2,g=f-u,v=p-h,y=g*g+v*v,x=r-n,b=u*p-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,T=(-b*g-v*_)/y,k=(b*v+g*_)/y,M=(-b*g+v*_)/y,A=w-d,S=T-m,E=k-d,L=M-m;return A*A+S*S>E*E+L*L&&(w=k,T=M),[[w-l,T-c],[w*r/x,T*r/x]]}function oi(){return!0}function si(t){var e=_e,r=we,n=oi,i=ci,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,f=ce(e),p=ce(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]);return i.join("")},"step-before":hi,"step-after":fi,basis:mi,"basis-open":function(t){if(t.length<4)return ci(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(gi(xi,a)+","+gi(xi,o)),--n;for(;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++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}(t))}});function ci(t){return t.length>1?t.join("L"):t+"Z"}function ui(t){return t.join("L")+"Z"}function hi(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){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 c=2;cMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ce(t),a):r},a.source=function(e){return arguments.length?(t=ce(e),a):t},a.target=function(t){return arguments.length?(e=ce(t),a):e},a.startAngle=function(t){return arguments.length?(n=ce(t),a):n},a.endAngle=function(t){return arguments.length?(i=ce(t),a):i},a},t.svg.diagonal=function(){var t=ki,e=Mi,r=Si;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ce(e),n):t},n.target=function(t){return arguments.length?(e=ce(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Si,n=e.projection;return e.projection=function(t){return arguments.length?n(Ei(r=t)):r},e},t.svg.symbol=function(){var t=Ci,e=Li;function r(r,n){return(Ii.get(t.call(this,r,n))||Pi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ce(e),r):t},r.size=function(t){return arguments.length?(e=ce(t),r):e},r};var Ii=t.map({circle:Pi,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*Di)),r=e*Di;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/zi),r=e*zi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/zi),r=e*zi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ii.keys();var zi=Math.sqrt(3),Di=Math.tan(30*Lt);Y.transition=function(t){for(var e,r,n=Ni||++Ui,i=Hi(t),a=[],o=Bi||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=ve((function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f}),0,a),h=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}ji.call=Y.call,ji.empty=Y.empty,ji.node=Y.node,ji.size=Y.size,t.transition=function(e,r){return e&&e.transition?Ni?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ji,ji.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=Z(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,v=this,y=t.select(t.event.target),x=n.of(v,arguments),b=t.select(v),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,T=!/^(e|w)$/.test(_)&&a,k=y.classed("extent"),M=bt(v),A=t.mouse(v),S=t.select(o(v)).on("keydown.brush",C).on("keyup.brush",P);if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",D):S.on("mousemove.brush",I).on("mouseup.brush",D),b.interrupt().selectAll("*").interrupt(),k)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var E=+/w$/.test(_),L=+/^n/.test(_);g=[s[1-E]-A[0],l[1-L]-A[1]],A[0]=s[E],A[1]=l[L]}else t.event.altKey&&(h=A.slice());function C(){32==t.event.keyCode&&(k||(h=null,A[0]-=s[1],A[1]-=l[1],k=2),F())}function P(){32==t.event.keyCode&&2==k&&(A[0]+=s[1],A[1]+=l[1],k=0,F())}function I(){var e=t.mouse(v),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),k||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]0){e+=Math.abs(a(t[0]));for(var r=1;r2){for(s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=h,r.lengthToRadians=f,r.lengthToDegrees=function(t,e){return p(f(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(f(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],57:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,h,f=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,v=m?t.features.length:1,y=0;yc||p>u||d>h)return l=i,c=r,u=p,h=d,void(o=0);var m=n.lineString([l,i],t.properties);if(!1===e(m,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=h,r.lengthToRadians=f,r.lengthToDegrees=function(t,e){return p(f(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(f(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],63:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,h,f=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,v=m?t.features.length:1,y=0;yc||p>u||d>h)return l=i,c=r,u=p,h=d,void(o=0);var m=n.lineString([l,i],t.properties);if(!1===e(m,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s * @license MIT - */function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a=0;c--)if(u[c]!==p[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var a;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!a&&g(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&b(a,r)||s)&&g(a,r,"Got unwanted exception"+n),t&&a&&r&&!b(a,r)||!t&&a)throw a}f.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=function(t){return m(y(t.actual),128)+" "+t.operator+" "+m(y(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=d(e),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(f.AssertionError,Error),f.fail=g,f.ok=v,f.equal=function(t,e,r){t!=e&&g(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){x(t,e,!1)||g(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){x(t,e,!0)||g(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){x(t,e,!1)&&g(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){w(!0,t,e,r)},f.doesNotThrow=function(t,e,r){w(!1,t,e,r)},f.ifError=function(t){if(t)throw t},f.strict=n((function t(e,r){e||g(e,!0,r,"==",t)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var T=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":122,"util/":57}],55:[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}},{}],56:[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}},{}],57:[function(t,e,r){(function(e,n){(function(){var a=/%[sdj%]/g;r.format=function(t){if(!g(t)){for(var e=[],r=0;r=i)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}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(n,t);return g(a)||(a=u(t,a,n)),a}var i=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(e);if(0===o.length){if(T(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(b(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return p(e)}var c,_="",k=!1,M=["{","}"];(h(e)&&(k=!0,M=["[","]"]),T(e))&&(_=" [Function"+(e.name?": "+e.name:"")+"]");return x(e)&&(_=" "+RegExp.prototype.toString.call(e)),b(e)&&(_=" "+Date.prototype.toUTCString.call(e)),w(e)&&(_=" "+p(e)),0!==o.length||k&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=k?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,_,M)):M[0]+_+M[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),L(n,a)||(o="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=i?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")),v(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).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 h(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function y(t){return"number"==typeof t}function g(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===k(t)}function _(t){return"object"==typeof t&&null!==t}function b(t){return _(t)&&"[object Date]"===k(t)}function w(t){return _(t)&&("[object Error]"===k(t)||t instanceof Error)}function T(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(v(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=h,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(t){return null==t},r.isNumber=y,r.isString=g,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=v,r.isRegExp=x,r.isObject=_,r.isDate=b,r.isError=w,r.isFunction=T,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",S(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":56,_process:147,inherits:55}],58:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=c(t),o=n[0],s=n[1],l=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,s)),u=0,p=s>0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var a,i,o=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],59:[function(t,e,r){},{}],60:[function(t,e,r){"use strict";var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(r,n){function a(){void 0!==i&&t.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==e&&(i=function(r){t.removeListener(e,a),n(r)},t.once("error",i)),t.once(e,a)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function p(t,e,r,n){var a,i,o,s;if(c(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),o=i[e]),void 0===o)o=i[e]=r,++t._eventsCount;else if("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(a=u(t))>0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=f.bind(n);return a.listener=r,n.wrapFn=a,a}function d(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var c=l.length,u=y(l,c);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],61:[function(t,e,r){(function(e){(function(){ + */function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;c--)if(u[c]!==h[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(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=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&i&&!r;if((!t&&o.isError(i)&&a&&_(i,r)||s)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}f.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=function(t){return m(g(t.actual),128)+" "+t.operator+" "+m(g(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(f.AssertionError,Error),f.fail=v,f.ok=y,f.equal=function(t,e,r){t!=e&&v(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){x(t,e,!1)||v(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){x(t,e,!0)||v(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){x(t,e,!1)&&v(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){w(!0,t,e,r)},f.doesNotThrow=function(t,e,r){w(!1,t,e,r)},f.ifError=function(t){if(t)throw t},f.strict=n((function t(e,r){e||v(e,!0,r,"==",t)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var T=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":379,"util/":72}],70:[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}},{}],71:[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}},{}],72:[function(t,e,r){(function(e,n){(function(){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;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}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(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 v(i)||(i=u(t,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(e);if(0===o.length){if(T(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return h(e)}var c,b="",k=!1,M=["{","}"];(p(e)&&(k=!0,M=["[","]"]),T(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+h(e)),0!==o.length||k&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,M)):M[0]+b+M[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?u(t,l.value,null):u(t,l.value,r-1)).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")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).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 p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===k(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===k(t)}function w(t){return b(t)&&("[object Error]"===k(t)||t instanceof Error)}function T(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(t){return null==t},r.isNumber=g,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=x,r.isObject=b,r.isDate=_,r.isError=w,r.isFunction=T,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",S(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":71,_process:413,inherits:70}],73:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],74:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],76:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":86}],77:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],78:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":86}],79:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,h=0;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h));return s(c,u)}},{"./div":78,"./is-rat":80,"./lib/is-bn":84,"./lib/num-to-bn":85,"./lib/rationalize":86,"./lib/str-to-bn":87}],80:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":84}],81:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":94}],82:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":93,"double-bits":153}],84:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":94}],85:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":94,"double-bits":153}],86:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":81,"./num-to-bn":85}],87:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":94}],88:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":86}],89:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":81}],90:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":86}],91:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,h=n(l.ushln(u).divRound(r));return c*(s+h*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53;h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":82,"./lib/ctz":83}],92:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function s(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function l(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,i,a){return l(t,e,r,i,a,n)},gt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},lt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},le:function(t,e,r,n,i){return l(t,e,r,n,i,o)},eq:function(t,e,r,n,i){return l(t,e,r,n,i,s)}}},{}],93:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],94:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],h=[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];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,f=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var f=u[t],p=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:c[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,M=0|o[5],A=8191&M,S=M>>>13,E=0|o[6],L=8191&E,C=E>>>13,P=0|o[7],I=8191&P,z=P>>>13,D=0|o[8],O=8191&D,R=D>>>13,F=0|o[9],N=8191&F,B=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],Z=8191&Y,X=Y>>>13,W=0|s[3],K=8191&W,J=W>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,Z)|0))<<13)|0;c=((a=a+Math.imul(f,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,Z)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,K)|0))<<13)|0;c=((a=a+Math.imul(f,J)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,K)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,J)|0;var bt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(S,Z)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,J)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,Z)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(B,U)|0,a=Math.imul(B,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(z,Z)|0,a=a+Math.imul(z,X)|0,n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ht)|0,i=(i=i+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var Mt=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;c=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,G))+Math.imul(B,H)|0,a=Math.imul(B,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(R,Z)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,J)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,X))+Math.imul(B,Z)|0,a=Math.imul(B,X),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,K),i=(i=Math.imul(N,J))+Math.imul(B,K)|0,a=Math.imul(B,J),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(B,$)|0,a=Math.imul(B,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Lt=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(B,rt)|0,a=Math.imul(B,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|0,n=n+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(A,dt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(B,at)|0,a=Math.imul(B,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(z,ht)|0,a=a+Math.imul(z,ft)|0;var Pt=(c+(n=n+Math.imul(L,dt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,dt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ct))+Math.imul(B,lt)|0,a=Math.imul(B,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((a=a+Math.imul(z,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(N,ht),i=(i=Math.imul(N,ft))+Math.imul(B,ht)|0,a=Math.imul(B,ft);var zt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Dt=(c+(n=Math.imul(N,dt))|0)+((8191&(i=(i=Math.imul(N,mt))+Math.imul(B,dt)|0))<<13)|0;return c=((a=Math.imul(B,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=Mt,l[10]=At,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=It,l[17]=zt,l[18]=Dt,0!==c&&(l[19]=c,r.length++),r};function d(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=f),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new T(t)},i(T,w),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:103}],95:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var h,f=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,f,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,f,p,0,c,d,m):o(u,r,n,s,f,p,c,d,m),i.free(d),i.free(m))}i.free(f),i.free(p)}return h}}}function u(t,e){n.push([t,e])}function h(t){return n=[],c(t,t,u,!0),n}function f(t,e){return n=[],c(t,e,u,!1),n}},{"./lib/intersect":98,"./lib/sweep":102,"typedarray-pool":477}],97:[function(t,e,r){"use strict";function n(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=n,p=h*n;fc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=n,p=h*n;f0;){var L=6*(S-=1),C=v[L],P=v[L+1],I=v[L+2],z=v[L+3],D=v[L+4],O=v[L+5],R=2*S,F=y[R],N=y[R+1],B=1&O,j=!!(16&O),U=u,V=w,q=k,H=M;if(B&&(U=k,V=M,q=u,H=w),!(2&O&&(I=p(t,C,P,I,U,V,N),P>=I)||4&O&&(P=d(t,C,P,I,U,V,F))>=I)){var G=I-P,Y=D-z;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(A=l.scanComplete(t,C,e,P,I,U,V,z,D,q,H)))return A;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(A=o(t,C,e,B,P,I,U,V,z,D,q,H)))return A;continue}if(t*G*Y<1<<22){if(void 0!==(A=l.scanBipartite(t,C,e,B,P,I,U,V,z,D,q,H)))return A;continue}}var Z=h(t,C,P,I,U,V,F,N);if(P=p0)&&!(p1>=hi)"),f=u("lo===p0"),p=u("lo>>1,h=2*t,f=u,p=o[h*u+e];for(;l=y?(f=v,p=y):g>=b?(f=m,p=g):(f=x,p=b):y>=b?(f=v,p=y):b>=g?(f=m,p=g):(f=x,p=b);for(var _=h*(c-1),w=h*f,T=0;Tr&&i[h+e]>c;--u,h-=o){for(var f=h,p=h+o,d=0;df;++f,l+=s){if(i[l+h]===o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}}return u},"lof;++f,l+=s){if(i[l+h]p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s){if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s){if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}}return u},"lop;++p,l+=s){var d=i[l+h],m=i[l+f];if(dg;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,f=t+e,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,h=r,f=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+f],g=i[c+p];if(!(m>=o||s>=g))if(h===d)h+=1,u+=l;else{for(var v=0;l>v;++v){var y=i[c+v];i[c+v]=i[u],i[u++]=y}var x=a[d];a[d]=a[h],a[h++]=x}}return h}}},{}],101:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var h=(r-e+1)/6|0,f=e+h,p=r-h,d=e+r>>1,m=d-h,g=d+h,v=f,y=m,x=d,b=g,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var M=u[2*y],A=u[2*y+1],S=u[2*b],E=u[2*b+1],L=2*v,C=2*x,P=2*_,I=2*f,z=2*d,D=2*p,O=0;O<2;++O){var R=u[L+O],F=u[C+O],N=u[P+O];u[I+O]=R,u[z+O]=F,u[D+O]=N}a(m,e,u),a(g,r,u);for(var B=w;B<=T;++B)if(c(B,M,A,u))B!==w&&i(B,w,u),++w;else if(!c(B,S,E,u))for(;;){if(c(T,S,E,u)){c(T,M,A,u)?(o(B,w,T,u),++w,--T):(i(B,T,u),--T);break}if(--Tt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(f,A);var S=0,E=0;for(w=0;w=1<<28)p(l,c,E--,L=L-(1<<28)|0);else if(L>=0)p(o,s,S--,L);else if(L<=-(1<<28)){L=-L-(1<<28)|0;for(var C=0;C>>1;a(f,E);var L=0,C=0,P=0;for(k=0;k>1==f[2*k+3]>>1&&(z=2,k+=1),I<0){for(var D=-(I>>1)-1,O=0;O>1)-1;0===z?p(o,s,L--,D):1===z?p(l,c,C--,D):2===z&&p(u,h,P--,D)}}},scanBipartite:function(t,e,r,n,i,l,c,u,h,m,g,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=i;k>>1;a(f,E);var L=0;for(k=0;k=1<<28?(P=!n,M-=1<<28):(P=!!n,M-=1),P)d(o,s,L++,M);else{var I=v[M],z=x*M,D=g[z+e+1],O=g[z+e+1+t];t:for(var R=0;R>>1;a(f,w);var T=0;for(y=0;y=1<<28)o[T++]=x-(1<<28);else{var M=p[x-=1],A=m*x,S=h[A+e+1],E=h[A+e+1+t];t:for(var L=0;L=0;--L)if(o[L]===x){for(z=L+1;z0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)a(l,this,e);else{var c=l.length,u=g(l,c);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],105:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},r.INSPECT_MAX_BYTES=50;function a(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function p(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(a)return n?-1:O(t).length;e=(""+e).toLowerCase(),a=!0}}function f(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function h(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var u=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var p=!0,f=0;fa&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:c>223?3:c>191?2:1;if(a+p<=r)switch(p){case 1:c<128&&(u=c);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&c)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,p=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=p}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,a),u=t.slice(e,r),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,a,i){return e=+e,r>>>=0,i||P(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function I(t,e,r,a,i){return e=+e,r>>>=0,i||P(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||E(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||E(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);E(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":58,buffer:61,ieee754:114}],62:[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"}},{}],63:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return te?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}var n=r(e),a=n.right,i=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,a=t.length,i=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(i-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,a,i=t.length,o=-1;if(null==e){for(;++o=r)for(n=a=r;++or&&(n=r),a=r)for(n=a=r;++or&&(n=r),a=0?(i>=g?10:i>=v?5:i>=x?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=g?10:i>=v?5:i>=x?2:1)}function b(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),i=n/a;return i>=g?a*=10:i>=v?a*=5:i>=x&&(a*=2),e=1)return+r(t[n-1],n-1,t);var n,a=(n-1)*e,i=Math.floor(a),o=+r(t[i],i,t);return o+(+r(t[i+1],i+1,t)-o)*(a-i)}}function k(t,e){var r,n,a=t.length,i=-1;if(null==e){for(;++i=r)for(n=r;++ir&&(n=r)}else for(;++i=r)for(n=r;++ir&&(n=r);return n}function M(t){if(!(a=t.length))return[];for(var e=-1,r=k(t,A),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var i,o,s=n.length,l=new Array(s);for(i=0;ip;)f.pop(),--h;var d,m=new Array(h+1);for(i=0;i<=h;++i)(d=m[i]=[]).x0=i>0?f[i-1]:u,d.x1=i=r)for(n=r;++in&&(n=r)}else for(;++i=r)for(n=r;++in&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,a=n,i=-1,o=0;if(null==e)for(;++i=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),i=new Array(a=Math.ceil(e-t+1));++s=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,p,f=-1,h=n.length,d=l[a++],m=r(),y=i();++fl.length)return r;var a,i=c[n-1];return null!=e&&n>=l.length?a=r.entries():(a=[],r.each((function(e,r){a.push({key:r,values:t(e,n)})}))),null!=i?a.sort((function(t,e){return i(t.key,e.key)})):a}(u(t,0,i,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],65:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var a="\\s*([+-]?\\d+)\\s*",i="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),u=new RegExp("^rgba\\("+[a,a,a,i]+"\\)$"),p=new RegExp("^rgba\\("+[o,o,o,i]+"\\)$"),f=new RegExp("^hsl\\("+[i,o,o]+"\\)$"),h=new RegExp("^hsla\\("+[i,o,o,i]+"\\)$"),d={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};function m(){return this.rgb().formatHex()}function y(){return this.rgb().formatRgb()}function g(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?v(e):3===r?new w(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new w(e[1],e[2],e[3],1):(e=c.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=u.exec(t))?x(e[1],e[2],e[3],e[4]):(e=p.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=f.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=h.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):d.hasOwnProperty(t)?v(d[t]):"transparent"===t?new w(NaN,NaN,NaN,0):null}function v(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function _(t){return t instanceof n||(t=g(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function b(t,e,r,n){return 1===arguments.length?_(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function T(){return"#"+M(this.r)+M(this.g)+M(this.b)}function k(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function M(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function A(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new E(t,e,r,n)}function S(t){if(t instanceof E)return new E(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=g(t)),!t)return new E;if(t instanceof E)return t;var e=(t=t.rgb()).r/255,r=t.g/255,a=t.b/255,i=Math.min(e,r,a),o=Math.max(e,r,a),s=NaN,l=o-i,c=(o+i)/2;return l?(s=e===o?(r-a)/l+6*(r0&&c<1?0:s,new E(s,l,c,t.opacity)}function L(t,e,r,n){return 1===arguments.length?S(t):new E(t,e,r,null==n?1:n)}function E(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function P(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,g,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:m,formatHex:m,formatHsl:function(){return S(this).formatHsl()},formatRgb:y,toString:y}),e(w,b,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:T,formatHex:T,formatRgb:k,toString:k})),e(E,L,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new E(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new E(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new w(P(t>=240?t-240:t+120,a,n),P(t,a,n),P(t<120?t+240:t-120,a,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var C=Math.PI/180,I=180/Math.PI,D=6/29,z=3*D*D;function O(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof H)return G(t);t instanceof w||(t=_(t));var e,r,n=U(t.r),a=U(t.g),i=U(t.b),o=N((.2225045*n+.7168786*a+.0606169*i)/1);return n===a&&a===i?e=r=o:(e=N((.4360747*n+.3850649*a+.1430804*i)/.96422),r=N((.0139322*n+.0971045*a+.7141733*i)/.82521)),new F(116*o-16,500*(e-o),200*(o-r),t.opacity)}function R(t,e,r,n){return 1===arguments.length?O(t):new F(t,e,r,null==n?1:n)}function F(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function N(t){return t>.008856451679035631?Math.pow(t,1/3):t/z+4/29}function B(t){return t>D?t*t*t:z*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t){if(t instanceof H)return new H(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=O(t)),0===t.a&&0===t.b)return new H(NaN,0=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function i(t,e){for(var r,n=0,a=t.length;n0)for(var r,n,a=new Array(r),i=0;if+c||nh+c||iu.index){var p=f-s.x-s.vx,y=h-s.y-s.vy,g=p*p+y*y;gt.r&&(t.r=t[e].r)}function f(){if(r){var e,a,i=r.length;for(n=new Array(i),e=0;e=c)){(t.data!==r||t.next)&&(0===p&&(d+=(p=o())*p),0===f&&(d+=(f=o())*f),d1?(null==r?u.remove(t):u.set(t,g(r)),e):u.get(t)},find:function(e,r,n){var a,i,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,a=i(.1);function o(t){for(var a,i=0,o=e.length;i1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var a=e(t,r);if(!a)return t+"";var i=a[0],o=a[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=i.length;return s===l?i:s>l?i+new Array(s-l+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,p=Array.prototype.map,f=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function h(t){var e,a,o=void 0===t.grouping||void 0===t.thousands?c:(e=p.call(t.grouping,Number),a=t.thousands+"",function(t,r){for(var n=t.length,i=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(a)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",h=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(p.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",y=void 0===t.minus?"-":t.minus+"",g=void 0===t.nan?"NaN":t.nan+"";function v(t){var e=(t=i(t)).fill,r=t.align,a=t.sign,c=t.symbol,p=t.zero,v=t.width,x=t.comma,_=t.precision,b=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===_&&(_=12),b=!0,w="g"),(p||"0"===e&&"="===r)&&(p=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?m:"",M=l[w],A=/[defgprs%]/.test(w);function S(t){var i,s,l,c=T,u=k;if("c"===w)u=M(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?g:M(Math.abs(t),_),b&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==a&&(m=!1),c=(m?"("===a?a:y:"-"===a||"("===a?"":a)+c,u=("s"===w?f[8+n/3]:"")+u+(m&&"("===a?")":""),A)for(i=-1,s=t.length;++i(l=t.charCodeAt(i))||l>57){u=(46===l?h+t.slice(i+1):t.slice(i))+u,t=t.slice(0,i);break}}x&&!p&&(t=o(t,1/0));var S=c.length+t.length+u.length,L=S>1)+c+t+u+L.slice(S);break;default:t=L+c+t+u}return d(t)}return _=void 0===_?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:v,formatPrefix:function(t,e){var n=v(((t=i(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-a),s=f[8+a/3];return function(t){return n(o*t)+s}}}}function d(e){return u=h(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=h,t.formatSpecifier=i,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],69:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-geo"),t("d3-array")):a(n.d3=n.d3||{},n.d3,n.d3)}(this,(function(t,e,r){"use strict";var n=Math.abs,a=Math.atan,i=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,p=Math.min,f=Math.pow,h=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,y=Math.tan,g=1e-6,v=Math.PI,x=v/2,_=v/4,b=Math.SQRT1_2,w=E(2),T=E(v),k=2*v,M=180/v,A=v/180;function S(t){return t>1?x:t<-1?-x:Math.asin(t)}function L(t){return t>1?0:t<-1?v:Math.acos(t)}function E(t){return t>0?Math.sqrt(t):0}function P(t){return(s(t)-s(-t))/2}function C(t){return(s(t)+s(-t))/2}function I(t){var e=y(t/2),r=2*c(o(t/2))/(e*e);function a(t,e){var n=o(t),a=o(e),i=m(e),s=a*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*a*m(t),l*i]}return a.invert=function(e,a){var s,l=E(e*e+a*a),u=-t/2,p=50;if(!l)return[0,0];do{var f=u/2,h=o(f),d=m(f),y=d/h,v=-c(n(h));u-=s=(2/y*v-r*y-l)/(-v/(d*d)+1-r/(2*h*h))*(h<0?.7:1)}while(n(s)>g&&--p>0);var x=m(u);return[i(e*x,l*o(u)),S(a*x/l)]},a}function D(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(L(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function z(t){var e=m(t),r=o(t),a=t>=0?1:-1,s=y(a*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(a*n>-i(u,s)-.001?0:10*-a)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,p=0,f=50;do{var h=o(u),d=m(u),y=o(p),v=m(p),x=1+y,_=x*d-t,b=l+v*r-x*e*h-c,w=x*h/2,T=-d*v,k=e*x*d/2,M=r*y+e*h*v,A=T*k-M*w,S=(b*T-_*M)/A/2,L=(_*k-b*w)/A;n(L)>2&&(L/=2),u-=S,p-=L}while((n(S)>g||n(L)>g)&&--f>0);return a*p>-i(o(u),s)-.001?[2*u,p]:null},c}function O(t,e){var r=y(e/2),n=E(1-r*r),a=1+n*o(t/=2),i=m(t)*n/a,s=r/a,l=i*i,c=s*s;return[4/3*i*(3+l-3*c),4/3*s*(3+3*l-c)]}D.invert=function(t,e){if(!(t*t+4*e*e>v*v+g)){var r=t,a=e,i=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),p=m(a),f=o(a),h=m(2*a),d=p*p,y=f*f,x=c*c,_=1-y*u*u,b=_?L(f*u)*E(s=1/_):s=0,w=2*b*f*c-t,T=b*p-e,k=s*(y*x+b*f*u*d),M=s*(.5*l*h-2*b*p*c),A=.25*s*(h*c-b*p*y*l),S=s*(d*u+b*x*f),P=M*A-S*k;if(!P)break;var C=(T*M-w*S)/P,I=(w*A-T*k)/P;r-=C,a-=I}while((n(C)>g||n(I)>g)&&--i>0);return[r,a]}},O.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,a=E((r-E(r*r-4*e*e))/2),s=S(a)/3,l=a?function(t){return c(t+E(t*t-1))}(n(e/a))/3:function(t){return c(t+E(t*t+1))}(n(t))/3,u=o(s),p=C(l),f=p*p-u*u;return[2*d(t)*i(P(l)*u,.25-f),2*d(e)*i(p*m(s),.25+f)]};var R=E(8),F=c(1+w);function N(t,e){var r=n(e);return r<_?[t,c(y(_+e/2))]:[t*o(r)*(2*w-1/m(r)),d(e)*(2*w*(r-_)-c(y(r/2)))]}function B(t){var r=2*v/t;function s(t,a){var s=e.geoAzimuthalEquidistantRaw(t,a);if(n(t)>x){var l=i(s[1],s[0]),c=E(s[0]*s[0]+s[1]*s[1]),u=r*h((l-x)/r)+x,p=i(m(l-=u),2-o(l));l=u+S(v/c*m(p))-p,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=E(t*t+n*n);if(s>x){var l=i(n,t),c=r*h((l-x)/r)+x,u=l>c?-1:1,p=s*o(c-l),f=1/y(u*L((p-v)/E(v*(v-2*p)+s*s)));l=c+2*a((f+u*E(f*f-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function j(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return U;function n(n,a){var i=e.geoAzimuthalEqualAreaRaw(n/r,a);return i[0]*=t,i}return n.invert=function(n,a){var i=e.geoAzimuthalEqualAreaRaw.invert(n/t,a);return i[0]*=r,i},n}function U(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function V(t,e,r){var a,i,o,s=100;r=void 0===r?0:+r,e=+e;do{(i=t(r))===(o=t(r+g))&&(o=i+g),r-=a=-1*g*(i-e)/(i-o)}while(s-- >0&&n(a)>g);return s<0?NaN:r}function q(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=1e-12),function(a,i,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var p=0;pl)o-=c/=2,s-=u/=2;else{l=m;var y=(o>0?-1:1)*r,g=(s>0?-1:1)*r,v=t(o+y,s),x=t(o,s+g),_=(v[0]-f[0])/y,b=(v[1]-f[1])/y,w=(x[0]-f[0])/g,T=(x[1]-f[1])/g,k=T*_-b*w,M=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-h*T)*M,s+=u=(h*b-d*_)*M,n(c)0&&(a[1]*=1+i/1.5*a[0]*a[0]),a}return e.invert=q(e),e}function G(t,e){var r,a=t*m(e),i=30;do{e-=r=(e+m(e)-a)/(1+o(e))}while(n(r)>g&&--i>0);return e/2}function Y(t,e,r){function n(n,a){return[t*n*o(a=G(r,a)),e*m(a)]}return n.invert=function(n,a){return a=S(a/e),[n/(t*o(a)),S((2*a+m(2*a))/r)]},n}N.invert=function(t,e){if((i=n(e))1e-12&&--u>0);return[t/(o(l)*(R-1/m(l))),d(e)*l]},U.invert=function(t,e){var r=2*S(e/2);return[t*o(r/2)/o(r),r]};var Z=Y(w/x,w,v);var X=2.00276,W=1.11072;function K(t,e){var r=G(v,e);return[X*t/(1/o(e)+W/o(r)),(e+w*m(r))/X]}function J(t){var r=0,n=e.geoProjectionMutator(t),a=n(r);return a.parallel=function(t){return arguments.length?n(r=t*A):r*M},a}function $(t,e){return[t*o(e),e]}function Q(t){if(!t)return $;var e=1/y(t);function r(r,n){var a=e+t-n,i=a?r*o(n)/a:a;return[a*m(i),e-a*o(i)]}return r.invert=function(r,n){var a=E(r*r+(n=e-n)*n),s=e+t-a;return[a/o(s)*i(r,n),s]},r}function tt(t){function e(e,r){var n=x-r,a=n?e*t*m(n)/n:n;return[n*m(a)/t,x-n*o(a)]}return e.invert=function(e,r){var n=e*t,a=x-r,o=E(n*n+a*a),s=i(n,a);return[(o?o/m(o):1)*s/t,x-o]},e}K.invert=function(t,e){var r,a,i=X*e,s=e<0?-_:_,l=25;do{a=i-w*m(s),s-=r=(m(2*s)+2*s-v*m(a))/(2*o(2*s)+2+v*o(a)*w*o(s))}while(n(r)>g&&--l>0);return a=i-w*m(s),[t*(1/o(a)+W/o(s))/X,a]},$.invert=function(t,e){return[t/o(e),e]};var et=Y(1,4/v,v);function rt(t,e,r,a,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=L(r*s+e*a*u);else{var p=m(t/2),f=m(l/2);c=2*S(E(p*p+e*a*f*f))}return n(c)>g?[c,i(a*m(l),e*s-r*a*u)]:[0,0]}function nt(t,e,r){return L((t*t+e*e-r*r)/(2*t*e))}function at(t){return t-2*v*l((t+v)/(2*v))}function it(t,e,r){for(var n,a=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],i=a[2],s=0;s<3;++s,i=n)n=a[s],i.v=rt(n[1]-i[1],i[3],i[2],n[3],n[2],n[0]-i[0]),i.point=[0,0];var l=nt(a[0].v[0],a[2].v[0],a[1].v[0]),c=nt(a[0].v[0],a[1].v[0],a[2].v[0]),u=v-l;a[2].point[1]=0,a[0].point[0]=-(a[1].point[0]=a[0].v[0]/2);var p=[a[2].point[0]=a[0].point[0]+a[2].v[0]*o(l),2*(a[0].point[1]=a[1].point[1]=a[2].v[0]*m(l))];return function(t,e){var r,n=m(e),i=o(e),s=new Array(3);for(r=0;r<3;++r){var l=a[r];if(s[r]=rt(e-l[1],l[3],l[2],i,n,t-l[0]),!s[r][0])return l.point;s[r][1]=at(s[r][1]-l.v[1])}var f=p.slice();for(r=0;r<3;++r){var h=2==r?0:r+1,d=nt(a[r].v[0],s[r][0],s[h][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=u-d,f[0]+=s[r][0]*o(d),f[1]+=s[r][0]*m(d)):(f[0]+=s[r][0]*o(d),f[1]-=s[r][0]*m(d))}return f[0]/=3,f[1]/=3,f}}function ot(t){return t[0]*=A,t[1]*=A,t}function st(t,r,n){var a=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),i=[-a[0],-a[1]],o=e.geoRotation(i),s=it(ot(o(t)),ot(o(r)),ot(o(n)));s.invert=q(s);var l=e.geoProjection(s).rotate(i),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function lt(t,e){var r=E(1-m(e));return[2/T*t*r,T*(1-r)]}function ct(t){var e=y(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*i(E(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,S(t?e*y(t)/t:e)]},r}lt.invert=function(t,e){var r=(r=e/T-1)*r;return[r>0?t*E(v/r)/2:0,S(1-r)]};var ut=E(3);function pt(t,e){return[ut*t*(2*o(2*e/3)-1)/T,ut*T*m(e/3)]}function ft(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,S(r*e)]},r}function ht(t){var e=o(t);function r(t,r){return[t*e,(1+e)*y(r/2)]}return r.invert=function(t,r){return[t/e,2*a(r/(1+e))]},r}function dt(t,e){var r=E(8/(3*v));return[r*t*(1-n(e)/v),r*e]}function mt(t,e){var r=E(4-3*m(n(e)));return[2/E(6*v)*t*r,d(e)*E(2*v/3)*(2-r)]}function yt(t,e){var r=E(v*(4+v));return[2/r*t*(1+E(1-4*e*e/(v*v))),4/r*e]}function gt(t,e){var r=(2+x)*m(e);e/=2;for(var a=0,i=1/0;a<10&&n(i)>g;a++){var s=o(e);e-=i=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/E(v*(4+v))*t*(1+o(e)),2*E(v/(4+v))*m(e)]}function vt(t,e){return[t*(1+o(e))/E(2+v),2*e/E(2+v)]}function xt(t,e){for(var r=(1+x)*m(e),a=0,i=1/0;a<10&&n(i)>g;a++)e-=i=(e+m(e)-r)/(1+o(e));return r=E(2+v),[t*(1+o(e))/r,2*e/r]}pt.invert=function(t,e){var r=3*S(e/(ut*T));return[T*t/(ut*(2*o(2*r/3)-1)),r]},dt.invert=function(t,e){var r=E(8/(3*v)),a=e/r;return[t/(r*(1-n(a)/v)),a]},mt.invert=function(t,e){var r=2-n(e)/E(2*v/3);return[t*E(6*v)/(2*r),d(e)*S((4-r*r)/3)]},yt.invert=function(t,e){var r=E(v*(4+v))/2;return[t*r/(1+E(1-e*e*(4+v)/(4*v))),e*r/2]},gt.invert=function(t,e){var r=e*E((4+v)/v)/2,n=S(r),a=o(n);return[t/(2/E(v*(4+v))*(1+a)),S((n+r*(a+2))/(2+x))]},vt.invert=function(t,e){var r=E(2+v),n=e*r/2;return[r*t/(1+o(n)),n]},xt.invert=function(t,e){var r=1+x,n=E(r/2);return[2*t*n/(1+o(e*=n)),S((e+m(e))/r)]};var _t=3+2*w;function bt(t,e){var r=m(t/=2),n=o(t),i=E(o(e)),s=o(e/=2),l=m(e)/(s+w*n*i),u=E(2/(1+l*l)),p=E((w*s+(n+r)*i)/(w*s+(n-r)*i));return[_t*(u*(p-1/p)-2*c(p)),_t*(u*l*(p+1/p)-2*a(l))]}bt.invert=function(t,e){if(!(r=O.invert(t/1.2,1.065*e)))return null;var r,i=r[0],s=r[1],l=20;t/=_t,e/=_t;do{var f=i/2,h=s/2,d=m(f),y=o(f),v=m(h),_=o(h),T=o(s),k=E(T),M=v/(_+w*y*k),A=M*M,S=E(2/(1+A)),L=(w*_+(y+d)*k)/(w*_+(y-d)*k),P=E(L),C=P-1/P,I=P+1/P,D=S*C-2*c(P)-t,z=S*M*I-2*a(M)-e,R=v&&b*k*d*A/v,F=(w*y*_+k)/(2*(_+w*y*k)*(_+w*y*k)*k),N=-.5*M*S*S*S,B=N*R,j=N*F,U=(U=2*_+w*k*(y-d))*U*P,V=(w*y*_*k+T)/U,q=-w*d*v/(k*U),H=C*B-2*V/P+S*(V+V/L),G=C*j-2*q/P+S*(q+q/L),Y=M*I*B-2*R/(1+A)+S*I*R+S*M*(V-V/L),Z=M*I*j-2*F/(1+A)+S*I*F+S*M*(q-q/L),X=G*Y-Z*H;if(!X)break;var W=(z*G-D*Z)/X,K=(D*Y-z*H)/X;i-=W,s=u(-x,p(x,s-K))}while((n(W)>g||n(K)>g)&&--l>0);return n(n(s)-x)s){var d=E(f),y=i(p,u),_=a*h(y/a),b=y-_,w=t*o(b),T=(t*m(b)-b*m(w))/(x-w),k=Et(b,T),M=(v-t)/Pt(k,w,v);u=d;var A,S=50;do{u-=A=(t+Pt(k,w,u)*M-d)/(k(u)*M)}while(n(A)>g&&--S>0);p=b*m(u),us){var u=E(c),p=i(l,r),f=a*h(p/a),d=p-f;r=u*o(d),l=u*m(d);for(var y=r-x,g=m(r),_=l/g,b=rg||n(h)>g)&&--x>0);return[d,y]},u}Tt.invert=function(t,e){var r=e/(1+wt);return[t&&t/(wt*E(1-r*r)),2*a(r)]},kt.invert=function(t,e){var r=a(e/T),n=o(r),i=2*r;return[t*T/2/(o(i)*n*n),i]};var It=Ct(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var Dt=Ct(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var zt=Ct(5/6*v,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Ot(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Ot.invert=function(t,e){var r,a=t,i=e,o=50;do{var s=i*i;i-=r=(i*(1+s/12)-e)/(1+s/4)}while(n(r)>g&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=a*a)*l;a-=r=(a*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>g&&--o>0);return[a,i]};var Rt=Ct(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Ft(t){var e=t(x,0)[0]-t(-x,0)[0];function r(r,n){var a=r>0?-.5:.5,i=t(r+a*v,n);return i[0]-=a*e,i}return t.invert&&(r.invert=function(r,n){var a=r>0?-.5:.5,i=t.invert(r+a*e,n),o=i[0]-a*v;return o<-v?o+=2*v:o>v&&(o-=2*v),i[0]=o,i}),r}function Nt(t,e){var r=d(t),a=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(a*e);t=n(i(c,u)),e=S(l),n(t-x)>g&&(t%=x);var p=function(t,e){if(e===x)return[0,0];var r,a,i=m(e),s=i*i,l=s*s,c=1+l,u=1+3*l,p=1-l,f=S(1/E(c)),h=p+s*c*f,d=(1-i)/h,y=E(d),_=d*c,b=E(_),w=y*p;if(0===t)return[0,-(w+s*b)];var T,k=o(e),M=1/k,A=2*i*k,L=(-h*k-(-3*s+f*u)*A*(1-i))/(h*h),P=-M*A,C=-M*(s*c*L+d*u*A),I=-2*M*(p*(.5*L/y)-2*s*y*A),D=4*t/v;if(t>.222*v||e.175*v){if(r=(w+s*E(_*(1+l)-w*w))/(1+l),t>v/4)return[r,r];var z=r,O=.5*r;r=.5*(O+z),a=50;do{var R=E(_-r*r),F=r*(I+P*R)+C*S(r/b)-D;if(!F)break;F<0?O=r:z=r,r=.5*(O+z)}while(n(z-O)>g&&--a>0)}else{r=g,a=25;do{var N=r*r,B=E(_-N),j=I+P*B,U=r*j+C*S(r/b)-D,V=j+(C-P*N)/B;r-=T=B?U/V:0}while(n(T)>g&&--a>0)}return[r,-w-s*E(_-r*r)]}(t>v/4?x-t:t,e);return t>v/4&&(u=p[0],p[0]=-p[1],p[1]=-u),p[0]*=r,p[1]*=-a,p}function Bt(t,e){var r,i,l,c,u,p;if(e=1-g)return r=(1-e)/4,l=1/(i=C(t)),[(c=((p=s(2*(p=t)))-1)/(p+1))+r*((u=i*P(t))-t)/(i*i),l-r*c*l*(u-t),l+r*c*l*(u+t),2*a(s(t))-x+r*(u-t)/i];var f=[1,0,0,0,0,0,0,0,0],h=[E(e),0,0,0,0,0,0,0,0],d=0;for(i=E(1-e),u=1;n(h[d]/f[d])>g&&d<8;)r=f[d++],h[d]=(r-i)/2,f[d]=(r+i)/2,i=E(r*i),u*=2;l=u*f[d]*t;do{l=(S(c=h[d]*m(i=l)/f[d])+l)/2}while(--d);return[m(l),c=o(l),c/o(l-i),l]}function jt(t,e){if(!e)return t;if(1===e)return c(y(t/2+_));for(var r=1,i=E(1-e),o=E(e),s=0;n(o)>g;s++){if(t%v){var l=a(i*y(t)/r);l<0&&(l+=v),t+=l+~~(t/v)*v}else t+=t;o=(r+i)/2,i=E(r*i),o=((r=o)-i)/2}return t/(f(2,s)*r)}function Ut(t,e){var r=(w-1)/(w+1),l=E(1-r*r),u=jt(x,l*l),p=c(y(v/4+n(e)/2)),f=s(-1*p)/E(r),h=function(t,e){var r=t*t,n=e+1,a=1-r-e*e;return[.5*((t>=0?x:-x)-i(a,2*t)),-.25*c(a*a+4*r)+.5*c(n*n+r)]}(f*o(-1*t),f*m(-1*t)),g=function(t,e,r){var i=n(t),o=P(n(e));if(i){var s=1/m(i),l=1/(y(i)*y(i)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+E(c*c-4*((r-1)*l)))/2;return[jt(a(1/E(u)),r)*d(t),jt(a(E((u/l-1)/r)),1-r)*d(e)]}return[0,jt(a(o),1-r)*d(e)]}(h[0],h[1],l*l);return[-g[1],(e>=0?1:-1)*(.5*u-g[0])]}function Vt(t){var e=m(t),r=o(t),a=qt(t);function s(t,i){var s=a(t,i);t=s[0],i=s[1];var l=m(i),c=o(i),u=o(t),p=L(e*l+r*c*u),f=m(p),h=n(f)>g?p/f:1;return[h*r*m(t),(n(t)>x?h:-h)*(e*c-r*l*u)]}return a.invert=qt(-t),s.invert=function(t,r){var n=E(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,p=n*e,f=E(c*c+u*u-p*p),h=i(c*p+u*f,u*p-c*f),d=(n>x?-1:1)*i(t*s,n*o(h)*l+r*m(h)*s);return a.invert(d,h)},s}function qt(t){var e=m(t),r=o(t);return function(t,n){var a=o(n),s=o(t)*a,l=m(t)*a,c=m(n);return[i(l,s*r-c*e),S(c*r+s*e)]}}Nt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),a=d(e),s=-r*t,l=-a*e,c=l/s<1,u=function(t,e){var r=0,a=1,i=.5,s=50;for(;;){var l=i*i,c=E(i),u=S(1/E(1+l)),p=1-l+i*(1+l)*u,f=(1-c)/p,h=E(f),d=f*(1+l),m=h*(1-l),y=E(d-t*t),g=e+m+i*y;if(n(a-r)<1e-12||0==--s||0===g)break;g>0?r=i:a=i,i=.5*(r+a)}if(!s)return null;var x=S(c),_=o(x),b=1/_,w=2*c*_,T=(-p*_-(-3*i+u*(1+3*l))*w*(1-c))/(p*p);return[v/4*(t*(-2*b*(.5*T/h*(1-l)-2*i*h*w)+-b*w*y)+-b*(i*(1+l)*T+f*(1+3*l)*w)*S(t/E(d))),x]}(c?l:s,c?s:l),p=u[0],f=u[1],h=o(f);return c&&(p=-x-p),[r*(i(m(p)*h,-m(f))+v),a*S(o(p)*h)]},Ut.invert=function(t,e){var r,n,o,l,u,p,f=(w-1)/(w+1),h=E(1-f*f),d=jt(x,h*h),m=(n=-t,o=h*h,(r=.5*d-e)?(l=Bt(r,o),n?(p=(u=Bt(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/p,l[1]*l[2]*u[0]*u[1]/p],[l[1]*u[1]/p,-l[0]*l[2]*u[0]*u[2]/p],[l[2]*u[1]*u[2]/p,-o*l[0]*l[1]*u[0]/p]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=Bt(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),y=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(m[0],m[1]);return[i(y[1],y[0])/-1,2*a(s(-.5*c(f*y[0]*y[0]+f*y[1]*y[1])))-x]};var Ht=S(1-1/3)*M,Gt=ft(0);function Yt(t){var e=Ht*A,r=lt(v,e)[0]-lt(-v,e)[0],a=Gt(0,e)[1],i=lt(0,e)[1],o=T-i,s=k/t,c=4/k,f=a+o*o*4/k;function h(h,d){var m,y=n(d);if(y>e){var g=p(t-1,u(0,l((h+v)/s)));(m=lt(h+=v*(t-1)/t-g*s,y))[0]=m[0]*k/r-k*(t-1)/(2*t)+g*k/t,m[1]=a+4*(m[1]-i)*o/k,d<0&&(m[1]=-m[1])}else m=Gt(h,d);return m[0]*=c,m[1]/=f,m}return h.invert=function(e,h){e/=c;var d=n(h*=f);if(d>a){var m=p(t-1,u(0,l((e+v)/s)));e=(e+v*(t-1)/t-m*s)*r/k;var y=lt.invert(e,.25*(d-a)*k/o+i);return y[0]-=v*(t-1)/t-m*s,h<0&&(y[1]=-y[1]),y}return Gt.invert(e,h)},h}function Zt(t,e){return[t,1&e?90-g:Ht]}function Xt(t,e){return[t,1&e?-90+g:-Ht]}function Wt(t){return[t[0]*(1-g),t[1]]}function Kt(t){var e,r=1+t,a=S(m(1/r)),s=2*E(v/(e=v+4*a*r)),l=.5*s*(r+E(t*(2+t))),c=t*t,u=r*r;function p(p,f){var h,d,y=1-m(f);if(y&&y<2){var g,_=x-f,b=25;do{var w=m(_),T=o(_),k=a+i(w,r-T),M=1+u-2*r*T;_-=g=(_-c*a-r*w+M*k-.5*y*e)/(2*r*w*k)}while(n(g)>1e-12&&--b>0);h=s*E(M),d=p*k/v}else h=s*(t+y),d=p*a/v;return[h*m(d),l-h*o(d)]}return p.invert=function(t,n){var o=t*t+(n-=l)*n,p=(1+u-o/(s*s))/(2*r),f=L(p),h=m(f),d=a+i(h,r-p);return[S(t/E(o))*v/d,S(1-2*(f-c*a-r*h+(1+u-2*r*p)*d)/e)]},p}function Jt(t,e){return e>-.7109889596207567?((t=Z(t,e))[1]+=.0528035274542,t):$(t,e)}function $t(t,e){return n(e)>.7109889596207567?((t=Z(t,e))[1]-=e>0?.0528035274542:-.0528035274542,t):$(t,e)}function Qt(t,e,r,n){var a=E(4*v/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),i=E(n*m(r)*E((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return E(1+t*o(2*r)+e*o(4*r))}function c(n){var a=n*r;return(2*a+(1+t-e/2)*m(2*a)+(t+e)/2*m(4*a)+e/2*m(6*a))/r}function u(t){return l(t)*m(t)}var p=function(t,e){var n=r*V(c,s*m(e)/r,e/v);isNaN(n)&&(n=r*d(e));var u=a*l(n);return[u*i*t/v*o(n),u/i*m(n)]};return p.invert=function(t,e){var n=V(u,e*i/a);return[t*v/(o(n)*a*i*l(n)),S(r*c(n/r)/s)]},0===r&&(a=E(n/v),(p=function(t,e){return[t*a,m(e)/a]}).invert=function(t,e){return[t/a,S(e*a)]}),p}function te(t,e,r,n,a){void 0===n&&(n=1e-8),void 0===a&&(a=20);var i=t(e),o=t(.5*(e+r)),s=t(r);return function t(e,r,n,a,i,o,s,l,c,u,p){if(p.nanEncountered)return NaN;var f,h,d,m,y,g,v,x,_,b;if(h=e(r+.25*(f=n-r)),d=e(n-.25*f),isNaN(h))p.nanEncountered=!0;else{if(!isNaN(d))return b=((g=(m=f*(a+4*h+i)/12)+(y=f*(i+4*d+o)/12))-s)/15,u>c?(p.maxDepthCount++,g+b):Math.abs(b)t?r=n:e=n,n=e+r>>1}while(n>e);var a=c[n+1]-c[n];return a&&(a=(t-c[n+1])/a),(n+1+a)/s}var h=2*p(1)/v*o/r,y=function(t,e){var r=p(n(m(e))),i=a(r)*t;return r/=h,[i,e>=0?r:-r]};return y.invert=function(t,e){var r;return n(e*=h)<1&&(r=d(e)*S(i(n(e))*o)),[t/a(n(e)),r]},y}function re(t,e){return n(t[0]-e[0])=0;--l)n=(e=t[1][l])[0][0],a=e[0][1],i=e[1][1],o=e[2][0],s=e[2][1],c.push(ne([[o-g,s-g],[o-g,i+g],[n+g,i+g],[n+g,a-g]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function ie(t,r,n){var a,i;function o(e,n){for(var a=n<0?-1:1,i=r[+(n<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=t(e-i[o][1][0],n);return l[0]+=t(i[o][1][0],a*n>a*i[o][0][1]?i[o][0][1]:n)[0],l}n?o.invert=n(o):t.invert&&(o.invert=function(e,n){for(var a=i[+(n<0)],s=r[+(n<0)],l=0,c=a.length;lo&&(r=i,i=o,o=r),[[n,i],[a,o]]}))})),s):r.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))}))},null!=r&&s.lobes(r),s}Jt.invert=function(t,e){return e>-.7109889596207567?Z.invert(t,e-.0528035274542):$.invert(t,e)},$t.invert=function(t,e){return n(e)>.7109889596207567?Z.invert(t,e+(e>0?.0528035274542:-.0528035274542)):$.invert(t,e)};var oe=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var se=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var le=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var ce=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var ue=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var pe=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function fe(t,e){return[3/k*t*E(v*v/3-e*e),e]}function he(t){function e(e,r){if(n(n(r)-x)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=f((1+l)/(1-l),1/t),[i(2*e,1-o-s)/t,S((l-1)/(l+1))]},e}fe.invert=function(t,e){return[k/3*t/E(v*v/3-e*e),e]};var de=v/w;function me(t,e){return[t*(1+E(o(e)))/2,e/(o(e/2)*o(t/6))]}function ye(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function ge(t,e){return[m(t)/o(e),y(e)*o(t)]}function ve(t){var e=o(t),r=y(_+t/2);function a(a,i){var o=i-t,s=n(o)=0;)f=(p=t[u])[0]+l*(a=f)-c*h,h=p[1]+l*h+c*a;return[f=l*(a=f)-c*h,h=l*h+c*a]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var p,f=e,h=t[f],d=h[0],y=h[1],g=0,v=0;--f>=0;)g=d+c*(p=g)-u*v,v=y+c*v+u*p,d=(h=t[f])[0]+c*(p=d)-u*y,y=h[1]+c*y+u*p;var x,_,b=(g=d+c*(p=g)-u*v)*g+(v=y+c*v+u*p)*v;c-=x=((d=c*(p=d)-u*y-r)*g+(y=c*y+u*p-s)*v)/b,u-=_=(y*g-d*v)/b}while(n(x)+n(_)>1e-12&&--l>0);if(l){var w=E(c*c+u*u),T=2*a(.5*w),k=m(T);return[i(c*k,w*o(T)),w?S(u*k/w):0]}},r}me.invert=function(t,e){var r=n(t),a=n(e),i=g,s=x;ag||n(_)>g)&&--i>0);return i&&[r,a]},ge.invert=function(t,e){var r=t*t,n=e*e+1,a=r+n,i=t?b*E((a-E(a*a-4*r))/r):1/E(n);return[S(t*i),d(e)*L(i)]},xe.invert=function(t,e){return[t,2.5*a(s(.8*e))-.625*v]};var be=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],we=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Te=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],ke=[[.9245,0],[0,0],[.01943,0]],Me=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ae(t,r){var n=e.geoProjection(_e(t)).rotate(r).clipAngle(90),a=e.geoRotation(r),i=n.center;return delete n.rotate,n.center=function(t){return arguments.length?i(a(t)):a.invert(i())},n}var Se=E(6),Le=E(7);function Ee(t,e){var r=S(7*m(e)/(3*Se));return[Se*t*(2*o(2*r/3)-1)/Le,9*m(r/3)/Le]}function Pe(t,e){for(var r,a=(1+b)*m(e),i=e,s=0;s<25&&(i-=r=(m(i/2)+m(i)-a)/(.5*o(i/2)+o(i)),!(n(r)1e-12&&--l>0);return[t/(.84719-.13063*(a=s*s)+(o=a*(i=a*a))*o*(.05494*a-.04515-.02326*i+.00331*o)),s]},De.invert=function(t,e){for(var r=e/2,a=0,i=1/0;a<10&&n(i)>g;++a){var s=o(e/2);e-=i=(e-y(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var ze=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Oe(t,e){var r=m(e),a=o(e),i=d(t);if(0===t||n(e)===x)return[0,e];if(0===e)return[t,0];if(n(t)===x)return[t*a,x*r];var s=v/(2*t)-2*t/v,l=2*e/v,c=(1-l*l)/(r-l),u=s*s,p=c*c,f=1+u/p,h=1+p/u,y=(s*r/c-s/2)/f,g=(p*r/u+c/2)/h,_=g*g-(p*r*r/u+c*r-1)/h;return[x*(y+E(y*y+a*a/f)*i),x*(g+E(_<0?0:_)*d(-e*s)*i)]}Oe.invert=function(t,e){var r=(t/=x)*t,n=r+(e/=x)*e,a=v*v;return[t?(n-1+E((1-n)*(1-n)+4*r))/(2*t)*x:0,V((function(t){return n*(v*m(t)-2*t)*v+4*t*t*(e-m(t))+2*v*t-a*e}),0)]};function Re(t,e){var r=e*e;return[t,e*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function Fe(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(i)return[i,r];i=r}}}(e.face,r.face),a=Ne(n.map(r.project),n.map(e.project));e.transform=r.transform?Be(r.transform,a):a;for(var i=r.edges,o=0,s=i.length;o1.790857183?e=1.790857183:e<-1.790857183&&(e=-1.790857183);var r,a=e;do{var i=a*a;a-=r=(a*(1.0148+i*i*(.23185+i*(.02406*i-.14499)))-e)/(1.0148+i*i*(5*.23185+i*(.21654*i-1.01493)))}while(n(r)>g);return[t,a]},Fe.invert=function(t,e){if(n(e)g&&--s>0);return l=y(i),[(n(e)n^h>n&&r<(f-c)*(n-u)/(h-u)+c&&(a=!a)}return a}(t[0],r))return t.push(e),!0}))||t.push([e])})),nr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function sr(t){var r=t(x,0)[0]-t(-x,0)[0];function a(e,a){var i=n(e)0?e-v:e+v,a),s=(o[0]-o[1])*b,l=(o[0]+o[1])*b;if(i)return[s,l];var c=r*b,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(a.invert=function(e,a){var i=(e+a)*b,o=(a-e)*b,s=n(i)<.5*r&&n(o)<.5*r;if(!s){var l=r*b,c=i>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,p=-c*a+(i>0?1:-1)*l;i=(-u-p)*b,o=(u-p)*b}var f=t.invert(i,o);return s||(f[0]+=i>0?v:-v),f}),e.geoProjection(a).rotate([-90,-90,45]).clipAngle(179.999)}function lr(){return sr(Ut).scale(111.48)}function cr(t){var e=m(t);function r(r,n){var i=e?y(r*e/2)/e:r/2;if(!n)return[2*i,-t];var s=2*a(i*m(n)),l=1/y(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,i){if(n(i+=t)g&&--u>0);var d=r*(p=y(c)),x=y(n(i)0?x:-x)*(f+o*(d-c)/2+o*o*(d-2*f+c)/2)]}function fr(t,e){var r=function(t){function e(e,r){var n=o(r),a=(t-1)/(t-n*o(e));return[a*n*m(e),a*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,a=E(n),o=(t-E(1-n*(t+1)/(t-1)))/((t-1)/a+a/(t-1));return[i(e*o,a*E(1-o*o)),a?S(r*o/a):0]},e}(t);if(!e)return r;var n=o(e),a=m(e);function s(e,i){var o=r(e,i),s=o[1],l=s*a/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,i){var o=(t-1)/(t-1-i*a);return r.invert(o*e,o*i*n)},s}ur.forEach((function(t){t[1]*=1.0144})),pr.invert=function(t,e){var r=e/x,a=90*r,i=p(18,n(a/5)),o=u(0,l(i));do{var s=ur[o][1],c=ur[o+1][1],f=ur[p(19,o+2)][1],h=f-s,d=f-2*c+s,m=2*(n(r)-c)/h,y=d/h,g=m*(1-y*m*(1-2*y*m));if(g>=0||1===o){a=(e>=0?5:-5)*(g+i);var v,_=50;do{g=(i=p(18,n(a)/5))-(o=l(i)),s=ur[o][1],c=ur[o+1][1],f=ur[p(19,o+2)][1],a-=(v=(e>=0?x:-x)*(c+g*(f-s)/2+g*g*(f-2*c+s)/2)-e)*M}while(n(v)>1e-12&&--_>0);break}}while(--o>=0);var b=ur[o][0],w=ur[o+1][0],T=ur[p(19,o+2)][0];return[t/(w+g*(T-b)/2+g*g*(T-2*w+b)/2),a*A]};var hr=-179.9999,dr=179.9999,mr=-89.9999;function yr(t){return t.length>0}function gr(t){return-90===t||90===t?[0,t]:[-180,(e=t,Math.floor(1e4*e)/1e4)];var e}function vr(t){var e=t[0],r=t[1],n=!1;return e<=hr?(e=-180,n=!0):e>=dr&&(e=180,n=!0),r<=mr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[e,r]:t}function xr(t){return t.map(vr)}function _r(t,e,r){for(var n=0,a=t.length;n=dr||u<=mr||u>=89.9999){i[o]=vr(l);for(var p=o+1;phr&&hmr&&d<89.9999)break}if(p===o+1)continue;if(o){var m={index:-1,polygon:e,ring:i.slice(0,o+1)};m.ring[m.ring.length-1]=gr(u),r[r.length-1]=m}else r.pop();if(p>=s)break;r.push({index:-1,polygon:e,ring:i=i.slice(p-1)}),i[0]=gr(i[0][1]),o=-1,s=i.length}}}}function br(t){var e,r,n,a,i,o,s=t.length,l={},c={};for(e=0;e0?v-l:l)*M],u=e.geoProjection(t(s)).rotate(c),p=e.geoRotation(c),f=u.center;return delete u.rotate,u.center=function(t){return arguments.length?f(p(t)):p.invert(f())},u.clipAngle(90)}function Ar(t){var r=o(t);function n(t,n){var a=e.geoGnomonicRaw(t,n);return a[0]*=r,a}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Sr(t,e){return Mr(Ar,t,e)}function Lr(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,a=t*t,s=y(n),l=.5/m(n);function c(e,i){var s=L(o(i)*o(e-r)),l=L(o(i)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(i<0?-1:1)*E(4*a*l-(a-s+l)*(a-s+l))/(2*t)]}return c.invert=function(t,e){var a,c,u=e*e,p=o(E(u+(a=t+r)*a)),f=o(E(u+(a=t+n)*a));return[i(c=p-f,a=(p+f)*s),(e<0?-1:1)*L(E(a*a+c*c)*l)]},c}function Er(t,e){return Mr(Lr,t,e)}function Pr(t,e){if(n(e)g&&--l>0);return[d(t)*(E(i*i+4)+i)*v/4,x*s]};var Rr=4*v+3*E(3),Fr=2*E(2*v*E(3)/Rr),Nr=Y(Fr*E(3)/v,Fr,Rr/6);function Br(t,e){return[t*E(1-3*e*e/(v*v)),e]}function jr(t,e){var r=o(e),n=o(t)*r,a=1-n,s=o(t=i(m(t)*r,-m(e))),l=m(t);return[l*(r=E(1-n*n))-s*a,-s*r-l*a]}function Ur(t,e){var r=D(t,e);return[(r[0]+t/x)/2,(r[1]+e)/2]}Br.invert=function(t,e){return[t/E(1-3*e*e/(v*v)),e]},jr.invert=function(t,e){var r=(t*t+e*e)/-2,n=E(-r*(2+r)),a=e*r+t*n,o=t*r-e*n,s=E(o*o+a*a);return[i(n*a,s*(1+r)),s?-S(n*o/s):0]},Ur.invert=function(t,e){var r=t,a=e,i=25;do{var s,l=o(a),c=m(a),u=m(2*a),p=c*c,f=l*l,h=m(r),d=o(r/2),y=m(r/2),v=y*y,_=1-f*d*d,b=_?L(l*d)*E(s=1/_):s=0,w=.5*(2*b*l*y+r/x)-t,T=.5*(b*c+a)-e,k=.5*s*(f*v+b*l*d*p)+.5/x,M=s*(h*u/4-b*c*y),A=.125*s*(u*y-b*c*f*h),S=.5*s*(p*d+b*v*l)+.5,P=M*A-S*k,C=(T*M-w*S)/P,I=(w*A-T*k)/P;r-=C,a-=I}while((n(C)>g||n(I)>g)&&--i>0);return[r,a]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=x,r=e.geoProjectionMutator(I),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*A):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=I,t.geoAitoff=function(){return e.geoProjection(D).scale(152.63)},t.geoAitoffRaw=D,t.geoArmadillo=function(){var t=20*A,r=t>=0?1:-1,n=y(r*t),a=e.geoProjectionMutator(z),s=a(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=y((r=(t=e*A)>=0?1:-1)*t),a(t)):t*M},s.stream=function(e){var a=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),p=s.precision();return s.rotate(a),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*p)>=-180;)u.point(e,r*-i(o(e*A/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=z,t.geoAugust=function(){return e.geoProjection(O).scale(66.1603)},t.geoAugustRaw=O,t.geoBaker=function(){return e.geoProjection(N).scale(112.314)},t.geoBakerRaw=N,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(B),n=r(t),a=n.stream,s=-o(.01*A),l=m(.01*A);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),c=a(e),u=(n.rotate([0,0]),a(e));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=0,r=360/t,n=2*v/t,a=90-180/t,c=x;e=0;)t.point((e=r[a])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=Vt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Yt),a=n(t),i=a.stream;return a.lobes=function(e){return arguments.length?n(t=+e):t},a.stream=function(n){var o=a.rotate(),s=i(n),l=(a.rotate([0,0]),i(n));return a.rotate(o),s.sphere=function(){var n,a;e.geoStream((n=180/t,a=[].concat(r.range(-180,180+n/2,n).map(Zt),r.range(180,-180-n/2,-n).map(Xt)),{type:"Polygon",coordinates:[180===n?a.map(Wt):a]}),l)},s},a.scale(239.75)},t.geoHealpixRaw=Yt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Kt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Kt,t.geoHomolosine=function(){return e.geoProjection($t).scale(152.63)},t.geoHomolosineRaw=$t,t.geoHufnagel=function(){var t=1,r=0,n=45*A,a=2,i=e.geoProjectionMutator(Qt),o=i(t,r,n,a);return o.a=function(e){return arguments.length?i(t=+e,r,n,a):t},o.b=function(e){return arguments.length?i(t,r=+e,n,a):r},o.psiMax=function(e){return arguments.length?i(t,r,n=+e*A,a):n*M},o.ratio=function(e){return arguments.length?i(t,r,n,a=+e):a},o.scale(180.739)},t.geoHufnagelRaw=Qt,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,a=e.geoProjectionMutator(ee),i=a(t,r,n);return i.alpha=function(e){return arguments.length?a(t=+e,r,n):t},i.k=function(e){return arguments.length?a(t,r=+e,n):r},i.gamma=function(e){return arguments.length?a(t,r,n=+e):n},i.scale(152.63)},t.geoHyperellipticalRaw=ee,t.geoInterrupt=ie,t.geoInterruptedBoggs=function(){return ie(K,oe).scale(160.857)},t.geoInterruptedHomolosine=function(){return ie($t,se).scale(152.63)},t.geoInterruptedMollweide=function(){return ie(Z,le).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return ie(Z,ce).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return ie(Jt,ue,q).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return ie($,pe).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(fe).scale(158.837)},t.geoKavrayskiy7Raw=fe,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(he),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=he,t.geoLarrivee=function(){return e.geoProjection(me).scale(97.2672)},t.geoLarriveeRaw=me,t.geoLaskowski=function(){return e.geoProjection(ye).scale(139.98)},t.geoLaskowskiRaw=ye,t.geoLittrow=function(){return e.geoProjection(ge).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=ge,t.geoLoximuthal=function(){return J(ve).parallel(40).scale(158.837)},t.geoLoximuthalRaw=ve,t.geoMiller=function(){return e.geoProjection(xe).scale(108.318)},t.geoMillerRaw=xe,t.geoModifiedStereographic=Ae,t.geoModifiedStereographicRaw=_e,t.geoModifiedStereographicAlaska=function(){return Ae(be,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ae(we,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ae(Te,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ae(ke,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ae(Me,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Z).scale(169.529)},t.geoMollweideRaw=Z,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Ee).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Ee,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(Pe).scale(188.209)},t.geoMtFlatPolarQuarticRaw=Pe,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(Ce).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=Ce,t.geoNaturalEarth2=function(){return e.geoProjection(Ie).scale(175.295)},t.geoNaturalEarth2Raw=Ie,t.geoNellHammer=function(){return e.geoProjection(De).scale(152.63)},t.geoNellHammerRaw=De,t.geoInterruptedQuarticAuthalic=function(){return ie(j(1/0),ze).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(Oe).scale(127.267)},t.geoNicolosiRaw=Oe,t.geoPatterson=function(){return e.geoProjection(Re).scale(139.319)},t.geoPattersonRaw=Re,t.geoPolyconic=function(){return e.geoProjection(Fe).scale(103.74)},t.geoPolyconicRaw=Fe,t.geoPolyhedral=Ve,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-v/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-v/2?e<0?6:4:t<0?e<0?2:0:t2||i[0]!=e[0]||i[1]!=e[1])&&(n.push(i),e=i)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function i(t){return t.map(a)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(i)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=sr,t.geoRectangularPolyconic=function(){return J(cr).scale(131.215)},t.geoRectangularPolyconicRaw=cr,t.geoRobinson=function(){return e.geoProjection(pr).scale(152.63)},t.geoRobinsonRaw=pr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(fr),a=n(t,r);return a.distance=function(e){return arguments.length?n(t=+e,r):t},a.tilt=function(e){return arguments.length?n(t,r=e*A):r*M},a.scale(432.147).clipAngle(L(1/t)*M-1e-6)},t.geoSatelliteRaw=fr,t.geoSinuMollweide=function(){return e.geoProjection(Jt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=Jt,t.geoSinusoidal=function(){return e.geoProjection($).scale(152.63)},t.geoSinusoidalRaw=$,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return wr(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(wr)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Tr(t)}},t.geoTimes=function(){return e.geoProjection(kr).scale(146.153)},t.geoTimesRaw=kr,t.geoTwoPointAzimuthal=Sr,t.geoTwoPointAzimuthalRaw=Ar,t.geoTwoPointAzimuthalUsa=function(){return Sr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Er,t.geoTwoPointEquidistantRaw=Lr,t.geoTwoPointEquidistantUsa=function(){return Er([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(Pr).scale(79.4183)},t.geoVanDerGrintenRaw=Pr,t.geoVanDerGrinten2=function(){return e.geoProjection(Cr).scale(79.4183)},t.geoVanDerGrinten2Raw=Cr,t.geoVanDerGrinten3=function(){return e.geoProjection(Ir).scale(79.4183)},t.geoVanDerGrinten3Raw=Ir,t.geoVanDerGrinten4=function(){return e.geoProjection(Dr).scale(127.16)},t.geoVanDerGrinten4Raw=Dr,t.geoWagner=Or,t.geoWagner7=function(){return Or().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=zr,t.geoWagner4=function(){return e.geoProjection(Nr).scale(176.84)},t.geoWagner4Raw=Nr,t.geoWagner6=function(){return e.geoProjection(Br).scale(152.63)},t.geoWagner6Raw=Br,t.geoWiechel=function(){return e.geoProjection(jr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=jr,t.geoWinkel3=function(){return e.geoProjection(Ur).scale(158.837)},t.geoWinkel3Raw=Ur,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":63,"d3-geo":70}],70:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-array")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){i(a,t,this.t),i(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new n;function i(t,e,r){var n=t.s=e+r,a=n-e,i=n-a;t.t=e-i+(r-a)}var o=1e-6,s=Math.PI,l=s/2,c=s/4,u=2*s,p=180/s,f=s/180,h=Math.abs,d=Math.atan,m=Math.atan2,y=Math.cos,g=Math.ceil,v=Math.exp,x=Math.log,_=Math.pow,b=Math.sin,w=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,k=Math.tan;function M(t){return t>1?0:t<-1?s:Math.acos(t)}function A(t){return t>1?l:t<-1?-l:Math.asin(t)}function S(t){return(t=b(t/2))*t}function L(){}function E(t,e){t&&C.hasOwnProperty(t.type)&&C[t.type](t,e)}var P={Feature:function(t,e){E(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n=0?1:-1,a=n*r,i=y(e=(e*=f)/2+c),o=b(e),s=B*o,l=N*i+s*y(a),u=s*n*b(a);j.add(m(u,l)),F=t,N=i,B=o}function Z(t){return[m(t[1],t[0]),A(t[2])]}function X(t){var e=t[0],r=t[1],n=y(r);return[n*y(e),n*b(e),b(r)]}function W(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function K(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 J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function $(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Q(t){var e=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var tt,et,rt,nt,at,it,ot,st,lt,ct,ut,pt,ft,ht,dt,mt,yt,gt,vt,xt,_t,bt,wt,Tt,kt,Mt,At=r(),St={point:Lt,lineStart:Pt,lineEnd:Ct,polygonStart:function(){St.point=It,St.lineStart=Dt,St.lineEnd=zt,At.reset(),V.polygonStart()},polygonEnd:function(){V.polygonEnd(),St.point=Lt,St.lineStart=Pt,St.lineEnd=Ct,j<0?(tt=-(rt=180),et=-(nt=90)):At>o?nt=90:At<-o&&(et=-90),ct[0]=tt,ct[1]=rt},sphere:function(){tt=-(rt=180),et=-(nt=90)}};function Lt(t,e){lt.push(ct=[tt=t,rt=t]),ent&&(nt=e)}function Et(t,e){var r=X([t*f,e*f]);if(st){var n=K(st,r),a=K([n[1],-n[0],0],n);Q(a),a=Z(a);var i,o=t-at,s=o>0?1:-1,l=a[0]*p*s,c=h(o)>180;c^(s*atnt&&(nt=i):c^(s*at<(l=(l+360)%360-180)&&lnt&&(nt=e)),c?tOt(tt,rt)&&(rt=t):Ot(t,rt)>Ot(tt,rt)&&(tt=t):rt>=tt?(trt&&(rt=t)):t>at?Ot(tt,t)>Ot(tt,rt)&&(rt=t):Ot(t,rt)>Ot(tt,rt)&&(tt=t)}else lt.push(ct=[tt=t,rt=t]);ent&&(nt=e),st=r,at=t}function Pt(){St.point=Et}function Ct(){ct[0]=tt,ct[1]=rt,St.point=Lt,st=null}function It(t,e){if(st){var r=t-at;At.add(h(r)>180?r+(r>0?360:-360):r)}else it=t,ot=e;V.point(t,e),Et(t,e)}function Dt(){V.lineStart()}function zt(){It(it,ot),V.lineEnd(),h(At)>o&&(tt=-(rt=180)),ct[0]=tt,ct[1]=rt,st=null}function Ot(t,e){return(e-=t)<0?e+360:e}function Rt(t,e){return t[0]-e[0]}function Ft(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:es?t+Math.round(-t/u)*u:t,e]}function $t(t,e,r){return(t%=u)?e||r?Kt(te(t),ee(e,r)):te(t):e||r?ee(e,r):Jt}function Qt(t){return function(e,r){return[(e+=t)>s?e-u:e<-s?e+u:e,r]}}function te(t){var e=Qt(t);return e.invert=Qt(-t),e}function ee(t,e){var r=y(t),n=b(t),a=y(e),i=b(e);function o(t,e){var o=y(e),s=y(t)*o,l=b(t)*o,c=b(e),u=c*r+s*n;return[m(l*a-u*i,s*r-c*n),A(u*a+l*i)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=b(t)*o,c=b(e),u=c*a-l*i;return[m(l*a+c*i,s*r+u*n),A(u*r-s*n)]},o}function re(t){function e(e){return(e=t(e[0]*f,e[1]*f))[0]*=p,e[1]*=p,e}return t=$t(t[0]*f,t[1]*f,t.length>2?t[2]*f:0),e.invert=function(e){return(e=t.invert(e[0]*f,e[1]*f))[0]*=p,e[1]*=p,e},e}function ne(t,e,r,n,a,i){if(r){var o=y(e),s=b(e),l=n*r;null==a?(a=e+n*u,i=e-l/2):(a=ae(o,a),i=ae(o,i),(n>0?ai)&&(a+=n*u));for(var c,p=a;n>0?p>i:p1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function oe(t,e){return h(t[0]-e[0])=0;--i)a.point((p=u[i])[0],p[1]);else n(h.x,h.p.x,-1,a);h=h.p}u=(h=h.o).z,d=!d}while(!h.v);a.lineEnd()}}}function ce(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n=0?1:-1,z=D*I,O=z>s,R=T*P;if(ue.add(m(R*D*b(z),k*C+R*y(z))),p+=O?I+D*u:I,O^_>=r^L>=r){var F=K(X(x),X(S));Q(F);var N=K(i,F);Q(N);var B=(O^I>=0?-1:1)*A(N[2]);(n>B||n===B&&(F[0]||F[1]))&&(f+=O^I>=0?1:-1)}}return(p<-o||p0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&a&&c.push(c.pop().concat(c.shift())),s.push(c.filter(de))}return h}}function de(t){return t.length>1}function me(t,e){return((t=t.x)[0]<0?t[1]-l-o:l-t[1])-((e=e.x)[0]<0?e[1]-l-o:l-e[1])}var ye=he((function(){return!0}),(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,c){var u=i>0?s:-s,p=h(i-r);h(p-s)0?l:-l),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(i,n),e=0):a!==u&&p>=s&&(h(r-a)o?d((b(e)*(i=y(n))*b(r)-b(n)*(a=y(e))*b(t))/(a*i*s)):(e+n)/2}(r,n,i,c),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=i,n=c),a=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*l,n.point(-s,a),n.point(0,a),n.point(s,a),n.point(s,0),n.point(s,-a),n.point(0,-a),n.point(-s,-a),n.point(-s,0),n.point(-s,a);else if(h(t[0]-e[0])>o){var i=t[0]0,a=h(e)>o;function i(t,r){return y(t)*y(r)>e}function l(t,r,n){var a=[1,0,0],i=K(X(t),X(r)),l=W(i,i),c=i[0],u=l-c*c;if(!u)return!n&&t;var p=e*l/u,f=-e*c/u,d=K(a,i),m=$(a,p);J(m,$(i,f));var y=d,g=W(m,y),v=W(y,y),x=g*g-v*(W(m,m)-1);if(!(x<0)){var _=T(x),b=$(y,(-g-_)/v);if(J(b,m),b=Z(b),!n)return b;var w,k=t[0],M=r[0],A=t[1],S=r[1];M0^b[1]<(h(b[0]-k)s^(k<=b[0]&&b[0]<=M)){var P=$(y,(-g+_)/v);return J(P,m),[b,Z(P)]}}}function c(e,r){var a=n?t:s-t,i=0;return e<-a?i|=1:e>a&&(i|=2),r<-a?i|=4:r>a&&(i|=8),i}return he(i,(function(t){var e,r,o,u,p;return{lineStart:function(){u=o=!1,p=1},point:function(f,h){var d,m=[f,h],y=i(f,h),g=n?y?0:c(f,h):y?c(f+(f<0?s:-s),h):0;if(!e&&(u=o=y)&&t.lineStart(),y!==o&&(!(d=l(e,m))||oe(e,d)||oe(m,d))&&(m[2]=1),y!==o)p=0,y?(t.lineStart(),d=l(m,e),t.point(d[0],d[1])):(d=l(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(a&&e&&n^y){var v;g&r||!(v=l(m,e,!0))||(p=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!y||e&&oe(e,m)||t.point(m[0],m[1]),e=m,o=y,r=g},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return p|(u&&o)<<1}}}),(function(e,n,a,i){ne(i,t,r,a,e,n)}),n?[0,-t]:[-s,t-s])}function ve(t,r,n,a){function i(e,i){return t<=e&&e<=n&&r<=i&&i<=a}function s(e,i,o,s){var c=0,p=0;if(null==e||(c=l(e,o))!==(p=l(i,o))||u(e,i)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?a:r)}while((c=(c+o+4)%4)!==p);else s.point(i[0],i[1])}function l(e,a){return h(e[0]-t)0?0:3:h(e[0]-n)0?2:1:h(e[1]-r)0?1:0:a>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(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(o){var l,u,p,f,h,d,m,y,g,v,x,_=o,b=ie(),w={point:T,lineStart:function(){w.point=k,u&&u.push(p=[]);v=!0,g=!1,m=y=NaN},lineEnd:function(){l&&(k(f,h),d&&g&&b.rejoin(),l.push(b.result()));w.point=T,g&&_.lineEnd()},polygonStart:function(){_=b,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ra&&(f-i)*(a-o)>(h-o)*(t-i)&&++e:h<=a&&(f-i)*(a-o)<(h-o)*(t-i)&&--e;return e}(),n=x&&r,i=(l=e.merge(l)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),i&&le(l,c,r,s,o),o.polygonEnd());_=o,l=u=p=null}};function T(t,e){i(t,e)&&_.point(t,e)}function k(e,o){var s=i(e,o);if(u&&p.push([e,o]),v)f=e,h=o,d=s,v=!1,s&&(_.lineStart(),_.point(e,o));else if(s&&g)_.point(e,o);else{var l=[m=Math.max(-1e9,Math.min(1e9,m)),y=Math.max(-1e9,Math.min(1e9,y))],c=[e=Math.max(-1e9,Math.min(1e9,e)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,r,n,a,i){var o,s=t[0],l=t[1],c=0,u=1,p=e[0]-s,f=e[1]-l;if(o=r-s,p||!(o>0)){if(o/=p,p<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-s,p||!(o<0)){if(o/=p,p<0){if(o>u)return;o>c&&(c=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0&&(t[0]=s+c*p,t[1]=l+c*f),u<1&&(e[0]=s+u*p,e[1]=l+u*f),!0}}}}}(l,c,t,r,n,a)?s&&(_.lineStart(),_.point(e,o),x=!1):(g||(_.lineStart(),_.point(l[0],l[1])),_.point(c[0],c[1]),s||_.lineEnd(),x=!1)}m=e,y=o,g=s}return w}}var xe,_e,be,we=r(),Te={sphere:L,point:L,lineStart:function(){Te.point=Me,Te.lineEnd=ke},lineEnd:L,polygonStart:L,polygonEnd:L};function ke(){Te.point=Te.lineEnd=L}function Me(t,e){xe=t*=f,_e=b(e*=f),be=y(e),Te.point=Ae}function Ae(t,e){t*=f;var r=b(e*=f),n=y(e),a=h(t-xe),i=y(a),o=n*b(a),s=be*r-_e*n*i,l=_e*r+be*n*i;we.add(m(T(o*o+s*s),l)),xe=t,_e=r,be=n}function Se(t){return we.reset(),z(t,Te),+we}var Le=[null,null],Ee={type:"LineString",coordinates:Le};function Pe(t,e){return Le[0]=t,Le[1]=e,Se(Ee)}var Ce={Feature:function(t,e){return De(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n0&&(a=Pe(t[i],t[i-1]))>0&&r<=a&&n<=a&&(r+n-a)*(1-Math.pow((r-n)/a,2))<1e-12*a)return!0;r=n}return!1}function Re(t,e){return!!fe(t.map(Fe),Ne(e))}function Fe(t){return(t=t.map(Ne)).pop(),t}function Ne(t){return[t[0]*f,t[1]*f]}function Be(t,r,n){var a=e.range(t,r-o,n).concat(r);return function(t){return a.map((function(e){return[t,e]}))}}function je(t,r,n){var a=e.range(t,r-o,n).concat(r);return function(t){return a.map((function(e){return[e,t]}))}}function Ue(){var t,r,n,a,i,s,l,c,u,p,f,d,m=10,y=m,v=90,x=360,_=2.5;function b(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(g(a/v)*v,n,v).map(f).concat(e.range(g(c/x)*x,l,x).map(d)).concat(e.range(g(r/m)*m,t,m).filter((function(t){return h(t%v)>o})).map(u)).concat(e.range(g(s/y)*y,i,y).filter((function(t){return h(t%x)>o})).map(p))}return b.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(c).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),c>l&&(t=c,c=l,l=t),b.precision(_)):[[a,c],[n,l]]},b.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],i=+e[1][1],r>t&&(e=r,r=t,t=e),s>i&&(e=s,s=i,i=e),b.precision(_)):[[r,s],[t,i]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(v=+t[0],x=+t[1],b):[v,x]},b.stepMinor=function(t){return arguments.length?(m=+t[0],y=+t[1],b):[m,y]},b.precision=function(e){return arguments.length?(_=+e,u=Be(s,i,90),p=je(r,t,_),f=Be(c,l,90),d=je(a,n,_),b):_},b.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Ve(t){return t}var qe,He,Ge,Ye,Ze=r(),Xe=r(),We={point:L,lineStart:L,lineEnd:L,polygonStart:function(){We.lineStart=Ke,We.lineEnd=Qe},polygonEnd:function(){We.lineStart=We.lineEnd=We.point=L,Ze.add(h(Xe)),Xe.reset()},result:function(){var t=Ze/2;return Ze.reset(),t}};function Ke(){We.point=Je}function Je(t,e){We.point=$e,qe=Ge=t,He=Ye=e}function $e(t,e){Xe.add(Ye*t-Ge*e),Ge=t,Ye=e}function Qe(){$e(qe,He)}var tr=1/0,er=tr,rr=-tr,nr=rr,ar={point:function(t,e){trr&&(rr=t);enr&&(nr=e)},lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var t=[[tr,er],[rr,nr]];return rr=nr=-(er=tr=1/0),t}};var ir,or,sr,lr,cr=0,ur=0,pr=0,fr=0,hr=0,dr=0,mr=0,yr=0,gr=0,vr={point:xr,lineStart:_r,lineEnd:Tr,polygonStart:function(){vr.lineStart=kr,vr.lineEnd=Mr},polygonEnd:function(){vr.point=xr,vr.lineStart=_r,vr.lineEnd=Tr},result:function(){var t=gr?[mr/gr,yr/gr]:dr?[fr/dr,hr/dr]:pr?[cr/pr,ur/pr]:[NaN,NaN];return cr=ur=pr=fr=hr=dr=mr=yr=gr=0,t}};function xr(t,e){cr+=t,ur+=e,++pr}function _r(){vr.point=br}function br(t,e){vr.point=wr,xr(sr=t,lr=e)}function wr(t,e){var r=t-sr,n=e-lr,a=T(r*r+n*n);fr+=a*(sr+t)/2,hr+=a*(lr+e)/2,dr+=a,xr(sr=t,lr=e)}function Tr(){vr.point=xr}function kr(){vr.point=Ar}function Mr(){Sr(ir,or)}function Ar(t,e){vr.point=Sr,xr(ir=sr=t,or=lr=e)}function Sr(t,e){var r=t-sr,n=e-lr,a=T(r*r+n*n);fr+=a*(sr+t)/2,hr+=a*(lr+e)/2,dr+=a,mr+=(a=lr*t-sr*e)*(sr+t),yr+=a*(lr+e),gr+=3*a,xr(sr=t,lr=e)}function Lr(t){this._context=t}Lr.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,u)}},result:L};var Er,Pr,Cr,Ir,Dr,zr=r(),Or={point:L,lineStart:function(){Or.point=Rr},lineEnd:function(){Er&&Fr(Pr,Cr),Or.point=L},polygonStart:function(){Er=!0},polygonEnd:function(){Er=null},result:function(){var t=+zr;return zr.reset(),t}};function Rr(t,e){Or.point=Fr,Pr=Ir=t,Cr=Dr=e}function Fr(t,e){Ir-=t,Dr-=e,zr.add(T(Ir*Ir+Dr*Dr)),Ir=t,Dr=e}function Nr(){this._string=[]}function Br(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function jr(t){return function(e){var r=new Ur;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Ur(){}function Vr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),z(r,t.stream(ar)),e(ar.result()),null!=n&&t.clipExtent(n),t}function qr(t,e,r){return Vr(t,(function(r){var n=e[1][0]-e[0][0],a=e[1][1]-e[0][1],i=Math.min(n/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+e[0][0]+(n-i*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(a-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([o,s])}),r)}function Hr(t,e,r){return qr(t,[[0,0],e],r)}function Gr(t,e,r){return Vr(t,(function(r){var n=+e,a=n/(r[1][0]-r[0][0]),i=(n-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];t.scale(150*a).translate([i,o])}),r)}function Yr(t,e,r){return Vr(t,(function(r){var n=+e,a=n/(r[1][1]-r[0][1]),i=-a*r[0][0],o=(n-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([i,o])}),r)}Nr.prototype={_radius:4.5,_circle:Br(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Br(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ur.prototype={constructor:Ur,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Zr=y(30*f);function Xr(t,e){return+e?function(t,e){function r(n,a,i,s,l,c,u,p,f,d,y,g,v,x){var _=u-n,b=p-a,w=_*_+b*b;if(w>4*e&&v--){var k=s+d,M=l+y,S=c+g,L=T(k*k+M*M+S*S),E=A(S/=L),P=h(h(S)-1)e||h((_*z+b*O)/w-.5)>.3||s*d+l*y+c*g2?t[2]%360*f:0,I()):[v*p,x*p,_*p]},P.angle=function(t){return arguments.length?(b=t%360*f,I()):b*p},P.reflectX=function(t){return arguments.length?(w=t?-1:1,I()):w<0},P.reflectY=function(t){return arguments.length?(k=t?-1:1,I()):k<0},P.precision=function(t){return arguments.length?(o=Xr(s,E=t*t),D()):T(E)},P.fitExtent=function(t,e){return qr(P,t,e)},P.fitSize=function(t,e){return Hr(P,t,e)},P.fitWidth=function(t,e){return Gr(P,t,e)},P.fitHeight=function(t,e){return Yr(P,t,e)},function(){return e=t.apply(this,arguments),P.invert=e.invert&&C,I()}}function tn(t){var e=0,r=s/3,n=Qr(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*f,r=t[1]*f):[e*p,r*p]},a}function en(t,e){var r=b(t),n=(r+b(e))/2;if(h(n)0?e<-l+o&&(e=-l+o):e>l-o&&(e=l-o);var r=a/_(pn(e),n);return[r*b(n*t),a-r*y(n*t)]}return i.invert=function(t,e){var r=a-e,i=w(n)*T(t*t+r*r),o=m(t,h(r))*w(r);return r*n<0&&(o-=s*w(t)*w(r)),[o/n,2*d(_(a/i,1/n))-l]},i}function hn(t,e){return[t,e]}function dn(t,e){var r=y(t),n=t===e?b(t):(r-y(e))/(e-t),a=r/n+t;if(h(n)o&&--a>0);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},Tn.invert=on(A),kn.invert=on((function(t){return 2*d(t)})),Mn.invert=function(t,e){return[-e,2*d(v(t))-l]},t.geoAlbers=nn,t.geoAlbersUsa=function(){var t,e,r,n,a,i,s=nn(),l=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){i=[t,e]}};function p(t){var e=t[0],o=t[1];return i=null,r.point(e,o),i||(n.point(e,o),i)||(a.point(e,o),i)}function f(){return t=e=null,p}return p.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?l:a>=.166&&a<.234&&n>=-.214&&n<-.115?c:s).invert(t)},p.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],a=n.length,t={point:function(t,e){for(var r=-1;++rOt(n[0],n[1])&&(n[1]=a[1]),Ot(a[0],n[1])>Ot(n[0],n[1])&&(n[0]=a[0])):i.push(n=a);for(o=-1/0,e=0,n=i[r=i.length-1];e<=r;n=a,++e)a=i[e],(s=Ot(n[1],a[0]))>o&&(o=s,tt=a[0],rt=n[1])}return lt=ct=null,tt===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,et],[rt,nt]]},t.geoCentroid=function(t){ut=pt=ft=ht=dt=mt=yt=gt=vt=xt=_t=0,z(t,Nt);var e=vt,r=xt,n=_t,a=e*e+r*r+n*n;return a<1e-12&&(e=mt,r=yt,n=gt,pt2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Mn,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":63}],71:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function a(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function i(t,e){var r,n,a,i,s,u=new c(t),p=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=o);r=f.pop();)if(p&&(r.value=+r.data.value),(a=e(r.data))&&(s=a.length))for(r.children=new Array(s),i=s-1;i>=0;--i)f.push(n=r.children[i]=new c(a[i])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=i.prototype={constructor:c,count:function(){return this.eachAfter(a)},each:function(t){var e,r,n,a,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(t(i),r=i.children)for(n=0,a=r.length;n=0;--r)a.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,a=n&&n.length;--a>=0;)r+=n[a].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),a=null;t=r.pop(),e=n.pop();for(;t===e;)a=t,t=r.pop(),e=n.pop();return a}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var a=n.length;t!==r;)n.splice(a,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return i(this).eachBefore(s)}};var u=Array.prototype.slice;function p(t){for(var e,r,n=0,a=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,i=[];n0&&r*r>n*n+a*a}function m(t,e){for(var r=0;r(o*=o)?(n=(c+o-a)/(2*c),i=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-i*l,r.y=t.y-n*l+i*s):(n=(c+a-o)/(2*c),i=Math.sqrt(Math.max(0,a/c-n*n)),r.x=e.x+n*s-i*l,r.y=e.y+n*l+i*s)):(r.x=e.x+r.r,r.y=e.y)}function _(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,a=e.y-t.y;return r>0&&r*r>n*n+a*a}function b(t){var e=t._,r=t.next._,n=e.r+r.r,a=(e.x*r.r+r.x*e.r)/n,i=(e.y*r.r+r.y*e.r)/n;return a*a+i*i}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(a=t.length))return 0;var e,r,n,a,i,o,s,l,c,u,f;if((e=t[0]).x=0,e.y=0,!(a>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(a>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sf&&(f=s),y=u*u*m,(h=Math.max(f/y,y/p))>d){u-=s;break}d=h}g.push(o={value:u,dice:l1?e:1)},r}(G);var X=function t(e){function r(t,r,n,a,i){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,p=-1,f=o.length,h=t.value;++p1?e:1)},r}(G);t.cluster=function(){var t=e,a=1,i=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var a=e.children;a?(e.x=function(t){return t.reduce(r,0)/t.length}(a),e.y=function(t){return 1+t.reduce(n,0)}(a)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),p=c.x-t(c,u)/2,f=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*a,t.y=(e.y-t.y)*i}:function(t){t.x=(t.x-p)/(f-p)*a,t.y=(1-(e.y?t.y/e.y:1))*i})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,a=+t[0],i=+t[1],s):o?null:[a,i]},s.nodeSize=function(t){return arguments.length?(o=!0,a=+t[0],i=+t[1],s):o?[a,i]:null},s},t.hierarchy=i,t.pack=function(){var t=null,e=1,r=1,n=A;function a(a){return a.x=e/2,a.y=r/2,t?a.eachBefore(E(t)).eachAfter(P(n,.5)).eachBefore(C(1)):a.eachBefore(E(L)).eachAfter(P(A,1)).eachAfter(P(n,a.r/Math.min(e,r))).eachBefore(C(Math.min(e,r)/(2*a.r))),a}return a.radius=function(e){return arguments.length?(t=k(e),a):t},a.size=function(t){return arguments.length?(e=+t[0],r=+t[1],a):[e,r]},a.padding=function(t){return arguments.length?(n="function"==typeof t?t:S(+t),a):n},a},t.packEnclose=p,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function a(a){var i=a.height+1;return a.x0=a.y0=r,a.x1=t,a.y1=e/i,a.eachBefore(function(t,e){return function(n){n.children&&D(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var a=n.x0,i=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return i}return r.id=function(e){return arguments.length?(t=M(e),r):t},r.parentId=function(t){return arguments.length?(e=M(t),r):e},r},t.tree=function(){var t=N,e=1,r=1,n=null;function a(a){var l=function(t){for(var e,r,n,a,i,o=new q(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(i=n.length),a=i-1;a>=0;--a)s.push(r=e.children[a]=new q(n[a],a)),r.parent=e;return(o.parent=new q(null,0)).children=[o],o}(a);if(l.eachAfter(i),l.parent.m=-l.z,l.eachBefore(o),n)a.eachBefore(s);else{var c=a,u=a,p=a;a.eachBefore((function(t){t.xu.x&&(u=t),t.depth>p.depth&&(p=t)}));var f=c===u?1:t(c,u)/2,h=f-c.x,d=e/(u.x+f+h),m=r/(p.depth||1);a.eachBefore((function(t){t.x=(t.x+h)*d,t.y=t.depth*m}))}return a}function i(e){var r=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,a=t.children,i=a.length;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var i=(r[0].z+r[r.length-1].z)/2;a?(e.z=a.z+t(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+t(e._,a._));e.parent.A=function(e,r,n){if(r){for(var a,i=e,o=e,s=r,l=i.parent.children[0],c=i.m,u=o.m,p=s.m,f=l.m;s=j(s),i=B(i),s&&i;)l=B(l),(o=j(o)).a=e,(a=s.z+p-i.z-c+t(s._,i._))>0&&(U(V(s,e,n),e,a),c+=a,u+=a),p+=s.m,c+=i.m,f+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=p-u),i&&!B(l)&&(l.t=i,l.m+=c-f,n=e)}return n}(e,a,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return a.separation=function(e){return arguments.length?(t=e,a):t},a.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],a):n?null:[e,r]},a.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],a):n?[e,r]:null},a},t.treemap=function(){var t=Z,e=!1,r=1,n=1,a=[0],i=A,o=A,s=A,l=A,c=A;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(p),a=[0],e&&t.eachBefore(I),t}function p(e){var r=a[e.depth],n=e.x0+r,u=e.y0+r,p=e.x1-r,f=e.y1-r;p=r-1){var u=s[e];return u.x0=a,u.y0=i,u.x1=o,void(u.y1=l)}var p=c[e],f=n/2+p,h=e+1,d=r-1;for(;h>>1;c[m]l-i){var v=(a*g+o*y)/n;t(e,h,y,a,i,v,l),t(h,r,g,v,i,o,l)}else{var x=(i*g+l*y)/n;t(e,h,y,a,i,o,x),t(h,r,g,a,x,o,l)}}(0,l,t.value,e,r,n,a)},t.treemapDice=D,t.treemapResquarify=X,t.treemapSlice=H,t.treemapSliceDice=function(t,e,r,n,a){(1&t.depth?H:D)(t,e,r,n,a)},t.treemapSquarify=Z,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],72:[function(t,e,r){!function(n,a){"object"==typeof r&&void 0!==e?a(r,t("d3-color")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t,e,r,n,a){var i=t*t,o=i*t;return((1-3*t+3*i-o)*e+(4-6*i+3*o)*r+(1+3*t+3*i-3*o)*n+o*a)/6}function n(t){var e=t.length-1;return function(n){var a=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[a],o=t[a+1],s=a>0?t[a-1]:2*i-o,l=a180||r<-180?r-360*Math.round(r/360):r):i(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):i(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):i(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function a(t,r){var a=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),i=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=a(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return a.gamma=t,a}(1);function p(t){return function(r){var n,a,i=r.length,o=new Array(i),s=new Array(i),l=new Array(i);for(n=0;ni&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:v(r,n)})),i=b.lastIndex;return i180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(a(r)+"rotate(",null,n)-2,x:v(t,e)})):e&&r.push(a(r)+"rotate("+e+n)}(i.rotate,o.rotate,s,l),function(t,e,r,i){t!==e?i.push({i:r.push(a(r)+"skewX(",null,n)-2,x:v(t,e)}):e&&r.push(a(r)+"skewX("+e+n)}(i.skewX,o.skewX,s,l),function(t,e,r,n,i,o){if(t!==r||e!==n){var s=i.push(a(i)+"scale(",null,",",null,")");o.push({i:s-4,x:v(t,r)},{i:s-2,x:v(e,n)})}else 1===r&&1===n||i.push(a(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,s,l),i=o=null,function(t){for(var e,r=-1,n=l.length;++r1e-6)if(Math.abs(p*l-c*u)>1e-6&&i){var h=n-o,d=a-s,m=l*l+c*c,y=h*h+d*d,g=Math.sqrt(m),v=Math.sqrt(f),x=i*Math.tan((e-Math.acos((m+f-y)/(2*g*v)))/2),_=x/v,b=x/g;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*u)+","+(r+_*p)),this._+="A"+i+","+i+",0,0,"+ +(p*h>u*d)+","+(this._x1=t+b*l)+","+(this._y1=r+b*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r);else;},arc:function(t,a,i,o,s,l){t=+t,a=+a,l=!!l;var c=(i=+i)*Math.cos(o),u=i*Math.sin(o),p=t+c,f=a+u,h=1^l,d=l?o-s:s-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+p+","+f:(Math.abs(this._x1-p)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+p+","+f),i&&(d<0&&(d=d%r+r),d>n?this._+="A"+i+","+i+",0,1,"+h+","+(t-c)+","+(a-u)+"A"+i+","+i+",0,1,"+h+","+(this._x1=p)+","+(this._y1=f):d>1e-6&&(this._+="A"+i+","+i+",0,"+ +(d>=e)+","+h+","+(this._x1=t+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],74:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var a,i,o,s,l,c,u,p,f,h=t._root,d={data:n},m=t._x0,y=t._y0,g=t._x1,v=t._y1;if(!h)return t._root=d,t;for(;h.length;)if((c=e>=(i=(m+g)/2))?m=i:g=i,(u=r>=(o=(y+v)/2))?y=o:v=o,a=h,!(h=h[p=u<<1|c]))return a[p]=d,t;if(s=+t._x.call(null,h.data),l=+t._y.call(null,h.data),e===s&&r===l)return d.next=h,a?a[p]=d:t._root=d,t;do{a=a?a[p]=new Array(4):t._root=new Array(4),(c=e>=(i=(m+g)/2))?m=i:g=i,(u=r>=(o=(y+v)/2))?y=o:v=o}while((p=u<<1|c)==(f=(l>=o)<<1|s>=i));return a[f]=h,a[p]=d,t}function r(t,e,r,n,a){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=a}function n(t){return t[0]}function a(t){return t[1]}function i(t,e,r){var i=new o(null==e?n:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function o(t,e,r,n,a,i){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=a,this._y1=i,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=i.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var a=0;a<4;++a)(e=n.source[a])&&(e.length?t.push({source:e,target:n.target[a]=new Array(4)}):n.target[a]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,a,i,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,p=-1/0,f=-1/0;for(n=0;np&&(p=a),if&&(f=i));if(c>p||u>f)return this;for(this.cover(c,u).cover(p,f),n=0;nt||t>=a||n>e||e>=i;)switch(s=(eh||(o=c.y0)>d||(s=c.x1)=v)<<1|t>=g)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,y.data),_=e-+this._y.call(null,y.data),b=x*x+_*_;if(b=(s=(d+y)/2))?d=s:y=s,(u=o>=(l=(m+g)/2))?m=l:g=l,e=h,!(h=h[p=u<<1|c]))return this;if(!h.length)break;(e[p+1&3]||e[p+2&3]||e[p+3&3])&&(r=e,f=p)}for(;h.data!==t;)if(n=h,!(h=h.next))return this;return(a=h.next)&&delete h.next,n?(a?n.next=a:delete n.next,this):e?(a?e[p]=a:delete e[p],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(r?r[f]=h:this._root=h),this):(this._root=a,this)},l.removeAll=function(t){for(var e=0,r=t.length;e1?0:t<-1?u:Math.acos(t)}function d(t){return t>=1?p:t<=-1?-p:Math.asin(t)}function m(t){return t.innerRadius}function y(t){return t.outerRadius}function g(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function _(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,p=s-i,f=p*l-u*c;if(!(f*f<1e-12))return[t+(f=(u*(e-i)-p*(t-a))/f)*l,e+f*c]}function b(t,e,r,n,a,i,s){var l=t-r,u=e-n,p=(s?i:-i)/c(l*l+u*u),f=p*u,h=-p*l,d=t+f,m=e+h,y=r+f,g=n+h,v=(d+y)/2,x=(m+g)/2,_=y-d,b=g-m,w=_*_+b*b,T=a-i,k=d*g-y*m,M=(b<0?-1:1)*c(o(0,T*T*w-k*k)),A=(k*b-_*M)/w,S=(-k*_-b*M)/w,L=(k*b+_*M)/w,E=(-k*_+b*M)/w,P=A-v,C=S-x,I=L-v,D=E-x;return P*P+C*C>I*I+D*D&&(A=L,S=E),{cx:A,cy:S,x01:-f,y01:-h,x11:A*(a/T-1),y11:S*(a/T-1)}}function w(t){this._context=t}function T(t){return new w(t)}function k(t){return t[0]}function M(t){return t[1]}function A(){var t=k,n=M,a=r(!0),i=null,o=T,s=null;function l(r){var l,c,u,p=r.length,f=!1;for(null==i&&(s=o(u=e.path())),l=0;l<=p;++l)!(l=p;--f)c.point(g[f],v[f]);c.lineEnd(),c.areaEnd()}y&&(g[u]=+t(h,u,r),v[u]=+a(h,u,r),c.point(n?+n(h,u,r):g[u],i?+i(h,u,r):v[u]))}if(d)return c=null,d+""||null}function p(){return A().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),i=null,u):a},u.y0=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),u):a},u.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:r(+t),u):i},u.lineX0=u.lineY0=function(){return p().x(t).y(a)},u.lineY1=function(){return p().x(t).y(i)},u.lineX1=function(){return p().x(n).y(a)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function L(t,e){return et?1:e>=t?0:NaN}function E(t){return t}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var P=I(T);function C(t){this._curve=t}function I(t){function e(e){return new C(t(e))}return e._curve=t,e}function D(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function z(){return D(A().curve(P))}function O(){var t=S().curve(P),e=t.curve,r=t.lineX0,n=t.lineX1,a=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return D(r())},delete t.lineX0,t.lineEndAngle=function(){return D(n())},delete t.lineX1,t.lineInnerRadius=function(){return D(a())},delete t.lineY0,t.lineOuterRadius=function(){return D(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function R(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}C.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var F=Array.prototype.slice;function N(t){return t.source}function B(t){return t.target}function j(t){var n=N,a=B,i=k,o=M,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=a.apply(this,l);if(s||(s=r=e.path()),t(s,+i.apply(this,(l[0]=c,l)),+o.apply(this,l),+i.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(a=t,l):a},l.x=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),l):i},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function U(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,a,n,a)}function V(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+a)/2,n,r,n,a)}function q(t,e,r,n,a){var i=R(e,r),o=R(e,r=(r+a)/2),s=R(n,r),l=R(n,a);t.moveTo(i[0],i[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var H={draw:function(t,e){var r=Math.sqrt(e/u);t.moveTo(r,0),t.arc(0,0,r,0,f)}},G={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Y=Math.sqrt(1/3),Z=2*Y,X={draw:function(t,e){var r=Math.sqrt(e/Z),n=r*Y;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},W=Math.sin(u/10)/Math.sin(7*u/10),K=Math.sin(f/10)*W,J=-Math.cos(f/10)*W,$={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=K*r,a=J*r;t.moveTo(0,-r),t.lineTo(n,a);for(var i=1;i<5;++i){var o=f*i/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*a,l*n+s*a)}t.closePath()}},Q={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},tt=Math.sqrt(3),et={draw:function(t,e){var r=-Math.sqrt(e/(3*tt));t.moveTo(0,2*r),t.lineTo(-tt*r,-r),t.lineTo(tt*r,-r),t.closePath()}},rt=-.5,nt=Math.sqrt(3)/2,at=1/Math.sqrt(12),it=3*(at/2+1),ot={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,a=r*at,i=n,o=r*at+r,s=-i,l=o;t.moveTo(n,a),t.lineTo(i,o),t.lineTo(s,l),t.lineTo(rt*n-nt*a,nt*n+rt*a),t.lineTo(rt*i-nt*o,nt*i+rt*o),t.lineTo(rt*s-nt*l,nt*s+rt*l),t.lineTo(rt*n+nt*a,rt*a-nt*n),t.lineTo(rt*i+nt*o,rt*o-nt*i),t.lineTo(rt*s+nt*l,rt*l-nt*s),t.closePath()}},st=[H,G,X,Q,$,et,ot];function lt(){}function ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function pt(t){this._context=t}function ft(t){this._context=t}function ht(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,a=t[0],i=e[0],o=t[r]-a,s=e[r]-i,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(a+n*o),this._beta*e[l]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function r(t){return 1===e?new ut(t):new ht(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function mt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function vt(t,e){this._context=t,this._k=(1-e)/6}vt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new vt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e){this._context=t,this._k=(1-e)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var bt=function t(e){function r(t){return new _t(t,e)}return r.tension=function(e){return t(+e)},r}(0);function wt(t,e,r){var n=t._x1,a=t._y1,i=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,a,i,o,t._x2,t._y2)}function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new Tt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new Mt(t,e):new vt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t,e){this._context=t,this._alpha=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Lt=function t(e){function r(t){return e?new St(t,e):new _t(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Et(t){this._context=t}function Pt(t){return t<0?-1:1}function Ct(t,e,r){var n=t._x1-t._x0,a=e-t._x1,i=(t._y1-t._y0)/(n||a<0&&-0),o=(r-t._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(Pt(i)+Pt(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function It(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Dt(t,e,r){var n=t._x0,a=t._y0,i=t._x1,o=t._y1,s=(i-n)/3;t._context.bezierCurveTo(n+s,a+s*e,i-s,o-s*r,i,o)}function zt(t){this._context=t}function Ot(t){this._context=new Rt(t)}function Rt(t){this._context=t}function Ft(t){this._context=t}function Nt(t){var e,r,n=t.length-1,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)a[e]=(o[e]-a[e+1])/i[e];for(i[n-1]=(t[n]+a[n-1])/2,e=0;e1)for(var r,n,a,i=1,o=t[e[0]],s=o.length;i=0;)r[e]=e;return r}function Vt(t,e){return t[e]}function qt(t){var e=t.map(Ht);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Ht(t){for(var e,r=-1,n=0,a=t.length,i=-1/0;++ri&&(i=e,n=r);return n}function Gt(t){var e=t.map(Yt);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Yt(t){for(var e,r=0,n=-1,a=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=y,w=r(0),T=null,k=g,M=v,A=x,S=null;function L(){var r,m,y=+t.apply(this,arguments),g=+o.apply(this,arguments),v=k.apply(this,arguments)-p,x=M.apply(this,arguments)-p,L=n(x-v),E=x>v;if(S||(S=r=e.path()),g1e-12)if(L>f-1e-12)S.moveTo(g*i(v),g*l(v)),S.arc(0,0,g,v,x,!E),y>1e-12&&(S.moveTo(y*i(x),y*l(x)),S.arc(0,0,y,x,v,E));else{var P,C,I=v,D=x,z=v,O=x,R=L,F=L,N=A.apply(this,arguments)/2,B=N>1e-12&&(T?+T.apply(this,arguments):c(y*y+g*g)),j=s(n(g-y)/2,+w.apply(this,arguments)),U=j,V=j;if(B>1e-12){var q=d(B/y*l(N)),H=d(B/g*l(N));(R-=2*q)>1e-12?(z+=q*=E?1:-1,O-=q):(R=0,z=O=(v+x)/2),(F-=2*H)>1e-12?(I+=H*=E?1:-1,D-=H):(F=0,I=D=(v+x)/2)}var G=g*i(I),Y=g*l(I),Z=y*i(O),X=y*l(O);if(j>1e-12){var W,K=g*i(D),J=g*l(D),$=y*i(z),Q=y*l(z);if(L1e-12?V>1e-12?(P=b($,Q,G,Y,g,V,E),C=b(K,J,Z,X,g,V,E),S.moveTo(P.cx+P.x01,P.cy+P.y01),V1e-12&&R>1e-12?U>1e-12?(P=b(Z,X,K,J,y,-U,E),C=b(G,Y,$,Q,y,-U,E),S.lineTo(P.cx+P.x01,P.cy+P.y01),U0&&(d+=p);for(null!=e?m.sort((function(t,r){return e(y[t],y[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(v-h*_)/d:0;s0?p*c:0)+_,y[l]={data:r[l],index:s,value:p,startAngle:g,endAngle:u,padAngle:x};return y}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=R,t.radialArea=O,t.radialLine=z,t.stack=function(){var t=r([]),e=Ut,n=jt,a=Vt;function i(r){var i,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(i=0;i0)for(var r,n,a,i,o,s,l=0,c=t[e[0]].length;l0?(n[0]=i,n[1]=i+=a):a<0?(n[1]=o,n[0]=o+=a):(n[0]=0,n[1]=a)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,a,i=0,o=t[0].length;i0){for(var r,n=0,a=t[e[0]],i=a.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,a,i=0,o=1;o=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:yt,s:gt,S:q,u:H,U:G,V:Y,w:Z,W:X,x:null,X:null,y:W,Y:K,Z:J,"%":mt},Pt={a:function(t){return p[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:$,e:$,f:nt,H:Q,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:yt,s:gt,S:ot,u:st,U:lt,V:ct,w:ut,W:pt,x:null,X:null,y:ft,Y:ht,Z:dt,"%":mt},Ct={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Lt[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return zt(t,i,e,r)},d:M,e:M,f:C,H:S,I:S,j:A,L:P,m:k,M:L,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=_t[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:D,s:z,S:E,u:y,U:g,V:v,w:m,W:x,x:function(t,e,r){return zt(t,o,e,r)},X:function(t,e,r){return zt(t,l,e,r)},y:b,Y:_,Z:w,"%":I};function It(t,e){return function(r){var n,a,i,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(a(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(a(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(a(c.y,0,1)).getUTCDay():r(a(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function zt(t,e,r,n){for(var a,i,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Ct[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Et.x=It(o,Et),Et.X=It(l,Et),Et.c=It(i,Et),Pt.x=It(o,Pt),Pt.X=It(l,Pt),Pt.c=It(i,Pt),{format:function(t){var e=It(t+="",Et);return e.toString=function(){return t},e},parse:function(t){var e=Dt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Pt);return e.toString=function(){return t},e},utcParse:function(t){var e=Dt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function p(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return p(t.getDate(),e,2)}function R(t,e){return p(t.getHours(),e,2)}function F(t,e){return p(t.getHours()%12||12,e,2)}function N(t,r){return p(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return p(t.getMilliseconds(),e,3)}function j(t,e){return B(t,e)+"000"}function U(t,e){return p(t.getMonth()+1,e,2)}function V(t,e){return p(t.getMinutes(),e,2)}function q(t,e){return p(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return p(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Y(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),p(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Z(t){return t.getDay()}function X(t,r){return p(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function W(t,e){return p(t.getFullYear()%100,e,2)}function K(t,e){return p(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+p(e/60|0,"0",2)+p(e%60,"0",2)}function $(t,e){return p(t.getUTCDate(),e,2)}function Q(t,e){return p(t.getUTCHours(),e,2)}function tt(t,e){return p(t.getUTCHours()%12||12,e,2)}function et(t,r){return p(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return p(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return p(t.getUTCMonth()+1,e,2)}function it(t,e){return p(t.getUTCMinutes(),e,2)}function ot(t,e){return p(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return p(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),p(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function pt(t,r){return p(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ft(t,e){return p(t.getUTCFullYear()%100,e,2)}function ht(t,e){return p(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function yt(t){return+t}function gt(t){return Math.floor(+t/1e3)}function vt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var _t=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=xt,t.isoParse=_t,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":77}],77:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=l.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),p=u.range,f=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),h=f.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var m=d(0),y=d(1),g=d(2),v=d(3),x=d(4),_=d(5),b=d(6),w=m.range,T=y.range,k=g.range,M=v.range,A=x.range,S=_.range,L=b.range,E=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),P=E.range,C=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));C.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var I=C.range,D=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),z=D.range,O=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=O.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),N=F.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=B(0),U=B(1),V=B(2),q=B(3),H=B(4),G=B(5),Y=B(6),Z=j.range,X=U.range,W=V.range,K=q.range,J=H.range,$=G.range,Q=Y.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=f,t.timeDays=h,t.timeFriday=_,t.timeFridays=S,t.timeHour=u,t.timeHours=p,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=c,t.timeMonday=y,t.timeMondays=T,t.timeMonth=E,t.timeMonths=P,t.timeSaturday=b,t.timeSaturdays=L,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=m,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=A,t.timeTuesday=g,t.timeTuesdays=k,t.timeWednesday=v,t.timeWednesdays=M,t.timeWeek=m,t.timeWeeks=w,t.timeYear=C,t.timeYears=I,t.utcDay=F,t.utcDays=N,t.utcFriday=G,t.utcFridays=$,t.utcHour=O,t.utcHours=R,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=D,t.utcMinutes=z,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Y,t.utcSaturdays=Q,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=Z,t.utcThursday=H,t.utcThursdays=J,t.utcTuesday=V,t.utcTuesdays=W,t.utcWednesday=q,t.utcWednesdays=K,t.utcWeek=j,t.utcWeeks=Z,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],78:[function(t,e,r){arguments[4][77][0].apply(r,arguments)},{dup:77}],79:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e,r,n=0,a=0,i=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function p(){return s||(u(f),s=c.now()+l)}function f(){s=0}function h(){this._call=this._time=this._next=null}function d(t,e,r){var n=new h;return n.restart(t,e,r),n}function m(){p(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function y(){s=(o=c.now())+l,n=a=0;try{m()}finally{n=0,function(){var t,n,a=e,i=1/0;for(;a;)a._call?(i>a._time&&(i=a._time),t=a,a=a._next):(n=a._next,a._next=null,a=t?t._next=n:e=n);r=t,v(i)}(),s=0}}function g(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(a&&(a=clearTimeout(a)),t-s>24?(t<1/0&&(a=setTimeout(y,t-c.now()-l)),i&&(i=clearInterval(i))):(i||(o=c.now(),i=setInterval(g,1e3)),n=1,u(y)))}h.prototype=d.prototype={constructor:h,restart:function(t,n,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?p():+a)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=a,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.interval=function(t,e,r){var n=new h,a=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?p():+r,n.restart((function i(o){o+=a,n.restart(i,a+=e,r),t(o)}),e,r),n)},t.now=p,t.timeout=function(t,e,r){var n=new h;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],80:[function(t,e,r){var n=t("strongly-connected-components");e.exports=function(t,e){var r,a=[],i=[],o=[],s={},l=[];function c(t){var e,n,a=!1;for(i.push(t),o[t]=!0,e=0;e=e}))}(e);for(var r,a=n(t).components.filter((function(t){return t.length>1})),i=1/0,o=0;o>1,u=-7,p=r?a-1:0,f=r?-1:1,h=t[e+p];for(p+=f,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+t[e+p],p+=f,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+p],p+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=c}return(h?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+p>=1?f/l:f*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=u?(s=0,o=u):o+p>=1?(s=(e*l-1)*Math.pow(2,a),o+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,a),o=0));a>=8;t[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<0;t[r+h]=255&o,h+=d,o/=256,c-=8);t[r+h-d]|=128*m}},{}],115:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],116:[function(t,e,r){e.exports=!0},{}],117:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],118:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],119:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,a){if(t)if(e){var i="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))}else e=a;else t=a}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}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){var r,n,a,i,o;for(void 0===e&&(e=1e-6),a=t,o=0;o<8;o++){if(i=this.sampleCurveX(a)-t,Math.abs(i)(n=1))return n;for(;ri?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=i;function i(t,e){this.x=t,this.y=e}function o(t,e,n,a){var i=new r(t,e,n,a);return function(t){return i.solve(t)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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,a=r*this.x+e*this.y;return this.x=n,this.y=a,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),a=e.x+r*(this.x-e.x)-n*(this.y-e.y),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=a,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,a=((t-e)%n+n)%n+e;return a===e?r:a}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var a in t)n[a]=e.call(r||this,t[a],a,t);return n}function v(t,e,r){var n={};for(var a in t)e.call(r||this,t[a],a,t)&&(n[a]=t[a]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?g(t,x):t}var _={};function b(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,a=n-1,i=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,a){var i=n||a;return e[r]=!i||i.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var A=null;function S(t){if(null==A){var e=t.navigator?t.navigator.userAgent:null;A=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return A}function L(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var E,P,C,I,D=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),z=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,O=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:D,frame:function(t){var e=z(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return E||(E=self.document.createElement("a")),E.href=t,E.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==P&&(P=self.matchMedia("(prefers-reduced-motion: reduce)")),P.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},N={supported:!1,testSupport:function(t){if(B||!I)return;j?U(t):C=t}},B=!1,j=!1;function U(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,I),t.isContextLost())return;N.supported=!0}catch(t){}t.deleteTexture(e),B=!0}self.document&&((I=self.document.createElement("img")).onload=function(){C&&U(C),C=null,j=!0},I.onerror=function(){B=!0,C=null},I.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01";var q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var a=X(t);return H(t)?(a.path="/styles/v1"+a.path+"/sprite"+e+r,this._makeAPIURL(a,this._customAccessToken||n)):(a.path+=""+e+r,W(a))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=X(t),n=R.devicePixelRatio>=2||512===e?"@2x":"",a=N.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+a),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){b("Unable to write to LocalStorage")}},J.prototype.processRequests=function(t){},J.prototype.postEvent=function(t,e,r,n){var a=this;if(F.EVENTS_URL){var i=X(F.EVENTS_URL);i.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?u(o,e):o,l={url:W(i),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=_t(l,(function(t){a.pendingRequest=null,r(t),a.saveEventData(),a.processRequests(n)}))}},J.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var $,Q,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,a=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=h()),this.postEvent(a,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(J),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=K(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,a=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=h(),a=!0);var i=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(i),l=(i-this.eventData.lastSuccess)/864e5;a=a||l>=1||l<-1||o.getDate()!==s.getDate()}else a=!0;if(!a)return this.processRequests();this.postEvent(i,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=i,e.eventData.tokenU=n)}),t)}},e}(J)),rt=et.postTurnstileEvent.bind(et),nt=new tt,at=nt.postMapLoadEvent.bind(nt),it=500,ot=50;function st(){self.caches&&!$&&($=self.caches.open("mapbox-tiles"))}function lt(t,e,r){if(st(),$){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var a=M(e.headers.get("Cache-Control")||"");if(!a["no-store"])a["max-age"]&&n.headers.set("Expires",new Date(r+1e3*a["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Q)try{new Response(new ReadableStream),Q=!0}catch(t){Q=!1}Q?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),$&&$.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return b(t.message)}))}))}}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ut(t,e){if(st(),!$)return e(null);var r=ct(t.url);$.then((function(t){t.match(r).then((function(n){var a=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),a&&t.put(r,n.clone()),e(null,n,a)})).catch(e)})).catch(e)}var pt,ft=1/0;function ht(){return null==pt&&(pt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),pt}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt=function(t){function e(e,r,n){401===r&&Y(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function gt(t,e){var r,n=new self.AbortController,a=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:n.signal}),i=!1,o=!1,s=(r=a.url).indexOf("sku=")>0&&Y(r);"json"===t.type&&a.headers.set("Accept","application/json");var l=function(r,n,i){if(!o){if(r&&"SecurityError"!==r.message&&b(r),n&&i)return c(n);var l=Date.now();self.fetch(a).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&<(a,n,s),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?ut(a,l):l(null,null),{cancel:function(){o=!0,i||n.abort()}}}var vt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(yt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return gt(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return vt(u(t,{type:"arrayBuffer"}),e)},_t=function(t,e){return vt(u(t,{method:"POST"}),e)};var bt,wt;bt=[],wt=0;var Tt=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),wt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return bt.push(r),r}wt++;var n=!1,a=function(){if(!n)for(n=!0,wt--;bt.length&&wt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Lt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Et={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Pt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ct(t){var e=t.key,r=t.value;return r?[new Pt(e,r,"constants have been deprecated as of v8")]:[]}function It(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,a=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Wt=[Ft,Nt,Bt,jt,Ut,Gt,Vt,Zt(qt),Yt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Wt;r255?255:t}function a(t){return t<0?0:t>1?1:t}function i(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?a(parseFloat(t)/100):a(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}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in r)return r[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),p=a.substr(l+1,c-(l+1)).split(","),f=1;switch(u){case"rgba":if(4!==p.length)return null;f=o(p.pop());case"rgb":return 3!==p.length?null:[i(p[0]),i(p[1]),i(p[2]),f];case"hsla":if(4!==p.length)return null;f=o(p.pop());case"hsl":if(3!==p.length)return null;var h=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return[n(255*s(g,y,h+1/3)),n(255*s(g,y,h)),n(255*s(g,y,h-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=Qt(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],a=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+a+")"},te.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=a},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ae)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in pe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[s],n++}else i=qt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Zt(i,o)}else r=pe[a];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var he=function(t){this.type=Gt,this.sections=t};he.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],a=!1,i=1;i<=t.length-1;++i){var o=t[i];if(a&&"object"==typeof o&&!Array.isArray(o)){a=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Nt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Zt(Bt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Ut)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var p=e.parse(t[i],1,qt);if(!p)return null;var f=p.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:p,scale:null,font:null,textColor:null})}}return new he(n)},he.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Yt?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},he.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":jt,"to-color":Ut,"to-number":Nt,"to-string":Bt},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=me[r],a=[],i=1;i4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ie(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Te(t,e){var r,n=(180+t[0])/360,a=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,e.z);return[Math.round(n*i*8192),Math.round(a*i*8192)]}function ke(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Me(t,e){for(var r,n,a,i,o,s,l,c=!1,u=0,p=e.length;u0&&p<0||u<0&&p>0}function Le(t,e,r){for(var n=0,a=r;nr[2]){var a=.5*n,i=t[0]-r[0]>a?-n:r[0]-t[0]>a?n:0;0===i&&(i=t[0]-r[2]>a?-n:r[2]-t[0]>a?n:0),t[0]+=i}be(e,t)}function ze(t,e,r,n){for(var a=8192*Math.pow(2,n.z),i=[8192*n.x,8192*n.y],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ue("Input is not a number.");o=s-1}return 0}Ue.prototype.parse=function(t,e,r,n,a){return void 0===a&&(a={}),e?this.concat(e,r,n)._parse(t,a):this._parse(t,a)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new fe(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=this.registry[n];if(a){var i=a.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,s=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof ce)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof xe&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof Re)return!1;var r=e instanceof ye||e instanceof fe,n=!0;if(e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ce})),!n)return!1;return Fe(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(i)){var l=new ve;try{i=new ce(i.type,i.evaluate(l))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,a,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ot(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,a=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,a);if(!u)return null;a=a||u.type,n.push([o,u])}return new qe(a,r,n)},qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;return n>=e[a-1]?r[a-1].evaluate(t):r[Ve(e,n)].evaluate(t)},qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ge=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new te(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return He(t,e[n],r)}))}}),Ye=6/29,Ze=3*Ye*Ye,Xe=Math.PI/180,We=180/Math.PI;function Ke(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ze+4/29}function Je(t){return t>Ye?t*t*t:Ze*(t-4/29)}function $e(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=Qe(t.r),r=Qe(t.g),n=Qe(t.b),a=Ke((.4124564*e+.3575761*r+.1804375*n)/.95047),i=Ke((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Ke((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Je(e),r=.95047*Je(r),n=1.08883*Je(n),new te($e(3.2404542*r-1.5371385*e-.4985314*n),$e(-.969266*r+1.8760108*e+.041556*n),$e(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function rr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ar={forward:function(t){var e=tr(t),r=e.l,n=e.a,a=e.b,i=Math.atan2(a,n)*We;return{h:i<0?i+360:i,c:Math.sqrt(n*n+a*a),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:nr,hcl:ar}),or=function(t,e,r,n,a){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var i=0,o=a;i1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(a=e.parse(a,2,Nt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var m=e.parse(f,d,c);if(!m)return null;c=c||m.type,l.push([p,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new or(c,r,n,a,l):e.error("Type "+Xt(c)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var a=e.length;if(n>=e[a-1])return r[a-1].evaluate(t);var i=Ve(e,n),o=e[i],s=e[i+1],l=or.interpolationFactor(this.interpolation,n,o,s),c=r[i].evaluate(t),u=r[i+1].evaluate(t);return"interpolate"===this.operator?Ge[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?ar.reverse(ar.interpolate(ar.forward(c),ar.forward(u),l)):nr.reverse(nr.interpolate(nr.forward(c),nr.forward(u),l))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var pr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};pr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);return r&&n?Jt(r.type,[jt,Bt,Nt,Ft,qt])?new pr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead"):null},pr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!$t(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!$t(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");return r.indexOf(e)>=0},pr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},pr.prototype.outputDefined=function(){return!0},pr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fr=function(t,e,r){this.type=Nt,this.needle=t,this.haystack=e,this.fromIndex=r};fr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);if(!r||!n)return null;if(!Jt(r.type,[jt,Bt,Nt,Ft,qt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Nt);return a?new fr(r,n,a):null}return new fr(r,n)},fr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!$t(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!$t(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},fr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},fr.prototype.outputDefined=function(){return!1},fr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r,n,a,i){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i};hr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var a={},i=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,se(f)))return null}else r=se(f);if(void 0!==a[String(f)])return c.error("Branch labels must be unique.");a[String(f)]=i.length}var h=e.parse(l,o,n);if(!h)return null;n=n||h.type,i.push(h)}var d=e.parse(t[1],1,qt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new hr(r,n,d,a,i,m):null},hr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},hr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},hr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},hr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},a=0,i=Object.keys(this.cases).sort();a=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,Nt);if(!r||!n)return null;if(!Jt(r.type,[Zt(qt),Bt,qt]))return e.error("Expected first argument to be of type array or string, but found "+Xt(r.type)+" instead");if(4===t.length){var a=e.parse(t[3],3,Nt);return a?new mr(r.type,r,n,a):null}return new mr(r.type,r,n)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!$t(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Xt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xr=vr("==",(function(t,e,r){return e===r}),gr),_r=vr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!gr(0,e,r,n)})),br=vr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Tr=vr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),kr=vr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Mr=function(t,e,r,n,a){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=a};Mr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Nt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var a=null;if(n.locale&&!(a=e.parse(n.locale,1,Bt)))return null;var i=null;if(n.currency&&!(i=e.parse(n.currency,1,Bt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Nt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Nt))?null:new Mr(r,a,i,o,s)},Mr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ar=function(t){this.type=Nt,this.input=t};Ar.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Xt(r.type)+" instead."):new Ar(r):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Xt(se(e))+" instead.")},Ar.prototype.eachChild=function(t){t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":xr,"!=":_r,">":wr,"<":br,">=":kr,"<=":Tr,array:fe,at:ur,boolean:fe,case:dr,coalesce:lr,collator:_e,format:he,image:de,in:pr,"index-of":fr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Ar,let:cr,literal:ce,match:hr,number:fe,"number-format":Mr,object:fe,slice:mr,step:qe,string:fe,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:je,within:Re};function Lr(t,e){var r=e[0],n=e[1],a=e[2],i=e[3];r=r.evaluate(t),n=n.evaluate(t),a=a.evaluate(t);var o=i?i.evaluate(t):1,s=ie(r,n,a,o);if(s)throw new ue(s);return new te(r/255*o,n/255*o,a/255*o,o)}function Er(t,e){return t in e}function Pr(t,e){var r=e[t];return void 0===r?null:r}function Cr(t){return{type:t}}function Ir(t){return{result:"success",value:t}}function Dr(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Nr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Br(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,a){return jr(typeof r===a?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var a=Ve(t.stops.map((function(t){return t[0]})),r);return t.stops[a][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Fr(r))return jr(t.default,e.default);var a=t.stops.length;if(1===a)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[a-1][0])return t.stops[a-1][1];var i=Ve(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var a=n-r,i=t-r;return 0===a?0:1===e?i/a:(Math.pow(e,i)-1)/(Math.pow(e,a)-1)}(r,n,t.stops[i][0],t.stops[i+1][0]),s=t.stops[i][1],l=t.stops[i+1][1],c=Ge[e.type]||Br;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=ir[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function Hr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ae.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}xe.register(Sr,{error:[{kind:"error"},[Bt],function(t,e){var r=e[0];throw new ue(r.evaluate(t))}],typeof:[Bt,[qt],function(t,e){return Xt(se(e[0].evaluate(t)))}],"to-rgba":[Zt(Nt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Nt,Nt,Nt],Lr],rgba:[Ut,[Nt,Nt,Nt,Nt],Lr],has:{type:jt,overloads:[[[Bt],function(t,e){return Er(e[0].evaluate(t),t.properties())}],[[Bt,Vt],function(t,e){var r=e[0],n=e[1];return Er(r.evaluate(t),n.evaluate(t))}]]},get:{type:qt,overloads:[[[Bt],function(t,e){return Pr(e[0].evaluate(t),t.properties())}],[[Bt,Vt],function(t,e){var r=e[0],n=e[1];return Pr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[qt,[Bt],function(t,e){return Pr(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Nt,[],function(t){return t.globals.zoom}],"heatmap-density":[Nt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Nt,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Nt,Cr(Nt),function(t,e){for(var r=0,n=0,a=e;n":[jt,[Bt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>i}],"filter-id->":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>a}],"filter-<=":[jt,[Bt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a<=i}],"filter-id-<=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n<=a}],"filter->=":[jt,[Bt,qt],function(t,e){var r=e[0],n=e[1],a=t.properties()[r.value],i=n.value;return typeof a==typeof i&&a>=i}],"filter-id->=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),a=r.value;return typeof n==typeof a&&n>=a}],"filter-has":[jt,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[Zt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Zt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Bt,Zt(qt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Bt,Zt(qt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var a=r+n>>1;if(e[a]===t)return!0;e[a]>t?n=a-1:r=a+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Cr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Zr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Bt,number:Nt,enum:Bt,boolean:jt,formatted:Gt,resolvedImage:Yt};if("array"===t.type)return Zt(e[t.value]||qt,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ir(new Gr(n,e)):Dr(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,a,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ne(e.expression)};Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,a,i)},Xr.prototype.evaluate=function(t,e,r,n,a,i){return this._styleExpression.evaluate(t,e,r,n,a,i)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ne(e.expression),this.interpolationType=n};function Kr(t,e){if("error"===(t=Zr(t,e)).result)return t;var r=t.value.expression,n=Fe(r);if(!n&&!zr(e))return Dr([new Ot("","data expressions not supported")]);var a=Be(r,["zoom"]);if(!a&&!Or(e))return Dr([new Ot("","zoom expressions not supported")]);var i=function t(e){var r=null;if(e instanceof cr)r=t(e.result);else if(e instanceof lr)for(var n=0,a=e.args;nn.maximum?[new Pt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function en(t){var e,r,n,a=t.valueSpec,i=Dt(t.value.type),o={},s="categorical"!==i&&void 0===t.value.property,l=!s,c="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),u=$r({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new Pt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Qr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Fr(r)&&0===r.length&&e.push(new Pt(t.key,r,"array must have at least one stop"));return e},default:function(t){return kn({key:t.key,value:t.value,valueSpec:a,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&u.push(new Pt(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||u.push(new Pt(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Rr(t.valueSpec)&&u.push(new Pt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!zr(t.valueSpec)?u.push(new Pt(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&u.push(new Pt(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||u.push(new Pt(t.key,t.value,'"property" property is required')),u;function p(t){var e=[],i=t.value,s=t.key;if("array"!==Fr(i))return[new Pt(s,i,"array expected, "+Fr(i)+" found")];if(2!==i.length)return[new Pt(s,i,"array length 2 expected, length "+i.length+" found")];if(c){if("object"!==Fr(i[0]))return[new Pt(s,i,"object expected, "+Fr(i[0])+" found")];if(void 0===i[0].zoom)return[new Pt(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new Pt(s,i,"object stop key must have value")];if(n&&n>Dt(i[0].zoom))return[new Pt(s,i[0].zoom,"stop zoom values must appear in ascending order")];Dt(i[0].zoom)!==n&&(n=Dt(i[0].zoom),r=void 0,o={}),e=e.concat($r({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return Yr(zt(i[1]))?e.concat([new Pt(s+"[1]",i[1],"expressions are not allowed in function stops.")]):e.concat(kn({key:s+"[1]",value:i[1],valueSpec:a,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Fr(t.value),l=Dt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Pt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Pt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var u="number expected, "+s+" found";return zr(a)&&void 0===i&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(t.key,c,u)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function cn(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?hn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cn))):"all"===r?["all"].concat(t.slice(1).map(cn)):"none"===r?["all"].concat(t.slice(1).map(cn).map(hn)):"in"===r?pn(t[1],t.slice(2)):"!in"===r?hn(pn(t[1],t.slice(2))):"has"===r?fn(t[1]):"!has"===r?hn(fn(t[1])):"within"!==r||t}function un(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function pn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ln)]]:["filter-in-small",t,["literal",e]]}}function fn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function hn(t){return["!",t]}function dn(t){return an(zt(t.value))?rn(It({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Fr(r))return[new Pt(n,r,"array expected, "+Fr(r)+" found")];var a,i=e.styleSpec,o=[];if(r.length<1)return[new Pt(n,r,"filter array must have at least 1 element")];switch(o=o.concat(nn({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Dt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Dt(r[1])&&o.push(new Pt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Pt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=Fr(r[1]))&&o.push(new Pt(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s=u[h+0]&&n>=u[h+1])?(o[f]=!0,i.push(c[f])):o[f]=!1}}},On.prototype._forEachCell=function(t,e,r,n,a,i,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),p=this._convertToCellCoord(n),f=l;f<=u;f++)for(var h=c;h<=p;h++){var d=this.d*h+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(h),this._convertFromCellCoord(f+1),this._convertFromCellCoord(h+1)))&&a.call(this,t,e,r,n,d,i,o,s))return}},On.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var p=t[u];c[u]=Nn[l].shallow.indexOf(u)>=0?p:qn(p,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function Hn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Hn);if("object"==typeof t){var e=t.$name||"Object",r=Nn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),a=0,i=Object.keys(t);a=0?s:Hn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Yn["CJK Compatibility Ideographs"](t)||(!!Yn["CJK Compatibility"](t)||(!!Yn["CJK Radicals Supplement"](t)||(!!Yn["CJK Strokes"](t)||(!(!Yn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Yn["CJK Unified Ideographs Extension A"](t)||(!!Yn["CJK Unified Ideographs"](t)||(!!Yn["Enclosed CJK Letters and Months"](t)||(!!Yn["Hangul Compatibility Jamo"](t)||(!!Yn["Hangul Jamo Extended-A"](t)||(!!Yn["Hangul Jamo Extended-B"](t)||(!!Yn["Hangul Jamo"](t)||(!!Yn["Hangul Syllables"](t)||(!!Yn.Hiragana(t)||(!!Yn["Ideographic Description Characters"](t)||(!!Yn.Kanbun(t)||(!!Yn["Kangxi Radicals"](t)||(!!Yn["Katakana Phonetic Extensions"](t)||(!(!Yn.Katakana(t)||12540===t)||(!(!Yn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Yn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Yn["Unified Canadian Aboriginal Syllabics"](t)||(!!Yn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Yn["Vertical Forms"](t)||(!!Yn["Yijing Hexagram Symbols"](t)||(!!Yn["Yi Syllables"](t)||!!Yn["Yi Radicals"](t))))))))))))))))))))))))))))))}function Kn(t){return!(Wn(t)||function(t){return!(!Yn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Yn["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!Yn["Letterlike Symbols"](t)||(!!Yn["Number Forms"](t)||(!(!Yn["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!Yn["Control Pictures"](t)||9251===t)||(!!Yn["Optical Character Recognition"](t)||(!!Yn["Enclosed Alphanumerics"](t)||(!!Yn["Geometric Shapes"](t)||(!(!Yn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Yn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Yn["CJK Symbols and Punctuation"](t)||(!!Yn.Katakana(t)||(!!Yn["Private Use Area"](t)||(!!Yn["CJK Compatibility Forms"](t)||(!!Yn["Small Form Variants"](t)||(!!Yn["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function Jn(t){return t>=1424&&t<=2303||Yn["Arabic Presentation Forms-A"](t)||Yn["Arabic Presentation Forms-B"](t)}function $n(t,e){return!(!e&&Jn(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Yn.Khmer(t))}function Qn(t){for(var e=0,r=t;e-1&&(ia=na),aa&&aa(t)};function la(){ca.fire(new At("pluginStateChange",{pluginStatus:ia,pluginURL:oa}))}var ca=new Lt,ua=function(){return ia},pa=function(){if(ia!==ta||!oa)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ia=ea,la(),oa&&xt({url:oa},(function(t){t?sa(t):(ia=ra,la())}))},fa={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ia===ra||null!=fa.applyArabicShaping},isLoading:function(){return ia===ea},setState:function(t){ia=t.pluginStatus,oa=t.pluginURL},isParsed:function(){return null!=fa.applyArabicShaping&&null!=fa.processBidirectionalText&&null!=fa.processStyledBidirectionalText},getPluginURL:function(){return oa}},ha=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Gn,this.transition={})};ha.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var da=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Nr(t))return new Jr(t,e);if(Yr(t)){var r=Kr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};da.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},da.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ma=function(t){this.property=t,this.value=new da(t,void 0)};ma.prototype.transitioned=function(t,e){return new ga(this.property,this.value,e,u({},t.transition,this.transition),t.now)},ma.prototype.untransitioned=function(){return new ga(this.property,this.value,null,{},0)};var ya=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ya.prototype.getValue=function(t){return x(this._values[t].value.value)},ya.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ma(this._values[t].property)),this._values[t].value=new da(this._values[t].property,null===e?void 0:x(e))},ya.prototype.getTransition=function(t){return x(this._values[t].transition)},ya.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ma(this._values[t].property)),this._values[t].transition=x(e)||void 0},ya.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return a};var va=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};va.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ba(this._properties),a=0,i=Object.keys(this._values);an.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ta),Ma=function(t){this.specification=t};Ma.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var a=t.expression.evaluate(e,null,{},r,n);return this._calculate(a,a,a,e)}return this._calculate(t.expression.evaluate(new ha(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ha(Math.floor(e.zoom),e)),t.expression.evaluate(new ha(Math.floor(e.zoom+1),e)),e)}},Ma.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ma.prototype.interpolate=function(t){return t};var Aa=function(t){this.specification=t};Aa.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Aa.prototype.interpolate=function(){return!1};var Sa=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new da(r,void 0),a=this.defaultTransitionablePropertyValues[e]=new ma(r);this.defaultTransitioningPropertyValues[e]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Bn("DataDrivenProperty",Ta),Bn("DataConstantProperty",wa),Bn("CrossFadedDataDrivenProperty",ka),Bn("CrossFadedProperty",Ma),Bn("ColorRampProperty",Aa);var La=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new xa(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ya(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ba(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(In,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Cn,n,t,e,r))return!1}if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var a=this._transitionablePaint._values[t],i="cross-faded-data-driven"===a.property.specification["property-type"],o=a.value.isDataDriven(),s=a.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Dn(this,t.call(En,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Et,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof _a&&zr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Lt),Ea={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Pa=function(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},Ca=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ia(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var a,i=(a=t.type,Ea[a].BYTES_PER_ELEMENT),o=r=Da(r,Math.max(e,i)),s=t.components||1;return n=Math.max(n,i),r+=i*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Da(r,Math.max(n,e)),alignment:e}}function Da(t,e){return Math.ceil(t/e)*e}Ca.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ca.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ca.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ca.prototype.clear=function(){this.length=0},Ca.prototype.resize=function(t){this.reserve(t),this.length=t},Ca.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ca.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ca);za.prototype.bytesPerElement=4,Bn("StructArrayLayout2i4",za);var Oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,this.int16[i+3]=a,t},e}(Ca);Oa.prototype.bytesPerElement=8,Bn("StructArrayLayout4i8",Oa);var Ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(Ca);Ra.prototype.bytesPerElement=12,Bn("StructArrayLayout2i4i12",Ra);var Fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=a,this.uint8[l+6]=i,this.uint8[l+7]=o,t},e}(Ca);Fa.prototype.bytesPerElement=8,Bn("StructArrayLayout2i4ub8",Fa);var Na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,a,i,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u){var p=9*t,f=18*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=a,this.uint16[p+4]=i,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.uint8[f+16]=c,this.uint8[f+17]=u,t},e}(Ca);Na.prototype.bytesPerElement=18,Bn("StructArrayLayout8ui2ub18",Na);var Ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,c,u,p){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,a,i,o,s,l,c,u,p)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u,p,f){var h=12*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=a,this.uint16[h+4]=i,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.int16[h+8]=c,this.int16[h+9]=u,this.int16[h+10]=p,this.int16[h+11]=f,t},e}(Ca);Ba.prototype.bytesPerElement=24,Bn("StructArrayLayout4i4ui4i24",Ba);var ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,t},e}(Ca);ja.prototype.bytesPerElement=12,Bn("StructArrayLayout3f12",ja);var Ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Ca);Ua.prototype.bytesPerElement=4,Bn("StructArrayLayout1ul4",Ua);var Va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,a,i,o,s,l)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c){var u=10*t,p=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=a,this.int16[u+4]=i,this.int16[u+5]=o,this.uint32[p+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Ca);Va.prototype.bytesPerElement=20,Bn("StructArrayLayout6i1ul2ui20",Va);var qa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,a,i)},e.prototype.emplace=function(t,e,r,n,a,i,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=a,this.int16[s+4]=i,this.int16[s+5]=o,t},e}(Ca);qa.prototype.bytesPerElement=12,Bn("StructArrayLayout2i2i2i12",qa);var Ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n,a)},e.prototype.emplace=function(t,e,r,n,a,i){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=a,this.int16[s+7]=i,t},e}(Ca);Ha.prototype.bytesPerElement=16,Bn("StructArrayLayout2f1f2i16",Ha);var Ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=12*t,o=3*t;return this.uint8[i+0]=e,this.uint8[i+1]=r,this.float32[o+1]=n,this.float32[o+2]=a,t},e}(Ca);Ga.prototype.bytesPerElement=12,Bn("StructArrayLayout2ub2f12",Ga);var Ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.uint16[a+0]=e,this.uint16[a+1]=r,this.uint16[a+2]=n,t},e}(Ca);Ya.prototype.bytesPerElement=6,Bn("StructArrayLayout3ui6",Ya);var Za=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y,g){var v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=a,this.uint32[x+2]=i,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=p,this.float32[x+8]=f,this.uint8[_+36]=h,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=y,this.int16[v+22]=g,t},e}(Ca);Za.prototype.bytesPerElement=48,Bn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Za);var Xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y,g,v,x,_,b,w,T,k,M,A,S){var L=this.length;return this.resize(L+1),this.emplace(L,t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y,g,v,x,_,b,w,T,k,M,A,S)},e.prototype.emplace=function(t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y,g,v,x,_,b,w,T,k,M,A,S,L){var E=34*t,P=17*t;return this.int16[E+0]=e,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=a,this.int16[E+4]=i,this.int16[E+5]=o,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=c,this.uint16[E+9]=u,this.uint16[E+10]=p,this.uint16[E+11]=f,this.uint16[E+12]=h,this.uint16[E+13]=d,this.uint16[E+14]=m,this.uint16[E+15]=y,this.uint16[E+16]=g,this.uint16[E+17]=v,this.uint16[E+18]=x,this.uint16[E+19]=_,this.uint16[E+20]=b,this.uint16[E+21]=w,this.uint16[E+22]=T,this.uint32[P+12]=k,this.float32[P+13]=M,this.float32[P+14]=A,this.float32[P+15]=S,this.float32[P+16]=L,t},e}(Ca);Xa.prototype.bytesPerElement=68,Bn("StructArrayLayout8i15ui1ul4f68",Xa);var Wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Ca);Wa.prototype.bytesPerElement=4,Bn("StructArrayLayout1f4",Wa);var Ka=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=3*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,t},e}(Ca);Ka.prototype.bytesPerElement=6,Bn("StructArrayLayout3i6",Ka);var Ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var a=2*t,i=4*t;return this.uint32[a+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ca);Ja.prototype.bytesPerElement=8,Bn("StructArrayLayout1ul2ui8",Ja);var $a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ca);$a.prototype.bytesPerElement=4,Bn("StructArrayLayout2ui4",$a);var Qa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Ca);Qa.prototype.bytesPerElement=2,Bn("StructArrayLayout1ui2",Qa);var ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ca);ti.prototype.bytesPerElement=8,Bn("StructArrayLayout2f8",ti);var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,a){var i=4*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,this.float32[i+3]=a,t},e}(Ca);ei.prototype.bytesPerElement=16,Bn("StructArrayLayout4f16",ei);var ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Pa);ri.prototype.size=20;var ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ri(this,t)},e}(Va);Bn("CollisionBoxArray",ni);var ai=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Pa);ai.prototype.size=48;var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ai(this,t)},e}(Za);Bn("PlacedSymbolArray",ii);var oi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Pa);oi.prototype.size=68;var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new oi(this,t)},e}(Xa);Bn("SymbolInstanceArray",si);var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Wa);Bn("GlyphOffsetArray",li);var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ka);Bn("SymbolLineVertexArray",ci);var ui=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Pa);ui.prototype.size=8;var pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ui(this,t)},e}(Ja);Bn("FeatureIndexArray",pi);var fi=Ia([{name:"a_pos",components:2,type:"Int16"}],4).members,hi=function(t){void 0===t&&(t=[]),this.segments=t};function di(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}hi.prototype.prepareSegment=function(t,e,r,n){var a=this.segments[this.segments.length-1];return t>hi.MAX_VERTEX_ARRAY_LENGTH&&b("Max vertices per segment is "+hi.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!a||a.vertexLength+t>hi.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a},hi.prototype.get=function(){return this.segments},hi.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:a^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),gi=e((function(t){t.exports=function(t,e){for(var r,n=t.length,a=e^n,i=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(i)|(255&t.charCodeAt(++i))<<8|(255&t.charCodeAt(++i))<<16|(255&t.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:a^=(255&t.charCodeAt(i+2))<<16;case 2:a^=(255&t.charCodeAt(i+1))<<8;case 1:a=1540483477*(65535&(a^=255&t.charCodeAt(i)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0}})),vi=yi,xi=yi,_i=gi;vi.murmur3=xi,vi.murmur2=_i;var bi=function(){this.ids=[],this.positions=[],this.indexed=!1};bi.prototype.add=function(t,e,r,n){this.ids.push(Ti(t)),this.positions.push(e,r,n)},bi.prototype.getPositions=function(t){for(var e=Ti(t),r=0,n=this.ids.length-1;r>1;this.ids[a]>=e?n=a:r=a+1}for(var i=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];i.push({index:o,start:s,end:l}),r++}return i},bi.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,a){for(;n>1],o=n-1,s=a+1;;){do{o++}while(e[o]i);if(o>=s)break;ki(e,o,s),ki(r,3*o,3*s),ki(r,3*o+1,3*s+1),ki(r,3*o+2,3*s+2)}s-nGi.max||o.yGi.max)&&(b("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Gi.min,Gi.max),o.y=l(o.y,Gi.min,Gi.max))}return r}function Zi(t,e,r,n,a){t.emplaceBack(2*e+(n+1)/2,2*r+(a+1)/2)}var Xi=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new za,this.indexArray=new Ya,this.segments=new hi,this.programConfigurations=new Ui(fi,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Wi(t,e){for(var r=0;r1){if(Qi(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(a)._add(e))}function no(t,e){for(var r,n,a,i=!1,o=0;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(i=!i);return i}function ao(t,e){for(var r=!1,n=0,a=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function io(t,e,r){var n=r[0],a=r[2];if(t.xa.x&&e.x>a.x||t.ya.y&&e.y>a.y)return!1;var i=w(t,e,r[0]);return i!==w(t,e,r[1])||i!==w(t,e,r[2])||i!==w(t,e,r[3])}function oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function so(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function lo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=8192||u<0||u>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=p.vertexLength;Zi(this.layoutVertexArray,c,u,-1,-1),Zi(this.layoutVertexArray,c,u,1,-1),Zi(this.layoutVertexArray,c,u,1,1),Zi(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Bn("CircleBucket",Xi,{omit:["layers"]});var co=new Sa({"circle-sort-key":new Ta(Et.layout_circle["circle-sort-key"])}),uo={paint:new Sa({"circle-radius":new Ta(Et.paint_circle["circle-radius"]),"circle-color":new Ta(Et.paint_circle["circle-color"]),"circle-blur":new Ta(Et.paint_circle["circle-blur"]),"circle-opacity":new Ta(Et.paint_circle["circle-opacity"]),"circle-translate":new wa(Et.paint_circle["circle-translate"]),"circle-translate-anchor":new wa(Et.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wa(Et.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wa(Et.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ta(Et.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ta(Et.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ta(Et.paint_circle["circle-stroke-opacity"])}),layout:co},po="undefined"!=typeof Float32Array?Float32Array:Array;function fo(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}function ho(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],p=e[8],f=e[9],h=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*p+w*m,t[1]=x*a+_*l+b*f+w*y,t[2]=x*i+_*c+b*h+w*g,t[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*p+w*m,t[5]=x*a+_*l+b*f+w*y,t[6]=x*i+_*c+b*h+w*g,t[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*p+w*m,t[9]=x*a+_*l+b*f+w*y,t[10]=x*i+_*c+b*h+w*g,t[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*p+w*m,t[13]=x*a+_*l+b*f+w*y,t[14]=x*i+_*c+b*h+w*g,t[15]=x*o+_*u+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var mo=ho;var yo,go,vo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};yo=new po(3),po!=Float32Array&&(yo[0]=0,yo[1]=0,yo[2]=0),go=yo;function xo(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*o,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*o,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*o,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*o,t}!function(){var t=function(){var t=new po(4);return po!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var _o=function(t){var e=t[0],r=t[1];return e*e+r*r},bo=(function(){var t=function(){var t=new po(2);return po!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),function(t){function e(e){t.call(this,e,uo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xi(t)},e.prototype.queryRadius=function(t){var e=t;return oo("circle-radius",this,e)+oo("circle-stroke-width",this,e)+so(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,i,o,s){for(var l=lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),p=u?l:function(t,e){return t.map((function(t){return wo(t,e)}))}(l,s),f=u?c*o:c,h=0,d=n;ht.width||a.height>t.height||r.x>t.width-a.width||r.y>t.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||n.x>e.width-a.width||n.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=i=t[0],a=o=t[1];for(var d=r;di&&(i=s),l>o&&(o=l);c=0!==(c=Math.max(i-n,o-a))?1/c:0}return jo(f,h,r,n,a,c),h}function No(t,e,r,n,a){var i,o;if(a===ls(t,e,r,n)>0)for(i=e;i=e;i-=n)o=is(i,t[i],t[i+1],o);return o&&Qo(o,o.next)&&(os(o),o=o.next),o}function Bo(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Qo(n,n.next)&&0!==$o(n.prev,n,n.next))n=n.next;else{if(os(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,a,i,o){if(t){!o&&i&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=Xo(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,c=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,c*=2}while(o>1)}(a)}(t,n,a,i);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,i?Vo(t,n,a,i):Uo(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),os(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?jo(t=qo(Bo(t),e,r),e,r,n,a,i,2):2===o&&Ho(t,e,r,n,a,i):jo(Bo(t),e,r,n,a,i,1);break}}}function Uo(t){var e=t.prev,r=t,n=t.next;if($o(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(Ko(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&$o(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Vo(t,e,r,n){var a=t.prev,i=t,o=t.next;if($o(a,i,o)>=0)return!1;for(var s=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,u=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,p=Xo(s,l,e,r,n),f=Xo(c,u,e,r,n),h=t.prevZ,d=t.nextZ;h&&h.z>=p&&d&&d.z<=f;){if(h!==t.prev&&h!==t.next&&Ko(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&$o(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==t.prev&&d!==t.next&&Ko(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&$o(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=p;){if(h!==t.prev&&h!==t.next&&Ko(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&$o(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&Ko(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&$o(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function qo(t,e,r){var n=t;do{var a=n.prev,i=n.next.next;!Qo(a,i)&&ts(a,n,n.next,i)&&ns(a,i)&&ns(i,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(i.i/r),os(n),os(n.next),n=t=i),n=n.next}while(n!==t);return Bo(n)}function Ho(t,e,r,n,a,i){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Jo(o,s)){var l=as(o,s);return o=Bo(o,o.next),l=Bo(l,l.next),jo(o,e,r,n,a,i),void jo(l,e,r,n,a,i)}s=s.next}o=o.next}while(o!==t)}function Go(t,e){return t.x-e.x}function Yo(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&a!==n.x&&Ko(ir.x||n.x===r.x&&Zo(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e)){var r=as(e,t);Bo(e,e.next),Bo(r,r.next)}}function Zo(t,e){return $o(t.prev,t,e.prev)<0&&$o(e.next,t,t.next)<0}function Xo(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Wo(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function Jo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&ts(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ns(t,e)&&ns(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&($o(t.prev,t,e.prev)||$o(t,e.prev,e))||Qo(t,e)&&$o(t.prev,t,t.next)>0&&$o(e.prev,e,e.next)>0)}function $o(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Qo(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,r,n){var a=rs($o(t,e,r)),i=rs($o(t,e,n)),o=rs($o(r,n,t)),s=rs($o(r,n,e));return a!==i&&o!==s||(!(0!==a||!es(t,r,e))||(!(0!==i||!es(t,n,e))||(!(0!==o||!es(r,t,n))||!(0!==s||!es(r,e,n)))))}function es(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function rs(t){return t>0?1:t<0?-1:0}function ns(t,e){return $o(t.prev,t,t.next)<0?$o(t,e,t.next)>=0&&$o(t,t.prev,e)>=0:$o(t,e,t.prev)<0||$o(t,t.next,e)<0}function as(t,e){var r=new ss(t.i,t.x,t.y),n=new ss(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function is(t,e,r,n){var a=new ss(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function os(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 ss(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 ls(t,e,r,n){for(var a=0,i=e,o=r-n;in;){if(a-n>600){var o=a-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1),p=Math.max(n,Math.floor(r-s*c/o+u)),f=Math.min(a,Math.floor(r+(o-s)*c/o+u));t(e,r,p,f,i)}var h=e[r],d=n,m=a;for(us(e,n,r),i(e[a],h)>0&&us(e,n,a);d0;)m--}0===i(e[n],h)?us(e,n,m):(m++,us(e,m,a)),m<=r&&(n=m+1),r<=m&&(a=m-1)}}(t,e,r||0,n||t.length-1,a||ps)}function us(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ps(t,e){return te?1:0}function fs(t,e){var r=t.length;if(r<=1)return[t];for(var n,a,i=[],o=0;o1)for(var l=0;l0&&(n+=t[a-1].length,r.holes.push(n))}return r},Oo.default=Ro;var ys=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new za,this.indexArray=new Ya,this.indexArray2=new $a,this.programConfigurations=new Ui(zo,t.layers,t.zoom),this.segments=new hi,this.segments2=new hi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ys.prototype.populate=function(t,e,r){this.hasPattern=ds("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),a=[],i=0,o=t;i>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ws.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,a=0,i=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(a+=t.readSVarint())s&&(s=a),(i+=t.readSVarint())c&&(c=i);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},ws.prototype.toGeoJSON=function(t,e,r){var n,a,i=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=ws.types[this.type];function u(t){for(var e=0;e>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}(r))}function Ls(t,e,r){if(3===t){var n=new Ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}As.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 bs(this._pbf,e,this.extent,this._keys,this._values)};var Es={VectorTile:function(t,e){this.layers=t.readFields(Ls,{},e)},VectorTileFeature:bs,VectorTileLayer:Ms},Ps=Es.VectorTileFeature.types,Cs=Math.pow(2,13);function Is(t,e,r,n,a,i,o,s){t.emplaceBack(e,r,2*Math.floor(n*Cs)+o,a*Cs*2,i*Cs*2,Math.round(s))}var Ds=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ra,this.indexArray=new Ya,this.programConfigurations=new Ui(_s,t.layers,t.zoom),this.segments=new hi,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function zs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Os(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>8192}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>8192}))}Ds.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ds("fill-extrusion",this.layers,e);for(var n=0,a=t;n=1){var v=d[y-1];if(!zs(g,v)){p.vertexLength+4>hi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=g.sub(v)._perp()._unit(),_=v.dist(g);m+_>32768&&(m=0),Is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,m),Is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,m),m+=_,Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+l>hi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Ps[t.type]){for(var w=[],T=[],k=p.vertexLength,M=0,A=s;M=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&g>c){var M=u.dist(h);if(M>2*p){var A=u.sub(u.sub(h)._mult(p/M)._round());this.updateDistance(h,A),this.addCurrentVertex(A,m,0,0,f),h=A}}var S=h&&d,L=S?r:s?"butt":n;if(S&&"round"===L&&(ba&&(L="bevel"),"bevel"===L&&(b>2&&(L="flipbevel"),b100)v=y.mult(-1);else{var E=b*m.add(y).mag()/m.sub(y).mag();v._perp()._mult(E*(k?-1:1))}this.addCurrentVertex(u,v,0,0,f),this.addCurrentVertex(u,v.mult(-1),0,0,f)}else if("bevel"===L||"fakeround"===L){var P=-Math.sqrt(b*b-1),C=k?P:0,I=k?0:P;if(h&&this.addCurrentVertex(u,m,C,I,f),"fakeround"===L)for(var D=Math.round(180*w/Math.PI/20),z=1;z2*p){var j=u.add(d.sub(u)._mult(p/B)._round());this.updateDistance(u,j),this.addCurrentVertex(j,y,0,0,f),u=j}}}}},Hs.prototype.addCurrentVertex=function(t,e,r,n,a,i){void 0===i&&(i=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,i,!1,r,a),this.addHalfVertex(t,l,c,i,!0,-n,a),this.distance>qs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,a,i))},Hs.prototype.addHalfVertex=function(t,e,r,n,a,i,o){var s=t.x,l=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(a?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===i?0:i<0?-1:1)|(63&c)<<2,c>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),a?this.e2=u:this.e1=u},Hs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(qs-1):this.distance},Hs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Bn("LineBucket",Hs,{omit:["layers","patternFeatures"]});var Gs=new Sa({"line-cap":new wa(Et.layout_line["line-cap"]),"line-join":new Ta(Et.layout_line["line-join"]),"line-miter-limit":new wa(Et.layout_line["line-miter-limit"]),"line-round-limit":new wa(Et.layout_line["line-round-limit"]),"line-sort-key":new Ta(Et.layout_line["line-sort-key"])}),Ys={paint:new Sa({"line-opacity":new Ta(Et.paint_line["line-opacity"]),"line-color":new Ta(Et.paint_line["line-color"]),"line-translate":new wa(Et.paint_line["line-translate"]),"line-translate-anchor":new wa(Et.paint_line["line-translate-anchor"]),"line-width":new Ta(Et.paint_line["line-width"]),"line-gap-width":new Ta(Et.paint_line["line-gap-width"]),"line-offset":new Ta(Et.paint_line["line-offset"]),"line-blur":new Ta(Et.paint_line["line-blur"]),"line-dasharray":new Ma(Et.paint_line["line-dasharray"]),"line-pattern":new ka(Et.paint_line["line-pattern"]),"line-gradient":new Aa(Et.paint_line["line-gradient"])}),layout:Gs},Zs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new ha(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,a){return r=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,a)},e}(Ta))(Ys.paint.properties["line-width"].specification);Zs.useIntegerZoom=!0;var Xs=function(t){function e(e){t.call(this,e,Ys)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Po(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Zs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Hs(t)},e.prototype.queryRadius=function(t){var e=t,r=Ws(oo("line-width",this,e),oo("line-gap-width",this,e)),n=oo("line-offset",this,e);return r/2+Math.abs(n)+so(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*Ws(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var i=0;i0?e+2*t:t}var Ks=Ia([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Js=Ia([{name:"a_projected_pos",components:3,type:"Float32"}],4),$s=(Ia([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ia([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Qs=(Ia([{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:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ia([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),tl=Ia([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ia([{name:"triangle",components:3,type:"Uint16"}]),Ia([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ia([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ia([{type:"Float32",name:"offsetX"}]),Ia([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function el(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),fa.applyArabicShaping&&(t=fa.applyArabicShaping(t)),t}(t.text,e,r)})),t}var rl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var nl=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,u=-7,p=r?a-1:0,f=r?-1:1,h=t[e+p];for(p+=f,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+t[e+p],p+=f,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=n;u>0;o=256*o+t[e+p],p+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=c}return(h?-1:1)*o*Math.pow(2,i-n)},al=function(t,e,r,n,a,i){var o,s,l,c=8*i-a-1,u=(1<>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+p>=1?f/l:f*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=u?(s=0,o=u):o+p>=1?(s=(e*l-1)*Math.pow(2,a),o+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,a),o=0));a>=8;t[r+h]=255&s,h+=d,s/=256,a-=8);for(o=o<0;t[r+h]=255&o,h+=d,o/=256,c-=8);t[r+h-d]|=128*m},il=ol;function ol(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ol.Varint=0,ol.Fixed64=1,ol.Bytes=2,ol.Fixed32=5;var sl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ll(t){return t.type===ol.Bytes?t.readVarint()+t.pos:t.pos+1}function cl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ul(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var a=r.pos-1;a>=t;a--)r.buf[a+n]=r.buf[a]}function pl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ol.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,i=this.pos;this.type=7&n,t(a,e,this),this.pos===i&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_l(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_l(this.buf,this.pos)+4294967296*_l(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=_l(this.buf,this.pos)+4294967296*wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,a,i=r.buf;if(a=i[r.pos++],n=(112&a)>>4,a<128)return cl(t,n,e);if(a=i[r.pos++],n|=(127&a)<<3,a<128)return cl(t,n,e);if(a=i[r.pos++],n|=(127&a)<<10,a<128)return cl(t,n,e);if(a=i[r.pos++],n|=(127&a)<<17,a<128)return cl(t,n,e);if(a=i[r.pos++],n|=(127&a)<<24,a<128)return cl(t,n,e);if(a=i[r.pos++],n|=(1&a)<<31,a<128)return cl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},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.pos;return this.pos=t,t-e>=12&&sl?function(t,e,r){return sl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",a=e;for(;a239?4:l>223?3:l>191?2:1;if(a+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(i=t[a+1]))&&(c=(31&l)<<6|63&i)<=127&&(c=null):3===u?(i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&((c=(15&l)<<12|(63&i)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&i)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),a+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ol.Bytes)return t.push(this.readVarint(e));var r=ll(this);for(t=t||[];this.pos127;);else if(e===ol.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ol.Fixed32)this.pos+=4;else{if(e!==ol.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),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),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,a,i=0;i55295&&n<57344){if(!a){n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(t[r++]=239,t[r++]=191,t[r++]=189,a=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ul(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),al(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),al(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&ul(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ol.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,xl,e)},writeBytesField:function(t,e){this.writeTag(t,ol.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ol.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ol.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Tl(t,e,r){1===t&&r.readMessage(kl,e)}function kl(t,e,r){if(3===t){var n=r.readMessage(Ml,{}),a=n.id,i=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:a,bitmap:new So({width:o+6,height:s+6},i),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ml(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())}function Al(t){for(var e=0,r=0,n=0,a=t;n=0;f--){var h=o[f];if(!(p.w>h.w||p.h>h.h)){if(p.x=h.x,p.y=h.y,l=Math.max(l,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===h.w&&p.h===h.h){var d=o.pop();f0&&B>M&&(M=B)}else{var j=r[S.fontStack],U=j&&j[E];if(U&&U.rect)I=U.rect,C=U.metrics;else{var V=e[S.fontStack],q=V&&V[E];if(!q)continue;C=q.metrics}P=24*(b-S.scale)}O?(t.verticalizable=!0,k.push({glyph:E,imageName:D,x:f,y:h+P,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:L,metrics:C,rect:I}),f+=z*S.scale+c):(k.push({glyph:E,imageName:D,x:f,y:h+P,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:L,metrics:C,rect:I}),f+=C.advance*S.scale+c)}if(0!==k.length){var H=f-c;d=Math.max(H,d),Vl(k,0,k.length-1,y,M)}f=0;var G=i*b+M;T.lineOffset=Math.max(M,w),h+=G,m=Math.max(G,m),++g}else h+=i,++g}var Y;var Z=h- -17,X=Ul(o),W=X.horizontalAlign,K=X.verticalAlign;(function(t,e,r,n,a,i,o,s,l){var c=(e-r)*a,u=0;u=i!==o?-s*n- -17:(-n*l+.5)*o;for(var p=0,f=t;p=0&&n>=t&&zl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Il.prototype.substring=function(t,e){var r=new Il;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Il.prototype.toString=function(){return this.text},Il.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Il.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Cl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ol={};function Rl(t,e,r,n,a,i){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/i+a:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+a:0}function Fl(t,e,r,n){var a=Math.pow(t-e,2);return n?t=0,p=0,f=0;f-r/2;){if(--o<0)return!1;s-=t[o].dist(i),i=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>a)return!1;o++,s+=p.dist(f)}return!0}function Kl(t){for(var e=0,r=0;rc){var d=(c-l)/h,m=He(p.x,f.x,d),y=He(p.y,f.y,d),g=new Hl(m,y,f.angleTo(p),u);return g._round(),!o||Wl(t,g,s,o,e)?g:void 0}l+=h}}function tc(t,e,r,n,a,i,o,s,l){var c=Jl(n,i,o),u=$l(n,a),p=u*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-p=0&&b=0&&w=0&&h+u<=p){var T=new Hl(b,w,x,m);T._round(),a&&!Wl(e,T,o,a,i)||d.push(T)}}f+=v}l||d.length||s||(d=t(e,f/2,n,a,i,o,s,!0,c));return d}(t,f?e/2*s%e:(u/2+2*i)*o*s%e,e,c,r,p,f,!1,l)}function ec(t,e,r,n,i){for(var o=[],s=0;s=n&&f.x>=n||(p.x>=n?p=new a(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round():f.x>=n&&(f=new a(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round()),p.y>=i&&f.y>=i||(p.y>=i?p=new a(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round():f.y>=i&&(f=new a(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round()),c&&p.equals(c[c.length-1])||(c=[p],o.push(c)),c.push(f)))))}return o}function rc(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,p=t.bottom-t.top,f=o.stretchX||[[0,l]],h=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),y=h.reduce(d,0),g=l-m,v=c-y,x=0,_=m,b=0,w=y,T=0,k=g,M=0,A=v;if(o.content&&n){var S=o.content;x=nc(f,0,S[0]),b=nc(h,0,S[1]),_=nc(f,S[0],S[2]),w=nc(h,S[1],S[3]),T=S[0]-x,M=S[1]-b,k=S[2]-S[0]-_,A=S[3]-S[1]-w}var L=function(n,i,l,c){var f=ic(n.stretch-x,_,u,t.left),h=oc(n.fixed-T,k,n.stretch,m),d=ic(i.stretch-b,w,p,t.top),g=oc(i.fixed-M,A,i.stretch,y),v=ic(l.stretch-x,_,u,t.left),S=oc(l.fixed-T,k,l.stretch,m),L=ic(c.stretch-b,w,p,t.top),E=oc(c.fixed-M,A,c.stretch,y),P=new a(f,d),C=new a(v,d),I=new a(v,L),D=new a(f,L),z=new a(h/s,g/s),O=new a(S/s,E/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),N=Math.cos(R),B=[N,-F,F,N];P._matMult(B),C._matMult(B),D._matMult(B),I._matMult(B)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:P,tr:C,bl:D,br:I,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:O,minFontScaleX:k/s/u,minFontScaleY:A/s/p,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=ac(f,g,m),P=ac(h,v,y),C=0;C0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,y=o.bottom*s+l,g=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(g-=x[0]*s,m-=x[1]*s,v+=x[2]*s,y+=x[3]*s),u){var _=new a(g,m),b=new a(v,m),w=new a(g,y),T=new a(v,y),k=u*Math.PI/180;_._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),g=Math.min(_.x,b.x,w.x,T.x),v=Math.max(_.x,b.x,w.x,T.x),m=Math.min(_.y,b.y,w.y,T.y),y=Math.max(_.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,g,m,v,y,r,n,i)}this.boxEndIndex=t.length},lc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=cc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function cc(t,e){return te?1:0}function uc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var p=o-n,f=s-i,h=Math.min(p,f),d=h/2,m=new lc([],pc);if(0===h)return new a(n,i);for(var y=n;yv.d||!v.d)&&(v=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,x)),_.max-v.d<=e||(d=_.h/2,m.push(new fc(_.p.x-d,_.p.y-d,d,t)),m.push(new fc(_.p.x+d,_.p.y-d,d,t)),m.push(new fc(_.p.x-d,_.p.y+d,d,t)),m.push(new fc(_.p.x+d,_.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function pc(t,e){return e.max-t.max}function fc(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,a=0;at.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,ro(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}lc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},lc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},lc.prototype.peek=function(){return this.data[0]},lc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var a=t-1>>1,i=e[a];if(r(n,i)>=0)break;e[t]=i,t=a}e[t]=n},lc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,a=e[t];t=0)break;e[t]=o,t=i}e[t]=a};var hc=Number.POSITIVE_INFINITY;function dc(t,e){return e[1]!==hc?function(t,e,r){var n=0,a=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":a=r-7;break;case"bottom-right":case"bottom-left":case"bottom":a=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,a]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var a=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=a-7;break;case"bottom-right":case"bottom-left":n=7-a;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-a;break;case"top-left":case"bottom-left":r=a;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function mc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function yc(t,e,r,n,i,o,s,l,c,u,p,f,h,d,m){var y=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],p=0,f=e.positionedLines;p32640&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,v,l,o,s,u,e,c.lineStartIndex,c.lineLength,h,m);for(var x=0,_=p;x<_.length;x+=1){f[_[x]]=t.text.placedSymbolArray.length-1}return 4*y.length}function gc(t){for(var e in t)return t[e];return null}function vc(t,e,r,n){var a=t.compareText;if(e in a){for(var i=a[e],o=i.length-1;o>=0;o--)if(n.dist(i[o])0)&&("constant"!==i.value.kind||i.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=a.get("symbol-sort-key");if(this.features=[],l||c){for(var p=e.iconDependencies,f=e.glyphDependencies,h=e.availableImages,d=new ha(this.zoom),m=0,y=t;m=0;for(var D=0,z=k.sections;D=0;s--)i[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=e[s-1].dist(e[s]));for(var l=0;l0},Ac.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ac.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Ac.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Ac.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Ac.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,a=r.vertexStartIndex;a1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Bn("SymbolBucket",Ac,{omit:["layers","collisionBoxArray","features","compareText"]}),Ac.MAX_GLYPHS=65535,Ac.addDynamicAttributes=wc;var Sc=new Sa({"symbol-placement":new wa(Et.layout_symbol["symbol-placement"]),"symbol-spacing":new wa(Et.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wa(Et.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ta(Et.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wa(Et.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wa(Et.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wa(Et.layout_symbol["icon-ignore-placement"]),"icon-optional":new wa(Et.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wa(Et.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ta(Et.layout_symbol["icon-size"]),"icon-text-fit":new wa(Et.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wa(Et.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ta(Et.layout_symbol["icon-image"]),"icon-rotate":new Ta(Et.layout_symbol["icon-rotate"]),"icon-padding":new wa(Et.layout_symbol["icon-padding"]),"icon-keep-upright":new wa(Et.layout_symbol["icon-keep-upright"]),"icon-offset":new Ta(Et.layout_symbol["icon-offset"]),"icon-anchor":new Ta(Et.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wa(Et.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wa(Et.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wa(Et.layout_symbol["text-rotation-alignment"]),"text-field":new Ta(Et.layout_symbol["text-field"]),"text-font":new Ta(Et.layout_symbol["text-font"]),"text-size":new Ta(Et.layout_symbol["text-size"]),"text-max-width":new Ta(Et.layout_symbol["text-max-width"]),"text-line-height":new wa(Et.layout_symbol["text-line-height"]),"text-letter-spacing":new Ta(Et.layout_symbol["text-letter-spacing"]),"text-justify":new Ta(Et.layout_symbol["text-justify"]),"text-radial-offset":new Ta(Et.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wa(Et.layout_symbol["text-variable-anchor"]),"text-anchor":new Ta(Et.layout_symbol["text-anchor"]),"text-max-angle":new wa(Et.layout_symbol["text-max-angle"]),"text-writing-mode":new wa(Et.layout_symbol["text-writing-mode"]),"text-rotate":new Ta(Et.layout_symbol["text-rotate"]),"text-padding":new wa(Et.layout_symbol["text-padding"]),"text-keep-upright":new wa(Et.layout_symbol["text-keep-upright"]),"text-transform":new Ta(Et.layout_symbol["text-transform"]),"text-offset":new Ta(Et.layout_symbol["text-offset"]),"text-allow-overlap":new wa(Et.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wa(Et.layout_symbol["text-ignore-placement"]),"text-optional":new wa(Et.layout_symbol["text-optional"])}),Lc={paint:new Sa({"icon-opacity":new Ta(Et.paint_symbol["icon-opacity"]),"icon-color":new Ta(Et.paint_symbol["icon-color"]),"icon-halo-color":new Ta(Et.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ta(Et.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ta(Et.paint_symbol["icon-halo-blur"]),"icon-translate":new wa(Et.paint_symbol["icon-translate"]),"icon-translate-anchor":new wa(Et.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ta(Et.paint_symbol["text-opacity"]),"text-color":new Ta(Et.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ta(Et.paint_symbol["text-halo-color"]),"text-halo-width":new Ta(Et.paint_symbol["text-halo-width"]),"text-halo-blur":new Ta(Et.paint_symbol["text-halo-blur"]),"text-translate":new wa(Et.paint_symbol["text-translate"]),"text-translate-anchor":new wa(Et.paint_symbol["text-translate-anchor"])}),layout:Sc},Ec=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};Ec.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Ec.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Ec.prototype.outputDefined=function(){return!1},Ec.prototype.serialize=function(){return null},Bn("FormatSectionOverride",Ec,{omit:["defaultValue"]});var Pc=function(t){function e(e){t.call(this,e,Lc)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var a=[],i=0,o=n;i",targetMapId:n,sourceMapId:i.mapId})}}},Hc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Hc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Hn(e.error)):n(null,Hn(e.data)))}else{var a=!1,i=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){a=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,i)},i)}:function(t){a=!0},s=null,l=Hn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!a&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Yc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Yc.prototype.setNorthEast=function(t){return this._ne=t instanceof Zc?new Zc(t.lng,t.lat):Zc.convert(t),this},Yc.prototype.setSouthWest=function(t){return this._sw=t instanceof Zc?new Zc(t.lng,t.lat):Zc.convert(t),this},Yc.prototype.extend=function(t){var e,r,n=this._sw,a=this._ne;if(t instanceof Zc)e=t,r=t;else{if(!(t instanceof Yc)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var i=t;return this.extend(Yc.convert(i))}var o=t;return this.extend(Zc.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||a?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new Zc(e.lng,e.lat),this._ne=new Zc(r.lng,r.lat)),this},Yc.prototype.getCenter=function(){return new Zc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Yc.prototype.getSouthWest=function(){return this._sw},Yc.prototype.getNorthEast=function(){return this._ne},Yc.prototype.getNorthWest=function(){return new Zc(this.getWest(),this.getNorth())},Yc.prototype.getSouthEast=function(){return new Zc(this.getEast(),this.getSouth())},Yc.prototype.getWest=function(){return this._sw.lng},Yc.prototype.getSouth=function(){return this._sw.lat},Yc.prototype.getEast=function(){return this._ne.lng},Yc.prototype.getNorth=function(){return this._ne.lat},Yc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Yc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Yc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Yc.prototype.contains=function(t){var e=Zc.convert(t),r=e.lng,n=e.lat,a=this._sw.lat<=n&&n<=this._ne.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),a&&i},Yc.convert=function(t){return!t||t instanceof Yc?t:new Yc(t)};var Zc=function(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")};Zc.prototype.wrap=function(){return new Zc(c(this.lng,-180,180),this.lat)},Zc.prototype.toArray=function(){return[this.lng,this.lat]},Zc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Zc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,a=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(a,1))},Zc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Yc(new Zc(this.lng-r,this.lat-e),new Zc(this.lng+r,this.lat+e))},Zc.convert=function(t){if(t instanceof Zc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Zc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Zc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Xc=2*Math.PI*6371008.8;function Wc(t){return Xc*Math.cos(t*Math.PI/180)}function Kc(t){return(180+t)/360}function Jc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function $c(t,e){return t/Wc(e)}function Qc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var tu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};tu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Zc.convert(t);return new tu(Kc(r.lng),Jc(r.lat),$c(e,r.lat))},tu.prototype.toLngLat=function(){return new Zc(360*this.x-180,Qc(this.y))},tu.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Wc(Qc(e));var t,e},tu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xc*(t=Qc(this.y),1/Math.cos(t*Math.PI/180));var t};var eu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=au(0,t,t,e,r)};eu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},eu.prototype.url=function(t,e){var r,n,a,i,o,s=(r=this.x,n=this.y,a=this.z,i=Gc(256*r,256*(n=Math.pow(2,a)-n-1),a),o=Gc(256*(r+1),256*(n+1),a),i[0]+","+i[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,a="",i=t;i>0;i--)a+=(e&(n=1<this.canonical.z?new nu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},nu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?au(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):au(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nu.prototype.children=function(t){if(this.overscaledZ>=t)return[new nu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nu(e,this.wrap,e,r,n),new nu(e,this.wrap,e,r+1,n),new nu(e,this.wrap,e,r,n+1),new nu(e,this.wrap,e,r+1,n+1)]},nu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},iu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},iu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},iu.prototype.getPixels=function(){return new Lo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},iu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,a=e*this.dim+this.dim,i=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=a-1;break;case 1:a=n+1}switch(r){case-1:i=o-1;break;case 1:o=i+1}for(var s=-e*this.dim,l=-r*this.dim,c=i;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},uu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Es.VectorTile(new il(this.rawTileData)).layers,this.sourceLayerCoder=new ou(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},uu.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=sn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,p=fu(c),f=this.grid.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u),h=fu(t.cameraQueryGeometry),d=this.grid3D.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var c=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var u=0,p=c;u=0)return!0;return!1}(i,p)){var f=this.sourceLayerCoder.decode(r),h=this.vtLayers[f].feature(n);if(a.filter(new ha(this.tileID.overscaledZ),h))for(var d=this.getId(h,f),m=0;mn)a=!1;else if(e)if(this.expirationTimeot&&(t.getActor().send("enforceCacheSizeLimit",it),ft=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=ec,t.clone=function(t){var e=new po(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},t.clone$1=x,t.clone$2=function(t){var e=new po(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=tl,t.config=F,t.create=function(){var t=new po(16);return po!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new po(9);return po!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new po(4);return po!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zr,t.createLayout=Ia,t.createStyleLayer=function(t){return"custom"===t.type?new Oc(t):new Rc[t.type](t)},t.cross=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=r[0],s=r[1],l=r[2];return t[0]=a*l-i*s,t[1]=i*o-n*l,t[2]=n*s-a*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.number=He,t.offscreenCanvasSupported=ht,t.ortho=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),c=1/(i-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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(a+n)*l,t[14]=(o+i)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new il(t).readFields(Tl,[])},t.pbf=il,t.performSymbolLayout=function(t,e,r,n,a,i,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=8192/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var p=t.textSizeData,f=p.minZoom,h=p.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new ha(f),o),c["text-size"].possiblyEvaluate(new ha(h),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,y=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new ha(m),o),c["icon-size"].possiblyEvaluate(new ha(y),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new ha(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new ha(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new ha(18));for(var g=24*l.get("text-line-height"),v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),_=l.get("text-size"),w=function(){var i=k[T],s=l.get("text-font").evaluate(i,{},o).join(","),c=_.evaluate(i,{},o),p=u.layoutTextSize.evaluate(i,{},o),f=u.layoutIconSize.evaluate(i,{},o),h={horizontal:{},vertical:void 0},d=i.text,m=[0,0];if(d){var y=d.toString(),w=24*l.get("text-letter-spacing").evaluate(i,{},o),M=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m,y,g,v,x,_,w,T,k,M){var A,S,L,E,P,C=t.addToLineVertexArray(e,r),I=0,D=0,z=0,O=0,R=-1,F=-1,N={},B=vi(""),j=0,U=0;void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(A=s.layout.get("text-offset").evaluate(_,{},k).map((function(t){return 24*t})),j=A[0],U=A[1]):(j=24*s.layout.get("text-radial-offset").evaluate(_,{},k),U=hc);if(t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},k)+90,q=n.vertical;E=new sc(l,e,c,u,p,q,f,h,d,V),o&&(P=new sc(l,e,c,u,p,o,y,g,d,V))}if(a){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),Y=rc(a,H,T,G),Z=o?rc(o,H,T,G):void 0;L=new sc(l,e,c,u,p,a,y,g,!1,H),I=4*Y.length;var X=t.iconSizeData,W=null;"source"===X.kind?(W=[128*s.layout.get("icon-size").evaluate(_,{})])[0]>32640&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((W=[128*w.compositeIconSizes[0].evaluate(_,{},k),128*w.compositeIconSizes[1].evaluate(_,{},k)])[0]>32640||W[1]>32640)&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Y,W,x,v,_,!1,e,C.lineStartIndex,C.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,Z&&(D=4*Z.length,t.addSymbols(t.icon,Z,W,x,v,_,Pl.vertical,e,C.lineStartIndex,C.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var J=n.horizontal[K];if(!S){B=vi(J.text);var $=s.layout.get("text-rotate").evaluate(_,{},k);S=new sc(l,e,c,u,p,J,f,h,d,$)}var Q=1===J.positionedLines.length;if(z+=yc(t,e,J,i,s,d,_,m,C,n.vertical?Pl.horizontal:Pl.horizontalOnly,Q?Object.keys(n.horizontal):[K],N,R,w,k),Q)break}n.vertical&&(O+=yc(t,e,n.vertical,i,s,d,_,m,C,Pl.vertical,["vertical"],N,F,w,k));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=E?E.boxStartIndex:t.collisionBoxArray.length,nt=E?E.boxEndIndex:t.collisionBoxArray.length,at=L?L.boxStartIndex:t.collisionBoxArray.length,it=L?L.boxEndIndex:t.collisionBoxArray.length,ot=P?P.boxStartIndex:t.collisionBoxArray.length,st=P?P.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(E,lt),lt=ct(L,lt);var ut=(lt=ct(P,lt))>-1?1:0;ut&&(lt*=M/24);t.glyphOffsetArray.length>=Ac.MAX_GLYPHS&&b("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey);t.symbolInstances.emplaceBack(e.x,e.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,R,F,B,tt,et,rt,nt,at,it,ot,st,c,z,O,I,D,ut,0,f,j,U,lt)}(t,p,s,r,n,a,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,w,M,l,x,T,A,d,e,i,c,u,o)};if("line"===S)for(var C=0,I=ec(e.geometry,0,0,8192,8192);C1){var V=Ql(U,k,r.vertical||m,n,24,v);V&&P(U,V)}}else if("Polygon"===e.type)for(var q=0,H=fs(e.geometry,0);q=L.maxzoom))if("none"!==L.visibility)o(S,this.zoom,n),(m[L.id]=L.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,y,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id})))}}}var E=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(E).length?i.send("getGlyphs",{uid:this.uid,stacks:E},(function(t,e){p||(p=t,f=e,I.call(l))})):f={};var P=Object.keys(y.iconDependencies);P.length?i.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,h=e,I.call(l))})):h={};var C=Object.keys(y.patternDependencies);function I(){if(p)return s(p);if(f&&h&&d){var e=new a(f),r=new t.ImageAtlas(h,d);for(var i in m){var l=m[i];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,f,e.positions,h,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?h:null,glyphPositions:this.returnDependencies?e.positions:null})}}C.length?i.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,I.call(l))})):d={},I.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,a=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[a]=new i(e);s.abort=this.loadVectorData(e,(function(e,i){if(delete n.loading[a],e||!i)return s.status="done",n.loaded[a]=s,r(e);var l=i.rawData,c={};i.expires&&(c.expires=i.expires),i.cacheControl&&(c.cacheControl=i.cacheControl);var u={};if(o){var p=o.finish();p&&(u.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=i.vectorTile,s.parse(i.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[a]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,a=t.uid,i=this;if(n&&n[a]){var o=n[a];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,r.availableImages,i.actor,a)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,a=e.encoding,i=e.rawImageData,o=c&&i instanceof c?this.getImageData(i):i,s=new t.DEMData(n,o,a);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var p=function t(e,r){var n,a=e&&e.type;if("FeatureCollection"===a)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function C(t,e){for(var r=t.loadGeometry(),n=t.type,a=0,i=0,o=r.length,s=0;s>1;!function t(e,r,n,a,i,o){for(;i>a;){if(i-a>600){var s=i-a+1,l=n-a+1,c=Math.log(s),u=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),f=Math.max(a,Math.floor(n-l*u/s+p)),h=Math.min(i,Math.floor(n+(s-l)*u/s+p));t(e,r,n,f,h,o)}var d=r[2*n+o],m=a,y=i;for(z(e,r,a,n),r[2*i+o]>d&&z(e,r,a,i);md;)y--}r[2*a+o]===d?z(e,r,a,y):(y++,z(e,r,y,i)),y<=n&&(a=y+1),n<=y&&(i=y-1)}}(t,e,o,n,a,i%2),D(t,e,r,n,o-1,i+1),D(t,e,r,o+1,a,i+1)}}function z(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}function R(t,e,r,n){var a=t-r,i=e-n;return a*a+i*i}b.fromVectorTileJs=w,b.fromGeojsonVt=T,b.GeoJSONWrapper=k;var F=function(t){return t[0]},N=function(t){return t[1]},B=function(t,e,r,n,a){void 0===e&&(e=F),void 0===r&&(r=N),void 0===n&&(n=64),void 0===a&&(a=Float64Array),this.nodeSize=n,this.points=t;for(var i=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new i(t.length),s=this.coords=new a(2*t.length),l=0;l=r&&s<=a&&l>=n&&l<=i&&u.push(t[d]);else{var m=Math.floor((h+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=a&&l>=n&&l<=i&&u.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=l)&&(c.push(h),c.push(m-1),c.push(y)),(0===p?a>=s:i>=l)&&(c.push(m+1),c.push(f),c.push(y))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},B.prototype.within=function(t,e,r){return function(t,e,r,n,a,i){for(var o=[0,t.length-1,0],s=[],l=a*a;o.length;){var c=o.pop(),u=o.pop(),p=o.pop();if(u-p<=i)for(var f=p;f<=u;f++)R(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var h=Math.floor((p+u)/2),d=e[2*h],m=e[2*h+1];R(d,m,r,n)<=l&&s.push(t[h]);var y=(c+1)%2;(0===c?r-a<=d:n-a<=m)&&(o.push(p),o.push(h-1),o.push(y)),(0===c?r+a>=d:n+a>=m)&&(o.push(h+1),o.push(u),o.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=X(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,a){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:a}}function q(t,e){var r=t.geometry.coordinates,n=r[0],a=r[1];return{x:Y(n),y:Z(a),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function Y(t){return t/360+.5}function Z(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 X(t,e){for(var r in e)t[r]=e[r];return t}function W(t){return t.x}function K(t){return t.y}function J(t,e,r,n,a,i){var o=a-r,s=i-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=a,n=i):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function $(t,e,r,n){var a={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Q(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(a*c-l*i)/2:Math.sqrt(Math.pow(l-a,2)+Math.pow(c-i,2))),a=l,i=c}var u=e.length-3;e[2]=1,function t(e,r,n,a){for(var i,o=a,s=n-r>>1,l=n-r,c=e[r],u=e[r+1],p=e[n],f=e[n+1],h=r+3;ho)i=h,o=d;else if(d===o){var m=Math.abs(h-s);ma&&(i-r>3&&t(e,r,i,a),e[i+2]=o,n-i>3&&t(e,i,n,a))}(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function nt(t,e,r,n){for(var a=0;a1?1:r}function ot(t,e,r,n,a,i,o,s){if(n/=e,i>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var m=[];if("Point"===f||"MultiPoint"===f)st(p,m,r,n,a);else if("LineString"===f)lt(p,m,r,n,a,!1,s.lineMetrics);else if("MultiLineString"===f)ut(p,m,r,n,a,!1);else if("Polygon"===f)ut(p,m,r,n,a,!0);else if("MultiPolygon"===f)for(var y=0;y=r&&o<=n&&(e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]))}}function lt(t,e,r,n,a,i,o){for(var s,l,c=ct(t),u=0===a?ft:ht,p=t.start,f=0;fr&&(l=u(c,h,d,y,g,r),o&&(c.start=p+s*l)):v>n?x=r&&(l=u(c,h,d,y,g,r),_=!0),x>n&&v<=n&&(l=u(c,h,d,y,g,n),_=!0),!i&&_&&(o&&(c.end=p+s*l),e.push(c),c=ct(t)),o&&(p+=s)}var b=t.length-3;h=t[b],d=t[b+1],m=t[b+2],(v=0===a?h:d)>=r&&v<=n&&pt(c,h,d,m),b=c.length-3,i&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&pt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ct(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ut(t,e,r,n,a,i){for(var o=0;oo.maxX&&(o.maxX=u),p>o.maxY&&(o.maxY=p)}return o}function xt(t,e,r,n){var a=e.geometry,i=e.type,o=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s0&&e.size<(a?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;a&&function(t,e){for(var r=0,n=0,a=t.length,i=a-2;n0===e)for(n=0,a=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new B(s,W,K,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,a=180;else if(r>a){var o=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,a,i],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,p=l.range(Y(r),Z(i),Y(a),Z(n));u1?this._map(c,!0):null,y=(l<<5)+(e+1)+this.points.length,g=0,v=p;g>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},bt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},bt.prototype.splitTile=function(t,e,r,n,a,i,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),f=this.tiles[p]=vt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var h="z"+e;this.stats[h]=(this.stats[h]||0)+1,this.total++}if(f.source=t,a){if(e===l.maxZoom||e===a)continue;var d=1<1&&console.time("clipping");var m,y,g,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=y=g=v=null,x=ot(t,u,r-b,r+T,0,f.minX,f.maxX,l),_=ot(t,u,r+w,r+k,0,f.minX,f.maxX,l),t=null,x&&(m=ot(x,u,n-b,n+T,1,f.minY,f.maxY,l),y=ot(x,u,n+w,n+k,1,f.minY,f.maxY,l),x=null),_&&(g=ot(_,u,n-b,n+T,1,f.minY,f.maxY,l),v=ot(_,u,n+w,n+k,1,f.minY,f.maxY,l),_=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(g||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},bt.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,i=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,p=r;!l&&c>0;)c--,u=Math.floor(u/2),p=Math.floor(p/2),l=this.tiles[wt(c,u,p)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",c,u,p),i>1&&console.time("drilling down"),this.splitTile(l.source,c,u,p,t,e,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?yt(this.tiles[s],a):null):null};var kt=function(e){function r(t,r,n,a){e.call(this,t,r,n,Tt),a&&(this.loadGeoJSON=a)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var a=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(i,o){if(i||!o)return r(i);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));p(o,!0);try{e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var a={},i={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function g(t,e,r,n,a,i,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(i.ranges[s])e(null,{stack:r,id:a,glyph:o});else{var l=i.requests[s];l||(l=i.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(i.glyphs[+r]=e[+r]);i.ranges[s]=!0}for(var a=0,o=l;a1&&(l=t[++s]);var u=Math.abs(c-l.left),p=Math.abs(c-l.right),f=Math.min(u,p),h=void 0,d=a/r*(n+1);if(l.isDash){var m=n-Math.abs(d);h=Math.sqrt(f*f+m*m)}else h=n-Math.sqrt(f*f+d*d);this.data[o+c]=Math.max(0,Math.min(255,h+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var a=t[0],i=t[t.length-1];a.isDash===i.isDash&&(a.left=i.left-this.width,i.right=a.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),p=Math.abs(c-l.right),f=Math.min(u,p),h=l.isDash?f:-f;this.data[o+c]=Math.max(0,Math.min(255,h+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,a=2*n+1;if(this.nextRow+a>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var i=0,o=0;o=n&&e.x=a&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,i,r.z,a,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),a=this._data;"string"==typeof a?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(a),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(a),this.actor.send(this.type+".loadData",n,(function(t,a){r._removed||a&&a.abandoned||(r._loaded=!0,a&&a.resourceTiming&&a.resourceTiming[r.id]&&(r._resourceTiming=a.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,a=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(a,i,(function(t,i){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(i,n.map.painter,"reloadTile"===a),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),C=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),I=function(e){function r(t,r,n,a){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(a),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(a,i){n._loaded=!0,a?n.fire(new t.ErrorEvent(a)):i&&(n.image=i,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,a=-1/0,i=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,C.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var a=this.tiles[n];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(I),z=function(e){function r(r,n,a,i){e.call(this,r,n,a,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var a in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,C.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var i=this.tiles[a];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),a=this.data[r][n];return this.data[r].splice(n,1),a.timeout&&clearTimeout(a.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(a.value),this.order.splice(this.order.indexOf(r),1),this},B.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,a=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[i]&&(t.neighboringTiles[i].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var a in this._tiles){var i=this._tiles[a];if(!(n[a]||!i.hasData()||i.tileID.overscaledZ<=e||i.tileID.overscaledZ>r)){for(var o=i.tileID;i&&i.tileID.overscaledZ>e+1;){var s=i.tileID.scaledTo(i.tileID.overscaledZ-1);(i=this._tiles[s.key])&&i.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var a=t.scaledTo(n),i=this._getLoadedTile(a);if(i)return i}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var a in this._tiles){var i=this._tiles[a];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+r),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var a;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(a=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(a=a.filter((function(t){return n._source.hasTile(t)})))):a=[];var i=e.coveringZoomLevel(this._source),o=Math.max(i-r.maxOverzooming,this._source.minzoom),s=Math.max(i+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(a,i);if(It(this._source.type)){for(var c={},u={},p=0,f=Object.keys(l);pthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],g=this.getTile(y);if(g&&g.hasData()){n[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),_=d.overscaledZ-1;_>=i;--_){var b=d.scaledTo(_);if(a[b.key])break;if(a[b.key]=!0,!(m=this.getTile(b))&&x&&(m=this._addTile(b)),m&&(n[b.key]=b,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var a=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(a))break;n=a}for(var i=0,o=e;i0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var a=this,i=[],o=this.transform;if(!o)return i;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),p=1/0,f=1/0,h=-1/0,d=-1/0,m=0,y=c;m=0&&g[1].y+y>=0){var v=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));i.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles){this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading")}this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Ct(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function It(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(Wa.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(a-o)/s:0;return this.points[i].mult(1-l).add(this.points[r].mult(l))};var Jt=function(t,e,r){var n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var i=0;i=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,a,i,o,s,l){var c=a?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],f=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var h=e.lineVertexArray,d=a?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,y=!1,g=0;gMath.abs(n.x-r.x)*a)return{useVertical:!0};return(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,a,i,o,s,l,c,u,p,f,h,d){var m,y=r/24,g=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ae(y,l,g,v,n,p,f,e,c,o,h);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,k=te(w.last.point,s).point;if(a&&!n){var M=ie(e.writingMode,T,k,d);if(M)return M}m=[w.first];for(var A=e.glyphStartIndex+1;A0?P.point:se(f,E,S,1,i),I=ie(e.writingMode,S,C,d);if(I)return I}var D=le(y*l.getoffsetX(e.glyphStartIndex),g,v,n,p,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,h);if(!D)return{notEnoughRoom:!0};m=[D]}for(var z=0,O=m;z0?1:-1,m=0;a&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?l+s:l+s+1,g=i,v=i,x=0,_=0,b=Math.abs(h),w=[];x+_<=b;){if((y+=d)=c)return null;if(v=g,w.push(g),void 0===(g=f[y])){var T=new t.Point(u.getx(y),u.gety(y)),k=te(T,p);if(k.signedDistanceFromCamera>0)g=f[y]=k.point;else{var M=y-d;g=se(0===x?o:new t.Point(u.getx(M),u.gety(M)),T,v,b-x+1,p)}}x+=_,_=v.dist(g)}var A=(b-x)/_,S=g.sub(v),L=S.mult(A)._add(v);L._add(S._unit()._perp()._mult(n*d));var E=m+Math.atan2(g.y-v.y,g.x-v.x);return w.push(L),{point:L,angle:E,path:w}}Jt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Jt.prototype.insert=function(t,e,r,n,a){this._forEachCell(e,r,n,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(a)},Jt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Jt.prototype._insertBoxCell=function(t,e,r,n,a,i){this.boxCells[a].push(i)},Jt.prototype._insertCircleCell=function(t,e,r,n,a,i){this.circleCells[a].push(i)},Jt.prototype._query=function(t,e,r,n,a,i){if(r<0||t>this.width||n<0||e>this.height)return!a&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(a)return!0;for(var s=0;s0:o},Jt.prototype._queryCircle=function(t,e,r,n,a){var i=t-r,o=t+r,s=e-r,l=e+r;if(o<0||i>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,s,o,l,this._queryCellCircle,c,u,a),n?c.length>0:c},Jt.prototype.query=function(t,e,r,n,a){return this._query(t,e,r,n,!1,a)},Jt.prototype.hitTest=function(t,e,r,n,a){return this._query(t,e,r,n,!0,a)},Jt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Jt.prototype._queryCell=function(t,e,r,n,a,i,o,s){var l=o.seenUids,c=this.boxCells[a];if(null!==c)for(var u=this.bboxes,p=0,f=c;p=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[h]))){if(o.hitTest)return i.push(!0),!0;i.push({key:this.boxKeys[h],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[a];if(null!==m)for(var y=this.circles,g=0,v=m;go*o+s*s},Jt.prototype._circleAndRectCollide=function(t,e,r,n,a,i,o){var s=(i-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-a)/2,u=Math.abs(e-(a+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var p=l-s,f=u-c;return p*p+f*f<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r=1;C--)P.push(L.path[C]);for(var I=1;I0){for(var R=P[0].clone(),F=P[0].clone(),N=1;N=M.x&&F.x<=A.x&&R.y>=M.y&&F.y<=A.y?[P]:F.xA.x||F.yA.y?[]:t.clipLine([P],M.x,M.y,A.x,A.y)}for(var B=0,j=O;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},fe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:a,prevAnchor:m},this.markUsedJustification(f,t,p,h),f.allowVerticalPlacement&&(this.markUsedOrientation(f,h,p),this.placedOrientations[p.crossTileID]=h),{shift:g,placedGlyphBoxes:v}},we.prototype.placeLayerBucketPart=function(e,r,n){var a=this,i=e.parameters,o=i.bucket,s=i.layout,l=i.posMatrix,c=i.textLabelPlaneMatrix,u=i.labelToScreenMatrix,p=i.textPixelRatio,f=i.holdingForFade,h=i.collisionBoxArray,d=i.partiallyEvaluatedTextSize,m=i.collisionGroup,y=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(x||!o.hasIconData()||g),M=x&&(v||!o.hasTextData()||y);!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h);var A=function(e,i){if(!r[e.crossTileID])if(f)a.placements[e.crossTileID]=new ye(!1,!1,!1);else{var h,T=!1,A=!1,S=!0,L=null,E={box:null,offscreen:null},P={box:null,offscreen:null},C=null,I=null,D=0,z=0,O=0;i.textFeatureIndex?D=i.textFeatureIndex:e.useRuntimeCollisionCircles&&(D=e.featureIndex),i.verticalTextFeatureIndex&&(z=i.verticalTextFeatureIndex);var R=i.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&a.prevPlacement){var i=a.prevPlacement.placedOrientations[e.crossTileID];i&&(a.placedOrientations[e.crossTileID]=i,n=i,a.markUsedOrientation(o,n,e))}return n},N=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i.verticalTextBox)for(var a=0,s=o.writingModes;a0&&(B=B.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,r,n){for(var i=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,f={box:[],offscreen:!1},h=v?2*B.length:B.length,d=0;d=B.length,k=a.attemptAnchorPlacement(y,t,i,s,c,_,b,p,l,m,g,e,o,n,u);if(k&&(f=k.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,L=k.shift;break}}return f};N((function(){return U(R,i.iconBox,t.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox,n=E&&E.box&&E.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,i.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),E&&(T=E.box,S=E.offscreen);var V=F(E&&E.box);if(!T&&a.prevPlacement){var q=a.prevPlacement.variableOffsets[e.crossTileID];q&&(a.variableOffsets[e.crossTileID]=q,a.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=a.collisionIndex.placeCollisionBox(t,v,p,l,m.predicate);return n&&n.box&&n.box.length&&(a.markUsedOrientation(o,r,e),a.placedOrientations[e.crossTileID]=r),n};N((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=i.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(E&&E.box&&E.box.length)}}if(T=(h=E)&&h.box&&h.box.length>0,S=h&&h.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Y=t.evaluateSizeForFeature(o.textSizeData,d,G),Z=s.get("text-padding"),X=e.collisionCircleDiameter;C=a.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,Y,l,c,u,n,b,m.predicate,X,Z),T=v||C.circles.length>0&&!C.collisionDetected,S=S&&C.offscreen}if(i.iconFeatureIndex&&(O=i.iconFeatureIndex),i.iconBox){var W=function(t){var e=w&&L?be(t,L.x,L.y,_,b,a.transform.angle):t;return a.collisionIndex.placeCollisionBox(e,x,p,l,m.predicate)};A=P&&P.box&&P.box.length&&i.verticalIconBox?(I=W(i.verticalIconBox)).box.length>0:(I=W(i.iconBox)).box.length>0,S=S&&I.offscreen}var K=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,J=g||0===e.numIconVertices;if(K||J?J?K||(A=A&&T):T=A&&T:A=T=A&&T,T&&h&&h.box&&(P&&P.box&&z?a.collisionIndex.insertCollisionBox(h.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID):a.collisionIndex.insertCollisionBox(h.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID)),A&&I&&a.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),C&&(T&&a.collisionIndex.insertCollisionCircles(C.circles,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID),n)){var $=o.bucketInstanceId,Q=a.collisionCircleArrays[$];void 0===Q&&(Q=a.collisionCircleArrays[$]=new ge);for(var tt=0;tt=0;--L){var E=S[L];A(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var P=e.symbolInstanceStart;P=0&&(e.text.placedSymbolArray.get(c).crossTileID=i>=0&&c!==i?0:n.crossTileID)}},we.prototype.markUsedOrientation=function(e,r,n){for(var a=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,i=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=i.numIconVertices>0,_=a.placedOrientations[i.crossTileID],b=_===t.WritingMode.vertical,w=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(v){var T=Ce(g.text),k=b?Ie:T;d(e.text,s,k);var M=w?Ie:T;d(e.text,l,M);var A=g.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=A||b?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var S=a.variableOffsets[i.crossTileID];S&&a.markUsedJustification(e,S.anchor,i,_);var L=a.placedOrientations[i.crossTileID];L&&(a.markUsedJustification(e,"left",i,L),a.markUsedOrientation(e,L,i))}if(x){var E=Ce(g.icon),P=!(f&&i.verticalPlacedIconSymbolIndex&&b);if(i.placedIconSymbolIndex>=0){var C=P?E:Ie;d(e.icon,i.numIconVertices,C),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(i.verticalPlacedIconSymbolIndex>=0){var I=P?Ie:E;d(e.icon,i.numVerticalIconVertices,I),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var D=e.collisionArrays[n];if(D){var z=new t.Point(0,0);if(D.textBox||D.verticalTextBox){var O=!0;if(c){var R=a.variableOffsets[m];R?(z=_e(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&z._rotate(p?a.transform.angle:-a.transform.angle)):O=!1}D.textBox&&Te(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||b,z.x,z.y),D.verticalTextBox&&Te(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||w,z.x,z.y)}var F=Boolean(!w&&D.verticalIconBox);D.iconBox&&Te(e.iconCollisionBox.collisionVertexArray,g.icon.placed,F,f?z.x:0,f?z.y:0),D.verticalIconBox&&Te(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!F,f?z.x:0,f?z.y:0)}}},y=0;yt},we.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Ae=Math.pow(2,17),Se=Math.pow(2,16),Le=Math.pow(2,9),Ee=Math.pow(2,8),Pe=Math.pow(2,1);function Ce(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Me+r*Ae+e*Se+r*Le+e*Ee+r*Pe+e}var Ie=0,De=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};De.prototype.continuePlacement=function(t,e,r,n,a){for(var i=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,a)}else{var c=o[t.scaledTo(Number(i)).key];c&&c.findMatches(e.symbolInstances,t,a)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,a=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,i=e,u())}));function u(){if(o)n(o);else if(a&&i){var e=t.browser.getImageData(i),r={};for(var s in a){var l=a[s],c=l.width,u=l.height,p=l.x,f=l.y,h=l.sdf,d=l.pixelRatio,m=l.stretchX,y=l.stretchY,g=l.content,v=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,v,{x:p,y:f},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:d,sdf:h,stretchX:m,stretchY:y,content:g}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var a in n)r.imageManager.addImage(a,n[a]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var a=r.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+a.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+a.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var a=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var i=this.sourceCaches[e]=new Pt(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(function(){return{isSourceLoaded:a.loaded(),source:i.serialize(),sourceId:e}})),i.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=e.id;if(this.getLayer(a))this.fire(new t.ErrorEvent(new Error('Layer with id "'+a+'" already exists on this map')));else{var i;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;i=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(a,e.source),e=t.clone$1(e),e=t.extend(e,{source:a})),this._validate(t.validateStyle.layer,"layers."+a,e,{arrayIndex:-1},n))return;i=t.createStyleLayer(e),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}}),this._serializedLayers[i.id]=i.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){var s=this._removedLayers[a];delete this._removedLayers[a],s.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var a=r?this._order.indexOf(r):this._order.length;r&&-1===a?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(a,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var a=this.getLayer(e);a?a.minzoom===r&&a.maxzoom===n||(null!=r&&(a.minzoom=r),null!=n&&(a.maxzoom=n),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var a=this.getLayer(e);if(a){if(!t.deepEqual(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(t.validateStyle.filter,"layers."+a.id+".filter",r,null,n)||(a.filter=t.clone$1(r),this._updateLayer(a)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n,a),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,a){void 0===a&&(a={}),this._checkLoaded();var i=this.getLayer(e);i?t.deepEqual(i.getPaintProperty(r),n)||(i.setPaintProperty(r,n,a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=e.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type;"geojson"===o&&a?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||a?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.setFeatureState(a,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,a=this.sourceCaches[n];if(void 0!==a){var i=a.getSource().type,o="vector"===i?e.sourceLayer:void 0;"vector"!==i||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):a.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,a=this.sourceCaches[r];if(void 0!==a){if("vector"!==a.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},a=[],i=this._order.length-1;i>=0;i--){var o=this._order[i];if(r(o)){n[o]=i;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var y=a.length-1;y>=0;y--){var g=a[y].feature;if(n[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=vr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=vr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=vr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=vr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=vr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=vr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),lr=vr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cr=vr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=vr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=vr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),hr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=vr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),mr=vr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),yr=vr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gr=vr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function vr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,a,i){return n[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,a,i){var o="float"===a?"vec2":"vec4",s=i.match(/color/)?"color":o;return n[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+a+" "+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+a+" u_"+i+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = a_"+i+";\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+a+" "+i+" = unpack_mix_"+s+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+a+" "+i+" = u_"+i+";\n#endif\n"}))}}var xr=Object.freeze({__proto__:null,prelude:Ye,background:Ze,backgroundPattern:Xe,circle:We,clippingMask:Ke,heatmap:Je,heatmapTexture:$e,collisionBox:Qe,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ar,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:sr,hillshadePrepare:lr,hillshade:cr,line:ur,lineGradient:pr,linePattern:fr,lineSDF:hr,raster:dr,symbolIcon:mr,symbolSDF:yr,symbolTextAndIcon:gr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};_r.prototype.bind=function(t,e,r,n,a,i,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}br.prototype.draw=function(t,e,r,n,a,i,o,s,l,c,u,p,f,h,d,m){var y,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(a),t.setCullFace(i),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);h&&h.setUniforms(t,this.binderUniforms,p,{zoom:f});for(var x=(y={},y[g.LINES]=2,y[g.TRIANGLES]=3,y[g.LINE_STRIP]=1,y)[e],_=0,b=u.get();_0?1-1/(1.001-o):-o),u_contrast_factor:(i=a.paint.get("raster-contrast"),i>0?1/(1-i):1+i),u_spin_weights:qr(a.paint.get("raster-hue-rotate"))};var i,o};function qr(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]}var Hr,Gr=function(t,e,r,n,a,i,o,s,l,c){var u=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:i,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Yr=function(e,r,n,a,i,o,s,l,c,u,p){var f=i.transform;return t.extend(Gr(e,r,n,a,i,o,s,l,c,u),{u_gamma_scale:a?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})},Zr=function(e,r,n,a,i,o,s,l,c,u){return t.extend(Yr(e,r,n,a,i,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Xr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,a,i,o){return t.extend(function(t,e,r,n){var a=r.imageManager.getPattern(t.from.toString()),i=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,p=u*(n.tileID.canonical.x+n.tileID.wrap*c),f=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:i.tl,u_pattern_br_b:i.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:i.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/he(n,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,f>>16],u_pixel_coord_lower:[65535&p,65535&f]}}(a,o,n,i),{u_matrix:e,u_opacity:r})},Kr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Jr(e,r,n,a,i,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),p=[],f=0,h=0,d=0;d0){var b=t.create(),w=v;t.mul(b,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,g.placementViewportMatrix),p.push({circleArray:_,circleOffset:h,transform:w,invTransform:b}),h=f+=_.length/4}x&&u.draw(l,c.LINES,Mt.disabled,At.disabled,e.colorModeForRenderPass(),Lt.disabled,Pr(v,e.transform,y),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&p.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*f),k._trim();for(var M=0,A=0,S=p;A=0&&(m[g.associatedIconIndex]={shiftedAnchor:S,angle:L})}else ue(g.numGlyphs,h)}if(p){d.clear();for(var P=e.icon.placedSymbolArray,C=0;C0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),p=i.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(e.tileID.overscaledZ-p),h=f&&e.refreshedUponExpiration?1:t.clamp(f?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}var un=new t.Color(1,0,0,1),pn=new t.Color(0,1,0,1),fn=new t.Color(0,0,1,1),hn=new t.Color(1,0,1,1),dn=new t.Color(0,1,1,1);function mn(t){var e=t.transform.padding;yn(t,t.transform.height-(e.top||0),3,un),yn(t,e.bottom||0,3,pn),gn(t,e.left||0,3,fn),gn(t,t.transform.width-(e.right||0),3,hn);var r=t.transform.centerPoint;!function(t,e,r,n){vn(t,e-1,r-10,2,20,n),vn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,dn)}function yn(t,e,r,n){vn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){vn(t,e-r/2,0,r,t.transform.height,n)}function vn(e,r,n,a,i,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function xn(e,r,n){var a=e.context,i=a.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,c=At.disabled,u=e.colorModeForRenderPass();a.activeTexture.set(i.TEXTURE0),e.emptyTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE),s.draw(a,i.LINE_STRIP,l,c,u,Lt.disabled,Ir(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,f=p&&p.byteLength||0,h=Math.floor(f/1024),d=r.getTile(n).tileSize,m=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,a=t.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,r.width,r.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(e,5,5),a.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+h+"kb"),s.draw(a,i.TRIANGLES,l,c,St.alphaBlended,Lt.disabled,Ir(o,t.Color.transparent,m),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var _n={symbol:function(e,r,n,a,i){if("translucent"===e.renderPass){var o=At.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,a,i,o,s){for(var l=r.transform,c="map"===i,u="map"===o,p=0,f=e;p256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(Mt.disabled);var a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var i=0,o=e;i256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new At({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},bn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new At({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},bn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),a=n[n.length-1].overscaledZ,i=n[0].overscaledZ-a+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[a[this.currentLayer]],T=i[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},bn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},bn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,xr[t],e,Kr[t],this._showOverdrawInspector)),this.cache[r]},bn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},bn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},bn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},bn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var wn=function(t,e){this.points=t,this.planes=e};wn.fromInvProjectionMatrix=function(e,r,n){var a=Math.pow(2,n),i=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*a)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],i[e[0]],i[e[1]]),n=t.sub([],i[e[2]],i[e[1]]),a=t.normalize([],t.cross([],r,n)),o=-t.dot(a,i[e[1]]);return a.concat(o)}));return new wn(i,o)};var Tn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Tn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),a=t.clone$2(this.max),i=0;i=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,p=0;pthis.max[l]-this.min[l])return 0}return 1};var kn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};kn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},kn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),a=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,a)},kn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},kn.prototype.clone=function(){return new kn(this.top,this.bottom,this.left,this.right)},kn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Mn=function(e,r,n,a,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==a?60:a,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new kn,this._posMatrixCache={},this._alignedPosMatrixCache={}},An={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Mn.prototype.clone=function(){var t=new Mn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},An.minZoom.get=function(){return this._minZoom},An.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},An.maxZoom.get=function(){return this._maxZoom},An.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},An.minPitch.get=function(){return this._minPitch},An.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},An.maxPitch.get=function(){return this._maxPitch},An.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},An.renderWorldCopies.get=function(){return this._renderWorldCopies},An.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},An.worldSize.get=function(){return this.tileSize*this.scale},An.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},An.size.get=function(){return new t.Point(this.width,this.height)},An.bearing.get=function(){return-this.angle/Math.PI*180},An.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},An.pitch.get=function(){return this._pitch/Math.PI*180},An.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},An.fov.get=function(){return this._fov/Math.PI*180},An.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},An.zoom.get=function(){return this._zoom},An.zoom.set=function(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._constrain(),this._calcMatrices())},An.center.get=function(){return this._center},An.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},An.padding.get=function(){return this._edgeInsets.toJSON()},An.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},An.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Mn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Mn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Mn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Mn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),a=this.pointCoordinate(new t.Point(this.width,0)),i=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,a.x,i.x,o.x)),l=Math.floor(Math.max(n.x,a.x,i.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Mn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var a=t.MercatorCoordinate.fromLngLat(this.center),i=Math.pow(2,r),o=[i*a.x,i*a.y,0],s=wn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Tn([t*i,0,0],[(t+1)*i,i,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],p=[],f=r,h=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),y=m.x,g=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var _=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(_),Math.abs(b)),T=3+(1<T&&m.zoom>=l)p.push({tileID:new t.OverscaledTileID(m.zoom===f?h:m.zoom,m.wrap,m.zoom,y,g),distanceSq:t.sqrLen([o[0]-.5-y,o[1]-.5-g])});else for(var k=0;k<4;k++){var M=(y<<1)+k%2,A=(g<<1)+(k>>1);u.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:M,y:A,wrap:m.wrap,fullyVisible:v})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Mn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},An.unmodified.get=function(){return this._unmodified},Mn.prototype.zoomScale=function(t){return Math.pow(2,t)},Mn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Mn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Mn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},An.point.get=function(){return this.project(this.center)},Mn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),a=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(e),o=new t.MercatorCoordinate(i.x-(n.x-a.x),i.y-(n.y-a.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Mn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Mn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Mn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Mn.prototype.coordinateLocation=function(t){return t.toLngLat()},Mn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var a=r[3],i=n[3],o=r[0]/a,s=n[0]/i,l=r[1]/a,c=n[1]/i,u=r[2]/a,p=n[2]/i,f=u===p?0:(0-u)/(p-u);return new t.MercatorCoordinate(t.number(o,s,f)/this.worldSize,t.number(l,c,f)/this.worldSize)},Mn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Mn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Mn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Mn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Mn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,a=r?this._alignedPosMatrixCache:this._posMatrixCache;if(a[n])return a[n];var i=e.canonical,o=this.worldSize/this.zoomScale(i.z),s=i.x+Math.pow(2,i.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,i.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),a[n]=new Float32Array(l),a[n]},Mn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Mn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,a,i=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var p=this.latRange;i=t.mercatorYfromLat(p[1])*this.worldSize,e=(o=t.mercatorYfromLat(p[0])*this.worldSize)-io&&(a=o-y)}if(this.lngRange){var g=h.x,v=c.x/2;g-vl&&(n=l-v)}void 0===n&&void 0===a||(this.center=this.unproject(new t.Point(void 0!==n?n:h.x,void 0!==a?a:h.y))),this._unmodified=u,this._constraining=!1}},Mn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,a=this._fov*(.5+r.y/this.height),i=Math.sin(a)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-a,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),u=this.height/50,p=new Float64Array(16);t.perspective(p,this._fov,this.width/this.height,u,c),p[8]=2*-r.x/this.width,p[9]=2*r.y/this.height,t.scale(p,p,[1,-1,1]),t.translate(p,p,[0,0,-this.cameraToCenterDistance]),t.rotateX(p,p,this._pitch),t.rotateZ(p,p,this.angle),t.translate(p,p,[-s,-l,0]),this.mercatorMatrix=t.scale([],p,[this.worldSize,this.worldSize,this.worldSize]),t.scale(p,p,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=p,this.invProjMatrix=t.invert([],this.projMatrix);var f=this.width%2/2,h=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),y=s-Math.round(s)+d*f+m*h,g=l-Math.round(l)+d*h+m*f,v=new Float64Array(p);if(t.translate(v,v,[y>.5?y-1:y,g>.5?g-1:g,0]),this.alignedProjMatrix=v,p=t.create(),t.scale(p,p,[this.width/2,-this.height/2,1]),t.translate(p,p,[1,-1,0]),this.labelPlaneMatrix=p,p=t.create(),t.scale(p,p,[1,-1,1]),t.translate(p,p,[-1,-1,0]),t.scale(p,p,[2/this.width,2/this.height,1]),this.glCoordMatrix=p,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(p=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=p,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Mn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Mn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Mn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,a=r.y,i=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Sn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Ln={linearity:.3,easing:t.bezier(0,0,.3,1)},En=t.extend({deceleration:2500,maxSpeed:1400},Ln),Pn=t.extend({deceleration:20,maxSpeed:1400},Ln),Cn=t.extend({deceleration:1e3,maxSpeed:360},Ln),In=t.extend({deceleration:1e3,maxSpeed:90},Ln),Dn=function(t){this._map=t,this.clear()};function zn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Dn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,a=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))},Bn.prototype.dblclick=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},Bn.prototype.mouseover=function(t){this._map.fire(new Rn(t.type,this._map,t))},Bn.prototype.mouseout=function(t){this._map.fire(new Rn(t.type,this._map,t))},Bn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},Bn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},Bn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},Bn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},Bn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Rn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Vn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,a=e;n30)&&(this.aborted=!0)}}},qn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new qn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var a=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(a&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Gn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Gn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Gn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Gn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Gn.prototype.touchend=function(t,e,r){var n=this,a=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r);return a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(a)},{originalEvent:t})}}):i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(i)},{originalEvent:t})}}):void 0},Gn.prototype.touchcancel=function(){this.reset()},Gn.prototype.enable=function(){this._enabled=!0},Gn.prototype.disable=function(){this._enabled=!1,this.reset()},Gn.prototype.isEnabled=function(){return this._enabled},Gn.prototype.isActive=function(){return this._active};var Yn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Yn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Yn.prototype._correctButton=function(t,e){return!1},Yn.prototype._move=function(t,e){return{}},Yn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Yn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var a=Vn(n,r),i=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in a){var c=a[l],u=this._touches[l];u&&(i._add(c),o._add(c.sub(u)),s++,a[l]=c)}if(this._touches=a,!(sMath.abs(t.x)}var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,na(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),a=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,a,r.timeStamp),this._valid){this._lastPoints=t,this._active=!0;return{pitchDelta:-.5*((n.y+a.y)/2)}}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,a=e.mag()>=2;if(n||a){if(!n||!a)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var i=t.y>0==e.y>0;return na(t)&&na(e)&&i}},e}(Jn),ia={panStep:100,bearingStep:15,pitchStep:10},oa=function(){var t=ia;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function sa(t){return t*(2-t)}oa.prototype.reset=function(){this._active=!1},oa.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,a=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?a=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?a=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:sa,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+a*e._pitchStep,offset:[-i*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oa.prototype.enable=function(){this._enabled=!0},oa.prototype.disable=function(){this._enabled=!1,this.reset()},oa.prototype.isEnabled=function(){return this._enabled},oa.prototype.isActive=function(){return this._active};var la=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};la.prototype.setZoomRate=function(t){this._defaultZoomRate=t},la.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},la.prototype.isEnabled=function(){return!!this._enabled},la.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},la.prototype.isZooming=function(){return!!this._zooming},la.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},la.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},la.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),a=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(a*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},la.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},la.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},la.prototype.renderFrame=function(){return this._onScrollFrame()},la.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==a&&(a=1/a);var i="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(i*a))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var p=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(p);o=t.number(l,s,f),p<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},la.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,a=(t.browser.now()-n.start)/n.duration,i=n.easing(a+.01)-n.easing(a),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},la.prototype.reset=function(){this._active=!1};var ca=function(t,e){this._clickZoom=t,this._tapZoom=e};ca.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ca.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ca.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ca.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ua=function(){this.reset()};ua.prototype.reset=function(){this._active=!1},ua.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ua.prototype.enable=function(){this._enabled=!0},ua.prototype.disable=function(){this._enabled=!1,this.reset()},ua.prototype.isEnabled=function(){return this._enabled},ua.prototype.isActive=function(){return this._active};var pa=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};pa.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},pa.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},pa.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],a=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:a/128}}}else this._tap.touchmove(t,e,r)},pa.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},pa.prototype.touchcancel=function(){this.reset()},pa.prototype.enable=function(){this._enabled=!0},pa.prototype.disable=function(){this._enabled=!1,this.reset()},pa.prototype.isEnabled=function(){return this._enabled},pa.prototype.isActive=function(){return this._active};var fa=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};fa.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},fa.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},fa.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},fa.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ha=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};ha.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ha.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ha.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ha.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var da=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};da.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},da.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},da.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},da.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},da.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},da.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ma=function(t){return t.zoom||t.drag||t.pitch||t.rotate},ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function ga(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var va=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Dn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var a=this._el;this._listeners=[[a,"touchstart",{passive:!1}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[t.window,"blur",void 0]];for(var i=0,o=this._listeners;ii?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),T=a.unproject(x.add(_.mult(e*w)).mult(m));a.setLocationAtPoint(a.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,a=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),a&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var a=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(a,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):o,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:l,h="padding"in e?e.padding:i.padding,d=i.zoomScale(u-o),m=t.Point.convert(e.offset),y=i.centerPoint.add(m),g=i.pointLocation(y),v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var x=i.project(g),_=i.project(v).sub(x),b=e.curve,w=Math.max(i.width,i.height),T=w/d,k=_.mag();if("minZoom"in e){var M=t.clamp(Math.min(e.minZoom,o,u),i.minZoom,i.maxZoom),A=w/i.zoomScale(M-o);b=Math.sqrt(A/k*2)}var S=b*b;function L(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function E(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var C=L(0),I=function(t){return P(C)/P(C+b*t)},D=function(t){return w*((P(C)*(E(e=C+b*t)/P(e))-E(C))/S)/k;var e},z=(L(1)-C)/b;if(Math.abs(k)<1e-6||!isFinite(z)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=f!==l,this._padding=!i.isPaddingEqual(h),this._prepareEase(r,!1),this._ease((function(e){var a=e*z,d=1/I(a);i.zoom=1===e?u:o+i.scaleZoom(d),n._rotating&&(i.bearing=t.number(s,p,e)),n._pitching&&(i.pitch=t.number(l,f,e)),n._padding&&(i.interpolatePadding(c,h,e),y=i.centerPoint.add(m));var g=1===e?v:i.unproject(x.add(_.mult(D(a))).mult(d));i.setLocationAtPoint(i.renderWorldCopies?g.wrap():g,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),_a=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};_a.prototype.getDefaultPosition=function(){return"bottom-right"},_a.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_a.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},_a.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_a.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var ba=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};ba.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ba.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ba.prototype.getDefaultPosition=function(){return"bottom-left"},ba.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},ba.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},ba.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wa.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wa.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var a=new Mn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,a,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wa,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ta,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ma))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new va(this,e);var i="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Sn(i).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _a({customAttribution:e.customAttribution})),this.addControl(new ba,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(a.__proto__=n),a.prototype=Object.create(n&&n.prototype),a.prototype.constructor=a;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var a=this._controlPositions[r];return-1!==r.indexOf("bottom")?a.insertBefore(n,a.firstChild):a.appendChild(n),this},a.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},a.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],a=r[1];this._resizeCanvas(n,a),this.transform.resize(n,a),this.painter.resize(n,a);var i=!this._moving;return i&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},a.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},a.prototype.getMaxPitch=function(){return this.transform.maxPitch},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},a.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},a.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},a.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},a.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},a.prototype._createDelegatedListener=function(t,e,r){var n,a=this;if("mouseenter"===t||"mouseover"===t){var i=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?i||(i=!0,r.call(a,new Rn(t,a,n.originalEvent,{features:o}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(a.getLayer(e)?a.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(a,new Rn(t,a,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(a,new Rn(t,a,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(a,t),delete t.features)},n)}},a.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var a=this._createDelegatedListener(t,e,r);for(var i in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)this.on(i,a.delegates[i]);return this},a.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var a=this._createDelegatedListener(t,e,r);for(var i in a.delegates)this.once(i,a.delegates[i]);return this},a.prototype.off=function(t,e,r){var a=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var i=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ia.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ia.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var a=this.mousePitch.mousemoveWindow(t,e);a&&a.pitchDelta&&r.setPitch(r.getPitch()+a.pitchDelta)}},Ia.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ia.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ia.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ia.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ia.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ia.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ia.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ia.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,a=this._map.getBearing(),i=t.extend({bearing:a},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),i,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),a=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=a+"px",this._circleElement.style.height=a+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ja)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{var i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fa(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fa({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ba--,ja=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Ba>1?(e={maximumAge:6e5,timeout:0},ja=!0):(e=this.options.positionOptions,ja=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Va={maxWidth:100,unit:"metric"},qa=function(e){this.options=t.extend({},Va,e),t.bindAll(["_onMove","setUnit"],this)};function Ha(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,i=t.unproject([0,a]),o=t.unproject([n,a]),s=i.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;if(l>5280)Ga(e,n,l/5280,t._getUIString("ScaleControl.Miles"));else Ga(e,n,l,t._getUIString("ScaleControl.Feet"))}else if(r&&"nautical"===r.unit){Ga(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?Ga(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ga(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ga(t,e,r,n){var a,i,o,s=(a=r,i=Math.pow(10,(""+Math.floor(a)).length-1),o=(o=a/i)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),i*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}qa.prototype.getDefaultPosition=function(){return"bottom-left"},qa.prototype._onMove=function(){Ha(this._map,this._container,this.options)},qa.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qa.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qa.prototype.setUnit=function(t){this.options.unit=t,Ha(this._map,this._container,this.options)};var Ya=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ya.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ya.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ya.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ya.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ya.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ya.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ya.prototype._isFullscreen=function(){return this._fullscreen},Ya.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ya.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Za={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Xa=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Za),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),a=t.window.document.createElement("body");for(a.innerHTML=e;r=a.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this,a=this._lngLat||this._trackPointer;if(this._map&&a&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Da(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var a=t.Point.convert(r);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,c=this._container.offsetWidth,u=this._container.offsetHeight;l=i.y+s.bottom.ythis._map.transform.height-u?["bottom"]:[],i.xthis._map.transform.width-c/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var p=i.add(s[o]).round();r.setTransform(this._container,za[o]+" translate("+p.x+"px,"+p.y+"px)"),Oa(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);var Wa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:La,NavigationControl:Ca,GeolocateControl:Ua,AttributionControl:_a,ScaleControl:qa,FullscreenControl:Ya,Popup:Xa,Marker:Fa,Style:He,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Nt().acquire(zt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Wa})),r}))},{}],120:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],121:[function(t,e,r){(function(t,r){(function(){ +"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');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 TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|h(t,e),n=i(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function h(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(i)return n?-1:O(t).length;e=(""+e).toLowerCase(),i=!0}}function f(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(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),B(r=+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:m(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):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;fi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},a.prototype.compare=function(t,e,r,n,i){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);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(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),h=0;h>>=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 g(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(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)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(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 P(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||E(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||E(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(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||E(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||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||E(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||E(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||E(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||E(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||E(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(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||L(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||L(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||L(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||L(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);L(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>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);L(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||L(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||L(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||L(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||L(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||L(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 P(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},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),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);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":75,buffer:105,ieee754:345}],106:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),f=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!h&&!f||0===t.length)return[];var d=n(t,e);if(u||h!==f||p){for(var m=i(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,h=-1,l=o[s],1);d=0||(e.flip(s,p),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,p,u),i(t,e,r,p,u,h)))}}},{"binary-search-bounds":92,"robust-in-sphere":425}],108:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(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 o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var m=f[3*p+d];m>=0&&0===c[m]&&(h[3*p+d]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[f[p-2]],r[f[p-1]],a)>0;)t.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=h.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],v=[],y=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;nr?r:t:te?e:t}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var M,A=x[1]=S[1];for(i&&(M=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([A,E,M]):e.push([A,E]),A=E}i?e.push([A,_,M]):e.push([A,_])}return f}(t,e,f,g,r));return v(e,y,r),!!y||(f.length>0||g.length>0)}},{"./lib/rat-seg-intersect":116,"big-rat":79,"big-rat/cmp":77,"big-rat/to-float":91,"box-intersect":96,nextafter:377,"rat-vec":416,"robust-segment-intersect":430,"union-find":478}],116:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),f=u(a,h);if(0===o(f))return null;var p=s(t,r),d=u(h,p),m=i(d,f),g=c(a,m);return l(t,g)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":78,"big-rat/mul":88,"big-rat/sign":89,"big-rat/sub":90,"rat-vec/add":415,"rat-vec/muls":417,"rat-vec/sub":418}],117:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],118:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(a(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},{clamp:114,"color-rgba":120,dtype:154}],119:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=(p=t.slice(1)).length;c=1,u<=4?(l=[parseInt(p[0]+p[0],16),parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16)],4===u&&(c=parseInt(p[3]+p[3],16)/255)):(l=[parseInt(p[0]+p[1],16),parseInt(p[2]+p[3],16),parseInt(p[4]+p[5],16)],8===u&&(c=parseInt(p[6]+p[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var h=e[1],f="rgb"===h,p=h.replace(/a$/,"");s=p;u="cmyk"===p?4:"gray"===p?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===p?255*parseFloat(t)/100:parseFloat(t);if("h"===p[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),h===p&&l.push(1),c=f||void 0===l[u]?1:l[u],l=l.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":117,defined:151,"is-plain-obj":353}],120:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:114,"color-parse":119,"color-space/hsl":121}],121:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":122}],122:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],123:[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]}],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:1,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]}]}},{}],124:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,h,f,p,d,m;t||(t={});p=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet");if("string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var f=n(t,e,r);return f>0?o>0&&n(t,e,a)>0?1:-1:f<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":427,"robust-product":428,"robust-sum":432,signum:434,"two-sum":476}],126:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(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=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],h=t[1],f=t[2],p=t[3],d=e[0],m=e[1],g=e[2],v=e[3];return u+h+f+p-(d+m+g+v)||n(u,h,f,p)-n(d,m,g,v,d)||n(u+h,u+f,u+p,h+f,h+p,f+p)-n(d+m,d+g,d+v,m+g,m+v,g+v)||n(u+h+f,u+h+p,u+f+p,h+f+p)-n(d+m+g,d+m+v,d+g+v,m+g+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],130:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":66,"incremental-convex-hull":346}],132:[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"}},{}],133:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+h*r[p]+f*n[p];return a}return c*t+u*e+h*r+f*n},e.exports.derivative=function(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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],134:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return te?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=v?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=v?10:a>=y?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=v?i*=10:a>=y?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function k(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function M(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,A),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;ah;)f.pop(),--p;var d,m=new Array(p+1);for(a=0;a<=p;++a)(d=m[a]=[]).x0=a>0?f[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,h,f=-1,p=n.length,d=l[i++],m=r(),g=a();++fl.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each((function(e,r){i.push({key:r,values:t(e,n)})}))),null!=a?i.sort((function(t,e){return a(t.key,e.key)})):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],136:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),u=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),h=new RegExp("^rgba\\("+[o,o,o,a]+"\\)$"),f=new RegExp("^hsl\\("+[a,o,o]+"\\)$"),p=new RegExp("^hsla\\("+[a,o,o,a]+"\\)$"),d={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};function m(){return this.rgb().formatHex()}function g(){return this.rgb().formatRgb()}function v(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?y(e):3===r?new w(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new w(e[1],e[2],e[3],1):(e=c.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=u.exec(t))?x(e[1],e[2],e[3],e[4]):(e=h.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=f.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):d.hasOwnProperty(t)?y(d[t]):"transparent"===t?new w(NaN,NaN,NaN,0):null}function y(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function _(t,e,r,n){return 1===arguments.length?b(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function T(){return"#"+M(this.r)+M(this.g)+M(this.b)}function k(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function M(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function A(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new L(t,e,r,n)}function S(t){if(t instanceof L)return new L(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new L;if(t instanceof L)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&c<1?0:s,new L(s,l,c,t.opacity)}function E(t,e,r,n){return 1===arguments.length?S(t):new L(t,e,r,null==n?1:n)}function L(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function C(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:m,formatHex:m,formatHsl:function(){return S(this).formatHsl()},formatRgb:g,toString:g}),e(w,_,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:T,formatHex:T,formatRgb:k,toString:k})),e(L,E,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new L(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new L(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new w(C(t>=240?t-240:t+120,i,n),C(t,i,n),C(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var P=Math.PI/180,I=180/Math.PI,z=6/29,D=3*z*z;function O(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof H)return G(t);t instanceof w||(t=b(t));var e,r,n=U(t.r),i=U(t.g),a=U(t.b),o=N((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=o:(e=N((.4360747*n+.3850649*i+.1430804*a)/.96422),r=N((.0139322*n+.0971045*i+.7141733*a)/.82521)),new F(116*o-16,500*(e-o),200*(o-r),t.opacity)}function R(t,e,r,n){return 1===arguments.length?O(t):new F(t,e,r,null==n?1:n)}function F(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function N(t){return t>.008856451679035631?Math.pow(t,1/3):t/D+4/29}function B(t){return t>z?t*t*t:D*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t){if(t instanceof H)return new H(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=O(t)),0===t.a&&0===t.b)return new H(NaN,0=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function a(t,e){for(var r,n=0,i=t.length;n0)for(var r,n,i=new Array(r),a=0;af+c||np+c||au.index){var h=f-s.x-s.vx,g=p-s.y-s.vy,v=h*h+g*g;vt.r&&(t.r=t[e].r)}function f(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d1?(null==r?u.remove(t):u.set(t,v(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,h=Array.prototype.map,f=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e,i,o=void 0===t.grouping||void 0===t.thousands?c:(e=h.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var n=t.length,a=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",p=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(h.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",v=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=a(t)).fill,r=t.align,i=t.sign,c=t.symbol,h=t.zero,y=t.width,x=t.comma,b=t.precision,_=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===b&&(b=12),_=!0,w="g"),(h||"0"===e&&"="===r)&&(h=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?m:"",M=l[w],A=/[defgprs%]/.test(w);function S(t){var a,s,l,c=T,u=k;if("c"===w)u=M(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?v:M(Math.abs(t),b),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?f[8+n/3]:"")+u+(m&&"("===i?")":""),A)for(a=-1,s=t.length;++a(l=t.charCodeAt(a))||l>57){u=(46===l?p+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}x&&!h&&(t=o(t,1/0));var S=c.length+t.length+u.length,E=S>1)+c+t+u+E.slice(S);break;default:t=E+c+t+u}return d(t)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),S.toString=function(){return t+""},S}return{format:y,formatPrefix:function(t,e){var n=y(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=f[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],140:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-geo"),t("d3-array")):i(n.d3=n.d3||{},n.d3,n.d3)}(this,(function(t,e,r){"use strict";var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,f=Math.pow,p=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,v=1e-6,y=Math.PI,x=y/2,b=y/4,_=Math.SQRT1_2,w=L(2),T=L(y),k=2*y,M=180/y,A=y/180;function S(t){return t>1?x:t<-1?-x:Math.asin(t)}function E(t){return t>1?0:t<-1?y:Math.acos(t)}function L(t){return t>0?Math.sqrt(t):0}function C(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function I(t){var e=g(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=L(e*e+i*i),u=-t/2,h=50;if(!l)return[0,0];do{var f=u/2,p=o(f),d=m(f),g=d/p,y=-c(n(p));u-=s=(2/g*y-r*g-l)/(-y/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>v&&--h>0);var x=m(u);return[a(e*x,l*o(u)),S(i*x/l)]},i}function z(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(E(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function D(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,h=0,f=50;do{var p=o(u),d=m(u),g=o(h),y=m(h),x=1+g,b=x*d-t,_=l+y*r-x*e*p-c,w=x*p/2,T=-d*y,k=e*x*d/2,M=r*g+e*p*y,A=T*k-M*w,S=(_*T-b*M)/A/2,E=(b*k-_*w)/A;n(E)>2&&(E/=2),u-=S,h-=E}while((n(S)>v||n(E)>v)&&--f>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function O(t,e){var r=g(e/2),n=L(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}z.invert=function(t,e){if(!(t*t+4*e*e>y*y+v)){var r=t,i=e,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),f=o(i),p=m(2*i),d=h*h,g=f*f,x=c*c,b=1-g*u*u,_=b?E(f*u)*L(s=1/b):s=0,w=2*_*f*c-t,T=_*h-e,k=s*(g*x+_*f*u*d),M=s*(.5*l*p-2*_*h*c),A=.25*s*(p*c-_*h*g*l),S=s*(d*u+_*x*f),C=M*A-S*k;if(!C)break;var P=(T*M-w*S)/C,I=(w*A-T*k)/C;r-=P,i-=I}while((n(P)>v||n(I)>v)&&--a>0);return[r,i]}},O.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=L((r-L(r*r-4*e*e))/2),s=S(i)/3,l=i?function(t){return c(t+L(t*t-1))}(n(e/i))/3:function(t){return c(t+L(t*t+1))}(n(t))/3,u=o(s),h=P(l),f=h*h-u*u;return[2*d(t)*a(C(l)*u,.25-f),2*d(e)*a(h*m(s),.25+f)]};var R=L(8),F=c(1+w);function N(t,e){var r=n(e);return rx){var l=a(s[1],s[0]),c=L(s[0]*s[0]+s[1]*s[1]),u=r*p((l-x)/r)+x,h=a(m(l-=u),2-o(l));l=u+S(y/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=L(t*t+n*n);if(s>x){var l=a(n,t),c=r*p((l-x)/r)+x,u=l>c?-1:1,h=s*o(c-l),f=1/g(u*E((h-y)/L(y*(y-2*h)+s*s)));l=c+2*i((f+u*L(f*f-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function j(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return U;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function U(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function V(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+v))&&(o=a+v),r-=i=-1*v*(a-e)/(a-o)}while(s-- >0&&n(i)>v);return s<0?NaN:r}function q(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=1e-12),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;hl)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,v=(s>0?-1:1)*r,y=t(o+g,s),x=t(o,s+v),b=(y[0]-f[0])/g,_=(y[1]-f[1])/g,w=(x[0]-f[0])/v,T=(x[1]-f[1])/v,k=T*b-_*w,M=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-p*T)*M,s+=u=(p*_-d*b)*M,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=q(e),e}function G(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>v&&--a>0);return e/2}function Y(t,e,r){function n(n,i){return[t*n*o(i=G(r,i)),e*m(i)]}return n.invert=function(n,i){return i=S(i/e),[n/(t*o(i)),S((2*i+m(2*i))/r)]},n}N.invert=function(t,e){if((a=n(e))1e-12&&--u>0);return[t/(o(l)*(R-1/m(l))),d(e)*l]},U.invert=function(t,e){var r=2*S(e/2);return[t*o(r/2)/o(r),r]};var Z=Y(w/x,w,y);var X=2.00276,W=1.11072;function K(t,e){var r=G(y,e);return[X*t/(1/o(e)+W/o(r)),(e+w*m(r))/X]}function J(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*A):r*M},i}function Q(t,e){return[t*o(e),e]}function $(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i?r*o(n)/i:i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=L(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function tt(t){function e(e,r){var n=x-r,i=n?e*t*m(n)/n:n;return[n*m(i)/t,x-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=x-r,o=L(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,x-o]},e}K.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-w*m(s),s-=r=(m(2*s)+2*s-y*m(i))/(2*o(2*s)+2+y*o(i)*w*o(s))}while(n(r)>v&&--l>0);return i=a-w*m(s),[t*(1/o(i)+W/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var et=Y(1,4/y,y);function rt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=E(r*s+e*i*u);else{var h=m(t/2),f=m(l/2);c=2*S(L(h*h+e*i*f*f))}return n(c)>v?[c,a(i*m(l),e*s-r*i*u)]:[0,0]}function nt(t,e,r){return E((t*t+e*e-r*r)/(2*t*e))}function it(t){return t-2*y*l((t+y)/(2*y))}function at(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=rt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=nt(i[0].v[0],i[2].v[0],i[1].v[0]),c=nt(i[0].v[0],i[1].v[0],i[2].v[0]),u=y-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=rt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=it(s[r][1]-l.v[1])}var f=h.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=nt(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=u-d,f[0]+=s[r][0]*o(d),f[1]+=s[r][0]*m(d)):(f[0]+=s[r][0]*o(d),f[1]-=s[r][0]*m(d))}return f[0]/=3,f[1]/=3,f}}function ot(t){return t[0]*=A,t[1]*=A,t}function st(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=at(ot(o(t)),ot(o(r)),ot(o(n)));s.invert=q(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function lt(t,e){var r=L(1-m(e));return[2/T*t*r,T*(1-r)]}function ct(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(L(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,S(t?e*g(t)/t:e)]},r}lt.invert=function(t,e){var r=(r=e/T-1)*r;return[r>0?t*L(y/r)/2:0,S(1-r)]};var ut=L(3);function ht(t,e){return[ut*t*(2*o(2*e/3)-1)/T,ut*T*m(e/3)]}function ft(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,S(r*e)]},r}function pt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function dt(t,e){var r=L(8/(3*y));return[r*t*(1-n(e)/y),r*e]}function mt(t,e){var r=L(4-3*m(n(e)));return[2/L(6*y)*t*r,d(e)*L(2*y/3)*(2-r)]}function gt(t,e){var r=L(y*(4+y));return[2/r*t*(1+L(1-4*e*e/(y*y))),4/r*e]}function vt(t,e){var r=(2+x)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>v;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/L(y*(4+y))*t*(1+o(e)),2*L(y/(4+y))*m(e)]}function yt(t,e){return[t*(1+o(e))/L(2+y),2*e/L(2+y)]}function xt(t,e){for(var r=(1+x)*m(e),i=0,a=1/0;i<10&&n(a)>v;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=L(2+y),[t*(1+o(e))/r,2*e/r]}ht.invert=function(t,e){var r=3*S(e/(ut*T));return[T*t/(ut*(2*o(2*r/3)-1)),r]},dt.invert=function(t,e){var r=L(8/(3*y)),i=e/r;return[t/(r*(1-n(i)/y)),i]},mt.invert=function(t,e){var r=2-n(e)/L(2*y/3);return[t*L(6*y)/(2*r),d(e)*S((4-r*r)/3)]},gt.invert=function(t,e){var r=L(y*(4+y))/2;return[t*r/(1+L(1-e*e*(4+y)/(4*y))),e*r/2]},vt.invert=function(t,e){var r=e*L((4+y)/y)/2,n=S(r),i=o(n);return[t/(2/L(y*(4+y))*(1+i)),S((n+r*(i+2))/(2+x))]},yt.invert=function(t,e){var r=L(2+y),n=e*r/2;return[r*t/(1+o(n)),n]},xt.invert=function(t,e){var r=1+x,n=L(r/2);return[2*t*n/(1+o(e*=n)),S((e+m(e))/r)]};var bt=3+2*w;function _t(t,e){var r=m(t/=2),n=o(t),a=L(o(e)),s=o(e/=2),l=m(e)/(s+w*n*a),u=L(2/(1+l*l)),h=L((w*s+(n+r)*a)/(w*s+(n-r)*a));return[bt*(u*(h-1/h)-2*c(h)),bt*(u*l*(h+1/h)-2*i(l))]}_t.invert=function(t,e){if(!(r=O.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var f=a/2,p=s/2,d=m(f),g=o(f),y=m(p),b=o(p),T=o(s),k=L(T),M=y/(b+w*g*k),A=M*M,S=L(2/(1+A)),E=(w*b+(g+d)*k)/(w*b+(g-d)*k),C=L(E),P=C-1/C,I=C+1/C,z=S*P-2*c(C)-t,D=S*M*I-2*i(M)-e,R=y&&_*k*d*A/y,F=(w*g*b+k)/(2*(b+w*g*k)*(b+w*g*k)*k),N=-.5*M*S*S*S,B=N*R,j=N*F,U=(U=2*b+w*k*(g-d))*U*C,V=(w*g*b*k+T)/U,q=-w*d*y/(k*U),H=P*B-2*V/C+S*(V+V/E),G=P*j-2*q/C+S*(q+q/E),Y=M*I*B-2*R/(1+A)+S*I*R+S*M*(V-V/E),Z=M*I*j-2*F/(1+A)+S*I*F+S*M*(q-q/E),X=G*Y-Z*H;if(!X)break;var W=(D*G-z*Z)/X,K=(z*Y-D*H)/X;a-=W,s=u(-x,h(x,s-K))}while((n(W)>v||n(K)>v)&&--l>0);return n(n(s)-x)s){var d=L(f),g=a(h,u),b=i*p(g/i),_=g-b,w=t*o(_),T=(t*m(_)-_*m(w))/(x-w),k=Lt(_,T),M=(y-t)/Ct(k,w,y);u=d;var A,S=50;do{u-=A=(t+Ct(k,w,u)*M-d)/(k(u)*M)}while(n(A)>v&&--S>0);h=_*m(u),us){var u=L(c),h=a(l,r),f=i*p(h/i),d=h-f;r=u*o(d),l=u*m(d);for(var g=r-x,v=m(r),b=l/v,_=rv||n(p)>v)&&--x>0);return[d,g]},u}Tt.invert=function(t,e){var r=e/(1+wt);return[t&&t/(wt*L(1-r*r)),2*i(r)]},kt.invert=function(t,e){var r=i(e/T),n=o(r),a=2*r;return[t*T/2/(o(a)*n*n),a]};var It=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var zt=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var Dt=Pt(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Ot(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Ot.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>v&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>v&&--o>0);return[i,a]};var Rt=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Ft(t){var e=t(x,0)[0]-t(-x,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*y,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*y;return o<-y?o+=2*y:o>y&&(o-=2*y),a[0]=o,a}),r}function Nt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),e=S(l),n(t-x)>v&&(t%=x);var h=function(t,e){if(e===x)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,f=S(1/L(c)),p=h+s*c*f,d=(1-a)/p,g=L(d),b=d*c,_=L(b),w=g*h;if(0===t)return[0,-(w+s*_)];var T,k=o(e),M=1/k,A=2*a*k,E=(-p*k-(-3*s+f*u)*A*(1-a))/(p*p),C=-M*A,P=-M*(s*c*E+d*u*A),I=-2*M*(h*(.5*E/g)-2*s*g*A),z=4*t/y;if(t>.222*y||e.175*y){if(r=(w+s*L(b*(1+l)-w*w))/(1+l),t>y/4)return[r,r];var D=r,O=.5*r;r=.5*(O+D),i=50;do{var R=L(b-r*r),F=r*(I+C*R)+P*S(r/_)-z;if(!F)break;F<0?O=r:D=r,r=.5*(O+D)}while(n(D-O)>v&&--i>0)}else{r=v,i=25;do{var N=r*r,B=L(b-N),j=I+C*B,U=r*j+P*S(r/_)-z,V=j+(P-C*N)/B;r-=T=B?U/V:0}while(n(T)>v&&--i>0)}return[r,-w-s*L(b-r*r)]}(t>y/4?x-t:t,e);return t>y/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Bt(t,e){var r,a,l,c,u,h;if(e=1-v)return r=(1-e)/4,l=1/(a=P(t)),[(c=((h=s(2*(h=t)))-1)/(h+1))+r*((u=a*C(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-x+r*(u-t)/a];var f=[1,0,0,0,0,0,0,0,0],p=[L(e),0,0,0,0,0,0,0,0],d=0;for(a=L(1-e),u=1;n(p[d]/f[d])>v&&d<8;)r=f[d++],p[d]=(r-a)/2,f[d]=(r+a)/2,a=L(r*a),u*=2;l=u*f[d]*t;do{l=(S(c=p[d]*m(a=l)/f[d])+l)/2}while(--d);return[m(l),c=o(l),c/o(l-a),l]}function jt(t,e){if(!e)return t;if(1===e)return c(g(t/2+b));for(var r=1,a=L(1-e),o=L(e),s=0;n(o)>v;s++){if(t%y){var l=i(a*g(t)/r);l<0&&(l+=y),t+=l+~~(t/y)*y}else t+=t;o=(r+a)/2,a=L(r*a),o=((r=o)-a)/2}return t/(f(2,s)*r)}function Ut(t,e){var r=(w-1)/(w+1),l=L(1-r*r),u=jt(x,l*l),h=c(g(y/4+n(e)/2)),f=s(-1*h)/L(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?x:-x)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(f*o(-1*t),f*m(-1*t)),v=function(t,e,r){var a=n(t),o=C(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+L(c*c-4*((r-1)*l)))/2;return[jt(i(1/L(u)),r)*d(t),jt(i(L((u/l-1)/r)),1-r)*d(e)]}return[0,jt(i(o),1-r)*d(e)]}(p[0],p[1],l*l);return[-v[1],(e>=0?1:-1)*(.5*u-v[0])]}function Vt(t){var e=m(t),r=o(t),i=qt(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),c=o(a),u=o(t),h=E(e*l+r*c*u),f=m(h),p=n(f)>v?h/f:1;return[p*r*m(t),(n(t)>x?p:-p)*(e*c-r*l*u)]}return i.invert=qt(-t),s.invert=function(t,r){var n=L(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*e,f=L(c*c+u*u-h*h),p=a(c*h+u*f,u*h-c*f),d=(n>x?-1:1)*a(t*s,n*o(p)*l+r*m(p)*s);return i.invert(d,p)},s}function qt(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,c=m(n);return[a(l,s*r-c*e),S(c*r+s*e)]}}Nt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){var r=0,i=1,a=.5,s=50;for(;;){var l=a*a,c=L(a),u=S(1/L(1+l)),h=1-l+a*(1+l)*u,f=(1-c)/h,p=L(f),d=f*(1+l),m=p*(1-l),g=L(d-t*t),v=e+m+a*g;if(n(i-r)<1e-12||0==--s||0===v)break;v>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var x=S(c),b=o(x),_=1/b,w=2*c*b,T=(-h*b-(-3*a+u*(1+3*l))*w*(1-c))/(h*h);return[y/4*(t*(-2*_*(.5*T/p*(1-l)-2*a*p*w)+-_*w*g)+-_*(a*(1+l)*T+f*(1+3*l)*w)*S(t/L(d))),x]}(c?l:s,c?s:l),h=u[0],f=u[1],p=o(f);return c&&(h=-x-h),[r*(a(m(h)*p,-m(f))+y),i*S(o(h)*p)]},Ut.invert=function(t,e){var r,n,o,l,u,h,f=(w-1)/(w+1),p=L(1-f*f),d=jt(x,p*p),m=(n=-t,o=p*p,(r=.5*d-e)?(l=Bt(r,o),n?(h=(u=Bt(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/h,l[1]*l[2]*u[0]*u[1]/h],[l[1]*u[1]/h,-l[0]*l[2]*u[0]*u[2]/h],[l[2]*u[1]*u[2]/h,-o*l[0]*l[1]*u[0]/h]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=Bt(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),g=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(m[0],m[1]);return[a(g[1],g[0])/-1,2*i(s(-.5*c(f*g[0]*g[0]+f*g[1]*g[1])))-x]};var Ht=S(1-1/3)*M,Gt=ft(0);function Yt(t){var e=Ht*A,r=lt(y,e)[0]-lt(-y,e)[0],i=Gt(0,e)[1],a=lt(0,e)[1],o=T-a,s=k/t,c=4/k,f=i+o*o*4/k;function p(p,d){var m,g=n(d);if(g>e){var v=h(t-1,u(0,l((p+y)/s)));(m=lt(p+=y*(t-1)/t-v*s,g))[0]=m[0]*k/r-k*(t-1)/(2*t)+v*k/t,m[1]=i+4*(m[1]-a)*o/k,d<0&&(m[1]=-m[1])}else m=Gt(p,d);return m[0]*=c,m[1]/=f,m}return p.invert=function(e,p){e/=c;var d=n(p*=f);if(d>i){var m=h(t-1,u(0,l((e+y)/s)));e=(e+y*(t-1)/t-m*s)*r/k;var g=lt.invert(e,.25*(d-i)*k/o+a);return g[0]-=y*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Gt.invert(e,p)},p}function Zt(t,e){return[t,1&e?90-v:Ht]}function Xt(t,e){return[t,1&e?-90+v:-Ht]}function Wt(t){return[t[0]*(1-v),t[1]]}function Kt(t){var e,r=1+t,i=S(m(1/r)),s=2*L(y/(e=y+4*i*r)),l=.5*s*(r+L(t*(2+t))),c=t*t,u=r*r;function h(h,f){var p,d,g=1-m(f);if(g&&g<2){var v,b=x-f,_=25;do{var w=m(b),T=o(b),k=i+a(w,r-T),M=1+u-2*r*T;b-=v=(b-c*i-r*w+M*k-.5*g*e)/(2*r*w*k)}while(n(v)>1e-12&&--_>0);p=s*L(M),d=h*k/y}else p=s*(t+g),d=h*i/y;return[p*m(d),l-p*o(d)]}return h.invert=function(t,n){var o=t*t+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),f=E(h),p=m(f),d=i+a(p,r-h);return[S(t/L(o))*y/d,S(1-2*(f-c*i-r*p+(1+u-2*r*h)*d)/e)]},h}function Jt(t,e){return e>-.7109889596207567?((t=Z(t,e))[1]+=.0528035274542,t):Q(t,e)}function Qt(t,e){return n(e)>.7109889596207567?((t=Z(t,e))[1]-=e>0?.0528035274542:-.0528035274542,t):Q(t,e)}function $t(t,e,r,n){var i=L(4*y/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=L(n*m(r)*L((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return L(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function u(t){return l(t)*m(t)}var h=function(t,e){var n=r*V(c,s*m(e)/r,e/y);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/y*o(n),u/a*m(n)]};return h.invert=function(t,e){var n=V(u,e*a/i);return[t*y/(o(n)*i*a*l(n)),S(r*c(n/r)/s)]},0===r&&(i=L(n/y),(h=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,S(e*i)]}),h}function te(t,e,r,n,i){void 0===n&&(n=1e-8),void 0===i&&(i=20);var a=t(e),o=t(.5*(e+r)),s=t(r);return function t(e,r,n,i,a,o,s,l,c,u,h){if(h.nanEncountered)return NaN;var f,p,d,m,g,v,y,x,b,_;if(p=e(r+.25*(f=n-r)),d=e(n-.25*f),isNaN(p))h.nanEncountered=!0;else{if(!isNaN(d))return _=((v=(m=f*(i+4*p+a)/12)+(g=f*(a+4*d+o)/12))-s)/15,u>c?(h.maxDepthCount++,v+_):Math.abs(_)t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var p=2*h(1)/y*o/r,g=function(t,e){var r=h(n(m(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=p)<1&&(r=d(e)*S(a(n(e))*o)),[t/i(n(e)),r]},g}function re(t,e){return n(t[0]-e[0])=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(ne([[o-v,s-v],[o-v,a+v],[n+v,a+v],[n+v,i-v]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function ae(t,r,n){var i,a;function o(e,n){for(var i=n<0?-1:1,a=r[+(n<0)],o=0,s=a.length-1;oa[o][2][0];++o);var l=t(e-a[o][1][0],n);return l[0]+=t(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}n?o.invert=n(o):t.invert&&(o.invert=function(e,n){for(var i=a[+(n<0)],s=r[+(n<0)],l=0,c=i.length;lo&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):r.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))}))},null!=r&&s.lobes(r),s}Jt.invert=function(t,e){return e>-.7109889596207567?Z.invert(t,e-.0528035274542):Q.invert(t,e)},Qt.invert=function(t,e){return n(e)>.7109889596207567?Z.invert(t,e+(e>0?.0528035274542:-.0528035274542)):Q.invert(t,e)};var oe=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var se=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var le=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var ce=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var ue=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var he=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function fe(t,e){return[3/k*t*L(y*y/3-e*e),e]}function pe(t){function e(e,r){if(n(n(r)-x)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=f((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,S((l-1)/(l+1))]},e}fe.invert=function(t,e){return[k/3*t/L(y*y/3-e*e),e]};var de=y/w;function me(t,e){return[t*(1+L(o(e)))/2,e/(o(e/2)*o(t/6))]}function ge(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function ve(t,e){return[m(t)/o(e),g(e)*o(t)]}function ye(t){var e=o(t),r=g(b+t/2);function i(i,a){var o=a-t,s=n(o)=0;)f=(h=t[u])[0]+l*(i=f)-c*p,p=h[1]+l*p+c*i;return[f=l*(i=f)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,f=e,p=t[f],d=p[0],g=p[1],v=0,y=0;--f>=0;)v=d+c*(h=v)-u*y,y=g+c*y+u*h,d=(p=t[f])[0]+c*(h=d)-u*g,g=p[1]+c*g+u*h;var x,b,_=(v=d+c*(h=v)-u*y)*v+(y=g+c*y+u*h)*y;c-=x=((d=c*(h=d)-u*g-r)*v+(g=c*g+u*h-s)*y)/_,u-=b=(g*v-d*y)/_}while(n(x)+n(b)>1e-12&&--l>0);if(l){var w=L(c*c+u*u),T=2*i(.5*w),k=m(T);return[a(c*k,w*o(T)),w?S(u*k/w):0]}},r}me.invert=function(t,e){var r=n(t),i=n(e),a=v,s=x;iv||n(b)>v)&&--a>0);return a&&[r,i]},ve.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?_*L((i-L(i*i-4*r))/r):1/L(n);return[S(t*a),d(e)*E(a)]},xe.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*y]};var _e=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],we=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Te=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],ke=[[.9245,0],[0,0],[.01943,0]],Me=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ae(t,r){var n=e.geoProjection(be(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Se=L(6),Ee=L(7);function Le(t,e){var r=S(7*m(e)/(3*Se));return[Se*t*(2*o(2*r/3)-1)/Ee,9*m(r/3)/Ee]}function Ce(t,e){for(var r,i=(1+_)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)1e-12&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},ze.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>v;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var De=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Oe(t,e){var r=m(e),i=o(e),a=d(t);if(0===t||n(e)===x)return[0,e];if(0===e)return[t,0];if(n(t)===x)return[t*i,x*r];var s=y/(2*t)-2*t/y,l=2*e/y,c=(1-l*l)/(r-l),u=s*s,h=c*c,f=1+u/h,p=1+h/u,g=(s*r/c-s/2)/f,v=(h*r/u+c/2)/p,b=v*v-(h*r*r/u+c*r-1)/p;return[x*(g+L(g*g+i*i/f)*a),x*(v+L(b<0?0:b)*d(-e*s)*a)]}Oe.invert=function(t,e){var r=(t/=x)*t,n=r+(e/=x)*e,i=y*y;return[t?(n-1+L((1-n)*(1-n)+4*r))/(2*t)*x:0,V((function(t){return n*(y*m(t)-2*t)*y+4*t*t*(e-m(t))+2*y*t-i*e}),0)]};function Re(t,e){var r=e*e;return[t,e*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function Fe(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Ne(n.map(r.project),n.map(e.project));e.transform=r.transform?Be(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o1.790857183?e=1.790857183:e<-1.790857183&&(e=-1.790857183);var r,i=e;do{var a=i*i;i-=r=(i*(1.0148+a*a*(.23185+a*(.02406*a-.14499)))-e)/(1.0148+a*a*(5*.23185+a*(.21654*a-1.01493)))}while(n(r)>v);return[t,i]},Fe.invert=function(t,e){if(n(e)v&&--s>0);return l=g(a),[(n(e)n^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),nr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function sr(t){var r=t(x,0)[0]-t(-x,0)[0];function i(e,i){var a=n(e)0?e-y:e+y,i),s=(o[0]-o[1])*_,l=(o[0]+o[1])*_;if(a)return[s,l];var c=r*_,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*_,o=(i-e)*_,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*_,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*_,o=(u-h)*_}var f=t.invert(a,o);return s||(f[0]+=a>0?y:-y),f}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function lr(){return sr(Ut).scale(111.48)}function cr(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)v&&--u>0);var d=r*(h=g(c)),x=g(n(a)0?x:-x)*(f+o*(d-c)/2+o*o*(d-2*f+c)/2)]}function fr(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=L(n),o=(t-L(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*L(1-o*o)),i?S(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}ur.forEach((function(t){t[1]*=1.0144})),hr.invert=function(t,e){var r=e/x,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=ur[o][1],c=ur[o+1][1],f=ur[h(19,o+2)][1],p=f-s,d=f-2*c+s,m=2*(n(r)-c)/p,g=d/p,v=m*(1-g*m*(1-2*g*m));if(v>=0||1===o){i=(e>=0?5:-5)*(v+a);var y,b=50;do{v=(a=h(18,n(i)/5))-(o=l(a)),s=ur[o][1],c=ur[o+1][1],f=ur[h(19,o+2)][1],i-=(y=(e>=0?x:-x)*(c+v*(f-s)/2+v*v*(f-2*c+s)/2)-e)*M}while(n(y)>1e-12&&--b>0);break}}while(--o>=0);var _=ur[o][0],w=ur[o+1][0],T=ur[h(19,o+2)][0];return[t/(w+v*(T-_)/2+v*v*(T-2*w+_)/2),i*A]};var pr=-179.9999,dr=179.9999,mr=-89.9999;function gr(t){return t.length>0}function vr(t){return-90===t||90===t?[0,t]:[-180,(e=t,Math.floor(1e4*e)/1e4)];var e}function yr(t){var e=t[0],r=t[1],n=!1;return e<=pr?(e=-180,n=!0):e>=dr&&(e=180,n=!0),r<=mr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[e,r]:t}function xr(t){return t.map(yr)}function br(t,e,r){for(var n=0,i=t.length;n=dr||u<=mr||u>=89.9999){a[o]=yr(l);for(var h=o+1;hpr&&pmr&&d<89.9999)break}if(h===o+1)continue;if(o){var m={index:-1,polygon:e,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=vr(u),r[r.length-1]=m}else r.pop();if(h>=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(h-1)}),a[0]=vr(a[0][1]),o=-1,s=a.length}}}}function _r(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e0?y-l:l)*M],u=e.geoProjection(t(s)).rotate(c),h=e.geoRotation(c),f=u.center;return delete u.rotate,u.center=function(t){return arguments.length?f(h(t)):h.invert(f())},u.clipAngle(90)}function Ar(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Sr(t,e){return Mr(Ar,t,e)}function Er(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(e,a){var s=E(o(a)*o(e-r)),l=E(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*L(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,h=o(L(u+(i=t+r)*i)),f=o(L(u+(i=t+n)*i));return[a(c=h-f,i=(h+f)*s),(e<0?-1:1)*E(L(i*i+c*c)*l)]},c}function Lr(t,e){return Mr(Er,t,e)}function Cr(t,e){if(n(e)v&&--l>0);return[d(t)*(L(a*a+4)+a)*y/4,x*s]};var Rr=4*y+3*L(3),Fr=2*L(2*y*L(3)/Rr),Nr=Y(Fr*L(3)/y,Fr,Rr/6);function Br(t,e){return[t*L(1-3*e*e/(y*y)),e]}function jr(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=L(1-n*n))-s*i,-s*r-l*i]}function Ur(t,e){var r=z(t,e);return[(r[0]+t/x)/2,(r[1]+e)/2]}Br.invert=function(t,e){return[t/L(1-3*e*e/(y*y)),e]},jr.invert=function(t,e){var r=(t*t+e*e)/-2,n=L(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=L(o*o+i*i);return[a(n*i,s*(1+r)),s?-S(n*o/s):0]},Ur.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,f=l*l,p=m(r),d=o(r/2),g=m(r/2),y=g*g,b=1-f*d*d,_=b?E(l*d)*L(s=1/b):s=0,w=.5*(2*_*l*g+r/x)-t,T=.5*(_*c+i)-e,k=.5*s*(f*y+_*l*d*h)+.5/x,M=s*(p*u/4-_*c*g),A=.125*s*(u*g-_*c*f*p),S=.5*s*(h*d+_*y*l)+.5,C=M*A-S*k,P=(T*M-w*S)/C,I=(w*A-T*k)/C;r-=P,i-=I}while((n(P)>v||n(I)>v)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=x,r=e.geoProjectionMutator(I),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*A):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=I,t.geoAitoff=function(){return e.geoProjection(z).scale(152.63)},t.geoAitoffRaw=z,t.geoArmadillo=function(){var t=20*A,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(D),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*A)>=0?1:-1)*t),i(t)):t*M},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)u.point(e,r*-a(o(e*A/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=D,t.geoAugust=function(){return e.geoProjection(O).scale(66.1603)},t.geoAugustRaw=O,t.geoBaker=function(){return e.geoProjection(N).scale(112.314)},t.geoBakerRaw=N,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(B),n=r(t),i=n.stream,s=-o(.01*A),l=m(.01*A);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),c=i(e),u=(n.rotate([0,0]),i(e));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=0,r=360/t,n=2*y/t,i=90-180/t,c=x;e=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=Vt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Yt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){var n,i;e.geoStream((n=180/t,i=[].concat(r.range(-180,180+n/2,n).map(Zt),r.range(180,-180-n/2,-n).map(Xt)),{type:"Polygon",coordinates:[180===n?i.map(Wt):i]}),l)},s},i.scale(239.75)},t.geoHealpixRaw=Yt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Kt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Kt,t.geoHomolosine=function(){return e.geoProjection(Qt).scale(152.63)},t.geoHomolosineRaw=Qt,t.geoHufnagel=function(){var t=1,r=0,n=45*A,i=2,a=e.geoProjectionMutator($t),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*A,i):n*M},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=$t,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ee),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ee,t.geoInterrupt=ae,t.geoInterruptedBoggs=function(){return ae(K,oe).scale(160.857)},t.geoInterruptedHomolosine=function(){return ae(Qt,se).scale(152.63)},t.geoInterruptedMollweide=function(){return ae(Z,le).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return ae(Z,ce).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return ae(Jt,ue,q).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return ae(Q,he).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(fe).scale(158.837)},t.geoKavrayskiy7Raw=fe,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(pe),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=pe,t.geoLarrivee=function(){return e.geoProjection(me).scale(97.2672)},t.geoLarriveeRaw=me,t.geoLaskowski=function(){return e.geoProjection(ge).scale(139.98)},t.geoLaskowskiRaw=ge,t.geoLittrow=function(){return e.geoProjection(ve).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=ve,t.geoLoximuthal=function(){return J(ye).parallel(40).scale(158.837)},t.geoLoximuthalRaw=ye,t.geoMiller=function(){return e.geoProjection(xe).scale(108.318)},t.geoMillerRaw=xe,t.geoModifiedStereographic=Ae,t.geoModifiedStereographicRaw=be,t.geoModifiedStereographicAlaska=function(){return Ae(_e,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ae(we,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ae(Te,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ae(ke,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ae(Me,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Z).scale(169.529)},t.geoMollweideRaw=Z,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Le).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Le,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(Ce).scale(188.209)},t.geoMtFlatPolarQuarticRaw=Ce,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(Pe).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=Pe,t.geoNaturalEarth2=function(){return e.geoProjection(Ie).scale(175.295)},t.geoNaturalEarth2Raw=Ie,t.geoNellHammer=function(){return e.geoProjection(ze).scale(152.63)},t.geoNellHammerRaw=ze,t.geoInterruptedQuarticAuthalic=function(){return ae(j(1/0),De).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(Oe).scale(127.267)},t.geoNicolosiRaw=Oe,t.geoPatterson=function(){return e.geoProjection(Re).scale(139.319)},t.geoPattersonRaw=Re,t.geoPolyconic=function(){return e.geoProjection(Fe).scale(103.74)},t.geoPolyconicRaw=Fe,t.geoPolyhedral=Ve,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-y/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-y/2?e<0?6:4:t<0?e<0?2:0:t2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=sr,t.geoRectangularPolyconic=function(){return J(cr).scale(131.215)},t.geoRectangularPolyconicRaw=cr,t.geoRobinson=function(){return e.geoProjection(hr).scale(152.63)},t.geoRobinsonRaw=hr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(fr),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*A):r*M},i.scale(432.147).clipAngle(E(1/t)*M-1e-6)},t.geoSatelliteRaw=fr,t.geoSinuMollweide=function(){return e.geoProjection(Jt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=Jt,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return wr(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(wr)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Tr(t)}},t.geoTimes=function(){return e.geoProjection(kr).scale(146.153)},t.geoTimesRaw=kr,t.geoTwoPointAzimuthal=Sr,t.geoTwoPointAzimuthalRaw=Ar,t.geoTwoPointAzimuthalUsa=function(){return Sr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Lr,t.geoTwoPointEquidistantRaw=Er,t.geoTwoPointEquidistantUsa=function(){return Lr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(Cr).scale(79.4183)},t.geoVanDerGrintenRaw=Cr,t.geoVanDerGrinten2=function(){return e.geoProjection(Pr).scale(79.4183)},t.geoVanDerGrinten2Raw=Pr,t.geoVanDerGrinten3=function(){return e.geoProjection(Ir).scale(79.4183)},t.geoVanDerGrinten3Raw=Ir,t.geoVanDerGrinten4=function(){return e.geoProjection(zr).scale(127.16)},t.geoVanDerGrinten4Raw=zr,t.geoWagner=Or,t.geoWagner7=function(){return Or().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=Dr,t.geoWagner4=function(){return e.geoProjection(Nr).scale(176.84)},t.geoWagner4Raw=Nr,t.geoWagner6=function(){return e.geoProjection(Br).scale(152.63)},t.geoWagner6Raw=Br,t.geoWiechel=function(){return e.geoProjection(jr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=jr,t.geoWinkel3=function(){return e.geoProjection(Ur).scale(158.837)},t.geoWinkel3Raw=Ur,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":134,"d3-geo":141}],141:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-array")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){a(i,t,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new n;function a(t,e,r){var n=t.s=e+r,i=n-e,a=n-i;t.t=e-a+(r-i)}var o=1e-6,s=Math.PI,l=s/2,c=s/4,u=2*s,h=180/s,f=s/180,p=Math.abs,d=Math.atan,m=Math.atan2,g=Math.cos,v=Math.ceil,y=Math.exp,x=Math.log,b=Math.pow,_=Math.sin,w=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,k=Math.tan;function M(t){return t>1?0:t<-1?s:Math.acos(t)}function A(t){return t>1?l:t<-1?-l:Math.asin(t)}function S(t){return(t=_(t/2))*t}function E(){}function L(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var C={Feature:function(t,e){L(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=g(e=(e*=f)/2+c),o=_(e),s=B*o,l=N*a+s*g(i),u=s*n*_(i);j.add(m(u,l)),F=t,N=a,B=o}function Z(t){return[m(t[1],t[0]),A(t[2])]}function X(t){var e=t[0],r=t[1],n=g(r);return[n*g(e),n*_(e),_(r)]}function W(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function K(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 J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function $(t){var e=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ht,ft,pt,dt,mt,gt,vt,yt,xt,bt,_t,wt,Tt,kt,Mt,At=r(),St={point:Et,lineStart:Ct,lineEnd:Pt,polygonStart:function(){St.point=It,St.lineStart=zt,St.lineEnd=Dt,At.reset(),V.polygonStart()},polygonEnd:function(){V.polygonEnd(),St.point=Et,St.lineStart=Ct,St.lineEnd=Pt,j<0?(tt=-(rt=180),et=-(nt=90)):At>o?nt=90:At<-o&&(et=-90),ct[0]=tt,ct[1]=rt},sphere:function(){tt=-(rt=180),et=-(nt=90)}};function Et(t,e){lt.push(ct=[tt=t,rt=t]),ent&&(nt=e)}function Lt(t,e){var r=X([t*f,e*f]);if(st){var n=K(st,r),i=K([n[1],-n[0],0],n);$(i),i=Z(i);var a,o=t-it,s=o>0?1:-1,l=i[0]*h*s,c=p(o)>180;c^(s*itnt&&(nt=a):c^(s*it<(l=(l+360)%360-180)&&lnt&&(nt=e)),c?tOt(tt,rt)&&(rt=t):Ot(t,rt)>Ot(tt,rt)&&(tt=t):rt>=tt?(trt&&(rt=t)):t>it?Ot(tt,t)>Ot(tt,rt)&&(rt=t):Ot(t,rt)>Ot(tt,rt)&&(tt=t)}else lt.push(ct=[tt=t,rt=t]);ent&&(nt=e),st=r,it=t}function Ct(){St.point=Lt}function Pt(){ct[0]=tt,ct[1]=rt,St.point=Et,st=null}function It(t,e){if(st){var r=t-it;At.add(p(r)>180?r+(r>0?360:-360):r)}else at=t,ot=e;V.point(t,e),Lt(t,e)}function zt(){V.lineStart()}function Dt(){It(at,ot),V.lineEnd(),p(At)>o&&(tt=-(rt=180)),ct[0]=tt,ct[1]=rt,st=null}function Ot(t,e){return(e-=t)<0?e+360:e}function Rt(t,e){return t[0]-e[0]}function Ft(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:es?t+Math.round(-t/u)*u:t,e]}function Qt(t,e,r){return(t%=u)?e||r?Kt(te(t),ee(e,r)):te(t):e||r?ee(e,r):Jt}function $t(t){return function(e,r){return[(e+=t)>s?e-u:e<-s?e+u:e,r]}}function te(t){var e=$t(t);return e.invert=$t(-t),e}function ee(t,e){var r=g(t),n=_(t),i=g(e),a=_(e);function o(t,e){var o=g(e),s=g(t)*o,l=_(t)*o,c=_(e),u=c*r+s*n;return[m(l*i-u*a,s*r-c*n),A(u*i+l*a)]}return o.invert=function(t,e){var o=g(e),s=g(t)*o,l=_(t)*o,c=_(e),u=c*i-l*a;return[m(l*i+c*a,s*r+u*n),A(u*r-s*n)]},o}function re(t){function e(e){return(e=t(e[0]*f,e[1]*f))[0]*=h,e[1]*=h,e}return t=Qt(t[0]*f,t[1]*f,t.length>2?t[2]*f:0),e.invert=function(e){return(e=t.invert(e[0]*f,e[1]*f))[0]*=h,e[1]*=h,e},e}function ne(t,e,r,n,i,a){if(r){var o=g(e),s=_(e),l=n*r;null==i?(i=e+n*u,a=e-l/2):(i=ie(o,i),a=ie(o,a),(n>0?ia)&&(i+=n*u));for(var c,h=i;n>0?h>a:h1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function oe(t,e){return p(t[0]-e[0])=0;--a)i.point((h=u[a])[0],h[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ce(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,D=z*I,O=D>s,R=T*C;if(ue.add(m(R*z*_(D),k*P+R*g(D))),h+=O?I+z*u:I,O^b>=r^E>=r){var F=K(X(x),X(S));$(F);var N=K(a,F);$(N);var B=(O^I>=0?-1:1)*A(N[2]);(n>B||n===B&&(F[0]||F[1]))&&(f+=O^I>=0?1:-1)}}return(h<-o||h0){for(f||(a.polygonStart(),f=!0),a.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(de))}return p}}function de(t){return t.length>1}function me(t,e){return((t=t.x)[0]<0?t[1]-l-o:l-t[1])-((e=e.x)[0]<0?e[1]-l-o:l-e[1])}var ge=pe((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,c){var u=a>0?s:-s,h=p(a-r);p(h-s)0?l:-l),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&h>=s&&(p(r-i)o?d((_(e)*(a=g(n))*_(r)-_(n)*(i=g(e))*_(t))/(i*a*s)):(e+n)/2}(r,n,a,c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=c),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*l,n.point(-s,i),n.point(0,i),n.point(s,i),n.point(s,0),n.point(s,-i),n.point(0,-i),n.point(-s,-i),n.point(-s,0),n.point(-s,i);else if(p(t[0]-e[0])>o){var a=t[0]0,i=p(e)>o;function a(t,r){return g(t)*g(r)>e}function l(t,r,n){var i=[1,0,0],a=K(X(t),X(r)),l=W(a,a),c=a[0],u=l-c*c;if(!u)return!n&&t;var h=e*l/u,f=-e*c/u,d=K(i,a),m=Q(i,h);J(m,Q(a,f));var g=d,v=W(m,g),y=W(g,g),x=v*v-y*(W(m,m)-1);if(!(x<0)){var b=T(x),_=Q(g,(-v-b)/y);if(J(_,m),_=Z(_),!n)return _;var w,k=t[0],M=r[0],A=t[1],S=r[1];M0^_[1]<(p(_[0]-k)s^(k<=_[0]&&_[0]<=M)){var C=Q(g,(-v+b)/y);return J(C,m),[_,Z(C)]}}}function c(e,r){var i=n?t:s-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return pe(a,(function(t){var e,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(f,p){var d,m=[f,p],g=a(f,p),v=n?g?0:c(f,p):g?c(f+(f<0?s:-s),p):0;if(!e&&(u=o=g)&&t.lineStart(),g!==o&&(!(d=l(e,m))||oe(e,d)||oe(m,d))&&(m[2]=1),g!==o)h=0,g?(t.lineStart(),d=l(m,e),t.point(d[0],d[1])):(d=l(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^g){var y;v&r||!(y=l(m,e,!0))||(h=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&oe(e,m)||t.point(m[0],m[1]),e=m,o=g,r=v},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return h|(u&&o)<<1}}}),(function(e,n,i,a){ne(a,t,r,i,e,n)}),n?[0,-t]:[-s,t-s])}function ye(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,h=0;if(null==e||(c=l(e,o))!==(h=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(e,i){return p(e[0]-t)0?0:3:p(e[0]-n)0?2:1:p(e[1]-r)0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(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(o){var l,u,h,f,p,d,m,g,v,y,x,b=o,_=ae(),w={point:T,lineStart:function(){w.point=k,u&&u.push(h=[]);y=!0,v=!1,m=g=NaN},lineEnd:function(){l&&(k(f,p),d&&v&&_.rejoin(),l.push(_.result()));w.point=T,v&&b.lineEnd()},polygonStart:function(){b=_,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ri&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&le(l,c,r,s,o),o.polygonEnd());b=o,l=u=h=null}};function T(t,e){a(t,e)&&b.point(t,e)}function k(e,o){var s=a(e,o);if(u&&h.push([e,o]),y)f=e,p=o,d=s,y=!1,s&&(b.lineStart(),b.point(e,o));else if(s&&v)b.point(e,o);else{var l=[m=Math.max(-1e9,Math.min(1e9,m)),g=Math.max(-1e9,Math.min(1e9,g))],c=[e=Math.max(-1e9,Math.min(1e9,e)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,c,t,r,n,i)?s&&(b.lineStart(),b.point(e,o),x=!1):(v||(b.lineStart(),b.point(l[0],l[1])),b.point(c[0],c[1]),s||b.lineEnd(),x=!1)}m=e,g=o,v=s}return w}}var xe,be,_e,we=r(),Te={sphere:E,point:E,lineStart:function(){Te.point=Me,Te.lineEnd=ke},lineEnd:E,polygonStart:E,polygonEnd:E};function ke(){Te.point=Te.lineEnd=E}function Me(t,e){xe=t*=f,be=_(e*=f),_e=g(e),Te.point=Ae}function Ae(t,e){t*=f;var r=_(e*=f),n=g(e),i=p(t-xe),a=g(i),o=n*_(i),s=_e*r-be*n*a,l=be*r+_e*n*a;we.add(m(T(o*o+s*s),l)),xe=t,be=r,_e=n}function Se(t){return we.reset(),D(t,Te),+we}var Ee=[null,null],Le={type:"LineString",coordinates:Ee};function Ce(t,e){return Ee[0]=t,Ee[1]=e,Se(Le)}var Pe={Feature:function(t,e){return ze(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=Ce(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<1e-12*i)return!0;r=n}return!1}function Re(t,e){return!!fe(t.map(Fe),Ne(e))}function Fe(t){return(t=t.map(Ne)).pop(),t}function Ne(t){return[t[0]*f,t[1]*f]}function Be(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[t,e]}))}}function je(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[e,t]}))}}function Ue(){var t,r,n,i,a,s,l,c,u,h,f,d,m=10,g=m,y=90,x=360,b=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(v(i/y)*y,n,y).map(f).concat(e.range(v(c/x)*x,l,x).map(d)).concat(e.range(v(r/m)*m,t,m).filter((function(t){return p(t%y)>o})).map(u)).concat(e.range(v(s/g)*g,a,g).filter((function(t){return p(t%x)>o})).map(h))}return _.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(d(l).slice(1),f(n).reverse().slice(1),d(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),_.precision(b)):[[i,c],[n,l]]},_.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),_.precision(b)):[[r,s],[t,a]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],_):[y,x]},_.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],_):[m,g]},_.precision=function(e){return arguments.length?(b=+e,u=Be(s,a,90),h=je(r,t,b),f=Be(c,l,90),d=je(i,n,b),_):b},_.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Ve(t){return t}var qe,He,Ge,Ye,Ze=r(),Xe=r(),We={point:E,lineStart:E,lineEnd:E,polygonStart:function(){We.lineStart=Ke,We.lineEnd=$e},polygonEnd:function(){We.lineStart=We.lineEnd=We.point=E,Ze.add(p(Xe)),Xe.reset()},result:function(){var t=Ze/2;return Ze.reset(),t}};function Ke(){We.point=Je}function Je(t,e){We.point=Qe,qe=Ge=t,He=Ye=e}function Qe(t,e){Xe.add(Ye*t-Ge*e),Ge=t,Ye=e}function $e(){Qe(qe,He)}var tr=1/0,er=tr,rr=-tr,nr=rr,ir={point:function(t,e){trr&&(rr=t);enr&&(nr=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E,result:function(){var t=[[tr,er],[rr,nr]];return rr=nr=-(er=tr=1/0),t}};var ar,or,sr,lr,cr=0,ur=0,hr=0,fr=0,pr=0,dr=0,mr=0,gr=0,vr=0,yr={point:xr,lineStart:br,lineEnd:Tr,polygonStart:function(){yr.lineStart=kr,yr.lineEnd=Mr},polygonEnd:function(){yr.point=xr,yr.lineStart=br,yr.lineEnd=Tr},result:function(){var t=vr?[mr/vr,gr/vr]:dr?[fr/dr,pr/dr]:hr?[cr/hr,ur/hr]:[NaN,NaN];return cr=ur=hr=fr=pr=dr=mr=gr=vr=0,t}};function xr(t,e){cr+=t,ur+=e,++hr}function br(){yr.point=_r}function _r(t,e){yr.point=wr,xr(sr=t,lr=e)}function wr(t,e){var r=t-sr,n=e-lr,i=T(r*r+n*n);fr+=i*(sr+t)/2,pr+=i*(lr+e)/2,dr+=i,xr(sr=t,lr=e)}function Tr(){yr.point=xr}function kr(){yr.point=Ar}function Mr(){Sr(ar,or)}function Ar(t,e){yr.point=Sr,xr(ar=sr=t,or=lr=e)}function Sr(t,e){var r=t-sr,n=e-lr,i=T(r*r+n*n);fr+=i*(sr+t)/2,pr+=i*(lr+e)/2,dr+=i,mr+=(i=lr*t-sr*e)*(sr+t),gr+=i*(lr+e),vr+=3*i,xr(sr=t,lr=e)}function Er(t){this._context=t}Er.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,u)}},result:E};var Lr,Cr,Pr,Ir,zr,Dr=r(),Or={point:E,lineStart:function(){Or.point=Rr},lineEnd:function(){Lr&&Fr(Cr,Pr),Or.point=E},polygonStart:function(){Lr=!0},polygonEnd:function(){Lr=null},result:function(){var t=+Dr;return Dr.reset(),t}};function Rr(t,e){Or.point=Fr,Cr=Ir=t,Pr=zr=e}function Fr(t,e){Ir-=t,zr-=e,Dr.add(T(Ir*Ir+zr*zr)),Ir=t,zr=e}function Nr(){this._string=[]}function Br(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function jr(t){return function(e){var r=new Ur;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Ur(){}function Vr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),D(r,t.stream(ir)),e(ir.result()),null!=n&&t.clipExtent(n),t}function qr(t,e,r){return Vr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function Hr(t,e,r){return qr(t,[[0,0],e],r)}function Gr(t,e,r){return Vr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Yr(t,e,r){return Vr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Nr.prototype={_radius:4.5,_circle:Br(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Br(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ur.prototype={constructor:Ur,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Zr=g(30*f);function Xr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,h,f,d,g,v,y,x){var b=u-n,_=h-i,w=b*b+_*_;if(w>4*e&&y--){var k=s+d,M=l+g,S=c+v,E=T(k*k+M*M+S*S),L=A(S/=E),C=p(p(S)-1)e||p((b*D+_*O)/w-.5)>.3||s*d+l*g+c*v2?t[2]%360*f:0,I()):[y*h,x*h,b*h]},C.angle=function(t){return arguments.length?(_=t%360*f,I()):_*h},C.reflectX=function(t){return arguments.length?(w=t?-1:1,I()):w<0},C.reflectY=function(t){return arguments.length?(k=t?-1:1,I()):k<0},C.precision=function(t){return arguments.length?(o=Xr(s,L=t*t),z()):T(L)},C.fitExtent=function(t,e){return qr(C,t,e)},C.fitSize=function(t,e){return Hr(C,t,e)},C.fitWidth=function(t,e){return Gr(C,t,e)},C.fitHeight=function(t,e){return Yr(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&P,I()}}function tn(t){var e=0,r=s/3,n=$r(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*f,r=t[1]*f):[e*h,r*h]},i}function en(t,e){var r=_(t),n=(r+_(e))/2;if(p(n)0?e<-l+o&&(e=-l+o):e>l-o&&(e=l-o);var r=i/b(hn(e),n);return[r*_(n*t),i-r*g(n*t)]}return a.invert=function(t,e){var r=i-e,a=w(n)*T(t*t+r*r),o=m(t,p(r))*w(r);return r*n<0&&(o-=s*w(t)*w(r)),[o/n,2*d(b(i/a,1/n))-l]},a}function pn(t,e){return[t,e]}function dn(t,e){var r=g(t),n=t===e?_(t):(r-g(e))/(e-t),i=r/n+t;if(p(n)o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Tn.invert=on(A),kn.invert=on((function(t){return 2*d(t)})),Mn.invert=function(t,e){return[-e,2*d(y(t))-l]},t.geoAlbers=nn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=nn(),l=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function h(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,h}return h.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},h.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++rOt(n[0],n[1])&&(n[1]=i[1]),Ot(i[0],n[1])>Ot(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Ot(n[1],i[0]))>o&&(o=s,tt=i[0],rt=n[1])}return lt=ct=null,tt===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,et],[rt,nt]]},t.geoCentroid=function(t){ut=ht=ft=pt=dt=mt=gt=vt=yt=xt=bt=0,D(t,Nt);var e=yt,r=xt,n=bt,i=e*e+r*r+n*n;return i<1e-12&&(e=mt,r=gt,n=vt,ht2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Mn,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":134}],142:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),h=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=o);r=f.pop();)if(h&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)f.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;t=r.pop(),e=n.pop();for(;t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function _(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sf&&(f=s),g=u*u*m,(p=Math.max(f/g,g/h))>d){u-=s;break}d=p}v.push(o={value:u,dice:l1?e:1)},r}(G);var X=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,f=o.length,p=t.value;++h1?e:1)},r}(G);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,f=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-h)/(f-h)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=A;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(L(t)).eachAfter(C(n,.5)).eachBefore(P(1)):i.eachBefore(L(E)).eachAfter(C(A,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(P(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=k(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:S(+t),i):n},i},t.packEnclose=h,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&z(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=M(e),r):t},r.parentId=function(t){return arguments.length?(e=M(t),r):e},r},t.tree=function(){var t=N,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new q(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new q(n[i],i)),r.parent=e;return(o.parent=new q(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>h.depth&&(h=t)}));var f=c===u?1:t(c,u)/2,p=f-c.x,d=e/(u.x+f+p),m=r/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=j(s),a=B(a),s&&a;)l=B(l),(o=j(o)).a=e,(i=s.z+h-a.z-c+t(s._,a._))>0&&(U(V(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=h-u),a&&!B(l)&&(l.t=a,l.m+=c-f,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=Z,e=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,c=A;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),i=[0],e&&t.eachBefore(I),t}function h(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,h=e.x1-r,f=e.y1-r;h=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}var h=c[e],f=n/2+h,p=e+1,d=r-1;for(;p>>1;c[m]l-a){var y=(i*v+o*g)/n;t(e,p,g,i,a,y,l),t(p,r,v,y,a,o,l)}else{var x=(a*v+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,v,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=z,t.treemapResquarify=X,t.treemapSlice=H,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?H:z)(t,e,r,n,i)},t.treemapSquarify=Z,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],143:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-color")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function h(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;na&&(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:y(r,n)})),a=_.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:y(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:y(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:y(t,r)},{i:s-2,x:y(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r1e-6)if(Math.abs(h*l-c*u)>1e-6&&a){var p=n-o,d=i-s,m=l*l+c*c,g=p*p+d*d,v=Math.sqrt(m),y=Math.sqrt(f),x=a*Math.tan((e-Math.acos((m+f-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(r+b*h)),this._+="A"+a+","+a+",0,0,"+ +(h*p>u*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r);else;},arc:function(t,i,a,o,s,l){t=+t,i=+i,l=!!l;var c=(a=+a)*Math.cos(o),u=a*Math.sin(o),h=t+c,f=i+u,p=1^l,d=l?o-s:s-o;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+h+","+f:(Math.abs(this._x1-h)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+h+","+f),a&&(d<0&&(d=d%r+r),d>n?this._+="A"+a+","+a+",0,1,"+p+","+(t-c)+","+(i-u)+"A"+a+","+a+",0,1,"+p+","+(this._x1=h)+","+(this._y1=f):d>1e-6&&(this._+="A"+a+","+a+",0,"+ +(d>=e)+","+p+","+(this._x1=t+a*Math.cos(s))+","+(this._y1=i+a*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],145:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,h,f,p=t._root,d={data:n},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=p,!(p=p[h=u<<1|c]))return i[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),n=0;nt||t>=i||n>e||e>=a;)switch(s=(ep||(o=c.y0)>d||(s=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e1?0:t<-1?u:Math.acos(t)}function d(t){return t>=1?h:t<=-1?-h:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function v(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,u=o-i,h=s-a,f=h*l-u*c;if(!(f*f<1e-12))return[t+(f=(u*(e-a)-h*(t-i))/f)*l,e+f*c]}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,h=(s?a:-a)/c(l*l+u*u),f=h*u,p=-h*l,d=t+f,m=e+p,g=r+f,v=n+p,y=(d+g)/2,x=(m+v)/2,b=g-d,_=v-m,w=b*b+_*_,T=i-a,k=d*v-g*m,M=(_<0?-1:1)*c(o(0,T*T*w-k*k)),A=(k*_-b*M)/w,S=(-k*b-_*M)/w,E=(k*_+b*M)/w,L=(-k*b+_*M)/w,C=A-y,P=S-x,I=E-y,z=L-x;return C*C+P*P>I*I+z*z&&(A=E,S=L),{cx:A,cy:S,x01:-f,y01:-p,x11:A*(i/T-1),y11:S*(i/T-1)}}function w(t){this._context=t}function T(t){return new w(t)}function k(t){return t[0]}function M(t){return t[1]}function A(){var t=k,n=M,i=r(!0),a=null,o=T,s=null;function l(r){var l,c,u,h=r.length,f=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=h;++l)!(l=h;--f)c.point(v[f],y[f]);c.lineEnd(),c.areaEnd()}g&&(v[u]=+t(p,u,r),y[u]=+i(p,u,r),c.point(n?+n(p,u,r):v[u],a?+a(p,u,r):y[u]))}if(d)return c=null,d+""||null}function h(){return A().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return h().x(t).y(i)},u.lineY1=function(){return h().x(t).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function E(t,e){return et?1:e>=t?0:NaN}function L(t){return t}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var C=I(T);function P(t){this._curve=t}function I(t){function e(e){return new P(t(e))}return e._curve=t,e}function z(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function D(){return z(A().curve(C))}function O(){var t=S().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return z(r())},delete t.lineX0,t.lineEndAngle=function(){return z(n())},delete t.lineX1,t.lineInnerRadius=function(){return z(i())},delete t.lineY0,t.lineOuterRadius=function(){return z(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function R(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var F=Array.prototype.slice;function N(t){return t.source}function B(t){return t.target}function j(t){var n=N,i=B,a=k,o=M,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function V(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function q(t,e,r,n,i){var a=R(e,r),o=R(e,r=(r+i)/2),s=R(n,r),l=R(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var H={draw:function(t,e){var r=Math.sqrt(e/u);t.moveTo(r,0),t.arc(0,0,r,0,f)}},G={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Y=Math.sqrt(1/3),Z=2*Y,X={draw:function(t,e){var r=Math.sqrt(e/Z),n=r*Y;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},W=Math.sin(u/10)/Math.sin(7*u/10),K=Math.sin(f/10)*W,J=-Math.cos(f/10)*W,Q={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=K*r,i=J*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=f*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},tt=Math.sqrt(3),et={draw:function(t,e){var r=-Math.sqrt(e/(3*tt));t.moveTo(0,2*r),t.lineTo(-tt*r,-r),t.lineTo(tt*r,-r),t.closePath()}},rt=-.5,nt=Math.sqrt(3)/2,it=1/Math.sqrt(12),at=3*(it/2+1),ot={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,i=r*it,a=n,o=r*it+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(rt*n-nt*i,nt*n+rt*i),t.lineTo(rt*a-nt*o,nt*a+rt*o),t.lineTo(rt*s-nt*l,nt*s+rt*l),t.lineTo(rt*n+nt*i,rt*i-nt*n),t.lineTo(rt*a+nt*o,rt*o-nt*a),t.lineTo(rt*s+nt*l,rt*l-nt*s),t.closePath()}},st=[H,G,X,$,Q,et,ot];function lt(){}function ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ht(t){this._context=t}function ft(t){this._context=t}function pt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function r(t){return 1===e?new ut(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function mt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function gt(t,e){this._context=t,this._k=(1-e)/6}gt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new gt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e){this._context=t,this._k=(1-e)/6}bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new bt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function wt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new Tt(t,e):new gt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new Mt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t,e){this._context=t,this._alpha=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Et=function t(e){function r(t){return e?new St(t,e):new bt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Lt(t){this._context=t}function Ct(t){return t<0?-1:1}function Pt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function It(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function zt(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function Dt(t){this._context=t}function Ot(t){this._context=new Rt(t)}function Rt(t){this._context=t}function Ft(t){this._context=t}function Nt(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Vt(t,e){return t[e]}function qt(t){var e=t.map(Ht);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Ht(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function Gt(t){var e=t.map(Yt);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Yt(t){for(var e,r=0,n=-1,i=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,w=r(0),T=null,k=v,M=y,A=x,S=null;function E(){var r,m,g=+t.apply(this,arguments),v=+o.apply(this,arguments),y=k.apply(this,arguments)-h,x=M.apply(this,arguments)-h,E=n(x-y),L=x>y;if(S||(S=r=e.path()),v1e-12)if(E>f-1e-12)S.moveTo(v*a(y),v*l(y)),S.arc(0,0,v,y,x,!L),g>1e-12&&(S.moveTo(g*a(x),g*l(x)),S.arc(0,0,g,x,y,L));else{var C,P,I=y,z=x,D=y,O=x,R=E,F=E,N=A.apply(this,arguments)/2,B=N>1e-12&&(T?+T.apply(this,arguments):c(g*g+v*v)),j=s(n(v-g)/2,+w.apply(this,arguments)),U=j,V=j;if(B>1e-12){var q=d(B/g*l(N)),H=d(B/v*l(N));(R-=2*q)>1e-12?(D+=q*=L?1:-1,O-=q):(R=0,D=O=(y+x)/2),(F-=2*H)>1e-12?(I+=H*=L?1:-1,z-=H):(F=0,I=z=(y+x)/2)}var G=v*a(I),Y=v*l(I),Z=g*a(O),X=g*l(O);if(j>1e-12){var W,K=v*a(z),J=v*l(z),Q=g*a(D),$=g*l(D);if(E1e-12?V>1e-12?(C=_(Q,$,G,Y,v,V,L),P=_(K,J,Z,X,v,V,L),S.moveTo(C.cx+C.x01,C.cy+C.y01),V1e-12&&R>1e-12?U>1e-12?(C=_(Z,X,K,J,g,-U,L),P=_(G,Y,Q,$,g,-U,L),S.lineTo(C.cx+C.x01,C.cy+C.y01),U0&&(d+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(y-p*b)/d:0;s0?h*c:0)+b,g[l]={data:r[l],index:s,value:h,startAngle:v,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=R,t.radialArea=O,t.radialLine=D,t.stack=function(){var t=r([]),e=Ut,n=jt,i=Vt;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:vt,S:q,u:H,U:G,V:Y,w:Z,W:X,x:null,X:null,y:W,Y:K,Z:J,"%":mt},Ct={a:function(t){return h[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:vt,S:ot,u:st,U:lt,V:ct,w:ut,W:ht,x:null,X:null,y:ft,Y:pt,Z:dt,"%":mt},Pt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Dt(t,a,e,r)},d:M,e:M,f:P,H:S,I:S,j:A,L:C,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:D,S:L,u:g,U:v,V:y,w:m,W:x,x:function(t,e,r){return Dt(t,o,e,r)},X:function(t,e,r){return Dt(t,l,e,r)},y:_,Y:b,Z:w,"%":I};function It(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Dt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Lt.x=It(o,Lt),Lt.X=It(l,Lt),Lt.c=It(a,Lt),Ct.x=It(o,Ct),Ct.X=It(l,Ct),Ct.c=It(a,Ct),{format:function(t){var e=It(t+="",Lt);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Ct);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return h(t.getDate(),e,2)}function R(t,e){return h(t.getHours(),e,2)}function F(t,e){return h(t.getHours()%12||12,e,2)}function N(t,r){return h(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return h(t.getMilliseconds(),e,3)}function j(t,e){return B(t,e)+"000"}function U(t,e){return h(t.getMonth()+1,e,2)}function V(t,e){return h(t.getMinutes(),e,2)}function q(t,e){return h(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return h(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Y(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),h(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Z(t){return t.getDay()}function X(t,r){return h(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function W(t,e){return h(t.getFullYear()%100,e,2)}function K(t,e){return h(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function Q(t,e){return h(t.getUTCDate(),e,2)}function $(t,e){return h(t.getUTCHours(),e,2)}function tt(t,e){return h(t.getUTCHours()%12||12,e,2)}function et(t,r){return h(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return h(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return h(t.getUTCMonth()+1,e,2)}function at(t,e){return h(t.getUTCMinutes(),e,2)}function ot(t,e){return h(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return h(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),h(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ht(t,r){return h(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ft(t,e){return h(t.getUTCFullYear()%100,e,2)}function pt(t,e){return h(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function vt(t){return Math.floor(+t/1e3)}function yt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=xt,t.isoParse=bt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":148}],148:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=l.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),h=u.range,f=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),p=f.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var m=d(0),g=d(1),v=d(2),y=d(3),x=d(4),b=d(5),_=d(6),w=m.range,T=g.range,k=v.range,M=y.range,A=x.range,S=b.range,E=_.range,L=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),C=L.range,P=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));P.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var I=P.range,z=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),D=z.range,O=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=O.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),N=F.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=B(0),U=B(1),V=B(2),q=B(3),H=B(4),G=B(5),Y=B(6),Z=j.range,X=U.range,W=V.range,K=q.range,J=H.range,Q=G.range,$=Y.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=f,t.timeDays=p,t.timeFriday=b,t.timeFridays=S,t.timeHour=u,t.timeHours=h,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=l,t.timeMinutes=c,t.timeMonday=g,t.timeMondays=T,t.timeMonth=L,t.timeMonths=C,t.timeSaturday=_,t.timeSaturdays=E,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=m,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=A,t.timeTuesday=v,t.timeTuesdays=k,t.timeWednesday=y,t.timeWednesdays=M,t.timeWeek=m,t.timeWeeks=w,t.timeYear=P,t.timeYears=I,t.utcDay=F,t.utcDays=N,t.utcFriday=G,t.utcFridays=Q,t.utcHour=O,t.utcHours=R,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=z,t.utcMinutes=D,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Y,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=Z,t.utcThursday=H,t.utcThursdays=J,t.utcTuesday=V,t.utcTuesdays=W,t.utcWednesday=q,t.utcWednesdays=K,t.utcWeek=j,t.utcWeeks=Z,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],149:[function(t,e,r){arguments[4][148][0].apply(r,arguments)},{dup:148}],150:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e,r,n=0,i=0,a=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return s||(u(f),s=c.now()+l)}function f(){s=0}function p(){this._call=this._time=this._next=null}function d(t,e,r){var n=new p;return n.restart(t,e,r),n}function m(){h(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,y(a)}(),s=0}}function v(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function y(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(v,1e3)),n=1,u(g)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],151:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){f=(b=_[u])[0];b[0]=b[1],b[1]=f}return _}},{"incremental-convex-hull":346,uniq:479}],153:[function(t,e,r){(function(t){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:105}],154:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],155:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=e}))}(e);for(var r,i=n(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o=r-1){f=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=a(c[f-1],u[f-1],arguments[f]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],c[f-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":92,"cubic-hermite":133}],161:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||m,null)};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}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left)if(i=u(t,e,r,n.left))return i;if(i=r(n.key,n.value))return i}if(n.right)return u(t,e,r,n.right)}function h(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=h(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 h(t,e,r,n,i.right)}function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(0,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){i=l[h];c[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(h=l.length-1;h>1;--h){var f=l[h-1];i=l[h];if(1===f._color||1===i._color)break;var p=l[h-2];if(p.left===f)if(f.left===i){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=f.right,f._color=1,f.right=p,l[h-2]=f,l[h-1]=i,o(p),o(f),h>=3)(m=l[h-3]).left===p?m.left=f:m.right=f;break}f._color=1,p.right=a(1,d),p._color=0,h-=1}else{if(!(d=p.right)||0!==d._color){if(f.right=i.left,p._color=0,p.left=i.right,i._color=1,i.left=f,i.right=p,l[h-2]=i,l[h-1]=f,o(p),o(f),o(i),h>=3)(m=l[h-3]).left===p?m.left=i:m.right=i;break}f._color=1,p.right=a(1,d),p._color=0,h-=1}else if(f.right===i){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=f.left,f._color=1,f.left=p,l[h-2]=f,l[h-1]=i,o(p),o(f),h>=3)(m=l[h-3]).right===p?m.right=f:m.left=f;break}f._color=1,p.left=a(1,d),p._color=0,h-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;if(f.left=i.right,p._color=0,p.right=i.left,i._color=1,i.right=f,i.left=p,l[h-2]=i,l[h-1]=f,o(p),o(f),o(i),h>=3)(m=l[h-3]).right===p?m.right=i:m.left=i;break}f._color=1,p.left=a(1,d),p._color=0,h-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return h(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),l.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},l.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 f(this,n)},l.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 f(this,n)},l.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 f(this,n)},l.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 f(this,n)},l.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 f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 p=f.prototype;function d(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 m(t,e){return te?1:0}Object.defineProperty(p,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new f(this.tree,this._stack.slice())},p.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var h=e[e.length-2];h.left===r?h.left=null:h.right===r&&(h.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=i(n)).right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=a(0,n));r.right=a(0,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=a(0,n));r.left=a(0,n);continue}var c;n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,"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}),p.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(p,"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}}),p.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]).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])},p.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(p,"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}})},{}],162:[function(t,e,r){e.exports=function(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;o0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var m=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};h.isOpaque=function(){return!0},h.isTransparent=function(){return!1},h.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];h.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),h=u.cubeEdges,f=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=h[M],this.lastCubeProps.axis[M]=f[M];var A=p;for(M=0;M<3;++M)d(p[M],M,this.bounds,h,f);e=this.gl;var S,E=m;for(M=0;M<3;++M)this.backgroundEnable[M]?E[M]=f[M]:E[M]=0;this._background.draw(r,n,i,a,E,this.backgroundColor),this._lines.bind(r,n,i,this);for(M=0;M<3;++M){var L=[0,0,0];f[M]>0?L[M]=a[1][M]:L[M]=a[0][M];for(var C=0;C<2;++C){var P=(M+1+C)%3,I=(M+1+(1^C))%3;this.gridEnable[P]&&this._lines.drawGrid(P,I,this.bounds,L,this.gridColor[P],this.gridWidth[P]*this.pixelRatio)}for(C=0;C<2;++C){P=(M+1+C)%3,I=(M+1+(1^C))%3;this.zeroEnable[I]&&Math.min(a[0][I],a[1][I])<=0&&Math.max(a[0][I],a[1][I])>=0&&this._lines.drawZero(P,I,this.bounds,L,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var z=c(v,A[M].primalMinor),D=c(y,A[M].mirrorMinor),O=this.lineTickLength;for(C=0;C<3;++C){var R=k/r[5*C];z[C]*=O[C]*R,D[C]*=O[C]*R}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,A[M].primalOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,A[M].mirrorOffset,D,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var F,N;function B(t){(N=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?B(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&B(i)}for(M=0;M<3;++M){var U=A[M].primalMinor,V=A[M].mirrorMinor,q=c(x,A[M].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[M]&&(q[C]+=k*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var H=[0,0,0];if(H[M]=1,this.tickEnable[M]){-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,F=1,"auto"===(S=[this.tickAlign[M],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]),N=[0,0,0],j(M,U,V);for(C=0;C<3;++C)q[C]+=k*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],q,this.tickColor[M],H,N,S)}if(this.labelEnable[M]){F=0,N=[0,0,0],this.labels[M].length>4&&(B(M),F=1),"auto"===(S=[this.labelAlign[M],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(C=0;C<3;++C)q[C]+=k*U[C]*this.labelPad[C]/r[5*C];q[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],q,this.labelColor[M],[0,0,0],N,S)}}this._text.unbind()},h.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":164,"./lib/cube.js":165,"./lib/lines.js":166,"./lib/text.js":168,"./lib/ticks.js":169}],164:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[c]=d;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=g}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.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),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":167,"gl-buffer":171,"gl-vao":261}],165:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],f(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((B=R^1<c[N][0]&&(N=B)}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^N)]=R&N;var U=7^N;U===w||U===O?(U=7^F,j[n.log2(N^U)]=U&N):j[n.log2(F^U)]=U&F;var V=g,q=w;for(M=0;M<3;++M)V[M]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),u=n(["precision highp 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 i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":242,glslify:342}],168:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),h=i(t,[{buffer:u,size:3}]),f=o(t);f.attributes.position.location=0;var p=new c(t,f,u,h);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(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}var u=c.prototype,h=[0,0];u.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,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var h=(n||12)/12,f=u.positions,p=u.cells,d=0,m=p.length;d=0;--v){var y=f[g[v]];o.push(h*y[0],-h*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),f[d]=(o.length/3|0)-h[d],c[d]=o.length/3|0;for(var m=0;m=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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 i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:376,"ndarray-ops":371,"typedarray-pool":477}],172:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,f=-1/0,p=null,d=null,m=[],g=1/0,v=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(g=Math.min(g,_),v=!1):v=!0}v||(p=x,d=b),m.push(b)}var w=[s,c,h],T=[l,u,f];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||.5;t.absoluteConeSize&&(M=t.absoluteConeSize*k),a.coneScale=M;y=0;for(var A=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"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),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({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 c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var f=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,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,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=m(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var h=i(t),p=i(t),g=i(t),v=i(t),y=i(t),x=a(t,[{buffer:h,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new f(t,u,s,l,h,p,y,g,v,x,r.traceType||"cone");return b.update(e),b}},{colormap:124,"gl-buffer":171,"gl-mat4/invert":203,"gl-mat4/multiply":205,"gl-shader":242,"gl-texture2d":257,"gl-vao":261,ndarray:376}],174:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:342}],175:[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"}},{}],176:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":175}],177:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(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}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function c(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])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=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=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],a=0;a0)(m=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,m[0],m[1],m[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,m),o+=2+h(i,m,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":179,"gl-buffer":171,"gl-vao":261}],178:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":242,glslify:178}],180:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&h>0&&p&&(f=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;"stencil"in n&&(g=!!n.stencil);return new d(t,e,r,f,h,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(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 d(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 d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=f(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=f(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==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(v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.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+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){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var c,u,h,p,d=t.colorLevels||[0],m=t.colorValues||[0,0,0,1],g=d.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=o[0],h=v[2]=r[r.length-1],p=v[3]=o[o.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=o[0]+(o[1]-o[0])/2,h=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=v[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(h-c),x=1/(p-u),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(f.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),k=a.mallocFloat32(2*w),M=a.mallocUint8(2*w),A=a.mallocUint32(w),S=0,E=l?b-1:b,L=l?_-1:_,C=0;C max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{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 i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":242,glslify:186}],185:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(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 o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new v(e,r,o,s,l,d);return m.update(t),m};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),c=t("ndarray"),u=t("./lib/shaders"),h=u.createShader,f=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(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 m(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 g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(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.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],f=t.position||t.positions;if(f){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],b[r],_[r]),h[1][r]=Math.max(h[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;v+=g[h]}if(Math.abs(v-1)>.001)return null;return[f,s(t,g),g]}},{barycentric:74,"polytope-closest-point/lib/closest_point_2d.js":397}],218:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),c=n(["precision highp 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=n(["precision highp 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}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),p=n(["precision highp 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=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:342}],219:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),h=t("colormap"),f=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),m=t("./lib/closest-point"),g=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_,T,k,M,A,S){this.gl=t,this.pixelRatio=1,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=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function M(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function A(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function P(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,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,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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;ai[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[k],i[M]-i[k]))),y[t]&&T&&(u[1^t]-=A*p*x[t],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),u[1^t]=A*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=A*p*m[t+2],ki[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[k],i[M]-i[k]))),y[t+2]&&T&&(u[1^t]+=A*p*x[t+2],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),m.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),m.bind=(f=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],h=a[o],m=a[o+2]-h,g=i[o],v=i[o+2]-g;p[o]=2*l/u*m/v,f[o]=2*(s-c)/u*m/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=f,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],h=[-1/0],f=l[o];for(e=0;e=0){var m=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(m,e[1],m,e[3],p[d],f[d]):o.drawLine(e[0],m,e[2],m,p[d],f[d])}}for(d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":51,"has-passive-events":344,"mouse-change":363,"mouse-event-offset":364,"mouse-wheel":366,"right-now":421}],228:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["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}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":242,glslify:342}],229:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),h=t("gl-mat4/perspective"),f=t("gl-mat4/ortho"),p=t("./lib/shader"),d=t("is-mobile")({tablet:!0,featureDetect:!0});function m(){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 g(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){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},M=i(r,k);M.enable=!k.disable;var A=t.spikes||{},S=o(r,A),E=[],L=[],C=[],P=[],I=!0,z=!0,D=new Array(16),O=new Array(16),R={view:null,projection:D,model:O,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),N=t.cameraObject||n(e,T),B={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:N,axes:M,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,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:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/B.pixelRatio|0,r.drawingBufferHeight/B.pixelRatio|0];function U(){if(!B._stopped&&B.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*B.pixelRatio),a=0|Math.ceil(n*B.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}B.autoResize&&U();function V(){for(var t=E.length,e=P.length,n=0;n0&&0===C[e-1];)C.pop(),P.pop().dispose()}function q(){if(B.contextLost)return!0;r.isContextLost()&&(B.contextLost=!0,B.mouseListener.enabled=!1,B.selection.object=null,B.oncontextloss&&B.oncontextloss())}window.addEventListener("resize",U),B.update=function(t){B._stopped||(t=t||{},I=!0,z=!0)},B.add=function(t){B._stopped||(t.axes=M,E.push(t),L.push(-1),I=!0,z=!0,V())},B.remove=function(t){if(!B._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),L.pop(),I=!0,z=!0,V())}},B.dispose=function(){if(!B._stopped&&(B._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",q),B.mouseListener.enabled=!1,!B.contextLost)){M.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c 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=n(["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=n(["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"])},{glslify:342}],231:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(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}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),h=new s(t,a,l,c,u);return h.update(e),t.addObject(h),h};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var h=n.getParameter(n.BLEND),f=n.getParameter(n.DITHER);return h&&!this.blend&&n.disable(n.BLEND),f&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),h&&!this.blend&&n.enable(n.BLEND),f&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(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":230,"gl-buffer":171,"gl-shader":242,"typedarray-pool":477}],232:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],p=r[0],d=r[1],m=r[2],g=r[3];(a=c*p+u*d+h*m+f*g)<0&&(a=-a,p=-p,d=-d,m=-m,g=-g);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*h+l*m,t[3]=s*f+l*g,t}},{}],233:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],234:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},f={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return v(t,h)},r.createOrtho=function(t){return v(t,f)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,m)},r.createPickProject=function(t){return v(t,g)}},{"gl-shader":242,glslify:236}],236:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],237:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),c=t("./lib/glyphs"),u=t("./lib/get-simple-string"),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(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 p(t,e,r,n){return f(n,n),f(n,n),f(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function m(t){return!0===t||t>1?1:t}function g(t,e,r,n,i,a,o,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new d(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),f=i(e),p=i(e),d=i(e),m=a(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:f,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new g(e,r,n,o,h,f,p,d,m,s,c,u);return v.update(t),v};var v=g.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=h.slice(),k=[0,0,0],M=[[0,0,0],[0,0,0]];function A(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function L(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,f=r.projection||h,d=e.axesBounds,m=function(t){for(var e=M,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}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=f,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=m,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(a[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var v=T,L=0;L<16;++L)v[L]=0;for(L=0;L<4;++L)v[5*L]=1;v[5*g]=0,i[g]<0?v[12+g]=d[0][g]:v[12+g]=d[1][g],s(v,c,v),l.model=v;var C=(g+1)%3,P=(g+2)%3,I=A(x),z=A(b);I[C]=1,z[P]=1;var D=p(0,0,0,S(_,I)),O=p(0,0,0,S(w,z));if(Math.abs(D[1])>Math.abs(O[1])){var R=D;D=O,O=R,R=I,I=z,z=R;var F=C;C=P,P=F}D[0]<0&&(I[C]=-1),O[1]>0&&(z[P]=-1);var N=0,B=0;for(L=0;L<4;++L)N+=Math.pow(c[4*C+L],2),B+=Math.pow(c[4*P+L],2);I[C]/=Math.sqrt(N),z[P]/=Math.sqrt(B),l.axes[0]=I,l.axes[1]=z,l.fragClipBounds[0]=E(k,m[0],g,-1e8),l.fragClipBounds[1]=E(k,m[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&L(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var a;a=Array.isArray(t)?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},v.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]},v.update=function(t){if("perspective"in(t=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(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=m(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=m(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else{i=[],a=[];for(n=0;n0){var z=0,D=x,O=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),N=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;h[T]=Math.max(h[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(B=I(f,n,l,this.pixelRatio)).mesh,M=B.lines,A=B.bounds;var B,j=B.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n0?1-A[0][0]:Y<0?1+A[1][0]:1,Z*=Z>0?1-A[0][1]:Z<0?1+A[1][1]:1],W=k.cells||[],K=k.positions||[];for(T=0;T0){var v=r*u;o.drawBox(h-v,f-v,p+v,f+v,a),o.drawBox(h-v,d-v,p+v,d+v,a),o.drawBox(h-v,f-v,h+v,d+v,a),o.drawBox(p-v,f-v,p+v,d+v,a)}}}},s.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()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":238,"gl-buffer":171,"gl-shader":242}],241:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(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)}}var c=l.prototype;Object.defineProperty(c,"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){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),M=0;M=0;)A+=1;_[y]=A}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,b,_);for(var t=0;t=0){if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(t,e,p[0],i,d,a,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d;if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);l(t,e,p,i,d,a,h)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"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}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+g+"fv"](s[u],!1,h);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((g=v.charCodeAt(v.length-1)-48)<2||g>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+g+"iv"](s[u],h);break;case"v":t["uniform"+g+"fv"](s[u],h);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e,n){if("object"==typeof n){var c=u(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(h=n,function(t,e,r){return t.getUniform(e.program,r[h])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var h}function u(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:253}],253:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],254:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(f[T],p[T],p[k],p[k],f[k],f[T]),h.push(y,v,v,v,y,y),d.push(m,g,g,g,m,m);var M=c.length;u.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var A=f;f=p,p=A;var S=y;y=v,v=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(t,r,a,o)})),h=[],f=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nh-1||y>f-1||x>p-1)return n.create();var b,_,w,T,k,M,A=a[0][d],S=a[0][v],E=a[1][m],L=a[1][y],C=a[2][g],P=(o-A)/(S-A),I=(c-E)/(L-E),z=(u-C)/(a[2][x]-C);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,v=h-1-v),r.reversedY&&(m=f-1-m,y=f-1-y),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,M=x,w=m*p,T=y*p,b=d*p*f,_=v*p*f;break;case 4:k=g,M=x,b=d*p,_=v*p,w=m*p*h,T=y*p*h;break;case 3:w=m,T=y,k=g*f,M=x*f,b=d*f*p,_=v*f*p;break;case 2:w=m,T=y,b=d*f,_=v*f,k=g*f*h,M=x*f*h;break;case 1:b=d,_=v,k=g*h,M=x*h,w=m*h*p,T=y*h*p;break;default:b=d,_=v,w=m*h,T=y*h,k=g*h*f,M=x*h*f}var D=i[b+w+k],O=i[b+w+M],R=i[b+T+k],F=i[b+T+M],N=i[_+w+k],B=i[_+w+M],j=i[_+T+k],U=i[_+T+M],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,D,N,P),n.lerp(q,O,B,P),n.lerp(H,R,j,P),n.lerp(G,F,U,P);var Y=n.create(),Z=n.create();n.lerp(Y,V,H,I),n.lerp(Z,q,G,I);var X=n.create();return n.lerp(X,Y,Z,z),X}(e,t,p)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},k=10*n.distance(e[0],e[1])/i,M=k*k,A=1,S=0,E=r.length;E>1&&(A=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lS&&(S=F),O.push(F),g.push({points:P,velocities:I,divergences:O});for(var N=0;N<100*i&&P.lengthM&&n.scale(B,B,k/Math.sqrt(j)),n.add(B,B,C),z=d(B),n.squaredDistance(D,B)-M>-1e-4*M){P.push(B),D=B,I.push(z);R=m(B,z),F=n.length(R);isFinite(F)&&F>S&&(S=F),O.push(F)}C=B}}var U=o(g,t.colormap,S,A);return h?U.tubeScale=h:(0===S&&(S=1),U.tubeScale=.5*u*A/S),U};var u=t("./lib/shaders"),h=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return h(t,e,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":252,"gl-cone3d":172,"gl-vec3":280,"gl-vec4":316}],255:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,a,o,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,a,l,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,s,o,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,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":242,glslify:342}],256:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),h=i(e),f=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new A(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,f,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||"jet",g.update(v),g};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),h=t("ndarray"),f=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),m=t("binary-search-bounds"),g=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[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 M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function A(t,e,r,n,i,a,o,l,c,u,f,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.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.pixelRatio=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}var S=A.prototype;S.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],L={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||E,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=L.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],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var P={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=w.slice(),z=[1,0,0,0,1,0,0,0,1];function D(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-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=z,n.vertexColor=this.vertexColor;var s=I;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=C(n,this);if(u.showSurface){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=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(h.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var p=i+u,d=s+f,g=h*(f?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*g;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=m.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.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))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=R(t.contourWidth,Number)),"showContour"in t&&(this.showContour=R(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=R(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=N(t.contourColor)),"contourProject"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=N(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));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 i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(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&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(v=0;v<2;++v)if(c.shape[v]!==a[v])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=h(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=h(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;oi||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 p(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}var d=p.prototype;function m(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 g(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 v(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 o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}function y(t,e,r,n,i,a){var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new p(t,o,r,n,i,a)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=m(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var u,f,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];f=a.malloc(v,r);var x=n(f,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):h(x,e),u=f.subarray(0,v)}var b=g(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||a.free(f),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.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},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.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)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,u){var f=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,g=0,v=m(p,u.stride.slice());"float32"===f?d=t.FLOAT:"float64"===f?(d=t.FLOAT,v=!1,f="float32"):"uint8"===f?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,f="uint8");if(2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s);if(g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?h(_,u):i.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:376,"ndarray-ops":371,"typedarray-pool":477}],258:[function(t,e,r){"use strict";e.exports=function(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;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":273,"./fromValues":279,"./normalize":290}],264:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],265:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],266:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],267:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],268:[function(t,e,r){e.exports=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}},{}],269:[function(t,e,r){e.exports=t("./distance")},{"./distance":270}],270:[function(t,e,r){e.exports=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)}},{}],271:[function(t,e,r){e.exports=t("./divide")},{"./divide":272}],272:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],273:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],274:[function(t,e,r){e.exports=1e-6},{}],275:[function(t,e,r){e.exports=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*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":274}],276:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],277:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],278:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],291:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],292:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},{}],293:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},{}],294:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},{}],295:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],296:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],297:[function(t,e,r){e.exports=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}},{}],298:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],299:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":301}],300:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":302}],301:[function(t,e,r){e.exports=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}},{}],302:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],303:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":304}],304:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],305:[function(t,e,r){e.exports=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}},{}],306:[function(t,e,r){e.exports=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}},{}],307:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t}},{}],308:[function(t,e,r){e.exports=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}},{}],309:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],310:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],311:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],312:[function(t,e,r){e.exports=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)}},{}],313:[function(t,e,r){e.exports=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}},{}],314:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],315:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],316:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":308,"./clone":309,"./copy":310,"./create":311,"./distance":312,"./divide":313,"./dot":314,"./fromValues":315,"./inverse":317,"./length":318,"./lerp":319,"./max":320,"./min":321,"./multiply":322,"./negate":323,"./normalize":324,"./random":325,"./scale":326,"./scaleAndAdd":327,"./set":328,"./squaredDistance":329,"./squaredLength":330,"./subtract":331,"./transformMat4":332,"./transformQuat":333}],317:[function(t,e,r){e.exports=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}},{}],318:[function(t,e,r){e.exports=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)}},{}],319:[function(t,e,r){e.exports=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}},{}],320:[function(t,e,r){e.exports=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}},{}],321:[function(t,e,r){e.exports=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}},{}],322:[function(t,e,r){e.exports=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}},{}],323:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],324:[function(t,e,r){e.exports=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;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],325:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":324,"./scale":326}],326:[function(t,e,r){e.exports=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}},{}],327:[function(t,e,r){e.exports=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}},{}],328:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],329:[function(t,e,r){e.exports=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}},{}],330:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],331:[function(t,e,r){e.exports=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}},{}],332:[function(t,e,r){e.exports=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}},{}],333:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t[3]=e[3],t}},{}],334:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return M(r),v+=r.length,(p=p.slice(r.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(M(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function z(){return"."===e||/[eE]/.test(e)?(p.push(e),f=5,r=e,u+1):"x"===e&&1===p.length&&"0"===p[0]?(f=11,p.push(e),r=e,u+1):/[^\d]/.test(e)?(M(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function D(){return"f"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(M(p.join("")),f=999,u):(p.push(e),r=e,u+1)}function O(){if(/[^\d\w_]/.test(e)){var t=p.join("");return f=k[t]?8:T[t]?7:6,M(p.join("")),f=999,u}return p.push(e),r=e,u+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":337,"./lib/builtins-300es":336,"./lib/literals":339,"./lib/literals-300es":338,"./lib/operators":340}],336:[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":337}],337:[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"]},{}],338:[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","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":339}],339:[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","uint","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"]},{}],340:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],341:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":335}],342:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],343:[function(t,e,r){(function(r){(function(){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":350}],344:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":350}],345:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=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=u):(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))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):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+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}},{}],346:[function(t,e,r){"use strict";e.exports=function(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 o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),f=h.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var v=new a(d,new Array(i+1),!0);f[u]=v,p[u]=v}p[i+1]=h;for(u=0;u<=i;++u){d=f[u].vertices;var y=f[u].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)y[m]=h;else for(var b=0;b<=i;++b)f[b].vertices.indexOf(x)<0&&(y[m]=f[b])}}var _=new c(i,o,p),w=!!e;for(u=i+1;u0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var p=this.orient();if(a[u]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var p=(e=h.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var v=d[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var M=_.indexOf(e);if(!(M<0)){_[M]=k,T[m]=v,w[g]=-1,T[g]=e,d[g]=k,k.flip();for(b=0;b<=n;++b){var A=w[b];if(!(A<0||A===r)){for(var S=new Array(n-1),E=0,L=0;L<=n;++L){var C=w[L];C<0||L===b||(S[E++]=C)}f.push(new o(S,k,b))}}}}}}f.sort(s);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":427,"simplicial-complex":438}],347:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],348:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(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}e.exports=function(t){if(!t||0===t.length)return new v(null);return new v(g(t))};var a=i.prototype;function o(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 s(t,e){var r=g(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function f(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return h(this.rightPoints,t,e)}return f(this.leftPoints,e)},a.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?h(this.rightPoints,t,r):f(this.leftPoints,r)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":92}],349:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r + * @license MIT + */ +e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],352:[function(t,e,r){"use strict";e.exports=a,e.exports.isMobile=a,e.exports.default=a;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function a(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?i.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],353:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],354:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],355:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],356:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=i;else t=i}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}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){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function y(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}var b={};function _(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var A=null;function S(t){if(null==A){var e=t.navigator?t.navigator.userAgent:null;A=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return A}function E(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,C,P,I,z=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),D=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,O=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:z,frame:function(t){var e=D(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=self.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==C&&(C=self.matchMedia("(prefers-reduced-motion: reduce)")),C.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},N={supported:!1,testSupport:function(t){if(B||!I)return;j?U(t):P=t}},B=!1,j=!1;function U(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,I),t.isContextLost())return;N.supported=!0}catch(t){}t.deleteTexture(e),B=!0}self.document&&((I=self.document.createElement("img")).onload=function(){P&&U(P),P=null,j=!0},I.onerror=function(){B=!0,P=null},I.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01";var q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var i=X(t);return H(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,W(i))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=X(t),n=R.devicePixelRatio>=2||512===e?"@2x":"",i=N.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){_("Unable to write to LocalStorage")}},J.prototype.processRequests=function(t){},J.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var a=X(F.EVENTS_URL);a.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?u(o,e):o,l={url:W(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(l,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},J.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=p()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(J),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=K(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=p(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(J)),rt=et.postTurnstileEvent.bind(et),nt=new tt,it=nt.postMapLoadEvent.bind(nt),at=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=M(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return _(t.message)}))}))}}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ut(t,e){if(st(),!Q)return e(null);var r=ct(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}var ht,ft=1/0;function pt(){return null==ht&&(ht=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt=function(t){function e(e,r,n){401===r&&Y(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),gt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function vt(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:gt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&Y(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&_(r),n&&a)return c(n);var l=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&<(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?ut(i,l):l(null,null),{cancel:function(){o=!0,a||n.abort()}}}var yt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(gt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return vt(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return yt(u(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return yt(u(t,{method:"POST"}),e)};var _t,wt;_t=[],wt=0;var Tt=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),wt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}wt++;var n=!1,i=function(){if(!n)for(n=!0,wt--;_t.length&&wt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Et.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Lt={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ct=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.key,r=t.value;return r?[new Ct(e,r,"constants have been deprecated as of v8")]:[]}function It(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Wt=[Ft,Nt,Bt,jt,Ut,Gt,Vt,Zt(qt),Yt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Wt;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(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}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),f=1;switch(u){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 p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),g=m<=.5?m*(d+1):m+d-m*d,v=2*m-g;return[n(255*s(v,g,p+1/3)),n(255*s(v,g,p)),n(255*s(v,g,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},te.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=he[s],n++}else a=qt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Zt(a,o)}else r=he[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Gt,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Nt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Zt(Bt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Ut)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[a],1,qt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new pe(n)},pe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Yt?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":jt,"to-color":Ut,"to-number":Nt,"to-string":Bt},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=me[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ae(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Te(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*8192),Math.round(i*a*8192)]}function ke(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Me(t,e){for(var r,n,i,a,o,s,l,c=!1,u=0,h=e.length;u0&&h<0||u<0&&h>0}function Ee(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}_e(e,t)}function De(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ue("Input is not a number.");o=s-1}return 0}Ue.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new fe(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof ce)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof xe&&"error"===e.name)return!1;if(e instanceof be)return!1;if(e instanceof Re)return!1;var r=e instanceof ge||e instanceof fe,n=!0;if(e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ce})),!n)return!1;return Fe(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new ye;try{a=new ce(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,i,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ot(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new qe(i,r,n)},qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ve(e,n)].evaluate(t)},qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ge=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new te(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return He(t,e[n],r)}))}}),Ye=6/29,Ze=3*Ye*Ye,Xe=Math.PI/180,We=180/Math.PI;function Ke(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ze+4/29}function Je(t){return t>Ye?t*t*t:Ze*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),n=$e(t.b),i=Ke((.4124564*e+.3575761*r+.1804375*n)/.95047),a=Ke((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-Ke((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Je(e),r=.95047*Je(r),n=1.08883*Je(n),new te(Qe(3.2404542*r-1.5371385*e-.4985314*n),Qe(-.969266*r+1.8760108*e+.041556*n),Qe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function rr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ir={forward:function(t){var e=tr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*We;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},ar=Object.freeze({__proto__:null,lab:nr,hcl:ir}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Nt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=e.parse(f,d,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new or(c,r,n,i,l):e.error("Type "+Xt(c)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Ve(e,n),o=e[a],s=e[a+1],l=or.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?Ge[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?ir.reverse(ir.interpolate(ir.forward(c),ir.forward(u),l)):nr.reverse(nr.interpolate(nr.forward(c),nr.forward(u),l))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var hr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};hr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);return r&&n?Jt(r.type,[jt,Bt,Nt,Ft,qt])?new hr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead"):null},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");return r.indexOf(e)>=0},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},hr.prototype.outputDefined=function(){return!0},hr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fr=function(t,e,r){this.type=Nt,this.needle=t,this.haystack=e,this.fromIndex=r};fr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);if(!r||!n)return null;if(!Jt(r.type,[jt,Bt,Nt,Ft,qt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Nt);return i?new fr(r,n,i):null}return new fr(r,n)},fr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},fr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},fr.prototype.outputDefined=function(){return!1},fr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};pr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,se(f)))return null}else r=se(f);if(void 0!==i[String(f)])return c.error("Branch labels must be unique.");i[String(f)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,qt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,a,m):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,Nt);if(!r||!n)return null;if(!Jt(r.type,[Zt(qt),Bt,qt]))return e.error("Expected first argument to be of type array or string, but found "+Xt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Nt);return i?new mr(r.type,r,n,i):null}return new mr(r.type,r,n)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Xt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xr=yr("==",(function(t,e,r){return e===r}),vr),br=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!vr(0,e,r,n)})),_r=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Tr=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),kr=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Mr=function(t,e,r,n,i){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Mr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Nt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Bt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Bt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Nt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Nt))?null:new Mr(r,i,a,o,s)},Mr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ar=function(t){this.type=Nt,this.input=t};Ar.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Xt(r.type)+" instead."):new Ar(r):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Xt(se(e))+" instead.")},Ar.prototype.eachChild=function(t){t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":xr,"!=":br,">":wr,"<":_r,">=":kr,"<=":Tr,array:fe,at:ur,boolean:fe,case:dr,coalesce:lr,collator:be,format:pe,image:de,in:hr,"index-of":fr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Ar,let:cr,literal:ce,match:pr,number:fe,"number-format":Mr,object:fe,slice:mr,step:qe,string:fe,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:je,within:Re};function Er(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=ae(r,n,i,o);if(s)throw new ue(s);return new te(r/255*o,n/255*o,i/255*o,o)}function Lr(t,e){return t in e}function Cr(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Ir(t){return{result:"success",value:t}}function zr(t){return{result:"error",value:t}}function Dr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Nr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Br(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return jr(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ve(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Fr(r))return jr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Ve(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Ge[e.type]||Br;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=ar[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function Hr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}xe.register(Sr,{error:[{kind:"error"},[Bt],function(t,e){var r=e[0];throw new ue(r.evaluate(t))}],typeof:[Bt,[qt],function(t,e){return Xt(se(e[0].evaluate(t)))}],"to-rgba":[Zt(Nt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Nt,Nt,Nt],Er],rgba:[Ut,[Nt,Nt,Nt,Nt],Er],has:{type:jt,overloads:[[[Bt],function(t,e){return Lr(e[0].evaluate(t),t.properties())}],[[Bt,Vt],function(t,e){var r=e[0],n=e[1];return Lr(r.evaluate(t),n.evaluate(t))}]]},get:{type:qt,overloads:[[[Bt],function(t,e){return Cr(e[0].evaluate(t),t.properties())}],[[Bt,Vt],function(t,e){var r=e[0],n=e[1];return Cr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[qt,[Bt],function(t,e){return Cr(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Nt,[],function(t){return t.globals.zoom}],"heatmap-density":[Nt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Nt,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Nt,Pr(Nt),function(t,e){for(var r=0,n=0,i=e;n":[jt,[Bt,qt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[jt,[qt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[jt,[Bt,qt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[jt,[Bt,qt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[jt,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[Zt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Zt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Bt,Zt(qt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Bt,Zt(qt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Pr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Zr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Bt,number:Nt,enum:Bt,boolean:jt,formatted:Gt,resolvedImage:Yt};if("array"===t.type)return Zt(e[t.value]||qt,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ir(new Gr(n,e)):zr(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ne(e.expression)};Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Xr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ne(e.expression),this.interpolationType=n};function Kr(t,e){if("error"===(t=Zr(t,e)).result)return t;var r=t.value.expression,n=Fe(r);if(!n&&!Dr(e))return zr([new Ot("","data expressions not supported")]);var i=Be(r,["zoom"]);if(!i&&!Or(e))return zr([new Ot("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof cr)r=t(e.result);else if(e instanceof lr)for(var n=0,i=e.args;nn.maximum?[new Ct(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function en(t){var e,r,n,i=t.valueSpec,a=zt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),u=Qr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Ct(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat($r({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Fr(r)&&0===r.length&&e.push(new Ct(t.key,r,"array must have at least one stop"));return e},default:function(t){return kn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Ct(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new Ct(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Rr(t.valueSpec)&&u.push(new Ct(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Dr(t.valueSpec)?u.push(new Ct(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&u.push(new Ct(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new Ct(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Fr(a))return[new Ct(s,a,"array expected, "+Fr(a)+" found")];if(2!==a.length)return[new Ct(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Fr(a[0]))return[new Ct(s,a,"object expected, "+Fr(a[0])+" found")];if(void 0===a[0].zoom)return[new Ct(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Ct(s,a,"object stop key must have value")];if(n&&n>zt(a[0].zoom))return[new Ct(s,a[0].zoom,"stop zoom values must appear in ascending order")];zt(a[0].zoom)!==n&&(n=zt(a[0].zoom),r=void 0,o={}),e=e.concat(Qr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Yr(Dt(a[1]))?e.concat([new Ct(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(kn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Fr(t.value),l=zt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Ct(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ct(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Dr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ct(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function cn(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?pn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cn))):"all"===r?["all"].concat(t.slice(1).map(cn)):"none"===r?["all"].concat(t.slice(1).map(cn).map(pn)):"in"===r?hn(t[1],t.slice(2)):"!in"===r?pn(hn(t[1],t.slice(2))):"has"===r?fn(t[1]):"!has"===r?pn(fn(t[1])):"within"!==r||t}function un(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function hn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ln)]]:["filter-in-small",t,["literal",e]]}}function fn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function dn(t){return an(Dt(t.value))?rn(It({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Fr(r))return[new Ct(n,r,"array expected, "+Fr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new Ct(n,r,"filter array must have at least 1 element")];switch(o=o.concat(nn({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),zt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===zt(r[1])&&o.push(new Ct(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Ct(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Fr(r[1]))&&o.push(new Ct(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=u[p+0]&&n>=u[p+1])?(o[f]=!0,a.push(c[f])):o[f]=!1}}},On.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=l;f<=u;f++)for(var p=c;p<=h;p++){var d=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},On.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var h=t[u];c[u]=Nn[l].shallow.indexOf(u)>=0?h:qn(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function Hn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Hn);if("object"==typeof t){var e=t.$name||"Object",r=Nn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:Hn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Yn["CJK Compatibility Ideographs"](t)||(!!Yn["CJK Compatibility"](t)||(!!Yn["CJK Radicals Supplement"](t)||(!!Yn["CJK Strokes"](t)||(!(!Yn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Yn["CJK Unified Ideographs Extension A"](t)||(!!Yn["CJK Unified Ideographs"](t)||(!!Yn["Enclosed CJK Letters and Months"](t)||(!!Yn["Hangul Compatibility Jamo"](t)||(!!Yn["Hangul Jamo Extended-A"](t)||(!!Yn["Hangul Jamo Extended-B"](t)||(!!Yn["Hangul Jamo"](t)||(!!Yn["Hangul Syllables"](t)||(!!Yn.Hiragana(t)||(!!Yn["Ideographic Description Characters"](t)||(!!Yn.Kanbun(t)||(!!Yn["Kangxi Radicals"](t)||(!!Yn["Katakana Phonetic Extensions"](t)||(!(!Yn.Katakana(t)||12540===t)||(!(!Yn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Yn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Yn["Unified Canadian Aboriginal Syllabics"](t)||(!!Yn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Yn["Vertical Forms"](t)||(!!Yn["Yijing Hexagram Symbols"](t)||(!!Yn["Yi Syllables"](t)||!!Yn["Yi Radicals"](t))))))))))))))))))))))))))))))}function Kn(t){return!(Wn(t)||function(t){return!(!Yn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Yn["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!Yn["Letterlike Symbols"](t)||(!!Yn["Number Forms"](t)||(!(!Yn["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!Yn["Control Pictures"](t)||9251===t)||(!!Yn["Optical Character Recognition"](t)||(!!Yn["Enclosed Alphanumerics"](t)||(!!Yn["Geometric Shapes"](t)||(!(!Yn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Yn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Yn["CJK Symbols and Punctuation"](t)||(!!Yn.Katakana(t)||(!!Yn["Private Use Area"](t)||(!!Yn["CJK Compatibility Forms"](t)||(!!Yn["Small Form Variants"](t)||(!!Yn["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function Jn(t){return t>=1424&&t<=2303||Yn["Arabic Presentation Forms-A"](t)||Yn["Arabic Presentation Forms-B"](t)}function Qn(t,e){return!(!e&&Jn(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Yn.Khmer(t))}function $n(t){for(var e=0,r=t;e-1&&(ai=ni),ii&&ii(t)};function li(){ci.fire(new At("pluginStateChange",{pluginStatus:ai,pluginURL:oi}))}var ci=new Et,ui=function(){return ai},hi=function(){if(ai!==ti||!oi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ai=ei,li(),oi&&xt({url:oi},(function(t){t?si(t):(ai=ri,li())}))},fi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ai===ri||null!=fi.applyArabicShaping},isLoading:function(){return ai===ei},setState:function(t){ai=t.pluginStatus,oi=t.pluginURL},isParsed:function(){return null!=fi.applyArabicShaping&&null!=fi.processBidirectionalText&&null!=fi.processStyledBidirectionalText},getPluginURL:function(){return oi}},pi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Gn,this.transition={})};pi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var di=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Nr(t))return new Jr(t,e);if(Yr(t)){var r=Kr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},di.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var mi=function(t){this.property=t,this.value=new di(t,void 0)};mi.prototype.transitioned=function(t,e){return new vi(this.property,this.value,e,u({},t.transition,this.transition),t.now)},mi.prototype.untransitioned=function(){return new vi(this.property,this.value,null,{},0)};var gi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};gi.prototype.getValue=function(t){return x(this._values[t].value.value)},gi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new mi(this._values[t].property)),this._values[t].value=new di(this._values[t].property,null===e?void 0:x(e))},gi.prototype.getTransition=function(t){return x(this._values[t].transition)},gi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new mi(this._values[t].property)),this._values[t].transition=x(e)||void 0},gi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var yi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};yi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new _i(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ti),Mi=function(t){this.specification=t};Mi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new pi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new pi(Math.floor(e.zoom),e)),t.expression.evaluate(new pi(Math.floor(e.zoom+1),e)),e)}},Mi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Mi.prototype.interpolate=function(t){return t};var Ai=function(t){this.specification=t};Ai.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Ai.prototype.interpolate=function(){return!1};var Si=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new di(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new mi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Bn("DataDrivenProperty",Ti),Bn("DataConstantProperty",wi),Bn("CrossFadedDataDrivenProperty",ki),Bn("CrossFadedProperty",Mi),Bn("ColorRampProperty",Ai);var Ei=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new xi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new gi(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _i(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(In,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Pn,n,t,e,r))return!1}if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),y(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&zn(this,t.call(Ln,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof bi&&Dr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Et),Li={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ci=function(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},Pi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ii(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,a=(i=t.type,Li[i].BYTES_PER_ELEMENT),o=r=zi(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}})),size:zi(r,Math.max(n,e)),alignment:e}}function zi(t,e){return Math.ceil(t/e)*e}Pi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Pi.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Pi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Pi.prototype.clear=function(){this.length=0},Pi.prototype.resize=function(t){this.reserve(t),this.length=t},Pi.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Pi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Pi);Di.prototype.bytesPerElement=4,Bn("StructArrayLayout2i4",Di);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Pi);Oi.prototype.bytesPerElement=8,Bn("StructArrayLayout4i8",Oi);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Pi);Ri.prototype.bytesPerElement=12,Bn("StructArrayLayout2i4i12",Ri);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Pi);Fi.prototype.bytesPerElement=8,Bn("StructArrayLayout2i4ub8",Fi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var h=9*t,f=18*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint8[f+16]=c,this.uint8[f+17]=u,t},e}(Pi);Ni.prototype.bytesPerElement=18,Bn("StructArrayLayout8ui2ub18",Ni);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t},e}(Pi);Bi.prototype.bytesPerElement=24,Bn("StructArrayLayout4i4ui4i24",Bi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Pi);ji.prototype.bytesPerElement=12,Bn("StructArrayLayout3f12",ji);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Pi);Ui.prototype.bytesPerElement=4,Bn("StructArrayLayout1ul4",Ui);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Pi);Vi.prototype.bytesPerElement=20,Bn("StructArrayLayout6i1ul2ui20",Vi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Pi);qi.prototype.bytesPerElement=12,Bn("StructArrayLayout2i2i2i12",qi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(Pi);Hi.prototype.bytesPerElement=16,Bn("StructArrayLayout2f1f2i16",Hi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Pi);Gi.prototype.bytesPerElement=12,Bn("StructArrayLayout2ub2f12",Gi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Pi);Yi.prototype.bytesPerElement=6,Bn("StructArrayLayout3ui6",Yi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v){var y=24*t,x=12*t,b=48*t;return this.int16[y+0]=e,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[b+36]=p,this.uint8[b+37]=d,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[y+22]=v,t},e}(Pi);Zi.prototype.bytesPerElement=48,Bn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S,E){var L=34*t,C=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=i,this.int16[L+4]=a,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=c,this.uint16[L+9]=u,this.uint16[L+10]=h,this.uint16[L+11]=f,this.uint16[L+12]=p,this.uint16[L+13]=d,this.uint16[L+14]=m,this.uint16[L+15]=g,this.uint16[L+16]=v,this.uint16[L+17]=y,this.uint16[L+18]=x,this.uint16[L+19]=b,this.uint16[L+20]=_,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[C+12]=k,this.float32[C+13]=M,this.float32[C+14]=A,this.float32[C+15]=S,this.float32[C+16]=E,t},e}(Pi);Xi.prototype.bytesPerElement=68,Bn("StructArrayLayout8i15ui1ul4f68",Xi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Pi);Wi.prototype.bytesPerElement=4,Bn("StructArrayLayout1f4",Wi);var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Pi);Ki.prototype.bytesPerElement=6,Bn("StructArrayLayout3i6",Ki);var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(Pi);Ji.prototype.bytesPerElement=8,Bn("StructArrayLayout1ul2ui8",Ji);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Pi);Qi.prototype.bytesPerElement=4,Bn("StructArrayLayout2ui4",Qi);var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Pi);$i.prototype.bytesPerElement=2,Bn("StructArrayLayout1ui2",$i);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Pi);ta.prototype.bytesPerElement=8,Bn("StructArrayLayout2f8",ta);var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Pi);ea.prototype.bytesPerElement=16,Bn("StructArrayLayout4f16",ea);var ra=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ci);ra.prototype.size=20;var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ra(this,t)},e}(Vi);Bn("CollisionBoxArray",na);var ia=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ci);ia.prototype.size=48;var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ia(this,t)},e}(Zi);Bn("PlacedSymbolArray",aa);var oa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ci);oa.prototype.size=68;var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new oa(this,t)},e}(Xi);Bn("SymbolInstanceArray",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Wi);Bn("GlyphOffsetArray",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ki);Bn("SymbolLineVertexArray",ca);var ua=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ci);ua.prototype.size=8;var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ua(this,t)},e}(Ji);Bn("FeatureIndexArray",ha);var fa=Ii([{name:"a_pos",components:2,type:"Int16"}],4).members,pa=function(t){void 0===t&&(t=[]),this.segments=t};function da(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}pa.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>pa.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+pa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>pa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},pa.prototype.get=function(){return this.segments},pa.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),va=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ya=ga,xa=ga,ba=va;ya.murmur3=xa,ya.murmur2=ba;var _a=function(){this.ids=[],this.positions=[],this.indexed=!1};_a.prototype.add=function(t,e,r,n){this.ids.push(Ta(t)),this.positions.push(e,r,n)},_a.prototype.getPositions=function(t){for(var e=Ta(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},_a.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],o=n-1,s=i+1;;){do{o++}while(e[o]a);if(o>=s)break;ka(e,o,s),ka(r,3*o,3*s),ka(r,3*o+1,3*s+1),ka(r,3*o+2,3*s+2)}s-nGa.max||o.yGa.max)&&(_("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Ga.min,Ga.max),o.y=l(o.y,Ga.min,Ga.max))}return r}function Za(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Xa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Di,this.indexArray=new Yi,this.segments=new pa,this.programConfigurations=new Ua(fa,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Wa(t,e){for(var r=0;r1){if($a(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function no(t,e){for(var r,n,i,a=!1,o=0;oe.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 io(t,e){for(var r=!1,n=0,i=t.length-1;ne.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}function ao(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=w(t,e,r[0]);return a!==w(t,e,r[1])||a!==w(t,e,r[2])||a!==w(t,e,r[3])}function oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function so(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function lo(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=8192||u<0||u>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;Za(this.layoutVertexArray,c,u,-1,-1),Za(this.layoutVertexArray,c,u,1,-1),Za(this.layoutVertexArray,c,u,1,1),Za(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Bn("CircleBucket",Xa,{omit:["layers"]});var co=new Si({"circle-sort-key":new Ti(Lt.layout_circle["circle-sort-key"])}),uo={paint:new Si({"circle-radius":new Ti(Lt.paint_circle["circle-radius"]),"circle-color":new Ti(Lt.paint_circle["circle-color"]),"circle-blur":new Ti(Lt.paint_circle["circle-blur"]),"circle-opacity":new Ti(Lt.paint_circle["circle-opacity"]),"circle-translate":new wi(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new wi(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wi(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wi(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ti(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ti(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ti(Lt.paint_circle["circle-stroke-opacity"])}),layout:co},ho="undefined"!=typeof Float32Array?Float32Array:Array;function fo(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}function po(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*f+w*g,t[2]=x*a+b*c+_*p+w*v,t[3]=x*o+b*u+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*m,t[5]=x*i+b*l+_*f+w*g,t[6]=x*a+b*c+_*p+w*v,t[7]=x*o+b*u+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*m,t[9]=x*i+b*l+_*f+w*g,t[10]=x*a+b*c+_*p+w*v,t[11]=x*o+b*u+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*m,t[13]=x*i+b*l+_*f+w*g,t[14]=x*a+b*c+_*p+w*v,t[15]=x*o+b*u+_*d+w*y,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var mo=po;var go,vo,yo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};go=new ho(3),ho!=Float32Array&&(go[0]=0,go[1]=0,go[2]=0),vo=go;function xo(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(){var t=function(){var t=new ho(4);return ho!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var bo=function(t){var e=t[0],r=t[1];return e*e+r*r},_o=(function(){var t=function(){var t=new ho(2);return ho!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),function(t){function e(e){t.call(this,e,uo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xa(t)},e.prototype.queryRadius=function(t){var e=t;return oo("circle-radius",this,e)+oo("circle-stroke-width",this,e)+so(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return wo(t,e)}))}(l,s),f=u?c*o:c,p=0,d=n;pt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return jo(f,p,r,n,i,c),p}function No(t,e,r,n,i){var a,o;if(i===ls(t,e,r,n)>0)for(a=e;a=e;a-=n)o=as(a,t[a],t[a+1],o);return o&&$o(o,o.next)&&(os(o),o=o.next),o}function Bo(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!$o(n,n.next)&&0!==Qo(n.prev,n,n.next))n=n.next;else{if(os(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Xo(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,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Vo(t,n,i,a):Uo(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),os(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?jo(t=qo(Bo(t),e,r),e,r,n,i,a,2):2===o&&Ho(t,e,r,n,i,a):jo(Bo(t),e,r,n,i,a,1);break}}}function Uo(t){var e=t.prev,r=t,n=t.next;if(Qo(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ko(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Qo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Vo(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Qo(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Xo(s,l,e,r,n),f=Xo(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Qo(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Qo(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&Ko(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function qo(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!$o(i,a)&&ts(i,n,n.next,a)&&ns(i,a)&&ns(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),os(n),os(n.next),n=t=a),n=n.next}while(n!==t);return Bo(n)}function Ho(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Jo(o,s)){var l=is(o,s);return o=Bo(o,o.next),l=Bo(l,l.next),jo(o,e,r,n,i,a),void jo(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Go(t,e){return t.x-e.x}function Yo(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.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.x&&n.x>=u&&i!==n.x&&Ko(ar.x||n.x===r.x&&Zo(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e)){var r=is(e,t);Bo(e,e.next),Bo(r,r.next)}}function Zo(t,e){return Qo(t.prev,t,e.prev)<0&&Qo(e.next,t,t.next)<0}function Xo(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Wo(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Jo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&ts(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ns(t,e)&&ns(e,t)&&function(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&&r.next.y!==r.y&&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}(t,e)&&(Qo(t.prev,t,e.prev)||Qo(t,e.prev,e))||$o(t,e)&&Qo(t.prev,t,t.next)>0&&Qo(e.prev,e,e.next)>0)}function Qo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $o(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,r,n){var i=rs(Qo(t,e,r)),a=rs(Qo(t,e,n)),o=rs(Qo(r,n,t)),s=rs(Qo(r,n,e));return i!==a&&o!==s||(!(0!==i||!es(t,r,e))||(!(0!==a||!es(t,n,e))||(!(0!==o||!es(r,t,n))||!(0!==s||!es(r,e,n)))))}function es(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function rs(t){return t>0?1:t<0?-1:0}function ns(t,e){return Qo(t.prev,t,t.next)<0?Qo(t,e,t.next)>=0&&Qo(t,t.prev,e)>=0:Qo(t,e,t.prev)<0||Qo(t,t.next,e)<0}function is(t,e){var r=new ss(t.i,t.x,t.y),n=new ss(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 as(t,e,r,n){var i=new ss(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 os(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 ss(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 ls(t,e,r,n){for(var i=0,a=e,o=r-n;an;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1),h=Math.max(n,Math.floor(r-s*c/o+u)),f=Math.min(i,Math.floor(r+(o-s)*c/o+u));t(e,r,h,f,a)}var p=e[r],d=n,m=i;for(us(e,n,r),a(e[i],p)>0&&us(e,n,i);d0;)m--}0===a(e[n],p)?us(e,n,m):(m++,us(e,m,i)),m<=r&&(n=m+1),r<=m&&(i=m-1)}}(t,e,r||0,n||t.length-1,i||hs)}function us(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function hs(t,e){return te?1:0}function fs(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},Oo.default=Ro;var gs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Di,this.indexArray=new Yi,this.indexArray2=new Qi,this.programConfigurations=new Ua(Do,t.layers,t.zoom),this.segments=new pa,this.segments2=new pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};gs.prototype.populate=function(t,e,r){this.hasPattern=ds("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ws.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,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},ws.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=ws.types[this.type];function u(t){for(var e=0;e>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}(r))}function Es(t,e,r){if(3===t){var n=new Ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}As.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 _s(this._pbf,e,this.extent,this._keys,this._values)};var Ls={VectorTile:function(t,e){this.layers=t.readFields(Es,{},e)},VectorTileFeature:_s,VectorTileLayer:Ms},Cs=Ls.VectorTileFeature.types,Ps=Math.pow(2,13);function Is(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ps)+o,i*Ps*2,a*Ps*2,Math.round(s))}var zs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ri,this.indexArray=new Yi,this.programConfigurations=new Ua(bs,t.layers,t.zoom),this.segments=new pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ds(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Os(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>8192}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>8192}))}zs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ds("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var y=d[g-1];if(!Ds(v,y)){h.vertexLength+4>pa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(y)._perp()._unit(),b=y.dist(v);m+b>32768&&(m=0),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m),m+=b,Is(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),Is(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m);var _=h.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>pa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Cs[t.type]){for(var w=[],T=[],k=h.vertexLength,M=0,A=s;M=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&v>c){var M=u.dist(p);if(M>2*h){var A=u.sub(u.sub(p)._mult(h/M)._round());this.updateDistance(p,A),this.addCurrentVertex(A,m,0,0,f),p=A}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(_i&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_100)y=g.mult(-1);else{var L=_*m.add(g).mag()/m.sub(g).mag();y._perp()._mult(L*(k?-1:1))}this.addCurrentVertex(u,y,0,0,f),this.addCurrentVertex(u,y.mult(-1),0,0,f)}else if("bevel"===E||"fakeround"===E){var C=-Math.sqrt(_*_-1),P=k?C:0,I=k?0:C;if(p&&this.addCurrentVertex(u,m,P,I,f),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),D=1;D2*h){var j=u.add(d.sub(u)._mult(h/B)._round());this.updateDistance(u,j),this.addCurrentVertex(j,g,0,0,f),u=j}}}}},Hs.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>qs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},Hs.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u},Hs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(qs-1):this.distance},Hs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Bn("LineBucket",Hs,{omit:["layers","patternFeatures"]});var Gs=new Si({"line-cap":new wi(Lt.layout_line["line-cap"]),"line-join":new Ti(Lt.layout_line["line-join"]),"line-miter-limit":new wi(Lt.layout_line["line-miter-limit"]),"line-round-limit":new wi(Lt.layout_line["line-round-limit"]),"line-sort-key":new Ti(Lt.layout_line["line-sort-key"])}),Ys={paint:new Si({"line-opacity":new Ti(Lt.paint_line["line-opacity"]),"line-color":new Ti(Lt.paint_line["line-color"]),"line-translate":new wi(Lt.paint_line["line-translate"]),"line-translate-anchor":new wi(Lt.paint_line["line-translate-anchor"]),"line-width":new Ti(Lt.paint_line["line-width"]),"line-gap-width":new Ti(Lt.paint_line["line-gap-width"]),"line-offset":new Ti(Lt.paint_line["line-offset"]),"line-blur":new Ti(Lt.paint_line["line-blur"]),"line-dasharray":new Mi(Lt.paint_line["line-dasharray"]),"line-pattern":new ki(Lt.paint_line["line-pattern"]),"line-gradient":new Ai(Lt.paint_line["line-gradient"])}),layout:Gs},Zs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new pi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Ti))(Ys.paint.properties["line-width"].specification);Zs.useIntegerZoom=!0;var Xs=function(t){function e(e){t.call(this,e,Ys)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Co(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Zs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Hs(t)},e.prototype.queryRadius=function(t){var e=t,r=Ws(oo("line-width",this,e),oo("line-gap-width",this,e)),n=oo("line-offset",this,e);return r/2+Math.abs(n)+so(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var l=lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*Ws(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a=3)for(var a=0;a0?e+2*t:t}var Ks=Ii([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Js=Ii([{name:"a_projected_pos",components:3,type:"Float32"}],4),Qs=(Ii([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ii([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),$s=(Ii([{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:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ii([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),tl=Ii([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ii([{name:"triangle",components:3,type:"Uint16"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ii([{type:"Float32",name:"offsetX"}]),Ii([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function el(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),fi.applyArabicShaping&&(t=fi.applyArabicShaping(t)),t}(t.text,e,r)})),t}var rl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var nl=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},il=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=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=u):(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))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):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+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m},al=ol;function ol(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ol.Varint=0,ol.Fixed64=1,ol.Bytes=2,ol.Fixed32=5;var sl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ll(t){return t.type===ol.Bytes?t.readVarint()+t.pos:t.pos+1}function cl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ul(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(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 hl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ol.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,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=bl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=bl(this.buf,this.pos)+4294967296*bl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=bl(this.buf,this.pos)+4294967296*wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return cl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},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.pos;return this.pos=t,t-e>=12&&sl?function(t,e,r){return sl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ol.Bytes)return t.push(this.readVarint(e));var r=ll(this);for(t=t||[];this.pos127;);else if(e===ol.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ol.Fixed32)this.pos+=4;else{if(e!==ol.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),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),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ul(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),il(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),il(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&ul(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ol.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,xl,e)},writeBytesField:function(t,e){this.writeTag(t,ol.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ol.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ol.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Tl(t,e,r){1===t&&r.readMessage(kl,e)}function kl(t,e,r){if(3===t){var n=r.readMessage(Ml,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new So({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ml(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())}function Al(t){for(var e=0,r=0,n=0,i=t;n=0;f--){var p=o[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=o.pop();f0&&B>M&&(M=B)}else{var j=r[S.fontStack],U=j&&j[L];if(U&&U.rect)I=U.rect,P=U.metrics;else{var V=e[S.fontStack],q=V&&V[L];if(!q)continue;P=q.metrics}C=24*(_-S.scale)}O?(t.verticalizable=!0,k.push({glyph:L,imageName:z,x:f,y:p+C,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:I}),f+=D*S.scale+c):(k.push({glyph:L,imageName:z,x:f,y:p+C,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:I}),f+=P.advance*S.scale+c)}if(0!==k.length){var H=f-c;d=Math.max(H,d),Vl(k,0,k.length-1,g,M)}f=0;var G=a*_+M;T.lineOffset=Math.max(M,w),p+=G,m=Math.max(G,m),++v}else p+=a,++v}var Y;var Z=p- -17,X=Ul(o),W=X.horizontalAlign,K=X.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c=(e-r)*i,u=0;u=a!==o?-s*n- -17:(-n*l+.5)*o;for(var h=0,f=t;h=0&&n>=t&&Dl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Il.prototype.substring=function(t,e){var r=new Il;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Il.prototype.toString=function(){return this.text},Il.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Il.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Pl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Dl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ol={};function Rl(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function Fl(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,f=0;f-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}function Kl(t){for(var e=0,r=0;rc){var d=(c-l)/p,m=He(h.x,f.x,d),g=He(h.y,f.y,d),v=new Hl(m,g,f.angleTo(h),u);return v._round(),!o||Wl(t,v,s,o,e)?v:void 0}l+=p}}function tc(t,e,r,n,i,a,o,s,l){var c=Jl(n,a,o),u=Ql(n,i),h=u*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&_=0&&w=0&&p+u<=h){var T=new Hl(_,w,x,m);T._round(),i&&!Wl(e,T,o,i,a)||d.push(T)}}f+=y}l||d.length||s||(d=t(e,f/2,n,i,a,o,s,!0,c));return d}(t,f?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,h,f,!1,l)}function ec(t,e,r,n,a){for(var o=[],s=0;s=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()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(f)))))}return o}function rc(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,f=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),g=p.reduce(d,0),v=l-m,y=c-g,x=0,b=m,_=0,w=g,T=0,k=v,M=0,A=y;if(o.content&&n){var S=o.content;x=nc(f,0,S[0]),_=nc(p,0,S[1]),b=nc(f,S[0],S[2]),w=nc(p,S[1],S[3]),T=S[0]-x,M=S[1]-_,k=S[2]-S[0]-b,A=S[3]-S[1]-w}var E=function(n,a,l,c){var f=ac(n.stretch-x,b,u,t.left),p=oc(n.fixed-T,k,n.stretch,m),d=ac(a.stretch-_,w,h,t.top),v=oc(a.fixed-M,A,a.stretch,g),y=ac(l.stretch-x,b,u,t.left),S=oc(l.fixed-T,k,l.stretch,m),E=ac(c.stretch-_,w,h,t.top),L=oc(c.fixed-M,A,c.stretch,g),C=new i(f,d),P=new i(y,d),I=new i(y,E),z=new i(f,E),D=new i(p/s,v/s),O=new i(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),N=Math.cos(R),B=[N,-F,F,N];C._matMult(B),P._matMult(B),z._matMult(B),I._matMult(B)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=a.stretch+a.fixed,q=c.stretch+c.fixed;return{tl:C,tr:P,bl:z,br:I,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:k/s/u,minFontScaleY:A/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=ic(f,v,m),C=ic(p,y,g),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,v=o.left*s-l,y=o.right*s+l,x=o.collisionPadding;if(x&&(v-=x[0]*s,m-=x[1]*s,y+=x[2]*s,g+=x[3]*s),u){var b=new i(v,m),_=new i(y,m),w=new i(v,g),T=new i(y,g),k=u*Math.PI/180;b._rotate(k),_._rotate(k),w._rotate(k),T._rotate(k),v=Math.min(b.x,_.x,w.x,T.x),y=Math.max(b.x,_.x,w.x,T.x),m=Math.min(b.y,_.y,w.y,T.y),g=Math.max(b.y,_.y,w.y,T.y)}t.emplaceBack(e.x,e.y,v,m,y,g,r,n,a)}this.boxEndIndex=t.length},lc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=cc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function cc(t,e){return te?1:0}function uc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,f=s-a,p=Math.min(h,f),d=p/2,m=new lc([],hc);if(0===p)return new i(n,a);for(var g=n;gy.d||!y.d)&&(y=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-y.d<=e||(d=b.h/2,m.push(new fc(b.p.x-d,b.p.y-d,d,t)),m.push(new fc(b.p.x+d,b.p.y-d,d,t)),m.push(new fc(b.p.x-d,b.p.y+d,d,t)),m.push(new fc(b.p.x+d,b.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+y.d)),y.p}function hc(t,e){return e.max-t.max}function fc(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,ro(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}lc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},lc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},lc.prototype.peek=function(){return this.data[0]},lc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},lc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var pc=Number.POSITIVE_INFINITY;function dc(t,e){return e[1]!==pc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function mc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function gc(t,e,r,n,a,o,s,l,c,u,h,f,p,d,m){var g=function(t,e,r,n,a,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,f=e.positionedLines;h32640&&_(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((y=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||y[1]>32640)&&_(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,y,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(var x=0,b=h;x=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new pi(this.zoom),m=0,g=t;m=0;for(var z=0,D=k.sections;z=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},Ac.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ac.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Ac.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Ac.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Ac.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Bn("SymbolBucket",Ac,{omit:["layers","collisionBoxArray","features","compareText"]}),Ac.MAX_GLYPHS=65535,Ac.addDynamicAttributes=wc;var Sc=new Si({"symbol-placement":new wi(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new wi(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wi(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ti(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wi(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wi(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wi(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new wi(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wi(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ti(Lt.layout_symbol["icon-size"]),"icon-text-fit":new wi(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wi(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ti(Lt.layout_symbol["icon-image"]),"icon-rotate":new Ti(Lt.layout_symbol["icon-rotate"]),"icon-padding":new wi(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new wi(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ti(Lt.layout_symbol["icon-offset"]),"icon-anchor":new Ti(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wi(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wi(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wi(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new Ti(Lt.layout_symbol["text-field"]),"text-font":new Ti(Lt.layout_symbol["text-font"]),"text-size":new Ti(Lt.layout_symbol["text-size"]),"text-max-width":new Ti(Lt.layout_symbol["text-max-width"]),"text-line-height":new wi(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ti(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new Ti(Lt.layout_symbol["text-justify"]),"text-radial-offset":new Ti(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wi(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ti(Lt.layout_symbol["text-anchor"]),"text-max-angle":new wi(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new wi(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new Ti(Lt.layout_symbol["text-rotate"]),"text-padding":new wi(Lt.layout_symbol["text-padding"]),"text-keep-upright":new wi(Lt.layout_symbol["text-keep-upright"]),"text-transform":new Ti(Lt.layout_symbol["text-transform"]),"text-offset":new Ti(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new wi(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wi(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new wi(Lt.layout_symbol["text-optional"])}),Ec={paint:new Si({"icon-opacity":new Ti(Lt.paint_symbol["icon-opacity"]),"icon-color":new Ti(Lt.paint_symbol["icon-color"]),"icon-halo-color":new Ti(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ti(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ti(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new wi(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new wi(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ti(Lt.paint_symbol["text-opacity"]),"text-color":new Ti(Lt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ti(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new Ti(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ti(Lt.paint_symbol["text-halo-blur"]),"text-translate":new wi(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new wi(Lt.paint_symbol["text-translate-anchor"])}),layout:Sc},Lc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};Lc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Lc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Lc.prototype.outputDefined=function(){return!1},Lc.prototype.serialize=function(){return null},Bn("FormatSectionOverride",Lc,{omit:["defaultValue"]});var Cc=function(t){function e(e){t.call(this,e,Ec)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},Hc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Hc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Hn(e.error)):n(null,Hn(e.data)))}else{var i=!1,a=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,a)},a)}:function(t){i=!0},s=null,l=Hn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Yc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Yc.prototype.setNorthEast=function(t){return this._ne=t instanceof Zc?new Zc(t.lng,t.lat):Zc.convert(t),this},Yc.prototype.setSouthWest=function(t){return this._sw=t instanceof Zc?new Zc(t.lng,t.lat):Zc.convert(t),this},Yc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Zc)e=t,r=t;else{if(!(t instanceof Yc)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Yc.convert(a))}var o=t;return this.extend(Zc.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Zc(e.lng,e.lat),this._ne=new Zc(r.lng,r.lat)),this},Yc.prototype.getCenter=function(){return new Zc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Yc.prototype.getSouthWest=function(){return this._sw},Yc.prototype.getNorthEast=function(){return this._ne},Yc.prototype.getNorthWest=function(){return new Zc(this.getWest(),this.getNorth())},Yc.prototype.getSouthEast=function(){return new Zc(this.getEast(),this.getSouth())},Yc.prototype.getWest=function(){return this._sw.lng},Yc.prototype.getSouth=function(){return this._sw.lat},Yc.prototype.getEast=function(){return this._ne.lng},Yc.prototype.getNorth=function(){return this._ne.lat},Yc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Yc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Yc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Yc.prototype.contains=function(t){var e=Zc.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Yc.convert=function(t){return!t||t instanceof Yc?t:new Yc(t)};var Zc=function(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")};Zc.prototype.wrap=function(){return new Zc(c(this.lng,-180,180),this.lat)},Zc.prototype.toArray=function(){return[this.lng,this.lat]},Zc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Zc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Zc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Yc(new Zc(this.lng-r,this.lat-e),new Zc(this.lng+r,this.lat+e))},Zc.convert=function(t){if(t instanceof Zc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Zc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Zc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Xc=2*Math.PI*6371008.8;function Wc(t){return Xc*Math.cos(t*Math.PI/180)}function Kc(t){return(180+t)/360}function Jc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Qc(t,e){return t/Wc(e)}function $c(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var tu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};tu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Zc.convert(t);return new tu(Kc(r.lng),Jc(r.lat),Qc(e,r.lat))},tu.prototype.toLngLat=function(){return new Zc(360*this.x-180,$c(this.y))},tu.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Wc($c(e));var t,e},tu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xc*(t=$c(this.y),1/Math.cos(t*Math.PI/180));var t};var eu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=iu(0,t,t,e,r)};eu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},eu.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=Gc(256*r,256*(n=Math.pow(2,i)-n-1),i),o=Gc(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new nu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},nu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?iu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):iu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nu.prototype.children=function(t){if(this.overscaledZ>=t)return[new nu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nu(e,this.wrap,e,r,n),new nu(e,this.wrap,e,r+1,n),new nu(e,this.wrap,e,r,n+1),new nu(e,this.wrap,e,r+1,n+1)]},nu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},au.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},au.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},au.prototype.getPixels=function(){return new Eo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},au.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},uu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ls.VectorTile(new al(this.rawTileData)).layers,this.sourceLayerCoder=new ou(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},uu.prototype.query=function(t,e,r,n){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=sn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,h=fu(c),f=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=fu(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o=l.x&&a>=l.y)return!0}var c=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var u=0,h=c;u=0)return!0;return!1}(a,h)){var f=this.sourceLayerCoder.decode(r),p=this.vtLayers[f].feature(n);if(i.filter(new pi(this.tileID.overscaledZ),p))for(var d=this.getId(p,f),m=0;mn)i=!1;else if(e)if(this.expirationTimeot&&(t.getActor().send("enforceCacheSizeLimit",at),ft=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=ec,t.clone=function(t){var e=new ho(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},t.clone$1=x,t.clone$2=function(t){var e=new ho(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=tl,t.config=F,t.create=function(){var t=new ho(16);return ho!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ho(9);return ho!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ho(4);return ho!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zr,t.createLayout=Ii,t.createStyleLayer=function(t){return"custom"===t.type?new Oc(t):new Rc[t.type](t)},t.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},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=He,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new al(t).readFields(Tl,[])},t.pbf=al,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=8192/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new pi(f),o),c["text-size"].possiblyEvaluate(new pi(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new pi(m),o),c["icon-size"].possiblyEvaluate(new pi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new pi(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new pi(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new pi(18));for(var v=24*l.get("text-line-height"),y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),w=function(){var a=k[T],s=l.get("text-font").evaluate(a,{},o).join(","),c=b.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),f=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),w=24*l.get("text-letter-spacing").evaluate(a,{},o),M=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,w,T,k,M){var A,S,E,L,C,P=t.addToLineVertexArray(e,r),I=0,z=0,D=0,O=0,R=-1,F=-1,N={},B=ya(""),j=0,U=0;void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(A=s.layout.get("text-offset").evaluate(b,{},k).map((function(t){return 24*t})),j=A[0],U=A[1]):(j=24*s.layout.get("text-radial-offset").evaluate(b,{},k),U=pc);if(t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},k)+90,q=n.vertical;L=new sc(l,e,c,u,h,q,f,p,d,V),o&&(C=new sc(l,e,c,u,h,o,g,v,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),Y=rc(i,H,T,G),Z=o?rc(o,H,T,G):void 0;E=new sc(l,e,c,u,h,i,g,v,!1,H),I=4*Y.length;var X=t.iconSizeData,W=null;"source"===X.kind?(W=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&_(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((W=[128*w.compositeIconSizes[0].evaluate(b,{},k),128*w.compositeIconSizes[1].evaluate(b,{},k)])[0]>32640||W[1]>32640)&&_(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Y,W,x,y,b,!1,e,P.lineStartIndex,P.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,Z&&(z=4*Z.length,t.addSymbols(t.icon,Z,W,x,y,b,Cl.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var J=n.horizontal[K];if(!S){B=ya(J.text);var Q=s.layout.get("text-rotate").evaluate(b,{},k);S=new sc(l,e,c,u,h,J,f,p,d,Q)}var $=1===J.positionedLines.length;if(D+=gc(t,e,J,a,s,d,b,m,P,n.vertical?Cl.horizontal:Cl.horizontalOnly,$?Object.keys(n.horizontal):[K],N,R,w,k),$)break}n.vertical&&(O+=gc(t,e,n.vertical,a,s,d,b,m,P,Cl.vertical,["vertical"],N,F,w,k));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=L?L.boxStartIndex:t.collisionBoxArray.length,nt=L?L.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,st=C?C.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(L,lt),lt=ct(E,lt);var ut=(lt=ct(C,lt))>-1?1:0;ut&&(lt*=M/24);t.glyphOffsetArray.length>=Ac.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);t.symbolInstances.emplaceBack(e.x,e.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,R,F,B,tt,et,rt,nt,it,at,ot,st,c,D,O,I,z,ut,0,f,j,U,lt)}(t,h,s,r,n,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,M,l,x,T,A,d,e,a,c,u,o)};if("line"===S)for(var P=0,I=ec(e.geometry,0,0,8192,8192);P1){var V=$l(U,k,r.vertical||m,n,24,y);V&&C(U,V)}}else if("Polygon"===e.type)for(var q=0,H=fs(e.geometry,0);q=E.maxzoom))if("none"!==E.visibility)o(S,this.zoom,n),(m[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id})))}}}var L=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(L).length?a.send("getGlyphs",{uid:this.uid,stacks:L},(function(t,e){h||(h=t,f=e,I.call(l))})):f={};var C=Object.keys(g.iconDependencies);C.length?a.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,I.call(l))})):p={};var P=Object.keys(g.patternDependencies);function I(){if(h)return s(h);if(f&&p&&d){var e=new i(f),r=new t.ImageAtlas(p,d);for(var a in m){var l=m[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,f,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,I.call(l))})):d={},I.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;!function t(e,r,n,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=n-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),f=Math.max(i,Math.floor(n-l*u/s+h)),p=Math.min(a,Math.floor(n+(s-l)*u/s+h));t(e,r,n,f,p,o)}var d=r[2*n+o],m=i,g=a;for(D(e,r,i,n),r[2*a+o]>d&&D(e,r,i,a);md;)g--}r[2*i+o]===d?D(e,r,i,g):(g++,D(e,r,g,a)),g<=n&&(i=g+1),n<=g&&(a=g-1)}}(t,e,o,n,i,a%2),z(t,e,r,n,o-1,a+1),z(t,e,r,o+1,i,a+1)}}function D(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}function R(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=T,_.GeoJSONWrapper=k;var F=function(t){return t[0]},N=function(t){return t[1]},B=function(t,e,r,n,i){void 0===e&&(e=F),void 0===r&&(r=N),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var m=Math.floor((p+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},B.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var f=h;f<=u;f++)R(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var p=Math.floor((h+u)/2),d=e[2*p],m=e[2*p+1];R(d,m,r,n)<=l&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=X(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function q(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:Y(n),y:Z(i),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function Y(t){return t/360+.5}function Z(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 X(t,e){for(var r in e)t[r]=e[r];return t}function W(t){return t.x}function K(t){return t.y}function J(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function Q(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=n-r>>1,l=n-r,c=e[r],u=e[r+1],h=e[n],f=e[n+1],p=r+3;po)a=p,o=d;else if(d===o){var m=Math.abs(p-s);mi&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function nt(t,e,r,n){for(var i=0;i1?1:r}function ot(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var m=[];if("Point"===f||"MultiPoint"===f)st(h,m,r,n,i);else if("LineString"===f)lt(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)ut(h,m,r,n,i,!1);else if("Polygon"===f)ut(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function lt(t,e,r,n,i,a,o){for(var s,l,c=ct(t),u=0===i?ft:pt,h=t.start,f=0;fr&&(l=u(c,p,d,g,v,r),o&&(c.start=h+s*l)):y>n?x=r&&(l=u(c,p,d,g,v,r),b=!0),x>n&&y<=n&&(l=u(c,p,d,g,v,n),b=!0),!a&&b&&(o&&(c.end=h+s*l),e.push(c),c=ct(t)),o&&(h+=s)}var _=t.length-3;p=t[_],d=t[_+1],m=t[_+2],(y=0===i?p:d)>=r&&y<=n&&ht(c,p,d,m),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&ht(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ct(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ut(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function xt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new B(s,W,K,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(Y(r),Z(a),Y(i),Z(n));u1?this._map(c,!0):null,g=(l<<5)+(e+1)+this.points.length,v=0,y=h;v>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),f=this.tiles[h]=yt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,g,v,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,T=.5+_,k=1+_;m=g=v=y=null,x=ot(t,u,r-_,r+T,0,f.minX,f.maxX,l),b=ot(t,u,r+w,r+k,0,f.minX,f.maxX,l),t=null,x&&(m=ot(x,u,n-_,n+T,1,f.minY,f.maxY,l),g=ot(x,u,n+w,n+k,1,f.minY,f.maxY,l),x=null),b&&(v=ot(b,u,n-_,n+T,1,f.minY,f.maxY,l),y=ot(b,u,n+w,n+k,1,f.minY,f.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},_t.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[wt(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?gt(this.tiles[s],i):null):null};var kt=function(e){function r(t,r,n,i){e.call(this,t,r,n,Tt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function v(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);p=Math.sqrt(f*f+m*m)}else p=n-Math.sqrt(f*f+d*d);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=l.isDash?f:-f;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),I=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(I),D=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},B.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(It(this._source.type)){for(var c={},u={},h=0,f=Object.keys(l);hthis._source.maxzoom){var g=d.children(this._source.maxzoom)[0],v=this.getTile(g);if(v&&v.hasData()){n[g.key]=g;continue}}else{var y=d.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var x=m.wasRequested(),b=d.overscaledZ-1;b>=a;--b){var _=d.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(m=this.getTile(_))&&x&&(m=this._addTile(_)),m&&(n[_.key]=_,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,m=0,g=c;m=0&&v[1].y+g>=0){var y=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:y,cameraQueryGeometry:x,scale:m})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles){this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading")}this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function It(t){return"raster"===t||"image"===t||"video"===t}function zt(){return new t.window.Worker(Wi.workerUrl)}Ct.maxOverzooming=10,Ct.maxUnderzooming=3;var Dt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Jt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,v=0;vMath.abs(n.x-r.x)*i)return{useVertical:!0};return(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,a,o,s,l,c,u,h,f,p,d){var m,g=r/24,v=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=ie(g,l,v,y,n,h,f,e,c,o,p);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,k=te(w.last.point,s).point;if(i&&!n){var M=ae(e.writingMode,T,k,d);if(M)return M}m=[w.first];for(var A=e.glyphStartIndex+1;A0?C.point:se(f,L,S,1,a),I=ae(e.writingMode,S,P,d);if(I)return I}var z=le(g*l.getoffsetX(e.glyphStartIndex),v,y,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,O=m;D0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,v=a,y=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((g+=d)=c)return null;if(y=v,w.push(v),void 0===(v=f[g])){var T=new t.Point(u.getx(g),u.gety(g)),k=te(T,h);if(k.signedDistanceFromCamera>0)v=f[g]=k.point;else{var M=g-d;v=se(0===x?o:new t.Point(u.getx(M),u.gety(M)),T,y,_-x+1,h)}}x+=b,b=y.dist(v)}var A=(_-x)/b,S=v.sub(y),E=S.mult(A)._add(y);E._add(S._unit()._perp()._mult(n*d));var L=m+Math.atan2(v.y-y.y,v.x-y.x);return w.push(E),{point:E,angle:L,path:w}}Jt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Jt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Jt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Jt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Jt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Jt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Jt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Jt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Jt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Jt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Jt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,f=c;h=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,v=0,y=m;vo*o+s*s},Jt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,f=u-c;return h*h+f*f<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r=1;P--)C.push(E.path[P]);for(var I=1;I0){for(var R=C[0].clone(),F=C[0].clone(),N=1;N=M.x&&F.x<=A.x&&R.y>=M.y&&F.y<=A.y?[C]:F.xA.x||F.yA.y?[]:t.clipLine([C],M.x,M.y,A.x,A.y)}for(var B=0,j=O;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},fe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(f,t,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:v,placedGlyphBoxes:y}},we.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),v=s.get("icon-optional"),y=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=y&&(x||!o.hasIconData()||v),M=x&&(y||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var A=function(e,a){if(!r[e.crossTileID])if(f)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var p,T=!1,A=!1,S=!0,E=null,L={box:null,offscreen:null},C={box:null,offscreen:null},P=null,I=null,z=0,D=0,O=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},N=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(B=B.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,f={box:[],offscreen:!1},p=y?2*B.length:B.length,d=0;d=B.length,k=i.attemptAnchorPlacement(g,t,a,s,c,b,_,h,l,m,v,e,o,n,u);if(k&&(f=k.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,E=k.shift;break}}return f};N((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=L&&L.box&&L.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,y,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};N((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(L&&L.box&&L.box.length)}}if(T=(p=L)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Y=t.evaluateSizeForFeature(o.textSizeData,d,G),Z=s.get("text-padding"),X=e.collisionCircleDiameter;P=i.collisionIndex.placeCollisionCircles(y,G,o.lineVertexArray,o.glyphOffsetArray,Y,l,c,u,n,_,m.predicate,X,Z),T=y||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var W=function(t){var e=w&&E?_e(t,E.x,E.y,b,_,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,h,l,m.predicate)};A=C&&C.box&&C.box.length&&a.verticalIconBox?(I=W(a.verticalIconBox)).box.length>0:(I=W(a.iconBox)).box.length>0,S=S&&I.offscreen}var K=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,J=v||0===e.numIconVertices;if(K||J?J?K||(A=A&&T):T=A&&T:A=T=A&&T,T&&p&&p.box&&(C&&C.box&&D?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),A&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),P&&(T&&i.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var Q=o.bucketInstanceId,$=i.collisionCircleArrays[Q];void 0===$&&($=i.collisionCircleArrays[Q]=new ve);for(var tt=0;tt=0;--E){var L=S[E];A(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var C=e.symbolInstanceStart;C=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},we.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===t.WritingMode.vertical,w=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;if(y){var T=Pe(v.text),k=_?Ie:T;d(e.text,s,k);var M=w?Ie:T;d(e.text,l,M);var A=v.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=A||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,b);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var L=Pe(v.icon),C=!(f&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var P=C?L:Ie;d(e.icon,a.numIconVertices,P),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=v.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=C?Ie:L;d(e.icon,a.numVerticalIconVertices,I),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var z=e.collisionArrays[n];if(z){var D=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var O=!0;if(c){var R=i.variableOffsets[m];R?(D=be(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&D._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}z.textBox&&Te(e.textCollisionBox.collisionVertexArray,v.text.placed,!O||_,D.x,D.y),z.verticalTextBox&&Te(e.textCollisionBox.collisionVertexArray,v.text.placed,!O||w,D.x,D.y)}var F=Boolean(!w&&z.verticalIconBox);z.iconBox&&Te(e.iconCollisionBox.collisionVertexArray,v.icon.placed,F,f?D.x:0,f?D.y:0),z.verticalIconBox&&Te(e.iconCollisionBox.collisionVertexArray,v.icon.placed,!F,f?D.x:0,f?D.y:0)}}},g=0;gt},we.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Ae=Math.pow(2,17),Se=Math.pow(2,16),Ee=Math.pow(2,9),Le=Math.pow(2,8),Ce=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Me+r*Ae+e*Se+r*Ee+e*Le+r*Ce+e}var Ie=0,ze=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ze.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ze(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},De.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,f=l.y,p=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,v=l.content,y=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,y,{x:h,y:f},{x:0,y:0},{width:c,height:u}),r[s]={data:y,pixelRatio:d,sdf:p,stretchX:m,stretchY:g,content:v}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Ct(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var v=i[g].feature;if(n[v.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),lr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cr=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),mr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),vr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,a){return n[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}))}}var xr=Object.freeze({__proto__:null,prelude:Ye,background:Ze,backgroundPattern:Xe,circle:We,clippingMask:Ke,heatmap:Je,heatmapTexture:Qe,collisionBox:$e,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ir,fillPattern:ar,fillExtrusion:or,fillExtrusionPattern:sr,hillshadePrepare:lr,hillshade:cr,line:ur,lineGradient:hr,linePattern:fr,lineSDF:pr,raster:dr,symbolIcon:mr,symbolSDF:gr,symbolTextAndIcon:vr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};br.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}_r.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g,v=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[y].set(o[y]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var x=(g={},g[v.LINES]=2,g[v.TRIANGLES]=3,g[v.LINE_STRIP]=1,g)[e],b=0,_=u.get();b<_.length;b+=1){var w=_[b],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new br)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,w.vertexOffset,d,m),v.drawElements(e,w.primitiveLength*x,v.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Tr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},kr=function(e,r,n,i,a,o,s){return t.extend(Tr(e,r,n,i),wr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Mr=function(t){return{u_matrix:t}},Ar=function(e,r,n,i){return t.extend(Mr(e),wr(n,r,i))},Sr=function(t,e){return{u_matrix:t,u_world:e}},Er=function(e,r,n,i,a){return t.extend(Ar(e,r,n,i),{u_world:a})},Lr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=pe(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Cr=function(t,e,r){var n=pe(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Pr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Ir=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},zr=function(t){return{u_matrix:t}},Dr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:pe(e,1,r),u_intensity:n}};function Or(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Rr=function(e,r,n){var i=e.transform;return{u_matrix:Ur(e,r,n),u_ratio:1/pe(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Fr=function(e,r,n){return t.extend(Rr(e,r,n),{u_image:0})},Nr=function(e,r,n,i){var a=e.transform,o=jr(r,a);return{u_matrix:Ur(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/pe(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Br=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=jr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return t.extend(Rr(e,r,n),{u_patternscale_a:[l/f,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function jr(t,e){return 1/pe(t,1,e.tileZoom)}function Ur(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Vr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var a,o};function qr(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]}var Hr,Gr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Yr=function(e,r,n,i,a,o,s,l,c,u,h){var f=a.transform;return t.extend(Gr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Zr=function(e,r,n,i,a,o,s,l,c,u){return t.extend(Yr(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Xr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),f=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},Kr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Jr(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d0){var _=t.create(),w=y;t.mul(_,v.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(_,_,v.placementViewportMatrix),h.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=f+=b.length/4}x&&u.draw(l,c.LINES,Mt.disabled,At.disabled,e.colorModeForRenderPass(),Et.disabled,Cr(y,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*f),k._trim();for(var M=0,A=0,S=h;A=0&&(m[v.associatedIconIndex]={shiftedAnchor:S,angle:E})}else ue(v.numGlyphs,p)}if(h){d.clear();for(var C=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.clamp(f?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var un=new t.Color(1,0,0,1),hn=new t.Color(0,1,0,1),fn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),dn=new t.Color(0,1,1,1);function mn(t){var e=t.transform.padding;gn(t,t.transform.height-(e.top||0),3,un),gn(t,e.bottom||0,3,hn),vn(t,e.left||0,3,fn),vn(t,t.transform.width-(e.right||0),3,pn);var r=t.transform.centerPoint;!function(t,e,r,n){yn(t,e-1,r-10,2,20,n),yn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,dn)}function gn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function vn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function xn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,c=At.disabled,u=e.colorModeForRenderPass();i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Et.disabled,Ir(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,f=h&&h.byteLength||0,p=Math.floor(f/1024),d=r.getTile(n).tileSize,m=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,a.TRIANGLES,l,c,St.alphaBlended,Et.disabled,Ir(o,t.Color.transparent,m),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var bn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=At.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,f=e;h256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new At({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new At({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new _r(this.context,xr[t],e,Kr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var wn=function(t,e){this.points=t,this.planes=e};wn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new wn(a,o)};var Tn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Tn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;hthis.max[l]-this.min[l])return 0}return 1};var kn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};kn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},kn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},kn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},kn.prototype.clone=function(){return new kn(this.top,this.bottom,this.left,this.right)},kn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Mn=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new kn,this._posMatrixCache={},this._alignedPosMatrixCache={}},An={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Mn.prototype.clone=function(){var t=new Mn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},An.minZoom.get=function(){return this._minZoom},An.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},An.maxZoom.get=function(){return this._maxZoom},An.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},An.minPitch.get=function(){return this._minPitch},An.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},An.maxPitch.get=function(){return this._maxPitch},An.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},An.renderWorldCopies.get=function(){return this._renderWorldCopies},An.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},An.worldSize.get=function(){return this.tileSize*this.scale},An.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},An.size.get=function(){return new t.Point(this.width,this.height)},An.bearing.get=function(){return-this.angle/Math.PI*180},An.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},An.pitch.get=function(){return this._pitch/Math.PI*180},An.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},An.fov.get=function(){return this._fov/Math.PI*180},An.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},An.zoom.get=function(){return this._zoom},An.zoom.set=function(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._constrain(),this._calcMatrices())},An.center.get=function(){return this._center},An.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},An.padding.get=function(){return this._edgeInsets.toJSON()},An.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},An.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Mn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Mn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Mn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Mn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Mn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=wn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Tn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],f=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,v=m.y,y=m.fullyVisible;if(!y){var x=m.aabb.intersects(s);if(0===x)continue;y=2===x}var b=m.aabb.distanceX(o),_=m.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),T=3+(1<T&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===f?p:m.zoom,m.wrap,m.zoom,g,v),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-v])});else for(var k=0;k<4;k++){var M=(g<<1)+k%2,A=(v<<1)+(k>>1);u.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:M,y:A,wrap:m.wrap,fullyVisible:y})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Mn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},An.unmodified.get=function(){return this._unmodified},Mn.prototype.zoomScale=function(t){return Math.pow(2,t)},Mn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Mn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Mn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},An.point.get=function(){return this.project(this.center)},Mn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Mn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Mn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Mn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Mn.prototype.coordinateLocation=function(t){return t.toLngLat()},Mn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,f=u===h?0:(0-u)/(h-u);return new t.MercatorCoordinate(t.number(o,s,f)/this.worldSize,t.number(l,c,f)/this.worldSize)},Mn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Mn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Mn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Mn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Mn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Mn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Mn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var v=p.x,y=c.x/2;v-yl&&(n=l-y)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},Mn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-s,-l,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),t.scale(h,h,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var f=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*f+m*p,v=l-Math.round(l)+d*p+m*f,y=new Float64Array(h);if(t.translate(y,y,[g>.5?g-1:g,v>.5?v-1:v,0]),this.alignedProjMatrix=y,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Mn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Mn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Mn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Sn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var En={linearity:.3,easing:t.bezier(0,0,.3,1)},Ln=t.extend({deceleration:2500,maxSpeed:1400},En),Cn=t.extend({deceleration:20,maxSpeed:1400},En),Pn=t.extend({deceleration:1e3,maxSpeed:360},En),In=t.extend({deceleration:1e3,maxSpeed:90},En),zn=function(t){this._map=t,this.clear()};function Dn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},zn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))},Bn.prototype.dblclick=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},Bn.prototype.mouseover=function(t){this._map.fire(new Rn(t.type,this._map,t))},Bn.prototype.mouseout=function(t){this._map.fire(new Rn(t.type,this._map,t))},Bn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},Bn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},Bn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},Bn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},Bn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Rn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Vn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},qn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new qn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Gn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Gn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Gn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Gn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Gn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Gn.prototype.touchcancel=function(){this.reset()},Gn.prototype.enable=function(){this._enabled=!0},Gn.prototype.disable=function(){this._enabled=!1,this.reset()},Gn.prototype.isEnabled=function(){return this._enabled},Gn.prototype.isActive=function(){return this._active};var Yn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Yn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Yn.prototype._correctButton=function(t,e){return!1},Yn.prototype._move=function(t,e){return{}},Yn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Yn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var i=Vn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid){this._lastPoints=t,this._active=!0;return{pitchDelta:-.5*((n.y+i.y)/2)}}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ni(t)&&ni(e)&&a}},e}(Jn),ai={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ai;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function si(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:si,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active};var li=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};li.prototype.setZoomRate=function(t){this._defaultZoomRate=t},li.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},li.prototype.isEnabled=function(){return!!this._enabled},li.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},li.prototype.isZooming=function(){return!!this._zooming},li.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},li.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},li.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},li.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},li.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},li.prototype.renderFrame=function(){return this._onScrollFrame()},li.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(h);o=t.number(l,s,f),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},li.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},li.prototype.reset=function(){this._active=!1};var ci=function(t,e){this._clickZoom=t,this._tapZoom=e};ci.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ci.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ci.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ci.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ui=function(){this.reset()};ui.prototype.reset=function(){this._active=!1},ui.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active};var hi=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};hi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},hi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},hi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},hi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},hi.prototype.touchcancel=function(){this.reset()},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active};var fi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};fi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},fi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},fi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},fi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var di=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};di.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},di.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},di.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},di.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},di.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},di.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var mi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function vi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-e),T=i.unproject(x.add(b.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(u-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),v=a.pointLocation(g),y=t.LngLat.convert(e.center||v);this._normalizeCenter(y);var x=a.project(v),b=a.project(y).sub(x),_=e.curve,w=Math.max(a.width,a.height),T=w/d,k=b.mag();if("minZoom"in e){var M=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),A=w/a.zoomScale(M-o);_=Math.sqrt(A/k*2)}var S=_*_;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}var P=E(0),I=function(t){return C(P)/C(P+_*t)},z=function(t){return w*((C(P)*(L(e=P+_*t)/C(e))-L(P))/S)/k;var e},D=(E(1)-P)/_;if(Math.abs(k)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(e){var i=e*D,d=1/I(i);a.zoom=1===e?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,h,e)),n._pitching&&(a.pitch=t.number(l,f,e)),n._padding&&(a.interpolatePadding(c,p,e),g=a.centerPoint.add(m));var v=1===e?y:a.unproject(x.add(b.mult(z(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?v.wrap():v,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),bi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};bi.prototype.getDefaultPosition=function(){return"bottom-right"},bi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},bi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},bi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},bi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var _i=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_i.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_i.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_i.prototype.getDefaultPosition=function(){return"bottom-left"},_i.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_i.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},_i.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new Mn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ti,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Mi))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new yi(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Sn(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new bi({customAttribution:e.customAttribution})),this.addControl(new _i,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Rn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Rn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Rn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ii.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ii.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ii.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ii.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ii.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ii.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ii.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ii.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ji)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Bi--,ji=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Bi>1?(e={maximumAge:6e5,timeout:0},ji=!0):(e=this.options.positionOptions,ji=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function Hi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;if(l>5280)Gi(e,n,l/5280,t._getUIString("ScaleControl.Miles"));else Gi(e,n,l,t._getUIString("ScaleControl.Feet"))}else if(r&&"nautical"===r.unit){Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,a,o,s=(i=r,a=Math.pow(10,(""+Math.floor(i)).length-1),o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),a*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){Hi(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,Hi(this._map,this._container,this.options)};var Yi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Yi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Yi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Yi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Yi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Yi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Yi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Yi.prototype._isFullscreen=function(){return this._fullscreen},Yi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Yi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Zi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Xi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Zi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var a=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,c=this._container.offsetWidth,u=this._container.offsetHeight;l=a.y+s.bottom.ythis._map.transform.height-u?["bottom"]:[],a.xthis._map.transform.width-c/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var h=a.add(s[o]).round();r.setTransform(this._container,Di[o]+" translate("+h.x+"px,"+h.y+"px)"),Oi(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);var Wi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ei,NavigationControl:Pi,GeolocateControl:Ui,AttributionControl:bi,ScaleControl:qi,FullscreenControl:Yi,Popup:Xi,Marker:Fi,Style:He,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Nt().acquire(Dt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Dt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Wi})),r}))},{}],357:[function(t,e,r){var n=t("./normalize"),i=t("gl-mat4/create"),a=t("gl-mat4/clone"),o=t("gl-mat4/determinant"),s=t("gl-mat4/invert"),l=t("gl-mat4/transpose"),c={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},u=i(),h=i(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(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}e.exports=function(t,e,r,i,g,v){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),v||(v=[0,0,0,1]),!n(u,t))return!1;if(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var y,x,b,_,w,T,k,M=u[3],A=u[7],S=u[11],E=u[12],L=u[13],C=u[14],P=u[15];if(0!==M||0!==A||0!==S){if(f[0]=M,f[1]=A,f[2]=S,f[3]=P,!s(h,h))return!1;l(h,h),y=g,b=h,_=(x=f)[0],w=x[1],T=x[2],k=x[3],y[0]=b[0]*_+b[4]*w+b[8]*T+b[12]*k,y[1]=b[1]*_+b[5]*w+b[9]*T+b[13]*k,y[2]=b[2]*_+b[6]*w+b[10]*T+b[14]*k,y[3]=b[3]*_+b[7]*w+b[11]*T+b[15]*k}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=E,e[1]=L,e[2]=C,function(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]}(p,u),r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,p[1],p[2]),c.dot(p[0],d)<0)for(var I=0;I<3;I++)r[I]*=-1,p[I][0]*=-1,p[I][1]*=-1,p[I][2]*=-1;return v[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),v[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),v[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),v[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":358,"gl-mat4/clone":188,"gl-mat4/create":190,"gl-mat4/determinant":191,"gl-mat4/invert":203,"gl-mat4/transpose":216,"gl-vec3/cross":268,"gl-vec3/dot":273,"gl-vec3/length":283,"gl-vec3/normalize":290}],358:[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}},{}],359:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=h(),c=h(),u=h();function h(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var f=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!f||!p)&&(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}},{"gl-mat4/determinant":191,"gl-vec3/lerp":284,"mat4-decompose":357,"mat4-recompose":360,"quat-slerp":414}],360:[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":190,"gl-mat4/fromRotationTranslation":194,"gl-mat4/identity":201,"gl-mat4/multiply":205,"gl-mat4/scale":213,"gl-mat4/translate":215}],361:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),f=[0,0,0];function p(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]}e.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)f[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&f[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=f[c];else i(o,f,d,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-o[2+4*c]*b}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i0;--p)r[h++]=s[p];return r};var n=t("robust-orientation")[3]},{"robust-orientation":427}],363:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function f(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",f),t.addEventListener("keydown",f),t.addEventListener("keypress",f),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}g();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(e){e?g():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",f),t.removeEventListener("keydown",f),t.removeEventListener("keypress",f),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":365}],364:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],365:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<0&&o(l,r))}catch(t){p.call(new h(r),t)}}}function p(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function f(t,e,r,n){for(var a=0;a0&&o(l,r))}catch(t){h.call(new p(r),t)}}}function h(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function f(t,e,r,n){for(var i=0;i 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 s=t.getters||[],l=new Array(a),c=0;c=0?l[c]=!0:l[c]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,v=0|-d,y=0,x=0|-m,b=0,_=-d-m|0,w=0,T=0|d,k=m-d*u|0,M=0,A=0,S=0,E=2*u|0,L=n(E),C=n(E),P=0,I=0,z=-1,D=-1,O=0,R=0|-u,F=0|u,N=0,B=-u-1|0,j=u-1|0,U=0,V=0,q=0;for(M=0;M0){if(A=1,L[P++]=r(f[g],o,s,l),g+=T,u>0)for(M=1,c=f[g],I=L[P]=r(c,o,s,l),O=L[P+z],N=L[P+R],U=L[P+B],I===O&&I===N&&I===U||(y=f[g+v],b=f[g+x],w=f[g+_],t(M,A,c,y,b,w,I,O,N,U,o,s,l),V=C[P]=S++),P+=1,g+=T,M=2;M0)for(M=1,c=f[g],I=L[P]=r(c,o,s,l),O=L[P+z],N=L[P+R],U=L[P+B],I===O&&I===N&&I===U||(y=f[g+v],b=f[g+x],w=f[g+_],t(M,A,c,y,b,w,I,O,N,U,o,s,l),V=C[P]=S++,U!==N&&e(C[P+R],V,b,w,N,U,o,s,l)),P+=1,g+=T,M=2;M0){if(M=1,L[P++]=r(f[g],o,s,l),g+=T,h>0)for(A=1,c=f[g],I=L[P]=r(c,o,s,l),N=L[P+R],O=L[P+z],U=L[P+B],I===N&&I===O&&I===U||(y=f[g+v],b=f[g+x],w=f[g+_],t(M,A,c,y,b,w,I,N,O,U,o,s,l),V=C[P]=S++),P+=1,g+=T,A=2;A0)for(A=1,c=f[g],I=L[P]=r(c,o,s,l),N=L[P+R],O=L[P+z],U=L[P+B],I===N&&I===O&&I===U||(y=f[g+v],b=f[g+x],w=f[g+_],t(M,A,c,y,b,w,I,N,O,U,o,s,l),V=C[P]=S++,U!==N&&e(C[P+R],V,w,y,U,N,o,s,l)),P+=1,g+=T,A=2;A2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}e.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=u[e])return a;for(var r=t.length,n=[h,f],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return u[e]=a,a}(r)(t,e)}},{dup:155}],370:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|t[1];b>0;){b<64?(c=b,b=0):(c=64,b-=64),n=v+x*h+b*f,o=y+x*d+b*m;var _=0,w=0,T=0,k=p,M=h-u*p,A=f-l*h,S=g,E=d-u*g,L=m-l*d;for(T=0;T0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*u+g*c,o=d+m*f+g*h;var v=0,y=0,x=u,b=c-l*u,_=f,w=h-l*f;for(y=0;y0;){y<64?(c=y,y=0):(c=64,y-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|t[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+y*f+x*u+b*h,o=v+y*m+x*p+b*d;var _=0,w=0,T=0,k=f,M=u-c*f,A=h-s*u,S=m,E=p-c*m,L=d-s*p;for(T=0;Tr;){v=0,y=m-o;e:for(g=0;gb)break e;y+=h,v+=f}for(v=m,y=m-o,g=0;g>1,H=q-j,G=q+j,Y=U,Z=H,X=q,W=G,K=V,J=i+1,Q=a-1,$=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);M=l*Y,A=l*Z,B=s;t:for(k=0;k0){g=Y,Y=Z,Z=g;break t}if(rt<0)break t;B+=p}M=l*W,A=l*K,B=s;t:for(k=0;k0){g=W,W=K,K=g;break t}if(rt<0)break t;B+=p}M=l*Y,A=l*X,B=s;t:for(k=0;k0){g=Y,Y=X,X=g;break t}if(rt<0)break t;B+=p}M=l*Z,A=l*X,B=s;t:for(k=0;k0){g=Z,Z=X,X=g;break t}if(rt<0)break t;B+=p}M=l*Y,A=l*W,B=s;t:for(k=0;k0){g=Y,Y=W,W=g;break t}if(rt<0)break t;B+=p}M=l*X,A=l*W,B=s;t:for(k=0;k0){g=X,X=W,W=g;break t}if(rt<0)break t;B+=p}M=l*Z,A=l*K,B=s;t:for(k=0;k0){g=Z,Z=K,K=g;break t}if(rt<0)break t;B+=p}M=l*Z,A=l*X,B=s;t:for(k=0;k0){g=Z,Z=X,X=g;break t}if(rt<0)break t;B+=p}M=l*W,A=l*K,B=s;t:for(k=0;k0){g=W,W=K,K=g;break t}if(rt<0)break t;B+=p}for(M=l*Y,A=l*Z,S=l*X,E=l*W,L=l*K,C=l*U,P=l*q,I=l*V,N=0,B=s,k=0;k0)){if(rt<0){for(M=l*b,A=l*J,S=l*Q,B=s,k=0;k0)for(;;){_=s+Q*l,N=0;t:for(k=0;k0)){_=s+Q*l,N=0;t:for(k=0;kV){t:for(;;){for(_=s+J*l,N=0,B=s,k=0;k1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},{"typedarray-pool":477}],375:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":374}],376:[function(t,e,r){var n=t("is-buffer"),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,f=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(u+=s*(i-1),i=f(-i/h)):i=f(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(u+=l*(a-1),a=f(-a/h)):a=f(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(o-1),o=f(-o/h)):o=f(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=h*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=f*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,f,p,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],f=this.stride[3],p=this.offset,d=0,m=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(p+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof e&&((d=0|e)<0?(p+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(p+=h*(s-1),s=m(-s/d)):s=m(s/d),h*=d),"number"==typeof i&&((d=0|i)<0?(p+=f*(l-1),l=m(-l/d)):l=m(l/d),f*=d),new n(this.data,a,o,s,l,c,u,h,f,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c,u,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],f=this.shape[4],p=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],v=this.stride[4];return"number"==typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"==typeof a&&a>=0&&(o+=v*(s=0|a),f-=s),new n(this.data,l,c,u,h,f,p,d,m,g,v,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,v=0,y=Math.ceil;return"number"==typeof t&&((v=0|t)<0?(g+=h*(o-1),o=y(-o/v)):o=y(o/v),h*=v),"number"==typeof e&&((v=0|e)<0?(g+=f*(s-1),s=y(-s/v)):s=y(s/v),f*=v),"number"==typeof r&&((v=0|r)<0?(g+=p*(l-1),l=y(-l/v)):l=y(l/v),p*=v),"number"==typeof i&&((v=0|i)<0?(g+=d*(c-1),c=y(-c/v)):c=y(c/v),d*=v),"number"==typeof a&&((v=0|a)<0?(g+=m*(u-1),u=y(-u/v)):u=y(u/v),m*=v),new n(this.data,o,s,l,c,u,h,f,p,d,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===a){a=0;for(s=0;st==t>0?a===-1>>>0?(r+=1,a=0):a+=1:0===a?(a=-1>>>0,r-=1):a-=1;return n.pack(a,r)}},{"double-bits":153}],378:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;b[x]+=_*(v[w]*m[T]-v[T]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0;for(c=0;c<3;++c)f[c]*=p;i[o]=f}return i}},{}],379:[function(t,e,r){ /* object-assign (c) Sindre Sorhus @license MIT */ -"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){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;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),c=1;c2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length0){var h=Math.sqrt(u+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,c);h=Math.sqrt(2*f-u+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}},{}],381:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(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)}var f=h.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(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 c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},f.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},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=l(u-=a*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var m=i[2],g=i[6],v=i[10],y=m*a+g*o+v*s,x=m*u+g*h+v*f,b=l(m-=y*a+x*u,g-=y*o+x*h,v-=y*s+x*f);m/=b,g/=b,v/=b;var _=u*e+a*r,w=h*e+o*r,T=f*e+s*r;this.center.move(t,_,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],f=i[9],p=i[2],d=i[6],m=i[10],g=e*a+r*u,v=e*o+r*h,y=e*s+r*f,x=-(d*y-m*v),b=-(m*g-p*y),_=-(p*v-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),T=c(x,b,_,w);T>1e-6?(x/=T,b/=T,_/=T,w/=T):(x=b=_=0,w=1);var k=this.computedRotation,M=k[0],A=k[1],S=k[2],E=k[3],L=M*w+E*x+A*_-S*b,C=A*w+E*b+S*x-M*_,P=S*w+E*_+M*b-A*x,I=E*w-M*x-A*b-S*_;if(n){x=p,b=d,_=m;var z=Math.sin(n)/l(x,b,_);x*=z,b*=z,_*=z,I=I*(w=Math.cos(e))-(L=L*w+I*x+C*_-P*b)*x-(C=C*w+I*b+P*x-L*_)*b-(P=P*w+I*_+L*b-C*x)*_}var D=c(L,C,P,I);D>1e-6?(L/=D,C/=D,P/=D,I/=D):(L=C=P=0,I=1),this.rotation.set(t,L,C,P,I)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.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},f.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])]},f.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]}},f.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":380,"filtered-vector":160,"gl-mat4/fromQuat":192,"gl-mat4/invert":203,"gl-mat4/lookAt":204}],382:[function(t,e,r){ +/*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ +"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":420}],383:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,(function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length0){o=a[u][r][0],l=u;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=a[h][r],p=0;p0&&(o=d,s=m,l=h)}return i||o&&c(o,l),s}function h(t,r){var i=a[r][t][0],o=[t];c(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=u(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],h=t,f=o[1],p=u(l,h,!0);if(n(e[l],e[h],e[f],e[p])<0)break;o.push(t),s=u(l,h)}return o}function f(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){a[0][o].length;var m=h(o,p);f(0,m)?d.push.apply(d,m):(d.length>0&&l.push(d),d=m)}d.length>0&&l.push(d)}return l};var n=t("compare-angle")},{"compare-angle":125}],386:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var c=o.pop();i[c]=!1;var u=r[c];for(s=0;s0}))).length,g=new Array(m),v=new Array(m);for(p=0;p0;){var N=R.pop(),B=E[N];l(B,(function(t,e){return t-e}));var j,U=B.length,V=F[N];if(0===V){var q=d[N];j=[q]}for(p=0;p=0))if(F[H]=1^V,R.push(H),0===V)O(q=d[H])||(q.reverse(),j.push(q))}0===V&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),c=t("./lib/trim-leaves");function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(v.slabs,v.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-c)*(a-u)/(o-u)+c-n>t&&(s=!s),i=c,o=u}return s}};return e}},{}],127:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function u(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var p=e.linesIntersect(o,s,c,u);if(!1===p){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),h=e.pointsSame(s,u);if(f&&h)return n;var d=!f&&e.pointBetween(o,c,u),m=!h&&e.pointBetween(s,c,u);if(f)return m?l(n,s):l(t,u),n;d&&(h||(m?l(n,s):l(t,u)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,c):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,u)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var h=c(f),d=h.before?h.before.ev:null,m=h.after?h.after.ev:null;function y(){if(d){var t=u(f,d);if(t)return t}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(t)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(v.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(t)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)g=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:g,below:g};r&&r.status(f.seg,!!d&&d.seg,!!m&&m.seg),f.other.status=h.insert(n.node({ev:f}))}else{var _=f.status;if(null===_)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(_.prev)&&s.exists(_.next)&&u(_.prev.ev,_.next.ev),r&&r.statusRemove(_.ev.seg),_.remove(),!f.primary){var b=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=b}p.push(f.seg)}i.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},i.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},i.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},i.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},i.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},i.prototype.scan_ifd=function(t,e,r){var i=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=f,y=0;y0&&(this.ifds_to_read.push({id:s,offset:d[0]}),h=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:p,data_offset:f+this.start,value:d,is_subifd_link:h}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=i,e.exports.get_orientation=function(t){var e=0;try{return new i(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],134:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,a=t("./common").readUInt32BE;function i(t,e){if(t.length<4+e)return null;var r=a(t,e);return t.length>4&15,a=15&t[4],i=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),a=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(f.variants=p.variants),p.orientation&&(f.orientation=p.orientation),p.exif_location&&p.exif_location.offset+p.exif_location.length<=t.length){var h=i(t,p.exif_location.offset),d=t.slice(p.exif_location.offset+h+4,p.exif_location.offset+p.exif_location.length),m=s.get_orientation(d);m>0&&(f.orientation=m)}return f}}}}}}},{"../common":132,"../exif_utils":133,"../miaf_utils":134}],136:[function(t,e,r){"use strict";var n=t("../common").str2arr,a=t("../common").sliceEq,i=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&a(t,0,o))return{width:i(t,18),height:i(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":132}],137:[function(t,e,r){"use strict";var n=t("../common").str2arr,a=t("../common").sliceEq,i=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(a(t,0,o)||a(t,0,s)))return{width:i(t,6),height:i(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":132}],138:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),a=n(t,4);if(0===e&&1===r&&a){for(var i=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":132}],139:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,a=t("../common").str2arr,i=t("../common").sliceEq,o=t("../exif_utils"),s=a("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1])for(var e=2;;){if(t.length-e<2)return;if(255!==t[e++])return;for(var r,a,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&i(t,e,s)&&(a=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=a),c}e+=r}}},{"../common":132,"../exif_utils":133}],140:[function(t,e,r){"use strict";var n=t("../common").str2arr,a=t("../common").sliceEq,i=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&a(t,0,o)&&a(t,12,s))return{width:i(t,16),height:i(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":132}],141:[function(t,e,r){"use strict";var n=t("../common").str2arr,a=t("../common").sliceEq,i=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&a(t,0,o))return{width:i(t,18),height:i(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":132}],142:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function f(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===h&&d>=9?r=r||p(t,e+8):"VP8X"===h&&d>=10?r=r||f(t,e+8):"EXIF"===h&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":132,"../exif_utils":133}],145:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":135,"./parse_sync/bmp":136,"./parse_sync/gif":137,"./parse_sync/ico":138,"./parse_sync/jpeg":139,"./parse_sync/png":140,"./parse_sync/psd":141,"./parse_sync/svg":142,"./parse_sync/tiff":143,"./parse_sync/webp":144}],146:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}a("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,a,o,s;if("string"==typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(i(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],151:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var a=t("./_stream_readable"),i=t("./_stream_writable");t("inherits")(c,a);for(var o=n(i.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new b):S(t,o,e,!0);else if(o.ended)w(t,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):C(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,C(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(P,t))}function P(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function C(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){c("readable nexttick read 0"),t.read(0)}function O(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function N(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(B,e,t))}function B(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?N(this):E(this),null;if(0===(t=L(t,e))&&e.ended)return 0===e.length&&N(this),null;var n,a=e.needReadable;return c("need readable",a),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&N(this)),null!==n&&this.emit("data",n),n},M.prototype._read=function(t){w(this,new _("_read()"))},M.prototype.pipe=function(t,e){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:y;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",y),n.removeListener("data",f),p=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}a.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var p=!1;function f(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==j(a.pipes,t))&&!p&&(c("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function h(e){c("onerror",e),y(),t.removeListener("error",h),0===i(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),y()}function m(){c("onfinish"),t.removeListener("close",d),y()}function y(){c("unpipe"),n.unpipe(t)}return n.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",d),t.once("finish",m),t.emit("pipe",n),a.flowing||(c("pipe resume"),n.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===t&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,c("on readable",a.length,a.reading),a.length?E(this):a.reading||r.nextTick(z,this))),n},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(D,this),n},M.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(D,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(O,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var a in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){(c("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(e.push(a)||(n=!0,t.pause()))})),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function(e){return function(){return t[e].apply(t,arguments)}}(a));for(var i=0;i-1))throw new b(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new m("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,n){var a=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),a.corked&&(a.corked=1,this.uncork()),a.ending||function(t,e,n){e.ending=!0,C(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,a,n),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=p.destroy,M.prototype._undestroy=p.undestroy,M.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":150,"./_stream_duplex":151,"./internal/streams/destroy":158,"./internal/streams/state":162,"./internal/streams/stream":163,_process:147,buffer:61,inherits:115,"util-deprecate":173}],156:[function(t,e,r){(function(r){(function(){"use strict";var n;function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),p=Symbol("handlePromise"),f=Symbol("stream");function h(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[f].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(h(r,!1)))}}function m(t){r.nextTick(d,t)}var y=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a(n={get stream(){return this[f]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(h(void 0,!0))}))}));var n,a=this[u];if(a)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(h(void 0,!0)):e[p](r,n)}),n)}}(a,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[p])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var t=this;return new Promise((function(e,r){t[f].destroy(null,(function(t){t?r(t):e(h(void 0,!0))}))}))})),n),y);e.exports=function(t){var e,r=Object.create(g,(a(e={},f,{value:t,writable:!0}),a(e,o,{value:null,writable:!0}),a(e,s,{value:null,writable:!0}),a(e,l,{value:null,writable:!0}),a(e,c,{value:t._readableState.endEmitted,writable:!0}),a(e,p,{value:function(t,e){var n=r[f].read();n?(r[u]=null,r[o]=null,r[s]=null,t(h(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,i(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":159,_process:147}],157:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,a=o.allocUnsafe(t>>>0),i=this.head,s=0;i;)e=i.data,r=a,n=s,o.prototype.copy.call(e,r,n),s+=i.data.length,i=i.next;return a}},{key:"consume",value:function(t,e){var r;return ta.length?a.length:t;if(i===a.length?n+=a:n+=a.slice(0,t),0==(t-=i)){i===a.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var a=r.data,i=t>a.length?a.length:t;if(a.copy(e,e.length-t,0,i),0==(t-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),i||(o.forEach(c),a(n))}))}));return e.reduce(u)}},{"../../../errors":150,"./end-of-stream":159}],162:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,a){var i=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,a,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(a?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}},{"../../../errors":150}],163:[function(t,e,r){e.exports=t("events").EventEmitter},{events:60}],164:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,a=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=p,e=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function p(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}r.StringDecoder=i,i.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(t.lastNeed=a-1),a;if(--n=0)return a>0&&(t.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":148}],165:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),a=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");a("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function i(t){a("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||i(this),a("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||i(this),a("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||i(this),a("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||i(this),a("write(%o bytes)",t.length),"function"==typeof e&&(r=e),f(this,t,null,r)}function u(t,e,r){this._parserInit||i(this),a("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),f(this,t,e,r)}function p(t,e,r,i){if(t._parserBytesLeft-=e.length,a("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return i;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(h(i));var c=o.apply(t,s);if(!l||i===c)return i}}var f=h((function t(e,r,n,a){return e._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return p(e,r,n,a)}:function(){var i=r.slice(0,e._parserBytesLeft);return p(e,i,n,(function(o){return o?a(o):r.length>i.length?function(){return t(e,r.slice(i.length),n,a)}:void 0}))}}));function h(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:147,assert:54,buffer:61,debug:166}],166:[function(t,e,r){(function(n){(function(){function a(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var a=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(a++,"%c"===t&&(i=a))})),t.splice(i,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=a,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(a())}).call(this)}).call(this,t("_process"))},{"./debug":167,_process:147}],167:[function(t,e,r){var n;function a(t){function e(){if(e.enabled){var t=e,a=+new Date,i=a-(n||a);t.diff=i,t.prev=n,t.curr=a,n=a;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,i,"hour")||s(r,a,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=i)return Math.round(t/i)+"h";if(t>=a)return Math.round(t/a)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],169:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),a=new Array(e),i=new Array(e),o=new Array(e),s=new Array(e),l=0;l0;){e=c[c.length-1];var h=t[e];if(i[e]=0&&s[e].push(o[m])}i[e]=d}else{if(n[e]===r[e]){var y=[],g=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(a[x]=!1,y.push(x),g.push(s[x]),v+=s[x].length,o[x]=p.length,x===e){l.length=d;break}}p.push(y);var _=new Array(v);for(d=0;d=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":147,timers:170}],171:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var a={r:0,g:0,b:0},i=1,l=null,c=null,u=null,p=!1,f=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(S[t])t=S[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(h=e.r,d=e.g,m=e.b,a={r:255*P(h,255),g:255*P(d,255),b:255*P(m,255)},p=!0,f="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),c=z(e.v),a=function(e,r,n){e=6*P(e,360),r=P(r,100),n=P(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),c=a%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),p=!0,f="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),u=z(e.l),a=function(t,e,r){var n,a,i;function o(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}if(t=P(t,360),e=P(e,100),r=P(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,u),p=!0,f="hsl"),e.hasOwnProperty("a")&&(i=e.a));var h,d,m;return i=E(i),{ok:p,format:e.format||f,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,r){t=P(t,255),e=P(e,255),r=P(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),c=(i+l)/2;if(i==l)n=a=0;else{var u=i-l;switch(a=c>.5?u/(2-i-l):u/(i+l),i){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:a,v:i})),i=(i+s)%1;return o}c.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 e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(O(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*P(this._r,255))+"%",g:i(100*P(this._g,255))+"%",b:i(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%)":"rgba("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+h(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);r="#"+h(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(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(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),a=c(e).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(e,r){var n=c(e),a=c(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,a,i=c.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.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"},L=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function P(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function C(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,N,B,j=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],172:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).topojson=t.topojson||{})}(this,(function(t){"use strict";function e(t){return t}function r(t){if(null==t)return e;var r,n,a=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=2,c=t.length,u=new Array(c);for(u[0]=(r+=t[0])*a+o,u[1]=(n+=t[1])*i+s;lo&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[a,i,o,s]}function a(t,e){var r=e.id,n=e.bbox,a=null==e.properties?{}:e.properties,o=i(t,e);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(t,e){var n=r(t.transform),a=t.arcs;function i(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],i=0,o=r.length;i1)n=l(t,e,r);else for(a=0,n=new Array(i=t.arcs.length);a1)for(var i,s,c=1,u=l(a[0]);cu&&(s=a[0],a[0]=a[c],a[c]=s,u=i);return a})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[a]=2))throw new Error("n must be \u22652");var r,a=(l=t.bbox||n(t))[0],i=l[1],o=l[2],s=l[3];e={scale:[o-a?(o-a)/(r-1):1,s-i?(s-i)/(r-1):1],translate:[a,i]}}var l,c,u=p(e),f=t.objects,h={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in f)h[c]=m(f[c]);return{type:"Topology",bbox:l,transform:e,objects:h,arcs:t.arcs.map((function(t){var e,r=0,n=1,a=t.length,i=new Array(a);for(i[0]=u(t[0],0);++r2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=f[o-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(a=i.newDate(l,c,u)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(p/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=p[t-p[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=p[o.year-p[0]],h=u>>13;c=h&&(o.month>h||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=f[a.year-f[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=f[i.year-f[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);l=Math.round((u-c)/864e5);var h,d=p[i.year-p[0]];for(h=0;h<13;h++){var m=d&1<<12-h?30:29;if(l>13;!y||h=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(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"};n.calendars.discworld=i},{"../main":188,"object-assign":122}],177:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.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,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":188,"object-assign":122}],178:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.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(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":188,"object-assign":122}],179:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+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)}}),n.calendars.islamic=i},{"../main":188,"object-assign":122}],180:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":188,"object-assign":122}],181:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.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)}}),n.calendars.mayan=i},{"../main":188,"object-assign":122}],182:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.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,n.local.invalidYear||n.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,n.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 a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=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)}}),n.calendars.nanakshahi=i},{"../main":188,"object-assign":122}],183:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),p=t-this.toJD(l,u,1)+1;return this.newDate(l,u,p)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":188,"object-assign":122}],185:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.taiwan=o},{"../main":188,"object-assign":122}],186:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.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)}}),n.calendars.thai=o},{"../main":188,"object-assign":122}],187:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)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 a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;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":188,"object-assign":122}],188:[function(t,e,r){var n=t("object-assign");function a(){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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.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,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).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="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.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){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}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 a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new a;c.cdate=i,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":122}],189:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.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"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.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 a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,p=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,h=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(h(t,n))for(;a.length1},x=function(t,r){var n=v(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(M).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var t=l.call(_,e.substring(M));return M+=t.length,t}return x("m")},w=function(t,r,n,i){for(var o=v(t,i)?n:r,s=0;s-1){h=1,d=m;for(var L=this.daysInMonth(f,h);d>L;L=this.daysInMonth(f,h))h++,d-=L}return p>-1?this.fromJD(p):this.newDate(f,h,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":188,"object-assign":122}],190:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],191:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":314,"../../plot_api/plot_template":379,"../../plots/cartesian/constants":397,"../../plots/font_attributes":419,"./arrow_paths":190}],192:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],c=t["a"+i+"ref"],u=t["_"+i+"padplus"],p=t["_"+i+"padminus"],f={x:1,y:-1}[i]*t[i+"shift"],h=3*t.arrowsize*t.arrowwidth||0,d=h+f,m=h-f,y=3*t.startarrowsize*t.arrowwidth||0,g=y+f,v=y-f;if(c===l){var x=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),_=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,g),ppadminus:Math.max(p,v)});r={min:[x.min[0],_.min[0]],max:[x.max[0],_.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":342,"../../plots/cartesian/axes":390,"./draw":197}],193:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,c,u=t._fullLayout.annotations,p=[],f=[],h=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),p={},f=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Z=!1,X=["x","y"],W=0;W1)&&(nt===rt?((ht=at.r2fraction(e["a"+et]))<0||ht>1)&&(Z=!0):Z=!0),K=at._offset+at.r2p(e[et]),Q=.5}else{var dt="domain"===ft;"x"===et?($=e[et],K=dt?at._offset+at._length*$:K=T.l+T.w*$):($=1-e[et],K=dt?at._offset+at._length*$:K=T.t+T.h*$),Q=e.showarrow?.5:$}if(e.showarrow){pt.head=K;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var yt=l.getRefType(nt);"domain"===yt?("y"===et&&(mt=1-mt),pt.tail=at._offset+at._length*mt):"paper"===yt?"y"===et?(mt=1-mt,pt.tail=T.t+T.h*mt):pt.tail=T.l+T.w*mt:pt.tail=at._offset+at.r2p(mt),J=tt}else pt.tail=K+mt,J=tt+mt;pt.text=pt.tail+tt;var gt=w["x"===et?"width":"height"];if("paper"===rt&&(pt.head=o.constrain(pt.head,1,gt-1)),"pixel"===nt){var vt=-Math.max(pt.tail-3,pt.text),xt=Math.min(pt.tail+3,pt.text)-gt;vt>0?(pt.tail+=vt,pt.text+=vt):xt>0&&(pt.tail-=xt,pt.text-=xt)}pt.tail+=ut,pt.head+=ut}else J=tt=lt*H(Q,ct),pt.text=K+tt;pt.text+=ut,tt+=ut,J+=ut,e["_"+et+"padplus"]=lt/2+J,e["_"+et+"padminus"]=lt/2-J,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Z)R.remove();else{var _t=0,bt=0;if("left"!==e.align&&(_t=(M-_)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),p)n.select("svg").attr({x:B+_t-1,y:B+bt}).call(u.setClipUrl,U?E:null,t);else{var wt=B+bt-m.top,Tt=B+_t-m.left;G.call(f.positionText,Tt,wt).call(u.setClipUrl,U?E:null,t)}V.select("rect").call(u.setRect,B,B,M,O),j.call(u.setRect,F/2,F/2,N-F,q-F),R.call(u.setTranslate,Math.round(P.x.text-N/2),Math.round(P.y.text-q/2)),D.attr({transform:"rotate("+C+","+P.x.text+","+P.y.text+")"});var kt,Mt=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=P.x.head,p=P.y.head,f=P.x.tail+r,h=P.y.tail+n,m=P.x.text+r,_=P.y.text+n,b=o.rotationXYMatrix(C,m,_),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),E=+j.attr("width"),z=+j.attr("height"),O=m-.5*E,F=O+E,N=_-.5*z,B=N+z,U=[[O,N,O,B],[O,B,F,B],[F,B,F,N],[F,N,O,N]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,p,l+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(f,h,l,p,t[0],t[1],t[2],t[3]);e&&(f=e.x,h=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=I.append("g").style({opacity:c.opacity(q)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+f+","+h+"L"+l+","+p).style("stroke-width",V+"px").call(c.stroke,c.rgb(q));if(y(Y,H,e),k.annotationPosition&&Y.node().parentNode&&!i){var Z=l,X=p;if(e.standoff){var W=Math.sqrt(Math.pow(l-f,2)+Math.pow(p-h,2));Z+=e.standoff*(f-l)/W,X+=e.standoff*(h-p)/W}var K,J,$=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(h-X),transform:s(Z,X)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:$.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);K=t.x,J=t.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(K,J),a=n[0]+t,i=n[1]+r;R.call(u.setTranslate,a,i),S("x",v(g,t,"x",T,e)),S("y",v(x,r,"y",T,e)),e.axref===e.xref&&S("ax",v(g,t,"ax",T,e)),e.ayref===e.yref&&S("ay",v(x,r,"ay",T,e)),G.attr("transform",s(t,r)),D.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,L());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(g,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(x,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(g)a=v(g,t,"x",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;a=d.align(c+t/T.w,l,0,1,e.xanchor)}if(x)o=v(x,r,"y",T,e);else{var u=e._ysize/T.h,p=e.y-(e._yshift+e.yshift)/T.h-u/2;o=d.align(p-r/T.h,u,0,1,e.yanchor)}S("x",a),S("y",o),g&&x||(n=d.getCursor(g?.5:a,x?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+kt}),h(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){h(R),a.call("_guiRelayout",t,L());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=e.indexOf("end")>=0,_=d.backoff*y+r.standoff,b=m.backoff*g+r.startstandoff;if("line"===h.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(p=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void z();if(_){if(_*_>w*w+T*T)return void z();var k=_*Math.cos(p),M=_*Math.sin(p);u.x+=k,u.y+=M,t.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void z();var A=b*Math.cos(p),S=b*Math.sin(p);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===h.nodeName){var L=h.getTotalLength(),E="";if(L<_+b)return void z();var P=h.getPointAtLength(0),C=h.getPointAtLength(.1);p=Math.atan2(P.y-C.y,P.x-C.x),o=h.getPointAtLength(Math.min(b,L)),E="0px,"+b+"px,";var I=h.getPointAtLength(L),D=h.getPointAtLength(L-.1);f=Math.atan2(I.y-D.y,I.x-D.x),u=h.getPointAtLength(Math.max(0,L-_)),E+=L-(E?b+_:_)+"px,"+L+"px",t.style("stroke-dasharray",E)}function z(){t.style("stroke-dasharray","0px,100px")}function O(e,i,o,u){e.path&&(e.noRotate&&(o=0),n.select(h.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:c(i.x,i.y)+l(180*o/Math.PI)+s(u)}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}v&&O(m,o,p,g),x&&O(d,u,f,y)}},{"../../lib":342,"../color":208,"./arrow_paths":190,"@plotly/d3":44}],199:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":403,"./attributes":191,"./calc_autorange":192,"./click":193,"./convert_coords":195,"./defaults":196,"./draw":197}],200:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll,i=t("../../plot_api/plot_template").templatedArray;e.exports=a(i("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../annotations/attributes":191}],201:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes");function i(t,e){var r=e.fullSceneLayout.domain,i=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),a.setConvert(t._xa),t._xa._offset=i.l+r.x[0]*i.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*i.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),a.setConvert(t._ya),t._ya._offset=i.t+(1-r.y[1])*i.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*i.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":428,"../annotations/draw":197}],204:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=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+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||c).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,c))),(a.isDark()?e?a.lighten(e):c:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>u&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var K=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Z*=K*c.roundUp(W/K,[2,5,10]),(Math.abs(P.start)/P.size+1e-6)%1<2e-6&&(Y.tick0=0)}Y.dtick=Z}Y.domain=[q+j,q+F-j],Y.setScale(),t.attr("transform",u(Math.round(l.l),Math.round(l.t)));var J,$=t.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(l.l),-Math.round(l.t))),Q=t.select("."+M.cbaxis),tt=0;function et(n,a){var i={propContainer:Y,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),m.draw(r,n,p(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+N)*l.w,n=Y.title.font.size;t="top"===A?(1-(q+F-j))*l.h+l.t+3+.75*n:(1-(q+j))*l.h+l.t-3-.25*n,et(Y._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=t.select("."+M.cbtitle),o=i.select("text"),p=[-e.outlinewidth/2,e.outlinewidth/2],f=i.select(".h"+Y._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),f?(tt=h.bBox(f).height)>d&&(p[1]-=(tt-d)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=h.bBox(o.node()).height),tt){if(tt+=5,"top"===A)Y.domain[1]-=tt/l.h,p[1]*=-1;else{Y.domain[0]+=tt/l.h;var m=y.lineCount(o);p[1]+=(1-m)*d}i.attr("transform",u(p[0],p[1])),Y.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",u(0,Math.round(l.h*(1-Y.domain[1])))),Q.attr("transform",u(0,Math.round(-l.t)));var v=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(I);v.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),v.exit().remove();var x=S.map(Y.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?S[0]:(I[i]+I[i-1])/2,i===I.length-1?S[1]:(I[i]+I[i+1])/2].map(Y.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var s=n.select(this).attr({x:U,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=E(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var _=t.select("."+M.cblines).selectAll("path."+M.cbline).data(g.color&&g.width?D:[]);_.enter().append("path").classed(M.cbline,!0),_.exit().remove(),_.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(Y.c2p(t))+g.width/2%1)+"h"+z).call(h.lineGroupStyle,g.width,L(t),g.dash)})),Q.selectAll("g."+Y._id+"tick,path").remove();var b=U+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(Y),k=s.getTickSigns(Y)[2];return s.drawTicks(r,Y,{vals:"inside"===Y.ticks?s.clipEnds(Y,T):T,layer:Q,path:s.makeTickPath(Y,b,k),transFn:s.makeTransTickFn(Y)}),s.drawLabels(r,Y,{vals:T,layer:Q,transFn:s.makeTransTickLabelFn(Y),labelFns:s.makeLabelFns(Y,b)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=Y.title.font.size,e=Y._offset+Y._length/2,a=l.l+(Y.position||0)*l.w+("right"===Y.side?10+t*(Y.showticklabels?1:.5):-10-t*(Y.showticklabels?.5:0));et("h"+Y._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Y._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+e.outlinewidth/2;if(-1===Y.ticklabelposition.indexOf("inside")&&(n+=h.bBox(Q.node()).width),(J=$.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=$.select(".h"+Y._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?h.bBox(o).width:h.bBox($.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=H-G;t.select("."+M.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(s,2),height:Math.max(c+2*B,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:U,y:G+e.ypad+("top"===A?tt:0),width:Math.max(z,2),height:Math.max(c-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var p=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",u(l.l-p,l.t));var f={},m=T[e.yanchor],y=k[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=c*m,f.b=c*y):(f.t=f.b=0,f.yt=e.y+e.len*m,f.yb=e.y-e.len*y);var g=T[e.xanchor],v=k[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*g,f.r=s*v;else{var x=s-z;f.l=x*g,f.r=x*v,f.xl=e.x-e.thickness*g,f.xr=e.x+e.thickness*v}i.autoMargin(r,e._id,f)}],r)}(r,e,t);g&&g.then&&(t._promises||[]).push(g),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var c=l.getCursor(a,i,e.xanchor,e.yanchor);f(t,c)},doneFn:function(){if(f(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":313,"../../lib":342,"../../lib/extend":333,"../../lib/setcursor":362,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../plots/cartesian/axis_defaults":392,"../../plots/cartesian/layout_attributes":405,"../../plots/cartesian/position_defaults":408,"../../plots/plots":438,"../../registry":452,"../color":208,"../colorscale/helpers":219,"../dragelement":227,"../drawing":230,"../titles":306,"./constants":210,"@plotly/d3":44,tinycolor2:171}],213:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":342}],214:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":209,"./defaults":211,"./draw":212,"./has_colorbar":213}],215:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===i,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,p=e.editTypeOverride||"",f=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(f+(r={z:"z",c:"color"}[i]));var h=i+"auto",d=i+"min",m=i+"max",y=i+"mid",g=(s(f+h),s(f+d),s(f+m),{});g[d]=g[m]=void 0;var v={};v[h]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(x.color.anim=!0)),x[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":358,"../../lib/sort_object_keys":363,"../colorbar/attributes":209,"./scales.js":223}],216:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?a.nestedProperty(e,c).get():e,p=i(u),f=!1!==p.auto,h=p.min,d=p.max,m=p.mid,y=function(){return a.aggNums(Math.min,null,l)},g=function(){return a.aggNums(Math.max,null,l)};(void 0===h?h=y():f&&(h=u._colorAx&&n(h)?Math.min(h,y()):y()),void 0===d?d=g():f&&(d=u._colorAx&&n(d)?Math.max(d,g()):g()),f&&void 0!==m&&(d-m>m-h?h=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":342,"./helpers":219,"fast-isnumeric":81}],217:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],225:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":342}],226:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],227:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");function u(){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 p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,f,h,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,x=t.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=b,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=b,x.addEventListener("touchstart",b,{passive:!1})):x.ontouchstart=b;var _=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,h),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=u},{"../../lib":342,"../../plots/cartesian/constants":397,"./align":224,"./cursor":225,"./unhover":228,"has-hover":112,"has-passive-events":113,"mouse-event-offset":120}],228:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":331,"../../lib/events":332,"../../lib/throttle":366,"../fx/constants":242}],229:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],230:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),p=a.strTranslate,f=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,y=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,x=e.exports={};x.font=function(t,e,r,n){a.isPlainObject(e)&&(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(c.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,a){t.call(x.setPosition,e,r).call(x.setSize,n,a)},x.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",p(a,i)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);x.translatePoint(t,a,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,c=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";c.stroke(e,n||i.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(c.fill,e)},x.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(c.fill,t[0].trace.fillcolor)}))};var _=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var b=x.symbolNames.length;function w(t,e){var r=t%100;return x.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(t))t=+t;else 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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=b||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=i("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(t,e,r,i,o,l){for(var u=o.length,p=A[i],f=new Array(u),h=0;h"+g(t);d._gradientUrlQueryParts[v]=1},x.pattern=function(t,e,r,i,o,s,l,u,p,f,h,d){var m="legend"===e;u&&("overlay"===p?(f=u,h=c.contrast(f)):(f=void 0,h=u));var y,g,v,x,_,b,w,T,k,M,A,S=r._fullLayout,L="p"+S._uid+"-"+i,E={};switch(o){case"/":y=s*Math.sqrt(2),g=s*Math.sqrt(2),b="path",E={d:v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2,opacity:d,stroke:h,"stroke-width":(x=l*s)+"px"};break;case"\\":y=s*Math.sqrt(2),g=s*Math.sqrt(2),b="path",E={d:v="M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,opacity:d,stroke:h,"stroke-width":(x=l*s)+"px"};break;case"x":y=s*Math.sqrt(2),g=s*Math.sqrt(2),v="M-"+y/4+","+g/4+"l"+y/2+",-"+g/2+"M0,"+g+"L"+y+",0M"+y/4*3+","+g/4*5+"l"+y/2+",-"+g/2+"M"+y/4*3+",-"+g/4+"l"+y/2+","+g/2+"M0,0L"+y+","+g+"M-"+y/4+","+g/4*3+"l"+y/2+","+g/2,x=s-s*Math.sqrt(1-l),b="path",E={d:v,opacity:d,stroke:h,"stroke-width":x+"px"};break;case"|":b="path",b="path",E={d:v="M"+(y=s)/2+",0L"+y/2+","+(g=s),opacity:d,stroke:h,"stroke-width":(x=l*s)+"px"};break;case"-":b="path",b="path",E={d:v="M0,"+(g=s)/2+"L"+(y=s)+","+g/2,opacity:d,stroke:h,"stroke-width":(x=l*s)+"px"};break;case"+":b="path",v="M"+(y=s)/2+",0L"+y/2+","+(g=s)+"M0,"+g/2+"L"+y+","+g/2,x=s-s*Math.sqrt(1-l),b="path",E={d:v,opacity:d,stroke:h,"stroke-width":x+"px"};break;case".":y=s,g=s,l.pattern_filled";S._patternUrlQueryParts[I]=1},x.initGradients=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},x.initPatterns=function(t){var e=t._fullLayout;a.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},x.getPatternAttr=function(t,e,r){return t&&a.isArrayOrTypedArray(t)?e=100,e.attr("d",w(u,l))}var p,f,h,d=!1;if(t.so)h=s.outlierwidth,f=s.outliercolor,p=o.outliercolor;else{var m=(s||{}).width;h=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in t?t.mlcc=n.lineScale(t.mlc):a.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,p).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:h)+"px");var y=o.gradient,g=t.mgt;g?d=!0:g=y&&y.type,a.isArrayOrTypedArray(g)&&(g=g[0],A[g]||(g=0));var v=o.pattern,_=v&&x.getPatternAttr(v.shape,t.i,"");if(g&&"none"!==g){var b=t.mgc;b?d=!0:b=y.color;var T=r.uid;d&&(T+="-"+t.i),x.gradient(e,i,T,g,[[0,b],[1,p]],"fill")}else if(_){var k=x.getPatternAttr(v.bgcolor,t.i,null),M=x.getPatternAttr(v.fgcolor,t.i,null),S=v.fgopacity,L=x.getPatternAttr(v.size,t.i,8),E=x.getPatternAttr(v.solidity,t.i,.3),P=t.mcc||a.isArrayOrTypedArray(v.shape)||a.isArrayOrTypedArray(v.bgcolor)||a.isArrayOrTypedArray(v.size)||a.isArrayOrTypedArray(v.solidity),C=r.uid;P&&(C+="-"+t.i),x.pattern(e,"point",i,C,_,L,E,t.mcc,v.fillmode,k,M,S)}else c.fill(e,p);h&&c.stroke(e,f)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=y.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},c=i.opacity,u=o.opacity,p=s.opacity,f=void 0!==u,h=void 0!==p;(a.isArrayOrTypedArray(c)||f||h)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?f?u:e:h?p:m*e});var d=i.color,y=o.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?y||e:g||e});var v=i.size,x=o.size,_=s.size,b=void 0!==x,w=void 0!==_;return l.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?x/2:e:w?_/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",w(x.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}x.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,p=u?u(t,e,l):{},h={};v(h,e,t.i);var d=e._meta||{};c=a.texttemplateString(c,p,l._d3locale,h,t,d)}var m=t.tp||e.textposition,y=E(t,e),g=i?i(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,y,g).text(c).call(f.convertToTspans,r).call(L,m,y,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=E(t,e);c.fill(a,i),L(a,o,s,t.mrc2||t.mrc)}))}};function P(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(i*i+o*o,.25),u=Math.pow(s*s+l*l,.25),p=(u*u*i-c*c*s)*a,f=(u*u*o-c*c*l)*a,h=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(h&&p/h),2),n.round(e[1]+(h&&f/h),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&f/d),2)]]}x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(x.savedBBoxes={},D=0),r&&(x.savedBBoxes[r]=y),D++,a.extendFlat({},y)},x.setClipUrl=function(t,e,r){t.attr("clip-path",O(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=p(e,r)).trim(),t[a]("transform",i),i},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var R=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(F);t=1===e&&1===r?[]:[p(o,s),"scale("+e+","+r+")",p(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":244,"../../constants/alignment":313,"../../constants/interactions":318,"../../constants/xmlns_namespaces":320,"../../lib":342,"../../lib/svg_text_utils":365,"../../registry":452,"../../traces/scatter/make_bubble_size_func":722,"../../traces/scatter/subtypes":730,"../color":208,"../colorscale":220,"./symbol_defs":231,"@plotly/d3":44,"fast-isnumeric":81,tinycolor2:171}],231:[function(t,e,r){"use strict";var n=t("@plotly/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,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+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),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+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),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":44}],232:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],233:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),p=0;p0;e.each((function(e){var p,f=e[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(p=function(t){return t.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){h.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,t),y.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};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)));return n}(t,l,c);if(!m||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var p=d.width;i="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(i+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var f=e.select("path.xerror");if(h.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(h.copy_ystyle?d:h).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(s.duration).ease(s.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":730,"../drawing":230,"@plotly/d3":44,"fast-isnumeric":81}],238:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":208,"@plotly/d3":44}],239:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":333,"../../plots/font_attributes":419,"./layout_attributes":249}],240:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||it<0||it>b[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=it+b[0]._offset,N="xval"in e?g.flat(s,e.xval):g.p2c(_,at),V="yval"in e?g.flat(s,e.yval):g.p2c(b,it),!a(N[0])||!a(V[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(H=0;HQ&&(tt.splice(0,Q),ct=tt[0].distance),m&&0!==D&&0===tt.length){$.distance=D,$.index=!1;var p=Y._module.hoverPoints($,K,J,"closest",{hoverLayer:l._hoverlayer});if(p&&(p=p.filter((function(t){return t.spikeDistance<=D}))),p&&p.length){var f,d=p.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var y=d[0];a(y.x0)&&a(y.y0)&&(f=ft(y),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>f.spikeDistance)&&(rt.vLinePoint=f))}var v=p.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var x=v[0];a(x.x0)&&a(x.y0)&&(f=ft(x),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>f.spikeDistance)&&(rt.hLinePoint=f))}}}}}function pt(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)Pt(tt[At]);tt=St,yt()}var Ct=t._hoverdata,It=[],Dt=j(t),zt=U(t);for(q=0;q1||tt.length>1)||"closest"===S&&nt&&tt.length>1,Zt=h.combine(l.plot_bgcolor||h.background,l.paper_bgcolor),Xt=I(tt,{gd:t,hovermode:S,rotateLabels:Yt,bgColor:Zt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});g.isUnifiedHover(S)||(!function(t,e,r){var n,a,i,o,s,l,c,u=0,p=1,f=t.size(),h=new Array(f),d=0;function m(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(p=-1),h[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),h.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=a;for(y.push.apply(y,g),h.splice(o+1,1),c=0,s=y.length-1;s>=0;s--)c+=y[s].dp;for(i=c/y.length,s=y.length-1;s>=0;s--)y[s].dp-=i;n=!1}else o++}h.forEach(m)}for(o=h.length-1;o>=0;o--){var _=h[o];for(s=_.length-1;s>=0;s--){var b=_[s],w=b.datum;w.offset=b.dp,w.del=b.del}}}(Xt,Yt?"xa":"ya",l),z(Xt,Yt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Wt=y.getComponentMethod("annotations","hasClickToShow")(t,It);p(n.select(e.target),Wt?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,Ct))return;Ct&&t.emit("plotly_unhover",{event:e,points:Ct});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:b,xvals:N,yvals:V})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),p=Math.max(r,n),f=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,p+=v,f+=x,d+=x}c.bbox={x0:u+o,x1:p+o,y0:f+i,y1:d+i},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||h.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,c=e.rotateLabels,p=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{},T=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,M=t[0],L=M.xa,E=M.ya,C=i.charAt(0),I=M[C+"Label"],z=m.getBoundingClientRect(),O=z.top,R=z.width,F=z.height,N=void 0!==I&&M.distance<=e.hoverdistance&&("x"===i||"y"===i);if(N){var B,j,U=!0;for(B=0;Ba.width-_?(y=a.width-_,e.attr("d","M"+(_-A)+",0L"+_+","+x+A+"v"+x+(2*S+v.height)+"H-"+_+"V"+x+A+"H"+(_-2*A)+"Z")):e.attr("d","M0,0L"+A+","+x+A+"H"+(S+v.width/2)+"v"+x+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var b,P,C;"right"===E.side?(b="start",P=1,C="",y=L._offset+L._length):(b="end",P=-1,C="-",y=L._offset),g=E._offset+(M.y0+M.y1)/2,l.attr("text-anchor",b),e.attr("d","M0,0L"+C+A+","+A+"V"+(S+v.height/2)+"h"+C+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+C+A+"V-"+A+"Z");var D,z=v.height/2,R=O-v.top-z,F="clip"+a._uid+"commonlabel"+E._id;if(y=0?nt:at+st=0?at:mt+st=0?et:rt+lt=0?rt:yt+lt=0,"top"!==t.idealAlign&&C||!z?C?(U+=q/2,t.anchor="start"):t.anchor="middle":(U-=q/2,t.anchor="end");else if(t.pos=U,C=j+V/2+H<=R,z=j-V/2-H>=0,"left"!==t.idealAlign&&C||!z)if(C)j+=V/2,t.anchor="start";else{t.anchor="middle";var G=H/2,Y=j+G-R,Z=j-G;Y>0&&(j-=Y),Z<0&&(j+=-Z)}else j-=V/2,t.anchor="end";w.attr("text-anchor",t.anchor),L&&M.attr("text-anchor",t.anchor),e.attr("transform",s(j,U)+(c?l(b):""))})),gt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=N(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===a?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var p=t.hovertemplate||!1;if(p){var f=t.hovertemplateLabels||t;t[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),l=(l=o.hovertemplateString(p,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(C,(function(e,r){return s=N(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],p=c*(A+S),h=p+c*(t.txwidth+S),d=0,m=t.offset,y="middle"===s;y&&(p-=t.tx2width/2,h+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",y?"M-"+i(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*A+d)+"V"+o(m-A)+"Z");var g=d+p,v=m+t.ty0-t.by/2+S,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==s?(a.attr("text-anchor","start"),g=y?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===x&&"end"!==s&&(a.attr("text-anchor","end"),g=y?t.bx/2-t.tx2width/2-S:t.bx+S)),a.call(u.positionText,i(g),o(v)),t.tx2width&&(r.select("text.name").call(u.positionText,i(h+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(f.setRect,i(h+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var c=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var a=c(r,n);l(a)&&(t[e]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||u){var d=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,_,b=i.readability(v.color,d)<1.5?h.contrast(d):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,M=m.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,_=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),x=l.l+A*l.w,_=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:_,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:_,y1:g,y2:g,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(p){var L,E,P=e.vLinePoint;n=P&&P.xa,a=P&&P.ya,"cursor"===n.spikesnap?(L=c.pointerX,E=c.pointerY):(L=n._offset+P.x,E=a._offset+P.y);var C,I,D=i.readability(P.color,d)<1.5?h.contrast(d):P.color,z=n.spikemode,O=n.spikethickness,R=n.spikecolor||D,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(C=F,I=E),-1!==z.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),C=l.t+(1-B)*l.h,I=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:C,y2:I,"stroke-width":O,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:C,y2:I,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function N(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}},{"../../lib":342,"../../lib/events":332,"../../lib/override_cursor":353,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"../legend/defaults":260,"../legend/draw":261,"./constants":242,"./helpers":244,"@plotly/d3":44,"fast-isnumeric":81,tinycolor2:171}],246:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":342,"../color":208,"./helpers":244}],247:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":342,"./layout_attributes":249}],248:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":342,"../dragelement":227,"./attributes":239,"./calc":240,"./click":241,"./constants":242,"./defaults":243,"./helpers":244,"./hover":245,"./layout_attributes":249,"./layout_defaults":250,"./layout_global_defaults":251,"@plotly/d3":44}],249:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":419,"./constants":242}],250:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":342,"./hoverlabel_defaults":246,"./hovermode_defaults":247,"./layout_attributes":249}],251:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":342,"./hoverlabel_defaults":246,"./layout_attributes":249}],252:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),c=s[0],u=(s[1]-c)/(a-o),p=u*(1-o),f=0;f1){if(!f&&!h&&!d)"independent"===k("pattern")&&(f=!0);y._hasSubplotGrid=f;var x,_,b="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),y._domains={x:u("x",k,w,x,v),y:u("y",k,T,_,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,u,f=t.grid||{},h=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var x=f.subplots||[];l=r.subplots=new Array(m);var _=1;for(n=0;n1);if(!1!==m||c.uirevision){var y=i.newContainer(e,"legend");if(T("uirevision",e.uirevision),!1!==m){T("bgcolor",e.paper_bgcolor),T("bordercolor"),T("borderwidth");var g,v,x,_=a.coerceFont(T,"font",e.font),b="h"===T("orientation");if(b?(g=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,x="bottom"):(v=-.1,x="top")):(g=1.02,v=1,x="auto"),T("traceorder",f),l.isGrouped(e.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",g),T("xanchor"),T("y",v),T("yanchor",x),T("valign"),a.noneOrAll(c,y,["x","y"]),T("title.text")){T("title.side",b?"left":"top");var w=a.extendFlat({},_,{size:a.bigFont(_.size)});a.coerceFont(T,"title.font",w)}}}function T(t,e){return a.coerce(c,y,o,t,e)}}},{"../../lib":342,"../../plot_api/plot_template":379,"../../plots/layout_attributes":429,"../../registry":452,"./attributes":258,"./helpers":264}],261:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),p=t("../../lib/svg_text_utils"),f=t("./handle_click"),h=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),x=t("./style"),_=t("./helpers");function b(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&f(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&f(r,t,n)}}function w(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),f=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var m=a.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?T(n,d):n);var y=r.itemwidth+2*h.itemGap;p.positionText(m,y,0),f?m.call(p.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(M,t,e,r);var i=s.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),p=u[u.length-1],f=a.keyedContainer(i,"transforms["+p+"].styles","target","value.name");f.set(s.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}})))}function M(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,d=s.size*m;if(o){var y=c.bBox(o);u=y.height,f=y.width,1===n?c.setTranslate(i,l,l+.75*u):c.setTranslate(i,0,.25*u)}else{var g=t.select(1===n?".legendtitletext":".legendtext"),v=p.lineCount(g),x=g.node();if(u=d*v,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*h.itemGap),p.positionText(g,l+h.titlePad,l+d);else{var _=2*h.itemGap+r.itemwidth;a.groupTitle&&(_=h.itemGap,f-=r.itemwidth),p.positionText(g,_,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=d,a.height=Math.max(u,16)+3,a.width=f)}(e,r,n,a)}))}function A(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function S(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,p=t._fullLayout,f="legend"+p._uid,d=e._inHover;d?(r=e.layer,f+="-hover"):r=p._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=p.showlegend&&v(t.calcdata,e)}var m=p.hiddenlabels||[];if(!(d||p.showlegend&&s.length))return r.selectAll(".legend").remove(),p._topdefs.select("#"+f).remove(),i.autoMargin(t,"legend");var T=a.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),L=a.ensureSingleById(p._topdefs,"clipPath",f,(function(t){t.append("rect")})),E=a.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));E.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var P=a.ensureSingle(T,"g","scrollbox"),C=e.title;if(e._titleWidth=0,e._titleHeight=0,C.text){var I=a.ensureSingle(P,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,C.font).text(C.text),M(I,P,t,e,1)}else P.selectAll(".legendtitletext").remove();var D=a.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(h.scrollBarEnterAttrs).call(u.fill,h.scrollBarColor)})),z=P.selectAll("g.groups").data(s);z.enter().append("g").attr("class","groups"),z.exit().remove();var O=z.selectAll("g.traces").data(a.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){d||n.select(this).call(k,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=_.isVertical(a),l=_.isGrouped(a),u=a.borderwidth,p=2*u,f=h.itemGap,d=a.itemwidth+2*f,m=2*(u+f),y=S(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y,x=a.tracegroupgap;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var b=0;a._width=0,a._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+w[0],u+w[1]+a._height+e/2+f),a._height+=e,a._width=Math.max(a._width,t[0].width)})),b=d+a._width,a._width+=f+d+p,a._height+=m,l&&(e.each((function(t,e){c.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var T=A(a),k=a.x<0||0===a.x&&"right"===T,M=a.x>1||1===a.x&&"left"===T,L=v||g,E=i.width/2;a._maxWidth=Math.max(k?L&&"left"===T?o.l+o.w:E:M?L&&"right"===T?o.r+o.w:E:o.w,2*d);var P=0,C=0;r.each((function(t){var e=t[0].width+d;P=Math.max(P,e),C+=e})),b=null;var I=0;if(l){var D=0,z=0,O=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+f+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),D=Math.max(D,e);var r=t+f;r+u+z>a._maxWidth&&(I=Math.max(I,z),z=0,O+=D+x,D=e),c.setTranslate(this,z,O),z+=r})),a._width=Math.max(I,z)+u,a._height=O+D+m}else{var R=r.size(),F=C+p+(R-1)*f=a._maxWidth&&(I=Math.max(I,U),B=0,j+=N,a._height+=N,N=0),c.setTranslate(this,w[0]+u+B,w[1]+u+j+e/2+f),U=B+r+f,B+=n,N=Math.max(N,e)})),F?(a._width=B+p,a._height=N+m):(a._width=Math.max(I,U)+p,a._height+=N+m)}}a._width=Math.ceil(Math.max(a._width+w[0],a._titleWidth+2*(u+h.titlePad))),a._height=Math.ceil(Math.max(a._height+w[1],a._titleHeight+2*(u+h.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=t._context.edits,q=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=q?d:b||d+t[0].width;s||(a+=f/2),c.setRect(e,0,-r/2,a,r)}))}(t,z,O,e)},function(){if(d||!function(t){var e=t._fullLayout.legend,r=A(e),n=S(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t)){var s,u,m,v,x=p._size,_=e.borderwidth,w=x.l+x.w*e.x-y[A(e)]*e._width,k=x.t+x.h*(1-e.y)-y[S(e)]*e._effHeight;if(!d&&p.margin.autoexpand){var M=w,C=k;w=a.constrain(w,0,p.width-e._width),k=a.constrain(k,0,p.height-e._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==C&&a.log("Constrain legend.y to make legend fit inside graph")}if(d||c.setTranslate(T,w,k),D.on(".drag",null),T.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;d&&(I=e._height),E.attr({width:e._width-_,height:I-_,x:_/2,y:_/2}),c.setTranslate(P,0,0),L.select("rect").attr({width:e._width-2*_,height:I-2*_,x:_,y:_}),c.setClipUrl(P,f,t),c.setRect(D,0,0,0,0),delete e._scrollY}else{var z,O,R,F=Math.max(h.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),N=e._effHeight-F-2*h.scrollBarMargin,B=e._height-e._effHeight,j=N/B,U=Math.min(e._scrollY||0,B);E.attr({width:e._width-2*_+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-_,x:_/2,y:_/2}),L.select("rect").attr({width:e._width-2*_+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-2*_,x:_,y:_+U}),c.setClipUrl(P,f,t),H(U,F,j),T.on("wheel",(function(){H(U=a.constrain(e._scrollY+n.event.deltaY/N*B,0,B),F,j),0!==U&&U!==B&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,B)}(R,z,O),F,j))}));D.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,H(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,B)}(R,z,O),F,j))}));P.call(q)}if(t._context.edits.legendPosition)T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=c.getTranslate(T);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,a=v+r;c.setTranslate(T,n,a),s=l.align(n,0,x.l,x.l+x.w,e.xanchor),u=l.align(a,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&b(t,T,a,e,n)}})}function H(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(P,0,-r),c.setRect(D,e._width,h.scrollBarMargin+r*a,h.scrollBarWidth,n),L.select("rect").attr("y",_+r)}}],t)}(t,e)}},{"../../constants/alignment":313,"../../lib":342,"../../lib/events":332,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../../registry":452,"../color":208,"../dragelement":227,"../drawing":230,"./constants":259,"./get_legend_data":262,"./handle_click":263,"./helpers":264,"./style":266,"@plotly/d3":44}],262:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),c={},u=[],p=!1,f={},h=0,d=0;function m(t,r){if(""!==t&&a.isGrouped(e))-1===u.indexOf(t)?(u.push(t),p=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+h;u.push(n),c[n]=[r],h++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,_=(x+2*h.itemGap)/2,b=o(_,0),w=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))return 0;a=e.width}return v?n:Math.min(a,r)};function T(t,i,o){var u=t[0].trace,p=u.marker||{},f=p.line||{},h=o?u.visible&&u.type===o:a.traceIs(u,"bar"),d=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(h?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),d.exit().remove(),d.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,p.line,5,2);a.style("stroke-width",o+"px");var h=i.mcc;if(!r._inHover&&"mc"in i){var d=c(p),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),h=s.tryColorscale(p,"")(m)}var g=h||i.mc||p.color,v=p.pattern,x=v&&s.getPatternAttr(v.shape,0,"");if(x){var _=s.getPatternAttr(v.bgcolor,0,null),b=s.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=y(v.size,8,10),M=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(s.pattern,"legend",e,A,x,k,M,h,v.fillmode,_,b,T)}else a.call(l.fill,g);o&&l.stroke(a,i.mlc||f.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),c.exit().remove(),c.size()){var u=(s.marker||{}).line,h=w(f(u.width,o.pts),u,5,2),d=i.minExtend(s,{marker:{line:{width:h}}});d.marker.line.color=u.color;var m=i.minExtend(o,{trace:d});p(c,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));a.attr("transform",o(0,u))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=a.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,p=n.select(this),f=c(a),h=f.colorscale,m=f.reversescale;if(h){if(!r){var y=h.length;u=0===o?h[m?y-1:0][1]:1===o?h[m?0:y-1][1]:h[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}p.attr("d",t[0]),u?p.call(l.fill,u):p.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,d(m,"radial"===r),h,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,T(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,a,o=m(t),l=o.showFill,p=o.showLine,f=o.showGradientLine,h=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=t[0],_=v.trace,b=c(_),T=b.colorscale,k=b.reversescale,M=u.hasMarkers(_)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||h?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+x+"v6h-"+x+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+_.uid;s.gradient(t,e,r,d(k),T,"fill")}}),p||f){var L=w(void 0,_.line,10,5);a=i.minExtend(_,{line:{width:L}}),r=[i.minExtend(v,{trace:a})]}var E=A.select(".legendlines").selectAll("path").data(p||f?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",M+(f?"l"+x+",0.0001":"h"+x)).call(p?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+_.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,a,o=m(t),l=o.anyFill,c=o.anyLine,p=o.showLine,f=o.showMarker,h=t[0],d=h.trace,y=!f&&!c&&!l&&u.hasText(d);function g(t,e,r,n){var a=i.nestedProperty(d,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return h._distinct&&h.index&&t[h.index]?t[h.index]:t[0]}if(f||y||p){var _={},w={};if(f){_.mc=g("marker.color",x),_.mx=g("marker.symbol",x),_.mo=g("marker.opacity",i.mean,[.2,1]),_.mlc=g("marker.line.color",x),_.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);_.ms=T,w.marker.size=T}p&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(_.tx="Aa",_.tp=g("textposition",x),_.ts=10,_.tc=g("textfont.color",x),_.tf=g("textfont.family",x)),r=[i.minExtend(h,_)],(a=i.minExtend(d,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(f?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),M.exit().remove(),M.call(s.pointStyle,a,e),f&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),A.exit().remove(),A.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":342,"../../registry":452,"../../traces/pie/helpers":688,"../../traces/pie/style_one":694,"../../traces/scatter/subtypes":730,"../color":208,"../colorscale/helpers":219,"../drawing":230,"./constants":259,"@plotly/d3":44}],267:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":269}],268:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function p(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},p=i.list(t,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===s){var h,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(a=0;a1?(C=["toggleHover"],I=["resetViews"]):g?(P=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],I=["resetGeo"]):y?(C=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(P=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],I=["resetViewMapbox"]):_?C=["hoverClosestGl2d"]:v?C=["hoverClosestPie"]:k?(C=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):C=["toggleHover"];m&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,p,f=1/0,h=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lh&&(h=p)));return h>=f?[f,h]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;ov?(k=p,L="y0",M=v,E="y1"):(k=v,L="y1",M=p,E="y0");W(n),$(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===D?K:J,X.altKey=n.altKey},doneFn:function(){if(g(t))return;h(e),Q(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(g(t))return;Q(s)}};function W(r){if(g(t))D=null;else if(R)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?f.getCursor(o/a,1-s/i):"move";h(e,l),D=l.split("-")[0]}}function K(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;z?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(q(t)+n)},B&&"date"===B.type&&(o=m.encodeDate(o))),O?N("yanchor",r.yanchor=Y(T+a)):(l=function(t){return Y(H(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),N("path",r.path=w(I,o,l))}else z?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(y+n))),O?N("yanchor",r.yanchor=Y(T+a)):(N("y0",r.y0=Y(p+a)),N("y1",r.y1=Y(v+a)));e.attr("d",b(t,r)),$(s,r)}function J(n,a){if(F){var i=function(t){return t},o=i,l=i;z?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(q(t)+n)},B&&"date"===B.type&&(o=m.encodeDate(o))),O?N("yanchor",r.yanchor=Y(T+a)):(l=function(t){return Y(H(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),N("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===D){var u=c+n,f=O?p-a:p+a;N("x0",r.x0=z?u:G(u)),N("y0",r.y0=O?f:Y(f))}else if("resize-over-end-point"===D){var h=y+n,d=O?v-a:v+a;N("x1",r.x1=z?h:G(h)),N("y1",r.y1=O?d:Y(d))}}else{var g=function(t){return-1!==D.indexOf(t)},_=g("n"),j=g("s"),V=g("w"),Z=g("e"),X=_?k+a:k,W=j?M+a:M,K=V?A+n:A,J=Z?S+n:S;O&&(_&&(X=k-a),j&&(W=M-a)),(!O&&W-X>10||O&&X-W>10)&&(N(L,r[L]=O?X:Y(X)),N(E,r[E]=O?W:Y(W))),J-K>10&&(N(P,r[P]=z?K:G(K)),N(C,r[C]=z?J:G(J)))}e.attr("d",b(t,r)),$(s,r)}function $(t,e){(z||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=q(z?e.xanchor:a.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=H(O?e.yanchor:a.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&O){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function Q(t){t.selectAll(".visual-cue").remove()}f.init(X),Z.node().onmousemove=W}(t,z,l,e,r,D):!0===l.editable&&z.style("pointer-events",C||c.opacity(S)*A<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!v(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,y(t)}}(t,z)}))}}function _(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function b(t,e){var r,n,o,s,l,c,u,p,f=e.type,h=i.getRefType(e.xref),y=i.getRefType(e.yref),g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),x=t._fullLayout._size;if(g?"domain"===h?n=function(t){return g._offset+g._length*t}:(r=m.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return x.l+x.w*t},v?"domain"===y?s=function(t){return v._offset+v._length*(1-t)}:(o=m.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return x.t+x.h*(1-t)},"path"===f)return g&&"date"===g.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,c=t.charAt(0),u=d.paramIsX[c],p=d.paramIsY[c],f=d.numParams[c],h=t.substr(1).replace(d.paramRE,(function(t){return u[n]?t="pixel"===i?e(s)+Number(t):e(t):p[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>f&&(t="X"),t}));return n>f&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+h}))}(e,n,s);if("pixel"===e.xsizemode){var _=n(e.xanchor);l=_+e.x0,c=_+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);u=b-e.y0,p=b-e.y1}else u=s(e.y0),p=s(e.y1);if("line"===f)return"M"+l+","+u+"L"+c+","+p;if("rect"===f)return"M"+l+","+u+"H"+c+"V"+p+"H"+l+"Z";var w=(l+c)/2,T=(u+p)/2,k=Math.abs(w-l),M=Math.abs(T-u),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){v(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:x,eraseActiveShape:function(t){if(!v(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&p(g),r.attr("d",m(e)),M&&!f)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,v(),x())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*p.gripWidth,e._dims.currentValueTotalHeight))}}function L(t,e){var r=t._dims;return r.inputAreaStart+p.stepInset+(r.inputAreaLength-2*p.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-p.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*p.stepInset-2*r.inputAreaStart)))}function P(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",p.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,p.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*p.railInset,a=s.ensureSingle(t,"rect",p.railRectClass);a.attr({width:n,height:p.railWidth,rx:p.railRadius,ry:p.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,p.railInset,.5*(r.inputAreaWidth-p.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[p.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,y(e))}if(i.enter().append("g").classed(p.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+p.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+p.groupClassName).data(r,g);l.enter().append("g").classed(p.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||f<0){var g={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[_.side];e.attr("transform",l(g[0],g[1]))}}}return O.call(R),D&&(L?O.on(".opacity",null):(M=0,A=!0,O.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),O.call(p.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,g,e,x):o.call("_guiRelayout",t,g,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(p.positionText,b.x,b.y)}))),O.classed("js-placeholder",A),T}}},{"../../constants/alignment":313,"../../constants/interactions":318,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../../registry":452,"../color":208,"../drawing":230,"@plotly/d3":44,"fast-isnumeric":81}],307:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:c,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:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../plots/font_attributes":419,"../../plots/pad_attributes":437,"../color/attributes":207}],308:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],309:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":342,"../../plots/array_container_defaults":385,"./attributes":307,"./constants":308}],310:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),f=t("./scrollbox");function h(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,a,i,o,s){e.active=o,c(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(a.attr(p.menuIndexAttrName,"-1"),y(t,n,a,i,e),s||g(t,n,a,i,e))}function y(t,e,r,n,a){var i=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,c=a.active,u=a.buttons[c]||p.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},h={width:l.headerWidth,height:l.headerHeight};i.call(v,a,u,t).call(A,a,f,h),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(p.arrowSymbol[a.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+a.pad.l,y:l.headerHeight/2+p.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),g(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),f=u.enter().append("g").classed(c,!0),h=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var _={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:_.x+o.borderwidth,t:_.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(v,o,s,t).call(A,o,_),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(b,o)}))})),u.call(b,o),x?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=_.y-k.t):(k.w=_.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,s,l,c=a.direction,u="up"===c||"down"===c,f=a._dims,h=a.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,h);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,L=y+g;L+A>c&&(L=c-A);var E=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:L,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=g>T,C=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,D=d+m,z=y;D+C>l&&(D=l-C);var O=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),P?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:z,width:C,height:I}),this._vbarYMin=z+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=P?p+C+.5:p+.5,B=f-.5,j=k?h+A+.5:h+.5,U=o._topdefs.selectAll("#"+R).data(k||P?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||P?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||P){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),P&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":342,"../color":208,"../drawing":230,"@plotly/d3":44}],313:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],314:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],315:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],316:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],317:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],318:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],319:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],320:[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}},{}],321:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],323:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],324:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return i(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function p(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,p,f,h,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}m?(u=0,p=o,f=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return p(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return p(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return p(t,e,r,n,a,i,1)}}},{"./mod":349}],325:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(p(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||u(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=b(e),g=t.charAt(0);!c||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:v);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),L=Number(T[9]||0),E=Number(T[11]||0);if(c){if(2===k.length)return u;var P;k=Number(k);try{var C=y.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===M.charAt(M.length-1);M=parseInt(M,10),P=C.newDate(k,C.toMonthIndex(k,M,I),A)}else P=C.newDate(k,Number(M),A)}catch(t){return u}return P?(P.toJD()-m)*p+S*f+L*h+E*d:u}k=2===k.length?(Number(k)+2e3-_)%100+_:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,S,L));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?u:D.getTime()+E*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*p,k=3*f,M=5*h;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,s,c,v,x,_=Math.floor(10*l(t+.05,1)),w=Math.round(t-_/10);if(b(r)){var S=Math.floor(w/p)+m,L=Math.floor(l(t,p));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+p&&t<=a-p))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,L=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function P(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(t=t.replace(L,(function(){return E[r("%q")(a)]})),b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=b(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/f),2)+":"+w(l(Math.floor(r/h),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+P(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return P(e,t,n,a)};var I=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var a=Math.round(t/p)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+I);return c.setUTCMonth(c.getUTCMonth()+e)+n-I},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,c=b(e)&&y.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=f.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(f.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(s(t,e,r,n,a,i,o,c))return 0;var u=r-t,p=n-e,f=o-a,h=c-i,d=u*u+p*p,m=f*f+h*h,y=Math.min(l(u,p,d,a-t,i-e),l(u,p,d,o-t,c-e),l(f,h,m,t-a,e-i),l(f,h,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),p=t.getPointAtLength(o(r,e)),f={x:(4*p.x+l.x+c.x)/6,y:(4*p.y+l.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),p=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(c*c+p*p)}for(var h=f(c);h;){if((c+=h+r)>p)return;h=f(c)}for(h=f(p);h;){if(c>(p-=h+r))return;h=f(p)}return{min:c,max:p,len:p-c,total:u,isClosed:0===c&&p===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,f=0,h=s;p0?h=a:f=a,p++}return i}},{"./mod":349}],339:[function(t,e,r){"use strict";var n=t("./identity");function a(t){return[t]}e.exports={keyFun:function(t){return t.key},repeat:a,descend:n,wrap:a,unwrap:function(t){return t[0]}}},{"./identity":340}],340:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],341:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],342:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,p=e.exports={};p.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var f={};p.warnBadFormat=function(t){var e=String(t);f[e]||(f[e]=1,p.warn('encountered bad format: "'+e+'"'))},p.noFormat=function(t){return String(t)},p.numberFormat=function(t){var e;try{e=i(p.adjustFormat(t))}catch(e){return p.warnBadFormat(t),p.noFormat}return e},p.nestedProperty=t("./nested_property"),p.keyedContainer=t("./keyed_container"),p.relativeAttr=t("./relative_attr"),p.isPlainObject=t("./is_plain_object"),p.toLogRange=t("./to_log_range"),p.relinkPrivateKeys=t("./relink_private");var h=t("./array");p.isTypedArray=h.isTypedArray,p.isArrayOrTypedArray=h.isArrayOrTypedArray,p.isArray1D=h.isArray1D,p.ensureArray=h.ensureArray,p.concat=h.concat,p.maxRowLength=h.maxRowLength,p.minRowLength=h.minRowLength;var d=t("./mod");p.mod=d.mod,p.modHalf=d.modHalf;var m=t("./coerce");p.valObjectMeta=m.valObjectMeta,p.coerce=m.coerce,p.coerce2=m.coerce2,p.coerceFont=m.coerceFont,p.coercePattern=m.coercePattern,p.coerceHoverinfo=m.coerceHoverinfo,p.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,p.validate=m.validate;var y=t("./dates");p.dateTime2ms=y.dateTime2ms,p.isDateTime=y.isDateTime,p.ms2DateTime=y.ms2DateTime,p.ms2DateTimeLocal=y.ms2DateTimeLocal,p.cleanDate=y.cleanDate,p.isJSDate=y.isJSDate,p.formatDate=y.formatDate,p.incrementMonth=y.incrementMonth,p.dateTick0=y.dateTick0,p.dfltRange=y.dfltRange,p.findExactDates=y.findExactDates,p.MIN_MS=y.MIN_MS,p.MAX_MS=y.MAX_MS;var g=t("./search");p.findBin=g.findBin,p.sorterAsc=g.sorterAsc,p.sorterDes=g.sorterDes,p.distinctVals=g.distinctVals,p.roundUp=g.roundUp,p.sort=g.sort,p.findIndexOfMin=g.findIndexOfMin,p.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");p.aggNums=v.aggNums,p.len=v.len,p.mean=v.mean,p.median=v.median,p.midRange=v.midRange,p.variance=v.variance,p.stdev=v.stdev,p.interp=v.interp;var x=t("./matrix");p.init2dArray=x.init2dArray,p.transposeRagged=x.transposeRagged,p.dot=x.dot,p.translationMatrix=x.translationMatrix,p.rotationMatrix=x.rotationMatrix,p.rotationXYMatrix=x.rotationXYMatrix,p.apply3DTransform=x.apply3DTransform,p.apply2DTransform=x.apply2DTransform,p.apply2DTransform2=x.apply2DTransform2,p.convertCssMatrix=x.convertCssMatrix,p.inverseTransformMatrix=x.inverseTransformMatrix;var _=t("./angles");p.deg2rad=_.deg2rad,p.rad2deg=_.rad2deg,p.angleDelta=_.angleDelta,p.angleDist=_.angleDist,p.isFullCircle=_.isFullCircle,p.isAngleInsideSector=_.isAngleInsideSector,p.isPtInsideSector=_.isPtInsideSector,p.pathArc=_.pathArc,p.pathSector=_.pathSector,p.pathAnnulus=_.pathAnnulus;var b=t("./anchor_utils");p.isLeftAnchor=b.isLeftAnchor,p.isCenterAnchor=b.isCenterAnchor,p.isRightAnchor=b.isRightAnchor,p.isTopAnchor=b.isTopAnchor,p.isMiddleAnchor=b.isMiddleAnchor,p.isBottomAnchor=b.isBottomAnchor;var w=t("./geometry2d");p.segmentsIntersect=w.segmentsIntersect,p.segmentDistance=w.segmentDistance,p.getTextLocation=w.getTextLocation,p.clearLocationCache=w.clearLocationCache,p.getVisibleSegment=w.getVisibleSegment,p.findPointOnPath=w.findPointOnPath;var T=t("./extend");p.extendFlat=T.extendFlat,p.extendDeep=T.extendDeep,p.extendDeepAll=T.extendDeepAll,p.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");p.log=k.log,p.warn=k.warn,p.error=k.error;var M=t("./regex");p.counterRegex=M.counter;var A=t("./throttle");p.throttle=A.throttle,p.throttleDone=A.done,p.clearThrottle=A.clear;var S=t("./dom");function L(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},p.noop=t("./noop"),p.identity=t("./identity"),p.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},p.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},p.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(p.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},p.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},p.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*c[n];u[r]=i}return u},p.syncOrAsync=function(t,e,r){var n;function a(){return p.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},p.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},p.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},p.fillArray=function(t,e,r,n){if(n=n||p.identity,p.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},p.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;p.templateString=function(t,e){var r={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,n){var a;return z.test(n)?a=e[n]:(r[n]=r[n]||p.nestedProperty(e,n).get,a=r[n]()),p.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};p.hovertemplateString=function(){return N.apply(O,arguments)};var R={max:10,count:0,name:"texttemplate"};p.texttemplateString=function(){return N.apply(R,arguments)};var F=/^[:|\|]/;function N(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,f,h="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,y="xother"===s||"yother"===s||h||m||d,g=s;if((h||d)&&(g=g.substring(1)),(m||d)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=e[g]))return""}else for(f=3;f=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(a=10*a+s-48),!l||!c){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var B=2e9;p.seedPseudoRandom=function(){B=2e9},p.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?p.pseudoRandom():B/4294967296},p.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=p.extractOption(t,e,"htx","hovertext");if(p.isValidTextValue(a))return n(a);var i=p.extractOption(t,e,"tx","text");return p.isValidTextValue(i)?n(i):void 0},p.isValidTextValue=function(t){return t||0===t},p.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,p.strTranslate(a-c*(r+o),i-c*(n+s))+p.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},p.ensureUniformFontSize=function(t,e){var r=p.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},p.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},p.bigFont=function(t){return Math.round(1.2*t)};var j=p.getFirefoxVersion(),U=null!==j&&j<86;p.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":319,"./anchor_utils":323,"./angles":324,"./array":325,"./clean_number":326,"./clear_responsive":328,"./coerce":329,"./dates":330,"./dom":331,"./extend":333,"./filter_unique":334,"./filter_visible":335,"./geometry2d":338,"./identity":340,"./increment":341,"./is_plain_object":343,"./keyed_container":344,"./localize":345,"./loggers":346,"./make_trace_groups":347,"./matrix":348,"./mod":349,"./nested_property":350,"./noop":351,"./notifier":352,"./preserve_drawing_buffer":355,"./push_unique":356,"./regex":358,"./relative_attr":359,"./relink_private":360,"./search":361,"./sort_object_keys":363,"./stats":364,"./throttle":366,"./to_log_range":367,"@plotly/d3":44,"d3-format":68,"d3-time-format":76,"fast-isnumeric":81}],343:[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).hasOwnProperty("hasOwnProperty")}},{}],344:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],f.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":377,"./notifier":352}],347:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{"@plotly/d3":44}],348:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],350:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;li||c===a||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===a||li||c===a||cs)return!1;var u,p,f,h,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(p,y)||c>Math.max(f,g)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":319,"./matrix":348}],355:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":81,"is-mobile":117}],356:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,p=0,f=e.length,h=0,d=f>1?(e[f-1]-e[0])/(f-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&a.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],p=u-a;void 0===a?(l.push(u),a=u):p>s&&(i=Math.min(i,p),l.push(u),a=u)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":325,"fast-isnumeric":81}],365:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),P=n.select(t.node().parentNode);if(!P.empty()){var C=t.attr("class")?t.attr("class").split(" ")[0]:"text";return C+="-math",P.selectAll("svg."+C).remove(),P.selectAll("g."+C+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(p,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,a,o){P.selectAll("svg."+C).remove(),P.selectAll("g."+C+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return I(),void e();var c=P.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:C,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",p=s.select("g");p.attr({fill:u,stroke:u});var f=l(p,"width"),h=l(p,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=-(r||l(t,"height"))/4;"y"===C[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-f/2,y-h/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===C[0]?s.attr({x:t.attr("x"),y:y-h/2}):"a"===C[0]&&0!==C.indexOf("atitle")?s.attr({x:0,y:y}):s.attr({x:d,y:+t.attr("y")+y-h/2}),m&&m.call(t,c),e(c)}))}))):I(),t}function I(){P.empty()||(C=t.attr("class")+"-math",P.select("svg."+C).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(y," ");var r,i=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(g),P=0;P|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&L(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(g),o=[],s="",l=0,c=0;ca?o.push(u.substr(0,d-a)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?e:""}function P(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=i()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(t){t=t.replace(y," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(g),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],367:[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":81}],368:[function(t,e,r){"use strict";var n=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,i=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=a[t.locationmode],n=e.objects[r];return i(e,n).features}},{"../plots/geo/constants":421,"topojson-client":172}],369:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],370:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],371:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,f=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=_(e);r;){if(r in t)return!0;r=_(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(c(v))e.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(f(y,g),h(t),!0)}var x,_,b,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),L=e.get(),E=L||[],P=u(g,p).get(),C=[],I=-1,D=E.length;for(x=0;xE.length-(M?0:1))i.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,b),c(k)?C.push(b):M?("add"===k&&(k={}),E.splice(b,0,k),P&&P.splice(b,0,{})):i.warn("Unrecognized full object edit value",p,b,k),-1===I&&(I=b);else for(_=0;_=0;x--)E.splice(C[x],1),P&&P.splice(C[x],1);if(E.length?L||e.set(E):e.set(null),m)return!1;if(f(y,g),d!==a){var z;if(-1===I)z=S;else{for(D=Math.max(E.length,D),z=[],x=0;x=I);x++)z.push(b);for(x=I;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),C(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].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")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,c,u,p,f=o.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=P(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),b.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=Z(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[f.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,i,a)||f.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(f.rehover,f.redrag),c.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=h.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(t,r,{skipTitle:n})}:function(t){return h.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,a,i=t.layout,l=t._fullLayout,c=l._guiEditing,f=F(l._preGUI,c),d=Object.keys(e),m=h.list(t),y=o.extendDeepAll({},e),g={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[O];)O--;var N=D.parts[O],B=D.parts[O-1]+"."+N,U=D.parts.slice(0,O).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),Z=D.get();if(void 0!==z){A[I]=z,S[I]="reverse"===N?z:R(Z);var W=p.getLayoutValObject(l,D.parts);if(W&&W.impliedEdits&&null!==z)for(var K in W.impliedEdits)L(o.relativeAttr(I,K),W.impliedEdits[K]);if(-1!==["width","height"].indexOf(I))if(z){L("autosize",null);var J="height"===I?"width":"height";L(J,l[J])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)L("width",z?null:l.width),L("height",z?null:l.height);else if(B.match(H))C(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){C(B),s(l,U+"._inputRange").set(null);var $=s(l,U).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else B.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===N){E=V;var Q="linear"===q.type&&"log"===z,tt="log"===q.type&&"linear"===z;if(Q||tt){if(E&&E.range)if(q.autorange)Q&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];Q?(et<=0&&rt<=0&&L(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),L(U+".range[0]",Math.log(et)/Math.LN10),L(U+".range[1]",Math.log(rt)/Math.LN10)):(L(U+".range[0]",Math.pow(10,et)),L(U+".range[1]",Math.pow(10,rt)))}else L(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,z,L),u.getComponentMethod("images","convertCoords")(t,q,z,L)}else L(U+".autorange",!0),L(U+".range",null);s(l,U+"._inputRange").set(null)}else if(N.match(k)){var nt=s(l,I).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,at,L),u.getComponentMethod("images","convertCoords")(t,nt,at,L)}var it=_.containerArrayMatch(I);if(it){r=it.array,n=it.index;var ot=it.property,st=W||{editType:"calc"};""!==n&&""===ot&&(_.isAddVal(z)?S[I]=null:_.isRemoveVal(z)?S[I]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),g[r]||(g[r]={});var lt=g[r][n];lt||(lt=g[r][n]={}),lt[ot]=z,delete e[I]}else"reverse"===N?(V.range?V.range.reverse():(L(U+".autorange",!0),V.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===z||"select"===z)&&"lasso"!==Z&&"select"!==Z||l._has("gl2d")?M.plot=!0:W?T.update(M,W):M.calc=!0,D.set(z))}}for(r in g){_.applyContainerArrayChanges(t,f(i,r),g[r],M,f)||(M.plot=!0)}for(var ct in P){var ut=(E=h.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var pt in M.calc=!0,ut)P[pt]||(h.getFromId(t,pt)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:P,undoit:S,redoit:A,eventData:y}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&f.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function W(t,e,n,a){t=o.getGraphDiv(t),b.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=b.coerceTraceIndices(t,a),s=B(t,o.extendFlat({},e),i),l=s.flags,u=Z(t,o.extendFlat({},n)),p=u.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&b.clearAxisTypes(t,i,n);var h=[];p.layoutReplot?h.push(w.layoutReplot):l.fullReplot?h.push(r._doPlot):(h.push(f.previousPromises),V(t,p,u)||f.supplyDefaults(t),l.style&&h.push(w.doTraceStyle),(l.colorbars||p.colorbars)&&h.push(w.doColorBars),p.legend&&h.push(w.doLegend),p.layoutstyle&&h.push(w.layoutStyles),p.axrange&&q(h,u.rangesAltered),p.ticks&&h.push(w.doTicksRelayout),p.modebar&&h.push(w.doModeBar),p.camera&&h.push(w.doCamera),h.push(A)),h.push(f.rehover,f.redrag),c.add(t,W,[t,s.undoit,u.undoit,s.traces],W,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(h,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function K(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var J=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],$=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function Q(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,f.transition(t,e.frame.data,e.frame.layout,b.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function h(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(a)?y>=a.length?t.transitionOpts=a[y]:t.transitionOpts=a[0]:t.transitionOpts=a,y++,t}var v=[],x=null==e,_=Array.isArray(e);if(!x&&!_&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);v=M}}v.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(u[m]||d[m]||{}).name,g=e[n].name,v=u[y]||d[y];y&&g&&"number"==typeof g&&v&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(u[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},h.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}h.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=h[n].frame).name&&o.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(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=f.modifyFrames,u=f.modifyFrames,p=[t,s],h=[t,i];return c&&c.add(t,l,p,u,h),f.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],u=r.deleteTraces,p=t,f=[e,l],h=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function v(t){return t===Math.round(t)&&t>=0}function x(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var p=u.basePlotModule;p&&p.attributes&&(a=p.attributes[o])}a||(a=i[o])}return g(a,e,s)},r.getLayoutValObject=function(t,e){return g(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:p,applyUpdate:function(e,r){e&&u(e,r);var a=p();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":342,"../plots/attributes":386}],380:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),p=t("../components/modebar"),f=t("../plots/cartesian/axes"),h=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function x(t){var e,a,s,u,d,m,y=t._fullLayout,g=y._size,x=g.p,b=f.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._has("cartesian"))return i.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=m(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&y(i)&&t(i,o)}}({data:h,layout:f},""),u.length)return u.map(g)}},{"../lib":342,"../plots/attributes":386,"../plots/plots":438,"./plot_config":377,"./plot_schema":378,"./plot_template":379}],382:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../version").version,p={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,f,h,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],f=t.layout||{},h=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),f=o.extendDeep({},t.layout),h=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(p.format.values,", "," or ")+".");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),x=g("width"),_=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},f);x?M.width=x:null===e.width&&n(d.width)&&(M.width=d.width),_?M.height=_:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function L(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function f(){a.purge(k),document.body.removeChild(k)}if("full-json"===v){var h=i.graphJson(k,!1,"keepdata","object",!0,!0);return h.version=u,h=JSON.stringify(h),f(),t(T?h:s.encodeJSON(h))}if(f(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(k,r,M,A).then(S).then(L).then(E).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":342,"../plots/plots":438,"../snapshot/helpers":456,"../snapshot/svgtoimg":458,"../snapshot/tosvg":460,"../version":840,"./plot_api":376,"fast-isnumeric":81}],383:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var p=Object.keys(t),f=0;fx.length&&a.push(d("unused",i,g.concat(x.length)));var M,A,S,L,E,P=x.length,C=Array.isArray(k);if(C&&(P=Math.min(P,k.length)),2===_.dimensions)for(A=0;Ax[A].length&&a.push(d("unused",i,g.concat(A,x[A].length)));var I=x[A].length;for(M=0;M<(C?Math.min(I,k[A].length):I);M++)S=C?k[A][M]:k,L=v[A][M],E=x[A][M],n.validate(L,S)?E!==L&&E!==+L&&a.push(d("dynamic",i,g.concat(A,M),L,E)):a.push(d("value",i,g.concat(A,M),L))}else a.push(d("array",i,g.concat(A),v[A]));else for(A=0;A1&&h.push(d("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(p)===p))return{vals:a};c=p}for(var f=e.calendar,h="start"===l,d="end"===l,m=t[r+"period0"],y=i(m,f)||0,g=[],v=[],x=[],_=a.length,b=0;b<_;b++){var w,T,k,M=a[b];if(c){for(w=Math.round((M-y)/(c*s)),k=o(y,c*w,f);k>M;)k=o(k,-c,f);for(;k<=M;)k=o(k,c,f);T=o(k,-c,f)}else{for(k=y+(w=Math.round((M-y)/u))*u;k>M;)k-=u;for(;k<=M;)k+=u;T=k-u}g[b]=h?T:d?k:(T+k)/2,v[b]=T,x[b]=k}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":319,"../../lib":342,"fast-isnumeric":81}],388:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],389:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,p=c.isLinked;function f(t,e){var r,n,a=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,p=c.max;if(0===u.length||0===p.length)return i.simpleMap(e.range,e.r2l);var f=u[0].val,y=p[0].val;for(r=1;r0&&((T=L-s(x)-l(_))>E?k/T>P&&(b=x,w=_,P=k/T):k/L>P&&(b={val:x.val,nopad:1},w={val:_.val,nopad:1},P=k/L));if(f===y){var C=f-1,I=f+1;if(A)if(0===f)a=[0,1];else{var D=(f>0?p:u).reduce((function(t,e){return Math.max(t,l(e))}),0),z=f/(1-Math.min(.5,D/L));a=f>0?[0,z]:[z,0]}else a=S?[Math.max(0,C),Math.max(1,I)]:[C,I]}else A?(b.val>=0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(b.val-P*s(b)<0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),P=(w.val-b.val-h(e,x.val,_.val))/(L-s(b)-l(w)),a=[b.val-P*s(b),w.val+P*l(w)];return g&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function h(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=M(r.vpadplus||r.vpad),E=M(r.vpadminus||r.vpad);if(!T){if(f=1/0,h=-1/0,w)for(n=0;n0&&(f=i),i>h&&i-o&&(f=i),i>h&&i=I;n--)C(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,c=[],p=[];function f(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":230,"../../constants/numerical":319,"../../lib":342,"../../registry":452,"./axis_ids":394,"@plotly/d3":44,"fast-isnumeric":81}],390:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),p=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,_=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,L=m.ONEHOUR,E=m.ONEMIN,P=m.ONESEC,C=m.MINUS_SIGN,I=m.BADNUM,D={K:"zeroline"},z={K:"gridline",L:"path"},O={K:"tick",L:"path"},R={K:"tick",L:"text"},F=t("../../constants/alignment"),N=F.MID_SHIFT,B=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var q=t("./axis_autotype"),H=t("./axis_ids"),G=H.idSort,Y=H.isLinked;V.id2name=H.id2name,V.name2id=H.name2id,V.cleanId=H.cleanId,V.list=H.list,V.listIds=H.listIds,V.getFromId=H.getFromId,V.getFromTrace=H.getFromTrace;var Z=t("./autorange");V.getAutoRange=Z.getAutoRange,V.findExtremes=Z.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,u,c)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var c=V.getFromId(e,n);l=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,g,c,i)),y=v,0;y<=u;)y=V.tickIncrement(y,g,!1,i);return{start:e.c2r(v,0,i),end:e.c2r(y,0,i),size:g,_dataSpan:u-c}},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,V.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=V.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=L,o&&!n&&t.dticki&&p=o:h<=o;h=V.tickIncrement(h,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(h=u)break}if(E.length>m||h===P)break;P=h;var C=!1;p&&h!==(0|h)&&(C=!0),E.push({minor:C,value:h})}if(f&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,c=t[o].value,u=Math.abs(c-l),p=r||u,f=0;p>=v?f=u>=v&&u<=y?u:g:r===_&&p>=b?f=u>=b&&u<=x?u:_:p>=k?f=u>=k&&u<=w?u:T:r===M&&p>=M?f=M:p>=A?f=A:r===S&&p>=S?f=S:r===L&&p>=L&&(f=L),f>=u&&(f=u,s=!0);var h=a+f;if(e.rangebreaks&&f>0){for(var d=0,m=0;m<84;m++){var E=(m+.5)/84;e.maskBreaks(a*(1-E)+E*h)!==I&&d++}(f*=d/84)||(t[n].drop=!0),s&&u>M&&(f=u)}(f>0||0===n)&&(t[n].periodX=a+f/2)}}(E,t,t._definedDelta),t.rangebreaks){var D="y"===t._id.charAt(0),z=1;"auto"===t.tickmode&&(z=t.tickfont?t.tickfont.size:12);var O=NaN;for(d=E.length-1;d>-1;d--)if(E[d].drop)E.splice(d,1);else{E[d].value=At(E[d].value,t);var R=t.c2p(E[d].value);(D?O>R-z:Ou||Nu&&(F.periodX=u),N10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&i<=10||e>=15*A)t._tickround="d";else if(e>=E&&i<=16||e>=L)t._tickround="M";else if(e>=P&&i<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(ut(t.exponentformat)&&!pt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}V.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>g)e/=g,r=n(10),t.dtick="M"+12*ot(e,r,Q);else if(i>T)e/=T,t.dtick="M"+ot(e,1,tt);else if(i>A){t.dtick=ot(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=V.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>L?t.dtick=ot(e,L,tt):i>E?t.dtick=ot(e,E,et):i>P?t.dtick=ot(e,P,et):(r=n(10),t.dtick=ot(e,r,Q))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),t.dtick="L"+ot(e,r,Q)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Mt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,it)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,Q));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},V.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,i);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?at:nt,p=t+.01*o,f=s.roundUp(s.mod(p,1),u,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,i){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=ft(Math.pow(10,l),t,i,n);else if(a(o)||"D"===u&&s.mod(l+.01,1)<.1){var p=Math.round(l),f=Math.abs(p),h=t.exponentformat;"power"===h||ut(h)&&pt(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":C)+f+"",e.fontSize*=1.25):("e"===h||"E"===h)&&f>2?e.text="1"+h+(p>0?"+":C)+f:(e.text=ft(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,c,m):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):Mt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=ft(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=ft(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=C+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=ft(e.x,t,a,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var ct=["f","p","n","\u03bc","m","","k","M","G","T"];function ut(t){return"SI"===t||"B"===t}function pt(t){return t>14||t<-15}function ft(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=V.getTickFormat(e),p=e.separatethousands;if(n){var f={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,C);var h,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+h+"":"B"===l&&9===c?t+="B":ut(l)&&(t+=ct[c/3+5]));return i?C+t:t}function ht(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=u(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-p:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var h=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?p-r.top:0,f),h.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?p-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-p:0,f),h.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[h[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=yt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[u]+=f),!0===e.mirror||"ticks"===e.mirror?a[m]=e._anchorAxis.domain[h[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[m]=[e._counterDomainMin,e._counterDomainMax][h[1]]))}J&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,xt(e),n),i.autoMargin(t,_t(e),a),i.autoMargin(t,bt(e),s)})),r.skipTitle||J&&"bottom"===e.side||W.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+yt(e);else{var s=St(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var c,p,h,d,m=V.getPxPosition(t,e);"x"===i?(p=e._offset+e._length/2,h="top"===e.side?m-r:m+r):(h=e._offset+e._length/2,p="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var y=e._selections[e._id+"tick"];if(d={selection:y,side:e.side},y&&y.node()&&y.node().parentNode){var g=f.getTranslate(y.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:c,attributes:{x:p,y:h,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(W)}}function $(t){var r=h+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=vt(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},V.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,p=3,f=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=f*B,p+=(t.linewidth||0)/2);(a||i)&&(u+=(t.linewidth||0)/2,p+=3);s&&"top"===c&&(p-=f*(1-B));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(p=-p);return[l?u:0,s?p:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(dt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(dt(e)))}},V.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),c=i("right"),u=i("bottom")||l||o||c,p=i("inside"),f="inside"===n&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==t.tickson,h=0,d=0,m=f?t.ticklen:0;if(p?m*=-1:u&&(m=0),f&&(h+=m,r)){var y=s.deg2rad(r);h=m*Math.cos(y)+1,d=m*Math.sin(y)}t.showticklabels&&(f||t.showline)&&(h+=.2*t.tickfont.size);var g,v,x,_,b,w={labelStandoff:h+=(t.linewidth||1)/2*(p?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)_=(b=!p&&"bottom"===k||p&&"top"===k)?1:-1,p&&(_*=-1),g=d*_,v=e+h*_,x=b?1:-.2,90===Math.abs(A)&&(p?x+=N:x=-90===A&&"bottom"===k?B:90===A&&"top"===k?N:.5,T=N/2*(A/90)),w.xFn=function(t){return t.dx+g+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return a(e)&&0!==e&&180!==e?e*_<0!==p?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===M){if(_=(b=!p&&"left"===k||p&&"right"===k)?1:-1,p&&(_*=-1),g=h,v=d*_,x=0,p||90!==Math.abs(A)||(x=-90===A&&"left"===k||90===A&&"right"===k?B:.5),p){var S=a(A)?+A:0;if(0!==S){var L=s.deg2rad(S);T=Math.abs(Math.sin(L))*B*_,x=0}}w.xFn=function(t){return t.dx+e-(g+t.fontSize*x)*_+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*N},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},V.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],mt);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(p.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),Lt(e,[O]),i.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&V.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;sh||i.lefth||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},x(g,y+1?y:m);var _=null;e._selections&&(e._selections[p]=g);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&i._redrawFromAutoMarginCount&&90===y?(_=90,b.push((function(){x(g,y)}))):b.push((function(){if(x(g,m),h.length&&"x"===u&&!a(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){_=0;var t,n=0,i=[];if(g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=vt(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=h.length,l=Math.abs((h[o-1].x-h[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",p=function(t){return-1!==c.indexOf(t)},d=p("top"),y=p("left"),v=p("right"),b=p("bottom")||y||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var y="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=p(r),a=0,o=0,s={},u=0;u2*a}(a,y)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=v(o[l])){u=d;break}var p=a("pattern",u);if(p===d)for(l=0;l<2;l++)(c=v(o[l]))&&(e.bounds[l]=o[l]=c-1);if(p)for(l=0;l<2;l++)switch(c=o[l],p){case d:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case m:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":452,"./constants":397}],395:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function y(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;oc*x)||T)for(r=0;rD&&FC&&(C=F);f/=(C-P)/(2*I),P=l.l2r(P),C=l.l2r(C),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:p.background,stroke:p.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,a,i)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){I&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,n,i){for(var o,s,l,c,u=!1,p={},f={},h=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(q(a),2!==t||gt||Ht(),yt)o.indexOf("select")>-1&&S(r,a,K,J,e.id,Ct),o.indexOf("event")>-1&&h.click(a,r,e.id);else if(1===t&>){var s=m?D:I,c="s"===m||"w"===g?0:1,p=s._name+".range["+c+"]",f=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,c),d="left",y="middle";if(s.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===g&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(_t).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:y}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,p,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ht*e+bt)),a=Math.max(0,Math.min(et,dt*r+wt)),i=Math.abs(n-bt),o=Math.abs(a-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Et.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,a),Tt.b=Math.max(wt,a),rt.isSubplotConstrained)i>C||o>C?(St="xy",i/tt>o/et?(o=i*et/tt,wt>a?Tt.t=wt-o:Tt.b=wt+o):(i=o*tt/et,bt>n?Tt.l=bt-i:Tt.r=bt+i),Et.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(i>C||o>C){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Et.attr("d",G(Tt))}else s();else!it||o0){var u;if(nt.isSubplotConstrained||!at&&1===it.length){for(u=0;um[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":342,"fast-isnumeric":81}],409:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":313}],410:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,p=c.rectMode,f=c.drawMode,h=c.openMode,d=c.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),y=t("../../components/shapes/draw_newshape/helpers").handleEllipse,g=t("../../components/shapes/draw_newshape/newshapes"),v=t("../../lib"),x=t("../../lib/polygon"),_=t("../../lib/throttle"),b=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),M=k.MINSELECT,A=x.filter,S=x.tester,L=t("./handle_outline").clearSelect,E=t("./helpers"),P=E.p2r,C=E.axValue,I=E.getTransform;function D(t,e,r,n,a,i,o){var s,l,c,u,p,f,d,y,g,v=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,_=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){F(t,e,i);var b=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(f=j(b))){for(o&&o.remove(),g=0;g=0&&n._fullLayout._deactivateShape(n),f(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=g(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)E._fullLayout._deactivateShape(E);else if(!b){var r=z.clickmode;_.done(mt).then((function(){if(_.clear(mt),2===t){for(pt.remove(),Q=0;Q-1&&D(e,E,a.xaxes,a.yaxes,a.subplot,a,pt),"event"===r&&E.emit("plotly_selected",void 0);s.click(E,e)})).catch(v.error)}},a.doneFn=function(){dt.remove(),_.done(mt).then((function(){_.clear(mt),a.gd.emit("plotly_selected",et),$&&a.selectionDefs&&($.subtract=ut,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,J)),a.doneFnCompleted&&a.doneFnCompleted(yt)})).catch(v.error),b&&N(a)}},clearSelect:L,clearSelectionsCache:N,selectOnClick:D}},{"../../components/color":208,"../../components/dragelement/helpers":226,"../../components/drawing":230,"../../components/fx":248,"../../components/fx/helpers":244,"../../components/shapes/draw_newshape/display_outlines":296,"../../components/shapes/draw_newshape/helpers":297,"../../components/shapes/draw_newshape/newshapes":298,"../../lib":342,"../../lib/clear_gl_canvases":327,"../../lib/polygon":354,"../../lib/throttle":366,"../../plot_api/subroutines":380,"../../registry":452,"./axis_ids":394,"./constants":397,"./handle_outline":401,"./helpers":402,polybooljs:124}],411:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,p=i.ensureNumber,f=i.isArrayOrTypedArray,h=t("../../constants/numerical"),d=h.FP_SAFE,m=h.BADNUM,y=h.LOG_CLIP,g=h.ONEWEEK,v=h.ONEDAY,x=h.ONEHOUR,_=h.ONEMIN,b=h.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function L(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],a=t.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function E(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function P(e,r,n){return c(e,r,n||t.calendar)}function C(e){return t._categories[Math.round(e)]}function I(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function O(t){return s(t)?+t:D(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var N=function(e){return s(e)?R(e,t._m,t._b):m},B=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===h;N=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lu)){o=i<(c+u)/2?l:l+1;break}o=l+1}var p=t._B[o]||0;return isFinite(p)?R(e,t._m2,p):0},B=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?L:p,t.l2c="log"===t.type?A:p,t.l2p=N,t.p2l=B,t.c2p="log"===t.type?function(t,e){return N(L(t,e))}:N,t.p2c="log"===t.type?function(t){return A(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=p,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=p):"log"===t.type?(t.d2r=t.d2l=function(t,e){return L(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=p,t.c2r=L,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=p):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=P,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return P(B(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=p,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:p(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=p,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:p(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var p=[[0,{}],[0,{}]],d=[];for(a=0;ad&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,c=t.r2l(t[i][0],o),u=t.r2l(t[i][1],o),p="y"===h;if((p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(f=!f),f&&t._rangebreaks.reverse();var d=f?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(p?u:c)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function y(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,c=a._length,u=l._length,p=!!e.xr1,f=!!e.yr1,h=[];if(p){var d=i.simpleMap(e.xr0,a.r2l),m=i.simpleMap(e.xr1,a.r2l),y=d[1]-d[0],g=m[1]-m[0];h[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,h[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(d[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*m[1])}else h[0]=0,h[2]=c;if(f){var v=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),_=v[1]-v[0],b=x[1]-x[0];h[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,h[3]=u*(1-r+r*b/_),l.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else h[1]=0,h[3]=u;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=p?c/h[2]:1,T=f?u/h[3]:1,k=p?h[0]:0,M=f?h[1]:0,A=p?h[0]/h[2]*c:0,S=f?h[1]/h[3]*u:0,L=a._offset-A,E=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,L,E).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":230,"../../lib":342,"../../registry":452,"./axes":390,"@plotly/d3":44}],416:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",p=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=t.autotypenumbers,o(c,l)){var h=i(c),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){i(t,c,s.cache),s.check=function(){if(l){var e=i(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;p0&&a<0&&(a+=360);var s=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[a,o],[a,i],[a-s,i],[a-2*s,i],[a-3*s,i],[n,i]]]}}e.exports=function(t){return new A(t)},S.plot=function(t,e,r){var n=this,a=e[this.id],i=[],o=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&a["show"+s]){o=!0;break}for(var l=0;l0&&i._module.calcGeoJSON(a,e)}if(!this.updateProjection(t,e)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),d.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,p=n.projection,f=n.lonaxis,h=n.lataxis,d=f._ax,m=h._ax,g=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(a[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,p=["center","rotate","parallels","clipExtent"],f=function(t){return t?l:[]},h=0;hu*Math.PI/180}return!1},l.getPath=function(){return i().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),v=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],x=n.center||{},_=p.rotation||{},b=f.range||[],T=h.range||[];if(n.fitbounds){d._length=v[1][0]-v[0][0],m._length=v[1][1]-v[0][1],d.range=y(r,d),m.range=y(r,m);var k=(d.range[0]+d.range[1])/2,M=(m.range[0]+m.range[1])/2;if(n._isScoped)x={lon:k,lat:M};else if(n._isClipped){x={lon:k,lat:M},_={lon:k,lat:M,roll:_.roll};var A=p.type,S=w.lonaxisSpan[A]/2||180,E=w.lataxisSpan[A]/2||90;b=[k-S,k+S],T=[M-E,M+E]}else x={lon:k,lat:M},_={lon:k,lat:_.lat,roll:_.roll}}g.center([x.lon-_.lon,x.lat-_.lat]).rotate([-_.lon,-_.lat,_.roll]).parallels(p.parallels);var P=L(b,T);g.fitExtent(v,P);var C=this.bounds=g.getBounds(P),I=this.fitScale=g.scale(),D=g.translate();if(n.fitbounds){var z=g.getBounds(L(d.range,m.range)),O=Math.min((C[1][0]-C[0][0])/(z[1][0]-z[0][0]),(C[1][1]-C[0][1])/(z[1][1]-z[0][1]));isFinite(O)?g.scale(O*I):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else g.scale(p.scale*I);var R=this.midPt=[(C[0][0]+C[1][0])/2,(C[0][1]+C[1][1])/2];if(g.translate([D[0]+(R[0]-D[0]),D[1]+(R[1]-D[1])]).clipExtent(C),n._isAlbersUsa){var F=g([x.lon,x.lat]),N=g.translate();g.translate([N[0]-(F[0]-N[0]),N[1]-(F[1]-N[1])])}},S.updateBaseLayers=function(t,e){var r=this,a=r.topojson,i=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),h=r.framework.selectAll(".layer").data(u,String);h.exit().each((function(t){delete i[t],delete o[t],n.select(this).remove()})),h.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=i[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),h.order(),h.each((function(r){var n=o[r],i=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(M(a,a.objects[r])):s(r)&&n.datum(function(t,e,r){var n,a,i,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,a=s.lataxisRange,i=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,a=s.lonaxisRange,i=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,p=new Array(u),f=0;f-1&&_(n.event,a,[r.xaxis],[r.yaxis],r.id,p),s.indexOf("event")>-1&&h.click(a,n.event))}))}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,a="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",a),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(f.setClipUrl,a,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,a=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},c.extendFlat(this.viewInitial,e)},S.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function a(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",a).attr("transform",n)}},{"../../components/color":208,"../../components/dragelement":227,"../../components/drawing":230,"../../components/fx":248,"../../lib":342,"../../lib/geo_location_utils":336,"../../lib/topojson_utils":368,"../../registry":452,"../cartesian/autorange":389,"../cartesian/axes":390,"../cartesian/select":410,"../plots":438,"./constants":421,"./zoom":426,"@plotly/d3":44,"d3-geo":70,"d3-geo-projection":69,"topojson-client":172}],423:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,a=t("../../lib").counterRegex,i=t("./geo"),o="geo",s=a(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,a=e._subplots.geo,s=0;s0&&C<0&&(C+=360);var I,D,z,O=(P+C)/2;if(!h){var R=d?p.projRotate:[O,0,0];I=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}(h?(D=-96.6,z=38.7):(D=d?O:I,z=(E[0]+E[1])/2),r("center.lon",D),r("center.lat",z),m&&(r("projection.tilt"),r("projection.distance")),y)&&r("projection.parallels",p.projParallels||[0,60]);r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):g?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){a(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":342,"../get_data":427,"../subplot_defaults":446,"./constants":421,"./layout_attributes":424}],426:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function p(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],p={},f={};function h(t,e){p[n+"."+t]=a.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,p);var r=a.nestedProperty(u,t);r.get()!==e&&(r.set(e),a.nestedProperty(l,t).set(e),f[n+"."+t]=e)}r(h),h("projection.scale",e.scale()/t.fitScale),h("fitbounds",!1),o.emit("plotly_relayout",f)}function f(t,e){var r=u(0,e);function a(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),p(t,e,a)})),r}function h(t,e){var r,a,i,o,s,f,h,d,m,y=u(0,e);function g(t){return e.invert(t)}function v(r){var n=e.rotate(),a=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return y.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),a=e.rotate(),i=e.translate(),o=a,s=g(r)})).on("zoom",(function(){if(f=n.mouse(this),function(t){var r=g(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return y.scale(e.scale()),void y.translate(e.translate());e.scale(n.event.scale),e.translate([i[0],n.event.translate[1]]),s?g(f)&&(d=g(f),h=[o[0]+(d[0]-s[0]),a[1],a[2]],e.rotate(h),o=h):s=g(r=f),m=!0,t.render();var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&p(t,e,v)})),y}function d(t,e){var r,a={r:e.rotate(),k:e.scale()},i=u(0,e),o=function(t){var e=0,r=arguments.length,a=[];for(;++ed?(i=(p>0?90:-90)-h,a=0):(i=Math.asin(p/d)*s-h,a=Math.sqrt(d*d-p*p));var m=180-i-2*h,y=(Math.atan2(f,u)-Math.atan2(c,a))*s,g=(Math.atan2(f,u)-Math.atan2(c,-a))*s;return _(r[0],r[1],i,y)<=_(r[0],r[1],m,g)?[i,y,r[2]]:[m,g,r[2]]}function _(t,e,r,n){var a=b(r-t),i=b(n-e);return Math.sqrt(a*a+i*i)}function b(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,a=t.slice(),i=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return a[i]=t[i]*l-t[s]*c,a[s]=t[s]*l+t[i]*c,a}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,a=t.length;nOpenStreetMap
contributors',i=['\xa9 Carto',a].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":363}],431:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(a){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(i){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":342}],432:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),a=t("../../lib"),i=a.strTranslate,o=a.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),f=t("./mapbox"),h=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==h.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,i=e._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(h.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,i);n.accessToken=o;for(var l=0;lb/2){var w=g.split("|").join("
");x.text(w).attr("data-unformatted",w).call(p.convertToTspans,t),_=u.bBox(x.node())}x.attr("transform",i(-3,8-_.height)),v.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;_.width+6>b&&(T=b/(_.width+6));var k=[n.l+n.w*f.x[1],n.t+n.h*(1-f.y[0])];v.attr("transform",i(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=p(o)?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.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])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){_.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},_.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=_.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,_.linkSubplots(f,l,p,n),_.cleanPlot(f,l,p,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var f=_.layoutAttributes.width.min,h=_.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),_.sanitizeMargins(r)},_.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,c=e._basePlotModules,p=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var f in c.length||c.push(p),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var g=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,b=void 0!==r.yb?r.yb:r.y;f[e]={l:{val:g,size:r.l+d},r:{val:v,size:r.r+d},b:{val:b,size:r.b+d},t:{val:x,size:r.t+d}},h[e]=1}else delete f[e],delete h[e];if(!n._replotting)return _.doAutoMargin(t)}},_.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),P(e);var a=e._size,i=e.margin,l=u.extendFlat({},a),c=i.l,p=i.r,f=i.t,d=i.b,m=e._pushmargin,y=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var g in m)y[g]||delete m[g];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:p},t:{val:1,size:f},b:{val:0,size:d}},m){var x=m[v].l||{},b=m[v].b||{},w=x.val,T=x.size,k=b.val,M=b.size;for(var A in m){if(o(T)&&m[A].r){var S=m[A].r.val,L=m[A].r.size;if(S>w){var E=(T*S+(L-r)*w)/(S-w),C=(L*(1-w)+(T-r)*(1-S))/(S-w);E+C>c+p&&(c=E,p=C)}}if(o(M)&&m[A].t){var I=m[A].t.val,D=m[A].t.size;if(I>k){var z=(M*I+(D-n)*k)/(I-k),O=(D*(1-k)+(M-n)*(1-I))/(I-k);z+O>d+f&&(d=z,f=O)}}}}}var R=u.constrain(r-i.l-i.r,2,64),F=u.constrain(n-i.t-i.b,2,64),N=Math.max(0,r-R),B=Math.max(0,n-F);if(N){var j=(c+p)/N;j>1&&(c/=j,p/=j)}if(B){var U=(d+f)/B;U>1&&(d/=U,f/=U)}if(a.l=Math.round(c),a.r=Math.round(p),a.t=Math.round(f),a.b=Math.round(d),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&_.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=u.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}_.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},_.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&_.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var p={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=c(s),a)){var f=s._size;p.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return l&&(p.frames=c(l)),i&&(p.config=c(t._context,!0)),"object"===n?p:JSON.stringify(p)},_.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,c,p),a=0;a1e-10?t:0}function f(t,e,r){e=e||0,r=r||0;for(var n=t.length,a=new Array(n),i=0;i0?r:1/0})),a=n.mod(r+1,e.length);return[e[r],e[a]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var a=-e*r,i=e*e+1,o=2*(e*a-r),s=a*a+r*r-t*t,l=Math.sqrt(o*o-4*i*s),c=(-o+l)/(2*i),u=(-o-l)/(2*i);return[[c,e*c+a+n],[u,e*u+a+n]]},clampTiny:p,pathPolygon:function(t,e,r,n,a,i){return"M"+f(u(t,e,r,n),a,i).join("L")},pathPolygonAnnulus:function(t,e,r,n,a,i,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&f<=0?0:Math.max(u,f);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&p>=0?0:Math.min(c,p);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&f>=0?0:Math.min(u,f);n=l>=360?1:c<=0&&p<=0?0:Math.max(c,p);return[e,r,n,a]}(h),_=x[2]-x[0],b=x[3]-x[1],w=f/p,T=Math.abs(b/_);w>T?(d=p,v=(f-(m=p*T))/n.h/2,y=[o[0],o[1]],g=[s[0]+v,s[1]-v]):(m=f,v=(p-(d=f/T))/n.w/2,y=[o[0]+v,o[1]-v],g=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=y,this.yDomain2=g;var k=this.xOffset2=n.l+n.w*y[0],M=this.yOffset2=n.t+n.h*(1-g[1]),A=this.radius=d/_,S=this.innerRadius=e.hole*A,L=this.cx=k-A*x[0],E=this.cy=M+A*x[3],I=this.cxx=L-k,D=this.cyy=E-M;this.radialAxis=this.mockAxis(t,e,a,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[a.side],_realSide:a.side,domain:[S/n.w,A/n.w]}),this.angularAxis=this.mockAxis(t,e,i,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:y}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:g});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",l(I,D)),r.frontplot.attr("transform",l(k,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",l(L,E)).call(c.fill,e.bgcolor)},z.mockAxis=function(t,e,r,n){var a=o.extendFlat({},r,n);return d(a,e,t),a},z.mockCartesianAxis=function(t,e,r){var n=this,a=r._id,i=o.extendFlat({type:"linear"},r);h(i,t);var s={x:[0,2],y:[1,3]};return i.setRange=function(){var t=n.sectorBBox,r=s[a],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);i.range=[t[r[0]]*l,t[r[1]]*l]},i.isPtWithinRange="x"===a?function(t){return n.isPtInside(t)}:function(){return!0},i.setRange(),i.setScale(),i},z.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,a=e.radialaxis;n.setScale(),m(r,n);var i=n.range;a.range=i.slice(),a._input.range=i.slice(),n._rl=[n.r2l(i[0],null,"gregorian"),n.r2l(i[1],null,"gregorian")]},z.updateRadialAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,u=r.innerRadius,p=r.cx,h=r.cy,d=e.radialaxis,m=P(e.sector[0],360),y=r.radialAxis,g=u90&&m<=270&&(y.tickangle=180);var v=function(t){return l(y.l2p(t.x)+u,0)},x=O(d);if(r.radialTickLayout!==x&&(a["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=x),g){y.setScale();var _=f.calcTicks(y),b=f.clipEnds(y,_),w=f.getTickSigns(y)[2];f.drawTicks(n,y,{vals:_,layer:a["radial-axis"],path:f.makeTickPath(y,0,w),transFn:v,crisp:!1}),f.drawGrid(n,y,{vals:b,layer:a["radial-grid"],path:function(t){return r.pathArc(y.r2p(t.x)+u)},transFn:o.noop,crisp:!1}),f.drawLabels(n,y,{vals:_,layer:a["radial-axis"],transFn:v,labelFns:f.makeLabelFns(y,0)})}var T=r.radialAxisAngle=r.vangles?I(R(C(d.angle),r.vangles)):d.angle,k=l(p,h),M=k+s(-T);F(a["radial-axis"],g&&(d.showticklabels||d.ticks),{transform:M}),F(a["radial-grid"],g&&d.showgrid,{transform:k}),F(a["radial-line"].select("line"),g&&d.showline,{x1:u,y1:0,x2:i,y2:0,transform:M}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateRadialAxisTitle=function(t,e,r){var n=this.gd,a=this.radius,i=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,p=C(c),f=Math.cos(p),h=Math.sin(p),d=0;if(s.title){var m=u.bBox(this.layers["radial-axis"].node()).height,y=s.title.font.size;d="counterclockwise"===s.side?-m-.4*y:m+.8*y}this.layers["radial-axis-title"]=x.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:E(n,"Click to enter radial axis title"),attributes:{x:i+a/2*f+d*h,y:o-a/2*h+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},z.updateAngularAxis=function(t,e){var r=this,n=r.gd,a=r.layers,i=r.radius,u=r.innerRadius,p=r.cx,h=r.cy,d=e.angularaxis,m=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale();var y=function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=I(m.tick0),m.dtick=I(m.dtick));var g=function(t){return l(p+i*Math.cos(t),h-i*Math.sin(t))},v=f.makeLabelFns(m,0).labelStandoff,x={xFn:function(t){var e=y(t);return Math.cos(e)*v},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(v+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*A)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},_=O(d);r.angularTickLayout!==_&&(a["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=_);var b,w=f.calcTicks(m);if("linear"===e.gridshape?(b=w.map(y),o.angleDelta(b[0],b[1])<0&&(b=b.slice().reverse())):b=null,r.vangles=b,"category"===m.type&&(w=w.filter((function(t){return o.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var T="inside"===m.ticks?-1:1,k=(m.linewidth||1)/2;f.drawTicks(n,m,{vals:w,layer:a["angular-axis"],path:"M"+T*k+",0h"+T*m.ticklen,transFn:function(t){var e=y(t);return g(e)+s(-I(e))},crisp:!1}),f.drawGrid(n,m,{vals:w,layer:a["angular-grid"],path:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[p+u*r,h-u*n]+"L"+[p+i*r,h-i*n]},transFn:o.noop,crisp:!1}),f.drawLabels(n,m,{vals:w,layer:a["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return g(y(t))},labelFns:x})}F(a["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(p,h)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},z.updateMainDrag=function(t){var e,r,s=this,c=s.gd,u=s.layers,p=t._zoomlayer,f=S.MINZOOM,h=S.OFFEDGE,d=s.radius,m=s.innerRadius,x=s.cx,T=s.cy,k=s.cxx,M=s.cyy,A=s.sectorInRad,E=s.vangles,P=s.radialAxis,C=L.clampTiny,I=L.findXYatLength,D=L.findEnclosingVertexAngles,z=S.cornerHalfWidth,O=S.cornerLen/2,R=y.makeDragger(u,"path","maindrag","crosshair");n.select(R).attr("d",s.pathSubplot()).attr("transform",l(x,T));var F,N,B,j,U,V,q,H,G,Y={element:R,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-k,e-M)}function W(t,e){return Math.atan2(M-e,t-k)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function J(t,e){if(0===t)return s.pathSector(2*z);var r=O/t,n=e-r,a=e+r,i=Math.max(0,Math.min(t,d)),o=i-z,l=i+z;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,a)+"L"+K(l,a)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function $(t,e,r){if(0===t)return s.pathSector(2*z);var n,a,i=K(t,e),o=K(t,r),l=C((i[0]+o[0])/2),c=C((i[1]+o[1])/2);if(l&&c){var u=c/l,p=-1/u,f=I(z,u,l,c);n=I(O,p,f[0][0],f[0][1]),a=I(O,p,f[1][0],f[1][1])}else{var h,d;c?(h=O,d=z):(h=z,d=O),n=[[l-h,c-d],[l+h,c-d]],a=[[l-h,c+d],[l+h,c+d]]}return"M"+n.join("L")+"L"+a.reverse().join("L")+"Z"}function Q(t,e){return e=Math.max(Math.min(e,d),m),tf?(t-1&&1===t&&b(e,c,[s.xaxis],[s.yaxis],s.id,Y),r.indexOf("event")>-1&&v.click(c,e,s.id)}Y.prepFn=function(t,n,i){var l=c._fullLayout.dragmode,u=R.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var f=c._fullLayout._invTransform;e=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var h=o.apply3DTransform(f)(n-u.left,i-u.top);if(F=h[0],N=h[1],E){var m=L.findPolygonOffset(d,A[0],A[1],E);F+=k+m[0],N+=M+m[1]}switch(l){case"zoom":Y.moveFn=E?nt:et,Y.clickFn=ot,Y.doneFn=at,function(){B=null,j=null,U=s.pathSubplot(),V=!1;var t=c._fullLayout[s.id];q=a(t.bgcolor).getLuminance(),(H=y.makeZoombox(p,q,x,T,U)).attr("fill-rule","evenodd"),G=y.makeCorners(p,x,T),w(c)}();break;case"select":case"lasso":_(t,n,i,Y,l)}},R.onmousemove=function(t){v.hover(c,t,s.id),c._fullLayout._lasthover=R,c._fullLayout._hoversubplot=s.id},R.onmouseout=function(t){c._dragging||g.unhover(c,t)},g.init(Y)},z.updateRadialDrag=function(t,e,r){var a=this,c=a.gd,u=a.layers,p=a.radius,f=a.innerRadius,h=a.cx,d=a.cy,m=a.radialAxis,v=S.radialDragBoxSize,x=v/2;if(m.visible){var _,b,T,A=C(a.radialAxisAngle),L=m._rl,E=L[0],P=L[1],D=L[r],z=.75*(L[1]-L[0])/(1-e.hole)/p;r?(_=h+(p+x)*Math.cos(A),b=d-(p+x)*Math.sin(A),T="radialdrag"):(_=h+(f-x)*Math.cos(A),b=d-(f-x)*Math.sin(A),T="radialdrag-inner");var O,N,B,j=y.makeRectDragger(u,T,"crosshair",-x,-x,v,v),U={element:j,gd:c};F(n.select(j),m.visible&&f0==(r?B>E:Bn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*i},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var a=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(a(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,a){var i,o,s=e[a],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(i=new Array(l),o=0;o0){for(var n=[],a=0;a=u&&(h.min=0,m.min=0,y.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=p[e._name];function o(r,n){return i.coerce(t,e,a,r,n)}o("uirevision",n.uirevision),e.type="linear";var f=o("color"),h=f!==a.color.dflt?f:r.font.color,d=e._name.charAt(0).toUpperCase(),m="Component "+d,y=o("title.text",m);e._hovertitle=y===m?y:d,i.coerceFont(o,"title.font",{family:r.font.family,size:i.bigFont(r.font.size),color:h}),o("min"),c(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:p,handleDefaults:h,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":208,"../../lib":342,"../../plot_api/plot_template":379,"../cartesian/line_grid_defaults":407,"../cartesian/tick_label_defaults":412,"../cartesian/tick_mark_defaults":413,"../cartesian/tick_value_defaults":414,"../subplot_defaults":446,"./layout_attributes":449}],451:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("tinycolor2"),i=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),p=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,h=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),y=t("../../components/fx"),g=t("../../components/dragelement/helpers"),v=g.freeMode,x=g.rectMode,_=t("../../components/titles"),b=t("../cartesian/select").prepSelect,w=t("../cartesian/select").selectOnClick,T=t("../cartesian/select").clearSelect,k=t("../cartesian/select").clearSelectionsCache,M=t("../cartesian/constants");function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var S=A.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var a=0;aL*_?a=(i=_)*L:i=(a=x)/L,o=g*a/x,l=v*i/_,r=e.l+e.w*m-a/2,n=e.t+e.h*(1-y)-i/2,h.x0=r,h.y0=n,h.w=a,h.h=i,h.sum=b,h.xaxis={type:"linear",range:[w+2*k-b,b-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},p(h.xaxis,h.graphDiv._fullLayout),h.xaxis.setScale(),h.xaxis.isPtWithinRange=function(t){return t.a>=h.aaxis.range[0]&&t.a<=h.aaxis.range[1]&&t.b>=h.baxis.range[1]&&t.b<=h.baxis.range[0]&&t.c>=h.caxis.range[1]&&t.c<=h.caxis.range[0]},h.yaxis={type:"linear",range:[w,b-T-k],domain:[y-l/2,y+l/2],_id:"y"},p(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var M=h.yaxis.domain[0],A=h.aaxis=f({},t.aaxis,{range:[w,b-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*L],anchor:"free",position:0,_id:"y",_length:a});p(A,h.graphDiv._fullLayout),A.setScale();var S=h.baxis=f({},t.baxis,{range:[b-w-k,T],side:"bottom",domain:h.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});p(S,h.graphDiv._fullLayout),S.setScale();var E=h.caxis=f({},t.caxis,{range:[b-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*L],anchor:"free",position:0,_id:"y",_length:a});p(E,h.graphDiv._fullLayout),E.setScale();var P="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";h.clipDef.select("path").attr("d",P),h.layers.plotbg.select("path").attr("d",P);var C="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";h.clipDefRelative.select("path").attr("d",C);var I=s(r,n);h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),h.clipDefRelative.select("path").attr("transform",null);var D=s(r-S._offset,n+i);h.layers.baxis.attr("transform",D),h.layers.bgrid.attr("transform",D);var z=s(r+a/2,n)+"rotate(30)"+s(0,-A._offset);h.layers.aaxis.attr("transform",z),h.layers.agrid.attr("transform",z);var O=s(r+a/2,n)+"rotate(-30)"+s(0,-E._offset);h.layers.caxis.attr("transform",O),h.layers.cgrid.attr("transform",O),h.drawAxes(!0),h.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+i)+"l"+a/2+",-"+i:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+i)+"h"+a:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",E.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),u.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId,h.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,a=this.aaxis,i=this.baxis,o=this.caxis;if(this.drawAx(a),this.drawAx(i),this.drawAx(o),t){var s=Math.max(a.showticklabels?a.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;n["a-title"]=_.draw(e,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=_.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*i.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=_.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,a=n.charAt(0),i=t._id,s=this.layers[n],l=a+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+i+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),p=d.clipEnds(t,u),f=d.makeTransTickFn(t),h=d.getTickSigns(t)[2],m=o.deg2rad(30),y=h*(t.linewidth||1)/2,g=h*t.ticklen,v=this.w,x=this.h,_="b"===a?"M0,"+y+"l"+Math.sin(m)*g+","+Math.cos(m)*g:"M"+y+",0l"+Math.cos(m)*g+","+-Math.sin(m)*g,b={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[a];d.drawTicks(r,t,{vals:"inside"===t.ticks?p:u,layer:s,path:_,transFn:f,crisp:!1}),d.drawGrid(r,t,{vals:p,layer:this.layers[a+"grid"],path:b,transFn:f,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:f,labelFns:d.makeLabelFns(t,0,30)})};var E=M.MINZOOM/2+.87,P="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",C="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",I="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",D=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearSelect=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,p,f,h,d,g,_,T,k,A=this,S=A.layers.plotbg.select("path").node(),E=A.graphDiv,O=E._fullLayout._zoomlayer;function R(t){var e={};return e[A.id+".aaxis.min"]=t.a,e[A.id+".baxis.min"]=t.b,e[A.id+".caxis.min"]=t.c,e}function F(t,e){var r=E._fullLayout.clickmode;z(E),2===t&&(E.emit("plotly_doubleclick",null),i.call("_guiRelayout",E,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,E,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&y.click(E,e,A.id)}function N(t,e){return 1-e/A.h}function B(t,e){return 1-(t+(A.h-e)/Math.sqrt(3))/A.w}function j(t,e){return(t-(A.h-e)/Math.sqrt(3))/A.w}function U(a,i){var o=r+a*t,s=n+i*e,l=Math.max(0,Math.min(1,N(0,n),N(0,s))),c=Math.max(0,Math.min(1,B(r,n),B(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*A.w,y=(1-l/2-c)*A.w,v=(m+y)/2,x=y-m,b=(1-l)*A.h,w=b-x/L;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),_=!0),E.emit("plotly_relayouting",R(h))}function V(){z(E),h!==p&&(i.call("_guiRelayout",E,R(h)),D&&E.data&&E._context.showTips&&(o.notifier(l(E,"Double-click to zoom back out"),"long"),D=!1))}function q(t,e){var r=t/A.xaxis._m,n=e/A.yaxis._m,a=[(h={a:p.a-n,b:p.b+(r+n)/2,c:p.c-(r-n)/2}).a,h.b,h.c].sort(o.sorterAsc),i=a.indexOf(h.a),l=a.indexOf(h.b),c=a.indexOf(h.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),h={a:a[i],b:a[l],c:a[c]},e=(p.a-h.a)*A.yaxis._m,t=(p.c-h.c-p.b+h.b)*A.xaxis._m);var f=s(A.x0+t,A.y0+e);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d=s(-t,-e);A.clipDefRelative.select("path").attr("transform",d),A.aaxis.range=[h.a,A.sum-h.b-h.c],A.baxis.range=[A.sum-h.a-h.c,h.b],A.caxis.range=[A.sum-h.a-h.b,h.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),E.emit("plotly_relayouting",R(h))}function H(){i.call("_guiRelayout",E,R(h))}this.dragOptions={element:S,gd:E,plotinfo:{id:A.id,domain:E._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,l,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],t=E._fullLayout._invScaleX,e=E._fullLayout._invScaleY;var m=A.dragOptions.dragmode=E._fullLayout.dragmode;v(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=F,A.dragOptions.doneFn=V,function(t,e,i){var l=S.getBoundingClientRect();r=e-l.left,n=i-l.top,E._fullLayout._calcInverseTransform(E);var u=E._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],p={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},h=p,f=A.aaxis.range[1]-p.a,d=a(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),g="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",_=!1,T=O.append("path").attr("class","zoombox").attr("transform",s(A.x0,A.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",g),k=O.append("path").attr("class","zoombox-corners").attr("transform",s(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(E)}(0,l,u)):"pan"===m?(A.dragOptions.moveFn=q,A.dragOptions.clickFn=F,A.dragOptions.doneFn=H,p={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},h=p,A.clearSelect(E)):(x(m)||v(m))&&b(i,l,u,A.dragOptions,m)}},S.onmousemove=function(t){y.hover(E,t,A.id),E._fullLayout._lasthover=S,E._fullLayout._hoversubplot=A.id},S.onmouseout=function(t){E._dragging||m.unhover(E,t)},m.init(this.dragOptions)}},{"../../components/color":208,"../../components/dragelement":227,"../../components/dragelement/helpers":226,"../../components/drawing":230,"../../components/fx":248,"../../components/titles":306,"../../lib":342,"../../lib/extend":333,"../../registry":452,"../cartesian/axes":390,"../cartesian/constants":397,"../cartesian/select":410,"../cartesian/set_convert":411,"../plots":438,"@plotly/d3":44,tinycolor2:171}],452:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),p=l.extendFlat,f=l.extendDeepAll;function h(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in g(t),r.subplotsRegistry[e]=t,r.componentsRegistry)_(a,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(p[h[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":208,"../components/drawing":230,"../constants/xmlns_namespaces":320,"../lib":342,"@plotly/d3":44}],461:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rp+c||!n(u))}for(var h=0;hi))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0?e+=r:u<0&&(e-=r)}return e}function z(t){var e=u,r=t.b,a=D(t);return n.inbox(r-e,a-e,b+(a-e)/(a-r)-1)}var O=t[p+"a"],R=t[f+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F=n.getDistanceFunction(a,h,d,(function(t){return(h(t)+d(t))/2}));if(n.getClosest(y,F,t),!1!==t.index&&y[t.index].p!==c){k||(E=function(t){return Math.min(M(t),t.p-v.bargroupwidth/2)},P=function(t){return Math.max(A(t),t.p+v.bargroupwidth/2)});var N=y[t.index],B=g.base?N.b+N.s:N.s;t[f+"0"]=t[f+"1"]=R.c2p(N[f],!0),t[f+"LabelVal"]=B;var j=v.extents[v.extents.round(N.p)];t[p+"0"]=O.c2p(x?E(N):j[0],!0),t[p+"1"]=O.c2p(x?P(N):j[1],!0);var U=void 0!==N.orig_p;return t[p+"LabelVal"]=U?N.orig_p:N.p,t.labelLabel=l(O,t[p+"LabelVal"],g[p+"hoverformat"]),t.valueLabel=l(R,t[f+"LabelVal"],g[f+"hoverformat"]),t.baseLabel=l(R,N.b,g[f+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,a=D(t);return n.inbox(r-e,a-e,w+(a-e)/(a-r)-1)}(N)+function(t){return C(M(t),A(t),w)}(N))/2,t[p+"Spike"]=O.c2p(N.p,!0),o(N,g,t),t.hovertemplate=g.hovertemplate,t}}function p(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=s(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,n,i){var o=u(t,e,r,n,i);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=p(l,c),a.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:p}},{"../../components/color":208,"../../components/fx":248,"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/axes":390,"../../registry":452,"./helpers":468}],470:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":404,"../scatter/marker_colorbar":723,"./arrays_to_calcdata":461,"./attributes":462,"./calc":463,"./cross_trace_calc":465,"./defaults":466,"./event_data":467,"./hover":469,"./layout_attributes":471,"./layout_defaults":472,"./plot":473,"./select":474,"./style":476}],471:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],472:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return i.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,p={},f=s("barmode"),h=0;h0}function S(t){return"auto"===t?0:t}function L(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:t.width*a+t.height*n,y:t.width*n+t.height*a}}function E(t,e,r,n,a,i){var o=!!i.isHorizontal,s=!!i.constrained,l=i.angle||0,c=i.anchor||"end",u="end"===c,p="start"===c,f=((i.leftToRight||0)+1)/2,h=1-f,d=a.width,m=a.height,y=Math.abs(e-t),g=Math.abs(n-r),v=y>2*b&&g>2*b?b:0;y-=2*v,g-=2*v;var x=S(l);"auto"!==l||d<=y&&m<=g||!(d>y||m>g)||(d>g||m>y)&&d.01?H:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?H(t):t>e?Math.ceil(t):Math.floor(t)};N=G(N,B,O),B=G(B,N,O),j=G(j,U,!O),U=G(U,j,!O)}var Y=M(i.ensureSingle(I,"path"),C,y,g);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(U-j))||V&&t._context.staticPlot?"M0,0Z":"M"+N+","+j+"V"+U+"H"+B+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!C.uniformtext.mode&&R){var Z=l.makePointStyleFns(p);l.singlePointStyle(c,Y,p,Z,t)}!function(t,e,r,n,a,s,c,p,h,y,g){var w,T=e.xaxis,A=e.yaxis,P=t._fullLayout;function C(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,D="h"===I.orientation,z=function(t,e,r,n,a){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,c,p,f,h="waterfall"===o.type,d="funnel"===o.type;"h"===o.orientation?(l="y",c=a,p="x",f=n):(l="x",c=n,p="y",f=a);function m(t){return u(f,f.c2l(t),!0).text}var y=e[r],g={};g.label=y.p,g.labelLabel=g[l+"Label"]=(v=y.p,u(c,c.c2l(v),!0).text);var v;var x=i.castOption(o,y.i,"text");(0===x||x)&&(g.text=x);g.value=y.s,g.valueLabel=g[p+"Label"]=m(y.s);var b={};_(b,o,y.i),h&&(g.delta=+y.rawS||y.s,g.deltaLabel=m(g.delta),g.final=y.v,g.finalLabel=m(g.final),g.initial=g.final-g.delta,g.initialLabel=m(g.initial));d&&(g.value=y.s,g.valueLabel=m(g.value),g.percentInitial=y.begR,g.percentInitialLabel=i.formatPercent(y.begR),g.percentPrevious=y.difR,g.percentPreviousLabel=i.formatPercent(y.difR),g.percentTotal=y.sumR,g.percenTotalLabel=i.formatPercent(y.sumR));var w=i.castOption(o,y.i,"customdata");w&&(g.customdata=w);return i.texttemplateString(s,g,t._d3locale,b,g,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function c(t){return u(o?r:n,+t,!0).text}var p,f=a.textinfo,h=t[e],d=f.split("+"),m=[],y=function(t){return-1!==d.indexOf(t)};y("label")&&m.push((g=t[e].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(p=i.castOption(a,h.i,"text"))||p)&&m.push(p);if(s){var v=+h.rawS||h.s,x=h.v,_=x-v;y("initial")&&m.push(c(_)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(l){y("value")&&m.push(c(h.s));var b=0;y("percent initial")&&b++,y("percent previous")&&b++,y("percent total")&&b++;var w=b>1;y("percent initial")&&(p=i.formatPercent(h.begR),w&&(p+=" of initial"),m.push(p)),y("percent previous")&&(p=i.formatPercent(h.difR),w&&(p+=" of previous"),m.push(p)),y("percent total")&&(p=i.formatPercent(h.sumR),w&&(p+=" of total"),m.push(p))}return m.join("
")}(e,r,n,a):m.getValue(s.text,r);return m.coerceString(v,o)}(P,n,a,T,A);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(x,r)}(I,a);var O="stack"===y.mode||"relative"===y.mode,R=n[a],F=!O||R._outmost;if(!z||"none"===w||(R.isBlank||s===c||p===h)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=P.font,B=d.getBarColor(n[a],I),j=d.getInsideTextFont(I,a,N,B),U=d.getOutsideTextFont(I,a,N),V=r.datum();D?"log"===T.type&&V.s0<=0&&(s=T.range[0]=G*(W/Y):W>=Y*(X/G);G>0&&Y>0&&(K||J||$)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){Z=i.ensureUniformFontSize(t,"outside"===w?U:j);var Q=(q=C(r,z,Z)).attr("transform");if(q.attr("transform",""),H=l.bBox(q.node()),G=H.width,Y=H.height,q.attr("transform",Q),G<=0||Y<=0)return void q.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,a,i){var o,s=!!i.isHorizontal,l=!!i.constrained,c=i.angle||0,u=a.width,p=a.height,f=Math.abs(e-t),h=Math.abs(n-r);o=s?h>2*b?b:0:f>2*b?b:0;var d=1;l&&(d=s?Math.min(1,h/p):Math.min(1,f/u));var m=S(c),y=L(a,m),g=(s?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,_=(t+e)/2,w=(r+n)/2,T=0,M=0,A=s?k(e,t):k(r,n);s?(_=e-A*o,T=A*g):(w=n+A*o,M=-A*g);return{textX:v,textY:x,targetX:_,targetY:w,anchorX:T,anchorY:M,scale:d,rotate:m}}(s,c,p,h,H,{isHorizontal:D,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=E(s,c,p,h,H,{isHorizontal:D,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=Z.size,f(I.type,tt,P),R.transform=tt,M(q,P,y,g).attr("transform",i.getTextTransform(tt))}(t,e,I,r,h,N,B,j,U,y,g),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,P,p.xcalendar,p.ycalendar)}));var j=!1===p.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,y)},toMoveInsideBar:E}},{"../../components/color":208,"../../components/drawing":230,"../../components/fx/helpers":244,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../registry":452,"./attributes":462,"./constants":464,"./helpers":468,"./style":476,"./uniform_text":478,"@plotly/d3":44,"fast-isnumeric":81}],474:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return a?[(i+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(i+o)/2,l]}e.exports=function(t,e){var r,a=t.cd,i=t.xaxis,o=t.yaxis,s=a[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var a=e[0].trace;a.selectedpoints?function(t,e,r){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var a,s=n.select(this);if(t.selected){a=o.ensureUniformFontSize(r,y(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(a.color=l),i.font(s,a)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,a,t):(d(r,a,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:b,resizeText:l}},{"../../components/color":208,"../../components/drawing":230,"../../lib":342,"../../registry":452,"./attributes":462,"./helpers":468,"./uniform_text":478,"@plotly/d3":44}],477:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=a(t,"marker");u&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":208,"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"../../lib":342}],478:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib");function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=of.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return m(v,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?y+Math.min(1,Math.abs(t.thetag1-t.thetag0)/g)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var _=c[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var b=a.extendFlat({},_,{r:_.s,theta:_.p});return o(_,u,t),s(b,u,p,t),t.hovertemplate=u.hovertemplate,t.color=i(u,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":248,"../../lib":342,"../../plots/polar/helpers":440,"../bar/hover":469,"../scatterpolar/hover":764}],483:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":441,"../bar/select":474,"../bar/style":476,"../scatter/marker_colorbar":723,"../scatterpolar/format_labels":763,"./attributes":479,"./calc":480,"./defaults":481,"./hover":482,"./layout_attributes":484,"./layout_defaults":485,"./plot":486}],484:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],485:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i,o={};function s(r,o){return n.coerce(t[i]||{},e[i],a,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var p=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,a,c,u,p,e,r)};return function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),h=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=i.ensureSingle(r,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),h=t.thetag0=p.c2g(t.p0),d=t.thetag1=p.c2g(t.p1);if(a(o)&&a(s)&&a(h)&&a(d)&&o!==s&&h!==d){var m=u.c2g(t.s1),y=(h+d)/2;t.ct=[l.c2p(m*Math.cos(y)),c.c2p(m*Math.sin(y))],e=f(o,s,h,d)}else e="M0,0Z";i.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":230,"../../lib":342,"../../plots/polar/helpers":440,"@plotly/d3":44,"fast-isnumeric":81}],487:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../bar/attributes"),i=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":207,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../bar/attributes":462,"../scatter/attributes":705}],488:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),i=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,v,x,_,b,w,T=t._fullLayout,k=a.getFromId(t,e.xaxis||"x"),M=a.getFromId(t,e.yaxis||"y"),A=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=k,x="x",_=M,b="y",w=!!e.yperiodalignment):(v=M,x="y",_=k,b="x",w=!!e.xperiodalignment);var L,E,P,C,I,D,z=function(t,e,r,a){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[i(t,r,e,u).vals,u]}s=l?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:a;for(var p="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),f=t._length,h=new Array(f),d=0;dL.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return v.d2c((e[t]||[])[r])},q=1/0,H=-1/0;for(r=0;r=L.q1&&L.q3>=L.med){var Y=V("lowerfence");L.lf=Y!==s&&Y<=L.q1?Y:h(L,P,C);var Z=V("upperfence");L.uf=Z!==s&&Z>=L.q3?Z:d(L,P,C);var X=V("mean");L.mean=X!==s?X:C?o.mean(P,C):(L.q1+L.q3)/2;var W=V("sd");L.sd=X!==s&&W>=0?W:C?o.stdev(P,C,L.mean):L.q3-L.q1,L.lo=m(L),L.uo=y(L);var K=V("notchspan");K=K!==s&&K>0?K:g(L,C),L.ln=L.med-K,L.un=L.med+K;var J=L.lf,$=L.uf;e.boxpoints&&P.length&&(J=Math.min(J,P[0]),$=Math.max($,P[C-1])),e.notched&&(J=Math.min(J,L.ln),$=Math.max($,L.un)),L.min=J,L.max=$}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+L.q1,"median = "+L.med,"q3 = "+L.q3].join("\n")),Q=L.med!==s?L.med:L.q1!==s?L.q3!==s?(L.q1+L.q3)/2:L.q1:L.q3!==s?L.q3:0,L.med=Q,L.q1=L.q3=Q,L.lf=L.uf=Q,L.mean=L.sd=Q,L.ln=L.un=Q,L.min=L.max=Q}q=Math.min(q,L.min),H=Math.max(H,L.max),L.pts2=E.filter(j),A.push(L)}}e._extremes[v._id]=a.findExtremes(v,[q,H],{padded:!0})}else{var tt=v.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),a=0;a=0&&at0){var ut,pt;if((L={}).pos=L[b]=N[r],E=L.pts=nt[r].sort(p),C=(P=L[x]=E.map(f)).length,L.min=P[0],L.max=P[C-1],L.mean=o.mean(P,C),L.sd=o.stdev(P,C,L.mean),L.med=o.interp(P,.5),C%2&&(lt||ct))lt?(ut=P.slice(0,C/2),pt=P.slice(C/2+1)):ct&&(ut=P.slice(0,C/2+1),pt=P.slice(C/2)),L.q1=o.interp(ut,.5),L.q3=o.interp(pt,.5);else L.q1=o.interp(P,.25),L.q3=o.interp(P,.75);L.lf=h(L,P,C),L.uf=d(L,P,C),L.lo=m(L),L.uo=y(L);var ft=g(L,C);L.ln=L.med-ft,L.un=L.med+ft,it=Math.min(it,L.ln),ot=Math.max(ot,L.un),L.pts2=E.filter(j),A.push(L)}e._extremes[v._id]=a.findExtremes(v,e.notched?tt.concat([it,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(A[0].t={num:T[S],dPos:B,posLetter:b,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in c)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[c[n]]=e[n][r[0]][r[1]]):t[c[n]]=e[n][r])}function p(t,e){return t.v-e.v}function f(t){return t.v}function h(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function d(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function m(t){return 4*t.q1-3*t.q3}function y(t){return 4*t.q3-3*t.q1}function g(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"fast-isnumeric":81}],489:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib"),i=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,p=e._fullLayout,f=o._id,h=f.charAt(0),d=[],m=0;for(s=0;s1,_=1-p[t+"gap"],b=1-p[t+"groupgap"];for(s=0;s0){var H=L.pointpos,G=L.jitter,Y=L.marker.size/2,Z=0;H+G>=0&&((Z=V*(H+G))>A?(q=!0,j=Y,N=Z):Z>R&&(j=Y,N=A)),Z<=A&&(N=A);var X=0;H-G<=0&&((X=-V*(H-G))>S?(q=!0,U=Y,B=X):X>F&&(U=Y,B=S)),X<=S&&(B=S)}else N=A,B=S;var W=new Array(c.length);for(l=0;l0?(y="v",g=x>0?Math.min(b,_):Math.min(_)):x>0?(y="h",g=Math.min(b)):g=0;if(g){e._length=g;var S=r("orientation",y);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===v&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===v&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i)}else e.visible=!1}function p(t,e,r,a){var i=a.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(i+"points",l);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var p=r("hoveron");"all"!==p&&-1===p.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,a){function s(r,a){return n.coerce(t,e,c,r,a)}if(u(t,e,s,a),!1!==e.visible){o(t,e,a,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",i.addOpacity(e.line.color,.5));var f=!1;if(l){var h=s("mean"),d=s("sd");h&&h.length&&(f=!0,d&&d.length&&(f="sd"))}s("boxmean",f),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var y=s("notchspan");y&&y.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),p(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,a;function i(t){return n.coerce(a._input,a,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function l(t,e,r,i){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,p=i.bPos,f=i.bPosPxOffset||0,h=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],s=i.bdPos[1]):(o=i.bdPos,s=i.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+p,!0),a=c.l2p(e-o)+f,i=c.l2p(e+s)+f,d=u?(a+i)/2:c.l2p(e)+f,m=l.c2p(t.mean,!0),y=l.c2p(t.mean-t.sd,!0),g=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===h?"m0,0L"+y+","+d+"L"+m+","+a+"L"+g+","+d+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===h?"m0,0L"+d+","+y+"L"+a+","+m+"L"+d+","+g+"Z":""))}))}e.exports={plot:function(t,e,r,i){var c=e.xaxis,u=e.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(t){var e,r,a=n.select(this),i=t[0],p=i.t,f=i.trace;(p.wdPos=p.bdPos*f.whiskerwidth,!0!==f.visible||p.empty)?a.remove():("h"===f.orientation?(e=u,r=c):(e=c,r=u),o(a,{pos:e,val:r},f,p),s(a,{x:c,y:u},f,p),l(a,{pos:e,val:r},f,p))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":230,"../../lib":342,"@plotly/d3":44}],497:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a=t.cd,i=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var a=1/0,i=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,z=E>0?Math.max:Math.min,O=C(S+P),R=I(L-P),F=[[p=A(S)]];for(i=O;i*E=0;a--)i[u-a]=t[p][a],o[u-a]=e[p][a];for(s.push({x:i,y:o,bicubic:l}),a=p,i=[],o=[];a>=0;a--)i[p-a]=t[a][0],o[p-a]=e[a][0];return s.push({x:i,y:o,bicubic:c}),s}},{}],511:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var i,o,s,l,c,u,p,f,h,d,m,y,g,v,x=t["_"+e],_=t[e+"axis"],b=_._gridlines=[],w=_._minorgridlines=[],T=_._boundarylines=[],k=t["_"+r],M=t[r+"axis"];"array"===_.tickmode&&(_.tickvals=x.slice());var A=t._xctrl,S=t._yctrl,L=A[0].length,E=A.length,P=t._a.length,C=t._b.length;n.prepTicks(_),"array"===_.tickmode&&delete _.tickvals;var I=_.smoothing?3:1;function D(n){var a,i,o,s,l,c,u,p,h,d,m,y,g=[],v=[],x={};if("b"===e)for(i=t.b2j(n),o=Math.floor(Math.max(0,Math.min(C-2,i))),s=i-o,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},a=0;a0&&(h=t.dxydi([],a-1,o,0,s),g.push(l[0]+h[0]/3),v.push(l[1]+h[1]/3),d=t.dxydi([],a-1,o,1,s),g.push(p[0]-d[0]/3),v.push(p[1]-d[1]/3)),g.push(p[0]),v.push(p[1]),l=p;else for(a=t.a2i(n),c=Math.floor(Math.max(0,Math.min(P-2,a))),u=a-c,x.length=P,x.crossLength=C,x.xy=function(e){return t.evalxy([],a,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(m=t.dxydj([],c,i-1,u,0),g.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),y=t.dxydj([],c,i-1,u,1),g.push(p[0]-y[0]/3),v.push(p[1]-y[1]/3)),g.push(p[0]),v.push(p[1]),l=p;return x.axisLetter=e,x.axis=_,x.crossAxis=M,x.value=n,x.constvar=r,x.index=f,x.x=g,x.y=v,x.smoothing=M.smoothing,x}function z(n){var a,i,o,s,l,c=[],u=[],p={};if(p.length=x.length,p.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(C-2,n)),l=Math.min(1,Math.max(0,n-o)),p.xy=function(e){return t.evalxy([],e,n)},p.dxy=function(e,r){return t.dxydi([],e,o,r,l)},a=0;ax.length-1||b.push(a(z(o),{color:_.gridcolor,width:_.gridwidth}));for(f=u;fx.length-1||m<0||m>x.length-1))for(y=x[s],g=x[m],i=0;i<_.minorgridcount;i++)(v=m-s)<=0||(d=y+(g-y)*(i+1)/(_.minorgridcount+1)*(_.arraydtick/v))x[x.length-1]||w.push(a(D(d),{color:_.minorgridcolor,width:_.minorgridwidth}));_.startline&&T.push(a(z(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(a(z(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+l)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+l))].sort((function(t,e){return t-e})))[0],p=c[1],f=u;f<=p;f++)h=_.tick0+_.dtick*f,b.push(a(D(h),{color:_.gridcolor,width:_.gridwidth}));for(f=u-1;fx[x.length-1]||w.push(a(D(d),{color:_.minorgridcolor,width:_.minorgridwidth}));_.startline&&T.push(a(D(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(a(D(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}},{"../../lib/extend":333,"../../plots/cartesian/axes":390}],512:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,i,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],a=0;a90&&(h-=180,l=-l),{angle:h,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],526:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../components/drawing"),i=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,p=c.strTranslate,f=t("../../constants/alignment");function h(t,e,r,a,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var a=r,s=a.x,l=a.y,c=i([],s,t.c2p),u=i([],l,e.c2p),p="M"+o(c,u,a.smoothing);n.select(this).attr("d",p).style("stroke-width",a.width).style("stroke",a.color).style("fill","none")})),u.exit().remove()}function d(t,e,r,i,o,c,f,h){var d=c.selectAll("text."+h).data(f);d.enter().append("text").classed(h,!0);var m=0,y={};return d.each((function(o,c){var f;if("auto"===o.axis.tickangle)f=s(i,e,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;f=s(i,e,r,o.xy,[Math.cos(h),Math.sin(h)])}c||(y={angle:f.angle,flip:f.flip});var d=(o.endAnchor?-1:1)*f.flip,g=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(a.font,o.font).text(o.text).call(l.convertToTspans,t),v=a.bBox(this);g.attr("transform",p(f.p[0],f.p[1])+u(f.angle)+p(o.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+o.axis.labelpadding)})),d.exit().remove(),y.maxExtent=m,y}e.exports=function(t,e,r,a){var l=e.xaxis,u=e.yaxis,p=t._fullLayout._clips;c.makeTraceGroups(a,r,"trace").each((function(e){var r=n.select(this),a=e[0],f=a.trace,m=f.aaxis,y=f.baxis,v=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),_=c.ensureSingle(r,"g","boundarylayer"),b=c.ensureSingle(r,"g","labellayer");r.style("opacity",f.opacity),h(l,u,x,m,"a",m._gridlines),h(l,u,x,y,"b",y._gridlines),h(l,u,v,m,"a",m._minorgridlines),h(l,u,v,y,"b",y._minorgridlines),h(l,u,_,m,"a-boundary",m._boundarylines),h(l,u,_,y,"b-boundary",y._boundarylines);var w=d(t,l,u,f,a,b,m._labels,"a-label"),T=d(t,l,u,f,a,b,y._labels,"b-label");!function(t,e,r,n,a,i,o,l){var u,p,f,h,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),y=c.aggNums(Math.min,null,r.b),v=c.aggNums(Math.max,null,r.b);u=.5*(d+m),p=y,f=r.ab2xy(u,p,!0),h=r.dxyda_rough(u,p),void 0===o.angle&&c.extendFlat(o,s(r,a,i,f,r.dxydb_rough(u,p)));g(t,e,r,n,f,h,r.aaxis,a,i,o,"a-title"),u=d,p=.5*(y+v),f=r.ab2xy(u,p,!0),h=r.dxydb_rough(u,p),void 0===l.angle&&c.extendFlat(l,s(r,a,i,f,r.dxyda_rough(u,p)));g(t,e,r,n,f,h,r.baxis,a,i,l,"b-title")}(t,b,f,a,l,u,w,T),function(t,e,r,n,a){var s,l,u,p,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var h=c.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,m=[];for(p=0;p90&&v<270,_=n.select(this);_.text(f.title.text).call(l.convertToTspans,t),x&&(b=(-l.lineCount(_)+y)*m*i-b),_.attr("transform",p(e.p[0],e.p[1])+u(e.angle)+p(0,b)).attr("text-anchor","middle").call(a.font,f.title.font)})),_.exit().remove()}},{"../../components/drawing":230,"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"./makepath":523,"./map_1d_array":524,"./orient_text":525,"@plotly/d3":44}],527:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib/search").findBin,i=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,p=t.aaxis,f=t.baxis,h=e[0],d=e[c-1],m=r[0],y=r[u-1],g=e[e.length-1]-e[0],v=r[r.length-1]-r[0],x=g*n.RELATIVE_CULL_TOLERANCE,_=v*n.RELATIVE_CULL_TOLERANCE;h-=x,d+=x,m-=_,y+=_,t.isVisible=function(t,e){return t>h&&tm&&ed||ey},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,p.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,p.smoothing,f.smoothing),t.dxydi=s([t._xctrl,t._yctrl],p.smoothing,f.smoothing),t.dxydj=l([t._xctrl,t._yctrl],p.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(a(t,e),c-2)),n=e[r],i=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(i-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(a(t,r),u-2)),n=r[e],i=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(i-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,a,i){if(!i&&(ne[c-1]|ar[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(a),l=t.evalxy([],o,s);if(i){var p,f,h,d,m=0,y=0,g=[];ne[c-1]?(p=c-2,f=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(p=Math.max(0,Math.min(c-2,Math.floor(o)))),ar[u-1]?(h=u-2,d=1,y=(a-r[u-1])/(r[u-1]-r[u-2])):d=s-(h=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(g,p,h,f,d),l[0]+=g[0]*m,l[1]+=g[1]*m),y&&(t.dxydj(g,p,h,f,d),l[0]+=g[0]*y,l[1]+=g[1]*y)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,a){var i=t.dxydi(null,e,r,n,a),o=t.dadi(e,n);return[i[0]/o,i[1]/o]},t.dxydb=function(e,r,n,a){var i=t.dxydj(null,e,r,n,a),o=t.dbdj(r,a);return[i[0]/o,i[1]/o]},t.dxyda_rough=function(e,r,n){var a=g*(n||.1),i=t.ab2xy(e+a,r,!0),o=t.ab2xy(e-a,r,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dxydb_rough=function(e,r,n){var a=v*(n||.1),i=t.ab2xy(e,r+a,!0),o=t.ab2xy(e,r-a,!0);return[.5*(i[0]-o[0])/a,.5*(i[1]-o[1])/a]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":361,"./compute_control_points":515,"./constants":516,"./create_i_derivative_evaluator":517,"./create_j_derivative_evaluator":518,"./create_spline_evaluator":519}],528:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var a,i,o,s=[],l=[],c=t[0].length,u=t.length;function p(e,r){var n,a=0,i=0;return e>0&&void 0!==(n=t[r][e-1])&&(i++,a+=n),e0&&void 0!==(n=t[r-1][e])&&(i++,a+=n),r0&&i0&&a1e-5);return n.log("Smoother converged to",k,"after",M,"iterations"),t}},{"../../lib":342}],529:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var a=r("x"),i=a&&a.length,o=r("y"),s=o&&o.length;if(!i&&!s)return!1;if(e._cheater=!a,i&&!n(a)||s&&!n(o))e._length=null;else{var l=i?a.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":342}],530:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":207,"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/template_attributes":447,"../scattergeo/attributes":741}],531:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o),[t]}},{"../../lib":342,"../../plots/cartesian/axes":390,"./attributes":530}],535:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":423,"../heatmap/colorbar":604,"./attributes":530,"./calc":531,"./defaults":532,"./event_data":533,"./hover":534,"./plot":536,"./select":537,"./style":538}],536:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],a=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(t):o(r,a.topojson),p=[],f=[],h=0;h=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":430,"./convert":540}],544:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../scatter/attributes"),i=t("../../plots/cartesian/axis_format_attributes"),o=i.axisHoverFormat,s=i.descriptionOnlyNumbers,l=t("../../components/colorscale/attributes"),c=t("../../components/drawing/attributes").dash,u=t("../../plots/font_attributes"),p=t("../../lib/extend").extendFlat,f=t("../../constants/filter_ops"),h=f.COMPARISON_OPS2,d=f.INTERVAL_OPS,m=a.line;e.exports=p({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:n.hovertemplate,hoverongaps:n.hoverongaps,connectgaps:p({},n.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:u({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:s("contour label")},operation:{valType:"enumerated",values:[].concat(h).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:p({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:c,smoothing:p({},m.smoothing,{}),editType:"plot"}},l("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":215,"../../components/drawing/attributes":229,"../../constants/filter_ops":317,"../../lib/extend":333,"../../plots/cartesian/axis_format_attributes":393,"../../plots/font_attributes":419,"../heatmap/attributes":601,"../scatter/attributes":705}],545:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("../heatmap/calc"),i=t("./set_contours"),o=t("./end_plus");e.exports=function(t,e){var r=a(t,e),s=r[0].z;i(e,s);var l,c=e.contours,u=n.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var p=c.start,f=o(c),h=c.size||1,d=Math.floor((f-p)/h)+1;isFinite(h)||(h=1,d=1);var m=p-h/2;l=[m,m+d*h]}else l=s;return n.calc(t,e,{vals:l,cLetter:"z"}),r}},{"../../components/colorscale":220,"../heatmap/calc":602,"./end_plus":555,"./set_contours":563}],546:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t[0],a=n.z;switch(e.type){case"levels":var i=Math.min(a[0][0],a[0][1]);for(r=0;ro.level||o.starts.length&&i===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":h>c&&(n.prefixBoundary=!0);break;case"<":(hc||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":p=Math.min(h[0],h[1]),f=Math.max(h[0],h[1]),pc&&(n.prefixBoundary=!0)}}}},{}],547:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("./make_color_map"),i=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=a(e,{isColorbar:!0});if("heatmap"===c){var p=n.extractOpts(e);r._fillgradient=p.reversescale?n.flipScale(p.colorscale):p.colorscale,r._zrange=[p.min,p.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:i(o),size:l}}}},{"../../components/colorscale":220,"./end_plus":555,"./make_color_map":560}],548:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],549:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,s=i.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,i,l,p){var f,h,d,m=e.contours,y=r("contours.operation");(m._operation=c[y],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,m),"="===y?f=m.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),f)&&(h=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,h,p)}},{"../../components/color":208,"../../constants/filter_ops":317,"./label_defaults":559,"fast-isnumeric":81}],550:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),a=t("fast-isnumeric");function i(t,e){var r,i=Array.isArray(e);function o(t){return a(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(i?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=i?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=i?e.map(o):[o(e)]),r}function o(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":317,"fast-isnumeric":81}],551:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],552:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,i,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":342,"./constraint_mapping":550,"./end_plus":555}],555:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],556:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./constants");function i(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(t)?i=1:-1!==a.LEFTSTART.indexOf(t)?n=1:-1!==a.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),h=[s(t,e,[-f[0],-f[1]])],d=t.z.length,m=t.z[0].length,y=e.slice(),g=f.slice();for(c=0;c<1e4;c++){if(p>20?(p=a.CHOOSESADDLE[p][(f[0]||f[1])<0?0:1],t.crossings[u]=a.SADDLEREMAINDER[p]):delete t.crossings[u],!(f=a.NEWDELTA[p])){n.log("Found bad marching index:",p,e,t.level);break}h.push(s(t,e,f)),e[0]+=f[0],e[1]+=f[1],u=e.join(","),i(h[h.length-1],h[h.length-2],o,l)&&h.pop();var v=f[0]&&(e[0]<0||e[0]>m-2)||f[1]&&(e[1]<0||e[1]>d-2);if(e[0]===y[0]&&e[1]===y[1]&&f[0]===g[0]&&f[1]===g[1]||r&&v)break;p=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,_,b,w,T,k,M,A,S,L,E,P,C,I,D,z=i(h[0],h[h.length-1],o,l),O=0,R=.2*t.smoothing,F=[],N=0;for(c=1;c=N;c--)if((x=F[c])=N&&x+F[_]A&&S--,t.edgepaths[S]=E.concat(h,L));break}V||(t.edgepaths[A]=h.concat(L))}for(A=0;At?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,i,o,s,l,c,u,p,f=t[0].z,h=f.length,d=f[0].length,m=2===h||2===d;for(r=0;r=0&&(n=v,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,s=l):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,s>=0)break;p+="L"+n}if(s===t.edgepaths.length){a.log("unclosed perimeter path");break}f=s,(d=-1===h.indexOf(f))&&(f=h[0],p+="Z")}for(f=0;fn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),h=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(p)+Math.cos(c)*o);if(f<1||h<1)return 1/0;var d=g.EDGECOST*(1/(f-1)+1/(h-1));d+=g.ANGLECOST*c*c;for(var m=s-u,y=l-p,v=s+u,x=l+p,_=0;_2*g.MAXCOST)break;h&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var a=e.fontSize,i=e.width+a/3,o=Math.max(0,e.height-a/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),p=Math.cos(c),f=function(t,e){return[s+t*p-e*u,l+t*u+e*p]},h=[f(-i/2,-o/2),f(-i/2,o/2),f(i/2,o/2),f(i/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:i,height:o}),n.push(h)},r.drawLabels=function(t,e,r,i,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,a=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:a,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+a+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,p=r.end,f=t._input.contours;if(u>p&&(r.start=f.start=p,p=r.end=f.end=u,u=r.start),!(r.size>0))c=u===p?1:i(u,p,t.ncontours).dtick,f.size=r.size=c}}},{"../../lib":342,"../../plots/cartesian/axes":390}],564:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../components/drawing"),i=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[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,i=r.contours,s=r.line,l=i.size||1,c=i.start,u="constraint"===i.type,p=!u&&"lines"===i.coloring,f=!u&&"fill"===i.coloring,h=p||f?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(a.lineGroupStyle,s.width,p?h(t.level):s.color,s.dash)}));var d=i.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){a.font(n.select(this),{family:d.family,size:d.size,color:d.color||(p?h(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(f){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),h(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",h(m-.5*l))}})),i(t)}},{"../../components/drawing":230,"../heatmap/style":613,"./make_color_map":560,"@plotly/d3":44}],565:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":218,"./label_defaults":559}],566:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../contour/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=a.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:a.fillcolor,autocontour:a.autocontour,ncontours:a.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a.line.color,width:a.line.width,dash:a.line.dash,smoothing:a.line.smoothing,editType:"plot"},transforms:void 0},i("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../contour/attributes":544,"../heatmap/attributes":601}],567:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),a=t("../../lib"),i=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),p=t("../carpet/lookup_carpetid"),f=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=p(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var h=t.data[r.index],d=t.data[e.index];d.a||(d.a=h.a),d.b||(d.b=h.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,p,f,h,d,m,y=e._carpetTrace,g=y.aaxis,v=y.baxis;g._minDtick=0,v._minDtick=0,a.isArray1D(e.z)&&i(e,g,v,"a","b",["z"]);r=e._a=e._a||e.a,f=e._b=e._b||e.b,r=r?g.makeCalcdata(e,"_a"):[],f=f?v.makeCalcdata(e,"_b"):[],u=e.a0||0,p=e.da||1,h=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var x=a.maxRowLength(m),_="scaled"===e.xtype?"":r,b=c(e,_,u,p,x,g),w="scaled"===e.ytype?"":f,T=c(e,w,h,d,m.length,v),k={a:b,b:T,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return f(e,e._z),m}}},{"../../components/colorscale/calc":216,"../../lib":342,"../carpet/lookup_carpetid":522,"../contour/set_contours":563,"../heatmap/clean_2d_array":603,"../heatmap/convert_column_xyz":605,"../heatmap/find_empties":607,"../heatmap/interp2d":610,"../heatmap/make_bound_array":611,"./defaults":568}],568:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,i,r,a)}if(u("carpet"),t.a&&t.b){if(!a(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,i,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":342,"../contour/constraint_defaults":549,"../contour/contours_defaults":551,"../contour/style_defaults":565,"../heatmap/xyz_defaults":615,"./attributes":566}],569:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":404,"../contour/colorbar":547,"../contour/style":564,"./attributes":566,"./calc":567,"./defaults":568,"./plot":570}],570:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../carpet/map_1d_array"),i=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),p=t("../contour/constants"),f=t("../contour/convert_to_constraints"),h=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),y=t("../carpet/axis_aligned_line");function g(t,e,r){var n=t.getPointAtLength(e),a=t.getPointAtLength(r),i=a.x-n.x,o=a.y-n.y,s=Math.sqrt(i*i+o*o);return[i/s,o/s]}function v(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,_){var b=e.xaxis,w=e.yaxis;s.makeTraceGroups(_,r,"contour").each((function(r){var _=n.select(this),T=r[0],k=T.trace,M=k._carpetTrace=m(t,k),A=t.calcdata[M.index][0];if(M.visible&&"legendonly"!==M.visible){var S=T.a,L=T.b,E=k.contours,P=h(E,e,T),C="constraint"===E.type,I=E._operation,D=C?"="===I?"lines":"fill":E.coloring,z=[[S[0],L[L.length-1]],[S[S.length-1],L[L.length-1]],[S[S.length-1],L[0]],[S[0],L[0]]];l(P);var O=1e-8*(S[S.length-1]-S[0]),R=1e-8*(L[L.length-1]-L[0]);c(P,O,R);var F,N,B,j,U=P;"constraint"===E.type&&(U=f(P,I)),function(t,e){var r,n,a,i,o,s,l,c,u;for(r=0;r=0;j--)F=A.clipsegments[j],N=a([],F.x,b.c2p),B=a([],F.y,w.c2p),N.reverse(),B.reverse(),V.push(i(N,B,F.bicubic));var q="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,p,f,h=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);h.enter().append("path"),h.exit().remove();var d=[];for(f=0;f=0&&(f=E,d=m):Math.abs(p[1]-f[1])=0&&(f=E,d=m):s.log("endpt to newendpt is not vert. or horz.",p,f,E)}if(d>=0)break;v+=S(p,f),p=f}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(_=-1===x.indexOf(u))&&(u=x[0],v+=S(p,f)+"Z",p=null)}for(u=0;uy&&(n.max=y);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*p.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/I),p.LABELMAX),i=0;i0?+h[u]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var _=o.extractOpts(e),b=_.reversescale?o.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":430,"./convert":573}],579:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,a=e.mc||r.color,i=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(u,f),[l]}}},{"../../components/color":208,"../../lib":342,"../bar/hover":469}],587:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":404,"../bar/select":474,"./attributes":580,"./calc":581,"./cross_trace_calc":583,"./defaults":584,"./event_data":585,"./hover":586,"./layout_attributes":588,"./layout_defaults":589,"./plot":590,"./style":591}],588:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],589:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(a.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":208,"../../components/drawing":230,"../../constants/interactions":318,"../bar/style":476,"../bar/uniform_text":478,"@plotly/d3":44}],592:[function(t,e,r){"use strict";var n=t("../pie/attributes"),a=t("../../plots/attributes"),i=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":333,"../../plots/attributes":386,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683}],593:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":438}],594:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":685}],595:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,i){return n.coerce(t,e,a,r,i)}var u=c("labels"),p=c("values"),f=s(u,p),h=f.len;if(e._hasLabels=f.hasLabels,e._hasValues=f.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),h){e._length=h,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),y=c("texttemplate");if(y||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||d&&"none"!==d){var g=c("textposition");o(t,e,l,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":342,"../../plots/domain":418,"../bar/defaults":466,"../pie/defaults":686,"./attributes":592}],596:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":694,"./attributes":592,"./base_plot":593,"./calc":594,"./defaults":595,"./layout_attributes":597,"./layout_defaults":598,"./plot":599,"./style":600}],597:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":690}],598:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":342,"./layout_attributes":597}],599:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../components/drawing"),i=t("../../lib"),o=i.strScale,s=i.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),p=u.recordMinTextSize,f=u.clearMinTextSize,h=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,y=d.determineInsideTextFont,g=d.layoutAreas,v=d.prerenderTitles,x=d.positionTitleOutside,_=d.formatSliceLabel;function b(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;f("funnelarea",r),v(e,t),g(e,r._size),i.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var u=n.select(this),f=e[0],d=f.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var p,f,h=[];for(h.push(u()),p=t.length-1;p>-1;p--)if(!(f=t[p]).hidden){var d=f.v/l;c+=d,h.push(u())}var m=1/0,y=-1/0;for(p=0;p-1;p--)if(!(f=t[p]).hidden){var M=h[k+=1][0],A=h[k][1];f.TL=[-M,A],f.TR=[M,A],f.BL=w,f.BR=T,f.pxmid=(S=f.TR,L=f.BR,[.5*(S[0]+L[0]),.5*(S[1]+L[1])]),w=f.TL,T=f.TR}var S,L}(e),u.each((function(){var u=n.select(this).selectAll("g.slice").data(e);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=d.index;var u=f.cx,g=f.cy,v=n.select(this),x=v.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),v.call(m,t,e);var w="M"+(u+o.TR[0])+","+(g+o.TR[1])+b(o.TR,o.BR)+b(o.BR,o.BL)+b(o.BL,o.TL)+"Z";x.attr("d",w),_(t,o,f);var T=h.castOption(d.textposition,o.pts),k=v.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var f=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=i.ensureUniformFontSize(t,y(d,o,r.font));f.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,h).call(l.convertToTspans,t);var m,v,x,_=a.bBox(f.node()),b=Math.min(o.BL[1],o.BR[1])+g,w=Math.max(o.TL[1],o.TR[1])+g;v=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(m=c(v,x,b,w,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=h.size,p(d.type,m,r),e[s].transform=m,f.attr("transform",i.getTextTransform(m))}))}}));var g=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var e=i.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),c=d.title.text;d._meta&&(c=i.templateString(c,d._meta)),e.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,d.title.font).call(l.convertToTspans,t);var u=x(f,r._size);e.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../bar/plot":473,"../bar/uniform_text":478,"../pie/helpers":688,"../pie/plot":692,"@plotly/d3":44}],600:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../pie/style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":478,"../pie/style_one":694,"@plotly/d3":44}],601:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:l({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:l({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:l({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:l({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:l({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:l({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z",1),hovertemplate:o(),showlegend:l({},a.showlegend,{dflt:!1})},{transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/template_attributes":447,"../scatter/attributes":705}],602:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),p=t("./interp2d"),f=t("./find_empties"),h=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nO){D("x scale is not linear");break}}if(x.length&&"fast"===C){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){D("y scale is not linear");break}}}var N=a.maxRowLength(T),B="scaled"===e.xtype?"":r,j=h(e,B,y,g,N,A),U="scaled"===e.ytype?"":x,V=h(e,U,_,b,T.length,S);P||(e._extremes[A._id]=i.findExtremes(A,j),e._extremes[S._id]=i.findExtremes(S,V));var q={x:j,y:V,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&v&&(q.orig_x=v),e.yperiodalignment&&w&&(q.orig_y=w),B&&B.length===j.length-1&&(q.xCenter=B),U&&U.length===V.length-1&&(q.yCenter=U),E&&(q.xRanges=M.xRanges,q.yRanges=M.yRanges,q.pts=M.pts),L||l(t,e,{vals:T,cLetter:"z"}),L&&e.contours&&"heatmap"===e.contours.coloring){var H={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};q.xfill=h(H,B,y,g,N,A),q.yfill=h(H,U,_,b,T.length,S)}return[q]}},{"../../components/colorscale/calc":216,"../../constants/numerical":319,"../../lib":342,"../../plots/cartesian/align_period":387,"../../plots/cartesian/axes":390,"../../registry":452,"../histogram2d/calc":630,"./clean_2d_array":603,"./convert_column_xyz":605,"./find_empties":607,"./interp2d":610,"./make_bound_array":611}],603:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,p,f;function h(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,p=0;p=0;o--)(s=((p[[(r=(i=f[o])[0])-1,a=i[1]]]||m)[2]+(p[[r+1,a]]||m)[2]+(p[[r,a-1]]||m)[2]+(p[[r,a+1]]||m)[2])/20)&&(l[i]=[r,a,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(i in l)p[i]=l[i],u.push(l[i])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":342}],608:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,p,f,h=l.isContour,d=t.cd[0],m=d.trace,y=t.xa,g=t.ya,v=d.x,x=d.y,_=d.z,b=d.xCenter,w=d.yCenter,T=d.zmask,k=m.zhoverformat,M=v,A=x;if(!1!==t.index){try{p=Math.round(t.index[1]),f=Math.round(t.index[0])}catch(e){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(p<0||p>=_[0].length||f<0||f>_.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(h){var S;for(M=[2*v[0]-v[1]],S=1;Sm&&(g=Math.max(g,Math.abs(t[i][o]-d)/(y-m))))}return g}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":342}],611:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,c,u,p=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!h&&"category"!==s.type){var m=e.length;if(!(m<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f||d)p=e.slice(0,o);else if(1===o)p=[e[0]-.5,e[0]+.5];else{for(p=[1.5*e[0]-.5*e[1]],u=1;u0;)f=h.c2p(T[v]),v--;for(f0;)g=d.c2p(k[v]),v--;if(g0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]c?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function h(t,e,r,n,i,s){if(n&&t>o){var l=d(e,i,s),c=d(r,i,s),u=t===a?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,c=-1.1*e,f=-.1*e,h=t-f,d=r[0],m=r[1],y=Math.min(p(d+f,d+h,n,i),p(m+f,m+h,n,i)),g=Math.min(p(d+c,d+f,n,i),p(m+c,m+f,n,i));if(y>g&&go){var v=s===a?1:6,x=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",v);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,i);if(cr.r2l(N)&&(j=o.tickIncrement(j,_.size,!0,h)),z.start=r.l2r(j),F||a.nestedProperty(e,g+".start").set(z.start)}var U=_.end,V=r.r2l(D.end),q=void 0!==V;if((_.endFound||q)&&V!==r.r2l(U)){var H=q?V:a.aggNums(Math.max,null,d);z.end=r.l2r(H),q||a.nestedProperty(e,g+".start").set(z.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[g]=a.extendFlat({},e[g]||{}),delete e._input[G],delete e[G]),[z,d]}e.exports={calc:function(t,e){var r,i,h,d,m=[],y=[],g=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),v="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[v],_=e[v+"calendar"],b=e.cumulative,w=f(t,e,g,v),T=w[0],k=w[1],M="string"==typeof T.size,A=[],S=M?A:T,L=[],E=[],P=[],C=0,I=e.histnorm,D=e.histfunc,z=-1!==I.indexOf("density");b.enabled&&z&&(I=I.replace(/ ?density$/,""),z=!1);var O,R="max"===D||"min"===D?null:0,F=l.count,N=c[I],B=!1,j=function(t){return g.r2c(t,0,_)};for(a.isArrayOrTypedArray(e[x])&&"count"!==D&&(O=e[x],B="avg"===D,F=l[D]),r=j(T.start),h=j(T.end)+(r-o.tickIncrement(r,T.size,!1,_))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(y,b.direction,b.currentbin);var K=Math.min(m.length,y.length),J=[],$=0,Q=K-1;for(r=0;r=$;r--)if(y[r]){Q=r;break}for(r=$;r<=Q;r++)if(n(m[r])&&n(y[r])){var tt={p:m[r],s:y[r],b:0};b.enabled||(tt.pts=P[r],G?tt.ph0=tt.ph1=P[r].length?k[P[r][0]]:m[r]:(e._computePh=!0,tt.ph0=q(A[r]),tt.ph1=q(A[r+1],!0))),J.push(tt)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,_)-J[0].p),s(J,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(J,e,X),J},calcAllAutoBins:f}},{"../../lib":342,"../../plots/cartesian/axes":390,"../../registry":452,"../bar/arrays_to_calcdata":461,"./average":617,"./bin_functions":619,"./bin_label_vals":620,"./norm_functions":628,"fast-isnumeric":81}],622:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],623:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=t("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,p,f,h,d,m,y,g=e._histogramBinOpts={},v=[],x={},_=[];function b(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,i){var o=t.uid+"__"+i;r||(r=o);var s=function(t,r){return a.getFromTrace({_fullLayout:e},t,r).type}(t,i),l=t[i+"calendar"]||"",c=g[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(i)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[t],dirs:[i],axType:s,calendar:t[i+"calendar"]||""}),t["_"+i+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),A.length>S&&A.splice(S,A.length-S);var L=[],E=[],P=[],C="string"==typeof w.size,I="string"==typeof M.size,D=[],z=[],O=C?D:w,R=I?z:M,F=0,N=[],B=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=o[j],Y=!1,Z=[],X=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==U&&(Y="avg"===U,H=i[U]);var K=w.size,J=x(w.start),$=x(w.end)+(J-a.tickIncrement(J,K,!1,g))/1e6;for(r=J;r<$;r=a.tickIncrement(r,K,!1,g))E.push(q),D.push(r),Y&&P.push(0);D.push(r);var Q,tt=E.length,et=(r-J)/tt,rt=(Q=J+et/2,m.c2r(Q,0,g)),nt=M.size,at=_(M.start),it=_(M.end)+(at-a.tickIncrement(at,nt,!1,v))/1e6;for(r=at;r=0&&h=0&&d-1,flipY:L.tiling.flip.indexOf("y")>-1,orientation:L.tiling.orientation,pad:{inner:L.tiling.pad},maxDepth:L._maxDepth}).descendants(),D=1/0,z=-1/0;I.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),z=Math.max(z,e))})),h=h.data(I,u.getPtId),L._maxVisibleLayers=isFinite(z)?z-D+1:0,h.enter().append("g").classed("slice",!0),T(h,!1,{},[m,y],x),h.order();var O=null;if(w&&A){var R=u.getPtId(A);h.each((function(t){null===O&&u.getPtId(t)===R&&(O={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var F=function(){return O||{x0:0,x1:m,y0:0,y1:y}},N=h;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=g(s.x0),s._x1=g(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=g(s.x1-L.tiling.pad),s._hoverY=v(C?s.y1-L.tiling.pad/2:s.y0+L.tiling.pad/2);var h=n.select(this),d=a.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events","all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,F(),[m,y],{orientation:L.tiling.orientation,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1});return function(t){return x(e(t))}})):d.attr("d",x),h.call(p,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,L,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=f(s,r,L,e,S)||"";var T=a.ensureSingle(h,"g","slicetext"),A=a.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),I=a.ensureUniformFontSize(t,u.determineTextFont(L,s,S.font));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":E?"start":"middle").call(i.font,I).call(o.convertToTspans,t),s.textBB=i.bBox(A.node()),s.transform=_(s,{fontSize:I.size}),s.transform.fontSize=I.size,w?A.transition().attrTween("transform",(function(t){var e=M(t,!1,F(),[m,y]);return function(t){return b(e(t))}})):A.attr("transform",b(s))})),O}},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../sunburst/fx":780,"../sunburst/helpers":781,"../sunburst/plot":785,"../treemap/constants":799,"./partition":646,"./style":648,"@plotly/d3":44}],643:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":723,"./attributes":638,"./base_plot":639,"./calc":640,"./defaults":641,"./layout_attributes":644,"./layout_defaults":645,"./plot":647,"./style":648}],644:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],645:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":342,"./layout_attributes":644}],646:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),a=t("../treemap/flip_tree");e.exports=function(t,e,r){var i=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var p=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||i||o)&&a(p,e,{swapXY:s,flipX:i,flipY:o}),p}},{"../treemap/flip_tree":804,"d3-hierarchy":71}],647:[function(t,e,r){"use strict";var n=t("../treemap/draw"),a=t("./draw_descendants");e.exports=function(t,e,r,i){return n(t,e,r,i,{type:"icicle",drawDescendants:a})}},{"../treemap/draw":801,"./draw_descendants":642}],648:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,c=i.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":208,"../../lib":342,"../bar/uniform_text":478,"@plotly/d3":44}],649:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,p=Math.floor((e-o.x0)/s.dx),f=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[f][p]:s._hasSource&&(u=s._canvas.el.getContext("2d").getImageData(p,f,1,1).data),u){var h,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(h=!0)}var y,g=i.colormodel[s.colormodel],v=g.colormodel||s.colormodel,x=v.length,_=s._scaler(u),b=g.suffix,w=[];(s.hovertemplate||h)&&(w.push("["+[_[0]+b[0],_[1]+b[1],_[2]+b[2]].join(", ")),4===x&&w.push(", "+_[3]+b[3]),w.push("]"),w=w.join(""),t.extraText=v.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[f])?y=s.hovertext[f][p]:Array.isArray(s.text)&&Array.isArray(s.text[f])&&(y=s.text[f][p]);var T=c.c2p(o.y0+(f+.5)*s.dy),k=o.x0+(p+.5)*s.dx,M=o.y0+(f+.5)*s.dy,A="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[a.extendFlat(t,{index:[f,p],x0:l.c2p(o.x0+p*s.dx),x1:l.c2p(o.x0+(p+1)*s.dx),y0:T,y1:T,color:_,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:A,text:y,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":_[0]+b[0],"color[1]Label":_[1]+b[1],"color[2]Label":_[2]+b[2],"color[3]Label":_[3]+b[3]}})]}}}},{"../../components/fx":248,"../../lib":342,"./constants":651}],656:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":404,"./attributes":649,"./calc":650,"./defaults":652,"./event_data":653,"./hover":655,"./plot":657,"./style":658}],657:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=a.isIOS()||a.isSafari()||a.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,p=e.yaxis,f=!(l||t._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&f)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===p.type;c._realImage=h;var d,m,y,g,v,x,_=l.z,b=l.x0,w=l.y0,T=l.w,k=l.h,M=c.dx,A=c.dy;for(x=0;void 0===d&&x0;)m=u.c2p(b+x*M),x--;for(x=0;void 0===g&&x0;)v=p.c2p(w+x*A),x--;if(mI[0];if(D||z){var O=d+S/2,R=g+L/2;P+="transform:"+i(O+"px",R+"px")+"scale("+(D?-1:1)+","+(z?-1:1)+")"+i(-O+"px",-R+"px")+";"}}E.attr("style",P);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=k;var r=e.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}})).then((function(){var t;if(c._hasZ)t=N((function(t,e){return _[e][t]})).toDataURL("image/png");else if(c._hasSource)if(h)t=c.source;else{var e=c._canvas.el.getContext("2d").getImageData(0,0,T,k).data;t=N((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}E.attr({"xlink:href":t,height:L,width:S,x:d,y:g})}));t._promises.push(F)}function N(t){var e=document.createElement("canvas");e.width=S,e.height=L;var r,n=e.getContext("2d"),i=function(t){return a.constrain(Math.round(u.c2p(b+t*M)-d),0,S)},o=function(t){return a.constrain(Math.round(p.c2p(w+t*A)-g),0,L)},f=s.colormodel[c.colormodel],h=f.colormodel||c.colormodel,m=f.fmt;for(x=0;x0}function T(t){t.each((function(t){v.stroke(n.select(this),t.line.color)})).each((function(t){v.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),i={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(a,i,g,t,e)}return m(a,i,l,s,n),y(a,i,l,s),i}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function A(t,e,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(h.convertToTspans,a).call(p.font,e),p.bBox(o.node())}function S(t,e,r,n,a,i){var s="_cache"+e;t[s]&&t[s].key===a||(t[s]={key:a,value:r});var l=o.aggNums(i,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var y,g=t._fullLayout;w(r)&&m&&(y=m()),o.makeTraceGroups(g._indicatorlayer,e,"trace").each((function(e){var m,L,E,P,C,I=e[0].trace,D=n.select(this),z=I._hasGauge,O=I._isAngular,R=I._isBullet,F=I.domain,N={w:g._size.w*(F.x[1]-F.x[0]),h:g._size.h*(F.y[1]-F.y[0]),l:g._size.l+g._size.w*F.x[0],r:g._size.r+g._size.w*(1-F.x[1]),t:g._size.t+g._size.h*(1-F.y[1]),b:g._size.b+g._size.h*F.y[0]},B=N.l+N.w/2,j=N.t+N.h/2,U=Math.min(N.w/2,N.h),V=f.innerRadius*U,q=I.align||"center";if(L=j,z){if(O&&(m=B,L=j+U/2,E=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*V)}),R){var H=f.bulletPadding,G=1-f.bulletNumberDomainSize+H;m=N.l+(G+(1-G)*_[q])*N.w,E=function(t){return M(t,(f.bulletNumberDomainSize-H)*N.w,N.h)}}}else m=N.l+_[q]*N.w,E=function(t){return M(t,N.w,N.h)};!function(t,e,r,a){var c,u,f,m=r[0].trace,y=a.numbersX,g=a.numbersY,T=m.align||"center",M=x[T],L=a.transitionOpts,E=a.onComplete,P=o.ensureSingle(e,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var I=P.selectAll("text").data(C);function D(e,r,n,a){if(!e.match("s")||n>=0==a>=0||r(n).slice(-1).match(b)||r(a).slice(-1).match(b))return r;var i=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:i});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}I.enter().append("text"),I.attr("text-anchor",(function(){return M})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,O=m.mode+m.align;m._hasDelta&&(z=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var a=function(t){return d.tickText(e,t).text},o=function(t){return m.delta.relative?t.relativeDelta:t.delta},s=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+e(t)},l=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=o(r[0]));var c=P.select("text.delta");function f(){c.text(s(o(r[0]),a)).call(v.fill,l(r[0])).call(h.convertToTspans,t)}return c.call(p.font,m.delta.font).call(v.fill,l({delta:m._deltaLastValue})),w(L)?c.transition().duration(L.duration).ease(L.easing).tween("text",(function(){var t=n.select(this),e=o(r[0]),c=m._deltaLastValue,u=D(m.delta.valueformat,a,c,e),p=i(c,e);return m._deltaLastValue=e,function(e){t.text(s(p(e),u)),t.call(v.fill,l({delta:p(e)}))}})).each("end",(function(){f(),E&&E()})).each("interrupt",(function(){f(),E&&E()})):f(),u=A(s(o(r[0]),a),m.delta.font,M,t),c}(),O+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,O+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var a=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=P.select("text.number");function u(){var e="number"==typeof r[0].y?s+a(r[0].y)+o:"-";l.text(e).call(p.font,m.number.font).call(h.convertToTspans,t)}w(L)?l.transition().duration(L.duration).ease(L.easing).each("end",(function(){u(),E&&E()})).each("interrupt",(function(){u(),E&&E()})).attrTween("text",(function(){var t=n.select(this),e=i(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=D(m.number.valueformat,a,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=A(s+a(r[0].y)+o,m.number.font,M,t)}(),O+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c);if(m._hasDelta&&m._hasNumber){var R,F,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],B=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*_[m.align]+u.width*(1-_[m.align])+j),O,Math.min),F=N[1]-B[1],f={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-_[m.align])+u.width*_[m.align]+j,O,Math.max),F=N[1]-B[1],f={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),z.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&P.attr("transform",(function(){var t=a.numbersScaler(f);O+=t[2];var e,r=S(m,"numbersScale",1,t[0],O,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?g-r*f.bottom:g-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+e;var n=f[T];"center"===T&&(n=(f.left+f.right)/2);var i=y-r*n;return i=S(m,"numbersTranslate",0,i,O,Math.max),l(i,e)+s(r)}))}(t,D,e,{numbersX:m,numbersY:L,numbersScaler:E,transitionOpts:r,onComplete:y}),z&&(P={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},C={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var Y=D.selectAll("g.angular").data(O?e:[]);Y.exit().remove();var Z=D.selectAll("g.angularaxis").data(O?e:[]);Z.exit().remove(),O&&function(t,e,r,i){var o,s,p,f,h=r[0].trace,m=i.size,y=i.radius,g=i.innerRadius,v=i.gaugeBg,x=i.gaugeOutline,_=[m.l+m.w/2,m.t+m.h/2+y/2],b=i.gauge,M=i.layer,A=i.transitionOpts,S=i.onComplete,L=Math.PI/2;function E(t){var e=h.gauge.axis.range[0],r=(t-e)/(h.gauge.axis.range[1]-e)*Math.PI-L;return r<-L?-L:r>L?L:r}function P(t){return n.svg.arc().innerRadius((g+y)/2-t/2*(y-g)).outerRadius((g+y)/2+t/2*(y-g)).startAngle(-L)}function C(t){t.attr("d",(function(t){return P(t.thickness).startAngle(E(t.range[0])).endAngle(E(t.range[1]))()}))}b.enter().append("g").classed("angular",!0),b.attr("transform",l(_[0],_[1])),M.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),M.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,h.gauge.axis)).type="linear",o.range=h.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},D={},z=d.makeLabelFns(o,0).labelStandoff;D.xFn=function(t){var e=I(t);return Math.cos(e)*z},D.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},D.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},D.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return l(_[0]+y*Math.cos(t),_[1]-y*Math.sin(t))};p=function(t){return O(I(t))};if(s=d.calcTicks(o),f=d.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:M,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(t){var e=I(t);return O(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:M,transFn:p,labelFns:D})}var F=[v].concat(h.gauge.steps),N=b.selectAll("g.bg-arc").data(F);N.enter().append("g").classed("bg-arc",!0).append("path"),N.select("path").call(C).call(T),N.exit().remove();var B=P(h.gauge.bar.thickness),j=b.selectAll("g.value-arc").data([h.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U=j.select("path");w(A)?(U.transition().duration(A.duration).ease(A.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=B,q=E(r[0].lastY),H=E(r[0].y),function(){var t=a(q,H);return function(e){return V.endAngle(t(e))()}})),h._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?B.endAngle(E(r[0].y)):"M0,0Z");var V,q,H;U.call(T),j.exit().remove(),F=[];var G=h.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:h.gauge.threshold.color,line:{color:h.gauge.threshold.line.color,width:h.gauge.threshold.line.width},thickness:h.gauge.threshold.thickness});var Y=b.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(C).call(T),Y.exit().remove();var Z=b.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(C).call(T),Z.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:Z,size:N,gaugeBg:P,gaugeOutline:C,transitionOpts:r,onComplete:y});var X=D.selectAll("g.bullet").data(R?e:[]);X.exit().remove();var W=D.selectAll("g.bulletaxis").data(R?e:[]);W.exit().remove(),R&&function(t,e,r,n){var a,i,o,s,c,u=r[0].trace,p=n.gauge,h=n.layer,m=n.gaugeBg,y=n.gaugeOutline,g=n.size,x=u.domain,_=n.transitionOpts,b=n.onComplete;p.enter().append("g").classed("bullet",!0),p.attr("transform",l(g.l,g.t)),h.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),h.selectAll("g.xbulletaxistick,path,text").remove();var M=g.h,A=u.gauge.bar.thickness*M,S=x.x[0],L=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-f.bulletNumberDomainSize:1);(a=k(t,u.gauge.axis))._id="xbulletaxis",a.domain=[S,L],a.setScale(),i=d.calcTicks(a),o=d.makeTransTickFn(a),s=d.getTickSigns(a)[2],c=g.t+g.h,a.visible&&(d.drawTicks(t,a,{vals:"inside"===a.ticks?d.clipEnds(a,i):i,layer:h,path:d.makeTickPath(a,c,s),transFn:o}),d.drawLabels(t,a,{vals:i,layer:h,transFn:o,labelFns:d.makeLabelFns(a,c)}));function E(t){t.attr("width",(function(t){return Math.max(0,a.c2p(t.range[1])-a.c2p(t.range[0]))})).attr("x",(function(t){return a.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*M})).attr("height",(function(t){return t.thickness*M}))}var P=[m].concat(u.gauge.steps),C=p.selectAll("g.bg-bullet").data(P);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(E).call(T),C.exit().remove();var I=p.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",A).attr("y",(M-A)/2).call(T),w(_)?I.select("rect").transition().duration(_.duration).ease(_.easing).each("end",(function(){b&&b()})).each("interrupt",(function(){b&&b()})).attr("width",Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);I.exit().remove();var D=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),z=p.selectAll("g.threshold-bullet").data(D);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",a.c2p(u.gauge.threshold.value)).attr("x2",a.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*M).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*M).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),z.exit().remove();var O=p.selectAll("g.gauge-outline").data([y]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(E).call(T),O.exit().remove()}(t,0,e,{gauge:X,layer:W,size:N,gaugeBg:P,gaugeOutline:C,transitionOpts:r,onComplete:y});var K=D.selectAll("text.title").data(e);K.exit().remove(),K.enter().append("text").classed("title",!0),K.attr("text-anchor",(function(){return R?x.right:x[I.title.align]})).text(I.title.text).call(p.font,I.title.font).call(h.convertToTspans,t),K.attr("transform",(function(){var t,e=N.l+N.w*_[I.title.align],r=f.titlePadding,n=p.bBox(K.node());if(z){if(O)if(I.gauge.axis.visible)t=p.bBox(Z.node()).top-r-n.bottom;else t=N.t+N.h/2-U/2-n.bottom-r;R&&(t=L-(n.top+n.bottom)/2,e=N.l-f.bulletPadding*N.w)}else t=I._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":208,"../../components/drawing":230,"../../constants/alignment":313,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/cartesian/axes":390,"../../plots/cartesian/axis_defaults":392,"../../plots/cartesian/layout_attributes":405,"../../plots/cartesian/position_defaults":408,"./constants":662,"@plotly/d3":44,"d3-interpolate":72}],666:[function(t,e,r){"use strict";var n=t("../../lib").extendFlat,a=t("../scatter/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../components/drawing/attributes").dash,s=t("../../components/fx/attributes"),l=t("../../constants/delta.js"),c=l.INCREASING.COLOR,u=l.DECREASING.COLOR,p=a.line;function f(t){return{line:{color:n({},p.color,{dflt:t}),width:p.width,dash:o,editType:"style"},editType:"style"}}e.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},p.width,{}),dash:n({},o,{}),editType:"style"},increasing:f(c),decreasing:f(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},s.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":229,"../../components/fx/attributes":239,"../../constants/delta.js":315,"../../lib":342,"../../plots/cartesian/axis_format_attributes":393,"../scatter/attributes":705}],667:[function(t,e,r){"use strict";var n=t("../../lib"),a=n._,i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../../constants/numerical").BADNUM;function l(t,e,r,n){return{o:t,h:e,l:r,c:n}}function c(t,e,r,o,l,c){for(var u=l.makeCalcdata(e,"open"),p=l.makeCalcdata(e,"high"),f=l.makeCalcdata(e,"low"),h=l.makeCalcdata(e,"close"),d=Array.isArray(e.text),m=Array.isArray(e.hovertext),y=!0,g=null,v=!!e.xperiodalignment,x=[],_=0;_g):y=M>w,g=M;var A=c(w,T,k,M);A.pos=b,A.yc=(w+M)/2,A.i=_,A.dir=y?"increasing":"decreasing",A.x=A.pos,A.y=[k,T],v&&(A.orig_p=r[_]),d&&(A.tx=e.text[_]),m&&(A.htx=e.hovertext[_]),x.push(A)}else x.push({pos:b,empty:!0})}return e._extremes[l._id]=i.findExtremes(l,n.concat(f,p),{padded:!0}),x.length&&(x[0].t={labels:{open:a(t,"open:")+" ",high:a(t,"high:")+" ",low:a(t,"low:")+" ",close:a(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var r=i.getFromId(t,e.xaxis),a=i.getFromId(t,e.yaxis),s=function(t,e,r){var a=r._minDiff;if(!a){var i,s=t._fullData,l=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(s,_,l.yhoverformat):((v=a.extendFlat({},f)).y0=v.y1=b,v.yLabelVal=_,v.yLabel=c.labels[x]+n.hoverLabelText(s,_,l.yhoverformat),v.name="",p.push(v),y[_]=v)}return p}function f(t,e,r,a){var i=t.cd,o=t.ya,l=i[0].trace,p=i[0].t,f=u(t,e,r,a);if(!f)return[];var h=i[f.index],d=f.index=h.i,m=h.dir;function y(t){return p.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var g=h.hi||l.hoverinfo,v=g.split("+"),x="all"===g,_=x||-1!==v.indexOf("y"),b=x||-1!==v.indexOf("text"),w=_?[y("open"),y("high"),y("low"),y("close")+" "+c[m]]:[];return b&&s(h,l,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(h.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?p(t,e,r,n):f(t,e,r,n)},hoverSplit:p,hoverOnPoints:f}},{"../../components/color":208,"../../components/fx":248,"../../constants/delta.js":315,"../../lib":342,"../../plots/cartesian/axes":390}],670:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":404,"./attributes":666,"./calc":667,"./defaults":668,"./hover":669,"./plot":672,"./select":673,"./style":674}],671:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports=function(t,e,r,i){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),s&&l&&c&&u){var p=Math.min(s.length,l.length,c.length,u.length);return o&&(p=Math.min(p,a.minRowLength(o))),e._length=p,p}}},{"../../lib":342,"../../registry":452}],672:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib");e.exports=function(t,e,r,i){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],i=r.t;if(!0!==r.trace.visible||i.empty)e.remove();else{var c=i.tickLen,u=e.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":342,"@plotly/d3":44}],673:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,a=t.xaxis,i=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,p){function f(r,a){return n.coerce(t,e,l,r,a)}var h=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,p,f);o(e,p,f),Array.isArray(h)&&h.length||(e.visible=!1),c(e,h,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var m={family:p.font.family,size:Math.round(p.font.size),color:p.font.color};n.coerceFont(f,"labelfont",m);var y={family:p.font.family,size:Math.round(p.font.size/1.2),color:p.font.color};n.coerceFont(f,"tickfont",y)}},{"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"../../lib":342,"../../plots/array_container_defaults":385,"../../plots/domain":418,"../parcoords/merge_length":682,"./attributes":675}],679:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":675,"./base_plot":676,"./calc":677,"./defaults":678,"./plot":681}],680:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-interpolate").interpolateNumber,i=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),p=t("../../lib/svg_text_utils");function f(t,e,r,a){var i=t.map(F.bind(0,e,r)),o=a.selectAll("g.parcatslayer").data([null]);o.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=o.selectAll("g.trace.parcats").data(i,h),f=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return l(t.x,t.y)})),f.append("g").attr("class","paths");var v=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),h);v.attr("fill",(function(t){return t.model.color}));var x=v.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);b(x),v.attr("d",(function(t){return t.svgD})),x.empty()||v.sort(m),v.exit().remove(),v.on("mouseover",y).on("mouseout",g).on("click",_),f.append("g").attr("class","dimensions");var w=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),h);w.enter().append("g").attr("class","dimension"),w.attr("transform",(function(t){return l(t.x,0)})),w.exit().remove();var M=w.selectAll("g.category").data((function(t){return t.categories}),h),A=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(A);var S=M.selectAll("rect.bandrect").data((function(t){return t.bands}),h);S.each((function(){s.raiseToTop(this)})),S.attr("fill",(function(t){return t.color}));var L=S.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);S.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(L),S.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var z=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",p.makeTextShadow(z)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),p.convertToTspans(n.select(this),e)})),A.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",P),M.exit().remove(),w.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",C).on("drag",I).on("dragend",D)),u.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function h(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),E=n.mouse(p)[0];o.loneHover({trace:f,x:_-d.left+m.left,y:b-d.top+m.top,text:L,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:E<_?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:A,eventData:[{data:f._input,fullData:f,count:k,probability:M}]},{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:p})}}}function g(t){if(!t.parcatsViewModel.dragDimension&&(b(n.select(this)),o.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(m),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=v(t),r=x(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:n.event,constraints:r})}}function v(t){for(var e=[],r=z(t.parcatsViewModel),n=0;n1&&f.displayInd===p.dimensions.length-1?(a=c.left,i="left"):(a=c.left+c.width,i="right");var m=u.model.count,y=u.model.categoryLabel,g=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:y,probabilityLabel:g.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var _=x.join("
");return{trace:h,x:o*(a-e.left),y:s*(d-e.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:i,hovertemplate:h.hovertemplate,hovertemplateLabels:v,eventData:[{data:h._input,fullData:h,count:m,category:y,probability:g}]}}function E(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,a=r._fullLayout,i=a._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=M(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=M(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),A(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=L(r,i,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var a,i,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),p=c.categoryViewModel,f=p.parcatsViewModel,h=f.model.dimensions[p.model.dimensionInd],d=f.trace,m=l.y+l.height/2;f.dimensions.length>1&&h.displayInd===f.dimensions.length-1?(a=l.left,i="left"):(a=l.left+l.width,i="right");var y=p.model.categoryLabel,g=c.parcatsViewModel.model.count,v=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(v+=t.count)}));var x=p.model.count,_=0;f.pathSelection.each((function(t){t.model.color===c.color&&(_+=t.model.count)}));var b=v/g,w=v/_,T=v/x,k={countLabel:g,categoryLabel:y,probabilityLabel:b.toFixed(3)},M=[];-1!==p.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",k.countLabel].join(" ")),-1!==p.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(M.push("P(color \u2229 "+y+"): "+k.probabilityLabel),M.push("P("+y+" | color): "+w.toFixed(3)),M.push("P(color | "+y+"): "+T.toFixed(3)));var A=M.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(a-e.left),y:s*(m-e.top),text:A,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:i,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:y,count:g,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(r,i,this):"dimension"===l&&(e=function(t,e,r){var a=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){a.push(L(t,e,this))})),a}(r,i,this)),e&&o.loneHover(e,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r})}}function P(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(b(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):A(this,"plotly_unhover",n.event)}}function C(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],a=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=a&&a<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yp.y+p.height/2&&(o.model.displayInd=p.model.displayInd,p.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){i.model.dragX=n.event.x;var f=t.parcatsViewModel.dimensions[r],h=t.parcatsViewModel.dimensions[a];void 0!==f&&i.model.dragXh.x&&(i.model.displayInd=h.model.displayInd,h.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=i.model.displayInd}j(t.parcatsViewModel),B(t.parcatsViewModel),R(t.parcatsViewModel),O(t.parcatsViewModel)}}function D(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=z(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==a[e]}));o&&a.forEach((function(r,n){var a=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+a+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),p=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[p],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):A(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),B(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),O(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function z(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function B(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),a=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),i=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function p(t){var e=t.categoryInds.map((function(t,e){return a[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=p(e),a=p(r);return"backward"===t.sortpaths&&(n.reverse(),a.reverse()),n.push(e.valueInds[0]),a.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),a.unshift(r.rawColor)),na?1:0}));for(var f=new Array(c.length),h=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(g.count/h):0;for(var v,x=new Array(n.length),_=0;_1?(t.width-80-16)/(n-1):0)*a;var i,o,s,l,c,u=[],p=t.model.maxCats,f=e.categories.length,h=e.count,d=t.height-8*(p-1),m=8*(p-f)/2,y=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(y.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/h*d:0,s={key:o.valueInds[0],model:o,width:16,height:i,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+i+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){f(r,t,n,e)}},{"../../components/drawing":230,"../../components/fx":248,"../../lib":342,"../../lib/svg_text_utils":365,"../../plot_api/plot_api":376,"@plotly/d3":44,"d3-interpolate":72,tinycolor2:171}],681:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,a){var i=t._fullLayout,o=i._paper,s=i._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,a)}},{"./parcats":680}],682:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a,i;for(n||(n=1/0),a=0;a0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:i,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return a.coerce(t,e,i,r,n)}var u=l(c("labels"),c("values")),p=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,h=c("text"),d=c("texttemplate");if(d||(f=c("textinfo",Array.isArray(h)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||f&&"none"!==f){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(e.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":342,"../../plots/domain":418,"../bar/defaults":466,"./attributes":683,"fast-isnumeric":81}],687:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":244}],688:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:p.hovertemplate||-1!==f.indexOf("name")?p.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:y.castOption(b.bgcolor,t.pts)||t.color,borderColor:y.castOption(b.bordercolor,t.pts),fontFamily:y.castOption(w.family,t.pts),fontSize:y.castOption(w.size,t.pts),fontColor:y.castOption(w.color,t.pts),nameLength:y.castOption(b.namelength,t.pts),textAlign:y.castOption(b.align,t.pts),hovertemplate:y.castOption(p.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,p)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,p)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,a=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,a=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[g(t,a)],i.click(e,n.event))}))}function _(t,e,r){var n=y.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=y.castOption(t._input.textfont.color,e.pts));var a=y.castOption(t.insidetextfont.family,e.pts)||y.castOption(t.textfont.family,e.pts)||r.family,i=y.castOption(t.insidetextfont.size,e.pts)||y.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:a,size:i}}function b(t,e){for(var r,n,a=0;ae&&e>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(p||h){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(s||d||p){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,i.scale>=1)return i;m.push(i)}(d||h)&&((i=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(i)),(d||f)&&((i=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(i));for(var x=0,_=0,b=0;b=1)break}return m[x]}function T(t,e,r,n,a){e=Math.max(0,e-2*m);var i=t.width/t.height,o=S(i,n,e,r);return{scale:2*o/t.height,rCenter:M(i,o/e),rotate:A(a)}}function k(t,e,r,n,a){e=Math.max(0,e-2*m);var i=t.height/t.width,o=S(i,n,e,r);return{scale:2*o/t.width,rCenter:M(i,o/e),rotate:A(a+Math.PI/2)}}function M(t,e){return Math.cos(e)-t*e}function A(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var a=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(t*t+n/2)+t))}function L(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function E(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function P(t,e){var r,n,a,i=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=i.title.font.size,a=I(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*t.r,s.ty-=t.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),p=e.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(p+=u,o.x-=(1+a)*u,s.tx+=t.titleBox.width/2):-1!==i.title.position.indexOf("center")?p*=2:-1!==i.title.position.indexOf("right")&&(p+=u,o.x+=(1+a)*u,s.tx-=t.titleBox.width/2),r=p/t.titleBox.width,n=C(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function C(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function I(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function D(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(i){var x=l.castOption(a,e.i,"texttemplate");if(x){var _=function(t){return{label:t.label,value:t.v,valueLabel:y.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:y.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(a,t.i,"customdata")}}(e),b=y.getFirstFilled(a.text,e.pts);(v(b)||""===b)&&(_.text=b),e.text=l.texttemplateString(x,_,t._fullLayout._d3locale,_,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=i*n-o*a,t.textY=i*a+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,i=r._size;d("pie",r),b(e,t),D(e,i);var f=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var f=n.select(this),d=e[0],m=d.trace;!function(t){var e,r,n,a=t[0],i=a.r,o=a.trace,s=y.getRotationAngle(o.rotation),l=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ea.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=L(r,a))}(e),f.attr("stroke-linejoin","round"),f.each((function(){var g=n.select(this).selectAll("g.slice").data(e);g.enter().append("g").classed("slice",!0),g.exit().remove();var v=[[[],[]],[[],[]]],b=!1;g.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=m.index,v[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=d.cx,c=d.cy,u=n.select(this),f=u.selectAll("path.surface").data([a]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,t,e),m.pull){var g=+y.castOption(m.pull,a.pts)||0;g>0&&(o+=g*a.pxmid[0],c+=g*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=m.hole;if(a.v===d.vTotal){var k="M"+(o+a.px0[0])+","+(c+a.px0[1])+P(a.px0,a.pxmid,!0,1)+P(a.pxmid,a.px0,!0,1)+"Z";T?f.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+P(a.px0,a.pxmid,!1,T)+P(a.pxmid,a.px0,!1,T)+"Z"+k):f.attr("d",k)}else{var M=P(a.px0,a.px1,!0,1);if(T){var A=1-T;f.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+P(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else f.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}O(t,a,d);var S=y.castOption(m.textposition,a.pts),L=u.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each((function(){var u=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),f=l.ensureUniformFontSize(t,"outside"===S?function(t,e,r){var n=y.castOption(t.outsidetextfont.color,e.pts)||y.castOption(t.textfont.color,e.pts)||r.color,a=y.castOption(t.outsidetextfont.family,e.pts)||y.castOption(t.textfont.family,e.pts)||r.family,i=y.castOption(t.outsidetextfont.size,e.pts)||y.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:a,size:i}}(m,a,r.font):_(m,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,f).call(p.convertToTspans,t);var g,v=s.bBox(u.node());if("outside"===S)g=E(v,a);else if(g=w(v,a,d),"auto"===S&&g.scale<1){var x=l.ensureUniformFontSize(t,m.outsidetextfont);u.call(s.font,x),g=E(v=s.bBox(u.node()),a)}var T=g.textPosAngle,k=void 0===T?a.pxmid:z(d.r,T);if(g.targetX=o+k[0]*g.rCenter+(g.x||0),g.targetY=c+k[1]*g.rCenter+(g.y||0),R(g,v),g.outside){var M=g.targetY;a.yLabelMin=M-v.height/2,a.yLabelMid=M,a.yLabelMax=M+v.height/2,a.labelExtraX=0,a.labelExtraY=0,b=!0}g.fontSize=f.size,h(m.type,g,r),e[i].transform=g,u.attr("transform",l.getTextTransform(g))}))}function P(t,e,r,n){var i=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*d.r+","+n*d.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),a=m.title.text;m._meta&&(a=l.templateString(a,m._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,m.title.font).call(p.convertToTspans,t),e="middle center"===m.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(d):P(d,i),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),b&&function(t,e){var r,n,a,i,o,s,l,c,u,p,f,h,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function g(t,e){return e.pxmid[1]-t.pxmid[1]}function v(t,r){r||(r={});var a,c,u,f,h=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,g=t.cyFinal+o(t.px0[1],t.px1[1]),v=h-d;if(v*l>0&&(t.labelExtraY=v),Array.isArray(e.pull))for(c=0;c=(y.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=v):(m+t.labelExtraY-g)*l>0&&(a=3*s*Math.abs(c-p.indexOf(t)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(a),u=t[1-n][r],p=u.concat(c),h=[],f=0;fMath.abs(p)?s+="l"+p*t.pxmid[0]/t.pxmid[1]+","+p+"H"+(i+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(p-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(g,m),b&&m.automargin){var k=s.bBox(f.node()),M=m.domain,A=i.w*(M.x[1]-M.x[0]),S=i.h*(M.y[1]-M.y[0]),L=(.5*A-d.r)/i.w,C=(.5*S-d.r)/i.h;a.autoMargin(t,"pie."+m.uid+".automargin",{xl:M.x[0]-L,xr:M.x[1]+L,yb:M.y[0]-C,yt:M.y[1]+C,l:Math.max(d.cx-d.r-k.left,0),r:Math.max(k.right-(d.cx+d.r),0),b:Math.max(k.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-k.top,0),pad:5})}}))}));setTimeout((function(){f.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:O,transformInsideText:w,determineInsideTextFont:_,positionTitleOutside:P,prerenderTitles:b,layoutAreas:D,attachFxHandlers:x,computeTransform:R}},{"../../components/color":208,"../../components/drawing":230,"../../components/fx":248,"../../lib":342,"../../lib/svg_text_utils":365,"../../plots/plots":438,"../bar/constants":464,"../bar/uniform_text":478,"./event_data":687,"./helpers":688,"@plotly/d3":44}],693:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("./style_one"),i=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(a,t,e)}))}))}},{"../bar/uniform_text":478,"./style_one":694,"@plotly/d3":44}],694:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,s=a(i.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":208,"./helpers":688}],695:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/attributes"),i=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,p=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,f=t("../../lib/extend").extendFlat,h=t("../../plot_api/edit_types").overrideAll;(e.exports=h({hoverinfo:f({},a.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:p("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:f(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":207,"../../components/colorscale/attributes":215,"../../components/fx/attributes":239,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plot_api/plot_template":379,"../../plots/attributes":386,"../../plots/cartesian/axis_format_attributes":393,"../../plots/domain":418,"../../plots/font_attributes":419,"../../plots/template_attributes":447}],696:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../plots/cartesian/select").prepSelect,u=t("../../lib"),p=t("../../registry");function f(t,e){var r=t._fullData[e],n=t._fullLayout,a=n.dragmode,i="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==a&&"zoom"!==a){s(o,i);var f={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},h={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:f,yaxis:h,fillRangeItems:u.noop},subplot:e,xaxes:[f],yaxes:[h],doneFnCompleted:function(r){var n,a=t._fullData[e],i=a.node.groups.slice(),o=[];function s(t){for(var e=a._sankey.graph.nodes,r=0;rv&&(v=i.source[e]),i.target[e]>v&&(v=i.target[e]);var x,_=v+1;t.node._count=_;var b=t.node.groups,w={};for(e=0;e0&&s(L,_)&&s(E,_)&&(!w.hasOwnProperty(L)||!w.hasOwnProperty(E)||w[L]!==w[E])){w.hasOwnProperty(E)&&(E=w[E]),w.hasOwnProperty(L)&&(L=w[L]),E=+E,f[L=+L]=f[E]=!0;var P="";i.label&&i.label[e]&&(P=i.label[e]);var C=null;P&&h.hasOwnProperty(P)&&(C=h[P]),c.push({pointNumber:e,label:P,color:u?i.color[e]:i.color,customdata:p?i.customdata[e]:i.customdata,concentrationscale:C,source:L,target:E,value:+S}),A.source.push(L),A.target.push(E)}}var I=_+b.length,D=o(r.color),z=o(r.customdata),O=[];for(e=0;e_-1,childrenNodes:[],pointNumber:e,label:R,color:D?r.color[e]:r.color,customdata:z?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var i=a.init2dArray(t,0),o=0;o1}))}(I,A.source,A.target)&&(F=!0),{circular:F,links:c,nodes:O,groups:b,groupLookup:w}}e.exports=function(t,e){var r=c(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":220,"../../lib":342,"../../lib/gup":339,"strongly-connected-components":169}],698:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],699:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function p(t,e){function r(r,i){return n.coerce(t,e,a.link.colorscales,r,i)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,a,r,i)}var d=n.extendDeep(f.hoverlabel,t.hoverlabel),m=t.node,y=c.newContainer(e,"node");function g(t,e){return n.coerce(m,y,a.node,t,e)}g("label"),g("groups"),g("x"),g("y"),g("pad"),g("thickness"),g("line.color"),g("line.width"),g("hoverinfo",t.hoverinfo),l(m,y,g,d),g("hovertemplate");var v=f.colorway;g("color",y.label.map((function(t,e){return i.addOpacity(function(t){return v[t%v.length]}(e),.8)}))),g("customdata");var x=t.link||{},_=c.newContainer(e,"link");function b(t,e){return n.coerce(x,_,a.link,t,e)}b("label"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",t.hoverinfo),l(x,_,b,d),b("hovertemplate");var w,T=o(f.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";b("color",n.repeat(T,_.value.length)),b("customdata"),u(x,_,{name:"colorscales",handleItemDefaults:p}),s(e,f,h),h("orientation"),h("valueformat"),h("valuesuffix"),y.x.length&&y.y.length&&(w="freeform"),h("arrangement",w),n.coerceFont(h,"textfont",n.extendFlat({},f.font)),e._length=null}},{"../../components/color":208,"../../components/fx/hoverlabel_defaults":246,"../../lib":342,"../../plot_api/plot_template":379,"../../plots/array_container_defaults":385,"../../plots/domain":418,"./attributes":695,tinycolor2:171}],700:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":695,"./base_plot":696,"./calc":697,"./defaults":699,"./plot":701,"./select.js":703}],701:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=a._;function p(t){return""!==t}function f(t,e){return t.filter((function(t){return t.key===e.traceId}))}function h(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function y(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function g(t,e,r){e&&r&&f(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function v(t,e,r){e&&r&&f(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(_.bind(0,e,r,!1))}function x(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),a&&f(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&f(e,t).selectAll("."+c.sankeyNode).filter(y(t)).call(g)}function _(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),a&&f(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===a})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&f(e,t).selectAll(c.sankeyNode).filter(y(t)).call(v)}function b(t,e){var r=t.hoverlabel||{},n=a.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,a=r._paper,f=r._size,m=0;m"),color:b(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:b(o,"bordercolor"),fontFamily:b(o,"font.family"),fontSize:b(o,"font.size"),fontColor:b(o,"font.color"),nameLength:b(o,"namelength"),textAlign:b(o,"align"),idealAlign:n.event.x"),color:b(o,"bgcolor")||a.tinyColorHue,borderColor:b(o,"bordercolor"),fontFamily:b(o,"font.family"),fontSize:b(o,"font.size"),fontColor:b(o,"font.color"),nameLength:b(o,"namelength"),textAlign:b(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(w,.85),d(w)}}},unhover:function(e,a,i){!1!==t._fullLayout.hovermode&&(n.select(e).call(v,a,i),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,t.emit("plotly_unhover",{event:n.event,points:[a.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,a){var i=r.node;i.originalEvent=n.event,t._hoverdata=[i],n.select(e).call(v,r,a),s.click(t,{target:!0})}}})}},{"../../components/color":208,"../../components/fx":248,"../../lib":342,"./constants":698,"./render":702,"@plotly/d3":44}],702:[function(t,e,r){"use strict";var n=t("d3-force"),a=t("d3-interpolate").interpolateNumber,i=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),p=t("../../components/drawing"),f=t("../../lib"),h=f.strTranslate,d=f.strRotate,m=t("../../lib/gup"),y=m.keyFun,g=m.repeat,v=m.unwrap,x=t("../../lib/svg_text_utils"),_=t("../../registry"),b=t("../../constants/alignment"),w=b.CAP_SHIFT,T=b.LINE_SPACING;function k(t,e,r){var n,a=v(e),i=a.trace,u=i.domain,p="h"===i.orientation,h=i.node.pad,d=i.node.thickness,m=t.width*(u.x[1]-u.x[0]),y=t.height*(u.y[1]-u.y[0]),g=a._nodes,x=a._links,_=a.circular;(n=_?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(p?[m,y]:[y,m]).nodeWidth(d).nodePadding(h).nodeId((function(t){return t.pointNumber})).nodes(g).links(x);var b,w,T,k=n();for(var M in n.nodePadding()=a||(r=a-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),a=e.y1+h}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),a=[],i=-1,o=-1/0;for(b=0;bo+d&&(i+=1,e=s.x0),o=s.x0,a[i]||(a[i]=[]),a[i].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return a}(g=k.nodes));n.update(k)}return{circular:_,key:r,trace:i,guid:f.randstr(),horizontal:p,width:m,height:y,nodePad:i.node.pad,nodeLineColor:i.node.line.color,nodeLineWidth:i.node.line.width,linkLineColor:i.link.line.color,linkLineWidth:i.link.line.width,valueFormat:i.valueformat,valueSuffix:i.valuesuffix,textFont:i.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:p?y:m,dragPerpendicular:p?m:y,arrangement:i.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=c(e.color),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:A,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function A(){return function(t){if(t.link.circular)return e=t.link,r=e.width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,i=t.link.source.x1,o=t.link.target.x0,s=a(i,o),l=s(.5),c=s(.5),u=t.link.y0-t.link.width/2,p=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,h=t.link.y1+t.link.width/2;return"M"+i+","+u+"C"+l+","+u+" "+c+","+f+" "+o+","+f+"L"+o+","+h+"C"+c+","+h+" "+l+","+p+" "+i+","+p+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,a=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var i=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=f.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(i),visibleHeight:o,zoneX:-n,zoneY:-a,zoneWidth:i+2*n,zoneHeight:o+2*a,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function L(t){t.attr("transform",(function(t){return h(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function E(t){t.call(L)}function P(t,e){t.call(E),e.attr("d",A())}function C(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function I(t){return t.link.width>1||t.linkLineWidth>0}function D(t){return h(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function z(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function O(t,e,r,a){var o=i.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(f.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(t){a._fullLayout._dragCover=t})),f.raiseToTop(this),i.interactionState.dragInProgress=i.node,F(i.node),i.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,r,a){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,o,i),function(t,e,r,n,a){window.requestAnimationFrame((function i(){var o;for(o=0;o0)window.requestAnimationFrame(i);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,a)}}))}(t,e,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),P(t.filter(N(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&P[g].gap;)g--;for(x=P[g].s,m=P.length-1;m>g;m--)P[m].s=x;for(;lA[u]&&u=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],712:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),p=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults");e.exports=function(t,e,r,y){function g(r,a){return n.coerce(t,e,i,r,a)}var v=l(t,e,y,g);if(v||(e.visible=!1),e.visible){c(t,e,y,g),g("xhoverformat"),g("yhoverformat");var x=u(t,e,y,g),_=!x&&v=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(f.c2p(t.x)-d);return i=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.y)-m);return iZ!=(B=z[I][1])>=Z&&(R=z[I-1][0],F=z[I][0],B-N&&(O=R+(F-R)*(Z-N)/(B-N),q=Math.min(q,O),H=Math.max(H,O)));q=Math.max(q,0),H=Math.min(H,f._length);var X=s.defaultLine;return s.opacity(p.fillcolor)?X=p.fillcolor:s.opacity((p.line||{}).color)&&(X=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:H,y0:Z,y1:Z,color:X,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":208,"../../components/fx":248,"../../lib":342,"../../registry":452,"./get_trace_color":715}],717:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":404,"./arrays_to_calcdata":704,"./attributes":705,"./calc":706,"./cross_trace_calc":710,"./cross_trace_defaults":711,"./defaults":712,"./format_labels":714,"./hover":716,"./marker_colorbar":723,"./plot":726,"./select":727,"./style":729,"./subtypes":730}],718:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"../../lib":342}],719:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),c=l.segmentsIntersect,u=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,i,f,h,d,m,y,g,v,x,_,b,w,T,k,M,A,S=e.xaxis,L=e.yaxis,E="log"===S.type,P="log"===L.type,C=S._length,I=L._length,D=e.connectGaps,z=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,N=[],B=p.minTolerance,j=t.length,U=new Array(j),V=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?L.l2p(n.y):L.c2p(n.y);if(i===a){if(E&&(i=S.c2p(n.x,!0)),i===a)return!1;P&&l===a&&(i*=Math.abs(S._m*I*(S._m>0?o:s)/(L._m*C*(L._m>0?o:s)))),i*=1e3}if(l===a){if(P&&(l=L.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function H(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,c=a*o+i*s;if(c>0&&crt||t[1]at)return[u(t[0],et,rt),u(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var c=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);c&&((i&&o?c>0==i[t]>o[t]?i:o:i||o)[t]+=c);return s}}function ct(t){var e=t[0],r=t[1],n=e===U[V-1][0],a=r===U[V-1][1];if(!n||!a)if(V>1){var i=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&i?o?V--:U[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ut(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ct([W,K]),ct(t),J=null,W=K=0}function pt(t){if(M=t[0]/C,A=t[1]/I,Z=t[0]rt?rt:0,X=t[1]at?at:0,Z||X){if(V)if(J){var e=Q(J,t);e.length>1&&(ut(e[0]),U[V++]=e[1])}else $=Q(U[V-1],t)[0],U[V++]=$;else U[V++]=[Z||t[0],X||t[1]];var r=U[V-1];Z&&X&&(r[0]!==Z||r[1]!==X)?(J&&(W!==Z&&K!==X?ct(W&&K?(n=J,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[W||Z,K||X]):W&&K&&ct([W,K])),ct([Z,X])):W-Z&&K-X&&ct([Z||W,X||K]),J=t,W=Z,K=X}else J&&ut(Q(J,t)[0]),U[V++]=t;var n,a,i,o}for("linear"===O||"spline"===O?Q=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=c(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,t)G(d,ft))break;i=d,(b=g[0]*y[0]+g[1]*y[1])>x?(x=b,f=d,m=!1):b<_&&(_=b,h=d,m=!0)}if(m?(pt(f),i!==h&&pt(h)):(h!==n&&pt(h),i!==f&&pt(f)),pt(i),r>=t.length||!d)break;pt(d),n=d}}else pt(f)}J&&ct([W||J[0],K||J[1]]),N.push(U.slice(0,V))}return N}},{"../../constants/numerical":319,"../../lib":342,"./constants":709}],720:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],721:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,c={},u=!1,p=-1,f=0,h=-1;for(i=0;i=0?l=h:(l=h=f,f++),l0?Math.max(r,i):0}}},{"fast-isnumeric":81}],723:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],724:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),p=(t.line||{}).color;(c=c||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:u?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":208,"../../components/colorscale/defaults":218,"../../components/colorscale/helpers":219,"./subtypes":730}],725:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":319,"../../lib":342}],726:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),p=t("./link_traces"),f=t("../../lib/polygon").tester;function h(t,e,r,p,h,d,m){var y;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,u=n.extent(i.simpleMap(s.range,s.r2c)),p=n.extent(i.simpleMap(l.range,l.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var h=f.marker.maxdisplayed;if(0===h)return;var d=a.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/h),y=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var x=r.xaxis,_=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var L,E;v(T).style("opacity",b.opacity);var P=b.fill.charAt(b.fill.length-1);"x"!==P&&"y"!==P&&(P=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,I,D="",z=[],O=b._prevtrace;O&&(D=O._prevRevpath||"",E=O._nextFill,z=O._polygons);var R,F,N,B,j,U,V,q="",H="",G=[],Y=i.noop;if(L=b._ownFill,c.hasLines(b)||"none"!==b.fill){for(E&&E.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},G=u(p,{xaxis:x,yaxis:_,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(G.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",C).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),l.singleLineStyle(p,a)}}}}}var Z=M.selectAll(".js-line").data(G);v(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(Z,r.layerClipId,t),G.length?(L?(L.datum(p),B&&U&&(P?("y"===P?B[1]=U[1]=_.c2p(0,!0):"x"===P&&(B[0]=U[0]=x.c2p(0,!0)),v(L).attr("d","M"+U+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):v(L).attr("d",q+"Z").call(l.singleFillStyle))):E&&("tonext"===b.fill.substr(0,6)&&q&&D?("tonext"===b.fill?v(E).attr("d",q+"Z"+D+"Z").call(l.singleFillStyle):v(E).attr("d",q+"L"+D.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(z)):(W(E),b._polygons=null)),b._prevRevpath=H,b._prevPolygons=V):(L?W(L):E&&W(E),b._polygons=b._prevRevpath=b._prevPolygons=null),A.datum(p),S.datum(p),function(e,a,i){var o,u=i[0].trace,p=c.hasMarkers(u),f=c.hasText(u),h=tt(u),d=et,m=et;if(p||f){var y=s,b=u.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+_._id][b].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?J:K:b&&!w&&(y=$),p&&(d=y),f&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,_).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(u)),o.each((function(e){var a=n.select(this),i=v(a);l.translatePoint(e,i,x,_)?(l.singlePointStyle(e,i,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,x,_,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,h)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=v(e.select("text"));l.translatePoint(t,a,x,_)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,_,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=_.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,p);var X=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(A,X,t),l.setClipUrl(S,X,t)}function W(t){v(t).attr("d","M0,0Z")}function K(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function Q(t){return t.id}function tt(t){if(t.ids)return Q}function et(){return!1}}e.exports=function(t,e,r,a,i,c){var u,f,d=!i,m=!!i&&i.duration>0,y=p(t,e,r);((u=a.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){i[t]=null})).remove(),u.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){h(t,n,e,r,y,this,i)}))}))):u.each((function(r,n){h(t,n,e,r,y,this,i)}));d&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":230,"../../lib":342,"../../lib/polygon":354,"../../registry":452,"./line_points":719,"./link_traces":721,"./subtypes":730,"@plotly/d3":44}],727:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,y.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":342,"../scatter/hover":716}],739:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":404,"../scatter/marker_colorbar":723,"../scatter/select":727,"../scatter/style":729,"./attributes":733,"./calc":734,"./defaults":735,"./event_data":736,"./format_labels":737,"./hover":738,"./plot":740}],740:[function(t,e,r){"use strict";var n=t("../scatter/plot"),a=t("../../plots/cartesian/axes"),i=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,p={xaxis:a.getFromId(t,u.xaxis||"x"),yaxis:a.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,p,r,o),s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":248,"../../constants/numerical":319,"../../lib":342,"../scatter/get_trace_color":715,"./attributes":741}],747:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":423,"../scatter/marker_colorbar":723,"../scatter/style":729,"./attributes":741,"./calc":742,"./defaults":743,"./event_data":744,"./format_labels":745,"./hover":746,"./plot":748,"./select":749,"./style":750}],748:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,p=t("../scatter/subtypes"),f=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,a=t[0].trace,o=e[a.geo],p=o._subplot,f=a._length;if(Array.isArray(a.locations)){var h=a.locationmode,d="geojson-id"===h?s.extractTraceFeature(t):i(a,p.topojson);for(r=0;r")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,u=t.xa,p=t.ya,f=t.subplot,h=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-h;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=f.project([n,i]),l=o.x-u.c2p([d,i]),c=o.y-p.c2p([n,r]),h=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-h,1-3/h)}),t),!1!==t.index){var m=o[t.index],y=m.lonlat,g=[a.modHalf(y[0],360)+h,y[1]],v=u.c2p(g),x=p.c2p(g),_=m.mrc||1;t.x0=v-_,t.x1=v+_,t.y0=x-_,t.y1=x+_;var b={};b[c.subplot]={_subplot:f};var w=c._module.formatLabels(m,c,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=i(c,m),t.extraText=l(c,m,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:l}},{"../../components/fx":248,"../../constants/numerical":319,"../../lib":342,"../scatter/get_trace_color":715}],757:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":432,"../scatter/marker_colorbar":723,"../scattergeo/calc":742,"./attributes":751,"./defaults":753,"./event_data":754,"./format_labels":755,"./hover":756,"./plot":758,"./select":759}],758:[function(t,e,r){"use strict";var n=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,i=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,a,o=this.subplot,s=o.map,l=n(o.gd,t),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(e=i.length-1;e>=0;e--)r=i[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=i[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,a=new o(t,r.uid),s=n(t.gd,e),l=a.below=t.belowLookup["trace-"+r.uid],c=0;c")}}e.exports={hoverPoints:function(t,e,r,i){var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,a(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:a}},{"../scatter/hover":716}],765:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":441,"../scatter/marker_colorbar":723,"../scatter/select":727,"../scatter/style":729,"./attributes":760,"./calc":761,"./defaults":762,"./format_labels":763,"./hover":764,"./plot":766}],766:[function(t,e,r){"use strict";var n=t("../scatter/plot"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var i=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,c=0;c"),o.hovertemplate=f.hovertemplate,i}function x(t,e){g.push(t._hovertitle+": "+e)}}},{"../scatter/hover":716}],773:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":448,"../scatter/marker_colorbar":723,"../scatter/select":727,"../scatter/style":729,"./attributes":767,"./calc":768,"./defaults":769,"./event_data":770,"./format_labels":771,"./hover":772,"./plot":774}],774:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var a=e.plotContainer;a.select(".scatterlayer").selectAll("*").remove();var i={xaxis:e.xaxis,yaxis:e.yaxis,plot:a,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,i,r,o)}},{"../scatter/plot":726}],775:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,o=t("../../components/colorscale/attributes"),s=t("../../plots/domain").attributes,l=t("../pie/attributes"),c=t("./constants"),u=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:u({colors:{valType:"data_array",editType:"calc"},line:{color:u({},l.marker.line.color,{dflt:null}),width:u({},l.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:l.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:l.hovertext,hoverinfo:u({},n.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:a({},{keys:c.eventDataKeys}),textfont:l.textfont,insidetextorientation:l.insidetextorientation,insidetextfont:l.insidetextfont,outsidetextfont:u({},l.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:l.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:s({name:"sunburst",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/attributes":386,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683,"./constants":778}],776:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="sunburst",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":438}],777:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../components/colorscale").makeColorScaleFuncFromTrace,s=t("../pie/calc").makePullColorFn,l=t("../pie/calc").generateExtendedColors,c=t("../../components/colorscale").calc,u=t("../../constants/numerical").ALMOST_EQUAL,p={},f={},h={};r.calc=function(t,e){var r,l,p,f,h,d,m=t._fullLayout,y=e.ids,g=i.isArrayOrTypedArray(y),v=e.labels,x=e.parents,_=e.values,b=i.isArrayOrTypedArray(_),w=[],T={},k={},M=function(t){return t||"number"==typeof t},A=function(t){return!b||a(_[t])&&_[t]>=0};g?(r=Math.min(y.length,x.length),l=function(t){return M(y[t])&&A(t)},p=function(t){return String(y[t])}):(r=Math.min(v.length,x.length),l=function(t){return M(v[t])&&A(t)},p=function(t){return String(v[t])}),b&&(r=Math.min(r,_.length));for(var S=0;S1){for(var C=i.randstr(),I=0;I"),name:M||z("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:M,hovertemplateLabels:C,eventData:l};y&&(F.x0=L-a.rInscribed*a.rpx1,F.x1=L+a.rInscribed*a.rpx1,F.idealAlign=a.pxmid[0]<0?"left":"right"),g&&(F.x=L,F.idealAlign=L<0?"left":"right");var N=[];o.loneHover(F,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r,inOut_bbox:N}),l[0].bbox=N[0],d._hasHoverLabel=!0}if(g){var B=t.select("path.surface");f.styleOne(B,a,v,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[p(a,v,f.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var a=r._fullLayout,i=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[p(s,i,f.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(a._hoverlayer.node()),d._hasHoverLabel=!1),g){var l=t.select("path.surface");f.styleOne(l,s,i,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,i=r._fullData[d.index],s=y&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),h=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),g=c.getPtId(h),v={points:[p(t,i,f.eventDataKeys)],event:n.event};s||(v.nextLevel=g);var x=l.triggerHandler(r,"plotly_"+d.type+"click",v);if(!1!==x&&e.hovermode&&(r._hoverdata=[p(t,i,f.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){a.call("_storeDirectGUIEdit",i,e._tracePreGUI[i.uid],{level:i.level});var _={data:[{level:g}],traces:[d.index]},b={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),a.call("animate",r,_,b)}}))}},{"../../components/fx":248,"../../components/fx/helpers":244,"../../lib":342,"../../lib/events":332,"../../registry":452,"../pie/helpers":688,"./helpers":781,"@plotly/d3":44}],781:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var a=t.children||[],i=0;i0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var a=e?[n.data[e]]:[n];return r.listPath(n,e).concat(a)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":208,"../../lib":342,"../../lib/setcursor":362,"../pie/helpers":688}],782:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":723,"./attributes":775,"./base_plot":776,"./calc":777,"./defaults":779,"./layout_attributes":783,"./layout_defaults":784,"./plot":785,"./style":786}],783:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],784:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":342,"./layout_attributes":783}],785:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-hierarchy"),i=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,p=c.clearMinTextSize,f=t("../pie/plot"),h=t("../pie/helpers").getRotationAngle,d=f.computeTransform,m=f.transformInsideText,y=t("./style").styleOne,g=t("../bar/style").resizeText,v=t("./fx"),x=t("./constants"),_=t("./helpers");function b(t,e,c,p){var f=t._fullLayout,g=!f.uniformtext.mode&&_.hasTransition(p),b=n.select(c).selectAll("g.slice"),T=e[0],k=T.trace,M=T.hierarchy,A=_.findEntryWithLevel(M,k.level),S=_.getMaxDepth(k),L=f._size,E=k.domain,P=L.w*(E.x[1]-E.x[0]),C=L.h*(E.y[1]-E.y[0]),I=.5*Math.min(P,C),D=T.cx=L.l+L.w*(E.x[1]+E.x[0])/2,z=T.cy=L.t+L.h*(1-E.y[0])-C/2;if(!A)return b.remove();var O=null,R={};g&&b.each((function(t){R[_.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!O&&_.isEntry(t)&&(O=t)}));var F=function(t){return a.partition().size([2*Math.PI,t.height+1])(t)}(A).descendants(),N=A.height+1,B=0,j=S;T.hasMultipleRoots&&_.isHierarchyRoot(A)&&(F=F.slice(1),N-=1,B=1,j+=1),F=F.filter((function(t){return t.y1<=j}));var U=h(k.rotation);U&&F.forEach((function(t){t.x0+=U,t.x1+=U}));var V=Math.min(N,S),q=function(t){return(t-B)/V*I},H=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},G=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,z)},Y=function(t){return D+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return z+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(b=b.data(F,_.getPtId)).enter().append("g").classed("slice",!0),g?b.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=_.getPtId(t),n=R[r],a=R[_.getPtId(A)];if(a){var o=(t.x1>a.x1?2*Math.PI:0)+U;e=t.rpx1X?2*Math.PI:0)+U;e={x0:a,x1:a}}else e={rpx0:I,rpx1:I},s.extendFlat(e,J(t));else e={rpx0:0,rpx1:0};else e={x0:U,x1:U};return i(e,n)}(t);return function(t){return G(e(t))}})):p.attr("d",G),c.call(v,A,t,e,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(_.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),p.call(y,a,k);var h=s.ensureSingle(c,"g","slicetext"),b=s.ensureSingle(h,"text","",(function(t){t.attr("data-notex",1)})),w=s.ensureUniformFontSize(t,_.determineTextFont(k,a,f.font));b.text(r.formatSliceLabel(a,A,k,e,f)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,w).call(l.convertToTspans,t);var M=o.bBox(b.node());a.transform=m(M,a,T),a.transform.targetX=Y(a),a.transform.targetY=Z(a);var S=function(t,e){var r=t.transform;return d(r,e),r.fontSize=w.size,u(k.type,r,f),s.getTextTransform(r)};g?b.transition().attrTween("transform",(function(t){var e=function(t){var e,r=R[_.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},O)if(t.parent)if(X){var a=t.x1>X?2*Math.PI:0;e.x0=e.x1=a}else s.extendFlat(e,J(t));else e.x0=e.x1=U;else e.x0=e.x1=U;var o=i(e.transform.textPosAngle,t.transform.textPosAngle),l=i(e.rpx1,t.rpx1),c=i(e.x0,t.x0),p=i(e.x1,t.x1),h=i(e.transform.scale,n.scale),d=i(e.transform.rotate,n.rotate),m=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,y=i(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),a=p(t),i=function(t){return y(Math.pow(t,m))}(t),s={pxmid:H(e,(r+a)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:i,x:n.x,y:n.y}};return u(k.type,n,f),{transform:{targetX:Y(s),targetY:Z(s),scale:h(t),rotate:d(t),rCenter:i}}}}(t);return function(t){return S(e(t),M)}})):b.attr("transform",S(a,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,a){var i,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&_.hasTransition(r);(p("sunburst",s),(i=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),i.order(),u)?(a&&(o=a()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){b(t,e,this,r)}))}))):(i.each((function(e){b(t,e,this,r)})),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&i.exit().remove()},r.formatSliceLabel=function(t,e,r,n,a){var i=r.texttemplate,o=r.textinfo;if(!(i||o&&"none"!==o))return"";var l=a.separators,c=n[0],u=t.data.data,p=c.hierarchy,f=_.isHierarchyRoot(t),h=_.getParent(p,t),d=_.getValue(t);if(!i){var m,y=o.split("+"),g=function(t){return-1!==y.indexOf(t)},v=[];if(g("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&g("value")&&v.push(_.formatValue(u.v,l)),!f){g("current path")&&v.push(_.getPath(t.data));var x=0;g("percent parent")&&x++,g("percent entry")&&x++,g("percent root")&&x++;var b=x>1;if(x){var w,T=function(t){m=_.formatPercent(w,l),b&&(m+=" of "+t),v.push(m)};g("percent parent")&&!f&&(w=d/_.getValue(h),T("parent")),g("percent entry")&&(w=d/_.getValue(e),T("entry")),g("percent root")&&(w=d/_.getValue(p),T("root"))}}return g("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&v.push(m)),v.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var M={};u.label&&(M.label=u.label),u.hasOwnProperty("v")&&(M.value=u.v,M.valueLabel=_.formatValue(u.v,l)),M.currentPath=_.getPath(t.data),f||(M.percentParent=d/_.getValue(h),M.percentParentLabel=_.formatPercent(M.percentParent,l),M.parent=_.getPtLabel(h)),M.percentEntry=d/_.getValue(e),M.percentEntryLabel=_.formatPercent(M.percentEntry,l),M.entry=_.getPtLabel(e),M.percentRoot=d/_.getValue(p),M.percentRootLabel=_.formatPercent(M.percentRoot,l),M.root=_.getPtLabel(p),u.hasOwnProperty("color")&&(M.color=u.color);var A=s.castOption(r,u.i,"text");return(s.isValidTextValue(A)||""===A)&&(M.text=A),M.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,M,a._d3locale,M,r._meta||{})}},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../bar/style":476,"../bar/uniform_text":478,"../pie/helpers":688,"../pie/plot":692,"./constants":778,"./fx":780,"./helpers":781,"./style":786,"@plotly/d3":44,"d3-hierarchy":71,"d3-interpolate":72}],786:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=i.castOption(r,s,"marker.line.color")||a.defaultLine,c=i.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(a.fill,n.color).call(a.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":208,"../../lib":342,"../bar/uniform_text":478,"@plotly/d3":44}],787:[function(t,e,r){"use strict";var n=t("../../components/annotations/attributes"),a=t("../../lib/extend").extendFlat,i=t("../../plot_api/edit_types").overrideAll,o=t("../../plots/font_attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers;(e.exports=i({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:a({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:a({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:a({},n.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:a({},o({arrayOk:!0}))}},"calc","from-root")).transforms=void 0},{"../../components/annotations/attributes":191,"../../lib/extend":333,"../../plot_api/edit_types":372,"../../plots/cartesian/axis_format_attributes":393,"../../plots/domain":418,"../../plots/font_attributes":419}],788:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getModuleCalcData,a=t("./plot");r.name="table",r.plot=function(t){var e=n(t.calcdata,"table")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("table"),i=e._has&&e._has("table");a&&!i&&n._paperdiv.selectAll(".table").remove()}},{"../../plots/get_data":427,"./plot":795}],789:[function(t,e,r){"use strict";var n=t("../../lib/gup").wrap;e.exports=function(){return n({})}},{"../../lib/gup":339}],790:[function(t,e,r){"use strict";e.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],791:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib/extend").extendFlat,i=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[a]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},a+=i,s=c+1,i=0);return n}e.exports=function(t,e){var r=l(e.cells.values),h=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(h(r).map((function(){return c((d[0]||[""]).length)}))),y=e.domain,g=Math.floor(t._fullLayout._size.w*(y.x[1]-y.x[0])),v=Math.floor(t._fullLayout._size.h*(y.y[1]-y.y[0])),x=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],_=r.length?r[0].map((function(){return e.cells.height})):[],b=x.reduce(s,0),w=f(_,v-b+n.uplift),T=p(f(x,b),[]),k=p(w,T),M={},A=e._fullInput.columnorder.concat(h(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),L=S.reduce(s,0);S=S.map((function(t){return t/L*g}));var E=Math.max(o(e.header.line.width),o(e.cells.line.width)),P={key:e.uid+t._context.staticPlot,translateX:y.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-y.y[1]),size:t._fullLayout._size,width:g,maxLineWidth:E,height:v,columnOrder:A,groupHeight:v,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:a({},e.cells,{values:r}),headerCells:a({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:A[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return P.columns.forEach((function(t){t.calcdata=P,t.x=u(t)})),P}},{"../../lib/extend":333,"./constants":790,"fast-isnumeric":81}],792:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":333}],793:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,a=r.slice(0,n),i=a.slice().sort((function(t,e){return t-e})),o=a.map((function(t){return i.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&a.match(/[<&>]/);var c,u="string"==typeof(c=a)&&c.match(n.latexCheck);t.latex=u;var p,f,h=u?"":T(t.calcdata.cells.prefix,e,r)||"",d=u?"":T(t.calcdata.cells.suffix,e,r)||"",m=u?null:T(t.calcdata.cells.format,e,r)||null,y=h+(m?i(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(p=w(y)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===p?w(y):p),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var g=(" "===n.wrapSplitCharacter?y.replace(/a&&n.push(i),a+=l}return n}(a,l,s);1===c.length&&(c[0]===a.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=O(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(P(t,r,e,c,n.prevPages,n,0),P(t,r,e,c,n.prevPages,n,1),x(r,t))}}function E(t,e,r,i){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===i?s.scrollY+c*a.event.dy:i;var p=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(M);return L(t,p,l),s.scrollY===u}}function P(t,e,r,n,a,i,o){n[o]!==a[o]&&(clearTimeout(i.currentRepaint[o]),i.currentRepaint[o]=setTimeout((function(){var i=r.filter((function(t,e){return e===o&&n[e]!==a[e]}));_(t,e,i,r),a[o]=n[o]})))}function C(t,e,r,i){return function(){var o=a.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,a,i=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(a=(r=s.shift()).width+i)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=a;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),b(o.select("."+n.cn.cellText),r,t,i),a.select(e.parentNode.parentNode).call(z)}}function I(t,e,r,i,o){return function(){if(!o.settledY){var s=a.select(e.parentNode),l=N(o),c=o.key-l.firstRowIndex,p=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:p,h=Math.max(f,p);h-l.rows[c].rowHeight&&(l.rows[c].rowHeight=h,t.selectAll("."+n.cn.columnCell).call(z),L(null,t.filter(M),0),x(r,i,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=a.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),i=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(D(o,a.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),i)})),o.settledY=!0}}}function D(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function z(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(N(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=N(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function O(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:a({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":215,"../../lib/extend":333,"../../plots/domain":418,"../../plots/template_attributes":447,"../pie/attributes":683,"../sunburst/attributes":775,"./constants":799}],797:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,a,i){n.plotBasePlot(r.name,t,e,a,i)},r.clean=function(t,e,a,i){n.cleanBasePlot(r.name,t,e,a,i)}},{"../../plots/plots":438}],798:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":777}],799:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],800:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,p=c.handleDefaults;e.exports=function(t,e,r,c){function f(r,i){return n.coerce(t,e,a,r,i)}var h=f("labels"),d=f("parents");if(h&&h.length&&d&&d.length){var m=f("values");m&&m.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),e.texttemplate||f("textinfo",Array.isArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var g=f("pathbar.visible");s(t,e,c,f,"auto",{hasPathbar:g,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var v=-1!==e.textposition.indexOf("bottom");f("marker.line.width")&&f("marker.line.color",c.paper_bgcolor);var x=f("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?p(t,e,c,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(x||[]).length);var _=2*e.textfont.size;f("marker.pad.t",v?_/4:_),f("marker.pad.l",_/4),f("marker.pad.r",_/4),f("marker.pad.b",v?_:_/4),e._hovered={marker:{line:{width:2,color:i.contrast(c.paper_bgcolor)}}},g&&(f("pathbar.thickness",e.pathbar.textfont.size+2*l),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),o(e,c,f),e._length=null}else e.visible=!1}},{"../../components/color":208,"../../components/colorscale":220,"../../lib":342,"../../plots/domain":418,"../bar/constants":464,"../bar/defaults":466,"./attributes":796}],801:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../sunburst/helpers"),i=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,p,f=c.type,h=c.drawDescendants,d=t._fullLayout,m=d["_"+f+"layer"],y=!r;(i(f,d),(u=m.selectAll("g.trace."+f).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(f,!0),u.order(),!d.uniformtext.mode&&a.hasTransition(r))?(l&&(p=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,h)}))}))):(u.each((function(e){s(t,e,this,r,h)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),f));y&&u.exit().remove()}},{"../bar/style":476,"../bar/uniform_text":478,"../sunburst/helpers":781,"./plot_one":810,"@plotly/d3":44}],802:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),p=t("../sunburst/fx");e.exports=function(t,e,r,f,h){var d=h.barDifY,m=h.width,y=h.height,g=h.viewX,v=h.viewY,x=h.pathSlice,_=h.toMoveInsideSlice,b=h.strTransform,w=h.hasTransition,T=h.handleSlicesExit,k=h.makeUpdateSliceInterpolator,M=h.makeUpdateTextInterpolator,A={},S=t._fullLayout,L=e[0],E=L.trace,P=L.hierarchy,C=m/E._entryDepth,I=u.listPath(r.data,"id"),D=s(P.copy(),[m,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(D=D.filter((function(t){var e=I.indexOf(t.data.id);return-1!==e&&(t.x0=C*e,t.x1=C*(e+1),t.y0=d,t.y1=d+y,t.onPathbar=!0,!0)}))).reverse(),(f=f.data(D,u.getPtId)).enter().append("g").classed("pathbar",!0),T(f,!0,A,[m,y],x),f.order();var z=f;w&&(z=z.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),z.each((function(s){s._x0=g(s.x0),s._x1=g(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=g(s.x1-Math.min(m,y)/2),s._hoverY=v(s.y1-y/2);var f=n.select(this),h=a.ensureSingle(f,"path","surface",(function(t){t.style("pointer-events","all")}));w?h.transition().attrTween("d",(function(t){var e=k(t,!0,A,[m,y]);return function(t){return x(e(t))}})):h.attr("d",x),f.call(p,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),h.call(l,s,E,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=a.ensureSingle(f,"g","slicetext"),T=a.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),L=a.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,L).call(o.convertToTspans,t),s.textBB=i.bBox(T.node()),s.transform=_(s,{fontSize:L.size,onPathbar:!0}),s.transform.fontSize=L.size,w?T.transition().attrTween("transform",(function(t){var e=M(t,!0,A,[m,y]);return function(t){return b(e(t))}})):T.attr("transform",b(s))}))}},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../sunburst/fx":780,"../sunburst/helpers":781,"./constants":799,"./partition":808,"./style":811,"@plotly/d3":44}],803:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),p=t("../sunburst/fx"),f=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,h,d){var m=d.width,y=d.height,g=d.viewX,v=d.viewY,x=d.pathSlice,_=d.toMoveInsideSlice,b=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,M=d.makeUpdateTextInterpolator,A=d.prevEntry,S=t._fullLayout,L=e[0].trace,E=-1!==L.textposition.indexOf("left"),P=-1!==L.textposition.indexOf("right"),C=-1!==L.textposition.indexOf("bottom"),I=!C&&!L.marker.pad.t||C&&!L.marker.pad.b,D=s(r,[m,y],{packing:L.tiling.packing,squarifyratio:L.tiling.squarifyratio,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1,pad:{inner:L.tiling.pad,top:L.marker.pad.t,left:L.marker.pad.l,right:L.marker.pad.r,bottom:L.marker.pad.b}}).descendants(),z=1/0,O=-1/0;D.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),O=Math.max(O,e))})),h=h.data(D,u.getPtId),L._maxVisibleLayers=isFinite(O)?O-z+1:0,h.enter().append("g").classed("slice",!0),T(h,!1,{},[m,y],x),h.order();var R=null;if(w&&A){var F=u.getPtId(A);h.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return R||{x0:0,x1:m,y0:0,y1:y}},B=h;return w&&(B=B.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){var h=u.isHeader(s,L);s._x0=g(s.x0),s._x1=g(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=g(s.x1-L.marker.pad.r),s._hoverY=v(C?s.y1-L.marker.pad.b/2:s.y0+L.marker.pad.t/2);var d=n.select(this),T=a.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,N(),[m,y]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(p,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,L,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?I?"":u.getPtLabel(s)||"":f(s,r,L,e,S)||"";var A=a.ensureSingle(d,"g","slicetext"),D=a.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),z=a.ensureUniformFontSize(t,u.determineTextFont(L,s,S.font));D.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":E||h?"start":"middle").call(i.font,z).call(o.convertToTspans,t),s.textBB=i.bBox(D.node()),s.transform=_(s,{fontSize:z.size,isHeader:h}),s.transform.fontSize=z.size,w?D.transition().attrTween("transform",(function(t){var e=M(t,!1,N(),[m,y]);return function(t){return b(e(t))}})):D.attr("transform",b(s))})),R}},{"../../components/drawing":230,"../../lib":342,"../../lib/svg_text_utils":365,"../sunburst/fx":780,"../sunburst/helpers":781,"../sunburst/plot":785,"./constants":799,"./partition":808,"./style":811,"@plotly/d3":44}],804:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var a;n.swapXY&&(a=e.x0,e.x0=e.y0,e.y0=a,a=e.x1,e.x1=e.y1,e.y1=a),n.flipX&&(a=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-a),n.flipY&&(a=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-a);var i=e.children;if(i)for(var o=0;o-1?P+D:-(I+D):0,O={x0:C,x1:C,y0:z,y1:z+I},R=function(t,e,r){var n=g.tiling.pad,a=function(t){return t-n<=e.x0},i=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:a(t.x0-n)?0:i(t.x0-n)?r[0]:t.x0,x1:a(t.x1+n)?0:i(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,N={},B={},j=null,U=function(t,e){return e?N[f(t)]:B[f(t)]},V=function(t,e,r,n){if(e)return N[f(x)]||O;var a=B[g.level]||r;return function(t){return t.data.depth-_.data.depth=(n-=(v?y:y.r)-s)){var x=(r+n)/2;r=x,n=x}var _;p?a<(_=i-(v?y:y.b))&&_"===tt?(l.x-=i,c.x-=i,u.x-=i,p.x-=i):"/"===tt?(u.x-=i,p.x-=i,o.x-=i/2,s.x-=i/2):"\\"===tt?(l.x-=i,c.x-=i,o.x-=i/2,s.x-=i/2):"<"===tt&&(o.x-=i,s.x-=i),Q(l),Q(p),Q(o),Q(c),Q(u),Q(s),"M"+J(l.x,l.y)+"L"+J(c.x,c.y)+"L"+J(s.x,s.y)+"L"+J(u.x,u.y)+"L"+J(p.x,p.y)+"L"+J(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:at,handleSlicesExit:it,hasTransition:M,strTransform:ot}):w.remove()}},{"../../lib":342,"../bar/constants":464,"../bar/plot":473,"../bar/uniform_text":478,"../sunburst/helpers":781,"./constants":799,"./draw_ancestors":802,"@plotly/d3":44,"d3-interpolate":72}],811:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../components/color"),i=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,p=u.i,f=u.color,h=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(h&&f===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=i.castOption(r,p,"marker.line.color")||a.defaultLine,l=i.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var y,g=a.combine(a.addOpacity(r._backgroundColor,.75),f);if(!0===m){var v=o.getMaxDepth(r);y=isFinite(v)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else y=e.data.depth-r._entryDepth,r._atRootLevel||y++;if(y>0)for(var x=0;x0){var x,_,b,w,T,k=t.xa,M=t.ya;"h"===h.orientation?(T=e,x="y",b=M,_="x",w=k):(T=r,x="x",b=k,_="y",w=M);var A=f[t.index];if(T>=A.span[0]&&T<=A.span[1]){var S=n.extendFlat({},t),L=w.c2p(T,!0),E=o.getKdeValue(A,h,T),P=o.getPositionOnKdePath(A,h,L),C=b._offset,I=b._length;S[x+"0"]=P[0],S[x+"1"]=P[1],S[_+"0"]=S[_+"1"]=L,S[_+"Label"]=_+": "+a.hoverLabelText(w,T,h[_+"hoverformat"])+", "+f[0].t.labels.kde+" "+E.toFixed(3),S.spikeDistance=v[0].spikeDistance;var D=x+"Spike";S[D]=v[0][D],v[0].spikeDistance=void 0,v[0][D]=void 0,S.hovertemplate=!1,g.push(S),(u={stroke:t.color})[x+"1"]=n.constrain(C+P[0],C,C+I),u[x+"2"]=n.constrain(C+P[1],C,C+I),u[_+"1"]=u[_+"2"]=w._offset+L}}m&&(g=g.concat(v))}-1!==d.indexOf("points")&&(c=i.hoverOnPoints(t,e,r));var z=p.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return z.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),z.exit().remove(),z.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":342,"../../plots/cartesian/axes":390,"../box/hover":492,"./helpers":816}],818:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":404,"../box/defaults":490,"../box/select":497,"../scatter/style":729,"./attributes":812,"./calc":813,"./cross_trace_calc":814,"./defaults":815,"./hover":817,"./layout_attributes":819,"./layout_defaults":820,"./plot":821,"./style":822}],819:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),a=t("../../lib").extendFlat;e.exports={violinmode:a({},n.boxmode,{}),violingap:a({},n.boxgap,{}),violingroupgap:a({},n.boxgroupgap,{})}},{"../../lib":342,"../box/layout_attributes":494}],820:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("../box/layout_defaults");e.exports=function(t,e,r){i._supply(t,e,r,(function(r,i){return n.coerce(t,e,a,r,i)}),"violin")}},{"../../lib":342,"../box/layout_defaults":495,"./layout_attributes":819}],821:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,p=e.xaxis,f=e.yaxis;function h(t){var e=s(t,{xaxis:p,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(e[0],1)}a.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),i=t[0],s=i.t,c=i.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,m=s.bdPos,y=e[s.valLetter+"axis"],g=e[s.posLetter+"axis"],v="both"===c.side,x=v||"positive"===c.side,_=v||"negative"===c.side,b=r.selectAll("path.violin").data(a.identity);b.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),b.exit().remove(),b.each((function(t){var e,r,a,i,o,l,p,f,b=n.select(this),w=t.density,T=w.length,k=g.c2l(t.pos+d,!0),M=g.l2p(k);if(c.width)e=s.maxKDE/m;else{var A=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/m*(A.maxCount/t.pts.length):A.maxKDE/m}if(x){for(p=new Array(T),o=0;o")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,y),[u]}function k(t){return n(m,t,f[d+"hoverformat"])}}},{"../../components/color":208,"../../constants/delta.js":315,"../../plots/cartesian/axes":390,"../bar/hover":469}],830:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":404,"../bar/select":474,"./attributes":823,"./calc":824,"./cross_trace_calc":826,"./defaults":827,"./event_data":828,"./hover":829,"./layout_attributes":831,"./layout_defaults":832,"./plot":833,"./style":834}],831:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],832:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){var i=!1;function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=0;s0&&(y+=f?"M"+p[0]+","+d[1]+"V"+d[0]:"M"+p[1]+","+d[0]+"H"+p[0]),"between"!==h&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(a.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":208,"../../components/drawing":230,"../../constants/interactions":318,"../bar/style":476,"../bar/uniform_text":478,"@plotly/d3":44}],835:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),a=t("../lib"),i=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,i){if(i.enabled){for(var o=i.target,l=a.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,i=e.c2d;switch(r){case"count":return p;case"first":return f;case"last":return h;case"sum":return function(t,e){for(var r=0,a=0;aa&&(a=u,o=c)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return f(t)>s};case">=":return function(t){return f(t)>=s};case"[]":return function(t){var e=f(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=f(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=f(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=f(t);return es[1]};case"](":return function(t){var e=f(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=f(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(f(t))};case"}{":return function(t){return-1===s.indexOf(f(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),f),x={},_={},b=0;d?(y=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(p))},g=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(y=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},g=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(y);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(i=0;i=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],392:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),p=e.pointsSame(s,u);if(f&&p)return n;var d=!f&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(f)return m?l(n,s):l(t,u),n;d&&(p||(m?l(n,s):l(t,u)),l(n,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(n,o):0===h.alongA?l(n,h.pt):1===h.alongA&&l(n,s));return!1}for(var h=[];!a.isEmpty();){var f=a.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function g(){if(d){var t=u(f,d);if(t)return t}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!d&&d.seg,!!m&&m.seg);var v,y=g();if(y){var x;if(t)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(y.seg),f.other.remove(),f.remove()}if(a.getHead()!==f){r&&r.rewind(f.seg);continue}if(t)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:i,f.seg.otherFill={above:v,below:v};r&&r.status(f.seg,!!d&&d.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}h.push(f.seg)}a.getHead().remove()}return r&&r.done(),h}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=c?(k=1,y=c+2*f+d):y=f*(k=-f/c)+d):(k=0,p>=0?(M=0,y=d):-p>=h?(M=1,y=h+2*p+d):y=p*(M=-p/h)+d);else if(M<0)M=0,f>=0?(k=0,y=d):-f>=c?(k=1,y=c+2*f+d):y=f*(k=-f/c)+d;else{var A=1/T;y=(k*=A)*(c*k+u*(M*=A)+2*f)+M*(u*k+h*M+2*p)+d}else k<0?(b=h+p)>(x=u+f)?(_=b-x)>=(w=c-2*u+h)?(k=1,M=0,y=c+2*f+d):y=(k=_/w)*(c*k+u*(M=1-k)+2*f)+M*(u*k+h*M+2*p)+d:(k=0,b<=0?(M=1,y=h+2*p+d):p>=0?(M=0,y=d):y=p*(M=-p/h)+d):M<0?(b=c+f)>(x=u+p)?(_=b-x)>=(w=c-2*u+h)?(M=1,k=0,y=h+2*p+d):y=(k=1-(M=_/w))*(c*k+u*M+2*f)+M*(u*k+h*M+2*p)+d:(M=0,b<=0?(k=1,y=c+2*f+d):f>=0?(k=0,y=d):y=f*(k=-f/c)+d):(_=h+p-u-f)<=0?(k=0,M=1,y=h+2*p+d):_>=(w=c-2*u+h)?(k=1,M=0,y=c+2*f+d):y=(k=_/w)*(c*k+u*(M=1-k)+2*f)+M*(u*k+h*M+2*p)+d;var S=1-k-M;for(l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=f,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:h,data_offset:f+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],400:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(f.variants=h.variants),h.orientation&&(f.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=t.length){var p=a(t,h.exif_location.offset),d=t.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),m=s.get_orientation(d);m>0&&(f.orientation=m)}return f}}}}}}},{"../common":398,"../exif_utils":399,"../miaf_utils":400}],402:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":398}],403:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":398}],404:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":398}],405:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1])for(var e=2;;){if(t.length-e<2)return;if(255!==t[e++])return;for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":398,"../exif_utils":399}],406:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":398}],407:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":398}],408:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function f(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===p&&d>=9?r=r||h(t,e+8):"VP8X"===p&&d>=10?r=r||f(t,e+8):"EXIF"===p&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":398,"../exif_utils":399}],411:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":401,"./parse_sync/bmp":402,"./parse_sync/gif":403,"./parse_sync/ico":404,"./parse_sync/jpeg":405,"./parse_sync/png":406,"./parse_sync/psd":407,"./parse_sync/svg":408,"./parse_sync/tiff":409,"./parse_sync/webp":410}],412:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":111,"compare-cell":126,"compare-oriented-cell":127}],420:[function(t,e,r){ +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ +"use strict";var n,i="";e.exports=function(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(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],421:[function(t,e,r){(function(t){(function(){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],422:[function(t,e,r){"use strict";e.exports=function(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];(l=o-((r=a+o)-a))&&(t[--n]=r,r=l)}var s=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(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],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],p=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+h*(g-v)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:f(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(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),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(l+=1)=n?(i=h,(l+=1)0?1:0}},{}],435:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":95,"reduce-simplicial-complex":419}],436:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},r.skeleton=h,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return g(0,A-1),A-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((A+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),M[e]>=0&&w(M[e],m(e)),M[r]>=0&&w(M[r],m(r))}}var k=[],M=new Array(a);for(h=0;h>1;h>=0;--h)x(h);for(;;){var S=_();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h=0&&r>=0&&e!==r){var n=M[e],i=M[r];n!==i&&C.push([n,i])}})),i.unique(i.normalize(C)),{positions:E,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":427,"simplicial-complex":440}],443:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f=h.length)return i;p=h[f]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},{"./lib/order-segments":443,"binary-search-bounds":92,"functional-red-black-tree":161,"robust-orientation":427}],445:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":424,"robust-sum":432}],446:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return i(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function i(r,n){var i,a,o,s,l,c,u,h,f,p=1,d=r.length,m="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?m+=i:(!t.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",i=i.toString().replace(t.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+i).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?f+i+l:"0"===c?f+l+i:l+f+i)}return m}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],447:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/lib/_stream_readable.js"),i.Writable=t("readable-stream/lib/_stream_writable.js"),i.Duplex=t("readable-stream/lib/_stream_duplex.js"),i.Transform=t("readable-stream/lib/_stream_transform.js"),i.PassThrough=t("readable-stream/lib/_stream_passthrough.js"),i.finished=t("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=t("readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(u(),0===n.listenerCount(this,"error"))throw t}function u(){r.removeListener("data",i),t.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("error",c),t.on("error",c),r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t}},{events:104,inherits:347,"readable-stream/lib/_stream_duplex.js":449,"readable-stream/lib/_stream_passthrough.js":450,"readable-stream/lib/_stream_readable.js":451,"readable-stream/lib/_stream_transform.js":452,"readable-stream/lib/_stream_writable.js":453,"readable-stream/lib/internal/streams/end-of-stream.js":457,"readable-stream/lib/internal/streams/pipeline.js":459}],448:[function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function a(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],449:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):P(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,P(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(C,t))}function C(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function D(t){c("readable nexttick read 0"),t.read(0)}function O(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function N(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(B,e,t))}function B(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?N(this):L(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&N(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&N(this)),null!==n&&this.emit("data",n),n},M.prototype._read=function(t){w(this,new b("_read()"))},M.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",f),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var h=!1;function f(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(e){c("onerror",e),g(),t.removeListener("error",p),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",m),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?L(this):i.reading||r.nextTick(D,this))),n},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(z,this),n},M.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(z,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(O,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new m("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,P(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=h.destroy,M.prototype._undestroy=h.undestroy,M.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":448,"./_stream_duplex":449,"./internal/streams/destroy":456,"./internal/streams/state":460,"./internal/streams/stream":461,_process:413,buffer:105,inherits:347,"util-deprecate":480}],454:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[f].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(p(r,!1)))}}function m(t){r.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[f]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(p(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[h](r,n)}),n)}}(i,this));else{var a=this[f].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[h])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[f].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,r=Object.create(v,(i(e={},f,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[f].read();n?(r[u]=null,r[o]=null,r[s]=null,t(p(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":457,_process:413}],455:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":448,"./end-of-stream":457}],460:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":448}],461:[function(t,e,r){e.exports=t("events").EventEmitter},{events:104}],462:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=h,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":433}],463:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),f(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),f(this,t,e,r)}function h(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(p(a));var c=o.apply(t,s);if(!l||a===c)return a}}var f=p((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return h(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return h(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function p(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:413,assert:69,buffer:105,debug:464}],464:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":465,_process:413}],465:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],467:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),v.push(s[x]),y+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(g);var b=new Array(y);for(d=0;dn|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=(o<<0)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*f)/(r-n),e-.25-.25*(i+r-2*f)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*f)/(n-r),e-.25-.25*(a+n-2*f)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*f)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*f)/(i-a),e-.75-.25*(-i-r+2*f)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*f)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*f)/(i-a),e-.75-.25*(a+n-2*f)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*f)/(a-i),e-.75-.25*(-a-n+2*f)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*f)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*f)/(a-i),e-.75-.25*(i+r-2*f)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*f)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*f)/(r-n),e-.25-.25*(-a-n+2*f)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*f)/(n-r),e-.25-.25*(-i-r+2*f)/(i-r)]);break;case 15:u.push([t-.5,e-.5])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}},"3d":function(t,e,r){var n=t({order:e,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(t,e,r,n){return t>n|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_){var w=(h<<0)+(f<<1)+(p<<2)+(d<<3)+(m<<4)+(g<<5)+(v<<6)+(y<<7)|0;if(0!==w&&255!==w)switch(w>>>7){case 0:!function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_){switch(t){case 0:b.push([e-.5,r-.5,n-.5]);break;case 1:b.push([e-1/6-1/6*(a+i-2*_)/(i-a),r-1/6-1/6*(o+i-2*_)/(i-o),n-1/6-1/6*(l+i-2*_)/(i-l)]);break;case 2:b.push([e-5/6-1/6*(-a-i+2*_)/(a-i),r-1/6-1/6*(s+a-2*_)/(a-s),n-1/6-1/6*(c+a-2*_)/(a-c)]);break;case 3:b.push([e-.5,r-.25-.25*(o+i+s+a-4*_)/(i-o+a-s),n-.25-.25*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 4:b.push([e-1/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(-o-i+2*_)/(o-i),n-1/6-1/6*(u+o-2*_)/(o-u)]);break;case 5:b.push([e-.25-.25*(a+i+s+o-4*_)/(i-a+o-s),r-.5,n-.25-.25*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 6:b.push([e-.5-1/6*(-a-i+s+o)/(a-i+o-s),r-.5-1/6*(-o-i+s+a)/(o-i+a-s),n-1/6-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 7:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(s+a-2*_)/(a-s),n-.3-.3*(l+i+c+a+u+o-6*_)/(i-l+a-c+o-u)]);break;case 8:b.push([e-5/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(-s-a+2*_)/(s-a),n-1/6-1/6*(h+s-2*_)/(s-h)]);break;case 9:b.push([e-.5-1/6*(a+i+-s-o)/(i-a+s-o),r-.5-1/6*(o+i+-s-a)/(i-o+s-a),n-1/6-1/6*(l+i+h+s-4*_)/(i-l+s-h)]);break;case 10:b.push([e-.75-.25*(-a-i-s-o+4*_)/(a-i+s-o),r-.5,n-.25-.25*(c+a+h+s-4*_)/(a-c+s-h)]);break;case 11:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(o+i-2*_)/(i-o),n-.3-.3*(l+i+c+a+h+s-6*_)/(i-l+a-c+s-h)]);break;case 12:b.push([e-.5,r-.75-.25*(-o-i-s-a+4*_)/(o-i+s-a),n-.25-.25*(u+o+h+s-4*_)/(o-u+s-h)]);break;case 13:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.5-.1*(-s-a+2*_)/(s-a),n-.3-.3*(l+i+u+o+h+s-6*_)/(i-l+o-u+s-h)]);break;case 14:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.5-.1*(-o-i+2*_)/(o-i),n-.3-.3*(c+a+u+o+h+s-6*_)/(a-c+o-u+s-h)]);break;case 15:b.push([e-.5,r-.5,n-.5-.5*(l+i+c+a+u+o+h+s-8*_)/(i-l+a-c+o-u+s-h)]);break;case 16:b.push([e-1/6-1/6*(c+l-2*_)/(l-c),r-1/6-1/6*(u+l-2*_)/(l-u),n-5/6-1/6*(-l-i+2*_)/(l-i)]);break;case 17:b.push([e-.25-.25*(a+i+c+l-4*_)/(i-a+l-c),r-.25-.25*(o+i+u+l-4*_)/(i-o+l-u),n-.5]);break;case 18:b.push([e-.5-1/6*(-a-i+c+l)/(a-i+l-c),r-1/6-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(-l-i+c+a)/(l-i+a-c)]);break;case 19:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.3-.3*(o+i+s+a+u+l-6*_)/(i-o+a-s+l-u),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 20:b.push([e-1/6-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(-o-i+u+l)/(o-i+l-u),n-.5-1/6*(-l-i+u+o)/(l-i+o-u)]);break;case 21:b.push([e-.3-.3*(a+i+s+o+c+l-6*_)/(i-a+o-s+l-c),r-.5-.1*(u+l-2*_)/(l-u),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 22:b.push([e-7/18-1/6*(-a-i+s+o+c+l-2*_)/(a-i+o-s+l-c),r-7/18-1/6*(-o-i+s+a+u+l-2*_)/(o-i+a-s+l-u),n-7/18-1/6*(-l-i+c+a+u+o-2*_)/(l-i+a-c+o-u)]);break;case 23:b.push([e-.5-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 24:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(-l-i+h+s)/(l-i+s-h)]);break;case 25:b.push([e-.5-3/14*(a+i+-s-o+c+l-2*_)/(i-a+s-o+l-c),r-.5-3/14*(o+i+-s-a+u+l-2*_)/(i-o+s-a+l-u),n-5/14-1/14*(h+s-2*_)/(s-h)]);break;case 26:b.push([e-.5-3/14*(-a-i-s-o+c+l+2*_)/(a-i+s-o+l-c),r-5/14-1/14*(u+l-2*_)/(l-u),n-.5-3/14*(-l-i+c+a+h+s-2*_)/(l-i+a-c+s-h)]);break;case 27:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(o+i+u+l-4*_)/(i-o+l-u),n-.5-1/6*(c+a+h+s-4*_)/(a-c+s-h)]);break;case 28:b.push([e-5/14-1/14*(c+l-2*_)/(l-c),r-.5-3/14*(-o-i-s-a+u+l+2*_)/(o-i+s-a+l-u),n-.5-3/14*(-l-i+u+o+h+s-2*_)/(l-i+o-u+s-h)]);break;case 29:b.push([e-.5-1/6*(a+i+c+l-4*_)/(i-a+l-c),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(u+o+h+s-4*_)/(o-u+s-h)]);break;case 30:b.push([e-.375-.125*(-a-i+c+l)/(a-i+l-c),r-.375-.125*(-o-i+u+l)/(o-i+l-u),n-.5-.25*(-l-i+c+a+u+o+h+s-4*_)/(l-i+a-c+o-u+s-h)]);break;case 31:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.5-.1*(u+l-2*_)/(l-u),n-.7-.3*(c+a+u+o+h+s-6*_)/(a-c+o-u+s-h)]);break;case 32:b.push([e-5/6-1/6*(-c-l+2*_)/(c-l),r-1/6-1/6*(h+c-2*_)/(c-h),n-5/6-1/6*(-c-a+2*_)/(c-a)]);break;case 33:b.push([e-.5-1/6*(a+i+-c-l)/(i-a+c-l),r-1/6-1/6*(o+i+h+c-4*_)/(i-o+c-h),n-.5-1/6*(l+i+-c-a)/(i-l+c-a)]);break;case 34:b.push([e-.75-.25*(-a-i-c-l+4*_)/(a-i+c-l),r-.25-.25*(s+a+h+c-4*_)/(a-s+c-h),n-.5]);break;case 35:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.3-.3*(o+i+s+a+h+c-6*_)/(i-o+a-s+c-h),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 36:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(-o-i+h+c)/(o-i+c-h),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 37:b.push([e-.5-3/14*(a+i+s+o+-c-l-2*_)/(i-a+o-s+c-l),r-5/14-1/14*(h+c-2*_)/(c-h),n-.5-3/14*(l+i+-c-a+u+o-2*_)/(i-l+c-a+o-u)]);break;case 38:b.push([e-.5-3/14*(-a-i+s+o+-c-l+2*_)/(a-i+o-s+c-l),r-.5-3/14*(-o-i+s+a+h+c-2*_)/(o-i+a-s+c-h),n-5/14-1/14*(u+o-2*_)/(o-u)]);break;case 39:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(s+a+h+c-4*_)/(a-s+c-h),n-.5-1/6*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 40:b.push([e-5/6-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(-s-a+h+c)/(s-a+c-h),n-.5-1/6*(-c-a+h+s)/(c-a+s-h)]);break;case 41:b.push([e-11/18-1/6*(a+i+-s-o-c-l+2*_)/(i-a+s-o+c-l),r-7/18-1/6*(o+i+-s-a+h+c-2*_)/(i-o+s-a+c-h),n-7/18-1/6*(l+i+-c-a+h+s-2*_)/(i-l+c-a+s-h)]);break;case 42:b.push([e-.7-.3*(-a-i-s-o-c-l+6*_)/(a-i+s-o+c-l),r-.5-.1*(h+c-2*_)/(c-h),n-.5-.1*(h+s-2*_)/(s-h)]);break;case 43:b.push([e-.5-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(o+i+h+c-4*_)/(i-o+c-h),n-.5-1/6*(l+i+h+s-4*_)/(i-l+s-h)]);break;case 44:b.push([e-9/14-1/14*(-c-l+2*_)/(c-l),r-.5-3/14*(-o-i-s-a+h+c+2*_)/(o-i+s-a+c-h),n-.5-3/14*(-c-a+u+o+h+s-2*_)/(c-a+o-u+s-h)]);break;case 45:b.push([e-.625-.125*(a+i+-c-l)/(i-a+c-l),r-.375-.125*(-s-a+h+c)/(s-a+c-h),n-.5-.25*(l+i+-c-a+u+o+h+s-4*_)/(i-l+c-a+o-u+s-h)]);break;case 46:b.push([e-.5-1/6*(-a-i-c-l+4*_)/(a-i+c-l),r-.5-1/6*(-o-i+h+c)/(o-i+c-h),n-.5-1/6*(u+o+h+s-4*_)/(o-u+s-h)]);break;case 47:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.5-.1*(h+c-2*_)/(c-h),n-.7-.3*(l+i+u+o+h+s-6*_)/(i-l+o-u+s-h)]);break;case 48:b.push([e-.5,r-.25-.25*(u+l+h+c-4*_)/(l-u+c-h),n-.75-.25*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 49:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.3-.3*(o+i+u+l+h+c-6*_)/(i-o+l-u+c-h),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 50:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.3-.3*(s+a+u+l+h+c-6*_)/(a-s+l-u+c-h),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 51:b.push([e-.5,r-.5-.5*(o+i+s+a+u+l+h+c-8*_)/(i-o+a-s+l-u+c-h),n-.5]);break;case 52:b.push([e-5/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(-o-i+u+l+h+c-2*_)/(o-i+l-u+c-h),n-.5-3/14*(-l-i-c-a+u+o+2*_)/(l-i+c-a+o-u)]);break;case 53:b.push([e-.5-1/6*(a+i+s+o-4*_)/(i-a+o-s),r-.5-1/6*(u+l+h+c-4*_)/(l-u+c-h),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 54:b.push([e-.375-.125*(-a-i+s+o)/(a-i+o-s),r-.5-.25*(-o-i+s+a+u+l+h+c-4*_)/(o-i+a-s+l-u+c-h),n-.375-.125*(-l-i+u+o)/(l-i+o-u)]);break;case 55:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(s+a+u+l+h+c-6*_)/(a-s+l-u+c-h),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 56:b.push([e-9/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(-s-a+u+l+h+c-2*_)/(s-a+l-u+c-h),n-.5-3/14*(-l-i-c-a+h+s+2*_)/(l-i+c-a+s-h)]);break;case 57:b.push([e-.625-.125*(a+i+-s-o)/(i-a+s-o),r-.5-.25*(o+i+-s-a+u+l+h+c-4*_)/(i-o+s-a+l-u+c-h),n-.375-.125*(-c-a+h+s)/(c-a+s-h)]);break;case 58:b.push([e-.5-1/6*(-a-i-s-o+4*_)/(a-i+s-o),r-.5-1/6*(u+l+h+c-4*_)/(l-u+c-h),n-.5-1/6*(-l-i+h+s)/(l-i+s-h)]);break;case 59:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(o+i+u+l+h+c-6*_)/(i-o+l-u+c-h),n-.5-.1*(h+s-2*_)/(s-h)]);break;case 60:b.push([e-.5,r-.5-.25*(-o-i-s-a+u+l+h+c)/(o-i+s-a+l-u+c-h),n-.5-.25*(-l-i-c-a+u+o+h+s)/(l-i+c-a+o-u+s-h)]);break;case 61:b.push([e-9/14-1/14*(a+i-2*_)/(i-a),r-.5-3/14*(-s-a+u+l+h+c-2*_)/(s-a+l-u+c-h),n-.5-3/14*(-c-a+u+o+h+s-2*_)/(c-a+o-u+s-h)]);break;case 62:b.push([e-5/14-1/14*(-a-i+2*_)/(a-i),r-.5-3/14*(-o-i+u+l+h+c-2*_)/(o-i+l-u+c-h),n-.5-3/14*(-l-i+u+o+h+s-2*_)/(l-i+o-u+s-h)]);break;case 63:b.push([e-.5,r-.75-.25*(u+l+h+c-4*_)/(l-u+c-h),n-.75-.25*(u+o+h+s-4*_)/(o-u+s-h)]);break;case 64:b.push([e-1/6-1/6*(h+u-2*_)/(u-h),r-5/6-1/6*(-u-l+2*_)/(u-l),n-5/6-1/6*(-u-o+2*_)/(u-o)]);break;case 65:b.push([e-1/6-1/6*(a+i+h+u-4*_)/(i-a+u-h),r-.5-1/6*(o+i+-u-l)/(i-o+u-l),n-.5-1/6*(l+i+-u-o)/(i-l+u-o)]);break;case 66:b.push([e-.5-1/6*(-a-i+h+u)/(a-i+u-h),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 67:b.push([e-5/14-1/14*(h+u-2*_)/(u-h),r-.5-3/14*(o+i+s+a+-u-l-2*_)/(i-o+a-s+u-l),n-.5-3/14*(l+i+c+a+-u-o-2*_)/(i-l+a-c+u-o)]);break;case 68:b.push([e-.25-.25*(s+o+h+u-4*_)/(o-s+u-h),r-.75-.25*(-o-i-u-l+4*_)/(o-i+u-l),n-.5]);break;case 69:b.push([e-.3-.3*(a+i+s+o+h+u-6*_)/(i-a+o-s+u-h),r-.5-.1*(-u-l+2*_)/(u-l),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 70:b.push([e-.5-3/14*(-a-i+s+o+h+u-2*_)/(a-i+o-s+u-h),r-.5-3/14*(-o-i+s+a+-u-l+2*_)/(o-i+a-s+u-l),n-5/14-1/14*(c+a-2*_)/(a-c)]);break;case 71:b.push([e-.5-1/6*(s+o+h+u-4*_)/(o-s+u-h),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 72:b.push([e-.5-1/6*(-s-o+h+u)/(s-o+u-h),r-5/6-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(-u-o+h+s)/(u-o+s-h)]);break;case 73:b.push([e-7/18-1/6*(a+i+-s-o+h+u-2*_)/(i-a+s-o+u-h),r-11/18-1/6*(o+i+-s-a-u-l+2*_)/(i-o+s-a+u-l),n-7/18-1/6*(l+i+-u-o+h+s-2*_)/(i-l+u-o+s-h)]);break;case 74:b.push([e-.5-3/14*(-a-i-s-o+h+u+2*_)/(a-i+s-o+u-h),r-9/14-1/14*(-u-l+2*_)/(u-l),n-.5-3/14*(c+a+-u-o+h+s-2*_)/(a-c+u-o+s-h)]);break;case 75:b.push([e-.375-.125*(-s-o+h+u)/(s-o+u-h),r-.625-.125*(o+i+-u-l)/(i-o+u-l),n-.5-.25*(l+i+c+a+-u-o+h+s-4*_)/(i-l+a-c+u-o+s-h)]);break;case 76:b.push([e-.5-.1*(h+u-2*_)/(u-h),r-.7-.3*(-o-i-s-a-u-l+6*_)/(o-i+s-a+u-l),n-.5-.1*(h+s-2*_)/(s-h)]);break;case 77:b.push([e-.5-1/6*(a+i+h+u-4*_)/(i-a+u-h),r-.5-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(l+i+h+s-4*_)/(i-l+s-h)]);break;case 78:b.push([e-.5-1/6*(-a-i+h+u)/(a-i+u-h),r-.5-1/6*(-o-i-u-l+4*_)/(o-i+u-l),n-.5-1/6*(c+a+h+s-4*_)/(a-c+s-h)]);break;case 79:b.push([e-.5-.1*(h+u-2*_)/(u-h),r-.5-.1*(-u-l+2*_)/(u-l),n-.7-.3*(l+i+c+a+h+s-6*_)/(i-l+a-c+s-h)]);break;case 80:b.push([e-.25-.25*(c+l+h+u-4*_)/(l-c+u-h),r-.5,n-.75-.25*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 81:b.push([e-.3-.3*(a+i+c+l+h+u-6*_)/(i-a+l-c+u-h),r-.5-.1*(o+i-2*_)/(i-o),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 82:b.push([e-.5-3/14*(-a-i+c+l+h+u-2*_)/(a-i+l-c+u-h),r-5/14-1/14*(s+a-2*_)/(a-s),n-.5-3/14*(-l-i+c+a+-u-o+2*_)/(l-i+a-c+u-o)]);break;case 83:b.push([e-.5-1/6*(c+l+h+u-4*_)/(l-c+u-h),r-.5-1/6*(o+i+s+a-4*_)/(i-o+a-s),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 84:b.push([e-.3-.3*(s+o+c+l+h+u-6*_)/(o-s+l-c+u-h),r-.5-.1*(-o-i+2*_)/(o-i),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 85:b.push([e-.5-.5*(a+i+s+o+c+l+h+u-8*_)/(i-a+o-s+l-c+u-h),r-.5,n-.5]);break;case 86:b.push([e-.5-.25*(-a-i+s+o+c+l+h+u-4*_)/(a-i+o-s+l-c+u-h),r-.375-.125*(-o-i+s+a)/(o-i+a-s),n-.375-.125*(-l-i+c+a)/(l-i+a-c)]);break;case 87:b.push([e-.7-.3*(s+o+c+l+h+u-6*_)/(o-s+l-c+u-h),r-.5-.1*(s+a-2*_)/(a-s),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 88:b.push([e-.5-3/14*(-s-o+c+l+h+u-2*_)/(s-o+l-c+u-h),r-9/14-1/14*(-s-a+2*_)/(s-a),n-.5-3/14*(-l-i-u-o+h+s+2*_)/(l-i+u-o+s-h)]);break;case 89:b.push([e-.5-.25*(a+i+-s-o+c+l+h+u-4*_)/(i-a+s-o+l-c+u-h),r-.625-.125*(o+i+-s-a)/(i-o+s-a),n-.375-.125*(-u-o+h+s)/(u-o+s-h)]);break;case 90:b.push([e-.5-.25*(-a-i-s-o+c+l+h+u)/(a-i+s-o+l-c+u-h),r-.5,n-.5-.25*(-l-i+c+a+-u-o+h+s)/(l-i+a-c+u-o+s-h)]);break;case 91:b.push([e-.5-3/14*(-s-o+c+l+h+u-2*_)/(s-o+l-c+u-h),r-9/14-1/14*(o+i-2*_)/(i-o),n-.5-3/14*(c+a+-u-o+h+s-2*_)/(a-c+u-o+s-h)]);break;case 92:b.push([e-.5-1/6*(c+l+h+u-4*_)/(l-c+u-h),r-.5-1/6*(-o-i-s-a+4*_)/(o-i+s-a),n-.5-1/6*(-l-i+h+s)/(l-i+s-h)]);break;case 93:b.push([e-.7-.3*(a+i+c+l+h+u-6*_)/(i-a+l-c+u-h),r-.5-.1*(-s-a+2*_)/(s-a),n-.5-.1*(h+s-2*_)/(s-h)]);break;case 94:b.push([e-.5-3/14*(-a-i+c+l+h+u-2*_)/(a-i+l-c+u-h),r-5/14-1/14*(-o-i+2*_)/(o-i),n-.5-3/14*(-l-i+c+a+h+s-2*_)/(l-i+a-c+s-h)]);break;case 95:b.push([e-.75-.25*(c+l+h+u-4*_)/(l-c+u-h),r-.5,n-.75-.25*(c+a+h+s-4*_)/(a-c+s-h)]);break;case 96:b.push([e-.5-1/6*(-c-l+h+u)/(c-l+u-h),r-.5-1/6*(-u-l+h+c)/(u-l+c-h),n-5/6-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 97:b.push([e-7/18-1/6*(a+i+-c-l+h+u-2*_)/(i-a+c-l+u-h),r-7/18-1/6*(o+i+-u-l+h+c-2*_)/(i-o+u-l+c-h),n-11/18-1/6*(l+i+-c-a-u-o+2*_)/(i-l+c-a+u-o)]);break;case 98:b.push([e-.5-3/14*(-a-i-c-l+h+u+2*_)/(a-i+c-l+u-h),r-.5-3/14*(s+a+-u-l+h+c-2*_)/(a-s+u-l+c-h),n-9/14-1/14*(-u-o+2*_)/(u-o)]);break;case 99:b.push([e-.375-.125*(-c-l+h+u)/(c-l+u-h),r-.5-.25*(o+i+s+a+-u-l+h+c-4*_)/(i-o+a-s+u-l+c-h),n-.625-.125*(l+i+-u-o)/(i-l+u-o)]);break;case 100:b.push([e-.5-3/14*(s+o+-c-l+h+u-2*_)/(o-s+c-l+u-h),r-.5-3/14*(-o-i-u-l+h+c+2*_)/(o-i+u-l+c-h),n-9/14-1/14*(-c-a+2*_)/(c-a)]);break;case 101:b.push([e-.5-.25*(a+i+s+o+-c-l+h+u-4*_)/(i-a+o-s+c-l+u-h),r-.375-.125*(-u-l+h+c)/(u-l+c-h),n-.625-.125*(l+i+-c-a)/(i-l+c-a)]);break;case 102:b.push([e-.5-.25*(-a-i+s+o+-c-l+h+u)/(a-i+o-s+c-l+u-h),r-.5-.25*(-o-i+s+a+-u-l+h+c)/(o-i+a-s+u-l+c-h),n-.5]);break;case 103:b.push([e-.5-3/14*(s+o+-c-l+h+u-2*_)/(o-s+c-l+u-h),r-.5-3/14*(s+a+-u-l+h+c-2*_)/(a-s+u-l+c-h),n-9/14-1/14*(l+i-2*_)/(i-l)]);break;case 104:b.push([e-11/18-1/6*(-s-o-c-l+h+u+2*_)/(s-o+c-l+u-h),r-11/18-1/6*(-s-a-u-l+h+c+2*_)/(s-a+u-l+c-h),n-11/18-1/6*(-c-a-u-o+h+s+2*_)/(c-a+u-o+s-h)]);break;case 105:b.push([e-.5-1/6*(a+i+-s-o-c-l+h+u)/(i-a+s-o+c-l+u-h),r-.5-1/6*(o+i+-s-a-u-l+h+c)/(i-o+s-a+u-l+c-h),n-.5-1/6*(l+i+-c-a-u-o+h+s)/(i-l+c-a+u-o+s-h)]);break;case 106:b.push([e-.5-.25*(-a-i-s-o-c-l+h+u+4*_)/(a-i+s-o+c-l+u-h),r-.625-.125*(-u-l+h+c)/(u-l+c-h),n-.625-.125*(-u-o+h+s)/(u-o+s-h)]);break;case 107:b.push([e-7/18-1/6*(-s-o-c-l+h+u+2*_)/(s-o+c-l+u-h),r-11/18-1/6*(o+i+-u-l+h+c-2*_)/(i-o+u-l+c-h),n-11/18-1/6*(l+i+-u-o+h+s-2*_)/(i-l+u-o+s-h)]);break;case 108:b.push([e-.625-.125*(-c-l+h+u)/(c-l+u-h),r-.5-.25*(-o-i-s-a-u-l+h+c+4*_)/(o-i+s-a+u-l+c-h),n-.625-.125*(-c-a+h+s)/(c-a+s-h)]);break;case 109:b.push([e-11/18-1/6*(a+i+-c-l+h+u-2*_)/(i-a+c-l+u-h),r-7/18-1/6*(-s-a-u-l+h+c+2*_)/(s-a+u-l+c-h),n-11/18-1/6*(l+i+-c-a+h+s-2*_)/(i-l+c-a+s-h)]);break;case 110:b.push([e-.5-3/14*(-a-i-c-l+h+u+2*_)/(a-i+c-l+u-h),r-.5-3/14*(-o-i-u-l+h+c+2*_)/(o-i+u-l+c-h),n-9/14-1/14*(h+s-2*_)/(s-h)]);break;case 111:b.push([e-.5-1/6*(-c-l+h+u)/(c-l+u-h),r-.5-1/6*(-u-l+h+c)/(u-l+c-h),n-5/6-1/6*(l+i+h+s-4*_)/(i-l+s-h)]);break;case 112:b.push([e-.5-.1*(h+u-2*_)/(u-h),r-.5-.1*(h+c-2*_)/(c-h),n-.7-.3*(-l-i-c-a-u-o+6*_)/(l-i+c-a+u-o)]);break;case 113:b.push([e-.5-1/6*(a+i+h+u-4*_)/(i-a+u-h),r-.5-1/6*(o+i+h+c-4*_)/(i-o+c-h),n-.5-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 114:b.push([e-.5-1/6*(-a-i+h+u)/(a-i+u-h),r-.5-1/6*(s+a+h+c-4*_)/(a-s+c-h),n-.5-1/6*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 115:b.push([e-.5-.1*(h+u-2*_)/(u-h),r-.7-.3*(o+i+s+a+h+c-6*_)/(i-o+a-s+c-h),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 116:b.push([e-.5-1/6*(s+o+h+u-4*_)/(o-s+u-h),r-.5-1/6*(-o-i+h+c)/(o-i+c-h),n-.5-1/6*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 117:b.push([e-.7-.3*(a+i+s+o+h+u-6*_)/(i-a+o-s+u-h),r-.5-.1*(h+c-2*_)/(c-h),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 118:b.push([e-.5-3/14*(-a-i+s+o+h+u-2*_)/(a-i+o-s+u-h),r-.5-3/14*(-o-i+s+a+h+c-2*_)/(o-i+a-s+c-h),n-5/14-1/14*(-l-i+2*_)/(l-i)]);break;case 119:b.push([e-.75-.25*(s+o+h+u-4*_)/(o-s+u-h),r-.75-.25*(s+a+h+c-4*_)/(a-s+c-h),n-.5]);break;case 120:b.push([e-.625-.125*(-s-o+h+u)/(s-o+u-h),r-.625-.125*(-s-a+h+c)/(s-a+c-h),n-.5-.25*(-l-i-c-a-u-o+h+s+4*_)/(l-i+c-a+u-o+s-h)]);break;case 121:b.push([e-11/18-1/6*(a+i+-s-o+h+u-2*_)/(i-a+s-o+u-h),r-11/18-1/6*(o+i+-s-a+h+c-2*_)/(i-o+s-a+c-h),n-7/18-1/6*(-c-a-u-o+h+s+2*_)/(c-a+u-o+s-h)]);break;case 122:b.push([e-.5-3/14*(-a-i-s-o+h+u+2*_)/(a-i+s-o+u-h),r-9/14-1/14*(h+c-2*_)/(c-h),n-.5-3/14*(-l-i-u-o+h+s+2*_)/(l-i+u-o+s-h)]);break;case 123:b.push([e-.5-1/6*(-s-o+h+u)/(s-o+u-h),r-5/6-1/6*(o+i+h+c-4*_)/(i-o+c-h),n-.5-1/6*(-u-o+h+s)/(u-o+s-h)]);break;case 124:b.push([e-9/14-1/14*(h+u-2*_)/(u-h),r-.5-3/14*(-o-i-s-a+h+c+2*_)/(o-i+s-a+c-h),n-.5-3/14*(-l-i-c-a+h+s+2*_)/(l-i+c-a+s-h)]);break;case 125:b.push([e-5/6-1/6*(a+i+h+u-4*_)/(i-a+u-h),r-.5-1/6*(-s-a+h+c)/(s-a+c-h),n-.5-1/6*(-c-a+h+s)/(c-a+s-h)]);break;case 126:b.push([e-.5-1/6*(-a-i+h+u)/(a-i+u-h),r-.5-1/6*(-o-i+h+c)/(o-i+c-h),n-.5-1/6*(-l-i+h+s)/(l-i+s-h)]);break;case 127:b.push([e-5/6-1/6*(h+u-2*_)/(u-h),r-5/6-1/6*(h+c-2*_)/(c-h),n-5/6-1/6*(h+s-2*_)/(s-h)])}}(127&w,t,e,r,n,i,a,o,s,l,c,u,0,0,0,0,0,0,0,0,x,_);break;case 1:!function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,v,y,x,b,_){switch(t){case 0:b.push([e-5/6-1/6*(-h-u+2*_)/(h-u),r-5/6-1/6*(-h-c+2*_)/(h-c),n-5/6-1/6*(-h-s+2*_)/(h-s)]);break;case 1:b.push([e-.5-1/6*(a+i+-h-u)/(i-a+h-u),r-.5-1/6*(o+i+-h-c)/(i-o+h-c),n-.5-1/6*(l+i+-h-s)/(i-l+h-s)]);break;case 2:b.push([e-5/6-1/6*(-a-i-h-u+4*_)/(a-i+h-u),r-.5-1/6*(s+a+-h-c)/(a-s+h-c),n-.5-1/6*(c+a+-h-s)/(a-c+h-s)]);break;case 3:b.push([e-9/14-1/14*(-h-u+2*_)/(h-u),r-.5-3/14*(o+i+s+a+-h-c-2*_)/(i-o+a-s+h-c),n-.5-3/14*(l+i+c+a+-h-s-2*_)/(i-l+a-c+h-s)]);break;case 4:b.push([e-.5-1/6*(s+o+-h-u)/(o-s+h-u),r-5/6-1/6*(-o-i-h-c+4*_)/(o-i+h-c),n-.5-1/6*(u+o+-h-s)/(o-u+h-s)]);break;case 5:b.push([e-.5-3/14*(a+i+s+o+-h-u-2*_)/(i-a+o-s+h-u),r-9/14-1/14*(-h-c+2*_)/(h-c),n-.5-3/14*(l+i+u+o+-h-s-2*_)/(i-l+o-u+h-s)]);break;case 6:b.push([e-11/18-1/6*(-a-i+s+o+-h-u+2*_)/(a-i+o-s+h-u),r-11/18-1/6*(-o-i+s+a+-h-c+2*_)/(o-i+a-s+h-c),n-7/18-1/6*(c+a+u+o+-h-s-2*_)/(a-c+o-u+h-s)]);break;case 7:b.push([e-.625-.125*(s+o+-h-u)/(o-s+h-u),r-.625-.125*(s+a+-h-c)/(a-s+h-c),n-.5-.25*(l+i+c+a+u+o+-h-s-4*_)/(i-l+a-c+o-u+h-s)]);break;case 8:b.push([e-.75-.25*(-s-o-h-u+4*_)/(s-o+h-u),r-.75-.25*(-s-a-h-c+4*_)/(s-a+h-c),n-.5]);break;case 9:b.push([e-.5-3/14*(a+i+-s-o-h-u+2*_)/(i-a+s-o+h-u),r-.5-3/14*(o+i+-s-a-h-c+2*_)/(i-o+s-a+h-c),n-5/14-1/14*(l+i-2*_)/(i-l)]);break;case 10:b.push([e-.7-.3*(-a-i-s-o-h-u+6*_)/(a-i+s-o+h-u),r-.5-.1*(-h-c+2*_)/(h-c),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 11:b.push([e-.5-1/6*(-s-o-h-u+4*_)/(s-o+h-u),r-.5-1/6*(o+i+-h-c)/(i-o+h-c),n-.5-1/6*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 12:b.push([e-.5-.1*(-h-u+2*_)/(h-u),r-.7-.3*(-o-i-s-a-h-c+6*_)/(o-i+s-a+h-c),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 13:b.push([e-.5-1/6*(a+i+-h-u)/(i-a+h-u),r-.5-1/6*(-s-a-h-c+4*_)/(s-a+h-c),n-.5-1/6*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 14:b.push([e-.5-1/6*(-a-i-h-u+4*_)/(a-i+h-u),r-.5-1/6*(-o-i-h-c+4*_)/(o-i+h-c),n-.5-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 15:b.push([e-.5-.1*(-h-u+2*_)/(h-u),r-.5-.1*(-h-c+2*_)/(h-c),n-.7-.3*(l+i+c+a+u+o-6*_)/(i-l+a-c+o-u)]);break;case 16:b.push([e-.5-1/6*(c+l+-h-u)/(l-c+h-u),r-.5-1/6*(u+l+-h-c)/(l-u+h-c),n-5/6-1/6*(-l-i-h-s+4*_)/(l-i+h-s)]);break;case 17:b.push([e-.5-3/14*(a+i+c+l+-h-u-2*_)/(i-a+l-c+h-u),r-.5-3/14*(o+i+u+l+-h-c-2*_)/(i-o+l-u+h-c),n-9/14-1/14*(-h-s+2*_)/(h-s)]);break;case 18:b.push([e-11/18-1/6*(-a-i+c+l+-h-u+2*_)/(a-i+l-c+h-u),r-7/18-1/6*(s+a+u+l+-h-c-2*_)/(a-s+l-u+h-c),n-11/18-1/6*(-l-i+c+a+-h-s+2*_)/(l-i+a-c+h-s)]);break;case 19:b.push([e-.625-.125*(c+l+-h-u)/(l-c+h-u),r-.5-.25*(o+i+s+a+u+l+-h-c-4*_)/(i-o+a-s+l-u+h-c),n-.625-.125*(c+a+-h-s)/(a-c+h-s)]);break;case 20:b.push([e-7/18-1/6*(s+o+c+l+-h-u-2*_)/(o-s+l-c+h-u),r-11/18-1/6*(-o-i+u+l+-h-c+2*_)/(o-i+l-u+h-c),n-11/18-1/6*(-l-i+u+o+-h-s+2*_)/(l-i+o-u+h-s)]);break;case 21:b.push([e-.5-.25*(a+i+s+o+c+l+-h-u-4*_)/(i-a+o-s+l-c+h-u),r-.625-.125*(u+l+-h-c)/(l-u+h-c),n-.625-.125*(u+o+-h-s)/(o-u+h-s)]);break;case 22:b.push([e-.5-1/6*(-a-i+s+o+c+l+-h-u)/(a-i+o-s+l-c+h-u),r-.5-1/6*(-o-i+s+a+u+l+-h-c)/(o-i+a-s+l-u+h-c),n-.5-1/6*(-l-i+c+a+u+o+-h-s)/(l-i+a-c+o-u+h-s)]);break;case 23:b.push([e-11/18-1/6*(s+o+c+l+-h-u-2*_)/(o-s+l-c+h-u),r-11/18-1/6*(s+a+u+l+-h-c-2*_)/(a-s+l-u+h-c),n-11/18-1/6*(c+a+u+o+-h-s-2*_)/(a-c+o-u+h-s)]);break;case 24:b.push([e-.5-3/14*(-s-o+c+l+-h-u+2*_)/(s-o+l-c+h-u),r-.5-3/14*(-s-a+u+l+-h-c+2*_)/(s-a+l-u+h-c),n-9/14-1/14*(-l-i+2*_)/(l-i)]);break;case 25:b.push([e-.5-.25*(a+i+-s-o+c+l+-h-u)/(i-a+s-o+l-c+h-u),r-.5-.25*(o+i+-s-a+u+l+-h-c)/(i-o+s-a+l-u+h-c),n-.5]);break;case 26:b.push([e-.5-.25*(-a-i-s-o+c+l+-h-u+4*_)/(a-i+s-o+l-c+h-u),r-.375-.125*(u+l+-h-c)/(l-u+h-c),n-.625-.125*(-l-i+c+a)/(l-i+a-c)]);break;case 27:b.push([e-.5-3/14*(-s-o+c+l+-h-u+2*_)/(s-o+l-c+h-u),r-.5-3/14*(o+i+u+l+-h-c-2*_)/(i-o+l-u+h-c),n-9/14-1/14*(c+a-2*_)/(a-c)]);break;case 28:b.push([e-.375-.125*(c+l+-h-u)/(l-c+h-u),r-.5-.25*(-o-i-s-a+u+l+-h-c+4*_)/(o-i+s-a+l-u+h-c),n-.625-.125*(-l-i+u+o)/(l-i+o-u)]);break;case 29:b.push([e-.5-3/14*(a+i+c+l+-h-u-2*_)/(i-a+l-c+h-u),r-.5-3/14*(-s-a+u+l+-h-c+2*_)/(s-a+l-u+h-c),n-9/14-1/14*(u+o-2*_)/(o-u)]);break;case 30:b.push([e-7/18-1/6*(-a-i+c+l+-h-u+2*_)/(a-i+l-c+h-u),r-7/18-1/6*(-o-i+u+l+-h-c+2*_)/(o-i+l-u+h-c),n-11/18-1/6*(-l-i+c+a+u+o-2*_)/(l-i+a-c+o-u)]);break;case 31:b.push([e-.5-1/6*(c+l+-h-u)/(l-c+h-u),r-.5-1/6*(u+l+-h-c)/(l-u+h-c),n-5/6-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 32:b.push([e-.75-.25*(-c-l-h-u+4*_)/(c-l+h-u),r-.5,n-.75-.25*(-c-a-h-s+4*_)/(c-a+h-s)]);break;case 33:b.push([e-.5-3/14*(a+i+-c-l-h-u+2*_)/(i-a+c-l+h-u),r-5/14-1/14*(o+i-2*_)/(i-o),n-.5-3/14*(l+i+-c-a-h-s+2*_)/(i-l+c-a+h-s)]);break;case 34:b.push([e-.7-.3*(-a-i-c-l-h-u+6*_)/(a-i+c-l+h-u),r-.5-.1*(s+a-2*_)/(a-s),n-.5-.1*(-h-s+2*_)/(h-s)]);break;case 35:b.push([e-.5-1/6*(-c-l-h-u+4*_)/(c-l+h-u),r-.5-1/6*(o+i+s+a-4*_)/(i-o+a-s),n-.5-1/6*(l+i+-h-s)/(i-l+h-s)]);break;case 36:b.push([e-.5-3/14*(s+o+-c-l-h-u+2*_)/(o-s+c-l+h-u),r-9/14-1/14*(-o-i+2*_)/(o-i),n-.5-3/14*(-c-a+u+o+-h-s+2*_)/(c-a+o-u+h-s)]);break;case 37:b.push([e-.5-.25*(a+i+s+o+-c-l-h-u)/(i-a+o-s+c-l+h-u),r-.5,n-.5-.25*(l+i+-c-a+u+o+-h-s)/(i-l+c-a+o-u+h-s)]);break;case 38:b.push([e-.5-.25*(-a-i+s+o+-c-l-h-u+4*_)/(a-i+o-s+c-l+h-u),r-.625-.125*(-o-i+s+a)/(o-i+a-s),n-.375-.125*(u+o+-h-s)/(o-u+h-s)]);break;case 39:b.push([e-.5-3/14*(s+o+-c-l-h-u+2*_)/(o-s+c-l+h-u),r-9/14-1/14*(s+a-2*_)/(a-s),n-.5-3/14*(l+i+u+o+-h-s-2*_)/(i-l+o-u+h-s)]);break;case 40:b.push([e-.7-.3*(-s-o-c-l-h-u+6*_)/(s-o+c-l+h-u),r-.5-.1*(-s-a+2*_)/(s-a),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 41:b.push([e-.5-.25*(a+i+-s-o-c-l-h-u+4*_)/(i-a+s-o+c-l+h-u),r-.375-.125*(o+i+-s-a)/(i-o+s-a),n-.375-.125*(l+i+-c-a)/(i-l+c-a)]);break;case 42:b.push([e-.5-.5*(-a-i-s-o-c-l-h-u+8*_)/(a-i+s-o+c-l+h-u),r-.5,n-.5]);break;case 43:b.push([e-.3-.3*(-s-o-c-l-h-u+6*_)/(s-o+c-l+h-u),r-.5-.1*(o+i-2*_)/(i-o),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 44:b.push([e-.5-1/6*(-c-l-h-u+4*_)/(c-l+h-u),r-.5-1/6*(-o-i-s-a+4*_)/(o-i+s-a),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 45:b.push([e-.5-3/14*(a+i+-c-l-h-u+2*_)/(i-a+c-l+h-u),r-5/14-1/14*(-s-a+2*_)/(s-a),n-.5-3/14*(l+i+-c-a+u+o-2*_)/(i-l+c-a+o-u)]);break;case 46:b.push([e-.3-.3*(-a-i-c-l-h-u+6*_)/(a-i+c-l+h-u),r-.5-.1*(-o-i+2*_)/(o-i),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 47:b.push([e-.25-.25*(-c-l-h-u+4*_)/(c-l+h-u),r-.5,n-.75-.25*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 48:b.push([e-.5-.1*(-h-u+2*_)/(h-u),r-.5-.1*(u+l-2*_)/(l-u),n-.7-.3*(-l-i-c-a-h-s+6*_)/(l-i+c-a+h-s)]);break;case 49:b.push([e-.5-1/6*(a+i+-h-u)/(i-a+h-u),r-.5-1/6*(o+i+u+l-4*_)/(i-o+l-u),n-.5-1/6*(-c-a-h-s+4*_)/(c-a+h-s)]);break;case 50:b.push([e-.5-1/6*(-a-i-h-u+4*_)/(a-i+h-u),r-.5-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(-l-i-h-s+4*_)/(l-i+h-s)]);break;case 51:b.push([e-.5-.1*(-h-u+2*_)/(h-u),r-.7-.3*(o+i+s+a+u+l-6*_)/(i-o+a-s+l-u),n-.5-.1*(-h-s+2*_)/(h-s)]);break;case 52:b.push([e-.375-.125*(s+o+-h-u)/(o-s+h-u),r-.625-.125*(-o-i+u+l)/(o-i+l-u),n-.5-.25*(-l-i-c-a+u+o+-h-s+4*_)/(l-i+c-a+o-u+h-s)]);break;case 53:b.push([e-.5-3/14*(a+i+s+o+-h-u-2*_)/(i-a+o-s+h-u),r-9/14-1/14*(u+l-2*_)/(l-u),n-.5-3/14*(-c-a+u+o+-h-s+2*_)/(c-a+o-u+h-s)]);break;case 54:b.push([e-7/18-1/6*(-a-i+s+o+-h-u+2*_)/(a-i+o-s+h-u),r-11/18-1/6*(-o-i+s+a+u+l-2*_)/(o-i+a-s+l-u),n-7/18-1/6*(-l-i+u+o+-h-s+2*_)/(l-i+o-u+h-s)]);break;case 55:b.push([e-.5-1/6*(s+o+-h-u)/(o-s+h-u),r-5/6-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(u+o+-h-s)/(o-u+h-s)]);break;case 56:b.push([e-.5-1/6*(-s-o-h-u+4*_)/(s-o+h-u),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 57:b.push([e-.5-3/14*(a+i+-s-o-h-u+2*_)/(i-a+s-o+h-u),r-.5-3/14*(o+i+-s-a+u+l-2*_)/(i-o+s-a+l-u),n-5/14-1/14*(-c-a+2*_)/(c-a)]);break;case 58:b.push([e-.3-.3*(-a-i-s-o-h-u+6*_)/(a-i+s-o+h-u),r-.5-.1*(u+l-2*_)/(l-u),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 59:b.push([e-.25-.25*(-s-o-h-u+4*_)/(s-o+h-u),r-.75-.25*(o+i+u+l-4*_)/(i-o+l-u),n-.5]);break;case 60:b.push([e-5/14-1/14*(-h-u+2*_)/(h-u),r-.5-3/14*(-o-i-s-a+u+l+2*_)/(o-i+s-a+l-u),n-.5-3/14*(-l-i-c-a+u+o+2*_)/(l-i+c-a+o-u)]);break;case 61:b.push([e-.5-1/6*(a+i+-h-u)/(i-a+h-u),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 62:b.push([e-1/6-1/6*(-a-i-h-u+4*_)/(a-i+h-u),r-.5-1/6*(-o-i+u+l)/(o-i+l-u),n-.5-1/6*(-l-i+u+o)/(l-i+o-u)]);break;case 63:b.push([e-1/6-1/6*(-h-u+2*_)/(h-u),r-5/6-1/6*(u+l-2*_)/(l-u),n-5/6-1/6*(u+o-2*_)/(o-u)]);break;case 64:b.push([e-.5,r-.75-.25*(-u-l-h-c+4*_)/(u-l+h-c),n-.75-.25*(-u-o-h-s+4*_)/(u-o+h-s)]);break;case 65:b.push([e-5/14-1/14*(a+i-2*_)/(i-a),r-.5-3/14*(o+i+-u-l-h-c+2*_)/(i-o+u-l+h-c),n-.5-3/14*(l+i+-u-o-h-s+2*_)/(i-l+u-o+h-s)]);break;case 66:b.push([e-9/14-1/14*(-a-i+2*_)/(a-i),r-.5-3/14*(s+a+-u-l-h-c+2*_)/(a-s+u-l+h-c),n-.5-3/14*(c+a+-u-o-h-s+2*_)/(a-c+u-o+h-s)]);break;case 67:b.push([e-.5,r-.5-.25*(o+i+s+a+-u-l-h-c)/(i-o+a-s+u-l+h-c),n-.5-.25*(l+i+c+a+-u-o-h-s)/(i-l+a-c+u-o+h-s)]);break;case 68:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(-o-i-u-l-h-c+6*_)/(o-i+u-l+h-c),n-.5-.1*(-h-s+2*_)/(h-s)]);break;case 69:b.push([e-.5-1/6*(a+i+s+o-4*_)/(i-a+o-s),r-.5-1/6*(-u-l-h-c+4*_)/(u-l+h-c),n-.5-1/6*(l+i+-h-s)/(i-l+h-s)]);break;case 70:b.push([e-.625-.125*(-a-i+s+o)/(a-i+o-s),r-.5-.25*(-o-i+s+a+-u-l-h-c+4*_)/(o-i+a-s+u-l+h-c),n-.375-.125*(c+a+-h-s)/(a-c+h-s)]);break;case 71:b.push([e-9/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(s+a+-u-l-h-c+2*_)/(a-s+u-l+h-c),n-.5-3/14*(l+i+c+a+-h-s-2*_)/(i-l+a-c+h-s)]);break;case 72:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(-s-a-u-l-h-c+6*_)/(s-a+u-l+h-c),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 73:b.push([e-.375-.125*(a+i+-s-o)/(i-a+s-o),r-.5-.25*(o+i+-s-a-u-l-h-c+4*_)/(i-o+s-a+u-l+h-c),n-.375-.125*(l+i+-u-o)/(i-l+u-o)]);break;case 74:b.push([e-.5-1/6*(-a-i-s-o+4*_)/(a-i+s-o),r-.5-1/6*(-u-l-h-c+4*_)/(u-l+h-c),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 75:b.push([e-5/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(o+i+-u-l-h-c+2*_)/(i-o+u-l+h-c),n-.5-3/14*(l+i+c+a+-u-o-2*_)/(i-l+a-c+u-o)]);break;case 76:b.push([e-.5,r-.5-.5*(-o-i-s-a-u-l-h-c+8*_)/(o-i+s-a+u-l+h-c),n-.5]);break;case 77:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.3-.3*(-s-a-u-l-h-c+6*_)/(s-a+u-l+h-c),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 78:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.3-.3*(-o-i-u-l-h-c+6*_)/(o-i+u-l+h-c),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 79:b.push([e-.5,r-.25-.25*(-u-l-h-c+4*_)/(u-l+h-c),n-.75-.25*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 80:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.5-.1*(-h-c+2*_)/(h-c),n-.7-.3*(-l-i-u-o-h-s+6*_)/(l-i+u-o+h-s)]);break;case 81:b.push([e-.5-1/6*(a+i+c+l-4*_)/(i-a+l-c),r-.5-1/6*(o+i+-h-c)/(i-o+h-c),n-.5-1/6*(-u-o-h-s+4*_)/(u-o+h-s)]);break;case 82:b.push([e-.625-.125*(-a-i+c+l)/(a-i+l-c),r-.375-.125*(s+a+-h-c)/(a-s+h-c),n-.5-.25*(-l-i+c+a+-u-o-h-s+4*_)/(l-i+a-c+u-o+h-s)]);break;case 83:b.push([e-9/14-1/14*(c+l-2*_)/(l-c),r-.5-3/14*(o+i+s+a+-h-c-2*_)/(i-o+a-s+h-c),n-.5-3/14*(c+a+-u-o-h-s+2*_)/(a-c+u-o+h-s)]);break;case 84:b.push([e-.5-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(-o-i-h-c+4*_)/(o-i+h-c),n-.5-1/6*(-l-i-h-s+4*_)/(l-i+h-s)]);break;case 85:b.push([e-.7-.3*(a+i+s+o+c+l-6*_)/(i-a+o-s+l-c),r-.5-.1*(-h-c+2*_)/(h-c),n-.5-.1*(-h-s+2*_)/(h-s)]);break;case 86:b.push([e-11/18-1/6*(-a-i+s+o+c+l-2*_)/(a-i+o-s+l-c),r-7/18-1/6*(-o-i+s+a+-h-c+2*_)/(o-i+a-s+h-c),n-7/18-1/6*(-l-i+c+a+-h-s+2*_)/(l-i+a-c+h-s)]);break;case 87:b.push([e-5/6-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(s+a+-h-c)/(a-s+h-c),n-.5-1/6*(c+a+-h-s)/(a-c+h-s)]);break;case 88:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(-s-a-h-c+4*_)/(s-a+h-c),n-.5-1/6*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 89:b.push([e-.5-3/14*(a+i+-s-o+c+l-2*_)/(i-a+s-o+l-c),r-.5-3/14*(o+i+-s-a-h-c+2*_)/(i-o+s-a+h-c),n-5/14-1/14*(-u-o+2*_)/(u-o)]);break;case 90:b.push([e-.5-3/14*(-a-i-s-o+c+l+2*_)/(a-i+s-o+l-c),r-5/14-1/14*(-h-c+2*_)/(h-c),n-.5-3/14*(-l-i+c+a+-u-o+2*_)/(l-i+a-c+u-o)]);break;case 91:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(o+i+-h-c)/(i-o+h-c),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 92:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.3-.3*(-o-i-s-a-h-c+6*_)/(o-i+s-a+h-c),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 93:b.push([e-.75-.25*(a+i+c+l-4*_)/(i-a+l-c),r-.25-.25*(-s-a-h-c+4*_)/(s-a+h-c),n-.5]);break;case 94:b.push([e-.5-1/6*(-a-i+c+l)/(a-i+l-c),r-1/6-1/6*(-o-i-h-c+4*_)/(o-i+h-c),n-.5-1/6*(-l-i+c+a)/(l-i+a-c)]);break;case 95:b.push([e-5/6-1/6*(c+l-2*_)/(l-c),r-1/6-1/6*(-h-c+2*_)/(h-c),n-5/6-1/6*(c+a-2*_)/(a-c)]);break;case 96:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.5-.1*(-u-l+2*_)/(u-l),n-.7-.3*(-c-a-u-o-h-s+6*_)/(c-a+u-o+h-s)]);break;case 97:b.push([e-.375-.125*(a+i+-c-l)/(i-a+c-l),r-.375-.125*(o+i+-u-l)/(i-o+u-l),n-.5-.25*(l+i+-c-a-u-o-h-s+4*_)/(i-l+c-a+u-o+h-s)]);break;case 98:b.push([e-.5-1/6*(-a-i-c-l+4*_)/(a-i+c-l),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(-u-o-h-s+4*_)/(u-o+h-s)]);break;case 99:b.push([e-5/14-1/14*(-c-l+2*_)/(c-l),r-.5-3/14*(o+i+s+a+-u-l-2*_)/(i-o+a-s+u-l),n-.5-3/14*(l+i+-u-o-h-s+2*_)/(i-l+u-o+h-s)]);break;case 100:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(-o-i-u-l+4*_)/(o-i+u-l),n-.5-1/6*(-c-a-h-s+4*_)/(c-a+h-s)]);break;case 101:b.push([e-.5-3/14*(a+i+s+o+-c-l-2*_)/(i-a+o-s+c-l),r-5/14-1/14*(-u-l+2*_)/(u-l),n-.5-3/14*(l+i+-c-a-h-s+2*_)/(i-l+c-a+h-s)]);break;case 102:b.push([e-.5-3/14*(-a-i+s+o+-c-l+2*_)/(a-i+o-s+c-l),r-.5-3/14*(-o-i+s+a+-u-l+2*_)/(o-i+a-s+u-l),n-5/14-1/14*(-h-s+2*_)/(h-s)]);break;case 103:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(l+i+-h-s)/(i-l+h-s)]);break;case 104:b.push([e-.5-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 105:b.push([e-7/18-1/6*(a+i+-s-o-c-l+2*_)/(i-a+s-o+c-l),r-7/18-1/6*(o+i+-s-a-u-l+2*_)/(i-o+s-a+u-l),n-7/18-1/6*(l+i+-c-a-u-o+2*_)/(i-l+c-a+u-o)]);break;case 106:b.push([e-.3-.3*(-a-i-s-o-c-l+6*_)/(a-i+s-o+c-l),r-.5-.1*(-u-l+2*_)/(u-l),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 107:b.push([e-1/6-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(o+i+-u-l)/(i-o+u-l),n-.5-1/6*(l+i+-u-o)/(i-l+u-o)]);break;case 108:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.3-.3*(-o-i-s-a-u-l+6*_)/(o-i+s-a+u-l),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 109:b.push([e-.5-1/6*(a+i+-c-l)/(i-a+c-l),r-1/6-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(l+i+-c-a)/(i-l+c-a)]);break;case 110:b.push([e-.25-.25*(-a-i-c-l+4*_)/(a-i+c-l),r-.25-.25*(-o-i-u-l+4*_)/(o-i+u-l),n-.5]);break;case 111:b.push([e-1/6-1/6*(-c-l+2*_)/(c-l),r-1/6-1/6*(-u-l+2*_)/(u-l),n-5/6-1/6*(l+i-2*_)/(i-l)]);break;case 112:b.push([e-.5,r-.5,n-.5-.5*(-l-i-c-a-u-o-h-s+8*_)/(l-i+c-a+u-o+h-s)]);break;case 113:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.5-.1*(o+i-2*_)/(i-o),n-.3-.3*(-c-a-u-o-h-s+6*_)/(c-a+u-o+h-s)]);break;case 114:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.5-.1*(s+a-2*_)/(a-s),n-.3-.3*(-l-i-u-o-h-s+6*_)/(l-i+u-o+h-s)]);break;case 115:b.push([e-.5,r-.75-.25*(o+i+s+a-4*_)/(i-o+a-s),n-.25-.25*(-u-o-h-s+4*_)/(u-o+h-s)]);break;case 116:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(-o-i+2*_)/(o-i),n-.3-.3*(-l-i-c-a-h-s+6*_)/(l-i+c-a+h-s)]);break;case 117:b.push([e-.75-.25*(a+i+s+o-4*_)/(i-a+o-s),r-.5,n-.25-.25*(-c-a-h-s+4*_)/(c-a+h-s)]);break;case 118:b.push([e-.5-1/6*(-a-i+s+o)/(a-i+o-s),r-.5-1/6*(-o-i+s+a)/(o-i+a-s),n-1/6-1/6*(-l-i-h-s+4*_)/(l-i+h-s)]);break;case 119:b.push([e-5/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(s+a-2*_)/(a-s),n-1/6-1/6*(-h-s+2*_)/(h-s)]);break;case 120:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(-s-a+2*_)/(s-a),n-.3-.3*(-l-i-c-a-u-o+6*_)/(l-i+c-a+u-o)]);break;case 121:b.push([e-.5-1/6*(a+i+-s-o)/(i-a+s-o),r-.5-1/6*(o+i+-s-a)/(i-o+s-a),n-1/6-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 122:b.push([e-.25-.25*(-a-i-s-o+4*_)/(a-i+s-o),r-.5,n-.25-.25*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 123:b.push([e-1/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(o+i-2*_)/(i-o),n-1/6-1/6*(-u-o+2*_)/(u-o)]);break;case 124:b.push([e-.5,r-.25-.25*(-o-i-s-a+4*_)/(o-i+s-a),n-.25-.25*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 125:b.push([e-5/6-1/6*(a+i-2*_)/(i-a),r-1/6-1/6*(-s-a+2*_)/(s-a),n-1/6-1/6*(-c-a+2*_)/(c-a)]);break;case 126:b.push([e-1/6-1/6*(-a-i+2*_)/(a-i),r-1/6-1/6*(-o-i+2*_)/(o-i),n-1/6-1/6*(-l-i+2*_)/(l-i)]);break;case 127:b.push([e-.5,r-.5,n-.5])}}(127&w,t,e,r,n,i,a,o,s,l,c,u,0,0,0,0,0,0,0,0,x,_)}},cell:function(t,e,r,n,i,a,o,s,l,c,u){o?c.push([n,r,t],[t,e,n]):c.push([t,r,n],[n,e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}};var o={}},{"ndarray-extract-contour":368,"zero-crossings":505}],469:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function t(e,r,i){i=i||{};var o=a[e];o||(o=a[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(h+=.02);var p=new Float32Array(u),d=0,m=-.5*h;for(f=0;f=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":413,timers:470}],471:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,h=!1,f=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(p=e.r,d=e.g,m=e.b,i={r:255*C(p,255),g:255*C(d,255),b:255*C(m,255)},h=!0,f="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=D(e.s),c=D(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),h=!0,f="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=D(e.s),u=D(e.l),i=function(t,e,r){var n,i,a;function o(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}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),h=!0,f="hsl"),e.hasOwnProperty("a")&&(a=e.a));var p,d,m;return a=L(a),{ok:h,format:e.format||f,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.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 e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16)),z(O(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(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(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,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(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.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"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,N,B,j=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],472:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=a;function i(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}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 function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=i(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return i(e,"font-size");case"rem":return i(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":384}],473:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).topojson=t.topojson||{})}(this,(function(t){"use strict";function e(t){return t}function r(t){if(null==t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=2,c=t.length,u=new Array(c);for(u[0]=(r+=t[0])*i+o,u[1]=(n+=t[1])*a+s;lo&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=h(e),f=t.objects,p={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in f)p[c]=m(f[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++rMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function f(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.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,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),v=Math.sin(d),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,T=x,k=-g*x,M=-v*x,A=y,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*f[a]+T*e[a];E[4*a+1]=k*r[a]+M*f[a]+A*e[a],E[4*a+2]=L,E[4*a+3]=0}var C=E[1],P=E[5],I=E[9],z=E[2],D=E[6],O=E[10],R=P*O-I*D,F=I*z-C*O,N=C*D-P*z,B=c(R,F,N);R/=B,F/=B,N/=B,E[0]=R,E[4]=F,E[8]=N;for(a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var j=0;j<3;++j)u+=E[a+4*j]*S[j];E[12+a]=-u}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 d=[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;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];a(i,i,n,d);for(c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=c(u-=a*p,h-=o*p,f-=s*p),m=(u/=d)*e+a*r,g=(h/=d)*e+o*r,v=(f/=d)*e+s*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),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,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),m=Math.max(f,p,d);f===m?(s=s<0?-1:1,l=h=0):d===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*h,T=c(x-=s*w,b-=l*w,_-=h*w),k=l*(_/=T)-h*(b/=T),M=h*(x/=T)-s*_,A=s*b-l*x,S=c(k,M,A);if(k/=S,M/=S,A/=S,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,b,_),2===a){var E=e[1],L=e[5],C=e[9],P=E*x+L*b+C*_,I=E*k+L*M+C*A;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,P)}else{var z=e[2],D=e[6],O=e[10],R=z*s+D*l+O*h,F=z*x+D*b+O*_,N=z*k+D*M+O*A;v=Math.asin(u(R)),y=Math.atan2(N,F)}this.angle.jump(t,y,v),this.recalcMatrix(t);var B=e[2],j=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,Z=Math.exp(this.computedRadius[0]);this.center.jump(t,H-B*Z,G-j*Z,Y-U*Z)},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,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,m=d[0],g=d[1],v=d[2],y=i*m+a*g+o*v,x=c(m-=y*i,g-=y*a,v-=y*o);if(!(x<.01&&(x=c(m=a*f-o*h,g=o*l-i*f,v=i*h-a*l))<1e-6)){m/=x,g/=x,v/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*v-o*g,_=o*m-i*v,w=i*g-a*m,T=c(b,_,w),k=i*l+a*h+o*f,M=m*l+g*h+v*f,A=(b/=T)*l+(_/=T)*h+(w/=T)*f,S=Math.asin(u(k)),E=Math.atan2(A,M),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var I=Math.abs(C+2*Math.PI-E),z=Math.abs(C-E),D=Math.abs(C-2*Math.PI-E);I0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function M(t){return new DataView(p(t),0,t)}function A(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))h[n.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|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){f(t.buffer)},r.freeArrayBuffer=f,r.freeBuffer=function(t){h[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return A(t);case"data":case"dataview":return M(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=M,r.mallocBuffer=A,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":93,buffer:105,dup:155}],478:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",f(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(p=0;p-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(S(),"?px "),g*=Math.pow(.75,l-s),n=n.replace("?px ",S())),m+=.25*x*(l-s)}if(!0===o.superscripts){var c=t.indexOf("+"),u=r.indexOf("+"),h=c>-1?parseInt(t[1+c]):0,f=u>-1?parseInt(r[1+u]):0;h!==f&&(n=n.replace(S(),"?px "),g*=Math.pow(.75,f-h),n=n.replace("?px ",S())),m-=.25*x*(f-h)}if(!0===o.bolds){var p=t.indexOf("b|")>-1,d=r.indexOf("b|")>-1;!p&&d&&(n=v?n.replace("italic ","italic bold "):"bold "+n),p&&!d&&(n=n.replace("bold ",""))}if(!0===o.italics){var v=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!v&&y&&(n="italic "+n),v&&!y&&(n=n.replace("italic ",""))}e.font=n}for(f=0;f",a="",o=i.length,s=a.length,l="+"===e[0]||"-"===e[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(e[0]);-1===f?n[h]+=e:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=c+o,d=r.substr(p,u-p).indexOf(i);c=-1!==d?d:u+s}return n}function u(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function h(t,e,r,n){var i=u(t,n),a=function(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=0?e[a]:i}))},has___:{value:y((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:y((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};d.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 r?function(){function n(){this instanceof d||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new d),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new d),i.set___(t,e)}else n.set(t,e);return this},Object.create(d.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==m)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=d)}function m(t){t.permitHostObjects___&&t.permitHostObjects___(m)}function g(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){f||"undefined"==typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],484:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){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:n(e,t)}}},{"./hidden-store.js":485}],485:[function(t,e,r){e.exports=function(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}},{}],486:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":484}],487:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":162}],488:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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(l);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(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},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}return this.toMonthIndex(t,n,r)},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 i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=f[o-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-i.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=h[t-h[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=h[o.year-h[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=f[i.year-f[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=f[a.year-f[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var p,d=h[a.year-h[0]];for(p=0;p<13;p++){var m=d&1<<12-p?30:29;if(l>13;!g||p=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(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"};n.calendars.discworld=a},{"../main":502,"object-assign":379}],491:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.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)}}),n.calendars.ethiopian=a},{"../main":502,"object-assign":379}],492:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":502,"object-assign":379}],493:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+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)}}),n.calendars.islamic=a},{"../main":502,"object-assign":379}],494:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":502,"object-assign":379}],495:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.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)}}),n.calendars.mayan=a},{"../main":502,"object-assign":379}],496:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.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,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=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)}}),n.calendars.nanakshahi=a},{"../main":502,"object-assign":379}],497:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":502,"object-assign":379}],499:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.taiwan=o},{"../main":502,"object-assign":379}],500:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.thai=o},{"../main":502,"object-assign":379}],501:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;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":502,"object-assign":379}],502:[function(t,e,r){var n=t("object-assign");function i(){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 a(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.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()).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]}}}),n(a.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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();"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&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}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,c.local.invalidDate||c.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.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":379}],503:[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;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,h=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=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(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(M));return M+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=m;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},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;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":502,"object-assign":379}],504:[function(t,e,r){"use strict";var n,i=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u=0!=p>=0&&i.push(l[0]+.5+.5*(f+p)/(f-p)),n+=h,++l[0]}}};e.exports=(n={funcName:{funcName:"zeroCrossings"}.funcName},function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(i.bind(void 0,n)))},{}],505:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":504}],506:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],507:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":630,"../../plot_api/plot_template":700,"../../plots/cartesian/constants":718,"../../plots/font_attributes":740,"./arrow_paths":506}],508:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],h=t["_"+a+"padminus"],f={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+f,m=p-f,g=3*t.startarrowsize*t.arrowwidth||0,v=g+f,y=g-f;if(c===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(h,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(h,m,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":661,"../../plots/cartesian/axes":711,"./draw":513}],509:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Z=!1,X=["x","y"],W=0;W1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(Z=!0):Z=!0),K=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===ft;"x"===et?(Q=e[et],K=dt?it._offset+it._length*Q:K=T.l+T.w*Q):(Q=1-e[et],K=dt?it._offset+it._length*Q:K=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ht.head=K;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=T.t+T.h*mt):ht.tail=T.l+T.w*mt:ht.tail=it._offset+it.r2p(mt),J=tt}else ht.tail=K+mt,J=tt+mt;ht.text=ht.tail+tt;var vt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=o.constrain(ht.head,1,vt-1)),"pixel"===nt){var yt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-vt;yt>0?(ht.tail+=yt,ht.text+=yt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ut,ht.head+=ut}else J=tt=lt*H($,ct),ht.text=K+tt;ht.text+=ut,tt+=ut,J+=ut,e["_"+et+"padplus"]=lt/2+J,e["_"+et+"padminus"]=lt/2-J,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Z)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(M-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(O-_)*("middle"===e.valign?.5:1)),h)n.select("svg").attr({x:B+bt-1,y:B+_t}).call(u.setClipUrl,U?L:null,t);else{var wt=B+_t-m.top,Tt=B+bt-m.left;G.call(f.positionText,Tt,wt).call(u.setClipUrl,U?L:null,t)}V.select("rect").call(u.setRect,B,B,M,O),j.call(u.setRect,F/2,F/2,N-F,q-F),R.call(u.setTranslate,Math.round(C.x.text-N/2),Math.round(C.y.text-q/2)),z.attr({transform:"rotate("+P+","+C.x.text+","+C.y.text+")"});var kt,Mt=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=C.x.head,h=C.y.head,f=C.x.tail+r,p=C.y.tail+n,m=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,m,b),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),L=+j.attr("width"),D=+j.attr("height"),O=m-.5*L,F=O+L,N=b-.5*D,B=N+D,U=[[O,N,O,B],[O,B,F,B],[F,B,F,N],[F,N,O,N]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,h,l+1e6,h+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(f,p,l,h,t[0],t[1],t[2],t[3]);e&&(f=e.x,p=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=I.append("g").style({opacity:c.opacity(q)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+f+","+p+"L"+l+","+h).style("stroke-width",V+"px").call(c.stroke,c.rgb(q));if(g(Y,H,e),k.annotationPosition&&Y.node().parentNode&&!a){var Z=l,X=h;if(e.standoff){var W=Math.sqrt(Math.pow(l-f,2)+Math.pow(h-p,2));Z+=e.standoff*(f-l)/W,X+=e.standoff*(p-h)/W}var K,J,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-X),transform:s(Z,X)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);K=t.x,J=t.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(K,J),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",s(t,r)),z.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),D)d.init({element:R.node(),gd:t,prepFn:function(){kt=z.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(a)return;var i,o;if(v)i=y(v,t,"x",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(c+t/T.w,l,0,1,e.xanchor)}if(x)o=y(x,r,"y",T,e);else{var u=e._ysize/T.h,h=e.y-(e._yshift+e.yshift)/T.h-u/2;o=d.align(h-r/T.h,u,0,1,e.yanchor)}S("x",i),S("y",o),v&&x||(n=d.getCursor(v?.5:i,x?.5:o,e.xanchor,e.yanchor))}z.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){p(R),i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=e.indexOf("end")>=0,b=d.backoff*g+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(h=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void D();if(b){if(b*b>w*w+T*T)return void D();var k=b*Math.cos(h),M=b*Math.sin(h);u.x+=k,u.y+=M,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void D();var A=_*Math.cos(h),S=_*Math.sin(h);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),L="";if(E1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":762,"../annotations/draw":513}],520:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var K=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Z*=K*c.roundUp(W/K,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(Y.tick0=0)}Y.dtick=Z}Y.domain=[q+j,q+F-j],Y.setScale(),t.attr("transform",u(Math.round(l.l),Math.round(l.t)));var J,Q=t.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+M.cbaxis),tt=0;function et(n,i){var a={propContainer:Y,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),m.draw(r,n,h(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+N)*l.w,n=Y.title.font.size;t="top"===A?(1-(q+F-j))*l.h+l.t+3+.75*n:(1-(q+j))*l.h+l.t-3-.25*n,et(Y._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var a=t.select("."+M.cbtitle),o=a.select("text"),h=[-e.outlinewidth/2,e.outlinewidth/2],f=a.select(".h"+Y._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),f?(tt=p.bBox(f).height)>d&&(h[1]-=(tt-d)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=p.bBox(o.node()).height),tt){if(tt+=5,"top"===A)Y.domain[1]-=tt/l.h,h[1]*=-1;else{Y.domain[0]+=tt/l.h;var m=g.lineCount(o);h[1]+=(1-m)*d}a.attr("transform",u(h[0],h[1])),Y.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",u(0,Math.round(l.h*(1-Y.domain[1])))),$.attr("transform",u(0,Math.round(-l.t)));var y=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(I);y.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),y.exit().remove();var x=S.map(Y.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var o=[0===a?S[0]:(I[a]+I[a-1])/2,a===I.length-1?S[1]:(I[a]+I[a+1])/2].map(Y.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var s=n.select(this).attr({x:U,width:Math.max(D,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)p.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var b=t.select("."+M.cblines).selectAll("path."+M.cbline).data(v.color&&v.width?z:[]);b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(Y.c2p(t))+v.width/2%1)+"h"+D).call(p.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+Y._id+"tick,path").remove();var _=U+D+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(Y),k=s.getTickSigns(Y)[2];return s.drawTicks(r,Y,{vals:"inside"===Y.ticks?s.clipEnds(Y,T):T,layer:$,path:s.makeTickPath(Y,_,k),transFn:s.makeTransTickFn(Y)}),s.drawLabels(r,Y,{vals:T,layer:$,transFn:s.makeTransTickLabelFn(Y),labelFns:s.makeLabelFns(Y,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=Y.title.font.size,e=Y._offset+Y._length/2,i=l.l+(Y.position||0)*l.w+("right"===Y.side?10+t*(Y.showticklabels?1:.5):-10-t*(Y.showticklabels?.5:0));et("h"+Y._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Y._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=D+e.outlinewidth/2;if(-1===Y.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(J=Q.select("text")).node()&&!J.classed(M.jsPlaceholder)){var i,o=Q.select(".h"+Y._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(Q.node()).right-U-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=H-G;t.select("."+M.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(s,2),height:Math.max(c+2*B,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:U,y:G+e.ypad+("top"===A?tt:0),width:Math.max(D,2),height:Math.max(c-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var h=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",u(l.l-h,l.t));var f={},m=T[e.yanchor],g=k[e.yanchor];"pixels"===e.lenmode?(f.y=e.y,f.t=c*m,f.b=c*g):(f.t=f.b=0,f.yt=e.y+e.len*m,f.yb=e.y-e.len*g);var v=T[e.xanchor],y=k[e.xanchor];if("pixels"===e.thicknessmode)f.x=e.x,f.l=s*v,f.r=s*y;else{var x=s-D;f.l=x*v,f.r=x*y,f.xl=e.x-e.thickness*v,f.xr=e.x+e.thickness*y}a.autoMargin(r,e._id,f)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),f(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var c=l.getCursor(i,a,e.xanchor,e.yanchor);f(t,c)},doneFn:function(){if(f(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":629,"../../lib":661,"../../lib/extend":651,"../../lib/setcursor":681,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../plots/cartesian/axis_defaults":713,"../../plots/cartesian/layout_attributes":726,"../../plots/cartesian/position_defaults":729,"../../plots/plots":774,"../../registry":788,"../color":524,"../colorscale/helpers":535,"../dragelement":543,"../drawing":546,"../titles":622,"./constants":526,"@plotly/d3":54,tinycolor2:471}],529:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":661}],530:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":525,"./defaults":527,"./draw":528,"./has_colorbar":529}],531:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,h=e.editTypeOverride||"",f=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(f+(r={z:"z",c:"color"}[a]));var p=a+"auto",d=a+"min",m=a+"max",g=a+"mid",v=(s(f+p),s(f+d),s(f+m),{});v[d]=v[m]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[d]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":677,"../../lib/sort_object_keys":683,"../colorbar/attributes":525,"./scales.js":539}],532:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,h=a(u),f=!1!==h.auto,p=h.min,d=h.max,m=h.mid,g=function(){return i.aggNums(Math.min,null,l)},v=function(){return i.aggNums(Math.max,null,l)};(void 0===p?p=g():f&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===d?d=v():f&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),f&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}},{"../../lib":661,"./helpers":535,"fast-isnumeric":159}],533:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],541:[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":661}],542:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],543:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");function u(){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 h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,f,p,d,m,g=t.gd,v=1,y=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)y&&(v=Math.max(v-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=h(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":661,"../../plots/cartesian/constants":718,"./align":540,"./cursor":541,"./unhover":544,"has-hover":343,"has-passive-events":344,"mouse-event-offset":364}],544:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":649,"../../lib/events":650,"../../lib/throttle":687,"../fx/constants":558}],545:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],546:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),h=i.strTranslate,f=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,x=e.exports={};x.font=function(t,e,r,n){i.isPlainObject(e)&&(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(c.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",h(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.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||"";c.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(c.fill,e)},x.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(c.fill,t[0].trace.fillcolor)}))};var b=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(t){var e=b[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(t,e){var r=t%100;return x.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(t))t=+t;else 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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=a("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(t,e,r,a,o,l){for(var u=o.length,h=A[a],f=new Array(u),p=0;p"+v(t);d._gradientUrlQueryParts[y]=1},x.pattern=function(t,e,r,a,o,s,l,u,h,f,p,d){var m="legend"===e;u&&("overlay"===h?(f=u,p=c.contrast(f)):(f=void 0,p=u));var g,v,y,x,b,_,w,T,k,M,A,S=r._fullLayout,E="p"+S._uid+"-"+a,L={};switch(o){case"/":g=s*Math.sqrt(2),v=s*Math.sqrt(2),_="path",L={d:y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"\\":g=s*Math.sqrt(2),v=s*Math.sqrt(2),_="path",L={d:y="M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"x":g=s*Math.sqrt(2),v=s*Math.sqrt(2),y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2+"M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,x=s-s*Math.sqrt(1-l),_="path",L={d:y,opacity:d,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",L={d:y="M"+(g=s)/2+",0L"+g/2+","+(v=s),opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"-":_="path",_="path",L={d:y="M0,"+(v=s)/2+"L"+(g=s)+","+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"+":_="path",y="M"+(g=s)/2+",0L"+g/2+","+(v=s)+"M0,"+v/2+"L"+g+","+v/2,x=s-s*Math.sqrt(1-l),_="path",L={d:y,opacity:d,stroke:p,"stroke-width":x+"px"};break;case".":g=s,v=s,l.pattern_filled";S._patternUrlQueryParts[I]=1},x.initGradients=function(t){var e=t._fullLayout;i.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},x.initPatterns=function(t){var e=t._fullLayout;i.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},x.getPatternAttr=function(t,e,r){return t&&i.isArrayOrTypedArray(t)?e=100,e.attr("d",w(u,l))}var h,f,p,d=!1;if(t.so)p=s.outlierwidth,f=s.outliercolor,h=o.outliercolor;else{var m=(s||{}).width;p=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(h=c.defaultLine,d=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,h).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var g=o.gradient,v=t.mgt;v?d=!0:v=g&&g.type,i.isArrayOrTypedArray(v)&&(v=v[0],A[v]||(v=0));var y=o.pattern,b=y&&x.getPatternAttr(y.shape,t.i,"");if(v&&"none"!==v){var _=t.mgc;_?d=!0:_=g.color;var T=r.uid;d&&(T+="-"+t.i),x.gradient(e,a,T,v,[[0,_],[1,h]],"fill")}else if(b){var k=x.getPatternAttr(y.bgcolor,t.i,null),M=x.getPatternAttr(y.fgcolor,t.i,null),S=y.fgopacity,E=x.getPatternAttr(y.size,t.i,8),L=x.getPatternAttr(y.solidity,t.i,.3),C=t.mcc||i.isArrayOrTypedArray(y.shape)||i.isArrayOrTypedArray(y.bgcolor)||i.isArrayOrTypedArray(y.size)||i.isArrayOrTypedArray(y.solidity),P=r.uid;C&&(P+="-"+t.i),x.pattern(e,"point",a,P,b,E,L,t.mcc,y.fillmode,k,M,S)}else c.fill(e,h);p&&c.stroke(e,f)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,h=s.opacity,f=void 0!==u,p=void 0!==h;(i.isArrayOrTypedArray(c)||f||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u:e:p?h:m*e});var d=a.color,g=o.color,v=s.color;(g||v)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:v||e});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",w(x.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,h=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,h,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=L(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,g,v).text(c).call(f.convertToTspans,r).call(E,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);c.fill(i,a),E(i,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,.25),u=Math.pow(s*s+l*l,.25),h=(u*u*a-c*c*s)*i,f=(u*u*o-c*c*l)*i,p=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(p&&h/p),2),n.round(e[1]+(p&&f/p),2)],[n.round(e[0]-(d&&h/d),2),n.round(e[1]-(d&&f/d),2)]]}x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(x.savedBBoxes={},z=0),r&&(x.savedBBoxes[r]=g),z++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",O(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=h(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var R=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(F);t=1===e&&1===r?[]:[h(o,s),"scale("+e+","+r+")",h(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":560,"../../constants/alignment":629,"../../constants/interactions":636,"../../constants/xmlns_namespaces":638,"../../lib":661,"../../lib/svg_text_utils":686,"../../registry":788,"../../traces/scatter/make_bubble_size_func":1081,"../../traces/scatter/subtypes":1089,"../color":524,"../colorscale":536,"./symbol_defs":547,"@plotly/d3":54,"fast-isnumeric":159,tinycolor2:471}],547:[function(t,e,r){"use strict";var n=t("@plotly/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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":54}],548:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],549:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),h=0;h0;e.each((function(e){var h,f=e[0].trace,p=f.error_x||{},d=f.error_y||{};f.ids&&(h=function(t){return t.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,h);if(g.exit().remove(),e.length){p.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var h=d.width;a="M"+(r.x-h)+","+r.yh+"h"+2*h+"m-"+h+",0V"+r.ys,r.noYS||(a+="m-"+h+",0h"+2*h),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var f=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(p.copy_ystyle?d:p).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(s.duration).ease(s.easing)),f.attr("d",a)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":1089,"../drawing":546,"@plotly/d3":54,"fast-isnumeric":159}],554:[function(t,e,r){"use strict";var n=t("@plotly/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":524,"@plotly/d3":54}],555:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":651,"../../plots/font_attributes":740,"./layout_attributes":565}],556:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexb[0]._length||at<0||at>_[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=it+b[0]._offset,e.pointerY=at+_[0]._offset,N="xval"in e?v.flat(s,e.xval):v.p2c(b,it),V="yval"in e?v.flat(s,e.yval):v.p2c(_,at),!i(N[0])||!i(V[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(H=0;H$&&(tt.splice(0,$),ct=tt[0].distance),m&&0!==z&&0===tt.length){Q.distance=z,Q.index=!1;var h=Y._module.hoverPoints(Q,K,J,"closest",{hoverLayer:l._hoverlayer});if(h&&(h=h.filter((function(t){return t.spikeDistance<=z}))),h&&h.length){var f,d=h.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var g=d[0];i(g.x0)&&i(g.y0)&&(f=ft(g),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>f.spikeDistance)&&(rt.vLinePoint=f))}var y=h.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var x=y[0];i(x.x0)&&i(x.y0)&&(f=ft(x),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>f.spikeDistance)&&(rt.hLinePoint=f))}}}}}function ht(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)Ct(tt[At]);tt=St,gt()}var Pt=t._hoverdata,It=[],zt=j(t),Dt=U(t);for(q=0;q1||tt.length>1)||"closest"===S&&nt&&tt.length>1,Zt=p.combine(l.plot_bgcolor||p.background,l.paper_bgcolor),Xt=I(tt,{gd:t,hovermode:S,rotateLabels:Yt,bgColor:Zt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});v.isUnifiedHover(S)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,h=1,f=t.size(),p=new Array(f),d=0;function m(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 c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(h=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?T:1)/2,pmin:0,pmax:i?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||h*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=i;for(g.push.apply(g,v),p.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var _=b[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,Yt?"xa":"ya",l),D(Xt,Yt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Wt=g.getComponentMethod("annotations","hasClickToShow")(t,It);h(n.select(e.target),Wt?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:_,xvals:N,yvals:V})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),h=Math.max(r,n),f=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var v=i._fullLayout[m.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,h+=y,f+=x,d+=x}c.bbox={x0:u+o,x1:h+o,y0:f+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||p.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,h=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{},T=e.fontFamily||y.HOVERFONT,k=e.fontSize||y.HOVERFONTSIZE,M=t[0],E=M.xa,L=M.ya,P=a.charAt(0),I=M[P+"Label"],D=V(r,m),O=D.top,R=D.width,F=D.height,N=void 0!==I&&M.distance<=e.hoverdistance&&("x"===a||"y"===a);if(N){var B,j,U=!0;for(B=0;Bi.width-b?(g=i.width-b,e.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*S+y.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):e.attr("d","M0,0L"+A+","+x+A+"H"+(S+y.width/2)+"v"+x+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,C,P;"right"===L.side?(_="start",C=1,P="",g=E._offset+E._length):(_="end",C=-1,P="-",g=E._offset),v=L._offset+(M.y0+M.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+P+A+","+A+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+A+"V-"+A+"Z");var z,D=y.height/2,R=O-y.top-D,F="clip"+i._uid+"commonlabel"+L._id;if(g=0?it:at+lt=0?at:gt+lt=0?rt:nt+ct=0?nt:vt+ct=0,"top"!==t.idealAlign&&G||!Y?G?(D+=j/2,t.anchor="start"):t.anchor="middle":(D-=j/2,t.anchor="end");else if(t.pos=D,G=P+B/2+Z<=R,Y=P-B/2-Z>=0,"left"!==t.idealAlign&&G||!Y)if(G)P+=B/2,t.anchor="start";else{t.anchor="middle";var X=Z/2,W=P+X-R,K=P-X;W>0&&(P-=W),K<0&&(P+=-K)}else P-=B/2,t.anchor="end";w.attr("text-anchor",t.anchor),E&&M.attr("text-anchor",t.anchor),e.attr("transform",s(P,D)+(c?l(_):""))})),yt}function z(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=N(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var h=t.hovertemplate||!1;if(h){var f=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),l=(l=o.hovertemplateString(h,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=N(r,t.nameLength),""}))}return[l,s]}function D(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],h=c*(A+S),p=h+c*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(h-=t.tx2width/2,p+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*A+d)+"V"+o(m-A)+"Z");var v=d+h,y=m+t.ty0-t.by/2+S,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==s?(i.attr("text-anchor","start"),v=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===x&&"end"!==s&&(i.attr("text-anchor","end"),v=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(v),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(p+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(f.setRect,a(p+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function O(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,h=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),h||u){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(g=c.pointerX,v=c.pointerY):(g=n._offset+y.x,v=i._offset+y.y);var x,b,_=a.readability(y.color,d)<1.5?p.contrast(d):y.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||_,M=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=g),-1!==w.indexOf("across")){var A=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(A=Math.min(A,i.position),S=Math.max(S,i.position)),x=l.l+A*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":f.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==i.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(h){var E,L,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(E=c.pointerX,L=c.pointerY):(E=n._offset+C.x,L=i._offset+C.y);var P,I,z=a.readability(C.color,d)<1.5?p.contrast(d):C.color,D=n.spikemode,O=n.spikethickness,R=n.spikecolor||z,F=m.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(P=F,I=L),-1!==D.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),P=l.t+(1-B)*l.h,I=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":O,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function N(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),h=c[0],f=c[1],p=u[0],d=u[1];return{x:h,y:f,width:p-h,height:d-f,top:Math.min(f,d),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(f,d)}}},{"../../lib":661,"../../lib/events":650,"../../lib/override_cursor":672,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"../legend/defaults":576,"../legend/draw":577,"./constants":558,"./helpers":560,"@plotly/d3":54,"fast-isnumeric":159,tinycolor2:471}],562:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":661,"../color":524,"./helpers":560}],563:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":661,"./layout_attributes":565}],564:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":661,"../dragelement":543,"./attributes":555,"./calc":556,"./click":557,"./constants":558,"./defaults":559,"./helpers":560,"./hover":561,"./layout_attributes":565,"./layout_defaults":566,"./layout_global_defaults":567,"@plotly/d3":54}],565:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":740,"./constants":558}],566:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":661,"./hoverlabel_defaults":562,"./hovermode_defaults":563,"./layout_attributes":565}],567:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":661,"./hoverlabel_defaults":562,"./layout_attributes":565}],568:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),h=u*(1-o),f=0;f1){if(!f&&!p&&!d)"independent"===k("pattern")&&(f=!0);g._hasSubplotGrid=f;var x,b,_="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=f.subplots||[];l=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var g=a.newContainer(e,"legend");if(T("uirevision",e.uirevision),!1!==m){T("bgcolor",e.paper_bgcolor),T("bordercolor"),T("borderwidth");var v,y,x,b=i.coerceFont(T,"font",e.font),_="h"===T("orientation");if(_?(v=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),T("traceorder",f),l.isGrouped(e.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",v),T("xanchor"),T("y",y),T("yanchor",x),T("valign"),i.noneOrAll(c,g,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=i.extendFlat({},b,{size:i.bigFont(b.size)});i.coerceFont(T,"title.font",w)}}}function T(t,e){return i.coerce(c,g,o,t,e)}}},{"../../lib":661,"../../plot_api/plot_template":700,"../../plots/layout_attributes":765,"../../registry":788,"./attributes":574,"./helpers":580}],577:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),h=t("../../lib/svg_text_utils"),f=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&f(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&f(r,t,n)}}function w(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),f=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,a).text(f?T(n,d):n);var g=r.itemwidth+2*p.itemGap;h.positionText(m,g,0),f?m.call(h.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(M,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),h=u[u.length-1],f=i.keyedContainer(a,"transforms["+h+"].styles","target","value.name");f.set(s.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function M(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),h.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,f,d=s.size*m;if(o){var g=c.bBox(o);u=g.height,f=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var v=t.select(1===n?".legendtitletext":".legendtext"),y=h.lineCount(v),x=v.node();if(u=d*y,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),h.positionText(v,l+p.titlePad,l+d);else{var b=2*p.itemGap+r.itemwidth;i.groupTitle&&(b=p.itemGap,f-=r.itemwidth),h.positionText(v,b,-d*((y-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=f)}(e,r,n,i)}))}function A(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,h=t._fullLayout,f="legend"+h._uid,d=e._inHover;d?(r=e.layer,f+="-hover"):r=h._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=h.showlegend&&y(t.calcdata,e)}var m=h.hiddenlabels||[];if(!(d||h.showlegend&&s.length))return r.selectAll(".legend").remove(),h._topdefs.select("#"+f).remove(),a.autoMargin(t,"legend");var T=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),E=i.ensureSingleById(h._topdefs,"clipPath",f,(function(t){t.append("rect")})),L=i.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=i.ensureSingle(T,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var I=i.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),M(I,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var z=i.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),D=C.selectAll("g.groups").data(s);D.enter().append("g").attr("class","groups"),D.exit().remove();var O=D.selectAll("g.traces").data(i.identity);O.enter().append("g").attr("class","traces"),O.exit().remove(),O.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){d||n.select(this).call(k,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=b.isVertical(i),l=b.isGrouped(i),u=i.borderwidth,h=2*u,f=p.itemGap,d=i.itemwidth+2*f,m=2*(u+f),g=S(i),v=i.y<0||0===i.y&&"top"===g,y=i.y>1||1===i.y&&"bottom"===g,x=i.tracegroupgap;i._maxHeight=Math.max(v||y?a.height/2:o.h,30);var _=0;i._width=0,i._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+w[0],u+w[1]+i._height+e/2+f),i._height+=e,i._width=Math.max(i._width,t[0].width)})),_=d+i._width,i._width+=f+d+h,i._height+=m,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var T=A(i),k=i.x<0||0===i.x&&"right"===T,M=i.x>1||1===i.x&&"left"===T,E=y||v,L=a.width/2;i._maxWidth=Math.max(k?E&&"left"===T?o.l+o.w:L:M?E&&"right"===T?o.r+o.w:L:o.w,2*d);var C=0,P=0;r.each((function(t){var e=t[0].width+d;C=Math.max(C,e),P+=e})),_=null;var I=0;if(l){var z=0,D=0,O=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+f+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),z=Math.max(z,e);var r=t+f;r+u+D>i._maxWidth&&(I=Math.max(I,D),D=0,O+=z+x,z=e),c.setTranslate(this,D,O),D+=r})),i._width=Math.max(I,D)+u,i._height=O+z+m}else{var R=r.size(),F=P+h+(R-1)*f=i._maxWidth&&(I=Math.max(I,U),B=0,j+=N,i._height+=N,N=0),c.setTranslate(this,w[0]+u+B,w[1]+u+j+e/2+f),U=B+r+f,B+=n,N=Math.max(N,e)})),F?(i._width=B+h,i._height=N+m):(i._width=Math.max(I,U)+h,i._height+=N+m)}}i._width=Math.ceil(Math.max(i._width+w[0],i._titleWidth+2*(u+p.titlePad))),i._height=Math.ceil(Math.max(i._height+w[1],i._titleHeight+2*(u+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var V=t._context.edits,q=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=q?d:_||d+t[0].width;s||(i+=f/2),c.setRect(e,0,-r/2,i,r)}))}(t,D,O,e)},function(){if(d||!function(t){var e=t._fullLayout.legend,r=A(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*g[n]})}(t)){var s,u,m,y,x=h._size,b=e.borderwidth,w=x.l+x.w*e.x-g[A(e)]*e._width,k=x.t+x.h*(1-e.y)-g[S(e)]*e._effHeight;if(!d&&h.margin.autoexpand){var M=w,P=k;w=i.constrain(w,0,h.width-e._width),k=i.constrain(k,0,h.height-e._effHeight),w!==M&&i.log("Constrain legend.x to make legend fit inside graph"),k!==P&&i.log("Constrain legend.y to make legend fit inside graph")}if(d||c.setTranslate(T,w,k),z.on(".drag",null),T.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;d&&(I=e._height),L.attr({width:e._width-b,height:I-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),E.select("rect").attr({width:e._width-2*b,height:I-2*b,x:b,y:b}),c.setClipUrl(C,f,t),c.setRect(z,0,0,0,0),delete e._scrollY}else{var D,O,R,F=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),N=e._effHeight-F-2*p.scrollBarMargin,B=e._height-e._effHeight,j=N/B,U=Math.min(e._scrollY||0,B);L.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),E.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+U}),c.setClipUrl(C,f,t),H(U,F,j),T.on("wheel",(function(){H(U=i.constrain(e._scrollY+n.event.deltaY/N*B,0,B),F,j),0!==U&&U!==B&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;D="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,B)}(R,D,O),F,j))}));z.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(D=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,H(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,B)}(R,D,O),F,j))}));C.call(q)}if(t._context.edits.legendPosition)T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=c.getTranslate(T);m=t.x,y=t.y},moveFn:function(t,r){var n=m+t,i=y+r;c.setTranslate(T,n,i),s=l.align(n,0,x.l,x.l+x.w,e.xanchor),u=l.align(i,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&_(t,T,i,e,n)}})}function H(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(z,e._width,p.scrollBarMargin+r*i,p.scrollBarWidth,n),E.select("rect").attr("y",b+r)}}],t)}(t,e)}},{"../../constants/alignment":629,"../../lib":661,"../../lib/events":650,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../../registry":788,"../color":524,"../dragelement":543,"../drawing":546,"./constants":575,"./get_legend_data":578,"./handle_click":579,"./helpers":580,"./style":582,"@plotly/d3":54}],578:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],h=!1,f={},p=0,d=0;function m(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),h=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var v=e._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function T(t,a,o){var u=t[0].trace,h=u.marker||{},f=h.line||{},p=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,h.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var d=c(h),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),p=s.tryColorscale(h,"")(m)}var v=p||a.mc||h.color,y=h.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,k=g(y.size,8,10),M=g(y.solidity,.5,1),A="legend-"+u.uid;i.call(s.pattern,"legend",e,A,x,k,M,p,y.fillmode,b,_,T)}else i.call(l.fill,v);o&&l.stroke(i,a.mlc||f.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=u.color;var m=a.minExtend(o,{trace:d});h(c,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var h=i.selectAll("g.legendsymbols").data([t]);h.enter().append("g").classed("legendsymbols",!0),h.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,h=n.select(this),f=c(i),p=f.colorscale,m=f.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(v)?v[o]||v[0]:v}h.attr("d",t[0]),u?h.call(l.fill,u):h.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=m(t),l=o.showFill,h=o.showLine,f=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,v=o.anyLine,y=t[0],b=y.trace,_=c(b),T=_.colorscale,k=_.reversescale,M=u.hasMarkers(b)||!g?"M5,0":v?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||p?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+x+"v6h-"+x+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+b.uid;s.gradient(t,e,r,d(k),T,"fill")}}),h||f){var E=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:E}}),r=[a.minExtend(y,{trace:i})]}var L=A.select(".legendlines").selectAll("path").data(h||f?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(f?"l"+x+",0.0001":"h"+x)).call(h?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,h=o.showLine,f=o.showMarker,p=t[0],d=p.trace,g=!f&&!c&&!l&&u.hasText(d);function v(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(f||g||h){var b={},w={};if(f){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",a.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",a.mean,[2,16],12);b.ms=T,w.marker.size=T}h&&(w.line={width:v("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(f?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),M.exit().remove(),M.call(s.pointStyle,i,e),f&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(g?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":661,"../../registry":788,"../../traces/pie/helpers":1043,"../../traces/pie/style_one":1049,"../../traces/scatter/subtypes":1089,"../color":524,"../colorscale/helpers":535,"../drawing":546,"./constants":575,"@plotly/d3":54}],583:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":585}],584:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function h(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=a.list(t,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(P=["toggleHover"],I=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):g?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,h,f=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=h)));return p>=f?[f,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=h,E="y0",M=y,L="y1"):(k=y,E="y1",M=h,L="y0");W(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===z?K:J,X.altKey=n.altKey},doneFn:function(){if(v(t))return;p(e),$(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function W(r){if(v(t))z=null;else if(R)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?f.getCursor(o/i,1-s/a):"move";p(e,l),z=l.split("-")[0]}}function K(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;D?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(q(t)+n)},B&&"date"===B.type&&(o=m.encodeDate(o))),O?N("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(H(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),N("path",r.path=w(I,o,l))}else D?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(g+n))),O?N("yanchor",r.yanchor=Y(T+i)):(N("y0",r.y0=Y(h+i)),N("y1",r.y1=Y(y+i)));e.attr("d",_(t,r)),Q(s,r)}function J(n,i){if(F){var a=function(t){return t},o=a,l=a;D?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(q(t)+n)},B&&"date"===B.type&&(o=m.encodeDate(o))),O?N("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(H(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),N("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===z){var u=c+n,f=O?h-i:h+i;N("x0",r.x0=D?u:G(u)),N("y0",r.y0=O?f:Y(f))}else if("resize-over-end-point"===z){var p=g+n,d=O?y-i:y+i;N("x1",r.x1=D?p:G(p)),N("y1",r.y1=O?d:Y(d))}}else{var v=function(t){return-1!==z.indexOf(t)},b=v("n"),j=v("s"),V=v("w"),Z=v("e"),X=b?k+i:k,W=j?M+i:M,K=V?A+n:A,J=Z?S+n:S;O&&(b&&(X=k-i),j&&(W=M-i)),(!O&&W-X>10||O&&X-W>10)&&(N(E,r[E]=O?X:Y(X)),N(L,r[L]=O?W:Y(W))),J-K>10&&(N(C,r[C]=D?K:G(K)),N(P,r[P]=D?J:G(J)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(D||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=q(D?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=H(O?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),D&&O){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(D){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}f.init(X),Z.node().onmousemove=W}(t,D,l,e,r,z):!0===l.editable&&D.style("pointer-events",P||c.opacity(S)*A<=.5?"stroke":"all");D.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,g(t)}}(t,D)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,c,u,h,f=e.type,p=a.getRefType(e.xref),g=a.getRefType(e.yref),v=a.getFromId(t,e.xref),y=a.getFromId(t,e.yref),x=t._fullLayout._size;if(v?"domain"===p?n=function(t){return v._offset+v._length*t}:(r=m.shapePositionToRange(v),n=function(t){return v._offset+v.r2p(r(t,!0))}):n=function(t){return x.l+x.w*t},y?"domain"===g?s=function(t){return y._offset+y._length*(1-t)}:(o=m.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return x.t+x.h*(1-t)},"path"===f)return v&&"date"===v.type&&(n=m.decodeDate(n)),y&&"date"===y.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,c=t.charAt(0),u=d.paramIsX[c],h=d.paramIsY[c],f=d.numParams[c],p=t.substr(1).replace(d.paramRE,(function(t){return u[n]?t="pixel"===a?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>f&&(t="X"),t}));return n>f&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,s);if("pixel"===e.xsizemode){var b=n(e.xanchor);l=b+e.x0,c=b+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);u=_-e.y0,h=_-e.y1}else u=s(e.y0),h=s(e.y1);if("line"===f)return"M"+l+","+u+"L"+c+","+h;if("rect"===f)return"M"+l+","+u+"H"+c+"V"+h+"H"+l+"Z";var w=(l+c)/2,T=(u+h)/2,k=Math.abs(w-l),M=Math.abs(T-u),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,g(t)))}e.exports={draw:g,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&h(v),r.attr("d",m(e)),M&&!f)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,y(),x())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*h.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+h.stepInset+(r.inputAreaLength-2*h.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-h.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*h.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",h.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,h.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*h.railInset,i=s.ensureSingle(t,"rect",h.railRectClass);i.attr({width:n,height:h.railWidth,rx:h.railRadius,ry:h.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,h.railInset,.5*(r.inputAreaWidth-h.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[h.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(h.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+h.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+h.groupClassName).data(r,v);l.enter().append("g").classed(h.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||f<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform",l(v[0],v[1]))}}}return O.call(R),z&&(E?O.on(".opacity",null):(M=0,A=!0,O.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),O.call(h.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,v,e,x):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(h.positionText,_.x,_.y)}))),O.classed("js-placeholder",A),T}}},{"../../constants/alignment":629,"../../constants/interactions":636,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../../registry":788,"../color":524,"../drawing":546,"@plotly/d3":54,"fast-isnumeric":159}],623:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:c,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(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../plots/font_attributes":740,"../../plots/pad_attributes":773,"../color/attributes":523}],624:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],625:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":661,"../../plots/array_container_defaults":706,"./attributes":623,"./constants":624}],626:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,h=t("./constants"),f=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(h.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,h.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(h.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||v(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",h.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||h.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(A,i,f,p),s.ensureSingle(e,"text",h.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(h.arrowSymbol[i.direction])})).attr({x:l.headerWidth-h.arrowOffsetX+i.pad.l,y:l.headerHeight/2+h.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),v(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(h.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?h.dropdownButtonClassName:h.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,g=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=v.headerHeight+h.gapButtonHeader:d=v.headerWidth+h.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-h.gapButtonHeader+h.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-h.gapButtonHeader+h.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+g+o.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,f=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+h.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+h.headerGroupClassName).data(r,p);l.enter().append("g").classed(h.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",h.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,E=g+v;E+A>c&&(E=c-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,z=d+m,D=g;z+P>l&&(z=l-P);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:z,y:D,width:P,height:I}),this._vbarYMin=D+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,N=C?h+P+.5:h+.5,B=f-.5,j=k?p+A+.5:p+.5,U=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.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(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":661,"../color":524,"../drawing":546,"@plotly/d3":54}],629:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],630:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],631:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],632:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],633:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],634:[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]}},{}],635:[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"}},{}],636:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],637:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],638:[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}},{}],639:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],641:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],642:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function h(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,h,f,p,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,h=o,f=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return h(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return h(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return h(t,e,r,n,i,a,1)}}},{"./mod":668}],643:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&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)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(h(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),L=Number(T[11]||0);if(c){if(2===k.length)return u;var C;k=Number(k);try{var P=g.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===M.charAt(M.length-1);M=parseInt(M,10),C=P.newDate(k,P.toMonthIndex(k,M,I),A)}else C=P.newDate(k,Number(M),A)}catch(t){return u}return C?(C.toJD()-m)*h+S*f+E*p+L*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var z=new Date(Date.UTC(2e3,M,A,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==M||z.getUTCDate()!==A?u:z.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*h,k=3*f,M=5*p;function A(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/h)+m,E=Math.floor(l(t,h));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=v("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+h&&t<=i-h))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return A(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return L[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/f),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var I=3*h;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var i=Math.round(t/h)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*h+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+I);return c.setUTCMonth(c.getUTCMonth()+e)+n-I},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=f.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(f.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,h=n-e,f=o-i,p=c-a,d=u*u+h*h,m=f*f+p*p,g=Math.min(l(u,h,d,i-t,a-e),l(u,h,d,o-t,c-e),l(f,p,m,t-i,e-a),l(f,p,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(o(r,e)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=i:f=i,h++}return a}},{"./mod":668}],657:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return c;var e=a(t);return e.length?e:c}function f(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,p,d,m=t.color,g=l(m),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):h,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:h,s=v?function(t,e){return void 0===t[e]?1:f(t[e])}:f,g||v)for(var b=0;b1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],661:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,h=e.exports={};h.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var f={};h.warnBadFormat=function(t){var e=String(t);f[e]||(f[e]=1,h.warn('encountered bad format: "'+e+'"'))},h.noFormat=function(t){return String(t)},h.numberFormat=function(t){var e;try{e=a(h.adjustFormat(t))}catch(e){return h.warnBadFormat(t),h.noFormat}return e},h.nestedProperty=t("./nested_property"),h.keyedContainer=t("./keyed_container"),h.relativeAttr=t("./relative_attr"),h.isPlainObject=t("./is_plain_object"),h.toLogRange=t("./to_log_range"),h.relinkPrivateKeys=t("./relink_private");var p=t("./array");h.isTypedArray=p.isTypedArray,h.isArrayOrTypedArray=p.isArrayOrTypedArray,h.isArray1D=p.isArray1D,h.ensureArray=p.ensureArray,h.concat=p.concat,h.maxRowLength=p.maxRowLength,h.minRowLength=p.minRowLength;var d=t("./mod");h.mod=d.mod,h.modHalf=d.modHalf;var m=t("./coerce");h.valObjectMeta=m.valObjectMeta,h.coerce=m.coerce,h.coerce2=m.coerce2,h.coerceFont=m.coerceFont,h.coercePattern=m.coercePattern,h.coerceHoverinfo=m.coerceHoverinfo,h.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,h.validate=m.validate;var g=t("./dates");h.dateTime2ms=g.dateTime2ms,h.isDateTime=g.isDateTime,h.ms2DateTime=g.ms2DateTime,h.ms2DateTimeLocal=g.ms2DateTimeLocal,h.cleanDate=g.cleanDate,h.isJSDate=g.isJSDate,h.formatDate=g.formatDate,h.incrementMonth=g.incrementMonth,h.dateTick0=g.dateTick0,h.dfltRange=g.dfltRange,h.findExactDates=g.findExactDates,h.MIN_MS=g.MIN_MS,h.MAX_MS=g.MAX_MS;var v=t("./search");h.findBin=v.findBin,h.sorterAsc=v.sorterAsc,h.sorterDes=v.sorterDes,h.distinctVals=v.distinctVals,h.roundUp=v.roundUp,h.sort=v.sort,h.findIndexOfMin=v.findIndexOfMin,h.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");h.aggNums=y.aggNums,h.len=y.len,h.mean=y.mean,h.median=y.median,h.midRange=y.midRange,h.variance=y.variance,h.stdev=y.stdev,h.interp=y.interp;var x=t("./matrix");h.init2dArray=x.init2dArray,h.transposeRagged=x.transposeRagged,h.dot=x.dot,h.translationMatrix=x.translationMatrix,h.rotationMatrix=x.rotationMatrix,h.rotationXYMatrix=x.rotationXYMatrix,h.apply3DTransform=x.apply3DTransform,h.apply2DTransform=x.apply2DTransform,h.apply2DTransform2=x.apply2DTransform2,h.convertCssMatrix=x.convertCssMatrix,h.inverseTransformMatrix=x.inverseTransformMatrix;var b=t("./angles");h.deg2rad=b.deg2rad,h.rad2deg=b.rad2deg,h.angleDelta=b.angleDelta,h.angleDist=b.angleDist,h.isFullCircle=b.isFullCircle,h.isAngleInsideSector=b.isAngleInsideSector,h.isPtInsideSector=b.isPtInsideSector,h.pathArc=b.pathArc,h.pathSector=b.pathSector,h.pathAnnulus=b.pathAnnulus;var _=t("./anchor_utils");h.isLeftAnchor=_.isLeftAnchor,h.isCenterAnchor=_.isCenterAnchor,h.isRightAnchor=_.isRightAnchor,h.isTopAnchor=_.isTopAnchor,h.isMiddleAnchor=_.isMiddleAnchor,h.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");h.segmentsIntersect=w.segmentsIntersect,h.segmentDistance=w.segmentDistance,h.getTextLocation=w.getTextLocation,h.clearLocationCache=w.clearLocationCache,h.getVisibleSegment=w.getVisibleSegment,h.findPointOnPath=w.findPointOnPath;var T=t("./extend");h.extendFlat=T.extendFlat,h.extendDeep=T.extendDeep,h.extendDeepAll=T.extendDeepAll,h.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");h.log=k.log,h.warn=k.warn,h.error=k.error;var M=t("./regex");h.counterRegex=M.counter;var A=t("./throttle");h.throttle=A.throttle,h.throttleDone=A.done,h.clearThrottle=A.clear;var S=t("./dom");function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},h.noop=t("./noop"),h.identity=t("./identity"),h.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},h.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},h.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(h.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},h.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},h.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},h.syncOrAsync=function(t,e,r){var n;function i(){return h.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},h.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},h.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},h.fillArray=function(t,e,r,n){if(n=n||h.identity,h.isArrayOrTypedArray(t))for(var i=0;i1?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},h.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var D=/^\w*$/;h.templateString=function(t,e){var r={};return t.replace(h.TEMPLATE_STRING_REGEX,(function(t,n){var i;return D.test(n)?i=e[n]:(r[n]=r[n]||h.nestedProperty(e,n).get,i=r[n]()),h.isValidTextValue(i)?i:""}))};var O={max:10,count:0,name:"hovertemplate"};h.hovertemplateString=function(){return N.apply(O,arguments)};var R={max:10,count:0,name:"texttemplate"};h.texttemplateString=function(){return N.apply(R,arguments)};var F=/^[:|\|]/;function N(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(h.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,f,p="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||p||m||d,v=s;if((p||d)&&(v=v.substring(1)),(m||d)&&(v=v.substring(0,v.length-1)),g){if(void 0===(c=e[v]))return""}else for(f=3;f=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var B=2e9;h.seedPseudoRandom=function(){B=2e9},h.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?h.pseudoRandom():B/4294967296},h.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=h.extractOption(t,e,"htx","hovertext");if(h.isValidTextValue(i))return n(i);var a=h.extractOption(t,e,"tx","text");return h.isValidTextValue(a)?n(a):void 0},h.isValidTextValue=function(t){return t||0===t},h.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,h.strTranslate(i-c*(r+o),a-c*(n+s))+h.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},h.ensureUniformFontSize=function(t,e){var r=h.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},h.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},h.bigFont=function(t){return Math.round(1.2*t)};var j=h.getFirefoxVersion(),U=null!==j&&j<86;h.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":637,"./anchor_utils":641,"./angles":642,"./array":643,"./clean_number":644,"./clear_responsive":646,"./coerce":647,"./dates":648,"./dom":649,"./extend":651,"./filter_unique":652,"./filter_visible":653,"./geometry2d":656,"./identity":659,"./increment":660,"./is_plain_object":662,"./keyed_container":663,"./localize":664,"./loggers":665,"./make_trace_groups":666,"./matrix":667,"./mod":668,"./nested_property":669,"./noop":670,"./notifier":671,"./preserve_drawing_buffer":674,"./push_unique":675,"./regex":677,"./relative_attr":678,"./relink_private":679,"./search":680,"./sort_object_keys":683,"./stats":684,"./throttle":687,"./to_log_range":688,"@plotly/d3":54,"d3-format":139,"d3-time-format":147,"fast-isnumeric":159}],662:[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).hasOwnProperty("hasOwnProperty")}},{}],663:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":698,"./notifier":671}],666:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":54}],667:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],669:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,h,f,p,d,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(h,g)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":637,"./matrix":667}],674:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":159,"is-mobile":352}],675:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,h=0,f=e.length,p=0,d=f>1?(e[f-1]-e[0])/(f-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);h90&&i.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,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],h=u-i;void 0===i?(l.push(u),i=u):h>s&&(a=Math.min(a,h),l.push(u),i=u)}return{vals:l,minDiff:a}},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,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":643,"fast-isnumeric":159}],685:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":118}],686:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(h,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,i,o){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return I(),void e();var c=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",h=s.select("g");h.attr({fill:u,stroke:u});var f=l(h,"width"),p=l(h,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],g=-(r||l(t,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+a(-f/2,g-p/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:g-p/2}):"a"===P[0]&&0!==P.indexOf("atitle")?s.attr({x:0,y:g}):s.attr({x:d,y:+t.attr("y")+g-p/2}),m&&m.call(t,c),e(c)}))}))):I(),t}function I(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(v),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],688:[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":159}],689:[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":742,"topojson-client":473}],690:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],691:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],692:[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;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,h=(s.subplotsRegistry.ternary||{}).attrRegex,f=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(g,v),p(t),!0)}var x,b,_,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),E=e.get(),L=E||[],C=u(v,h).get(),P=[],I=-1,z=L.length;for(x=0;xL.length-(M?0:1))a.warn("index out of range",h,_);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?P.push(_):M?("add"===k&&(k={}),L.splice(_,0,k),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",h,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)L.splice(P[x],1),C&&C.splice(P[x],1);if(L.length?E||e.set(L):e.set(null),m)return!1;if(f(g,v),d!==i){var D;if(-1===I)D=S;else{for(z=Math.max(L.length,z),D=[],x=0;x=I);x++)D.push(_);for(x=I;x=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 I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function z(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),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")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,h,f=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Z(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[f.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,a,i)||f.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&q(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(f.rehover,f.redrag),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[p.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=p.getFromId(t,i);if(r.push(i),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,f=F(l._preGUI,c),d=Object.keys(e),m=p.list(t),g=o.extendDeepAll({},e),v={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof z.parts[O];)O--;var N=z.parts[O],B=z.parts[O-1]+"."+N,U=z.parts.slice(0,O).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),Z=z.get();if(void 0!==D){A[I]=D,S[I]="reverse"===N?D:R(Z);var W=h.getLayoutValObject(l,z.parts);if(W&&W.impliedEdits&&null!==D)for(var K in W.impliedEdits)E(o.relativeAttr(I,K),W.impliedEdits[K]);if(-1!==["width","height"].indexOf(I))if(D){E("autosize",null);var J="height"===I?"width":"height";E(J,l[J])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",D?null:l.width),E("height",D?null:l.height);else if(B.match(H))P(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){P(B),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===N){L=V;var $="linear"===q.type&&"log"===D,tt="log"===q.type&&"linear"===D;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&E(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(U+".range[0]",Math.log(et)/Math.LN10),E(U+".range[1]",Math.log(rt)/Math.LN10)):(E(U+".range[0]",Math.pow(10,et)),E(U+".range[1]",Math.pow(10,rt)))}else E(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete l[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,D,E),u.getComponentMethod("images","convertCoords")(t,q,D,E)}else E(U+".autorange",!0),E(U+".range",null);s(l,U+"._inputRange").set(null)}else if(N.match(k)){var nt=s(l,I).get(),it=(D||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,E),u.getComponentMethod("images","convertCoords")(t,nt,it,E)}var at=b.containerArrayMatch(I);if(at){r=at.array,n=at.index;var ot=at.property,st=W||{editType:"calc"};""!==n&&""===ot&&(b.isAddVal(D)?S[I]=null:b.isRemoveVal(D)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),v[r]||(v[r]={});var lt=v[r][n];lt||(lt=v[r][n]={}),lt[ot]=D,delete e[I]}else"reverse"===N?(V.range?V.range.reverse():(E(U+".autorange",!0),V.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===D||"select"===D)&&"lasso"!==Z&&"select"!==Z||l._has("gl2d")?M.plot=!0:W?T.update(M,W):M.calc=!0,z.set(D))}}for(r in v){b.applyContainerArrayChanges(t,f(a,r),v[r],M,f)||(M.plot=!0)}for(var ct in C){var ut=(L=p.getFromId(t,ct))&&L._constraintGroup;if(ut)for(var ht in M.calc=!0,ut)C[ht]||(p.getFromId(t,ht)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:C,undoit:S,redoit:A,eventData:g}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&f.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function W(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=B(t,o.extendFlat({},e),a),l=s.flags,u=Z(t,o.extendFlat({},n)),h=u.flags;(l.calc||h.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var p=[];h.layoutReplot?p.push(w.layoutReplot):l.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),V(t,h,u)||f.supplyDefaults(t),l.style&&p.push(w.doTraceStyle),(l.colorbars||h.colorbars)&&p.push(w.doColorBars),h.legend&&p.push(w.doLegend),h.layoutstyle&&p.push(w.layoutStyles),h.axrange&&q(p,u.rangesAltered),h.ticks&&p.push(w.doTicksRelayout),h.modebar&&p.push(w.doModeBar),h.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag),c.add(t,W,[t,s.undoit,u.undoit,s.traces],W,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(p,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function K(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var J=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,u){function h(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,f.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&h()};e()}var d,m,g=0;function v(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);y=M}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,v=e[n].name,y=u[g]||d[g];g&&v&&"number"==typeof v&&y&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=f.modifyFrames,u=f.modifyFrames,h=[t,s],p=[t,a];return c&&c.add(t,l,h,u,p),f.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,h=t,f=[e,l],p=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function x(){var t,e,r={};for(t in h(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return v(i,e,s)},r.getLayoutValObject=function(t,e){return v(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function h(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:h,applyUpdate:function(e,r){e&&u(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":661,"../plots/attributes":707}],701:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),h=t("../components/modebar"),f=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function x(t){var e,i,s,u,d,m,g=t._fullLayout,v=g._size,x=v.p,_=f.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),h.manage(t),!g._has("cartesian"))return a.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],S=[],E=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var L=s.xaxis.domain,C=s.yaxis.domain,P=s.plotgroup;if(y(L,C,S)){var I=P.node(),z=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(z.node(),I.childNodes[0]),A.push(i)}else P.select("rect.bg").remove(),S.push([L,C]),E||(M.push(i),A.push(i))}var D,O,R,F,N,B,j,U,V,q,H,G,Y,Z=g._bgLayer.selectAll(".bg").data(M);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":661,"../plots/attributes":707,"../plots/plots":774,"./plot_config":698,"./plot_schema":699,"./plot_template":700}],703:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../version").version,h={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,f,p,d;function m(t){return!(t in e)||o.validate(e[t],h[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),f=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(h.format.values,", "," or ")+".");var g={};function v(t,r){return o.coerce(e,g,h,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},f);x?M.width=x:null===e.width&&n(d.width)&&(M.width=d.width),b?M.height=b:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,h=k._fullLayout.height;function f(){i.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=a.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),t(T?p:s.encodeJSON(p))}if(f(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:h,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,M,A).then(S).then(E).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":661,"../plots/plots":774,"../snapshot/helpers":792,"../snapshot/svgtoimg":794,"../snapshot/tosvg":796,"../version":1219,"./plot_api":697,"fast-isnumeric":159}],704:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var h=Object.keys(t),f=0;fx.length&&i.push(d("unused",a,v.concat(x.length)));var M,A,S,E,L,C=x.length,P=Array.isArray(k);if(P&&(C=Math.min(C,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&i.push(d("unused",a,v.concat(A,x[A].length)));var I=x[A].length;for(M=0;M<(P?Math.min(I,k[A].length):I);M++)S=P?k[A][M]:k,E=y[A][M],L=x[A][M],n.validate(E,S)?L!==E&&L!==+E&&i.push(d("dynamic",a,v.concat(A,M),E,L)):i.push(d("value",a,v.concat(A,M),E))}else i.push(d("array",a,v.concat(A),y[A]));else for(A=0;A1&&p.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,v=r.length,y=0;y0&&Math.round(h)===h))return{vals:i};c=h}for(var f=e.calendar,p="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,f)||0,v=[],y=[],x=[],b=i.length,_=0;_M;)k=o(k,-c,f);for(;k<=M;)k=o(k,c,f);T=o(k,-c,f)}else{for(k=g+(w=Math.round((M-g)/u))*u;k>M;)k-=u;for(;k<=M;)k+=u;T=k-u}v[_]=p?T:d?k:(T+k)/2,y[_]=T,x[_]=k}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":637,"../../lib":661,"fast-isnumeric":159}],709:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],710:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,h=c.isLinked;function f(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return a.simpleMap(e.range,e.r2l);var f=u[0].val,g=h[0].val;for(r=1;r0&&((T=E-s(x)-l(b))>L?k/T>C&&(_=x,w=b,C=k/T):k/E>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=k/E));if(f===g){var P=f-1,I=f+1;if(A)if(0===f)i=[0,1];else{var z=(f>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),D=f/(1-Math.min(.5,z/E));i=f>0?[0,D]:[D,0]}else i=S?[Math.max(0,P),Math.max(1,I)]:[P,I]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(e,x.val,b.val))/(E-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return v&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=a),a>p&&a-o&&(f=a),a>p&&a=I;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],h=[];function f(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":546,"../../constants/numerical":637,"../../lib":661,"../../registry":788,"./axis_ids":715,"@plotly/d3":54,"fast-isnumeric":159}],711:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),h=t("../../components/color"),f=t("../../components/drawing"),p=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,y=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,E=m.ONEHOUR,L=m.ONEMIN,C=m.ONESEC,P=m.MINUS_SIGN,I=m.BADNUM,z={K:"zeroline"},D={K:"gridline",L:"path"},O={K:"tick",L:"path"},R={K:"tick",L:"text"},F=t("../../constants/alignment"),N=F.MID_SHIFT,B=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var q=t("./axis_autotype"),H=t("./axis_ids"),G=H.idSort,Y=H.isLinked;V.id2name=H.id2name,V.name2id=H.name2id,V.cleanId=H.cleanId,V.list=H.list,V.listIds=H.listIds,V.getFromId=H.getFromId,V.getFromTrace=H.getFromTrace;var Z=t("./autorange");V.getAutoRange=Z.getAutoRange,V.findExtremes=Z.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=V.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,i=0;i.3*f||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*A:a.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,v,c,a)),g=y,0;g<=u;)g=V.tickIncrement(g,v,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:v,_dataSpan:u-c}},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,V.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=V.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dticka&&h=o:p<=o;p=V.tickIncrement(p,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(p=u)break}if(L.length>m||p===C)break;C=p;var P=!1;h&&p!==(0|p)&&(P=!0),L.push({minor:P,value:p})}if(f&&function(t,e,r){for(var n=0;n0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),h=r||u,f=0;h>=y?f=u>=y&&u<=g?u:v:r===b&&h>=_?f=u>=_&&u<=x?u:b:h>=k?f=u>=k&&u<=w?u:T:r===M&&h>=M?f=M:h>=A?f=A:r===S&&h>=S?f=S:r===E&&h>=E&&(f=E),f>=u&&(f=u,s=!0);var p=i+f;if(e.rangebreaks&&f>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(i*(1-L)+L*p)!==I&&d++}(f*=d/84)||(t[n].drop=!0),s&&u>M&&(f=u)}(f>0||0===n)&&(t[n].periodX=i+f/2)}}(L,t,t._definedDelta),t.rangebreaks){var z="y"===t._id.charAt(0),D=1;"auto"===t.tickmode&&(D=t.tickfont?t.tickfont.size:12);var O=NaN;for(d=L.length-1;d>-1;d--)if(L[d].drop)L.splice(d,1);else{L[d].value=At(L[d].value,t);var R=t.c2p(L[d].value);(z?O>R-D:Ou||Nu&&(F.periodX=u),N10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&a<=10||e>=15*A)t._tickround="d";else if(e>=L&&a<=16||e>=E)t._tickround="M";else if(e>=C&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(ut(t.exponentformat)&&!ht(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}V.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var a=2*e;if(a>v)e/=v,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(a>T)e/=T,t.dtick="M"+ot(e,1,tt);else if(a>A){t.dtick=ot(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=V.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else a>E?t.dtick=ot(e,E,tt):a>L?t.dtick=ot(e,L,et):a>C?t.dtick=ot(e,C,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Mt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,at)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},V.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?it:nt,h=t+.01*o,f=s.roundUp(s.mod(h,1),u,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=ft(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var h=Math.round(l),f=Math.abs(h),p=t.exponentformat;"power"===p||ut(p)&&ht(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":P)+f+"",e.fontSize*=1.25):("e"===p||"E"===p)&&f>2?e.text="1"+p+(h>0?"+":P)+f:(e.text=ft(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,c,m):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Mt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=ft(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=ft(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=ft(e.x,t,i,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":P+o:o};var ct=["f","p","n","\u03bc","m","","k","M","G","T"];function ut(t){return"SI"===t||"B"===t}function ht(t){return t>14||t<-15}function ft(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=V.getTickFormat(e),h=e.separatethousands;if(n){var f={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":ut(l)&&(t+=ct[c/3+5]));return a?P+t:t}function pt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-h:0,f)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?h-r.top:0,f),p.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?h-r.left:0,f):(n[l]=e._depth=Math.max(r.height>0?r.right-h:0,f),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=gt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=f),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}J&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,xt(e),n),a.autoMargin(t,bt(e),i),a.autoMargin(t,_t(e),s)})),r.skipTitle||J&&"bottom"===e.side||W.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+gt(e);else{var s=St(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var c,h,p,d,m=V.getPxPosition(t,e);"x"===a?(h=e._offset+e._length/2,p="top"===e.side?m-r:m+r):(p=e._offset+e._length/2,h="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var v=f.getTranslate(g.node().parentNode);d.offsetLeft=v.x,d.offsetTop=v.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:h,y:p,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(W)}}function Q(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=yt(this),e=f.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},V.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,f=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=f*B,h+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,h+=3);s&&"top"===c&&(h-=f*(1-B));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(h=-h);return[l?u:0,s?h:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(dt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(dt(e)))}},V.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,h=a("inside"),f="inside"===n&&"inside"===t.ticks||!h&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,m=f?t.ticklen:0;if(h?m*=-1:u&&(m=0),f&&(p+=m,r)){var g=s.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(f||t.showline)&&(p+=.2*t.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(h?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)b=(_=!h&&"bottom"===k||h&&"top"===k)?1:-1,h&&(b*=-1),v=d*b,y=e+p*b,x=_?1:-.2,90===Math.abs(A)&&(h?x+=N:x=-90===A&&"bottom"===k?B:90===A&&"top"===k?N:.5,T=N/2*(A/90)),w.xFn=function(t){return t.dx+v+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*b<0!==h?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==h?-n:0};else if("y"===M){if(b=(_=!h&&"left"===k||h&&"right"===k)?1:-1,h&&(b*=-1),v=p,y=d*b,x=0,h||90!==Math.abs(A)||(x=-90===A&&"left"===k||90===A&&"right"===k?B:.5),h){var S=i(A)?+A:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*B*b,x=0}}w.xFn=function(t){return t.dx+e-(v+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*N},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},V.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.vals;"period"===e.ticklabelmode&&(i=i.slice()).shift();var a=r.layer.selectAll("path."+n).data(e.ticks?i:[],mt);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(h.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),Et(e,[O]),a.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&V.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;sp||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},x(v,g+1?g:m);var b=null;e._selections&&(e._selections[h]=v);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(b=90,_.push((function(){x(v,g)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,a=[];if(v.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=yt(this),o=f.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=p.length,l=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",h=function(t){return-1!==c.indexOf(t)},d=h("top"),g=h("left"),y=h("right"),_=h("bottom")||g||d||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=h(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=y(o[l])){u=d;break}var h=i("pattern",u);if(h===d)for(l=0;l<2;l++)(c=y(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case d:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case m:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":788,"./constants":718}],716:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*x)||T)for(r=0;rz&&FP&&(P=F);f/=(P-C)/(2*I),C=l.l2r(C),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:h.background,stroke:h.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,i,a)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){I&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,n,a){for(var o,s,l,c,u=!1,h={},f={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(q(i),2!==t||vt||Ht(),gt)o.indexOf("select")>-1&&S(r,i,K,J,e.id,Pt),o.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&vt){var s=m?z:I,c="s"===m||"w"===v?0:1,h=s._name+".range["+c+"]",f=function(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,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===v&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(f),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,h,e)}))}}}function Dt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(_t,n),Tt.r=Math.max(_t,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,_t>n?Tt.l=_t-a:Tt.r=_t+a),Lt.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Lt.attr("d",G(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;um[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":661,"fast-isnumeric":159}],730:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":629}],731:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),g=t("../../components/shapes/draw_newshape/helpers").handleEllipse,v=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),x=t("../../lib/polygon"),b=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),M=k.MINSELECT,A=x.filter,S=x.tester,E=t("./handle_outline").clearSelect,L=t("./helpers"),C=L.p2r,P=L.axValue,I=L.getTransform;function z(t,e,r,n,i,a,o){var s,l,c,u,h,f,d,g,v,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){F(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(f=j(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),f(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=v(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function U(t,e,r){var n,a,o,s;for(n=0;n=0)L._fullLayout._deactivateShape(L);else if(!_){var r=D.clickmode;b.done(mt).then((function(){if(b.clear(mt),2===t){for(ht.remove(),$=0;$-1&&z(e,L,i.xaxes,i.yaxes,i.subplot,i,ht),"event"===r&&L.emit("plotly_selected",void 0);s.click(L,e)})).catch(y.error)}},i.doneFn=function(){dt.remove(),b.done(mt).then((function(){b.clear(mt),i.gd.emit("plotly_selected",et),Q&&i.selectionDefs&&(Q.subtract=ut,i.selectionDefs.push(Q),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,J)),i.doneFnCompleted&&i.doneFnCompleted(gt)})).catch(y.error),_&&N(i)}},clearSelect:E,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":524,"../../components/dragelement/helpers":542,"../../components/drawing":546,"../../components/fx":564,"../../components/fx/helpers":560,"../../components/shapes/draw_newshape/display_outlines":612,"../../components/shapes/draw_newshape/helpers":613,"../../components/shapes/draw_newshape/newshapes":614,"../../lib":661,"../../lib/clear_gl_canvases":645,"../../lib/polygon":673,"../../lib/throttle":687,"../../plot_api/subroutines":701,"../../registry":788,"./axis_ids":715,"./constants":718,"./handle_outline":722,"./helpers":723,polybooljs:389}],732:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,h=a.ensureNumber,f=a.isArrayOrTypedArray,p=t("../../constants/numerical"),d=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);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-2*g*Math.abs(n-i))}return m}function L(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function I(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function D(t){var e=z(t);return void 0!==e?e:s(t)?+t:void 0}function O(t){return s(t)?+t:z(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var N=function(e){return s(e)?R(e,t._m,t._b):m},B=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===p;N=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var h=t._B[o]||0;return isFinite(h)?R(e,t._m2,h):0},B=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:h,t.l2c="log"===t.type?A:h,t.l2p=N,t.p2l=B,t.c2p="log"===t.type?function(t,e){return N(E(t,e))}:N,t.p2c="log"===t.type?function(t){return A(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=h,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=h):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=h,t.c2r=E,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=h):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(B(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=h,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:h(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=h,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:h(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var h=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h="y"===p;if((h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(f=!f),f&&t._rangebreaks.reverse();var d=f?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,h=!!e.xr1,f=!!e.yr1,p=[];if(h){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],v=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var y=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,k=h?p[0]:0,M=f?p[1]:0,A=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=i._offset-A,L=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":546,"../../lib":661,"../../registry":788,"./axes":711,"@plotly/d3":54}],737:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",h=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=t.autotypenumbers,o(c,l)){var p=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new A(t)},S.plot=function(t,e,r){var n=this,i=e[this.id],a=[],o=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&i["show"+s]){o=!0;break}for(var l=0;l0&&a._module.calcGeoJSON(i,e)}if(!this.updateProjection(t,e)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),d.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,h=n.projection,f=n.lonaxis,p=n.lataxis,d=f._ax,m=p._ax,v=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],f=function(t){return t?l:[]},p=0;pu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),y=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],x=n.center||{},b=h.rotation||{},_=f.range||[],T=p.range||[];if(n.fitbounds){d._length=y[1][0]-y[0][0],m._length=y[1][1]-y[0][1],d.range=g(r,d),m.range=g(r,m);var k=(d.range[0]+d.range[1])/2,M=(m.range[0]+m.range[1])/2;if(n._isScoped)x={lon:k,lat:M};else if(n._isClipped){x={lon:k,lat:M},b={lon:k,lat:M,roll:b.roll};var A=h.type,S=w.lonaxisSpan[A]/2||180,L=w.lataxisSpan[A]/2||90;_=[k-S,k+S],T=[M-L,M+L]}else x={lon:k,lat:M},b={lon:k,lat:b.lat,roll:b.roll}}v.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(h.parallels);var C=E(_,T);v.fitExtent(y,C);var P=this.bounds=v.getBounds(C),I=this.fitScale=v.scale(),z=v.translate();if(n.fitbounds){var D=v.getBounds(E(d.range,m.range)),O=Math.min((P[1][0]-P[0][0])/(D[1][0]-D[0][0]),(P[1][1]-P[0][1])/(D[1][1]-D[0][1]));isFinite(O)?v.scale(O*I):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else v.scale(h.scale*I);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(v.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(P),n._isAlbersUsa){var F=v([x.lon,x.lat]),N=v.translate();v.translate([N[0]-(F[0]-N[0]),N[1]-(F[1]-N[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(M(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,h=new Array(u),f=0;f-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,h),s.indexOf("event")>-1&&p.click(i,n.event))}))}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(f.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":524,"../../components/dragelement":543,"../../components/drawing":546,"../../components/fx":564,"../../lib":661,"../../lib/geo_location_utils":654,"../../lib/topojson_utils":689,"../../registry":788,"../cartesian/autorange":710,"../cartesian/axes":711,"../cartesian/select":731,"../plots":774,"./constants":742,"./zoom":747,"@plotly/d3":54,"d3-geo":141,"d3-geo-projection":140,"topojson-client":473}],744:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&P<0&&(P+=360);var I,z,D,O=(C+P)/2;if(!p){var R=d?h.projRotate:[O,0,0];I=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}(p?(z=-96.6,D=38.7):(z=d?O:I,D=(L[0]+L[1])/2),r("center.lon",z),r("center.lat",D),m&&(r("projection.tilt"),r("projection.distance")),g)&&r("projection.parallels",h.projParallels||[0,60]);r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):v?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":661,"../get_data":748,"../subplot_defaults":782,"./constants":742,"./layout_attributes":745}],747:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function h(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],h={},f={};function p(t,e){h[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),f[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function f(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),h(t,e,i)})),r}function p(t,e){var r,i,a,o,s,f,p,d,m,g=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=v(r)})).on("zoom",(function(){if(f=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?v(f)&&(d=v(f),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=v(r=f),m=!0,t.render();var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&h(t,e,y)})),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/d)*s-p,i=Math.sqrt(d*d-h*h));var m=180-a-2*p,g=(Math.atan2(f,u)-Math.atan2(c,i))*s,v=(Math.atan2(f,u)-Math.atan2(c,-i))*s;return b(r[0],r[1],a,g)<=b(r[0],r[1],m,v)?[a,g,r[2]]:[m,v,r[2]]}function b(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(g(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":524,"../../../lib":661,"../../../registry":788,"../../get_data":748,"../../subplot_defaults":782,"./axis_defaults":756,"./layout_attributes":759}],759:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":661,"../../../lib/extend":651,"../../domain":739,"./axis_attributes":755}],760:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){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]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":685}],761:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var f=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/f)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=h}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var c,u=Object.keys(e.traces),f=null,m=e.glplot.selection,g=0;g")):"isosurface"===t.type||"volume"===t.type?(k.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(m.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+k.valueLabel),m.textLabel&&E.push(m.textLabel),_=E.join("
")):_=m.textLabel;var L={x:m.traceCoordinate[0],y:m.traceCoordinate[1],z:m.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};d.appendArrayPointValue(L,w,T),t._module.eventData&&(L=w._module.eventData(L,m,w,{},T));var C={points:[L]};if(e.fullSceneLayout.hovermode){var P=[];d.loneHover({trace:w,x:(.5+.5*x[0]/x[3])*s,y:(.5-.5*x[1]/x[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:_,name:f.name,color:d.castHoverOption(w,T,"bgcolor")||f.color,borderColor:d.castHoverOption(w,T,"bordercolor"),fontFamily:d.castHoverOption(w,T,"font.family"),fontSize:d.castHoverOption(w,T,"font.size"),fontColor:d.castHoverOption(w,T,"font.color"),nameLength:d.castHoverOption(w,T,"namelength"),textAlign:d.castHoverOption(w,T,"align"),hovertemplate:h.castOption(w,T,"hovertemplate"),hovertemplateLabels:h.extendFlat({},L,k),eventData:[L]},{container:n,gd:r,inOut_bbox:P}),L.bbox=P[0]}m.buttons&&m.distance<5?r.emit("plotly_click",C):r.emit("plotly_hover",C),c=C}else d.loneUnhover(n),r.emit("plotly_unhover",c);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):h.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(h.isArrayOrTypedArray(l))for(var f,p=0;p<(u||l.length);p++)if(h.isArrayOrTypedArray(l[p]))for(var d=0;dg[1][a])g[0][a]=-1,g[1][a]=1;else{var L=g[1][a]-g[0][a];g[0][a]-=L/32,g[1][a]+=L/32}if("reversed"===s.autorange){var C=g[0][a];g[0][a]=g[1][a],g[1][a]=C}}else{var P=s.range;g[0][a]=s.r2l(P[0]),g[1][a]=s.r2l(P[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*f[a],max:g[1][a]*f[a]})}var I=c.aspectmode;if("cube"===I)d=[1,1,1];else if("manual"===I){var z=c.aspectratio;d=[z.x,z.y,z.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var D=[1,1,1];for(a=0;a<3;++a){var O=y[l=(s=c[k[a]]).type];D[a]=Math.pow(O.acc,1/O.count)/f[a]}d="data"===I||Math.max.apply(null,D)/Math.min.apply(null,D)<=4?D:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var N=this.container.style;N.position="absolute",N.left=F.l+R.x[0]*F.w+"px",N.top=F.t+(1-R.y[1])*F.h+"px",N.width=F.w*(R.x[1]-R.x[0])+"px",N.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).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]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=h.nestedProperty(t,this.id+".camera").get();function n(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 i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=h.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),f=l||c;if(f){var p={};if(l&&(e=this.getCamera(),n=(r=h.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=h.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),h.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),h.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return f},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",f={x:0,y:0,z:1},p={};p[c]=f;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=f,h.nestedProperty(d,c).set(f)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d"),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=h.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":564,"../../lib":661,"../../lib/show_no_webgl_msg":682,"../../lib/str2rgbarray":685,"../../plots/cartesian/axes":711,"../../registry":788,"./layout/convert":757,"./layout/spikes":760,"./layout/tick_marks":761,"./project":762,"gl-plot3d":229,"has-passive-events":344,"webgl-context":487}],764:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap
contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":683}],767:[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=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":661}],768:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),h=t("../../lib/svg_text_utils"),f=t("./mapbox"),p=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=v.split("|").join("
");x.text(w).attr("data-unformatted",w).call(h.convertToTspans,t),b=u.bBox(x.node())}x.attr("transform",a(-3,8-b.height)),y.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;b.width+6>_&&(T=_/(b.width+6));var k=[n.l+n.w*f.x[1],n.t+n.h*(1-f.y[0])];y.attr("transform",a(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&v(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},_.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=h(o)?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},_.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])},_.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=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"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){b.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})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},b.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&D.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&D.length>15&&0===l.shapes.length&&0===l.images.length,b.linkSubplots(f,l,h,n),b.cleanPlot(f,l,h,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var f in c.length||c.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(u.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(h){var g=(r.t+r.b)/h;g>1&&(r.t/=g,r.b/=g)}var v=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;f[e]={l:{val:v,size:r.l+d},r:{val:y,size:r.r+d},b:{val:_,size:r.b+d},t:{val:x,size:r.t+d}},p[e]=1}else delete f[e],delete p[e];if(!n._replotting)return b.doAutoMargin(t)}},b.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,h=a.r,f=a.t,d=a.b,m=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in m)g[v]||delete m[v];for(var y in m.base={l:{val:0,size:c},r:{val:1,size:h},t:{val:1,size:f},b:{val:0,size:d}},m){var x=m[y].l||{},_=m[y].b||{},w=x.val,T=x.size,k=_.val,M=_.size;for(var A in m){if(o(T)&&m[A].r){var S=m[A].r.val,E=m[A].r.size;if(S>w){var L=(T*S+(E-r)*w)/(S-w),P=(E*(1-w)+(T-r)*(1-S))/(S-w);L+P>c+h&&(c=L,h=P)}}if(o(M)&&m[A].t){var I=m[A].t.val,z=m[A].t.size;if(I>k){var D=(M*I+(z-n)*k)/(I-k),O=(z*(1-k)+(M-n)*(1-I))/(I-k);D+O>d+f&&(d=D,f=O)}}}}}var R=u.constrain(r-a.l-a.r,2,64),F=u.constrain(n-a.t-a.b,2,64),N=Math.max(0,r-R),B=Math.max(0,n-F);if(N){var j=(c+h)/N;j>1&&(c/=j,h/=j)}if(B){var U=(d+f)/B;U>1&&(d/=U,f/=U)}if(i.l=Math.round(c),i.r=Math.round(h),i.t=Math.round(f),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&b.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}b.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},b.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&b.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var h={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(h.layout=c(s),i)){var f=s._size;h.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return l&&(h.frames=c(l)),a&&(h.config=c(t._context,!0)),"object"===n?h:JSON.stringify(h)},b.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(D(o,c,h),i=0;i1e-10?t:0}function f(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:h,pathPolygon:function(t,e,r,n,i,a){return"M"+f(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&f<=0?0:Math.max(u,f);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&h>=0?0:Math.min(c,h);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&f>=0?0:Math.min(u,f);n=l>=360?1:c<=0&&h<=0?0:Math.max(c,h);return[e,r,n,i]}(p),b=x[2]-x[0],_=x[3]-x[1],w=f/h,T=Math.abs(_/b);w>T?(d=h,y=(f-(m=h*T))/n.h/2,g=[o[0],o[1]],v=[s[0]+y,s[1]-y]):(m=f,y=(h-(d=f/T))/n.w/2,g=[o[0]+y,o[1]-y],v=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=v;var k=this.xOffset2=n.l+n.w*g[0],M=this.yOffset2=n.t+n.h*(1-v[1]),A=this.radius=d/b,S=this.innerRadius=e.hole*A,E=this.cx=k-A*x[0],L=this.cy=M+A*x[3],I=this.cxx=E-k,z=this.cyy=L-M;this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[i.side],_realSide:i.side,domain:[S/n.w,A/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:v});var D=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",D).attr("transform",l(I,z)),r.frontplot.attr("transform",l(k,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",D).attr("transform",l(E,L)).call(c.fill,e.bgcolor)},D.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},D.mockCartesianAxis=function(t,e,r){var n=this,i=r._id,a=o.extendFlat({type:"linear"},r);p(a,t);var s={x:[0,2],y:[1,3]};return a.setRange=function(){var t=n.sectorBBox,r=s[i],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);a.range=[t[r[0]]*l,t[r[1]]*l]},a.isPtWithinRange="x"===i?function(t){return n.isPtInside(t)}:function(){return!0},a.setRange(),a.setScale(),a},D.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=e.radialaxis;n.setScale(),m(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},D.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,h=r.cx,p=r.cy,d=e.radialaxis,m=C(e.sector[0],360),g=r.radialAxis,v=u90&&m<=270&&(g.tickangle=180);var y=function(t){return l(g.l2p(t.x)+u,0)},x=O(d);if(r.radialTickLayout!==x&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=x),v){g.setScale();var b=f.calcTicks(g),_=f.clipEnds(g,b),w=f.getTickSigns(g)[2];f.drawTicks(n,g,{vals:b,layer:i["radial-axis"],path:f.makeTickPath(g,0,w),transFn:y,crisp:!1}),f.drawGrid(n,g,{vals:_,layer:i["radial-grid"],path:function(t){return r.pathArc(g.r2p(t.x)+u)},transFn:o.noop,crisp:!1}),f.drawLabels(n,g,{vals:b,layer:i["radial-axis"],transFn:y,labelFns:f.makeLabelFns(g,0)})}var T=r.radialAxisAngle=r.vangles?I(R(P(d.angle),r.vangles)):d.angle,k=l(h,p),M=k+s(-T);F(i["radial-axis"],v&&(d.showticklabels||d.ticks),{transform:M}),F(i["radial-grid"],v&&d.showgrid,{transform:k}),F(i["radial-line"].select("line"),v&&d.showline,{x1:u,y1:0,x2:a,y2:0,transform:M}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},D.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,h=P(c),f=Math.cos(h),p=Math.sin(h),d=0;if(s.title){var m=u.bBox(this.layers["radial-axis"].node()).height,g=s.title.font.size;d="counterclockwise"===s.side?-m-.4*g:m+.8*g}this.layers["radial-axis-title"]=x.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:L(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*p,y:o-i/2*p+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},D.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,h=r.cx,p=r.cy,d=e.angularaxis,m=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale();var g=function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=I(m.tick0),m.dtick=I(m.dtick));var v=function(t){return l(h+a*Math.cos(t),p-a*Math.sin(t))},y=f.makeLabelFns(m,0).labelStandoff,x={xFn:function(t){var e=g(t);return Math.cos(e)*y},yFn:function(t){var e=g(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(y+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*A)},anchorFn:function(t){var e=g(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=g(t);return-.5*(1+Math.sin(n))*r}},b=O(d);r.angularTickLayout!==b&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=b);var _,w=f.calcTicks(m);if("linear"===e.gridshape?(_=w.map(g),o.angleDelta(_[0],_[1])<0&&(_=_.slice().reverse())):_=null,r.vangles=_,"category"===m.type&&(w=w.filter((function(t){return o.isAngleInsideSector(g(t),r.sectorInRad)}))),m.visible){var T="inside"===m.ticks?-1:1,k=(m.linewidth||1)/2;f.drawTicks(n,m,{vals:w,layer:i["angular-axis"],path:"M"+T*k+",0h"+T*m.ticklen,transFn:function(t){var e=g(t);return v(e)+s(-I(e))},crisp:!1}),f.drawGrid(n,m,{vals:w,layer:i["angular-grid"],path:function(t){var e=g(t),r=Math.cos(e),n=Math.sin(e);return"M"+[h+u*r,p-u*n]+"L"+[h+a*r,p-a*n]},transFn:o.noop,crisp:!1}),f.drawLabels(n,m,{vals:w,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return v(g(t))},labelFns:x})}F(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(h,p)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},D.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},D.updateMainDrag=function(t){var e,r,s=this,c=s.gd,u=s.layers,h=t._zoomlayer,f=S.MINZOOM,p=S.OFFEDGE,d=s.radius,m=s.innerRadius,x=s.cx,T=s.cy,k=s.cxx,M=s.cyy,A=s.sectorInRad,L=s.vangles,C=s.radialAxis,P=E.clampTiny,I=E.findXYatLength,z=E.findEnclosingVertexAngles,D=S.cornerHalfWidth,O=S.cornerLen/2,R=g.makeDragger(u,"path","maindrag","crosshair");n.select(R).attr("d",s.pathSubplot()).attr("transform",l(x,T));var F,N,B,j,U,V,q,H,G,Y={element:R,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-k,e-M)}function W(t,e){return Math.atan2(M-e,t-k)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function J(t,e){if(0===t)return s.pathSector(2*D);var r=O/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,d)),o=a-D,l=a+D;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(l,i)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function Q(t,e,r){if(0===t)return s.pathSector(2*D);var n,i,a=K(t,e),o=K(t,r),l=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(l&&c){var u=c/l,h=-1/u,f=I(D,u,l,c);n=I(O,h,f[0][0],f[0][1]),i=I(O,h,f[1][0],f[1][1])}else{var p,d;c?(p=O,d=D):(p=D,d=O),n=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function $(t,e){return e=Math.max(Math.min(e,d),m),tf?(t-1&&1===t&&_(e,c,[s.xaxis],[s.yaxis],s.id,Y),r.indexOf("event")>-1&&y.click(c,e,s.id)}Y.prepFn=function(t,n,a){var l=c._fullLayout.dragmode,u=R.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var f=c._fullLayout._invTransform;e=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var p=o.apply3DTransform(f)(n-u.left,a-u.top);if(F=p[0],N=p[1],L){var m=E.findPolygonOffset(d,A[0],A[1],L);F+=k+m[0],N+=M+m[1]}switch(l){case"zoom":Y.moveFn=L?nt:et,Y.clickFn=ot,Y.doneFn=it,function(){B=null,j=null,U=s.pathSubplot(),V=!1;var t=c._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(H=g.makeZoombox(h,q,x,T,U)).attr("fill-rule","evenodd"),G=g.makeCorners(h,x,T),w(c)}();break;case"select":case"lasso":b(t,n,a,Y,l)}},R.onmousemove=function(t){y.hover(c,t,s.id),c._fullLayout._lasthover=R,c._fullLayout._hoversubplot=s.id},R.onmouseout=function(t){c._dragging||v.unhover(c,t)},v.init(Y)},D.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,h=i.radius,f=i.innerRadius,p=i.cx,d=i.cy,m=i.radialAxis,y=S.radialDragBoxSize,x=y/2;if(m.visible){var b,_,T,A=P(i.radialAxisAngle),E=m._rl,L=E[0],C=E[1],z=E[r],D=.75*(E[1]-E[0])/(1-e.hole)/h;r?(b=p+(h+x)*Math.cos(A),_=d-(h+x)*Math.sin(A),T="radialdrag"):(b=p+(f-x)*Math.cos(A),_=d-(f-x)*Math.sin(A),T="radialdrag-inner");var O,N,B,j=g.makeRectDragger(u,T,"crosshair",-x,-x,y,y),U={element:j,gd:c};F(n.select(j),m.visible&&f0==(r?B>L:Bn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0){for(var n=[],i=0;i=u&&(p.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var i=h[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var f=o("color"),p=f!==i.color.dflt?f:r.font.color,d=e._name.charAt(0).toUpperCase(),m="Component "+d,g=o("title.text",m);e._hovertitle=g===m?g:d,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:p}),o("min"),c(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":524,"../../lib":661,"../../plot_api/plot_template":700,"../cartesian/line_grid_defaults":728,"../cartesian/tick_label_defaults":733,"../cartesian/tick_mark_defaults":734,"../cartesian/tick_value_defaults":735,"../subplot_defaults":782,"./layout_attributes":785}],787:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,p=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/dragelement/helpers"),y=v.freeMode,x=v.rectMode,b=t("../../components/titles"),_=t("../cartesian/select").prepSelect,w=t("../cartesian/select").selectOnClick,T=t("../cartesian/select").clearSelect,k=t("../cartesian/select").clearSelectionsCache,M=t("../cartesian/constants");function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var S=A.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iE*b?i=(a=b)*E:a=(i=x)/E,o=v*i/x,l=y*a/b,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},h(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-k],domain:[g-l/2,g+l/2],_id:"y"},h(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var M=p.yaxis.domain[0],A=p.aaxis=f({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*E],anchor:"free",position:0,_id:"y",_length:i});h(A,p.graphDiv._fullLayout),A.setScale();var S=p.baxis=f({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});h(S,p.graphDiv._fullLayout),S.setScale();var L=p.caxis=f({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*E],anchor:"free",position:0,_id:"y",_length:i});h(L,p.graphDiv._fullLayout),L.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var z=s(r-S._offset,n+a);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var D=s(r+i/2,n)+"rotate(30)"+s(0,-A._offset);p.layers.aaxis.attr("transform",D),p.layers.agrid.attr("transform",D);var O=s(r+i/2,n)+"rotate(-30)"+s(0,-L._offset);p.layers.caxis.attr("transform",O),p.layers.cgrid.attr("transform",O),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",L.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),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)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=b.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=b.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),h=d.clipEnds(t,u),f=d.makeTransTickFn(t),p=d.getTickSigns(t)[2],m=o.deg2rad(30),g=p*(t.linewidth||1)/2,v=p*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+g+"l"+Math.sin(m)*v+","+Math.cos(m)*v:"M"+g+",0l"+Math.cos(m)*v+","+-Math.sin(m)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?h:u,layer:s,path:b,transFn:f,crisp:!1}),d.drawGrid(r,t,{vals:h,layer:this.layers[i+"grid"],path:_,transFn:f,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:f,labelFns:d.makeLabelFns(t,0,30)})};var L=M.MINZOOM/2+.87,C="m-0.87,.5h"+L+"v3h-"+(L+5.2)+"l"+(L/2+2.6)+",-"+(.87*L+4.5)+"l2.6,1.5l-"+L/2+","+.87*L+"Z",P="m0.87,.5h-"+L+"v3h"+(L+5.2)+"l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-2.6,1.5l"+L/2+","+.87*L+"Z",I="m0,1l"+L/2+","+.87*L+"l2.6,-1.5l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-"+(L/2+2.6)+","+(.87*L+4.5)+"l2.6,1.5l"+L/2+",-"+.87*L+"Z",z=!0;function D(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearSelect=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,h,f,p,d,v,b,T,k,A=this,S=A.layers.plotbg.select("path").node(),L=A.graphDiv,O=L._fullLayout._zoomlayer;function R(t){var e={};return e[A.id+".aaxis.min"]=t.a,e[A.id+".baxis.min"]=t.b,e[A.id+".caxis.min"]=t.c,e}function F(t,e){var r=L._fullLayout.clickmode;D(L),2===t&&(L.emit("plotly_doubleclick",null),a.call("_guiRelayout",L,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,L,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&g.click(L,e,A.id)}function N(t,e){return 1-e/A.h}function B(t,e){return 1-(t+(A.h-e)/Math.sqrt(3))/A.w}function j(t,e){return(t-(A.h-e)/Math.sqrt(3))/A.w}function U(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,N(0,n),N(0,s))),c=Math.max(0,Math.min(1,B(r,n),B(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*A.w,g=(1-l/2-c)*A.w,y=(m+g)/2,x=g-m,_=(1-l)*A.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),L.emit("plotly_relayouting",R(p))}function V(){D(L),p!==h&&(a.call("_guiRelayout",L,R(p)),z&&L.data&&L._context.showTips&&(o.notifier(l(L,"Double-click to zoom back out"),"long"),z=!1))}function q(t,e){var r=t/A.xaxis._m,n=e/A.yaxis._m,i=[(p={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),a=i.indexOf(p.a),l=i.indexOf(p.b),c=i.indexOf(p.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),p={a:i[a],b:i[l],c:i[c]},e=(h.a-p.a)*A.yaxis._m,t=(h.c-p.c-h.b+p.b)*A.xaxis._m);var f=s(A.x0+t,A.y0+e);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d=s(-t,-e);A.clipDefRelative.select("path").attr("transform",d),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),L.emit("plotly_relayouting",R(p))}function H(){a.call("_guiRelayout",L,R(p))}this.dragOptions={element:S,gd:L,plotinfo:{id:A.id,domain:L._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(a,l,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],t=L._fullLayout._invScaleX,e=L._fullLayout._invScaleY;var m=A.dragOptions.dragmode=L._fullLayout.dragmode;y(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=F,A.dragOptions.doneFn=V,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,L._fullLayout._calcInverseTransform(L);var u=L._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=h,f=A.aaxis.range[1]-h.a,d=i(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),v="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,T=O.append("path").attr("class","zoombox").attr("transform",s(A.x0,A.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=O.append("path").attr("class","zoombox-corners").attr("transform",s(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(L)}(0,l,u)):"pan"===m?(A.dragOptions.moveFn=q,A.dragOptions.clickFn=F,A.dragOptions.doneFn=H,h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=h,A.clearSelect(L)):(x(m)||y(m))&&_(a,l,u,A.dragOptions,m)}},S.onmousemove=function(t){g.hover(L,t,A.id),L._fullLayout._lasthover=S,L._fullLayout._hoversubplot=A.id},S.onmouseout=function(t){L._dragging||m.unhover(L,t)},m.init(this.dragOptions)}},{"../../components/color":524,"../../components/dragelement":543,"../../components/dragelement/helpers":542,"../../components/drawing":546,"../../components/fx":564,"../../components/titles":622,"../../lib":661,"../../lib/extend":651,"../../registry":788,"../cartesian/axes":711,"../cartesian/constants":718,"../cartesian/select":731,"../cartesian/set_convert":732,"../plots":774,"@plotly/d3":54,tinycolor2:471}],788:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),h=l.extendFlat,f=l.extendDeepAll;function p(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var i in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(h[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":524,"../components/drawing":546,"../constants/xmlns_namespaces":638,"../lib":661,"@plotly/d3":54}],797:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rh+c||!n(u))}for(var p=0;pa))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0?e+=r:u<0&&(e-=r)}return e}function D(t){var e=u,r=t.b,i=z(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var O=t[h+"a"],R=t[f+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F=n.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==c){k||(L=function(t){return Math.min(M(t),t.p-y.bargroupwidth/2)},C=function(t){return Math.max(A(t),t.p+y.bargroupwidth/2)});var N=g[t.index],B=v.base?N.b+N.s:N.s;t[f+"0"]=t[f+"1"]=R.c2p(N[f],!0),t[f+"LabelVal"]=B;var j=y.extents[y.extents.round(N.p)];t[h+"0"]=O.c2p(x?L(N):j[0],!0),t[h+"1"]=O.c2p(x?C(N):j[1],!0);var U=void 0!==N.orig_p;return t[h+"LabelVal"]=U?N.orig_p:N.p,t.labelLabel=l(O,t[h+"LabelVal"],v[h+"hoverformat"]),t.valueLabel=l(R,t[f+"LabelVal"],v[f+"hoverformat"]),t.baseLabel=l(R,N.b,v[f+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=z(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(N)+function(t){return P(M(t),A(t),w)}(N))/2,t[h+"Spike"]=O.c2p(N.p,!0),o(N,v,t),t.hovertemplate=v.hovertemplate,t}}function h(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=h(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:h}},{"../../components/color":524,"../../components/fx":564,"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/axes":711,"../../registry":788,"./helpers":804}],806:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":725,"../scatter/marker_colorbar":1082,"./arrays_to_calcdata":797,"./attributes":798,"./calc":799,"./cross_trace_calc":801,"./defaults":802,"./event_data":803,"./hover":805,"./layout_attributes":807,"./layout_defaults":808,"./plot":809,"./select":810,"./style":812}],807:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],808:[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,c=!1,u=!1,h={},f=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,h="start"===c,f=((a.leftToRight||0)+1)/2,p=1-f,d=i.width,m=i.height,g=Math.abs(e-t),v=Math.abs(n-r),y=g>2*_&&v>2*_?_:0;g-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=g&&m<=v||!(d>g||m>v)||(d>v||m>g)&&d.01?H:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?H(t):t>e?Math.ceil(t):Math.floor(t)};N=G(N,B,O),B=G(B,N,O),j=G(j,U,!O),U=G(U,j,!O)}var Y=M(a.ensureSingle(I,"path"),P,g,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((B-N)*(U-j))||V&&t._context.staticPlot?"M0,0Z":"M"+N+","+j+"V"+U+"H"+B+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var Z=l.makePointStyleFns(h);l.singlePointStyle(c,Y,h,Z,t)}!function(t,e,r,n,i,s,c,h,p,g,v){var w,T=e.xaxis,A=e.yaxis,C=t._fullLayout;function P(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,z="h"===I.orientation,D=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,h,f,p="waterfall"===o.type,d="funnel"===o.type;"h"===o.orientation?(l="y",c=i,h="x",f=n):(l="x",c=n,h="y",f=i);function m(t){return u(f,f.c2l(t),!0).text}var g=e[r],v={};v.label=g.p,v.labelLabel=v[l+"Label"]=(y=g.p,u(c,c.c2l(y),!0).text);var y;var x=a.castOption(o,g.i,"text");(0===x||x)&&(v.text=x);v.value=g.s,v.valueLabel=v[h+"Label"]=m(g.s);var _={};b(_,o,g.i),p&&(v.delta=+g.rawS||g.s,v.deltaLabel=m(v.delta),v.final=g.v,v.finalLabel=m(v.final),v.initial=v.final-v.delta,v.initialLabel=m(v.initial));d&&(v.value=g.s,v.valueLabel=m(v.value),v.percentInitial=g.begR,v.percentInitialLabel=a.formatPercent(g.begR),v.percentPrevious=g.difR,v.percentPreviousLabel=a.formatPercent(g.difR),v.percentTotal=g.sumR,v.percenTotalLabel=a.formatPercent(g.sumR));var w=a.castOption(o,g.i,"customdata");w&&(v.customdata=w);return a.texttemplateString(s,v,t._d3locale,_,v,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var h,f=i.textinfo,p=t[e],d=f.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};g("label")&&m.push((v=t[e].p,u(o?n:r,v,!0).text));var v;g("text")&&(0===(h=a.castOption(i,p.i,"text"))||h)&&m.push(h);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(c(b)),g("delta")&&m.push(c(y)),g("final")&&m.push(c(x))}if(l){g("value")&&m.push(c(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(h=a.formatPercent(p.begR),w&&(h+=" of initial"),m.push(h)),g("percent previous")&&(h=a.formatPercent(p.difR),w&&(h+=" of previous"),m.push(h)),g("percent total")&&(h=a.formatPercent(p.sumR),w&&(h+=" of total"),m.push(h))}return m.join("
")}(e,r,n,i):m.getValue(s.text,r);return m.coerceString(y,o)}(C,n,i,T,A);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(x,r)}(I,i);var O="stack"===g.mode||"relative"===g.mode,R=n[i],F=!O||R._outmost;if(!D||"none"===w||(R.isBlank||s===c||h===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=C.font,B=d.getBarColor(n[i],I),j=d.getInsideTextFont(I,i,N,B),U=d.getOutsideTextFont(I,i,N),V=r.datum();z?"log"===T.type&&V.s0<=0&&(s=T.range[0]=G*(W/Y):W>=Y*(X/G);G>0&&Y>0&&(K||J||Q)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){Z=a.ensureUniformFontSize(t,"outside"===w?U:j);var $=(q=P(r,D,Z)).attr("transform");if(q.attr("transform",""),H=l.bBox(q.node()),G=H.width,Y=H.height,q.attr("transform",$),G<=0||Y<=0)return void q.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,f=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:f>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/u));var m=S(c),g=E(i,m),v=(s?g.x:g.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,M=0,A=s?k(e,t):k(r,n);s?(b=e-A*o,T=A*v):(w=n+A*o,M=-A*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:d,rotate:m}}(s,c,h,p,H,{isHorizontal:z,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=L(s,c,h,p,H,{isHorizontal:z,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=Z.size,f(I.type,tt,C),R.transform=tt,M(q,C,g,v).attr("transform",a.getTextTransform(tt))}(t,e,I,r,p,N,B,j,U,g,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,C,h.xcalendar,h.ycalendar)}));var j=!1===h.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,g)},toMoveInsideBar:L}},{"../../components/color":524,"../../components/drawing":546,"../../components/fx/helpers":560,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../registry":788,"./attributes":798,"./constants":800,"./helpers":804,"./style":812,"./uniform_text":814,"@plotly/d3":54,"fast-isnumeric":159}],810:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":524,"../../components/drawing":546,"../../lib":661,"../../registry":788,"./attributes":798,"./helpers":804,"./uniform_text":814,"@plotly/d3":54}],813:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":524,"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"../../lib":661}],814:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=of.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return m(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,h,t),t.hovertemplate=u.hovertemplate,t.color=a(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":564,"../../lib":661,"../../plots/polar/helpers":776,"../bar/hover":805,"../scatterpolar/hover":1129}],819:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":777,"../bar/select":810,"../bar/style":812,"../scatter/marker_colorbar":1082,"../scatterpolar/format_labels":1128,"./attributes":815,"./calc":816,"./defaults":817,"./hover":818,"./layout_attributes":820,"./layout_defaults":821,"./plot":822}],820:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],821:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var h=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,h,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=h.c2g(t.p0),d=t.thetag1=h.c2g(t.p1);if(i(o)&&i(s)&&i(p)&&i(d)&&o!==s&&p!==d){var m=u.c2g(t.s1),g=(p+d)/2;t.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=f(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":546,"../../lib":661,"../../plots/polar/helpers":776,"@plotly/d3":54,"fast-isnumeric":159}],823:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":523,"../../lib/extend":651,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../bar/attributes":798,"../scatter/attributes":1064}],824:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,y,x,b,_,w,T=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),M=i.getFromId(t,e.yaxis||"y"),A=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(y=k,x="x",b=M,_="y",w=!!e.yperiodalignment):(y=M,x="y",b=k,_="x",w=!!e.xperiodalignment);var E,L,C,P,I,z,D=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;for(var h="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),f=t._length,p=new Array(f),d=0;dE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return y.d2c((e[t]||[])[r])},q=1/0,H=-1/0;for(r=0;r=E.q1&&E.q3>=E.med){var Y=V("lowerfence");E.lf=Y!==s&&Y<=E.q1?Y:p(E,C,P);var Z=V("upperfence");E.uf=Z!==s&&Z>=E.q3?Z:d(E,C,P);var X=V("mean");E.mean=X!==s?X:P?o.mean(C,P):(E.q1+E.q3)/2;var W=V("sd");E.sd=X!==s&&W>=0?W:P?o.stdev(C,P,E.mean):E.q3-E.q1,E.lo=m(E),E.uo=g(E);var K=V("notchspan");K=K!==s&&K>0?K:v(E,P),E.ln=E.med-K,E.un=E.med+K;var J=E.lf,Q=E.uf;e.boxpoints&&C.length&&(J=Math.min(J,C[0]),Q=Math.max(Q,C[P-1])),e.notched&&(J=Math.min(J,E.ln),Q=Math.max(Q,E.un)),E.min=J,E.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),$=E.med!==s?E.med:E.q1!==s?E.q3!==s?(E.q1+E.q3)/2:E.q1:E.q3!==s?E.q3:0,E.med=$,E.q1=E.q3=$,E.lf=E.uf=$,E.mean=E.sd=$,E.ln=E.un=$,E.min=E.max=$}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=L.filter(j),A.push(E)}}e._extremes[y._id]=i.findExtremes(y,[q,H],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ht;if((E={}).pos=E[_]=N[r],L=E.pts=nt[r].sort(h),P=(C=E[x]=L.map(f)).length,E.min=C[0],E.max=C[P-1],E.mean=o.mean(C,P),E.sd=o.stdev(C,P,E.mean),E.med=o.interp(C,.5),P%2&&(lt||ct))lt?(ut=C.slice(0,P/2),ht=C.slice(P/2+1)):ct&&(ut=C.slice(0,P/2+1),ht=C.slice(P/2)),E.q1=o.interp(ut,.5),E.q3=o.interp(ht,.5);else E.q1=o.interp(C,.25),E.q3=o.interp(C,.75);E.lf=p(E,C,P),E.uf=d(E,C,P),E.lo=m(E),E.uo=g(E);var ft=v(E,P);E.ln=E.med-ft,E.un=E.med+ft,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=L.filter(j),A.push(E)}e._extremes[y._id]=i.findExtremes(y,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(A[0].t={num:T[S],dPos:B,posLetter:_,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in c)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[c[n]]=e[n][r[0]][r[1]]):t[c[n]]=e[n][r])}function h(t,e){return t.v-e.v}function f(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function d(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function v(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"fast-isnumeric":159}],825:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],m=0;for(s=0;s1,b=1-h[t+"gap"],_=1-h[t+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,Y=E.marker.size/2,Z=0;H+G>=0&&((Z=V*(H+G))>A?(q=!0,j=Y,N=Z):Z>R&&(j=Y,N=A)),Z<=A&&(N=A);var X=0;H-G<=0&&((X=-V*(H-G))>S?(q=!0,U=Y,B=X):X>F&&(U=Y,B=S)),X<=S&&(B=S)}else N=A,B=S;var W=new Array(c.length);for(l=0;l0?(g="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",v=Math.min(_)):v=0;if(v){e._length=v;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===y&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function h(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var h=r("hoveron");"all"!==h&&-1===h.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var f=!1;if(l){var p=s("mean"),d=s("sd");p&&p.length&&(f=!0,d&&d.length&&(f="sd"))}s("boxmean",f),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),h(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return a}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,h=a.bPos,f=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+h,!0),i=c.l2p(e-o)+f,a=c.l2p(e+s)+f,d=u?(i+a)/2:c.l2p(e)+f,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),v=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+i+"L"+v+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+i+","+m+"L"+d+","+v+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],h=a.t,f=a.trace;(h.wdPos=h.bdPos*f.whiskerwidth,!0!==f.visible||h.empty)?i.remove():("h"===f.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},f,h),s(i,{x:c,y:u},f,h),l(i,{pos:e,val:r},f,h))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":546,"../../lib":661,"@plotly/d3":54}],833:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=L>0?Math.ceil:Math.floor,z=L>0?Math.min:Math.max,D=L>0?Math.max:Math.min,O=P(S+C),R=I(E-C),F=[[h=A(S)]];for(a=O;a*L=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],847:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,h,f,p,d,m,g,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],M=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var A=t._xctrl,S=t._yctrl,E=A[0].length,L=A.length,C=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function z(n){var i,a,o,s,l,c,u,h,p,d,m,g,v=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,a))),s=a-o,x.length=P,x.crossLength=C,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(C-2,i))),u=i-c,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),v.push(l[0]+m[0]/3),y.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),v.push(h[0]-g[0]/3),y.push(h[1]-g[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return x.axisLetter=e,x.axis=b,x.crossAxis=M,x.value=n,x.constvar=r,x.index=f,x.x=v,x.y=y,x.smoothing=M.smoothing,x}function D(n){var i,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),h.xy=function(e){return t.evalxy([],e,n)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(D(o),{color:b.gridcolor,width:b.gridwidth}));for(f=u;fx.length-1||m<0||m>x.length-1))for(g=x[s],v=x[m],a=0;ax[x.length-1]||w.push(i(z(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(i(D(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(D(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],f=u;f<=h;f++)p=b.tick0+b.dtick*f,_.push(i(z(p),{color:b.gridcolor,width:b.gridwidth}));for(f=u-1;fx[x.length-1]||w.push(i(z(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(i(z(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(z(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":651,"../../plots/cartesian/axes":711}],848:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],862:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,h=c.strTranslate,f=t("../../constants/alignment");function p(t,e,r,i,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var i=r,s=i.x,l=i.y,c=a([],s,t.c2p),u=a([],l,e.c2p),h="M"+o(c,u,i.smoothing);n.select(this).attr("d",h).style("stroke-width",i.width).style("stroke",i.color).style("fill","none")})),u.exit().remove()}function d(t,e,r,a,o,c,f,p){var d=c.selectAll("text."+p).data(f);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(o,c){var f;if("auto"===o.axis.tickangle)f=s(a,e,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;f=s(a,e,r,o.xy,[Math.cos(p),Math.sin(p)])}c||(g={angle:f.angle,flip:f.flip});var d=(o.endAnchor?-1:1)*f.flip,v=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),y=i.bBox(this);v.attr("transform",h(f.p[0],f.p[1])+u(f.angle)+h(o.axis.labelpadding*d,.3*y.height)),m=Math.max(m,y.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,h=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],f=i.trace,m=f.aaxis,g=f.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",f.opacity),p(l,u,x,m,"a",m._gridlines),p(l,u,x,g,"b",g._gridlines),p(l,u,y,m,"a",m._minorgridlines),p(l,u,y,g,"b",g._minorgridlines),p(l,u,b,m,"a-boundary",m._boundarylines),p(l,u,b,g,"b-boundary",g._boundarylines);var w=d(t,l,u,f,i,_,m._labels,"a-label"),T=d(t,l,u,f,i,_,g._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,h,f,p,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+m),h=g,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===o.angle&&c.extendFlat(o,s(r,i,a,f,r.dxydb_rough(u,h)));v(t,e,r,n,f,p,r.aaxis,i,a,o,"a-title"),u=d,h=.5*(g+y),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===l.angle&&c.extendFlat(l,s(r,i,a,f,r.dxyda_rough(u,h)));v(t,e,r,n,f,p,r.baxis,i,a,l,"b-title")}(t,_,f,i,l,u,w,T),function(t,e,r,n,i){var s,l,u,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,m=[];for(h=0;h90&&y<270,b=n.select(this);b.text(f.title.text).call(l.convertToTspans,t),x&&(_=(-l.lineCount(b)+g)*m*a-_),b.attr("transform",h(e.p[0],e.p[1])+u(e.angle)+h(0,_)).attr("text-anchor","middle").call(i.font,f.title.font)})),b.exit().remove()}},{"../../components/drawing":546,"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"./makepath":859,"./map_1d_array":860,"./orient_text":861,"@plotly/d3":54}],863:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,h=t.aaxis,f=t.baxis,p=e[0],d=e[c-1],m=r[0],g=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,m-=b,g+=b,t.isVisible=function(t,e){return t>p&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=l([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,p,d,m=0,g=0,v=[];ne[c-1]?(h=c-2,f=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(h=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(p=u-2,d=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,h,p,f,d),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,h,p,f,d),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":680,"./compute_control_points":851,"./constants":852,"./create_i_derivative_evaluator":853,"./create_j_derivative_evaluator":854,"./create_spline_evaluator":855}],864:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function h(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",M,"iterations"),t}},{"../../lib":661}],865:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":661}],866:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":523,"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scattergeo/attributes":1106}],867:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var h=0;h")}(t,h,o),[t]}},{"../../lib":661,"../../plots/cartesian/axes":711,"./attributes":866}],871:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":744,"../heatmap/colorbar":945,"./attributes":866,"./calc":867,"./defaults":868,"./event_data":869,"./hover":870,"./plot":872,"./select":873,"./style":874}],872:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),h=[],f=[],p=0;p=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":766,"./convert":876}],880:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../mesh3d/attributes":1016}],881:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),hc&&(n.prefixBoundary=!0)}}}},{}],888:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(e,{isColorbar:!0});if("heatmap"===c){var h=n.extractOpts(e);r._fillgradient=h.reversescale?n.flipScale(h.colorscale):h.colorscale,r._zrange=[h.min,h.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":536,"./end_plus":896,"./make_color_map":901}],889:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],890:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,h){var f,p,d,m=e.contours,g=r("contours.operation");(m._operation=c[g],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,m),"="===g?f=m.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),f)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,p,h)}},{"../../components/color":524,"../../constants/filter_ops":633,"./label_defaults":900,"fast-isnumeric":159}],891:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":633,"fast-isnumeric":159}],892:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],893:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":661,"./constraint_mapping":891,"./end_plus":896}],896:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],897:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(h,r,e),p=[s(t,e,[-f[0],-f[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),v=f.slice();for(c=0;c<1e4;c++){if(h>20?(h=i.CHOOSESADDLE[h][(f[0]||f[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[h]):delete t.crossings[u],!(f=i.NEWDELTA[h])){n.log("Found bad marching index:",h,e,t.level);break}p.push(s(t,e,f)),e[0]+=f[0],e[1]+=f[1],u=e.join(","),a(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=f[0]&&(e[0]<0||e[0]>m-2)||f[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&f[0]===v[0]&&f[1]===v[1]||r&&y)break;h=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,M,A,S,E,L,C,P,I,z,D=a(p[0],p[p.length-1],o,l),O=0,R=.2*t.smoothing,F=[],N=0;for(c=1;c=N;c--)if((x=F[c])=N&&x+F[b]A&&S--,t.edgepaths[S]=L.concat(p,E));break}V||(t.edgepaths[A]=p.concat(E))}for(A=0;At?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,c,u,h,f=t[0].z,p=f.length,d=f[0].length,m=2===p||2===d;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;h+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;fn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=v.EDGECOST*(1/(f-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var m=s-u,g=l-h,y=s+u,x=l+h,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),f=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},p=[f(-a/2,-o/2),f(-a/2,o/2),f(a/2,o/2),f(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,h=r.end,f=t._input.contours;if(u>h&&(r.start=f.start=h,h=r.end=f.end=u,u=r.start),!(r.size>0))c=u===h?1:a(u,h,t.ncontours).dtick,f.size=r.size=c}}},{"../../lib":661,"../../plots/cartesian/axes":711}],905:[function(t,e,r){"use strict";var n=t("@plotly/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[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,h=!u&&"lines"===a.coloring,f=!u&&"fill"===a.coloring,p=h||f?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,h?p(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(h?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(f){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),p(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),a(t)}},{"../../components/drawing":546,"../heatmap/style":954,"./make_color_map":901,"@plotly/d3":54}],906:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":534,"./label_defaults":900}],907:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../contour/attributes":885,"../heatmap/attributes":942}],908:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),h=t("../carpet/lookup_carpetid"),f=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=h(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,h,f,p,d,m,g=e._carpetTrace,v=g.aaxis,y=g.baxis;v._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,f=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],f=f?y.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var x=i.maxRowLength(m),b="scaled"===e.xtype?"":r,_=c(e,b,u,h,x,v),w="scaled"===e.ytype?"":f,T=c(e,w,p,d,m.length,y),k={a:_,b:T,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return f(e,e._z),m}}},{"../../components/colorscale/calc":532,"../../lib":661,"../carpet/lookup_carpetid":858,"../contour/set_contours":904,"../heatmap/clean_2d_array":944,"../heatmap/convert_column_xyz":946,"../heatmap/find_empties":948,"../heatmap/interp2d":951,"../heatmap/make_bound_array":952,"./defaults":909}],909:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":661,"../contour/constraint_defaults":890,"../contour/contours_defaults":892,"../contour/style_defaults":906,"../heatmap/xyz_defaults":956,"./attributes":907}],910:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":725,"../contour/colorbar":888,"../contour/style":905,"./attributes":907,"./calc":908,"./defaults":909,"./plot":911}],911:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),h=t("../contour/constants"),f=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),g=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,M=k._carpetTrace=m(t,k),A=t.calcdata[M.index][0];if(M.visible&&"legendonly"!==M.visible){var S=T.a,E=T.b,L=k.contours,C=p(L,e,T),P="constraint"===L.type,I=L._operation,z=P?"="===I?"lines":"fill":L.coloring,D=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(C);var O=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(C,O,R);var F,N,B,j,U=C;"constraint"===L.type&&(U=f(C,I)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=A.clipsegments[j],N=i([],F.x,_.c2p),B=i([],F.y,w.c2p),N.reverse(),B.reverse(),V.push(a(N,B,F.bicubic));var q="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,h,f,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f=0&&(f=L,d=m):Math.abs(h[1]-f[1])=0&&(f=L,d=m):s.log("endpt to newendpt is not vert. or horz.",h,f,L)}if(d>=0)break;y+=S(h,f),h=f}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(h,f)+"Z",h=null)}for(u=0;ug&&(n.max=g);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*h.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),h.LABELMAX),a=0;a0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}},{"../../components/color":524,"../../components/colorscale":536,"../../constants/numerical":637,"../../lib":661,"../../lib/geojson_utils":655,"fast-isnumeric":159}],915:[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=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":534,"../../lib":661,"./attributes":912}],916:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],917:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":711,"../scattermapbox/hover":1121}],918:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":766,"./convert":914}],920:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,f),[l]}}},{"../../components/color":524,"../../lib":661,"../bar/hover":805}],928:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":725,"../bar/select":810,"./attributes":921,"./calc":922,"./cross_trace_calc":924,"./defaults":925,"./event_data":926,"./hover":927,"./layout_attributes":929,"./layout_defaults":930,"./plot":931,"./style":932}],929:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],930:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":524,"../../components/drawing":546,"../../constants/interactions":636,"../bar/style":812,"../bar/uniform_text":814,"@plotly/d3":54}],933:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":651,"../../plots/attributes":707,"../../plots/domain":739,"../../plots/template_attributes":783,"../pie/attributes":1038}],934:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":774}],935:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1040}],936:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),h=c("values"),f=s(u,h),p=f.len;if(e._hasLabels=f.hasLabels,e._hasValues=f.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":661,"../../plots/domain":739,"../bar/defaults":802,"../pie/defaults":1041,"./attributes":933}],937:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1049,"./attributes":933,"./base_plot":934,"./calc":935,"./defaults":936,"./layout_attributes":938,"./layout_defaults":939,"./plot":940,"./style":941}],938:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1045}],939:[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"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":661,"./layout_attributes":938}],940:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),h=u.recordMinTextSize,f=u.clearMinTextSize,p=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,v=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;f("funnelarea",r),y(e,t),v(e,r._size),a.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var u=n.select(this),f=e[0],d=f.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var h,f,p=[];for(p.push(u()),h=t.length-1;h>-1;h--)if(!(f=t[h]).hidden){var d=f.v/l;c+=d,p.push(u())}var m=1/0,g=-1/0;for(h=0;h-1;h--)if(!(f=t[h]).hidden){var M=p[k+=1][0],A=p[k][1];f.TL=[-M,A],f.TR=[M,A],f.BL=w,f.BR=T,f.pxmid=(S=f.TR,E=f.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=f.TL,T=f.TR}var S,E}(e),u.each((function(){var u=n.select(this).selectAll("g.slice").data(e);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=d.index;var u=f.cx,v=f.cy,y=n.select(this),x=y.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.call(m,t,e);var w="M"+(u+o.TR[0])+","+(v+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";x.attr("d",w),b(t,o,f);var T=p.castOption(d.textposition,o.pts),k=y.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var f=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=a.ensureUniformFontSize(t,g(d,o,r.font));f.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,t);var m,y,x,b=i.bBox(f.node()),_=Math.min(o.BL[1],o.BR[1])+v,w=Math.max(o.TL[1],o.TR[1])+v;y=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(m=c(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,h(d.type,m,r),e[s].transform=m,f.attr("transform",a.getTextTransform(m))}))}}));var v=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),c=d.title.text;d._meta&&(c=a.templateString(c,d._meta)),e.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,d.title.font).call(l.convertToTspans,t);var u=x(f,r._size);e.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../bar/plot":809,"../bar/uniform_text":814,"../pie/helpers":1043,"../pie/plot":1047,"@plotly/d3":54}],941:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(i,t,e)}))}))}},{"../bar/uniform_text":814,"../pie/style_one":1049,"@plotly/d3":54}],942:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:l({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:l({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:l({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:l({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:l({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:l({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:o(),showlegend:l({},i.showlegend,{dflt:!1})},{transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../scatter/attributes":1064}],943:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),h=t("./interp2d"),f=t("./find_empties"),p=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nO){z("x scale is not linear");break}}if(x.length&&"fast"===P){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){z("y scale is not linear");break}}}var N=i.maxRowLength(T),B="scaled"===e.xtype?"":r,j=p(e,B,g,v,N,A),U="scaled"===e.ytype?"":x,V=p(e,U,b,_,T.length,S);C||(e._extremes[A._id]=a.findExtremes(A,j),e._extremes[S._id]=a.findExtremes(S,V));var q={x:j,y:V,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(q.orig_x=y),e.yperiodalignment&&w&&(q.orig_y=w),B&&B.length===j.length-1&&(q.xCenter=B),U&&U.length===V.length-1&&(q.yCenter=U),L&&(q.xRanges=M.xRanges,q.yRanges=M.yRanges,q.pts=M.pts),E||l(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var H={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};q.xfill=p(H,B,g,v,N,A),q.yfill=p(H,U,b,_,T.length,S)}return[q]}},{"../../components/colorscale/calc":532,"../../constants/numerical":637,"../../lib":661,"../../plots/cartesian/align_period":708,"../../plots/cartesian/axes":711,"../../registry":788,"../histogram2d/calc":975,"./clean_2d_array":944,"./convert_column_xyz":946,"./find_empties":948,"./interp2d":951,"./make_bound_array":952}],944:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,h,f;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,h=0;h=0;o--)(s=((h[[(r=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":661}],949:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,h,f,p=l.isContour,d=t.cd[0],m=d.trace,g=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=m.zhoverformat,M=y,A=x;if(!1!==t.index){try{h=Math.round(t.index[1]),f=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(h<0||h>=b[0].length||f<0||f>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var S;for(M=[2*y[0]-y[1]],S=1;Sm&&(v=Math.max(v,Math.abs(t[a][o]-d)/(g-m))))}return v}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":661}],952:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,h=[],f=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var m=e.length;if(!(m<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f||d)h=e.slice(0,o);else if(1===o)h=[e[0]-.5,e[0]+.5];else{for(h=[1.5*e[0]-.5*e[1]],u=1;u0;)f=p.c2p(T[y]),y--;for(f0;)v=d.c2p(k[y]),y--;if(v0&&(a=!0);for(var l=0;la){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]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,f=-.1*e,p=t-f,d=r[0],m=r[1],g=Math.min(h(d+f,d+p,n,a),h(m+f,m+p,n,a)),v=Math.min(h(d+c,d+f,n,a),h(m+c,m+f,n,a));if(g>v&&vo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(N)&&(j=o.tickIncrement(j,b.size,!0,p)),D.start=r.l2r(j),F||i.nestedProperty(e,v+".start").set(D.start)}var U=b.end,V=r.r2l(z.end),q=void 0!==V;if((b.endFound||q)&&V!==r.r2l(U)){var H=q?V:i.aggNums(Math.max,null,d);D.end=r.l2r(H),q||i.nestedProperty(e,v+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=i.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var r,a,p,d,m=[],g=[],v=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=f(t,e,v,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],S=M?A:T,E=[],L=[],C=[],P=0,I=e.histnorm,z=e.histfunc,D=-1!==I.indexOf("density");_.enabled&&D&&(I=I.replace(/ ?density$/,""),D=!1);var O,R="max"===z||"min"===z?null:0,F=l.count,N=c[I],B=!1,j=function(t){return v.r2c(t,0,b)};for(i.isArrayOrTypedArray(e[x])&&"count"!==z&&(O=e[x],B="avg"===z,F=l[z]),r=j(T.start),p=j(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,_.direction,_.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,$=K-1;for(r=0;r=Q;r--)if(g[r]){$=r;break}for(r=Q;r<=$;r++)if(n(m[r])&&n(g[r])){var tt={p:m[r],s:g[r],b:0};_.enabled||(tt.pts=C[r],G?tt.ph0=tt.ph1=C[r].length?k[C[r][0]]:m[r]:(e._computePh=!0,tt.ph0=q(A[r]),tt.ph1=q(A[r+1],!0))),J.push(tt)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,b)-J[0].p),s(J,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(J,e,X),J},calcAllAutoBins:f}},{"../../lib":661,"../../plots/cartesian/axes":711,"../../registry":788,"../bar/arrays_to_calcdata":797,"./average":962,"./bin_functions":964,"./bin_label_vals":965,"./norm_functions":973,"fast-isnumeric":159}],967:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],968:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=t("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,h,f,p,d,m,g,v=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),A.length>S&&A.splice(S,A.length-S);var E=[],L=[],C=[],P="string"==typeof w.size,I="string"==typeof M.size,z=[],D=[],O=P?z:w,R=I?D:M,F=0,N=[],B=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),q="max"===U||"min"===U?null:0,H=a.count,G=o[j],Y=!1,Z=[],X=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==U&&(Y="avg"===U,H=a[U]);var K=w.size,J=x(w.start),Q=x(w.end)+(J-i.tickIncrement(J,K,!1,v))/1e6;for(r=J;r=0&&p=0&&d-1,flipY:E.tiling.flip.indexOf("y")>-1,orientation:E.tiling.orientation,pad:{inner:E.tiling.pad},maxDepth:E._maxDepth}).descendants(),z=1/0,D=-1/0;I.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),D=Math.max(D,e))})),p=p.data(I,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-z+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var O=null;if(w&&A){var R=u.getPtId(A);p.each((function(t){null===O&&u.getPtId(t)===R&&(O={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var F=function(){return O||{x0:0,x1:m,y0:0,y1:g}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-E.tiling.pad),s._hoverY=y(P?s.y1-E.tiling.pad/2:s.y0+E.tiling.pad/2);var p=n.select(this),d=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events","all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,F(),[m,g],{orientation:E.tiling.orientation,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1});return function(t){return x(e(t))}})):d.attr("d",x),p.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=f(s,r,E,e,S)||"";var T=i.ensureSingle(p,"g","slicetext"),A=i.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),I=i.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L?"start":"middle").call(a.font,I).call(o.convertToTspans,t),s.textBB=a.bBox(A.node()),s.transform=b(s,{fontSize:I.size}),s.transform.fontSize=I.size,w?A.transition().attrTween("transform",(function(t){var e=M(t,!1,F(),[m,g]);return function(t){return _(e(t))}})):A.attr("transform",_(s))})),O}},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../sunburst/fx":1150,"../sunburst/helpers":1151,"../sunburst/plot":1155,"../treemap/constants":1174,"./partition":991,"./style":993,"@plotly/d3":54}],988:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1082,"./attributes":983,"./base_plot":984,"./calc":985,"./defaults":986,"./layout_attributes":989,"./layout_defaults":990,"./plot":992,"./style":993}],989:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],990:[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("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":661,"./layout_attributes":989}],991:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(h,e,{swapXY:s,flipX:a,flipY:o}),h}},{"../treemap/flip_tree":1179,"d3-hierarchy":142}],992:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1176,"./draw_descendants":987}],993:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":524,"../../lib":661,"../bar/uniform_text":814,"@plotly/d3":54}],994:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,h=Math.floor((e-o.x0)/s.dx),f=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[f][h]:s._hasSource&&(u=s._canvas.el.getContext("2d").getImageData(h,f,1,1).data),u){var p,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var g,v=a.colormodel[s.colormodel],y=v.colormodel||s.colormodel,x=y.length,b=s._scaler(u),_=v.suffix,w=[];(s.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=y.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[f])?g=s.hovertext[f][h]:Array.isArray(s.text)&&Array.isArray(s.text[f])&&(g=s.text[f][h]);var T=c.c2p(o.y0+(f+.5)*s.dy),k=o.x0+(h+.5)*s.dx,M=o.y0+(f+.5)*s.dy,A="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[f,h],x0:l.c2p(o.x0+h*s.dx),x1:l.c2p(o.x0+(h+1)*s.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:A,text:g,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":564,"../../lib":661,"./constants":996}],1001:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":725,"./attributes":994,"./calc":995,"./defaults":997,"./event_data":998,"./hover":1e3,"./plot":1002,"./style":1003}],1002:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,h=e.yaxis,f=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&f)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===h.type;c._realImage=p;var d,m,g,v,y,x,b=l.z,_=l.x0,w=l.y0,T=l.w,k=l.h,M=c.dx,A=c.dy;for(x=0;void 0===d&&x0;)m=u.c2p(_+x*M),x--;for(x=0;void 0===v&&x0;)y=h.c2p(w+x*A),x--;if(mI[0];if(z||D){var O=d+S/2,R=v+E/2;C+="transform:"+a(O+"px",R+"px")+"scale("+(z?-1:1)+","+(D?-1:1)+")"+a(-O+"px",-R+"px")+";"}}L.attr("style",C);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=k;var r=e.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}})).then((function(){var t;if(c._hasZ)t=N((function(t,e){return b[e][t]})).toDataURL("image/png");else if(c._hasSource)if(p)t=c.source;else{var e=c._canvas.el.getContext("2d").getImageData(0,0,T,k).data;t=N((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}L.attr({"xlink:href":t,height:E,width:S,x:d,y:v})}));t._promises.push(F)}function N(t){var e=document.createElement("canvas");e.width=S,e.height=E;var r,n=e.getContext("2d"),a=function(t){return i.constrain(Math.round(u.c2p(_+t*M)-d),0,S)},o=function(t){return i.constrain(Math.round(h.c2p(w+t*A)-v),0,E)},f=s.colormodel[c.colormodel],p=f.colormodel||c.colormodel,m=f.fmt;for(x=0;x0}function T(t){t.each((function(t){y.stroke(n.select(this),t.line.color)})).each((function(t){y.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,v,t,e)}return m(i,a,l,s,n),g(i,a,l,s),a}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function A(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(p.convertToTspans,i).call(h.font,e),h.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var g,v=t._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(v._indicatorlayer,e,"trace").each((function(e){var m,E,L,C,P,I=e[0].trace,z=n.select(this),D=I._hasGauge,O=I._isAngular,R=I._isBullet,F=I.domain,N={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},B=N.l+N.w/2,j=N.t+N.h/2,U=Math.min(N.w/2,N.h),V=f.innerRadius*U,q=I.align||"center";if(E=j,D){if(O&&(m=B,E=j+U/2,L=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*V)}),R){var H=f.bulletPadding,G=1-f.bulletNumberDomainSize+H;m=N.l+(G+(1-G)*b[q])*N.w,L=function(t){return M(t,(f.bulletNumberDomainSize-H)*N.w,N.h)}}}else m=N.l+b[q]*N.w,L=function(t){return M(t,N.w,N.h)};!function(t,e,r,i){var c,u,f,m=r[0].trace,g=i.numbersX,v=i.numbersY,T=m.align||"center",M=x[T],E=i.transitionOpts,L=i.onComplete,C=o.ensureSingle(e,"g","numbers"),P=[];m._hasNumber&&P.push("number");m._hasDelta&&(P.push("delta"),"left"===m.delta.position&&P.reverse());var I=C.selectAll("text").data(P);function z(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}I.enter().append("text"),I.attr("text-anchor",(function(){return M})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var D,O=m.mode+m.align;m._hasDelta&&(D=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=function(t){return m.delta.relative?t.relativeDelta:t.delta},s=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+e(t)},l=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=o(r[0]));var c=C.select("text.delta");function f(){c.text(s(o(r[0]),i)).call(y.fill,l(r[0])).call(p.convertToTspans,t)}return c.call(h.font,m.delta.font).call(y.fill,l({delta:m._deltaLastValue})),w(E)?c.transition().duration(E.duration).ease(E.easing).tween("text",(function(){var t=n.select(this),e=o(r[0]),c=m._deltaLastValue,u=z(m.delta.valueformat,i,c,e),h=a(c,e);return m._deltaLastValue=e,function(e){t.text(s(h(e),u)),t.call(y.fill,l({delta:h(e)}))}})).each("end",(function(){f(),L&&L()})).each("interrupt",(function(){f(),L&&L()})):f(),u=A(s(o(r[0]),i),m.delta.font,M,t),c}(),O+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,O+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=C.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(h.font,m.number.font).call(p.convertToTspans,t)}w(E)?l.transition().duration(E.duration).ease(E.easing).each("end",(function(){u(),L&&L()})).each("interrupt",(function(){u(),L&&L()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=z(m.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=A(s+i(r[0].y)+o,m.number.font,M,t)}(),O+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c);if(m._hasDelta&&m._hasNumber){var R,F,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],B=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+j),O,Math.min),F=N[1]-B[1],f={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+j,O,Math.max),F=N[1]-B[1],f={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),D.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&C.attr("transform",(function(){var t=i.numbersScaler(f);O+=t[2];var e,r=S(m,"numbersScale",1,t[0],O,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?v-r*f.bottom:v-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+e;var n=f[T];"center"===T&&(n=(f.left+f.right)/2);var a=g-r*n;return a=S(m,"numbersTranslate",0,a,O,Math.max),l(a,e)+s(r)}))}(t,z,e,{numbersX:m,numbersY:E,numbersScaler:L,transitionOpts:r,onComplete:g}),D&&(C={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},P={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var Y=z.selectAll("g.angular").data(O?e:[]);Y.exit().remove();var Z=z.selectAll("g.angularaxis").data(O?e:[]);Z.exit().remove(),O&&function(t,e,r,a){var o,s,h,f,p=r[0].trace,m=a.size,g=a.radius,v=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,M=a.layer,A=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function L(t){var e=p.gauge.axis.range[0],r=(t-e)/(p.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function C(t){return n.svg.arc().innerRadius((v+g)/2-t/2*(g-v)).outerRadius((v+g)/2+t/2*(g-v)).startAngle(-E)}function P(t){t.attr("d",(function(t){return C(t.thickness).startAngle(L(t.range[0])).endAngle(L(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),M.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),M.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},D=d.makeLabelFns(o,0).labelStandoff;z.xFn=function(t){var e=I(t);return Math.cos(e)*D},z.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(D+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},z.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return l(b[0]+g*Math.cos(t),b[1]-g*Math.sin(t))};h=function(t){return O(I(t))};if(s=d.calcTicks(o),f=d.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:M,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(t){var e=I(t);return O(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:M,transFn:h,labelFns:z})}var F=[y].concat(p.gauge.steps),N=_.selectAll("g.bg-arc").data(F);N.enter().append("g").classed("bg-arc",!0).append("path"),N.select("path").call(P).call(T),N.exit().remove();var B=C(p.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([p.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U=j.select("path");w(A)?(U.transition().duration(A.duration).ease(A.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=B,q=L(r[0].lastY),H=L(r[0].y),function(){var t=i(q,H);return function(e){return V.endAngle(t(e))()}})),p._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?B.endAngle(L(r[0].y)):"M0,0Z");var V,q,H;U.call(T),j.exit().remove(),F=[];var G=p.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var Y=_.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(P).call(T),Z.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:Z,size:N,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var X=z.selectAll("g.bullet").data(R?e:[]);X.exit().remove();var W=z.selectAll("g.bulletaxis").data(R?e:[]);W.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,h=n.gauge,p=n.layer,m=n.gaugeBg,g=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;h.enter().append("g").classed("bullet",!0),h.attr("transform",l(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var M=v.h,A=u.gauge.bar.thickness*M,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-f.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=v.t+v.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:p,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:p,transFn:o,labelFns:d.makeLabelFns(i,c)}));function L(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*M})).attr("height",(function(t){return t.thickness*M}))}var C=[m].concat(u.gauge.steps),P=h.selectAll("g.bg-bullet").data(C);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(L).call(T),P.exit().remove();var I=h.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",A).attr("y",(M-A)/2).call(T),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);I.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),D=h.selectAll("g.threshold-bullet").data(z);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*M).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*M).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),D.exit().remove();var O=h.selectAll("g.gauge-outline").data([g]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(L).call(T),O.exit().remove()}(t,0,e,{gauge:X,layer:W,size:N,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var K=z.selectAll("text.title").data(e);K.exit().remove(),K.enter().append("text").classed("title",!0),K.attr("text-anchor",(function(){return R?x.right:x[I.title.align]})).text(I.title.text).call(h.font,I.title.font).call(p.convertToTspans,t),K.attr("transform",(function(){var t,e=N.l+N.w*b[I.title.align],r=f.titlePadding,n=h.bBox(K.node());if(D){if(O)if(I.gauge.axis.visible)t=h.bBox(Z.node()).top-r-n.bottom;else t=N.t+N.h/2-U/2-n.bottom-r;R&&(t=E-(n.top+n.bottom)/2,e=N.l-f.bulletPadding*N.w)}else t=I._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":524,"../../components/drawing":546,"../../constants/alignment":629,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/cartesian/axes":711,"../../plots/cartesian/axis_defaults":713,"../../plots/cartesian/layout_attributes":726,"../../plots/cartesian/position_defaults":729,"./constants":1007,"@plotly/d3":54,"d3-interpolate":143}],1011:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../mesh3d/attributes":1016}],1012:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:L(d,m,v);f[p]=x>-1?x:I(d,m,v,R(e,y))}i=f[0],a=f[1],o=f[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function N(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=N(f,u,n,i),d=N(f,h,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,h,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=N(h,u,n,i),d=N(f,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(t,e,r,n){var i=!1,a=U(e),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]];if(m)i=F(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=N(f,c,r,n),d=N(f,u,r,n),g=N(f,h,r,n);i=F(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=N(h,c,r,n),d=N(h,u,r,n),g=N(f,u,r,n),v=N(f,c,r,n);m?(i=F(t,[c,v,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,v],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=N(u,c,r,n),d=N(h,c,r,n),g=N(f,c,r,n);m?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,g],[-1,-1,-1])||i,s=!0}})),i)}function H(t,e,r,n,i,a,o,s,l,c,u){var h=!1;return d&&(O(t,"A")&&(h=q(null,[e,r,n,a],c,u)||h),O(t,"B")&&(h=q(null,[r,n,i,l],c,u)||h),O(t,"C")&&(h=q(null,[r,a,o,l],c,u)||h),O(t,"D")&&(h=q(null,[n,a,s,l],c,u)||h),O(t,"E")&&(h=q(null,[r,n,a,l],c,u)||h)),m&&(h=q(t,[r,n,a,l],c,u)||h),h}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Y(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function Z(t,e,r,n,i,a,o){var s,l,c,u,h=!1,f=function(){h=V(t,[s,l,c],[-1,-1,-1],i,a)||h,h=V(t,[c,u,s],[-1,-1,-1],i,a)||h},p=o[0],d=o[1],m=o[2];return p&&(s=z(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=z(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=z(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=z(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),f()),d&&(s=z(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=z(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=z(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=z(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),f()),m&&(s=z(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],m),l=z(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],m),c=z(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],m),u=z(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],m),f()),h}function X(t,e,r,n,i,a,o,s,l,c,u,h){var f=t;return h?(d&&"even"===t&&(f=null),H(f,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(f=null),H(f,l,s,o,a,i,n,r,e,c,u))}function W(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-A)?[M,d]:[d,A];$(e,T[0],T[1])}}var L=[[Math.min(S,A),Math.max(S,A)],[Math.min(M,E),Math.max(M,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?h.push([p.distRatio,0,0]):"y"===e?h.push([0,p.distRatio,0]):h.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,h,r[i]):"y"===e?et(null,u,a,o,h,r[i]):rt(null,u,a,o,h,r[i]),i++),c.length>0&&(r[i]="x"===e?W(null,c,a,o,r[i]):"y"===e?K(null,c,a,o,r[i]):J(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(D(d.fill),r[i]="x"===e?W(null,[0,b-1],a,o,r[i]):"y"===e?K(null,[0,_-1],a,o,r[i]):J(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":536,"../../lib/gl_format_color":657,"../../lib/str2rgbarray":685,"../../plots/gl3d/zip3":764,"gl-mesh3d":219}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),h=a("z"),f=a("value");c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":534,"../../lib":661,"../../registry":788,"./attributes":1011}],1015:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":753,"./attributes":1011,"./calc":1012,"./convert":1013,"./defaults":1014}],1016:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../surface/attributes":1157}],1017:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":532}],1018:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,h=t.x.length,f=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;n=u(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(f):t.alphahull>0?a(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ov):g=M>w,v=M;var A=c(w,T,k,M);A.pos=_,A.yc=(w+M)/2,A.i=b,A.dir=g?"increasing":"decreasing",A.x=A.pos,A.y=[k,T],y&&(A.orig_p=r[b]),d&&(A.tx=e.text[b]),m&&(A.htx=e.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(f,h),{padded:!0}),x.length&&(x[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},f)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",h.push(y),g[b]=y)}return h}function f(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,h=a[0].t,f=u(t,e,r,i);if(!f)return[];var p=a[f.index],d=f.index=p.i,m=p.dir;function g(t){return h.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+c[m]]:[];return _&&s(p,l,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?h(t,e,r,n):f(t,e,r,n)},hoverSplit:h,hoverOnPoints:f}},{"../../components/color":524,"../../components/fx":564,"../../constants/delta.js":631,"../../lib":661,"../../plots/cartesian/axes":711}],1025:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":725,"./attributes":1021,"./calc":1022,"./defaults":1023,"./hover":1024,"./plot":1027,"./select":1028,"./style":1029}],1026:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,i.minRowLength(o))),e._length=h,h}}},{"../../lib":661,"../../registry":788}],1027:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":661,"@plotly/d3":54}],1028:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,h){function f(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,h,f);o(e,h,f),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var m={family:h.font.family,size:Math.round(h.font.size),color:h.font.color};n.coerceFont(f,"labelfont",m);var g={family:h.font.family,size:Math.round(h.font.size/1.2),color:h.font.color};n.coerceFont(f,"tickfont",g)}},{"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"../../lib":661,"../../plots/array_container_defaults":706,"../../plots/domain":739,"../parcoords/merge_length":1037,"./attributes":1030}],1034:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1030,"./base_plot":1031,"./calc":1032,"./defaults":1033,"./plot":1036}],1035:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),h=t("../../lib/svg_text_utils");function f(t,e,r,i){var a=t.map(F.bind(0,e,r)),o=i.selectAll("g.parcatslayer").data([null]);o.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=o.selectAll("g.trace.parcats").data(a,p),f=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return l(t.x,t.y)})),f.append("g").attr("class","paths");var y=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),p);y.attr("fill",(function(t){return t.model.color}));var x=y.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(x),y.attr("d",(function(t){return t.svgD})),x.empty()||y.sort(m),y.exit().remove(),y.on("mouseover",g).on("mouseout",v).on("click",b),f.append("g").attr("class","dimensions");var w=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),p);w.enter().append("g").attr("class","dimension"),w.attr("transform",(function(t){return l(t.x,0)})),w.exit().remove();var M=w.selectAll("g.category").data((function(t){return t.categories}),p),A=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(A);var S=M.selectAll("rect.bandrect").data((function(t){return t.bands}),p);S.each((function(){s.raiseToTop(this)})),S.attr("fill",(function(t){return t.color}));var E=S.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);S.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(E),S.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var D=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",h.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),h.convertToTspans(n.select(this),e)})),A.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",C),M.exit().remove(),w.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",P).on("drag",I).on("dragend",z)),u.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function p(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),L=n.mouse(h)[0];o.loneHover({trace:f,x:b-d.left+m.left,y:_-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:L1&&f.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,v=m/u.parcatsViewModel.model.count,y={countLabel:m,categoryLabel:g,probabilityLabel:v.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:v}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=M(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=M(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),A(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=E(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),h=c.categoryViewModel,f=h.parcatsViewModel,p=f.model.dimensions[h.model.dimensionInd],d=f.trace,m=l.y+l.height/2;f.dimensions.length>1&&p.displayInd===f.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,v=c.parcatsViewModel.model.count,y=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(y+=t.count)}));var x=h.model.count,b=0;f.pathSelection.each((function(t){t.model.color===c.color&&(b+=t.model.count)}));var _=y/v,w=y/b,T=y/x,k={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},M=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",k.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(M.push("P(color \u2229 "+g+"): "+k.probabilityLabel),M.push("P("+g+" | color): "+w.toFixed(3)),M.push("P(color | "+g+"): "+T.toFixed(3)));var A=M.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:A,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:v,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(E(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function C(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):A(this,"plotly_unhover",n.event)}}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var f=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==f&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),B(t.parcatsViewModel),R(t.parcatsViewModel),O(t.parcatsViewModel)}}function z(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=D(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):A(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),B(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),O(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function D(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function B(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),i=h(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var f=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=t.model.maxCats,f=e.categories.length,p=e.count,d=t.height-8*(h-1),m=8*(h-f)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){f(r,t,n,e)}},{"../../components/drawing":546,"../../components/fx":564,"../../lib":661,"../../lib/svg_text_utils":686,"../../plot_api/plot_api":697,"@plotly/d3":54,"d3-interpolate":143,tinycolor2:471}],1036:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":1035}],1037:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a;for(n||(n=1/0),i=0;i0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(c("labels"),c("values")),h=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),h){e._length=h,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),d=c("texttemplate");if(d||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||f&&"none"!==f){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var g=c("hole");if(c("title.text")){var v=c("title.position",g?"middle center":"top center");g||"middle center"!==v||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":661,"../../plots/domain":739,"../bar/defaults":802,"./attributes":1038,"fast-isnumeric":159}],1042:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":560}],1043:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:h.hovertemplate||-1!==f.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[v(t,h)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[v(t,h)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[v(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[v(t,i)],a.click(e,n.event))}))}function b(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)v(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)v(Math.PI*(g+1),"tan")}if(h||p){for(g=4;g>=-4;g-=2)v(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)v(Math.PI*(g+.5),"rad")}}if(s||d||h){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||f)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:M(a,o/e),rotate:A(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:M(a,o/e),rotate:A(i+Math.PI/2)}}function M(t,e){return Math.cos(e)-t*e}function A(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function L(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 C(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),h=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(h+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?h*=2:-1!==a.title.position.indexOf("right")&&(h+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=h/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function I(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function z(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,a=r._size;d("pie",r),_(e,t),z(e,a);var f=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var f=n.select(this),d=e[0],m=d.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),f.attr("stroke-linejoin","round"),f.each((function(){var v=n.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var y=[[[],[]],[[],[]]],_=!1;v.each((function(i,a){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=m.index,y[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var o=d.cx,c=d.cy,u=n.select(this),f=u.selectAll("path.surface").data([i]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,t,e),m.pull){var v=+g.castOption(m.pull,i.pts)||0;v>0&&(o+=v*i.pxmid[0],c+=v*i.pxmid[1])}i.cxFinal=o,i.cyFinal=c;var T=m.hole;if(i.v===d.vTotal){var k="M"+(o+i.px0[0])+","+(c+i.px0[1])+C(i.px0,i.pxmid,!0,1)+C(i.pxmid,i.px0,!0,1)+"Z";T?f.attr("d","M"+(o+T*i.px0[0])+","+(c+T*i.px0[1])+C(i.px0,i.pxmid,!1,T)+C(i.pxmid,i.px0,!1,T)+"Z"+k):f.attr("d",k)}else{var M=C(i.px0,i.px1,!0,1);if(T){var A=1-T;f.attr("d","M"+(o+T*i.px1[0])+","+(c+T*i.px1[1])+C(i.px1,i.px0,!1,T)+"l"+A*i.px0[0]+","+A*i.px0[1]+M+"Z")}else f.attr("d","M"+o+","+c+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}O(t,i,d);var S=g.castOption(m.textposition,i.pts),E=u.selectAll("g.slicetext").data(i.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each((function(){var u=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),f=l.ensureUniformFontSize(t,"outside"===S?function(t,e,r){var n=g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,i=g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(m,i,r.font):b(m,i,r.font));u.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,f).call(h.convertToTspans,t);var v,y=s.bBox(u.node());if("outside"===S)v=L(y,i);else if(v=w(y,i,d),"auto"===S&&v.scale<1){var x=l.ensureUniformFontSize(t,m.outsidetextfont);u.call(s.font,x),v=L(y=s.bBox(u.node()),i)}var T=v.textPosAngle,k=void 0===T?i.pxmid:D(d.r,T);if(v.targetX=o+k[0]*v.rCenter+(v.x||0),v.targetY=c+k[1]*v.rCenter+(v.y||0),R(v,y),v.outside){var M=v.targetY;i.yLabelMin=M-y.height/2,i.yLabelMid=M,i.yLabelMax=M+y.height/2,i.labelExtraX=0,i.labelExtraY=0,_=!0}v.fontSize=f.size,p(m.type,v,r),e[a].transform=v,u.attr("transform",l.getTextTransform(v))}))}function C(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*d.r+","+n*d.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=m.title.text;m._meta&&(i=l.templateString(i,m._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,m.title.font).call(h.convertToTspans,t),e="middle center"===m.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(d):C(d,a),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),_&&function(t,e){var r,n,i,a,o,s,l,c,u,h,f,p,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-d;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(g.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(m+t.labelExtraY-v)*l>0&&(i=3*s*Math.abs(c-h.indexOf(t)),(f=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=f)))}for(n=0;n<2;n++)for(i=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],h=u.concat(c),p=[],f=0;fMath.abs(h)?s+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(v,m),_&&m.automargin){var k=s.bBox(f.node()),M=m.domain,A=a.w*(M.x[1]-M.x[0]),S=a.h*(M.y[1]-M.y[0]),E=(.5*A-d.r)/a.w,P=(.5*S-d.r)/a.h;i.autoMargin(t,"pie."+m.uid+".automargin",{xl:M.x[0]-E,xr:M.x[1]+E,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(d.cx-d.r-k.left,0),r:Math.max(k.right-(d.cx+d.r),0),b:Math.max(k.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-k.top,0),pad:5})}}))}));setTimeout((function(){f.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:O,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:z,attachFxHandlers:x,computeTransform:R}},{"../../components/color":524,"../../components/drawing":546,"../../components/fx":564,"../../lib":661,"../../lib/svg_text_utils":686,"../../plots/plots":774,"../bar/constants":800,"../bar/uniform_text":814,"./event_data":1042,"./helpers":1043,"@plotly/d3":54}],1048:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(i,t,e)}))}))}},{"../bar/uniform_text":814,"./style_one":1049,"@plotly/d3":54}],1049:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":524,"./helpers":1043}],1050:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1064}],1051:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(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=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.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}},l.update=function(t){this.index=t.index,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=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,h=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(h){if(n=h,e=h.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=i(t.marker.color),g=i(t.marker.border.color),v=t.opacity*t.marker.opacity;m[3]*=v,this.pointcloudOptions.color=m;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,g[3]*=v,this.pointcloudOptions.borderColor=g;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":685,"../../plots/cartesian/autorange":710,"../scatter/get_trace_color":1074,"gl-pointcloud2d":231}],1052:[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"),e._length=null}},{"../../lib":661,"./attributes":1050}],1053:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":751,"../scatter3d/calc":1093,"./attributes":1050,"./convert":1051,"./defaults":1052}],1054:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,h=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,f=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll;(e.exports=p({hoverinfo:f({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:h("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:f(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":523,"../../components/colorscale/attributes":531,"../../components/fx/attributes":555,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plot_api/plot_template":700,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/domain":739,"../../plots/font_attributes":740,"../../plots/template_attributes":783}],1055:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../plots/cartesian/select").prepSelect,u=t("../../lib"),h=t("../../registry");function f(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==i&&"zoom"!==i){s(o,a);var f={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:f,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;ry&&(y=a.source[e]),a.target[e]>y&&(y=a.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(L,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(L)||w[E]!==w[L])){w.hasOwnProperty(L)&&(L=w[L]),w.hasOwnProperty(E)&&(E=w[E]),L=+L,f[E=+E]=f[L]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var P=null;C&&p.hasOwnProperty(C)&&(P=p[C]),c.push({pointNumber:e,label:C,color:u?a.color[e]:a.color,customdata:h?a.customdata[e]:a.customdata,concentrationscale:P,source:E,target:L,value:+S}),A.source.push(E),A.target.push(L)}}var I=b+_.length,z=o(r.color),D=o(r.customdata),O=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:z?r.color[e]:r.color,customdata:D?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(I,A.source,A.target)&&(F=!0),{circular:F,links:c,nodes:O,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":536,"../../lib":661,"../../lib/gup":658,"strongly-connected-components":467}],1057:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],1058:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function h(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,f){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(f.hoverlabel,t.hoverlabel),m=t.node,g=c.newContainer(e,"node");function v(t,e){return n.coerce(m,g,i.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(m,g,v,d),v("hovertemplate");var y=f.colorway;v("color",g.label.map((function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(f.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:h}),s(e,f,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},f.font)),e._length=null}},{"../../components/color":524,"../../components/fx/hoverlabel_defaults":562,"../../lib":661,"../../plot_api/plot_template":700,"../../plots/array_container_defaults":706,"../../plots/domain":739,"./attributes":1054,tinycolor2:471}],1059:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1054,"./base_plot":1055,"./calc":1056,"./defaults":1058,"./plot":1060,"./select.js":1062}],1060:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function h(t){return""!==t}function f(t,e){return t.filter((function(t){return t.key===e.traceId}))}function p(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function v(t,e,r){e&&r&&f(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&f(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(b.bind(0,e,r,!1))}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&f(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&f(e,t).selectAll("."+c.sankeyNode).filter(g(t)).call(v)}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&f(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&f(e,t).selectAll(c.sankeyNode).filter(g(t)).call(y)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,f=r._size,m=0;m"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(y,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":524,"../../components/fx":564,"../../lib":661,"./constants":1057,"./render":1061,"@plotly/d3":54}],1061:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),h=t("../../components/drawing"),f=t("../../lib"),p=f.strTranslate,d=f.strRotate,m=t("../../lib/gup"),g=m.keyFun,v=m.repeat,y=m.unwrap,x=t("../../lib/svg_text_utils"),b=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,T=_.LINE_SPACING;function k(t,e,r){var n,i=y(e),a=i.trace,u=a.domain,h="h"===a.orientation,p=a.node.pad,d=a.node.thickness,m=t.width*(u.x[1]-u.x[0]),g=t.height*(u.y[1]-u.y[0]),v=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(h?[m,g]:[g,m]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(v).links(x);var _,w,T,k=n();for(var M in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=k.nodes));n.update(k)}return{circular:b,key:r,trace:a,guid:f.randstr(),horizontal:h,width:m,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:h?g:m,dragPerpendicular:h?m:g,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:A,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function A(){return function(t){if(t.link.circular)return e=t.link,r=e.width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,a=t.link.source.x1,o=t.link.target.x0,s=i(a,o),l=s(.5),c=s(.5),u=t.link.y0-t.link.width/2,h=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2;return"M"+a+","+u+"C"+l+","+u+" "+c+","+f+" "+o+","+f+"L"+o+","+p+"C"+c+","+p+" "+l+","+h+" "+a+","+h+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=f.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",(function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function L(t){t.call(E)}function C(t,e){t.call(L),e.attr("d",A())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function I(t){return t.link.width>1||t.linkLineWidth>0}function z(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function D(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function O(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(f.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),f.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(t.filter(N(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&C[v].gap;)v--;for(x=C[v].s,m=C.length-1;m>v;m--)C[m].s=x;for(;lA[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1071:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),h=t("./marker_defaults"),f=t("./line_defaults"),p=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,a,r,i)}var y=l(t,e,g,v);if(y||(e.visible=!1),e.visible){c(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=u(t,e,g,v),b=!x&&y=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(f.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return aZ!=(B=D[I][1])>=Z&&(R=D[I-1][0],F=D[I][0],B-N&&(O=R+(F-R)*(Z-N)/(B-N),q=Math.min(q,O),H=Math.max(H,O)));q=Math.max(q,0),H=Math.min(H,f._length);var X=s.defaultLine;return s.opacity(h.fillcolor)?X=h.fillcolor:s.opacity((h.line||{}).color)&&(X=h.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:H,y0:Z,y1:Z,color:X,hovertemplate:!1}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":524,"../../components/fx":564,"../../lib":661,"../../registry":788,"./get_trace_color":1074}],1076:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":725,"./arrays_to_calcdata":1063,"./attributes":1064,"./calc":1065,"./cross_trace_calc":1069,"./cross_trace_defaults":1070,"./defaults":1071,"./format_labels":1073,"./hover":1075,"./marker_colorbar":1082,"./plot":1085,"./select":1086,"./style":1088,"./subtypes":1089}],1077:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"../../lib":661}],1078:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),c=l.segmentsIntersect,u=l.constrain,h=t("./constants");e.exports=function(t,e){var r,n,a,f,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S=e.xaxis,E=e.yaxis,L="log"===S.type,C="log"===E.type,P=S._length,I=E._length,z=e.connectGaps,D=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,N=[],B=h.minTolerance,j=t.length,U=new Array(j),V=0;function q(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?E.l2p(n.y):E.c2p(n.y);if(a===i){if(L&&(a=S.c2p(n.x,!0)),a===i)return!1;C&&l===i&&(a*=Math.abs(S._m*I*(S._m>0?o:s)/(E._m*P*(E._m>0?o:s)))),a*=1e3}if(l===i){if(C&&(l=E.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function H(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&crt||t[1]it)return[u(t[0],et,rt),u(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c);return s}}function ct(t){var e=t[0],r=t[1],n=e===U[V-1][0],i=r===U[V-1][1];if(!n||!i)if(V>1){var a=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&a?o?V--:U[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ut(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ct([W,K]),ct(t),J=null,W=K=0}function ht(t){if(M=t[0]/P,A=t[1]/I,Z=t[0]rt?rt:0,X=t[1]it?it:0,Z||X){if(V)if(J){var e=$(J,t);e.length>1&&(ut(e[0]),U[V++]=e[1])}else Q=$(U[V-1],t)[0],U[V++]=Q;else U[V++]=[Z||t[0],X||t[1]];var r=U[V-1];Z&&X&&(r[0]!==Z||r[1]!==X)?(J&&(W!==Z&&K!==X?ct(W&&K?(n=J,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[W||Z,K||X]):W&&K&&ct([W,K])),ct([Z,X])):W-Z&&K-X&&ct([Z||W,X||K]),J=t,W=Z,K=X}else J&&ut($(J,t)[0]),U[V++]=t;var n,i,a,o}for("linear"===O||"spline"===O?$=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,t)G(d,ft))break;a=d,(_=v[0]*g[0]+v[1]*g[1])>x?(x=_,f=d,m=!1):_=t.length||!d)break;ht(d),n=d}}else ht(f)}J&&ct([W||J[0],K||J[1]]),N.push(U.slice(0,V))}return N}},{"../../constants/numerical":637,"../../lib":661,"./constants":1068}],1079:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1080:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,c={},u=!1,h=-1,f=0,p=-1;for(a=0;a=0?l=p:(l=p=f,f++),l0?Math.max(r,a):0}}},{"fast-isnumeric":159}],1082:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1083:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),h=(t.line||{}).color;(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":524,"../../components/colorscale/defaults":534,"../../components/colorscale/helpers":535,"./subtypes":1089}],1084:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":637,"../../lib":661}],1085:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),h=t("./link_traces"),f=t("../../lib/polygon").tester;function p(t,e,r,h,p,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),h=n.extent(a.simpleMap(l.range,l.r2c)),f=i[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=h[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===_.visible){var E,L;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),h[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,z="",D=[],O=_._prevtrace;O&&(z=O._prevRevpath||"",L=O._nextFill,D=O._polygons);var R,F,N,B,j,U,V,q="",H="",G=[],Y=a.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(L&&L.datum(h),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},G=u(h,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(h),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",P),l.singleLineStyle(h,i)}}}}}var Z=M.selectAll(".js-line").data(G);y(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(Z,r.layerClipId,t),G.length?(E?(E.datum(h),B&&U&&(C?("y"===C?B[1]=U[1]=b.c2p(0,!0):"x"===C&&(B[0]=U[0]=x.c2p(0,!0)),y(E).attr("d","M"+U+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):y(E).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===_.fill.substr(0,6)&&q&&z?("tonext"===_.fill?y(L).attr("d",q+"Z"+z+"Z").call(l.singleFillStyle):y(L).attr("d",q+"L"+z.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(D)):(W(L),_._polygons=null)),_._prevRevpath=H,_._prevPolygons=V):(E?W(E):L&&W(L),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(h),S.datum(h),function(e,i,a){var o,u=a[0].trace,h=c.hasMarkers(u),f=c.hasText(u),p=tt(u),d=et,m=et;if(h||f){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?J:K:_&&!w&&(g=Q),h&&(d=g),f&&(m=g)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),h&&(T=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,h);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(A,X,t),l.setClipUrl(S,X,t)}function W(t){y(t).attr("d","M0,0Z")}function K(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,f,d=!a,m=!!a&&a.duration>0,g=h(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(f=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){p(t,n,e,r,g,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":546,"../../lib":661,"../../lib/polygon":673,"../../registry":788,"./line_points":1078,"./link_traces":1080,"./subtypes":1089,"@plotly/d3":54}],1086:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r0){var f=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=f),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,f)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&h("surfacecolor",f||p);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];h(g+".show")&&(h(g+".opacity"),h(g+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,f||p||r,{axis:"z"}),v(t,e,f||p||r,{axis:"y",inherit:"z"}),v(t,e,f||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":661,"../../registry":788,"../scatter/line_defaults":1077,"../scatter/marker_defaults":1083,"../scatter/subtypes":1089,"../scatter/text_defaults":1090,"./attributes":1092}],1097:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":635,"../../plots/gl3d":753,"./attributes":1092,"./calc":1093,"./convert":1095,"./defaults":1096}],1098:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/template_attributes":783,"../scatter/attributes":1064}],1099:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,h,f=e._length,p=new Array(f),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":661,"../scatter/hover":1075}],1104:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":725,"../scatter/marker_colorbar":1082,"../scatter/select":1086,"../scatter/style":1088,"./attributes":1098,"./calc":1099,"./defaults":1100,"./event_data":1101,"./format_labels":1102,"./hover":1103,"./plot":1105}],1105:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,h={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,h,r,o),s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":564,"../../constants/numerical":637,"../../lib":661,"../scatter/get_trace_color":1074,"./attributes":1106}],1112:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":744,"../scatter/marker_colorbar":1082,"../scatter/style":1088,"./attributes":1106,"./calc":1107,"./defaults":1108,"./event_data":1109,"./format_labels":1110,"./hover":1111,"./plot":1113,"./select":1114,"./style":1115}],1113:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,h=t("../scatter/subtypes"),f=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],h=o._subplot,f=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):a(i,h.topojson);for(r=0;r")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,u=t.xa,h=t.ya,f=t.subplot,p=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-p;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=f.project([n,a]),l=o.x-u.c2p([d,a]),c=o.y-h.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-p,1-3/p)}),t),!1!==t.index){var m=o[t.index],g=m.lonlat,v=[i.modHalf(g[0],360)+p,g[1]],y=u.c2p(v),x=h.c2p(v),b=m.mrc||1;t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b;var _={};_[c.subplot]={_subplot:f};var w=c._module.formatLabels(m,c,_);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(c,m),t.extraText=l(c,m,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:l}},{"../../components/fx":564,"../../constants/numerical":637,"../../lib":661,"../scatter/get_trace_color":1074}],1122:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":768,"../scatter/marker_colorbar":1082,"../scattergeo/calc":1107,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./format_labels":1120,"./hover":1121,"./plot":1123,"./select":1124}],1123:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],c=0;c")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":1075}],1130:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":777,"../scatter/marker_colorbar":1082,"../scatter/select":1086,"../scatter/style":1088,"./attributes":1125,"./calc":1126,"./defaults":1127,"./format_labels":1128,"./hover":1129,"./plot":1131}],1131:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,c=0;c"),o.hovertemplate=f.hovertemplate,a}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":1075}],1138:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":784,"../scatter/marker_colorbar":1082,"../scatter/select":1086,"../scatter/style":1088,"./attributes":1132,"./calc":1133,"./defaults":1134,"./event_data":1135,"./format_labels":1136,"./hover":1137,"./plot":1139}],1139:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,a,r,o)}},{"../scatter/plot":1085}],1140:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783,"../mesh3d/attributes":1016}],1141:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/calc");function a(t){var e,r,i,a,s,l,c,u,h,f,p,d,m=t._x,g=t._y,v=t._z,y=t._len,x=-1/0,b=1/0,_=-1/0,w=1/0,T=-1/0,k=1/0,M="";for(y&&(c=m[0],h=g[0],p=v[0]),y>1&&(u=m[y-1],f=g[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var L=function(){y=0,A=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,h={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(h.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(h.meshgrid=[m,g,v],h.gridFill=e._gridFill,e._slen)h.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=g[0],x=f(m),b=f(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(g.length,x.length),l=function(t){return M(g[t])&&A(t)},h=function(t){return String(g[t])}):(r=Math.min(y.length,x.length),l=function(t){return M(y[t])&&A(t)},h=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=a.randstr(),I=0;I"),name:M||D("name")?y.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:M,hovertemplateLabels:P,eventData:l};g&&(F.x0=E-i.rInscribed*i.rpx1,F.x1=E+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),v&&(F.x=E,F.idealAlign=E<0?"left":"right");var N=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:N}),l[0].bbox=N[0],d._hasHoverLabel=!0}if(v){var B=t.select("path.surface");f.styleOne(B,i,y,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[h(i,y,f.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[h(s,a,f.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");f.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),v=c.getPtId(p),y={points:[h(t,a,f.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[h(t,a,f.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,b,_)}}))}},{"../../components/fx":564,"../../components/fx/helpers":560,"../../lib":661,"../../lib/events":650,"../../registry":788,"../pie/helpers":1043,"./helpers":1151,"@plotly/d3":54}],1151:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":524,"../../lib":661,"../../lib/setcursor":681,"../pie/helpers":1043}],1152:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1082,"./attributes":1145,"./base_plot":1146,"./calc":1147,"./defaults":1149,"./layout_attributes":1153,"./layout_defaults":1154,"./plot":1155,"./style":1156}],1153:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1154:[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("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":661,"./layout_attributes":1153}],1155:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,h=c.clearMinTextSize,f=t("../pie/plot"),p=t("../pie/helpers").getRotationAngle,d=f.computeTransform,m=f.transformInsideText,g=t("./style").styleOne,v=t("../bar/style").resizeText,y=t("./fx"),x=t("./constants"),b=t("./helpers");function _(t,e,c,h){var f=t._fullLayout,v=!f.uniformtext.mode&&b.hasTransition(h),_=n.select(c).selectAll("g.slice"),T=e[0],k=T.trace,M=T.hierarchy,A=b.findEntryWithLevel(M,k.level),S=b.getMaxDepth(k),E=f._size,L=k.domain,C=E.w*(L.x[1]-L.x[0]),P=E.h*(L.y[1]-L.y[0]),I=.5*Math.min(C,P),z=T.cx=E.l+E.w*(L.x[1]+L.x[0])/2,D=T.cy=E.t+E.h*(1-L.y[0])-P/2;if(!A)return _.remove();var O=null,R={};v&&_.each((function(t){R[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!O&&b.isEntry(t)&&(O=t)}));var F=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(A).descendants(),N=A.height+1,B=0,j=S;T.hasMultipleRoots&&b.isHierarchyRoot(A)&&(F=F.slice(1),N-=1,B=1,j+=1),F=F.filter((function(t){return t.y1<=j}));var U=p(k.rotation);U&&F.forEach((function(t){t.x0+=U,t.x1+=U}));var V=Math.min(N,S),q=function(t){return(t-B)/V*I},H=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},G=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,z,D)},Y=function(t){return z+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(_=_.data(F,b.getPtId)).enter().append("g").classed("slice",!0),v?_.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=b.getPtId(t),n=R[r],i=R[b.getPtId(A)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+U;e=t.rpx1X?2*Math.PI:0)+U;e={x0:i,x1:i}}else e={rpx0:I,rpx1:I},s.extendFlat(e,J(t));else e={rpx0:0,rpx1:0};else e={x0:U,x1:U};return a(e,n)}(t);return function(t){return G(e(t))}})):h.attr("d",G),c.call(y,A,t,e,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),h.call(g,i,k);var p=s.ensureSingle(c,"g","slicetext"),_=s.ensureSingle(p,"text","",(function(t){t.attr("data-notex",1)})),w=s.ensureUniformFontSize(t,b.determineTextFont(k,i,f.font));_.text(r.formatSliceLabel(i,A,k,e,f)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,w).call(l.convertToTspans,t);var M=o.bBox(_.node());i.transform=m(M,i,T),i.transform.targetX=Y(i),i.transform.targetY=Z(i);var S=function(t,e){var r=t.transform;return d(r,e),r.fontSize=w.size,u(k.type,r,f),s.getTextTransform(r)};v?_.transition().attrTween("transform",(function(t){var e=function(t){var e,r=R[b.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},O)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,J(t));else e.x0=e.x1=U;else e.x0=e.x1=U;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),h=a(e.x1,t.x1),p=a(e.transform.scale,n.scale),d=a(e.transform.rotate,n.rotate),m=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,g=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=h(t),a=function(t){return g(Math.pow(t,m))}(t),s={pxmid:H(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(k.type,n,f),{transform:{targetX:Y(s),targetY:Z(s),scale:p(t),rotate:d(t),rCenter:a}}}}(t);return function(t){return S(e(t),M)}})):_.attr("transform",S(i,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&b.hasTransition(r);(h("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&v(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,h=c.hierarchy,f=b.isHierarchyRoot(t),p=b.getParent(h,t),d=b.getValue(t);if(!a){var m,g=o.split("+"),v=function(t){return-1!==g.indexOf(t)},y=[];if(v("label")&&u.label&&y.push(u.label),u.hasOwnProperty("v")&&v("value")&&y.push(b.formatValue(u.v,l)),!f){v("current path")&&y.push(b.getPath(t.data));var x=0;v("percent parent")&&x++,v("percent entry")&&x++,v("percent root")&&x++;var _=x>1;if(x){var w,T=function(t){m=b.formatPercent(w,l),_&&(m+=" of "+t),y.push(m)};v("percent parent")&&!f&&(w=d/b.getValue(p),T("parent")),v("percent entry")&&(w=d/b.getValue(e),T("entry")),v("percent root")&&(w=d/b.getValue(h),T("root"))}}return v("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&y.push(m)),y.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var M={};u.label&&(M.label=u.label),u.hasOwnProperty("v")&&(M.value=u.v,M.valueLabel=b.formatValue(u.v,l)),M.currentPath=b.getPath(t.data),f||(M.percentParent=d/b.getValue(p),M.percentParentLabel=b.formatPercent(M.percentParent,l),M.parent=b.getPtLabel(p)),M.percentEntry=d/b.getValue(e),M.percentEntryLabel=b.formatPercent(M.percentEntry,l),M.entry=b.getPtLabel(e),M.percentRoot=d/b.getValue(h),M.percentRootLabel=b.formatPercent(M.percentRoot,l),M.root=b.getPtLabel(h),u.hasOwnProperty("color")&&(M.color=u.color);var A=s.castOption(r,u.i,"text");return(s.isValidTextValue(A)||""===A)&&(M.text=A),M.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,M,i._d3locale,M,r._meta||{})}},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../bar/style":812,"../bar/uniform_text":814,"../pie/helpers":1043,"../pie/plot":1047,"./constants":1148,"./fx":1150,"./helpers":1151,"./style":1156,"@plotly/d3":54,"d3-hierarchy":142,"d3-interpolate":143}],1156:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":524,"../../lib":661,"../bar/uniform_text":814,"@plotly/d3":54}],1157:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var h=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},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},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");h.x.editType=h.y.editType=h.z.editType="calc+clearAxisTypes",h.transforms=void 0},{"../../components/color":524,"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plot_api/edit_types":693,"../../plots/attributes":707,"../../plots/cartesian/axis_format_attributes":714,"../../plots/template_attributes":783}],1158:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":532}],1159:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-linear-interpolate").d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),h=t("../../components/colorscale").extractOpts;function f(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=f.prototype;p.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=d[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=v(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),h=[1/e,0,0,0,1/r,0,0,0,1],f=0;f0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1166:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),g=e.domain,v=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),y=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),x=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=f(b,y-_+n.uplift),T=h(f(x,_),[]),k=h(w,T),M={},A=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var L=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:L,height:y,columnOrder:A,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:A[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return C.columns.forEach((function(t){t.calcdata=C,t.x=u(t)})),C}},{"../../lib/extend":651,"./constants":1165,"fast-isnumeric":159}],1167:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":651}],1168:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var h,f,p=u?"":T(t.calcdata.cells.prefix,e,r)||"",d=u?"":T(t.calcdata.cells.suffix,e,r)||"",m=u?null:T(t.calcdata.cells.format,e,r)||null,g=p+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=w(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?w(g):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=O(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(C(t,r,e,c,n.prevPages,n,0),C(t,r,e,c,n.prevPages,n,1),x(r,t))}}function L(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var h=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(M);return E(t,h,l),s.scrollY===u}}function C(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(D)}}function I(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=N(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:h,p=Math.max(f,h);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(D),E(null,t.filter(M),0),x(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(z(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function z(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function D(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(N(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=N(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function O(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":531,"../../lib/extend":651,"../../plots/domain":739,"../../plots/template_attributes":783,"../pie/attributes":1038,"../sunburst/attributes":1145,"./constants":1174}],1172:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":774}],1173:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1147}],1174:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1175:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,r,c){function f(r,a){return n.coerce(t,e,i,r,a)}var p=f("labels"),d=f("parents");if(p&&p.length&&d&&d.length){var m=f("values");m&&m.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var g=f("text");f("texttemplate"),e.texttemplate||f("textinfo",Array.isArray(g)?"text+label":"label"),f("hovertext"),f("hovertemplate");var v=f("pathbar.visible");s(t,e,c,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var y=-1!==e.textposition.indexOf("bottom");f("marker.line.width")&&f("marker.line.color",c.paper_bgcolor);var x=f("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?h(t,e,c,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(x||[]).length);var b=2*e.textfont.size;f("marker.pad.t",y?b/4:b),f("marker.pad.l",b/4),f("marker.pad.r",b/4),f("marker.pad.b",y?b:b/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},v&&(f("pathbar.thickness",e.pathbar.textfont.size+2*l),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),o(e,c,f),e._length=null}else e.visible=!1}},{"../../components/color":524,"../../components/colorscale":536,"../../lib":661,"../../plots/domain":739,"../bar/constants":800,"../bar/defaults":802,"./attributes":1171}],1176:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,h,f=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+f+"layer"],g=!r;(a(f,d),(u=m.selectAll("g.trace."+f).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(f,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(h=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,p)}))}))):(u.each((function(e){s(t,e,this,r,p)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),f));g&&u.exit().remove()}},{"../bar/style":812,"../bar/uniform_text":814,"../sunburst/helpers":1151,"./plot_one":1185,"@plotly/d3":54}],1177:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),h=t("../sunburst/fx");e.exports=function(t,e,r,f,p){var d=p.barDifY,m=p.width,g=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,M=p.makeUpdateTextInterpolator,A={},S=t._fullLayout,E=e[0],L=E.trace,C=E.hierarchy,P=m/L._entryDepth,I=u.listPath(r.data,"id"),z=s(C.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(z=z.filter((function(t){var e=I.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+g,t.onPathbar=!0,!0)}))).reverse(),(f=f.data(z,u.getPtId)).enter().append("g").classed("pathbar",!0),T(f,!0,A,[m,g],x),f.order();var D=f;w&&(D=D.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),D.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-Math.min(m,g)/2),s._hoverY=y(s.y1-g/2);var f=n.select(this),p=i.ensureSingle(f,"path","surface",(function(t){t.style("pointer-events","all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,A,[m,g]);return function(t){return x(e(t))}})):p.attr("d",x),f.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,L,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(f,"g","slicetext"),T=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=i.ensureUniformFontSize(t,u.determineTextFont(L,s,S.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,E).call(o.convertToTspans,t),s.textBB=a.bBox(T.node()),s.transform=b(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?T.transition().attrTween("transform",(function(t){var e=M(t,!0,A,[m,g]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../sunburst/fx":1150,"../sunburst/helpers":1151,"./constants":1174,"./partition":1183,"./style":1186,"@plotly/d3":54}],1178:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),h=t("../sunburst/fx"),f=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var m=d.width,g=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,M=d.makeUpdateTextInterpolator,A=d.prevEntry,S=t._fullLayout,E=e[0].trace,L=-1!==E.textposition.indexOf("left"),C=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),I=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,z=s(r,[m,g],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),D=1/0,O=-1/0;z.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),O=Math.max(O,e))})),p=p.data(z,u.getPtId),E._maxVisibleLayers=isFinite(O)?O-D+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var R=null;if(w&&A){var F=u.getPtId(A);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return R||{x0:0,x1:m,y0:0,y1:g}},B=p;return w&&(B=B.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){var p=u.isHeader(s,E);s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-E.marker.pad.r),s._hoverY=y(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),T=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,N(),[m,g]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(h,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?I?"":u.getPtLabel(s)||"":f(s,r,E,e,S)||"";var A=i.ensureSingle(d,"g","slicetext"),z=i.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),D=i.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));z.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L||p?"start":"middle").call(a.font,D).call(o.convertToTspans,t),s.textBB=a.bBox(z.node()),s.transform=b(s,{fontSize:D.size,isHeader:p}),s.transform.fontSize=D.size,w?z.transition().attrTween("transform",(function(t){var e=M(t,!1,N(),[m,g]);return function(t){return _(e(t))}})):z.attr("transform",_(s))})),R}},{"../../components/drawing":546,"../../lib":661,"../../lib/svg_text_utils":686,"../sunburst/fx":1150,"../sunburst/helpers":1151,"../sunburst/plot":1155,"./constants":1174,"./partition":1183,"./style":1186,"@plotly/d3":54}],1179:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?C+z:-(I+z):0,O={x0:P,x1:P,y0:D,y1:D+I},R=function(t,e,r){var n=v.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,N={},B={},j=null,U=function(t,e){return e?N[f(t)]:B[f(t)]},V=function(t,e,r,n){if(e)return N[f(x)]||O;var i=B[v.level]||r;return function(t){return t.data.depth-b.data.depth=(n-=(y?g:g.r)-s)){var x=(r+n)/2;r=x,n=x}var b;h?i<(b=a-(y?g:g.b))&&b"===tt?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===tt?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(h),$(o),$(c),$(u),$(s),"M"+J(l.x,l.y)+"L"+J(c.x,c.y)+"L"+J(s.x,s.y)+"L"+J(u.x,u.y)+"L"+J(h.x,h.y)+"L"+J(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:M,strTransform:ot}):w.remove()}},{"../../lib":661,"../bar/constants":800,"../bar/plot":809,"../bar/uniform_text":814,"../sunburst/helpers":1151,"./constants":1174,"./draw_ancestors":1177,"@plotly/d3":54,"d3-interpolate":143}],1186:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,h=u.i,f=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&f===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,h,"marker.line.color")||i.defaultLine,l=a.castOption(r,h,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var g,v=i.combine(i.addOpacity(r._backgroundColor,.75),f);if(!0===m){var y=o.getMaxDepth(r);g=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else g=e.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var x=0;x0){var x,b,_,w,T,k=t.xa,M=t.ya;"h"===p.orientation?(T=e,x="y",_=M,b="x",w=k):(T=r,x="x",_=k,b="y",w=M);var A=f[t.index];if(T>=A.span[0]&&T<=A.span[1]){var S=n.extendFlat({},t),E=w.c2p(T,!0),L=o.getKdeValue(A,p,T),C=o.getPositionOnKdePath(A,p,E),P=_._offset,I=_._length;S[x+"0"]=C[0],S[x+"1"]=C[1],S[b+"0"]=S[b+"1"]=E,S[b+"Label"]=b+": "+i.hoverLabelText(w,T,p[b+"hoverformat"])+", "+f[0].t.labels.kde+" "+L.toFixed(3),S.spikeDistance=y[0].spikeDistance;var z=x+"Spike";S[z]=y[0][z],y[0].spikeDistance=void 0,y[0][z]=void 0,S.hovertemplate=!1,v.push(S),(u={stroke:t.color})[x+"1"]=n.constrain(P+C[0],P,P+I),u[x+"2"]=n.constrain(P+C[1],P,P+I),u[b+"1"]=u[b+"2"]=w._offset+E}}m&&(v=v.concat(y))}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var D=h.selectAll(".violinline-"+p.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+p.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":661,"../../plots/cartesian/axes":711,"../box/hover":828,"./helpers":1191}],1193:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":725,"../box/defaults":826,"../box/select":833,"../scatter/style":1088,"./attributes":1187,"./calc":1188,"./cross_trace_calc":1189,"./defaults":1190,"./hover":1192,"./layout_attributes":1194,"./layout_defaults":1195,"./plot":1196,"./style":1197}],1194:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":661,"../box/layout_attributes":830}],1195:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,(function(r,a){return n.coerce(t,e,i,r,a)}),"violin")}},{"../../lib":661,"../box/layout_defaults":831,"./layout_attributes":1194}],1196:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,h=e.xaxis,f=e.yaxis;function p(t){var e=s(t,{xaxis:h,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return a.smoothopen(e[0],1)}i.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),a=t[0],s=a.t,c=a.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,m=s.bdPos,g=e[s.valLetter+"axis"],v=e[s.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(i.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(t){var e,r,i,a,o,l,h,f,_=n.select(this),w=t.density,T=w.length,k=v.c2l(t.pos+d,!0),M=v.l2p(k);if(c.width)e=s.maxKDE/m;else{var A=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/m*(A.maxCount/t.pts.length):A.maxKDE/m}if(x){for(h=new Array(T),o=0;o")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(f,g),[u]}function k(t){return n(m,t,f[d+"hoverformat"])}}},{"../../components/color":524,"../../constants/delta.js":631,"../../plots/cartesian/axes":711,"../bar/hover":805}],1209:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":725,"../bar/select":810,"./attributes":1202,"./calc":1203,"./cross_trace_calc":1205,"./defaults":1206,"./event_data":1207,"./hover":1208,"./layout_attributes":1210,"./layout_defaults":1211,"./plot":1212,"./style":1213}],1210:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1211:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(g+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":524,"../../components/drawing":546,"../../constants/interactions":636,"../bar/style":812,"../bar/uniform_text":814,"@plotly/d3":54}],1214:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return h;case"first":return f;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return f(t)>s};case">=":return function(t){return f(t)>=s};case"[]":return function(t){var e=f(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=f(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=f(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=f(t);return es[1]};case"](":return function(t){var e=f(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=f(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(f(t))};case"}{":return function(t){return-1===s.indexOf(f(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),f),x={},b={},_=0;d?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a be - bs) { + return bruteForceRedFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlueFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } } + return bruteForceFull } -function bruteForcePlanner(full) { - var funcName = 'bruteForce' + (full ? 'Full' : 'Partial') - var prefix = [] - var fargs = ARGS.slice() - if(!full) { - fargs.splice(3, 0, FLIP) +function partial() { + function bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - - var code = ['function ' + funcName + '(' + fargs.join() + '){'] - - function invoke(redMajor, flip) { - var res = generateBruteForce(redMajor, flip, full) - prefix.push(res.code) - code.push('return ' + res.name + '(' + ARGS.join() + ');') + function bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } } - - code.push('if(' + RED_END + '-' + RED_START + '>' + - BLUE_END + '-' + BLUE_START + '){') - - if(full) { - invoke(true, false) - code.push('}else{') - invoke(false, false) - } else { - code.push('if(' + FLIP + '){') - invoke(true, true) - code.push('}else{') - invoke(true, false) - code.push('}}else{if(' + FLIP + '){') - invoke(false, true) - code.push('}else{') - invoke(false, false) - code.push('}') + function bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - code.push('}}return ' + funcName) - - var codeStr = prefix.join('') + code.join('') - var proc = new Function(codeStr) - return proc() + function bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } + } + function bruteForcePartial(d, ax, vv, fp, rs, re, rb, ri, bs, be, bb, bi) { + if (re - rs > be - bs) { + if (fp) { + return bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + else { + if (fp) { + return bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + } + return bruteForcePartial } +function bruteForcePlanner(isFull) { + return isFull ? full() : partial() + +} exports.partial = bruteForcePlanner(false) exports.full = bruteForcePlanner(true) @@ -19915,32 +19942,26 @@ var genPartition = _dereq_('./partition') //Twiddle parameters var BRUTE_FORCE_CUTOFF = 128 //Cut off for brute force search var SCAN_CUTOFF = (1<<22) //Cut off for two way scan -var SCAN_COMPLETE_CUTOFF = (1<<22) +var SCAN_COMPLETE_CUTOFF = (1<<22) //Partition functions var partitionInteriorContainsInterval = genPartition( - '!(lo>=p0)&&!(p1>=hi)', - ['p0', 'p1']) + '!(lo>=p0)&&!(p1>=hi)') var partitionStartEqual = genPartition( - 'lo===p0', - ['p0']) + 'lo===p0') var partitionStartLessThan = genPartition( - 'lo mid point // var blue0 = findMedian( - d, axis, + d, axis, blueStart, blueEnd, blue, blueIndex) var mid = blue[elemSize * blue0 + axis] var blue1 = partitionStartEqual( @@ -20393,14 +20414,14 @@ function boxIntersectIter( } } } -},{"./brute":109,"./median":111,"./partition":112,"./sweep":114,"bit-twiddle":104,"typedarray-pool":617}],111:[function(_dereq_,module,exports){ +},{"./brute":109,"./median":111,"./partition":112,"./sweep":114,"bit-twiddle":104,"typedarray-pool":601}],111:[function(_dereq_,module,exports){ 'use strict' module.exports = findMedian var genPartition = _dereq_('./partition') -var partitionStartLessThan = genPartition('lostart && boxes[ptr+axis] > x; + for(var j=i, ptr=elemSize*(i-1); + j>start && boxes[ptr+axis] > x; --j, ptr-=elemSize) { //Swap var aPtr = ptr @@ -20441,14 +20462,14 @@ function findMedian(d, axis, start, end, boxes, ids) { var elemSize = 2*d var pivot = mid var value = boxes[elemSize*mid+axis] - + while(lo < hi) { if(hi - lo < PARTITION_THRESHOLD) { insertionSort(d, axis, lo, hi, boxes, ids) value = boxes[elemSize*mid+axis] break } - + //Select pivot using median-of-3 var count = hi - lo var pivot0 = (Math.random()*count+lo)|0 @@ -20495,7 +20516,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Partition using pivot pivot = partitionStartLessThan( - d, axis, + d, axis, lo, hi-1, boxes, ids, value) @@ -20514,7 +20535,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Swap pivot to last pivot if(mid < pivot) { hi = pivot-1 - while(lo < hi && + while(lo < hi && boxes[elemSize*(hi-1)+axis] === value) { hi -= 1 } @@ -20532,7 +20553,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Make sure pivot is at start return partitionStartLessThan( - d, axis, + d, axis, start, mid, boxes, ids, boxes[elemSize*mid+axis]) } @@ -20541,22 +20562,115 @@ function findMedian(d, axis, start, end, boxes, ids) { module.exports = genPartition -var code = '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' +var P2F = { + 'lo===p0': lo_equal_p0, + 'lo=p0)&&!(p1>=hi)': lo_lessThan_p0_and_p1_lessThan_hi +} + +function genPartition(predicate) { + return P2F[predicate] +} -function genPartition(predicate, args) { - var fargs ='abcdef'.split('').concat(args) - var reads = [] - if(predicate.indexOf('lo') >= 0) { - reads.push('lo=e[k+n]') +// lo===p0 +function lo_equal_p0(a, b, c, d, e, f, p0) { + 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 lo = e[k + n]; + if (lo === p0) 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 + } } - if(predicate.indexOf('hi') >= 0) { - reads.push('hi=e[k+o]') + return m +} + +// lo p; ++p, k += j) { + var lo = e[k + n]; + if (lo < p0) 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 + } } - fargs.push( - code.replace('_', reads.join()) - .replace('$', predicate)) - return Function.apply(void 0, fargs) + return m } + +// lo<=p0 +function lo_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} + +// hi<=p0 +function hi_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} + +// lo<=p0&&p0<=hi +function lo_lassOrEqual_p0_and_p0_lessOrEqual_hi(a, b, c, d, e, f, p0) { + 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 lo = e[k + n], hi = e[k + o]; + if (lo <= p0 && p0 <= hi) 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 +} + +// lo p; ++p, k += j) { + var lo = e[k + n], hi = e[k + o]; + if (lo < p0 && p0 <= hi) 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 +} + +// !(lo>=p0)&&!(p1>=hi) +function lo_lessThan_p0_and_p1_lessThan_hi(a, b, c, d, e, f, p0, p1) { + 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 lo = e[k + n], hi = e[k + o]; + if (!(lo >= p0) && !(p1 >= hi)) 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 +} + },{}],113:[function(_dereq_,module,exports){ 'use strict'; @@ -21229,7 +21343,7 @@ red_loop: } } } -},{"./sort":113,"bit-twiddle":104,"typedarray-pool":617}],115:[function(_dereq_,module,exports){ +},{"./sort":113,"bit-twiddle":104,"typedarray-pool":601}],115:[function(_dereq_,module,exports){ },{}],116:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. @@ -23490,7 +23604,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,_dereq_("buffer").Buffer) -},{"base64-js":86,"buffer":117,"ieee754":445}],118:[function(_dereq_,module,exports){ +},{"base64-js":86,"buffer":117,"ieee754":437}],118:[function(_dereq_,module,exports){ 'use strict' var monotoneTriangulate = _dereq_('./lib/monotone') @@ -23691,7 +23805,7 @@ function delaunayRefine(points, triangulation) { } } -},{"binary-search-bounds":103,"robust-in-sphere":546}],120:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"robust-in-sphere":532}],120:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -24062,7 +24176,7 @@ function monotoneTriangulate(points, edges) { return cells } -},{"binary-search-bounds":103,"robust-orientation":548}],122:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"robust-orientation":534}],122:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -24256,7 +24370,7 @@ function circumcenter(points) { circumcenter.barycenetric = barycentricCircumcenter module.exports = circumcenter -},{"dup":185,"robust-linear-solve":547}],125:[function(_dereq_,module,exports){ +},{"dup":182,"robust-linear-solve":533}],125:[function(_dereq_,module,exports){ module.exports = circumradius var circumcenter = _dereq_('circumcenter') @@ -24664,7 +24778,7 @@ function cleanPSLG (points, edges, colors) { return modified } -},{"./lib/rat-seg-intersect":128,"big-rat":90,"big-rat/cmp":88,"big-rat/to-float":102,"box-intersect":108,"nextafter":484,"rat-vec":532,"robust-segment-intersect":551,"union-find":618}],128:[function(_dereq_,module,exports){ +},{"./lib/rat-seg-intersect":128,"big-rat":90,"big-rat/cmp":88,"big-rat/to-float":102,"box-intersect":108,"nextafter":473,"rat-vec":518,"robust-segment-intersect":537,"union-find":602}],128:[function(_dereq_,module,exports){ 'use strict' module.exports = solveIntersection @@ -24708,7 +24822,7 @@ function solveIntersection (a, b, c, d) { return r } -},{"big-rat/div":89,"big-rat/mul":99,"big-rat/sign":100,"big-rat/sub":101,"rat-vec/add":531,"rat-vec/muls":533,"rat-vec/sub":534}],129:[function(_dereq_,module,exports){ +},{"big-rat/div":89,"big-rat/mul":99,"big-rat/sign":100,"big-rat/sub":101,"rat-vec/add":517,"rat-vec/muls":519,"rat-vec/sub":520}],129:[function(_dereq_,module,exports){ /** @module color-id */ 'use strict' @@ -24984,7 +25098,7 @@ function isInt(color) { return false } -},{"clamp":126,"color-rgba":133,"dtype":184}],132:[function(_dereq_,module,exports){ +},{"clamp":126,"color-rgba":133,"dtype":181}],132:[function(_dereq_,module,exports){ (function (global){(function (){ /** * @module color-parse @@ -25163,7 +25277,7 @@ function parse (cstr) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"color-name":130,"defined":179,"is-plain-obj":457}],133:[function(_dereq_,module,exports){ +},{"color-name":130,"defined":176,"is-plain-obj":447}],133:[function(_dereq_,module,exports){ /** @module color-rgba */ 'use strict' @@ -25555,7 +25669,7 @@ function rgbaStr (rgba) { return 'rgba(' + rgba.join(',') + ')'; } -},{"./colorScale":136,"lerp":460}],138:[function(_dereq_,module,exports){ +},{"./colorScale":136,"lerp":450}],138:[function(_dereq_,module,exports){ "use strict" module.exports = compareAngle @@ -25641,7 +25755,7 @@ function compareAngle(a, b, c, d) { } } } -},{"robust-orientation":548,"robust-product":549,"robust-sum":553,"signum":555,"two-sum":605}],139:[function(_dereq_,module,exports){ +},{"robust-orientation":534,"robust-product":535,"robust-sum":539,"signum":541,"two-sum":589}],139:[function(_dereq_,module,exports){ module.exports = compareCells var min = Math.min @@ -25782,7 +25896,7 @@ function convexHull2D(points) { return edges } -},{"monotone-convex-hull-2d":469}],144:[function(_dereq_,module,exports){ +},{"monotone-convex-hull-2d":458}],144:[function(_dereq_,module,exports){ 'use strict' module.exports = convexHullnD @@ -25843,7 +25957,7 @@ function convexHullnD(points, d) { return invPermute(nhull, ah) } } -},{"affine-hull":73,"incremental-convex-hull":446}],145:[function(_dereq_,module,exports){ +},{"affine-hull":73,"incremental-convex-hull":438}],145:[function(_dereq_,module,exports){ module.exports = { AFG: 'afghan', ALA: '\\b\\wland', @@ -26282,7 +26396,7 @@ function parseLineHeight(value) { return value } -},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"string-split-by":589,"unquote":620}],153:[function(_dereq_,module,exports){ +},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"string-split-by":574,"unquote":604}],153:[function(_dereq_,module,exports){ 'use strict' var pick = _dereq_('pick-by-alias') @@ -26386,7 +26500,7 @@ function a2o (a) { return o } -},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"pick-by-alias":498}],154:[function(_dereq_,module,exports){ +},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"pick-by-alias":485}],154:[function(_dereq_,module,exports){ module.exports=[ "inherit", "initial", @@ -26444,565 +26558,6 @@ function cubicHermite(p0, v0, p1, v1, t, f) { module.exports = cubicHermite module.exports.derivative = dcubicHermite },{}],157:[function(_dereq_,module,exports){ -"use strict" - -var createThunk = _dereq_("./lib/thunk.js") - -function Procedure() { - 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 = false -} - -function compileCwise(user_args) { - //Create procedure - var proc = new Procedure() - - //Parse blocks - proc.pre = user_args.pre - proc.body = user_args.body - proc.post = user_args.post - - //Parse arguments - var proc_args = user_args.args.slice(0) - proc.argTypes = proc_args - for(var i=0; i0) { - throw new Error("cwise: pre() block may not reference array args") - } - if(i < proc.post.args.length && proc.post.args[i].count>0) { - throw new Error("cwise: post() block may not reference array args") - } - } else if(arg_type === "scalar") { - proc.scalarArgs.push(i) - proc.shimArgs.push("scalar" + i) - } else if(arg_type === "index") { - proc.indexArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].count > 0) { - throw new Error("cwise: pre() block may not reference array index") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array index") - } - if(i < proc.post.args.length && proc.post.args[i].count > 0) { - throw new Error("cwise: post() block may not reference array index") - } - } else if(arg_type === "shape") { - proc.shapeArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].lvalue) { - throw new Error("cwise: pre() block may not write to array shape") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array shape") - } - if(i < proc.post.args.length && proc.post.args[i].lvalue) { - throw new Error("cwise: post() block may not write to array shape") - } - } else if(typeof arg_type === "object" && arg_type.offset) { - proc.argTypes[i] = "offset" - proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset }) - proc.offsetArgIndex.push(i) - } else { - throw new Error("cwise: Unknown argument type " + proc_args[i]) - } - } - - //Make sure at least one array argument was specified - if(proc.arrayArgs.length <= 0) { - throw new Error("cwise: No array arguments specified") - } - - //Make sure arguments are correct - if(proc.pre.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in pre() block") - } - if(proc.body.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in body() block") - } - if(proc.post.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in post() block") - } - - //Check debug flag - proc.debug = !!user_args.printCode || !!user_args.debug - - //Retrieve name - proc.funcName = user_args.funcName || "cwise" - - //Read in block size - proc.blockSize = user_args.blockSize || 64 - - return createThunk(proc) -} - -module.exports = compileCwise - -},{"./lib/thunk.js":159}],158:[function(_dereq_,module,exports){ -"use strict" - -var uniq = _dereq_("uniq") - -// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index) -// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments. -function innerFill(order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , has_index = proc.indexArgs.length>0 - , code = [] - , vars = [] - , idx=0, pidx=0, i, j - for(i=0; i 0) { - code.push("var " + vars.join(",")) - } - //Scan loop - for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards - idx = order[i] - code.push(["for(i",i,"=0;i",i," 0) { - code.push(["index[",pidx,"]-=s",pidx].join("")) - } - code.push(["++index[",idx,"]"].join("")) - } - code.push("}") - } - return code.join("\n") -} - -// Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block. -// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary. -// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used. -function outerFill(matched, order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , blockSize = proc.blockSize - , has_index = proc.indexArgs.length > 0 - , code = [] - for(var i=0; i0;){"].join("")) // Iterate back to front - code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j). - code.push(["s",order[i],"=j",i].join("")) - code.push(["j",i,"=0"].join("")) - code.push(["}else{s",order[i],"=",blockSize].join("")) - code.push(["j",i,"-=",blockSize,"}"].join("")) - if(has_index) { - code.push(["index[",order[i],"]=j",i].join("")) - } - } - for(var i=0; i 0) { - allEqual = allEqual && summary[i] === summary[i-1] - } - } - if(allEqual) { - return summary[0] - } - return summary.join("") -} - -//Generates a cwise operator -function generateCWiseOp(proc, typesig) { - - //Compute dimension - // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg. - var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0 - var orders = new Array(proc.arrayArgs.length) - var dtypes = new Array(proc.arrayArgs.length) - for(var i=0; i 0) { - vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example) - } - if(proc.indexArgs.length > 0) { - // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes. - var zeros = new Array(dimension) - for(var i=0; i 0) { - code.push("var " + vars.join(",")) - } - for(var i=0; i 3) { - code.push(processBlock(proc.pre, proc, dtypes)) - } - - //Process body - var body = processBlock(proc.body, proc, dtypes) - var matched = countMatches(loopOrders) - if(matched < dimension) { - code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example. - } else { - code.push(innerFill(loopOrders[0], proc, body)) - } - - //Inline epilog - if(proc.post.body.length > 3) { - code.push(processBlock(proc.post, proc, dtypes)) - } - - if(proc.debug) { - console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------") - } - - var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("") - var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join("")) - return f() -} -module.exports = generateCWiseOp - -},{"uniq":619}],159:[function(_dereq_,module,exports){ -"use strict" - -// The function below is called when constructing a cwise function object, and does the following: -// A function object is constructed which accepts as argument a compilation function and returns another function. -// It is this other function that is eventually returned by createThunk, and this function is the one that actually -// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed. -// The compilation passed to the first function object is used for compiling new functions. -// Once this function object is created, it is called with compile as argument, where the first argument of compile -// is bound to "proc" (essentially containing a preprocessed version of the user arguments to cwise). -// So createThunk roughly works like this: -// function createThunk(proc) { -// var thunk = function(compileBound) { -// var CACHED = {} -// return function(arrays and scalars) { -// if (dtype and order of arrays in CACHED) { -// var func = CACHED[dtype and order of arrays] -// } else { -// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays) -// } -// return func(arrays and scalars) -// } -// } -// return thunk(compile.bind1(proc)) -// } - -var compile = _dereq_("./compile.js") - -function createThunk(proc) { - var code = ["'use strict'", "var CACHED={}"] - var vars = [] - var thunkName = proc.funcName + "_cwise_thunk" - - //Build thunk - code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join("")) - var typesig = [] - var string_typesig = [] - var proc_args = [["array",proc.arrayArgs[0],".shape.slice(", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS). - Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(","+proc.arrayBlockIndices[0]+")"):")"].join("")] - var shapeLengthConditions = [], shapeConditions = [] - // Process array arguments - for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices) - shapeLengthConditions.push("array" + proc.arrayArgs[0] + ".shape.length===array" + j + ".shape.length+" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i]))) - shapeConditions.push("array" + proc.arrayArgs[0] + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[0]) + "]===array" + j + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[i]) + "]") - } - } - // Check for shape equality - if (proc.arrayArgs.length > 1) { - code.push("if (!(" + shapeLengthConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same dimensionality!')") - code.push("for(var shapeIndex=array" + proc.arrayArgs[0] + ".shape.length-" + Math.abs(proc.arrayBlockIndices[0]) + "; shapeIndex-->0;) {") - code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')") - code.push("}") - } - // Process scalar arguments - for(var i=0; i 0 ? 1 : -1; }; -},{}],199:[function(_dereq_,module,exports){ +},{}],196:[function(_dereq_,module,exports){ "use strict"; var sign = _dereq_("../math/sign") @@ -44952,7 +44507,7 @@ module.exports = function (value) { return sign(value) * floor(abs(value)); }; -},{"../math/sign":196}],200:[function(_dereq_,module,exports){ +},{"../math/sign":193}],197:[function(_dereq_,module,exports){ "use strict"; var toInteger = _dereq_("./to-integer") @@ -44960,7 +44515,7 @@ var toInteger = _dereq_("./to-integer") module.exports = function (value) { return max(0, toInteger(value)); }; -},{"./to-integer":199}],201:[function(_dereq_,module,exports){ +},{"./to-integer":196}],198:[function(_dereq_,module,exports){ // Internal method, used by iteration functions. // Calls a function for each key-value pair found in object // Optionally takes compareFn to iterate object in specific order @@ -44992,12 +44547,12 @@ module.exports = function (method, defVal) { }; }; -},{"./valid-callable":218,"./valid-value":220}],202:[function(_dereq_,module,exports){ +},{"./valid-callable":215,"./valid-value":217}],199:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.assign : _dereq_("./shim"); -},{"./is-implemented":203,"./shim":204}],203:[function(_dereq_,module,exports){ +},{"./is-implemented":200,"./shim":201}],200:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -45008,7 +44563,7 @@ module.exports = function () { return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; }; -},{}],204:[function(_dereq_,module,exports){ +},{}],201:[function(_dereq_,module,exports){ "use strict"; var keys = _dereq_("../keys") @@ -45033,7 +44588,7 @@ module.exports = function (dest, src/*, …srcn*/) { return dest; }; -},{"../keys":210,"../valid-value":220}],205:[function(_dereq_,module,exports){ +},{"../keys":207,"../valid-value":217}],202:[function(_dereq_,module,exports){ "use strict"; var aFrom = _dereq_("../array/from") @@ -45054,7 +44609,7 @@ module.exports = function (obj/*, propertyNames, options*/) { return result; }; -},{"../array/from":190,"./assign":202,"./valid-value":220}],206:[function(_dereq_,module,exports){ +},{"../array/from":187,"./assign":199,"./valid-value":217}],203:[function(_dereq_,module,exports){ // Workaround for http://code.google.com/p/v8/issues/detail?id=2804 "use strict"; @@ -45099,12 +44654,12 @@ module.exports = (function () { }; })(); -},{"./set-prototype-of/is-implemented":216,"./set-prototype-of/shim":217}],207:[function(_dereq_,module,exports){ +},{"./set-prototype-of/is-implemented":213,"./set-prototype-of/shim":214}],204:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./_iterate")("forEach"); -},{"./_iterate":201}],208:[function(_dereq_,module,exports){ +},{"./_iterate":198}],205:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -45113,19 +44668,19 @@ var map = { function: true, object: true }; module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; }; -},{"./is-value":209}],209:[function(_dereq_,module,exports){ +},{"./is-value":206}],206:[function(_dereq_,module,exports){ "use strict"; var _undefined = _dereq_("../function/noop")(); // Support ES3 engines module.exports = function (val) { return val !== _undefined && val !== null; }; -},{"../function/noop":195}],210:[function(_dereq_,module,exports){ +},{"../function/noop":192}],207:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.keys : _dereq_("./shim"); -},{"./is-implemented":211,"./shim":212}],211:[function(_dereq_,module,exports){ +},{"./is-implemented":208,"./shim":209}],208:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -45137,7 +44692,7 @@ module.exports = function () { } }; -},{}],212:[function(_dereq_,module,exports){ +},{}],209:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("../is-value"); @@ -45146,7 +44701,7 @@ var keys = Object.keys; module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; -},{"../is-value":209}],213:[function(_dereq_,module,exports){ +},{"../is-value":206}],210:[function(_dereq_,module,exports){ "use strict"; var callable = _dereq_("./valid-callable") @@ -45162,7 +44717,7 @@ module.exports = function (obj, cb/*, thisArg*/) { return result; }; -},{"./for-each":207,"./valid-callable":218}],214:[function(_dereq_,module,exports){ +},{"./for-each":204,"./valid-callable":215}],211:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -45184,12 +44739,12 @@ module.exports = function (opts1/*, …options*/) { return result; }; -},{"./is-value":209}],215:[function(_dereq_,module,exports){ +},{"./is-value":206}],212:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.setPrototypeOf : _dereq_("./shim"); -},{"./is-implemented":216,"./shim":217}],216:[function(_dereq_,module,exports){ +},{"./is-implemented":213,"./shim":214}],213:[function(_dereq_,module,exports){ "use strict"; var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; @@ -45200,7 +44755,7 @@ module.exports = function (/* CustomCreate*/) { return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; }; -},{}],217:[function(_dereq_,module,exports){ +},{}],214:[function(_dereq_,module,exports){ /* eslint no-proto: "off" */ // Big thanks to @WebReflection for sorting this out @@ -45283,7 +44838,7 @@ module.exports = (function (status) { _dereq_("../create"); -},{"../create":206,"../is-object":208,"../valid-value":220}],218:[function(_dereq_,module,exports){ +},{"../create":203,"../is-object":205,"../valid-value":217}],215:[function(_dereq_,module,exports){ "use strict"; module.exports = function (fn) { @@ -45291,7 +44846,7 @@ module.exports = function (fn) { return fn; }; -},{}],219:[function(_dereq_,module,exports){ +},{}],216:[function(_dereq_,module,exports){ "use strict"; var isObject = _dereq_("./is-object"); @@ -45301,7 +44856,7 @@ module.exports = function (value) { return value; }; -},{"./is-object":208}],220:[function(_dereq_,module,exports){ +},{"./is-object":205}],217:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -45311,12 +44866,12 @@ module.exports = function (value) { return value; }; -},{"./is-value":209}],221:[function(_dereq_,module,exports){ +},{"./is-value":206}],218:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? String.prototype.contains : _dereq_("./shim"); -},{"./is-implemented":222,"./shim":223}],222:[function(_dereq_,module,exports){ +},{"./is-implemented":219,"./shim":220}],219:[function(_dereq_,module,exports){ "use strict"; var str = "razdwatrzy"; @@ -45326,7 +44881,7 @@ module.exports = function () { return str.contains("dwa") === true && str.contains("foo") === false; }; -},{}],223:[function(_dereq_,module,exports){ +},{}],220:[function(_dereq_,module,exports){ "use strict"; var indexOf = String.prototype.indexOf; @@ -45335,7 +44890,7 @@ module.exports = function (searchString/*, position*/) { return indexOf.call(this, searchString, arguments[1]) > -1; }; -},{}],224:[function(_dereq_,module,exports){ +},{}],221:[function(_dereq_,module,exports){ "use strict"; var objToString = Object.prototype.toString, id = objToString.call(""); @@ -45350,7 +44905,7 @@ module.exports = function (value) { ); }; -},{}],225:[function(_dereq_,module,exports){ +},{}],222:[function(_dereq_,module,exports){ "use strict"; var generated = Object.create(null), random = Math.random; @@ -45363,7 +44918,7 @@ module.exports = function () { return str; }; -},{}],226:[function(_dereq_,module,exports){ +},{}],223:[function(_dereq_,module,exports){ "use strict"; var setPrototypeOf = _dereq_("es5-ext/object/set-prototype-of") @@ -45397,7 +44952,7 @@ ArrayIterator.prototype = Object.create(Iterator.prototype, { }); defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); -},{"./":229,"d":161,"es5-ext/object/set-prototype-of":215,"es5-ext/string/#/contains":221,"es6-symbol":233}],227:[function(_dereq_,module,exports){ +},{"./":226,"d":158,"es5-ext/object/set-prototype-of":212,"es5-ext/string/#/contains":218,"es6-symbol":230}],224:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -45446,7 +45001,7 @@ module.exports = function (iterable, cb /*, thisArg*/) { } }; -},{"./get":228,"es5-ext/function/is-arguments":193,"es5-ext/object/valid-callable":218,"es5-ext/string/is-string":224}],228:[function(_dereq_,module,exports){ +},{"./get":225,"es5-ext/function/is-arguments":190,"es5-ext/object/valid-callable":215,"es5-ext/string/is-string":221}],225:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -45463,7 +45018,7 @@ module.exports = function (obj) { return new ArrayIterator(obj); }; -},{"./array":226,"./string":231,"./valid-iterable":232,"es5-ext/function/is-arguments":193,"es5-ext/string/is-string":224,"es6-symbol":233}],229:[function(_dereq_,module,exports){ +},{"./array":223,"./string":228,"./valid-iterable":229,"es5-ext/function/is-arguments":190,"es5-ext/string/is-string":221,"es6-symbol":230}],226:[function(_dereq_,module,exports){ "use strict"; var clear = _dereq_("es5-ext/array/#/clear") @@ -45571,7 +45126,7 @@ defineProperty( }) ); -},{"d":161,"d/auto-bind":160,"es5-ext/array/#/clear":189,"es5-ext/object/assign":202,"es5-ext/object/valid-callable":218,"es5-ext/object/valid-value":220,"es6-symbol":233}],230:[function(_dereq_,module,exports){ +},{"d":158,"d/auto-bind":157,"es5-ext/array/#/clear":186,"es5-ext/object/assign":199,"es5-ext/object/valid-callable":215,"es5-ext/object/valid-value":217,"es6-symbol":230}],227:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -45589,7 +45144,7 @@ module.exports = function (value) { return typeof value[iteratorSymbol] === "function"; }; -},{"es5-ext/function/is-arguments":193,"es5-ext/object/is-value":209,"es5-ext/string/is-string":224,"es6-symbol":233}],231:[function(_dereq_,module,exports){ +},{"es5-ext/function/is-arguments":190,"es5-ext/object/is-value":206,"es5-ext/string/is-string":221,"es6-symbol":230}],228:[function(_dereq_,module,exports){ // Thanks @mathiasbynens // http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols @@ -45630,7 +45185,7 @@ StringIterator.prototype = Object.create(Iterator.prototype, { }); defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); -},{"./":229,"d":161,"es5-ext/object/set-prototype-of":215,"es6-symbol":233}],232:[function(_dereq_,module,exports){ +},{"./":226,"d":158,"es5-ext/object/set-prototype-of":212,"es6-symbol":230}],229:[function(_dereq_,module,exports){ "use strict"; var isIterable = _dereq_("./is-iterable"); @@ -45640,14 +45195,14 @@ module.exports = function (value) { return value; }; -},{"./is-iterable":230}],233:[function(_dereq_,module,exports){ +},{"./is-iterable":227}],230:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? _dereq_("ext/global-this").Symbol : _dereq_("./polyfill"); -},{"./is-implemented":234,"./polyfill":239,"ext/global-this":246}],234:[function(_dereq_,module,exports){ +},{"./is-implemented":231,"./polyfill":236,"ext/global-this":243}],231:[function(_dereq_,module,exports){ "use strict"; var global = _dereq_("ext/global-this") @@ -45669,7 +45224,7 @@ module.exports = function () { return true; }; -},{"ext/global-this":246}],235:[function(_dereq_,module,exports){ +},{"ext/global-this":243}],232:[function(_dereq_,module,exports){ "use strict"; module.exports = function (value) { @@ -45680,7 +45235,7 @@ module.exports = function (value) { return value[value.constructor.toStringTag] === "Symbol"; }; -},{}],236:[function(_dereq_,module,exports){ +},{}],233:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d"); @@ -45711,7 +45266,7 @@ module.exports = function (desc) { return name; }; -},{"d":161}],237:[function(_dereq_,module,exports){ +},{"d":158}],234:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d") @@ -45747,7 +45302,7 @@ module.exports = function (SymbolPolyfill) { }); }; -},{"d":161,"ext/global-this":246}],238:[function(_dereq_,module,exports){ +},{"d":158,"ext/global-this":243}],235:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d") @@ -45772,7 +45327,7 @@ module.exports = function (SymbolPolyfill) { }); }; -},{"../../../validate-symbol":240,"d":161}],239:[function(_dereq_,module,exports){ +},{"../../../validate-symbol":237,"d":158}],236:[function(_dereq_,module,exports){ // ES2015 Symbol polyfill for environments that do not (or partially) support it "use strict"; @@ -45861,7 +45416,7 @@ defineProperty( d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]) ); -},{"./lib/private/generate-name":236,"./lib/private/setup/standard-symbols":237,"./lib/private/setup/symbol-registry":238,"./validate-symbol":240,"d":161,"ext/global-this":246}],240:[function(_dereq_,module,exports){ +},{"./lib/private/generate-name":233,"./lib/private/setup/standard-symbols":234,"./lib/private/setup/symbol-registry":235,"./validate-symbol":237,"d":158,"ext/global-this":243}],237:[function(_dereq_,module,exports){ "use strict"; var isSymbol = _dereq_("./is-symbol"); @@ -45871,12 +45426,12 @@ module.exports = function (value) { return value; }; -},{"./is-symbol":235}],241:[function(_dereq_,module,exports){ +},{"./is-symbol":232}],238:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? WeakMap : _dereq_("./polyfill"); -},{"./is-implemented":242,"./polyfill":244}],242:[function(_dereq_,module,exports){ +},{"./is-implemented":239,"./polyfill":241}],239:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -45899,7 +45454,7 @@ module.exports = function () { return true; }; -},{}],243:[function(_dereq_,module,exports){ +},{}],240:[function(_dereq_,module,exports){ // Exports true if environment provides native `WeakMap` implementation, whatever that is. "use strict"; @@ -45909,7 +45464,7 @@ module.exports = (function () { return Object.prototype.toString.call(new WeakMap()) === "[object WeakMap]"; }()); -},{}],244:[function(_dereq_,module,exports){ +},{}],241:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("es5-ext/object/is-value") @@ -45976,7 +45531,7 @@ Object.defineProperties(WeakMapPoly.prototype, { }); defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d("c", "WeakMap")); -},{"./is-native-implemented":243,"d":161,"es5-ext/object/is-value":209,"es5-ext/object/set-prototype-of":215,"es5-ext/object/valid-object":219,"es5-ext/object/valid-value":220,"es5-ext/string/random-uniq":225,"es6-iterator/for-of":227,"es6-iterator/get":228,"es6-symbol":233}],245:[function(_dereq_,module,exports){ +},{"./is-native-implemented":240,"d":158,"es5-ext/object/is-value":206,"es5-ext/object/set-prototype-of":212,"es5-ext/object/valid-object":216,"es5-ext/object/valid-value":217,"es5-ext/string/random-uniq":222,"es6-iterator/for-of":224,"es6-iterator/get":225,"es6-symbol":230}],242:[function(_dereq_,module,exports){ var naiveFallback = function () { if (typeof self === "object" && self) return self; if (typeof window === "object" && window) return window; @@ -46009,12 +45564,12 @@ module.exports = (function () { } })(); -},{}],246:[function(_dereq_,module,exports){ +},{}],243:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? globalThis : _dereq_("./implementation"); -},{"./implementation":245,"./is-implemented":247}],247:[function(_dereq_,module,exports){ +},{"./implementation":242,"./is-implemented":244}],244:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -46023,7 +45578,7 @@ module.exports = function () { return globalThis.Array === Array; }; -},{}],248:[function(_dereq_,module,exports){ +},{}],245:[function(_dereq_,module,exports){ "use strict" module.exports = extractPlanes @@ -46040,7 +45595,7 @@ function extractPlanes(M, zNear, zFar) { [ zf*M[12] - M[8], zf*M[13] - M[9], zf*M[14] - M[10], zf*M[15] - M[11] ] ] } -},{}],249:[function(_dereq_,module,exports){ +},{}],246:[function(_dereq_,module,exports){ /** * inspired by is-number * but significantly simplified and sped up by ignoring number and string constructors @@ -46066,7 +45621,7 @@ module.exports = function(n) { return n - n < 1; }; -},{"is-string-blank":458}],250:[function(_dereq_,module,exports){ +},{"is-string-blank":448}],247:[function(_dereq_,module,exports){ 'use strict' module.exports = createFilteredVector @@ -46359,69 +45914,7 @@ function createFilteredVector(initState, initVelocity, initTime) { } } -},{"binary-search-bounds":251,"cubic-hermite":156}],251:[function(_dereq_,module,exports){ -"use strict" - -function compileSearch(funcName, predicate, reversed, extraArgs, useNdarray, earlyOut) { - var code = [ - "function ", funcName, "(a,l,h,", extraArgs.join(","), "){", -earlyOut ? "" : "var i=", (reversed ? "l-1" : "h+1"), -";while(l<=h){\ -var m=(l+h)>>>1,x=a", useNdarray ? ".get(m)" : "[m]"] - if(earlyOut) { - if(predicate.indexOf("c") < 0) { - code.push(";if(x===y){return m}else if(x<=y){") - } else { - code.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){") - } - } else { - code.push(";if(", predicate, "){i=m;") - } - if(reversed) { - code.push("l=m+1}else{h=m-1}") - } else { - code.push("h=m-1}else{l=m+1}") - } - code.push("}") - if(earlyOut) { - code.push("return -1};") - } else { - code.push("return i};") - } - return code.join("") -} - -function compileBoundsSearch(predicate, reversed, suffix, earlyOut) { - var result = new Function([ - compileSearch("A", "x" + predicate + "y", reversed, ["y"], false, earlyOut), - compileSearch("B", "x" + predicate + "y", reversed, ["y"], true, earlyOut), - compileSearch("P", "c(x,y)" + predicate + "0", reversed, ["y", "c"], false, earlyOut), - compileSearch("Q", "c(x,y)" + predicate + "0", reversed, ["y", "c"], true, earlyOut), -"function dispatchBsearch", suffix, "(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", suffix].join("")) - return result() -} - -module.exports = { - ge: compileBoundsSearch(">=", false, "GE"), - gt: compileBoundsSearch(">", false, "GT"), - lt: compileBoundsSearch("<", true, "LT"), - le: compileBoundsSearch("<=", true, "LE"), - eq: compileBoundsSearch("-", true, "EQ", true) -} - -},{}],252:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"cubic-hermite":156}],248:[function(_dereq_,module,exports){ /*eslint new-cap:0*/ var dtype = _dereq_('dtype') @@ -46481,7 +45974,7 @@ function flattenVertexData (data, output, offset) { return output } -},{"dtype":184}],253:[function(_dereq_,module,exports){ +},{"dtype":181}],249:[function(_dereq_,module,exports){ 'use strict' var stringifyFont = _dereq_('css-font/stringify') @@ -46540,7 +46033,7 @@ function atlas(options) { return canvas } -},{"css-font/stringify":153}],254:[function(_dereq_,module,exports){ +},{"css-font/stringify":153}],250:[function(_dereq_,module,exports){ 'use strict' module.exports = measure @@ -46727,7 +46220,7 @@ function firstBottom(iData) { } } -},{}],255:[function(_dereq_,module,exports){ +},{}],251:[function(_dereq_,module,exports){ "use strict" module.exports = createRBTree @@ -47724,76 +47217,7 @@ function defaultCompare(a, b) { function createRBTree(compare) { return new RedBlackTree(compare || defaultCompare, null) } -},{}],256:[function(_dereq_,module,exports){ -// transliterated from the python snippet here: -// http://en.wikipedia.org/wiki/Lanczos_approximation - -var g = 7; -var p = [ - 0.99999999999980993, - 676.5203681218851, - -1259.1392167224028, - 771.32342877765313, - -176.61502916214059, - 12.507343278686905, - -0.13857109526572012, - 9.9843695780195716e-6, - 1.5056327351493116e-7 -]; - -var g_ln = 607/128; -var p_ln = [ - 0.99999999999999709182, - 57.156235665862923517, - -59.597960355475491248, - 14.136097974741747174, - -0.49191381609762019978, - 0.33994649984811888699e-4, - 0.46523628927048575665e-4, - -0.98374475304879564677e-4, - 0.15808870322491248884e-3, - -0.21026444172410488319e-3, - 0.21743961811521264320e-3, - -0.16431810653676389022e-3, - 0.84418223983852743293e-4, - -0.26190838401581408670e-4, - 0.36899182659531622704e-5 -]; - -// Spouge approximation (suitable for large arguments) -function lngamma(z) { - - if(z < 0) return Number('0/0'); - var x = p_ln[0]; - for(var i = p_ln.length - 1; i > 0; --i) x += p_ln[i] / (z + i); - var t = z + g_ln + 0.5; - return .5*Math.log(2*Math.PI)+(z+.5)*Math.log(t)-t+Math.log(x)-Math.log(z); -} - -module.exports = function gamma (z) { - if (z < 0.5) { - return Math.PI / (Math.sin(Math.PI * z) * gamma(1 - z)); - } - else if(z > 100) return Math.exp(lngamma(z)); - else { - z -= 1; - var x = p[0]; - for (var i = 1; i < g + 2; i++) { - x += p[i] / (z + i); - } - var t = z + g + 0.5; - - return Math.sqrt(2 * Math.PI) - * Math.pow(t, z + 0.5) - * Math.exp(-t) - * x - ; - } -}; - -module.exports.log = lngamma; - -},{}],257:[function(_dereq_,module,exports){ +},{}],252:[function(_dereq_,module,exports){ module.exports = getCanvasContext function getCanvasContext (type, opts) { if (typeof type !== 'string') { @@ -47833,7 +47257,7 @@ function getCanvasContext (type, opts) { return (gl || null) // ensure null on fail } -},{}],258:[function(_dereq_,module,exports){ +},{}],253:[function(_dereq_,module,exports){ 'use strict' module.exports = createAxes @@ -48441,7 +47865,7 @@ function createAxes(gl, options) { return axes } -},{"./lib/background.js":259,"./lib/cube.js":260,"./lib/lines.js":261,"./lib/text.js":263,"./lib/ticks.js":264}],259:[function(_dereq_,module,exports){ +},{"./lib/background.js":254,"./lib/cube.js":255,"./lib/lines.js":256,"./lib/text.js":258,"./lib/ticks.js":259}],254:[function(_dereq_,module,exports){ 'use strict' module.exports = createBackgroundCube @@ -48554,7 +47978,7 @@ function createBackgroundCube(gl) { return new BackgroundCube(gl, buffer, vao, shader) } -},{"./shaders":262,"gl-buffer":267,"gl-vao":361}],260:[function(_dereq_,module,exports){ +},{"./shaders":257,"gl-buffer":261,"gl-vao":353}],255:[function(_dereq_,module,exports){ "use strict" module.exports = getCubeEdges @@ -48796,7 +48220,7 @@ function getCubeEdges(model, view, projection, bounds, ortho) { //Return result return CUBE_RESULT } -},{"bit-twiddle":104,"gl-mat4/multiply":301,"robust-orientation":548,"split-polygon":567}],261:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"gl-mat4/multiply":295,"robust-orientation":534,"split-polygon":552}],256:[function(_dereq_,module,exports){ 'use strict' module.exports = createLines @@ -49006,7 +48430,7 @@ function createLines(gl, bounds, ticks) { return new Lines(gl, vertBuf, vao, shader, tickCount, tickOffset, gridCount, gridOffset) } -},{"./shaders":262,"gl-buffer":267,"gl-vao":361}],262:[function(_dereq_,module,exports){ +},{"./shaders":257,"gl-buffer":261,"gl-vao":353}],257:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -49037,7 +48461,7 @@ exports.bg = function(gl) { ]) } -},{"gl-shader":339,"glslify":265}],263:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":434}],258:[function(_dereq_,module,exports){ (function (process){(function (){ "use strict" @@ -49259,7 +48683,7 @@ function createTextSprites( } }).call(this)}).call(this,_dereq_('_process')) -},{"./shaders":262,"_process":528,"gl-buffer":267,"gl-vao":361,"vectorize-text":623}],264:[function(_dereq_,module,exports){ +},{"./shaders":257,"_process":514,"gl-buffer":261,"gl-vao":353,"vectorize-text":607}],259:[function(_dereq_,module,exports){ 'use strict' exports.create = defaultTicks @@ -49340,19 +48764,7 @@ function ticksEqual(ticksA, ticksB) { } return true } -},{}],265:[function(_dereq_,module,exports){ -module.exports = function(strings) { - if (typeof strings === 'string') strings = [strings] - var exprs = [].slice.call(arguments,1) - var parts = [] - for (var i = 0; i < strings.length-1; i++) { - parts.push(strings[i], exprs[i] || '') - } - parts.push(strings[i]) - return parts.join('') -} - -},{}],266:[function(_dereq_,module,exports){ +},{}],260:[function(_dereq_,module,exports){ "use strict" module.exports = axesProperties @@ -49496,7 +48908,7 @@ i_loop: return ranges } -},{"./lib/cube.js":260,"extract-frustum-planes":248,"gl-mat4/multiply":301,"gl-mat4/transpose":312,"gl-vec4/transformMat4":432,"split-polygon":567}],267:[function(_dereq_,module,exports){ +},{"./lib/cube.js":255,"extract-frustum-planes":245,"gl-mat4/multiply":295,"gl-mat4/transpose":306,"gl-vec4/transformMat4":424,"split-polygon":552}],261:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") @@ -49650,7 +49062,7 @@ function createBuffer(gl, data, type, usage) { module.exports = createBuffer -},{"ndarray":483,"ndarray-ops":478,"typedarray-pool":617}],268:[function(_dereq_,module,exports){ +},{"ndarray":472,"ndarray-ops":467,"typedarray-pool":601}],262:[function(_dereq_,module,exports){ "use strict"; var vec3 = _dereq_('gl-vec3'); @@ -49788,7 +49200,7 @@ module.exports.createConeMesh = function(gl, params) { }); } -},{"./create_mesh":269,"./lib/shaders":270,"gl-vec3":380}],269:[function(_dereq_,module,exports){ +},{"./create_mesh":263,"./lib/shaders":264,"gl-vec3":372}],263:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -50363,7 +49775,7 @@ function createVectorMesh(gl, params, opts) { module.exports = createVectorMesh -},{"colormap":137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-shader":339,"gl-texture2d":356,"gl-vao":361,"ndarray":483}],270:[function(_dereq_,module,exports){ +},{"colormap":137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-shader":332,"gl-texture2d":348,"gl-vao":353,"ndarray":472}],264:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var triVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) @@ -50391,7 +49803,7 @@ exports.pickShader = { ] } -},{"glslify":442}],271:[function(_dereq_,module,exports){ +},{"glslify":434}],265:[function(_dereq_,module,exports){ module.exports = { 0: 'NONE', 1: 'ONE', @@ -50691,14 +50103,14 @@ module.exports = { 37444: 'BROWSER_DEFAULT_WEBGL' } -},{}],272:[function(_dereq_,module,exports){ +},{}],266:[function(_dereq_,module,exports){ var gl10 = _dereq_('./1.0/numbers') module.exports = function lookupConstant (number) { return gl10[number] } -},{"./1.0/numbers":271}],273:[function(_dereq_,module,exports){ +},{"./1.0/numbers":265}],267:[function(_dereq_,module,exports){ 'use strict' module.exports = createErrorBars @@ -50949,9 +50361,19 @@ function createErrorBars(options) { return result } -},{"./shaders/index":275,"gl-buffer":267,"gl-vao":361}],274:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],275:[function(_dereq_,module,exports){ +},{"./shaders/index":269,"gl-buffer":261,"gl-vao":353}],268:[function(_dereq_,module,exports){ +module.exports = function(strings) { + if (typeof strings === 'string') strings = [strings] + var exprs = [].slice.call(arguments,1) + var parts = [] + for (var i = 0; i < strings.length-1; i++) { + parts.push(strings[i], exprs[i] || '') + } + parts.push(strings[i]) + return parts.join('') +} + +},{}],269:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -50968,7 +50390,7 @@ module.exports = function(gl) { ]) } -},{"gl-shader":339,"glslify":274}],276:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":268}],270:[function(_dereq_,module,exports){ 'use strict' var createTexture = _dereq_('gl-texture2d') @@ -51435,7 +50857,7 @@ function createFBO(gl, width, height, options) { WEBGL_draw_buffers) } -},{"gl-texture2d":356}],277:[function(_dereq_,module,exports){ +},{"gl-texture2d":348}],271:[function(_dereq_,module,exports){ var sprintf = _dereq_('sprintf-js').sprintf; var glConstants = _dereq_('gl-constants/lookup'); @@ -51490,7 +50912,7 @@ function formatCompilerError(errLog, src, type) { } -},{"add-line-numbers":72,"gl-constants/lookup":272,"glsl-shader-name":434,"sprintf-js":568}],278:[function(_dereq_,module,exports){ +},{"add-line-numbers":72,"gl-constants/lookup":266,"glsl-shader-name":426,"sprintf-js":553}],272:[function(_dereq_,module,exports){ 'use strict' module.exports = createHeatmap2D @@ -51842,7 +51264,7 @@ function createHeatmap2D (plot, options) { return heatmap } -},{"./lib/shaders":279,"binary-search-bounds":103,"gl-buffer":267,"gl-shader":339,"iota-array":451,"typedarray-pool":617}],279:[function(_dereq_,module,exports){ +},{"./lib/shaders":273,"binary-search-bounds":103,"gl-buffer":261,"gl-shader":332,"iota-array":441,"typedarray-pool":601}],273:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -51854,7 +51276,7 @@ module.exports = { pickVertex: glslify(["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"]) } -},{"glslify":442}],280:[function(_dereq_,module,exports){ +},{"glslify":434}],274:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var createShader = _dereq_('gl-shader') @@ -51878,7 +51300,7 @@ exports.createPickShader = function(gl) { return createShader(gl, vertSrc, pickFrag, null, ATTRIBUTES) } -},{"gl-shader":339,"glslify":282}],281:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":276}],275:[function(_dereq_,module,exports){ 'use strict' module.exports = createLinePlot @@ -52279,9 +51701,9 @@ function createLinePlot (options) { return linePlot } -},{"./lib/shaders":280,"binary-search-bounds":103,"gl-buffer":267,"gl-texture2d":356,"gl-vao":361,"ndarray":483}],282:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],283:[function(_dereq_,module,exports){ +},{"./lib/shaders":274,"binary-search-bounds":103,"gl-buffer":261,"gl-texture2d":348,"gl-vao":353,"ndarray":472}],276:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],277:[function(_dereq_,module,exports){ module.exports = adjoint; /** @@ -52315,7 +51737,7 @@ function adjoint(out, a) { out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); return out; }; -},{}],284:[function(_dereq_,module,exports){ +},{}],278:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -52344,7 +51766,7 @@ function clone(a) { out[15] = a[15]; return out; }; -},{}],285:[function(_dereq_,module,exports){ +},{}],279:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -52373,7 +51795,7 @@ function copy(out, a) { out[15] = a[15]; return out; }; -},{}],286:[function(_dereq_,module,exports){ +},{}],280:[function(_dereq_,module,exports){ module.exports = create; /** @@ -52401,7 +51823,7 @@ function create() { out[15] = 1; return out; }; -},{}],287:[function(_dereq_,module,exports){ +},{}],281:[function(_dereq_,module,exports){ module.exports = determinant; /** @@ -52432,7 +51854,7 @@ function determinant(a) { // Calculate the determinant return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; }; -},{}],288:[function(_dereq_,module,exports){ +},{}],282:[function(_dereq_,module,exports){ module.exports = fromQuat; /** @@ -52480,7 +51902,7 @@ function fromQuat(out, q) { return out; }; -},{}],289:[function(_dereq_,module,exports){ +},{}],283:[function(_dereq_,module,exports){ module.exports = fromRotation /** @@ -52535,7 +51957,7 @@ function fromRotation(out, rad, axis) { return out } -},{}],290:[function(_dereq_,module,exports){ +},{}],284:[function(_dereq_,module,exports){ module.exports = fromRotationTranslation; /** @@ -52589,7 +52011,7 @@ function fromRotationTranslation(out, q, v) { return out; }; -},{}],291:[function(_dereq_,module,exports){ +},{}],285:[function(_dereq_,module,exports){ module.exports = fromScaling /** @@ -52623,7 +52045,7 @@ function fromScaling(out, v) { return out } -},{}],292:[function(_dereq_,module,exports){ +},{}],286:[function(_dereq_,module,exports){ module.exports = fromTranslation /** @@ -52657,7 +52079,7 @@ function fromTranslation(out, v) { return out } -},{}],293:[function(_dereq_,module,exports){ +},{}],287:[function(_dereq_,module,exports){ module.exports = fromXRotation /** @@ -52694,7 +52116,7 @@ function fromXRotation(out, rad) { out[15] = 1 return out } -},{}],294:[function(_dereq_,module,exports){ +},{}],288:[function(_dereq_,module,exports){ module.exports = fromYRotation /** @@ -52731,7 +52153,7 @@ function fromYRotation(out, rad) { out[15] = 1 return out } -},{}],295:[function(_dereq_,module,exports){ +},{}],289:[function(_dereq_,module,exports){ module.exports = fromZRotation /** @@ -52768,7 +52190,7 @@ function fromZRotation(out, rad) { out[15] = 1 return out } -},{}],296:[function(_dereq_,module,exports){ +},{}],290:[function(_dereq_,module,exports){ module.exports = frustum; /** @@ -52805,7 +52227,7 @@ function frustum(out, left, right, bottom, top, near, far) { out[15] = 0; return out; }; -},{}],297:[function(_dereq_,module,exports){ +},{}],291:[function(_dereq_,module,exports){ module.exports = identity; /** @@ -52833,7 +52255,7 @@ function identity(out) { out[15] = 1; return out; }; -},{}],298:[function(_dereq_,module,exports){ +},{}],292:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create') , clone: _dereq_('./clone') @@ -52866,7 +52288,7 @@ module.exports = { , str: _dereq_('./str') } -},{"./adjoint":283,"./clone":284,"./copy":285,"./create":286,"./determinant":287,"./fromQuat":288,"./fromRotation":289,"./fromRotationTranslation":290,"./fromScaling":291,"./fromTranslation":292,"./fromXRotation":293,"./fromYRotation":294,"./fromZRotation":295,"./frustum":296,"./identity":297,"./invert":299,"./lookAt":300,"./multiply":301,"./ortho":302,"./perspective":303,"./perspectiveFromFieldOfView":304,"./rotate":305,"./rotateX":306,"./rotateY":307,"./rotateZ":308,"./scale":309,"./str":310,"./translate":311,"./transpose":312}],299:[function(_dereq_,module,exports){ +},{"./adjoint":277,"./clone":278,"./copy":279,"./create":280,"./determinant":281,"./fromQuat":282,"./fromRotation":283,"./fromRotationTranslation":284,"./fromScaling":285,"./fromTranslation":286,"./fromXRotation":287,"./fromYRotation":288,"./fromZRotation":289,"./frustum":290,"./identity":291,"./invert":293,"./lookAt":294,"./multiply":295,"./ortho":296,"./perspective":297,"./perspectiveFromFieldOfView":298,"./rotate":299,"./rotateX":300,"./rotateY":301,"./rotateZ":302,"./scale":303,"./str":304,"./translate":305,"./transpose":306}],293:[function(_dereq_,module,exports){ module.exports = invert; /** @@ -52922,7 +52344,7 @@ function invert(out, a) { return out; }; -},{}],300:[function(_dereq_,module,exports){ +},{}],294:[function(_dereq_,module,exports){ var identity = _dereq_('./identity'); module.exports = lookAt; @@ -53013,7 +52435,7 @@ function lookAt(out, eye, center, up) { return out; }; -},{"./identity":297}],301:[function(_dereq_,module,exports){ +},{"./identity":291}],295:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -53056,7 +52478,7 @@ function multiply(out, a, b) { out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; return out; }; -},{}],302:[function(_dereq_,module,exports){ +},{}],296:[function(_dereq_,module,exports){ module.exports = ortho; /** @@ -53093,7 +52515,7 @@ function ortho(out, left, right, bottom, top, near, far) { out[15] = 1; return out; }; -},{}],303:[function(_dereq_,module,exports){ +},{}],297:[function(_dereq_,module,exports){ module.exports = perspective; /** @@ -53127,7 +52549,7 @@ function perspective(out, fovy, aspect, near, far) { out[15] = 0; return out; }; -},{}],304:[function(_dereq_,module,exports){ +},{}],298:[function(_dereq_,module,exports){ module.exports = perspectiveFromFieldOfView; /** @@ -53169,7 +52591,7 @@ function perspectiveFromFieldOfView(out, fov, near, far) { } -},{}],305:[function(_dereq_,module,exports){ +},{}],299:[function(_dereq_,module,exports){ module.exports = rotate; /** @@ -53234,7 +52656,7 @@ function rotate(out, a, rad, axis) { } return out; }; -},{}],306:[function(_dereq_,module,exports){ +},{}],300:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -53279,7 +52701,7 @@ function rotateX(out, a, rad) { out[11] = a23 * c - a13 * s; return out; }; -},{}],307:[function(_dereq_,module,exports){ +},{}],301:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -53324,7 +52746,7 @@ function rotateY(out, a, rad) { out[11] = a03 * s + a23 * c; return out; }; -},{}],308:[function(_dereq_,module,exports){ +},{}],302:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -53369,7 +52791,7 @@ function rotateZ(out, a, rad) { out[7] = a13 * c - a03 * s; return out; }; -},{}],309:[function(_dereq_,module,exports){ +},{}],303:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -53401,7 +52823,7 @@ function scale(out, a, v) { out[15] = a[15]; return out; }; -},{}],310:[function(_dereq_,module,exports){ +},{}],304:[function(_dereq_,module,exports){ module.exports = str; /** @@ -53416,7 +52838,7 @@ function str(a) { a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; }; -},{}],311:[function(_dereq_,module,exports){ +},{}],305:[function(_dereq_,module,exports){ module.exports = translate; /** @@ -53455,7 +52877,7 @@ function translate(out, a, v) { return out; }; -},{}],312:[function(_dereq_,module,exports){ +},{}],306:[function(_dereq_,module,exports){ module.exports = transpose; /** @@ -53505,7 +52927,7 @@ function transpose(out, a) { return out; }; -},{}],313:[function(_dereq_,module,exports){ +},{}],307:[function(_dereq_,module,exports){ 'use strict' var barycentric = _dereq_('barycentric') @@ -53603,7 +53025,7 @@ function closestPointToPickLocation(simplex, pixelCoord, model, view, projection } return [closestIndex, interpolate(simplex, weights), weights] } -},{"barycentric":85,"polytope-closest-point/lib/closest_point_2d.js":512}],314:[function(_dereq_,module,exports){ +},{"barycentric":85,"polytope-closest-point/lib/closest_point_2d.js":498}],308:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var triVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]) @@ -53672,7 +53094,7 @@ exports.contourShader = { ] } -},{"glslify":442}],315:[function(_dereq_,module,exports){ +},{"glslify":434}],309:[function(_dereq_,module,exports){ 'use strict' var DEFAULT_VERTEX_NORMALS_EPSILON = 1e-6; // may be too large if triangles are very small @@ -54783,7 +54205,7 @@ function createSimplicialMesh(gl, params) { module.exports = createSimplicialMesh -},{"./lib/closest-point":313,"./lib/shaders":314,"colormap":137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-shader":339,"gl-texture2d":356,"gl-vao":361,"ndarray":483,"normals":486,"simplicial-complex-contour":557,"typedarray-pool":617}],316:[function(_dereq_,module,exports){ +},{"./lib/closest-point":307,"./lib/shaders":308,"colormap":137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-shader":332,"gl-texture2d":348,"gl-vao":353,"ndarray":472,"normals":475,"simplicial-complex-contour":543,"typedarray-pool":601}],310:[function(_dereq_,module,exports){ 'use strict' module.exports = createBoxes @@ -54846,7 +54268,7 @@ function createBoxes(plot) { return new Boxes(plot, vbo, shader) } -},{"./shaders":319,"gl-buffer":267,"gl-shader":339}],317:[function(_dereq_,module,exports){ +},{"./shaders":313,"gl-buffer":261,"gl-shader":332}],311:[function(_dereq_,module,exports){ 'use strict' module.exports = createGrid @@ -55093,7 +54515,7 @@ function createGrid(plot) { return grid } -},{"./shaders":319,"binary-search-bounds":103,"gl-buffer":267,"gl-shader":339}],318:[function(_dereq_,module,exports){ +},{"./shaders":313,"binary-search-bounds":103,"gl-buffer":261,"gl-shader":332}],312:[function(_dereq_,module,exports){ 'use strict' module.exports = createLines @@ -55158,7 +54580,7 @@ function createLines(plot) { return lines } -},{"./shaders":319,"gl-buffer":267,"gl-shader":339}],319:[function(_dereq_,module,exports){ +},{"./shaders":313,"gl-buffer":261,"gl-shader":332}],313:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -55176,7 +54598,7 @@ module.exports = { tickVert: glslify(["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"]) } -},{"glslify":321}],320:[function(_dereq_,module,exports){ +},{"glslify":315}],314:[function(_dereq_,module,exports){ 'use strict' module.exports = createTextElements @@ -55454,9 +54876,9 @@ function createTextElements(plot) { return text } -},{"./shaders":319,"binary-search-bounds":103,"gl-buffer":267,"gl-shader":339,"text-cache":596}],321:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],322:[function(_dereq_,module,exports){ +},{"./shaders":313,"binary-search-bounds":103,"gl-buffer":261,"gl-shader":332,"text-cache":581}],315:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],316:[function(_dereq_,module,exports){ 'use strict' module.exports = createGLPlot2D @@ -56039,7 +55461,7 @@ function createGLPlot2D(options) { return plot } -},{"./lib/box":316,"./lib/grid":317,"./lib/line":318,"./lib/text":320,"gl-select-static":338}],323:[function(_dereq_,module,exports){ +},{"./lib/box":310,"./lib/grid":311,"./lib/line":312,"./lib/text":314,"gl-select-static":331}],317:[function(_dereq_,module,exports){ 'use strict' module.exports = createCamera @@ -56320,7 +55742,7 @@ function createCamera(element, options) { return camera } -},{"3d-view":55,"has-passive-events":444,"mouse-change":470,"mouse-event-offset":471,"mouse-wheel":473,"right-now":542}],324:[function(_dereq_,module,exports){ +},{"3d-view":55,"has-passive-events":436,"mouse-change":459,"mouse-event-offset":460,"mouse-wheel":462,"right-now":528}],318:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var createShader = _dereq_('gl-shader') @@ -56331,9 +55753,7 @@ module.exports = function(gl) { return createShader(gl, vertSrc, fragSrc, null, [ { name: 'position', type: 'vec2'}]) } -},{"gl-shader":339,"glslify":325}],325:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],326:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":434}],319:[function(_dereq_,module,exports){ 'use strict' var createCamera = _dereq_('./camera.js') @@ -57188,7 +56608,7 @@ function calcCameraParams(scene, isOrtho) { } } -},{"./camera.js":323,"./lib/shader":324,"a-big-triangle":70,"gl-axes3d":258,"gl-axes3d/properties":266,"gl-fbo":276,"gl-mat4/ortho":302,"gl-mat4/perspective":303,"gl-select-static":338,"gl-spikes3d":349,"is-mobile":455,"mouse-change":470}],327:[function(_dereq_,module,exports){ +},{"./camera.js":317,"./lib/shader":318,"a-big-triangle":70,"gl-axes3d":253,"gl-axes3d/properties":260,"gl-fbo":270,"gl-mat4/ortho":296,"gl-mat4/perspective":297,"gl-select-static":331,"gl-spikes3d":341,"is-mobile":445,"mouse-change":459}],320:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') exports.pointVertex = glslify(["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}"]) @@ -57196,7 +56616,7 @@ exports.pointFragment = glslify(["precision mediump float;\n#define GLSLIFY exports.pickVertex = glslify(["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"]) exports.pickFragment = glslify(["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"]) -},{"glslify":442}],328:[function(_dereq_,module,exports){ +},{"glslify":434}],321:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -57416,7 +56836,7 @@ function createPointcloud2D(plot, options) { return result } -},{"./lib/shader":327,"gl-buffer":267,"gl-shader":339,"typedarray-pool":617}],329:[function(_dereq_,module,exports){ +},{"./lib/shader":320,"gl-buffer":261,"gl-shader":332,"typedarray-pool":601}],322:[function(_dereq_,module,exports){ module.exports = slerp /** @@ -57469,14 +56889,14 @@ function slerp (out, a, b, t) { return out } -},{}],330:[function(_dereq_,module,exports){ +},{}],323:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(a){ return (!a && a !== 0) ? '' : a.toString(); } -},{}],331:[function(_dereq_,module,exports){ +},{}],324:[function(_dereq_,module,exports){ "use strict" var vectorizeText = _dereq_("vectorize-text") @@ -57545,7 +56965,7 @@ function getGlyph(symbol, font, pixelRatio) { //Save cached symbol return fontCache[symbol] = [triSymbol, lineSymbol, bounds] } -},{"vectorize-text":623}],332:[function(_dereq_,module,exports){ +},{"vectorize-text":607}],325:[function(_dereq_,module,exports){ var createShaderWrapper = _dereq_('gl-shader') var glslify = _dereq_('glslify') @@ -57622,9 +57042,9 @@ exports.createPickProject = function(gl) { return createShader(gl, pickProject) } -},{"gl-shader":339,"glslify":333}],333:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],334:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":326}],326:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],327:[function(_dereq_,module,exports){ 'use strict' var isAllBlank = _dereq_('is-string-blank') @@ -58496,7 +57916,7 @@ function createPointCloud(options) { return pointCloud } -},{"./lib/get-simple-string":330,"./lib/glyphs":331,"./lib/shaders":332,"gl-buffer":267,"gl-mat4/multiply":301,"gl-vao":361,"is-string-blank":458,"typedarray-pool":617}],335:[function(_dereq_,module,exports){ +},{"./lib/get-simple-string":323,"./lib/glyphs":324,"./lib/shaders":325,"gl-buffer":261,"gl-mat4/multiply":295,"gl-vao":353,"is-string-blank":448,"typedarray-pool":601}],328:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -58504,9 +57924,9 @@ var glslify = _dereq_('glslify') exports.boxVertex = glslify(["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"]) exports.boxFragment = glslify(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"]) -},{"glslify":336}],336:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],337:[function(_dereq_,module,exports){ +},{"glslify":329}],329:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],330:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -58632,7 +58052,7 @@ function createSelectBox(plot, options) { return selectBox } -},{"./lib/shaders":335,"gl-buffer":267,"gl-shader":339}],338:[function(_dereq_,module,exports){ +},{"./lib/shaders":328,"gl-buffer":261,"gl-shader":332}],331:[function(_dereq_,module,exports){ 'use strict' module.exports = createSelectBuffer @@ -58817,7 +58237,7 @@ function createSelectBuffer(gl, shape) { return new SelectBuffer(gl, fbo, buffer) } -},{"bit-twiddle":104,"gl-fbo":276,"ndarray":483,"typedarray-pool":617}],339:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"gl-fbo":270,"ndarray":472,"typedarray-pool":601}],332:[function(_dereq_,module,exports){ 'use strict' var createUniformWrapper = _dereq_('./lib/create-uniforms') @@ -59083,7 +58503,7 @@ function createShader( module.exports = createShader -},{"./lib/GLError":340,"./lib/create-attributes":341,"./lib/create-uniforms":342,"./lib/reflect":343,"./lib/runtime-reflect":344,"./lib/shader-cache":345}],340:[function(_dereq_,module,exports){ +},{"./lib/GLError":333,"./lib/create-attributes":334,"./lib/create-uniforms":335,"./lib/reflect":336,"./lib/runtime-reflect":337,"./lib/shader-cache":338}],333:[function(_dereq_,module,exports){ function GLError (rawError, shortMessage, longMessage) { this.shortMessage = shortMessage || '' this.longMessage = longMessage || '' @@ -59098,7 +58518,7 @@ GLError.prototype.name = 'GLError' GLError.prototype.constructor = GLError module.exports = GLError -},{}],341:[function(_dereq_,module,exports){ +},{}],334:[function(_dereq_,module,exports){ 'use strict' module.exports = createAttributeWrapper @@ -59159,6 +58579,40 @@ Object.defineProperty(proto, 'location', { } }) +var allFns = [ + function (gl, v, x0) { + if (x0.length === undefined) { + return gl.vertexAttrib1f(v, x0) + } else { + return gl.vertexAttrib1fv(v, x0) + } + }, + + function (gl, v, x0, x1) { + if (x0.length === undefined) { + return gl.vertexAttrib2f(v, x0, x1) + } else { + return gl.vertexAttrib2fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2) { + if (x0.length === undefined) { + return gl.vertexAttrib3f(v, x0, x1, x2) + } else { + return gl.vertexAttrib3fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2, x3) { + if (x0.length === undefined) { + return gl.vertexAttrib4f(v, x0, x1, x2, x3) + } else { + return gl.vertexAttrib4fv(v, x0) + } + } +] + //Adds a vector attribute to obj function addVectorAttribute( gl @@ -59169,21 +58623,7 @@ function addVectorAttribute( , obj , name) { - //Construct constant function - var constFuncArgs = [ 'gl', 'v' ] - var varNames = [] - for(var i=0; i 4) { - throw new GLError('', 'Invalid data type') + function makeSetter(type) { + return function updateProperty(obj){ + var indices = enumerateIndices('', type) + for(var i=0; i 4) { - throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + type) + var vidx = t.indexOf('vec') + if(0 <= vidx && vidx <= 1 && t.length === 4 + vidx) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type') + } + switch(t.charAt(0)) { + case 'b': + case 'i': + gl['uniform' + d + 'iv'](locations[idx], objPath) + break + case 'v': + gl['uniform' + d + 'fv'](locations[idx], objPath) + break + default: + throw new GLError('', 'Unrecognized data type for vector ' + name + ': ' + t) + } + } else if(t.indexOf('mat') === 0 && t.length === 4) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + t) + } + gl['uniformMatrix' + d + 'fv'](locations[idx], false, objPath) + break + } else { + throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + t) + } } - return 'gl.uniformMatrix' + d + 'fv(locations[' + index + '],false,obj' + path + ')' - } else { - throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + type) } - break + } } } @@ -59457,21 +58931,6 @@ function createUniformWrapper(gl, wrapper, uniforms, locations) { return indices } - function makeSetter(type) { - var code = [ 'return function updateProperty(obj){' ] - var indices = enumerateIndices('', type) - for(var i=0; i 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) @@ -60163,9 +59619,9 @@ exports.pickShader = { ] } -},{"glslify":351}],351:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],352:[function(_dereq_,module,exports){ +},{"glslify":343}],343:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],344:[function(_dereq_,module,exports){ "use strict"; var vec3 = _dereq_('gl-vec3'); @@ -60725,7 +60181,7 @@ module.exports.createTubeMesh = function(gl, params) { }); } -},{"./lib/shaders":350,"gl-cone3d":268,"gl-vec3":380,"gl-vec4":416}],353:[function(_dereq_,module,exports){ +},{"./lib/shaders":342,"gl-cone3d":262,"gl-vec3":372,"gl-vec4":408}],345:[function(_dereq_,module,exports){ var createShader = _dereq_('gl-shader') var glslify = _dereq_('glslify') @@ -60775,7 +60231,7 @@ exports.createPickContourShader = function (gl) { return shader } -},{"gl-shader":339,"glslify":442}],354:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":434}],346:[function(_dereq_,module,exports){ 'use strict' module.exports = createSurfacePlot @@ -62157,7 +61613,7 @@ function createSurfacePlot (params) { return surface } -},{"./lib/shaders":353,"binary-search-bounds":103,"bit-twiddle":104,"colormap":137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-texture2d":356,"gl-vao":361,"ndarray":483,"ndarray-gradient":476,"ndarray-ops":478,"ndarray-pack":479,"surface-nets":591,"typedarray-pool":617}],355:[function(_dereq_,module,exports){ +},{"./lib/shaders":345,"binary-search-bounds":103,"bit-twiddle":104,"colormap":137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-texture2d":348,"gl-vao":353,"ndarray":472,"ndarray-gradient":465,"ndarray-ops":467,"ndarray-pack":468,"surface-nets":576,"typedarray-pool":601}],347:[function(_dereq_,module,exports){ 'use strict' var Font = _dereq_('css-font') @@ -62885,7 +62341,7 @@ function isRegl (o) { module.exports = GlText -},{"bit-twiddle":104,"color-normalize":131,"css-font":150,"detect-kerning":181,"es6-weak-map":241,"flatten-vertex-data":252,"font-atlas":253,"font-measure":254,"gl-util/context":357,"is-plain-obj":457,"object-assign":487,"parse-rect":492,"parse-unit":494,"pick-by-alias":498,"regl":540,"to-px":600,"typedarray-pool":617}],356:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"color-normalize":131,"css-font":150,"detect-kerning":178,"es6-weak-map":238,"flatten-vertex-data":248,"font-atlas":249,"font-measure":250,"gl-util/context":349,"is-plain-obj":447,"object-assign":476,"parse-rect":481,"parse-unit":483,"pick-by-alias":485,"regl":526,"to-px":585,"typedarray-pool":601}],348:[function(_dereq_,module,exports){ 'use strict' var ndarray = _dereq_('ndarray') @@ -63448,7 +62904,7 @@ function createTexture2D(gl) { throw new Error('gl-texture2d: Invalid arguments for texture2d constructor') } -},{"ndarray":483,"ndarray-ops":478,"typedarray-pool":617}],357:[function(_dereq_,module,exports){ +},{"ndarray":472,"ndarray-ops":467,"typedarray-pool":601}],349:[function(_dereq_,module,exports){ (function (global){(function (){ /** @module gl-util/context */ 'use strict' @@ -63576,7 +63032,7 @@ function createCanvas () { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"pick-by-alias":498}],358:[function(_dereq_,module,exports){ +},{"pick-by-alias":485}],350:[function(_dereq_,module,exports){ "use strict" function doBind(gl, elements, attributes) { @@ -63631,7 +63087,7 @@ function doBind(gl, elements, attributes) { } module.exports = doBind -},{}],359:[function(_dereq_,module,exports){ +},{}],351:[function(_dereq_,module,exports){ "use strict" var bindAttribs = _dereq_("./do-bind.js") @@ -63671,7 +63127,7 @@ function createVAOEmulated(gl) { } module.exports = createVAOEmulated -},{"./do-bind.js":358}],360:[function(_dereq_,module,exports){ +},{"./do-bind.js":350}],352:[function(_dereq_,module,exports){ "use strict" var bindAttribs = _dereq_("./do-bind.js") @@ -63759,7 +63215,7 @@ function createVAONative(gl, ext) { } module.exports = createVAONative -},{"./do-bind.js":358}],361:[function(_dereq_,module,exports){ +},{"./do-bind.js":350}],353:[function(_dereq_,module,exports){ "use strict" var createVAONative = _dereq_("./lib/vao-native.js") @@ -63788,7 +63244,7 @@ function createVAO(gl, attributes, elements, elementsType) { module.exports = createVAO -},{"./lib/vao-emulated.js":359,"./lib/vao-native.js":360}],362:[function(_dereq_,module,exports){ +},{"./lib/vao-emulated.js":351,"./lib/vao-native.js":352}],354:[function(_dereq_,module,exports){ module.exports = add; /** @@ -63805,7 +63261,7 @@ function add(out, a, b) { out[2] = a[2] + b[2] return out } -},{}],363:[function(_dereq_,module,exports){ +},{}],355:[function(_dereq_,module,exports){ module.exports = angle var fromValues = _dereq_('./fromValues') @@ -63834,7 +63290,7 @@ function angle(a, b) { } } -},{"./dot":373,"./fromValues":379,"./normalize":390}],364:[function(_dereq_,module,exports){ +},{"./dot":365,"./fromValues":371,"./normalize":382}],356:[function(_dereq_,module,exports){ module.exports = ceil /** @@ -63851,7 +63307,7 @@ function ceil(out, a) { return out } -},{}],365:[function(_dereq_,module,exports){ +},{}],357:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -63867,7 +63323,7 @@ function clone(a) { out[2] = a[2] return out } -},{}],366:[function(_dereq_,module,exports){ +},{}],358:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -63883,7 +63339,7 @@ function copy(out, a) { out[2] = a[2] return out } -},{}],367:[function(_dereq_,module,exports){ +},{}],359:[function(_dereq_,module,exports){ module.exports = create; /** @@ -63898,7 +63354,7 @@ function create() { out[2] = 0 return out } -},{}],368:[function(_dereq_,module,exports){ +},{}],360:[function(_dereq_,module,exports){ module.exports = cross; /** @@ -63918,10 +63374,10 @@ function cross(out, a, b) { out[2] = ax * by - ay * bx return out } -},{}],369:[function(_dereq_,module,exports){ +},{}],361:[function(_dereq_,module,exports){ module.exports = _dereq_('./distance') -},{"./distance":370}],370:[function(_dereq_,module,exports){ +},{"./distance":362}],362:[function(_dereq_,module,exports){ module.exports = distance; /** @@ -63937,10 +63393,10 @@ function distance(a, b) { z = b[2] - a[2] return Math.sqrt(x*x + y*y + z*z) } -},{}],371:[function(_dereq_,module,exports){ +},{}],363:[function(_dereq_,module,exports){ module.exports = _dereq_('./divide') -},{"./divide":372}],372:[function(_dereq_,module,exports){ +},{"./divide":364}],364:[function(_dereq_,module,exports){ module.exports = divide; /** @@ -63957,7 +63413,7 @@ function divide(out, a, b) { out[2] = a[2] / b[2] return out } -},{}],373:[function(_dereq_,module,exports){ +},{}],365:[function(_dereq_,module,exports){ module.exports = dot; /** @@ -63970,10 +63426,10 @@ module.exports = dot; function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] } -},{}],374:[function(_dereq_,module,exports){ +},{}],366:[function(_dereq_,module,exports){ module.exports = 0.000001 -},{}],375:[function(_dereq_,module,exports){ +},{}],367:[function(_dereq_,module,exports){ module.exports = equals var EPSILON = _dereq_('./epsilon') @@ -63997,7 +63453,7 @@ function equals(a, b) { Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))) } -},{"./epsilon":374}],376:[function(_dereq_,module,exports){ +},{"./epsilon":366}],368:[function(_dereq_,module,exports){ module.exports = exactEquals /** @@ -64011,7 +63467,7 @@ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] } -},{}],377:[function(_dereq_,module,exports){ +},{}],369:[function(_dereq_,module,exports){ module.exports = floor /** @@ -64028,7 +63484,7 @@ function floor(out, a) { return out } -},{}],378:[function(_dereq_,module,exports){ +},{}],370:[function(_dereq_,module,exports){ module.exports = forEach; var vec = _dereq_('./create')() @@ -64073,7 +63529,7 @@ function forEach(a, stride, offset, count, fn, arg) { return a } -},{"./create":367}],379:[function(_dereq_,module,exports){ +},{"./create":359}],371:[function(_dereq_,module,exports){ module.exports = fromValues; /** @@ -64091,7 +63547,7 @@ function fromValues(x, y, z) { out[2] = z return out } -},{}],380:[function(_dereq_,module,exports){ +},{}],372:[function(_dereq_,module,exports){ module.exports = { EPSILON: _dereq_('./epsilon') , create: _dereq_('./create') @@ -64140,7 +63596,7 @@ module.exports = { , forEach: _dereq_('./forEach') } -},{"./add":362,"./angle":363,"./ceil":364,"./clone":365,"./copy":366,"./create":367,"./cross":368,"./dist":369,"./distance":370,"./div":371,"./divide":372,"./dot":373,"./epsilon":374,"./equals":375,"./exactEquals":376,"./floor":377,"./forEach":378,"./fromValues":379,"./inverse":381,"./len":382,"./length":383,"./lerp":384,"./max":385,"./min":386,"./mul":387,"./multiply":388,"./negate":389,"./normalize":390,"./random":391,"./rotateX":392,"./rotateY":393,"./rotateZ":394,"./round":395,"./scale":396,"./scaleAndAdd":397,"./set":398,"./sqrDist":399,"./sqrLen":400,"./squaredDistance":401,"./squaredLength":402,"./sub":403,"./subtract":404,"./transformMat3":405,"./transformMat4":406,"./transformQuat":407}],381:[function(_dereq_,module,exports){ +},{"./add":354,"./angle":355,"./ceil":356,"./clone":357,"./copy":358,"./create":359,"./cross":360,"./dist":361,"./distance":362,"./div":363,"./divide":364,"./dot":365,"./epsilon":366,"./equals":367,"./exactEquals":368,"./floor":369,"./forEach":370,"./fromValues":371,"./inverse":373,"./len":374,"./length":375,"./lerp":376,"./max":377,"./min":378,"./mul":379,"./multiply":380,"./negate":381,"./normalize":382,"./random":383,"./rotateX":384,"./rotateY":385,"./rotateZ":386,"./round":387,"./scale":388,"./scaleAndAdd":389,"./set":390,"./sqrDist":391,"./sqrLen":392,"./squaredDistance":393,"./squaredLength":394,"./sub":395,"./subtract":396,"./transformMat3":397,"./transformMat4":398,"./transformQuat":399}],373:[function(_dereq_,module,exports){ module.exports = inverse; /** @@ -64156,10 +63612,10 @@ function inverse(out, a) { out[2] = 1.0 / a[2] return out } -},{}],382:[function(_dereq_,module,exports){ +},{}],374:[function(_dereq_,module,exports){ module.exports = _dereq_('./length') -},{"./length":383}],383:[function(_dereq_,module,exports){ +},{"./length":375}],375:[function(_dereq_,module,exports){ module.exports = length; /** @@ -64174,7 +63630,7 @@ function length(a) { z = a[2] return Math.sqrt(x*x + y*y + z*z) } -},{}],384:[function(_dereq_,module,exports){ +},{}],376:[function(_dereq_,module,exports){ module.exports = lerp; /** @@ -64195,7 +63651,7 @@ function lerp(out, a, b, t) { out[2] = az + t * (b[2] - az) return out } -},{}],385:[function(_dereq_,module,exports){ +},{}],377:[function(_dereq_,module,exports){ module.exports = max; /** @@ -64212,7 +63668,7 @@ function max(out, a, b) { out[2] = Math.max(a[2], b[2]) return out } -},{}],386:[function(_dereq_,module,exports){ +},{}],378:[function(_dereq_,module,exports){ module.exports = min; /** @@ -64229,10 +63685,10 @@ function min(out, a, b) { out[2] = Math.min(a[2], b[2]) return out } -},{}],387:[function(_dereq_,module,exports){ +},{}],379:[function(_dereq_,module,exports){ module.exports = _dereq_('./multiply') -},{"./multiply":388}],388:[function(_dereq_,module,exports){ +},{"./multiply":380}],380:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -64249,7 +63705,7 @@ function multiply(out, a, b) { out[2] = a[2] * b[2] return out } -},{}],389:[function(_dereq_,module,exports){ +},{}],381:[function(_dereq_,module,exports){ module.exports = negate; /** @@ -64265,7 +63721,7 @@ function negate(out, a) { out[2] = -a[2] return out } -},{}],390:[function(_dereq_,module,exports){ +},{}],382:[function(_dereq_,module,exports){ module.exports = normalize; /** @@ -64289,7 +63745,7 @@ function normalize(out, a) { } return out } -},{}],391:[function(_dereq_,module,exports){ +},{}],383:[function(_dereq_,module,exports){ module.exports = random; /** @@ -64311,7 +63767,7 @@ function random(out, scale) { out[2] = z * scale return out } -},{}],392:[function(_dereq_,module,exports){ +},{}],384:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -64341,7 +63797,7 @@ function rotateX(out, a, b, c){ return out } -},{}],393:[function(_dereq_,module,exports){ +},{}],385:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -64371,7 +63827,7 @@ function rotateY(out, a, b, c){ return out } -},{}],394:[function(_dereq_,module,exports){ +},{}],386:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -64401,7 +63857,7 @@ function rotateZ(out, a, b, c){ return out } -},{}],395:[function(_dereq_,module,exports){ +},{}],387:[function(_dereq_,module,exports){ module.exports = round /** @@ -64418,7 +63874,7 @@ function round(out, a) { return out } -},{}],396:[function(_dereq_,module,exports){ +},{}],388:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -64435,7 +63891,7 @@ function scale(out, a, b) { out[2] = a[2] * b return out } -},{}],397:[function(_dereq_,module,exports){ +},{}],389:[function(_dereq_,module,exports){ module.exports = scaleAndAdd; /** @@ -64453,7 +63909,7 @@ function scaleAndAdd(out, a, b, scale) { out[2] = a[2] + (b[2] * scale) return out } -},{}],398:[function(_dereq_,module,exports){ +},{}],390:[function(_dereq_,module,exports){ module.exports = set; /** @@ -64471,13 +63927,13 @@ function set(out, x, y, z) { out[2] = z return out } -},{}],399:[function(_dereq_,module,exports){ +},{}],391:[function(_dereq_,module,exports){ module.exports = _dereq_('./squaredDistance') -},{"./squaredDistance":401}],400:[function(_dereq_,module,exports){ +},{"./squaredDistance":393}],392:[function(_dereq_,module,exports){ module.exports = _dereq_('./squaredLength') -},{"./squaredLength":402}],401:[function(_dereq_,module,exports){ +},{"./squaredLength":394}],393:[function(_dereq_,module,exports){ module.exports = squaredDistance; /** @@ -64493,7 +63949,7 @@ function squaredDistance(a, b) { z = b[2] - a[2] return x*x + y*y + z*z } -},{}],402:[function(_dereq_,module,exports){ +},{}],394:[function(_dereq_,module,exports){ module.exports = squaredLength; /** @@ -64508,10 +63964,10 @@ function squaredLength(a) { z = a[2] return x*x + y*y + z*z } -},{}],403:[function(_dereq_,module,exports){ +},{}],395:[function(_dereq_,module,exports){ module.exports = _dereq_('./subtract') -},{"./subtract":404}],404:[function(_dereq_,module,exports){ +},{"./subtract":396}],396:[function(_dereq_,module,exports){ module.exports = subtract; /** @@ -64528,7 +63984,7 @@ function subtract(out, a, b) { out[2] = a[2] - b[2] return out } -},{}],405:[function(_dereq_,module,exports){ +},{}],397:[function(_dereq_,module,exports){ module.exports = transformMat3; /** @@ -64546,7 +64002,7 @@ function transformMat3(out, a, m) { out[2] = x * m[2] + y * m[5] + z * m[8] return out } -},{}],406:[function(_dereq_,module,exports){ +},{}],398:[function(_dereq_,module,exports){ module.exports = transformMat4; /** @@ -64567,7 +64023,7 @@ function transformMat4(out, a, m) { out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w return out } -},{}],407:[function(_dereq_,module,exports){ +},{}],399:[function(_dereq_,module,exports){ module.exports = transformQuat; /** @@ -64596,7 +64052,7 @@ function transformQuat(out, a, q) { out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx return out } -},{}],408:[function(_dereq_,module,exports){ +},{}],400:[function(_dereq_,module,exports){ module.exports = add /** @@ -64615,7 +64071,7 @@ function add (out, a, b) { return out } -},{}],409:[function(_dereq_,module,exports){ +},{}],401:[function(_dereq_,module,exports){ module.exports = clone /** @@ -64633,7 +64089,7 @@ function clone (a) { return out } -},{}],410:[function(_dereq_,module,exports){ +},{}],402:[function(_dereq_,module,exports){ module.exports = copy /** @@ -64651,7 +64107,7 @@ function copy (out, a) { return out } -},{}],411:[function(_dereq_,module,exports){ +},{}],403:[function(_dereq_,module,exports){ module.exports = create /** @@ -64668,7 +64124,7 @@ function create () { return out } -},{}],412:[function(_dereq_,module,exports){ +},{}],404:[function(_dereq_,module,exports){ module.exports = distance /** @@ -64686,7 +64142,7 @@ function distance (a, b) { return Math.sqrt(x * x + y * y + z * z + w * w) } -},{}],413:[function(_dereq_,module,exports){ +},{}],405:[function(_dereq_,module,exports){ module.exports = divide /** @@ -64705,7 +64161,7 @@ function divide (out, a, b) { return out } -},{}],414:[function(_dereq_,module,exports){ +},{}],406:[function(_dereq_,module,exports){ module.exports = dot /** @@ -64719,7 +64175,7 @@ function dot (a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3] } -},{}],415:[function(_dereq_,module,exports){ +},{}],407:[function(_dereq_,module,exports){ module.exports = fromValues /** @@ -64740,7 +64196,7 @@ function fromValues (x, y, z, w) { return out } -},{}],416:[function(_dereq_,module,exports){ +},{}],408:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create'), clone: _dereq_('./clone'), @@ -64769,7 +64225,7 @@ module.exports = { transformQuat: _dereq_('./transformQuat') } -},{"./add":408,"./clone":409,"./copy":410,"./create":411,"./distance":412,"./divide":413,"./dot":414,"./fromValues":415,"./inverse":417,"./length":418,"./lerp":419,"./max":420,"./min":421,"./multiply":422,"./negate":423,"./normalize":424,"./random":425,"./scale":426,"./scaleAndAdd":427,"./set":428,"./squaredDistance":429,"./squaredLength":430,"./subtract":431,"./transformMat4":432,"./transformQuat":433}],417:[function(_dereq_,module,exports){ +},{"./add":400,"./clone":401,"./copy":402,"./create":403,"./distance":404,"./divide":405,"./dot":406,"./fromValues":407,"./inverse":409,"./length":410,"./lerp":411,"./max":412,"./min":413,"./multiply":414,"./negate":415,"./normalize":416,"./random":417,"./scale":418,"./scaleAndAdd":419,"./set":420,"./squaredDistance":421,"./squaredLength":422,"./subtract":423,"./transformMat4":424,"./transformQuat":425}],409:[function(_dereq_,module,exports){ module.exports = inverse /** @@ -64787,7 +64243,7 @@ function inverse (out, a) { return out } -},{}],418:[function(_dereq_,module,exports){ +},{}],410:[function(_dereq_,module,exports){ module.exports = length /** @@ -64804,7 +64260,7 @@ function length (a) { return Math.sqrt(x * x + y * y + z * z + w * w) } -},{}],419:[function(_dereq_,module,exports){ +},{}],411:[function(_dereq_,module,exports){ module.exports = lerp /** @@ -64828,7 +64284,7 @@ function lerp (out, a, b, t) { return out } -},{}],420:[function(_dereq_,module,exports){ +},{}],412:[function(_dereq_,module,exports){ module.exports = max /** @@ -64847,7 +64303,7 @@ function max (out, a, b) { return out } -},{}],421:[function(_dereq_,module,exports){ +},{}],413:[function(_dereq_,module,exports){ module.exports = min /** @@ -64866,7 +64322,7 @@ function min (out, a, b) { return out } -},{}],422:[function(_dereq_,module,exports){ +},{}],414:[function(_dereq_,module,exports){ module.exports = multiply /** @@ -64885,7 +64341,7 @@ function multiply (out, a, b) { return out } -},{}],423:[function(_dereq_,module,exports){ +},{}],415:[function(_dereq_,module,exports){ module.exports = negate /** @@ -64903,7 +64359,7 @@ function negate (out, a) { return out } -},{}],424:[function(_dereq_,module,exports){ +},{}],416:[function(_dereq_,module,exports){ module.exports = normalize /** @@ -64929,7 +64385,7 @@ function normalize (out, a) { return out } -},{}],425:[function(_dereq_,module,exports){ +},{}],417:[function(_dereq_,module,exports){ var vecNormalize = _dereq_('./normalize') var vecScale = _dereq_('./scale') @@ -64955,7 +64411,7 @@ function random (out, scale) { return out } -},{"./normalize":424,"./scale":426}],426:[function(_dereq_,module,exports){ +},{"./normalize":416,"./scale":418}],418:[function(_dereq_,module,exports){ module.exports = scale /** @@ -64974,7 +64430,7 @@ function scale (out, a, b) { return out } -},{}],427:[function(_dereq_,module,exports){ +},{}],419:[function(_dereq_,module,exports){ module.exports = scaleAndAdd /** @@ -64994,7 +64450,7 @@ function scaleAndAdd (out, a, b, scale) { return out } -},{}],428:[function(_dereq_,module,exports){ +},{}],420:[function(_dereq_,module,exports){ module.exports = set /** @@ -65015,7 +64471,7 @@ function set (out, x, y, z, w) { return out } -},{}],429:[function(_dereq_,module,exports){ +},{}],421:[function(_dereq_,module,exports){ module.exports = squaredDistance /** @@ -65033,7 +64489,7 @@ function squaredDistance (a, b) { return x * x + y * y + z * z + w * w } -},{}],430:[function(_dereq_,module,exports){ +},{}],422:[function(_dereq_,module,exports){ module.exports = squaredLength /** @@ -65050,7 +64506,7 @@ function squaredLength (a) { return x * x + y * y + z * z + w * w } -},{}],431:[function(_dereq_,module,exports){ +},{}],423:[function(_dereq_,module,exports){ module.exports = subtract /** @@ -65069,7 +64525,7 @@ function subtract (out, a, b) { return out } -},{}],432:[function(_dereq_,module,exports){ +},{}],424:[function(_dereq_,module,exports){ module.exports = transformMat4 /** @@ -65089,7 +64545,7 @@ function transformMat4 (out, a, m) { return out } -},{}],433:[function(_dereq_,module,exports){ +},{}],425:[function(_dereq_,module,exports){ module.exports = transformQuat /** @@ -65118,7 +64574,7 @@ function transformQuat (out, a, q) { return out } -},{}],434:[function(_dereq_,module,exports){ +},{}],426:[function(_dereq_,module,exports){ var tokenize = _dereq_('glsl-tokenizer') var atob = _dereq_('atob-lite') @@ -65143,7 +64599,7 @@ function getName(src) { } } -},{"atob-lite":84,"glsl-tokenizer":441}],435:[function(_dereq_,module,exports){ +},{"atob-lite":84,"glsl-tokenizer":433}],427:[function(_dereq_,module,exports){ module.exports = tokenize var literals100 = _dereq_('./lib/literals') @@ -65520,7 +64976,7 @@ function tokenize(opt) { } } -},{"./lib/builtins":437,"./lib/builtins-300es":436,"./lib/literals":439,"./lib/literals-300es":438,"./lib/operators":440}],436:[function(_dereq_,module,exports){ +},{"./lib/builtins":429,"./lib/builtins-300es":428,"./lib/literals":431,"./lib/literals-300es":430,"./lib/operators":432}],428:[function(_dereq_,module,exports){ // 300es builtins/reserved words that were previously valid in v100 var v100 = _dereq_('./builtins') @@ -65591,7 +65047,7 @@ module.exports = v100.concat([ , 'textureProjGradOffset' ]) -},{"./builtins":437}],437:[function(_dereq_,module,exports){ +},{"./builtins":429}],429:[function(_dereq_,module,exports){ module.exports = [ // Keep this list sorted 'abs' @@ -65743,7 +65199,7 @@ module.exports = [ , 'textureCubeGradEXT' ] -},{}],438:[function(_dereq_,module,exports){ +},{}],430:[function(_dereq_,module,exports){ var v100 = _dereq_('./literals') module.exports = v100.slice().concat([ @@ -65832,7 +65288,7 @@ module.exports = v100.slice().concat([ , 'usampler2DMSArray' ]) -},{"./literals":439}],439:[function(_dereq_,module,exports){ +},{"./literals":431}],431:[function(_dereq_,module,exports){ module.exports = [ // current 'precision' @@ -65928,7 +65384,7 @@ module.exports = [ , 'using' ] -},{}],440:[function(_dereq_,module,exports){ +},{}],432:[function(_dereq_,module,exports){ module.exports = [ '<<=' , '>>=' @@ -65977,7 +65433,7 @@ module.exports = [ , '}' ] -},{}],441:[function(_dereq_,module,exports){ +},{}],433:[function(_dereq_,module,exports){ var tokenize = _dereq_('./index') module.exports = tokenizeString @@ -65992,9 +65448,9 @@ function tokenizeString(str, opt) { return tokens } -},{"./index":435}],442:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],443:[function(_dereq_,module,exports){ +},{"./index":427}],434:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],435:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict' @@ -66011,7 +65467,7 @@ else { module.exports = hasHover }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"is-browser":452}],444:[function(_dereq_,module,exports){ +},{"is-browser":442}],436:[function(_dereq_,module,exports){ 'use strict' var isBrowser = _dereq_('is-browser') @@ -66037,7 +65493,7 @@ function detect() { module.exports = isBrowser && detect() -},{"is-browser":452}],445:[function(_dereq_,module,exports){ +},{"is-browser":442}],437:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -66123,7 +65579,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],446:[function(_dereq_,module,exports){ +},{}],438:[function(_dereq_,module,exports){ "use strict" //High level idea: @@ -66135,10 +65591,6 @@ module.exports = incrementalConvexHull var orient = _dereq_("robust-orientation") var compareCell = _dereq_("simplicial-complex").compareCells -function compareInt(a, b) { - return a - b -} - function Simplex(vertices, adjacent, boundary) { this.vertices = vertices this.adjacent = adjacent @@ -66165,21 +65617,19 @@ function compareGlue(a, b) { return compareCell(a.vertices, b.vertices) } -function bakeOrient(d) { - var code = ["function orient(){var tuple=this.tuple;return test("] - for(var i=0; i<=d; ++i) { - if(i > 0) { - code.push(",") - } - code.push("tuple[", i, "]") +function wrapper(test) { + return function() { + var tuple = this.tuple + return test.apply(this, tuple) } - code.push(")}return orient") - var proc = new Function("test", code.join("")) +} + +function bakeOrient(d) { var test = orient[d+1] if(!test) { test = orient } - return proc(test) + return wrapper(test) } var BAKED = [] @@ -66218,7 +65668,6 @@ proto.handleBoundaryDegeneracy = function(cell, point) { cell.lastVisited = -n while(toVisit.length > 0) { cell = toVisit.pop() - var cellVerts = cell.vertices var cellAdj = cell.adjacent for(var i=0; i<=d; ++i) { var neighbor = cellAdj[i] @@ -66341,7 +65790,7 @@ proto.addPeaks = function(point, cell) { var nv = neighbor.vertices //Test if neighbor is a peak - if(neighbor.lastVisited !== -n) { + if(neighbor.lastVisited !== -n) { //Compute orientation of p relative to each boundary peak var indexOfNeg1 = 0 for(var j=0; j<=d; ++j) { @@ -66566,11 +66015,11 @@ function incrementalConvexHull(points, randomSearch) { for(var i=d+1; i 0) { - stepVal.push(stride(i, order[j-1]) + "*" + shape(order[j-1]) ) +var allFns = { + "false,0,1": function surfaceProcedure(vertex, face, phase, mallocUint32, freeUint32) { + return function extractContour0_1(a0, x0, x1, x2) { + var s0 = a0.shape[0] | 0, + s1 = a0.shape[1] | 0, + d0 = a0.data, + o0 = a0.offset | 0, + t0_0 = a0.stride[0] | 0, + t0_1 = a0.stride[1] | 0, + p0 = o0, + c0_0, + d0_1 = -t0_0 | 0, + c0_1 = 0, + d0_2 = -t0_1 | 0, + c0_2 = 0, + d0_3 = (-t0_0 - t0_1) | 0, + c0_3 = 0, + u0_0 = t0_0 | 0, + u0_1 = (t0_1 - t0_0 * s0) | 0, + i0 = 0, + i1 = 0, + N = 0, + Q = (2 * s0) | 0, + P = mallocUint32(Q), + V = mallocUint32(Q), + X = 0, + b0 = 0, + e1 = -1 | 0, + y1 = -1 | 0, + b1 = 0, + e2 = -s0 | 0, + y2 = s0 | 0, + b2 = 0, + e3 = (-s0 - 1) | 0, + y3 = (s0 - 1) | 0, + b3 = 0, + v0 = 0, + T = 0 + for (i0 = 0; i0 < s0; ++i0) { + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 } - vars.push(step(i,order[j]) + "=(" + stepVal.join("-") + ")|0") - } - } - //Create index variables - for(var i=0; i=0; --i) { - sizeVariable.push(shape(order[i])) - } - //Previous phases and vertex_ids - vars.push(POOL_SIZE + "=(" + sizeVariable.join("*") + ")|0", - PHASES + "=mallocUint32(" + POOL_SIZE + ")", - VERTEX_IDS + "=mallocUint32(" + POOL_SIZE + ")", - POINTER + "=0") - //Create cube variables for phases - vars.push(pcube(0) + "=0") - for(var j=1; j<(1< 0) { + i1 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } } - } - cubeStep.push(shape(order[k])) - } - var signFlag = "" - if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) { - signFlag = "-" - } - var jperm = permBitmask(dimension, j, order) - vars.push(pdelta(jperm) + "=(-" + cubeDelta.join("-") + ")|0", - qcube(jperm) + "=(" + signFlag + cubeDelta.join("-") + ")|0", - pcube(jperm) + "=0") - } - vars.push(vert(0) + "=0", TEMPORARY + "=0") - - function forLoopBegin(i, start) { - code.push("for(", index(order[i]), "=", start, ";", - index(order[i]), "<", shape(order[i]), ";", - "++", index(order[i]), "){") - } - - function forLoopEnd(i) { - for(var j=0; j=0; --i) { - forLoopBegin(i, 0) - } - var phaseFuncArgs = [] - for(var i=0; i 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } + } + if (i1 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_1 } - vertexArgs.push(cube(i,j)) } + freeUint32(V) + freeUint32(P) } - for(var i=0; i<(1<0; k=(k-1)&subset) { - faceArgs.push(VERTEX_IDS + "[" + POINTER + "+" + pdelta(k) + "]") - } - faceArgs.push(vert(0)) - for(var k=0; k 0) { + i0 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + if (s1 > 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 } } - if(j&1) { - faceArgs.push(corner, edge) - } else { - faceArgs.push(edge, corner) - } - for(var k=0; k 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + } + } + if (i0 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_0 } - code.push("if(", corner, "!==", edge, "){", - "face(", faceArgs.join(), ")}") } + freeUint32(V) + freeUint32(P) } - - //Increment pointer, close off if statement - code.push("}", - POINTER, "+=1;") - } + }, +} - function flip() { - for(var j=1; j<(1<0){", - index(order[i]), "=1;") - createLoop(i-1, mask|(1<= 0) { - pickStr.push('0') - } else if(facet.indexOf(-(i+1)) >= 0) { - pickStr.push('s['+i+']-1') - } else { - pickStr.push('-1') - loStr.push('1') - hiStr.push('s['+i+']-2') - } +function CACHED_link(diff, zero, grad1, grad2) { + return function(dst, src) { + var s = src.shape.slice() + if (1 && s[0] > 2 && s[1] > 2) { + grad2( + src + .pick(-1, -1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 0) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2) + ) } - var boundStr = '.lo(' + loStr.join() + ').hi(' + hiStr.join() + ')' - if(loStr.length === 0) { - boundStr = '' + if (1 && s[1] > 2) { + grad1( + src + .pick(0, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(0, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(0, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) } - - if(cod > 0) { - code.push('if(1') - for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { - continue - } - code.push('&&s[', i, ']>2') - } - code.push('){grad', cod, '(src.pick(', pickStr.join(), ')', boundStr) - for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { - continue - } - code.push(',dst.pick(', pickStr.join(), ',', i, ')', boundStr) - } - code.push(');') + if (1 && s[1] > 2) { + grad1( + src + .pick(s[0] - 1, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(s[0] - 1, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(s[0] - 1, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) } - - for(var i=0; i1){dst.set(', - pickStr.join(), ',', bnd, ',0.5*(src.get(', - cPickStr.join(), ')-src.get(', - dPickStr.join(), ')))}else{dst.set(', - pickStr.join(), ',', bnd, ',0)};') - } else { - code.push('if(s[', bnd, ']>1){diff(', outStr, - ',src.pick(', cPickStr.join(), ')', boundStr, - ',src.pick(', dPickStr.join(), ')', boundStr, - ');}else{zero(', outStr, ');};') - } - break - - case 'mirror': - if(cod === 0) { - code.push('dst.set(', pickStr.join(), ',', bnd, ',0);') - } else { - code.push('zero(', outStr, ');') - } - break - - case 'wrap': - var aPickStr = pickStr.slice() - var bPickStr = pickStr.slice() - if(facet[i] < 0) { - aPickStr[bnd] = 's[' + bnd + ']-2' - bPickStr[bnd] = '0' - - } else { - aPickStr[bnd] = 's[' + bnd + ']-1' - bPickStr[bnd] = '1' - } - if(cod === 0) { - code.push('if(s[', bnd, ']>2){dst.set(', - pickStr.join(), ',', bnd, ',0.5*(src.get(', - aPickStr.join(), ')-src.get(', - bPickStr.join(), ')))}else{dst.set(', - pickStr.join(), ',', bnd, ',0)};') - } else { - code.push('if(s[', bnd, ']>2){diff(', outStr, - ',src.pick(', aPickStr.join(), ')', boundStr, - ',src.pick(', bPickStr.join(), ')', boundStr, - ');}else{zero(', outStr, ');};') - } - break - - default: - throw new Error('ndarray-gradient: Invalid boundary condition') - } + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, 0) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, 0, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, 0, 1) + .lo(1) + .hi(s[0] - 2) + ) } - - if(cod > 0) { - code.push('};') + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, s[1] - 1) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, s[1] - 1, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, s[1] - 1, 1) + .lo(1) + .hi(s[0] - 2) + ) } + dst.set(0, 0, 0, 0) + dst.set(0, 0, 1, 0) + dst.set(s[0] - 1, 0, 0, 0) + dst.set(s[0] - 1, 0, 1, 0) + dst.set(0, s[1] - 1, 0, 0) + dst.set(0, s[1] - 1, 1, 0) + dst.set(s[0] - 1, s[1] - 1, 0, 0) + dst.set(s[0] - 1, s[1] - 1, 1, 0) + return dst } +} - //Enumerate ridges, facets, etc. of hypercube - for(var i=0; i<(1< 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] * Y0 + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + }, + 'float32,1,0,float32,1,0': function () { + return function assign_cwise_loop_1s0m2f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + }, + 'float32,1,0,float32,0,1': function () { + return function assign_cwise_loop_1s0m0f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[1] | 0; j0 > 0;) { + if (j0 < 64) { + s1 = j0 + j0 = 0 + } else { + s1 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + p0 = (offset0 + j0 * t0p1 + j1 * t0p0) + p1 = (offset1 + j0 * t1p1 + j1 * t1p0) + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + } + } + }, + 'uint8,2,0,1,uint8,1,2,0': function () { + return function assign_cwise_loop_2s0s1m0u8(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[2] | 0; j0 > 0;) { + if (j0 < 64) { + s2 = j0 + j0 = 0 + } else { + s2 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j0 * t0p2 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j0 * t1p2 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + } + }, + 'uint8,2,0,1,array,2,0,1': function () { + return function assign_cwise_loop_2s0s1m3u8a(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + }, +} -var EmptyProc = { - body: "", - args: [], - thisVars: [], - localVars: [] +//Generates a cwise operator +function generateCWiseOp(proc, typesig) { + var key = typesig.join(',') + var f = CACHED_CWiseOp[key] + return f() } -function fixup(x) { - if(!x) { - return EmptyProc - } - for(var i=0; i>", - rrshift: ">>>" } ;(function(){ for(var id in assign_ops) { - var op = assign_ops[id] - exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a","b","c"], - body: "a=b"+op+"c"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array","array"], - body: {args:["a","b"], - body:"a"+op+"=b"}, - rvalue: true, - funcName: id+"eq" - }) - exports[id+"s"] = makeOp({ - args: ["array", "array", "scalar"], - body: {args:["a","b","s"], - body:"a=b"+op+"s"}, - funcName: id+"s" - }) - exports[id+"seq"] = makeOp({ - args: ["array","scalar"], - body: {args:["a","s"], - body:"a"+op+"=s"}, - rvalue: true, - funcName: id+"seq" - }) - } -})(); - -var unary_ops = { - not: "!", - bnot: "~", - neg: "-", - recip: "1.0/" -} -;(function(){ - for(var id in unary_ops) { - var op = unary_ops[id] exports[id] = makeOp({ - args: ["array", "array"], - body: {args:["a","b"], - body:"a="+op+"b"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array"], - body: {args:["a"], - body:"a="+op+"a"}, - rvalue: true, - count: 2, - funcName: id+"eq" - }) - } -})(); - -var binary_ops = { - and: "&&", - or: "||", - eq: "===", - neq: "!==", - lt: "<", - gt: ">", - leq: "<=", - geq: ">=" -} -;(function() { - for(var id in binary_ops) { - var op = binary_ops[id] - exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a", "b", "c"], - body:"a=b"+op+"c"}, funcName: id }) exports[id+"s"] = makeOp({ - args: ["array","array","scalar"], - body: {args:["a", "b", "s"], - body:"a=b"+op+"s"}, funcName: id+"s" }) - exports[id+"eq"] = makeOp({ - args: ["array", "array"], - body: {args:["a", "b"], - body:"a=a"+op+"b"}, - rvalue:true, - count:2, - funcName: id+"eq" - }) exports[id+"seq"] = makeOp({ - args: ["array", "scalar"], - body: {args:["a","s"], - body:"a=a"+op+"s"}, - rvalue:true, - count:2, funcName: id+"seq" }) } })(); -var math_unary = [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan" -] -;(function() { - for(var i=0; ithis_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" -}) - -exports.norm1 = compile({ - args:["array"], - pre: {args:[], localVars:[], thisVars:["this_s"], body:"this_s=0"}, - body: {args:[{name:"a", lvalue:false, rvalue:true, 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" -}) - -exports.sup = compile({ - 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":false,"rvalue":true,"count":2} ], - thisVars: [ "this_h" ], - localVars: [] }, - post: - { body: "return this_h", - args: [], - thisVars: [ "this_h" ], - localVars: [] } - }) - -exports.inf = compile({ - args: [ "array" ], - pre: - { body: "this_h=Infinity", - args: [], - thisVars: [ "this_h" ], - localVars: [] }, - body: - { body: "if(_inline_1_arg0_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:false,rvalue:true,count:2}, - {name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:2}], - thisVars:["this_i","this_v"], - localVars:["_inline_1_k"]}, - post:{ - body:"{return this_i}", - args:[], - thisVars:["this_i"], - localVars:[]} -}) - -exports.random = makeOp({ - args: ["array"], - pre: {args:[], body:"this_f=Math.random", thisVars:["this_f"]}, - body: {args: ["a"], body:"a=this_f()", thisVars:["this_f"]}, - funcName: "random" -}) - exports.assign = makeOp({ - args:["array", "array"], - body: {args:["a", "b"], body:"a=b"}, funcName: "assign" }) -exports.assigns = makeOp({ - args:["array", "scalar"], - body: {args:["a", "b"], body:"a=b"}, - funcName: "assigns" }) - - -exports.equals = compile({ - args:["array", "array"], - pre: EmptyProc, - body: {args:[{name:"x", lvalue:false, rvalue:true, count:1}, - {name:"y", lvalue:false, rvalue:true, count:1}], - body: "if(x!==y){return false}", - localVars: [], - thisVars: []}, - post: {args:[], localVars:[], thisVars:[], body:"return true"}, - funcName: "equals" -}) - - - -},{"cwise-compiler":157}],479:[function(_dereq_,module,exports){ +},{}],468:[function(_dereq_,module,exports){ "use strict" var ndarray = _dereq_("ndarray") @@ -112598,739 +111833,849 @@ module.exports = function convert(arr, result) { return result } -},{"./doConvert.js":480,"ndarray":483}],480:[function(_dereq_,module,exports){ -module.exports=_dereq_('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":true,"rvalue":false,"count":1},{"name":"_inline_1_arg1_","lvalue":false,"rvalue":true,"count":1},{"name":"_inline_1_arg2_","lvalue":false,"rvalue":true,"count":4}],"thisVars":[],"localVars":["_inline_1_i","_inline_1_v"]},"post":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"funcName":"convert","blockSize":64}) +},{"./doConvert.js":469,"ndarray":472}],469:[function(_dereq_,module,exports){ +"use strict" + +function CwiseOp() { + return function (SS, a0, t0, p0, Y0) { + var s0 = SS[0], + s1 = SS[1], + s2 = SS[2], + t0p0 = t0[0], + t0p1 = t0[1], + t0p2 = t0[2], + index = [0, 0, 0]; + p0 |= 0; + var i0 = 0, + i1 = 0, + i2 = 0, + d0s0 = t0p2, + d0s1 = t0p1 - s2 * t0p2, + d0s2 = t0p0 - s1 * t0p1; + for (i2 = 0; i2 < s0; ++i2) { + for (i1 = 0; i1 < s1; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + { + var _inline_1_v = Y0, + _inline_1_i; + for ( + _inline_1_i = 0; + _inline_1_i < index.length - 1; + ++_inline_1_i + ) { + _inline_1_v = _inline_1_v[index[_inline_1_i]]; + } + a0[p0] = _inline_1_v[index[index.length - 1]]; + } + p0 += d0s0; + ++index[2]; + } + p0 += d0s1; + index[2] -= s2; + ++index[1]; + } + p0 += d0s2; + index[1] -= s1; + ++index[0]; + } + }; +} -},{"cwise-compiler":157}],481:[function(_dereq_,module,exports){ +//Generates a cwise operator +function generateCWiseOp() { + return CwiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {}; + return function convert_cwise_thunk(array0, scalar1) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type]; + if (!proc) { + CACHED[type] = proc = compile([t0, r0]); + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + scalar1 + ); + }; +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ + funcName: "convert" +}); + +},{}],470:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") -var INSERTION_SORT_THRESHOLD = 32 - function getMallocFree(dtype) { switch(dtype) { - case "uint8": - return [pool.mallocUint8, pool.freeUint8] - case "uint16": - return [pool.mallocUint16, pool.freeUint16] case "uint32": return [pool.mallocUint32, pool.freeUint32] - case "int8": - return [pool.mallocInt8, pool.freeInt8] - case "int16": - return [pool.mallocInt16, pool.freeInt16] - case "int32": - return [pool.mallocInt32, pool.freeInt32] - case "float32": - return [pool.mallocFloat, pool.freeFloat] - case "float64": - return [pool.mallocDouble, pool.freeDouble] default: return null } } -function shapeArgs(dimension) { - var args = [] - for(var i=0; i left) { + dptr = 0 + sptr = cptr - s0 + __l: for (i1 = 0; i1 < n1; ++i1) { + a = data[sptr] + b = scratch[dptr] + if (a < b) { + break __g + } + if (a > b) { + break __l + } + sptr += e1 + dptr += f1 + } + dptr = cptr + sptr = cptr - s0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = data[sptr] + dptr += d1 + sptr += d1 + } + cptr -= s0 + } + dptr = cptr + sptr = 0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = scratch[sptr++] + dptr += d1 + } + } + free(scratch) + } + }, } function createInsertionSort(order, dtype) { - - var code = ["'use strict'"] - var funcName = ["ndarrayInsertionSort", order.join("d"), dtype].join("") - var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) var allocator = getMallocFree(dtype) - - var vars = [ "i,j,cptr,ptr=left*s0+offset" ] - - if(order.length > 1) { - var scratch_shape = [] - for(var i=1; i 1) { - - //Copy data into scratch - code.push("dptr=0;sptr=ptr") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue +} + +var CACHED_quickSort = { + "uint32,1,0": function (insertionSort, malloc, free) { + return function ndarrayQuickSort1d0uint32(left, right, data, offset, s0, s1, n0, n1, d1, e1, f1) { + var 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, + i1, + b_ptr0, + b_ptr1, + b_ptr2, + b_ptr3, + b_ptr4, + b_ptr5, + b_ptr6, + b_ptr7, + ptr3, + ptr4, + ptr5, + ptr6, + ptr7, + pivot_ptr, + ptr_shift, + elementSize = n1, + pivot1 = malloc(elementSize), + pivot2 = malloc(elementSize) + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + ptr_shift = offset + __l1: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el2 + el2 = tmp0 + break __l1 + } + if (comp < 0) { + break __l1 + } + ptr_shift += e1 } - code.push(["for(i",j,"=0;i",j," 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l2 + } + if (comp < 0) { + break __l2 + } + ptr_shift += e1 } - code.push("sptr+=d"+j,"}") - } - - - //Compare items in outer loop - code.push("__g:while(j-->left){", - "dptr=0", - "sptr=cptr-s0") - for(var i=1; i 0) { + tmp0 = el1 + el1 = el3 + el3 = tmp0 + break __l3 + } + if (comp < 0) { + break __l3 + } + ptr_shift += e1 } - code.push(["for(i",i,"=0;i",i,"b){break __l}"].join("")) - for(var i=order.length-1; i>=1; --i) { - code.push( - "sptr+=e"+i, - "dptr+=f"+i, - "}") - } - - //Copy data back - code.push("dptr=cptr;sptr=cptr-s0") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l4: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l4 + } + if (comp < 0) { + break __l4 + } + ptr_shift += e1 } - code.push(["for(i",j,"=0;i",j," 0) { + tmp0 = el1 + el1 = el4 + el4 = tmp0 + break __l5 + } + if (comp < 0) { + break __l5 + } + ptr_shift += e1 } - code.push(["dptr+=d",j,";sptr+=d",j].join(""),"}") - } - - //Close while loop - code.push("cptr-=s0\n}") - - //Copy scratch into cptr - code.push("dptr=cptr;sptr=0") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue + b_ptr0 = s0 * el3 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l6: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el3 + el3 = el4 + el4 = tmp0 + break __l6 + } + if (comp < 0) { + break __l6 + } + ptr_shift += e1 } - code.push(["for(i",j,"=0;i",j," 0) { + tmp0 = el2 + el2 = el5 + el5 = tmp0 + break __l7 + } + if (comp < 0) { + break __l7 + } + ptr_shift += e1 } - code.push("dptr+=d"+j,"}") - } - } else { - code.push("scratch=" + dataRead("ptr"), - "while((j-->left)&&("+dataRead("cptr-s0")+">scratch)){", - dataWrite("cptr", dataRead("cptr-s0")), - "cptr-=s0", - "}", - dataWrite("cptr", "scratch")) - } - - //Close outer loop body - code.push("}") - if(order.length > 1 && allocator) { - code.push("free(scratch)") - } - code.push("} return " + funcName) - - //Compile and link function - if(allocator) { - var result = new Function("malloc", "free", code.join("\n")) - return result(allocator[0], allocator[1]) - } else { - var result = new Function(code.join("\n")) - return result() - } -} - -function createQuickSort(order, dtype, insertionSort) { - var code = [ "'use strict'" ] - var funcName = ["ndarrayQuickSort", order.join("d"), dtype].join("") - var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) - var allocator = getMallocFree(dtype) - var labelCounter=0 - - code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - - var vars = [ - "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(order.length > 1) { - var ele_size = [] - for(var i=1; i 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l8 + } + if (comp < 0) { + break __l8 + } + ptr_shift += e1 } - } - if(usePivot) { - code.push("pivot_ptr=0") - } - code.push("ptr_shift=offset") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l9: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l9 + } + if (comp < 0) { + break __l9 + } + ptr_shift += e1 } - code.push(["for(i",j,"=0;i",j," 1) { - for(var i=0; i1) { - code.push("ptr_shift+=d"+j) + b_ptr0 = s0 * index4 + b_ptr1 = s0 * right + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + if (pivots_are_equal) { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l10: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l10 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + continue + } + if (comp < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l11: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l11 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + great-- + } else if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + break + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + break + } + } + } + } } else { - code.push("ptr0+=d"+j) + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l12: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l12 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l13: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l13 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 > 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l14: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l14 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l15: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l15 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } } - code.push("}") - } - } - - function lexicoLoop(label, ptrs, usePivot, body) { - if(ptrs.length === 1) { - code.push("ptr0="+toPointer(ptrs[0])) - } else { - for(var i=0; i 1) { - for(var i=0; i=1; --i) { - if(usePivot) { - code.push("pivot_ptr+=f"+i) + if (less - 2 - left <= 32) { + insertionSort(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) + } else { + ndarrayQuickSort1d0uint32(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) } - if(ptrs.length > 1) { - code.push("ptr_shift+=e"+i) + if (right - (great + 2) <= 32) { + insertionSort(great + 2, right, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - code.push("ptr0+=e"+i) + ndarrayQuickSort1d0uint32(great + 2, right, data, offset, s0, s1, n0, n1, d1, e1, f1) } - code.push("}") - } - } - - function cleanUp() { - if(order.length > 1 && allocator) { - code.push("free(pivot1)", "free(pivot2)") - } - } - - function compareSwap(a_id, b_id) { - var a = "el"+a_id - var b = "el"+b_id - if(order.length > 1) { - var lbl = "__l" + (++labelCounter) - lexicoLoop(lbl, [a, b], false, [ - "comp=",dataRead("ptr0"),"-",dataRead("ptr1"),"\n", - "if(comp>0){tmp0=", a, ";",a,"=",b,";", b,"=tmp0;break ", lbl,"}\n", - "if(comp<0){break ", lbl, "}" - ].join("")) - } else { - code.push(["if(", dataRead(toPointer(a)), ">", dataRead(toPointer(b)), "){tmp0=", a, ";",a,"=",b,";", b,"=tmp0}"].join("")) - } - } - - compareSwap(1, 2) - compareSwap(4, 5) - compareSwap(1, 3) - compareSwap(2, 3) - compareSwap(1, 4) - compareSwap(3, 4) - compareSwap(2, 5) - compareSwap(2, 3) - compareSwap(4, 5) - - if(order.length > 1) { - cacheLoop(["el1", "el2", "el3", "el4", "el5", "index1", "index3", "index5"], true, [ - "pivot1[pivot_ptr]=",dataRead("ptr1"),"\n", - "pivot2[pivot_ptr]=",dataRead("ptr3"),"\n", - "pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n", - "x=",dataRead("ptr0"),"\n", - "y=",dataRead("ptr2"),"\n", - "z=",dataRead("ptr4"),"\n", - dataWrite("ptr5", "x"),"\n", - dataWrite("ptr6", "y"),"\n", - dataWrite("ptr7", "z") - ].join("")) - } else { - code.push([ - "pivot1=", dataRead(toPointer("el2")), "\n", - "pivot2=", dataRead(toPointer("el4")), "\n", - "pivots_are_equal=pivot1===pivot2\n", - "x=", dataRead(toPointer("el1")), "\n", - "y=", dataRead(toPointer("el3")), "\n", - "z=", dataRead(toPointer("el5")), "\n", - dataWrite(toPointer("index1"), "x"), "\n", - dataWrite(toPointer("index3"), "y"), "\n", - dataWrite(toPointer("index5"), "z") - ].join("")) - } - - - function moveElement(dst, src) { - if(order.length > 1) { - cacheLoop([dst, src], false, - dataWrite("ptr0", dataRead("ptr1")) - ) - } else { - code.push(dataWrite(toPointer(dst), dataRead(toPointer(src)))) - } - } - - moveElement("index2", "left") - moveElement("index4", "right") - - function comparePivot(result, ptr, n) { - if(order.length > 1) { - var lbl = "__l" + (++labelCounter) - lexicoLoop(lbl, [ptr], true, [ - result,"=",dataRead("ptr0"),"-pivot",n,"[pivot_ptr]\n", - "if(",result,"!==0){break ", lbl, "}" - ].join("")) - } else { - code.push([result,"=", dataRead(toPointer(ptr)), "-pivot", n].join("")) - } - } - - function swapElements(a, b) { - if(order.length > 1) { - cacheLoop([a,b],false,[ - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", "tmp") - ].join("")) - } else { - code.push([ - "ptr0=",toPointer(a),"\n", - "ptr1=",toPointer(b),"\n", - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", "tmp") - ].join("")) - } - } - - function tripleSwap(k, less, great) { - if(order.length > 1) { - cacheLoop([k,less,great], false, [ - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", dataRead("ptr2")),"\n", - dataWrite("ptr2", "tmp") - ].join("")) - code.push("++"+less, "--"+great) - } else { - code.push([ - "ptr0=",toPointer(k),"\n", - "ptr1=",toPointer(less),"\n", - "ptr2=",toPointer(great),"\n", - "++",less,"\n", - "--",great,"\n", - "tmp=", dataRead("ptr0"), "\n", - dataWrite("ptr0", dataRead("ptr1")), "\n", - dataWrite("ptr1", dataRead("ptr2")), "\n", - dataWrite("ptr2", "tmp") - ].join("")) - } - } - - function swapAndDecrement(k, great) { - swapElements(k, great) - code.push("--"+great) - } - - code.push("if(pivots_are_equal){") - //Pivots are equal case - code.push("for(k=less;k<=great;++k){") - comparePivot("comp", "k", 1) - code.push("if(comp===0){continue}") - code.push("if(comp<0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - code.push("while(true){") - comparePivot("comp", "great", 1) - code.push("if(comp>0){") - code.push("great--") - code.push("}else if(comp<0){") - tripleSwap("k", "less", "great") - code.push("break") - code.push("}else{") - swapAndDecrement("k", "great") - code.push("break") - code.push("}") - code.push("}") - code.push("}") - code.push("}") - code.push("}else{") - //Pivots not equal case - code.push("for(k=less;k<=great;++k){") - comparePivot("comp_pivot1", "k", 1) - code.push("if(comp_pivot1<0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - comparePivot("comp_pivot2", "k", 2) - code.push("if(comp_pivot2>0){") - code.push("while(true){") - comparePivot("comp", "great", 2) - code.push("if(comp>0){") - code.push("if(--great1) { - cacheLoop([mem_dest, pivot_dest], true, [ - dataWrite("ptr0", dataRead("ptr1")), "\n", - dataWrite("ptr1", ["pivot",pivot,"[pivot_ptr]"].join("")) - ].join("")) - } else { - code.push( - dataWrite(toPointer(mem_dest), dataRead(toPointer(pivot_dest))), - dataWrite(toPointer(pivot_dest), "pivot"+pivot)) - } - } - - storePivot("left", "(less-1)", 1) - storePivot("right", "(great+1)", 2) - - //Recursive sort call - function doSort(left, right) { - code.push([ - "if((",right,"-",left,")<=",INSERTION_SORT_THRESHOLD,"){\n", - "insertionSort(", left, ",", right, ",data,offset,", shapeArgs(order.length).join(","), ")\n", - "}else{\n", - funcName, "(", left, ",", right, ",data,offset,", shapeArgs(order.length).join(","), ")\n", - "}" - ].join("")) - } - doSort("left", "(less-2)") - doSort("(great+2)", "right") - - //If pivots are equal, then early out - code.push("if(pivots_are_equal){") - cleanUp() - code.push("return") - code.push("}") - - function walkPointer(ptr, pivot, body) { - if(order.length > 1) { - code.push(["__l",++labelCounter,":while(true){"].join("")) - cacheLoop([ptr], true, [ - "if(", dataRead("ptr0"), "!==pivot", pivot, "[pivot_ptr]){break __l", labelCounter, "}" - ].join("")) - code.push(body, "}") - } else { - code.push(["while(", dataRead(toPointer(ptr)), "===pivot", pivot, "){", body, "}"].join("")) - } - } - - //Check bounds - code.push("if(lessindex5){") - - walkPointer("less", 1, "++less") - walkPointer("great", 2, "--great") - - code.push("for(k=less;k<=great;++k){") - comparePivot("comp_pivot1", "k", 1) - code.push("if(comp_pivot1===0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - comparePivot("comp_pivot2", "k", 2) - code.push("if(comp_pivot2===0){") - code.push("while(true){") - comparePivot("comp", "great", 2) - code.push("if(comp===0){") - code.push("if(--great 1 && allocator) { - var compiled = new Function("insertionSort", "malloc", "free", code.join("\n")) - return compiled(insertionSort, allocator[0], allocator[1]) - } - var compiled = new Function("insertionSort", code.join("\n")) - return compiled(insertionSort) -} - -function compileSort(order, dtype) { - var code = ["'use strict'"] - var funcName = ["ndarraySortWrapper", order.join("d"), dtype].join("") - var funcArgs = [ "array" ] - - code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - - //Unpack local variables from array - var vars = ["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"] - for(var i=0; i 0) { - vars.push(["d",j,"=s",j,"-d",p,"*n",p].join("")) + if (pivots_are_equal) { + free(pivot1) + free(pivot2) + return + } + if (less < index1 && great > index5) { + __l16: while (true) { + ptr0 = offset + less * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot1[pivot_ptr]) { + break __l16 + } + ++pivot_ptr + ptr0 += d1 + } + ++less + } + __l17: while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot2[pivot_ptr]) { + break __l17 + } + ++pivot_ptr + ptr0 += d1 + } + --great + } + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l18: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l18 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 === 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l19: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l19 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 === 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l20: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l20 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l21: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l21 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } + } + free(pivot1) + free(pivot2) + if (great - less <= 32) { + insertionSort(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - vars.push(["d",j,"=s",j].join("")) + ndarrayQuickSort1d0uint32(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) } - p = j } - var k = order.length-1-i - if(k !== 0) { - if(q > 0) { - vars.push(["e",k,"=s",k,"-e",q,"*n",q, - ",f",k,"=",scratch_stride[k],"-f",q,"*n",q].join("")) + }, +} + +function createQuickSort(order, dtype, insertionSort) { + var allocator = getMallocFree(dtype) + var key = [dtype, order].join(',') + var result = CACHED_quickSort[key] + + if(order.length > 1 && allocator) { + return result(insertionSort, allocator[0], allocator[1]) + } else { + return result(insertionSort) + } +} + +var CACHED_sort = { + "uint32,1,0": function (insertionSort, quickSort) { + return function (array) { + var data = array.data, + offset = array.offset | 0, + shape = array.shape, + stride = array.stride, + s0 = stride[0] | 0, + n0 = shape[0] | 0, + s1 = stride[1] | 0, + n1 = shape[1] | 0, + d1 = s1, + e1 = s1, + f1 = 1 + if (n0 <= 32) { + insertionSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - vars.push(["e",k,"=s",k,",f",k,"=",scratch_stride[k]].join("")) + quickSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) } - q = k } - } - - //Declare local variables - code.push("var " + vars.join(",")) - - //Create arguments for subroutine - var sortArgs = ["0", "n0-1", "data", "offset"].concat(shapeArgs(order.length)) - - //Call main sorting routine - code.push([ - "if(n0<=",INSERTION_SORT_THRESHOLD,"){", - "insertionSort(", sortArgs.join(","), ")}else{", - "quickSort(", sortArgs.join(","), - ")}" - ].join("")) - - //Return - code.push("}return " + funcName) - - //Link everything together - var result = new Function("insertionSort", "quickSort", code.join("\n")) + }, +} + +function compileSort(order, dtype) { + var key = [dtype, order].join(',') + var result = CACHED_sort[key] + var insertionSort = createInsertionSort(order, dtype) var quickSort = createQuickSort(order, dtype, insertionSort) return result(insertionSort, quickSort) } module.exports = compileSort -},{"typedarray-pool":617}],482:[function(_dereq_,module,exports){ +},{"typedarray-pool":601}],471:[function(_dereq_,module,exports){ "use strict" var compile = _dereq_("./lib/compile_sort.js") @@ -113350,8 +112695,7 @@ function sort(array) { } module.exports = sort -},{"./lib/compile_sort.js":481}],483:[function(_dereq_,module,exports){ -var iota = _dereq_("iota-array") +},{"./lib/compile_sort.js":470}],472:[function(_dereq_,module,exports){ var isBuffer = _dereq_("is-buffer") var hasTypedArrays = ((typeof Float64Array) !== "undefined") @@ -113375,234 +112719,883 @@ function order() { return result } -function compileConstructor(dtype, dimension) { - var className = ["View", dimension, "d", dtype].join("") - if(dimension < 0) { - className = "View_Nil" + dtype - } - var useGetters = (dtype === "generic") - - if(dimension === -1) { - //Special case for trivial arrays - var code = - "function "+className+"(a){this.data=a;};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"(this.data);};\ -proto.get=proto.set=function(){};\ -proto.pick=function(){return null};\ -return function construct_"+className+"(a){return new "+className+"(a);}" - var procedure = new Function(code) - return procedure() - } else if(dimension === 0) { - //Special case for 0d arrays - var code = - "function "+className+"(a,d) {\ -this.data = a;\ -this.offset = d\ -};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"_copy() {\ -return new "+className+"(this.data,this.offset)\ -};\ -proto.pick=function "+className+"_pick(){\ -return TrivialArray(this.data);\ -};\ -proto.valueOf=proto.get=function "+className+"_get(){\ -return "+(useGetters ? "this.data.get(this.offset)" : "this.data[this.offset]")+ -"};\ -proto.set=function "+className+"_set(v){\ -return "+(useGetters ? "this.data.set(this.offset,v)" : "this.data[this.offset]=v")+"\ -};\ -return function construct_"+className+"(a,b,c,d){return new "+className+"(a,d)}" - var procedure = new Function("TrivialArray", code) - return procedure(CACHED_CONSTRUCTORS[dtype][0]) - } - - var code = ["'use strict'"] - - //Create constructor for view - var indices = iota(dimension) - var args = indices.map(function(i) { return "i"+i }) - var index_str = "this.offset+" + indices.map(function(i) { - return "this.stride[" + i + "]*i" + i - }).join("+") - var shapeArg = indices.map(function(i) { - return "b"+i - }).join(",") - var strideArg = indices.map(function(i) { - return "c"+i - }).join(",") - code.push( - "function "+className+"(a," + shapeArg + "," + strideArg + ",d){this.data=a", - "this.shape=[" + shapeArg + "]", - "this.stride=[" + strideArg + "]", - "this.offset=d|0}", - "var proto="+className+".prototype", - "proto.dtype='"+dtype+"'", - "proto.dimension="+dimension) - - //view.size: - code.push("Object.defineProperty(proto,'size',{get:function "+className+"_size(){\ -return "+indices.map(function(i) { return "this.shape["+i+"]" }).join("*"), -"}})") - - //view.order: - if(dimension === 1) { - code.push("proto.order=[0]") - } else { - code.push("Object.defineProperty(proto,'order',{get:") - if(dimension < 4) { - code.push("function "+className+"_order(){") - if(dimension === 2) { - code.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})") - } else if(dimension === 3) { - code.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];\ -}}})") - } - } else { - code.push("ORDER})") +var allFns = { + // Special case for trivial arrays + T: function (dtype) { + function View(a) { + this.data = a } - } + var proto = View.prototype + proto.dtype = dtype + 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 View(this.data) + } + proto.get = proto.set = function () {} + proto.pick = function () { + return null + } + return function construct(a) { + return new View(a) + } + }, - //view.set(i0, ..., v): - code.push( -"proto.set=function "+className+"_set("+args.join(",")+",v){") - if(useGetters) { - code.push("return this.data.set("+index_str+",v)}") - } else { - code.push("return this.data["+index_str+"]=v}") - } + // Special case for 0d arrays + 0: function (dtype, TrivialArray) { + function View(a, d) { + this.data = a + this.offset = d + } + var proto = View.prototype + proto.dtype = dtype + 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 copy() { + return new View(this.data, this.offset) + } + proto.pick = function pick() { + return TrivialArray(this.data) + } + proto.valueOf = proto.get = function get() { + return dtype === "generic" ? this.data.get(this.offset) : this.data[this.offset] + } + proto.set = function set(v) { + return dtype === "generic" ? this.data.set(this.offset, v) : (this.data[this.offset] = v) + } + return function construct(a, b, c, d) { + return new View(a, d) + } + }, - //view.get(i0, ...): - code.push("proto.get=function "+className+"_get("+args.join(",")+"){") - if(useGetters) { - code.push("return this.data.get("+index_str+")}") - } else { - code.push("return this.data["+index_str+"]}") - } - - //view.index: - code.push( - "proto.index=function "+className+"_index(", args.join(), "){return "+index_str+"}") - - //view.hi(): - code.push("proto.hi=function "+className+"_hi("+args.join(",")+"){return new "+className+"(this.data,"+ - indices.map(function(i) { - return ["(typeof i",i,"!=='number'||i",i,"<0)?this.shape[", i, "]:i", i,"|0"].join("") - }).join(",")+","+ - indices.map(function(i) { - return "this.stride["+i + "]" - }).join(",")+",this.offset)}") - - //view.lo(): - var a_vars = indices.map(function(i) { return "a"+i+"=this.shape["+i+"]" }) - var c_vars = indices.map(function(i) { return "c"+i+"=this.stride["+i+"]" }) - code.push("proto.lo=function "+className+"_lo("+args.join(",")+"){var b=this.offset,d=0,"+a_vars.join(",")+","+c_vars.join(",")) - for(var i=0; i=0){\ -d=i"+i+"|0;\ -b+=c"+i+"*d;\ -a"+i+"-=d}") - } - code.push("return new "+className+"(this.data,"+ - indices.map(function(i) { - return "a"+i - }).join(",")+","+ - indices.map(function(i) { - return "c"+i - }).join(",")+",b)}") - - //view.step(): - code.push("proto.step=function "+className+"_step("+args.join(",")+"){var "+ - indices.map(function(i) { - return "a"+i+"=this.shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "b"+i+"=this.stride["+i+"]" - }).join(",")+",c=this.offset,d=0,ceil=Math.ceil") - for(var i=0; i= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + return new View(this.data, a0, c0, b) + } + proto.step = function step(i0) { + var a0 = this.shape[0], + b0 = this.stride[0], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + return new View(this.data, a0, b0, c) + } + proto.transpose = function transpose(i0) { + i0 = i0 === undefined ? 0 : i0 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], b[i0], this.offset) + } + proto.pick = function pick(i0) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], stride[0], offset) + } + }, + 2: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, c0, c1, d) { + this.data = a + this.shape = [b0, b1] + this.stride = [c0, c1] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 2 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + return Math.abs(this.stride[0]) > Math.abs(this.stride[1]) ? [1, 0] : [0, 1] + }, + }) + proto.set = function set(i0, i1, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] = v) + } + proto.get = function get(i0, i1) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] + } + proto.index = function index(i0, i1) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + } + proto.hi = function hi(i0, i1) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + this.stride[0], + this.stride[1], + this.offset + ) + } + proto.lo = function lo(i0, i1) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + c0 = this.stride[0], + c1 = this.stride[1] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + return new View(this.data, a0, a1, c0, c1, b) + } + proto.step = function step(i0, i1) { + var a0 = this.shape[0], + a1 = this.shape[1], + b0 = this.stride[0], + b1 = this.stride[1], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + return new View(this.data, a0, a1, b0, b1, c) + } + proto.transpose = function transpose(i0, i1) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], b[i0], b[i1], this.offset) + } + proto.pick = function pick(i0, i1) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], stride[0], stride[1], offset) + } + }, + 3: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, c0, c1, c2, d) { + this.data = a + this.shape = [b0, b1, b2] + this.stride = [c0, c1, c2] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 3 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + 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] + } + }, + }) + proto.set = function set(i0, i1, i2, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] = v) + } + proto.get = function get(i0, i1, i2) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] + } + proto.index = function index(i0, i1, i2) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + } + proto.hi = function hi(i0, i1, i2) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + return new View(this.data, a0, a1, a2, c0, c1, c2, b) + } + proto.step = function step(i0, i1, i2) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + return new View(this.data, a0, a1, a2, b0, b1, b2, c) + } + proto.transpose = function transpose(i0, i1, i2) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], b[i0], b[i1], b[i2], this.offset) + } + proto.pick = function pick(i0, i1, i2) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], stride[0], stride[1], stride[2], offset) + } + }, + 4: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, c0, c1, c2, c3, d) { + this.data = a + this.shape = [b0, b1, b2, b3] + this.stride = [c0, c1, c2, c3] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 4 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] = v) + } + proto.get = function get(i0, i1, i2, i3) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] + } + proto.index = function index(i0, i1, i2, i3) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3 + } + proto.hi = function hi(i0, i1, i2, i3) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + return new View(this.data, a0, a1, a2, a3, c0, c1, c2, c3, b) + } + proto.step = function step(i0, i1, i2, i3) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + return new View(this.data, a0, a1, a2, a3, b0, b1, b2, b3, c) + } + proto.transpose = function transpose(i0, i1, i2, i3) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], b[i0], b[i1], b[i2], b[i3], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], shape[3], stride[0], stride[1], stride[2], stride[3], offset) + } + }, + 5: function anonymous(dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, b4, c0, c1, c2, c3, c4, d) { + this.data = a + this.shape = [b0, b1, b2, b3, b4] + this.stride = [c0, c1, c2, c3, c4] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 5 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] * this.shape[4] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, i4, v) { + return dtype === "generic" + ? this.data.set( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4, + v + ) + : (this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] = v) + } + proto.get = function get(i0, i1, i2, i3, i4) { + return dtype === "generic" + ? this.data.get( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + : this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] + } + proto.index = function index(i0, i1, i2, i3, i4) { + return ( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + } + proto.hi = function hi(i0, i1, i2, i3, i4) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + typeof i4 !== "number" || i4 < 0 ? this.shape[4] : i4 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.stride[4], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3, i4) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3], + c4 = this.stride[4] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + if (typeof i4 === "number" && i4 >= 0) { + d = i4 | 0 + b += c4 * d + a4 -= d + } + return new View(this.data, a0, a1, a2, a3, a4, c0, c1, c2, c3, c4, b) + } + proto.step = function step(i0, i1, i2, i3, i4) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + b4 = this.stride[4], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + if (typeof i4 === "number") { + d = i4 | 0 + if (d < 0) { + c += b4 * (a4 - 1) + a4 = ceil(-a4 / d) + } else { + a4 = ceil(a4 / d) + } + b4 *= d + } + return new View(this.data, a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, c) + } + proto.transpose = function transpose(i0, i1, i2, i3, i4) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + i4 = i4 === undefined ? 4 : i4 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], a[i4], b[i0], b[i1], b[i2], b[i3], b[i4], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3, i4) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + if (typeof i4 === "number" && i4 >= 0) { + c = (c + this.stride[4] * i4) | 0 + } else { + a.push(this.shape[4]) + b.push(this.stride[4]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View( + data, + shape[0], + shape[1], + shape[2], + shape[3], + shape[4], + stride[0], + stride[1], + stride[2], + stride[3], + stride[4], + offset + ) + } + }, +} - //view.pick(): - code.push("proto.pick=function "+className+"_pick("+args+"){var a=[],b=[],c=this.offset") - for(var i=0; i=0){c=(c+this.stride["+i+"]*i"+i+")|0}else{a.push(this.shape["+i+"]);b.push(this.stride["+i+"])}") - } - code.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}") - //Add return statement - code.push("return function construct_"+className+"(data,shape,stride,offset){return new "+className+"(data,"+ - indices.map(function(i) { - return "shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "stride["+i+"]" - }).join(",")+",offset)}") +function compileConstructor(inType, inDimension) { + var dKey = inDimension === -1 ? 'T' : String(inDimension) - //Compile procedure - var procedure = new Function("CTOR_LIST", "ORDER", code.join("\n")) - return procedure(CACHED_CONSTRUCTORS[dtype], order) + var procedure = allFns[dKey] + if(inDimension === -1) { + return procedure(inType) + } else if(inDimension === 0) { + return procedure(inType, CACHED_CONSTRUCTORS[inType][0]) + } + return procedure(inType, CACHED_CONSTRUCTORS[inType], order) } function arrayDType(data) { @@ -113621,14 +113614,14 @@ function arrayDType(data) { return "int16" case "[object Int32Array]": return "int32" + case "[object Uint8ClampedArray]": + return "uint8_clamped" case "[object Uint8Array]": return "uint8" case "[object Uint16Array]": return "uint16" case "[object Uint32Array]": return "uint32" - case "[object Uint8ClampedArray]": - return "uint8_clamped" case "[object BigInt64Array]": return "bigint64" case "[object BigUint64Array]": @@ -113642,20 +113635,22 @@ function arrayDType(data) { } var CACHED_CONSTRUCTORS = { + "generic":[], + "buffer":[], + "array":[], + + // typed arrays "float32":[], "float64":[], "int8":[], "int16":[], "int32":[], + "uint8_clamped":[], "uint8":[], "uint16":[], "uint32":[], - "array":[], - "uint8_clamped":[], "bigint64": [], - "biguint64": [], - "buffer":[], - "generic":[] + "biguint64": [] } ;(function() { @@ -113690,10 +113685,10 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { } } } - var dtype = arrayDType(data) - var ctor_list = CACHED_CONSTRUCTORS[dtype] + var inType = arrayDType(data) + var ctor_list = CACHED_CONSTRUCTORS[inType] while(ctor_list.length <= d+1) { - ctor_list.push(compileConstructor(dtype, ctor_list.length-1)) + ctor_list.push(compileConstructor(inType, ctor_list.length-1)) } var ctor = ctor_list[d+1] return ctor(data, shape, stride, offset) @@ -113701,7 +113696,7 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { module.exports = wrappedNDArrayCtor -},{"iota-array":451,"is-buffer":453}],484:[function(_dereq_,module,exports){ +},{"is-buffer":443}],473:[function(_dereq_,module,exports){ "use strict" var doubleBits = _dereq_("double-bits") @@ -113744,7 +113739,7 @@ function nextafter(x, y) { } return doubleBits.pack(lo, hi) } -},{"double-bits":182}],485:[function(_dereq_,module,exports){ +},{"double-bits":179}],474:[function(_dereq_,module,exports){ var π = Math.PI var _120 = radians(120) @@ -113946,7 +113941,7 @@ function radians(degress){ return degress * (π / 180) } -},{}],486:[function(_dereq_,module,exports){ +},{}],475:[function(_dereq_,module,exports){ var DEFAULT_NORMALS_EPSILON = 1e-6; var DEFAULT_FACE_EPSILON = 1e-6; @@ -114071,7 +114066,7 @@ exports.faceNormals = function(faces, positions, specifiedEpsilon) { -},{}],487:[function(_dereq_,module,exports){ +},{}],476:[function(_dereq_,module,exports){ /* object-assign (c) Sindre Sorhus @@ -114163,7 +114158,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],488:[function(_dereq_,module,exports){ +},{}],477:[function(_dereq_,module,exports){ 'use strict' module.exports = quatFromFrame @@ -114205,7 +114200,7 @@ function quatFromFrame( } return out } -},{}],489:[function(_dereq_,module,exports){ +},{}],478:[function(_dereq_,module,exports){ 'use strict' module.exports = createOrbitController @@ -114599,7 +114594,7 @@ function createOrbitController(options) { return result } -},{"./lib/quatFromFrame":488,"filtered-vector":250,"gl-mat4/fromQuat":288,"gl-mat4/invert":299,"gl-mat4/lookAt":300}],490:[function(_dereq_,module,exports){ +},{"./lib/quatFromFrame":477,"filtered-vector":247,"gl-mat4/fromQuat":282,"gl-mat4/invert":293,"gl-mat4/lookAt":294}],479:[function(_dereq_,module,exports){ /*! * pad-left * @@ -114615,7 +114610,7 @@ module.exports = function padLeft(str, num, ch) { ch = typeof ch !== 'undefined' ? (ch + '') : ' '; return repeat(ch, num) + str; }; -},{"repeat-string":541}],491:[function(_dereq_,module,exports){ +},{"repeat-string":527}],480:[function(_dereq_,module,exports){ 'use strict' /** @@ -114752,7 +114747,7 @@ parenthesis.stringify = stringify module.exports = parenthesis -},{}],492:[function(_dereq_,module,exports){ +},{}],481:[function(_dereq_,module,exports){ 'use strict' var pick = _dereq_('pick-by-alias') @@ -114839,7 +114834,7 @@ function parseRect (arg) { return rect } -},{"pick-by-alias":498}],493:[function(_dereq_,module,exports){ +},{"pick-by-alias":485}],482:[function(_dereq_,module,exports){ module.exports = parse @@ -114898,7 +114893,7 @@ function parseValues(args) { return numbers ? numbers.map(Number) : [] } -},{}],494:[function(_dereq_,module,exports){ +},{}],483:[function(_dereq_,module,exports){ module.exports = function parseUnit(str, out) { if (!out) out = [ 0, '' ] @@ -114909,7 +114904,7 @@ module.exports = function parseUnit(str, out) { out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' return out } -},{}],495:[function(_dereq_,module,exports){ +},{}],484:[function(_dereq_,module,exports){ (function (process){(function (){ // Generated by CoffeeScript 1.12.2 (function() { @@ -114949,146 +114944,7 @@ module.exports = function parseUnit(str, out) { }).call(this)}).call(this,_dereq_('_process')) -},{"_process":528}],496:[function(_dereq_,module,exports){ -"use strict" - -module.exports = permutationSign - -var BRUTE_FORCE_CUTOFF = 32 - -var pool = _dereq_("typedarray-pool") - -function permutationSign(p) { - var n = p.length - if(n < BRUTE_FORCE_CUTOFF) { - //Use quadratic algorithm for small n - var sgn = 1 - for(var i=0; i0; --i) { - t = pinv[i] - s = p[i] - p[i] = p[t] - p[t] = s - pinv[i] = pinv[s] - pinv[s] = t - r = (r + s) * i - } - pool.freeUint32(pinv) - pool.freeUint32(p) - return r -} - -function unrank(n, r, p) { - switch(n) { - case 0: - if(p) { return p } - return [] - case 1: - if(p) { - p[0] = 0 - return p - } else { - return [0] - } - case 2: - if(p) { - if(r) { - p[0] = 0 - p[1] = 1 - } else { - p[0] = 1 - p[1] = 0 - } - return p - } else { - return r ? [0,1] : [1,0] - } - default: - break - } - p = p || new Array(n) - var s, t, i, nf=1 - p[0] = 0 - for(i=1; i0; --i) { - s = (r / nf)|0 - r = (r - s * nf)|0 - nf = (nf / i)|0 - t = p[i]|0 - p[i] = p[s]|0 - p[s] = t|0 - } - return p -} - -exports.rank = rank -exports.unrank = unrank - -},{"invert-permutation":450,"typedarray-pool":617}],498:[function(_dereq_,module,exports){ +},{"_process":514}],485:[function(_dereq_,module,exports){ 'use strict' @@ -115167,7 +115023,7 @@ function toList(arg) { return arg } -},{}],499:[function(_dereq_,module,exports){ +},{}],486:[function(_dereq_,module,exports){ "use strict" module.exports = planarDual @@ -115298,7 +115154,7 @@ function planarDual(cells, positions) { //Combine paths and loops together return cycles } -},{"compare-angle":138}],500:[function(_dereq_,module,exports){ +},{"compare-angle":138}],487:[function(_dereq_,module,exports){ 'use strict' module.exports = trimLeaves @@ -115354,7 +115210,7 @@ function trimLeaves(edges, positions) { return [ nedges, npositions ] } -},{"edges-to-adjacency-list":187}],501:[function(_dereq_,module,exports){ +},{"edges-to-adjacency-list":184}],488:[function(_dereq_,module,exports){ 'use strict' module.exports = planarGraphToPolyline @@ -115559,9 +115415,7 @@ function planarGraphToPolyline(edges, positions) { return result } -},{"./lib/trim-leaves":500,"edges-to-adjacency-list":187,"planar-dual":499,"point-in-big-polygon":503,"robust-sum":553,"two-product":604,"uniq":619}],502:[function(_dereq_,module,exports){ -arguments[4][251][0].apply(exports,arguments) -},{"dup":251}],503:[function(_dereq_,module,exports){ +},{"./lib/trim-leaves":487,"edges-to-adjacency-list":184,"planar-dual":486,"point-in-big-polygon":489,"robust-sum":539,"two-product":588,"uniq":603}],489:[function(_dereq_,module,exports){ module.exports = preprocessPolygon var orient = _dereq_('robust-orientation')[3] @@ -115713,7 +115567,7 @@ function preprocessPolygon(loops) { testSlab) } } -},{"binary-search-bounds":502,"interval-tree-1d":448,"robust-orientation":548,"slab-decomposition":566}],504:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"interval-tree-1d":440,"robust-orientation":534,"slab-decomposition":551}],490:[function(_dereq_,module,exports){ /* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT @@ -115841,7 +115695,7 @@ if (typeof window === 'object') module.exports = PolyBool; -},{"./lib/build-log":505,"./lib/epsilon":506,"./lib/geojson":507,"./lib/intersecter":508,"./lib/segment-chainer":510,"./lib/segment-selector":511}],505:[function(_dereq_,module,exports){ +},{"./lib/build-log":491,"./lib/epsilon":492,"./lib/geojson":493,"./lib/intersecter":494,"./lib/segment-chainer":496,"./lib/segment-selector":497}],491:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -115956,7 +115810,7 @@ function BuildLog(){ module.exports = BuildLog; -},{}],506:[function(_dereq_,module,exports){ +},{}],492:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116128,7 +115982,7 @@ function Epsilon(eps){ module.exports = Epsilon; -},{}],507:[function(_dereq_,module,exports){ +},{}],493:[function(_dereq_,module,exports){ // (c) Copyright 2017, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116318,7 +116172,7 @@ var GeoJSON = { module.exports = GeoJSON; -},{}],508:[function(_dereq_,module,exports){ +},{}],494:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116825,7 +116679,7 @@ function Intersecter(selfIntersection, eps, buildLog){ module.exports = Intersecter; -},{"./linked-list":509}],509:[function(_dereq_,module,exports){ +},{"./linked-list":495}],495:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116908,7 +116762,7 @@ var LinkedList = { module.exports = LinkedList; -},{}],510:[function(_dereq_,module,exports){ +},{}],496:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -117162,7 +117016,7 @@ function SegmentChainer(segments, eps, buildLog){ module.exports = SegmentChainer; -},{}],511:[function(_dereq_,module,exports){ +},{}],497:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -117330,7 +117184,7 @@ var SegmentSelector = { module.exports = SegmentSelector; -},{}],512:[function(_dereq_,module,exports){ +},{}],498:[function(_dereq_,module,exports){ //Optimized version for triangle closest point // Based on Eberly's WildMagick codes // http://www.geometrictools.com/LibMathematics/Distance/Distance.html @@ -117528,7 +117382,7 @@ function closestPoint2d(V0, V1, V2, point, result) { module.exports = closestPoint2d; -},{}],513:[function(_dereq_,module,exports){ +},{}],499:[function(_dereq_,module,exports){ 'use strict'; @@ -117616,7 +117470,7 @@ ProbeError.prototype.constructor = ProbeError; exports.ProbeError = ProbeError; -},{"stream":569,"stream-parser":585}],514:[function(_dereq_,module,exports){ +},{"stream":554,"stream-parser":570}],500:[function(_dereq_,module,exports){ /* eslint-disable no-bitwise */ /* eslint-disable consistent-return */ @@ -117888,7 +117742,7 @@ module.exports.get_orientation = function (data) { } }; -},{}],515:[function(_dereq_,module,exports){ +},{}],501:[function(_dereq_,module,exports){ // Utils used to parse miaf-based files (avif/heic/heif) // // ISO media file spec: @@ -118191,7 +118045,7 @@ module.exports.getMimeType = function (data) { return { type: 'avif', mime: 'image/avif' }; }; -},{"./common":513}],516:[function(_dereq_,module,exports){ +},{"./common":499}],502:[function(_dereq_,module,exports){ // Utils used to parse miaf-based files (avif/heic/heif) // // - image collections are not supported (only last size is reported) @@ -118281,7 +118135,7 @@ module.exports = function (data) { return result; }; -},{"../common":513,"../exif_utils":514,"../miaf_utils":515}],517:[function(_dereq_,module,exports){ +},{"../common":499,"../exif_utils":500,"../miaf_utils":501}],503:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118308,7 +118162,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],518:[function(_dereq_,module,exports){ +},{"../common":499}],504:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118337,7 +118191,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],519:[function(_dereq_,module,exports){ +},{"../common":499}],505:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118384,7 +118238,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],520:[function(_dereq_,module,exports){ +},{"../common":499}],506:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118470,7 +118324,7 @@ module.exports = function (data) { } }; -},{"../common":513,"../exif_utils":514}],521:[function(_dereq_,module,exports){ +},{"../common":499,"../exif_utils":500}],507:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118503,7 +118357,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],522:[function(_dereq_,module,exports){ +},{"../common":499}],508:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118532,7 +118386,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],523:[function(_dereq_,module,exports){ +},{"../common":499}],509:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118679,7 +118533,7 @@ module.exports = function (data) { }; }; -},{}],524:[function(_dereq_,module,exports){ +},{}],510:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118767,7 +118621,7 @@ module.exports = function (data) { } }; -},{"../common":513}],525:[function(_dereq_,module,exports){ +},{"../common":499}],511:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-bitwise */ @@ -118879,7 +118733,7 @@ module.exports = function (data) { return result; }; -},{"../common":513,"../exif_utils":514}],526:[function(_dereq_,module,exports){ +},{"../common":499,"../exif_utils":500}],512:[function(_dereq_,module,exports){ 'use strict'; @@ -118896,7 +118750,7 @@ module.exports = { webp: _dereq_('./parse_sync/webp') }; -},{"./parse_sync/avif":516,"./parse_sync/bmp":517,"./parse_sync/gif":518,"./parse_sync/ico":519,"./parse_sync/jpeg":520,"./parse_sync/png":521,"./parse_sync/psd":522,"./parse_sync/svg":523,"./parse_sync/tiff":524,"./parse_sync/webp":525}],527:[function(_dereq_,module,exports){ +},{"./parse_sync/avif":502,"./parse_sync/bmp":503,"./parse_sync/gif":504,"./parse_sync/ico":505,"./parse_sync/jpeg":506,"./parse_sync/png":507,"./parse_sync/psd":508,"./parse_sync/svg":509,"./parse_sync/tiff":510,"./parse_sync/webp":511}],513:[function(_dereq_,module,exports){ 'use strict'; @@ -118926,7 +118780,7 @@ module.exports = function get_image_size(src) { module.exports.parsers = parsers; -},{"./lib/parsers_sync":526}],528:[function(_dereq_,module,exports){ +},{"./lib/parsers_sync":512}],514:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -119112,9 +118966,9 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],529:[function(_dereq_,module,exports){ +},{}],515:[function(_dereq_,module,exports){ module.exports = _dereq_('gl-quat/slerp') -},{"gl-quat/slerp":329}],530:[function(_dereq_,module,exports){ +},{"gl-quat/slerp":322}],516:[function(_dereq_,module,exports){ (function (global){(function (){ var now = _dereq_('performance-now') , root = typeof window === 'undefined' ? global : window @@ -119193,7 +119047,7 @@ module.exports.polyfill = function(object) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"performance-now":495}],531:[function(_dereq_,module,exports){ +},{"performance-now":484}],517:[function(_dereq_,module,exports){ 'use strict' var bnadd = _dereq_('big-rat/add') @@ -119209,7 +119063,7 @@ function add (a, b) { return r } -},{"big-rat/add":87}],532:[function(_dereq_,module,exports){ +},{"big-rat/add":87}],518:[function(_dereq_,module,exports){ 'use strict' module.exports = float2rat @@ -119224,7 +119078,7 @@ function float2rat(v) { return result } -},{"big-rat":90}],533:[function(_dereq_,module,exports){ +},{"big-rat":90}],519:[function(_dereq_,module,exports){ 'use strict' var rat = _dereq_('big-rat') @@ -119242,7 +119096,7 @@ function muls(a, x) { return r } -},{"big-rat":90,"big-rat/mul":99}],534:[function(_dereq_,module,exports){ +},{"big-rat":90,"big-rat/mul":99}],520:[function(_dereq_,module,exports){ 'use strict' var bnsub = _dereq_('big-rat/sub') @@ -119258,7 +119112,7 @@ function sub(a, b) { return r } -},{"big-rat/sub":101}],535:[function(_dereq_,module,exports){ +},{"big-rat/sub":101}],521:[function(_dereq_,module,exports){ 'use strict' var compareCell = _dereq_('compare-cell') @@ -119291,7 +119145,7 @@ function reduceCellComplex(cells) { return cells } -},{"cell-orientation":123,"compare-cell":139,"compare-oriented-cell":140}],536:[function(_dereq_,module,exports){ +},{"cell-orientation":123,"compare-cell":139,"compare-oriented-cell":140}],522:[function(_dereq_,module,exports){ 'use strict' var getBounds = _dereq_('array-bounds') @@ -119780,7 +119634,7 @@ function Error2D (regl, options) { } } -},{"array-bounds":76,"color-normalize":131,"flatten-vertex-data":252,"object-assign":487,"pick-by-alias":498,"to-float32":599,"update-diff":621}],537:[function(_dereq_,module,exports){ +},{"array-bounds":76,"color-normalize":131,"flatten-vertex-data":248,"object-assign":476,"pick-by-alias":485,"to-float32":584,"update-diff":605}],523:[function(_dereq_,module,exports){ 'use strict' @@ -120562,7 +120416,7 @@ Line2D.prototype.destroy = function () { return this } -},{"array-bounds":76,"array-find-index":77,"array-normalize":78,"color-normalize":131,"earcut":186,"es6-weak-map":241,"flatten-vertex-data":252,"glslify":442,"object-assign":487,"parse-rect":492,"pick-by-alias":498,"to-float32":599}],538:[function(_dereq_,module,exports){ +},{"array-bounds":76,"array-find-index":77,"array-normalize":78,"color-normalize":131,"earcut":183,"es6-weak-map":238,"flatten-vertex-data":248,"glslify":434,"object-assign":476,"parse-rect":481,"pick-by-alias":485,"to-float32":584}],524:[function(_dereq_,module,exports){ 'use strict'; function _slicedToArray(arr, i) { @@ -121551,7 +121405,7 @@ var reglScatter2d = function reglScatter2d(regl, options) { module.exports = reglScatter2d; -},{"@plotly/point-cluster":59,"array-bounds":76,"color-id":129,"color-normalize":131,"flatten-vertex-data":252,"glslify":442,"is-iexplorer":454,"object-assign":487,"parse-rect":492,"pick-by-alias":498,"to-float32":599,"update-diff":621}],539:[function(_dereq_,module,exports){ +},{"@plotly/point-cluster":59,"array-bounds":76,"color-id":129,"color-normalize":131,"flatten-vertex-data":248,"glslify":434,"is-iexplorer":444,"object-assign":476,"parse-rect":481,"pick-by-alias":485,"to-float32":584,"update-diff":605}],525:[function(_dereq_,module,exports){ 'use strict' @@ -121973,7 +121827,7 @@ function getPad (arg) { } } -},{"array-bounds":76,"array-range":79,"flatten-vertex-data":252,"parse-rect":492,"pick-by-alias":498,"raf":530,"regl-scatter2d":538}],540:[function(_dereq_,module,exports){ +},{"array-bounds":76,"array-range":79,"flatten-vertex-data":248,"parse-rect":481,"pick-by-alias":485,"raf":516,"regl-scatter2d":524}],526:[function(_dereq_,module,exports){ (function(Z,ka){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ka():"function"===typeof define&&define.amd?define(ka):Z.createREGL=ka()})(this,function(){function Z(a,b){this.id=Db++;this.type=a;this.data=b}function ka(a){if(0===a.length)return[];var b=a.charAt(0),c=a.charAt(a.length-1);if(1 * @@ -122218,7 +122072,7 @@ function repeat(str, num) { return res; } -},{}],542:[function(_dereq_,module,exports){ +},{}],528:[function(_dereq_,module,exports){ (function (global){(function (){ module.exports = global.performance && @@ -122229,7 +122083,7 @@ module.exports = } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],543:[function(_dereq_,module,exports){ +},{}],529:[function(_dereq_,module,exports){ "use strict" module.exports = compressExpansion @@ -122264,7 +122118,7 @@ function compressExpansion(e) { e.length = top return e } -},{}],544:[function(_dereq_,module,exports){ +},{}],530:[function(_dereq_,module,exports){ "use strict" var twoProduct = _dereq_("two-product") @@ -122274,67 +122128,37 @@ var compress = _dereq_("robust-compress") var NUM_EXPANDED = 6 -function cofactor(m, c) { - var result = new Array(m.length-1) - for(var i=1; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function determinant(m) { - if(m.length === 2) { - return ["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("") - } else { - var expr = [] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function makeProduct(a, b) { - if(a.charAt(0) === "m") { - if(b.charAt(0) === "w") { - var toks = a.split("[") - return ["w", b.substr(1), "m", toks[0].substr(1)].join("") - } else { - return ["prod(", a, ",", b, ")"].join("") - } - } else { - return makeProduct(b, a) - } -} - -function sign(s) { - if(s & 1 !== 0) { - return "-" - } - return "" -} - -function determinant(m) { - if(m.length === 2) { - return [["diff(", makeProduct(m[0][0], m[1][1]), ",", makeProduct(m[1][0], m[0][1]), ")"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { - code.push(",") - } - code.push("[") - for(var k=0; k 0) { - code.push(",") - } - if(k === i) { - code.push("+b[", j, "]") - } else { - code.push("+A[", j, "][", k, "]") - } - } - code.push("]") - } - code.push("]),") - } - code.push("det(A)]}return ", funcName) - var proc = new Function("det", code.join("")) + var fn = + n === 2 ? solve2d : + n === 3 ? solve3d : + n === 4 ? solve4d : + n === 5 ? solve5d : solve6d + if(n < 6) { - return proc(determinant[n]) + return fn(determinant[n]) } - return proc(determinant) + return fn(determinant) } function robustLinearSolve0d() { - return [ 0 ] + return [ [ 0 ] ] } function robustLinearSolve1d(A, b) { return [ [ b[0] ], [ A[0][0] ] ] } +function solve2d(det) { + return function robustLinearSolve2d(A, b) { + return [det([[+b[0], +A[0][1]], [+b[1], +A[1][1]]]), det([[+A[0][0], +b[0]], [+A[1][0], +b[1]]]), det(A)] + } +} + +function solve3d(det) { + return function robustLinearSolve3d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2]], [+b[1], +A[1][1], +A[1][2]], [+b[2], +A[2][1], +A[2][2]]]), det([[+A[0][0], +b[0], +A[0][2]], [+A[1][0], +b[1], +A[1][2]], [+A[2][0], +b[2], +A[2][2]]]), det([[+A[0][0], +A[0][1], +b[0]], [+A[1][0], +A[1][1], +b[1]], [+A[2][0], +A[2][1], +b[2]]]), det(A)] + } +} + +function solve4d(det) { + return function robustLinearSolve4d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3]], [+b[1], +A[1][1], +A[1][2], +A[1][3]], [+b[2], +A[2][1], +A[2][2], +A[2][3]], [+b[3], +A[3][1], +A[3][2], +A[3][3]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3]], [+A[1][0], +b[1], +A[1][2], +A[1][3]], [+A[2][0], +b[2], +A[2][2], +A[2][3]], [+A[3][0], +b[3], +A[3][2], +A[3][3]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3]], [+A[1][0], +A[1][1], +b[1], +A[1][3]], [+A[2][0], +A[2][1], +b[2], +A[2][3]], [+A[3][0], +A[3][1], +b[3], +A[3][3]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +b[3]]]), det(A)] + } +} + +function solve5d(det) { + return function robustLinearSolve5d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3], +A[0][4]], [+b[1], +A[1][1], +A[1][2], +A[1][3], +A[1][4]], [+b[2], +A[2][1], +A[2][2], +A[2][3], +A[2][4]], [+b[3], +A[3][1], +A[3][2], +A[3][3], +A[3][4]], [+b[4], +A[4][1], +A[4][2], +A[4][3], +A[4][4]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3], +A[0][4]], [+A[1][0], +b[1], +A[1][2], +A[1][3], +A[1][4]], [+A[2][0], +b[2], +A[2][2], +A[2][3], +A[2][4]], [+A[3][0], +b[3], +A[3][2], +A[3][3], +A[3][4]], [+A[4][0], +b[4], +A[4][2], +A[4][3], +A[4][4]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3], +A[0][4]], [+A[1][0], +A[1][1], +b[1], +A[1][3], +A[1][4]], [+A[2][0], +A[2][1], +b[2], +A[2][3], +A[2][4]], [+A[3][0], +A[3][1], +b[3], +A[3][3], +A[3][4]], [+A[4][0], +A[4][1], +b[4], +A[4][3], +A[4][4]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0], +A[0][4]], [+A[1][0], +A[1][1], +A[1][2], +b[1], +A[1][4]], [+A[2][0], +A[2][1], +A[2][2], +b[2], +A[2][4]], [+A[3][0], +A[3][1], +A[3][2], +b[3], +A[3][4]], [+A[4][0], +A[4][1], +A[4][2], +b[4], +A[4][4]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +b[3]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +b[4]]]), det(A)] + } +} + +function solve6d(det) { + return function robustLinearSolve6d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3], +A[0][4], +A[0][5]], [+b[1], +A[1][1], +A[1][2], +A[1][3], +A[1][4], +A[1][5]], [+b[2], +A[2][1], +A[2][2], +A[2][3], +A[2][4], +A[2][5]], [+b[3], +A[3][1], +A[3][2], +A[3][3], +A[3][4], +A[3][5]], [+b[4], +A[4][1], +A[4][2], +A[4][3], +A[4][4], +A[4][5]], [+b[5], +A[5][1], +A[5][2], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3], +A[0][4], +A[0][5]], [+A[1][0], +b[1], +A[1][2], +A[1][3], +A[1][4], +A[1][5]], [+A[2][0], +b[2], +A[2][2], +A[2][3], +A[2][4], +A[2][5]], [+A[3][0], +b[3], +A[3][2], +A[3][3], +A[3][4], +A[3][5]], [+A[4][0], +b[4], +A[4][2], +A[4][3], +A[4][4], +A[4][5]], [+A[5][0], +b[5], +A[5][2], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3], +A[0][4], +A[0][5]], [+A[1][0], +A[1][1], +b[1], +A[1][3], +A[1][4], +A[1][5]], [+A[2][0], +A[2][1], +b[2], +A[2][3], +A[2][4], +A[2][5]], [+A[3][0], +A[3][1], +b[3], +A[3][3], +A[3][4], +A[3][5]], [+A[4][0], +A[4][1], +b[4], +A[4][3], +A[4][4], +A[4][5]], [+A[5][0], +A[5][1], +b[5], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0], +A[0][4], +A[0][5]], [+A[1][0], +A[1][1], +A[1][2], +b[1], +A[1][4], +A[1][5]], [+A[2][0], +A[2][1], +A[2][2], +b[2], +A[2][4], +A[2][5]], [+A[3][0], +A[3][1], +A[3][2], +b[3], +A[3][4], +A[3][5]], [+A[4][0], +A[4][1], +A[4][2], +b[4], +A[4][4], +A[4][5]], [+A[5][0], +A[5][1], +A[5][2], +b[5], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +b[0], +A[0][5]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +b[1], +A[1][5]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +b[2], +A[2][5]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +b[3], +A[3][5]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +b[4], +A[4][5]], [+A[5][0], +A[5][1], +A[5][2], +A[5][3], +b[5], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +A[0][4], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +A[1][4], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +A[2][4], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +A[3][4], +b[3]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +A[4][4], +b[4]], [+A[5][0], +A[5][1], +A[5][2], +A[5][3], +A[5][4], +b[5]]]), det(A)] + } +} + var CACHE = [ robustLinearSolve0d, robustLinearSolve1d ] +function proc(s0, s1, s2, s3, s4, s5, CACHE, g) { + return function dispatchLinearSolve(A, b) { + switch (A.length) { + case 0: return s0(A, b); + case 1: return s1(A, b); + case 2: return s2(A, b); + case 3: return s3(A, b); + case 4: return s4(A, b); + case 5: return s5(A, b); + } + var s = CACHE[A.length]; + if (!s) s = CACHE[A.length] = g(A.length); + return s(A, b) + } +} + function generateDispatch() { while(CACHE.length < NUM_EXPAND) { CACHE.push(generateSolver(CACHE.length)) } - var procArgs = [] - var code = ["function dispatchLinearSolve(A,b){switch(A.length){"] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function determinant(m) { - if(m.length === 2) { - return [["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { return 1 } return 0.0 } -},{}],556:[function(_dereq_,module,exports){ +},{}],542:[function(_dereq_,module,exports){ 'use strict' module.exports = boundary @@ -123343,7 +123195,7 @@ function boundary(cells) { return reduce(bnd(cells)) } -},{"boundary-cells":107,"reduce-simplicial-complex":535}],557:[function(_dereq_,module,exports){ +},{"boundary-cells":107,"reduce-simplicial-complex":521}],543:[function(_dereq_,module,exports){ 'use strict' module.exports = extractContour @@ -123506,104 +123358,308 @@ function extractContour(cells, values, level, d) { vertexWeights: uweights } } -},{"./lib/codegen":558,"ndarray":483,"ndarray-sort":482,"typedarray-pool":617}],558:[function(_dereq_,module,exports){ +},{"./lib/codegen":544,"ndarray":472,"ndarray-sort":471,"typedarray-pool":601}],544:[function(_dereq_,module,exports){ 'use strict' module.exports = getPolygonizer -var pool = _dereq_('typedarray-pool') -var createMSTable = _dereq_('marching-simplex-table') - -var CACHE = {} - -function createCellPolygonizer(d) { - var maxCellSize = 0 - var tables = new Array(d+1) - tables[0] = [ [] ] - for(var i=1; i<=d; ++i) { - var tab = tables[i] = createMSTable(i) - for(var j=0; j>1,v=E[2*m+1];', - 'if(v===b){return m}', - 'if(b> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour0d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + } + return R } - code.push('R.push(') - for(var i=0; i 0) { - code.push(',') + return getContour0d + }, + function cellPolygonizer_1() { + 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 + } } - code.push('[') - for(var j=0; j 0) { - code.push(',') + return l + } + function getContour1d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } } - code.push('B(C,E,c[', f[0], '],c[', f[1], '])') } - code.push(']') - } - code.push(');') - } - - for(var i=d+1; i>1; --i) { - if(i < d+1) { - code.push('else ') + return R } - code.push('if(l===', i, '){') - - //Generate mask - var maskStr = [] - for(var j=0; j> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour2d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R } - - //Perform table look up - code.push('var M=', maskStr.join('+'), - ';if(M===0||M===', (1<> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour3d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 4) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + (S[c[3]] << 3) + if (M === 0 || M === 15) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])]) + break + case 2: + R.push([B(C, E, c[1], c[2]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])]) + break + case 3: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])], [B(C, E, c[1], c[3]), B(C, E, c[1], c[2]), B(C, E, c[0], c[3])]) + break + case 4: + R.push([B(C, E, c[2], c[0]), B(C, E, c[2], c[1]), B(C, E, c[2], c[3])]) + break + case 5: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[0], c[3])], [B(C, E, c[2], c[1]), B(C, E, c[2], c[3]), B(C, E, c[0], c[3])]) + break + case 6: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])], [B(C, E, c[2], c[3]), B(C, E, c[2], c[0]), B(C, E, c[1], c[3])]) + break + case 7: + R.push([B(C, E, c[0], c[3]), B(C, E, c[1], c[3]), B(C, E, c[2], c[3])]) + break + case 8: + R.push([B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[3], c[2])]) + break + case 9: + R.push([B(C, E, c[3], c[1]), B(C, E, c[0], c[1]), B(C, E, c[0], c[2])], [B(C, E, c[3], c[2]), B(C, E, c[3], c[1]), B(C, E, c[0], c[2])]) + break + case 10: + R.push([B(C, E, c[1], c[0]), B(C, E, c[3], c[0]), B(C, E, c[1], c[2])], [B(C, E, c[3], c[0]), B(C, E, c[3], c[2]), B(C, E, c[1], c[2])]) + break + case 11: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[3], c[2])]) + break + case 12: + R.push([B(C, E, c[3], c[0]), B(C, E, c[2], c[0]), B(C, E, c[2], c[1])], [B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[2], c[1])]) + break + case 13: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[3], c[1])]) + break + case 14: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[3], c[0])]) + break + case 15: + break + } + } else if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R } - code.push('}}') + return getContour3d } - code.push('}return R;};return getContour', d, 'd') - - var proc = new Function('pool', code.join('')) - return proc(pool) -} +] function getPolygonizer(d) { - var alg = CACHE[d] - if(!alg) { - alg = CACHE[d] = createCellPolygonizer(d) - } - return alg + return allFns[d](); } -},{"marching-simplex-table":462,"typedarray-pool":617}],559:[function(_dereq_,module,exports){ + +},{}],545:[function(_dereq_,module,exports){ "use strict"; "use restrict"; var bits = _dereq_("bit-twiddle") @@ -123947,11 +124003,11 @@ function connectedComponents(cells, vertex_count) { } exports.connectedComponents = connectedComponents -},{"bit-twiddle":104,"union-find":618}],560:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"union-find":602}],546:[function(_dereq_,module,exports){ arguments[4][104][0].apply(exports,arguments) -},{"dup":104}],561:[function(_dereq_,module,exports){ -arguments[4][559][0].apply(exports,arguments) -},{"bit-twiddle":560,"dup":559,"union-find":562}],562:[function(_dereq_,module,exports){ +},{"dup":104}],547:[function(_dereq_,module,exports){ +arguments[4][545][0].apply(exports,arguments) +},{"bit-twiddle":546,"dup":545,"union-find":548}],548:[function(_dereq_,module,exports){ "use strict"; "use restrict"; module.exports = UnionFind; @@ -124008,7 +124064,7 @@ UnionFind.prototype.link = function(x, y) { } -},{}],563:[function(_dereq_,module,exports){ +},{}],549:[function(_dereq_,module,exports){ "use strict" module.exports = simplifyPolygon @@ -124280,7 +124336,7 @@ function simplifyPolygon(cells, positions, minArea) { edges: ncells } } -},{"robust-orientation":548,"simplicial-complex":561}],564:[function(_dereq_,module,exports){ +},{"robust-orientation":534,"simplicial-complex":547}],550:[function(_dereq_,module,exports){ "use strict" module.exports = orderSegments @@ -124376,9 +124432,7 @@ function orderSegments(b, a) { } return ar[0] - br[0] } -},{"robust-orientation":548}],565:[function(_dereq_,module,exports){ -arguments[4][251][0].apply(exports,arguments) -},{"dup":251}],566:[function(_dereq_,module,exports){ +},{"robust-orientation":534}],551:[function(_dereq_,module,exports){ "use strict" module.exports = createSlabDecomposition @@ -124609,7 +124663,7 @@ function createSlabDecomposition(segments) { } return new SlabDecomposition(slabs, lines, horizontal) } -},{"./lib/order-segments":564,"binary-search-bounds":565,"functional-red-black-tree":255,"robust-orientation":548}],567:[function(_dereq_,module,exports){ +},{"./lib/order-segments":550,"binary-search-bounds":103,"functional-red-black-tree":251,"robust-orientation":534}],552:[function(_dereq_,module,exports){ "use strict" var robustDot = _dereq_("robust-dot-product") @@ -124701,7 +124755,7 @@ function negative(points, plane) { } return neg } -},{"robust-dot-product":545,"robust-sum":553}],568:[function(_dereq_,module,exports){ +},{"robust-dot-product":531,"robust-sum":539}],553:[function(_dereq_,module,exports){ /* global window, exports, define */ !function() { @@ -124934,7 +124988,7 @@ function negative(points, plane) { /* eslint-enable quote-props */ }(); // eslint-disable-line -},{}],569:[function(_dereq_,module,exports){ +},{}],554:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -125065,7 +125119,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":116,"inherits":447,"readable-stream/lib/_stream_duplex.js":571,"readable-stream/lib/_stream_passthrough.js":572,"readable-stream/lib/_stream_readable.js":573,"readable-stream/lib/_stream_transform.js":574,"readable-stream/lib/_stream_writable.js":575,"readable-stream/lib/internal/streams/end-of-stream.js":579,"readable-stream/lib/internal/streams/pipeline.js":581}],570:[function(_dereq_,module,exports){ +},{"events":116,"inherits":439,"readable-stream/lib/_stream_duplex.js":556,"readable-stream/lib/_stream_passthrough.js":557,"readable-stream/lib/_stream_readable.js":558,"readable-stream/lib/_stream_transform.js":559,"readable-stream/lib/_stream_writable.js":560,"readable-stream/lib/internal/streams/end-of-stream.js":564,"readable-stream/lib/internal/streams/pipeline.js":566}],555:[function(_dereq_,module,exports){ 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } @@ -125194,7 +125248,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; -},{}],571:[function(_dereq_,module,exports){ +},{}],556:[function(_dereq_,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -125336,7 +125390,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); }).call(this)}).call(this,_dereq_('_process')) -},{"./_stream_readable":573,"./_stream_writable":575,"_process":528,"inherits":447}],572:[function(_dereq_,module,exports){ +},{"./_stream_readable":558,"./_stream_writable":560,"_process":514,"inherits":439}],557:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -125376,7 +125430,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":574,"inherits":447}],573:[function(_dereq_,module,exports){ +},{"./_stream_transform":559,"inherits":439}],558:[function(_dereq_,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -126503,7 +126557,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":570,"./_stream_duplex":571,"./internal/streams/async_iterator":576,"./internal/streams/buffer_list":577,"./internal/streams/destroy":578,"./internal/streams/from":580,"./internal/streams/state":582,"./internal/streams/stream":583,"_process":528,"buffer":117,"events":116,"inherits":447,"string_decoder/":584,"util":115}],574:[function(_dereq_,module,exports){ +},{"../errors":555,"./_stream_duplex":556,"./internal/streams/async_iterator":561,"./internal/streams/buffer_list":562,"./internal/streams/destroy":563,"./internal/streams/from":565,"./internal/streams/state":567,"./internal/streams/stream":568,"_process":514,"buffer":117,"events":116,"inherits":439,"string_decoder/":569,"util":115}],559:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -126705,7 +126759,7 @@ function done(stream, er, data) { if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } -},{"../errors":570,"./_stream_duplex":571,"inherits":447}],575:[function(_dereq_,module,exports){ +},{"../errors":555,"./_stream_duplex":556,"inherits":439}],560:[function(_dereq_,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -127405,7 +127459,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":570,"./_stream_duplex":571,"./internal/streams/destroy":578,"./internal/streams/state":582,"./internal/streams/stream":583,"_process":528,"buffer":117,"inherits":447,"util-deprecate":622}],576:[function(_dereq_,module,exports){ +},{"../errors":555,"./_stream_duplex":556,"./internal/streams/destroy":563,"./internal/streams/state":567,"./internal/streams/stream":568,"_process":514,"buffer":117,"inherits":439,"util-deprecate":606}],561:[function(_dereq_,module,exports){ (function (process){(function (){ 'use strict'; @@ -127615,7 +127669,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat module.exports = createReadableStreamAsyncIterator; }).call(this)}).call(this,_dereq_('_process')) -},{"./end-of-stream":579,"_process":528}],577:[function(_dereq_,module,exports){ +},{"./end-of-stream":564,"_process":514}],562:[function(_dereq_,module,exports){ 'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -127826,7 +127880,7 @@ function () { return BufferList; }(); -},{"buffer":117,"util":115}],578:[function(_dereq_,module,exports){ +},{"buffer":117,"util":115}],563:[function(_dereq_,module,exports){ (function (process){(function (){ 'use strict'; // undocumented cb() API, needed for core, not for public API @@ -127934,7 +127988,7 @@ module.exports = { errorOrDestroy: errorOrDestroy }; }).call(this)}).call(this,_dereq_('_process')) -},{"_process":528}],579:[function(_dereq_,module,exports){ +},{"_process":514}],564:[function(_dereq_,module,exports){ // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -128039,12 +128093,12 @@ function eos(stream, opts, callback) { } module.exports = eos; -},{"../../../errors":570}],580:[function(_dereq_,module,exports){ +},{"../../../errors":555}],565:[function(_dereq_,module,exports){ module.exports = function () { throw new Error('Readable.from is not available in the browser') }; -},{}],581:[function(_dereq_,module,exports){ +},{}],566:[function(_dereq_,module,exports){ // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -128142,7 +128196,7 @@ function pipeline() { } module.exports = pipeline; -},{"../../../errors":570,"./end-of-stream":579}],582:[function(_dereq_,module,exports){ +},{"../../../errors":555,"./end-of-stream":564}],567:[function(_dereq_,module,exports){ 'use strict'; var ERR_INVALID_OPT_VALUE = _dereq_('../../../errors').codes.ERR_INVALID_OPT_VALUE; @@ -128170,10 +128224,10 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark: getHighWaterMark }; -},{"../../../errors":570}],583:[function(_dereq_,module,exports){ +},{"../../../errors":555}],568:[function(_dereq_,module,exports){ module.exports = _dereq_('events').EventEmitter; -},{"events":116}],584:[function(_dereq_,module,exports){ +},{"events":116}],569:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -128470,7 +128524,7 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":554}],585:[function(_dereq_,module,exports){ +},{"safe-buffer":540}],570:[function(_dereq_,module,exports){ (function (process,Buffer){(function (){ /** @@ -128773,7 +128827,7 @@ function trampoline (fn) { } }).call(this)}).call(this,_dereq_('_process'),_dereq_("buffer").Buffer) -},{"_process":528,"assert":80,"buffer":117,"debug":586}],586:[function(_dereq_,module,exports){ +},{"_process":514,"assert":80,"buffer":117,"debug":571}],571:[function(_dereq_,module,exports){ (function (process){(function (){ /** * This is the web browser implementation of `debug()`. @@ -128962,7 +129016,7 @@ function localstorage() { } }).call(this)}).call(this,_dereq_('_process')) -},{"./debug":587,"_process":528}],587:[function(_dereq_,module,exports){ +},{"./debug":572,"_process":514}],572:[function(_dereq_,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -129166,7 +129220,7 @@ function coerce(val) { return val; } -},{"ms":588}],588:[function(_dereq_,module,exports){ +},{"ms":573}],573:[function(_dereq_,module,exports){ /** * Helpers. */ @@ -129320,7 +129374,7 @@ function plural(ms, n, name) { return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],589:[function(_dereq_,module,exports){ +},{}],574:[function(_dereq_,module,exports){ 'use strict' var paren = _dereq_('parenthesis') @@ -129378,7 +129432,7 @@ module.exports = function splitBy (string, separator, o) { return parts } -},{"parenthesis":491}],590:[function(_dereq_,module,exports){ +},{"parenthesis":480}],575:[function(_dereq_,module,exports){ "use strict" module.exports = stronglyConnectedComponents @@ -129494,180 +129548,1570 @@ function stronglyConnectedComponents(adjList) { return {components: components, adjacencyList: sccAdjList} } -},{}],591:[function(_dereq_,module,exports){ +},{}],576:[function(_dereq_,module,exports){ "use strict" module.exports = surfaceNets var generateContourExtractor = _dereq_("ndarray-extract-contour") -var triangulateCube = _dereq_("triangulate-hypercube") var zeroCrossings = _dereq_("zero-crossings") -function buildSurfaceNets(order, dtype) { - var dimension = order.length - var code = ["'use strict';"] - var funcName = "surfaceNets" + order.join("_") + "d" + dtype - - //Contour extraction function - code.push( - "var contour=genContour({", - "order:[", order.join(), "],", - "scalarArguments: 3,", - "phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },") - if(dtype === "generic") { - code.push("getters:[0],") - } - - //Generate vertex function - var cubeArgs = [] - var extraArgs = [] - for(var i=0; i>>7){") - } - for(var i=0; i<1<<(1< 128) { - if((i%128)===0) { - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - var efName = "vExtra" + extraFuncs.length - code.push("case ", (i>>>7), ":", efName, "(m&0x7f,", extraArgs.join(), ");break;") - currentFunc = [ - "function ", efName, "(m,", extraArgs.join(), "){switch(m){" - ] - extraFuncs.push(currentFunc) - } - } - currentFunc.push("case ", (i&0x7f), ":") - var crossings = new Array(dimension) - var denoms = new Array(dimension) - var crossingCount = new Array(dimension) - var bias = new Array(dimension) - var totalCrossings = 0 - for(var j=0; j j) { - continue +var F1_6 = 1 / 6 +var F5_6 = 5 / 6 +var F7_18 = 7 / 18 +var F1_14 = 1 / 14 +var F3_14 = 3 / 14 +var F5_14 = 5 / 14 +var F9_14 = 9 / 14 +var F11_18 = 11 / 18 + +var allFns = { + "2d": function (genContour, order, dtype) { + var contour = genContour({ + order: order, + scalarArguments: 3, + getters: dtype === "generic" ? [0] : undefined, + phase: function phaseFunc(p, a, b, c) { + return (p > c) | 0; + }, + vertex: function vertexFunc(d0, d1, v0, v1, v2, v3, p0, p1, p2, p3, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3)) | 0; + if (m === 0 || m === 15) { + return; } - if(!(i&(1< c) | 0; + }, + vertex: function vertexFunc(d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3) + (p4 << 4) + (p5 << 5) + (p6 << 6) + (p7 << 7)) | 0; + if (m === 0 || m === 255) { + return; } + switch (m >>> 7) { + case 0: + vExtra0(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + case 1: + vExtra1(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + } + }, + cell: function cellFunc(v0, v1, v2, v3, c0, c1, p0, p1, a, b, c) { + if (p0) { + b.push([v3, v2, v0], [v0, v1, v3]); + } else { + b.push([v0, v2, v3], [v3, v1, v0]); + } + }, + }); + return function (array, level) { + var verts = [], + cells = []; + contour(array, verts, cells, level); + return { positions: verts, cells: cells }; + }; + function vExtra0(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; + case 1: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 3: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 4: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 5: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 6: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 7: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 8: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 9: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 10: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 11: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 12: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 13: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 14: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 15: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (v4 + v0 + v5 + v1 + v6 + v2 + v7 + v3 - 8 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 16: + a.push([ + d0 - F1_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 17: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 18: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 19: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 20: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 21: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 22: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 23: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 24: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 25: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 26: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 28: + a.push([ + d0 - F5_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 30: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v4 - v0 + v1 - v5 + v2 - v6 + v3 - v7), + ]); + break; + case 31: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 32: + a.push([ + d0 - F5_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 33: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 34: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 35: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 36: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 37: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 38: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 40: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 41: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 42: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 43: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 44: + a.push([ + d0 - F9_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 45: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 46: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 47: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 48: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 49: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 50: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 51: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (v2 + v0 + v3 + v1 + v6 + v4 + v7 + v5 - 8 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5]); + break; + case 52: + a.push([ + d0 - F5_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 54: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v2 - v0 + v1 - v3 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 55: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 56: + a.push([ + d0 - F9_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 57: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 58: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 59: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 60: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + v7 + v5)) / (v2 - v0 + v3 - v1 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + v7 + v3)) / (v4 - v0 + v5 - v1 + v2 - v6 + v3 - v7)]); + break; + case 61: + a.push([ + d0 - F9_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 62: + a.push([ + d0 - F5_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 63: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 64: + a.push([ + d0 - F1_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 65: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 66: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 67: + a.push([ + d0 - F5_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 68: + a.push([d0 - 0.25 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 69: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 70: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 71: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 72: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 73: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 75: + a.push([ + d0 - 0.375 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 76: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 77: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 78: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 79: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 80: + a.push([d0 - 0.25 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 81: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 82: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 83: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 84: + a.push([d0 - 0.3 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 85: + a.push([d0 - 0.5 - (0.5 * (v1 + v0 + v3 + v2 + v5 + v4 + v7 + v6 - 8 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5]); + break; + case 86: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v1 - v0 + v2 - v3 + v4 - v5 + v6 - v7), + d1 - 0.375 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 87: + a.push([d0 - 0.7 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 88: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v3 - v2 + v4 - v5 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 90: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + v7 + v6)) / (v1 - v0 + v3 - v2 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + v7 + v3)) / (v4 - v0 + v1 - v5 + v6 - v2 + v3 - v7)]); + break; + case 91: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 92: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 93: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 94: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 95: + a.push([d0 - 0.75 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 96: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 97: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 99: + a.push([ + d0 - 0.375 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.375 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 102: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + v7 + v6)) / (v1 - v0 + v2 - v3 + v5 - v4 + v6 - v7), d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + v7 + v5)) / (v2 - v0 + v1 - v3 + v6 - v4 + v5 - v7), d2 - 0.5]); + break; + case 103: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 104: + a.push([ + d0 - F11_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 105: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + v7 + v6)) / (v0 - v1 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + v7 + v5)) / (v0 - v2 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + v7 + v3)) / (v0 - v4 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 106: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + v7 + v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.625 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 107: + a.push([ + d0 - F7_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 108: + a.push([ + d0 - 0.625 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + v7 + v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 109: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 110: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 111: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 112: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 113: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 114: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 115: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 116: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 117: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 119: + a.push([d0 - 0.75 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 120: + a.push([ + d0 - 0.625 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + v7 + v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 121: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 122: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 123: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 124: + a.push([ + d0 - F9_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 126: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 127: + a.push([ + d0 - F5_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; } } - var vertexStr = [] - for(var k=0; k 0) { - cStr = "+" + crossingCount[k] + "*c" - } - var weight = 0.5 * (crossings[k].length / totalCrossings) - var shift = 0.5 + 0.5 * (bias[k] / totalCrossings) - vertexStr.push("d" + k + "-" + shift + "-" + weight + "*(" + crossings[k].join("+") + cStr + ")/(" + denoms[k].join("+") + ")") - + function vExtra1(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([ + d0 - F5_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 1: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 3: + a.push([ + d0 - F9_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 4: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 5: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 6: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 7: + a.push([ + d0 - 0.625 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + v6 + v2 + -v7 - v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 8: + a.push([d0 - 0.75 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 9: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 10: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 11: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 12: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 13: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 14: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 15: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 16: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 17: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 18: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 19: + a.push([ + d0 - 0.625 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + v6 + v4 + -v7 - v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 20: + a.push([ + d0 - F7_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 21: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + v5 + v4 + -v7 - v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.625 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 22: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 + -v7 - v6)) / (v1 - v0 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 + -v7 - v5)) / (v2 - v0 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 + -v7 - v3)) / (v4 - v0 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 23: + a.push([ + d0 - F11_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 24: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 25: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + -v7 - v6)) / (v0 - v1 + v3 - v2 + v4 - v5 + v7 - v6), d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + -v7 - v5)) / (v0 - v2 + v3 - v1 + v4 - v6 + v7 - v5), d2 - 0.5]); + break; + case 26: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.375 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 28: + a.push([ + d0 - 0.375 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 30: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 31: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 32: + a.push([d0 - 0.75 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 33: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 34: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 35: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 36: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 37: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + -v7 - v6)) / (v0 - v1 + v2 - v3 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + -v7 - v3)) / (v0 - v4 + v5 - v1 + v2 - v6 + v7 - v3)]); + break; + case 38: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v2 - v3 + v5 - v4 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 40: + a.push([d0 - 0.7 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 41: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v0 - v1 + v3 - v2 + v5 - v4 + v7 - v6), + d1 - 0.375 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 42: + a.push([d0 - 0.5 - (0.5 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 8 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5]); + break; + case 43: + a.push([d0 - 0.3 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 44: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 45: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 46: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 47: + a.push([d0 - 0.25 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 48: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 49: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 50: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 51: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 52: + a.push([ + d0 - 0.375 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 54: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 55: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 56: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 57: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 58: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 59: + a.push([d0 - 0.25 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 60: + a.push([ + d0 - F5_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 61: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 62: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 63: + a.push([ + d0 - F1_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 64: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 65: + a.push([ + d0 - F5_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 66: + a.push([ + d0 - F9_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 67: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + -v7 - v5)) / (v0 - v2 + v1 - v3 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + -v7 - v3)) / (v0 - v4 + v1 - v5 + v6 - v2 + v7 - v3)]); + break; + case 68: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 69: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 70: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 71: + a.push([ + d0 - F9_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 72: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 73: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v0 - v2 + v3 - v1 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 75: + a.push([ + d0 - F5_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 76: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 8 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5]); + break; + case 77: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 78: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 79: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 80: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 81: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 82: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 83: + a.push([ + d0 - F9_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 84: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 85: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 86: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 87: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 88: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 90: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 91: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 92: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 93: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 94: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 95: + a.push([ + d0 - F5_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 96: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 97: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v0 - v4 + v5 - v1 + v6 - v2 + v7 - v3), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 99: + a.push([ + d0 - F5_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 102: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 103: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 104: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 105: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 106: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 107: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 108: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 109: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 110: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 111: + a.push([ + d0 - F1_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 112: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 8 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 113: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 114: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 115: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 116: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 117: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 119: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 120: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 121: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 122: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 123: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 124: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 126: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 127: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; } } - currentFunc.push("a.push([", vertexStr.join(), "]);", - "break;") - } - code.push("}},") - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - - //Create face function - var faceArgs = [] - for(var i=0; i<(1<<(dimension-1)); ++i) { - faceArgs.push("v" + i) - } - faceArgs.push("c0", "c1", "p0", "p1", "a", "b", "c") - code.push("cell:function cellFunc(", faceArgs.join(), "){") - - var facets = triangulateCube(dimension-1) - code.push("if(p0){b.push(", - facets.map(function(f) { - return "[" + f.map(function(v) { - return "v" + v - }) + "]" - }).join(), ")}else{b.push(", - facets.map(function(f) { - var e = f.slice() - e.reverse() - return "[" + e.map(function(v) { - return "v" + v - }) + "]" - }).join(), - ")}}});function ", funcName, "(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ", funcName, ";") - - for(var i=0; i= 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": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg1_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg2_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg3_", - "lvalue": false, - "rvalue": true, - "count": 2 - }, { - "name": "_inline_1_arg4_", - "lvalue": false, - "rvalue": true, - "count": 1 - }], - "thisVars": [], - "localVars": ["_inline_1_da", "_inline_1_db"] - }, +},{"./main":628,"object-assign":476}],630:[function(_dereq_,module,exports){ +"use strict" + +function CWiseOp() { + return function(SS, a0, t0, p0, Y0, Y1) { + var s0 = SS[0], + t0p0 = t0[0], + index = [0], + q0 = t0p0 + p0 |= 0 + var i0 = 0, + d0s0 = t0p0 + for (i0 = 0; i0 < s0; ++i0) { + { + var da = a0[p0] - Y1 + var db = a0[p0 + q0] - Y1 + if (da >= 0 !== db >= 0) { + Y0.push(index[0] + 0.5 + (0.5 * (da + db)) / (da - db)) + } + } + p0 += d0s0 + ++index[0] + } + } +} + +//Generates a cwise operator +function generateCWiseOp() { + return CWiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {} + return function zeroCrossings_cwise_thunk(array0, scalar2, scalar3) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar2, scalar3) + } +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ funcName: 'zeroCrossings' }) -},{"cwise-compiler":157}],647:[function(_dereq_,module,exports){ +},{}],631:[function(_dereq_,module,exports){ "use strict" module.exports = findZeroCrossings @@ -139998,7 +141419,7 @@ function findZeroCrossings(array, level) { core(array.hi(array.shape[0]-1), cross, level) return cross } -},{"./lib/zc-core":646}],648:[function(_dereq_,module,exports){ +},{"./lib/zc-core":630}],632:[function(_dereq_,module,exports){ 'use strict'; /** @@ -140061,7 +141482,7 @@ module.exports = [ } ]; -},{}],649:[function(_dereq_,module,exports){ +},{}],633:[function(_dereq_,module,exports){ 'use strict'; var ARROWPATHS = _dereq_('./arrow_paths'); @@ -140563,7 +141984,7 @@ module.exports = templatedArray('annotation', { } }); -},{"../../constants/axis_placeable_objects":772,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861,"../../plots/font_attributes":883,"./arrow_paths":648}],650:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":756,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845,"../../plots/font_attributes":867,"./arrow_paths":632}],634:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140645,7 +142066,7 @@ function calcAxisExpansion(ann, ax) { ann._extremes[axId] = extremes; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./draw":655}],651:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./draw":639}],635:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140775,7 +142196,7 @@ function clickData2r(d, ax) { return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d); } -},{"../../lib":803,"../../plot_api/plot_template":843,"../../registry":931}],652:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../registry":915}],636:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140846,7 +142267,7 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo coerce('captureevents', !!hoverText); }; -},{"../../lib":803,"../color":666}],653:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650}],637:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -140900,7 +142321,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":831,"fast-isnumeric":249}],654:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":815,"fast-isnumeric":246}],638:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140999,7 +142420,7 @@ function handleAnnotationDefaults(annIn, annOut, fullLayout) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"./attributes":649,"./common_defaults":652}],655:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"./attributes":633,"./common_defaults":636}],639:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -141752,7 +143173,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) { } else annText.call(textLayout); } -},{"../../lib":803,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plot_api/plot_template":843,"../../plots/cartesian/axes":854,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../fx":706,"./draw_arrow_head":656,"@plotly/d3":58}],656:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plot_api/plot_template":827,"../../plots/cartesian/axes":838,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../fx":690,"./draw_arrow_head":640,"@plotly/d3":58}],640:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -141899,7 +143320,7 @@ module.exports = function drawArrowHead(el3, ends, options) { if(doEnd) drawhead(headStyle, end, endRot, scale); }; -},{"../../lib":803,"../color":666,"./arrow_paths":648,"@plotly/d3":58}],657:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"./arrow_paths":632,"@plotly/d3":58}],641:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -141924,7 +143345,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":867,"./attributes":649,"./calc_autorange":650,"./click":651,"./convert_coords":653,"./defaults":654,"./draw":655}],658:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":851,"./attributes":633,"./calc_autorange":634,"./click":635,"./convert_coords":637,"./defaults":638,"./draw":639}],642:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -142008,7 +143429,7 @@ module.exports = overrideAll(templatedArray('annotation', { // zref: 'z' }), 'calc', 'from-root'); -},{"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../annotations/attributes":649}],659:[function(_dereq_,module,exports){ +},{"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../annotations/attributes":633}],643:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -142065,7 +143486,7 @@ function mockAnnAxes(ann, scene) { }; } -},{"../../lib":803,"../../plots/cartesian/axes":854}],660:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838}],644:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -142133,7 +143554,7 @@ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"../annotations/common_defaults":652,"./attributes":658}],661:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"../annotations/common_defaults":636,"./attributes":642}],645:[function(_dereq_,module,exports){ 'use strict'; var drawRaw = _dereq_('../annotations/draw').drawRaw; @@ -142177,7 +143598,7 @@ module.exports = function draw(scene) { } }; -},{"../../plots/gl3d/project":905,"../annotations/draw":655}],662:[function(_dereq_,module,exports){ +},{"../../plots/gl3d/project":889,"../annotations/draw":639}],646:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -142217,7 +143638,7 @@ function includeGL3D(layoutIn, layoutOut) { } } -},{"../../lib":803,"../../registry":931,"./attributes":658,"./convert":659,"./defaults":660,"./draw":661}],663:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./attributes":642,"./convert":643,"./defaults":644,"./draw":645}],647:[function(_dereq_,module,exports){ 'use strict'; // a trimmed down version of: @@ -142242,7 +143663,7 @@ _dereq_('world-calendars/dist/calendars/taiwan'); _dereq_('world-calendars/dist/calendars/thai'); _dereq_('world-calendars/dist/calendars/ummalqura'); -},{"world-calendars/dist/calendars/chinese":630,"world-calendars/dist/calendars/coptic":631,"world-calendars/dist/calendars/discworld":632,"world-calendars/dist/calendars/ethiopian":633,"world-calendars/dist/calendars/hebrew":634,"world-calendars/dist/calendars/islamic":635,"world-calendars/dist/calendars/julian":636,"world-calendars/dist/calendars/mayan":637,"world-calendars/dist/calendars/nanakshahi":638,"world-calendars/dist/calendars/nepali":639,"world-calendars/dist/calendars/persian":640,"world-calendars/dist/calendars/taiwan":641,"world-calendars/dist/calendars/thai":642,"world-calendars/dist/calendars/ummalqura":643,"world-calendars/dist/main":644,"world-calendars/dist/plus":645}],664:[function(_dereq_,module,exports){ +},{"world-calendars/dist/calendars/chinese":614,"world-calendars/dist/calendars/coptic":615,"world-calendars/dist/calendars/discworld":616,"world-calendars/dist/calendars/ethiopian":617,"world-calendars/dist/calendars/hebrew":618,"world-calendars/dist/calendars/islamic":619,"world-calendars/dist/calendars/julian":620,"world-calendars/dist/calendars/mayan":621,"world-calendars/dist/calendars/nanakshahi":622,"world-calendars/dist/calendars/nepali":623,"world-calendars/dist/calendars/persian":624,"world-calendars/dist/calendars/taiwan":625,"world-calendars/dist/calendars/thai":626,"world-calendars/dist/calendars/ummalqura":627,"world-calendars/dist/main":628,"world-calendars/dist/plus":629}],648:[function(_dereq_,module,exports){ 'use strict'; var calendars = _dereq_('./calendars'); @@ -142508,7 +143929,7 @@ module.exports = { worldCalFmt: worldCalFmt }; -},{"../../constants/numerical":779,"../../lib":803,"./calendars":663}],665:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"./calendars":647}],649:[function(_dereq_,module,exports){ 'use strict'; @@ -142540,7 +143961,7 @@ exports.borderLine = '#BEC8D9'; // gives back exactly lightLine if the other colors are defaults. exports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4); -},{}],666:[function(_dereq_,module,exports){ +},{}],650:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -142706,7 +144127,7 @@ function cleanOne(val) { return 'rgb(' + rgbStr + ')'; } -},{"../../lib/array":785,"./attributes":665,"fast-isnumeric":249,"tinycolor2":598}],667:[function(_dereq_,module,exports){ +},{"../../lib/array":769,"./attributes":649,"fast-isnumeric":246,"tinycolor2":583}],651:[function(_dereq_,module,exports){ 'use strict'; var axesAttrs = _dereq_('../../plots/cartesian/layout_attributes'); @@ -142933,7 +144354,7 @@ module.exports = overrideAll({ } }, 'colorbars', 'from-root'); -},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/cartesian/layout_attributes":869,"../../plots/font_attributes":883}],668:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/cartesian/layout_attributes":853,"../../plots/font_attributes":867}],652:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -142953,7 +144374,7 @@ module.exports = { } }; -},{}],669:[function(_dereq_,module,exports){ +},{}],653:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -143023,7 +144444,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) { coerce('title.side'); }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/cartesian/tick_label_defaults":876,"../../plots/cartesian/tick_mark_defaults":877,"../../plots/cartesian/tick_value_defaults":878,"./attributes":667}],670:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/cartesian/tick_label_defaults":860,"../../plots/cartesian/tick_mark_defaults":861,"../../plots/cartesian/tick_value_defaults":862,"./attributes":651}],654:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -143750,7 +145171,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":771,"../../lib":803,"../../lib/extend":793,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_defaults":856,"../../plots/cartesian/layout_attributes":869,"../../plots/cartesian/position_defaults":872,"../../plots/plots":917,"../../registry":931,"../color":666,"../colorscale/helpers":677,"../dragelement":685,"../drawing":688,"../titles":764,"./constants":668,"@plotly/d3":58,"tinycolor2":598}],671:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/extend":777,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_defaults":840,"../../plots/cartesian/layout_attributes":853,"../../plots/cartesian/position_defaults":856,"../../plots/plots":901,"../../registry":915,"../color":650,"../colorscale/helpers":661,"../dragelement":669,"../drawing":672,"../titles":748,"./constants":652,"@plotly/d3":58,"tinycolor2":583}],655:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -143760,7 +145181,7 @@ module.exports = function hasColorbar(container) { return Lib.isPlainObject(container.colorbar); }; -},{"../../lib":803}],672:[function(_dereq_,module,exports){ +},{"../../lib":787}],656:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -143774,7 +145195,7 @@ module.exports = { hasColorbar: _dereq_('./has_colorbar') }; -},{"./attributes":667,"./defaults":669,"./draw":670,"./has_colorbar":671}],673:[function(_dereq_,module,exports){ +},{"./attributes":651,"./defaults":653,"./draw":654,"./has_colorbar":655}],657:[function(_dereq_,module,exports){ 'use strict'; var colorbarAttrs = _dereq_('../colorbar/attributes'); @@ -144027,7 +145448,7 @@ module.exports = function colorScaleAttrs(context, opts) { return attrs; }; -},{"../../lib/regex":820,"../../lib/sort_object_keys":826,"../colorbar/attributes":667,"./scales.js":681}],674:[function(_dereq_,module,exports){ +},{"../../lib/regex":804,"../../lib/sort_object_keys":810,"../colorbar/attributes":651,"./scales.js":665}],658:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -144098,7 +145519,7 @@ module.exports = function calc(gd, trace, opts) { } }; -},{"../../lib":803,"./helpers":677,"fast-isnumeric":249}],675:[function(_dereq_,module,exports){ +},{"../../lib":787,"./helpers":661,"fast-isnumeric":246}],659:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -144167,7 +145588,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":803,"./helpers":677}],676:[function(_dereq_,module,exports){ +},{"../../lib":787,"./helpers":661}],660:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -144284,7 +145705,7 @@ module.exports = function colorScaleDefaults(parentContIn, parentContOut, layout } }; -},{"../../lib":803,"../../registry":931,"../colorbar/defaults":669,"../colorbar/has_colorbar":671,"./scales":681,"fast-isnumeric":249}],677:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../colorbar/defaults":653,"../colorbar/has_colorbar":655,"./scales":665,"fast-isnumeric":246}],661:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -144516,7 +145937,7 @@ module.exports = { makeColorScaleFuncFromTrace: makeColorScaleFuncFromTrace }; -},{"../../lib":803,"../color":666,"./scales":681,"@plotly/d3":58,"fast-isnumeric":249,"tinycolor2":598}],678:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"./scales":665,"@plotly/d3":58,"fast-isnumeric":246,"tinycolor2":583}],662:[function(_dereq_,module,exports){ 'use strict'; var scales = _dereq_('./scales'); @@ -144550,7 +145971,7 @@ module.exports = { makeColorScaleFuncFromTrace: helpers.makeColorScaleFuncFromTrace }; -},{"./attributes":673,"./calc":674,"./cross_trace_defaults":675,"./defaults":676,"./helpers":677,"./layout_attributes":679,"./layout_defaults":680,"./scales":681}],679:[function(_dereq_,module,exports){ +},{"./attributes":657,"./calc":658,"./cross_trace_defaults":659,"./defaults":660,"./helpers":661,"./layout_attributes":663,"./layout_defaults":664,"./scales":665}],663:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -144611,7 +146032,7 @@ module.exports = { })) }; -},{"../../lib/extend":793,"./attributes":673,"./scales":681}],680:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"./attributes":657,"./scales":665}],664:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -144654,7 +146075,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { } }; -},{"../../lib":803,"../../plot_api/plot_template":843,"./defaults":676,"./layout_attributes":679}],681:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"./defaults":660,"./layout_attributes":663}],665:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -144850,7 +146271,7 @@ module.exports = { isValid: isValidScale }; -},{"tinycolor2":598}],682:[function(_dereq_,module,exports){ +},{"tinycolor2":583}],666:[function(_dereq_,module,exports){ 'use strict'; @@ -144874,7 +146295,7 @@ module.exports = function align(v, dv, v0, v1, anchor) { return vc; }; -},{}],683:[function(_dereq_,module,exports){ +},{}],667:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -144903,7 +146324,7 @@ module.exports = function getCursor(x, y, xanchor, yanchor) { return cursorset[y][x]; }; -},{"../../lib":803}],684:[function(_dereq_,module,exports){ +},{"../../lib":787}],668:[function(_dereq_,module,exports){ 'use strict'; exports.selectMode = function(dragmode) { @@ -144954,7 +146375,7 @@ exports.selectingOrDrawing = function(dragmode) { ); }; -},{}],685:[function(_dereq_,module,exports){ +},{}],669:[function(_dereq_,module,exports){ 'use strict'; var mouseOffset = _dereq_('mouse-event-offset'); @@ -145238,7 +146659,7 @@ function pointerOffset(e) { ); } -},{"../../lib":803,"../../plots/cartesian/constants":861,"./align":682,"./cursor":683,"./unhover":686,"has-hover":443,"has-passive-events":444,"mouse-event-offset":471}],686:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/constants":845,"./align":666,"./cursor":667,"./unhover":670,"has-hover":435,"has-passive-events":436,"mouse-event-offset":460}],670:[function(_dereq_,module,exports){ 'use strict'; var Events = _dereq_('../../lib/events'); @@ -145285,7 +146706,7 @@ unhover.raw = function raw(gd, evt) { } }; -},{"../../lib/dom":791,"../../lib/events":792,"../../lib/throttle":830,"../fx/constants":700}],687:[function(_dereq_,module,exports){ +},{"../../lib/dom":775,"../../lib/events":776,"../../lib/throttle":814,"../fx/constants":684}],671:[function(_dereq_,module,exports){ 'use strict'; exports.dash = { @@ -145389,7 +146810,7 @@ exports.pattern = { ].join(' '), }; -},{}],688:[function(_dereq_,module,exports){ +},{}],672:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -146833,7 +148254,7 @@ drawing.setTextPointsScale = function(selection, xScale, yScale) { }); }; -},{"../../components/fx/helpers":702,"../../constants/alignment":771,"../../constants/interactions":778,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../lib/svg_text_utils":829,"../../registry":931,"../../traces/scatter/make_bubble_size_func":1235,"../../traces/scatter/subtypes":1243,"../color":666,"../colorscale":678,"./symbol_defs":689,"@plotly/d3":58,"fast-isnumeric":249,"tinycolor2":598}],689:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":686,"../../constants/alignment":755,"../../constants/interactions":762,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../lib/svg_text_utils":813,"../../registry":915,"../../traces/scatter/make_bubble_size_func":1219,"../../traces/scatter/subtypes":1227,"../color":650,"../colorscale":662,"./symbol_defs":673,"@plotly/d3":58,"fast-isnumeric":246,"tinycolor2":583}],673:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -147388,7 +148809,7 @@ module.exports = { } }; -},{"@plotly/d3":58}],690:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],674:[function(_dereq_,module,exports){ 'use strict'; @@ -147525,7 +148946,7 @@ module.exports = { } }; -},{}],691:[function(_dereq_,module,exports){ +},{}],675:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -147603,7 +149024,7 @@ function calcOneAxis(calcTrace, trace, axis, coord) { baseExtremes.max = baseExtremes.max.concat(extremes.max); } -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./compute_error":692,"fast-isnumeric":249}],692:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./compute_error":676,"fast-isnumeric":246}],676:[function(_dereq_,module,exports){ 'use strict'; @@ -147695,7 +149116,7 @@ function makeComputeErrorValue(type, value) { } } -},{}],693:[function(_dereq_,module,exports){ +},{}],677:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -147762,7 +149183,7 @@ module.exports = function(traceIn, traceOut, defaultColor, opts) { } }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../registry":931,"./attributes":690,"fast-isnumeric":249}],694:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../registry":915,"./attributes":674,"fast-isnumeric":246}],678:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -147823,7 +149244,7 @@ function hoverInfo(calcPoint, trace, hoverPoint) { } } -},{"../../lib":803,"../../plot_api/edit_types":836,"./attributes":690,"./calc":691,"./compute_error":692,"./defaults":693,"./plot":695,"./style":696}],695:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/edit_types":820,"./attributes":674,"./calc":675,"./compute_error":676,"./defaults":677,"./plot":679,"./style":680}],679:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -147986,7 +149407,7 @@ function errorCoords(d, xa, ya) { return out; } -},{"../../traces/scatter/subtypes":1243,"../drawing":688,"@plotly/d3":58,"fast-isnumeric":249}],696:[function(_dereq_,module,exports){ +},{"../../traces/scatter/subtypes":1227,"../drawing":672,"@plotly/d3":58,"fast-isnumeric":246}],680:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -148014,7 +149435,7 @@ module.exports = function style(traces) { }); }; -},{"../color":666,"@plotly/d3":58}],697:[function(_dereq_,module,exports){ +},{"../color":650,"@plotly/d3":58}],681:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -148042,7 +149463,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/font_attributes":883,"./layout_attributes":707}],698:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/font_attributes":867,"./layout_attributes":691}],682:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -148093,7 +149514,7 @@ function paste(traceAttr, cd, cdAttr, fn) { } } -},{"../../lib":803,"../../registry":931}],699:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],683:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -148122,7 +149543,7 @@ module.exports = function click(gd, evt, subplot) { } }; -},{"../../registry":931,"./hover":703}],700:[function(_dereq_,module,exports){ +},{"../../registry":915,"./hover":687}],684:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -148146,7 +149567,7 @@ module.exports = { HOVERID: '-hover' }; -},{}],701:[function(_dereq_,module,exports){ +},{}],685:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -148164,7 +149585,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleHoverLabelDefaults(traceIn, traceOut, coerce, opts); }; -},{"../../lib":803,"./attributes":697,"./hoverlabel_defaults":704}],702:[function(_dereq_,module,exports){ +},{"../../lib":787,"./attributes":681,"./hoverlabel_defaults":688}],686:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -148418,7 +149839,7 @@ exports.isXYhover = function(hovermode) { return !!xyHoverMode[hovermode]; }; -},{"../../lib":803}],703:[function(_dereq_,module,exports){ +},{"../../lib":787}],687:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -149312,7 +150733,7 @@ function createHoverText(hoverData, opts) { var ya = c0.ya; var axLetter = hovermode.charAt(0); var t0 = c0[axLetter + 'Label']; - var outerContainerBB = outerContainer.getBoundingClientRect(); + var outerContainerBB = getBoundingClientRect(gd, outerContainer); var outerTop = outerContainerBB.top; var outerWidth = outerContainerBB.width; var outerHeight = outerContainerBB.height; @@ -149387,7 +150808,7 @@ function createHoverText(hoverData, opts) { label.attr('transform', ''); - var tbb = ltext.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, ltext.node()); var lx, ly; if(hovermode === 'x') { @@ -149480,7 +150901,7 @@ function createHoverText(hoverData, opts) { var dummy = Drawing.tester.append('text') .text(s.text()) .call(Drawing.font, commonLabelFont); - var dummyBB = dummy.node().getBoundingClientRect(); + var dummyBB = getBoundingClientRect(gd, dummy.node()); if(Math.round(dummyBB.width) < Math.round(tbb.width)) { s.attr('x', ltx - dummyBB.width); } @@ -149569,7 +150990,7 @@ function createHoverText(hoverData, opts) { // Position the hover var legendContainer = container.select('g.legend'); - var tbb = legendContainer.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, legendContainer.node()); var tWidth = tbb.width + 2 * HOVERTEXTPAD; var tHeight = tbb.height + 2 * HOVERTEXTPAD; var winningPoint = hoverData[0]; @@ -149734,7 +151155,7 @@ function createHoverText(hoverData, opts) { .call(svgTextUtils.positionText, 0, 0) .call(svgTextUtils.convertToTspans, gd); - var t2bb = tx2.node().getBoundingClientRect(); + var t2bb = getBoundingClientRect(gd, tx2.node()); tx2width = t2bb.width + 2 * HOVERTEXTPAD; tx2height = t2bb.height + 2 * HOVERTEXTPAD; } else { @@ -149747,22 +151168,26 @@ function createHoverText(hoverData, opts) { stroke: contrastColor }); - var tbb = tx.node().getBoundingClientRect(); var htx = d.xa._offset + (d.x0 + d.x1) / 2; var hty = d.ya._offset + (d.y0 + d.y1) / 2; var dx = Math.abs(d.x1 - d.x0); var dy = Math.abs(d.y1 - d.y0); - var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width; - var anchorStartOK, anchorEndOK; - d.ty0 = outerTop - tbb.top; - d.bx = tbb.width + 2 * HOVERTEXTPAD; - d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height); + var tbb = getBoundingClientRect(gd, tx.node()); + var tbbWidth = tbb.width / fullLayout._invScaleX; + var tbbHeight = tbb.height / fullLayout._invScaleY; + + d.ty0 = (outerTop - tbb.top) / fullLayout._invScaleY; + d.bx = tbbWidth + 2 * HOVERTEXTPAD; + d.by = Math.max(tbbHeight + 2 * HOVERTEXTPAD, tx2height); d.anchor = 'start'; - d.txwidth = tbb.width; + d.txwidth = tbbWidth; d.tx2width = tx2width; d.offset = 0; + var txTotalWidth = (tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width) * fullLayout._invScaleX; + var anchorStartOK, anchorEndOK; + if(rotateLabels) { d.pos = htx; anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight; @@ -150522,7 +151947,37 @@ function getCoord(axLetter, winningPoint, fullLayout) { function getTopOffset(gd) { return gd.offsetTop + gd.clientTop; } function getLeftOffset(gd) { return gd.offsetLeft + gd.clientLeft; } -},{"../../lib":803,"../../lib/events":792,"../../lib/override_cursor":814,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../legend/defaults":718,"../legend/draw":719,"./constants":700,"./helpers":702,"@plotly/d3":58,"fast-isnumeric":249,"tinycolor2":598}],704:[function(_dereq_,module,exports){ +function getBoundingClientRect(gd, node) { + var fullLayout = gd._fullLayout; + + var rect = node.getBoundingClientRect(); + + var x0 = rect.x; + var y0 = rect.y; + var x1 = x0 + rect.width; + var y1 = y0 + rect.height; + + var A = Lib.apply3DTransform(fullLayout._invTransform)(x0, y0); + var B = Lib.apply3DTransform(fullLayout._invTransform)(x1, y1); + + var Ax = A[0]; + var Ay = A[1]; + var Bx = B[0]; + var By = B[1]; + + return { + x: Ax, + y: Ay, + width: Bx - Ax, + height: By - Ay, + top: Math.min(Ay, By), + left: Math.min(Ax, Bx), + right: Math.max(Ax, Bx), + bottom: Math.max(Ay, By), + }; +} + +},{"../../lib":787,"../../lib/events":776,"../../lib/override_cursor":798,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../legend/defaults":702,"../legend/draw":703,"./constants":684,"./helpers":686,"@plotly/d3":58,"fast-isnumeric":246,"tinycolor2":583}],688:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150560,7 +152015,7 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts coerce('hoverlabel.align', opts.align); }; -},{"../../lib":803,"../color":666,"./helpers":702}],705:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"./helpers":686}],689:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150578,7 +152033,7 @@ module.exports = function handleHoverModeDefaults(layoutIn, layoutOut) { return coerce('hovermode'); }; -},{"../../lib":803,"./layout_attributes":707}],706:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":691}],690:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -150649,7 +152104,7 @@ function castHoverinfo(trace, fullLayout, ptNumber) { return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce); } -},{"../../lib":803,"../dragelement":685,"./attributes":697,"./calc":698,"./click":699,"./constants":700,"./defaults":701,"./helpers":702,"./hover":703,"./layout_attributes":707,"./layout_defaults":708,"./layout_global_defaults":709,"@plotly/d3":58}],707:[function(_dereq_,module,exports){ +},{"../../lib":787,"../dragelement":669,"./attributes":681,"./calc":682,"./click":683,"./constants":684,"./defaults":685,"./helpers":686,"./hover":687,"./layout_attributes":691,"./layout_defaults":692,"./layout_global_defaults":693,"@plotly/d3":58}],691:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -150810,7 +152265,7 @@ module.exports = { } }; -},{"../../plots/font_attributes":883,"./constants":700}],708:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":867,"./constants":684}],692:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150849,7 +152304,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":803,"./hoverlabel_defaults":704,"./hovermode_defaults":705,"./layout_attributes":707}],709:[function(_dereq_,module,exports){ +},{"../../lib":787,"./hoverlabel_defaults":688,"./hovermode_defaults":689,"./layout_attributes":691}],693:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150864,7 +152319,7 @@ module.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":803,"./hoverlabel_defaults":704,"./layout_attributes":707}],710:[function(_dereq_,module,exports){ +},{"../../lib":787,"./hoverlabel_defaults":688,"./layout_attributes":691}],694:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -151277,7 +152732,7 @@ module.exports = { contentDefaults: contentDefaults }; -},{"../../lib":803,"../../lib/regex":820,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861,"../../plots/domain":882}],711:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/regex":804,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845,"../../plots/domain":866}],695:[function(_dereq_,module,exports){ 'use strict'; var cartesianConstants = _dereq_('../../plots/cartesian/constants'); @@ -151435,7 +152890,7 @@ module.exports = templatedArray('image', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":772,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861}],712:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":756,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845}],696:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -151507,7 +152962,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":831,"fast-isnumeric":249}],713:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":815,"fast-isnumeric":246}],697:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -151564,7 +153019,7 @@ function imageDefaults(imageIn, imageOut, fullLayout) { return imageOut; } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"./attributes":711}],714:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"./attributes":695}],698:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -151814,7 +153269,7 @@ module.exports = function draw(gd) { } }; -},{"../../constants/xmlns_namespaces":780,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_ids":858,"../drawing":688,"@plotly/d3":58}],715:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":764,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_ids":842,"../drawing":672,"@plotly/d3":58}],699:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -151830,7 +153285,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":867,"./attributes":711,"./convert_coords":712,"./defaults":713,"./draw":714}],716:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":851,"./attributes":695,"./convert_coords":696,"./defaults":697,"./draw":698}],700:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -152053,7 +153508,7 @@ module.exports = { editType: 'legend' }; -},{"../../plots/font_attributes":883,"../color/attributes":665}],717:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":867,"../color/attributes":649}],701:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -152069,7 +153524,7 @@ module.exports = { itemGap: 5 }; -},{}],718:[function(_dereq_,module,exports){ +},{}],702:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -152202,7 +153657,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/layout_attributes":908,"../../registry":931,"./attributes":716,"./helpers":722}],719:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/layout_attributes":892,"../../registry":915,"./attributes":700,"./helpers":706}],703:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -153027,7 +154482,7 @@ function getYanchor(legendObj) { 'top'; } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/events":792,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"./constants":717,"./get_legend_data":720,"./handle_click":721,"./helpers":722,"./style":724,"@plotly/d3":58}],720:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/events":776,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"./constants":701,"./get_legend_data":704,"./handle_click":705,"./helpers":706,"./style":708,"@plotly/d3":58}],704:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -153203,7 +154658,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../registry":931,"./helpers":722}],721:[function(_dereq_,module,exports){ +},{"../../registry":915,"./helpers":706}],705:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -153445,7 +154900,7 @@ module.exports = function handleClick(g, gd, numClicks) { } }; -},{"../../lib":803,"../../registry":931}],722:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],706:[function(_dereq_,module,exports){ 'use strict'; exports.isGrouped = function isGrouped(legendLayout) { @@ -153460,7 +154915,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{}],723:[function(_dereq_,module,exports){ +},{}],707:[function(_dereq_,module,exports){ 'use strict'; @@ -153475,7 +154930,7 @@ module.exports = { style: _dereq_('./style') }; -},{"./attributes":716,"./defaults":718,"./draw":719,"./style":724}],724:[function(_dereq_,module,exports){ +},{"./attributes":700,"./defaults":702,"./draw":703,"./style":708}],708:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -154162,7 +155617,7 @@ function dimAttr(v, dflt, max) { return v; } -},{"../../lib":803,"../../registry":931,"../../traces/pie/helpers":1197,"../../traces/pie/style_one":1203,"../../traces/scatter/subtypes":1243,"../color":666,"../colorscale/helpers":677,"../drawing":688,"./constants":717,"@plotly/d3":58}],725:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../../traces/pie/helpers":1181,"../../traces/pie/style_one":1187,"../../traces/scatter/subtypes":1227,"../color":650,"../colorscale/helpers":661,"../drawing":672,"./constants":701,"@plotly/d3":58}],709:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -154227,7 +155682,7 @@ module.exports = { } }; -},{"./constants":727}],726:[function(_dereq_,module,exports){ +},{"./constants":711}],710:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -154979,7 +156434,7 @@ function resetView(gd, subplotType) { Registry.call('_guiRelayout', gd, aObj); } -},{"../../fonts/ploticon":782,"../../lib":803,"../../plots/cartesian/axis_ids":858,"../../plots/plots":917,"../../registry":931,"../shapes/draw":750}],727:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":766,"../../lib":787,"../../plots/cartesian/axis_ids":842,"../../plots/plots":901,"../../registry":915,"../shapes/draw":734}],711:[function(_dereq_,module,exports){ 'use strict'; var modeBarButtons = _dereq_('./buttons'); @@ -155022,7 +156477,7 @@ module.exports = { foreButtons: foreButtons }; -},{"./buttons":726}],728:[function(_dereq_,module,exports){ +},{"./buttons":710}],712:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -155048,7 +156503,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('remove'); }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../color":666,"./attributes":725}],729:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../color":650,"./attributes":709}],713:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -155061,7 +156516,7 @@ module.exports = { manage: _dereq_('./manage') }; -},{"./attributes":725,"./defaults":728,"./manage":730}],730:[function(_dereq_,module,exports){ +},{"./attributes":709,"./defaults":712,"./manage":714}],714:[function(_dereq_,module,exports){ 'use strict'; var axisIds = _dereq_('../../plots/cartesian/axis_ids'); @@ -155416,7 +156871,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plots/cartesian/axis_ids":858,"../../registry":931,"../../traces/scatter/subtypes":1243,"../fx/helpers":702,"./buttons":726,"./constants":727,"./modebar":731}],731:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axis_ids":842,"../../registry":915,"../../traces/scatter/subtypes":1227,"../fx/helpers":686,"./buttons":710,"./constants":711,"./modebar":715}],715:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -155753,7 +157208,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../fonts/ploticon":782,"../../lib":803,"@plotly/d3":58,"fast-isnumeric":249}],732:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":766,"../../lib":787,"@plotly/d3":58,"fast-isnumeric":246}],716:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -155899,7 +157354,7 @@ module.exports = { editType: 'plot' }; -},{"../../plot_api/plot_template":843,"../../plots/font_attributes":883,"../color/attributes":665}],733:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":827,"../../plots/font_attributes":867,"../color/attributes":649}],717:[function(_dereq_,module,exports){ 'use strict'; @@ -155920,7 +157375,7 @@ module.exports = { darkAmount: 10 }; -},{}],734:[function(_dereq_,module,exports){ +},{}],718:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -156004,7 +157459,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../color":666,"./attributes":732,"./constants":733}],735:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../color":650,"./attributes":716,"./constants":717}],719:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -156251,7 +157706,7 @@ function reposition(gd, buttons, opts, axName, selector) { selector.attr('transform', strTranslate(lx, ly)); } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axis_ids":858,"../../plots/plots":917,"../../registry":931,"../color":666,"../drawing":688,"./constants":733,"./get_update_object":736,"@plotly/d3":58}],736:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axis_ids":842,"../../plots/plots":901,"../../registry":915,"../color":650,"../drawing":672,"./constants":717,"./get_update_object":720,"@plotly/d3":58}],720:[function(_dereq_,module,exports){ 'use strict'; var d3Time = _dereq_('d3-time'); @@ -156300,7 +157755,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"../../lib":803,"d3-time":177}],737:[function(_dereq_,module,exports){ +},{"../../lib":787,"d3-time":174}],721:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -156319,7 +157774,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":732,"./defaults":734,"./draw":735}],738:[function(_dereq_,module,exports){ +},{"./attributes":716,"./defaults":718,"./draw":719}],722:[function(_dereq_,module,exports){ 'use strict'; var colorAttributes = _dereq_('../color/attributes'); @@ -156399,7 +157854,7 @@ module.exports = { editType: 'calc' }; -},{"../color/attributes":665}],739:[function(_dereq_,module,exports){ +},{"../color/attributes":649}],723:[function(_dereq_,module,exports){ 'use strict'; var listAxes = _dereq_('../../plots/cartesian/axis_ids').list; @@ -156425,7 +157880,7 @@ module.exports = function calcAutorange(gd) { } }; -},{"../../plots/cartesian/autorange":853,"../../plots/cartesian/axis_ids":858,"./constants":740}],740:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/autorange":837,"../../plots/cartesian/axis_ids":842,"./constants":724}],724:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -156473,7 +157928,7 @@ module.exports = { extraPad: 15 }; -},{}],741:[function(_dereq_,module,exports){ +},{}],725:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -156551,7 +158006,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName) { containerOut._input = containerIn; }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_ids":858,"./attributes":738,"./oppaxis_attributes":745}],742:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_ids":842,"./attributes":722,"./oppaxis_attributes":729}],726:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -157187,7 +158642,7 @@ function drawGrabbers(rangeSlider, gd, axisOpts, opts) { grabAreaMax.attr('height', opts._height); } -},{"../../lib":803,"../../lib/setcursor":824,"../../plots/cartesian":868,"../../plots/cartesian/axis_ids":858,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../titles":764,"./constants":740,"@plotly/d3":58}],743:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/setcursor":808,"../../plots/cartesian":852,"../../plots/cartesian/axis_ids":842,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../titles":748,"./constants":724,"@plotly/d3":58}],727:[function(_dereq_,module,exports){ 'use strict'; var axisIDs = _dereq_('../../plots/cartesian/axis_ids'); @@ -157254,7 +158709,7 @@ exports.autoMarginOpts = function(gd, ax) { }; }; -},{"../../constants/alignment":771,"../../lib/svg_text_utils":829,"../../plots/cartesian/axis_ids":858,"./constants":740}],744:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib/svg_text_utils":813,"../../plots/cartesian/axis_ids":842,"./constants":724}],728:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -157285,7 +158740,7 @@ module.exports = { autoMarginOpts: helpers.autoMarginOpts }; -},{"../../lib":803,"./attributes":738,"./calc_autorange":739,"./defaults":741,"./draw":742,"./helpers":743,"./oppaxis_attributes":745}],745:[function(_dereq_,module,exports){ +},{"../../lib":787,"./attributes":722,"./calc_autorange":723,"./defaults":725,"./draw":726,"./helpers":727,"./oppaxis_attributes":729}],729:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -157322,7 +158777,7 @@ module.exports = { editType: 'calc' }; -},{}],746:[function(_dereq_,module,exports){ +},{}],730:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -157557,7 +159012,7 @@ module.exports = templatedArray('shape', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":772,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../traces/scatter/attributes":1218,"../annotations/attributes":649,"../drawing/attributes":687}],747:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":756,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../traces/scatter/attributes":1202,"../annotations/attributes":633,"../drawing/attributes":671}],731:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -157669,7 +159124,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./constants":748,"./helpers":757}],748:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./constants":732,"./helpers":741}],732:[function(_dereq_,module,exports){ 'use strict'; @@ -157724,7 +159179,7 @@ module.exports = { } }; -},{}],749:[function(_dereq_,module,exports){ +},{}],733:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -157846,7 +159301,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"./attributes":746,"./helpers":757}],750:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"./attributes":730,"./helpers":741}],734:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -158611,7 +160066,7 @@ function eraseActiveShape(gd) { } } -},{"../../lib":803,"../../lib/setcursor":824,"../../plot_api/plot_template":843,"../../plots/cartesian/axes":854,"../../plots/cartesian/handle_outline":865,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"./constants":748,"./draw_newshape/display_outlines":754,"./draw_newshape/helpers":755,"./helpers":757}],751:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/setcursor":808,"../../plot_api/plot_template":827,"../../plots/cartesian/axes":838,"../../plots/cartesian/handle_outline":849,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"./constants":732,"./draw_newshape/display_outlines":738,"./draw_newshape/helpers":739,"./helpers":741}],735:[function(_dereq_,module,exports){ 'use strict'; var dash = _dereq_('../../drawing/attributes').dash; @@ -158715,7 +160170,7 @@ module.exports = { } }; -},{"../../../lib/extend":793,"../../drawing/attributes":687}],752:[function(_dereq_,module,exports){ +},{"../../../lib/extend":777,"../../drawing/attributes":671}],736:[function(_dereq_,module,exports){ 'use strict'; var CIRCLE_SIDES = 32; // should be divisible by 4 @@ -158731,7 +160186,7 @@ module.exports = { SQRT2: Math.sqrt(2) }; -},{}],753:[function(_dereq_,module,exports){ +},{}],737:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../color'); @@ -158754,7 +160209,7 @@ module.exports = function supplyDrawNewShapeDefaults(layoutIn, layoutOut, coerce coerce('activeshape.opacity'); }; -},{"../../color":666}],754:[function(_dereq_,module,exports){ +},{"../../color":650}],738:[function(_dereq_,module,exports){ 'use strict'; var dragElement = _dereq_('../../dragelement'); @@ -159040,7 +160495,7 @@ function recordPositions(polygonsOut, polygonsIn) { return polygonsOut; } -},{"../../../plots/cartesian/handle_outline":865,"../../../registry":931,"../../dragelement":685,"../../dragelement/helpers":684,"./constants":752,"./helpers":755,"./newshapes":756}],755:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":849,"../../../registry":915,"../../dragelement":669,"../../dragelement/helpers":668,"./constants":736,"./helpers":739,"./newshapes":740}],739:[function(_dereq_,module,exports){ 'use strict'; var parseSvgPath = _dereq_('parse-svg-path'); @@ -159369,7 +160824,7 @@ exports.ellipseOver = function(pos) { }; }; -},{"../../../plots/cartesian/helpers":866,"./constants":752,"parse-svg-path":493}],756:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/helpers":850,"./constants":736,"parse-svg-path":482}],740:[function(_dereq_,module,exports){ 'use strict'; var dragHelpers = _dereq_('../../dragelement/helpers'); @@ -159619,7 +161074,7 @@ function fixDatesForPaths(polygons, xaxis, yaxis) { return polygons; } -},{"../../../plots/cartesian/handle_outline":865,"../../../plots/cartesian/helpers":866,"../../dragelement/helpers":684,"./constants":752,"./helpers":755}],757:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":849,"../../../plots/cartesian/helpers":850,"../../dragelement/helpers":668,"./constants":736,"./helpers":739}],741:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -159768,7 +161223,7 @@ exports.makeOptionsAndPlotinfo = function(gd, index) { }; }; -},{"../../lib":803,"./constants":748}],758:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constants":732}],742:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -159787,7 +161242,7 @@ module.exports = { drawOne: drawModule.drawOne }; -},{"../../plots/cartesian/include_components":867,"./attributes":746,"./calc_autorange":747,"./defaults":749,"./draw":750,"./draw_newshape/defaults":753}],759:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":851,"./attributes":730,"./calc_autorange":731,"./defaults":733,"./draw":734,"./draw_newshape/defaults":737}],743:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -160045,7 +161500,7 @@ module.exports = overrideAll(templatedArray('slider', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/animation_attributes":848,"../../plots/font_attributes":883,"../../plots/pad_attributes":916,"./constants":760}],760:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/animation_attributes":832,"../../plots/font_attributes":867,"../../plots/pad_attributes":900,"./constants":744}],744:[function(_dereq_,module,exports){ 'use strict'; @@ -160130,7 +161585,7 @@ module.exports = { currentValueInset: 0, }; -},{}],761:[function(_dereq_,module,exports){ +},{}],745:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -160237,7 +161692,7 @@ function stepDefaults(valueIn, valueOut) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"./attributes":759,"./constants":760}],762:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"./attributes":743,"./constants":744}],746:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -160871,7 +162326,7 @@ function drawRail(sliderGroup, sliderOpts) { ); } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_template":843,"../../plots/plots":917,"../color":666,"../drawing":688,"./constants":760,"@plotly/d3":58}],763:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_template":827,"../../plots/plots":901,"../color":650,"../drawing":672,"./constants":744,"@plotly/d3":58}],747:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -160886,7 +162341,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":759,"./constants":760,"./defaults":761,"./draw":762}],764:[function(_dereq_,module,exports){ +},{"./attributes":743,"./constants":744,"./defaults":745,"./draw":746}],748:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -161145,7 +162600,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":771,"../../constants/interactions":778,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"../color":666,"../drawing":688,"@plotly/d3":58,"fast-isnumeric":249}],765:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../constants/interactions":762,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"../color":650,"../drawing":672,"@plotly/d3":58,"fast-isnumeric":246}],749:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -161329,7 +162784,7 @@ module.exports = overrideAll(templatedArray('updatemenu', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/font_attributes":883,"../../plots/pad_attributes":916,"../color/attributes":665}],766:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/font_attributes":867,"../../plots/pad_attributes":900,"../color/attributes":649}],750:[function(_dereq_,module,exports){ 'use strict'; @@ -161401,7 +162856,7 @@ module.exports = { } }; -},{}],767:[function(_dereq_,module,exports){ +},{}],751:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -161476,7 +162931,7 @@ function buttonDefaults(buttonIn, buttonOut) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"./attributes":765,"./constants":766}],768:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"./attributes":749,"./constants":750}],752:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -162118,9 +163573,9 @@ function removeAllButtons(gButton, newMenuIndexAttr) { .selectAll('g.' + constants.dropdownButtonClassName).remove(); } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_template":843,"../../plots/plots":917,"../color":666,"../drawing":688,"./constants":766,"./scrollbox":770,"@plotly/d3":58}],769:[function(_dereq_,module,exports){ -arguments[4][763][0].apply(exports,arguments) -},{"./attributes":765,"./constants":766,"./defaults":767,"./draw":768,"dup":763}],770:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_template":827,"../../plots/plots":901,"../color":650,"../drawing":672,"./constants":750,"./scrollbox":754,"@plotly/d3":58}],753:[function(_dereq_,module,exports){ +arguments[4][747][0].apply(exports,arguments) +},{"./attributes":749,"./constants":750,"./defaults":751,"./draw":752,"dup":747}],754:[function(_dereq_,module,exports){ 'use strict'; module.exports = ScrollBox; @@ -162577,7 +164032,7 @@ ScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) } }; -},{"../../lib":803,"../color":666,"../drawing":688,"@plotly/d3":58}],771:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"../drawing":672,"@plotly/d3":58}],755:[function(_dereq_,module,exports){ 'use strict'; // fraction of some size to get to a named position @@ -162634,7 +164089,7 @@ module.exports = { } }; -},{}],772:[function(_dereq_,module,exports){ +},{}],756:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -162657,7 +164112,7 @@ module.exports = { } }; -},{}],773:[function(_dereq_,module,exports){ +},{}],757:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -162671,7 +164126,7 @@ module.exports = { } }; -},{}],774:[function(_dereq_,module,exports){ +},{}],758:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -162679,7 +164134,7 @@ module.exports = { DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format' }; -},{}],775:[function(_dereq_,module,exports){ +},{}],759:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -162709,7 +164164,7 @@ module.exports = { } }; -},{}],776:[function(_dereq_,module,exports){ +},{}],760:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -162721,7 +164176,7 @@ module.exports = { longdashdot: [[0.5, 0.7, 0.8, 1], 10] }; -},{}],777:[function(_dereq_,module,exports){ +},{}],761:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -162735,7 +164190,7 @@ module.exports = { x: '❌' }; -},{}],778:[function(_dereq_,module,exports){ +},{}],762:[function(_dereq_,module,exports){ 'use strict'; @@ -162750,7 +164205,7 @@ module.exports = { DESELECTDIM: 0.2 }; -},{}],779:[function(_dereq_,module,exports){ +},{}],763:[function(_dereq_,module,exports){ 'use strict'; @@ -162815,7 +164270,7 @@ module.exports = { MINUS_SIGN: '\u2212' }; -},{}],780:[function(_dereq_,module,exports){ +},{}],764:[function(_dereq_,module,exports){ 'use strict'; @@ -162830,7 +164285,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],781:[function(_dereq_,module,exports){ +},{}],765:[function(_dereq_,module,exports){ 'use strict'; exports.version = _dereq_('./version').version; @@ -162914,7 +164369,7 @@ exports.Fx = { exports.Snapshot = _dereq_('./snapshot'); exports.PlotSchema = _dereq_('./plot_api/plot_schema'); -},{"../build/plotcss":1,"./components/annotations":657,"./components/annotations3d":662,"./components/colorbar":672,"./components/colorscale":678,"./components/errorbars":694,"./components/fx":706,"./components/grid":710,"./components/images":715,"./components/legend":723,"./components/modebar":729,"./components/rangeselector":737,"./components/rangeslider":744,"./components/shapes":758,"./components/sliders":763,"./components/updatemenus":769,"./fonts/ploticon":782,"./locale-en":834,"./locale-en-us":833,"./plot_api":838,"./plot_api/plot_schema":842,"./plots/plots":917,"./registry":931,"./snapshot":936,"./traces/scatter":1230,"./version":1404,"native-promise-only":474}],782:[function(_dereq_,module,exports){ +},{"../build/plotcss":1,"./components/annotations":641,"./components/annotations3d":646,"./components/colorbar":656,"./components/colorscale":662,"./components/errorbars":678,"./components/fx":690,"./components/grid":694,"./components/images":699,"./components/legend":707,"./components/modebar":713,"./components/rangeselector":721,"./components/rangeslider":728,"./components/shapes":742,"./components/sliders":747,"./components/updatemenus":753,"./fonts/ploticon":766,"./locale-en":818,"./locale-en-us":817,"./plot_api":822,"./plot_api/plot_schema":826,"./plots/plots":901,"./registry":915,"./snapshot":920,"./traces/scatter":1214,"./version":1388,"native-promise-only":463}],766:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -163086,7 +164541,7 @@ module.exports = { } }; -},{}],783:[function(_dereq_,module,exports){ +},{}],767:[function(_dereq_,module,exports){ 'use strict'; @@ -163141,7 +164596,7 @@ exports.isBottomAnchor = function isBottomAnchor(opts) { ); }; -},{}],784:[function(_dereq_,module,exports){ +},{}],768:[function(_dereq_,module,exports){ 'use strict'; var modModule = _dereq_('./mod'); @@ -163374,7 +164829,7 @@ module.exports = { pathAnnulus: pathAnnulus }; -},{"./mod":810}],785:[function(_dereq_,module,exports){ +},{"./mod":794}],769:[function(_dereq_,module,exports){ 'use strict'; var isArray = Array.isArray; @@ -163516,7 +164971,7 @@ function _rowLength(z, fn, len0) { return 0; } -},{}],786:[function(_dereq_,module,exports){ +},{}],770:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -163540,7 +164995,7 @@ module.exports = function cleanNumber(v) { return BADNUM; }; -},{"../constants/numerical":779,"fast-isnumeric":249}],787:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"fast-isnumeric":246}],771:[function(_dereq_,module,exports){ 'use strict'; /** @@ -163560,7 +165015,7 @@ module.exports = function clearGlCanvases(gd) { } }; -},{}],788:[function(_dereq_,module,exports){ +},{}],772:[function(_dereq_,module,exports){ 'use strict'; /** @@ -163575,7 +165030,7 @@ module.exports = function clearResponsive(gd) { } }; -},{}],789:[function(_dereq_,module,exports){ +},{}],773:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -164115,7 +165570,7 @@ function validate(value, opts) { } exports.validate = validate; -},{"../components/color":666,"../components/colorscale/scales":681,"../constants/interactions":778,"../plots/attributes":850,"./array":785,"./mod":810,"./nested_property":811,"./regex":820,"fast-isnumeric":249,"tinycolor2":598}],790:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/colorscale/scales":665,"../constants/interactions":762,"../plots/attributes":834,"./array":769,"./mod":794,"./nested_property":795,"./regex":804,"fast-isnumeric":246,"tinycolor2":583}],774:[function(_dereq_,module,exports){ 'use strict'; var timeFormat = _dereq_('d3-time-format').timeFormat; @@ -164719,7 +166174,7 @@ exports.findExactDates = function(data, calendar) { }; }; -},{"../constants/numerical":779,"../registry":931,"./loggers":807,"./mod":810,"d3-time-format":175,"fast-isnumeric":249}],791:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"../registry":915,"./loggers":791,"./mod":794,"d3-time-format":172,"fast-isnumeric":246}],775:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -164889,7 +166344,7 @@ module.exports = { equalDomRects: equalDomRects }; -},{"./loggers":807,"./matrix":809,"@plotly/d3":58,"gl-mat4":298}],792:[function(_dereq_,module,exports){ +},{"./loggers":791,"./matrix":793,"@plotly/d3":58,"gl-mat4":292}],776:[function(_dereq_,module,exports){ 'use strict'; /* global jQuery:false */ @@ -165053,7 +166508,7 @@ var Events = { module.exports = Events; -},{"events":116}],793:[function(_dereq_,module,exports){ +},{"events":116}],777:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('./is_plain_object.js'); @@ -165158,7 +166613,7 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { return target; } -},{"./is_plain_object.js":804}],794:[function(_dereq_,module,exports){ +},{"./is_plain_object.js":788}],778:[function(_dereq_,module,exports){ 'use strict'; @@ -165200,7 +166655,7 @@ module.exports = function filterUnique(array) { return out; }; -},{}],795:[function(_dereq_,module,exports){ +},{}],779:[function(_dereq_,module,exports){ 'use strict'; /** Filter out object items with visible !== true @@ -165240,7 +166695,7 @@ function isCalcData(cont) { ); } -},{}],796:[function(_dereq_,module,exports){ +},{}],780:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -165617,7 +167072,7 @@ module.exports = { computeBbox: computeBbox }; -},{"./identity":801,"./is_plain_object":804,"./loggers":807,"./nested_property":811,"./polygon":815,"@plotly/d3":58,"@turf/area":61,"@turf/bbox":64,"@turf/centroid":67,"country-regex":145}],797:[function(_dereq_,module,exports){ +},{"./identity":785,"./is_plain_object":788,"./loggers":791,"./nested_property":795,"./polygon":799,"@plotly/d3":58,"@turf/area":61,"@turf/bbox":64,"@turf/centroid":67,"country-regex":145}],781:[function(_dereq_,module,exports){ 'use strict'; var BADNUM = _dereq_('../constants/numerical').BADNUM; @@ -165725,7 +167180,7 @@ exports.makeBlank = function() { }; }; -},{"../constants/numerical":779}],798:[function(_dereq_,module,exports){ +},{"../constants/numerical":763}],782:[function(_dereq_,module,exports){ 'use strict'; var mod = _dereq_('./mod').mod; @@ -165961,7 +167416,7 @@ exports.findPointOnPath = function findPointOnPath(path, val, coord, opts) { return pt; }; -},{"./mod":810}],799:[function(_dereq_,module,exports){ +},{"./mod":794}],783:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -166054,7 +167509,7 @@ module.exports = { parseColorScale: parseColorScale }; -},{"../components/color/attributes":665,"../components/colorscale":678,"./array":785,"color-normalize":131,"fast-isnumeric":249,"tinycolor2":598}],800:[function(_dereq_,module,exports){ +},{"../components/color/attributes":649,"../components/colorscale":662,"./array":769,"color-normalize":131,"fast-isnumeric":246,"tinycolor2":583}],784:[function(_dereq_,module,exports){ 'use strict'; var identity = _dereq_('./identity'); @@ -166082,7 +167537,7 @@ module.exports = { unwrap: function(d) {return d[0];} }; -},{"./identity":801}],801:[function(_dereq_,module,exports){ +},{"./identity":785}],785:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -166090,7 +167545,7 @@ module.exports = { module.exports = function identity(d) { return d; }; -},{}],802:[function(_dereq_,module,exports){ +},{}],786:[function(_dereq_,module,exports){ 'use strict'; module.exports = function incrementNumeric(x, delta) { @@ -166123,7 +167578,7 @@ module.exports = function incrementNumeric(x, delta) { return newX; }; -},{}],803:[function(_dereq_,module,exports){ +},{}],787:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -167511,7 +168966,7 @@ lib.getPositionFromD3Event = function() { } }; -},{"../constants/numerical":779,"./anchor_utils":783,"./angles":784,"./array":785,"./clean_number":786,"./clear_responsive":788,"./coerce":789,"./dates":790,"./dom":791,"./extend":793,"./filter_unique":794,"./filter_visible":795,"./geometry2d":798,"./identity":801,"./increment":802,"./is_plain_object":804,"./keyed_container":805,"./localize":806,"./loggers":807,"./make_trace_groups":808,"./matrix":809,"./mod":810,"./nested_property":811,"./noop":812,"./notifier":813,"./preserve_drawing_buffer":817,"./push_unique":818,"./regex":820,"./relative_attr":821,"./relink_private":822,"./search":823,"./sort_object_keys":826,"./stats":827,"./throttle":830,"./to_log_range":831,"@plotly/d3":58,"d3-format":167,"d3-time-format":175,"fast-isnumeric":249}],804:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"./anchor_utils":767,"./angles":768,"./array":769,"./clean_number":770,"./clear_responsive":772,"./coerce":773,"./dates":774,"./dom":775,"./extend":777,"./filter_unique":778,"./filter_visible":779,"./geometry2d":782,"./identity":785,"./increment":786,"./is_plain_object":788,"./keyed_container":789,"./localize":790,"./loggers":791,"./make_trace_groups":792,"./matrix":793,"./mod":794,"./nested_property":795,"./noop":796,"./notifier":797,"./preserve_drawing_buffer":801,"./push_unique":802,"./regex":804,"./relative_attr":805,"./relink_private":806,"./search":807,"./sort_object_keys":810,"./stats":811,"./throttle":814,"./to_log_range":815,"@plotly/d3":58,"d3-format":164,"d3-time-format":172,"fast-isnumeric":246}],788:[function(_dereq_,module,exports){ 'use strict'; // more info: http://stackoverflow.com/questions/18531624/isplainobject-thing @@ -167530,7 +168985,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],805:[function(_dereq_,module,exports){ +},{}],789:[function(_dereq_,module,exports){ 'use strict'; var nestedProperty = _dereq_('./nested_property'); @@ -167715,7 +169170,7 @@ module.exports = function keyedContainer(baseObj, path, keyName, valueName) { return obj; }; -},{"./nested_property":811}],806:[function(_dereq_,module,exports){ +},{"./nested_property":795}],790:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -167762,7 +169217,7 @@ module.exports = function localize(gd, s) { return s; }; -},{"../registry":931}],807:[function(_dereq_,module,exports){ +},{"../registry":915}],791:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-console */ @@ -167839,7 +169294,7 @@ loggers.error = function() { } }; -},{"../plot_api/plot_config":841,"./notifier":813}],808:[function(_dereq_,module,exports){ +},{"../plot_api/plot_config":825,"./notifier":797}],792:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -167874,7 +169329,7 @@ module.exports = function makeTraceGroups(traceLayer, cdModule, cls) { return traces; }; -},{"@plotly/d3":58}],809:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],793:[function(_dereq_,module,exports){ 'use strict'; var mat4X4 = _dereq_('gl-mat4'); @@ -168017,7 +169472,7 @@ exports.inverseTransformMatrix = function(m) { ]; }; -},{"gl-mat4":298}],810:[function(_dereq_,module,exports){ +},{"gl-mat4":292}],794:[function(_dereq_,module,exports){ 'use strict'; /** @@ -168044,7 +169499,7 @@ module.exports = { modHalf: modHalf }; -},{}],811:[function(_dereq_,module,exports){ +},{}],795:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -168281,7 +169736,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"./array":785,"fast-isnumeric":249}],812:[function(_dereq_,module,exports){ +},{"./array":769,"fast-isnumeric":246}],796:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -168289,7 +169744,7 @@ function badContainer(container, propStr, propParts) { module.exports = function noop() {}; -},{}],813:[function(_dereq_,module,exports){ +},{}],797:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -168368,7 +169823,7 @@ module.exports = function(text, displayLength) { }); }; -},{"@plotly/d3":58,"fast-isnumeric":249}],814:[function(_dereq_,module,exports){ +},{"@plotly/d3":58,"fast-isnumeric":246}],798:[function(_dereq_,module,exports){ 'use strict'; var setCursor = _dereq_('./setcursor'); @@ -168407,7 +169862,7 @@ module.exports = function overrideCursor(el3, csr) { } }; -},{"./setcursor":824}],815:[function(_dereq_,module,exports){ +},{"./setcursor":808}],799:[function(_dereq_,module,exports){ 'use strict'; var dot = _dereq_('./matrix').dot; @@ -168650,7 +170105,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"../constants/numerical":779,"./matrix":809}],816:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"./matrix":793}],800:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict'; @@ -168716,7 +170171,7 @@ module.exports = function prepareRegl(gd, extensions) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./show_no_webgl_msg":825,"regl":540}],817:[function(_dereq_,module,exports){ +},{"./show_no_webgl_msg":809,"regl":526}],801:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -168778,7 +170233,7 @@ function getUserAgent() { return ua; } -},{"fast-isnumeric":249,"is-mobile":455}],818:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246,"is-mobile":445}],802:[function(_dereq_,module,exports){ 'use strict'; /** @@ -168808,7 +170263,7 @@ module.exports = function pushUnique(array, item) { return array; }; -},{}],819:[function(_dereq_,module,exports){ +},{}],803:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -169000,7 +170455,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../lib":803,"../plot_api/plot_config":841}],820:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_config":825}],804:[function(_dereq_,module,exports){ 'use strict'; /* @@ -169022,7 +170477,7 @@ exports.counter = function(head, tail, openEnded, matchBeginning) { return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail); }; -},{}],821:[function(_dereq_,module,exports){ +},{}],805:[function(_dereq_,module,exports){ 'use strict'; // ASCEND: chop off the last nesting level - either [] or . - to ascend @@ -169066,7 +170521,7 @@ module.exports = function(baseAttr, relativeAttr) { return baseAttr + relativeAttr; }; -},{}],822:[function(_dereq_,module,exports){ +},{}],806:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; @@ -169114,7 +170569,7 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { } }; -},{"./array":785,"./is_plain_object":804}],823:[function(_dereq_,module,exports){ +},{"./array":769,"./is_plain_object":788}],807:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -169306,7 +170761,7 @@ exports.findIndexOfMin = function(arr, fn) { return ind; }; -},{"../constants/numerical":779,"./identity":801,"./loggers":807,"fast-isnumeric":249}],824:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"./identity":785,"./loggers":791,"fast-isnumeric":246}],808:[function(_dereq_,module,exports){ 'use strict'; // works with our CSS cursor classes (see css/_cursor.scss) @@ -169320,7 +170775,7 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],825:[function(_dereq_,module,exports){ +},{}],809:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../components/color'); @@ -169375,14 +170830,14 @@ module.exports = function showNoWebGlMsg(scene) { return false; }; -},{"../components/color":666}],826:[function(_dereq_,module,exports){ +},{"../components/color":650}],810:[function(_dereq_,module,exports){ 'use strict'; module.exports = function sortObjectKeys(obj) { return Object.keys(obj).sort(); }; -},{}],827:[function(_dereq_,module,exports){ +},{}],811:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -169483,7 +170938,7 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"./array":785,"fast-isnumeric":249}],828:[function(_dereq_,module,exports){ +},{"./array":769,"fast-isnumeric":246}],812:[function(_dereq_,module,exports){ 'use strict'; var rgba = _dereq_('color-normalize'); @@ -169495,7 +170950,7 @@ function str2RgbaArray(color) { module.exports = str2RgbaArray; -},{"color-normalize":131}],829:[function(_dereq_,module,exports){ +},{"color-normalize":131}],813:[function(_dereq_,module,exports){ 'use strict'; /* global MathJax:false */ @@ -170404,7 +171859,7 @@ exports.makeEditable = function(context, options) { return d3.rebind(context, dispatch, 'on'); }; -},{"../constants/alignment":771,"../constants/xmlns_namespaces":780,"../lib":803,"@plotly/d3":58}],830:[function(_dereq_,module,exports){ +},{"../constants/alignment":755,"../constants/xmlns_namespaces":764,"../lib":787,"@plotly/d3":58}],814:[function(_dereq_,module,exports){ 'use strict'; var timerCache = {}; @@ -170499,7 +171954,7 @@ function _clearTimeout(cache) { } } -},{}],831:[function(_dereq_,module,exports){ +},{}],815:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -170519,7 +171974,7 @@ module.exports = function toLogRange(val, range) { return newVal; }; -},{"fast-isnumeric":249}],832:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246}],816:[function(_dereq_,module,exports){ 'use strict'; var topojsonUtils = module.exports = {}; @@ -170545,7 +172000,7 @@ topojsonUtils.getTopojsonFeatures = function(trace, topojson) { return topojsonFeature(topojson, obj).features; }; -},{"../plots/geo/constants":885,"topojson-client":601}],833:[function(_dereq_,module,exports){ +},{"../plots/geo/constants":869,"topojson-client":586}],817:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -170559,7 +172014,7 @@ module.exports = { } }; -},{}],834:[function(_dereq_,module,exports){ +},{}],818:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -170594,7 +172049,7 @@ module.exports = { } }; -},{}],835:[function(_dereq_,module,exports){ +},{}],819:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -170643,7 +172098,7 @@ module.exports = function containerArrayMatch(astr) { return {array: arrayStr, index: Number(match[1]), property: match[3] || ''}; }; -},{"../registry":931}],836:[function(_dereq_,module,exports){ +},{"../registry":915}],820:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -170785,7 +172240,7 @@ function overrideOne(attr, editTypeOverride, overrideContainers, key) { } } -},{"../lib":803}],837:[function(_dereq_,module,exports){ +},{"../lib":787}],821:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -171479,7 +172934,7 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) { } }; -},{"../components/color":666,"../lib":803,"../plots/cartesian/axis_ids":858,"../plots/plots":917,"../registry":931,"fast-isnumeric":249,"gl-mat4/fromQuat":288}],838:[function(_dereq_,module,exports){ +},{"../components/color":650,"../lib":787,"../plots/cartesian/axis_ids":842,"../plots/plots":901,"../registry":915,"fast-isnumeric":246,"gl-mat4/fromQuat":282}],822:[function(_dereq_,module,exports){ 'use strict'; var main = _dereq_('./plot_api'); @@ -171514,7 +172969,7 @@ var templateApi = _dereq_('./template_api'); exports.makeTemplate = templateApi.makeTemplate; exports.validateTemplate = templateApi.validateTemplate; -},{"../snapshot/download":933,"./plot_api":840,"./template_api":845,"./to_image":846,"./validate":847}],839:[function(_dereq_,module,exports){ +},{"../snapshot/download":917,"./plot_api":824,"./template_api":829,"./to_image":830,"./validate":831}],823:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('../lib/is_plain_object'); @@ -171718,7 +173173,7 @@ exports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, return true; }; -},{"../lib/is_plain_object":804,"../lib/loggers":807,"../lib/noop":812,"../lib/search":823,"../registry":931,"./container_array_match":835}],840:[function(_dereq_,module,exports){ +},{"../lib/is_plain_object":788,"../lib/loggers":791,"../lib/noop":796,"../lib/search":807,"../registry":915,"./container_array_match":819}],824:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -175532,7 +176987,7 @@ exports._guiUpdate = guiEdit(update); exports._storeDirectGUIEdit = _storeDirectGUIEdit; -},{"../components/color":666,"../components/drawing":688,"../constants/xmlns_namespaces":780,"../lib":803,"../lib/events":792,"../lib/queue":819,"../plots/cartesian/axes":854,"../plots/cartesian/constants":861,"../plots/cartesian/graph_interact":864,"../plots/cartesian/select":874,"../plots/plots":917,"../registry":931,"./edit_types":836,"./helpers":837,"./manage_arrays":839,"./plot_config":841,"./plot_schema":842,"./subroutines":844,"@plotly/d3":58,"fast-isnumeric":249,"has-hover":443}],841:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/drawing":672,"../constants/xmlns_namespaces":764,"../lib":787,"../lib/events":776,"../lib/queue":803,"../plots/cartesian/axes":838,"../plots/cartesian/constants":845,"../plots/cartesian/graph_interact":848,"../plots/cartesian/select":858,"../plots/plots":901,"../registry":915,"./edit_types":820,"./helpers":821,"./manage_arrays":823,"./plot_config":825,"./plot_schema":826,"./subroutines":828,"@plotly/d3":58,"fast-isnumeric":246,"has-hover":435}],825:[function(_dereq_,module,exports){ 'use strict'; /** @@ -176017,7 +177472,7 @@ module.exports = { dfltConfig: dfltConfig }; -},{}],842:[function(_dereq_,module,exports){ +},{}],826:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -176702,7 +178157,7 @@ function insertAttrs(baseAttrs, newAttrs, astr) { np.set(extendDeepAll(np.get() || {}, newAttrs)); } -},{"../lib":803,"../plots/animation_attributes":848,"../plots/attributes":850,"../plots/frame_attributes":884,"../plots/layout_attributes":908,"../registry":931,"./edit_types":836,"./plot_config":841}],843:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/animation_attributes":832,"../plots/attributes":834,"../plots/frame_attributes":868,"../plots/layout_attributes":892,"../registry":915,"./edit_types":820,"./plot_config":825}],827:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -177019,7 +178474,7 @@ exports.arrayEditor = function(parentIn, containerStr, itemOut) { }; }; -},{"../lib":803,"../plots/attributes":850}],844:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/attributes":834}],828:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -177735,7 +179190,7 @@ exports.drawMarginPushers = function(gd) { Registry.getComponentMethod('colorbar', 'draw')(gd); }; -},{"../components/color":666,"../components/drawing":688,"../components/modebar":729,"../components/titles":764,"../constants/alignment":771,"../lib":803,"../lib/clear_gl_canvases":787,"../plots/cartesian/autorange":853,"../plots/cartesian/axes":854,"../plots/cartesian/constraints":862,"../plots/plots":917,"../registry":931,"@plotly/d3":58}],845:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/drawing":672,"../components/modebar":713,"../components/titles":748,"../constants/alignment":755,"../lib":787,"../lib/clear_gl_canvases":771,"../plots/cartesian/autorange":837,"../plots/cartesian/axes":838,"../plots/cartesian/constraints":846,"../plots/plots":901,"../registry":915,"@plotly/d3":58}],829:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -178188,7 +179643,7 @@ function format(opts) { return opts; } -},{"../lib":803,"../plots/attributes":850,"../plots/plots":917,"./plot_config":841,"./plot_schema":842,"./plot_template":843}],846:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/attributes":834,"../plots/plots":901,"./plot_config":825,"./plot_schema":826,"./plot_template":827}],830:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -178423,7 +179878,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":803,"../plots/plots":917,"../snapshot/helpers":935,"../snapshot/svgtoimg":937,"../snapshot/tosvg":939,"../version":1404,"./plot_api":840,"fast-isnumeric":249}],847:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/plots":901,"../snapshot/helpers":919,"../snapshot/svgtoimg":921,"../snapshot/tosvg":923,"../version":1388,"./plot_api":824,"fast-isnumeric":246}],831:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -178846,7 +180301,7 @@ function convertPathToAttributeString(path) { return astr; } -},{"../lib":803,"../plots/plots":917,"./plot_config":841,"./plot_schema":842}],848:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/plots":901,"./plot_config":825,"./plot_schema":826}],832:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -178967,7 +180422,7 @@ module.exports = { } }; -},{}],849:[function(_dereq_,module,exports){ +},{}],833:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -179054,7 +180509,7 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut return contOut; }; -},{"../lib":803,"../plot_api/plot_template":843}],850:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_template":827}],834:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -179283,7 +180738,7 @@ module.exports = { } }; -},{"../components/fx/attributes":697,"./font_attributes":883}],851:[function(_dereq_,module,exports){ +},{"../components/fx/attributes":681,"./font_attributes":867}],835:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -179378,7 +180833,7 @@ module.exports = function alignPeriod(trace, ax, axLetter, vals) { }; }; -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],852:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],836:[function(_dereq_,module,exports){ 'use strict'; @@ -179409,7 +180864,7 @@ module.exports = { } }; -},{}],853:[function(_dereq_,module,exports){ +},{}],837:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -180036,7 +181491,7 @@ function goodNumber(v) { function lessOrEqual(v0, v1) { return v0 <= v1; } function greaterOrEqual(v0, v1) { return v0 >= v1; } -},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../../registry":931,"./axis_ids":858,"@plotly/d3":58,"fast-isnumeric":249}],854:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../../registry":915,"./axis_ids":842,"@plotly/d3":58,"fast-isnumeric":246}],838:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -183878,7 +185333,7 @@ function hideCounterAxisInsideTickLabels(ax, opts) { } } -},{"../../components/color":666,"../../components/drawing":688,"../../components/titles":764,"../../constants/alignment":771,"../../constants/numerical":779,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"./autorange":853,"./axis_autotype":855,"./axis_ids":858,"./clean_ticks":860,"./layout_attributes":869,"./set_convert":875,"@plotly/d3":58,"fast-isnumeric":249}],855:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../components/titles":748,"../../constants/alignment":755,"../../constants/numerical":763,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"./autorange":837,"./axis_autotype":839,"./axis_ids":842,"./clean_ticks":844,"./layout_attributes":853,"./set_convert":859,"@plotly/d3":58,"fast-isnumeric":246}],839:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -184000,7 +185455,7 @@ function multiCategory(a) { return isArrayOrTypedArray(a[0]) && isArrayOrTypedArray(a[1]); } -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],856:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],840:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -184312,7 +185767,7 @@ function indexOfDay(v) { ]; } -},{"../../lib":803,"../../registry":931,"../array_container_defaults":849,"./category_order_defaults":859,"./constants":861,"./layout_attributes":869,"./line_grid_defaults":871,"./set_convert":875,"./tick_label_defaults":876,"./tick_mark_defaults":877,"./tick_value_defaults":878,"fast-isnumeric":249}],857:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../array_container_defaults":833,"./category_order_defaults":843,"./constants":845,"./layout_attributes":853,"./line_grid_defaults":855,"./set_convert":859,"./tick_label_defaults":860,"./tick_mark_defaults":861,"./tick_value_defaults":862,"fast-isnumeric":246}],841:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../../constants/docs'); @@ -184361,7 +185816,7 @@ module.exports = { descriptionWithDates: descriptionWithDates }; -},{"../../constants/docs":774}],858:[function(_dereq_,module,exports){ +},{"../../constants/docs":758}],842:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -184509,7 +185964,7 @@ exports.isLinked = function(fullLayout, axId) { ); }; -},{"../../registry":931,"./constants":861}],859:[function(_dereq_,module,exports){ +},{"../../registry":915,"./constants":845}],843:[function(_dereq_,module,exports){ 'use strict'; function findCategories(ax, opts) { @@ -184595,7 +186050,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],860:[function(_dereq_,module,exports){ +},{}],844:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -184679,7 +186134,7 @@ exports.tick0 = function(tick0, axType, calendar, dtick) { return isNumeric(tick0) ? Number(tick0) : 0; }; -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],861:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],845:[function(_dereq_,module,exports){ 'use strict'; var counterRegex = _dereq_('../../lib/regex').counter; @@ -184763,7 +186218,7 @@ module.exports = { } }; -},{"../../lib/regex":820}],862:[function(_dereq_,module,exports){ +},{"../../lib/regex":804}],846:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -185406,7 +186861,7 @@ function updateDomain(ax, factor) { ax.setScale(); } -},{"../../constants/alignment":771,"../../constants/numerical":779,"../../lib":803,"./autorange":853,"./axis_ids":858,"./layout_attributes":869,"./scale_zoom":873,"./set_convert":875}],863:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../constants/numerical":763,"../../lib":787,"./autorange":837,"./axis_ids":842,"./layout_attributes":853,"./scale_zoom":857,"./set_convert":859}],847:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -186738,7 +188193,7 @@ module.exports = { attachWheelEventHandler: attachWheelEventHandler }; -},{"../../components/color":666,"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../constants/alignment":771,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plot_api/subroutines":844,"../../registry":931,"../plots":917,"./axes":854,"./axis_ids":858,"./constants":861,"./scale_zoom":873,"./select":874,"@plotly/d3":58,"has-passive-events":444,"tinycolor2":598}],864:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../constants/alignment":755,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plot_api/subroutines":828,"../../registry":915,"../plots":901,"./axes":838,"./axis_ids":842,"./constants":845,"./scale_zoom":857,"./select":858,"@plotly/d3":58,"has-passive-events":436,"tinycolor2":583}],848:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -186897,7 +188352,7 @@ exports.updateFx = function(gd) { setCursor(fullLayout._draggers, cursor); }; -},{"../../components/dragelement":685,"../../components/fx":706,"../../lib/setcursor":824,"./constants":861,"./dragbox":863,"@plotly/d3":58}],865:[function(_dereq_,module,exports){ +},{"../../components/dragelement":669,"../../components/fx":690,"../../lib/setcursor":808,"./constants":845,"./dragbox":847,"@plotly/d3":58}],849:[function(_dereq_,module,exports){ 'use strict'; function clearOutlineControllers(gd) { @@ -186924,7 +188379,7 @@ module.exports = { clearSelect: clearSelect }; -},{}],866:[function(_dereq_,module,exports){ +},{}],850:[function(_dereq_,module,exports){ 'use strict'; var strTranslate = _dereq_('../../lib').strTranslate; @@ -186972,7 +188427,7 @@ module.exports = { getTransform: getTransform }; -},{"../../lib":803}],867:[function(_dereq_,module,exports){ +},{"../../lib":787}],851:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -187041,7 +188496,7 @@ module.exports = function makeIncludeComponents(containerArrayName) { }; }; -},{"../../lib":803,"../../registry":931,"./axis_ids":858}],868:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./axis_ids":842}],852:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -187650,7 +189105,7 @@ exports.toSVG = function(gd) { exports.updateFx = _dereq_('./graph_interact').updateFx; -},{"../../components/drawing":688,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../registry":931,"../get_data":891,"../plots":917,"./attributes":852,"./axis_ids":858,"./constants":861,"./graph_interact":864,"./layout_attributes":869,"./layout_defaults":870,"./transition_axes":879,"@plotly/d3":58}],869:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../registry":915,"../get_data":875,"../plots":901,"./attributes":836,"./axis_ids":842,"./constants":845,"./graph_interact":848,"./layout_attributes":853,"./layout_defaults":854,"./transition_axes":863,"@plotly/d3":58}],853:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../font_attributes'); @@ -188649,7 +190104,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../components/drawing/attributes":687,"../../constants/numerical":779,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../font_attributes":883,"./constants":861}],870:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../components/drawing/attributes":671,"../../constants/numerical":763,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../font_attributes":867,"./constants":845}],854:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -189027,7 +190482,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":666,"../../components/fx/helpers":702,"../../components/fx/hovermode_defaults":705,"../../lib":803,"../../plot_api/plot_template":843,"../../registry":931,"../layout_attributes":908,"./axis_defaults":856,"./axis_ids":858,"./constants":861,"./constraints":862,"./layout_attributes":869,"./position_defaults":872,"./type_defaults":880}],871:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx/helpers":686,"../../components/fx/hovermode_defaults":689,"../../lib":787,"../../plot_api/plot_template":827,"../../registry":915,"../layout_attributes":892,"./axis_defaults":840,"./axis_ids":842,"./constants":845,"./constraints":846,"./layout_attributes":853,"./position_defaults":856,"./type_defaults":864}],855:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -189084,7 +190539,7 @@ module.exports = function handleLineGridDefaults(containerIn, containerOut, coer } }; -},{"../../components/color/attributes":665,"../../lib":803,"tinycolor2":598}],872:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib":787,"tinycolor2":583}],856:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -189163,7 +190618,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":803,"fast-isnumeric":249}],873:[function(_dereq_,module,exports){ +},{"../../lib":787,"fast-isnumeric":246}],857:[function(_dereq_,module,exports){ 'use strict'; var FROM_BL = _dereq_('../../constants/alignment').FROM_BL; @@ -189183,7 +190638,7 @@ module.exports = function scaleZoom(ax, factor, centerFraction) { ax.setScale(); }; -},{"../../constants/alignment":771}],874:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755}],858:[function(_dereq_,module,exports){ 'use strict'; var polybool = _dereq_('polybooljs'); @@ -190117,7 +191572,7 @@ module.exports = { selectOnClick: selectOnClick }; -},{"../../components/color":666,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../components/fx/helpers":702,"../../components/shapes/draw_newshape/display_outlines":754,"../../components/shapes/draw_newshape/helpers":755,"../../components/shapes/draw_newshape/newshapes":756,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/polygon":815,"../../lib/throttle":830,"../../plot_api/subroutines":844,"../../registry":931,"./axis_ids":858,"./constants":861,"./handle_outline":865,"./helpers":866,"polybooljs":504}],875:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../components/fx/helpers":686,"../../components/shapes/draw_newshape/display_outlines":738,"../../components/shapes/draw_newshape/helpers":739,"../../components/shapes/draw_newshape/newshapes":740,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/polygon":799,"../../lib/throttle":814,"../../plot_api/subroutines":828,"../../registry":915,"./axis_ids":842,"./constants":845,"./handle_outline":849,"./helpers":850,"polybooljs":490}],859:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -191081,7 +192536,7 @@ module.exports = function setConvert(ax, fullLayout) { delete ax._forceTick0; }; -},{"../../constants/numerical":779,"../../lib":803,"./axis_ids":858,"./constants":861,"@plotly/d3":58,"d3-time-format":175,"fast-isnumeric":249}],876:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"./axis_ids":842,"./constants":845,"@plotly/d3":58,"d3-time-format":172,"fast-isnumeric":246}],860:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -191199,7 +192654,7 @@ function tickformatstopDefaults(valueIn, valueOut) { } } -},{"../../components/color":666,"../../lib":803,"../array_container_defaults":849,"./layout_attributes":869}],877:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../array_container_defaults":833,"./layout_attributes":853}],861:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -191223,7 +192678,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":803,"./layout_attributes":869}],878:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":853}],862:[function(_dereq_,module,exports){ 'use strict'; var cleanTicks = _dereq_('./clean_ticks'); @@ -191262,7 +192717,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"../../lib":803,"./clean_ticks":860}],879:[function(_dereq_,module,exports){ +},{"../../lib":787,"./clean_ticks":844}],863:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -191467,7 +192922,7 @@ module.exports = function transitionAxes(gd, edits, transitionOpts, makeOnComple return Promise.resolve(); }; -},{"../../components/drawing":688,"../../lib":803,"../../registry":931,"./axes":854,"@plotly/d3":58}],880:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../registry":915,"./axes":838,"@plotly/d3":58}],864:[function(_dereq_,module,exports){ 'use strict'; var traceIs = _dereq_('../../registry').traceIs; @@ -191599,7 +193054,7 @@ function isBoxWithoutPositionCoords(trace, axLetter) { ); } -},{"../../registry":931,"./axis_autotype":855}],881:[function(_dereq_,module,exports){ +},{"../../registry":915,"./axis_autotype":839}],865:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -192018,7 +193473,7 @@ function crawl(attrs, callback, path, depth) { }); } -},{"../lib":803,"../registry":931}],882:[function(_dereq_,module,exports){ +},{"../lib":787,"../registry":915}],866:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../lib/extend').extendFlat; @@ -192145,7 +193600,7 @@ exports.defaults = function(containerOut, layout, coerce, dfltDomains) { if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice(); }; -},{"../lib/extend":793}],883:[function(_dereq_,module,exports){ +},{"../lib/extend":777}],867:[function(_dereq_,module,exports){ 'use strict'; /* @@ -192210,7 +193665,7 @@ module.exports = function(opts) { return attrs; }; -},{}],884:[function(_dereq_,module,exports){ +},{}],868:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -192258,7 +193713,7 @@ module.exports = { } }; -},{}],885:[function(_dereq_,module,exports){ +},{}],869:[function(_dereq_,module,exports){ 'use strict'; // projection names to d3 function name @@ -192516,7 +193971,7 @@ exports.layerNameToAdjective = { frame: 'frame' }; -},{}],886:[function(_dereq_,module,exports){ +},{}],870:[function(_dereq_,module,exports){ 'use strict'; /* global PlotlyGeoAssets:false */ @@ -193304,7 +194759,7 @@ function makeRangeBox(lon, lat) { }; } -},{"../../components/color":666,"../../components/dragelement":685,"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/topojson_utils":832,"../../registry":931,"../cartesian/autorange":853,"../cartesian/axes":854,"../cartesian/select":874,"../plots":917,"./constants":885,"./zoom":890,"@plotly/d3":58,"d3-geo":169,"d3-geo-projection":168,"topojson-client":601}],887:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/topojson_utils":816,"../../registry":915,"../cartesian/autorange":837,"../cartesian/axes":838,"../cartesian/select":858,"../plots":901,"./constants":869,"./zoom":874,"@plotly/d3":58,"d3-geo":166,"d3-geo-projection":165,"topojson-client":586}],871:[function(_dereq_,module,exports){ 'use strict'; var getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData; @@ -193396,7 +194851,7 @@ module.exports = { clean: clean }; -},{"../../lib":803,"../../plots/get_data":891,"./geo":886,"./layout_attributes":888,"./layout_defaults":889}],888:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/get_data":875,"./geo":870,"./layout_attributes":872,"./layout_defaults":873}],872:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -193726,7 +195181,7 @@ attrs.uirevision = { ].join(' ') }; -},{"../../components/color/attributes":665,"../../lib/sort_object_keys":826,"../../plot_api/edit_types":836,"../domain":882,"./constants":885}],889:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/sort_object_keys":810,"../../plot_api/edit_types":820,"../domain":866,"./constants":869}],873:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -193952,7 +195407,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) { } } -},{"../../lib":803,"../get_data":891,"../subplot_defaults":925,"./constants":885,"./layout_attributes":888}],890:[function(_dereq_,module,exports){ +},{"../../lib":787,"../get_data":875,"../subplot_defaults":909,"./constants":869,"./layout_attributes":872}],874:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -194455,7 +195910,7 @@ function d3eventDispatch(target) { return dispatch; } -},{"../../lib":803,"../../registry":931,"@plotly/d3":58}],891:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"@plotly/d3":58}],875:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -194576,7 +196031,7 @@ exports.getSubplotData = function getSubplotData(data, type, subplotId) { return subplotData; }; -},{"../registry":931,"./cartesian/constants":861}],892:[function(_dereq_,module,exports){ +},{"../registry":915,"./cartesian/constants":845}],876:[function(_dereq_,module,exports){ 'use strict'; var mouseChange = _dereq_('mouse-change'); @@ -194862,7 +196317,7 @@ function createCamera(scene) { return result; } -},{"../cartesian/constants":861,"has-passive-events":444,"mouse-change":470,"mouse-event-offset":471,"mouse-wheel":473}],893:[function(_dereq_,module,exports){ +},{"../cartesian/constants":845,"has-passive-events":436,"mouse-change":459,"mouse-event-offset":460,"mouse-wheel":462}],877:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../cartesian/axes'); @@ -195096,7 +196551,7 @@ function createAxes2D(scene) { module.exports = createAxes2D; -},{"../../lib/str2rgbarray":828,"../cartesian/axes":854}],894:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":812,"../cartesian/axes":838}],878:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -195238,7 +196693,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/fx/layout_attributes":707,"../../constants/xmlns_namespaces":780,"../../plot_api/edit_types":836,"../cartesian":868,"../cartesian/attributes":852,"../cartesian/constants":861,"../get_data":891,"../layout_attributes":908,"./scene2d":895}],895:[function(_dereq_,module,exports){ +},{"../../components/fx/layout_attributes":691,"../../constants/xmlns_namespaces":764,"../../plot_api/edit_types":820,"../cartesian":852,"../cartesian/attributes":836,"../cartesian/constants":845,"../get_data":875,"../layout_attributes":892,"./scene2d":879}],879:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -195950,7 +197405,7 @@ proto.hoverFormatter = function(axisName, val) { return Axes.tickText(axis, axis.c2l(val), 'hover').text; }; -},{"../../components/dragelement/helpers":684,"../../components/fx":706,"../../lib/show_no_webgl_msg":825,"../../plots/cartesian/axes":854,"../../registry":931,"../cartesian/autorange":853,"../cartesian/constants":861,"../cartesian/constraints":862,"./camera":892,"./convert":893,"gl-plot2d":322,"gl-select-box":337,"gl-spikes2d":346,"webgl-context":629}],896:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":668,"../../components/fx":690,"../../lib/show_no_webgl_msg":809,"../../plots/cartesian/axes":838,"../../registry":915,"../cartesian/autorange":837,"../cartesian/constants":845,"../cartesian/constraints":846,"./camera":876,"./convert":877,"gl-plot2d":316,"gl-select-box":330,"gl-spikes2d":339,"webgl-context":613}],880:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -196101,7 +197556,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/fx/layout_attributes":707,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../plot_api/edit_types":836,"../get_data":891,"./layout/attributes":897,"./layout/defaults":901,"./layout/layout_attributes":902,"./scene":906}],897:[function(_dereq_,module,exports){ +},{"../../components/fx/layout_attributes":691,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../plot_api/edit_types":820,"../get_data":875,"./layout/attributes":881,"./layout/defaults":885,"./layout/layout_attributes":886,"./scene":890}],881:[function(_dereq_,module,exports){ 'use strict'; @@ -196121,7 +197576,7 @@ module.exports = { } }; -},{}],898:[function(_dereq_,module,exports){ +},{}],882:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../../components/color'); @@ -196240,7 +197695,7 @@ module.exports = overrideAll({ } }, 'plot', 'from-root'); -},{"../../../components/color":666,"../../../lib/extend":793,"../../../plot_api/edit_types":836,"../../cartesian/layout_attributes":869}],899:[function(_dereq_,module,exports){ +},{"../../../components/color":650,"../../../lib/extend":777,"../../../plot_api/edit_types":820,"../../cartesian/layout_attributes":853}],883:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -196309,7 +197764,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { } }; -},{"../../../lib":803,"../../../plot_api/plot_template":843,"../../cartesian/axis_defaults":856,"../../cartesian/type_defaults":880,"./axis_attributes":898,"tinycolor2":598}],900:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../../plot_api/plot_template":827,"../../cartesian/axis_defaults":840,"../../cartesian/type_defaults":864,"./axis_attributes":882,"tinycolor2":583}],884:[function(_dereq_,module,exports){ 'use strict'; var str2RgbaArray = _dereq_('../../../lib/str2rgbarray'); @@ -196466,7 +197921,7 @@ function createAxesOptions(fullLayout, sceneLayout) { module.exports = createAxesOptions; -},{"../../../lib":803,"../../../lib/str2rgbarray":828}],901:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../../lib/str2rgbarray":812}],885:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../../lib'); @@ -196607,7 +198062,7 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { coerce('hovermode', opts.getDfltFromLayout('hovermode')); } -},{"../../../components/color":666,"../../../lib":803,"../../../registry":931,"../../get_data":891,"../../subplot_defaults":925,"./axis_defaults":899,"./layout_attributes":902}],902:[function(_dereq_,module,exports){ +},{"../../../components/color":650,"../../../lib":787,"../../../registry":915,"../../get_data":875,"../../subplot_defaults":909,"./axis_defaults":883,"./layout_attributes":886}],886:[function(_dereq_,module,exports){ 'use strict'; var gl3dAxisAttrs = _dereq_('./axis_attributes'); @@ -196779,7 +198234,7 @@ module.exports = { } }; -},{"../../../lib":803,"../../../lib/extend":793,"../../domain":882,"./axis_attributes":898}],903:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../../lib/extend":777,"../../domain":866,"./axis_attributes":882}],887:[function(_dereq_,module,exports){ 'use strict'; var str2RGBArray = _dereq_('../../../lib/str2rgbarray'); @@ -196822,7 +198277,7 @@ function createSpikeOptions(layout) { module.exports = createSpikeOptions; -},{"../../../lib/str2rgbarray":828}],904:[function(_dereq_,module,exports){ +},{"../../../lib/str2rgbarray":812}],888:[function(_dereq_,module,exports){ /* eslint block-scoped-var: 0*/ /* eslint no-redeclare: 0*/ @@ -196915,7 +198370,7 @@ function computeTickMarks(scene) { scene.contourLevels = contourLevelsFromTicks(ticks); } -},{"../../../lib":803,"../../cartesian/axes":854}],905:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../cartesian/axes":838}],889:[function(_dereq_,module,exports){ 'use strict'; function xformMatrix(m, v) { @@ -196940,7 +198395,7 @@ function project(camera, v) { module.exports = project; -},{}],906:[function(_dereq_,module,exports){ +},{}],890:[function(_dereq_,module,exports){ 'use strict'; var glPlot3d = _dereq_('gl-plot3d'); @@ -198076,7 +199531,7 @@ proto.make4thDimension = function() { module.exports = Scene; -},{"../../components/fx":706,"../../lib":803,"../../lib/show_no_webgl_msg":825,"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"../../registry":931,"./layout/convert":900,"./layout/spikes":903,"./layout/tick_marks":904,"./project":905,"gl-plot3d":326,"has-passive-events":444,"webgl-context":629}],907:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../lib":787,"../../lib/show_no_webgl_msg":809,"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"../../registry":915,"./layout/convert":884,"./layout/spikes":887,"./layout/tick_marks":888,"./project":889,"gl-plot3d":319,"has-passive-events":436,"webgl-context":613}],891:[function(_dereq_,module,exports){ 'use strict'; module.exports = function zip3(x, y, z, len) { @@ -198089,7 +199544,7 @@ module.exports = function zip3(x, y, z, len) { return result; }; -},{}],908:[function(_dereq_,module,exports){ +},{}],892:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -198525,7 +199980,7 @@ module.exports = { } }; -},{"../components/color/attributes":665,"../components/shapes/draw_newshape/attributes":751,"../lib/extend":793,"./animation_attributes":848,"./font_attributes":883,"./pad_attributes":916}],909:[function(_dereq_,module,exports){ +},{"../components/color/attributes":649,"../components/shapes/draw_newshape/attributes":735,"../lib/extend":777,"./animation_attributes":832,"./font_attributes":867,"./pad_attributes":900}],893:[function(_dereq_,module,exports){ 'use strict'; var sortObjectKeys = _dereq_('../../lib/sort_object_keys'); @@ -198775,7 +200230,7 @@ module.exports = { } }; -},{"../../lib/sort_object_keys":826}],910:[function(_dereq_,module,exports){ +},{"../../lib/sort_object_keys":810}],894:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -198839,7 +200294,7 @@ module.exports = function convertTextOpts(textposition, iconSize) { return { anchor: anchor, offset: offset }; }; -},{"../../lib":803}],911:[function(_dereq_,module,exports){ +},{"../../lib":787}],895:[function(_dereq_,module,exports){ 'use strict'; var mapboxgl = _dereq_('mapbox-gl/dist/mapbox-gl-unminified'); @@ -199122,7 +200577,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/drawing":688,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/get_data":891,"./constants":909,"./layout_attributes":913,"./layout_defaults":914,"./mapbox":915,"@plotly/d3":58,"mapbox-gl/dist/mapbox-gl-unminified":461}],912:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/get_data":875,"./constants":893,"./layout_attributes":897,"./layout_defaults":898,"./mapbox":899,"@plotly/d3":58,"mapbox-gl/dist/mapbox-gl-unminified":451}],896:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -199423,7 +200878,7 @@ module.exports = function createMapboxLayer(subplot, index, opts) { return mapboxLayer; }; -},{"../../lib":803,"../../lib/svg_text_utils":829,"./constants":909,"./convert_text_opts":910}],913:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/svg_text_utils":813,"./constants":893,"./convert_text_opts":894}],897:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -199741,7 +201196,7 @@ attrs.uirevision = { ].join(' ') }; -},{"../../components/color":666,"../../lib":803,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../traces/scatter/attributes":1218,"../domain":882,"../font_attributes":883,"./constants":909}],914:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../traces/scatter/attributes":1202,"../domain":866,"../font_attributes":867,"./constants":893}],898:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -199841,7 +201296,7 @@ function handleLayerDefaults(layerIn, layerOut) { } } -},{"../../lib":803,"../array_container_defaults":849,"../subplot_defaults":925,"./layout_attributes":913}],915:[function(_dereq_,module,exports){ +},{"../../lib":787,"../array_container_defaults":833,"../subplot_defaults":909,"./layout_attributes":897}],899:[function(_dereq_,module,exports){ 'use strict'; var mapboxgl = _dereq_('mapbox-gl/dist/mapbox-gl-unminified'); @@ -200644,7 +202099,7 @@ function convertCenter(center) { module.exports = Mapbox; -},{"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/fx":706,"../../lib":803,"../../lib/geo_location_utils":796,"../../registry":931,"../cartesian/axes":854,"../cartesian/select":874,"./constants":909,"./layers":912,"mapbox-gl/dist/mapbox-gl-unminified":461}],916:[function(_dereq_,module,exports){ +},{"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/fx":690,"../../lib":787,"../../lib/geo_location_utils":780,"../../registry":915,"../cartesian/axes":838,"../cartesian/select":858,"./constants":893,"./layers":896,"mapbox-gl/dist/mapbox-gl-unminified":451}],900:[function(_dereq_,module,exports){ 'use strict'; /** @@ -200687,7 +202142,7 @@ module.exports = function(opts) { }; }; -},{}],917:[function(_dereq_,module,exports){ +},{}],901:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -204113,7 +205568,7 @@ plots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullD } }; -},{"../components/color":666,"../constants/numerical":779,"../lib":803,"../plot_api/plot_schema":842,"../plot_api/plot_template":843,"../plots/get_data":891,"../registry":931,"./animation_attributes":848,"./attributes":850,"./cartesian/axis_ids":858,"./cartesian/handle_outline":865,"./command":881,"./font_attributes":883,"./frame_attributes":884,"./layout_attributes":908,"@plotly/d3":58,"d3-format":167,"d3-time-format":175,"fast-isnumeric":249}],918:[function(_dereq_,module,exports){ +},{"../components/color":650,"../constants/numerical":763,"../lib":787,"../plot_api/plot_schema":826,"../plot_api/plot_template":827,"../plots/get_data":875,"../registry":915,"./animation_attributes":832,"./attributes":834,"./cartesian/axis_ids":842,"./cartesian/handle_outline":849,"./command":865,"./font_attributes":867,"./frame_attributes":868,"./layout_attributes":892,"@plotly/d3":58,"d3-format":164,"d3-time-format":172,"fast-isnumeric":246}],902:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -204150,7 +205605,7 @@ module.exports = { OFFEDGE: 20 }; -},{}],919:[function(_dereq_,module,exports){ +},{}],903:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -204437,7 +205892,7 @@ module.exports = { pathPolygonAnnulus: pathPolygonAnnulus }; -},{"../../lib":803,"../../lib/polygon":815}],920:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/polygon":799}],904:[function(_dereq_,module,exports){ 'use strict'; var getSubplotCalcData = _dereq_('../get_data').getSubplotCalcData; @@ -204522,7 +205977,7 @@ module.exports = { toSVG: _dereq_('../cartesian').toSVG }; -},{"../../lib":803,"../cartesian":868,"../get_data":891,"./constants":918,"./layout_attributes":921,"./layout_defaults":922,"./polar":923}],921:[function(_dereq_,module,exports){ +},{"../../lib":787,"../cartesian":852,"../get_data":875,"./constants":902,"./layout_attributes":905,"./layout_defaults":906,"./polar":907}],905:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -204850,7 +206305,7 @@ module.exports = { editType: 'calc' }; -},{"../../components/color/attributes":665,"../../lib":803,"../../plot_api/edit_types":836,"../cartesian/layout_attributes":869,"../domain":882}],922:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib":787,"../../plot_api/edit_types":820,"../cartesian/layout_attributes":853,"../domain":866}],906:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -205080,7 +206535,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":666,"../../lib":803,"../../plot_api/plot_template":843,"../cartesian/axis_autotype":855,"../cartesian/category_order_defaults":859,"../cartesian/line_grid_defaults":871,"../cartesian/tick_label_defaults":876,"../cartesian/tick_mark_defaults":877,"../cartesian/tick_value_defaults":878,"../get_data":891,"../subplot_defaults":925,"./constants":918,"./layout_attributes":921,"./set_convert":924}],923:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plot_api/plot_template":827,"../cartesian/axis_autotype":839,"../cartesian/category_order_defaults":843,"../cartesian/line_grid_defaults":855,"../cartesian/tick_label_defaults":860,"../cartesian/tick_mark_defaults":861,"../cartesian/tick_value_defaults":862,"../get_data":875,"../subplot_defaults":909,"./constants":902,"./layout_attributes":905,"./set_convert":908}],907:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -206517,7 +207972,7 @@ function updateElement(sel, showAttr, attrs) { return sel; } -},{"../../components/color":666,"../../components/dragelement":685,"../../components/drawing":688,"../../components/fx":706,"../../components/titles":764,"../../constants/alignment":771,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/setcursor":824,"../../plot_api/subroutines":844,"../../plots/cartesian/axes":854,"../../registry":931,"../cartesian/autorange":853,"../cartesian/dragbox":863,"../cartesian/select":874,"../cartesian/set_convert":875,"../plots":917,"./constants":918,"./helpers":919,"./set_convert":924,"@plotly/d3":58,"tinycolor2":598}],924:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/drawing":672,"../../components/fx":690,"../../components/titles":748,"../../constants/alignment":755,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/setcursor":808,"../../plot_api/subroutines":828,"../../plots/cartesian/axes":838,"../../registry":915,"../cartesian/autorange":837,"../cartesian/dragbox":847,"../cartesian/select":858,"../cartesian/set_convert":859,"../plots":901,"./constants":902,"./helpers":903,"./set_convert":908,"@plotly/d3":58,"tinycolor2":583}],908:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -206704,7 +208159,7 @@ function setConvertAngular(ax, polarLayout) { }; } -},{"../../lib":803,"../cartesian/set_convert":875}],925:[function(_dereq_,module,exports){ +},{"../../lib":787,"../cartesian/set_convert":859}],909:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -206780,7 +208235,7 @@ module.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, o } }; -},{"../lib":803,"../plot_api/plot_template":843,"./domain":882}],926:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_template":827,"./domain":866}],910:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../constants/docs'); @@ -206878,7 +208333,7 @@ exports.texttemplateAttrs = function(opts, extra) { return texttemplate; }; -},{"../constants/docs":774}],927:[function(_dereq_,module,exports){ +},{"../constants/docs":758}],911:[function(_dereq_,module,exports){ 'use strict'; var Ternary = _dereq_('./ternary'); @@ -206957,7 +208412,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../lib":803,"../../plots/get_data":891,"./layout_attributes":928,"./layout_defaults":929,"./ternary":930}],928:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/get_data":875,"./layout_attributes":912,"./layout_defaults":913,"./ternary":914}],912:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -207068,7 +208523,7 @@ attrs.aaxis.uirevision = attrs.baxis.uirevision = attrs.caxis.uirevision = { ].join(' ') }; -},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plot_api/edit_types":836,"../cartesian/layout_attributes":869,"../domain":882}],929:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plot_api/edit_types":820,"../cartesian/layout_attributes":853,"../domain":866}],913:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -207192,7 +208647,7 @@ function handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut coerce('layer'); } -},{"../../components/color":666,"../../lib":803,"../../plot_api/plot_template":843,"../cartesian/line_grid_defaults":871,"../cartesian/tick_label_defaults":876,"../cartesian/tick_mark_defaults":877,"../cartesian/tick_value_defaults":878,"../subplot_defaults":925,"./layout_attributes":928}],930:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plot_api/plot_template":827,"../cartesian/line_grid_defaults":855,"../cartesian/tick_label_defaults":860,"../cartesian/tick_mark_defaults":861,"../cartesian/tick_value_defaults":862,"../subplot_defaults":909,"./layout_attributes":912}],914:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -207964,7 +209419,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":666,"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../components/titles":764,"../../lib":803,"../../lib/extend":793,"../../registry":931,"../cartesian/axes":854,"../cartesian/constants":861,"../cartesian/select":874,"../cartesian/set_convert":875,"../plots":917,"@plotly/d3":58,"tinycolor2":598}],931:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../components/titles":748,"../../lib":787,"../../lib/extend":777,"../../registry":915,"../cartesian/axes":838,"../cartesian/constants":845,"../cartesian/select":858,"../cartesian/set_convert":859,"../plots":901,"@plotly/d3":58,"tinycolor2":583}],915:[function(_dereq_,module,exports){ 'use strict'; var Loggers = _dereq_('./lib/loggers'); @@ -208422,7 +209877,7 @@ function getTraceType(traceType) { return traceType; } -},{"./lib/dom":791,"./lib/extend":793,"./lib/is_plain_object":804,"./lib/loggers":807,"./lib/noop":812,"./lib/push_unique":818,"./plots/attributes":850,"./plots/layout_attributes":908}],932:[function(_dereq_,module,exports){ +},{"./lib/dom":775,"./lib/extend":777,"./lib/is_plain_object":788,"./lib/loggers":791,"./lib/noop":796,"./lib/push_unique":802,"./plots/attributes":834,"./plots/layout_attributes":892}],916:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -208582,7 +210037,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../lib":803,"../registry":931}],933:[function(_dereq_,module,exports){ +},{"../lib":787,"../registry":915}],917:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -208646,7 +210101,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":803,"../plot_api/to_image":846,"./filesaver":934,"./helpers":935}],934:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/to_image":830,"./filesaver":918,"./helpers":919}],918:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -208714,7 +210169,7 @@ function fileSaver(url, name, format) { module.exports = fileSaver; -},{"../lib":803,"./helpers":935}],935:[function(_dereq_,module,exports){ +},{"../lib":787,"./helpers":919}],919:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -208783,7 +210238,7 @@ exports.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; exports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\'svg\'} instead.'; -},{"../registry":931}],936:[function(_dereq_,module,exports){ +},{"../registry":915}],920:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -208800,7 +210255,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":932,"./download":933,"./helpers":935,"./svgtoimg":937,"./toimage":938,"./tosvg":939}],937:[function(_dereq_,module,exports){ +},{"./cloneplot":916,"./download":917,"./helpers":919,"./svgtoimg":921,"./toimage":922,"./tosvg":923}],921:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -208919,7 +210374,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":803,"./helpers":935,"events":116}],938:[function(_dereq_,module,exports){ +},{"../lib":787,"./helpers":919,"events":116}],922:[function(_dereq_,module,exports){ 'use strict'; var EventEmitter = _dereq_('events').EventEmitter; @@ -208988,7 +210443,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":803,"../registry":931,"./cloneplot":932,"./helpers":935,"./svgtoimg":937,"./tosvg":939,"events":116}],939:[function(_dereq_,module,exports){ +},{"../lib":787,"../registry":915,"./cloneplot":916,"./helpers":919,"./svgtoimg":921,"./tosvg":923,"events":116}],923:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -209173,7 +210628,7 @@ module.exports = function toSVG(gd, format, scale) { return s; }; -},{"../components/color":666,"../components/drawing":688,"../constants/xmlns_namespaces":780,"../lib":803,"@plotly/d3":58}],940:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/drawing":672,"../constants/xmlns_namespaces":764,"../lib":787,"@plotly/d3":58}],924:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -209198,7 +210653,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":803}],941:[function(_dereq_,module,exports){ +},{"../../lib":787}],925:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -209448,7 +210903,7 @@ module.exports = { } }; -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/font_attributes":883,"../../plots/template_attributes":926,"../scatter/attributes":1218,"./constants":943}],942:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/font_attributes":867,"../../plots/template_attributes":910,"../scatter/attributes":1202,"./constants":927}],926:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -209523,7 +210978,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../scatter/calc_selection":1220,"./arrays_to_calcdata":940}],943:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../scatter/calc_selection":1204,"./arrays_to_calcdata":924}],927:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -209536,7 +210991,7 @@ module.exports = { eventDataKeys: ['value', 'label'] }; -},{}],944:[function(_dereq_,module,exports){ +},{}],928:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -210311,7 +211766,7 @@ module.exports = { setGroupPositions: setGroupPositions }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../../plots/cartesian/constraints":862,"../../registry":931,"./sieve.js":954,"fast-isnumeric":249}],945:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../../plots/cartesian/constraints":846,"../../registry":915,"./sieve.js":938,"fast-isnumeric":246}],929:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -210490,7 +211945,7 @@ module.exports = { handleText: handleText }; -},{"../../components/color":666,"../../lib":803,"../../plots/cartesian/constraints":862,"../../registry":931,"../scatter/period_defaults":1238,"../scatter/xy_defaults":1245,"./attributes":941,"./style_defaults":956}],946:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plots/cartesian/constraints":846,"../../registry":915,"../scatter/period_defaults":1222,"../scatter/xy_defaults":1229,"./attributes":925,"./style_defaults":940}],930:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace) { @@ -210511,7 +211966,7 @@ module.exports = function eventData(out, pt, trace) { return out; }; -},{}],947:[function(_dereq_,module,exports){ +},{}],931:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -210581,7 +212036,7 @@ exports.getLineWidth = function(trace, di) { return w; }; -},{"../../lib":803,"fast-isnumeric":249,"tinycolor2":598}],948:[function(_dereq_,module,exports){ +},{"../../lib":787,"fast-isnumeric":246,"tinycolor2":583}],932:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -210806,7 +212261,7 @@ module.exports = { getTraceColor: getTraceColor }; -},{"../../components/color":666,"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./helpers":947}],949:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./helpers":931}],933:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -210841,7 +212296,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../scatter/marker_colorbar":1236,"./arrays_to_calcdata":940,"./attributes":941,"./calc":942,"./cross_trace_calc":944,"./defaults":945,"./event_data":946,"./hover":948,"./layout_attributes":950,"./layout_defaults":951,"./plot":952,"./select":953,"./style":955}],950:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../scatter/marker_colorbar":1220,"./arrays_to_calcdata":924,"./attributes":925,"./calc":926,"./cross_trace_calc":928,"./defaults":929,"./event_data":930,"./hover":932,"./layout_attributes":934,"./layout_defaults":935,"./plot":936,"./select":937,"./style":939}],934:[function(_dereq_,module,exports){ 'use strict'; @@ -210898,7 +212353,7 @@ module.exports = { } }; -},{}],951:[function(_dereq_,module,exports){ +},{}],935:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -210950,7 +212405,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { coerce('bargroupgap'); }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./layout_attributes":950}],952:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./layout_attributes":934}],936:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -211727,7 +213182,7 @@ module.exports = { toMoveInsideBar: toMoveInsideBar }; -},{"../../components/color":666,"../../components/drawing":688,"../../components/fx/helpers":702,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../registry":931,"./attributes":941,"./constants":943,"./helpers":947,"./style":955,"./uniform_text":957,"@plotly/d3":58,"fast-isnumeric":249}],953:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../components/fx/helpers":686,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../registry":915,"./attributes":925,"./constants":927,"./helpers":931,"./style":939,"./uniform_text":941,"@plotly/d3":58,"fast-isnumeric":246}],937:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -211783,7 +213238,7 @@ function getCentroid(d, xa, ya, isHorizontal, isFunnel) { } } -},{}],954:[function(_dereq_,module,exports){ +},{}],938:[function(_dereq_,module,exports){ 'use strict'; module.exports = Sieve; @@ -211892,7 +213347,7 @@ Sieve.prototype.getLabel = function getLabel(position, value) { return prefix + label; }; -},{"../../constants/numerical":779,"../../lib":803}],955:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787}],939:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -212066,7 +213521,7 @@ module.exports = { resizeText: resizeText }; -},{"../../components/color":666,"../../components/drawing":688,"../../lib":803,"../../registry":931,"./attributes":941,"./helpers":947,"./uniform_text":957,"@plotly/d3":58}],956:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../lib":787,"../../registry":915,"./attributes":925,"./helpers":931,"./uniform_text":941,"@plotly/d3":58}],940:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -212098,7 +213553,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, default coerce('unselected.marker.color'); }; -},{"../../components/color":666,"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803}],957:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787}],941:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -212177,7 +213632,7 @@ module.exports = { resizeText: resizeText }; -},{"../../lib":803,"@plotly/d3":58}],958:[function(_dereq_,module,exports){ +},{"../../lib":787,"@plotly/d3":58}],942:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -212252,7 +213707,7 @@ module.exports = { // error_y }; -},{"../../lib/extend":793,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatterpolar/attributes":1292}],959:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatterpolar/attributes":1276}],943:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -212356,7 +213811,7 @@ module.exports = { crossTraceCalc: crossTraceCalc }; -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"../../lib":803,"../../registry":931,"../bar/arrays_to_calcdata":940,"../bar/cross_trace_calc":944,"../scatter/calc_selection":1220}],960:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"../../lib":787,"../../registry":915,"../bar/arrays_to_calcdata":924,"../bar/cross_trace_calc":928,"../scatter/calc_selection":1204}],944:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -212407,7 +213862,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../bar/style_defaults":956,"../scatterpolar/defaults":1294,"./attributes":958}],961:[function(_dereq_,module,exports){ +},{"../../lib":787,"../bar/style_defaults":940,"../scatterpolar/defaults":1278,"./attributes":942}],945:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -212474,7 +213929,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { return [pointData]; }; -},{"../../components/fx":706,"../../lib":803,"../../plots/polar/helpers":919,"../bar/hover":948,"../scatterpolar/hover":1296}],962:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../lib":787,"../../plots/polar/helpers":903,"../bar/hover":932,"../scatterpolar/hover":1280}],946:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -212512,7 +213967,7 @@ module.exports = { } }; -},{"../../plots/polar":920,"../bar/select":953,"../bar/style":955,"../scatter/marker_colorbar":1236,"../scatterpolar/format_labels":1295,"./attributes":958,"./calc":959,"./defaults":960,"./hover":961,"./layout_attributes":963,"./layout_defaults":964,"./plot":965}],963:[function(_dereq_,module,exports){ +},{"../../plots/polar":904,"../bar/select":937,"../bar/style":939,"../scatter/marker_colorbar":1220,"../scatterpolar/format_labels":1279,"./attributes":942,"./calc":943,"./defaults":944,"./hover":945,"./layout_attributes":947,"./layout_defaults":948,"./plot":949}],947:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -212544,7 +213999,7 @@ module.exports = { } }; -},{}],964:[function(_dereq_,module,exports){ +},{}],948:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -212571,7 +214026,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"./layout_attributes":963}],965:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":947}],949:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -212671,7 +214126,7 @@ function makePathFn(subplot) { }; } -},{"../../components/drawing":688,"../../lib":803,"../../plots/polar/helpers":919,"@plotly/d3":58,"fast-isnumeric":249}],966:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../plots/polar/helpers":903,"@plotly/d3":58,"fast-isnumeric":246}],950:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -213093,7 +214548,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218}],967:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202}],951:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -213539,7 +214994,7 @@ function computeNotchSpan(cdi, N) { return 1.57 * (cdi.q3 - cdi.q1) / Math.sqrt(N); } -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"fast-isnumeric":249}],968:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"fast-isnumeric":246}],952:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -213764,7 +215219,7 @@ module.exports = { setPositionOffset: setPositionOffset }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../plots/cartesian/constraints":862}],969:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../plots/cartesian/constraints":846}],953:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -214074,7 +215529,7 @@ module.exports = { handlePointsDefaults: handlePointsDefaults }; -},{"../../components/color":666,"../../lib":803,"../../plots/cartesian/axis_autotype":855,"../../registry":931,"../bar/defaults":945,"../scatter/period_defaults":1238,"./attributes":966}],970:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plots/cartesian/axis_autotype":839,"../../registry":915,"../bar/defaults":929,"../scatter/period_defaults":1222,"./attributes":950}],954:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -214091,7 +215546,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],971:[function(_dereq_,module,exports){ +},{}],955:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -214370,7 +215825,7 @@ module.exports = { hoverOnPoints: hoverOnPoints }; -},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"../../plots/cartesian/axes":854}],972:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"../../plots/cartesian/axes":838}],956:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -214423,7 +215878,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":966,"./calc":967,"./cross_trace_calc":968,"./defaults":969,"./event_data":970,"./hover":971,"./layout_attributes":973,"./layout_defaults":974,"./plot":975,"./select":976,"./style":977}],973:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":950,"./calc":951,"./cross_trace_calc":952,"./defaults":953,"./event_data":954,"./hover":955,"./layout_attributes":957,"./layout_defaults":958,"./plot":959,"./select":960,"./style":961}],957:[function(_dereq_,module,exports){ 'use strict'; @@ -214469,7 +215924,7 @@ module.exports = { } }; -},{}],974:[function(_dereq_,module,exports){ +},{}],958:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -214507,7 +215962,7 @@ module.exports = { _supply: _supply }; -},{"../../lib":803,"../../registry":931,"./layout_attributes":973}],975:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./layout_attributes":957}],959:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -214849,7 +216304,7 @@ module.exports = { plotBoxMean: plotBoxMean }; -},{"../../components/drawing":688,"../../lib":803,"@plotly/d3":58}],976:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"@plotly/d3":58}],960:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -214890,7 +216345,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],977:[function(_dereq_,module,exports){ +},{}],961:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -214956,7 +216411,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/color":666,"../../components/drawing":688,"@plotly/d3":58}],978:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"@plotly/d3":58}],962:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib').extendFlat; @@ -215014,7 +216469,7 @@ module.exports = { hoverlabel: OHLCattrs.hoverlabel, }; -},{"../../lib":803,"../../plots/cartesian/axis_format_attributes":857,"../box/attributes":966,"../ohlc/attributes":1164}],979:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axis_format_attributes":841,"../box/attributes":950,"../ohlc/attributes":1148}],963:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -215058,7 +216513,7 @@ function ptFunc(o, h, l, c) { }; } -},{"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../ohlc/calc":1165}],980:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../ohlc/calc":1149}],964:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -215100,7 +216555,7 @@ function handleDirection(traceIn, traceOut, coerce, direction) { coerce(direction + '.fillcolor', Color.addOpacity(lineColor, 0.5)); } -},{"../../components/color":666,"../../lib":803,"../ohlc/ohlc_defaults":1169,"../scatter/period_defaults":1238,"./attributes":978}],981:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../ohlc/ohlc_defaults":1153,"../scatter/period_defaults":1222,"./attributes":962}],965:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -215137,7 +216592,7 @@ module.exports = { selectPoints: _dereq_('../ohlc/select') }; -},{"../../plots/cartesian":868,"../box/cross_trace_calc":968,"../box/layout_attributes":973,"../box/layout_defaults":974,"../box/plot":975,"../box/style":977,"../ohlc/hover":1167,"../ohlc/select":1171,"./attributes":978,"./calc":979,"./defaults":980}],982:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../box/cross_trace_calc":952,"../box/layout_attributes":957,"../box/layout_defaults":958,"../box/plot":959,"../box/style":961,"../ohlc/hover":1151,"../ohlc/select":1155,"./attributes":962,"./calc":963,"./defaults":964}],966:[function(_dereq_,module,exports){ 'use strict'; var handleAxisDefaults = _dereq_('./axis_defaults'); @@ -215194,7 +216649,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) { }); } -},{"../../plot_api/plot_template":843,"./axis_defaults":987}],983:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":827,"./axis_defaults":971}],967:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -215233,7 +216688,7 @@ function minMax(a, depth) { return [min, max]; } -},{"../../lib":803}],984:[function(_dereq_,module,exports){ +},{"../../lib":787}],968:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -215351,7 +216806,7 @@ module.exports = { transforms: undefined }; -},{"../../components/color/attributes":665,"../../plots/font_attributes":883,"./axis_attributes":986}],985:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../plots/font_attributes":867,"./axis_attributes":970}],969:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -215450,7 +216905,7 @@ module.exports = function(carpet, carpetcd, a, b) { return segments; }; -},{"../../lib":803}],986:[function(_dereq_,module,exports){ +},{"../../lib":787}],970:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -215935,7 +217390,7 @@ module.exports = { editType: 'calc' }; -},{"../../components/color/attributes":665,"../../plot_api/edit_types":836,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/layout_attributes":869,"../../plots/font_attributes":883}],987:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../plot_api/edit_types":820,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/layout_attributes":853,"../../plots/font_attributes":867}],971:[function(_dereq_,module,exports){ 'use strict'; var carpetAttrs = _dereq_('./attributes'); @@ -216155,7 +217610,7 @@ function setAutoType(ax, data) { }); } -},{"../../components/color":666,"../../lib":803,"../../plots/cartesian/axis_autotype":855,"../../plots/cartesian/category_order_defaults":859,"../../plots/cartesian/set_convert":875,"../../plots/cartesian/tick_label_defaults":876,"../../plots/cartesian/tick_value_defaults":878,"../../registry":931,"./attributes":984}],988:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plots/cartesian/axis_autotype":839,"../../plots/cartesian/category_order_defaults":843,"../../plots/cartesian/set_convert":859,"../../plots/cartesian/tick_label_defaults":860,"../../plots/cartesian/tick_value_defaults":862,"../../registry":915,"./attributes":968}],972:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -216257,7 +217712,7 @@ module.exports = function calc(gd, trace) { return [t]; }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../heatmap/clean_2d_array":1087,"../heatmap/convert_column_xyz":1089,"./array_minmax":983,"./calc_clippath":989,"./calc_gridlines":990,"./calc_labels":991,"./cheater_basis":993,"./set_convert":1006,"./smooth_fill_2d_array":1007}],989:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../heatmap/clean_2d_array":1071,"../heatmap/convert_column_xyz":1073,"./array_minmax":967,"./calc_clippath":973,"./calc_gridlines":974,"./calc_labels":975,"./cheater_basis":977,"./set_convert":990,"./smooth_fill_2d_array":991}],973:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makeClipPath(xctrl, yctrl, aax, bax) { @@ -216300,7 +217755,7 @@ module.exports = function makeClipPath(xctrl, yctrl, aax, bax) { return segments; }; -},{}],990:[function(_dereq_,module,exports){ +},{}],974:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -216635,7 +218090,7 @@ module.exports = function calcGridlines(trace, axisLetter, crossAxisLetter) { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axes":854}],991:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axes":838}],975:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -216688,7 +218143,7 @@ module.exports = function calcLabels(trace, axis) { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axes":854}],992:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axes":838}],976:[function(_dereq_,module,exports){ 'use strict'; /* @@ -216723,7 +218178,7 @@ module.exports = function makeControlPoints(p0, p1, p2, smoothness) { ]]; }; -},{}],993:[function(_dereq_,module,exports){ +},{}],977:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -216783,7 +218238,7 @@ module.exports = function(a, b, cheaterslope) { return data; }; -},{"../../lib":803}],994:[function(_dereq_,module,exports){ +},{"../../lib":787}],978:[function(_dereq_,module,exports){ 'use strict'; var makeControlPoints = _dereq_('./catmull_rom'); @@ -217127,14 +218582,14 @@ module.exports = function computeControlPoints(xe, ye, x, y, asmoothing, bsmooth return [xe, ye]; }; -},{"../../lib":803,"./catmull_rom":992}],995:[function(_dereq_,module,exports){ +},{"../../lib":787,"./catmull_rom":976}],979:[function(_dereq_,module,exports){ 'use strict'; module.exports = { RELATIVE_CULL_TOLERANCE: 1e-6 }; -},{}],996:[function(_dereq_,module,exports){ +},{}],980:[function(_dereq_,module,exports){ 'use strict'; /* @@ -217278,7 +218733,7 @@ module.exports = function(arrays, asmoothing, bsmoothing) { } }; -},{}],997:[function(_dereq_,module,exports){ +},{}],981:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(arrays, asmoothing, bsmoothing) { @@ -217397,7 +218852,7 @@ module.exports = function(arrays, asmoothing, bsmoothing) { } }; -},{}],998:[function(_dereq_,module,exports){ +},{}],982:[function(_dereq_,module,exports){ 'use strict'; /* @@ -217539,7 +218994,7 @@ module.exports = function(arrays, na, nb, asmoothing, bsmoothing) { } }; -},{}],999:[function(_dereq_,module,exports){ +},{}],983:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -217589,7 +219044,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, dfltColor, fullLayou } }; -},{"../../components/color/attributes":665,"../../lib":803,"./ab_defaults":982,"./attributes":984,"./xy_defaults":1008}],1000:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib":787,"./ab_defaults":966,"./attributes":968,"./xy_defaults":992}],984:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -217617,7 +219072,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":984,"./calc":988,"./defaults":999,"./plot":1005}],1001:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":968,"./calc":972,"./defaults":983,"./plot":989}],985:[function(_dereq_,module,exports){ 'use strict'; /* @@ -217645,7 +219100,7 @@ module.exports = function(gd, trace) { return firstAxis; }; -},{}],1002:[function(_dereq_,module,exports){ +},{}],986:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makePath(xp, yp, isBicubic) { @@ -217669,7 +219124,7 @@ module.exports = function makePath(xp, yp, isBicubic) { return path.join(isBicubic ? '' : 'L'); }; -},{}],1003:[function(_dereq_,module,exports){ +},{}],987:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -217698,7 +219153,7 @@ module.exports = function mapArray(out, data, func) { return out; }; -},{"../../lib":803}],1004:[function(_dereq_,module,exports){ +},{"../../lib":787}],988:[function(_dereq_,module,exports){ 'use strict'; module.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) { @@ -217731,7 +219186,7 @@ module.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) { }; }; -},{}],1005:[function(_dereq_,module,exports){ +},{}],989:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -217973,7 +219428,7 @@ function drawAxisTitle(gd, layer, trace, t, xy, dxy, axis, xa, ya, labelOrientat titleJoin.exit().remove(); } -},{"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"./makepath":1002,"./map_1d_array":1003,"./orient_text":1004,"@plotly/d3":58}],1006:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"./makepath":986,"./map_1d_array":987,"./orient_text":988,"@plotly/d3":58}],990:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -218248,7 +219703,7 @@ module.exports = function setConvert(trace) { }; }; -},{"../../lib/search":823,"./compute_control_points":994,"./constants":995,"./create_i_derivative_evaluator":996,"./create_j_derivative_evaluator":997,"./create_spline_evaluator":998}],1007:[function(_dereq_,module,exports){ +},{"../../lib/search":807,"./compute_control_points":978,"./constants":979,"./create_i_derivative_evaluator":980,"./create_j_derivative_evaluator":981,"./create_spline_evaluator":982}],991:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -218462,7 +219917,7 @@ module.exports = function smoothFill2dArray(data, a, b) { return data; }; -},{"../../lib":803}],1008:[function(_dereq_,module,exports){ +},{"../../lib":787}],992:[function(_dereq_,module,exports){ 'use strict'; var isArray1D = _dereq_('../../lib').isArray1D; @@ -218487,7 +219942,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { return true; }; -},{"../../lib":803}],1009:[function(_dereq_,module,exports){ +},{"../../lib":787}],993:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -218583,7 +220038,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/color/attributes":665,"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scattergeo/attributes":1260}],1010:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scattergeo/attributes":1244}],994:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -218636,7 +220091,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../scatter/arrays_to_calcdata":1217,"../scatter/calc_selection":1220,"fast-isnumeric":249}],1011:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../scatter/arrays_to_calcdata":1201,"../scatter/calc_selection":1204,"fast-isnumeric":246}],995:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -218684,7 +220139,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1009}],1012:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":993}],996:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -218701,7 +220156,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1013:[function(_dereq_,module,exports){ +},{}],997:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -218788,7 +220243,7 @@ function makeHoverInfo(pointData, trace, pt) { pointData.extraText = text.join('
'); } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./attributes":1009}],1014:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./attributes":993}],998:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -218818,7 +220273,7 @@ module.exports = { } }; -},{"../../plots/geo":887,"../heatmap/colorbar":1088,"./attributes":1009,"./calc":1010,"./defaults":1011,"./event_data":1012,"./hover":1013,"./plot":1015,"./select":1016,"./style":1017}],1015:[function(_dereq_,module,exports){ +},{"../../plots/geo":871,"../heatmap/colorbar":1072,"./attributes":993,"./calc":994,"./defaults":995,"./event_data":996,"./hover":997,"./plot":999,"./select":1000,"./style":1001}],999:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -218898,7 +220353,7 @@ module.exports = { plot: plot }; -},{"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/topojson_utils":832,"../../plots/cartesian/autorange":853,"./style":1017,"@plotly/d3":58}],1016:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/topojson_utils":816,"../../plots/cartesian/autorange":837,"./style":1001,"@plotly/d3":58}],1000:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -218939,7 +220394,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],1017:[function(_dereq_,module,exports){ +},{}],1001:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -218987,7 +220442,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/color":666,"../../components/colorscale":678,"../../components/drawing":688,"@plotly/d3":58}],1018:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../components/drawing":672,"@plotly/d3":58}],1002:[function(_dereq_,module,exports){ 'use strict'; var choroplethAttrs = _dereq_('../choropleth/attributes'); @@ -219099,7 +220554,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../choropleth/attributes":1009}],1019:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../choropleth/attributes":993}],1003:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -219247,7 +220702,7 @@ module.exports = { convertOnSelect: convertOnSelect }; -},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/geojson_utils":797,"fast-isnumeric":249}],1020:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/geojson_utils":781,"fast-isnumeric":246}],1004:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -219290,7 +220745,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1018}],1021:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1002}],1005:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -219348,7 +220803,7 @@ module.exports = { } }; -},{"../../plots/mapbox":911,"../choropleth/calc":1010,"../choropleth/event_data":1012,"../choropleth/hover":1013,"../choropleth/select":1016,"../heatmap/colorbar":1088,"./attributes":1018,"./defaults":1020,"./plot":1022}],1022:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":895,"../choropleth/calc":994,"../choropleth/event_data":996,"../choropleth/hover":997,"../choropleth/select":1000,"../heatmap/colorbar":1072,"./attributes":1002,"./defaults":1004,"./plot":1006}],1006:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert').convert; @@ -219467,7 +220922,7 @@ module.exports = function createChoroplethMapbox(subplot, calcTrace) { return choroplethMapbox; }; -},{"../../plots/mapbox/constants":909,"./convert":1019}],1023:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":893,"./convert":1003}],1007:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -219655,7 +221110,7 @@ attrs.transforms = undefined; module.exports = attrs; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1024:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1008:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -219691,7 +221146,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale/calc":674}],1025:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658}],1009:[function(_dereq_,module,exports){ 'use strict'; var conePlot = _dereq_('gl-cone3d'); @@ -219830,7 +221285,7 @@ function createConeTrace(scene, data) { module.exports = createConeTrace; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/gl3d/zip3":907,"gl-cone3d":268}],1026:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/gl3d/zip3":891,"gl-cone3d":262}],1010:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -219889,7 +221344,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1023}],1027:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1007}],1011:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -219924,7 +221379,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1023,"./calc":1024,"./convert":1025,"./defaults":1026}],1028:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1007,"./calc":1008,"./convert":1009,"./defaults":1010}],1012:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -220189,7 +221644,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../constants/filter_ops":775,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/font_attributes":883,"../heatmap/attributes":1085,"../scatter/attributes":1218}],1029:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../constants/filter_ops":759,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/font_attributes":867,"../heatmap/attributes":1069,"../scatter/attributes":1202}],1013:[function(_dereq_,module,exports){ 'use strict'; var Colorscale = _dereq_('../../components/colorscale'); @@ -220234,7 +221689,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale":678,"../heatmap/calc":1086,"./end_plus":1039,"./set_contours":1047}],1030:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../heatmap/calc":1070,"./end_plus":1023,"./set_contours":1031}],1014:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(pathinfo, contours) { @@ -220316,7 +221771,7 @@ module.exports = function(pathinfo, contours) { } }; -},{}],1031:[function(_dereq_,module,exports){ +},{}],1015:[function(_dereq_,module,exports){ 'use strict'; var Colorscale = _dereq_('../../components/colorscale'); @@ -220359,7 +221814,7 @@ module.exports = { calc: calc }; -},{"../../components/colorscale":678,"./end_plus":1039,"./make_color_map":1044}],1032:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"./end_plus":1023,"./make_color_map":1028}],1016:[function(_dereq_,module,exports){ 'use strict'; module.exports = { // some constants to help with marching squares algorithm @@ -220429,7 +221884,7 @@ module.exports = { } }; -},{}],1033:[function(_dereq_,module,exports){ +},{}],1017:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -220514,7 +221969,7 @@ function handleConstraintValueDefaults(coerce, contours) { } } -},{"../../components/color":666,"../../constants/filter_ops":775,"./label_defaults":1043,"fast-isnumeric":249}],1034:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/filter_ops":759,"./label_defaults":1027,"fast-isnumeric":246}],1018:[function(_dereq_,module,exports){ 'use strict'; var filterOps = _dereq_('../../constants/filter_ops'); @@ -220585,7 +222040,7 @@ function makeInequalitySettings(operation) { }; } -},{"../../constants/filter_ops":775,"fast-isnumeric":249}],1035:[function(_dereq_,module,exports){ +},{"../../constants/filter_ops":759,"fast-isnumeric":246}],1019:[function(_dereq_,module,exports){ 'use strict'; module.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerce2) { @@ -220606,7 +222061,7 @@ module.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerc if(autoContour || !contourSize) coerce('ncontours'); }; -},{}],1036:[function(_dereq_,module,exports){ +},{}],1020:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -220698,7 +222153,7 @@ function copyPathinfo(pi) { }); } -},{"../../lib":803}],1037:[function(_dereq_,module,exports){ +},{"../../lib":787}],1021:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -220746,7 +222201,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../lib":803,"../heatmap/xyz_defaults":1099,"../scatter/period_defaults":1238,"./attributes":1028,"./constraint_defaults":1033,"./contours_defaults":1035,"./style_defaults":1049}],1038:[function(_dereq_,module,exports){ +},{"../../lib":787,"../heatmap/xyz_defaults":1083,"../scatter/period_defaults":1222,"./attributes":1012,"./constraint_defaults":1017,"./contours_defaults":1019,"./style_defaults":1033}],1022:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -220802,7 +222257,7 @@ module.exports = function emptyPathinfo(contours, plotinfo, cd0) { return pathinfo; }; -},{"../../lib":803,"./constraint_mapping":1034,"./end_plus":1039}],1039:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constraint_mapping":1018,"./end_plus":1023}],1023:[function(_dereq_,module,exports){ 'use strict'; /* @@ -220813,7 +222268,7 @@ module.exports = function endPlus(contours) { return contours.end + contours.size / 1e6; }; -},{}],1040:[function(_dereq_,module,exports){ +},{}],1024:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -221099,7 +222554,7 @@ function getInterpPx(pi, loc, step) { } } -},{"../../lib":803,"./constants":1032}],1041:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constants":1016}],1025:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -221128,7 +222583,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return hoverData; }; -},{"../../components/color":666,"../heatmap/hover":1092}],1042:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../heatmap/hover":1076}],1026:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -221158,7 +222613,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":1028,"./calc":1029,"./colorbar":1031,"./defaults":1037,"./hover":1041,"./plot":1046,"./style":1048}],1043:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1012,"./calc":1013,"./colorbar":1015,"./defaults":1021,"./hover":1025,"./plot":1030,"./style":1032}],1027:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -221179,7 +222634,7 @@ module.exports = function handleLabelDefaults(coerce, layout, lineColor, opts) { if(opts.hasHover !== false) coerce('zhoverformat'); }; -},{"../../lib":803}],1044:[function(_dereq_,module,exports){ +},{"../../lib":787}],1028:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -221255,7 +222710,7 @@ module.exports = function makeColorMap(trace) { ); }; -},{"../../components/colorscale":678,"./end_plus":1039,"@plotly/d3":58}],1045:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"./end_plus":1023,"@plotly/d3":58}],1029:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -221339,7 +222794,7 @@ function getMarchingIndex(val, corners) { return (mi === 15) ? 0 : mi; } -},{"./constants":1032}],1046:[function(_dereq_,module,exports){ +},{"./constants":1016}],1030:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -222021,7 +223476,7 @@ function makeClipMask(cd0) { return z; } -},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/set_convert":875,"../heatmap/plot":1096,"./close_boundaries":1030,"./constants":1032,"./convert_to_constraints":1036,"./empty_pathinfo":1038,"./find_all_paths":1040,"./make_crossings":1045,"@plotly/d3":58}],1047:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/set_convert":859,"../heatmap/plot":1080,"./close_boundaries":1014,"./constants":1016,"./convert_to_constraints":1020,"./empty_pathinfo":1022,"./find_all_paths":1024,"./make_crossings":1029,"@plotly/d3":58}],1031:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -222117,7 +223572,7 @@ function autoContours(start, end, ncontours) { return dummyAx; } -},{"../../lib":803,"../../plots/cartesian/axes":854}],1048:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838}],1032:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -222189,7 +223644,7 @@ module.exports = function style(gd) { heatmapStyle(gd); }; -},{"../../components/drawing":688,"../heatmap/style":1097,"./make_color_map":1044,"@plotly/d3":58}],1049:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../heatmap/style":1081,"./make_color_map":1028,"@plotly/d3":58}],1033:[function(_dereq_,module,exports){ 'use strict'; var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); @@ -222225,7 +223680,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout, handleLabelDefaults(coerce, layout, lineColor, opts); }; -},{"../../components/colorscale/defaults":676,"./label_defaults":1043}],1050:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"./label_defaults":1027}],1034:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -222307,7 +223762,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../contour/attributes":1028,"../heatmap/attributes":1085}],1051:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../contour/attributes":1012,"../heatmap/attributes":1069}],1035:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -222411,7 +223866,7 @@ function heatmappishCalc(gd, trace) { return [cd0]; } -},{"../../components/colorscale/calc":674,"../../lib":803,"../carpet/lookup_carpetid":1001,"../contour/set_contours":1047,"../heatmap/clean_2d_array":1087,"../heatmap/convert_column_xyz":1089,"../heatmap/find_empties":1091,"../heatmap/interp2d":1094,"../heatmap/make_bound_array":1095,"./defaults":1052}],1052:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../lib":787,"../carpet/lookup_carpetid":985,"../contour/set_contours":1031,"../heatmap/clean_2d_array":1071,"../heatmap/convert_column_xyz":1073,"../heatmap/find_empties":1075,"../heatmap/interp2d":1078,"../heatmap/make_bound_array":1079,"./defaults":1036}],1036:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -222471,7 +223926,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../lib":803,"../contour/constraint_defaults":1033,"../contour/contours_defaults":1035,"../contour/style_defaults":1049,"../heatmap/xyz_defaults":1099,"./attributes":1050}],1053:[function(_dereq_,module,exports){ +},{"../../lib":787,"../contour/constraint_defaults":1017,"../contour/contours_defaults":1019,"../contour/style_defaults":1033,"../heatmap/xyz_defaults":1083,"./attributes":1034}],1037:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -222497,7 +223952,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../contour/colorbar":1031,"../contour/style":1048,"./attributes":1050,"./calc":1051,"./defaults":1052,"./plot":1054}],1054:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../contour/colorbar":1015,"../contour/style":1032,"./attributes":1034,"./calc":1035,"./defaults":1036,"./plot":1038}],1038:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -222970,7 +224425,7 @@ function joinAllPaths(trace, pi, perimeter, ab2p, carpet, carpetcd, xa, ya) { return fullpath; } -},{"../../components/drawing":688,"../../lib":803,"../carpet/axis_aligned_line":985,"../carpet/lookup_carpetid":1001,"../carpet/makepath":1002,"../carpet/map_1d_array":1003,"../contour/close_boundaries":1030,"../contour/constants":1032,"../contour/convert_to_constraints":1036,"../contour/empty_pathinfo":1038,"../contour/find_all_paths":1040,"../contour/make_crossings":1045,"../contour/plot":1046,"@plotly/d3":58}],1055:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../carpet/axis_aligned_line":969,"../carpet/lookup_carpetid":985,"../carpet/makepath":986,"../carpet/map_1d_array":987,"../contour/close_boundaries":1014,"../contour/constants":1016,"../contour/convert_to_constraints":1020,"../contour/empty_pathinfo":1022,"../contour/find_all_paths":1024,"../contour/make_crossings":1029,"../contour/plot":1030,"@plotly/d3":58}],1039:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -223056,7 +224511,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scattermapbox/attributes":1283}],1056:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scattermapbox/attributes":1267}],1040:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -223107,7 +224562,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],1057:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],1041:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -223215,7 +224670,7 @@ module.exports = function convert(calcTrace) { return opts; }; -},{"../../components/color":666,"../../components/colorscale":678,"../../constants/numerical":779,"../../lib":803,"../../lib/geojson_utils":797,"fast-isnumeric":249}],1058:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../constants/numerical":763,"../../lib":787,"../../lib/geojson_utils":781,"fast-isnumeric":246}],1042:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -223249,7 +224704,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1055}],1059:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1039}],1043:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -223259,7 +224714,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],1060:[function(_dereq_,module,exports){ +},{}],1044:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -223289,7 +224744,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { return [newPointData]; }; -},{"../../plots/cartesian/axes":854,"../scattermapbox/hover":1288}],1061:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../scattermapbox/hover":1272}],1045:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -223331,7 +224786,7 @@ module.exports = { } }; -},{"../../plots/mapbox":911,"../heatmap/colorbar":1088,"../scattermapbox/format_labels":1287,"./attributes":1055,"./calc":1056,"./defaults":1058,"./event_data":1059,"./hover":1060,"./plot":1062}],1062:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":895,"../heatmap/colorbar":1072,"../scattermapbox/format_labels":1271,"./attributes":1039,"./calc":1040,"./defaults":1042,"./event_data":1043,"./hover":1044,"./plot":1046}],1046:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert'); @@ -223437,7 +224892,7 @@ module.exports = function createDensityMapbox(subplot, calcTrace) { return densityMapbox; }; -},{"../../plots/mapbox/constants":909,"./convert":1057}],1063:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":893,"./convert":1041}],1047:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -223462,7 +224917,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":803}],1064:[function(_dereq_,module,exports){ +},{"../../lib":787}],1048:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -223583,7 +225038,7 @@ function funnelMarker() { return marker; } -},{"../../components/color":666,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218,"./constants":1066}],1065:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202,"./constants":1050}],1049:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -223683,7 +225138,7 @@ function fixNum(a) { return (a === BADNUM) ? 0 : a; } -},{"../../constants/numerical":779,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../scatter/calc_selection":1220,"./arrays_to_calcdata":1063}],1066:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../scatter/calc_selection":1204,"./arrays_to_calcdata":1047}],1050:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -223694,7 +225149,7 @@ module.exports = { ] }; -},{}],1067:[function(_dereq_,module,exports){ +},{}],1051:[function(_dereq_,module,exports){ 'use strict'; var setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions; @@ -223757,7 +225212,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../bar/cross_trace_calc":944}],1068:[function(_dereq_,module,exports){ +},{"../bar/cross_trace_calc":928}],1052:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -223851,7 +225306,7 @@ module.exports = { crossTraceDefaults: crossTraceDefaults }; -},{"../../components/color":666,"../../lib":803,"../bar/defaults":945,"../scatter/period_defaults":1238,"../scatter/xy_defaults":1245,"./attributes":1064}],1069:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/defaults":929,"../scatter/period_defaults":1222,"../scatter/xy_defaults":1229,"./attributes":1048}],1053:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { @@ -223870,7 +225325,7 @@ module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { return out; }; -},{}],1070:[function(_dereq_,module,exports){ +},{}],1054:[function(_dereq_,module,exports){ 'use strict'; var opacity = _dereq_('../../components/color').opacity; @@ -223935,7 +225390,7 @@ function getTraceColor(trace, di) { else if(opacity(mlc) && mlw) return mlc; } -},{"../../components/color":666,"../../lib":803,"../bar/hover":948}],1071:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/hover":932}],1055:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -223968,7 +225423,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../bar/select":953,"./attributes":1064,"./calc":1065,"./cross_trace_calc":1067,"./defaults":1068,"./event_data":1069,"./hover":1070,"./layout_attributes":1072,"./layout_defaults":1073,"./plot":1074,"./style":1075}],1072:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../bar/select":937,"./attributes":1048,"./calc":1049,"./cross_trace_calc":1051,"./defaults":1052,"./event_data":1053,"./hover":1054,"./layout_attributes":1056,"./layout_defaults":1057,"./plot":1058,"./style":1059}],1056:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -224010,7 +225465,7 @@ module.exports = { } }; -},{}],1073:[function(_dereq_,module,exports){ +},{}],1057:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224039,7 +225494,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"./layout_attributes":1072}],1074:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1056}],1058:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -224200,7 +225655,7 @@ function getXY(di, xa, ya, isHorizontal) { return isHorizontal ? [s, p] : [p, s]; } -},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../bar/plot":952,"../bar/uniform_text":957,"@plotly/d3":58}],1075:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../bar/plot":936,"../bar/uniform_text":941,"@plotly/d3":58}],1059:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -224257,7 +225712,7 @@ module.exports = { style: style }; -},{"../../components/color":666,"../../components/drawing":688,"../../constants/interactions":778,"../bar/style":955,"../bar/uniform_text":957,"@plotly/d3":58}],1076:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/interactions":762,"../bar/style":939,"../bar/uniform_text":941,"@plotly/d3":58}],1060:[function(_dereq_,module,exports){ 'use strict'; var pieAttrs = _dereq_('../pie/attributes'); @@ -224360,7 +225815,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192}],1077:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176}],1061:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -224375,7 +225830,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1078:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1062:[function(_dereq_,module,exports){ 'use strict'; var pieCalc = _dereq_('../pie/calc'); @@ -224393,7 +225848,7 @@ module.exports = { crossTraceCalc: crossTraceCalc }; -},{"../pie/calc":1194}],1079:[function(_dereq_,module,exports){ +},{"../pie/calc":1178}],1063:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224467,7 +225922,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('baseratio'); }; -},{"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"../pie/defaults":1195,"./attributes":1076}],1080:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"../pie/defaults":1179,"./attributes":1060}],1064:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -224498,7 +225953,7 @@ module.exports = { } }; -},{"../pie/style_one":1203,"./attributes":1076,"./base_plot":1077,"./calc":1078,"./defaults":1079,"./layout_attributes":1081,"./layout_defaults":1082,"./plot":1083,"./style":1084}],1081:[function(_dereq_,module,exports){ +},{"../pie/style_one":1187,"./attributes":1060,"./base_plot":1061,"./calc":1062,"./defaults":1063,"./layout_attributes":1065,"./layout_defaults":1066,"./plot":1067,"./style":1068}],1065:[function(_dereq_,module,exports){ 'use strict'; var hiddenlabels = _dereq_('../pie/layout_attributes').hiddenlabels; @@ -224533,7 +225988,7 @@ module.exports = { } }; -},{"../pie/layout_attributes":1199}],1082:[function(_dereq_,module,exports){ +},{"../pie/layout_attributes":1183}],1066:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224550,7 +226005,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendfunnelareacolors'); }; -},{"../../lib":803,"./layout_attributes":1081}],1083:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1065}],1067:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -224840,7 +226295,7 @@ function setCoords(cd) { } } -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../bar/plot":952,"../bar/uniform_text":957,"../pie/helpers":1197,"../pie/plot":1201,"@plotly/d3":58}],1084:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../bar/plot":936,"../bar/uniform_text":941,"../pie/helpers":1181,"../pie/plot":1185,"@plotly/d3":58}],1068:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -224865,7 +226320,7 @@ module.exports = function style(gd) { }); }; -},{"../bar/uniform_text":957,"../pie/style_one":1203,"@plotly/d3":58}],1085:[function(_dereq_,module,exports){ +},{"../bar/uniform_text":941,"../pie/style_one":1187,"@plotly/d3":58}],1069:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -224991,7 +226446,7 @@ module.exports = extendFlat({ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1086:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1070:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -225192,7 +226647,7 @@ function dropZonBreaks(x, y, z) { return newZ; } -},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../../registry":931,"../histogram2d/calc":1118,"./clean_2d_array":1087,"./convert_column_xyz":1089,"./find_empties":1091,"./interp2d":1094,"./make_bound_array":1095}],1087:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../../registry":915,"../histogram2d/calc":1102,"./clean_2d_array":1071,"./convert_column_xyz":1073,"./find_empties":1075,"./interp2d":1078,"./make_bound_array":1079}],1071:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -225261,7 +226716,7 @@ module.exports = function clean2dArray(zOld, trace, xa, ya) { return zNew; }; -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],1088:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],1072:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -225269,7 +226724,7 @@ module.exports = { max: 'zmax' }; -},{}],1089:[function(_dereq_,module,exports){ +},{}],1073:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -225350,7 +226805,7 @@ module.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name, trace._after2before = after2before; }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851}],1090:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835}],1074:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -225389,7 +226844,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../scatter/period_defaults":1238,"./attributes":1085,"./style_defaults":1098,"./xyz_defaults":1099}],1091:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../scatter/period_defaults":1222,"./attributes":1069,"./style_defaults":1082,"./xyz_defaults":1083}],1075:[function(_dereq_,module,exports){ 'use strict'; var maxRowLength = _dereq_('../../lib').maxRowLength; @@ -225486,7 +226941,7 @@ module.exports = function findEmpties(z) { return empties.sort(function(a, b) { return b[2] - a[2]; }); }; -},{"../../lib":803}],1092:[function(_dereq_,module,exports){ +},{"../../lib":787}],1076:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -225619,7 +227074,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { })]; }; -},{"../../components/colorscale":678,"../../components/fx":706,"../../lib":803,"../../plots/cartesian/axes":854}],1093:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/fx":690,"../../lib":787,"../../plots/cartesian/axes":838}],1077:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -225663,7 +227118,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":1085,"./calc":1086,"./colorbar":1088,"./defaults":1090,"./hover":1092,"./plot":1096,"./style":1097}],1094:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1069,"./calc":1070,"./colorbar":1072,"./defaults":1074,"./hover":1076,"./plot":1080,"./style":1081}],1078:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -225788,7 +227243,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../lib":803}],1095:[function(_dereq_,module,exports){ +},{"../../lib":787}],1079:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -225868,7 +227323,7 @@ module.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks, return arrayOut; }; -},{"../../lib":803,"../../registry":931}],1096:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1080:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -226264,7 +227719,7 @@ function putColor(pixels, pxIndex, c) { pixels[pxIndex + 3] = Math.round(c[3] * 255); } -},{"../../components/colorscale":678,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../registry":931,"@plotly/d3":58,"tinycolor2":598}],1097:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../registry":915,"@plotly/d3":58,"tinycolor2":583}],1081:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -226276,7 +227731,7 @@ module.exports = function style(gd) { }); }; -},{"@plotly/d3":58}],1098:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],1082:[function(_dereq_,module,exports){ 'use strict'; module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) { @@ -226290,7 +227745,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) { coerce('zhoverformat'); }; -},{}],1099:[function(_dereq_,module,exports){ +},{}],1083:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -226381,7 +227836,7 @@ function isValidZ(z) { return (allRowsAreArrays && oneRowIsFilled && hasOneNumber); } -},{"../../lib":803,"../../registry":931,"fast-isnumeric":249}],1100:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"fast-isnumeric":246}],1084:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -226420,7 +227875,7 @@ extendFlat( module.exports = overrideAll(attrs, 'calc', 'nested'); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../heatmap/attributes":1085}],1101:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../heatmap/attributes":1069}],1085:[function(_dereq_,module,exports){ 'use strict'; var createHeatmap2D = _dereq_('gl-heatmap2d'); @@ -226563,7 +228018,7 @@ function createHeatmap(scene, fullTrace, calcTrace) { module.exports = createHeatmap; -},{"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"gl-heatmap2d":278}],1102:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"gl-heatmap2d":272}],1086:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -226590,7 +228045,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../heatmap/xyz_defaults":1099,"./attributes":1100}],1103:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../heatmap/xyz_defaults":1083,"./attributes":1084}],1087:[function(_dereq_,module,exports){ 'use strict'; var deprecationWarning = [ @@ -226620,7 +228075,7 @@ module.exports = { } }; -},{"../../plots/gl2d":894,"../heatmap/calc":1086,"../heatmap/colorbar":1088,"./attributes":1100,"./convert":1101,"./defaults":1102}],1104:[function(_dereq_,module,exports){ +},{"../../plots/gl2d":878,"../heatmap/calc":1070,"../heatmap/colorbar":1072,"./attributes":1084,"./convert":1085,"./defaults":1086}],1088:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -226834,7 +228289,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"./bin_attributes":1106,"./constants":1110}],1105:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"./bin_attributes":1090,"./constants":1094}],1089:[function(_dereq_,module,exports){ 'use strict'; @@ -226850,7 +228305,7 @@ module.exports = function doAvg(size, counts) { return total; }; -},{}],1106:[function(_dereq_,module,exports){ +},{}],1090:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makeBinAttrs(axLetter, match) { @@ -226915,7 +228370,7 @@ module.exports = function makeBinAttrs(axLetter, match) { }; }; -},{}],1107:[function(_dereq_,module,exports){ +},{}],1091:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -226980,7 +228435,7 @@ module.exports = { } }; -},{"fast-isnumeric":249}],1108:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246}],1092:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -227147,7 +228602,7 @@ function dateParts(v, pa, calendar) { return parts; } -},{"../../constants/numerical":779,"../../plots/cartesian/axes":854}],1109:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../plots/cartesian/axes":838}],1093:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -227718,14 +229173,14 @@ module.exports = { calcAllAutoBins: calcAllAutoBins }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"../bar/arrays_to_calcdata":940,"./average":1105,"./bin_functions":1107,"./bin_label_vals":1108,"./norm_functions":1116,"fast-isnumeric":249}],1110:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"../bar/arrays_to_calcdata":924,"./average":1089,"./bin_functions":1091,"./bin_label_vals":1092,"./norm_functions":1100,"fast-isnumeric":246}],1094:[function(_dereq_,module,exports){ 'use strict'; module.exports = { eventDataKeys: ['binNumber'] }; -},{}],1111:[function(_dereq_,module,exports){ +},{}],1095:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -227994,7 +229449,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":803,"../../plots/cartesian/axis_ids":858,"../../plots/cartesian/constraints":862,"../../registry":931,"../bar/defaults":945}],1112:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axis_ids":842,"../../plots/cartesian/constraints":846,"../../registry":915,"../bar/defaults":929}],1096:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -228062,7 +229517,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":666,"../../lib":803,"../../registry":931,"../bar/style_defaults":956,"./attributes":1104}],1113:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../registry":915,"../bar/style_defaults":940,"./attributes":1088}],1097:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -228103,7 +229558,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1114:[function(_dereq_,module,exports){ +},{}],1098:[function(_dereq_,module,exports){ 'use strict'; var barHover = _dereq_('../bar/hover').hoverPoints; @@ -228127,7 +229582,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return pts; }; -},{"../../plots/cartesian/axes":854,"../bar/hover":948}],1115:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../bar/hover":932}],1099:[function(_dereq_,module,exports){ 'use strict'; /** @@ -228175,7 +229630,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../bar/cross_trace_calc":944,"../bar/layout_attributes":950,"../bar/layout_defaults":951,"../bar/plot":952,"../bar/select":953,"../bar/style":955,"../scatter/marker_colorbar":1236,"./attributes":1104,"./calc":1109,"./cross_trace_defaults":1111,"./defaults":1112,"./event_data":1113,"./hover":1114}],1116:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../bar/cross_trace_calc":928,"../bar/layout_attributes":934,"../bar/layout_defaults":935,"../bar/plot":936,"../bar/select":937,"../bar/style":939,"../scatter/marker_colorbar":1220,"./attributes":1088,"./calc":1093,"./cross_trace_defaults":1095,"./defaults":1096,"./event_data":1097,"./hover":1098}],1100:[function(_dereq_,module,exports){ 'use strict'; @@ -228201,7 +229656,7 @@ module.exports = { } }; -},{}],1117:[function(_dereq_,module,exports){ +},{}],1101:[function(_dereq_,module,exports){ 'use strict'; var histogramAttrs = _dereq_('../histogram/attributes'); @@ -228278,7 +229733,7 @@ module.exports = extendFlat( colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../heatmap/attributes":1085,"../histogram/attributes":1104,"../histogram/bin_attributes":1106}],1118:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../heatmap/attributes":1069,"../histogram/attributes":1088,"../histogram/bin_attributes":1090}],1102:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -228489,7 +229944,7 @@ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) { return out; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"../histogram/average":1105,"../histogram/bin_functions":1107,"../histogram/bin_label_vals":1108,"../histogram/calc":1109,"../histogram/norm_functions":1116}],1119:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../histogram/average":1089,"../histogram/bin_functions":1091,"../histogram/bin_label_vals":1092,"../histogram/calc":1093,"../histogram/norm_functions":1100}],1103:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -228515,7 +229970,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('yhoverformat'); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../heatmap/style_defaults":1098,"./attributes":1117,"./sample_defaults":1122}],1120:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../heatmap/style_defaults":1082,"./attributes":1101,"./sample_defaults":1106}],1104:[function(_dereq_,module,exports){ 'use strict'; var heatmapHover = _dereq_('../heatmap/hover'); @@ -228541,7 +229996,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return pts; }; -},{"../../plots/cartesian/axes":854,"../heatmap/hover":1092}],1121:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../heatmap/hover":1076}],1105:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -228573,7 +230028,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../heatmap/calc":1086,"../heatmap/colorbar":1088,"../heatmap/plot":1096,"../heatmap/style":1097,"../histogram/cross_trace_defaults":1111,"../histogram/event_data":1113,"./attributes":1117,"./defaults":1119,"./hover":1120}],1122:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../heatmap/calc":1070,"../heatmap/colorbar":1072,"../heatmap/plot":1080,"../heatmap/style":1081,"../histogram/cross_trace_defaults":1095,"../histogram/event_data":1097,"./attributes":1101,"./defaults":1103,"./hover":1104}],1106:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -228610,7 +230065,7 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout coerce('autobiny'); }; -},{"../../lib":803,"../../registry":931}],1123:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1107:[function(_dereq_,module,exports){ 'use strict'; var histogram2dAttrs = _dereq_('../histogram2d/attributes'); @@ -228663,7 +230118,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../contour/attributes":1028,"../histogram2d/attributes":1117}],1124:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../contour/attributes":1012,"../histogram2d/attributes":1101}],1108:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -228693,7 +230148,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('yhoverformat'); }; -},{"../../lib":803,"../contour/contours_defaults":1035,"../contour/style_defaults":1049,"../histogram2d/sample_defaults":1122,"./attributes":1123}],1125:[function(_dereq_,module,exports){ +},{"../../lib":787,"../contour/contours_defaults":1019,"../contour/style_defaults":1033,"../histogram2d/sample_defaults":1106,"./attributes":1107}],1109:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -228724,7 +230179,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../contour/calc":1029,"../contour/colorbar":1031,"../contour/hover":1041,"../contour/plot":1046,"../contour/style":1048,"../histogram/cross_trace_defaults":1111,"./attributes":1123,"./defaults":1124}],1126:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../contour/calc":1013,"../contour/colorbar":1015,"../contour/hover":1025,"../contour/plot":1030,"../contour/style":1032,"../histogram/cross_trace_defaults":1095,"./attributes":1107,"./defaults":1108}],1110:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -228824,7 +230279,7 @@ module.exports = { domain: domainAttrs({name: 'icicle', trace: true, editType: 'calc'}), }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"../sunburst/attributes":1330,"../treemap/attributes":1356,"../treemap/constants":1359}],1127:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"../sunburst/attributes":1314,"../treemap/attributes":1340,"../treemap/constants":1343}],1111:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -228839,7 +230294,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1128:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1112:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('../sunburst/calc'); @@ -228852,7 +230307,7 @@ exports.crossTraceCalc = function(gd) { return calc._runCrossTraceCalc('icicle', gd); }; -},{"../sunburst/calc":1332}],1129:[function(_dereq_,module,exports){ +},{"../sunburst/calc":1316}],1113:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -228955,7 +230410,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/color":666,"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/constants":943,"../bar/defaults":945,"./attributes":1126}],1130:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/constants":927,"../bar/defaults":929,"./attributes":1110}],1114:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -229163,7 +230618,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) { return nextOfPrevEntry; }; -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"../sunburst/plot":1340,"../treemap/constants":1359,"./partition":1134,"./style":1136,"@plotly/d3":58}],1131:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"../sunburst/plot":1324,"../treemap/constants":1343,"./partition":1118,"./style":1120,"@plotly/d3":58}],1115:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -229195,7 +230650,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":1236,"./attributes":1126,"./base_plot":1127,"./calc":1128,"./defaults":1129,"./layout_attributes":1132,"./layout_defaults":1133,"./plot":1135,"./style":1136}],1132:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1220,"./attributes":1110,"./base_plot":1111,"./calc":1112,"./defaults":1113,"./layout_attributes":1116,"./layout_defaults":1117,"./plot":1119,"./style":1120}],1116:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -229226,7 +230681,7 @@ module.exports = { } }; -},{}],1133:[function(_dereq_,module,exports){ +},{}],1117:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -229240,7 +230695,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendiciclecolors'); }; -},{"../../lib":803,"./layout_attributes":1132}],1134:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1116}],1118:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -229276,7 +230731,7 @@ module.exports = function partition(entry, size, opts) { return result; }; -},{"../treemap/flip_tree":1364,"d3-hierarchy":170}],1135:[function(_dereq_,module,exports){ +},{"../treemap/flip_tree":1348,"d3-hierarchy":167}],1119:[function(_dereq_,module,exports){ 'use strict'; var draw = _dereq_('../treemap/draw'); @@ -229289,7 +230744,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall }); }; -},{"../treemap/draw":1361,"./draw_descendants":1130}],1136:[function(_dereq_,module,exports){ +},{"../treemap/draw":1345,"./draw_descendants":1114}],1120:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -229332,7 +230787,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"@plotly/d3":58}],1137:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"@plotly/d3":58}],1121:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -229460,7 +230915,7 @@ module.exports = extendFlat({ transforms: undefined }); -},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"./constants":1139}],1138:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"./constants":1123}],1122:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -229550,7 +231005,7 @@ function makeScaler(trace) { }; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./constants":1139,"./helpers":1142,"fast-isnumeric":249}],1139:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./constants":1123,"./helpers":1126,"fast-isnumeric":246}],1123:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -229616,7 +231071,7 @@ module.exports = { ].join('; ') }; -},{}],1140:[function(_dereq_,module,exports){ +},{}],1124:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -229666,7 +231121,7 @@ module.exports = function supplyDefaults(traceIn, traceOut) { traceOut._length = null; }; -},{"../../lib":803,"../../snapshot/helpers":935,"./attributes":1137,"./constants":1139}],1141:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../snapshot/helpers":919,"./attributes":1121,"./constants":1123}],1125:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -229680,7 +231135,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],1142:[function(_dereq_,module,exports){ +},{}],1126:[function(_dereq_,module,exports){ 'use strict'; var probeSync = _dereq_('probe-image-size/sync'); @@ -229693,7 +231148,7 @@ exports.getImageSize = function(src) { return probeSync(buff); }; -},{"../../snapshot/helpers":935,"buffer/":117,"probe-image-size/sync":527}],1143:[function(_dereq_,module,exports){ +},{"../../snapshot/helpers":919,"buffer/":117,"probe-image-size/sync":513}],1127:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -229785,7 +231240,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { })]; }; -},{"../../components/fx":706,"../../lib":803,"./constants":1139}],1144:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../lib":787,"./constants":1123}],1128:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -229814,7 +231269,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":1137,"./calc":1138,"./defaults":1140,"./event_data":1141,"./hover":1143,"./plot":1145,"./style":1146}],1145:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1121,"./calc":1122,"./defaults":1124,"./event_data":1125,"./hover":1127,"./plot":1129,"./style":1130}],1129:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -230037,7 +231492,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) { }); }; -},{"../../constants/xmlns_namespaces":780,"../../lib":803,"./constants":1139,"@plotly/d3":58}],1146:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":764,"../../lib":787,"./constants":1123,"@plotly/d3":58}],1130:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -230049,7 +231504,7 @@ module.exports = function style(gd) { }); }; -},{"@plotly/d3":58}],1147:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],1131:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -230409,7 +231864,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../constants/delta.js":773,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/layout_attributes":869,"../../plots/domain":882,"../../plots/font_attributes":883}],1148:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../constants/delta.js":757,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/layout_attributes":853,"../../plots/domain":866,"../../plots/font_attributes":867}],1132:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -230424,7 +231879,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1149:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1133:[function(_dereq_,module,exports){ 'use strict'; // var Lib = require('../../lib'); @@ -230453,7 +231908,7 @@ module.exports = { calc: calc }; -},{}],1150:[function(_dereq_,module,exports){ +},{}],1134:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -230467,7 +231922,7 @@ module.exports = { horizontalPadding: 10 }; -},{}],1151:[function(_dereq_,module,exports){ +},{}],1135:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -230626,7 +232081,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../../plots/cartesian/tick_label_defaults":876,"../../plots/cartesian/tick_mark_defaults":877,"../../plots/cartesian/tick_value_defaults":878,"../../plots/domain":882,"./attributes":1147,"./constants.js":1150}],1152:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../../plots/cartesian/tick_label_defaults":860,"../../plots/cartesian/tick_mark_defaults":861,"../../plots/cartesian/tick_value_defaults":862,"../../plots/domain":866,"./attributes":1131,"./constants.js":1134}],1136:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -230654,7 +232109,7 @@ module.exports = { } }; -},{"./attributes":1147,"./base_plot":1148,"./calc":1149,"./defaults":1151,"./plot":1153}],1153:[function(_dereq_,module,exports){ +},{"./attributes":1131,"./base_plot":1132,"./calc":1133,"./defaults":1135,"./plot":1137}],1137:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -231528,7 +232983,7 @@ function cache(trace, name, initialValue, value, key, fn) { return v; } -},{"../../components/color":666,"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_defaults":856,"../../plots/cartesian/layout_attributes":869,"../../plots/cartesian/position_defaults":872,"./constants":1150,"@plotly/d3":58,"d3-interpolate":171}],1154:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_defaults":840,"../../plots/cartesian/layout_attributes":853,"../../plots/cartesian/position_defaults":856,"./constants":1134,"@plotly/d3":58,"d3-interpolate":168}],1138:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -231766,7 +233221,7 @@ attrs.flatshading.dflt = true; attrs.lighting.facenormalsepsilon.dflt = 0; attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1155:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1139:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -231813,7 +233268,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale/calc":674,"../streamtube/calc":1326}],1156:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../streamtube/calc":1310}],1140:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -232861,7 +234316,7 @@ module.exports = { createIsosurfaceTrace: createIsosurfaceTrace, }; -},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"gl-mesh3d":315}],1157:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"gl-mesh3d":309}],1141:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -232973,7 +234428,7 @@ module.exports = { supplyIsoDefaults: supplyIsoDefaults }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1154}],1158:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1138}],1142:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -233000,7 +234455,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1154,"./calc":1155,"./convert":1156,"./defaults":1157}],1159:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1138,"./calc":1139,"./convert":1140,"./defaults":1141}],1143:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -233242,7 +234697,7 @@ colorScaleAttrs('', { showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) }); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../surface/attributes":1342}],1160:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../surface/attributes":1326}],1144:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -233257,7 +234712,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":674}],1161:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658}],1145:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -233452,7 +234907,7 @@ function createMesh3DTrace(scene, data) { module.exports = createMesh3DTrace; -},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"alpha-shape":75,"convex-hull":141,"delaunay-triangulate":180,"gl-mesh3d":315}],1162:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"alpha-shape":75,"convex-hull":141,"delaunay-triangulate":177,"gl-mesh3d":309}],1146:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -233548,7 +235003,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1159}],1163:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1143}],1147:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -233577,7 +235032,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1159,"./calc":1160,"./convert":1161,"./defaults":1162}],1164:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1143,"./calc":1144,"./convert":1145,"./defaults":1146}],1148:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib').extendFlat; @@ -233715,7 +235170,7 @@ module.exports = { }), }; -},{"../../components/drawing/attributes":687,"../../components/fx/attributes":697,"../../constants/delta.js":773,"../../lib":803,"../../plots/cartesian/axis_format_attributes":857,"../scatter/attributes":1218}],1165:[function(_dereq_,module,exports){ +},{"../../components/drawing/attributes":671,"../../components/fx/attributes":681,"../../constants/delta.js":757,"../../lib":787,"../../plots/cartesian/axis_format_attributes":841,"../scatter/attributes":1202}],1149:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -233888,7 +235343,7 @@ module.exports = { calcCommon: calcCommon }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854}],1166:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838}],1150:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -233930,7 +235385,7 @@ function handleDirection(traceIn, traceOut, coerce, direction) { coerce(direction + '.line.dash', traceOut.line.dash); } -},{"../../lib":803,"../scatter/period_defaults":1238,"./attributes":1164,"./ohlc_defaults":1169}],1167:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/period_defaults":1222,"./attributes":1148,"./ohlc_defaults":1153}],1151:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -234129,7 +235584,7 @@ module.exports = { hoverOnPoints: hoverOnPoints }; -},{"../../components/color":666,"../../components/fx":706,"../../constants/delta.js":773,"../../lib":803,"../../plots/cartesian/axes":854}],1168:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../constants/delta.js":757,"../../lib":787,"../../plots/cartesian/axes":838}],1152:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -234162,7 +235617,7 @@ module.exports = { selectPoints: _dereq_('./select') }; -},{"../../plots/cartesian":868,"./attributes":1164,"./calc":1165,"./defaults":1166,"./hover":1167,"./plot":1170,"./select":1171,"./style":1172}],1169:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1148,"./calc":1149,"./defaults":1150,"./hover":1151,"./plot":1154,"./select":1155,"./style":1156}],1153:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -234189,7 +235644,7 @@ module.exports = function handleOHLC(traceIn, traceOut, coerce, layout) { return len; }; -},{"../../lib":803,"../../registry":931}],1170:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1154:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -234239,7 +235694,7 @@ module.exports = function plot(gd, plotinfo, cdOHLC, ohlcLayer) { }); }; -},{"../../lib":803,"@plotly/d3":58}],1171:[function(_dereq_,module,exports){ +},{"../../lib":787,"@plotly/d3":58}],1155:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -234276,7 +235731,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],1172:[function(_dereq_,module,exports){ +},{}],1156:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -234307,7 +235762,7 @@ module.exports = function style(gd, cd, sel) { }); }; -},{"../../components/color":666,"../../components/drawing":688,"@plotly/d3":58}],1173:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"@plotly/d3":58}],1157:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -234514,7 +235969,7 @@ module.exports = { showlegend: undefined }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1174:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1158:[function(_dereq_,module,exports){ 'use strict'; var getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData; @@ -234541,7 +235996,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/get_data":891,"./plot":1179}],1175:[function(_dereq_,module,exports){ +},{"../../plots/get_data":875,"./plot":1163}],1159:[function(_dereq_,module,exports){ 'use strict'; // Requirements @@ -235052,7 +236507,7 @@ function isRangePermutation(inds) { return true; } -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"../../components/drawing":688,"../../lib":803,"../../lib/filter_unique.js":794,"../../lib/gup":800,"fast-isnumeric":249}],1176:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"../../components/drawing":672,"../../lib":787,"../../lib/filter_unique.js":778,"../../lib/gup":784,"fast-isnumeric":246}],1160:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -235165,7 +236620,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceFont(coerce, 'tickfont', categoryfontDefault); }; -},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/domain":882,"../parcoords/merge_length":1189,"./attributes":1173}],1177:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/domain":866,"../parcoords/merge_length":1173,"./attributes":1157}],1161:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -235190,7 +236645,7 @@ module.exports = { } }; -},{"./attributes":1173,"./base_plot":1174,"./calc":1175,"./defaults":1176,"./plot":1179}],1178:[function(_dereq_,module,exports){ +},{"./attributes":1157,"./base_plot":1158,"./calc":1159,"./defaults":1160,"./plot":1163}],1162:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -237339,7 +238794,7 @@ function createDimensionViewModel(parcatsViewModel, dimensionModel) { * The parent trace's view model */ -},{"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_api":840,"@plotly/d3":58,"d3-interpolate":171,"tinycolor2":598}],1179:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_api":824,"@plotly/d3":58,"d3-interpolate":168,"tinycolor2":583}],1163:[function(_dereq_,module,exports){ 'use strict'; @@ -237375,7 +238830,7 @@ module.exports = function plot(graphDiv, parcatsModels, transitionOpts, makeOnCo ); }; -},{"./parcats":1178}],1180:[function(_dereq_,module,exports){ +},{"./parcats":1162}],1164:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -237514,7 +238969,7 @@ module.exports = { ) }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/layout_attributes":869,"../../plots/domain":882,"../../plots/font_attributes":883}],1181:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/layout_attributes":853,"../../plots/domain":866,"../../plots/font_attributes":867}],1165:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -238051,7 +239506,7 @@ module.exports = { cleanRanges: cleanRanges }; -},{"../../lib":803,"../../lib/gup":800,"./constants":1184,"@plotly/d3":58}],1182:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/gup":784,"./constants":1168,"@plotly/d3":58}],1166:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -238110,7 +239565,7 @@ exports.toSVG = function(gd) { }, 60); }; -},{"../../constants/xmlns_namespaces":780,"../../plots/get_data":891,"./plot":1191,"@plotly/d3":58}],1183:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":764,"../../plots/get_data":875,"./plot":1175,"@plotly/d3":58}],1167:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -238146,7 +239601,7 @@ function constHalf(len) { return out; } -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gup":800}],1184:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gup":784}],1168:[function(_dereq_,module,exports){ 'use strict'; @@ -238199,7 +239654,7 @@ module.exports = { } }; -},{}],1185:[function(_dereq_,module,exports){ +},{}],1169:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -238311,7 +239766,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('labelside'); }; -},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"../../plots/domain":882,"./attributes":1180,"./axisbrush":1181,"./constants":1184,"./merge_length":1189}],1186:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"../../plots/domain":866,"./attributes":1164,"./axisbrush":1165,"./constants":1168,"./merge_length":1173}],1170:[function(_dereq_,module,exports){ 'use strict'; var isTypedArray = _dereq_('../../lib').isTypedArray; @@ -238328,7 +239783,7 @@ exports.isVisible = function(dimension) { return dimension.visible || !('visible' in dimension); }; -},{"../../lib":803}],1187:[function(_dereq_,module,exports){ +},{"../../lib":787}],1171:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -238355,7 +239810,7 @@ module.exports = { } }; -},{"./attributes":1180,"./base_plot":1182,"./calc":1183,"./defaults":1185,"./plot":1191}],1188:[function(_dereq_,module,exports){ +},{"./attributes":1164,"./base_plot":1166,"./calc":1167,"./defaults":1169,"./plot":1175}],1172:[function(_dereq_,module,exports){ 'use strict'; var glslify = _dereq_('glslify'); @@ -238899,7 +240354,7 @@ module.exports = function(canvasGL, d) { }; }; -},{"../../lib":803,"./constants":1184,"glslify":442}],1189:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constants":1168,"glslify":434}],1173:[function(_dereq_,module,exports){ 'use strict'; /** @@ -238929,7 +240384,7 @@ module.exports = function(traceOut, dimensions, dataAttr, len) { return len; }; -},{}],1190:[function(_dereq_,module,exports){ +},{}],1174:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -239690,7 +241145,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) { brush.ensureAxisBrush(axisOverlays, paperColor); }; -},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"./axisbrush":1181,"./constants":1184,"./helpers":1186,"./lines":1188,"@plotly/d3":58,"color-rgba":133}],1191:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"./axisbrush":1165,"./constants":1168,"./helpers":1170,"./lines":1172,"@plotly/d3":58,"color-rgba":133}],1175:[function(_dereq_,module,exports){ 'use strict'; var parcoords = _dereq_('./parcoords'); @@ -239837,7 +241292,7 @@ module.exports = function plot(gd, cdModule) { ); }; -},{"../../lib/prepare_regl":816,"./helpers":1186,"./parcoords":1190}],1192:[function(_dereq_,module,exports){ +},{"../../lib/prepare_regl":800,"./helpers":1170,"./parcoords":1174}],1176:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -240169,7 +241624,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1193:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1177:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -240184,7 +241639,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1194:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1178:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -240359,7 +241814,7 @@ module.exports = { generateExtendedColors: generateExtendedColors }; -},{"../../components/color":666,"fast-isnumeric":249,"tinycolor2":598}],1195:[function(_dereq_,module,exports){ +},{"../../components/color":650,"fast-isnumeric":246,"tinycolor2":583}],1179:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -240482,7 +241937,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"./attributes":1192,"fast-isnumeric":249}],1196:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"./attributes":1176,"fast-isnumeric":246}],1180:[function(_dereq_,module,exports){ 'use strict'; var appendArrayMultiPointValues = _dereq_('../../components/fx/helpers').appendArrayMultiPointValues; @@ -240524,7 +241979,7 @@ module.exports = function eventData(pt, trace) { return out; }; -},{"../../components/fx/helpers":702}],1197:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":686}],1181:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -240564,7 +242019,7 @@ exports.getRotationAngle = function(rotation) { return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180; }; -},{"../../lib":803}],1198:[function(_dereq_,module,exports){ +},{"../../lib":787}],1182:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -240593,7 +242048,7 @@ module.exports = { } }; -},{"./attributes":1192,"./base_plot":1193,"./calc":1194,"./defaults":1195,"./layout_attributes":1199,"./layout_defaults":1200,"./plot":1201,"./style":1202,"./style_one":1203}],1199:[function(_dereq_,module,exports){ +},{"./attributes":1176,"./base_plot":1177,"./calc":1178,"./defaults":1179,"./layout_attributes":1183,"./layout_defaults":1184,"./plot":1185,"./style":1186,"./style_one":1187}],1183:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -240634,7 +242089,7 @@ module.exports = { } }; -},{}],1200:[function(_dereq_,module,exports){ +},{}],1184:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -240651,7 +242106,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendpiecolors'); }; -},{"../../lib":803,"./layout_attributes":1199}],1201:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1183}],1185:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -241831,7 +243286,7 @@ module.exports = { computeTransform: computeTransform }; -},{"../../components/color":666,"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../bar/constants":943,"../bar/uniform_text":957,"./event_data":1196,"./helpers":1197,"@plotly/d3":58}],1202:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../bar/constants":927,"../bar/uniform_text":941,"./event_data":1180,"./helpers":1181,"@plotly/d3":58}],1186:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -241856,7 +243311,7 @@ module.exports = function style(gd) { }); }; -},{"../bar/uniform_text":957,"./style_one":1203,"@plotly/d3":58}],1203:[function(_dereq_,module,exports){ +},{"../bar/uniform_text":941,"./style_one":1187,"@plotly/d3":58}],1187:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -241872,7 +243327,7 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":666,"./helpers":1197}],1204:[function(_dereq_,module,exports){ +},{"../../components/color":650,"./helpers":1181}],1188:[function(_dereq_,module,exports){ 'use strict'; var scatterglAttrs = _dereq_('../scatter/attributes'); @@ -242012,7 +243467,7 @@ module.exports = { transforms: undefined }; -},{"../scatter/attributes":1218}],1205:[function(_dereq_,module,exports){ +},{"../scatter/attributes":1202}],1189:[function(_dereq_,module,exports){ 'use strict'; var createPointCloudRenderer = _dereq_('gl-pointcloud2d'); @@ -242206,7 +243661,7 @@ function createPointcloud(scene, data) { module.exports = createPointcloud; -},{"../../lib/str2rgbarray":828,"../../plots/cartesian/autorange":853,"../scatter/get_trace_color":1228,"gl-pointcloud2d":328}],1206:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":812,"../../plots/cartesian/autorange":837,"../scatter/get_trace_color":1212,"gl-pointcloud2d":321}],1190:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -242245,7 +243700,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor) { traceOut._length = null; }; -},{"../../lib":803,"./attributes":1204}],1207:[function(_dereq_,module,exports){ +},{"../../lib":787,"./attributes":1188}],1191:[function(_dereq_,module,exports){ 'use strict'; var deprecationWarning = [ @@ -242274,7 +243729,7 @@ module.exports = { } }; -},{"../../plots/gl2d":894,"../scatter3d/calc":1247,"./attributes":1204,"./convert":1205,"./defaults":1206}],1208:[function(_dereq_,module,exports){ +},{"../../plots/gl2d":878,"../scatter3d/calc":1231,"./attributes":1188,"./convert":1189,"./defaults":1190}],1192:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -242545,7 +244000,7 @@ var attrs = module.exports = overrideAll({ }, 'calc', 'nested'); attrs.transforms = undefined; -},{"../../components/color/attributes":665,"../../components/colorscale/attributes":673,"../../components/fx/attributes":697,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1209:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../components/colorscale/attributes":657,"../../components/fx/attributes":681,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1193:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -242676,7 +244131,7 @@ function subplotUpdateFx(gd, index) { dragElement.init(dragOptions); } -},{"../../components/dragelement":685,"../../components/fx/layout_attributes":707,"../../lib":803,"../../lib/setcursor":824,"../../plot_api/edit_types":836,"../../plots/cartesian/select":874,"../../plots/get_data":891,"../../registry":931,"./plot":1214}],1210:[function(_dereq_,module,exports){ +},{"../../components/dragelement":669,"../../components/fx/layout_attributes":691,"../../lib":787,"../../lib/setcursor":808,"../../plot_api/edit_types":820,"../../plots/cartesian/select":858,"../../plots/get_data":875,"../../registry":915,"./plot":1198}],1194:[function(_dereq_,module,exports){ 'use strict'; var tarjan = _dereq_('strongly-connected-components'); @@ -242857,7 +244312,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gup":800,"strongly-connected-components":590}],1211:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gup":784,"strongly-connected-components":575}],1195:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -242880,7 +244335,7 @@ module.exports = { } }; -},{}],1212:[function(_dereq_,module,exports){ +},{}],1196:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -242986,7 +244441,7 @@ function concentrationscalesDefaults(In, Out) { coerce('colorscale'); } -},{"../../components/color":666,"../../components/fx/hoverlabel_defaults":704,"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../../plots/domain":882,"./attributes":1208,"tinycolor2":598}],1213:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx/hoverlabel_defaults":688,"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../../plots/domain":866,"./attributes":1192,"tinycolor2":583}],1197:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -243009,7 +244464,7 @@ module.exports = { } }; -},{"./attributes":1208,"./base_plot":1209,"./calc":1210,"./defaults":1212,"./plot":1214,"./select.js":1216}],1214:[function(_dereq_,module,exports){ +},{"./attributes":1192,"./base_plot":1193,"./calc":1194,"./defaults":1196,"./plot":1198,"./select.js":1200}],1198:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -243378,7 +244833,7 @@ module.exports = function plot(gd, calcData) { ); }; -},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"./constants":1211,"./render":1215,"@plotly/d3":58}],1215:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"./constants":1195,"./render":1199,"@plotly/d3":58}],1199:[function(_dereq_,module,exports){ 'use strict'; var d3Force = _dereq_('d3-force'); @@ -244395,7 +245850,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .ease(c.ease).duration(c.duration); }; -},{"../../components/color":666,"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"../../registry":931,"./constants":1211,"@plotly/d3":58,"@plotly/d3-sankey":57,"@plotly/d3-sankey-circular":56,"d3-force":166,"d3-interpolate":171,"tinycolor2":598}],1216:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"../../registry":915,"./constants":1195,"@plotly/d3":58,"@plotly/d3-sankey":57,"@plotly/d3-sankey-circular":56,"d3-force":163,"d3-interpolate":168,"tinycolor2":583}],1200:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -244425,7 +245880,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],1217:[function(_dereq_,module,exports){ +},{}],1201:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -244468,7 +245923,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":803}],1218:[function(_dereq_,module,exports){ +},{"../../lib":787}],1202:[function(_dereq_,module,exports){ 'use strict'; var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; @@ -245037,7 +246492,7 @@ module.exports = { }), }; -},{"../../components/colorscale/attributes":673,"../../components/drawing":688,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/font_attributes":883,"../../plots/template_attributes":926,"./constants":1222}],1219:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing":672,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/font_attributes":867,"../../plots/template_attributes":910,"./constants":1206}],1203:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -245334,7 +246789,7 @@ module.exports = { getStackOpts: getStackOpts }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"./arrays_to_calcdata":1217,"./calc_selection":1220,"./colorscale_calc":1221,"./subtypes":1243,"fast-isnumeric":249}],1220:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"./arrays_to_calcdata":1201,"./calc_selection":1204,"./colorscale_calc":1205,"./subtypes":1227,"fast-isnumeric":246}],1204:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -245345,7 +246800,7 @@ module.exports = function calcSelection(cd, trace) { } }; -},{"../../lib":803}],1221:[function(_dereq_,module,exports){ +},{"../../lib":787}],1205:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -245380,7 +246835,7 @@ module.exports = function calcMarkerColorscale(gd, trace) { } }; -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"./subtypes":1243}],1222:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"./subtypes":1227}],1206:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -245400,7 +246855,7 @@ module.exports = { eventDataKeys: [] }; -},{}],1223:[function(_dereq_,module,exports){ +},{}],1207:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('./calc'); @@ -245572,7 +247027,7 @@ function getInterp(calcTrace, index, position, posAttr) { return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]); } -},{"./calc":1219}],1224:[function(_dereq_,module,exports){ +},{"./calc":1203}],1208:[function(_dereq_,module,exports){ 'use strict'; @@ -245602,7 +247057,7 @@ module.exports = function crossTraceDefaults(fullData) { } }; -},{}],1225:[function(_dereq_,module,exports){ +},{}],1209:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -245689,7 +247144,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../../registry":931,"./attributes":1218,"./constants":1222,"./fillcolor_defaults":1226,"./line_defaults":1231,"./line_shape_defaults":1233,"./marker_defaults":1237,"./period_defaults":1238,"./stack_defaults":1241,"./subtypes":1243,"./text_defaults":1244,"./xy_defaults":1245}],1226:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./attributes":1202,"./constants":1206,"./fillcolor_defaults":1210,"./line_defaults":1215,"./line_shape_defaults":1217,"./marker_defaults":1221,"./period_defaults":1222,"./stack_defaults":1225,"./subtypes":1227,"./text_defaults":1228,"./xy_defaults":1229}],1210:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -245717,7 +247172,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":666,"../../lib":803}],1227:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787}],1211:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -245735,7 +247190,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1228:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1212:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -245775,7 +247230,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":666,"./subtypes":1243}],1229:[function(_dereq_,module,exports){ +},{"../../components/color":650,"./subtypes":1227}],1213:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -245986,7 +247441,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { } }; -},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"../../registry":931,"./get_trace_color":1228}],1230:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"../../registry":915,"./get_trace_color":1212}],1214:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -246030,7 +247485,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./arrays_to_calcdata":1217,"./attributes":1218,"./calc":1219,"./cross_trace_calc":1223,"./cross_trace_defaults":1224,"./defaults":1225,"./format_labels":1227,"./hover":1229,"./marker_colorbar":1236,"./plot":1239,"./select":1240,"./style":1242,"./subtypes":1243}],1231:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./arrays_to_calcdata":1201,"./attributes":1202,"./calc":1203,"./cross_trace_calc":1207,"./cross_trace_defaults":1208,"./defaults":1209,"./format_labels":1211,"./hover":1213,"./marker_colorbar":1220,"./plot":1223,"./select":1224,"./style":1226,"./subtypes":1227}],1215:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -246053,7 +247508,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, if(!(opts || {}).noDash) coerce('line.dash'); }; -},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803}],1232:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787}],1216:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -246505,7 +247960,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../constants/numerical":779,"../../lib":803,"./constants":1222}],1233:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"./constants":1206}],1217:[function(_dereq_,module,exports){ 'use strict'; @@ -246515,7 +247970,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],1234:[function(_dereq_,module,exports){ +},{}],1218:[function(_dereq_,module,exports){ 'use strict'; var LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1}; @@ -246597,7 +248052,7 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) { return cdscatterSorted; }; -},{}],1235:[function(_dereq_,module,exports){ +},{}],1219:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -246633,7 +248088,7 @@ module.exports = function makeBubbleSizeFn(trace, factor) { }; }; -},{"fast-isnumeric":249}],1236:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246}],1220:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -246642,7 +248097,7 @@ module.exports = { max: 'cmax' }; -},{}],1237:[function(_dereq_,module,exports){ +},{}],1221:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -246715,7 +248170,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":666,"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"./subtypes":1243}],1238:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"./subtypes":1227}],1222:[function(_dereq_,module,exports){ 'use strict'; var dateTick0 = _dereq_('../../lib').dateTick0; @@ -246754,7 +248209,7 @@ module.exports = function handlePeriodDefaults(traceIn, traceOut, layout, coerce } }; -},{"../../constants/numerical":779,"../../lib":803}],1239:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787}],1223:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -247306,7 +248761,7 @@ function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) { }); } -},{"../../components/drawing":688,"../../lib":803,"../../lib/polygon":815,"../../registry":931,"./line_points":1232,"./link_traces":1234,"./subtypes":1243,"@plotly/d3":58}],1240:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/polygon":799,"../../registry":915,"./line_points":1216,"./link_traces":1218,"./subtypes":1227,"@plotly/d3":58}],1224:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -247351,7 +248806,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"./subtypes":1243}],1241:[function(_dereq_,module,exports){ +},{"./subtypes":1227}],1225:[function(_dereq_,module,exports){ 'use strict'; var perStackAttrs = ['orientation', 'groupnorm', 'stackgaps']; @@ -247448,7 +248903,7 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) } }; -},{}],1242:[function(_dereq_,module,exports){ +},{}],1226:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -247510,7 +248965,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/drawing":688,"../../registry":931,"@plotly/d3":58}],1243:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../registry":915,"@plotly/d3":58}],1227:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247540,7 +248995,7 @@ module.exports = { } }; -},{"../../lib":803}],1244:[function(_dereq_,module,exports){ +},{"../../lib":787}],1228:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247561,7 +249016,7 @@ module.exports = function(traceIn, traceOut, layout, coerce, opts) { } }; -},{"../../lib":803}],1245:[function(_dereq_,module,exports){ +},{"../../lib":787}],1229:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247597,7 +249052,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) { return len; }; -},{"../../lib":803,"../../registry":931}],1246:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1230:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -247766,7 +249221,7 @@ var attrs = module.exports = overrideAll({ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; -},{"../../components/colorscale/attributes":673,"../../constants/gl3d_dashes":776,"../../constants/gl3d_markers":777,"../../lib/extend":793,"../../lib/sort_object_keys":826,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1247:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../constants/gl3d_dashes":760,"../../constants/gl3d_markers":761,"../../lib/extend":777,"../../lib/sort_object_keys":810,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1231:[function(_dereq_,module,exports){ 'use strict'; var arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata'); @@ -247786,7 +249241,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":1217,"../scatter/colorscale_calc":1221}],1248:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":1201,"../scatter/colorscale_calc":1205}],1232:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -247865,7 +249320,7 @@ function calculateErrors(data, scaleFactor, sceneLayout) { module.exports = calculateErrors; -},{"../../registry":931}],1249:[function(_dereq_,module,exports){ +},{"../../registry":915}],1233:[function(_dereq_,module,exports){ 'use strict'; var createLinePlot = _dereq_('gl-line3d'); @@ -248410,7 +249865,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../components/fx/helpers":702,"../../constants/gl3d_dashes":776,"../../constants/gl3d_markers":777,"../../lib":803,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"../scatter/make_bubble_size_func":1235,"./calc_errors":1248,"delaunay-triangulate":180,"gl-error3d":273,"gl-line3d":281,"gl-mesh3d":315,"gl-scatter3d":334}],1250:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":686,"../../constants/gl3d_dashes":760,"../../constants/gl3d_markers":761,"../../lib":787,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"../scatter/make_bubble_size_func":1219,"./calc_errors":1232,"delaunay-triangulate":177,"gl-error3d":267,"gl-line3d":275,"gl-mesh3d":309,"gl-scatter3d":327}],1234:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -248494,7 +249949,7 @@ function handleXYZDefaults(traceIn, traceOut, coerce, layout) { return len; } -},{"../../lib":803,"../../registry":931,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1246}],1251:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1230}],1235:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -248532,7 +249987,7 @@ module.exports = { } }; -},{"../../constants/gl3d_markers":777,"../../plots/gl3d":896,"./attributes":1246,"./calc":1247,"./convert":1249,"./defaults":1250}],1252:[function(_dereq_,module,exports){ +},{"../../constants/gl3d_markers":761,"../../plots/gl3d":880,"./attributes":1230,"./calc":1231,"./convert":1233,"./defaults":1234}],1236:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -248651,7 +250106,7 @@ module.exports = { hovertemplate: hovertemplateAttrs() }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1253:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1237:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -248701,7 +250156,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../carpet/lookup_carpetid":1001,"../scatter/arrays_to_calcdata":1217,"../scatter/calc":1219,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1254:[function(_dereq_,module,exports){ +},{"../carpet/lookup_carpetid":985,"../scatter/arrays_to_calcdata":1201,"../scatter/calc":1203,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1238:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -248782,7 +250237,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/line_shape_defaults":1233,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1252}],1255:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/line_shape_defaults":1217,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1236}],1239:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -248795,7 +250250,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1256:[function(_dereq_,module,exports){ +},{}],1240:[function(_dereq_,module,exports){ 'use strict'; module.exports = function formatLabels(cdi, trace) { @@ -248814,7 +250269,7 @@ module.exports = function formatLabels(cdi, trace) { return labels; }; -},{}],1257:[function(_dereq_,module,exports){ +},{}],1241:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -248897,7 +250352,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../../lib":803,"../scatter/hover":1229}],1258:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/hover":1213}],1242:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -248926,7 +250381,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1252,"./calc":1253,"./defaults":1254,"./event_data":1255,"./format_labels":1256,"./hover":1257,"./plot":1259}],1259:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1236,"./calc":1237,"./defaults":1238,"./event_data":1239,"./format_labels":1240,"./hover":1241,"./plot":1243}],1243:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -248961,7 +250416,7 @@ module.exports = function plot(gd, plotinfoproxy, data, layer) { } }; -},{"../../components/drawing":688,"../../plots/cartesian/axes":854,"../scatter/plot":1239}],1260:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../plots/cartesian/axes":838,"../scatter/plot":1223}],1244:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -249115,7 +250570,7 @@ module.exports = overrideAll({ hovertemplate: hovertemplateAttrs(), }, 'calc', 'nested'); -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1261:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1245:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -249174,7 +250629,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../constants/numerical":779,"../../lib":803,"../scatter/arrays_to_calcdata":1217,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1262:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../scatter/arrays_to_calcdata":1201,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1246:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -249249,7 +250704,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1260}],1263:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1244}],1247:[function(_dereq_,module,exports){ 'use strict'; @@ -249267,7 +250722,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1264:[function(_dereq_,module,exports){ +},{}],1248:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -249284,7 +250739,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1265:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1249:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -249388,7 +250843,7 @@ function getExtraText(trace, pt, pointData, labels) { return text.join('
'); } -},{"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../scatter/get_trace_color":1228,"./attributes":1260}],1266:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../scatter/get_trace_color":1212,"./attributes":1244}],1250:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -249419,7 +250874,7 @@ module.exports = { } }; -},{"../../plots/geo":887,"../scatter/marker_colorbar":1236,"../scatter/style":1242,"./attributes":1260,"./calc":1261,"./defaults":1262,"./event_data":1263,"./format_labels":1264,"./hover":1265,"./plot":1267,"./select":1268,"./style":1269}],1267:[function(_dereq_,module,exports){ +},{"../../plots/geo":871,"../scatter/marker_colorbar":1220,"../scatter/style":1226,"./attributes":1244,"./calc":1245,"./defaults":1246,"./event_data":1247,"./format_labels":1248,"./hover":1249,"./plot":1251,"./select":1252,"./style":1253}],1251:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -249540,7 +250995,7 @@ module.exports = { plot: plot }; -},{"../../constants/numerical":779,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/geojson_utils":797,"../../lib/topojson_utils":832,"../../plots/cartesian/autorange":853,"../scatter/calc":1219,"../scatter/subtypes":1243,"./style":1269,"@plotly/d3":58}],1268:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/geojson_utils":781,"../../lib/topojson_utils":816,"../../plots/cartesian/autorange":837,"../scatter/calc":1203,"../scatter/subtypes":1227,"./style":1253,"@plotly/d3":58}],1252:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('../scatter/subtypes'); @@ -249589,7 +251044,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"../../constants/numerical":779,"../scatter/subtypes":1243}],1269:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../scatter/subtypes":1227}],1253:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -249630,7 +251085,7 @@ function styleTrace(gd, calcTrace) { }); } -},{"../../components/color":666,"../../components/drawing":688,"../scatter/style":1242,"@plotly/d3":58}],1270:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../scatter/style":1226,"@plotly/d3":58}],1254:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -249733,7 +251188,7 @@ attrs.x.editType = attrs.y.editType = attrs.x0.editType = attrs.y0.editType = 'c attrs.hovertemplate = scatterAttrs.hovertemplate; attrs.texttemplate = scatterAttrs.texttemplate; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../lib/sort_object_keys":826,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../scatter/attributes":1218,"./constants":1272}],1271:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../lib/sort_object_keys":810,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../scatter/attributes":1202,"./constants":1256}],1255:[function(_dereq_,module,exports){ 'use strict'; var cluster = _dereq_('@plotly/point-cluster'); @@ -249919,7 +251374,7 @@ function sceneOptions(gd, subplot, trace, positions, x, y) { return opts; } -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/autorange":853,"../../plots/cartesian/axis_ids":858,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"./constants":1272,"./convert":1273,"./scene_update":1281,"@plotly/point-cluster":59}],1272:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/autorange":837,"../../plots/cartesian/axis_ids":842,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"./constants":1256,"./convert":1257,"./scene_update":1265,"@plotly/point-cluster":59}],1256:[function(_dereq_,module,exports){ 'use strict'; var SYMBOL_SIZE = 20; @@ -249944,7 +251399,7 @@ module.exports = { } }; -},{}],1273:[function(_dereq_,module,exports){ +},{}],1257:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -250591,7 +252046,7 @@ module.exports = { textPosition: convertTextPosition }; -},{"../../components/drawing":688,"../../components/fx/helpers":702,"../../constants/interactions":778,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/cartesian/axis_ids":858,"../../registry":931,"../scatter/make_bubble_size_func":1235,"../scatter/subtypes":1243,"./constants":1272,"./helpers":1277,"color-normalize":131,"fast-isnumeric":249,"svg-path-sdf":595}],1274:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../components/fx/helpers":686,"../../constants/interactions":762,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/cartesian/axis_ids":842,"../../registry":915,"../scatter/make_bubble_size_func":1219,"../scatter/subtypes":1227,"./constants":1256,"./helpers":1261,"color-normalize":131,"fast-isnumeric":246,"svg-path-sdf":580}],1258:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -250664,7 +252119,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../../registry":931,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/period_defaults":1238,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"../scatter/xy_defaults":1245,"./attributes":1270,"./helpers":1277}],1275:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/period_defaults":1222,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"../scatter/xy_defaults":1229,"./attributes":1254,"./helpers":1261}],1259:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -250712,7 +252167,7 @@ module.exports = { styleTextSelection: styleTextSelection }; -},{"../../components/color":666,"../../constants/interactions":778,"../../lib":803}],1276:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/interactions":762,"../../lib":787}],1260:[function(_dereq_,module,exports){ 'use strict'; var scatterFormatLabels = _dereq_('../scatter/format_labels'); @@ -250724,7 +252179,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return scatterFormatLabels(cdi, trace, fullLayout); }; -},{"../scatter/format_labels":1227}],1277:[function(_dereq_,module,exports){ +},{"../scatter/format_labels":1211}],1261:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -250741,7 +252196,7 @@ exports.isDotSymbol = function(symbol) { symbol > 200; }; -},{"./constants":1272}],1278:[function(_dereq_,module,exports){ +},{"./constants":1256}],1262:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -250961,7 +252416,7 @@ module.exports = { calcHover: calcHover }; -},{"../../lib":803,"../../registry":931,"../scatter/get_trace_color":1228}],1279:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../scatter/get_trace_color":1212}],1263:[function(_dereq_,module,exports){ 'use strict'; var hover = _dereq_('./hover'); @@ -250993,7 +252448,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../scatter/cross_trace_defaults":1224,"../scatter/marker_colorbar":1236,"./attributes":1270,"./calc":1271,"./defaults":1274,"./format_labels":1276,"./hover":1278,"./plot":1280,"./select":1282}],1280:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../scatter/cross_trace_defaults":1208,"../scatter/marker_colorbar":1220,"./attributes":1254,"./calc":1255,"./defaults":1258,"./format_labels":1260,"./hover":1262,"./plot":1264,"./select":1266}],1264:[function(_dereq_,module,exports){ 'use strict'; var createScatter = _dereq_('regl-scatter2d'); @@ -251366,7 +252821,7 @@ module.exports = function plot(gd, subplot, cdata) { } }; -},{"../../components/dragelement/helpers":684,"../../lib":803,"../../lib/prepare_regl":816,"../scatter/link_traces":1234,"../scatter/subtypes":1243,"./edit_style":1275,"gl-text":355,"regl-error2d":536,"regl-line2d":537,"regl-scatter2d":538}],1281:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":668,"../../lib":787,"../../lib/prepare_regl":800,"../scatter/link_traces":1218,"../scatter/subtypes":1227,"./edit_style":1259,"gl-text":347,"regl-error2d":522,"regl-line2d":523,"regl-scatter2d":524}],1265:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -251516,7 +252971,7 @@ module.exports = function sceneUpdate(gd, subplot) { return scene; }; -},{"../../lib":803}],1282:[function(_dereq_,module,exports){ +},{"../../lib":787}],1266:[function(_dereq_,module,exports){ 'use strict'; var subTypes = _dereq_('../scatter/subtypes'); @@ -251589,7 +253044,7 @@ module.exports = function select(searchInfo, selectionTester) { return selection; }; -},{"../scatter/subtypes":1243,"./edit_style":1275}],1283:[function(_dereq_,module,exports){ +},{"../scatter/subtypes":1227,"./edit_style":1259}],1267:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -251727,7 +253182,7 @@ module.exports = overrideAll({ hovertemplate: hovertemplateAttrs(), }, 'calc', 'nested'); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/mapbox/layout_attributes":913,"../../plots/template_attributes":926,"../scatter/attributes":1218,"../scattergeo/attributes":1260}],1284:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/mapbox/layout_attributes":897,"../../plots/template_attributes":910,"../scatter/attributes":1202,"../scattergeo/attributes":1244}],1268:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -252054,7 +253509,7 @@ function isBADNUM(lonlat) { return lonlat[0] === BADNUM; } -},{"../../components/colorscale":678,"../../components/drawing":688,"../../components/fx/helpers":702,"../../constants/numerical":779,"../../lib":803,"../../lib/geojson_utils":797,"../../lib/svg_text_utils":829,"../../plots/mapbox/convert_text_opts":910,"../scatter/make_bubble_size_func":1235,"../scatter/subtypes":1243,"fast-isnumeric":249}],1285:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../components/fx/helpers":686,"../../constants/numerical":763,"../../lib":787,"../../lib/geojson_utils":781,"../../lib/svg_text_utils":813,"../../plots/mapbox/convert_text_opts":894,"../scatter/make_bubble_size_func":1219,"../scatter/subtypes":1227,"fast-isnumeric":246}],1269:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -252124,7 +253579,7 @@ function handleLonLatDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../lib":803,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1283}],1286:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1267}],1270:[function(_dereq_,module,exports){ 'use strict'; @@ -252135,7 +253590,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],1287:[function(_dereq_,module,exports){ +},{}],1271:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -252153,7 +253608,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1288:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1272:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -252261,7 +253716,7 @@ module.exports = { getExtraText: getExtraText }; -},{"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../scatter/get_trace_color":1228}],1289:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../scatter/get_trace_color":1212}],1273:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -252296,7 +253751,7 @@ module.exports = { } }; -},{"../../plots/mapbox":911,"../scatter/marker_colorbar":1236,"../scattergeo/calc":1261,"./attributes":1283,"./defaults":1285,"./event_data":1286,"./format_labels":1287,"./hover":1288,"./plot":1290,"./select":1291}],1290:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":895,"../scatter/marker_colorbar":1220,"../scattergeo/calc":1245,"./attributes":1267,"./defaults":1269,"./event_data":1270,"./format_labels":1271,"./hover":1272,"./plot":1274,"./select":1275}],1274:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert'); @@ -252421,7 +253876,7 @@ module.exports = function createScatterMapbox(subplot, calcTrace) { return scatterMapbox; }; -},{"../../plots/mapbox/constants":909,"./convert":1284}],1291:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":893,"./convert":1268}],1275:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -252468,7 +253923,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"../../constants/numerical":779,"../../lib":803,"../scatter/subtypes":1243}],1292:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../scatter/subtypes":1227}],1276:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -252599,7 +254054,7 @@ module.exports = { unselected: scatterAttrs.unselected }; -},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1293:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1277:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -252645,7 +254100,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../constants/numerical":779,"../../plots/cartesian/axes":854,"../scatter/arrays_to_calcdata":1217,"../scatter/calc":1219,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1294:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../plots/cartesian/axes":838,"../scatter/arrays_to_calcdata":1201,"../scatter/calc":1203,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1278:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -252744,7 +254199,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/line_shape_defaults":1233,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1292}],1295:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/line_shape_defaults":1217,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1276}],1279:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -252778,7 +254233,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../lib":803,"../../plots/cartesian/axes":854}],1296:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838}],1280:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -252846,7 +254301,7 @@ module.exports = { makeHoverPointText: makeHoverPointText }; -},{"../scatter/hover":1229}],1297:[function(_dereq_,module,exports){ +},{"../scatter/hover":1213}],1281:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -252880,7 +254335,7 @@ module.exports = { } }; -},{"../../plots/polar":920,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1292,"./calc":1293,"./defaults":1294,"./format_labels":1295,"./hover":1296,"./plot":1298}],1298:[function(_dereq_,module,exports){ +},{"../../plots/polar":904,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1276,"./calc":1277,"./defaults":1278,"./format_labels":1279,"./hover":1280,"./plot":1282}],1282:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -252922,7 +254377,7 @@ module.exports = function plot(gd, subplot, moduleCalcData) { scatterPlot(gd, plotinfo, moduleCalcData, mlayer); }; -},{"../../constants/numerical":779,"../scatter/plot":1239}],1299:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../scatter/plot":1223}],1283:[function(_dereq_,module,exports){ 'use strict'; var scatterPolarAttrs = _dereq_('../scatterpolar/attributes'); @@ -252965,7 +254420,7 @@ module.exports = { unselected: scatterPolarAttrs.unselected }; -},{"../../plots/template_attributes":926,"../scattergl/attributes":1270,"../scatterpolar/attributes":1292}],1300:[function(_dereq_,module,exports){ +},{"../../plots/template_attributes":910,"../scattergl/attributes":1254,"../scatterpolar/attributes":1276}],1284:[function(_dereq_,module,exports){ 'use strict'; var calcColorscale = _dereq_('../scatter/colorscale_calc'); @@ -253009,7 +254464,7 @@ module.exports = function calc(gd, trace) { return [{x: false, y: false, t: stash, trace: trace}]; }; -},{"../../plots/cartesian/axes":854,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"../scattergl/constants":1272,"../scattergl/convert":1273}],1301:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"../scattergl/constants":1256,"../scattergl/convert":1257}],1285:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -253063,7 +254518,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"../scatterpolar/defaults":1294,"./attributes":1299}],1302:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"../scatterpolar/defaults":1278,"./attributes":1283}],1286:[function(_dereq_,module,exports){ 'use strict'; var scatterPolarFormatLabels = _dereq_('../scatterpolar/format_labels'); @@ -253075,7 +254530,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return scatterPolarFormatLabels(cdi, trace, fullLayout); }; -},{"../scatterpolar/format_labels":1295}],1303:[function(_dereq_,module,exports){ +},{"../scatterpolar/format_labels":1279}],1287:[function(_dereq_,module,exports){ 'use strict'; var hover = _dereq_('../scattergl/hover'); @@ -253117,7 +254572,7 @@ module.exports = { hoverPoints: hoverPoints }; -},{"../scattergl/hover":1278,"../scatterpolar/hover":1296}],1304:[function(_dereq_,module,exports){ +},{"../scattergl/hover":1262,"../scatterpolar/hover":1280}],1288:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -253149,7 +254604,7 @@ module.exports = { } }; -},{"../../plots/polar":920,"../scatter/marker_colorbar":1236,"../scattergl/select":1282,"./attributes":1299,"./calc":1300,"./defaults":1301,"./format_labels":1302,"./hover":1303,"./plot":1305}],1305:[function(_dereq_,module,exports){ +},{"../../plots/polar":904,"../scatter/marker_colorbar":1220,"../scattergl/select":1266,"./attributes":1283,"./calc":1284,"./defaults":1285,"./format_labels":1286,"./hover":1287,"./plot":1289}],1289:[function(_dereq_,module,exports){ 'use strict'; var cluster = _dereq_('@plotly/point-cluster'); @@ -253279,7 +254734,7 @@ module.exports = function plot(gd, subplot, cdata) { return scatterglPlot(gd, subplot, cdata); }; -},{"../../lib":803,"../scattergl/constants":1272,"../scattergl/convert":1273,"../scattergl/plot":1280,"../scattergl/scene_update":1281,"@plotly/point-cluster":59,"fast-isnumeric":249}],1306:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scattergl/constants":1256,"../scattergl/convert":1257,"../scattergl/plot":1264,"../scattergl/scene_update":1265,"@plotly/point-cluster":59,"fast-isnumeric":246}],1290:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -253427,7 +254882,7 @@ module.exports = { hovertemplate: hovertemplateAttrs(), }; -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1307:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1291:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -253499,7 +254954,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":1217,"../scatter/calc":1219,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1308:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":1201,"../scatter/calc":1203,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1292:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -253594,7 +255049,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/line_shape_defaults":1233,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1306}],1309:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/line_shape_defaults":1217,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1290}],1293:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -253618,7 +255073,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1310:[function(_dereq_,module,exports){ +},{}],1294:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -253634,7 +255089,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1311:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1295:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -253700,7 +255155,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../scatter/hover":1229}],1312:[function(_dereq_,module,exports){ +},{"../scatter/hover":1213}],1296:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -253729,7 +255184,7 @@ module.exports = { } }; -},{"../../plots/ternary":927,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1306,"./calc":1307,"./defaults":1308,"./event_data":1309,"./format_labels":1310,"./hover":1311,"./plot":1313}],1313:[function(_dereq_,module,exports){ +},{"../../plots/ternary":911,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1290,"./calc":1291,"./defaults":1292,"./event_data":1293,"./format_labels":1294,"./hover":1295,"./plot":1297}],1297:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -253753,7 +255208,7 @@ module.exports = function plot(gd, ternary, moduleCalcData) { scatterPlot(gd, plotinfo, moduleCalcData, scatterLayer); }; -},{"../scatter/plot":1239}],1314:[function(_dereq_,module,exports){ +},{"../scatter/plot":1223}],1298:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -253943,7 +255398,7 @@ module.exports = { opacity: scatterGlAttrs.opacity }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/constants":861,"../../plots/template_attributes":926,"../scatter/attributes":1218,"../scattergl/attributes":1270}],1315:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/constants":845,"../../plots/template_attributes":910,"../scatter/attributes":1202,"../scattergl/attributes":1254}],1299:[function(_dereq_,module,exports){ 'use strict'; var createLine = _dereq_('regl-line2d'); @@ -254168,7 +255623,7 @@ module.exports = { toSVG: Cartesian.toSVG }; -},{"../../lib/prepare_regl":816,"../../plots/cartesian":868,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_ids":858,"../../plots/get_data":891,"../../registry":931,"regl-line2d":537}],1316:[function(_dereq_,module,exports){ +},{"../../lib/prepare_regl":800,"../../plots/cartesian":852,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_ids":842,"../../plots/get_data":875,"../../registry":915,"regl-line2d":523}],1300:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -254271,7 +255726,7 @@ module.exports = function calc(gd, trace) { return [{x: false, y: false, t: {}, trace: trace}]; }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axis_ids":858,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"../scattergl/constants":1272,"../scattergl/convert":1273,"./scene_update":1323}],1317:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axis_ids":842,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"../scattergl/constants":1256,"../scattergl/convert":1257,"./scene_update":1307}],1301:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -254442,7 +255897,7 @@ function handleAxisDefaults(traceIn, traceOut, layout, coerce) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../parcoords/merge_length":1189,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scattergl/helpers":1277,"./attributes":1314}],1318:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../parcoords/merge_length":1173,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scattergl/helpers":1261,"./attributes":1298}],1302:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -254466,7 +255921,7 @@ module.exports = function editStyle(gd, cd0) { } }; -},{"../../lib":803,"../scatter/colorscale_calc":1221,"../scattergl/convert":1273}],1319:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/colorscale_calc":1205,"../scattergl/convert":1257}],1303:[function(_dereq_,module,exports){ 'use strict'; exports.getDimIndex = function getDimIndex(trace, ax) { @@ -254482,7 +255937,7 @@ exports.getDimIndex = function getDimIndex(trace, ax) { return false; }; -},{}],1320:[function(_dereq_,module,exports){ +},{}],1304:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -254535,7 +255990,7 @@ module.exports = { hoverPoints: hoverPoints }; -},{"../scattergl/hover":1278,"./helpers":1319}],1321:[function(_dereq_,module,exports){ +},{"../scattergl/hover":1262,"./helpers":1303}],1305:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -254574,7 +256029,7 @@ module.exports = { // register it here Registry.register(Grid); -},{"../../components/grid":710,"../../registry":931,"../scatter/marker_colorbar":1236,"./attributes":1314,"./base_plot":1315,"./calc":1316,"./defaults":1317,"./edit_style":1318,"./hover":1320,"./plot":1322,"./select":1324}],1322:[function(_dereq_,module,exports){ +},{"../../components/grid":694,"../../registry":915,"../scatter/marker_colorbar":1220,"./attributes":1298,"./base_plot":1299,"./calc":1300,"./defaults":1301,"./edit_style":1302,"./hover":1304,"./plot":1306,"./select":1308}],1306:[function(_dereq_,module,exports){ 'use strict'; var createMatrix = _dereq_('regl-splom'); @@ -254717,7 +256172,7 @@ function plotOne(gd, cd0) { } } -},{"../../components/dragelement/helpers":684,"../../lib":803,"../../plots/cartesian/axis_ids":858,"regl-splom":539}],1323:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":668,"../../lib":787,"../../plots/cartesian/axis_ids":842,"regl-splom":525}],1307:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -254781,7 +256236,7 @@ module.exports = function sceneUpdate(gd, trace) { return scene; }; -},{"../../lib":803}],1324:[function(_dereq_,module,exports){ +},{"../../lib":787}],1308:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -254848,7 +256303,7 @@ module.exports = function select(searchInfo, selectionTester) { return selection; }; -},{"../../lib":803,"../scatter/subtypes":1243,"./helpers":1319}],1325:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/subtypes":1227,"./helpers":1303}],1309:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -255012,7 +256467,7 @@ attrs.transforms = undefined; module.exports = attrs; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1326:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1310:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -255260,7 +256715,7 @@ module.exports = { processGrid: processGrid }; -},{"../../components/colorscale/calc":674,"../../lib":803}],1327:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../lib":787}],1311:[function(_dereq_,module,exports){ 'use strict'; var tube2mesh = _dereq_('gl-streamtube3d'); @@ -255478,7 +256933,7 @@ function createStreamtubeTrace(scene, data) { module.exports = createStreamtubeTrace; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/gl3d/zip3":907,"gl-streamtube3d":352}],1328:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/gl3d/zip3":891,"gl-streamtube3d":344}],1312:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -255541,7 +256996,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1325}],1329:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1309}],1313:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -255596,7 +257051,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1325,"./calc":1326,"./convert":1327,"./defaults":1328}],1330:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1309,"./calc":1310,"./convert":1311,"./defaults":1312}],1314:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -255815,7 +257270,7 @@ module.exports = { domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'}) }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"./constants":1333}],1331:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"./constants":1317}],1315:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -255830,7 +257285,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1332:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1316:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -256151,7 +257606,7 @@ function countDescendants(node, trace, opts) { return nChild; } -},{"../../components/colorscale":678,"../../constants/numerical":779,"../../lib":803,"../pie/calc":1194,"d3-hierarchy":170,"fast-isnumeric":249}],1333:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../constants/numerical":763,"../../lib":787,"../pie/calc":1178,"d3-hierarchy":167,"fast-isnumeric":246}],1317:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -256171,7 +257626,7 @@ module.exports = { ] }; -},{}],1334:[function(_dereq_,module,exports){ +},{}],1318:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256251,7 +257706,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"./attributes":1330}],1335:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"./attributes":1314}],1319:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -256567,7 +258022,7 @@ function makeEventData(pt, trace, keys) { return out; } -},{"../../components/fx":706,"../../components/fx/helpers":702,"../../lib":803,"../../lib/events":792,"../../registry":931,"../pie/helpers":1197,"./helpers":1336,"@plotly/d3":58}],1336:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../components/fx/helpers":686,"../../lib":787,"../../lib/events":776,"../../registry":915,"../pie/helpers":1181,"./helpers":1320,"@plotly/d3":58}],1320:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256744,7 +258199,7 @@ exports.formatPercent = function(v, separators) { return tx; }; -},{"../../components/color":666,"../../lib":803,"../../lib/setcursor":824,"../pie/helpers":1197}],1337:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../lib/setcursor":808,"../pie/helpers":1181}],1321:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -256776,7 +258231,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":1236,"./attributes":1330,"./base_plot":1331,"./calc":1332,"./defaults":1334,"./layout_attributes":1338,"./layout_defaults":1339,"./plot":1340,"./style":1341}],1338:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1220,"./attributes":1314,"./base_plot":1315,"./calc":1316,"./defaults":1318,"./layout_attributes":1322,"./layout_defaults":1323,"./plot":1324,"./style":1325}],1322:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -256807,7 +258262,7 @@ module.exports = { } }; -},{}],1339:[function(_dereq_,module,exports){ +},{}],1323:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256821,7 +258276,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendsunburstcolors'); }; -},{"../../lib":803,"./layout_attributes":1338}],1340:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1322}],1324:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -257456,7 +258911,7 @@ function getCoords(r, angle) { return [r * Math.sin(angle), -r * Math.cos(angle)]; } -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../bar/style":955,"../bar/uniform_text":957,"../pie/helpers":1197,"../pie/plot":1201,"./constants":1333,"./fx":1335,"./helpers":1336,"./style":1341,"@plotly/d3":58,"d3-hierarchy":170,"d3-interpolate":171}],1341:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../bar/style":939,"../bar/uniform_text":941,"../pie/helpers":1181,"../pie/plot":1185,"./constants":1317,"./fx":1319,"./helpers":1320,"./style":1325,"@plotly/d3":58,"d3-hierarchy":167,"d3-interpolate":168}],1325:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -257499,7 +258954,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"@plotly/d3":58}],1342:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"@plotly/d3":58}],1326:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -257809,7 +259264,7 @@ colorScaleAttrs('', { attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/color":666,"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926}],1343:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910}],1327:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -257832,7 +259287,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":674}],1344:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658}],1328:[function(_dereq_,module,exports){ 'use strict'; var createSurface = _dereq_('gl-surface3d'); @@ -258523,7 +259978,7 @@ function createSurfaceTrace(scene, data) { module.exports = createSurfaceTrace; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../heatmap/find_empties":1091,"../heatmap/interp2d":1094,"gl-surface3d":354,"ndarray":483,"ndarray-linear-interpolate":477}],1345:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../heatmap/find_empties":1075,"../heatmap/interp2d":1078,"gl-surface3d":346,"ndarray":472,"ndarray-linear-interpolate":466}],1329:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -258692,7 +260147,7 @@ module.exports = { opacityscaleDefaults: opacityscaleDefaults }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1342}],1346:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1326}],1330:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -258727,7 +260182,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1342,"./calc":1343,"./convert":1344,"./defaults":1345}],1347:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1326,"./calc":1327,"./convert":1328,"./defaults":1329}],1331:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../../components/annotations/attributes'); @@ -258897,7 +260352,7 @@ var attrs = module.exports = overrideAll({ }, 'calc', 'from-root'); attrs.transforms = undefined; -},{"../../components/annotations/attributes":649,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/cartesian/axis_format_attributes":857,"../../plots/domain":882,"../../plots/font_attributes":883}],1348:[function(_dereq_,module,exports){ +},{"../../components/annotations/attributes":633,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/cartesian/axis_format_attributes":841,"../../plots/domain":866,"../../plots/font_attributes":867}],1332:[function(_dereq_,module,exports){ 'use strict'; var getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData; @@ -258921,7 +260376,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/get_data":891,"./plot":1355}],1349:[function(_dereq_,module,exports){ +},{"../../plots/get_data":875,"./plot":1339}],1333:[function(_dereq_,module,exports){ 'use strict'; var wrap = _dereq_('../../lib/gup').wrap; @@ -258932,7 +260387,7 @@ module.exports = function calc() { return wrap({}); }; -},{"../../lib/gup":800}],1350:[function(_dereq_,module,exports){ +},{"../../lib/gup":784}],1334:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -258984,7 +260439,7 @@ module.exports = { } }; -},{}],1351:[function(_dereq_,module,exports){ +},{}],1335:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -259171,7 +260626,7 @@ function makeIdentity() { }; } -},{"../../lib/extend":793,"./constants":1350,"fast-isnumeric":249}],1352:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"./constants":1334,"fast-isnumeric":246}],1336:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -259246,7 +260701,7 @@ function rowFromTo(d) { return [rowFrom, rowTo]; } -},{"../../lib/extend":793}],1353:[function(_dereq_,module,exports){ +},{"../../lib/extend":777}],1337:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -259303,7 +260758,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../lib":803,"../../plots/domain":882,"./attributes":1347}],1354:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/domain":866,"./attributes":1331}],1338:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -259326,7 +260781,7 @@ module.exports = { } }; -},{"./attributes":1347,"./base_plot":1348,"./calc":1349,"./defaults":1353,"./plot":1355}],1355:[function(_dereq_,module,exports){ +},{"./attributes":1331,"./base_plot":1332,"./calc":1333,"./defaults":1337,"./plot":1339}],1339:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -260217,7 +261672,7 @@ function allRowsHeight(rowBlock) { function getBlock(d) {return d.rowBlocks[d.page];} function getRow(l, i) {return l.rows[i - l.firstRowIndex];} -},{"../../components/color":666,"../../components/drawing":688,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"./constants":1350,"./data_preparation_helper":1351,"./data_split_helpers":1352,"@plotly/d3":58}],1356:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"./constants":1334,"./data_preparation_helper":1335,"./data_split_helpers":1336,"@plotly/d3":58}],1340:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -260472,7 +261927,7 @@ module.exports = { domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}), }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"../sunburst/attributes":1330,"./constants":1359}],1357:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"../sunburst/attributes":1314,"./constants":1343}],1341:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -260487,7 +261942,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1358:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1342:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('../sunburst/calc'); @@ -260500,7 +261955,7 @@ exports.crossTraceCalc = function(gd) { return calc._runCrossTraceCalc('treemap', gd); }; -},{"../sunburst/calc":1332}],1359:[function(_dereq_,module,exports){ +},{"../sunburst/calc":1316}],1343:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -260521,7 +261976,7 @@ module.exports = { gapWithPathbar: 1 // i.e. one pixel }; -},{}],1360:[function(_dereq_,module,exports){ +},{}],1344:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -260636,7 +262091,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/color":666,"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/constants":943,"../bar/defaults":945,"./attributes":1356}],1361:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/constants":927,"../bar/defaults":929,"./attributes":1340}],1345:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -260707,7 +262162,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall } }; -},{"../bar/style":955,"../bar/uniform_text":957,"../sunburst/helpers":1336,"./plot_one":1370,"@plotly/d3":58}],1362:[function(_dereq_,module,exports){ +},{"../bar/style":939,"../bar/uniform_text":941,"../sunburst/helpers":1320,"./plot_one":1354,"@plotly/d3":58}],1346:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -260877,7 +262332,7 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) { }); }; -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"./constants":1359,"./partition":1368,"./style":1371,"@plotly/d3":58}],1363:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"./constants":1343,"./partition":1352,"./style":1355,"@plotly/d3":58}],1347:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -261088,7 +262543,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) { return nextOfPrevEntry; }; -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"../sunburst/plot":1340,"./constants":1359,"./partition":1368,"./style":1371,"@plotly/d3":58}],1364:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"../sunburst/plot":1324,"./constants":1343,"./partition":1352,"./style":1355,"@plotly/d3":58}],1348:[function(_dereq_,module,exports){ 'use strict'; module.exports = function flipTree(node, size, opts) { @@ -261126,7 +262581,7 @@ module.exports = function flipTree(node, size, opts) { } }; -},{}],1365:[function(_dereq_,module,exports){ +},{}],1349:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -261158,7 +262613,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":1236,"./attributes":1356,"./base_plot":1357,"./calc":1358,"./defaults":1360,"./layout_attributes":1366,"./layout_defaults":1367,"./plot":1369,"./style":1371}],1366:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1220,"./attributes":1340,"./base_plot":1341,"./calc":1342,"./defaults":1344,"./layout_attributes":1350,"./layout_defaults":1351,"./plot":1353,"./style":1355}],1350:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -261189,7 +262644,7 @@ module.exports = { } }; -},{}],1367:[function(_dereq_,module,exports){ +},{}],1351:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -261203,7 +262658,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendtreemapcolors'); }; -},{"../../lib":803,"./layout_attributes":1366}],1368:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1350}],1352:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -261267,7 +262722,7 @@ function getTilingMethod(key, squarifyratio) { } } -},{"./flip_tree":1364,"d3-hierarchy":170}],1369:[function(_dereq_,module,exports){ +},{"./flip_tree":1348,"d3-hierarchy":167}],1353:[function(_dereq_,module,exports){ 'use strict'; var draw = _dereq_('./draw'); @@ -261280,7 +262735,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall }); }; -},{"./draw":1361,"./draw_descendants":1363}],1370:[function(_dereq_,module,exports){ +},{"./draw":1345,"./draw_descendants":1347}],1354:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -261872,7 +263327,7 @@ module.exports = function plotOne(gd, cd, element, transitionOpts, drawDescendan } }; -},{"../../lib":803,"../bar/constants":943,"../bar/plot":952,"../bar/uniform_text":957,"../sunburst/helpers":1336,"./constants":1359,"./draw_ancestors":1362,"@plotly/d3":58,"d3-interpolate":171}],1371:[function(_dereq_,module,exports){ +},{"../../lib":787,"../bar/constants":927,"../bar/plot":936,"../bar/uniform_text":941,"../sunburst/helpers":1320,"./constants":1343,"./draw_ancestors":1346,"@plotly/d3":58,"d3-interpolate":168}],1355:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -261966,7 +263421,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"../sunburst/helpers":1336,"@plotly/d3":58}],1372:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"../sunburst/helpers":1320,"@plotly/d3":58}],1356:[function(_dereq_,module,exports){ 'use strict'; var boxAttrs = _dereq_('../box/attributes'); @@ -262224,7 +263679,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../box/attributes":966}],1373:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../box/attributes":950}],1357:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -262392,7 +263847,7 @@ function calcSpan(trace, cdi, valAxis, bandwidth) { return spanOut; } -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../box/calc":967,"./helpers":1376}],1374:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../box/calc":951,"./helpers":1360}],1358:[function(_dereq_,module,exports){ 'use strict'; var setPositionOffset = _dereq_('../box/cross_trace_calc').setPositionOffset; @@ -262427,7 +263882,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../box/cross_trace_calc":968}],1375:[function(_dereq_,module,exports){ +},{"../box/cross_trace_calc":952}],1359:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -262480,7 +263935,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout if(!meanLineVisible) traceOut.meanline = {visible: false}; }; -},{"../../components/color":666,"../../lib":803,"../box/defaults":969,"./attributes":1372}],1376:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../box/defaults":953,"./attributes":1356}],1360:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -262545,7 +264000,7 @@ exports.getKdeValue = function(calcItem, trace, valueDist) { exports.extractVal = function(o) { return o.v; }; -},{"../../lib":803}],1377:[function(_dereq_,module,exports){ +},{"../../lib":787}],1361:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -262652,7 +264107,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return closeData; }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../box/hover":971,"./helpers":1376}],1378:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../box/hover":955,"./helpers":1360}],1362:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -262686,7 +264141,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../box/defaults":969,"../box/select":976,"../scatter/style":1242,"./attributes":1372,"./calc":1373,"./cross_trace_calc":1374,"./defaults":1375,"./hover":1377,"./layout_attributes":1379,"./layout_defaults":1380,"./plot":1381,"./style":1382}],1379:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../box/defaults":953,"../box/select":960,"../scatter/style":1226,"./attributes":1356,"./calc":1357,"./cross_trace_calc":1358,"./defaults":1359,"./hover":1361,"./layout_attributes":1363,"./layout_defaults":1364,"./plot":1365,"./style":1366}],1363:[function(_dereq_,module,exports){ 'use strict'; var boxLayoutAttrs = _dereq_('../box/layout_attributes'); @@ -262720,7 +264175,7 @@ module.exports = { }) }; -},{"../../lib":803,"../box/layout_attributes":973}],1380:[function(_dereq_,module,exports){ +},{"../../lib":787,"../box/layout_attributes":957}],1364:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -262734,7 +264189,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { boxLayoutDefaults._supply(layoutIn, layoutOut, fullData, coerce, 'violin'); }; -},{"../../lib":803,"../box/layout_defaults":974,"./layout_attributes":1379}],1381:[function(_dereq_,module,exports){ +},{"../../lib":787,"../box/layout_defaults":958,"./layout_attributes":1363}],1365:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -262916,7 +264371,7 @@ module.exports = function plot(gd, plotinfo, cdViolins, violinLayer) { }); }; -},{"../../components/drawing":688,"../../lib":803,"../box/plot":975,"../scatter/line_points":1232,"./helpers":1376,"@plotly/d3":58}],1382:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../box/plot":959,"../scatter/line_points":1216,"./helpers":1360,"@plotly/d3":58}],1366:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -262963,7 +264418,7 @@ module.exports = function style(gd) { }); }; -},{"../../components/color":666,"../scatter/style":1242,"@plotly/d3":58}],1383:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../scatter/style":1226,"@plotly/d3":58}],1367:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -263038,7 +264493,7 @@ colorScaleAttrs('', { attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../isosurface/attributes":1154,"../surface/attributes":1342}],1384:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../isosurface/attributes":1138,"../surface/attributes":1326}],1368:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -263163,7 +264618,7 @@ function createVolumeTrace(scene, data) { module.exports = createVolumeTrace; -},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"../isosurface/convert":1156,"gl-mesh3d":315}],1385:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"../isosurface/convert":1140,"gl-mesh3d":309}],1369:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -263181,7 +264636,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout opacityscaleDefaults(traceIn, traceOut, layout, coerce); }; -},{"../../lib":803,"../isosurface/defaults":1157,"../surface/defaults":1345,"./attributes":1383}],1386:[function(_dereq_,module,exports){ +},{"../../lib":787,"../isosurface/defaults":1141,"../surface/defaults":1329,"./attributes":1367}],1370:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -263208,7 +264663,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"../isosurface/calc":1155,"./attributes":1383,"./convert":1384,"./defaults":1385}],1387:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"../isosurface/calc":1139,"./attributes":1367,"./convert":1368,"./defaults":1369}],1371:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -263365,7 +264820,7 @@ module.exports = { alignmentgroup: barAttrs.alignmentgroup }; -},{"../../components/color":666,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218,"./constants":1389}],1388:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202,"./constants":1373}],1372:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -263475,7 +264930,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../scatter/calc_selection":1220}],1389:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../scatter/calc_selection":1204}],1373:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -263486,7 +264941,7 @@ module.exports = { ] }; -},{}],1390:[function(_dereq_,module,exports){ +},{}],1374:[function(_dereq_,module,exports){ 'use strict'; var setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions; @@ -263551,7 +265006,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../bar/cross_trace_calc":944}],1391:[function(_dereq_,module,exports){ +},{"../bar/cross_trace_calc":928}],1375:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -263654,7 +265109,7 @@ module.exports = { crossTraceDefaults: crossTraceDefaults }; -},{"../../components/color":666,"../../constants/delta.js":773,"../../lib":803,"../bar/defaults":945,"../scatter/period_defaults":1238,"../scatter/xy_defaults":1245,"./attributes":1387}],1392:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/delta.js":757,"../../lib":787,"../bar/defaults":929,"../scatter/period_defaults":1222,"../scatter/xy_defaults":1229,"./attributes":1371}],1376:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { @@ -263673,7 +265128,7 @@ module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { return out; }; -},{}],1393:[function(_dereq_,module,exports){ +},{}],1377:[function(_dereq_,module,exports){ 'use strict'; var hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText; @@ -263761,7 +265216,7 @@ function getTraceColor(trace, di) { else if(opacity(mlc) && mlw) return mlc; } -},{"../../components/color":666,"../../constants/delta.js":773,"../../plots/cartesian/axes":854,"../bar/hover":948}],1394:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/delta.js":757,"../../plots/cartesian/axes":838,"../bar/hover":932}],1378:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -263795,7 +265250,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../bar/select":953,"./attributes":1387,"./calc":1388,"./cross_trace_calc":1390,"./defaults":1391,"./event_data":1392,"./hover":1393,"./layout_attributes":1395,"./layout_defaults":1396,"./plot":1397,"./style":1398}],1395:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../bar/select":937,"./attributes":1371,"./calc":1372,"./cross_trace_calc":1374,"./defaults":1375,"./event_data":1376,"./hover":1377,"./layout_attributes":1379,"./layout_defaults":1380,"./plot":1381,"./style":1382}],1379:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -263836,7 +265291,7 @@ module.exports = { } }; -},{}],1396:[function(_dereq_,module,exports){ +},{}],1380:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -263865,7 +265320,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"./layout_attributes":1395}],1397:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1379}],1381:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -263988,7 +265443,7 @@ function getXY(di, xa, ya, isHorizontal) { return isHorizontal ? [s, p] : [p, s]; } -},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../bar/plot":952,"../bar/uniform_text":957,"@plotly/d3":58}],1398:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../bar/plot":936,"../bar/uniform_text":941,"@plotly/d3":58}],1382:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -264041,7 +265496,7 @@ module.exports = { style: style }; -},{"../../components/color":666,"../../components/drawing":688,"../../constants/interactions":778,"../bar/style":955,"../bar/uniform_text":957,"@plotly/d3":58}],1399:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/interactions":762,"../bar/style":939,"../bar/uniform_text":941,"@plotly/d3":58}],1383:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../plots/cartesian/axes'); @@ -264493,7 +265948,7 @@ function last(array, indices) { return array[indices[indices.length - 1]]; } -},{"../constants/numerical":779,"../lib":803,"../plot_api/plot_schema":842,"../plots/cartesian/axes":854,"./helpers":1402}],1400:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"../lib":787,"../plot_api/plot_schema":826,"../plots/cartesian/axes":838,"./helpers":1386}],1384:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -264818,7 +266273,7 @@ function getFilterFunc(opts, d2c, targetCalendar) { } } -},{"../constants/filter_ops":775,"../lib":803,"../plots/cartesian/axes":854,"../registry":931,"./helpers":1402}],1401:[function(_dereq_,module,exports){ +},{"../constants/filter_ops":759,"../lib":787,"../plots/cartesian/axes":838,"../registry":915,"./helpers":1386}],1385:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -265089,7 +266544,7 @@ function transformOne(trace, state) { return newData; } -},{"../lib":803,"../plot_api/plot_schema":842,"../plots/plots":917,"./helpers":1402}],1402:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_schema":826,"../plots/plots":901,"./helpers":1386}],1386:[function(_dereq_,module,exports){ 'use strict'; exports.pointsAccessorFunction = function(transforms, opts) { @@ -265107,7 +266562,7 @@ exports.pointsAccessorFunction = function(transforms, opts) { return originalPointsAccessor; }; -},{}],1403:[function(_dereq_,module,exports){ +},{}],1387:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -265263,11 +266718,11 @@ function getSortFunc(opts, d2c) { } } -},{"../constants/numerical":779,"../lib":803,"../plots/cartesian/axes":854,"./helpers":1402}],1404:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"../lib":787,"../plots/cartesian/axes":838,"./helpers":1386}],1388:[function(_dereq_,module,exports){ 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.4.2'; +exports.version = '2.5.0'; },{}]},{},[27])(27) }); diff --git a/dist/plotly.js b/dist/plotly.js index bc2da0d9fb5..f2d2346aaf1 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -1,5 +1,5 @@ /** -* plotly.js v2.4.2 +* plotly.js v2.5.0 * Copyright 2012-2021, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -72,132 +72,132 @@ for(var selector in rules) { Lib.addStyleRule(fullSelector, rules[selector]); } -},{"../src/lib":803}],2:[function(_dereq_,module,exports){ +},{"../src/lib":787}],2:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/transforms/aggregate'); -},{"../src/transforms/aggregate":1399}],3:[function(_dereq_,module,exports){ +},{"../src/transforms/aggregate":1383}],3:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/bar'); -},{"../src/traces/bar":949}],4:[function(_dereq_,module,exports){ +},{"../src/traces/bar":933}],4:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/barpolar'); -},{"../src/traces/barpolar":962}],5:[function(_dereq_,module,exports){ +},{"../src/traces/barpolar":946}],5:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/box'); -},{"../src/traces/box":972}],6:[function(_dereq_,module,exports){ +},{"../src/traces/box":956}],6:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/components/calendars'); -},{"../src/components/calendars":664}],7:[function(_dereq_,module,exports){ +},{"../src/components/calendars":648}],7:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/candlestick'); -},{"../src/traces/candlestick":981}],8:[function(_dereq_,module,exports){ +},{"../src/traces/candlestick":965}],8:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/carpet'); -},{"../src/traces/carpet":1000}],9:[function(_dereq_,module,exports){ +},{"../src/traces/carpet":984}],9:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/choropleth'); -},{"../src/traces/choropleth":1014}],10:[function(_dereq_,module,exports){ +},{"../src/traces/choropleth":998}],10:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/choroplethmapbox'); -},{"../src/traces/choroplethmapbox":1021}],11:[function(_dereq_,module,exports){ +},{"../src/traces/choroplethmapbox":1005}],11:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/cone'); -},{"../src/traces/cone":1027}],12:[function(_dereq_,module,exports){ +},{"../src/traces/cone":1011}],12:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/contour'); -},{"../src/traces/contour":1042}],13:[function(_dereq_,module,exports){ +},{"../src/traces/contour":1026}],13:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/contourcarpet'); -},{"../src/traces/contourcarpet":1053}],14:[function(_dereq_,module,exports){ +},{"../src/traces/contourcarpet":1037}],14:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/core'); -},{"../src/core":781}],15:[function(_dereq_,module,exports){ +},{"../src/core":765}],15:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/densitymapbox'); -},{"../src/traces/densitymapbox":1061}],16:[function(_dereq_,module,exports){ +},{"../src/traces/densitymapbox":1045}],16:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/transforms/filter'); -},{"../src/transforms/filter":1400}],17:[function(_dereq_,module,exports){ +},{"../src/transforms/filter":1384}],17:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/funnel'); -},{"../src/traces/funnel":1071}],18:[function(_dereq_,module,exports){ +},{"../src/traces/funnel":1055}],18:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/funnelarea'); -},{"../src/traces/funnelarea":1080}],19:[function(_dereq_,module,exports){ +},{"../src/traces/funnelarea":1064}],19:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/transforms/groupby'); -},{"../src/transforms/groupby":1401}],20:[function(_dereq_,module,exports){ +},{"../src/transforms/groupby":1385}],20:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/heatmap'); -},{"../src/traces/heatmap":1093}],21:[function(_dereq_,module,exports){ +},{"../src/traces/heatmap":1077}],21:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/heatmapgl'); -},{"../src/traces/heatmapgl":1103}],22:[function(_dereq_,module,exports){ +},{"../src/traces/heatmapgl":1087}],22:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/histogram'); -},{"../src/traces/histogram":1115}],23:[function(_dereq_,module,exports){ +},{"../src/traces/histogram":1099}],23:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/histogram2d'); -},{"../src/traces/histogram2d":1121}],24:[function(_dereq_,module,exports){ +},{"../src/traces/histogram2d":1105}],24:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/histogram2dcontour'); -},{"../src/traces/histogram2dcontour":1125}],25:[function(_dereq_,module,exports){ +},{"../src/traces/histogram2dcontour":1109}],25:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/icicle'); -},{"../src/traces/icicle":1131}],26:[function(_dereq_,module,exports){ +},{"../src/traces/icicle":1115}],26:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/image'); -},{"../src/traces/image":1144}],27:[function(_dereq_,module,exports){ +},{"../src/traces/image":1128}],27:[function(_dereq_,module,exports){ 'use strict'; var Plotly = _dereq_('./core'); @@ -268,137 +268,137 @@ module.exports = Plotly; module.exports = _dereq_('../src/traces/indicator'); -},{"../src/traces/indicator":1152}],29:[function(_dereq_,module,exports){ +},{"../src/traces/indicator":1136}],29:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/isosurface'); -},{"../src/traces/isosurface":1158}],30:[function(_dereq_,module,exports){ +},{"../src/traces/isosurface":1142}],30:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/mesh3d'); -},{"../src/traces/mesh3d":1163}],31:[function(_dereq_,module,exports){ +},{"../src/traces/mesh3d":1147}],31:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/ohlc'); -},{"../src/traces/ohlc":1168}],32:[function(_dereq_,module,exports){ +},{"../src/traces/ohlc":1152}],32:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/parcats'); -},{"../src/traces/parcats":1177}],33:[function(_dereq_,module,exports){ +},{"../src/traces/parcats":1161}],33:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/parcoords'); -},{"../src/traces/parcoords":1187}],34:[function(_dereq_,module,exports){ +},{"../src/traces/parcoords":1171}],34:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/pie'); -},{"../src/traces/pie":1198}],35:[function(_dereq_,module,exports){ +},{"../src/traces/pie":1182}],35:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/pointcloud'); -},{"../src/traces/pointcloud":1207}],36:[function(_dereq_,module,exports){ +},{"../src/traces/pointcloud":1191}],36:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/sankey'); -},{"../src/traces/sankey":1213}],37:[function(_dereq_,module,exports){ +},{"../src/traces/sankey":1197}],37:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scatter3d'); -},{"../src/traces/scatter3d":1251}],38:[function(_dereq_,module,exports){ +},{"../src/traces/scatter3d":1235}],38:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scattercarpet'); -},{"../src/traces/scattercarpet":1258}],39:[function(_dereq_,module,exports){ +},{"../src/traces/scattercarpet":1242}],39:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scattergeo'); -},{"../src/traces/scattergeo":1266}],40:[function(_dereq_,module,exports){ +},{"../src/traces/scattergeo":1250}],40:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scattergl'); -},{"../src/traces/scattergl":1279}],41:[function(_dereq_,module,exports){ +},{"../src/traces/scattergl":1263}],41:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scattermapbox'); -},{"../src/traces/scattermapbox":1289}],42:[function(_dereq_,module,exports){ +},{"../src/traces/scattermapbox":1273}],42:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scatterpolar'); -},{"../src/traces/scatterpolar":1297}],43:[function(_dereq_,module,exports){ +},{"../src/traces/scatterpolar":1281}],43:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scatterpolargl'); -},{"../src/traces/scatterpolargl":1304}],44:[function(_dereq_,module,exports){ +},{"../src/traces/scatterpolargl":1288}],44:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/scatterternary'); -},{"../src/traces/scatterternary":1312}],45:[function(_dereq_,module,exports){ +},{"../src/traces/scatterternary":1296}],45:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/transforms/sort'); -},{"../src/transforms/sort":1403}],46:[function(_dereq_,module,exports){ +},{"../src/transforms/sort":1387}],46:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/splom'); -},{"../src/traces/splom":1321}],47:[function(_dereq_,module,exports){ +},{"../src/traces/splom":1305}],47:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/streamtube'); -},{"../src/traces/streamtube":1329}],48:[function(_dereq_,module,exports){ +},{"../src/traces/streamtube":1313}],48:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/sunburst'); -},{"../src/traces/sunburst":1337}],49:[function(_dereq_,module,exports){ +},{"../src/traces/sunburst":1321}],49:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/surface'); -},{"../src/traces/surface":1346}],50:[function(_dereq_,module,exports){ +},{"../src/traces/surface":1330}],50:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/table'); -},{"../src/traces/table":1354}],51:[function(_dereq_,module,exports){ +},{"../src/traces/table":1338}],51:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/treemap'); -},{"../src/traces/treemap":1365}],52:[function(_dereq_,module,exports){ +},{"../src/traces/treemap":1349}],52:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/violin'); -},{"../src/traces/violin":1378}],53:[function(_dereq_,module,exports){ +},{"../src/traces/violin":1362}],53:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/volume'); -},{"../src/traces/volume":1386}],54:[function(_dereq_,module,exports){ +},{"../src/traces/volume":1370}],54:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('../src/traces/waterfall'); -},{"../src/traces/waterfall":1394}],55:[function(_dereq_,module,exports){ +},{"../src/traces/waterfall":1378}],55:[function(_dereq_,module,exports){ 'use strict' module.exports = createViewController @@ -428,27 +428,60 @@ function ViewController(controllers, mode) { var proto = ViewController.prototype -var COMMON_METHODS = [ - ['flush', 1], - ['idle', 1], - ['lookAt', 4], - ['rotate', 4], - ['pan', 4], - ['translate', 4], - ['setMatrix', 2], - ['setDistanceLimits', 2], - ['setDistance', 2] -] - -COMMON_METHODS.forEach(function(method) { - var name = method[0] - var argNames = [] - for(var i=0; i be - bs) { + return bruteForceRedFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlueFull(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } } + return bruteForceFull } -function bruteForcePlanner(full) { - var funcName = 'bruteForce' + (full ? 'Full' : 'Partial') - var prefix = [] - var fargs = ARGS.slice() - if(!full) { - fargs.splice(3, 0, FLIP) +function partial() { + function bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - - var code = ['function ' + funcName + '(' + fargs.join() + '){'] - - function invoke(redMajor, flip) { - var res = generateBruteForce(redMajor, flip, full) - prefix.push(res.code) - code.push('return ' + res.name + '(' + ARGS.join() + ');') + function bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + Q: for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } } - - code.push('if(' + RED_END + '-' + RED_START + '>' + - BLUE_END + '-' + BLUE_START + '){') - - if(full) { - invoke(true, false) - code.push('}else{') - invoke(false, false) - } else { - code.push('if(' + FLIP + '){') - invoke(true, true) - code.push('}else{') - invoke(true, false) - code.push('}}else{if(' + FLIP + '){') - invoke(false, true) - code.push('}else{') - invoke(false, false) - code.push('}') + function bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 <= x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(yi, xi) + if (rv !== void 0) return rv + } + } } - code.push('}}return ' + funcName) - - var codeStr = prefix.join('') + code.join('') - var proc = new Function(codeStr) - return proc() + function bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) { + var es = 2 * d + for (var j = bs, bp = es * bs; j < be; ++j, bp += es) { + var y0 = bb[ax + bp], yi = bi[j] + Q: for (var i = rs, rp = es * rs; i < re; ++i, rp += es) { + var x0 = rb[ax + rp], x1 = rb[ax + rp + d], xi = ri[i] + if (y0 < x0 || x1 < y0) continue + for (var k = ax + 1; k < d; ++k) { + var r0 = rb[k + rp], r1 = rb[k + d + rp], b0 = bb[k + bp], b1 = bb[k + d + bp] + if (r1 < b0 || b1 < r0) continue Q + } + var rv = vv(xi, yi) + if (rv !== void 0) return rv + } + } + } + function bruteForcePartial(d, ax, vv, fp, rs, re, rb, ri, bs, be, bb, bi) { + if (re - rs > be - bs) { + if (fp) { + return bruteForceRedFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceRed(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + else { + if (fp) { + return bruteForceBlueFlip(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + else { + return bruteForceBlue(d, ax, vv, rs, re, rb, ri, bs, be, bb, bi) + } + } + } + return bruteForcePartial } +function bruteForcePlanner(isFull) { + return isFull ? full() : partial() + +} exports.partial = bruteForcePlanner(false) exports.full = bruteForcePlanner(true) @@ -19915,32 +19942,26 @@ var genPartition = _dereq_('./partition') //Twiddle parameters var BRUTE_FORCE_CUTOFF = 128 //Cut off for brute force search var SCAN_CUTOFF = (1<<22) //Cut off for two way scan -var SCAN_COMPLETE_CUTOFF = (1<<22) +var SCAN_COMPLETE_CUTOFF = (1<<22) //Partition functions var partitionInteriorContainsInterval = genPartition( - '!(lo>=p0)&&!(p1>=hi)', - ['p0', 'p1']) + '!(lo>=p0)&&!(p1>=hi)') var partitionStartEqual = genPartition( - 'lo===p0', - ['p0']) + 'lo===p0') var partitionStartLessThan = genPartition( - 'lo mid point // var blue0 = findMedian( - d, axis, + d, axis, blueStart, blueEnd, blue, blueIndex) var mid = blue[elemSize * blue0 + axis] var blue1 = partitionStartEqual( @@ -20393,14 +20414,14 @@ function boxIntersectIter( } } } -},{"./brute":109,"./median":111,"./partition":112,"./sweep":114,"bit-twiddle":104,"typedarray-pool":617}],111:[function(_dereq_,module,exports){ +},{"./brute":109,"./median":111,"./partition":112,"./sweep":114,"bit-twiddle":104,"typedarray-pool":601}],111:[function(_dereq_,module,exports){ 'use strict' module.exports = findMedian var genPartition = _dereq_('./partition') -var partitionStartLessThan = genPartition('lostart && boxes[ptr+axis] > x; + for(var j=i, ptr=elemSize*(i-1); + j>start && boxes[ptr+axis] > x; --j, ptr-=elemSize) { //Swap var aPtr = ptr @@ -20441,14 +20462,14 @@ function findMedian(d, axis, start, end, boxes, ids) { var elemSize = 2*d var pivot = mid var value = boxes[elemSize*mid+axis] - + while(lo < hi) { if(hi - lo < PARTITION_THRESHOLD) { insertionSort(d, axis, lo, hi, boxes, ids) value = boxes[elemSize*mid+axis] break } - + //Select pivot using median-of-3 var count = hi - lo var pivot0 = (Math.random()*count+lo)|0 @@ -20495,7 +20516,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Partition using pivot pivot = partitionStartLessThan( - d, axis, + d, axis, lo, hi-1, boxes, ids, value) @@ -20514,7 +20535,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Swap pivot to last pivot if(mid < pivot) { hi = pivot-1 - while(lo < hi && + while(lo < hi && boxes[elemSize*(hi-1)+axis] === value) { hi -= 1 } @@ -20532,7 +20553,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Make sure pivot is at start return partitionStartLessThan( - d, axis, + d, axis, start, mid, boxes, ids, boxes[elemSize*mid+axis]) } @@ -20541,22 +20562,115 @@ function findMedian(d, axis, start, end, boxes, ids) { module.exports = genPartition -var code = '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' +var P2F = { + 'lo===p0': lo_equal_p0, + 'lo=p0)&&!(p1>=hi)': lo_lessThan_p0_and_p1_lessThan_hi +} + +function genPartition(predicate) { + return P2F[predicate] +} -function genPartition(predicate, args) { - var fargs ='abcdef'.split('').concat(args) - var reads = [] - if(predicate.indexOf('lo') >= 0) { - reads.push('lo=e[k+n]') +// lo===p0 +function lo_equal_p0(a, b, c, d, e, f, p0) { + 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 lo = e[k + n]; + if (lo === p0) 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 + } } - if(predicate.indexOf('hi') >= 0) { - reads.push('hi=e[k+o]') + return m +} + +// lo p; ++p, k += j) { + var lo = e[k + n]; + if (lo < p0) 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 + } } - fargs.push( - code.replace('_', reads.join()) - .replace('$', predicate)) - return Function.apply(void 0, fargs) + return m } + +// lo<=p0 +function lo_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} + +// hi<=p0 +function hi_lessOrEqual_p0(a, b, c, d, e, f, p0) { + 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 hi = e[k + o]; + if (hi <= p0) 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 +} + +// lo<=p0&&p0<=hi +function lo_lassOrEqual_p0_and_p0_lessOrEqual_hi(a, b, c, d, e, f, p0) { + 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 lo = e[k + n], hi = e[k + o]; + if (lo <= p0 && p0 <= hi) 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 +} + +// lo p; ++p, k += j) { + var lo = e[k + n], hi = e[k + o]; + if (lo < p0 && p0 <= hi) 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 +} + +// !(lo>=p0)&&!(p1>=hi) +function lo_lessThan_p0_and_p1_lessThan_hi(a, b, c, d, e, f, p0, p1) { + 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 lo = e[k + n], hi = e[k + o]; + if (!(lo >= p0) && !(p1 >= hi)) 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 +} + },{}],113:[function(_dereq_,module,exports){ 'use strict'; @@ -21229,7 +21343,7 @@ red_loop: } } } -},{"./sort":113,"bit-twiddle":104,"typedarray-pool":617}],115:[function(_dereq_,module,exports){ +},{"./sort":113,"bit-twiddle":104,"typedarray-pool":601}],115:[function(_dereq_,module,exports){ },{}],116:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. @@ -23490,7 +23604,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,_dereq_("buffer").Buffer) -},{"base64-js":86,"buffer":117,"ieee754":445}],118:[function(_dereq_,module,exports){ +},{"base64-js":86,"buffer":117,"ieee754":437}],118:[function(_dereq_,module,exports){ 'use strict' var monotoneTriangulate = _dereq_('./lib/monotone') @@ -23691,7 +23805,7 @@ function delaunayRefine(points, triangulation) { } } -},{"binary-search-bounds":103,"robust-in-sphere":546}],120:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"robust-in-sphere":532}],120:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -24062,7 +24176,7 @@ function monotoneTriangulate(points, edges) { return cells } -},{"binary-search-bounds":103,"robust-orientation":548}],122:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"robust-orientation":534}],122:[function(_dereq_,module,exports){ 'use strict' var bsearch = _dereq_('binary-search-bounds') @@ -24256,7 +24370,7 @@ function circumcenter(points) { circumcenter.barycenetric = barycentricCircumcenter module.exports = circumcenter -},{"dup":185,"robust-linear-solve":547}],125:[function(_dereq_,module,exports){ +},{"dup":182,"robust-linear-solve":533}],125:[function(_dereq_,module,exports){ module.exports = circumradius var circumcenter = _dereq_('circumcenter') @@ -24664,7 +24778,7 @@ function cleanPSLG (points, edges, colors) { return modified } -},{"./lib/rat-seg-intersect":128,"big-rat":90,"big-rat/cmp":88,"big-rat/to-float":102,"box-intersect":108,"nextafter":484,"rat-vec":532,"robust-segment-intersect":551,"union-find":618}],128:[function(_dereq_,module,exports){ +},{"./lib/rat-seg-intersect":128,"big-rat":90,"big-rat/cmp":88,"big-rat/to-float":102,"box-intersect":108,"nextafter":473,"rat-vec":518,"robust-segment-intersect":537,"union-find":602}],128:[function(_dereq_,module,exports){ 'use strict' module.exports = solveIntersection @@ -24708,7 +24822,7 @@ function solveIntersection (a, b, c, d) { return r } -},{"big-rat/div":89,"big-rat/mul":99,"big-rat/sign":100,"big-rat/sub":101,"rat-vec/add":531,"rat-vec/muls":533,"rat-vec/sub":534}],129:[function(_dereq_,module,exports){ +},{"big-rat/div":89,"big-rat/mul":99,"big-rat/sign":100,"big-rat/sub":101,"rat-vec/add":517,"rat-vec/muls":519,"rat-vec/sub":520}],129:[function(_dereq_,module,exports){ /** @module color-id */ 'use strict' @@ -24984,7 +25098,7 @@ function isInt(color) { return false } -},{"clamp":126,"color-rgba":133,"dtype":184}],132:[function(_dereq_,module,exports){ +},{"clamp":126,"color-rgba":133,"dtype":181}],132:[function(_dereq_,module,exports){ (function (global){(function (){ /** * @module color-parse @@ -25163,7 +25277,7 @@ function parse (cstr) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"color-name":130,"defined":179,"is-plain-obj":457}],133:[function(_dereq_,module,exports){ +},{"color-name":130,"defined":176,"is-plain-obj":447}],133:[function(_dereq_,module,exports){ /** @module color-rgba */ 'use strict' @@ -25555,7 +25669,7 @@ function rgbaStr (rgba) { return 'rgba(' + rgba.join(',') + ')'; } -},{"./colorScale":136,"lerp":460}],138:[function(_dereq_,module,exports){ +},{"./colorScale":136,"lerp":450}],138:[function(_dereq_,module,exports){ "use strict" module.exports = compareAngle @@ -25641,7 +25755,7 @@ function compareAngle(a, b, c, d) { } } } -},{"robust-orientation":548,"robust-product":549,"robust-sum":553,"signum":555,"two-sum":605}],139:[function(_dereq_,module,exports){ +},{"robust-orientation":534,"robust-product":535,"robust-sum":539,"signum":541,"two-sum":589}],139:[function(_dereq_,module,exports){ module.exports = compareCells var min = Math.min @@ -25782,7 +25896,7 @@ function convexHull2D(points) { return edges } -},{"monotone-convex-hull-2d":469}],144:[function(_dereq_,module,exports){ +},{"monotone-convex-hull-2d":458}],144:[function(_dereq_,module,exports){ 'use strict' module.exports = convexHullnD @@ -25843,7 +25957,7 @@ function convexHullnD(points, d) { return invPermute(nhull, ah) } } -},{"affine-hull":73,"incremental-convex-hull":446}],145:[function(_dereq_,module,exports){ +},{"affine-hull":73,"incremental-convex-hull":438}],145:[function(_dereq_,module,exports){ module.exports = { AFG: 'afghan', ALA: '\\b\\wland', @@ -26282,7 +26396,7 @@ function parseLineHeight(value) { return value } -},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"string-split-by":589,"unquote":620}],153:[function(_dereq_,module,exports){ +},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"string-split-by":574,"unquote":604}],153:[function(_dereq_,module,exports){ 'use strict' var pick = _dereq_('pick-by-alias') @@ -26386,7 +26500,7 @@ function a2o (a) { return o } -},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"pick-by-alias":498}],154:[function(_dereq_,module,exports){ +},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"pick-by-alias":485}],154:[function(_dereq_,module,exports){ module.exports=[ "inherit", "initial", @@ -26444,565 +26558,6 @@ function cubicHermite(p0, v0, p1, v1, t, f) { module.exports = cubicHermite module.exports.derivative = dcubicHermite },{}],157:[function(_dereq_,module,exports){ -"use strict" - -var createThunk = _dereq_("./lib/thunk.js") - -function Procedure() { - 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 = false -} - -function compileCwise(user_args) { - //Create procedure - var proc = new Procedure() - - //Parse blocks - proc.pre = user_args.pre - proc.body = user_args.body - proc.post = user_args.post - - //Parse arguments - var proc_args = user_args.args.slice(0) - proc.argTypes = proc_args - for(var i=0; i0) { - throw new Error("cwise: pre() block may not reference array args") - } - if(i < proc.post.args.length && proc.post.args[i].count>0) { - throw new Error("cwise: post() block may not reference array args") - } - } else if(arg_type === "scalar") { - proc.scalarArgs.push(i) - proc.shimArgs.push("scalar" + i) - } else if(arg_type === "index") { - proc.indexArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].count > 0) { - throw new Error("cwise: pre() block may not reference array index") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array index") - } - if(i < proc.post.args.length && proc.post.args[i].count > 0) { - throw new Error("cwise: post() block may not reference array index") - } - } else if(arg_type === "shape") { - proc.shapeArgs.push(i) - if(i < proc.pre.args.length && proc.pre.args[i].lvalue) { - throw new Error("cwise: pre() block may not write to array shape") - } - if(i < proc.body.args.length && proc.body.args[i].lvalue) { - throw new Error("cwise: body() block may not write to array shape") - } - if(i < proc.post.args.length && proc.post.args[i].lvalue) { - throw new Error("cwise: post() block may not write to array shape") - } - } else if(typeof arg_type === "object" && arg_type.offset) { - proc.argTypes[i] = "offset" - proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset }) - proc.offsetArgIndex.push(i) - } else { - throw new Error("cwise: Unknown argument type " + proc_args[i]) - } - } - - //Make sure at least one array argument was specified - if(proc.arrayArgs.length <= 0) { - throw new Error("cwise: No array arguments specified") - } - - //Make sure arguments are correct - if(proc.pre.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in pre() block") - } - if(proc.body.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in body() block") - } - if(proc.post.args.length > proc_args.length) { - throw new Error("cwise: Too many arguments in post() block") - } - - //Check debug flag - proc.debug = !!user_args.printCode || !!user_args.debug - - //Retrieve name - proc.funcName = user_args.funcName || "cwise" - - //Read in block size - proc.blockSize = user_args.blockSize || 64 - - return createThunk(proc) -} - -module.exports = compileCwise - -},{"./lib/thunk.js":159}],158:[function(_dereq_,module,exports){ -"use strict" - -var uniq = _dereq_("uniq") - -// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index) -// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments. -function innerFill(order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , has_index = proc.indexArgs.length>0 - , code = [] - , vars = [] - , idx=0, pidx=0, i, j - for(i=0; i 0) { - code.push("var " + vars.join(",")) - } - //Scan loop - for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards - idx = order[i] - code.push(["for(i",i,"=0;i",i," 0) { - code.push(["index[",pidx,"]-=s",pidx].join("")) - } - code.push(["++index[",idx,"]"].join("")) - } - code.push("}") - } - return code.join("\n") -} - -// Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block. -// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary. -// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used. -function outerFill(matched, order, proc, body) { - var dimension = order.length - , nargs = proc.arrayArgs.length - , blockSize = proc.blockSize - , has_index = proc.indexArgs.length > 0 - , code = [] - for(var i=0; i0;){"].join("")) // Iterate back to front - code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j). - code.push(["s",order[i],"=j",i].join("")) - code.push(["j",i,"=0"].join("")) - code.push(["}else{s",order[i],"=",blockSize].join("")) - code.push(["j",i,"-=",blockSize,"}"].join("")) - if(has_index) { - code.push(["index[",order[i],"]=j",i].join("")) - } - } - for(var i=0; i 0) { - allEqual = allEqual && summary[i] === summary[i-1] - } - } - if(allEqual) { - return summary[0] - } - return summary.join("") -} - -//Generates a cwise operator -function generateCWiseOp(proc, typesig) { - - //Compute dimension - // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg. - var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0 - var orders = new Array(proc.arrayArgs.length) - var dtypes = new Array(proc.arrayArgs.length) - for(var i=0; i 0) { - vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example) - } - if(proc.indexArgs.length > 0) { - // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes. - var zeros = new Array(dimension) - for(var i=0; i 0) { - code.push("var " + vars.join(",")) - } - for(var i=0; i 3) { - code.push(processBlock(proc.pre, proc, dtypes)) - } - - //Process body - var body = processBlock(proc.body, proc, dtypes) - var matched = countMatches(loopOrders) - if(matched < dimension) { - code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example. - } else { - code.push(innerFill(loopOrders[0], proc, body)) - } - - //Inline epilog - if(proc.post.body.length > 3) { - code.push(processBlock(proc.post, proc, dtypes)) - } - - if(proc.debug) { - console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------") - } - - var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("") - var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join("")) - return f() -} -module.exports = generateCWiseOp - -},{"uniq":619}],159:[function(_dereq_,module,exports){ -"use strict" - -// The function below is called when constructing a cwise function object, and does the following: -// A function object is constructed which accepts as argument a compilation function and returns another function. -// It is this other function that is eventually returned by createThunk, and this function is the one that actually -// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed. -// The compilation passed to the first function object is used for compiling new functions. -// Once this function object is created, it is called with compile as argument, where the first argument of compile -// is bound to "proc" (essentially containing a preprocessed version of the user arguments to cwise). -// So createThunk roughly works like this: -// function createThunk(proc) { -// var thunk = function(compileBound) { -// var CACHED = {} -// return function(arrays and scalars) { -// if (dtype and order of arrays in CACHED) { -// var func = CACHED[dtype and order of arrays] -// } else { -// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays) -// } -// return func(arrays and scalars) -// } -// } -// return thunk(compile.bind1(proc)) -// } - -var compile = _dereq_("./compile.js") - -function createThunk(proc) { - var code = ["'use strict'", "var CACHED={}"] - var vars = [] - var thunkName = proc.funcName + "_cwise_thunk" - - //Build thunk - code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join("")) - var typesig = [] - var string_typesig = [] - var proc_args = [["array",proc.arrayArgs[0],".shape.slice(", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS). - Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(","+proc.arrayBlockIndices[0]+")"):")"].join("")] - var shapeLengthConditions = [], shapeConditions = [] - // Process array arguments - for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices) - shapeLengthConditions.push("array" + proc.arrayArgs[0] + ".shape.length===array" + j + ".shape.length+" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i]))) - shapeConditions.push("array" + proc.arrayArgs[0] + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[0]) + "]===array" + j + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[i]) + "]") - } - } - // Check for shape equality - if (proc.arrayArgs.length > 1) { - code.push("if (!(" + shapeLengthConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same dimensionality!')") - code.push("for(var shapeIndex=array" + proc.arrayArgs[0] + ".shape.length-" + Math.abs(proc.arrayBlockIndices[0]) + "; shapeIndex-->0;) {") - code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')") - code.push("}") - } - // Process scalar arguments - for(var i=0; i 0 ? 1 : -1; }; -},{}],199:[function(_dereq_,module,exports){ +},{}],196:[function(_dereq_,module,exports){ "use strict"; var sign = _dereq_("../math/sign") @@ -44952,7 +44507,7 @@ module.exports = function (value) { return sign(value) * floor(abs(value)); }; -},{"../math/sign":196}],200:[function(_dereq_,module,exports){ +},{"../math/sign":193}],197:[function(_dereq_,module,exports){ "use strict"; var toInteger = _dereq_("./to-integer") @@ -44960,7 +44515,7 @@ var toInteger = _dereq_("./to-integer") module.exports = function (value) { return max(0, toInteger(value)); }; -},{"./to-integer":199}],201:[function(_dereq_,module,exports){ +},{"./to-integer":196}],198:[function(_dereq_,module,exports){ // Internal method, used by iteration functions. // Calls a function for each key-value pair found in object // Optionally takes compareFn to iterate object in specific order @@ -44992,12 +44547,12 @@ module.exports = function (method, defVal) { }; }; -},{"./valid-callable":218,"./valid-value":220}],202:[function(_dereq_,module,exports){ +},{"./valid-callable":215,"./valid-value":217}],199:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.assign : _dereq_("./shim"); -},{"./is-implemented":203,"./shim":204}],203:[function(_dereq_,module,exports){ +},{"./is-implemented":200,"./shim":201}],200:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -45008,7 +44563,7 @@ module.exports = function () { return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; }; -},{}],204:[function(_dereq_,module,exports){ +},{}],201:[function(_dereq_,module,exports){ "use strict"; var keys = _dereq_("../keys") @@ -45033,7 +44588,7 @@ module.exports = function (dest, src/*, …srcn*/) { return dest; }; -},{"../keys":210,"../valid-value":220}],205:[function(_dereq_,module,exports){ +},{"../keys":207,"../valid-value":217}],202:[function(_dereq_,module,exports){ "use strict"; var aFrom = _dereq_("../array/from") @@ -45054,7 +44609,7 @@ module.exports = function (obj/*, propertyNames, options*/) { return result; }; -},{"../array/from":190,"./assign":202,"./valid-value":220}],206:[function(_dereq_,module,exports){ +},{"../array/from":187,"./assign":199,"./valid-value":217}],203:[function(_dereq_,module,exports){ // Workaround for http://code.google.com/p/v8/issues/detail?id=2804 "use strict"; @@ -45099,12 +44654,12 @@ module.exports = (function () { }; })(); -},{"./set-prototype-of/is-implemented":216,"./set-prototype-of/shim":217}],207:[function(_dereq_,module,exports){ +},{"./set-prototype-of/is-implemented":213,"./set-prototype-of/shim":214}],204:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./_iterate")("forEach"); -},{"./_iterate":201}],208:[function(_dereq_,module,exports){ +},{"./_iterate":198}],205:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -45113,19 +44668,19 @@ var map = { function: true, object: true }; module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; }; -},{"./is-value":209}],209:[function(_dereq_,module,exports){ +},{"./is-value":206}],206:[function(_dereq_,module,exports){ "use strict"; var _undefined = _dereq_("../function/noop")(); // Support ES3 engines module.exports = function (val) { return val !== _undefined && val !== null; }; -},{"../function/noop":195}],210:[function(_dereq_,module,exports){ +},{"../function/noop":192}],207:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.keys : _dereq_("./shim"); -},{"./is-implemented":211,"./shim":212}],211:[function(_dereq_,module,exports){ +},{"./is-implemented":208,"./shim":209}],208:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -45137,7 +44692,7 @@ module.exports = function () { } }; -},{}],212:[function(_dereq_,module,exports){ +},{}],209:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("../is-value"); @@ -45146,7 +44701,7 @@ var keys = Object.keys; module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; -},{"../is-value":209}],213:[function(_dereq_,module,exports){ +},{"../is-value":206}],210:[function(_dereq_,module,exports){ "use strict"; var callable = _dereq_("./valid-callable") @@ -45162,7 +44717,7 @@ module.exports = function (obj, cb/*, thisArg*/) { return result; }; -},{"./for-each":207,"./valid-callable":218}],214:[function(_dereq_,module,exports){ +},{"./for-each":204,"./valid-callable":215}],211:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -45184,12 +44739,12 @@ module.exports = function (opts1/*, …options*/) { return result; }; -},{"./is-value":209}],215:[function(_dereq_,module,exports){ +},{"./is-value":206}],212:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? Object.setPrototypeOf : _dereq_("./shim"); -},{"./is-implemented":216,"./shim":217}],216:[function(_dereq_,module,exports){ +},{"./is-implemented":213,"./shim":214}],213:[function(_dereq_,module,exports){ "use strict"; var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; @@ -45200,7 +44755,7 @@ module.exports = function (/* CustomCreate*/) { return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; }; -},{}],217:[function(_dereq_,module,exports){ +},{}],214:[function(_dereq_,module,exports){ /* eslint no-proto: "off" */ // Big thanks to @WebReflection for sorting this out @@ -45283,7 +44838,7 @@ module.exports = (function (status) { _dereq_("../create"); -},{"../create":206,"../is-object":208,"../valid-value":220}],218:[function(_dereq_,module,exports){ +},{"../create":203,"../is-object":205,"../valid-value":217}],215:[function(_dereq_,module,exports){ "use strict"; module.exports = function (fn) { @@ -45291,7 +44846,7 @@ module.exports = function (fn) { return fn; }; -},{}],219:[function(_dereq_,module,exports){ +},{}],216:[function(_dereq_,module,exports){ "use strict"; var isObject = _dereq_("./is-object"); @@ -45301,7 +44856,7 @@ module.exports = function (value) { return value; }; -},{"./is-object":208}],220:[function(_dereq_,module,exports){ +},{"./is-object":205}],217:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("./is-value"); @@ -45311,12 +44866,12 @@ module.exports = function (value) { return value; }; -},{"./is-value":209}],221:[function(_dereq_,module,exports){ +},{"./is-value":206}],218:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? String.prototype.contains : _dereq_("./shim"); -},{"./is-implemented":222,"./shim":223}],222:[function(_dereq_,module,exports){ +},{"./is-implemented":219,"./shim":220}],219:[function(_dereq_,module,exports){ "use strict"; var str = "razdwatrzy"; @@ -45326,7 +44881,7 @@ module.exports = function () { return str.contains("dwa") === true && str.contains("foo") === false; }; -},{}],223:[function(_dereq_,module,exports){ +},{}],220:[function(_dereq_,module,exports){ "use strict"; var indexOf = String.prototype.indexOf; @@ -45335,7 +44890,7 @@ module.exports = function (searchString/*, position*/) { return indexOf.call(this, searchString, arguments[1]) > -1; }; -},{}],224:[function(_dereq_,module,exports){ +},{}],221:[function(_dereq_,module,exports){ "use strict"; var objToString = Object.prototype.toString, id = objToString.call(""); @@ -45350,7 +44905,7 @@ module.exports = function (value) { ); }; -},{}],225:[function(_dereq_,module,exports){ +},{}],222:[function(_dereq_,module,exports){ "use strict"; var generated = Object.create(null), random = Math.random; @@ -45363,7 +44918,7 @@ module.exports = function () { return str; }; -},{}],226:[function(_dereq_,module,exports){ +},{}],223:[function(_dereq_,module,exports){ "use strict"; var setPrototypeOf = _dereq_("es5-ext/object/set-prototype-of") @@ -45397,7 +44952,7 @@ ArrayIterator.prototype = Object.create(Iterator.prototype, { }); defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); -},{"./":229,"d":161,"es5-ext/object/set-prototype-of":215,"es5-ext/string/#/contains":221,"es6-symbol":233}],227:[function(_dereq_,module,exports){ +},{"./":226,"d":158,"es5-ext/object/set-prototype-of":212,"es5-ext/string/#/contains":218,"es6-symbol":230}],224:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -45446,7 +45001,7 @@ module.exports = function (iterable, cb /*, thisArg*/) { } }; -},{"./get":228,"es5-ext/function/is-arguments":193,"es5-ext/object/valid-callable":218,"es5-ext/string/is-string":224}],228:[function(_dereq_,module,exports){ +},{"./get":225,"es5-ext/function/is-arguments":190,"es5-ext/object/valid-callable":215,"es5-ext/string/is-string":221}],225:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -45463,7 +45018,7 @@ module.exports = function (obj) { return new ArrayIterator(obj); }; -},{"./array":226,"./string":231,"./valid-iterable":232,"es5-ext/function/is-arguments":193,"es5-ext/string/is-string":224,"es6-symbol":233}],229:[function(_dereq_,module,exports){ +},{"./array":223,"./string":228,"./valid-iterable":229,"es5-ext/function/is-arguments":190,"es5-ext/string/is-string":221,"es6-symbol":230}],226:[function(_dereq_,module,exports){ "use strict"; var clear = _dereq_("es5-ext/array/#/clear") @@ -45571,7 +45126,7 @@ defineProperty( }) ); -},{"d":161,"d/auto-bind":160,"es5-ext/array/#/clear":189,"es5-ext/object/assign":202,"es5-ext/object/valid-callable":218,"es5-ext/object/valid-value":220,"es6-symbol":233}],230:[function(_dereq_,module,exports){ +},{"d":158,"d/auto-bind":157,"es5-ext/array/#/clear":186,"es5-ext/object/assign":199,"es5-ext/object/valid-callable":215,"es5-ext/object/valid-value":217,"es6-symbol":230}],227:[function(_dereq_,module,exports){ "use strict"; var isArguments = _dereq_("es5-ext/function/is-arguments") @@ -45589,7 +45144,7 @@ module.exports = function (value) { return typeof value[iteratorSymbol] === "function"; }; -},{"es5-ext/function/is-arguments":193,"es5-ext/object/is-value":209,"es5-ext/string/is-string":224,"es6-symbol":233}],231:[function(_dereq_,module,exports){ +},{"es5-ext/function/is-arguments":190,"es5-ext/object/is-value":206,"es5-ext/string/is-string":221,"es6-symbol":230}],228:[function(_dereq_,module,exports){ // Thanks @mathiasbynens // http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols @@ -45630,7 +45185,7 @@ StringIterator.prototype = Object.create(Iterator.prototype, { }); defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); -},{"./":229,"d":161,"es5-ext/object/set-prototype-of":215,"es6-symbol":233}],232:[function(_dereq_,module,exports){ +},{"./":226,"d":158,"es5-ext/object/set-prototype-of":212,"es6-symbol":230}],229:[function(_dereq_,module,exports){ "use strict"; var isIterable = _dereq_("./is-iterable"); @@ -45640,14 +45195,14 @@ module.exports = function (value) { return value; }; -},{"./is-iterable":230}],233:[function(_dereq_,module,exports){ +},{"./is-iterable":227}],230:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? _dereq_("ext/global-this").Symbol : _dereq_("./polyfill"); -},{"./is-implemented":234,"./polyfill":239,"ext/global-this":246}],234:[function(_dereq_,module,exports){ +},{"./is-implemented":231,"./polyfill":236,"ext/global-this":243}],231:[function(_dereq_,module,exports){ "use strict"; var global = _dereq_("ext/global-this") @@ -45669,7 +45224,7 @@ module.exports = function () { return true; }; -},{"ext/global-this":246}],235:[function(_dereq_,module,exports){ +},{"ext/global-this":243}],232:[function(_dereq_,module,exports){ "use strict"; module.exports = function (value) { @@ -45680,7 +45235,7 @@ module.exports = function (value) { return value[value.constructor.toStringTag] === "Symbol"; }; -},{}],236:[function(_dereq_,module,exports){ +},{}],233:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d"); @@ -45711,7 +45266,7 @@ module.exports = function (desc) { return name; }; -},{"d":161}],237:[function(_dereq_,module,exports){ +},{"d":158}],234:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d") @@ -45747,7 +45302,7 @@ module.exports = function (SymbolPolyfill) { }); }; -},{"d":161,"ext/global-this":246}],238:[function(_dereq_,module,exports){ +},{"d":158,"ext/global-this":243}],235:[function(_dereq_,module,exports){ "use strict"; var d = _dereq_("d") @@ -45772,7 +45327,7 @@ module.exports = function (SymbolPolyfill) { }); }; -},{"../../../validate-symbol":240,"d":161}],239:[function(_dereq_,module,exports){ +},{"../../../validate-symbol":237,"d":158}],236:[function(_dereq_,module,exports){ // ES2015 Symbol polyfill for environments that do not (or partially) support it "use strict"; @@ -45861,7 +45416,7 @@ defineProperty( d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]) ); -},{"./lib/private/generate-name":236,"./lib/private/setup/standard-symbols":237,"./lib/private/setup/symbol-registry":238,"./validate-symbol":240,"d":161,"ext/global-this":246}],240:[function(_dereq_,module,exports){ +},{"./lib/private/generate-name":233,"./lib/private/setup/standard-symbols":234,"./lib/private/setup/symbol-registry":235,"./validate-symbol":237,"d":158,"ext/global-this":243}],237:[function(_dereq_,module,exports){ "use strict"; var isSymbol = _dereq_("./is-symbol"); @@ -45871,12 +45426,12 @@ module.exports = function (value) { return value; }; -},{"./is-symbol":235}],241:[function(_dereq_,module,exports){ +},{"./is-symbol":232}],238:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? WeakMap : _dereq_("./polyfill"); -},{"./is-implemented":242,"./polyfill":244}],242:[function(_dereq_,module,exports){ +},{"./is-implemented":239,"./polyfill":241}],239:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -45899,7 +45454,7 @@ module.exports = function () { return true; }; -},{}],243:[function(_dereq_,module,exports){ +},{}],240:[function(_dereq_,module,exports){ // Exports true if environment provides native `WeakMap` implementation, whatever that is. "use strict"; @@ -45909,7 +45464,7 @@ module.exports = (function () { return Object.prototype.toString.call(new WeakMap()) === "[object WeakMap]"; }()); -},{}],244:[function(_dereq_,module,exports){ +},{}],241:[function(_dereq_,module,exports){ "use strict"; var isValue = _dereq_("es5-ext/object/is-value") @@ -45976,7 +45531,7 @@ Object.defineProperties(WeakMapPoly.prototype, { }); defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d("c", "WeakMap")); -},{"./is-native-implemented":243,"d":161,"es5-ext/object/is-value":209,"es5-ext/object/set-prototype-of":215,"es5-ext/object/valid-object":219,"es5-ext/object/valid-value":220,"es5-ext/string/random-uniq":225,"es6-iterator/for-of":227,"es6-iterator/get":228,"es6-symbol":233}],245:[function(_dereq_,module,exports){ +},{"./is-native-implemented":240,"d":158,"es5-ext/object/is-value":206,"es5-ext/object/set-prototype-of":212,"es5-ext/object/valid-object":216,"es5-ext/object/valid-value":217,"es5-ext/string/random-uniq":222,"es6-iterator/for-of":224,"es6-iterator/get":225,"es6-symbol":230}],242:[function(_dereq_,module,exports){ var naiveFallback = function () { if (typeof self === "object" && self) return self; if (typeof window === "object" && window) return window; @@ -46009,12 +45564,12 @@ module.exports = (function () { } })(); -},{}],246:[function(_dereq_,module,exports){ +},{}],243:[function(_dereq_,module,exports){ "use strict"; module.exports = _dereq_("./is-implemented")() ? globalThis : _dereq_("./implementation"); -},{"./implementation":245,"./is-implemented":247}],247:[function(_dereq_,module,exports){ +},{"./implementation":242,"./is-implemented":244}],244:[function(_dereq_,module,exports){ "use strict"; module.exports = function () { @@ -46023,7 +45578,7 @@ module.exports = function () { return globalThis.Array === Array; }; -},{}],248:[function(_dereq_,module,exports){ +},{}],245:[function(_dereq_,module,exports){ "use strict" module.exports = extractPlanes @@ -46040,7 +45595,7 @@ function extractPlanes(M, zNear, zFar) { [ zf*M[12] - M[8], zf*M[13] - M[9], zf*M[14] - M[10], zf*M[15] - M[11] ] ] } -},{}],249:[function(_dereq_,module,exports){ +},{}],246:[function(_dereq_,module,exports){ /** * inspired by is-number * but significantly simplified and sped up by ignoring number and string constructors @@ -46066,7 +45621,7 @@ module.exports = function(n) { return n - n < 1; }; -},{"is-string-blank":458}],250:[function(_dereq_,module,exports){ +},{"is-string-blank":448}],247:[function(_dereq_,module,exports){ 'use strict' module.exports = createFilteredVector @@ -46359,69 +45914,7 @@ function createFilteredVector(initState, initVelocity, initTime) { } } -},{"binary-search-bounds":251,"cubic-hermite":156}],251:[function(_dereq_,module,exports){ -"use strict" - -function compileSearch(funcName, predicate, reversed, extraArgs, useNdarray, earlyOut) { - var code = [ - "function ", funcName, "(a,l,h,", extraArgs.join(","), "){", -earlyOut ? "" : "var i=", (reversed ? "l-1" : "h+1"), -";while(l<=h){\ -var m=(l+h)>>>1,x=a", useNdarray ? ".get(m)" : "[m]"] - if(earlyOut) { - if(predicate.indexOf("c") < 0) { - code.push(";if(x===y){return m}else if(x<=y){") - } else { - code.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){") - } - } else { - code.push(";if(", predicate, "){i=m;") - } - if(reversed) { - code.push("l=m+1}else{h=m-1}") - } else { - code.push("h=m-1}else{l=m+1}") - } - code.push("}") - if(earlyOut) { - code.push("return -1};") - } else { - code.push("return i};") - } - return code.join("") -} - -function compileBoundsSearch(predicate, reversed, suffix, earlyOut) { - var result = new Function([ - compileSearch("A", "x" + predicate + "y", reversed, ["y"], false, earlyOut), - compileSearch("B", "x" + predicate + "y", reversed, ["y"], true, earlyOut), - compileSearch("P", "c(x,y)" + predicate + "0", reversed, ["y", "c"], false, earlyOut), - compileSearch("Q", "c(x,y)" + predicate + "0", reversed, ["y", "c"], true, earlyOut), -"function dispatchBsearch", suffix, "(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", suffix].join("")) - return result() -} - -module.exports = { - ge: compileBoundsSearch(">=", false, "GE"), - gt: compileBoundsSearch(">", false, "GT"), - lt: compileBoundsSearch("<", true, "LT"), - le: compileBoundsSearch("<=", true, "LE"), - eq: compileBoundsSearch("-", true, "EQ", true) -} - -},{}],252:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"cubic-hermite":156}],248:[function(_dereq_,module,exports){ /*eslint new-cap:0*/ var dtype = _dereq_('dtype') @@ -46481,7 +45974,7 @@ function flattenVertexData (data, output, offset) { return output } -},{"dtype":184}],253:[function(_dereq_,module,exports){ +},{"dtype":181}],249:[function(_dereq_,module,exports){ 'use strict' var stringifyFont = _dereq_('css-font/stringify') @@ -46540,7 +46033,7 @@ function atlas(options) { return canvas } -},{"css-font/stringify":153}],254:[function(_dereq_,module,exports){ +},{"css-font/stringify":153}],250:[function(_dereq_,module,exports){ 'use strict' module.exports = measure @@ -46727,7 +46220,7 @@ function firstBottom(iData) { } } -},{}],255:[function(_dereq_,module,exports){ +},{}],251:[function(_dereq_,module,exports){ "use strict" module.exports = createRBTree @@ -47724,76 +47217,7 @@ function defaultCompare(a, b) { function createRBTree(compare) { return new RedBlackTree(compare || defaultCompare, null) } -},{}],256:[function(_dereq_,module,exports){ -// transliterated from the python snippet here: -// http://en.wikipedia.org/wiki/Lanczos_approximation - -var g = 7; -var p = [ - 0.99999999999980993, - 676.5203681218851, - -1259.1392167224028, - 771.32342877765313, - -176.61502916214059, - 12.507343278686905, - -0.13857109526572012, - 9.9843695780195716e-6, - 1.5056327351493116e-7 -]; - -var g_ln = 607/128; -var p_ln = [ - 0.99999999999999709182, - 57.156235665862923517, - -59.597960355475491248, - 14.136097974741747174, - -0.49191381609762019978, - 0.33994649984811888699e-4, - 0.46523628927048575665e-4, - -0.98374475304879564677e-4, - 0.15808870322491248884e-3, - -0.21026444172410488319e-3, - 0.21743961811521264320e-3, - -0.16431810653676389022e-3, - 0.84418223983852743293e-4, - -0.26190838401581408670e-4, - 0.36899182659531622704e-5 -]; - -// Spouge approximation (suitable for large arguments) -function lngamma(z) { - - if(z < 0) return Number('0/0'); - var x = p_ln[0]; - for(var i = p_ln.length - 1; i > 0; --i) x += p_ln[i] / (z + i); - var t = z + g_ln + 0.5; - return .5*Math.log(2*Math.PI)+(z+.5)*Math.log(t)-t+Math.log(x)-Math.log(z); -} - -module.exports = function gamma (z) { - if (z < 0.5) { - return Math.PI / (Math.sin(Math.PI * z) * gamma(1 - z)); - } - else if(z > 100) return Math.exp(lngamma(z)); - else { - z -= 1; - var x = p[0]; - for (var i = 1; i < g + 2; i++) { - x += p[i] / (z + i); - } - var t = z + g + 0.5; - - return Math.sqrt(2 * Math.PI) - * Math.pow(t, z + 0.5) - * Math.exp(-t) - * x - ; - } -}; - -module.exports.log = lngamma; - -},{}],257:[function(_dereq_,module,exports){ +},{}],252:[function(_dereq_,module,exports){ module.exports = getCanvasContext function getCanvasContext (type, opts) { if (typeof type !== 'string') { @@ -47833,7 +47257,7 @@ function getCanvasContext (type, opts) { return (gl || null) // ensure null on fail } -},{}],258:[function(_dereq_,module,exports){ +},{}],253:[function(_dereq_,module,exports){ 'use strict' module.exports = createAxes @@ -48441,7 +47865,7 @@ function createAxes(gl, options) { return axes } -},{"./lib/background.js":259,"./lib/cube.js":260,"./lib/lines.js":261,"./lib/text.js":263,"./lib/ticks.js":264}],259:[function(_dereq_,module,exports){ +},{"./lib/background.js":254,"./lib/cube.js":255,"./lib/lines.js":256,"./lib/text.js":258,"./lib/ticks.js":259}],254:[function(_dereq_,module,exports){ 'use strict' module.exports = createBackgroundCube @@ -48554,7 +47978,7 @@ function createBackgroundCube(gl) { return new BackgroundCube(gl, buffer, vao, shader) } -},{"./shaders":262,"gl-buffer":267,"gl-vao":361}],260:[function(_dereq_,module,exports){ +},{"./shaders":257,"gl-buffer":261,"gl-vao":353}],255:[function(_dereq_,module,exports){ "use strict" module.exports = getCubeEdges @@ -48796,7 +48220,7 @@ function getCubeEdges(model, view, projection, bounds, ortho) { //Return result return CUBE_RESULT } -},{"bit-twiddle":104,"gl-mat4/multiply":301,"robust-orientation":548,"split-polygon":567}],261:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"gl-mat4/multiply":295,"robust-orientation":534,"split-polygon":552}],256:[function(_dereq_,module,exports){ 'use strict' module.exports = createLines @@ -49006,7 +48430,7 @@ function createLines(gl, bounds, ticks) { return new Lines(gl, vertBuf, vao, shader, tickCount, tickOffset, gridCount, gridOffset) } -},{"./shaders":262,"gl-buffer":267,"gl-vao":361}],262:[function(_dereq_,module,exports){ +},{"./shaders":257,"gl-buffer":261,"gl-vao":353}],257:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -49037,7 +48461,7 @@ exports.bg = function(gl) { ]) } -},{"gl-shader":339,"glslify":265}],263:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":434}],258:[function(_dereq_,module,exports){ (function (process){(function (){ "use strict" @@ -49259,7 +48683,7 @@ function createTextSprites( } }).call(this)}).call(this,_dereq_('_process')) -},{"./shaders":262,"_process":528,"gl-buffer":267,"gl-vao":361,"vectorize-text":623}],264:[function(_dereq_,module,exports){ +},{"./shaders":257,"_process":514,"gl-buffer":261,"gl-vao":353,"vectorize-text":607}],259:[function(_dereq_,module,exports){ 'use strict' exports.create = defaultTicks @@ -49340,19 +48764,7 @@ function ticksEqual(ticksA, ticksB) { } return true } -},{}],265:[function(_dereq_,module,exports){ -module.exports = function(strings) { - if (typeof strings === 'string') strings = [strings] - var exprs = [].slice.call(arguments,1) - var parts = [] - for (var i = 0; i < strings.length-1; i++) { - parts.push(strings[i], exprs[i] || '') - } - parts.push(strings[i]) - return parts.join('') -} - -},{}],266:[function(_dereq_,module,exports){ +},{}],260:[function(_dereq_,module,exports){ "use strict" module.exports = axesProperties @@ -49496,7 +48908,7 @@ i_loop: return ranges } -},{"./lib/cube.js":260,"extract-frustum-planes":248,"gl-mat4/multiply":301,"gl-mat4/transpose":312,"gl-vec4/transformMat4":432,"split-polygon":567}],267:[function(_dereq_,module,exports){ +},{"./lib/cube.js":255,"extract-frustum-planes":245,"gl-mat4/multiply":295,"gl-mat4/transpose":306,"gl-vec4/transformMat4":424,"split-polygon":552}],261:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") @@ -49650,7 +49062,7 @@ function createBuffer(gl, data, type, usage) { module.exports = createBuffer -},{"ndarray":483,"ndarray-ops":478,"typedarray-pool":617}],268:[function(_dereq_,module,exports){ +},{"ndarray":472,"ndarray-ops":467,"typedarray-pool":601}],262:[function(_dereq_,module,exports){ "use strict"; var vec3 = _dereq_('gl-vec3'); @@ -49788,7 +49200,7 @@ module.exports.createConeMesh = function(gl, params) { }); } -},{"./create_mesh":269,"./lib/shaders":270,"gl-vec3":380}],269:[function(_dereq_,module,exports){ +},{"./create_mesh":263,"./lib/shaders":264,"gl-vec3":372}],263:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -50363,7 +49775,7 @@ function createVectorMesh(gl, params, opts) { module.exports = createVectorMesh -},{"colormap":137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-shader":339,"gl-texture2d":356,"gl-vao":361,"ndarray":483}],270:[function(_dereq_,module,exports){ +},{"colormap":137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-shader":332,"gl-texture2d":348,"gl-vao":353,"ndarray":472}],264:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var triVertSrc = glslify(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) @@ -50391,7 +49803,7 @@ exports.pickShader = { ] } -},{"glslify":442}],271:[function(_dereq_,module,exports){ +},{"glslify":434}],265:[function(_dereq_,module,exports){ module.exports = { 0: 'NONE', 1: 'ONE', @@ -50691,14 +50103,14 @@ module.exports = { 37444: 'BROWSER_DEFAULT_WEBGL' } -},{}],272:[function(_dereq_,module,exports){ +},{}],266:[function(_dereq_,module,exports){ var gl10 = _dereq_('./1.0/numbers') module.exports = function lookupConstant (number) { return gl10[number] } -},{"./1.0/numbers":271}],273:[function(_dereq_,module,exports){ +},{"./1.0/numbers":265}],267:[function(_dereq_,module,exports){ 'use strict' module.exports = createErrorBars @@ -50949,9 +50361,19 @@ function createErrorBars(options) { return result } -},{"./shaders/index":275,"gl-buffer":267,"gl-vao":361}],274:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],275:[function(_dereq_,module,exports){ +},{"./shaders/index":269,"gl-buffer":261,"gl-vao":353}],268:[function(_dereq_,module,exports){ +module.exports = function(strings) { + if (typeof strings === 'string') strings = [strings] + var exprs = [].slice.call(arguments,1) + var parts = [] + for (var i = 0; i < strings.length-1; i++) { + parts.push(strings[i], exprs[i] || '') + } + parts.push(strings[i]) + return parts.join('') +} + +},{}],269:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -50968,7 +50390,7 @@ module.exports = function(gl) { ]) } -},{"gl-shader":339,"glslify":274}],276:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":268}],270:[function(_dereq_,module,exports){ 'use strict' var createTexture = _dereq_('gl-texture2d') @@ -51435,7 +50857,7 @@ function createFBO(gl, width, height, options) { WEBGL_draw_buffers) } -},{"gl-texture2d":356}],277:[function(_dereq_,module,exports){ +},{"gl-texture2d":348}],271:[function(_dereq_,module,exports){ var sprintf = _dereq_('sprintf-js').sprintf; var glConstants = _dereq_('gl-constants/lookup'); @@ -51490,7 +50912,7 @@ function formatCompilerError(errLog, src, type) { } -},{"add-line-numbers":72,"gl-constants/lookup":272,"glsl-shader-name":434,"sprintf-js":568}],278:[function(_dereq_,module,exports){ +},{"add-line-numbers":72,"gl-constants/lookup":266,"glsl-shader-name":426,"sprintf-js":553}],272:[function(_dereq_,module,exports){ 'use strict' module.exports = createHeatmap2D @@ -51842,7 +51264,7 @@ function createHeatmap2D (plot, options) { return heatmap } -},{"./lib/shaders":279,"binary-search-bounds":103,"gl-buffer":267,"gl-shader":339,"iota-array":451,"typedarray-pool":617}],279:[function(_dereq_,module,exports){ +},{"./lib/shaders":273,"binary-search-bounds":103,"gl-buffer":261,"gl-shader":332,"iota-array":441,"typedarray-pool":601}],273:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -51854,7 +51276,7 @@ module.exports = { pickVertex: glslify(["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"]) } -},{"glslify":442}],280:[function(_dereq_,module,exports){ +},{"glslify":434}],274:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var createShader = _dereq_('gl-shader') @@ -51878,7 +51300,7 @@ exports.createPickShader = function(gl) { return createShader(gl, vertSrc, pickFrag, null, ATTRIBUTES) } -},{"gl-shader":339,"glslify":282}],281:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":276}],275:[function(_dereq_,module,exports){ 'use strict' module.exports = createLinePlot @@ -52279,9 +51701,9 @@ function createLinePlot (options) { return linePlot } -},{"./lib/shaders":280,"binary-search-bounds":103,"gl-buffer":267,"gl-texture2d":356,"gl-vao":361,"ndarray":483}],282:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],283:[function(_dereq_,module,exports){ +},{"./lib/shaders":274,"binary-search-bounds":103,"gl-buffer":261,"gl-texture2d":348,"gl-vao":353,"ndarray":472}],276:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],277:[function(_dereq_,module,exports){ module.exports = adjoint; /** @@ -52315,7 +51737,7 @@ function adjoint(out, a) { out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); return out; }; -},{}],284:[function(_dereq_,module,exports){ +},{}],278:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -52344,7 +51766,7 @@ function clone(a) { out[15] = a[15]; return out; }; -},{}],285:[function(_dereq_,module,exports){ +},{}],279:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -52373,7 +51795,7 @@ function copy(out, a) { out[15] = a[15]; return out; }; -},{}],286:[function(_dereq_,module,exports){ +},{}],280:[function(_dereq_,module,exports){ module.exports = create; /** @@ -52401,7 +51823,7 @@ function create() { out[15] = 1; return out; }; -},{}],287:[function(_dereq_,module,exports){ +},{}],281:[function(_dereq_,module,exports){ module.exports = determinant; /** @@ -52432,7 +51854,7 @@ function determinant(a) { // Calculate the determinant return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; }; -},{}],288:[function(_dereq_,module,exports){ +},{}],282:[function(_dereq_,module,exports){ module.exports = fromQuat; /** @@ -52480,7 +51902,7 @@ function fromQuat(out, q) { return out; }; -},{}],289:[function(_dereq_,module,exports){ +},{}],283:[function(_dereq_,module,exports){ module.exports = fromRotation /** @@ -52535,7 +51957,7 @@ function fromRotation(out, rad, axis) { return out } -},{}],290:[function(_dereq_,module,exports){ +},{}],284:[function(_dereq_,module,exports){ module.exports = fromRotationTranslation; /** @@ -52589,7 +52011,7 @@ function fromRotationTranslation(out, q, v) { return out; }; -},{}],291:[function(_dereq_,module,exports){ +},{}],285:[function(_dereq_,module,exports){ module.exports = fromScaling /** @@ -52623,7 +52045,7 @@ function fromScaling(out, v) { return out } -},{}],292:[function(_dereq_,module,exports){ +},{}],286:[function(_dereq_,module,exports){ module.exports = fromTranslation /** @@ -52657,7 +52079,7 @@ function fromTranslation(out, v) { return out } -},{}],293:[function(_dereq_,module,exports){ +},{}],287:[function(_dereq_,module,exports){ module.exports = fromXRotation /** @@ -52694,7 +52116,7 @@ function fromXRotation(out, rad) { out[15] = 1 return out } -},{}],294:[function(_dereq_,module,exports){ +},{}],288:[function(_dereq_,module,exports){ module.exports = fromYRotation /** @@ -52731,7 +52153,7 @@ function fromYRotation(out, rad) { out[15] = 1 return out } -},{}],295:[function(_dereq_,module,exports){ +},{}],289:[function(_dereq_,module,exports){ module.exports = fromZRotation /** @@ -52768,7 +52190,7 @@ function fromZRotation(out, rad) { out[15] = 1 return out } -},{}],296:[function(_dereq_,module,exports){ +},{}],290:[function(_dereq_,module,exports){ module.exports = frustum; /** @@ -52805,7 +52227,7 @@ function frustum(out, left, right, bottom, top, near, far) { out[15] = 0; return out; }; -},{}],297:[function(_dereq_,module,exports){ +},{}],291:[function(_dereq_,module,exports){ module.exports = identity; /** @@ -52833,7 +52255,7 @@ function identity(out) { out[15] = 1; return out; }; -},{}],298:[function(_dereq_,module,exports){ +},{}],292:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create') , clone: _dereq_('./clone') @@ -52866,7 +52288,7 @@ module.exports = { , str: _dereq_('./str') } -},{"./adjoint":283,"./clone":284,"./copy":285,"./create":286,"./determinant":287,"./fromQuat":288,"./fromRotation":289,"./fromRotationTranslation":290,"./fromScaling":291,"./fromTranslation":292,"./fromXRotation":293,"./fromYRotation":294,"./fromZRotation":295,"./frustum":296,"./identity":297,"./invert":299,"./lookAt":300,"./multiply":301,"./ortho":302,"./perspective":303,"./perspectiveFromFieldOfView":304,"./rotate":305,"./rotateX":306,"./rotateY":307,"./rotateZ":308,"./scale":309,"./str":310,"./translate":311,"./transpose":312}],299:[function(_dereq_,module,exports){ +},{"./adjoint":277,"./clone":278,"./copy":279,"./create":280,"./determinant":281,"./fromQuat":282,"./fromRotation":283,"./fromRotationTranslation":284,"./fromScaling":285,"./fromTranslation":286,"./fromXRotation":287,"./fromYRotation":288,"./fromZRotation":289,"./frustum":290,"./identity":291,"./invert":293,"./lookAt":294,"./multiply":295,"./ortho":296,"./perspective":297,"./perspectiveFromFieldOfView":298,"./rotate":299,"./rotateX":300,"./rotateY":301,"./rotateZ":302,"./scale":303,"./str":304,"./translate":305,"./transpose":306}],293:[function(_dereq_,module,exports){ module.exports = invert; /** @@ -52922,7 +52344,7 @@ function invert(out, a) { return out; }; -},{}],300:[function(_dereq_,module,exports){ +},{}],294:[function(_dereq_,module,exports){ var identity = _dereq_('./identity'); module.exports = lookAt; @@ -53013,7 +52435,7 @@ function lookAt(out, eye, center, up) { return out; }; -},{"./identity":297}],301:[function(_dereq_,module,exports){ +},{"./identity":291}],295:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -53056,7 +52478,7 @@ function multiply(out, a, b) { out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; return out; }; -},{}],302:[function(_dereq_,module,exports){ +},{}],296:[function(_dereq_,module,exports){ module.exports = ortho; /** @@ -53093,7 +52515,7 @@ function ortho(out, left, right, bottom, top, near, far) { out[15] = 1; return out; }; -},{}],303:[function(_dereq_,module,exports){ +},{}],297:[function(_dereq_,module,exports){ module.exports = perspective; /** @@ -53127,7 +52549,7 @@ function perspective(out, fovy, aspect, near, far) { out[15] = 0; return out; }; -},{}],304:[function(_dereq_,module,exports){ +},{}],298:[function(_dereq_,module,exports){ module.exports = perspectiveFromFieldOfView; /** @@ -53169,7 +52591,7 @@ function perspectiveFromFieldOfView(out, fov, near, far) { } -},{}],305:[function(_dereq_,module,exports){ +},{}],299:[function(_dereq_,module,exports){ module.exports = rotate; /** @@ -53234,7 +52656,7 @@ function rotate(out, a, rad, axis) { } return out; }; -},{}],306:[function(_dereq_,module,exports){ +},{}],300:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -53279,7 +52701,7 @@ function rotateX(out, a, rad) { out[11] = a23 * c - a13 * s; return out; }; -},{}],307:[function(_dereq_,module,exports){ +},{}],301:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -53324,7 +52746,7 @@ function rotateY(out, a, rad) { out[11] = a03 * s + a23 * c; return out; }; -},{}],308:[function(_dereq_,module,exports){ +},{}],302:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -53369,7 +52791,7 @@ function rotateZ(out, a, rad) { out[7] = a13 * c - a03 * s; return out; }; -},{}],309:[function(_dereq_,module,exports){ +},{}],303:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -53401,7 +52823,7 @@ function scale(out, a, v) { out[15] = a[15]; return out; }; -},{}],310:[function(_dereq_,module,exports){ +},{}],304:[function(_dereq_,module,exports){ module.exports = str; /** @@ -53416,7 +52838,7 @@ function str(a) { a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; }; -},{}],311:[function(_dereq_,module,exports){ +},{}],305:[function(_dereq_,module,exports){ module.exports = translate; /** @@ -53455,7 +52877,7 @@ function translate(out, a, v) { return out; }; -},{}],312:[function(_dereq_,module,exports){ +},{}],306:[function(_dereq_,module,exports){ module.exports = transpose; /** @@ -53505,7 +52927,7 @@ function transpose(out, a) { return out; }; -},{}],313:[function(_dereq_,module,exports){ +},{}],307:[function(_dereq_,module,exports){ 'use strict' var barycentric = _dereq_('barycentric') @@ -53603,7 +53025,7 @@ function closestPointToPickLocation(simplex, pixelCoord, model, view, projection } return [closestIndex, interpolate(simplex, weights), weights] } -},{"barycentric":85,"polytope-closest-point/lib/closest_point_2d.js":512}],314:[function(_dereq_,module,exports){ +},{"barycentric":85,"polytope-closest-point/lib/closest_point_2d.js":498}],308:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var triVertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]) @@ -53672,7 +53094,7 @@ exports.contourShader = { ] } -},{"glslify":442}],315:[function(_dereq_,module,exports){ +},{"glslify":434}],309:[function(_dereq_,module,exports){ 'use strict' var DEFAULT_VERTEX_NORMALS_EPSILON = 1e-6; // may be too large if triangles are very small @@ -54783,7 +54205,7 @@ function createSimplicialMesh(gl, params) { module.exports = createSimplicialMesh -},{"./lib/closest-point":313,"./lib/shaders":314,"colormap":137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-shader":339,"gl-texture2d":356,"gl-vao":361,"ndarray":483,"normals":486,"simplicial-complex-contour":557,"typedarray-pool":617}],316:[function(_dereq_,module,exports){ +},{"./lib/closest-point":307,"./lib/shaders":308,"colormap":137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-shader":332,"gl-texture2d":348,"gl-vao":353,"ndarray":472,"normals":475,"simplicial-complex-contour":543,"typedarray-pool":601}],310:[function(_dereq_,module,exports){ 'use strict' module.exports = createBoxes @@ -54846,7 +54268,7 @@ function createBoxes(plot) { return new Boxes(plot, vbo, shader) } -},{"./shaders":319,"gl-buffer":267,"gl-shader":339}],317:[function(_dereq_,module,exports){ +},{"./shaders":313,"gl-buffer":261,"gl-shader":332}],311:[function(_dereq_,module,exports){ 'use strict' module.exports = createGrid @@ -55093,7 +54515,7 @@ function createGrid(plot) { return grid } -},{"./shaders":319,"binary-search-bounds":103,"gl-buffer":267,"gl-shader":339}],318:[function(_dereq_,module,exports){ +},{"./shaders":313,"binary-search-bounds":103,"gl-buffer":261,"gl-shader":332}],312:[function(_dereq_,module,exports){ 'use strict' module.exports = createLines @@ -55158,7 +54580,7 @@ function createLines(plot) { return lines } -},{"./shaders":319,"gl-buffer":267,"gl-shader":339}],319:[function(_dereq_,module,exports){ +},{"./shaders":313,"gl-buffer":261,"gl-shader":332}],313:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -55176,7 +54598,7 @@ module.exports = { tickVert: glslify(["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"]) } -},{"glslify":321}],320:[function(_dereq_,module,exports){ +},{"glslify":315}],314:[function(_dereq_,module,exports){ 'use strict' module.exports = createTextElements @@ -55454,9 +54876,9 @@ function createTextElements(plot) { return text } -},{"./shaders":319,"binary-search-bounds":103,"gl-buffer":267,"gl-shader":339,"text-cache":596}],321:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],322:[function(_dereq_,module,exports){ +},{"./shaders":313,"binary-search-bounds":103,"gl-buffer":261,"gl-shader":332,"text-cache":581}],315:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],316:[function(_dereq_,module,exports){ 'use strict' module.exports = createGLPlot2D @@ -56039,7 +55461,7 @@ function createGLPlot2D(options) { return plot } -},{"./lib/box":316,"./lib/grid":317,"./lib/line":318,"./lib/text":320,"gl-select-static":338}],323:[function(_dereq_,module,exports){ +},{"./lib/box":310,"./lib/grid":311,"./lib/line":312,"./lib/text":314,"gl-select-static":331}],317:[function(_dereq_,module,exports){ 'use strict' module.exports = createCamera @@ -56320,7 +55742,7 @@ function createCamera(element, options) { return camera } -},{"3d-view":55,"has-passive-events":444,"mouse-change":470,"mouse-event-offset":471,"mouse-wheel":473,"right-now":542}],324:[function(_dereq_,module,exports){ +},{"3d-view":55,"has-passive-events":436,"mouse-change":459,"mouse-event-offset":460,"mouse-wheel":462,"right-now":528}],318:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') var createShader = _dereq_('gl-shader') @@ -56331,9 +55753,7 @@ module.exports = function(gl) { return createShader(gl, vertSrc, fragSrc, null, [ { name: 'position', type: 'vec2'}]) } -},{"gl-shader":339,"glslify":325}],325:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],326:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":434}],319:[function(_dereq_,module,exports){ 'use strict' var createCamera = _dereq_('./camera.js') @@ -57188,7 +56608,7 @@ function calcCameraParams(scene, isOrtho) { } } -},{"./camera.js":323,"./lib/shader":324,"a-big-triangle":70,"gl-axes3d":258,"gl-axes3d/properties":266,"gl-fbo":276,"gl-mat4/ortho":302,"gl-mat4/perspective":303,"gl-select-static":338,"gl-spikes3d":349,"is-mobile":455,"mouse-change":470}],327:[function(_dereq_,module,exports){ +},{"./camera.js":317,"./lib/shader":318,"a-big-triangle":70,"gl-axes3d":253,"gl-axes3d/properties":260,"gl-fbo":270,"gl-mat4/ortho":296,"gl-mat4/perspective":297,"gl-select-static":331,"gl-spikes3d":341,"is-mobile":445,"mouse-change":459}],320:[function(_dereq_,module,exports){ var glslify = _dereq_('glslify') exports.pointVertex = glslify(["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}"]) @@ -57196,7 +56616,7 @@ exports.pointFragment = glslify(["precision mediump float;\n#define GLSLIFY exports.pickVertex = glslify(["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"]) exports.pickFragment = glslify(["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"]) -},{"glslify":442}],328:[function(_dereq_,module,exports){ +},{"glslify":434}],321:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -57416,7 +56836,7 @@ function createPointcloud2D(plot, options) { return result } -},{"./lib/shader":327,"gl-buffer":267,"gl-shader":339,"typedarray-pool":617}],329:[function(_dereq_,module,exports){ +},{"./lib/shader":320,"gl-buffer":261,"gl-shader":332,"typedarray-pool":601}],322:[function(_dereq_,module,exports){ module.exports = slerp /** @@ -57469,14 +56889,14 @@ function slerp (out, a, b, t) { return out } -},{}],330:[function(_dereq_,module,exports){ +},{}],323:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(a){ return (!a && a !== 0) ? '' : a.toString(); } -},{}],331:[function(_dereq_,module,exports){ +},{}],324:[function(_dereq_,module,exports){ "use strict" var vectorizeText = _dereq_("vectorize-text") @@ -57545,7 +56965,7 @@ function getGlyph(symbol, font, pixelRatio) { //Save cached symbol return fontCache[symbol] = [triSymbol, lineSymbol, bounds] } -},{"vectorize-text":623}],332:[function(_dereq_,module,exports){ +},{"vectorize-text":607}],325:[function(_dereq_,module,exports){ var createShaderWrapper = _dereq_('gl-shader') var glslify = _dereq_('glslify') @@ -57622,9 +57042,9 @@ exports.createPickProject = function(gl) { return createShader(gl, pickProject) } -},{"gl-shader":339,"glslify":333}],333:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],334:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":326}],326:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],327:[function(_dereq_,module,exports){ 'use strict' var isAllBlank = _dereq_('is-string-blank') @@ -58496,7 +57916,7 @@ function createPointCloud(options) { return pointCloud } -},{"./lib/get-simple-string":330,"./lib/glyphs":331,"./lib/shaders":332,"gl-buffer":267,"gl-mat4/multiply":301,"gl-vao":361,"is-string-blank":458,"typedarray-pool":617}],335:[function(_dereq_,module,exports){ +},{"./lib/get-simple-string":323,"./lib/glyphs":324,"./lib/shaders":325,"gl-buffer":261,"gl-mat4/multiply":295,"gl-vao":353,"is-string-blank":448,"typedarray-pool":601}],328:[function(_dereq_,module,exports){ 'use strict' var glslify = _dereq_('glslify') @@ -58504,9 +57924,9 @@ var glslify = _dereq_('glslify') exports.boxVertex = glslify(["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"]) exports.boxFragment = glslify(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"]) -},{"glslify":336}],336:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],337:[function(_dereq_,module,exports){ +},{"glslify":329}],329:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],330:[function(_dereq_,module,exports){ 'use strict' var createShader = _dereq_('gl-shader') @@ -58632,7 +58052,7 @@ function createSelectBox(plot, options) { return selectBox } -},{"./lib/shaders":335,"gl-buffer":267,"gl-shader":339}],338:[function(_dereq_,module,exports){ +},{"./lib/shaders":328,"gl-buffer":261,"gl-shader":332}],331:[function(_dereq_,module,exports){ 'use strict' module.exports = createSelectBuffer @@ -58817,7 +58237,7 @@ function createSelectBuffer(gl, shape) { return new SelectBuffer(gl, fbo, buffer) } -},{"bit-twiddle":104,"gl-fbo":276,"ndarray":483,"typedarray-pool":617}],339:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"gl-fbo":270,"ndarray":472,"typedarray-pool":601}],332:[function(_dereq_,module,exports){ 'use strict' var createUniformWrapper = _dereq_('./lib/create-uniforms') @@ -59083,7 +58503,7 @@ function createShader( module.exports = createShader -},{"./lib/GLError":340,"./lib/create-attributes":341,"./lib/create-uniforms":342,"./lib/reflect":343,"./lib/runtime-reflect":344,"./lib/shader-cache":345}],340:[function(_dereq_,module,exports){ +},{"./lib/GLError":333,"./lib/create-attributes":334,"./lib/create-uniforms":335,"./lib/reflect":336,"./lib/runtime-reflect":337,"./lib/shader-cache":338}],333:[function(_dereq_,module,exports){ function GLError (rawError, shortMessage, longMessage) { this.shortMessage = shortMessage || '' this.longMessage = longMessage || '' @@ -59098,7 +58518,7 @@ GLError.prototype.name = 'GLError' GLError.prototype.constructor = GLError module.exports = GLError -},{}],341:[function(_dereq_,module,exports){ +},{}],334:[function(_dereq_,module,exports){ 'use strict' module.exports = createAttributeWrapper @@ -59159,6 +58579,40 @@ Object.defineProperty(proto, 'location', { } }) +var allFns = [ + function (gl, v, x0) { + if (x0.length === undefined) { + return gl.vertexAttrib1f(v, x0) + } else { + return gl.vertexAttrib1fv(v, x0) + } + }, + + function (gl, v, x0, x1) { + if (x0.length === undefined) { + return gl.vertexAttrib2f(v, x0, x1) + } else { + return gl.vertexAttrib2fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2) { + if (x0.length === undefined) { + return gl.vertexAttrib3f(v, x0, x1, x2) + } else { + return gl.vertexAttrib3fv(v, x0) + } + }, + + function (gl, v, x0, x1, x2, x3) { + if (x0.length === undefined) { + return gl.vertexAttrib4f(v, x0, x1, x2, x3) + } else { + return gl.vertexAttrib4fv(v, x0) + } + } +] + //Adds a vector attribute to obj function addVectorAttribute( gl @@ -59169,21 +58623,7 @@ function addVectorAttribute( , obj , name) { - //Construct constant function - var constFuncArgs = [ 'gl', 'v' ] - var varNames = [] - for(var i=0; i 4) { - throw new GLError('', 'Invalid data type') + function makeSetter(type) { + return function updateProperty(obj){ + var indices = enumerateIndices('', type) + for(var i=0; i 4) { - throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + type) + var vidx = t.indexOf('vec') + if(0 <= vidx && vidx <= 1 && t.length === 4 + vidx) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid data type') + } + switch(t.charAt(0)) { + case 'b': + case 'i': + gl['uniform' + d + 'iv'](locations[idx], objPath) + break + case 'v': + gl['uniform' + d + 'fv'](locations[idx], objPath) + break + default: + throw new GLError('', 'Unrecognized data type for vector ' + name + ': ' + t) + } + } else if(t.indexOf('mat') === 0 && t.length === 4) { + d = t.charCodeAt(t.length-1) - 48 + if(d < 2 || d > 4) { + throw new GLError('', 'Invalid uniform dimension type for matrix ' + name + ': ' + t) + } + gl['uniformMatrix' + d + 'fv'](locations[idx], false, objPath) + break + } else { + throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + t) + } } - return 'gl.uniformMatrix' + d + 'fv(locations[' + index + '],false,obj' + path + ')' - } else { - throw new GLError('', 'Unknown uniform data type for ' + name + ': ' + type) } - break + } } } @@ -59457,21 +58931,6 @@ function createUniformWrapper(gl, wrapper, uniforms, locations) { return indices } - function makeSetter(type) { - var code = [ 'return function updateProperty(obj){' ] - var indices = enumerateIndices('', type) - for(var i=0; i 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]) @@ -60163,9 +59619,9 @@ exports.pickShader = { ] } -},{"glslify":351}],351:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],352:[function(_dereq_,module,exports){ +},{"glslify":343}],343:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],344:[function(_dereq_,module,exports){ "use strict"; var vec3 = _dereq_('gl-vec3'); @@ -60725,7 +60181,7 @@ module.exports.createTubeMesh = function(gl, params) { }); } -},{"./lib/shaders":350,"gl-cone3d":268,"gl-vec3":380,"gl-vec4":416}],353:[function(_dereq_,module,exports){ +},{"./lib/shaders":342,"gl-cone3d":262,"gl-vec3":372,"gl-vec4":408}],345:[function(_dereq_,module,exports){ var createShader = _dereq_('gl-shader') var glslify = _dereq_('glslify') @@ -60775,7 +60231,7 @@ exports.createPickContourShader = function (gl) { return shader } -},{"gl-shader":339,"glslify":442}],354:[function(_dereq_,module,exports){ +},{"gl-shader":332,"glslify":434}],346:[function(_dereq_,module,exports){ 'use strict' module.exports = createSurfacePlot @@ -62157,7 +61613,7 @@ function createSurfacePlot (params) { return surface } -},{"./lib/shaders":353,"binary-search-bounds":103,"bit-twiddle":104,"colormap":137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-texture2d":356,"gl-vao":361,"ndarray":483,"ndarray-gradient":476,"ndarray-ops":478,"ndarray-pack":479,"surface-nets":591,"typedarray-pool":617}],355:[function(_dereq_,module,exports){ +},{"./lib/shaders":345,"binary-search-bounds":103,"bit-twiddle":104,"colormap":137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-texture2d":348,"gl-vao":353,"ndarray":472,"ndarray-gradient":465,"ndarray-ops":467,"ndarray-pack":468,"surface-nets":576,"typedarray-pool":601}],347:[function(_dereq_,module,exports){ 'use strict' var Font = _dereq_('css-font') @@ -62885,7 +62341,7 @@ function isRegl (o) { module.exports = GlText -},{"bit-twiddle":104,"color-normalize":131,"css-font":150,"detect-kerning":181,"es6-weak-map":241,"flatten-vertex-data":252,"font-atlas":253,"font-measure":254,"gl-util/context":357,"is-plain-obj":457,"object-assign":487,"parse-rect":492,"parse-unit":494,"pick-by-alias":498,"regl":540,"to-px":600,"typedarray-pool":617}],356:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"color-normalize":131,"css-font":150,"detect-kerning":178,"es6-weak-map":238,"flatten-vertex-data":248,"font-atlas":249,"font-measure":250,"gl-util/context":349,"is-plain-obj":447,"object-assign":476,"parse-rect":481,"parse-unit":483,"pick-by-alias":485,"regl":526,"to-px":585,"typedarray-pool":601}],348:[function(_dereq_,module,exports){ 'use strict' var ndarray = _dereq_('ndarray') @@ -63448,7 +62904,7 @@ function createTexture2D(gl) { throw new Error('gl-texture2d: Invalid arguments for texture2d constructor') } -},{"ndarray":483,"ndarray-ops":478,"typedarray-pool":617}],357:[function(_dereq_,module,exports){ +},{"ndarray":472,"ndarray-ops":467,"typedarray-pool":601}],349:[function(_dereq_,module,exports){ (function (global){(function (){ /** @module gl-util/context */ 'use strict' @@ -63576,7 +63032,7 @@ function createCanvas () { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"pick-by-alias":498}],358:[function(_dereq_,module,exports){ +},{"pick-by-alias":485}],350:[function(_dereq_,module,exports){ "use strict" function doBind(gl, elements, attributes) { @@ -63631,7 +63087,7 @@ function doBind(gl, elements, attributes) { } module.exports = doBind -},{}],359:[function(_dereq_,module,exports){ +},{}],351:[function(_dereq_,module,exports){ "use strict" var bindAttribs = _dereq_("./do-bind.js") @@ -63671,7 +63127,7 @@ function createVAOEmulated(gl) { } module.exports = createVAOEmulated -},{"./do-bind.js":358}],360:[function(_dereq_,module,exports){ +},{"./do-bind.js":350}],352:[function(_dereq_,module,exports){ "use strict" var bindAttribs = _dereq_("./do-bind.js") @@ -63759,7 +63215,7 @@ function createVAONative(gl, ext) { } module.exports = createVAONative -},{"./do-bind.js":358}],361:[function(_dereq_,module,exports){ +},{"./do-bind.js":350}],353:[function(_dereq_,module,exports){ "use strict" var createVAONative = _dereq_("./lib/vao-native.js") @@ -63788,7 +63244,7 @@ function createVAO(gl, attributes, elements, elementsType) { module.exports = createVAO -},{"./lib/vao-emulated.js":359,"./lib/vao-native.js":360}],362:[function(_dereq_,module,exports){ +},{"./lib/vao-emulated.js":351,"./lib/vao-native.js":352}],354:[function(_dereq_,module,exports){ module.exports = add; /** @@ -63805,7 +63261,7 @@ function add(out, a, b) { out[2] = a[2] + b[2] return out } -},{}],363:[function(_dereq_,module,exports){ +},{}],355:[function(_dereq_,module,exports){ module.exports = angle var fromValues = _dereq_('./fromValues') @@ -63834,7 +63290,7 @@ function angle(a, b) { } } -},{"./dot":373,"./fromValues":379,"./normalize":390}],364:[function(_dereq_,module,exports){ +},{"./dot":365,"./fromValues":371,"./normalize":382}],356:[function(_dereq_,module,exports){ module.exports = ceil /** @@ -63851,7 +63307,7 @@ function ceil(out, a) { return out } -},{}],365:[function(_dereq_,module,exports){ +},{}],357:[function(_dereq_,module,exports){ module.exports = clone; /** @@ -63867,7 +63323,7 @@ function clone(a) { out[2] = a[2] return out } -},{}],366:[function(_dereq_,module,exports){ +},{}],358:[function(_dereq_,module,exports){ module.exports = copy; /** @@ -63883,7 +63339,7 @@ function copy(out, a) { out[2] = a[2] return out } -},{}],367:[function(_dereq_,module,exports){ +},{}],359:[function(_dereq_,module,exports){ module.exports = create; /** @@ -63898,7 +63354,7 @@ function create() { out[2] = 0 return out } -},{}],368:[function(_dereq_,module,exports){ +},{}],360:[function(_dereq_,module,exports){ module.exports = cross; /** @@ -63918,10 +63374,10 @@ function cross(out, a, b) { out[2] = ax * by - ay * bx return out } -},{}],369:[function(_dereq_,module,exports){ +},{}],361:[function(_dereq_,module,exports){ module.exports = _dereq_('./distance') -},{"./distance":370}],370:[function(_dereq_,module,exports){ +},{"./distance":362}],362:[function(_dereq_,module,exports){ module.exports = distance; /** @@ -63937,10 +63393,10 @@ function distance(a, b) { z = b[2] - a[2] return Math.sqrt(x*x + y*y + z*z) } -},{}],371:[function(_dereq_,module,exports){ +},{}],363:[function(_dereq_,module,exports){ module.exports = _dereq_('./divide') -},{"./divide":372}],372:[function(_dereq_,module,exports){ +},{"./divide":364}],364:[function(_dereq_,module,exports){ module.exports = divide; /** @@ -63957,7 +63413,7 @@ function divide(out, a, b) { out[2] = a[2] / b[2] return out } -},{}],373:[function(_dereq_,module,exports){ +},{}],365:[function(_dereq_,module,exports){ module.exports = dot; /** @@ -63970,10 +63426,10 @@ module.exports = dot; function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] } -},{}],374:[function(_dereq_,module,exports){ +},{}],366:[function(_dereq_,module,exports){ module.exports = 0.000001 -},{}],375:[function(_dereq_,module,exports){ +},{}],367:[function(_dereq_,module,exports){ module.exports = equals var EPSILON = _dereq_('./epsilon') @@ -63997,7 +63453,7 @@ function equals(a, b) { Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))) } -},{"./epsilon":374}],376:[function(_dereq_,module,exports){ +},{"./epsilon":366}],368:[function(_dereq_,module,exports){ module.exports = exactEquals /** @@ -64011,7 +63467,7 @@ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] } -},{}],377:[function(_dereq_,module,exports){ +},{}],369:[function(_dereq_,module,exports){ module.exports = floor /** @@ -64028,7 +63484,7 @@ function floor(out, a) { return out } -},{}],378:[function(_dereq_,module,exports){ +},{}],370:[function(_dereq_,module,exports){ module.exports = forEach; var vec = _dereq_('./create')() @@ -64073,7 +63529,7 @@ function forEach(a, stride, offset, count, fn, arg) { return a } -},{"./create":367}],379:[function(_dereq_,module,exports){ +},{"./create":359}],371:[function(_dereq_,module,exports){ module.exports = fromValues; /** @@ -64091,7 +63547,7 @@ function fromValues(x, y, z) { out[2] = z return out } -},{}],380:[function(_dereq_,module,exports){ +},{}],372:[function(_dereq_,module,exports){ module.exports = { EPSILON: _dereq_('./epsilon') , create: _dereq_('./create') @@ -64140,7 +63596,7 @@ module.exports = { , forEach: _dereq_('./forEach') } -},{"./add":362,"./angle":363,"./ceil":364,"./clone":365,"./copy":366,"./create":367,"./cross":368,"./dist":369,"./distance":370,"./div":371,"./divide":372,"./dot":373,"./epsilon":374,"./equals":375,"./exactEquals":376,"./floor":377,"./forEach":378,"./fromValues":379,"./inverse":381,"./len":382,"./length":383,"./lerp":384,"./max":385,"./min":386,"./mul":387,"./multiply":388,"./negate":389,"./normalize":390,"./random":391,"./rotateX":392,"./rotateY":393,"./rotateZ":394,"./round":395,"./scale":396,"./scaleAndAdd":397,"./set":398,"./sqrDist":399,"./sqrLen":400,"./squaredDistance":401,"./squaredLength":402,"./sub":403,"./subtract":404,"./transformMat3":405,"./transformMat4":406,"./transformQuat":407}],381:[function(_dereq_,module,exports){ +},{"./add":354,"./angle":355,"./ceil":356,"./clone":357,"./copy":358,"./create":359,"./cross":360,"./dist":361,"./distance":362,"./div":363,"./divide":364,"./dot":365,"./epsilon":366,"./equals":367,"./exactEquals":368,"./floor":369,"./forEach":370,"./fromValues":371,"./inverse":373,"./len":374,"./length":375,"./lerp":376,"./max":377,"./min":378,"./mul":379,"./multiply":380,"./negate":381,"./normalize":382,"./random":383,"./rotateX":384,"./rotateY":385,"./rotateZ":386,"./round":387,"./scale":388,"./scaleAndAdd":389,"./set":390,"./sqrDist":391,"./sqrLen":392,"./squaredDistance":393,"./squaredLength":394,"./sub":395,"./subtract":396,"./transformMat3":397,"./transformMat4":398,"./transformQuat":399}],373:[function(_dereq_,module,exports){ module.exports = inverse; /** @@ -64156,10 +63612,10 @@ function inverse(out, a) { out[2] = 1.0 / a[2] return out } -},{}],382:[function(_dereq_,module,exports){ +},{}],374:[function(_dereq_,module,exports){ module.exports = _dereq_('./length') -},{"./length":383}],383:[function(_dereq_,module,exports){ +},{"./length":375}],375:[function(_dereq_,module,exports){ module.exports = length; /** @@ -64174,7 +63630,7 @@ function length(a) { z = a[2] return Math.sqrt(x*x + y*y + z*z) } -},{}],384:[function(_dereq_,module,exports){ +},{}],376:[function(_dereq_,module,exports){ module.exports = lerp; /** @@ -64195,7 +63651,7 @@ function lerp(out, a, b, t) { out[2] = az + t * (b[2] - az) return out } -},{}],385:[function(_dereq_,module,exports){ +},{}],377:[function(_dereq_,module,exports){ module.exports = max; /** @@ -64212,7 +63668,7 @@ function max(out, a, b) { out[2] = Math.max(a[2], b[2]) return out } -},{}],386:[function(_dereq_,module,exports){ +},{}],378:[function(_dereq_,module,exports){ module.exports = min; /** @@ -64229,10 +63685,10 @@ function min(out, a, b) { out[2] = Math.min(a[2], b[2]) return out } -},{}],387:[function(_dereq_,module,exports){ +},{}],379:[function(_dereq_,module,exports){ module.exports = _dereq_('./multiply') -},{"./multiply":388}],388:[function(_dereq_,module,exports){ +},{"./multiply":380}],380:[function(_dereq_,module,exports){ module.exports = multiply; /** @@ -64249,7 +63705,7 @@ function multiply(out, a, b) { out[2] = a[2] * b[2] return out } -},{}],389:[function(_dereq_,module,exports){ +},{}],381:[function(_dereq_,module,exports){ module.exports = negate; /** @@ -64265,7 +63721,7 @@ function negate(out, a) { out[2] = -a[2] return out } -},{}],390:[function(_dereq_,module,exports){ +},{}],382:[function(_dereq_,module,exports){ module.exports = normalize; /** @@ -64289,7 +63745,7 @@ function normalize(out, a) { } return out } -},{}],391:[function(_dereq_,module,exports){ +},{}],383:[function(_dereq_,module,exports){ module.exports = random; /** @@ -64311,7 +63767,7 @@ function random(out, scale) { out[2] = z * scale return out } -},{}],392:[function(_dereq_,module,exports){ +},{}],384:[function(_dereq_,module,exports){ module.exports = rotateX; /** @@ -64341,7 +63797,7 @@ function rotateX(out, a, b, c){ return out } -},{}],393:[function(_dereq_,module,exports){ +},{}],385:[function(_dereq_,module,exports){ module.exports = rotateY; /** @@ -64371,7 +63827,7 @@ function rotateY(out, a, b, c){ return out } -},{}],394:[function(_dereq_,module,exports){ +},{}],386:[function(_dereq_,module,exports){ module.exports = rotateZ; /** @@ -64401,7 +63857,7 @@ function rotateZ(out, a, b, c){ return out } -},{}],395:[function(_dereq_,module,exports){ +},{}],387:[function(_dereq_,module,exports){ module.exports = round /** @@ -64418,7 +63874,7 @@ function round(out, a) { return out } -},{}],396:[function(_dereq_,module,exports){ +},{}],388:[function(_dereq_,module,exports){ module.exports = scale; /** @@ -64435,7 +63891,7 @@ function scale(out, a, b) { out[2] = a[2] * b return out } -},{}],397:[function(_dereq_,module,exports){ +},{}],389:[function(_dereq_,module,exports){ module.exports = scaleAndAdd; /** @@ -64453,7 +63909,7 @@ function scaleAndAdd(out, a, b, scale) { out[2] = a[2] + (b[2] * scale) return out } -},{}],398:[function(_dereq_,module,exports){ +},{}],390:[function(_dereq_,module,exports){ module.exports = set; /** @@ -64471,13 +63927,13 @@ function set(out, x, y, z) { out[2] = z return out } -},{}],399:[function(_dereq_,module,exports){ +},{}],391:[function(_dereq_,module,exports){ module.exports = _dereq_('./squaredDistance') -},{"./squaredDistance":401}],400:[function(_dereq_,module,exports){ +},{"./squaredDistance":393}],392:[function(_dereq_,module,exports){ module.exports = _dereq_('./squaredLength') -},{"./squaredLength":402}],401:[function(_dereq_,module,exports){ +},{"./squaredLength":394}],393:[function(_dereq_,module,exports){ module.exports = squaredDistance; /** @@ -64493,7 +63949,7 @@ function squaredDistance(a, b) { z = b[2] - a[2] return x*x + y*y + z*z } -},{}],402:[function(_dereq_,module,exports){ +},{}],394:[function(_dereq_,module,exports){ module.exports = squaredLength; /** @@ -64508,10 +63964,10 @@ function squaredLength(a) { z = a[2] return x*x + y*y + z*z } -},{}],403:[function(_dereq_,module,exports){ +},{}],395:[function(_dereq_,module,exports){ module.exports = _dereq_('./subtract') -},{"./subtract":404}],404:[function(_dereq_,module,exports){ +},{"./subtract":396}],396:[function(_dereq_,module,exports){ module.exports = subtract; /** @@ -64528,7 +63984,7 @@ function subtract(out, a, b) { out[2] = a[2] - b[2] return out } -},{}],405:[function(_dereq_,module,exports){ +},{}],397:[function(_dereq_,module,exports){ module.exports = transformMat3; /** @@ -64546,7 +64002,7 @@ function transformMat3(out, a, m) { out[2] = x * m[2] + y * m[5] + z * m[8] return out } -},{}],406:[function(_dereq_,module,exports){ +},{}],398:[function(_dereq_,module,exports){ module.exports = transformMat4; /** @@ -64567,7 +64023,7 @@ function transformMat4(out, a, m) { out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w return out } -},{}],407:[function(_dereq_,module,exports){ +},{}],399:[function(_dereq_,module,exports){ module.exports = transformQuat; /** @@ -64596,7 +64052,7 @@ function transformQuat(out, a, q) { out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx return out } -},{}],408:[function(_dereq_,module,exports){ +},{}],400:[function(_dereq_,module,exports){ module.exports = add /** @@ -64615,7 +64071,7 @@ function add (out, a, b) { return out } -},{}],409:[function(_dereq_,module,exports){ +},{}],401:[function(_dereq_,module,exports){ module.exports = clone /** @@ -64633,7 +64089,7 @@ function clone (a) { return out } -},{}],410:[function(_dereq_,module,exports){ +},{}],402:[function(_dereq_,module,exports){ module.exports = copy /** @@ -64651,7 +64107,7 @@ function copy (out, a) { return out } -},{}],411:[function(_dereq_,module,exports){ +},{}],403:[function(_dereq_,module,exports){ module.exports = create /** @@ -64668,7 +64124,7 @@ function create () { return out } -},{}],412:[function(_dereq_,module,exports){ +},{}],404:[function(_dereq_,module,exports){ module.exports = distance /** @@ -64686,7 +64142,7 @@ function distance (a, b) { return Math.sqrt(x * x + y * y + z * z + w * w) } -},{}],413:[function(_dereq_,module,exports){ +},{}],405:[function(_dereq_,module,exports){ module.exports = divide /** @@ -64705,7 +64161,7 @@ function divide (out, a, b) { return out } -},{}],414:[function(_dereq_,module,exports){ +},{}],406:[function(_dereq_,module,exports){ module.exports = dot /** @@ -64719,7 +64175,7 @@ function dot (a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3] } -},{}],415:[function(_dereq_,module,exports){ +},{}],407:[function(_dereq_,module,exports){ module.exports = fromValues /** @@ -64740,7 +64196,7 @@ function fromValues (x, y, z, w) { return out } -},{}],416:[function(_dereq_,module,exports){ +},{}],408:[function(_dereq_,module,exports){ module.exports = { create: _dereq_('./create'), clone: _dereq_('./clone'), @@ -64769,7 +64225,7 @@ module.exports = { transformQuat: _dereq_('./transformQuat') } -},{"./add":408,"./clone":409,"./copy":410,"./create":411,"./distance":412,"./divide":413,"./dot":414,"./fromValues":415,"./inverse":417,"./length":418,"./lerp":419,"./max":420,"./min":421,"./multiply":422,"./negate":423,"./normalize":424,"./random":425,"./scale":426,"./scaleAndAdd":427,"./set":428,"./squaredDistance":429,"./squaredLength":430,"./subtract":431,"./transformMat4":432,"./transformQuat":433}],417:[function(_dereq_,module,exports){ +},{"./add":400,"./clone":401,"./copy":402,"./create":403,"./distance":404,"./divide":405,"./dot":406,"./fromValues":407,"./inverse":409,"./length":410,"./lerp":411,"./max":412,"./min":413,"./multiply":414,"./negate":415,"./normalize":416,"./random":417,"./scale":418,"./scaleAndAdd":419,"./set":420,"./squaredDistance":421,"./squaredLength":422,"./subtract":423,"./transformMat4":424,"./transformQuat":425}],409:[function(_dereq_,module,exports){ module.exports = inverse /** @@ -64787,7 +64243,7 @@ function inverse (out, a) { return out } -},{}],418:[function(_dereq_,module,exports){ +},{}],410:[function(_dereq_,module,exports){ module.exports = length /** @@ -64804,7 +64260,7 @@ function length (a) { return Math.sqrt(x * x + y * y + z * z + w * w) } -},{}],419:[function(_dereq_,module,exports){ +},{}],411:[function(_dereq_,module,exports){ module.exports = lerp /** @@ -64828,7 +64284,7 @@ function lerp (out, a, b, t) { return out } -},{}],420:[function(_dereq_,module,exports){ +},{}],412:[function(_dereq_,module,exports){ module.exports = max /** @@ -64847,7 +64303,7 @@ function max (out, a, b) { return out } -},{}],421:[function(_dereq_,module,exports){ +},{}],413:[function(_dereq_,module,exports){ module.exports = min /** @@ -64866,7 +64322,7 @@ function min (out, a, b) { return out } -},{}],422:[function(_dereq_,module,exports){ +},{}],414:[function(_dereq_,module,exports){ module.exports = multiply /** @@ -64885,7 +64341,7 @@ function multiply (out, a, b) { return out } -},{}],423:[function(_dereq_,module,exports){ +},{}],415:[function(_dereq_,module,exports){ module.exports = negate /** @@ -64903,7 +64359,7 @@ function negate (out, a) { return out } -},{}],424:[function(_dereq_,module,exports){ +},{}],416:[function(_dereq_,module,exports){ module.exports = normalize /** @@ -64929,7 +64385,7 @@ function normalize (out, a) { return out } -},{}],425:[function(_dereq_,module,exports){ +},{}],417:[function(_dereq_,module,exports){ var vecNormalize = _dereq_('./normalize') var vecScale = _dereq_('./scale') @@ -64955,7 +64411,7 @@ function random (out, scale) { return out } -},{"./normalize":424,"./scale":426}],426:[function(_dereq_,module,exports){ +},{"./normalize":416,"./scale":418}],418:[function(_dereq_,module,exports){ module.exports = scale /** @@ -64974,7 +64430,7 @@ function scale (out, a, b) { return out } -},{}],427:[function(_dereq_,module,exports){ +},{}],419:[function(_dereq_,module,exports){ module.exports = scaleAndAdd /** @@ -64994,7 +64450,7 @@ function scaleAndAdd (out, a, b, scale) { return out } -},{}],428:[function(_dereq_,module,exports){ +},{}],420:[function(_dereq_,module,exports){ module.exports = set /** @@ -65015,7 +64471,7 @@ function set (out, x, y, z, w) { return out } -},{}],429:[function(_dereq_,module,exports){ +},{}],421:[function(_dereq_,module,exports){ module.exports = squaredDistance /** @@ -65033,7 +64489,7 @@ function squaredDistance (a, b) { return x * x + y * y + z * z + w * w } -},{}],430:[function(_dereq_,module,exports){ +},{}],422:[function(_dereq_,module,exports){ module.exports = squaredLength /** @@ -65050,7 +64506,7 @@ function squaredLength (a) { return x * x + y * y + z * z + w * w } -},{}],431:[function(_dereq_,module,exports){ +},{}],423:[function(_dereq_,module,exports){ module.exports = subtract /** @@ -65069,7 +64525,7 @@ function subtract (out, a, b) { return out } -},{}],432:[function(_dereq_,module,exports){ +},{}],424:[function(_dereq_,module,exports){ module.exports = transformMat4 /** @@ -65089,7 +64545,7 @@ function transformMat4 (out, a, m) { return out } -},{}],433:[function(_dereq_,module,exports){ +},{}],425:[function(_dereq_,module,exports){ module.exports = transformQuat /** @@ -65118,7 +64574,7 @@ function transformQuat (out, a, q) { return out } -},{}],434:[function(_dereq_,module,exports){ +},{}],426:[function(_dereq_,module,exports){ var tokenize = _dereq_('glsl-tokenizer') var atob = _dereq_('atob-lite') @@ -65143,7 +64599,7 @@ function getName(src) { } } -},{"atob-lite":84,"glsl-tokenizer":441}],435:[function(_dereq_,module,exports){ +},{"atob-lite":84,"glsl-tokenizer":433}],427:[function(_dereq_,module,exports){ module.exports = tokenize var literals100 = _dereq_('./lib/literals') @@ -65520,7 +64976,7 @@ function tokenize(opt) { } } -},{"./lib/builtins":437,"./lib/builtins-300es":436,"./lib/literals":439,"./lib/literals-300es":438,"./lib/operators":440}],436:[function(_dereq_,module,exports){ +},{"./lib/builtins":429,"./lib/builtins-300es":428,"./lib/literals":431,"./lib/literals-300es":430,"./lib/operators":432}],428:[function(_dereq_,module,exports){ // 300es builtins/reserved words that were previously valid in v100 var v100 = _dereq_('./builtins') @@ -65591,7 +65047,7 @@ module.exports = v100.concat([ , 'textureProjGradOffset' ]) -},{"./builtins":437}],437:[function(_dereq_,module,exports){ +},{"./builtins":429}],429:[function(_dereq_,module,exports){ module.exports = [ // Keep this list sorted 'abs' @@ -65743,7 +65199,7 @@ module.exports = [ , 'textureCubeGradEXT' ] -},{}],438:[function(_dereq_,module,exports){ +},{}],430:[function(_dereq_,module,exports){ var v100 = _dereq_('./literals') module.exports = v100.slice().concat([ @@ -65832,7 +65288,7 @@ module.exports = v100.slice().concat([ , 'usampler2DMSArray' ]) -},{"./literals":439}],439:[function(_dereq_,module,exports){ +},{"./literals":431}],431:[function(_dereq_,module,exports){ module.exports = [ // current 'precision' @@ -65928,7 +65384,7 @@ module.exports = [ , 'using' ] -},{}],440:[function(_dereq_,module,exports){ +},{}],432:[function(_dereq_,module,exports){ module.exports = [ '<<=' , '>>=' @@ -65977,7 +65433,7 @@ module.exports = [ , '}' ] -},{}],441:[function(_dereq_,module,exports){ +},{}],433:[function(_dereq_,module,exports){ var tokenize = _dereq_('./index') module.exports = tokenizeString @@ -65992,9 +65448,9 @@ function tokenizeString(str, opt) { return tokens } -},{"./index":435}],442:[function(_dereq_,module,exports){ -arguments[4][265][0].apply(exports,arguments) -},{"dup":265}],443:[function(_dereq_,module,exports){ +},{"./index":427}],434:[function(_dereq_,module,exports){ +arguments[4][268][0].apply(exports,arguments) +},{"dup":268}],435:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict' @@ -66011,7 +65467,7 @@ else { module.exports = hasHover }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"is-browser":452}],444:[function(_dereq_,module,exports){ +},{"is-browser":442}],436:[function(_dereq_,module,exports){ 'use strict' var isBrowser = _dereq_('is-browser') @@ -66037,7 +65493,7 @@ function detect() { module.exports = isBrowser && detect() -},{"is-browser":452}],445:[function(_dereq_,module,exports){ +},{"is-browser":442}],437:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -66123,7 +65579,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],446:[function(_dereq_,module,exports){ +},{}],438:[function(_dereq_,module,exports){ "use strict" //High level idea: @@ -66135,10 +65591,6 @@ module.exports = incrementalConvexHull var orient = _dereq_("robust-orientation") var compareCell = _dereq_("simplicial-complex").compareCells -function compareInt(a, b) { - return a - b -} - function Simplex(vertices, adjacent, boundary) { this.vertices = vertices this.adjacent = adjacent @@ -66165,21 +65617,19 @@ function compareGlue(a, b) { return compareCell(a.vertices, b.vertices) } -function bakeOrient(d) { - var code = ["function orient(){var tuple=this.tuple;return test("] - for(var i=0; i<=d; ++i) { - if(i > 0) { - code.push(",") - } - code.push("tuple[", i, "]") +function wrapper(test) { + return function() { + var tuple = this.tuple + return test.apply(this, tuple) } - code.push(")}return orient") - var proc = new Function("test", code.join("")) +} + +function bakeOrient(d) { var test = orient[d+1] if(!test) { test = orient } - return proc(test) + return wrapper(test) } var BAKED = [] @@ -66218,7 +65668,6 @@ proto.handleBoundaryDegeneracy = function(cell, point) { cell.lastVisited = -n while(toVisit.length > 0) { cell = toVisit.pop() - var cellVerts = cell.vertices var cellAdj = cell.adjacent for(var i=0; i<=d; ++i) { var neighbor = cellAdj[i] @@ -66341,7 +65790,7 @@ proto.addPeaks = function(point, cell) { var nv = neighbor.vertices //Test if neighbor is a peak - if(neighbor.lastVisited !== -n) { + if(neighbor.lastVisited !== -n) { //Compute orientation of p relative to each boundary peak var indexOfNeg1 = 0 for(var j=0; j<=d; ++j) { @@ -66566,11 +66015,11 @@ function incrementalConvexHull(points, randomSearch) { for(var i=d+1; i 0) { - stepVal.push(stride(i, order[j-1]) + "*" + shape(order[j-1]) ) - } - vars.push(step(i,order[j]) + "=(" + stepVal.join("-") + ")|0") - } - } - //Create index variables - for(var i=0; i=0; --i) { - sizeVariable.push(shape(order[i])) - } - //Previous phases and vertex_ids - vars.push(POOL_SIZE + "=(" + sizeVariable.join("*") + ")|0", - PHASES + "=mallocUint32(" + POOL_SIZE + ")", - VERTEX_IDS + "=mallocUint32(" + POOL_SIZE + ")", - POINTER + "=0") - //Create cube variables for phases - vars.push(pcube(0) + "=0") - for(var j=1; j<(1< 0) { + i1 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_0 + if (s0 > 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } } - } - cubeStep.push(shape(order[k])) - } - var signFlag = "" - if(cubeDelta[0].indexOf(shape(order[dimension-2])) < 0) { - signFlag = "-" - } - var jperm = permBitmask(dimension, j, order) - vars.push(pdelta(jperm) + "=(-" + cubeDelta.join("-") + ")|0", - qcube(jperm) + "=(" + signFlag + cubeDelta.join("-") + ")|0", - pcube(jperm) + "=0") - } - vars.push(vert(0) + "=0", TEMPORARY + "=0") - - function forLoopBegin(i, start) { - code.push("for(", index(order[i]), "=", start, ";", - index(order[i]), "<", shape(order[i]), ";", - "++", index(order[i]), "){") - } - - function forLoopEnd(i) { - for(var j=0; j=0; --i) { - forLoopBegin(i, 0) - } - var phaseFuncArgs = [] - for(var i=0; i 0) { + i0 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + for (i0 = 2; i0 < s0; ++i0) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_0 + } + } + if (i1 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_1 } - vertexArgs.push(cube(i,j)) } + freeUint32(V) + freeUint32(P) } - for(var i=0; i<(1<0; k=(k-1)&subset) { - faceArgs.push(VERTEX_IDS + "[" + POINTER + "+" + pdelta(k) + "]") - } - faceArgs.push(vert(0)) - for(var k=0; k 0) { + i0 = 1 + P[X++] = phase(d0[p0], x0, x1, x2) + p0 += u0_1 + if (s1 > 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 } } - if(j&1) { - faceArgs.push(corner, edge) - } else { - faceArgs.push(edge, corner) - } - for(var k=0; k 0) { + i1 = 1 + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + for (i1 = 2; i1 < s1; ++i1) { + c0_0 = d0[p0] + b0 = P[X] = phase(c0_0, x0, x1, x2) + b1 = P[X + e1] + b2 = P[X + e2] + b3 = P[X + e3] + if (b0 !== b1 || b0 !== b2 || b0 !== b3) { + c0_1 = d0[p0 + d0_1] + c0_2 = d0[p0 + d0_2] + c0_3 = d0[p0 + d0_3] + vertex(i0, i1, c0_0, c0_1, c0_2, c0_3, b0, b1, b2, b3, x0, x1, x2) + v0 = V[X] = N++ + if (b3 !== b2) { + face(V[X + e2], v0, c0_2, c0_3, b2, b3, x0, x1, x2) + } + if (b3 !== b1) { + face(V[X + e1], v0, c0_3, c0_1, b3, b1, x0, x1, x2) + } + } + X += 1 + p0 += u0_1 + } + } + if (i0 & 1) { + X = 0 + } + T = e1 + e1 = y1 + y1 = T + T = e2 + e2 = y2 + y2 = T + T = e3 + e3 = y3 + y3 = T + p0 += u0_0 } - code.push("if(", corner, "!==", edge, "){", - "face(", faceArgs.join(), ")}") } + freeUint32(V) + freeUint32(P) } - - //Increment pointer, close off if statement - code.push("}", - POINTER, "+=1;") - } + }, +} - function flip() { - for(var j=1; j<(1<0){", - index(order[i]), "=1;") - createLoop(i-1, mask|(1<= 0) { - pickStr.push('0') - } else if(facet.indexOf(-(i+1)) >= 0) { - pickStr.push('s['+i+']-1') - } else { - pickStr.push('-1') - loStr.push('1') - hiStr.push('s['+i+']-2') - } +function CACHED_link(diff, zero, grad1, grad2) { + return function(dst, src) { + var s = src.shape.slice() + if (1 && s[0] > 2 && s[1] > 2) { + grad2( + src + .pick(-1, -1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 0) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2), + dst + .pick(-1, -1, 1) + .lo(1, 1) + .hi(s[0] - 2, s[1] - 2) + ) } - var boundStr = '.lo(' + loStr.join() + ').hi(' + hiStr.join() + ')' - if(loStr.length === 0) { - boundStr = '' + if (1 && s[1] > 2) { + grad1( + src + .pick(0, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(0, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(0, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) } - - if(cod > 0) { - code.push('if(1') - for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { - continue - } - code.push('&&s[', i, ']>2') - } - code.push('){grad', cod, '(src.pick(', pickStr.join(), ')', boundStr) - for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { - continue - } - code.push(',dst.pick(', pickStr.join(), ',', i, ')', boundStr) - } - code.push(');') + if (1 && s[1] > 2) { + grad1( + src + .pick(s[0] - 1, -1) + .lo(1) + .hi(s[1] - 2), + dst + .pick(s[0] - 1, -1, 1) + .lo(1) + .hi(s[1] - 2) + ) + zero( + dst + .pick(s[0] - 1, -1, 0) + .lo(1) + .hi(s[1] - 2) + ) } - - for(var i=0; i1){dst.set(', - pickStr.join(), ',', bnd, ',0.5*(src.get(', - cPickStr.join(), ')-src.get(', - dPickStr.join(), ')))}else{dst.set(', - pickStr.join(), ',', bnd, ',0)};') - } else { - code.push('if(s[', bnd, ']>1){diff(', outStr, - ',src.pick(', cPickStr.join(), ')', boundStr, - ',src.pick(', dPickStr.join(), ')', boundStr, - ');}else{zero(', outStr, ');};') - } - break - - case 'mirror': - if(cod === 0) { - code.push('dst.set(', pickStr.join(), ',', bnd, ',0);') - } else { - code.push('zero(', outStr, ');') - } - break - - case 'wrap': - var aPickStr = pickStr.slice() - var bPickStr = pickStr.slice() - if(facet[i] < 0) { - aPickStr[bnd] = 's[' + bnd + ']-2' - bPickStr[bnd] = '0' - - } else { - aPickStr[bnd] = 's[' + bnd + ']-1' - bPickStr[bnd] = '1' - } - if(cod === 0) { - code.push('if(s[', bnd, ']>2){dst.set(', - pickStr.join(), ',', bnd, ',0.5*(src.get(', - aPickStr.join(), ')-src.get(', - bPickStr.join(), ')))}else{dst.set(', - pickStr.join(), ',', bnd, ',0)};') - } else { - code.push('if(s[', bnd, ']>2){diff(', outStr, - ',src.pick(', aPickStr.join(), ')', boundStr, - ',src.pick(', bPickStr.join(), ')', boundStr, - ');}else{zero(', outStr, ');};') - } - break - - default: - throw new Error('ndarray-gradient: Invalid boundary condition') - } + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, 0) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, 0, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, 0, 1) + .lo(1) + .hi(s[0] - 2) + ) } - - if(cod > 0) { - code.push('};') + if (1 && s[0] > 2) { + grad1( + src + .pick(-1, s[1] - 1) + .lo(1) + .hi(s[0] - 2), + dst + .pick(-1, s[1] - 1, 0) + .lo(1) + .hi(s[0] - 2) + ) + zero( + dst + .pick(-1, s[1] - 1, 1) + .lo(1) + .hi(s[0] - 2) + ) } + dst.set(0, 0, 0, 0) + dst.set(0, 0, 1, 0) + dst.set(s[0] - 1, 0, 0, 0) + dst.set(s[0] - 1, 0, 1, 0) + dst.set(0, s[1] - 1, 0, 0) + dst.set(0, s[1] - 1, 1, 0) + dst.set(s[0] - 1, s[1] - 1, 0, 0) + dst.set(s[0] - 1, s[1] - 1, 1, 0) + return dst } +} - //Enumerate ridges, facets, etc. of hypercube - for(var i=0; i<(1< 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] * Y0 + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + }, + 'float32,1,0,float32,1,0': function () { + return function assign_cwise_loop_1s0m2f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + }, + 'float32,1,0,float32,0,1': function () { + return function assign_cwise_loop_1s0m0f32(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], t0p0 = t0[0], t0p1 = t0[1], t1p0 = t1[0], t1p1 = t1[1] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[1] | 0; j0 > 0;) { + if (j0 < 64) { + s1 = j0 + j0 = 0 + } else { + s1 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + p0 = (offset0 + j0 * t0p1 + j1 * t0p0) + p1 = (offset1 + j0 * t1p1 + j1 * t1p0) + var i0 = 0, i1 = 0, d0s0 = t0p1, d0s1 = (t0p0 - s1 * t0p1), d1s0 = t1p1, d1s1 = (t1p0 - s1 * t1p1) + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s1; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + } + } + } + }, + 'uint8,2,0,1,uint8,1,2,0': function () { + return function assign_cwise_loop_2s0s1m0u8(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var offset0 = p0 + var offset1 = p1 + for (var j0 = SS[2] | 0; j0 > 0;) { + if (j0 < 64) { + s2 = j0 + j0 = 0 + } else { + s2 = 64 + j0 -= 64 + } + for (var j1 = SS[0] | 0; j1 > 0;) { + if (j1 < 64) { + s0 = j1 + j1 = 0 + } else { + s0 = 64 + j1 -= 64 + } + for (var j2 = SS[1] | 0; j2 > 0;) { + if (j2 < 64) { + s1 = j2 + j2 = 0 + } else { + s1 = 64 + j2 -= 64 + } + p0 = (offset0 + j0 * t0p2 + j1 * t0p0 + j2 * t0p1) + p1 = (offset1 + j0 * t1p2 + j1 * t1p0 + j2 * t1p1) + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + } + } + } + }, + 'uint8,2,0,1,array,2,0,1': function () { + return function assign_cwise_loop_2s0s1m3u8a(SS, a0, t0, p0, a1, t1, p1) { + var s0 = SS[0], s1 = SS[1], s2 = SS[2], t0p0 = t0[0], t0p1 = t0[1], t0p2 = t0[2], t1p0 = t1[0], t1p1 = t1[1], t1p2 = t1[2] + p0 |= 0 + p1 |= 0 + var i0 = 0, i1 = 0, i2 = 0, d0s0 = t0p2, d0s1 = (t0p0 - s2 * t0p2), d0s2 = (t0p1 - s0 * t0p0), d1s0 = t1p2, d1s1 = (t1p0 - s2 * t1p2), d1s2 = (t1p1 - s0 * t1p0) + for (i2 = 0; i2 < s1; ++i2) { + for (i1 = 0; i1 < s0; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + a0[p0] = a1[p1] + p0 += d0s0 + p1 += d1s0 + } + p0 += d0s1 + p1 += d1s1 + } + p0 += d0s2 + p1 += d1s2 + } + } + }, +} -var EmptyProc = { - body: "", - args: [], - thisVars: [], - localVars: [] +//Generates a cwise operator +function generateCWiseOp(proc, typesig) { + var key = typesig.join(',') + var f = CACHED_CWiseOp[key] + return f() } -function fixup(x) { - if(!x) { - return EmptyProc - } - for(var i=0; i>", - rrshift: ">>>" } ;(function(){ for(var id in assign_ops) { - var op = assign_ops[id] - exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a","b","c"], - body: "a=b"+op+"c"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array","array"], - body: {args:["a","b"], - body:"a"+op+"=b"}, - rvalue: true, - funcName: id+"eq" - }) - exports[id+"s"] = makeOp({ - args: ["array", "array", "scalar"], - body: {args:["a","b","s"], - body:"a=b"+op+"s"}, - funcName: id+"s" - }) - exports[id+"seq"] = makeOp({ - args: ["array","scalar"], - body: {args:["a","s"], - body:"a"+op+"=s"}, - rvalue: true, - funcName: id+"seq" - }) - } -})(); - -var unary_ops = { - not: "!", - bnot: "~", - neg: "-", - recip: "1.0/" -} -;(function(){ - for(var id in unary_ops) { - var op = unary_ops[id] exports[id] = makeOp({ - args: ["array", "array"], - body: {args:["a","b"], - body:"a="+op+"b"}, - funcName: id - }) - exports[id+"eq"] = makeOp({ - args: ["array"], - body: {args:["a"], - body:"a="+op+"a"}, - rvalue: true, - count: 2, - funcName: id+"eq" - }) - } -})(); - -var binary_ops = { - and: "&&", - or: "||", - eq: "===", - neq: "!==", - lt: "<", - gt: ">", - leq: "<=", - geq: ">=" -} -;(function() { - for(var id in binary_ops) { - var op = binary_ops[id] - exports[id] = makeOp({ - args: ["array","array","array"], - body: {args:["a", "b", "c"], - body:"a=b"+op+"c"}, funcName: id }) exports[id+"s"] = makeOp({ - args: ["array","array","scalar"], - body: {args:["a", "b", "s"], - body:"a=b"+op+"s"}, funcName: id+"s" }) - exports[id+"eq"] = makeOp({ - args: ["array", "array"], - body: {args:["a", "b"], - body:"a=a"+op+"b"}, - rvalue:true, - count:2, - funcName: id+"eq" - }) exports[id+"seq"] = makeOp({ - args: ["array", "scalar"], - body: {args:["a","s"], - body:"a=a"+op+"s"}, - rvalue:true, - count:2, funcName: id+"seq" }) } })(); -var math_unary = [ - "abs", - "acos", - "asin", - "atan", - "ceil", - "cos", - "exp", - "floor", - "log", - "round", - "sin", - "sqrt", - "tan" -] -;(function() { - for(var i=0; ithis_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" -}) - -exports.norm1 = compile({ - args:["array"], - pre: {args:[], localVars:[], thisVars:["this_s"], body:"this_s=0"}, - body: {args:[{name:"a", lvalue:false, rvalue:true, 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" -}) - -exports.sup = compile({ - 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":false,"rvalue":true,"count":2} ], - thisVars: [ "this_h" ], - localVars: [] }, - post: - { body: "return this_h", - args: [], - thisVars: [ "this_h" ], - localVars: [] } - }) - -exports.inf = compile({ - args: [ "array" ], - pre: - { body: "this_h=Infinity", - args: [], - thisVars: [ "this_h" ], - localVars: [] }, - body: - { body: "if(_inline_1_arg0_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:false,rvalue:true,count:2}, - {name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:2}], - thisVars:["this_i","this_v"], - localVars:["_inline_1_k"]}, - post:{ - body:"{return this_i}", - args:[], - thisVars:["this_i"], - localVars:[]} -}) - -exports.random = makeOp({ - args: ["array"], - pre: {args:[], body:"this_f=Math.random", thisVars:["this_f"]}, - body: {args: ["a"], body:"a=this_f()", thisVars:["this_f"]}, - funcName: "random" -}) - exports.assign = makeOp({ - args:["array", "array"], - body: {args:["a", "b"], body:"a=b"}, funcName: "assign" }) -exports.assigns = makeOp({ - args:["array", "scalar"], - body: {args:["a", "b"], body:"a=b"}, - funcName: "assigns" }) - - -exports.equals = compile({ - args:["array", "array"], - pre: EmptyProc, - body: {args:[{name:"x", lvalue:false, rvalue:true, count:1}, - {name:"y", lvalue:false, rvalue:true, count:1}], - body: "if(x!==y){return false}", - localVars: [], - thisVars: []}, - post: {args:[], localVars:[], thisVars:[], body:"return true"}, - funcName: "equals" -}) - - - -},{"cwise-compiler":157}],479:[function(_dereq_,module,exports){ +},{}],468:[function(_dereq_,module,exports){ "use strict" var ndarray = _dereq_("ndarray") @@ -112598,739 +111833,849 @@ module.exports = function convert(arr, result) { return result } -},{"./doConvert.js":480,"ndarray":483}],480:[function(_dereq_,module,exports){ -module.exports=_dereq_('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":true,"rvalue":false,"count":1},{"name":"_inline_1_arg1_","lvalue":false,"rvalue":true,"count":1},{"name":"_inline_1_arg2_","lvalue":false,"rvalue":true,"count":4}],"thisVars":[],"localVars":["_inline_1_i","_inline_1_v"]},"post":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"funcName":"convert","blockSize":64}) +},{"./doConvert.js":469,"ndarray":472}],469:[function(_dereq_,module,exports){ +"use strict" + +function CwiseOp() { + return function (SS, a0, t0, p0, Y0) { + var s0 = SS[0], + s1 = SS[1], + s2 = SS[2], + t0p0 = t0[0], + t0p1 = t0[1], + t0p2 = t0[2], + index = [0, 0, 0]; + p0 |= 0; + var i0 = 0, + i1 = 0, + i2 = 0, + d0s0 = t0p2, + d0s1 = t0p1 - s2 * t0p2, + d0s2 = t0p0 - s1 * t0p1; + for (i2 = 0; i2 < s0; ++i2) { + for (i1 = 0; i1 < s1; ++i1) { + for (i0 = 0; i0 < s2; ++i0) { + { + var _inline_1_v = Y0, + _inline_1_i; + for ( + _inline_1_i = 0; + _inline_1_i < index.length - 1; + ++_inline_1_i + ) { + _inline_1_v = _inline_1_v[index[_inline_1_i]]; + } + a0[p0] = _inline_1_v[index[index.length - 1]]; + } + p0 += d0s0; + ++index[2]; + } + p0 += d0s1; + index[2] -= s2; + ++index[1]; + } + p0 += d0s2; + index[1] -= s1; + ++index[0]; + } + }; +} + +//Generates a cwise operator +function generateCWiseOp() { + return CwiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {}; + return function convert_cwise_thunk(array0, scalar1) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type]; + if (!proc) { + CACHED[type] = proc = compile([t0, r0]); + } + return proc( + array0.shape.slice(0), + array0.data, + array0.stride, + array0.offset | 0, + scalar1 + ); + }; +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} -},{"cwise-compiler":157}],481:[function(_dereq_,module,exports){ +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ + funcName: "convert" +}); + +},{}],470:[function(_dereq_,module,exports){ "use strict" var pool = _dereq_("typedarray-pool") -var INSERTION_SORT_THRESHOLD = 32 - function getMallocFree(dtype) { switch(dtype) { - case "uint8": - return [pool.mallocUint8, pool.freeUint8] - case "uint16": - return [pool.mallocUint16, pool.freeUint16] case "uint32": return [pool.mallocUint32, pool.freeUint32] - case "int8": - return [pool.mallocInt8, pool.freeInt8] - case "int16": - return [pool.mallocInt16, pool.freeInt16] - case "int32": - return [pool.mallocInt32, pool.freeInt32] - case "float32": - return [pool.mallocFloat, pool.freeFloat] - case "float64": - return [pool.mallocDouble, pool.freeDouble] default: return null } } -function shapeArgs(dimension) { - var args = [] - for(var i=0; i left) { + dptr = 0 + sptr = cptr - s0 + __l: for (i1 = 0; i1 < n1; ++i1) { + a = data[sptr] + b = scratch[dptr] + if (a < b) { + break __g + } + if (a > b) { + break __l + } + sptr += e1 + dptr += f1 + } + dptr = cptr + sptr = cptr - s0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = data[sptr] + dptr += d1 + sptr += d1 + } + cptr -= s0 + } + dptr = cptr + sptr = 0 + for (i1 = 0; i1 < n1; ++i1) { + data[dptr] = scratch[sptr++] + dptr += d1 + } + } + free(scratch) + } + }, } function createInsertionSort(order, dtype) { - - var code = ["'use strict'"] - var funcName = ["ndarrayInsertionSort", order.join("d"), dtype].join("") - var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) var allocator = getMallocFree(dtype) - - var vars = [ "i,j,cptr,ptr=left*s0+offset" ] - - if(order.length > 1) { - var scratch_shape = [] - for(var i=1; i 1) { - - //Copy data into scratch - code.push("dptr=0;sptr=ptr") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j,"left){", - "dptr=0", - "sptr=cptr-s0") - for(var i=1; ib){break __l}"].join("")) - for(var i=order.length-1; i>=1; --i) { - code.push( - "sptr+=e"+i, - "dptr+=f"+i, - "}") - } - - //Copy data back - code.push("dptr=cptr;sptr=cptr-s0") - for(var i=order.length-1; i>=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j,"=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j,"left)&&("+dataRead("cptr-s0")+">scratch)){", - dataWrite("cptr", dataRead("cptr-s0")), - "cptr-=s0", - "}", - dataWrite("cptr", "scratch")) - } - - //Close outer loop body - code.push("}") - if(order.length > 1 && allocator) { - code.push("free(scratch)") - } - code.push("} return " + funcName) - - //Compile and link function if(allocator) { - var result = new Function("malloc", "free", code.join("\n")) return result(allocator[0], allocator[1]) } else { - var result = new Function(code.join("\n")) return result() } } -function createQuickSort(order, dtype, insertionSort) { - var code = [ "'use strict'" ] - var funcName = ["ndarrayQuickSort", order.join("d"), dtype].join("") - var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) - var allocator = getMallocFree(dtype) - var labelCounter=0 - - code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - - var vars = [ - "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(order.length > 1) { - var ele_size = [] - for(var i=1; i=0; --i) { - var j = order[i] - if(j === 0) { - continue - } - code.push(["for(i",j,"=0;i",j," 1) { - for(var i=0; i> 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, + i1, + b_ptr0, + b_ptr1, + b_ptr2, + b_ptr3, + b_ptr4, + b_ptr5, + b_ptr6, + b_ptr7, + ptr3, + ptr4, + ptr5, + ptr6, + ptr7, + pivot_ptr, + ptr_shift, + elementSize = n1, + pivot1 = malloc(elementSize), + pivot2 = malloc(elementSize) + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + ptr_shift = offset + __l1: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el2 + el2 = tmp0 + break __l1 + } + if (comp < 0) { + break __l1 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l2: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l2 + } + if (comp < 0) { + break __l2 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l3: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el3 + el3 = tmp0 + break __l3 + } + if (comp < 0) { + break __l3 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l4: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l4 + } + if (comp < 0) { + break __l4 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l5: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el1 + el1 = el4 + el4 = tmp0 + break __l5 + } + if (comp < 0) { + break __l5 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el3 + b_ptr1 = s0 * el4 + ptr_shift = offset + __l6: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el3 + el3 = el4 + el4 = tmp0 + break __l6 + } + if (comp < 0) { + break __l6 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l7: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el5 + el5 = tmp0 + break __l7 + } + if (comp < 0) { + break __l7 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el2 + b_ptr1 = s0 * el3 + ptr_shift = offset + __l8: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el2 + el2 = el3 + el3 = tmp0 + break __l8 + } + if (comp < 0) { + break __l8 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el4 + b_ptr1 = s0 * el5 + ptr_shift = offset + __l9: for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + comp = data[ptr0] - data[ptr1] + if (comp > 0) { + tmp0 = el4 + el4 = el5 + el5 = tmp0 + break __l9 + } + if (comp < 0) { + break __l9 + } + ptr_shift += e1 + } + b_ptr0 = s0 * el1 + b_ptr1 = s0 * el2 + b_ptr2 = s0 * el3 + b_ptr3 = s0 * el4 + b_ptr4 = s0 * el5 + b_ptr5 = s0 * index1 + b_ptr6 = s0 * index3 + b_ptr7 = s0 * index5 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + ptr3 = b_ptr3 + ptr_shift + ptr4 = b_ptr4 + ptr_shift + ptr5 = b_ptr5 + ptr_shift + ptr6 = b_ptr6 + ptr_shift + ptr7 = b_ptr7 + ptr_shift + pivot1[pivot_ptr] = data[ptr1] + pivot2[pivot_ptr] = data[ptr3] + pivots_are_equal = pivots_are_equal && pivot1[pivot_ptr] === pivot2[pivot_ptr] + x = data[ptr0] + y = data[ptr2] + z = data[ptr4] + data[ptr5] = x + data[ptr6] = y + data[ptr7] = z + ++pivot_ptr + ptr_shift += d1 + } + b_ptr0 = s0 * index2 + b_ptr1 = s0 * left + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + b_ptr0 = s0 * index4 + b_ptr1 = s0 * right + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + ptr_shift += d1 + } + if (pivots_are_equal) { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l10: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l10 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + continue + } + if (comp < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l11: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l11 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + great-- + } else if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + break + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + break + } + } + } + } + } else { + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l12: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l12 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 < 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l13: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l13 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 > 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l14: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l14 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp > 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l15: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l15 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } } - if(ptrs.length>1) { - code.push("ptr_shift+=d"+j) + b_ptr0 = s0 * left + b_ptr1 = s0 * (less - 1) + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + data[ptr1] = pivot1[pivot_ptr] + ++pivot_ptr + ptr_shift += d1 + } + b_ptr0 = s0 * right + b_ptr1 = s0 * (great + 1) + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + data[ptr0] = data[ptr1] + data[ptr1] = pivot2[pivot_ptr] + ++pivot_ptr + ptr_shift += d1 + } + if (less - 2 - left <= 32) { + insertionSort(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - code.push("ptr0+=d"+j) + ndarrayQuickSort1d0uint32(left, less - 2, data, offset, s0, s1, n0, n1, d1, e1, f1) } - code.push("}") - } - } - - function lexicoLoop(label, ptrs, usePivot, body) { - if(ptrs.length === 1) { - code.push("ptr0="+toPointer(ptrs[0])) - } else { - for(var i=0; i 1) { - for(var i=0; i=1; --i) { - if(usePivot) { - code.push("pivot_ptr+=f"+i) + if (less < index1 && great > index5) { + __l16: while (true) { + ptr0 = offset + less * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot1[pivot_ptr]) { + break __l16 + } + ++pivot_ptr + ptr0 += d1 + } + ++less + } + __l17: while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + if (data[ptr0] !== pivot2[pivot_ptr]) { + break __l17 + } + ++pivot_ptr + ptr0 += d1 + } + --great + } + for (k = less; k <= great; ++k) { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l18: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot1 = data[ptr0] - pivot1[pivot_ptr] + if (comp_pivot1 !== 0) { + break __l18 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot1 === 0) { + if (k !== less) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + } + ++less + } else { + ptr0 = offset + k * s0 + pivot_ptr = 0 + __l19: for (i1 = 0; i1 < n1; ++i1) { + comp_pivot2 = data[ptr0] - pivot2[pivot_ptr] + if (comp_pivot2 !== 0) { + break __l19 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp_pivot2 === 0) { + while (true) { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l20: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot2[pivot_ptr] + if (comp !== 0) { + break __l20 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp === 0) { + if (--great < k) { + break + } + continue + } else { + ptr0 = offset + great * s0 + pivot_ptr = 0 + __l21: for (i1 = 0; i1 < n1; ++i1) { + comp = data[ptr0] - pivot1[pivot_ptr] + if (comp !== 0) { + break __l21 + } + pivot_ptr += f1 + ptr0 += e1 + } + if (comp < 0) { + b_ptr0 = s0 * k + b_ptr1 = s0 * less + b_ptr2 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + ptr2 = b_ptr2 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = data[ptr2] + data[ptr2] = tmp + ptr_shift += d1 + } + ++less + --great + } else { + b_ptr0 = s0 * k + b_ptr1 = s0 * great + ptr_shift = offset + for (i1 = 0; i1 < n1; ++i1) { + ptr0 = b_ptr0 + ptr_shift + ptr1 = b_ptr1 + ptr_shift + tmp = data[ptr0] + data[ptr0] = data[ptr1] + data[ptr1] = tmp + ptr_shift += d1 + } + --great + } + break + } + } + } + } + } } - if(ptrs.length > 1) { - code.push("ptr_shift+=e"+i) + free(pivot1) + free(pivot2) + if (great - less <= 32) { + insertionSort(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - code.push("ptr0+=e"+i) + ndarrayQuickSort1d0uint32(less, great, data, offset, s0, s1, n0, n1, d1, e1, f1) } - code.push("}") } - } - - function cleanUp() { - if(order.length > 1 && allocator) { - code.push("free(pivot1)", "free(pivot2)") - } - } - - function compareSwap(a_id, b_id) { - var a = "el"+a_id - var b = "el"+b_id - if(order.length > 1) { - var lbl = "__l" + (++labelCounter) - lexicoLoop(lbl, [a, b], false, [ - "comp=",dataRead("ptr0"),"-",dataRead("ptr1"),"\n", - "if(comp>0){tmp0=", a, ";",a,"=",b,";", b,"=tmp0;break ", lbl,"}\n", - "if(comp<0){break ", lbl, "}" - ].join("")) - } else { - code.push(["if(", dataRead(toPointer(a)), ">", dataRead(toPointer(b)), "){tmp0=", a, ";",a,"=",b,";", b,"=tmp0}"].join("")) - } - } - - compareSwap(1, 2) - compareSwap(4, 5) - compareSwap(1, 3) - compareSwap(2, 3) - compareSwap(1, 4) - compareSwap(3, 4) - compareSwap(2, 5) - compareSwap(2, 3) - compareSwap(4, 5) - - if(order.length > 1) { - cacheLoop(["el1", "el2", "el3", "el4", "el5", "index1", "index3", "index5"], true, [ - "pivot1[pivot_ptr]=",dataRead("ptr1"),"\n", - "pivot2[pivot_ptr]=",dataRead("ptr3"),"\n", - "pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n", - "x=",dataRead("ptr0"),"\n", - "y=",dataRead("ptr2"),"\n", - "z=",dataRead("ptr4"),"\n", - dataWrite("ptr5", "x"),"\n", - dataWrite("ptr6", "y"),"\n", - dataWrite("ptr7", "z") - ].join("")) - } else { - code.push([ - "pivot1=", dataRead(toPointer("el2")), "\n", - "pivot2=", dataRead(toPointer("el4")), "\n", - "pivots_are_equal=pivot1===pivot2\n", - "x=", dataRead(toPointer("el1")), "\n", - "y=", dataRead(toPointer("el3")), "\n", - "z=", dataRead(toPointer("el5")), "\n", - dataWrite(toPointer("index1"), "x"), "\n", - dataWrite(toPointer("index3"), "y"), "\n", - dataWrite(toPointer("index5"), "z") - ].join("")) - } - - - function moveElement(dst, src) { - if(order.length > 1) { - cacheLoop([dst, src], false, - dataWrite("ptr0", dataRead("ptr1")) - ) - } else { - code.push(dataWrite(toPointer(dst), dataRead(toPointer(src)))) - } - } - - moveElement("index2", "left") - moveElement("index4", "right") - - function comparePivot(result, ptr, n) { - if(order.length > 1) { - var lbl = "__l" + (++labelCounter) - lexicoLoop(lbl, [ptr], true, [ - result,"=",dataRead("ptr0"),"-pivot",n,"[pivot_ptr]\n", - "if(",result,"!==0){break ", lbl, "}" - ].join("")) - } else { - code.push([result,"=", dataRead(toPointer(ptr)), "-pivot", n].join("")) - } - } - - function swapElements(a, b) { - if(order.length > 1) { - cacheLoop([a,b],false,[ - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", "tmp") - ].join("")) - } else { - code.push([ - "ptr0=",toPointer(a),"\n", - "ptr1=",toPointer(b),"\n", - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", "tmp") - ].join("")) - } - } - - function tripleSwap(k, less, great) { - if(order.length > 1) { - cacheLoop([k,less,great], false, [ - "tmp=",dataRead("ptr0"),"\n", - dataWrite("ptr0", dataRead("ptr1")),"\n", - dataWrite("ptr1", dataRead("ptr2")),"\n", - dataWrite("ptr2", "tmp") - ].join("")) - code.push("++"+less, "--"+great) - } else { - code.push([ - "ptr0=",toPointer(k),"\n", - "ptr1=",toPointer(less),"\n", - "ptr2=",toPointer(great),"\n", - "++",less,"\n", - "--",great,"\n", - "tmp=", dataRead("ptr0"), "\n", - dataWrite("ptr0", dataRead("ptr1")), "\n", - dataWrite("ptr1", dataRead("ptr2")), "\n", - dataWrite("ptr2", "tmp") - ].join("")) - } - } - - function swapAndDecrement(k, great) { - swapElements(k, great) - code.push("--"+great) - } - - code.push("if(pivots_are_equal){") - //Pivots are equal case - code.push("for(k=less;k<=great;++k){") - comparePivot("comp", "k", 1) - code.push("if(comp===0){continue}") - code.push("if(comp<0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - code.push("while(true){") - comparePivot("comp", "great", 1) - code.push("if(comp>0){") - code.push("great--") - code.push("}else if(comp<0){") - tripleSwap("k", "less", "great") - code.push("break") - code.push("}else{") - swapAndDecrement("k", "great") - code.push("break") - code.push("}") - code.push("}") - code.push("}") - code.push("}") - code.push("}else{") - //Pivots not equal case - code.push("for(k=less;k<=great;++k){") - comparePivot("comp_pivot1", "k", 1) - code.push("if(comp_pivot1<0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - comparePivot("comp_pivot2", "k", 2) - code.push("if(comp_pivot2>0){") - code.push("while(true){") - comparePivot("comp", "great", 2) - code.push("if(comp>0){") - code.push("if(--great1) { - cacheLoop([mem_dest, pivot_dest], true, [ - dataWrite("ptr0", dataRead("ptr1")), "\n", - dataWrite("ptr1", ["pivot",pivot,"[pivot_ptr]"].join("")) - ].join("")) - } else { - code.push( - dataWrite(toPointer(mem_dest), dataRead(toPointer(pivot_dest))), - dataWrite(toPointer(pivot_dest), "pivot"+pivot)) - } - } - - storePivot("left", "(less-1)", 1) - storePivot("right", "(great+1)", 2) - - //Recursive sort call - function doSort(left, right) { - code.push([ - "if((",right,"-",left,")<=",INSERTION_SORT_THRESHOLD,"){\n", - "insertionSort(", left, ",", right, ",data,offset,", shapeArgs(order.length).join(","), ")\n", - "}else{\n", - funcName, "(", left, ",", right, ",data,offset,", shapeArgs(order.length).join(","), ")\n", - "}" - ].join("")) - } - doSort("left", "(less-2)") - doSort("(great+2)", "right") - - //If pivots are equal, then early out - code.push("if(pivots_are_equal){") - cleanUp() - code.push("return") - code.push("}") - - function walkPointer(ptr, pivot, body) { - if(order.length > 1) { - code.push(["__l",++labelCounter,":while(true){"].join("")) - cacheLoop([ptr], true, [ - "if(", dataRead("ptr0"), "!==pivot", pivot, "[pivot_ptr]){break __l", labelCounter, "}" - ].join("")) - code.push(body, "}") - } else { - code.push(["while(", dataRead(toPointer(ptr)), "===pivot", pivot, "){", body, "}"].join("")) - } - } - - //Check bounds - code.push("if(lessindex5){") - - walkPointer("less", 1, "++less") - walkPointer("great", 2, "--great") - - code.push("for(k=less;k<=great;++k){") - comparePivot("comp_pivot1", "k", 1) - code.push("if(comp_pivot1===0){") - code.push("if(k!==less){") - swapElements("k", "less") - code.push("}") - code.push("++less") - code.push("}else{") - comparePivot("comp_pivot2", "k", 2) - code.push("if(comp_pivot2===0){") - code.push("while(true){") - comparePivot("comp", "great", 2) - code.push("if(comp===0){") - code.push("if(--great 1 && allocator) { - var compiled = new Function("insertionSort", "malloc", "free", code.join("\n")) - return compiled(insertionSort, allocator[0], allocator[1]) - } - var compiled = new Function("insertionSort", code.join("\n")) - return compiled(insertionSort) + }, } -function compileSort(order, dtype) { - var code = ["'use strict'"] - var funcName = ["ndarraySortWrapper", order.join("d"), dtype].join("") - var funcArgs = [ "array" ] - - code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - - //Unpack local variables from array - var vars = ["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"] - for(var i=0; i 0) { - vars.push(["d",j,"=s",j,"-d",p,"*n",p].join("")) - } else { - vars.push(["d",j,"=s",j].join("")) - } - p = j - } - var k = order.length-1-i - if(k !== 0) { - if(q > 0) { - vars.push(["e",k,"=s",k,"-e",q,"*n",q, - ",f",k,"=",scratch_stride[k],"-f",q,"*n",q].join("")) +function createQuickSort(order, dtype, insertionSort) { + var allocator = getMallocFree(dtype) + var key = [dtype, order].join(',') + var result = CACHED_quickSort[key] + + if(order.length > 1 && allocator) { + return result(insertionSort, allocator[0], allocator[1]) + } else { + return result(insertionSort) + } +} + +var CACHED_sort = { + "uint32,1,0": function (insertionSort, quickSort) { + return function (array) { + var data = array.data, + offset = array.offset | 0, + shape = array.shape, + stride = array.stride, + s0 = stride[0] | 0, + n0 = shape[0] | 0, + s1 = stride[1] | 0, + n1 = shape[1] | 0, + d1 = s1, + e1 = s1, + f1 = 1 + if (n0 <= 32) { + insertionSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) } else { - vars.push(["e",k,"=s",k,",f",k,"=",scratch_stride[k]].join("")) + quickSort(0, n0 - 1, data, offset, s0, s1, n0, n1, d1, e1, f1) } - q = k } - } - - //Declare local variables - code.push("var " + vars.join(",")) - - //Create arguments for subroutine - var sortArgs = ["0", "n0-1", "data", "offset"].concat(shapeArgs(order.length)) - - //Call main sorting routine - code.push([ - "if(n0<=",INSERTION_SORT_THRESHOLD,"){", - "insertionSort(", sortArgs.join(","), ")}else{", - "quickSort(", sortArgs.join(","), - ")}" - ].join("")) - - //Return - code.push("}return " + funcName) - - //Link everything together - var result = new Function("insertionSort", "quickSort", code.join("\n")) + }, +} + +function compileSort(order, dtype) { + var key = [dtype, order].join(',') + var result = CACHED_sort[key] + var insertionSort = createInsertionSort(order, dtype) var quickSort = createQuickSort(order, dtype, insertionSort) return result(insertionSort, quickSort) } module.exports = compileSort -},{"typedarray-pool":617}],482:[function(_dereq_,module,exports){ +},{"typedarray-pool":601}],471:[function(_dereq_,module,exports){ "use strict" var compile = _dereq_("./lib/compile_sort.js") @@ -113350,8 +112695,7 @@ function sort(array) { } module.exports = sort -},{"./lib/compile_sort.js":481}],483:[function(_dereq_,module,exports){ -var iota = _dereq_("iota-array") +},{"./lib/compile_sort.js":470}],472:[function(_dereq_,module,exports){ var isBuffer = _dereq_("is-buffer") var hasTypedArrays = ((typeof Float64Array) !== "undefined") @@ -113375,234 +112719,883 @@ function order() { return result } -function compileConstructor(dtype, dimension) { - var className = ["View", dimension, "d", dtype].join("") - if(dimension < 0) { - className = "View_Nil" + dtype - } - var useGetters = (dtype === "generic") - - if(dimension === -1) { - //Special case for trivial arrays - var code = - "function "+className+"(a){this.data=a;};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"(this.data);};\ -proto.get=proto.set=function(){};\ -proto.pick=function(){return null};\ -return function construct_"+className+"(a){return new "+className+"(a);}" - var procedure = new Function(code) - return procedure() - } else if(dimension === 0) { - //Special case for 0d arrays - var code = - "function "+className+"(a,d) {\ -this.data = a;\ -this.offset = d\ -};\ -var proto="+className+".prototype;\ -proto.dtype='"+dtype+"';\ -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 "+className+"_copy() {\ -return new "+className+"(this.data,this.offset)\ -};\ -proto.pick=function "+className+"_pick(){\ -return TrivialArray(this.data);\ -};\ -proto.valueOf=proto.get=function "+className+"_get(){\ -return "+(useGetters ? "this.data.get(this.offset)" : "this.data[this.offset]")+ -"};\ -proto.set=function "+className+"_set(v){\ -return "+(useGetters ? "this.data.set(this.offset,v)" : "this.data[this.offset]=v")+"\ -};\ -return function construct_"+className+"(a,b,c,d){return new "+className+"(a,d)}" - var procedure = new Function("TrivialArray", code) - return procedure(CACHED_CONSTRUCTORS[dtype][0]) - } - - var code = ["'use strict'"] - - //Create constructor for view - var indices = iota(dimension) - var args = indices.map(function(i) { return "i"+i }) - var index_str = "this.offset+" + indices.map(function(i) { - return "this.stride[" + i + "]*i" + i - }).join("+") - var shapeArg = indices.map(function(i) { - return "b"+i - }).join(",") - var strideArg = indices.map(function(i) { - return "c"+i - }).join(",") - code.push( - "function "+className+"(a," + shapeArg + "," + strideArg + ",d){this.data=a", - "this.shape=[" + shapeArg + "]", - "this.stride=[" + strideArg + "]", - "this.offset=d|0}", - "var proto="+className+".prototype", - "proto.dtype='"+dtype+"'", - "proto.dimension="+dimension) - - //view.size: - code.push("Object.defineProperty(proto,'size',{get:function "+className+"_size(){\ -return "+indices.map(function(i) { return "this.shape["+i+"]" }).join("*"), -"}})") - - //view.order: - if(dimension === 1) { - code.push("proto.order=[0]") - } else { - code.push("Object.defineProperty(proto,'order',{get:") - if(dimension < 4) { - code.push("function "+className+"_order(){") - if(dimension === 2) { - code.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})") - } else if(dimension === 3) { - code.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];\ -}}})") - } - } else { - code.push("ORDER})") - } - } - - //view.set(i0, ..., v): - code.push( -"proto.set=function "+className+"_set("+args.join(",")+",v){") - if(useGetters) { - code.push("return this.data.set("+index_str+",v)}") - } else { - code.push("return this.data["+index_str+"]=v}") - } +var allFns = { + // Special case for trivial arrays + T: function (dtype) { + function View(a) { + this.data = a + } + var proto = View.prototype + proto.dtype = dtype + 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 View(this.data) + } + proto.get = proto.set = function () {} + proto.pick = function () { + return null + } + return function construct(a) { + return new View(a) + } + }, - //view.get(i0, ...): - code.push("proto.get=function "+className+"_get("+args.join(",")+"){") - if(useGetters) { - code.push("return this.data.get("+index_str+")}") - } else { - code.push("return this.data["+index_str+"]}") - } - - //view.index: - code.push( - "proto.index=function "+className+"_index(", args.join(), "){return "+index_str+"}") - - //view.hi(): - code.push("proto.hi=function "+className+"_hi("+args.join(",")+"){return new "+className+"(this.data,"+ - indices.map(function(i) { - return ["(typeof i",i,"!=='number'||i",i,"<0)?this.shape[", i, "]:i", i,"|0"].join("") - }).join(",")+","+ - indices.map(function(i) { - return "this.stride["+i + "]" - }).join(",")+",this.offset)}") - - //view.lo(): - var a_vars = indices.map(function(i) { return "a"+i+"=this.shape["+i+"]" }) - var c_vars = indices.map(function(i) { return "c"+i+"=this.stride["+i+"]" }) - code.push("proto.lo=function "+className+"_lo("+args.join(",")+"){var b=this.offset,d=0,"+a_vars.join(",")+","+c_vars.join(",")) - for(var i=0; i=0){\ -d=i"+i+"|0;\ -b+=c"+i+"*d;\ -a"+i+"-=d}") - } - code.push("return new "+className+"(this.data,"+ - indices.map(function(i) { - return "a"+i - }).join(",")+","+ - indices.map(function(i) { - return "c"+i - }).join(",")+",b)}") - - //view.step(): - code.push("proto.step=function "+className+"_step("+args.join(",")+"){var "+ - indices.map(function(i) { - return "a"+i+"=this.shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "b"+i+"=this.stride["+i+"]" - }).join(",")+",c=this.offset,d=0,ceil=Math.ceil") - for(var i=0; i=0){c=(c+this.stride["+i+"]*i"+i+")|0}else{a.push(this.shape["+i+"]);b.push(this.stride["+i+"])}") - } - code.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}") + 1: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, c0, d) { + this.data = a + this.shape = [b0] + this.stride = [c0] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 1 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] + }, + }) + proto.order = [0] + proto.set = function set(i0, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0, v) + : (this.data[this.offset + this.stride[0] * i0] = v) + } + proto.get = function get(i0) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0) + : this.data[this.offset + this.stride[0] * i0] + } + proto.index = function index(i0) { + return this.offset + this.stride[0] * i0 + } + proto.hi = function hi(i0) { + return new View(this.data, typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, this.stride[0], this.offset) + } + proto.lo = function lo(i0) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + c0 = this.stride[0] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + return new View(this.data, a0, c0, b) + } + proto.step = function step(i0) { + var a0 = this.shape[0], + b0 = this.stride[0], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + return new View(this.data, a0, b0, c) + } + proto.transpose = function transpose(i0) { + i0 = i0 === undefined ? 0 : i0 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], b[i0], this.offset) + } + proto.pick = function pick(i0) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], stride[0], offset) + } + }, + 2: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, c0, c1, d) { + this.data = a + this.shape = [b0, b1] + this.stride = [c0, c1] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 2 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + return Math.abs(this.stride[0]) > Math.abs(this.stride[1]) ? [1, 0] : [0, 1] + }, + }) + proto.set = function set(i0, i1, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] = v) + } + proto.get = function get(i0, i1) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1] + } + proto.index = function index(i0, i1) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + } + proto.hi = function hi(i0, i1) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + this.stride[0], + this.stride[1], + this.offset + ) + } + proto.lo = function lo(i0, i1) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + c0 = this.stride[0], + c1 = this.stride[1] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + return new View(this.data, a0, a1, c0, c1, b) + } + proto.step = function step(i0, i1) { + var a0 = this.shape[0], + a1 = this.shape[1], + b0 = this.stride[0], + b1 = this.stride[1], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + return new View(this.data, a0, a1, b0, b1, c) + } + proto.transpose = function transpose(i0, i1) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], b[i0], b[i1], this.offset) + } + proto.pick = function pick(i0, i1) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], stride[0], stride[1], offset) + } + }, + 3: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, c0, c1, c2, d) { + this.data = a + this.shape = [b0, b1, b2] + this.stride = [c0, c1, c2] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 3 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] + }, + }) + Object.defineProperty(proto, "order", { + get: function order() { + 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] + } + }, + }) + proto.set = function set(i0, i1, i2, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] = v) + } + proto.get = function get(i0, i1, i2) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2] + } + proto.index = function index(i0, i1, i2) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + } + proto.hi = function hi(i0, i1, i2) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + return new View(this.data, a0, a1, a2, c0, c1, c2, b) + } + proto.step = function step(i0, i1, i2) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + return new View(this.data, a0, a1, a2, b0, b1, b2, c) + } + proto.transpose = function transpose(i0, i1, i2) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], b[i0], b[i1], b[i2], this.offset) + } + proto.pick = function pick(i0, i1, i2) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], stride[0], stride[1], stride[2], offset) + } + }, + 4: function (dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, c0, c1, c2, c3, d) { + this.data = a + this.shape = [b0, b1, b2, b3] + this.stride = [c0, c1, c2, c3] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 4 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, v) { + return dtype === "generic" + ? this.data.set(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3, v) + : (this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] = v) + } + proto.get = function get(i0, i1, i2, i3) { + return dtype === "generic" + ? this.data.get(this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3) + : this.data[this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3] + } + proto.index = function index(i0, i1, i2, i3) { + return this.offset + this.stride[0] * i0 + this.stride[1] * i1 + this.stride[2] * i2 + this.stride[3] * i3 + } + proto.hi = function hi(i0, i1, i2, i3) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + return new View(this.data, a0, a1, a2, a3, c0, c1, c2, c3, b) + } + proto.step = function step(i0, i1, i2, i3) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + return new View(this.data, a0, a1, a2, a3, b0, b1, b2, b3, c) + } + proto.transpose = function transpose(i0, i1, i2, i3) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], b[i0], b[i1], b[i2], b[i3], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View(data, shape[0], shape[1], shape[2], shape[3], stride[0], stride[1], stride[2], stride[3], offset) + } + }, + 5: function anonymous(dtype, CTOR_LIST, ORDER) { + function View(a, b0, b1, b2, b3, b4, c0, c1, c2, c3, c4, d) { + this.data = a + this.shape = [b0, b1, b2, b3, b4] + this.stride = [c0, c1, c2, c3, c4] + this.offset = d | 0 + } + var proto = View.prototype + proto.dtype = dtype + proto.dimension = 5 + Object.defineProperty(proto, "size", { + get: function size() { + return this.shape[0] * this.shape[1] * this.shape[2] * this.shape[3] * this.shape[4] + }, + }) + Object.defineProperty(proto, "order", { get: ORDER }) + proto.set = function set(i0, i1, i2, i3, i4, v) { + return dtype === "generic" + ? this.data.set( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4, + v + ) + : (this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] = v) + } + proto.get = function get(i0, i1, i2, i3, i4) { + return dtype === "generic" + ? this.data.get( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + : this.data[ + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ] + } + proto.index = function index(i0, i1, i2, i3, i4) { + return ( + this.offset + + this.stride[0] * i0 + + this.stride[1] * i1 + + this.stride[2] * i2 + + this.stride[3] * i3 + + this.stride[4] * i4 + ) + } + proto.hi = function hi(i0, i1, i2, i3, i4) { + return new View( + this.data, + typeof i0 !== "number" || i0 < 0 ? this.shape[0] : i0 | 0, + typeof i1 !== "number" || i1 < 0 ? this.shape[1] : i1 | 0, + typeof i2 !== "number" || i2 < 0 ? this.shape[2] : i2 | 0, + typeof i3 !== "number" || i3 < 0 ? this.shape[3] : i3 | 0, + typeof i4 !== "number" || i4 < 0 ? this.shape[4] : i4 | 0, + this.stride[0], + this.stride[1], + this.stride[2], + this.stride[3], + this.stride[4], + this.offset + ) + } + proto.lo = function lo(i0, i1, i2, i3, i4) { + var b = this.offset, + d = 0, + a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + c0 = this.stride[0], + c1 = this.stride[1], + c2 = this.stride[2], + c3 = this.stride[3], + c4 = this.stride[4] + if (typeof i0 === "number" && i0 >= 0) { + d = i0 | 0 + b += c0 * d + a0 -= d + } + if (typeof i1 === "number" && i1 >= 0) { + d = i1 | 0 + b += c1 * d + a1 -= d + } + if (typeof i2 === "number" && i2 >= 0) { + d = i2 | 0 + b += c2 * d + a2 -= d + } + if (typeof i3 === "number" && i3 >= 0) { + d = i3 | 0 + b += c3 * d + a3 -= d + } + if (typeof i4 === "number" && i4 >= 0) { + d = i4 | 0 + b += c4 * d + a4 -= d + } + return new View(this.data, a0, a1, a2, a3, a4, c0, c1, c2, c3, c4, b) + } + proto.step = function step(i0, i1, i2, i3, i4) { + var a0 = this.shape[0], + a1 = this.shape[1], + a2 = this.shape[2], + a3 = this.shape[3], + a4 = this.shape[4], + b0 = this.stride[0], + b1 = this.stride[1], + b2 = this.stride[2], + b3 = this.stride[3], + b4 = this.stride[4], + c = this.offset, + d = 0, + ceil = Math.ceil + if (typeof i0 === "number") { + d = i0 | 0 + if (d < 0) { + c += b0 * (a0 - 1) + a0 = ceil(-a0 / d) + } else { + a0 = ceil(a0 / d) + } + b0 *= d + } + if (typeof i1 === "number") { + d = i1 | 0 + if (d < 0) { + c += b1 * (a1 - 1) + a1 = ceil(-a1 / d) + } else { + a1 = ceil(a1 / d) + } + b1 *= d + } + if (typeof i2 === "number") { + d = i2 | 0 + if (d < 0) { + c += b2 * (a2 - 1) + a2 = ceil(-a2 / d) + } else { + a2 = ceil(a2 / d) + } + b2 *= d + } + if (typeof i3 === "number") { + d = i3 | 0 + if (d < 0) { + c += b3 * (a3 - 1) + a3 = ceil(-a3 / d) + } else { + a3 = ceil(a3 / d) + } + b3 *= d + } + if (typeof i4 === "number") { + d = i4 | 0 + if (d < 0) { + c += b4 * (a4 - 1) + a4 = ceil(-a4 / d) + } else { + a4 = ceil(a4 / d) + } + b4 *= d + } + return new View(this.data, a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, c) + } + proto.transpose = function transpose(i0, i1, i2, i3, i4) { + i0 = i0 === undefined ? 0 : i0 | 0 + i1 = i1 === undefined ? 1 : i1 | 0 + i2 = i2 === undefined ? 2 : i2 | 0 + i3 = i3 === undefined ? 3 : i3 | 0 + i4 = i4 === undefined ? 4 : i4 | 0 + var a = this.shape, + b = this.stride + return new View(this.data, a[i0], a[i1], a[i2], a[i3], a[i4], b[i0], b[i1], b[i2], b[i3], b[i4], this.offset) + } + proto.pick = function pick(i0, i1, i2, i3, i4) { + var a = [], + b = [], + c = this.offset + if (typeof i0 === "number" && i0 >= 0) { + c = (c + this.stride[0] * i0) | 0 + } else { + a.push(this.shape[0]) + b.push(this.stride[0]) + } + if (typeof i1 === "number" && i1 >= 0) { + c = (c + this.stride[1] * i1) | 0 + } else { + a.push(this.shape[1]) + b.push(this.stride[1]) + } + if (typeof i2 === "number" && i2 >= 0) { + c = (c + this.stride[2] * i2) | 0 + } else { + a.push(this.shape[2]) + b.push(this.stride[2]) + } + if (typeof i3 === "number" && i3 >= 0) { + c = (c + this.stride[3] * i3) | 0 + } else { + a.push(this.shape[3]) + b.push(this.stride[3]) + } + if (typeof i4 === "number" && i4 >= 0) { + c = (c + this.stride[4] * i4) | 0 + } else { + a.push(this.shape[4]) + b.push(this.stride[4]) + } + var ctor = CTOR_LIST[a.length + 1] + return ctor(this.data, a, b, c) + } + return function construct(data, shape, stride, offset) { + return new View( + data, + shape[0], + shape[1], + shape[2], + shape[3], + shape[4], + stride[0], + stride[1], + stride[2], + stride[3], + stride[4], + offset + ) + } + }, +} - //Add return statement - code.push("return function construct_"+className+"(data,shape,stride,offset){return new "+className+"(data,"+ - indices.map(function(i) { - return "shape["+i+"]" - }).join(",")+","+ - indices.map(function(i) { - return "stride["+i+"]" - }).join(",")+",offset)}") - //Compile procedure - var procedure = new Function("CTOR_LIST", "ORDER", code.join("\n")) - return procedure(CACHED_CONSTRUCTORS[dtype], order) +function compileConstructor(inType, inDimension) { + var dKey = inDimension === -1 ? 'T' : String(inDimension) + + var procedure = allFns[dKey] + if(inDimension === -1) { + return procedure(inType) + } else if(inDimension === 0) { + return procedure(inType, CACHED_CONSTRUCTORS[inType][0]) + } + return procedure(inType, CACHED_CONSTRUCTORS[inType], order) } function arrayDType(data) { @@ -113621,14 +113614,14 @@ function arrayDType(data) { return "int16" case "[object Int32Array]": return "int32" + case "[object Uint8ClampedArray]": + return "uint8_clamped" case "[object Uint8Array]": return "uint8" case "[object Uint16Array]": return "uint16" case "[object Uint32Array]": return "uint32" - case "[object Uint8ClampedArray]": - return "uint8_clamped" case "[object BigInt64Array]": return "bigint64" case "[object BigUint64Array]": @@ -113642,20 +113635,22 @@ function arrayDType(data) { } var CACHED_CONSTRUCTORS = { + "generic":[], + "buffer":[], + "array":[], + + // typed arrays "float32":[], "float64":[], "int8":[], "int16":[], "int32":[], + "uint8_clamped":[], "uint8":[], "uint16":[], "uint32":[], - "array":[], - "uint8_clamped":[], "bigint64": [], - "biguint64": [], - "buffer":[], - "generic":[] + "biguint64": [] } ;(function() { @@ -113690,10 +113685,10 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { } } } - var dtype = arrayDType(data) - var ctor_list = CACHED_CONSTRUCTORS[dtype] + var inType = arrayDType(data) + var ctor_list = CACHED_CONSTRUCTORS[inType] while(ctor_list.length <= d+1) { - ctor_list.push(compileConstructor(dtype, ctor_list.length-1)) + ctor_list.push(compileConstructor(inType, ctor_list.length-1)) } var ctor = ctor_list[d+1] return ctor(data, shape, stride, offset) @@ -113701,7 +113696,7 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { module.exports = wrappedNDArrayCtor -},{"iota-array":451,"is-buffer":453}],484:[function(_dereq_,module,exports){ +},{"is-buffer":443}],473:[function(_dereq_,module,exports){ "use strict" var doubleBits = _dereq_("double-bits") @@ -113744,7 +113739,7 @@ function nextafter(x, y) { } return doubleBits.pack(lo, hi) } -},{"double-bits":182}],485:[function(_dereq_,module,exports){ +},{"double-bits":179}],474:[function(_dereq_,module,exports){ var π = Math.PI var _120 = radians(120) @@ -113946,7 +113941,7 @@ function radians(degress){ return degress * (π / 180) } -},{}],486:[function(_dereq_,module,exports){ +},{}],475:[function(_dereq_,module,exports){ var DEFAULT_NORMALS_EPSILON = 1e-6; var DEFAULT_FACE_EPSILON = 1e-6; @@ -114071,7 +114066,7 @@ exports.faceNormals = function(faces, positions, specifiedEpsilon) { -},{}],487:[function(_dereq_,module,exports){ +},{}],476:[function(_dereq_,module,exports){ /* object-assign (c) Sindre Sorhus @@ -114163,7 +114158,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],488:[function(_dereq_,module,exports){ +},{}],477:[function(_dereq_,module,exports){ 'use strict' module.exports = quatFromFrame @@ -114205,7 +114200,7 @@ function quatFromFrame( } return out } -},{}],489:[function(_dereq_,module,exports){ +},{}],478:[function(_dereq_,module,exports){ 'use strict' module.exports = createOrbitController @@ -114599,7 +114594,7 @@ function createOrbitController(options) { return result } -},{"./lib/quatFromFrame":488,"filtered-vector":250,"gl-mat4/fromQuat":288,"gl-mat4/invert":299,"gl-mat4/lookAt":300}],490:[function(_dereq_,module,exports){ +},{"./lib/quatFromFrame":477,"filtered-vector":247,"gl-mat4/fromQuat":282,"gl-mat4/invert":293,"gl-mat4/lookAt":294}],479:[function(_dereq_,module,exports){ /*! * pad-left * @@ -114615,7 +114610,7 @@ module.exports = function padLeft(str, num, ch) { ch = typeof ch !== 'undefined' ? (ch + '') : ' '; return repeat(ch, num) + str; }; -},{"repeat-string":541}],491:[function(_dereq_,module,exports){ +},{"repeat-string":527}],480:[function(_dereq_,module,exports){ 'use strict' /** @@ -114752,7 +114747,7 @@ parenthesis.stringify = stringify module.exports = parenthesis -},{}],492:[function(_dereq_,module,exports){ +},{}],481:[function(_dereq_,module,exports){ 'use strict' var pick = _dereq_('pick-by-alias') @@ -114839,7 +114834,7 @@ function parseRect (arg) { return rect } -},{"pick-by-alias":498}],493:[function(_dereq_,module,exports){ +},{"pick-by-alias":485}],482:[function(_dereq_,module,exports){ module.exports = parse @@ -114898,7 +114893,7 @@ function parseValues(args) { return numbers ? numbers.map(Number) : [] } -},{}],494:[function(_dereq_,module,exports){ +},{}],483:[function(_dereq_,module,exports){ module.exports = function parseUnit(str, out) { if (!out) out = [ 0, '' ] @@ -114909,7 +114904,7 @@ module.exports = function parseUnit(str, out) { out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' return out } -},{}],495:[function(_dereq_,module,exports){ +},{}],484:[function(_dereq_,module,exports){ (function (process){(function (){ // Generated by CoffeeScript 1.12.2 (function() { @@ -114949,146 +114944,7 @@ module.exports = function parseUnit(str, out) { }).call(this)}).call(this,_dereq_('_process')) -},{"_process":528}],496:[function(_dereq_,module,exports){ -"use strict" - -module.exports = permutationSign - -var BRUTE_FORCE_CUTOFF = 32 - -var pool = _dereq_("typedarray-pool") - -function permutationSign(p) { - var n = p.length - if(n < BRUTE_FORCE_CUTOFF) { - //Use quadratic algorithm for small n - var sgn = 1 - for(var i=0; i0; --i) { - t = pinv[i] - s = p[i] - p[i] = p[t] - p[t] = s - pinv[i] = pinv[s] - pinv[s] = t - r = (r + s) * i - } - pool.freeUint32(pinv) - pool.freeUint32(p) - return r -} - -function unrank(n, r, p) { - switch(n) { - case 0: - if(p) { return p } - return [] - case 1: - if(p) { - p[0] = 0 - return p - } else { - return [0] - } - case 2: - if(p) { - if(r) { - p[0] = 0 - p[1] = 1 - } else { - p[0] = 1 - p[1] = 0 - } - return p - } else { - return r ? [0,1] : [1,0] - } - default: - break - } - p = p || new Array(n) - var s, t, i, nf=1 - p[0] = 0 - for(i=1; i0; --i) { - s = (r / nf)|0 - r = (r - s * nf)|0 - nf = (nf / i)|0 - t = p[i]|0 - p[i] = p[s]|0 - p[s] = t|0 - } - return p -} - -exports.rank = rank -exports.unrank = unrank - -},{"invert-permutation":450,"typedarray-pool":617}],498:[function(_dereq_,module,exports){ +},{"_process":514}],485:[function(_dereq_,module,exports){ 'use strict' @@ -115167,7 +115023,7 @@ function toList(arg) { return arg } -},{}],499:[function(_dereq_,module,exports){ +},{}],486:[function(_dereq_,module,exports){ "use strict" module.exports = planarDual @@ -115298,7 +115154,7 @@ function planarDual(cells, positions) { //Combine paths and loops together return cycles } -},{"compare-angle":138}],500:[function(_dereq_,module,exports){ +},{"compare-angle":138}],487:[function(_dereq_,module,exports){ 'use strict' module.exports = trimLeaves @@ -115354,7 +115210,7 @@ function trimLeaves(edges, positions) { return [ nedges, npositions ] } -},{"edges-to-adjacency-list":187}],501:[function(_dereq_,module,exports){ +},{"edges-to-adjacency-list":184}],488:[function(_dereq_,module,exports){ 'use strict' module.exports = planarGraphToPolyline @@ -115559,9 +115415,7 @@ function planarGraphToPolyline(edges, positions) { return result } -},{"./lib/trim-leaves":500,"edges-to-adjacency-list":187,"planar-dual":499,"point-in-big-polygon":503,"robust-sum":553,"two-product":604,"uniq":619}],502:[function(_dereq_,module,exports){ -arguments[4][251][0].apply(exports,arguments) -},{"dup":251}],503:[function(_dereq_,module,exports){ +},{"./lib/trim-leaves":487,"edges-to-adjacency-list":184,"planar-dual":486,"point-in-big-polygon":489,"robust-sum":539,"two-product":588,"uniq":603}],489:[function(_dereq_,module,exports){ module.exports = preprocessPolygon var orient = _dereq_('robust-orientation')[3] @@ -115713,7 +115567,7 @@ function preprocessPolygon(loops) { testSlab) } } -},{"binary-search-bounds":502,"interval-tree-1d":448,"robust-orientation":548,"slab-decomposition":566}],504:[function(_dereq_,module,exports){ +},{"binary-search-bounds":103,"interval-tree-1d":440,"robust-orientation":534,"slab-decomposition":551}],490:[function(_dereq_,module,exports){ /* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT @@ -115841,7 +115695,7 @@ if (typeof window === 'object') module.exports = PolyBool; -},{"./lib/build-log":505,"./lib/epsilon":506,"./lib/geojson":507,"./lib/intersecter":508,"./lib/segment-chainer":510,"./lib/segment-selector":511}],505:[function(_dereq_,module,exports){ +},{"./lib/build-log":491,"./lib/epsilon":492,"./lib/geojson":493,"./lib/intersecter":494,"./lib/segment-chainer":496,"./lib/segment-selector":497}],491:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -115956,7 +115810,7 @@ function BuildLog(){ module.exports = BuildLog; -},{}],506:[function(_dereq_,module,exports){ +},{}],492:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116128,7 +115982,7 @@ function Epsilon(eps){ module.exports = Epsilon; -},{}],507:[function(_dereq_,module,exports){ +},{}],493:[function(_dereq_,module,exports){ // (c) Copyright 2017, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116318,7 +116172,7 @@ var GeoJSON = { module.exports = GeoJSON; -},{}],508:[function(_dereq_,module,exports){ +},{}],494:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116825,7 +116679,7 @@ function Intersecter(selfIntersection, eps, buildLog){ module.exports = Intersecter; -},{"./linked-list":509}],509:[function(_dereq_,module,exports){ +},{"./linked-list":495}],495:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -116908,7 +116762,7 @@ var LinkedList = { module.exports = LinkedList; -},{}],510:[function(_dereq_,module,exports){ +},{}],496:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -117162,7 +117016,7 @@ function SegmentChainer(segments, eps, buildLog){ module.exports = SegmentChainer; -},{}],511:[function(_dereq_,module,exports){ +},{}],497:[function(_dereq_,module,exports){ // (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc // MIT License // Project Home: https://github.com/voidqk/polybooljs @@ -117330,7 +117184,7 @@ var SegmentSelector = { module.exports = SegmentSelector; -},{}],512:[function(_dereq_,module,exports){ +},{}],498:[function(_dereq_,module,exports){ //Optimized version for triangle closest point // Based on Eberly's WildMagick codes // http://www.geometrictools.com/LibMathematics/Distance/Distance.html @@ -117528,7 +117382,7 @@ function closestPoint2d(V0, V1, V2, point, result) { module.exports = closestPoint2d; -},{}],513:[function(_dereq_,module,exports){ +},{}],499:[function(_dereq_,module,exports){ 'use strict'; @@ -117616,7 +117470,7 @@ ProbeError.prototype.constructor = ProbeError; exports.ProbeError = ProbeError; -},{"stream":569,"stream-parser":585}],514:[function(_dereq_,module,exports){ +},{"stream":554,"stream-parser":570}],500:[function(_dereq_,module,exports){ /* eslint-disable no-bitwise */ /* eslint-disable consistent-return */ @@ -117888,7 +117742,7 @@ module.exports.get_orientation = function (data) { } }; -},{}],515:[function(_dereq_,module,exports){ +},{}],501:[function(_dereq_,module,exports){ // Utils used to parse miaf-based files (avif/heic/heif) // // ISO media file spec: @@ -118191,7 +118045,7 @@ module.exports.getMimeType = function (data) { return { type: 'avif', mime: 'image/avif' }; }; -},{"./common":513}],516:[function(_dereq_,module,exports){ +},{"./common":499}],502:[function(_dereq_,module,exports){ // Utils used to parse miaf-based files (avif/heic/heif) // // - image collections are not supported (only last size is reported) @@ -118281,7 +118135,7 @@ module.exports = function (data) { return result; }; -},{"../common":513,"../exif_utils":514,"../miaf_utils":515}],517:[function(_dereq_,module,exports){ +},{"../common":499,"../exif_utils":500,"../miaf_utils":501}],503:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118308,7 +118162,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],518:[function(_dereq_,module,exports){ +},{"../common":499}],504:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118337,7 +118191,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],519:[function(_dereq_,module,exports){ +},{"../common":499}],505:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118384,7 +118238,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],520:[function(_dereq_,module,exports){ +},{"../common":499}],506:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118470,7 +118324,7 @@ module.exports = function (data) { } }; -},{"../common":513,"../exif_utils":514}],521:[function(_dereq_,module,exports){ +},{"../common":499,"../exif_utils":500}],507:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118503,7 +118357,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],522:[function(_dereq_,module,exports){ +},{"../common":499}],508:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118532,7 +118386,7 @@ module.exports = function (data) { }; }; -},{"../common":513}],523:[function(_dereq_,module,exports){ +},{"../common":499}],509:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118679,7 +118533,7 @@ module.exports = function (data) { }; }; -},{}],524:[function(_dereq_,module,exports){ +},{}],510:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable consistent-return */ @@ -118767,7 +118621,7 @@ module.exports = function (data) { } }; -},{"../common":513}],525:[function(_dereq_,module,exports){ +},{"../common":499}],511:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-bitwise */ @@ -118879,7 +118733,7 @@ module.exports = function (data) { return result; }; -},{"../common":513,"../exif_utils":514}],526:[function(_dereq_,module,exports){ +},{"../common":499,"../exif_utils":500}],512:[function(_dereq_,module,exports){ 'use strict'; @@ -118896,7 +118750,7 @@ module.exports = { webp: _dereq_('./parse_sync/webp') }; -},{"./parse_sync/avif":516,"./parse_sync/bmp":517,"./parse_sync/gif":518,"./parse_sync/ico":519,"./parse_sync/jpeg":520,"./parse_sync/png":521,"./parse_sync/psd":522,"./parse_sync/svg":523,"./parse_sync/tiff":524,"./parse_sync/webp":525}],527:[function(_dereq_,module,exports){ +},{"./parse_sync/avif":502,"./parse_sync/bmp":503,"./parse_sync/gif":504,"./parse_sync/ico":505,"./parse_sync/jpeg":506,"./parse_sync/png":507,"./parse_sync/psd":508,"./parse_sync/svg":509,"./parse_sync/tiff":510,"./parse_sync/webp":511}],513:[function(_dereq_,module,exports){ 'use strict'; @@ -118926,7 +118780,7 @@ module.exports = function get_image_size(src) { module.exports.parsers = parsers; -},{"./lib/parsers_sync":526}],528:[function(_dereq_,module,exports){ +},{"./lib/parsers_sync":512}],514:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -119112,9 +118966,9 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],529:[function(_dereq_,module,exports){ +},{}],515:[function(_dereq_,module,exports){ module.exports = _dereq_('gl-quat/slerp') -},{"gl-quat/slerp":329}],530:[function(_dereq_,module,exports){ +},{"gl-quat/slerp":322}],516:[function(_dereq_,module,exports){ (function (global){(function (){ var now = _dereq_('performance-now') , root = typeof window === 'undefined' ? global : window @@ -119193,7 +119047,7 @@ module.exports.polyfill = function(object) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"performance-now":495}],531:[function(_dereq_,module,exports){ +},{"performance-now":484}],517:[function(_dereq_,module,exports){ 'use strict' var bnadd = _dereq_('big-rat/add') @@ -119209,7 +119063,7 @@ function add (a, b) { return r } -},{"big-rat/add":87}],532:[function(_dereq_,module,exports){ +},{"big-rat/add":87}],518:[function(_dereq_,module,exports){ 'use strict' module.exports = float2rat @@ -119224,7 +119078,7 @@ function float2rat(v) { return result } -},{"big-rat":90}],533:[function(_dereq_,module,exports){ +},{"big-rat":90}],519:[function(_dereq_,module,exports){ 'use strict' var rat = _dereq_('big-rat') @@ -119242,7 +119096,7 @@ function muls(a, x) { return r } -},{"big-rat":90,"big-rat/mul":99}],534:[function(_dereq_,module,exports){ +},{"big-rat":90,"big-rat/mul":99}],520:[function(_dereq_,module,exports){ 'use strict' var bnsub = _dereq_('big-rat/sub') @@ -119258,7 +119112,7 @@ function sub(a, b) { return r } -},{"big-rat/sub":101}],535:[function(_dereq_,module,exports){ +},{"big-rat/sub":101}],521:[function(_dereq_,module,exports){ 'use strict' var compareCell = _dereq_('compare-cell') @@ -119291,7 +119145,7 @@ function reduceCellComplex(cells) { return cells } -},{"cell-orientation":123,"compare-cell":139,"compare-oriented-cell":140}],536:[function(_dereq_,module,exports){ +},{"cell-orientation":123,"compare-cell":139,"compare-oriented-cell":140}],522:[function(_dereq_,module,exports){ 'use strict' var getBounds = _dereq_('array-bounds') @@ -119780,7 +119634,7 @@ function Error2D (regl, options) { } } -},{"array-bounds":76,"color-normalize":131,"flatten-vertex-data":252,"object-assign":487,"pick-by-alias":498,"to-float32":599,"update-diff":621}],537:[function(_dereq_,module,exports){ +},{"array-bounds":76,"color-normalize":131,"flatten-vertex-data":248,"object-assign":476,"pick-by-alias":485,"to-float32":584,"update-diff":605}],523:[function(_dereq_,module,exports){ 'use strict' @@ -120562,7 +120416,7 @@ Line2D.prototype.destroy = function () { return this } -},{"array-bounds":76,"array-find-index":77,"array-normalize":78,"color-normalize":131,"earcut":186,"es6-weak-map":241,"flatten-vertex-data":252,"glslify":442,"object-assign":487,"parse-rect":492,"pick-by-alias":498,"to-float32":599}],538:[function(_dereq_,module,exports){ +},{"array-bounds":76,"array-find-index":77,"array-normalize":78,"color-normalize":131,"earcut":183,"es6-weak-map":238,"flatten-vertex-data":248,"glslify":434,"object-assign":476,"parse-rect":481,"pick-by-alias":485,"to-float32":584}],524:[function(_dereq_,module,exports){ 'use strict'; function _slicedToArray(arr, i) { @@ -121551,7 +121405,7 @@ var reglScatter2d = function reglScatter2d(regl, options) { module.exports = reglScatter2d; -},{"@plotly/point-cluster":59,"array-bounds":76,"color-id":129,"color-normalize":131,"flatten-vertex-data":252,"glslify":442,"is-iexplorer":454,"object-assign":487,"parse-rect":492,"pick-by-alias":498,"to-float32":599,"update-diff":621}],539:[function(_dereq_,module,exports){ +},{"@plotly/point-cluster":59,"array-bounds":76,"color-id":129,"color-normalize":131,"flatten-vertex-data":248,"glslify":434,"is-iexplorer":444,"object-assign":476,"parse-rect":481,"pick-by-alias":485,"to-float32":584,"update-diff":605}],525:[function(_dereq_,module,exports){ 'use strict' @@ -121973,7 +121827,7 @@ function getPad (arg) { } } -},{"array-bounds":76,"array-range":79,"flatten-vertex-data":252,"parse-rect":492,"pick-by-alias":498,"raf":530,"regl-scatter2d":538}],540:[function(_dereq_,module,exports){ +},{"array-bounds":76,"array-range":79,"flatten-vertex-data":248,"parse-rect":481,"pick-by-alias":485,"raf":516,"regl-scatter2d":524}],526:[function(_dereq_,module,exports){ (function(Z,ka){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ka():"function"===typeof define&&define.amd?define(ka):Z.createREGL=ka()})(this,function(){function Z(a,b){this.id=Db++;this.type=a;this.data=b}function ka(a){if(0===a.length)return[];var b=a.charAt(0),c=a.charAt(a.length-1);if(1 * @@ -122218,7 +122072,7 @@ function repeat(str, num) { return res; } -},{}],542:[function(_dereq_,module,exports){ +},{}],528:[function(_dereq_,module,exports){ (function (global){(function (){ module.exports = global.performance && @@ -122229,7 +122083,7 @@ module.exports = } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],543:[function(_dereq_,module,exports){ +},{}],529:[function(_dereq_,module,exports){ "use strict" module.exports = compressExpansion @@ -122264,7 +122118,7 @@ function compressExpansion(e) { e.length = top return e } -},{}],544:[function(_dereq_,module,exports){ +},{}],530:[function(_dereq_,module,exports){ "use strict" var twoProduct = _dereq_("two-product") @@ -122274,67 +122128,37 @@ var compress = _dereq_("robust-compress") var NUM_EXPANDED = 6 -function cofactor(m, c) { - var result = new Array(m.length-1) - for(var i=1; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function determinant(m) { - if(m.length === 2) { - return ["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("") - } else { - var expr = [] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") - } -} - -function makeProduct(a, b) { - if(a.charAt(0) === "m") { - if(b.charAt(0) === "w") { - var toks = a.split("[") - return ["w", b.substr(1), "m", toks[0].substr(1)].join("") - } else { - return ["prod(", a, ",", b, ")"].join("") - } - } else { - return makeProduct(b, a) - } -} - -function sign(s) { - if(s & 1 !== 0) { - return "-" - } - return "" -} - -function determinant(m) { - if(m.length === 2) { - return [["diff(", makeProduct(m[0][0], m[1][1]), ",", makeProduct(m[1][0], m[0][1]), ")"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { - code.push(",") - } - code.push("[") - for(var k=0; k 0) { - code.push(",") - } - if(k === i) { - code.push("+b[", j, "]") - } else { - code.push("+A[", j, "][", k, "]") - } - } - code.push("]") - } - code.push("]),") - } - code.push("det(A)]}return ", funcName) - var proc = new Function("det", code.join("")) + var fn = + n === 2 ? solve2d : + n === 3 ? solve3d : + n === 4 ? solve4d : + n === 5 ? solve5d : solve6d + if(n < 6) { - return proc(determinant[n]) + return fn(determinant[n]) } - return proc(determinant) + return fn(determinant) } function robustLinearSolve0d() { - return [ 0 ] + return [ [ 0 ] ] } function robustLinearSolve1d(A, b) { return [ [ b[0] ], [ A[0][0] ] ] } +function solve2d(det) { + return function robustLinearSolve2d(A, b) { + return [det([[+b[0], +A[0][1]], [+b[1], +A[1][1]]]), det([[+A[0][0], +b[0]], [+A[1][0], +b[1]]]), det(A)] + } +} + +function solve3d(det) { + return function robustLinearSolve3d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2]], [+b[1], +A[1][1], +A[1][2]], [+b[2], +A[2][1], +A[2][2]]]), det([[+A[0][0], +b[0], +A[0][2]], [+A[1][0], +b[1], +A[1][2]], [+A[2][0], +b[2], +A[2][2]]]), det([[+A[0][0], +A[0][1], +b[0]], [+A[1][0], +A[1][1], +b[1]], [+A[2][0], +A[2][1], +b[2]]]), det(A)] + } +} + +function solve4d(det) { + return function robustLinearSolve4d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3]], [+b[1], +A[1][1], +A[1][2], +A[1][3]], [+b[2], +A[2][1], +A[2][2], +A[2][3]], [+b[3], +A[3][1], +A[3][2], +A[3][3]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3]], [+A[1][0], +b[1], +A[1][2], +A[1][3]], [+A[2][0], +b[2], +A[2][2], +A[2][3]], [+A[3][0], +b[3], +A[3][2], +A[3][3]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3]], [+A[1][0], +A[1][1], +b[1], +A[1][3]], [+A[2][0], +A[2][1], +b[2], +A[2][3]], [+A[3][0], +A[3][1], +b[3], +A[3][3]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +b[3]]]), det(A)] + } +} + +function solve5d(det) { + return function robustLinearSolve5d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3], +A[0][4]], [+b[1], +A[1][1], +A[1][2], +A[1][3], +A[1][4]], [+b[2], +A[2][1], +A[2][2], +A[2][3], +A[2][4]], [+b[3], +A[3][1], +A[3][2], +A[3][3], +A[3][4]], [+b[4], +A[4][1], +A[4][2], +A[4][3], +A[4][4]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3], +A[0][4]], [+A[1][0], +b[1], +A[1][2], +A[1][3], +A[1][4]], [+A[2][0], +b[2], +A[2][2], +A[2][3], +A[2][4]], [+A[3][0], +b[3], +A[3][2], +A[3][3], +A[3][4]], [+A[4][0], +b[4], +A[4][2], +A[4][3], +A[4][4]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3], +A[0][4]], [+A[1][0], +A[1][1], +b[1], +A[1][3], +A[1][4]], [+A[2][0], +A[2][1], +b[2], +A[2][3], +A[2][4]], [+A[3][0], +A[3][1], +b[3], +A[3][3], +A[3][4]], [+A[4][0], +A[4][1], +b[4], +A[4][3], +A[4][4]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0], +A[0][4]], [+A[1][0], +A[1][1], +A[1][2], +b[1], +A[1][4]], [+A[2][0], +A[2][1], +A[2][2], +b[2], +A[2][4]], [+A[3][0], +A[3][1], +A[3][2], +b[3], +A[3][4]], [+A[4][0], +A[4][1], +A[4][2], +b[4], +A[4][4]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +b[3]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +b[4]]]), det(A)] + } +} + +function solve6d(det) { + return function robustLinearSolve6d(A, b) { + return [det([[+b[0], +A[0][1], +A[0][2], +A[0][3], +A[0][4], +A[0][5]], [+b[1], +A[1][1], +A[1][2], +A[1][3], +A[1][4], +A[1][5]], [+b[2], +A[2][1], +A[2][2], +A[2][3], +A[2][4], +A[2][5]], [+b[3], +A[3][1], +A[3][2], +A[3][3], +A[3][4], +A[3][5]], [+b[4], +A[4][1], +A[4][2], +A[4][3], +A[4][4], +A[4][5]], [+b[5], +A[5][1], +A[5][2], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +b[0], +A[0][2], +A[0][3], +A[0][4], +A[0][5]], [+A[1][0], +b[1], +A[1][2], +A[1][3], +A[1][4], +A[1][5]], [+A[2][0], +b[2], +A[2][2], +A[2][3], +A[2][4], +A[2][5]], [+A[3][0], +b[3], +A[3][2], +A[3][3], +A[3][4], +A[3][5]], [+A[4][0], +b[4], +A[4][2], +A[4][3], +A[4][4], +A[4][5]], [+A[5][0], +b[5], +A[5][2], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +b[0], +A[0][3], +A[0][4], +A[0][5]], [+A[1][0], +A[1][1], +b[1], +A[1][3], +A[1][4], +A[1][5]], [+A[2][0], +A[2][1], +b[2], +A[2][3], +A[2][4], +A[2][5]], [+A[3][0], +A[3][1], +b[3], +A[3][3], +A[3][4], +A[3][5]], [+A[4][0], +A[4][1], +b[4], +A[4][3], +A[4][4], +A[4][5]], [+A[5][0], +A[5][1], +b[5], +A[5][3], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +b[0], +A[0][4], +A[0][5]], [+A[1][0], +A[1][1], +A[1][2], +b[1], +A[1][4], +A[1][5]], [+A[2][0], +A[2][1], +A[2][2], +b[2], +A[2][4], +A[2][5]], [+A[3][0], +A[3][1], +A[3][2], +b[3], +A[3][4], +A[3][5]], [+A[4][0], +A[4][1], +A[4][2], +b[4], +A[4][4], +A[4][5]], [+A[5][0], +A[5][1], +A[5][2], +b[5], +A[5][4], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +b[0], +A[0][5]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +b[1], +A[1][5]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +b[2], +A[2][5]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +b[3], +A[3][5]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +b[4], +A[4][5]], [+A[5][0], +A[5][1], +A[5][2], +A[5][3], +b[5], +A[5][5]]]), det([[+A[0][0], +A[0][1], +A[0][2], +A[0][3], +A[0][4], +b[0]], [+A[1][0], +A[1][1], +A[1][2], +A[1][3], +A[1][4], +b[1]], [+A[2][0], +A[2][1], +A[2][2], +A[2][3], +A[2][4], +b[2]], [+A[3][0], +A[3][1], +A[3][2], +A[3][3], +A[3][4], +b[3]], [+A[4][0], +A[4][1], +A[4][2], +A[4][3], +A[4][4], +b[4]], [+A[5][0], +A[5][1], +A[5][2], +A[5][3], +A[5][4], +b[5]]]), det(A)] + } +} + var CACHE = [ robustLinearSolve0d, robustLinearSolve1d ] +function proc(s0, s1, s2, s3, s4, s5, CACHE, g) { + return function dispatchLinearSolve(A, b) { + switch (A.length) { + case 0: return s0(A, b); + case 1: return s1(A, b); + case 2: return s2(A, b); + case 3: return s3(A, b); + case 4: return s4(A, b); + case 5: return s5(A, b); + } + var s = CACHE[A.length]; + if (!s) s = CACHE[A.length] = g(A.length); + return s(A, b) + } +} + function generateDispatch() { while(CACHE.length < NUM_EXPAND) { CACHE.push(generateSolver(CACHE.length)) } - var procArgs = [] - var code = ["function dispatchLinearSolve(A,b){switch(A.length){"] - for(var i=0; i>1 - return ["sum(", generateSum(expr.slice(0, m)), ",", generateSum(expr.slice(m)), ")"].join("") +function orientation_4(sum, prod, scale, sub) { + return function orientation4Exact(m0, m1, m2, m3) { + var p = sum(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m3[2]))), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m3[2])))) + var n = sum(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m3[2]))), sum(scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m2[2])))) + var d = sub(p, n) + return d[d.length - 1] } } -function determinant(m) { - if(m.length === 2) { - return [["sum(prod(", m[0][0], ",", m[1][1], "),prod(-", m[0][1], ",", m[1][0], "))"].join("")] - } else { - var expr = [] - for(var i=0; i 0) { return 1 } return 0.0 } -},{}],556:[function(_dereq_,module,exports){ +},{}],542:[function(_dereq_,module,exports){ 'use strict' module.exports = boundary @@ -123343,7 +123195,7 @@ function boundary(cells) { return reduce(bnd(cells)) } -},{"boundary-cells":107,"reduce-simplicial-complex":535}],557:[function(_dereq_,module,exports){ +},{"boundary-cells":107,"reduce-simplicial-complex":521}],543:[function(_dereq_,module,exports){ 'use strict' module.exports = extractContour @@ -123506,104 +123358,308 @@ function extractContour(cells, values, level, d) { vertexWeights: uweights } } -},{"./lib/codegen":558,"ndarray":483,"ndarray-sort":482,"typedarray-pool":617}],558:[function(_dereq_,module,exports){ +},{"./lib/codegen":544,"ndarray":472,"ndarray-sort":471,"typedarray-pool":601}],544:[function(_dereq_,module,exports){ 'use strict' module.exports = getPolygonizer -var pool = _dereq_('typedarray-pool') -var createMSTable = _dereq_('marching-simplex-table') - -var CACHE = {} - -function createCellPolygonizer(d) { - var maxCellSize = 0 - var tables = new Array(d+1) - tables[0] = [ [] ] - for(var i=1; i<=d; ++i) { - var tab = tables[i] = createMSTable(i) - for(var j=0; j>1,v=E[2*m+1];', - 'if(v===b){return m}', - 'if(b> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l } - code.push('R.push(') - for(var i=0; i 0) { - code.push(',') + function getContour0d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length } - code.push('[') - for(var j=0; j 0) { - code.push(',') + return R + } + return getContour0d + }, + function cellPolygonizer_1() { + 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 getContour1d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } } - code.push('B(C,E,c[', f[0], '],c[', f[1], '])') } - code.push(']') - } - code.push(');') - } - - for(var i=d+1; i>1; --i) { - if(i < d+1) { - code.push('else ') + return R } - code.push('if(l===', i, '){') - - //Generate mask - var maskStr = [] - for(var j=0; j> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour2d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R } - - //Perform table look up - code.push('var M=', maskStr.join('+'), - ';if(M===0||M===', (1<> 1, + v = E[2 * m + 1] + if (v === b) { + return m + } + if (b < v) { + h = m + } else { + l = m + 1 + } + } + return l + } + function getContour3d(F, E, C, S) { + var n = F.length, + R = [] + for (var i = 0; i < n; ++i) { + var c = F[i], + l = c.length + if (l === 4) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + (S[c[3]] << 3) + if (M === 0 || M === 15) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])]) + break + case 2: + R.push([B(C, E, c[1], c[2]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])]) + break + case 3: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[0], c[3])], [B(C, E, c[1], c[3]), B(C, E, c[1], c[2]), B(C, E, c[0], c[3])]) + break + case 4: + R.push([B(C, E, c[2], c[0]), B(C, E, c[2], c[1]), B(C, E, c[2], c[3])]) + break + case 5: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[0], c[3])], [B(C, E, c[2], c[1]), B(C, E, c[2], c[3]), B(C, E, c[0], c[3])]) + break + case 6: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[1], c[3])], [B(C, E, c[2], c[3]), B(C, E, c[2], c[0]), B(C, E, c[1], c[3])]) + break + case 7: + R.push([B(C, E, c[0], c[3]), B(C, E, c[1], c[3]), B(C, E, c[2], c[3])]) + break + case 8: + R.push([B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[3], c[2])]) + break + case 9: + R.push([B(C, E, c[3], c[1]), B(C, E, c[0], c[1]), B(C, E, c[0], c[2])], [B(C, E, c[3], c[2]), B(C, E, c[3], c[1]), B(C, E, c[0], c[2])]) + break + case 10: + R.push([B(C, E, c[1], c[0]), B(C, E, c[3], c[0]), B(C, E, c[1], c[2])], [B(C, E, c[3], c[0]), B(C, E, c[3], c[2]), B(C, E, c[1], c[2])]) + break + case 11: + R.push([B(C, E, c[1], c[2]), B(C, E, c[0], c[2]), B(C, E, c[3], c[2])]) + break + case 12: + R.push([B(C, E, c[3], c[0]), B(C, E, c[2], c[0]), B(C, E, c[2], c[1])], [B(C, E, c[3], c[1]), B(C, E, c[3], c[0]), B(C, E, c[2], c[1])]) + break + case 13: + R.push([B(C, E, c[0], c[1]), B(C, E, c[2], c[1]), B(C, E, c[3], c[1])]) + break + case 14: + R.push([B(C, E, c[2], c[0]), B(C, E, c[1], c[0]), B(C, E, c[3], c[0])]) + break + case 15: + break + } + } else if (l === 3) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + (S[c[2]] << 2) + if (M === 0 || M === 7) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[2]), B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0]), B(C, E, c[1], c[2])]) + break + case 3: + R.push([B(C, E, c[0], c[2]), B(C, E, c[1], c[2])]) + break + case 4: + R.push([B(C, E, c[2], c[1]), B(C, E, c[2], c[0])]) + break + case 5: + R.push([B(C, E, c[2], c[1]), B(C, E, c[0], c[1])]) + break + case 6: + R.push([B(C, E, c[1], c[0]), B(C, E, c[2], c[0])]) + break + case 7: + break + } + } else if (l === 2) { + var M = (S[c[0]] << 0) + (S[c[1]] << 1) + if (M === 0 || M === 3) { + continue + } + switch (M) { + case 0: + break + case 1: + R.push([B(C, E, c[0], c[1])]) + break + case 2: + R.push([B(C, E, c[1], c[0])]) + break + case 3: + break + } + } + } + return R } - code.push('}}') + return getContour3d } - code.push('}return R;};return getContour', d, 'd') - - var proc = new Function('pool', code.join('')) - return proc(pool) -} +] function getPolygonizer(d) { - var alg = CACHE[d] - if(!alg) { - alg = CACHE[d] = createCellPolygonizer(d) - } - return alg + return allFns[d](); } -},{"marching-simplex-table":462,"typedarray-pool":617}],559:[function(_dereq_,module,exports){ + +},{}],545:[function(_dereq_,module,exports){ "use strict"; "use restrict"; var bits = _dereq_("bit-twiddle") @@ -123947,11 +124003,11 @@ function connectedComponents(cells, vertex_count) { } exports.connectedComponents = connectedComponents -},{"bit-twiddle":104,"union-find":618}],560:[function(_dereq_,module,exports){ +},{"bit-twiddle":104,"union-find":602}],546:[function(_dereq_,module,exports){ arguments[4][104][0].apply(exports,arguments) -},{"dup":104}],561:[function(_dereq_,module,exports){ -arguments[4][559][0].apply(exports,arguments) -},{"bit-twiddle":560,"dup":559,"union-find":562}],562:[function(_dereq_,module,exports){ +},{"dup":104}],547:[function(_dereq_,module,exports){ +arguments[4][545][0].apply(exports,arguments) +},{"bit-twiddle":546,"dup":545,"union-find":548}],548:[function(_dereq_,module,exports){ "use strict"; "use restrict"; module.exports = UnionFind; @@ -124008,7 +124064,7 @@ UnionFind.prototype.link = function(x, y) { } -},{}],563:[function(_dereq_,module,exports){ +},{}],549:[function(_dereq_,module,exports){ "use strict" module.exports = simplifyPolygon @@ -124280,7 +124336,7 @@ function simplifyPolygon(cells, positions, minArea) { edges: ncells } } -},{"robust-orientation":548,"simplicial-complex":561}],564:[function(_dereq_,module,exports){ +},{"robust-orientation":534,"simplicial-complex":547}],550:[function(_dereq_,module,exports){ "use strict" module.exports = orderSegments @@ -124376,9 +124432,7 @@ function orderSegments(b, a) { } return ar[0] - br[0] } -},{"robust-orientation":548}],565:[function(_dereq_,module,exports){ -arguments[4][251][0].apply(exports,arguments) -},{"dup":251}],566:[function(_dereq_,module,exports){ +},{"robust-orientation":534}],551:[function(_dereq_,module,exports){ "use strict" module.exports = createSlabDecomposition @@ -124609,7 +124663,7 @@ function createSlabDecomposition(segments) { } return new SlabDecomposition(slabs, lines, horizontal) } -},{"./lib/order-segments":564,"binary-search-bounds":565,"functional-red-black-tree":255,"robust-orientation":548}],567:[function(_dereq_,module,exports){ +},{"./lib/order-segments":550,"binary-search-bounds":103,"functional-red-black-tree":251,"robust-orientation":534}],552:[function(_dereq_,module,exports){ "use strict" var robustDot = _dereq_("robust-dot-product") @@ -124701,7 +124755,7 @@ function negative(points, plane) { } return neg } -},{"robust-dot-product":545,"robust-sum":553}],568:[function(_dereq_,module,exports){ +},{"robust-dot-product":531,"robust-sum":539}],553:[function(_dereq_,module,exports){ /* global window, exports, define */ !function() { @@ -124934,7 +124988,7 @@ function negative(points, plane) { /* eslint-enable quote-props */ }(); // eslint-disable-line -},{}],569:[function(_dereq_,module,exports){ +},{}],554:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -125065,7 +125119,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":116,"inherits":447,"readable-stream/lib/_stream_duplex.js":571,"readable-stream/lib/_stream_passthrough.js":572,"readable-stream/lib/_stream_readable.js":573,"readable-stream/lib/_stream_transform.js":574,"readable-stream/lib/_stream_writable.js":575,"readable-stream/lib/internal/streams/end-of-stream.js":579,"readable-stream/lib/internal/streams/pipeline.js":581}],570:[function(_dereq_,module,exports){ +},{"events":116,"inherits":439,"readable-stream/lib/_stream_duplex.js":556,"readable-stream/lib/_stream_passthrough.js":557,"readable-stream/lib/_stream_readable.js":558,"readable-stream/lib/_stream_transform.js":559,"readable-stream/lib/_stream_writable.js":560,"readable-stream/lib/internal/streams/end-of-stream.js":564,"readable-stream/lib/internal/streams/pipeline.js":566}],555:[function(_dereq_,module,exports){ 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } @@ -125194,7 +125248,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; -},{}],571:[function(_dereq_,module,exports){ +},{}],556:[function(_dereq_,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -125336,7 +125390,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); }).call(this)}).call(this,_dereq_('_process')) -},{"./_stream_readable":573,"./_stream_writable":575,"_process":528,"inherits":447}],572:[function(_dereq_,module,exports){ +},{"./_stream_readable":558,"./_stream_writable":560,"_process":514,"inherits":439}],557:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -125376,7 +125430,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":574,"inherits":447}],573:[function(_dereq_,module,exports){ +},{"./_stream_transform":559,"inherits":439}],558:[function(_dereq_,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -126503,7 +126557,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":570,"./_stream_duplex":571,"./internal/streams/async_iterator":576,"./internal/streams/buffer_list":577,"./internal/streams/destroy":578,"./internal/streams/from":580,"./internal/streams/state":582,"./internal/streams/stream":583,"_process":528,"buffer":117,"events":116,"inherits":447,"string_decoder/":584,"util":115}],574:[function(_dereq_,module,exports){ +},{"../errors":555,"./_stream_duplex":556,"./internal/streams/async_iterator":561,"./internal/streams/buffer_list":562,"./internal/streams/destroy":563,"./internal/streams/from":565,"./internal/streams/state":567,"./internal/streams/stream":568,"_process":514,"buffer":117,"events":116,"inherits":439,"string_decoder/":569,"util":115}],559:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -126705,7 +126759,7 @@ function done(stream, er, data) { if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } -},{"../errors":570,"./_stream_duplex":571,"inherits":447}],575:[function(_dereq_,module,exports){ +},{"../errors":555,"./_stream_duplex":556,"inherits":439}],560:[function(_dereq_,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -127405,7 +127459,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":570,"./_stream_duplex":571,"./internal/streams/destroy":578,"./internal/streams/state":582,"./internal/streams/stream":583,"_process":528,"buffer":117,"inherits":447,"util-deprecate":622}],576:[function(_dereq_,module,exports){ +},{"../errors":555,"./_stream_duplex":556,"./internal/streams/destroy":563,"./internal/streams/state":567,"./internal/streams/stream":568,"_process":514,"buffer":117,"inherits":439,"util-deprecate":606}],561:[function(_dereq_,module,exports){ (function (process){(function (){ 'use strict'; @@ -127615,7 +127669,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat module.exports = createReadableStreamAsyncIterator; }).call(this)}).call(this,_dereq_('_process')) -},{"./end-of-stream":579,"_process":528}],577:[function(_dereq_,module,exports){ +},{"./end-of-stream":564,"_process":514}],562:[function(_dereq_,module,exports){ 'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -127826,7 +127880,7 @@ function () { return BufferList; }(); -},{"buffer":117,"util":115}],578:[function(_dereq_,module,exports){ +},{"buffer":117,"util":115}],563:[function(_dereq_,module,exports){ (function (process){(function (){ 'use strict'; // undocumented cb() API, needed for core, not for public API @@ -127934,7 +127988,7 @@ module.exports = { errorOrDestroy: errorOrDestroy }; }).call(this)}).call(this,_dereq_('_process')) -},{"_process":528}],579:[function(_dereq_,module,exports){ +},{"_process":514}],564:[function(_dereq_,module,exports){ // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -128039,12 +128093,12 @@ function eos(stream, opts, callback) { } module.exports = eos; -},{"../../../errors":570}],580:[function(_dereq_,module,exports){ +},{"../../../errors":555}],565:[function(_dereq_,module,exports){ module.exports = function () { throw new Error('Readable.from is not available in the browser') }; -},{}],581:[function(_dereq_,module,exports){ +},{}],566:[function(_dereq_,module,exports){ // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -128142,7 +128196,7 @@ function pipeline() { } module.exports = pipeline; -},{"../../../errors":570,"./end-of-stream":579}],582:[function(_dereq_,module,exports){ +},{"../../../errors":555,"./end-of-stream":564}],567:[function(_dereq_,module,exports){ 'use strict'; var ERR_INVALID_OPT_VALUE = _dereq_('../../../errors').codes.ERR_INVALID_OPT_VALUE; @@ -128170,10 +128224,10 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark: getHighWaterMark }; -},{"../../../errors":570}],583:[function(_dereq_,module,exports){ +},{"../../../errors":555}],568:[function(_dereq_,module,exports){ module.exports = _dereq_('events').EventEmitter; -},{"events":116}],584:[function(_dereq_,module,exports){ +},{"events":116}],569:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -128470,7 +128524,7 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":554}],585:[function(_dereq_,module,exports){ +},{"safe-buffer":540}],570:[function(_dereq_,module,exports){ (function (process,Buffer){(function (){ /** @@ -128773,7 +128827,7 @@ function trampoline (fn) { } }).call(this)}).call(this,_dereq_('_process'),_dereq_("buffer").Buffer) -},{"_process":528,"assert":80,"buffer":117,"debug":586}],586:[function(_dereq_,module,exports){ +},{"_process":514,"assert":80,"buffer":117,"debug":571}],571:[function(_dereq_,module,exports){ (function (process){(function (){ /** * This is the web browser implementation of `debug()`. @@ -128962,7 +129016,7 @@ function localstorage() { } }).call(this)}).call(this,_dereq_('_process')) -},{"./debug":587,"_process":528}],587:[function(_dereq_,module,exports){ +},{"./debug":572,"_process":514}],572:[function(_dereq_,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -129166,7 +129220,7 @@ function coerce(val) { return val; } -},{"ms":588}],588:[function(_dereq_,module,exports){ +},{"ms":573}],573:[function(_dereq_,module,exports){ /** * Helpers. */ @@ -129320,7 +129374,7 @@ function plural(ms, n, name) { return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],589:[function(_dereq_,module,exports){ +},{}],574:[function(_dereq_,module,exports){ 'use strict' var paren = _dereq_('parenthesis') @@ -129378,7 +129432,7 @@ module.exports = function splitBy (string, separator, o) { return parts } -},{"parenthesis":491}],590:[function(_dereq_,module,exports){ +},{"parenthesis":480}],575:[function(_dereq_,module,exports){ "use strict" module.exports = stronglyConnectedComponents @@ -129494,180 +129548,1570 @@ function stronglyConnectedComponents(adjList) { return {components: components, adjacencyList: sccAdjList} } -},{}],591:[function(_dereq_,module,exports){ +},{}],576:[function(_dereq_,module,exports){ "use strict" module.exports = surfaceNets var generateContourExtractor = _dereq_("ndarray-extract-contour") -var triangulateCube = _dereq_("triangulate-hypercube") var zeroCrossings = _dereq_("zero-crossings") -function buildSurfaceNets(order, dtype) { - var dimension = order.length - var code = ["'use strict';"] - var funcName = "surfaceNets" + order.join("_") + "d" + dtype - - //Contour extraction function - code.push( - "var contour=genContour({", - "order:[", order.join(), "],", - "scalarArguments: 3,", - "phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },") - if(dtype === "generic") { - code.push("getters:[0],") - } - - //Generate vertex function - var cubeArgs = [] - var extraArgs = [] - for(var i=0; i>>7){") - } - for(var i=0; i<1<<(1< 128) { - if((i%128)===0) { - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - var efName = "vExtra" + extraFuncs.length - code.push("case ", (i>>>7), ":", efName, "(m&0x7f,", extraArgs.join(), ");break;") - currentFunc = [ - "function ", efName, "(m,", extraArgs.join(), "){switch(m){" - ] - extraFuncs.push(currentFunc) - } - } - currentFunc.push("case ", (i&0x7f), ":") - var crossings = new Array(dimension) - var denoms = new Array(dimension) - var crossingCount = new Array(dimension) - var bias = new Array(dimension) - var totalCrossings = 0 - for(var j=0; j j) { - continue +var F1_6 = 1 / 6 +var F5_6 = 5 / 6 +var F7_18 = 7 / 18 +var F1_14 = 1 / 14 +var F3_14 = 3 / 14 +var F5_14 = 5 / 14 +var F9_14 = 9 / 14 +var F11_18 = 11 / 18 + +var allFns = { + "2d": function (genContour, order, dtype) { + var contour = genContour({ + order: order, + scalarArguments: 3, + getters: dtype === "generic" ? [0] : undefined, + phase: function phaseFunc(p, a, b, c) { + return (p > c) | 0; + }, + vertex: function vertexFunc(d0, d1, v0, v1, v2, v3, p0, p1, p2, p3, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3)) | 0; + if (m === 0 || m === 15) { + return; } - if(!(i&(1< c) | 0; + }, + vertex: function vertexFunc(d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, b, c) { + var m = ((p0 << 0) + (p1 << 1) + (p2 << 2) + (p3 << 3) + (p4 << 4) + (p5 << 5) + (p6 << 6) + (p7 << 7)) | 0; + if (m === 0 || m === 255) { + return; } + switch (m >>> 7) { + case 0: + vExtra0(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + case 1: + vExtra1(m & 0x7f, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c); + break; + } + }, + cell: function cellFunc(v0, v1, v2, v3, c0, c1, p0, p1, a, b, c) { + if (p0) { + b.push([v3, v2, v0], [v0, v1, v3]); + } else { + b.push([v0, v2, v3], [v3, v1, v0]); + } + }, + }); + return function (array, level) { + var verts = [], + cells = []; + contour(array, verts, cells, level); + return { positions: verts, cells: cells }; + }; + function vExtra0(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; + case 1: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 3: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 4: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 5: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 6: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 7: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 8: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 9: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 10: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 11: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 12: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 13: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 14: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 15: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (v4 + v0 + v5 + v1 + v6 + v2 + v7 + v3 - 8 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 16: + a.push([ + d0 - F1_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 17: + a.push([d0 - 0.25 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 18: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 19: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 20: + a.push([ + d0 - F1_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 21: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 22: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 23: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 24: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 25: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 26: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 28: + a.push([ + d0 - F5_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 30: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v4 - v0 + v1 - v5 + v2 - v6 + v3 - v7), + ]); + break; + case 31: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (v5 + v1 + v6 + v2 + v7 + v3 - 6 * c)) / (v1 - v5 + v2 - v6 + v3 - v7)]); + break; + case 32: + a.push([ + d0 - F5_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 33: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 34: + a.push([d0 - 0.75 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 35: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 36: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 37: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 38: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 40: + a.push([ + d0 - F5_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 41: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 42: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 43: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 44: + a.push([ + d0 - F9_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 45: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 46: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7), + ]); + break; + case 47: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (v4 + v0 + v6 + v2 + v7 + v3 - 6 * c)) / (v0 - v4 + v2 - v6 + v3 - v7)]); + break; + case 48: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 49: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 50: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 51: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (v2 + v0 + v3 + v1 + v6 + v4 + v7 + v5 - 8 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5]); + break; + case 52: + a.push([ + d0 - F5_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 54: + a.push([ + d0 - 0.375 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v2 - v0 + v1 - v3 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 55: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (v3 + v1 + v6 + v4 + v7 + v5 - 6 * c)) / (v1 - v3 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 56: + a.push([ + d0 - F9_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 57: + a.push([ + d0 - 0.625 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.375 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 58: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 59: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (v2 + v0 + v6 + v4 + v7 + v5 - 6 * c)) / (v0 - v2 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 60: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + v7 + v5)) / (v2 - v0 + v3 - v1 + v4 - v6 + v5 - v7), d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + v7 + v3)) / (v4 - v0 + v5 - v1 + v2 - v6 + v3 - v7)]); + break; + case 61: + a.push([ + d0 - F9_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + v7 + v5 - 2 * c)) / (v3 - v1 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + v7 + v3 - 2 * c)) / (v5 - v1 + v2 - v6 + v3 - v7), + ]); + break; + case 62: + a.push([ + d0 - F5_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v6 + v4 + v7 + v5 - 2 * c)) / (v2 - v0 + v4 - v6 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v6 + v2 + v7 + v3 - 2 * c)) / (v4 - v0 + v2 - v6 + v3 - v7), + ]); + break; + case 63: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v6 + v4 + v7 + v5 - 4 * c)) / (v4 - v6 + v5 - v7), d2 - 0.75 - (0.25 * (v6 + v2 + v7 + v3 - 4 * c)) / (v2 - v6 + v3 - v7)]); + break; + case 64: + a.push([ + d0 - F1_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 65: + a.push([ + d0 - F1_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 66: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 67: + a.push([ + d0 - F5_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 68: + a.push([d0 - 0.25 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 69: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 70: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 71: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 72: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 73: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 75: + a.push([ + d0 - 0.375 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + v7 + v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 76: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 77: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 78: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7), + ]); + break; + case 79: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v7 + v3 - 6 * c)) / (v0 - v4 + v1 - v5 + v3 - v7)]); + break; + case 80: + a.push([d0 - 0.25 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 81: + a.push([d0 - 0.3 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 82: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 83: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 84: + a.push([d0 - 0.3 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 85: + a.push([d0 - 0.5 - (0.5 * (v1 + v0 + v3 + v2 + v5 + v4 + v7 + v6 - 8 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5]); + break; + case 86: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v1 - v0 + v2 - v3 + v4 - v5 + v6 - v7), + d1 - 0.375 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 87: + a.push([d0 - 0.7 - (0.3 * (v3 + v2 + v5 + v4 + v7 + v6 - 6 * c)) / (v2 - v3 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 88: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v3 - v2 + v4 - v5 + v6 - v7), + d1 - 0.625 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 90: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + v7 + v6)) / (v1 - v0 + v3 - v2 + v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + v7 + v3)) / (v4 - v0 + v1 - v5 + v6 - v2 + v3 - v7)]); + break; + case 91: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + v7 + v6 - 2 * c)) / (v3 - v2 + v4 - v5 + v6 - v7), + d1 - F9_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + v7 + v3 - 2 * c)) / (v1 - v5 + v6 - v2 + v3 - v7), + ]); + break; + case 92: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7), + ]); + break; + case 93: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v5 + v4 + v7 + v6 - 6 * c)) / (v0 - v1 + v4 - v5 + v6 - v7), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (v7 + v3 - 2 * c)) / (v3 - v7)]); + break; + case 94: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v5 + v4 + v7 + v6 - 2 * c)) / (v1 - v0 + v4 - v5 + v6 - v7), + d1 - F5_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + v7 + v3 - 2 * c)) / (v4 - v0 + v1 - v5 + v3 - v7), + ]); + break; + case 95: + a.push([d0 - 0.75 - (0.25 * (v5 + v4 + v7 + v6 - 4 * c)) / (v4 - v5 + v6 - v7), d1 - 0.5, d2 - 0.75 - (0.25 * (v5 + v1 + v7 + v3 - 4 * c)) / (v1 - v5 + v3 - v7)]); + break; + case 96: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 97: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 99: + a.push([ + d0 - 0.375 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + v7 + v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + v7 + v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.375 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 102: + a.push([d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + v7 + v6)) / (v1 - v0 + v2 - v3 + v5 - v4 + v6 - v7), d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + v7 + v5)) / (v2 - v0 + v1 - v3 + v6 - v4 + v5 - v7), d2 - 0.5]); + break; + case 103: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + v7 + v6 - 2 * c)) / (v2 - v3 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + v7 + v5 - 2 * c)) / (v1 - v3 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 104: + a.push([ + d0 - F11_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 105: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + v7 + v6)) / (v0 - v1 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + v7 + v5)) / (v0 - v2 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + v7 + v3)) / (v0 - v4 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 106: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + v7 + v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v6 - v7), + d1 - 0.625 - (0.125 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 107: + a.push([ + d0 - F7_18 - (F1_6 * (-v3 - v2 + -v5 - v4 + v7 + v6 + 2 * c)) / (v3 - v2 + v5 - v4 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v6 - v4 + v7 + v5 - 2 * c)) / (v0 - v2 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v6 - v2 + v7 + v3 - 2 * c)) / (v0 - v4 + v6 - v2 + v3 - v7), + ]); + break; + case 108: + a.push([ + d0 - 0.625 - (0.125 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + v7 + v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v5 - v7), + d2 - 0.625 - (0.125 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 109: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v5 - v4 + v7 + v6 - 2 * c)) / (v0 - v1 + v5 - v4 + v6 - v7), + d1 - F7_18 - (F1_6 * (-v3 - v1 + -v6 - v4 + v7 + v5 + 2 * c)) / (v3 - v1 + v6 - v4 + v5 - v7), + d2 - F11_18 - (F1_6 * (v4 + v0 + -v5 - v1 + v7 + v3 - 2 * c)) / (v0 - v4 + v5 - v1 + v3 - v7), + ]); + break; + case 110: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v5 - v4 + v7 + v6 + 2 * c)) / (v1 - v0 + v5 - v4 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v6 - v4 + v7 + v5 + 2 * c)) / (v2 - v0 + v6 - v4 + v5 - v7), + d2 - F9_14 - (F1_14 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; + case 111: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + v7 + v6)) / (v5 - v4 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v6 - v4 + v7 + v5)) / (v6 - v4 + v5 - v7), + d2 - F5_6 - (F1_6 * (v4 + v0 + v7 + v3 - 4 * c)) / (v0 - v4 + v3 - v7), + ]); + break; + case 112: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 113: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 114: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), + d1 - 0.5 - (F1_6 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 115: + a.push([d0 - 0.5 - (0.1 * (v7 + v6 - 2 * c)) / (v6 - v7), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v7 + v5 - 6 * c)) / (v0 - v2 + v1 - v3 + v5 - v7), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 116: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 117: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v7 + v6 - 6 * c)) / (v0 - v1 + v2 - v3 + v6 - v7), d1 - 0.5 - (0.1 * (v7 + v5 - 2 * c)) / (v5 - v7), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + v7 + v6 - 2 * c)) / (v1 - v0 + v2 - v3 + v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + v7 + v5 - 2 * c)) / (v2 - v0 + v1 - v3 + v5 - v7), + d2 - F5_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 119: + a.push([d0 - 0.75 - (0.25 * (v3 + v2 + v7 + v6 - 4 * c)) / (v2 - v3 + v6 - v7), d1 - 0.75 - (0.25 * (v3 + v1 + v7 + v5 - 4 * c)) / (v1 - v3 + v5 - v7), d2 - 0.5]); + break; + case 120: + a.push([ + d0 - 0.625 - (0.125 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - 0.625 - (0.125 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + v7 + v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 121: + a.push([ + d0 - F11_18 - (F1_6 * (v1 + v0 + -v3 - v2 + v7 + v6 - 2 * c)) / (v0 - v1 + v3 - v2 + v6 - v7), + d1 - F11_18 - (F1_6 * (v2 + v0 + -v3 - v1 + v7 + v5 - 2 * c)) / (v0 - v2 + v3 - v1 + v5 - v7), + d2 - F7_18 - (F1_6 * (-v5 - v1 + -v6 - v2 + v7 + v3 + 2 * c)) / (v5 - v1 + v6 - v2 + v3 - v7), + ]); + break; + case 122: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v7 + v6 + 2 * c)) / (v1 - v0 + v3 - v2 + v6 - v7), + d1 - F9_14 - (F1_14 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v6 - v2 + v7 + v3 + 2 * c)) / (v4 - v0 + v6 - v2 + v3 - v7), + ]); + break; + case 123: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v7 + v6)) / (v3 - v2 + v6 - v7), + d1 - F5_6 - (F1_6 * (v2 + v0 + v7 + v5 - 4 * c)) / (v0 - v2 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v6 - v2 + v7 + v3)) / (v6 - v2 + v3 - v7), + ]); + break; + case 124: + a.push([ + d0 - F9_14 - (F1_14 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v7 + v5 + 2 * c)) / (v2 - v0 + v3 - v1 + v5 - v7), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v7 + v3 + 2 * c)) / (v4 - v0 + v5 - v1 + v3 - v7), + ]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 + v7 + v6 - 4 * c)) / (v0 - v1 + v6 - v7), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v7 + v5)) / (v3 - v1 + v5 - v7), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v7 + v3)) / (v5 - v1 + v3 - v7), + ]); + break; + case 126: + a.push([d0 - 0.5 - (F1_6 * (-v1 - v0 + v7 + v6)) / (v1 - v0 + v6 - v7), d1 - 0.5 - (F1_6 * (-v2 - v0 + v7 + v5)) / (v2 - v0 + v5 - v7), d2 - 0.5 - (F1_6 * (-v4 - v0 + v7 + v3)) / (v4 - v0 + v3 - v7)]); + break; + case 127: + a.push([ + d0 - F5_6 - (F1_6 * (v7 + v6 - 2 * c)) / (v6 - v7), + d1 - F5_6 - (F1_6 * (v7 + v5 - 2 * c)) / (v5 - v7), + d2 - F5_6 - (F1_6 * (v7 + v3 - 2 * c)) / (v3 - v7), + ]); + break; } } - var vertexStr = [] - for(var k=0; k 0) { - cStr = "+" + crossingCount[k] + "*c" - } - var weight = 0.5 * (crossings[k].length / totalCrossings) - var shift = 0.5 + 0.5 * (bias[k] / totalCrossings) - vertexStr.push("d" + k + "-" + shift + "-" + weight + "*(" + crossings[k].join("+") + cStr + ")/(" + denoms[k].join("+") + ")") - + function vExtra1(m, d0, d1, d2, v0, v1, v2, v3, v4, v5, v6, v7, p0, p1, p2, p3, p4, p5, p6, p7, a, c) { + switch (m) { + case 0: + a.push([ + d0 - F5_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 1: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 2: + a.push([ + d0 - F5_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 3: + a.push([ + d0 - F9_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 4: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 5: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 6: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 7: + a.push([ + d0 - 0.625 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + v6 + v2 + -v7 - v3 - 4 * c)) / (v0 - v4 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 8: + a.push([d0 - 0.75 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 9: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 10: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 11: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5), + ]); + break; + case 12: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 13: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6), + ]); + break; + case 14: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 15: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (v4 + v0 + v5 + v1 + v6 + v2 - 6 * c)) / (v0 - v4 + v1 - v5 + v2 - v6)]); + break; + case 16: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 17: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 18: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 19: + a.push([ + d0 - 0.625 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + v6 + v4 + -v7 - v5 - 4 * c)) / (v0 - v2 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 20: + a.push([ + d0 - F7_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 21: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + v5 + v4 + -v7 - v6 - 4 * c)) / (v0 - v1 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.625 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 22: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 + -v7 - v6)) / (v1 - v0 + v2 - v3 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 + -v7 - v5)) / (v2 - v0 + v1 - v3 + v4 - v6 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 + -v7 - v3)) / (v4 - v0 + v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 23: + a.push([ + d0 - F11_18 - (F1_6 * (v3 + v2 + v5 + v4 + -v7 - v6 - 2 * c)) / (v2 - v3 + v4 - v5 + v7 - v6), + d1 - F11_18 - (F1_6 * (v3 + v1 + v6 + v4 + -v7 - v5 - 2 * c)) / (v1 - v3 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (v5 + v1 + v6 + v2 + -v7 - v3 - 2 * c)) / (v1 - v5 + v2 - v6 + v7 - v3), + ]); + break; + case 24: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 25: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + v5 + v4 + -v7 - v6)) / (v0 - v1 + v3 - v2 + v4 - v5 + v7 - v6), d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + v6 + v4 + -v7 - v5)) / (v0 - v2 + v3 - v1 + v4 - v6 + v7 - v5), d2 - 0.5]); + break; + case 26: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + -v3 - v2 + v5 + v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.375 - (0.125 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 27: + a.push([ + d0 - 0.5 - (F3_14 * (-v3 - v2 + v5 + v4 + -v7 - v6 + 2 * c)) / (v3 - v2 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + v6 + v4 + -v7 - v5 - 2 * c)) / (v0 - v2 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 28: + a.push([ + d0 - 0.375 - (0.125 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (0.25 * (-v2 - v0 + -v3 - v1 + v6 + v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v3 - v1 + v4 - v6 + v7 - v5), + d2 - 0.625 - (0.125 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 29: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v5 + v4 + -v7 - v6 - 2 * c)) / (v0 - v1 + v4 - v5 + v7 - v6), + d1 - 0.5 - (F3_14 * (-v3 - v1 + v6 + v4 + -v7 - v5 + 2 * c)) / (v3 - v1 + v4 - v6 + v7 - v5), + d2 - F9_14 - (F1_14 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 30: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v5 + v4 + -v7 - v6 + 2 * c)) / (v1 - v0 + v4 - v5 + v7 - v6), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v6 + v4 + -v7 - v5 + 2 * c)) / (v2 - v0 + v4 - v6 + v7 - v5), + d2 - F11_18 - (F1_6 * (-v4 - v0 + v5 + v1 + v6 + v2 - 2 * c)) / (v4 - v0 + v1 - v5 + v2 - v6), + ]); + break; + case 31: + a.push([ + d0 - 0.5 - (F1_6 * (v5 + v4 + -v7 - v6)) / (v4 - v5 + v7 - v6), + d1 - 0.5 - (F1_6 * (v6 + v4 + -v7 - v5)) / (v4 - v6 + v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 + v6 + v2 - 4 * c)) / (v1 - v5 + v2 - v6), + ]); + break; + case 32: + a.push([d0 - 0.75 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 33: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 34: + a.push([d0 - 0.7 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 35: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 36: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 37: + a.push([d0 - 0.5 - (0.25 * (v1 + v0 + v3 + v2 + -v5 - v4 + -v7 - v6)) / (v0 - v1 + v2 - v3 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + v6 + v2 + -v7 - v3)) / (v0 - v4 + v5 - v1 + v2 - v6 + v7 - v3)]); + break; + case 38: + a.push([ + d0 - 0.5 - (0.25 * (-v1 - v0 + v3 + v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v1 - v0 + v2 - v3 + v5 - v4 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - 0.375 - (0.125 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 39: + a.push([ + d0 - 0.5 - (F3_14 * (v3 + v2 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v2 - v3 + v5 - v4 + v7 - v6), + d1 - F9_14 - (F1_14 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - 0.5 - (F3_14 * (v4 + v0 + v6 + v2 + -v7 - v3 - 2 * c)) / (v0 - v4 + v2 - v6 + v7 - v3), + ]); + break; + case 40: + a.push([d0 - 0.7 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 41: + a.push([ + d0 - 0.5 - (0.25 * (v1 + v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 4 * c)) / (v0 - v1 + v3 - v2 + v5 - v4 + v7 - v6), + d1 - 0.375 - (0.125 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - 0.375 - (0.125 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 42: + a.push([d0 - 0.5 - (0.5 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + -v7 - v6 + 8 * c)) / (v1 - v0 + v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.5]); + break; + case 43: + a.push([d0 - 0.3 - (0.3 * (-v3 - v2 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v3 - v2 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 44: + a.push([ + d0 - 0.5 - (F1_6 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), + d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6), + ]); + break; + case 45: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v5 - v4 + -v7 - v6 + 2 * c)) / (v0 - v1 + v5 - v4 + v7 - v6), + d1 - F5_14 - (F1_14 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + v6 + v2 - 2 * c)) / (v0 - v4 + v5 - v1 + v2 - v6), + ]); + break; + case 46: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v5 - v4 + -v7 - v6 + 6 * c)) / (v1 - v0 + v5 - v4 + v7 - v6), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.5 - (0.1 * (v6 + v2 - 2 * c)) / (v2 - v6)]); + break; + case 47: + a.push([d0 - 0.25 - (0.25 * (-v5 - v4 + -v7 - v6 + 4 * c)) / (v5 - v4 + v7 - v6), d1 - 0.5, d2 - 0.75 - (0.25 * (v4 + v0 + v6 + v2 - 4 * c)) / (v0 - v4 + v2 - v6)]); + break; + case 48: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.7 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 49: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), + d1 - 0.5 - (F1_6 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 50: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 51: + a.push([d0 - 0.5 - (0.1 * (-v7 - v6 + 2 * c)) / (v7 - v6), d1 - 0.7 - (0.3 * (v2 + v0 + v3 + v1 + v6 + v4 - 6 * c)) / (v0 - v2 + v1 - v3 + v4 - v6), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 52: + a.push([ + d0 - 0.375 - (0.125 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - 0.625 - (0.125 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (0.25 * (-v4 - v0 + -v5 - v1 + v6 + v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 53: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v7 - v6 - 2 * c)) / (v0 - v1 + v2 - v3 + v7 - v6), + d1 - F9_14 - (F1_14 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - 0.5 - (F3_14 * (-v5 - v1 + v6 + v2 + -v7 - v3 + 2 * c)) / (v5 - v1 + v2 - v6 + v7 - v3), + ]); + break; + case 54: + a.push([ + d0 - F7_18 - (F1_6 * (-v1 - v0 + v3 + v2 + -v7 - v6 + 2 * c)) / (v1 - v0 + v2 - v3 + v7 - v6), + d1 - F11_18 - (F1_6 * (-v2 - v0 + v3 + v1 + v6 + v4 - 2 * c)) / (v2 - v0 + v1 - v3 + v4 - v6), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v6 + v2 + -v7 - v3 + 2 * c)) / (v4 - v0 + v2 - v6 + v7 - v3), + ]); + break; + case 55: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v7 - v6)) / (v2 - v3 + v7 - v6), + d1 - F5_6 - (F1_6 * (v3 + v1 + v6 + v4 - 4 * c)) / (v1 - v3 + v4 - v6), + d2 - 0.5 - (F1_6 * (v6 + v2 + -v7 - v3)) / (v2 - v6 + v7 - v3), + ]); + break; + case 56: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1), + ]); + break; + case 57: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + -v7 - v6 + 2 * c)) / (v0 - v1 + v3 - v2 + v7 - v6), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + v6 + v4 - 2 * c)) / (v0 - v2 + v3 - v1 + v4 - v6), + d2 - F5_14 - (F1_14 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 58: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v7 - v6 + 6 * c)) / (v1 - v0 + v3 - v2 + v7 - v6), d1 - 0.5 - (0.1 * (v6 + v4 - 2 * c)) / (v4 - v6), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 59: + a.push([d0 - 0.25 - (0.25 * (-v3 - v2 + -v7 - v6 + 4 * c)) / (v3 - v2 + v7 - v6), d1 - 0.75 - (0.25 * (v2 + v0 + v6 + v4 - 4 * c)) / (v0 - v2 + v4 - v6), d2 - 0.5]); + break; + case 60: + a.push([ + d0 - F5_14 - (F1_14 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - 0.5 - (F3_14 * (-v2 - v0 + -v3 - v1 + v6 + v4 + 2 * c)) / (v2 - v0 + v3 - v1 + v4 - v6), + d2 - 0.5 - (F3_14 * (-v4 - v0 + -v5 - v1 + v6 + v2 + 2 * c)) / (v4 - v0 + v5 - v1 + v2 - v6), + ]); + break; + case 61: + a.push([d0 - 0.5 - (F1_6 * (v1 + v0 + -v7 - v6)) / (v0 - v1 + v7 - v6), d1 - 0.5 - (F1_6 * (-v3 - v1 + v6 + v4)) / (v3 - v1 + v4 - v6), d2 - 0.5 - (F1_6 * (-v5 - v1 + v6 + v2)) / (v5 - v1 + v2 - v6)]); + break; + case 62: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + -v7 - v6 + 4 * c)) / (v1 - v0 + v7 - v6), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v6 + v4)) / (v2 - v0 + v4 - v6), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v6 + v2)) / (v4 - v0 + v2 - v6), + ]); + break; + case 63: + a.push([ + d0 - F1_6 - (F1_6 * (-v7 - v6 + 2 * c)) / (v7 - v6), + d1 - F5_6 - (F1_6 * (v6 + v4 - 2 * c)) / (v4 - v6), + d2 - F5_6 - (F1_6 * (v6 + v2 - 2 * c)) / (v2 - v6), + ]); + break; + case 64: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 65: + a.push([ + d0 - F5_14 - (F1_14 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 66: + a.push([ + d0 - F9_14 - (F1_14 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 67: + a.push([d0 - 0.5, d1 - 0.5 - (0.25 * (v2 + v0 + v3 + v1 + -v6 - v4 + -v7 - v5)) / (v0 - v2 + v1 - v3 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.25 * (v4 + v0 + v5 + v1 + -v6 - v2 + -v7 - v3)) / (v0 - v4 + v1 - v5 + v6 - v2 + v7 - v3)]); + break; + case 68: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.7 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 69: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3), + ]); + break; + case 70: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (0.25 * (-v2 - v0 + v3 + v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v2 - v0 + v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 71: + a.push([ + d0 - F9_14 - (F1_14 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - 0.5 - (F3_14 * (v3 + v1 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v1 - v3 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v7 - v3 - 2 * c)) / (v0 - v4 + v1 - v5 + v7 - v3), + ]); + break; + case 72: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.7 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 73: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (0.25 * (v2 + v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 4 * c)) / (v0 - v2 + v3 - v1 + v6 - v4 + v7 - v5), + d2 - 0.375 - (0.125 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 74: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), + d1 - 0.5 - (F1_6 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2), + ]); + break; + case 75: + a.push([ + d0 - F5_14 - (F1_14 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v6 - v4 + -v7 - v5 + 2 * c)) / (v0 - v2 + v6 - v4 + v7 - v5), + d2 - 0.5 - (F3_14 * (v4 + v0 + v5 + v1 + -v6 - v2 - 2 * c)) / (v0 - v4 + v1 - v5 + v6 - v2), + ]); + break; + case 76: + a.push([d0 - 0.5, d1 - 0.5 - (0.5 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + -v7 - v5 + 8 * c)) / (v2 - v0 + v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5]); + break; + case 77: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.3 - (0.3 * (-v3 - v1 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v3 - v1 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v4 + v0 - 2 * c)) / (v0 - v4)]); + break; + case 78: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.3 - (0.3 * (-v2 - v0 + -v6 - v4 + -v7 - v5 + 6 * c)) / (v2 - v0 + v6 - v4 + v7 - v5), d2 - 0.5 - (0.1 * (v5 + v1 - 2 * c)) / (v1 - v5)]); + break; + case 79: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v6 - v4 + -v7 - v5 + 4 * c)) / (v6 - v4 + v7 - v5), d2 - 0.75 - (0.25 * (v4 + v0 + v5 + v1 - 4 * c)) / (v0 - v4 + v1 - v5)]); + break; + case 80: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.7 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 81: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 82: + a.push([ + d0 - 0.625 - (0.125 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - 0.375 - (0.125 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (0.25 * (-v4 - v0 + v5 + v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v4 - v0 + v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 83: + a.push([ + d0 - F9_14 - (F1_14 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v7 - v5 - 2 * c)) / (v0 - v2 + v1 - v3 + v7 - v5), + d2 - 0.5 - (F3_14 * (v5 + v1 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v1 - v5 + v6 - v2 + v7 - v3), + ]); + break; + case 84: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 85: + a.push([d0 - 0.7 - (0.3 * (v1 + v0 + v3 + v2 + v5 + v4 - 6 * c)) / (v0 - v1 + v2 - v3 + v4 - v5), d1 - 0.5 - (0.1 * (-v7 - v5 + 2 * c)) / (v7 - v5), d2 - 0.5 - (0.1 * (-v7 - v3 + 2 * c)) / (v7 - v3)]); + break; + case 86: + a.push([ + d0 - F11_18 - (F1_6 * (-v1 - v0 + v3 + v2 + v5 + v4 - 2 * c)) / (v1 - v0 + v2 - v3 + v4 - v5), + d1 - F7_18 - (F1_6 * (-v2 - v0 + v3 + v1 + -v7 - v5 + 2 * c)) / (v2 - v0 + v1 - v3 + v7 - v5), + d2 - F7_18 - (F1_6 * (-v4 - v0 + v5 + v1 + -v7 - v3 + 2 * c)) / (v4 - v0 + v1 - v5 + v7 - v3), + ]); + break; + case 87: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 + v5 + v4 - 4 * c)) / (v2 - v3 + v4 - v5), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v7 - v5)) / (v1 - v3 + v7 - v5), + d2 - 0.5 - (F1_6 * (v5 + v1 + -v7 - v3)) / (v1 - v5 + v7 - v3), + ]); + break; + case 88: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2), + ]); + break; + case 89: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + -v3 - v2 + v5 + v4 - 2 * c)) / (v0 - v1 + v3 - v2 + v4 - v5), + d1 - 0.5 - (F3_14 * (v2 + v0 + -v3 - v1 + -v7 - v5 + 2 * c)) / (v0 - v2 + v3 - v1 + v7 - v5), + d2 - F5_14 - (F1_14 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 90: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + -v3 - v2 + v5 + v4 + 2 * c)) / (v1 - v0 + v3 - v2 + v4 - v5), + d1 - F5_14 - (F1_14 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - 0.5 - (F3_14 * (-v4 - v0 + v5 + v1 + -v6 - v2 + 2 * c)) / (v4 - v0 + v1 - v5 + v6 - v2), + ]); + break; + case 91: + a.push([d0 - 0.5 - (F1_6 * (-v3 - v2 + v5 + v4)) / (v3 - v2 + v4 - v5), d1 - 0.5 - (F1_6 * (v2 + v0 + -v7 - v5)) / (v0 - v2 + v7 - v5), d2 - 0.5 - (F1_6 * (v5 + v1 + -v6 - v2)) / (v1 - v5 + v6 - v2)]); + break; + case 92: + a.push([d0 - 0.5 - (0.1 * (v5 + v4 - 2 * c)) / (v4 - v5), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v7 - v5 + 6 * c)) / (v2 - v0 + v3 - v1 + v7 - v5), d2 - 0.5 - (0.1 * (-v4 - v0 + 2 * c)) / (v4 - v0)]); + break; + case 93: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v5 + v4 - 4 * c)) / (v0 - v1 + v4 - v5), d1 - 0.25 - (0.25 * (-v3 - v1 + -v7 - v5 + 4 * c)) / (v3 - v1 + v7 - v5), d2 - 0.5]); + break; + case 94: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v5 + v4)) / (v1 - v0 + v4 - v5), + d1 - F1_6 - (F1_6 * (-v2 - v0 + -v7 - v5 + 4 * c)) / (v2 - v0 + v7 - v5), + d2 - 0.5 - (F1_6 * (-v4 - v0 + v5 + v1)) / (v4 - v0 + v1 - v5), + ]); + break; + case 95: + a.push([ + d0 - F5_6 - (F1_6 * (v5 + v4 - 2 * c)) / (v4 - v5), + d1 - F1_6 - (F1_6 * (-v7 - v5 + 2 * c)) / (v7 - v5), + d2 - F5_6 - (F1_6 * (v5 + v1 - 2 * c)) / (v1 - v5), + ]); + break; + case 96: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.7 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 97: + a.push([ + d0 - 0.375 - (0.125 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - 0.375 - (0.125 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (0.25 * (v4 + v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 4 * c)) / (v0 - v4 + v5 - v1 + v6 - v2 + v7 - v3), + ]); + break; + case 98: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), + d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3), + ]); + break; + case 99: + a.push([ + d0 - F5_14 - (F1_14 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - 0.5 - (F3_14 * (v2 + v0 + v3 + v1 + -v6 - v4 - 2 * c)) / (v0 - v2 + v1 - v3 + v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v6 - v2 + -v7 - v3 + 2 * c)) / (v0 - v4 + v6 - v2 + v7 - v3), + ]); + break; + case 100: + a.push([ + d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3), + ]); + break; + case 101: + a.push([ + d0 - 0.5 - (F3_14 * (v1 + v0 + v3 + v2 + -v5 - v4 - 2 * c)) / (v0 - v1 + v2 - v3 + v5 - v4), + d1 - F5_14 - (F1_14 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - 0.5 - (F3_14 * (v4 + v0 + -v5 - v1 + -v7 - v3 + 2 * c)) / (v0 - v4 + v5 - v1 + v7 - v3), + ]); + break; + case 102: + a.push([ + d0 - 0.5 - (F3_14 * (-v1 - v0 + v3 + v2 + -v5 - v4 + 2 * c)) / (v1 - v0 + v2 - v3 + v5 - v4), + d1 - 0.5 - (F3_14 * (-v2 - v0 + v3 + v1 + -v6 - v4 + 2 * c)) / (v2 - v0 + v1 - v3 + v6 - v4), + d2 - F5_14 - (F1_14 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 103: + a.push([d0 - 0.5 - (F1_6 * (v3 + v2 + -v5 - v4)) / (v2 - v3 + v5 - v4), d1 - 0.5 - (F1_6 * (v3 + v1 + -v6 - v4)) / (v1 - v3 + v6 - v4), d2 - 0.5 - (F1_6 * (v4 + v0 + -v7 - v3)) / (v0 - v4 + v7 - v3)]); + break; + case 104: + a.push([ + d0 - 0.5 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 105: + a.push([ + d0 - F7_18 - (F1_6 * (v1 + v0 + -v3 - v2 + -v5 - v4 + 2 * c)) / (v0 - v1 + v3 - v2 + v5 - v4), + d1 - F7_18 - (F1_6 * (v2 + v0 + -v3 - v1 + -v6 - v4 + 2 * c)) / (v0 - v2 + v3 - v1 + v6 - v4), + d2 - F7_18 - (F1_6 * (v4 + v0 + -v5 - v1 + -v6 - v2 + 2 * c)) / (v0 - v4 + v5 - v1 + v6 - v2), + ]); + break; + case 106: + a.push([d0 - 0.3 - (0.3 * (-v1 - v0 + -v3 - v2 + -v5 - v4 + 6 * c)) / (v1 - v0 + v3 - v2 + v5 - v4), d1 - 0.5 - (0.1 * (-v6 - v4 + 2 * c)) / (v6 - v4), d2 - 0.5 - (0.1 * (-v6 - v2 + 2 * c)) / (v6 - v2)]); + break; + case 107: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + -v5 - v4 + 4 * c)) / (v3 - v2 + v5 - v4), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v6 - v4)) / (v0 - v2 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v6 - v2)) / (v0 - v4 + v6 - v2), + ]); + break; + case 108: + a.push([d0 - 0.5 - (0.1 * (-v5 - v4 + 2 * c)) / (v5 - v4), d1 - 0.3 - (0.3 * (-v2 - v0 + -v3 - v1 + -v6 - v4 + 6 * c)) / (v2 - v0 + v3 - v1 + v6 - v4), d2 - 0.5 - (0.1 * (-v5 - v1 + 2 * c)) / (v5 - v1)]); + break; + case 109: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v5 - v4)) / (v0 - v1 + v5 - v4), + d1 - F1_6 - (F1_6 * (-v3 - v1 + -v6 - v4 + 4 * c)) / (v3 - v1 + v6 - v4), + d2 - 0.5 - (F1_6 * (v4 + v0 + -v5 - v1)) / (v0 - v4 + v5 - v1), + ]); + break; + case 110: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v5 - v4 + 4 * c)) / (v1 - v0 + v5 - v4), d1 - 0.25 - (0.25 * (-v2 - v0 + -v6 - v4 + 4 * c)) / (v2 - v0 + v6 - v4), d2 - 0.5]); + break; + case 111: + a.push([ + d0 - F1_6 - (F1_6 * (-v5 - v4 + 2 * c)) / (v5 - v4), + d1 - F1_6 - (F1_6 * (-v6 - v4 + 2 * c)) / (v6 - v4), + d2 - F5_6 - (F1_6 * (v4 + v0 - 2 * c)) / (v0 - v4), + ]); + break; + case 112: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5 - (0.5 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + -v7 - v3 + 8 * c)) / (v4 - v0 + v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 113: + a.push([d0 - 0.5 - (0.1 * (v1 + v0 - 2 * c)) / (v0 - v1), d1 - 0.5 - (0.1 * (v2 + v0 - 2 * c)) / (v0 - v2), d2 - 0.3 - (0.3 * (-v5 - v1 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v5 - v1 + v6 - v2 + v7 - v3)]); + break; + case 114: + a.push([d0 - 0.5 - (0.1 * (-v1 - v0 + 2 * c)) / (v1 - v0), d1 - 0.5 - (0.1 * (v3 + v1 - 2 * c)) / (v1 - v3), d2 - 0.3 - (0.3 * (-v4 - v0 + -v6 - v2 + -v7 - v3 + 6 * c)) / (v4 - v0 + v6 - v2 + v7 - v3)]); + break; + case 115: + a.push([d0 - 0.5, d1 - 0.75 - (0.25 * (v2 + v0 + v3 + v1 - 4 * c)) / (v0 - v2 + v1 - v3), d2 - 0.25 - (0.25 * (-v6 - v2 + -v7 - v3 + 4 * c)) / (v6 - v2 + v7 - v3)]); + break; + case 116: + a.push([d0 - 0.5 - (0.1 * (v3 + v2 - 2 * c)) / (v2 - v3), d1 - 0.5 - (0.1 * (-v2 - v0 + 2 * c)) / (v2 - v0), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v7 - v3 + 6 * c)) / (v4 - v0 + v5 - v1 + v7 - v3)]); + break; + case 117: + a.push([d0 - 0.75 - (0.25 * (v1 + v0 + v3 + v2 - 4 * c)) / (v0 - v1 + v2 - v3), d1 - 0.5, d2 - 0.25 - (0.25 * (-v5 - v1 + -v7 - v3 + 4 * c)) / (v5 - v1 + v7 - v3)]); + break; + case 118: + a.push([ + d0 - 0.5 - (F1_6 * (-v1 - v0 + v3 + v2)) / (v1 - v0 + v2 - v3), + d1 - 0.5 - (F1_6 * (-v2 - v0 + v3 + v1)) / (v2 - v0 + v1 - v3), + d2 - F1_6 - (F1_6 * (-v4 - v0 + -v7 - v3 + 4 * c)) / (v4 - v0 + v7 - v3), + ]); + break; + case 119: + a.push([ + d0 - F5_6 - (F1_6 * (v3 + v2 - 2 * c)) / (v2 - v3), + d1 - F5_6 - (F1_6 * (v3 + v1 - 2 * c)) / (v1 - v3), + d2 - F1_6 - (F1_6 * (-v7 - v3 + 2 * c)) / (v7 - v3), + ]); + break; + case 120: + a.push([d0 - 0.5 - (0.1 * (-v3 - v2 + 2 * c)) / (v3 - v2), d1 - 0.5 - (0.1 * (-v3 - v1 + 2 * c)) / (v3 - v1), d2 - 0.3 - (0.3 * (-v4 - v0 + -v5 - v1 + -v6 - v2 + 6 * c)) / (v4 - v0 + v5 - v1 + v6 - v2)]); + break; + case 121: + a.push([ + d0 - 0.5 - (F1_6 * (v1 + v0 + -v3 - v2)) / (v0 - v1 + v3 - v2), + d1 - 0.5 - (F1_6 * (v2 + v0 + -v3 - v1)) / (v0 - v2 + v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + -v6 - v2 + 4 * c)) / (v5 - v1 + v6 - v2), + ]); + break; + case 122: + a.push([d0 - 0.25 - (0.25 * (-v1 - v0 + -v3 - v2 + 4 * c)) / (v1 - v0 + v3 - v2), d1 - 0.5, d2 - 0.25 - (0.25 * (-v4 - v0 + -v6 - v2 + 4 * c)) / (v4 - v0 + v6 - v2)]); + break; + case 123: + a.push([ + d0 - F1_6 - (F1_6 * (-v3 - v2 + 2 * c)) / (v3 - v2), + d1 - F5_6 - (F1_6 * (v2 + v0 - 2 * c)) / (v0 - v2), + d2 - F1_6 - (F1_6 * (-v6 - v2 + 2 * c)) / (v6 - v2), + ]); + break; + case 124: + a.push([d0 - 0.5, d1 - 0.25 - (0.25 * (-v2 - v0 + -v3 - v1 + 4 * c)) / (v2 - v0 + v3 - v1), d2 - 0.25 - (0.25 * (-v4 - v0 + -v5 - v1 + 4 * c)) / (v4 - v0 + v5 - v1)]); + break; + case 125: + a.push([ + d0 - F5_6 - (F1_6 * (v1 + v0 - 2 * c)) / (v0 - v1), + d1 - F1_6 - (F1_6 * (-v3 - v1 + 2 * c)) / (v3 - v1), + d2 - F1_6 - (F1_6 * (-v5 - v1 + 2 * c)) / (v5 - v1), + ]); + break; + case 126: + a.push([ + d0 - F1_6 - (F1_6 * (-v1 - v0 + 2 * c)) / (v1 - v0), + d1 - F1_6 - (F1_6 * (-v2 - v0 + 2 * c)) / (v2 - v0), + d2 - F1_6 - (F1_6 * (-v4 - v0 + 2 * c)) / (v4 - v0), + ]); + break; + case 127: + a.push([d0 - 0.5, d1 - 0.5, d2 - 0.5]); + break; } } - currentFunc.push("a.push([", vertexStr.join(), "]);", - "break;") - } - code.push("}},") - if(extraFuncs.length > 0) { - currentFunc.push("}}") - } - - //Create face function - var faceArgs = [] - for(var i=0; i<(1<<(dimension-1)); ++i) { - faceArgs.push("v" + i) - } - faceArgs.push("c0", "c1", "p0", "p1", "a", "b", "c") - code.push("cell:function cellFunc(", faceArgs.join(), "){") - - var facets = triangulateCube(dimension-1) - code.push("if(p0){b.push(", - facets.map(function(f) { - return "[" + f.map(function(v) { - return "v" + v - }) + "]" - }).join(), ")}else{b.push(", - facets.map(function(f) { - var e = f.slice() - e.reverse() - return "[" + e.map(function(v) { - return "v" + v - }) + "]" - }).join(), - ")}}});function ", funcName, "(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ", funcName, ";") - - for(var i=0; i= 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": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg1_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg2_", - "lvalue": false, - "rvalue": true, - "count": 1 - }, { - "name": "_inline_1_arg3_", - "lvalue": false, - "rvalue": true, - "count": 2 - }, { - "name": "_inline_1_arg4_", - "lvalue": false, - "rvalue": true, - "count": 1 - }], - "thisVars": [], - "localVars": ["_inline_1_da", "_inline_1_db"] - }, +},{"./main":628,"object-assign":476}],630:[function(_dereq_,module,exports){ +"use strict" + +function CWiseOp() { + return function(SS, a0, t0, p0, Y0, Y1) { + var s0 = SS[0], + t0p0 = t0[0], + index = [0], + q0 = t0p0 + p0 |= 0 + var i0 = 0, + d0s0 = t0p0 + for (i0 = 0; i0 < s0; ++i0) { + { + var da = a0[p0] - Y1 + var db = a0[p0 + q0] - Y1 + if (da >= 0 !== db >= 0) { + Y0.push(index[0] + 0.5 + (0.5 * (da + db)) / (da - db)) + } + } + p0 += d0s0 + ++index[0] + } + } +} + +//Generates a cwise operator +function generateCWiseOp() { + return CWiseOp() +} + +var compile = generateCWiseOp + +function thunk(compile) { + var CACHED = {} + return function zeroCrossings_cwise_thunk(array0, scalar2, scalar3) { + var t0 = array0.dtype, + r0 = array0.order, + type = [t0, r0.join()].join(), + proc = CACHED[type] + + if (!proc) { + CACHED[type] = proc = compile([t0, r0]) + } + + return proc(array0.shape.slice(0), array0.data, array0.stride, array0.offset | 0, scalar2, scalar3) + } +} + +function createThunk(proc) { + return thunk(compile.bind(undefined, proc)) +} + +function compileCwise(user_args) { + return createThunk({ + funcName: user_args.funcName + }) +} + +module.exports = compileCwise({ funcName: 'zeroCrossings' }) -},{"cwise-compiler":157}],647:[function(_dereq_,module,exports){ +},{}],631:[function(_dereq_,module,exports){ "use strict" module.exports = findZeroCrossings @@ -139998,7 +141419,7 @@ function findZeroCrossings(array, level) { core(array.hi(array.shape[0]-1), cross, level) return cross } -},{"./lib/zc-core":646}],648:[function(_dereq_,module,exports){ +},{"./lib/zc-core":630}],632:[function(_dereq_,module,exports){ 'use strict'; /** @@ -140061,7 +141482,7 @@ module.exports = [ } ]; -},{}],649:[function(_dereq_,module,exports){ +},{}],633:[function(_dereq_,module,exports){ 'use strict'; var ARROWPATHS = _dereq_('./arrow_paths'); @@ -140349,7 +141770,7 @@ module.exports = templatedArray('annotation', { } }); -},{"../../constants/axis_placeable_objects":772,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861,"../../plots/font_attributes":883,"./arrow_paths":648}],650:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":756,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845,"../../plots/font_attributes":867,"./arrow_paths":632}],634:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140431,7 +141852,7 @@ function calcAxisExpansion(ann, ax) { ann._extremes[axId] = extremes; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./draw":655}],651:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./draw":639}],635:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140561,7 +141982,7 @@ function clickData2r(d, ax) { return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d); } -},{"../../lib":803,"../../plot_api/plot_template":843,"../../registry":931}],652:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../registry":915}],636:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140632,7 +142053,7 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo coerce('captureevents', !!hoverText); }; -},{"../../lib":803,"../color":666}],653:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650}],637:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -140686,7 +142107,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":831,"fast-isnumeric":249}],654:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":815,"fast-isnumeric":246}],638:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -140785,7 +142206,7 @@ function handleAnnotationDefaults(annIn, annOut, fullLayout) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"./attributes":649,"./common_defaults":652}],655:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"./attributes":633,"./common_defaults":636}],639:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -141538,7 +142959,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) { } else annText.call(textLayout); } -},{"../../lib":803,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plot_api/plot_template":843,"../../plots/cartesian/axes":854,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../fx":706,"./draw_arrow_head":656,"@plotly/d3":58}],656:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plot_api/plot_template":827,"../../plots/cartesian/axes":838,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../fx":690,"./draw_arrow_head":640,"@plotly/d3":58}],640:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -141685,7 +143106,7 @@ module.exports = function drawArrowHead(el3, ends, options) { if(doEnd) drawhead(headStyle, end, endRot, scale); }; -},{"../../lib":803,"../color":666,"./arrow_paths":648,"@plotly/d3":58}],657:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"./arrow_paths":632,"@plotly/d3":58}],641:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -141710,7 +143131,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":867,"./attributes":649,"./calc_autorange":650,"./click":651,"./convert_coords":653,"./defaults":654,"./draw":655}],658:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":851,"./attributes":633,"./calc_autorange":634,"./click":635,"./convert_coords":637,"./defaults":638,"./draw":639}],642:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -141779,7 +143200,7 @@ module.exports = overrideAll(templatedArray('annotation', { // zref: 'z' }), 'calc', 'from-root'); -},{"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../annotations/attributes":649}],659:[function(_dereq_,module,exports){ +},{"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../annotations/attributes":633}],643:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -141836,7 +143257,7 @@ function mockAnnAxes(ann, scene) { }; } -},{"../../lib":803,"../../plots/cartesian/axes":854}],660:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838}],644:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -141904,7 +143325,7 @@ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"../annotations/common_defaults":652,"./attributes":658}],661:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"../annotations/common_defaults":636,"./attributes":642}],645:[function(_dereq_,module,exports){ 'use strict'; var drawRaw = _dereq_('../annotations/draw').drawRaw; @@ -141948,7 +143369,7 @@ module.exports = function draw(scene) { } }; -},{"../../plots/gl3d/project":905,"../annotations/draw":655}],662:[function(_dereq_,module,exports){ +},{"../../plots/gl3d/project":889,"../annotations/draw":639}],646:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -141988,7 +143409,7 @@ function includeGL3D(layoutIn, layoutOut) { } } -},{"../../lib":803,"../../registry":931,"./attributes":658,"./convert":659,"./defaults":660,"./draw":661}],663:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./attributes":642,"./convert":643,"./defaults":644,"./draw":645}],647:[function(_dereq_,module,exports){ 'use strict'; // a trimmed down version of: @@ -142013,7 +143434,7 @@ _dereq_('world-calendars/dist/calendars/taiwan'); _dereq_('world-calendars/dist/calendars/thai'); _dereq_('world-calendars/dist/calendars/ummalqura'); -},{"world-calendars/dist/calendars/chinese":630,"world-calendars/dist/calendars/coptic":631,"world-calendars/dist/calendars/discworld":632,"world-calendars/dist/calendars/ethiopian":633,"world-calendars/dist/calendars/hebrew":634,"world-calendars/dist/calendars/islamic":635,"world-calendars/dist/calendars/julian":636,"world-calendars/dist/calendars/mayan":637,"world-calendars/dist/calendars/nanakshahi":638,"world-calendars/dist/calendars/nepali":639,"world-calendars/dist/calendars/persian":640,"world-calendars/dist/calendars/taiwan":641,"world-calendars/dist/calendars/thai":642,"world-calendars/dist/calendars/ummalqura":643,"world-calendars/dist/main":644,"world-calendars/dist/plus":645}],664:[function(_dereq_,module,exports){ +},{"world-calendars/dist/calendars/chinese":614,"world-calendars/dist/calendars/coptic":615,"world-calendars/dist/calendars/discworld":616,"world-calendars/dist/calendars/ethiopian":617,"world-calendars/dist/calendars/hebrew":618,"world-calendars/dist/calendars/islamic":619,"world-calendars/dist/calendars/julian":620,"world-calendars/dist/calendars/mayan":621,"world-calendars/dist/calendars/nanakshahi":622,"world-calendars/dist/calendars/nepali":623,"world-calendars/dist/calendars/persian":624,"world-calendars/dist/calendars/taiwan":625,"world-calendars/dist/calendars/thai":626,"world-calendars/dist/calendars/ummalqura":627,"world-calendars/dist/main":628,"world-calendars/dist/plus":629}],648:[function(_dereq_,module,exports){ 'use strict'; var calendars = _dereq_('./calendars'); @@ -142279,7 +143700,7 @@ module.exports = { worldCalFmt: worldCalFmt }; -},{"../../constants/numerical":779,"../../lib":803,"./calendars":663}],665:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"./calendars":647}],649:[function(_dereq_,module,exports){ 'use strict'; @@ -142311,7 +143732,7 @@ exports.borderLine = '#BEC8D9'; // gives back exactly lightLine if the other colors are defaults. exports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4); -},{}],666:[function(_dereq_,module,exports){ +},{}],650:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -142477,7 +143898,7 @@ function cleanOne(val) { return 'rgb(' + rgbStr + ')'; } -},{"../../lib/array":785,"./attributes":665,"fast-isnumeric":249,"tinycolor2":598}],667:[function(_dereq_,module,exports){ +},{"../../lib/array":769,"./attributes":649,"fast-isnumeric":246,"tinycolor2":583}],651:[function(_dereq_,module,exports){ 'use strict'; var axesAttrs = _dereq_('../../plots/cartesian/layout_attributes'); @@ -142624,7 +144045,7 @@ module.exports = overrideAll({ } }, 'colorbars', 'from-root'); -},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/cartesian/layout_attributes":869,"../../plots/font_attributes":883}],668:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/cartesian/layout_attributes":853,"../../plots/font_attributes":867}],652:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -142644,7 +144065,7 @@ module.exports = { } }; -},{}],669:[function(_dereq_,module,exports){ +},{}],653:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -142714,7 +144135,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) { coerce('title.side'); }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/cartesian/tick_label_defaults":876,"../../plots/cartesian/tick_mark_defaults":877,"../../plots/cartesian/tick_value_defaults":878,"./attributes":667}],670:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/cartesian/tick_label_defaults":860,"../../plots/cartesian/tick_mark_defaults":861,"../../plots/cartesian/tick_value_defaults":862,"./attributes":651}],654:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -143441,7 +144862,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":771,"../../lib":803,"../../lib/extend":793,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_defaults":856,"../../plots/cartesian/layout_attributes":869,"../../plots/cartesian/position_defaults":872,"../../plots/plots":917,"../../registry":931,"../color":666,"../colorscale/helpers":677,"../dragelement":685,"../drawing":688,"../titles":764,"./constants":668,"@plotly/d3":58,"tinycolor2":598}],671:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/extend":777,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_defaults":840,"../../plots/cartesian/layout_attributes":853,"../../plots/cartesian/position_defaults":856,"../../plots/plots":901,"../../registry":915,"../color":650,"../colorscale/helpers":661,"../dragelement":669,"../drawing":672,"../titles":748,"./constants":652,"@plotly/d3":58,"tinycolor2":583}],655:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -143451,7 +144872,7 @@ module.exports = function hasColorbar(container) { return Lib.isPlainObject(container.colorbar); }; -},{"../../lib":803}],672:[function(_dereq_,module,exports){ +},{"../../lib":787}],656:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -143465,7 +144886,7 @@ module.exports = { hasColorbar: _dereq_('./has_colorbar') }; -},{"./attributes":667,"./defaults":669,"./draw":670,"./has_colorbar":671}],673:[function(_dereq_,module,exports){ +},{"./attributes":651,"./defaults":653,"./draw":654,"./has_colorbar":655}],657:[function(_dereq_,module,exports){ 'use strict'; var colorbarAttrs = _dereq_('../colorbar/attributes'); @@ -143646,7 +145067,7 @@ module.exports = function colorScaleAttrs(context, opts) { return attrs; }; -},{"../../lib/regex":820,"../../lib/sort_object_keys":826,"../colorbar/attributes":667,"./scales.js":681}],674:[function(_dereq_,module,exports){ +},{"../../lib/regex":804,"../../lib/sort_object_keys":810,"../colorbar/attributes":651,"./scales.js":665}],658:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -143717,7 +145138,7 @@ module.exports = function calc(gd, trace, opts) { } }; -},{"../../lib":803,"./helpers":677,"fast-isnumeric":249}],675:[function(_dereq_,module,exports){ +},{"../../lib":787,"./helpers":661,"fast-isnumeric":246}],659:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -143786,7 +145207,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":803,"./helpers":677}],676:[function(_dereq_,module,exports){ +},{"../../lib":787,"./helpers":661}],660:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -143903,7 +145324,7 @@ module.exports = function colorScaleDefaults(parentContIn, parentContOut, layout } }; -},{"../../lib":803,"../../registry":931,"../colorbar/defaults":669,"../colorbar/has_colorbar":671,"./scales":681,"fast-isnumeric":249}],677:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../colorbar/defaults":653,"../colorbar/has_colorbar":655,"./scales":665,"fast-isnumeric":246}],661:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -144135,7 +145556,7 @@ module.exports = { makeColorScaleFuncFromTrace: makeColorScaleFuncFromTrace }; -},{"../../lib":803,"../color":666,"./scales":681,"@plotly/d3":58,"fast-isnumeric":249,"tinycolor2":598}],678:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"./scales":665,"@plotly/d3":58,"fast-isnumeric":246,"tinycolor2":583}],662:[function(_dereq_,module,exports){ 'use strict'; var scales = _dereq_('./scales'); @@ -144169,7 +145590,7 @@ module.exports = { makeColorScaleFuncFromTrace: helpers.makeColorScaleFuncFromTrace }; -},{"./attributes":673,"./calc":674,"./cross_trace_defaults":675,"./defaults":676,"./helpers":677,"./layout_attributes":679,"./layout_defaults":680,"./scales":681}],679:[function(_dereq_,module,exports){ +},{"./attributes":657,"./calc":658,"./cross_trace_defaults":659,"./defaults":660,"./helpers":661,"./layout_attributes":663,"./layout_defaults":664,"./scales":665}],663:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -144215,7 +145636,7 @@ module.exports = { })) }; -},{"../../lib/extend":793,"./attributes":673,"./scales":681}],680:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"./attributes":657,"./scales":665}],664:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -144258,7 +145679,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { } }; -},{"../../lib":803,"../../plot_api/plot_template":843,"./defaults":676,"./layout_attributes":679}],681:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"./defaults":660,"./layout_attributes":663}],665:[function(_dereq_,module,exports){ 'use strict'; var tinycolor = _dereq_('tinycolor2'); @@ -144454,7 +145875,7 @@ module.exports = { isValid: isValidScale }; -},{"tinycolor2":598}],682:[function(_dereq_,module,exports){ +},{"tinycolor2":583}],666:[function(_dereq_,module,exports){ 'use strict'; @@ -144478,7 +145899,7 @@ module.exports = function align(v, dv, v0, v1, anchor) { return vc; }; -},{}],683:[function(_dereq_,module,exports){ +},{}],667:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -144507,7 +145928,7 @@ module.exports = function getCursor(x, y, xanchor, yanchor) { return cursorset[y][x]; }; -},{"../../lib":803}],684:[function(_dereq_,module,exports){ +},{"../../lib":787}],668:[function(_dereq_,module,exports){ 'use strict'; exports.selectMode = function(dragmode) { @@ -144558,7 +145979,7 @@ exports.selectingOrDrawing = function(dragmode) { ); }; -},{}],685:[function(_dereq_,module,exports){ +},{}],669:[function(_dereq_,module,exports){ 'use strict'; var mouseOffset = _dereq_('mouse-event-offset'); @@ -144842,7 +146263,7 @@ function pointerOffset(e) { ); } -},{"../../lib":803,"../../plots/cartesian/constants":861,"./align":682,"./cursor":683,"./unhover":686,"has-hover":443,"has-passive-events":444,"mouse-event-offset":471}],686:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/constants":845,"./align":666,"./cursor":667,"./unhover":670,"has-hover":435,"has-passive-events":436,"mouse-event-offset":460}],670:[function(_dereq_,module,exports){ 'use strict'; var Events = _dereq_('../../lib/events'); @@ -144889,7 +146310,7 @@ unhover.raw = function raw(gd, evt) { } }; -},{"../../lib/dom":791,"../../lib/events":792,"../../lib/throttle":830,"../fx/constants":700}],687:[function(_dereq_,module,exports){ +},{"../../lib/dom":775,"../../lib/events":776,"../../lib/throttle":814,"../fx/constants":684}],671:[function(_dereq_,module,exports){ 'use strict'; exports.dash = { @@ -144951,7 +146372,7 @@ exports.pattern = { editType: 'style', }; -},{}],688:[function(_dereq_,module,exports){ +},{}],672:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -146395,7 +147816,7 @@ drawing.setTextPointsScale = function(selection, xScale, yScale) { }); }; -},{"../../components/fx/helpers":702,"../../constants/alignment":771,"../../constants/interactions":778,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../lib/svg_text_utils":829,"../../registry":931,"../../traces/scatter/make_bubble_size_func":1235,"../../traces/scatter/subtypes":1243,"../color":666,"../colorscale":678,"./symbol_defs":689,"@plotly/d3":58,"fast-isnumeric":249,"tinycolor2":598}],689:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":686,"../../constants/alignment":755,"../../constants/interactions":762,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../lib/svg_text_utils":813,"../../registry":915,"../../traces/scatter/make_bubble_size_func":1219,"../../traces/scatter/subtypes":1227,"../color":650,"../colorscale":662,"./symbol_defs":673,"@plotly/d3":58,"fast-isnumeric":246,"tinycolor2":583}],673:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -146950,7 +148371,7 @@ module.exports = { } }; -},{"@plotly/d3":58}],690:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],674:[function(_dereq_,module,exports){ 'use strict'; @@ -147033,7 +148454,7 @@ module.exports = { } }; -},{}],691:[function(_dereq_,module,exports){ +},{}],675:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -147111,7 +148532,7 @@ function calcOneAxis(calcTrace, trace, axis, coord) { baseExtremes.max = baseExtremes.max.concat(extremes.max); } -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./compute_error":692,"fast-isnumeric":249}],692:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./compute_error":676,"fast-isnumeric":246}],676:[function(_dereq_,module,exports){ 'use strict'; @@ -147203,7 +148624,7 @@ function makeComputeErrorValue(type, value) { } } -},{}],693:[function(_dereq_,module,exports){ +},{}],677:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -147270,7 +148691,7 @@ module.exports = function(traceIn, traceOut, defaultColor, opts) { } }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../registry":931,"./attributes":690,"fast-isnumeric":249}],694:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../registry":915,"./attributes":674,"fast-isnumeric":246}],678:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -147331,7 +148752,7 @@ function hoverInfo(calcPoint, trace, hoverPoint) { } } -},{"../../lib":803,"../../plot_api/edit_types":836,"./attributes":690,"./calc":691,"./compute_error":692,"./defaults":693,"./plot":695,"./style":696}],695:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/edit_types":820,"./attributes":674,"./calc":675,"./compute_error":676,"./defaults":677,"./plot":679,"./style":680}],679:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -147494,7 +148915,7 @@ function errorCoords(d, xa, ya) { return out; } -},{"../../traces/scatter/subtypes":1243,"../drawing":688,"@plotly/d3":58,"fast-isnumeric":249}],696:[function(_dereq_,module,exports){ +},{"../../traces/scatter/subtypes":1227,"../drawing":672,"@plotly/d3":58,"fast-isnumeric":246}],680:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -147522,7 +148943,7 @@ module.exports = function style(traces) { }); }; -},{"../color":666,"@plotly/d3":58}],697:[function(_dereq_,module,exports){ +},{"../color":650,"@plotly/d3":58}],681:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -147547,7 +148968,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/font_attributes":883,"./layout_attributes":707}],698:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/font_attributes":867,"./layout_attributes":691}],682:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -147598,7 +149019,7 @@ function paste(traceAttr, cd, cdAttr, fn) { } } -},{"../../lib":803,"../../registry":931}],699:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],683:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -147627,7 +149048,7 @@ module.exports = function click(gd, evt, subplot) { } }; -},{"../../registry":931,"./hover":703}],700:[function(_dereq_,module,exports){ +},{"../../registry":915,"./hover":687}],684:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -147651,7 +149072,7 @@ module.exports = { HOVERID: '-hover' }; -},{}],701:[function(_dereq_,module,exports){ +},{}],685:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -147669,7 +149090,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleHoverLabelDefaults(traceIn, traceOut, coerce, opts); }; -},{"../../lib":803,"./attributes":697,"./hoverlabel_defaults":704}],702:[function(_dereq_,module,exports){ +},{"../../lib":787,"./attributes":681,"./hoverlabel_defaults":688}],686:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -147923,7 +149344,7 @@ exports.isXYhover = function(hovermode) { return !!xyHoverMode[hovermode]; }; -},{"../../lib":803}],703:[function(_dereq_,module,exports){ +},{"../../lib":787}],687:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -148817,7 +150238,7 @@ function createHoverText(hoverData, opts) { var ya = c0.ya; var axLetter = hovermode.charAt(0); var t0 = c0[axLetter + 'Label']; - var outerContainerBB = outerContainer.getBoundingClientRect(); + var outerContainerBB = getBoundingClientRect(gd, outerContainer); var outerTop = outerContainerBB.top; var outerWidth = outerContainerBB.width; var outerHeight = outerContainerBB.height; @@ -148892,7 +150313,7 @@ function createHoverText(hoverData, opts) { label.attr('transform', ''); - var tbb = ltext.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, ltext.node()); var lx, ly; if(hovermode === 'x') { @@ -148985,7 +150406,7 @@ function createHoverText(hoverData, opts) { var dummy = Drawing.tester.append('text') .text(s.text()) .call(Drawing.font, commonLabelFont); - var dummyBB = dummy.node().getBoundingClientRect(); + var dummyBB = getBoundingClientRect(gd, dummy.node()); if(Math.round(dummyBB.width) < Math.round(tbb.width)) { s.attr('x', ltx - dummyBB.width); } @@ -149074,7 +150495,7 @@ function createHoverText(hoverData, opts) { // Position the hover var legendContainer = container.select('g.legend'); - var tbb = legendContainer.node().getBoundingClientRect(); + var tbb = getBoundingClientRect(gd, legendContainer.node()); var tWidth = tbb.width + 2 * HOVERTEXTPAD; var tHeight = tbb.height + 2 * HOVERTEXTPAD; var winningPoint = hoverData[0]; @@ -149239,7 +150660,7 @@ function createHoverText(hoverData, opts) { .call(svgTextUtils.positionText, 0, 0) .call(svgTextUtils.convertToTspans, gd); - var t2bb = tx2.node().getBoundingClientRect(); + var t2bb = getBoundingClientRect(gd, tx2.node()); tx2width = t2bb.width + 2 * HOVERTEXTPAD; tx2height = t2bb.height + 2 * HOVERTEXTPAD; } else { @@ -149252,22 +150673,26 @@ function createHoverText(hoverData, opts) { stroke: contrastColor }); - var tbb = tx.node().getBoundingClientRect(); var htx = d.xa._offset + (d.x0 + d.x1) / 2; var hty = d.ya._offset + (d.y0 + d.y1) / 2; var dx = Math.abs(d.x1 - d.x0); var dy = Math.abs(d.y1 - d.y0); - var txTotalWidth = tbb.width + HOVERARROWSIZE + HOVERTEXTPAD + tx2width; - var anchorStartOK, anchorEndOK; - d.ty0 = outerTop - tbb.top; - d.bx = tbb.width + 2 * HOVERTEXTPAD; - d.by = Math.max(tbb.height + 2 * HOVERTEXTPAD, tx2height); + var tbb = getBoundingClientRect(gd, tx.node()); + var tbbWidth = tbb.width / fullLayout._invScaleX; + var tbbHeight = tbb.height / fullLayout._invScaleY; + + d.ty0 = (outerTop - tbb.top) / fullLayout._invScaleY; + d.bx = tbbWidth + 2 * HOVERTEXTPAD; + d.by = Math.max(tbbHeight + 2 * HOVERTEXTPAD, tx2height); d.anchor = 'start'; - d.txwidth = tbb.width; + d.txwidth = tbbWidth; d.tx2width = tx2width; d.offset = 0; + var txTotalWidth = (tbbWidth + HOVERARROWSIZE + HOVERTEXTPAD + tx2width) * fullLayout._invScaleX; + var anchorStartOK, anchorEndOK; + if(rotateLabels) { d.pos = htx; anchorStartOK = hty + dy / 2 + txTotalWidth <= outerHeight; @@ -150027,7 +151452,37 @@ function getCoord(axLetter, winningPoint, fullLayout) { function getTopOffset(gd) { return gd.offsetTop + gd.clientTop; } function getLeftOffset(gd) { return gd.offsetLeft + gd.clientLeft; } -},{"../../lib":803,"../../lib/events":792,"../../lib/override_cursor":814,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../legend/defaults":718,"../legend/draw":719,"./constants":700,"./helpers":702,"@plotly/d3":58,"fast-isnumeric":249,"tinycolor2":598}],704:[function(_dereq_,module,exports){ +function getBoundingClientRect(gd, node) { + var fullLayout = gd._fullLayout; + + var rect = node.getBoundingClientRect(); + + var x0 = rect.x; + var y0 = rect.y; + var x1 = x0 + rect.width; + var y1 = y0 + rect.height; + + var A = Lib.apply3DTransform(fullLayout._invTransform)(x0, y0); + var B = Lib.apply3DTransform(fullLayout._invTransform)(x1, y1); + + var Ax = A[0]; + var Ay = A[1]; + var Bx = B[0]; + var By = B[1]; + + return { + x: Ax, + y: Ay, + width: Bx - Ax, + height: By - Ay, + top: Math.min(Ay, By), + left: Math.min(Ax, Bx), + right: Math.max(Ax, Bx), + bottom: Math.max(Ay, By), + }; +} + +},{"../../lib":787,"../../lib/events":776,"../../lib/override_cursor":798,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../legend/defaults":702,"../legend/draw":703,"./constants":684,"./helpers":686,"@plotly/d3":58,"fast-isnumeric":246,"tinycolor2":583}],688:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150065,7 +151520,7 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts coerce('hoverlabel.align', opts.align); }; -},{"../../lib":803,"../color":666,"./helpers":702}],705:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"./helpers":686}],689:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150083,7 +151538,7 @@ module.exports = function handleHoverModeDefaults(layoutIn, layoutOut) { return coerce('hovermode'); }; -},{"../../lib":803,"./layout_attributes":707}],706:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":691}],690:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -150154,7 +151609,7 @@ function castHoverinfo(trace, fullLayout, ptNumber) { return Lib.castOption(trace, ptNumber, 'hoverinfo', _coerce); } -},{"../../lib":803,"../dragelement":685,"./attributes":697,"./calc":698,"./click":699,"./constants":700,"./defaults":701,"./helpers":702,"./hover":703,"./layout_attributes":707,"./layout_defaults":708,"./layout_global_defaults":709,"@plotly/d3":58}],707:[function(_dereq_,module,exports){ +},{"../../lib":787,"../dragelement":669,"./attributes":681,"./calc":682,"./click":683,"./constants":684,"./defaults":685,"./helpers":686,"./hover":687,"./layout_attributes":691,"./layout_defaults":692,"./layout_global_defaults":693,"@plotly/d3":58}],691:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -150242,7 +151697,7 @@ module.exports = { } }; -},{"../../plots/font_attributes":883,"./constants":700}],708:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":867,"./constants":684}],692:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150281,7 +151736,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":803,"./hoverlabel_defaults":704,"./hovermode_defaults":705,"./layout_attributes":707}],709:[function(_dereq_,module,exports){ +},{"../../lib":787,"./hoverlabel_defaults":688,"./hovermode_defaults":689,"./layout_attributes":691}],693:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150296,7 +151751,7 @@ module.exports = function supplyLayoutGlobalDefaults(layoutIn, layoutOut) { handleHoverLabelDefaults(layoutIn, layoutOut, coerce); }; -},{"../../lib":803,"./hoverlabel_defaults":704,"./layout_attributes":707}],710:[function(_dereq_,module,exports){ +},{"../../lib":787,"./hoverlabel_defaults":688,"./layout_attributes":691}],694:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150639,7 +152094,7 @@ module.exports = { contentDefaults: contentDefaults }; -},{"../../lib":803,"../../lib/regex":820,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861,"../../plots/domain":882}],711:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/regex":804,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845,"../../plots/domain":866}],695:[function(_dereq_,module,exports){ 'use strict'; var cartesianConstants = _dereq_('../../plots/cartesian/constants'); @@ -150741,7 +152196,7 @@ module.exports = templatedArray('image', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":772,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861}],712:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":756,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845}],696:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -150813,7 +152268,7 @@ module.exports = function convertCoords(gd, ax, newType, doExtra) { } }; -},{"../../lib/to_log_range":831,"fast-isnumeric":249}],713:[function(_dereq_,module,exports){ +},{"../../lib/to_log_range":815,"fast-isnumeric":246}],697:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -150870,7 +152325,7 @@ function imageDefaults(imageIn, imageOut, fullLayout) { return imageOut; } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"./attributes":711}],714:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"./attributes":695}],698:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -151120,7 +152575,7 @@ module.exports = function draw(gd) { } }; -},{"../../constants/xmlns_namespaces":780,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_ids":858,"../drawing":688,"@plotly/d3":58}],715:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":764,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_ids":842,"../drawing":672,"@plotly/d3":58}],699:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -151136,7 +152591,7 @@ module.exports = { convertCoords: _dereq_('./convert_coords') }; -},{"../../plots/cartesian/include_components":867,"./attributes":711,"./convert_coords":712,"./defaults":713,"./draw":714}],716:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":851,"./attributes":695,"./convert_coords":696,"./defaults":697,"./draw":698}],700:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -151262,7 +152717,7 @@ module.exports = { editType: 'legend' }; -},{"../../plots/font_attributes":883,"../color/attributes":665}],717:[function(_dereq_,module,exports){ +},{"../../plots/font_attributes":867,"../color/attributes":649}],701:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -151278,7 +152733,7 @@ module.exports = { itemGap: 5 }; -},{}],718:[function(_dereq_,module,exports){ +},{}],702:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -151411,7 +152866,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/layout_attributes":908,"../../registry":931,"./attributes":716,"./helpers":722}],719:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/layout_attributes":892,"../../registry":915,"./attributes":700,"./helpers":706}],703:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -152236,7 +153691,7 @@ function getYanchor(legendObj) { 'top'; } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/events":792,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"./constants":717,"./get_legend_data":720,"./handle_click":721,"./helpers":722,"./style":724,"@plotly/d3":58}],720:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/events":776,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"./constants":701,"./get_legend_data":704,"./handle_click":705,"./helpers":706,"./style":708,"@plotly/d3":58}],704:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -152412,7 +153867,7 @@ module.exports = function getLegendData(calcdata, opts) { return legendData; }; -},{"../../registry":931,"./helpers":722}],721:[function(_dereq_,module,exports){ +},{"../../registry":915,"./helpers":706}],705:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -152654,7 +154109,7 @@ module.exports = function handleClick(g, gd, numClicks) { } }; -},{"../../lib":803,"../../registry":931}],722:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],706:[function(_dereq_,module,exports){ 'use strict'; exports.isGrouped = function isGrouped(legendLayout) { @@ -152669,7 +154124,7 @@ exports.isReversed = function isReversed(legendLayout) { return (legendLayout.traceorder || '').indexOf('reversed') !== -1; }; -},{}],723:[function(_dereq_,module,exports){ +},{}],707:[function(_dereq_,module,exports){ 'use strict'; @@ -152684,7 +154139,7 @@ module.exports = { style: _dereq_('./style') }; -},{"./attributes":716,"./defaults":718,"./draw":719,"./style":724}],724:[function(_dereq_,module,exports){ +},{"./attributes":700,"./defaults":702,"./draw":703,"./style":708}],708:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -153371,7 +154826,7 @@ function dimAttr(v, dflt, max) { return v; } -},{"../../lib":803,"../../registry":931,"../../traces/pie/helpers":1197,"../../traces/pie/style_one":1203,"../../traces/scatter/subtypes":1243,"../color":666,"../colorscale/helpers":677,"../drawing":688,"./constants":717,"@plotly/d3":58}],725:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../../traces/pie/helpers":1181,"../../traces/pie/style_one":1187,"../../traces/scatter/subtypes":1227,"../color":650,"../colorscale/helpers":661,"../drawing":672,"./constants":701,"@plotly/d3":58}],709:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -153415,7 +154870,7 @@ module.exports = { } }; -},{"./constants":727}],726:[function(_dereq_,module,exports){ +},{"./constants":711}],710:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -154167,7 +155622,7 @@ function resetView(gd, subplotType) { Registry.call('_guiRelayout', gd, aObj); } -},{"../../fonts/ploticon":782,"../../lib":803,"../../plots/cartesian/axis_ids":858,"../../plots/plots":917,"../../registry":931,"../shapes/draw":750}],727:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":766,"../../lib":787,"../../plots/cartesian/axis_ids":842,"../../plots/plots":901,"../../registry":915,"../shapes/draw":734}],711:[function(_dereq_,module,exports){ 'use strict'; var modeBarButtons = _dereq_('./buttons'); @@ -154210,7 +155665,7 @@ module.exports = { foreButtons: foreButtons }; -},{"./buttons":726}],728:[function(_dereq_,module,exports){ +},{"./buttons":710}],712:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -154236,7 +155691,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('remove'); }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../color":666,"./attributes":725}],729:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../color":650,"./attributes":709}],713:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -154249,7 +155704,7 @@ module.exports = { manage: _dereq_('./manage') }; -},{"./attributes":725,"./defaults":728,"./manage":730}],730:[function(_dereq_,module,exports){ +},{"./attributes":709,"./defaults":712,"./manage":714}],714:[function(_dereq_,module,exports){ 'use strict'; var axisIds = _dereq_('../../plots/cartesian/axis_ids'); @@ -154604,7 +156059,7 @@ function fillCustomButton(customButtons) { return customButtons; } -},{"../../plots/cartesian/axis_ids":858,"../../registry":931,"../../traces/scatter/subtypes":1243,"../fx/helpers":702,"./buttons":726,"./constants":727,"./modebar":731}],731:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axis_ids":842,"../../registry":915,"../../traces/scatter/subtypes":1227,"../fx/helpers":686,"./buttons":710,"./constants":711,"./modebar":715}],715:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -154941,7 +156396,7 @@ function createModeBar(gd, buttons) { module.exports = createModeBar; -},{"../../fonts/ploticon":782,"../../lib":803,"@plotly/d3":58,"fast-isnumeric":249}],732:[function(_dereq_,module,exports){ +},{"../../fonts/ploticon":766,"../../lib":787,"@plotly/d3":58,"fast-isnumeric":246}],716:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -155039,7 +156494,7 @@ module.exports = { editType: 'plot' }; -},{"../../plot_api/plot_template":843,"../../plots/font_attributes":883,"../color/attributes":665}],733:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":827,"../../plots/font_attributes":867,"../color/attributes":649}],717:[function(_dereq_,module,exports){ 'use strict'; @@ -155060,7 +156515,7 @@ module.exports = { darkAmount: 10 }; -},{}],734:[function(_dereq_,module,exports){ +},{}],718:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -155144,7 +156599,7 @@ function getPosDflt(containerOut, layout, counterAxes) { return [containerOut.domain[0], posY + constants.yPad]; } -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../color":666,"./attributes":732,"./constants":733}],735:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../color":650,"./attributes":716,"./constants":717}],719:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -155391,7 +156846,7 @@ function reposition(gd, buttons, opts, axName, selector) { selector.attr('transform', strTranslate(lx, ly)); } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axis_ids":858,"../../plots/plots":917,"../../registry":931,"../color":666,"../drawing":688,"./constants":733,"./get_update_object":736,"@plotly/d3":58}],736:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axis_ids":842,"../../plots/plots":901,"../../registry":915,"../color":650,"../drawing":672,"./constants":717,"./get_update_object":720,"@plotly/d3":58}],720:[function(_dereq_,module,exports){ 'use strict'; var d3Time = _dereq_('d3-time'); @@ -155440,7 +156895,7 @@ function getXRange(axisLayout, buttonLayout) { return [range0, range1]; } -},{"../../lib":803,"d3-time":177}],737:[function(_dereq_,module,exports){ +},{"../../lib":787,"d3-time":174}],721:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -155459,7 +156914,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":732,"./defaults":734,"./draw":735}],738:[function(_dereq_,module,exports){ +},{"./attributes":716,"./defaults":718,"./draw":719}],722:[function(_dereq_,module,exports){ 'use strict'; var colorAttributes = _dereq_('../color/attributes'); @@ -155511,7 +156966,7 @@ module.exports = { editType: 'calc' }; -},{"../color/attributes":665}],739:[function(_dereq_,module,exports){ +},{"../color/attributes":649}],723:[function(_dereq_,module,exports){ 'use strict'; var listAxes = _dereq_('../../plots/cartesian/axis_ids').list; @@ -155537,7 +156992,7 @@ module.exports = function calcAutorange(gd) { } }; -},{"../../plots/cartesian/autorange":853,"../../plots/cartesian/axis_ids":858,"./constants":740}],740:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/autorange":837,"../../plots/cartesian/axis_ids":842,"./constants":724}],724:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -155585,7 +157040,7 @@ module.exports = { extraPad: 15 }; -},{}],741:[function(_dereq_,module,exports){ +},{}],725:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -155663,7 +157118,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName) { containerOut._input = containerIn; }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_ids":858,"./attributes":738,"./oppaxis_attributes":745}],742:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_ids":842,"./attributes":722,"./oppaxis_attributes":729}],726:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -156299,7 +157754,7 @@ function drawGrabbers(rangeSlider, gd, axisOpts, opts) { grabAreaMax.attr('height', opts._height); } -},{"../../lib":803,"../../lib/setcursor":824,"../../plots/cartesian":868,"../../plots/cartesian/axis_ids":858,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../titles":764,"./constants":740,"@plotly/d3":58}],743:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/setcursor":808,"../../plots/cartesian":852,"../../plots/cartesian/axis_ids":842,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../titles":748,"./constants":724,"@plotly/d3":58}],727:[function(_dereq_,module,exports){ 'use strict'; var axisIDs = _dereq_('../../plots/cartesian/axis_ids'); @@ -156366,7 +157821,7 @@ exports.autoMarginOpts = function(gd, ax) { }; }; -},{"../../constants/alignment":771,"../../lib/svg_text_utils":829,"../../plots/cartesian/axis_ids":858,"./constants":740}],744:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib/svg_text_utils":813,"../../plots/cartesian/axis_ids":842,"./constants":724}],728:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -156397,7 +157852,7 @@ module.exports = { autoMarginOpts: helpers.autoMarginOpts }; -},{"../../lib":803,"./attributes":738,"./calc_autorange":739,"./defaults":741,"./draw":742,"./helpers":743,"./oppaxis_attributes":745}],745:[function(_dereq_,module,exports){ +},{"../../lib":787,"./attributes":722,"./calc_autorange":723,"./defaults":725,"./draw":726,"./helpers":727,"./oppaxis_attributes":729}],729:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -156423,7 +157878,7 @@ module.exports = { editType: 'calc' }; -},{}],746:[function(_dereq_,module,exports){ +},{}],730:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../annotations/attributes'); @@ -156533,7 +157988,7 @@ module.exports = templatedArray('shape', { editType: 'arraydraw' }); -},{"../../constants/axis_placeable_objects":772,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../traces/scatter/attributes":1218,"../annotations/attributes":649,"../drawing/attributes":687}],747:[function(_dereq_,module,exports){ +},{"../../constants/axis_placeable_objects":756,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../traces/scatter/attributes":1202,"../annotations/attributes":633,"../drawing/attributes":671}],731:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -156645,7 +158100,7 @@ function shapeBounds(ax, v0, v1, path, paramsToUse) { if(max >= min) return [min, max]; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./constants":748,"./helpers":757}],748:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./constants":732,"./helpers":741}],732:[function(_dereq_,module,exports){ 'use strict'; @@ -156700,7 +158155,7 @@ module.exports = { } }; -},{}],749:[function(_dereq_,module,exports){ +},{}],733:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -156822,7 +158277,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"./attributes":746,"./helpers":757}],750:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"./attributes":730,"./helpers":741}],734:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -157587,7 +159042,7 @@ function eraseActiveShape(gd) { } } -},{"../../lib":803,"../../lib/setcursor":824,"../../plot_api/plot_template":843,"../../plots/cartesian/axes":854,"../../plots/cartesian/handle_outline":865,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"./constants":748,"./draw_newshape/display_outlines":754,"./draw_newshape/helpers":755,"./helpers":757}],751:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/setcursor":808,"../../plot_api/plot_template":827,"../../plots/cartesian/axes":838,"../../plots/cartesian/handle_outline":849,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"./constants":732,"./draw_newshape/display_outlines":738,"./draw_newshape/helpers":739,"./helpers":741}],735:[function(_dereq_,module,exports){ 'use strict'; var dash = _dereq_('../../drawing/attributes').dash; @@ -157663,7 +159118,7 @@ module.exports = { } }; -},{"../../../lib/extend":793,"../../drawing/attributes":687}],752:[function(_dereq_,module,exports){ +},{"../../../lib/extend":777,"../../drawing/attributes":671}],736:[function(_dereq_,module,exports){ 'use strict'; var CIRCLE_SIDES = 32; // should be divisible by 4 @@ -157679,7 +159134,7 @@ module.exports = { SQRT2: Math.sqrt(2) }; -},{}],753:[function(_dereq_,module,exports){ +},{}],737:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../color'); @@ -157702,7 +159157,7 @@ module.exports = function supplyDrawNewShapeDefaults(layoutIn, layoutOut, coerce coerce('activeshape.opacity'); }; -},{"../../color":666}],754:[function(_dereq_,module,exports){ +},{"../../color":650}],738:[function(_dereq_,module,exports){ 'use strict'; var dragElement = _dereq_('../../dragelement'); @@ -157988,7 +159443,7 @@ function recordPositions(polygonsOut, polygonsIn) { return polygonsOut; } -},{"../../../plots/cartesian/handle_outline":865,"../../../registry":931,"../../dragelement":685,"../../dragelement/helpers":684,"./constants":752,"./helpers":755,"./newshapes":756}],755:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":849,"../../../registry":915,"../../dragelement":669,"../../dragelement/helpers":668,"./constants":736,"./helpers":739,"./newshapes":740}],739:[function(_dereq_,module,exports){ 'use strict'; var parseSvgPath = _dereq_('parse-svg-path'); @@ -158317,7 +159772,7 @@ exports.ellipseOver = function(pos) { }; }; -},{"../../../plots/cartesian/helpers":866,"./constants":752,"parse-svg-path":493}],756:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/helpers":850,"./constants":736,"parse-svg-path":482}],740:[function(_dereq_,module,exports){ 'use strict'; var dragHelpers = _dereq_('../../dragelement/helpers'); @@ -158567,7 +160022,7 @@ function fixDatesForPaths(polygons, xaxis, yaxis) { return polygons; } -},{"../../../plots/cartesian/handle_outline":865,"../../../plots/cartesian/helpers":866,"../../dragelement/helpers":684,"./constants":752,"./helpers":755}],757:[function(_dereq_,module,exports){ +},{"../../../plots/cartesian/handle_outline":849,"../../../plots/cartesian/helpers":850,"../../dragelement/helpers":668,"./constants":736,"./helpers":739}],741:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -158716,7 +160171,7 @@ exports.makeOptionsAndPlotinfo = function(gd, index) { }; }; -},{"../../lib":803,"./constants":748}],758:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constants":732}],742:[function(_dereq_,module,exports){ 'use strict'; var drawModule = _dereq_('./draw'); @@ -158735,7 +160190,7 @@ module.exports = { drawOne: drawModule.drawOne }; -},{"../../plots/cartesian/include_components":867,"./attributes":746,"./calc_autorange":747,"./defaults":749,"./draw":750,"./draw_newshape/defaults":753}],759:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/include_components":851,"./attributes":730,"./calc_autorange":731,"./defaults":733,"./draw":734,"./draw_newshape/defaults":737}],743:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -158909,7 +160364,7 @@ module.exports = overrideAll(templatedArray('slider', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/animation_attributes":848,"../../plots/font_attributes":883,"../../plots/pad_attributes":916,"./constants":760}],760:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/animation_attributes":832,"../../plots/font_attributes":867,"../../plots/pad_attributes":900,"./constants":744}],744:[function(_dereq_,module,exports){ 'use strict'; @@ -158994,7 +160449,7 @@ module.exports = { currentValueInset: 0, }; -},{}],761:[function(_dereq_,module,exports){ +},{}],745:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -159101,7 +160556,7 @@ function stepDefaults(valueIn, valueOut) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"./attributes":759,"./constants":760}],762:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"./attributes":743,"./constants":744}],746:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -159735,7 +161190,7 @@ function drawRail(sliderGroup, sliderOpts) { ); } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_template":843,"../../plots/plots":917,"../color":666,"../drawing":688,"./constants":760,"@plotly/d3":58}],763:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_template":827,"../../plots/plots":901,"../color":650,"../drawing":672,"./constants":744,"@plotly/d3":58}],747:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -159750,7 +161205,7 @@ module.exports = { draw: _dereq_('./draw') }; -},{"./attributes":759,"./constants":760,"./defaults":761,"./draw":762}],764:[function(_dereq_,module,exports){ +},{"./attributes":743,"./constants":744,"./defaults":745,"./draw":746}],748:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -160009,7 +161464,7 @@ module.exports = { draw: draw }; -},{"../../constants/alignment":771,"../../constants/interactions":778,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"../color":666,"../drawing":688,"@plotly/d3":58,"fast-isnumeric":249}],765:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../constants/interactions":762,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"../color":650,"../drawing":672,"@plotly/d3":58,"fast-isnumeric":246}],749:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -160132,7 +161587,7 @@ module.exports = overrideAll(templatedArray('updatemenu', { } }), 'arraydraw', 'from-root'); -},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/font_attributes":883,"../../plots/pad_attributes":916,"../color/attributes":665}],766:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/font_attributes":867,"../../plots/pad_attributes":900,"../color/attributes":649}],750:[function(_dereq_,module,exports){ 'use strict'; @@ -160204,7 +161659,7 @@ module.exports = { } }; -},{}],767:[function(_dereq_,module,exports){ +},{}],751:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -160279,7 +161734,7 @@ function buttonDefaults(buttonIn, buttonOut) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"./attributes":765,"./constants":766}],768:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"./attributes":749,"./constants":750}],752:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -160921,9 +162376,9 @@ function removeAllButtons(gButton, newMenuIndexAttr) { .selectAll('g.' + constants.dropdownButtonClassName).remove(); } -},{"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_template":843,"../../plots/plots":917,"../color":666,"../drawing":688,"./constants":766,"./scrollbox":770,"@plotly/d3":58}],769:[function(_dereq_,module,exports){ -arguments[4][763][0].apply(exports,arguments) -},{"./attributes":765,"./constants":766,"./defaults":767,"./draw":768,"dup":763}],770:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_template":827,"../../plots/plots":901,"../color":650,"../drawing":672,"./constants":750,"./scrollbox":754,"@plotly/d3":58}],753:[function(_dereq_,module,exports){ +arguments[4][747][0].apply(exports,arguments) +},{"./attributes":749,"./constants":750,"./defaults":751,"./draw":752,"dup":747}],754:[function(_dereq_,module,exports){ 'use strict'; module.exports = ScrollBox; @@ -161380,7 +162835,7 @@ ScrollBox.prototype.setTranslate = function setTranslate(translateX, translateY) } }; -},{"../../lib":803,"../color":666,"../drawing":688,"@plotly/d3":58}],771:[function(_dereq_,module,exports){ +},{"../../lib":787,"../color":650,"../drawing":672,"@plotly/d3":58}],755:[function(_dereq_,module,exports){ 'use strict'; // fraction of some size to get to a named position @@ -161437,7 +162892,7 @@ module.exports = { } }; -},{}],772:[function(_dereq_,module,exports){ +},{}],756:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161460,7 +162915,7 @@ module.exports = { } }; -},{}],773:[function(_dereq_,module,exports){ +},{}],757:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161474,7 +162929,7 @@ module.exports = { } }; -},{}],774:[function(_dereq_,module,exports){ +},{}],758:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161482,7 +162937,7 @@ module.exports = { DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format' }; -},{}],775:[function(_dereq_,module,exports){ +},{}],759:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161512,7 +162967,7 @@ module.exports = { } }; -},{}],776:[function(_dereq_,module,exports){ +},{}],760:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161524,7 +162979,7 @@ module.exports = { longdashdot: [[0.5, 0.7, 0.8, 1], 10] }; -},{}],777:[function(_dereq_,module,exports){ +},{}],761:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161538,7 +162993,7 @@ module.exports = { x: '❌' }; -},{}],778:[function(_dereq_,module,exports){ +},{}],762:[function(_dereq_,module,exports){ 'use strict'; @@ -161553,7 +163008,7 @@ module.exports = { DESELECTDIM: 0.2 }; -},{}],779:[function(_dereq_,module,exports){ +},{}],763:[function(_dereq_,module,exports){ 'use strict'; @@ -161618,7 +163073,7 @@ module.exports = { MINUS_SIGN: '\u2212' }; -},{}],780:[function(_dereq_,module,exports){ +},{}],764:[function(_dereq_,module,exports){ 'use strict'; @@ -161633,7 +163088,7 @@ exports.svgAttrs = { 'xmlns:xlink': exports.xlink }; -},{}],781:[function(_dereq_,module,exports){ +},{}],765:[function(_dereq_,module,exports){ 'use strict'; exports.version = _dereq_('./version').version; @@ -161717,7 +163172,7 @@ exports.Fx = { exports.Snapshot = _dereq_('./snapshot'); exports.PlotSchema = _dereq_('./plot_api/plot_schema'); -},{"../build/plotcss":1,"./components/annotations":657,"./components/annotations3d":662,"./components/colorbar":672,"./components/colorscale":678,"./components/errorbars":694,"./components/fx":706,"./components/grid":710,"./components/images":715,"./components/legend":723,"./components/modebar":729,"./components/rangeselector":737,"./components/rangeslider":744,"./components/shapes":758,"./components/sliders":763,"./components/updatemenus":769,"./fonts/ploticon":782,"./locale-en":834,"./locale-en-us":833,"./plot_api":838,"./plot_api/plot_schema":842,"./plots/plots":917,"./registry":931,"./snapshot":936,"./traces/scatter":1230,"./version":1404,"native-promise-only":474}],782:[function(_dereq_,module,exports){ +},{"../build/plotcss":1,"./components/annotations":641,"./components/annotations3d":646,"./components/colorbar":656,"./components/colorscale":662,"./components/errorbars":678,"./components/fx":690,"./components/grid":694,"./components/images":699,"./components/legend":707,"./components/modebar":713,"./components/rangeselector":721,"./components/rangeslider":728,"./components/shapes":742,"./components/sliders":747,"./components/updatemenus":753,"./fonts/ploticon":766,"./locale-en":818,"./locale-en-us":817,"./plot_api":822,"./plot_api/plot_schema":826,"./plots/plots":901,"./registry":915,"./snapshot":920,"./traces/scatter":1214,"./version":1388,"native-promise-only":463}],766:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -161889,7 +163344,7 @@ module.exports = { } }; -},{}],783:[function(_dereq_,module,exports){ +},{}],767:[function(_dereq_,module,exports){ 'use strict'; @@ -161944,7 +163399,7 @@ exports.isBottomAnchor = function isBottomAnchor(opts) { ); }; -},{}],784:[function(_dereq_,module,exports){ +},{}],768:[function(_dereq_,module,exports){ 'use strict'; var modModule = _dereq_('./mod'); @@ -162177,7 +163632,7 @@ module.exports = { pathAnnulus: pathAnnulus }; -},{"./mod":810}],785:[function(_dereq_,module,exports){ +},{"./mod":794}],769:[function(_dereq_,module,exports){ 'use strict'; var isArray = Array.isArray; @@ -162319,7 +163774,7 @@ function _rowLength(z, fn, len0) { return 0; } -},{}],786:[function(_dereq_,module,exports){ +},{}],770:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -162343,7 +163798,7 @@ module.exports = function cleanNumber(v) { return BADNUM; }; -},{"../constants/numerical":779,"fast-isnumeric":249}],787:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"fast-isnumeric":246}],771:[function(_dereq_,module,exports){ 'use strict'; /** @@ -162363,7 +163818,7 @@ module.exports = function clearGlCanvases(gd) { } }; -},{}],788:[function(_dereq_,module,exports){ +},{}],772:[function(_dereq_,module,exports){ 'use strict'; /** @@ -162378,7 +163833,7 @@ module.exports = function clearResponsive(gd) { } }; -},{}],789:[function(_dereq_,module,exports){ +},{}],773:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -162823,7 +164278,7 @@ function validate(value, opts) { } exports.validate = validate; -},{"../components/color":666,"../components/colorscale/scales":681,"../constants/interactions":778,"../plots/attributes":850,"./array":785,"./mod":810,"./nested_property":811,"./regex":820,"fast-isnumeric":249,"tinycolor2":598}],790:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/colorscale/scales":665,"../constants/interactions":762,"../plots/attributes":834,"./array":769,"./mod":794,"./nested_property":795,"./regex":804,"fast-isnumeric":246,"tinycolor2":583}],774:[function(_dereq_,module,exports){ 'use strict'; var timeFormat = _dereq_('d3-time-format').timeFormat; @@ -163427,7 +164882,7 @@ exports.findExactDates = function(data, calendar) { }; }; -},{"../constants/numerical":779,"../registry":931,"./loggers":807,"./mod":810,"d3-time-format":175,"fast-isnumeric":249}],791:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"../registry":915,"./loggers":791,"./mod":794,"d3-time-format":172,"fast-isnumeric":246}],775:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -163597,7 +165052,7 @@ module.exports = { equalDomRects: equalDomRects }; -},{"./loggers":807,"./matrix":809,"@plotly/d3":58,"gl-mat4":298}],792:[function(_dereq_,module,exports){ +},{"./loggers":791,"./matrix":793,"@plotly/d3":58,"gl-mat4":292}],776:[function(_dereq_,module,exports){ 'use strict'; /* global jQuery:false */ @@ -163761,7 +165216,7 @@ var Events = { module.exports = Events; -},{"events":116}],793:[function(_dereq_,module,exports){ +},{"events":116}],777:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('./is_plain_object.js'); @@ -163866,7 +165321,7 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { return target; } -},{"./is_plain_object.js":804}],794:[function(_dereq_,module,exports){ +},{"./is_plain_object.js":788}],778:[function(_dereq_,module,exports){ 'use strict'; @@ -163908,7 +165363,7 @@ module.exports = function filterUnique(array) { return out; }; -},{}],795:[function(_dereq_,module,exports){ +},{}],779:[function(_dereq_,module,exports){ 'use strict'; /** Filter out object items with visible !== true @@ -163948,7 +165403,7 @@ function isCalcData(cont) { ); } -},{}],796:[function(_dereq_,module,exports){ +},{}],780:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -164325,7 +165780,7 @@ module.exports = { computeBbox: computeBbox }; -},{"./identity":801,"./is_plain_object":804,"./loggers":807,"./nested_property":811,"./polygon":815,"@plotly/d3":58,"@turf/area":61,"@turf/bbox":64,"@turf/centroid":67,"country-regex":145}],797:[function(_dereq_,module,exports){ +},{"./identity":785,"./is_plain_object":788,"./loggers":791,"./nested_property":795,"./polygon":799,"@plotly/d3":58,"@turf/area":61,"@turf/bbox":64,"@turf/centroid":67,"country-regex":145}],781:[function(_dereq_,module,exports){ 'use strict'; var BADNUM = _dereq_('../constants/numerical').BADNUM; @@ -164433,7 +165888,7 @@ exports.makeBlank = function() { }; }; -},{"../constants/numerical":779}],798:[function(_dereq_,module,exports){ +},{"../constants/numerical":763}],782:[function(_dereq_,module,exports){ 'use strict'; var mod = _dereq_('./mod').mod; @@ -164669,7 +166124,7 @@ exports.findPointOnPath = function findPointOnPath(path, val, coord, opts) { return pt; }; -},{"./mod":810}],799:[function(_dereq_,module,exports){ +},{"./mod":794}],783:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -164762,7 +166217,7 @@ module.exports = { parseColorScale: parseColorScale }; -},{"../components/color/attributes":665,"../components/colorscale":678,"./array":785,"color-normalize":131,"fast-isnumeric":249,"tinycolor2":598}],800:[function(_dereq_,module,exports){ +},{"../components/color/attributes":649,"../components/colorscale":662,"./array":769,"color-normalize":131,"fast-isnumeric":246,"tinycolor2":583}],784:[function(_dereq_,module,exports){ 'use strict'; var identity = _dereq_('./identity'); @@ -164790,7 +166245,7 @@ module.exports = { unwrap: function(d) {return d[0];} }; -},{"./identity":801}],801:[function(_dereq_,module,exports){ +},{"./identity":785}],785:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -164798,7 +166253,7 @@ module.exports = { module.exports = function identity(d) { return d; }; -},{}],802:[function(_dereq_,module,exports){ +},{}],786:[function(_dereq_,module,exports){ 'use strict'; module.exports = function incrementNumeric(x, delta) { @@ -164831,7 +166286,7 @@ module.exports = function incrementNumeric(x, delta) { return newX; }; -},{}],803:[function(_dereq_,module,exports){ +},{}],787:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -166219,7 +167674,7 @@ lib.getPositionFromD3Event = function() { } }; -},{"../constants/numerical":779,"./anchor_utils":783,"./angles":784,"./array":785,"./clean_number":786,"./clear_responsive":788,"./coerce":789,"./dates":790,"./dom":791,"./extend":793,"./filter_unique":794,"./filter_visible":795,"./geometry2d":798,"./identity":801,"./increment":802,"./is_plain_object":804,"./keyed_container":805,"./localize":806,"./loggers":807,"./make_trace_groups":808,"./matrix":809,"./mod":810,"./nested_property":811,"./noop":812,"./notifier":813,"./preserve_drawing_buffer":817,"./push_unique":818,"./regex":820,"./relative_attr":821,"./relink_private":822,"./search":823,"./sort_object_keys":826,"./stats":827,"./throttle":830,"./to_log_range":831,"@plotly/d3":58,"d3-format":167,"d3-time-format":175,"fast-isnumeric":249}],804:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"./anchor_utils":767,"./angles":768,"./array":769,"./clean_number":770,"./clear_responsive":772,"./coerce":773,"./dates":774,"./dom":775,"./extend":777,"./filter_unique":778,"./filter_visible":779,"./geometry2d":782,"./identity":785,"./increment":786,"./is_plain_object":788,"./keyed_container":789,"./localize":790,"./loggers":791,"./make_trace_groups":792,"./matrix":793,"./mod":794,"./nested_property":795,"./noop":796,"./notifier":797,"./preserve_drawing_buffer":801,"./push_unique":802,"./regex":804,"./relative_attr":805,"./relink_private":806,"./search":807,"./sort_object_keys":810,"./stats":811,"./throttle":814,"./to_log_range":815,"@plotly/d3":58,"d3-format":164,"d3-time-format":172,"fast-isnumeric":246}],788:[function(_dereq_,module,exports){ 'use strict'; // more info: http://stackoverflow.com/questions/18531624/isplainobject-thing @@ -166238,7 +167693,7 @@ module.exports = function isPlainObject(obj) { ); }; -},{}],805:[function(_dereq_,module,exports){ +},{}],789:[function(_dereq_,module,exports){ 'use strict'; var nestedProperty = _dereq_('./nested_property'); @@ -166423,7 +167878,7 @@ module.exports = function keyedContainer(baseObj, path, keyName, valueName) { return obj; }; -},{"./nested_property":811}],806:[function(_dereq_,module,exports){ +},{"./nested_property":795}],790:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -166470,7 +167925,7 @@ module.exports = function localize(gd, s) { return s; }; -},{"../registry":931}],807:[function(_dereq_,module,exports){ +},{"../registry":915}],791:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-console */ @@ -166547,7 +168002,7 @@ loggers.error = function() { } }; -},{"../plot_api/plot_config":841,"./notifier":813}],808:[function(_dereq_,module,exports){ +},{"../plot_api/plot_config":825,"./notifier":797}],792:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -166582,7 +168037,7 @@ module.exports = function makeTraceGroups(traceLayer, cdModule, cls) { return traces; }; -},{"@plotly/d3":58}],809:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],793:[function(_dereq_,module,exports){ 'use strict'; var mat4X4 = _dereq_('gl-mat4'); @@ -166725,7 +168180,7 @@ exports.inverseTransformMatrix = function(m) { ]; }; -},{"gl-mat4":298}],810:[function(_dereq_,module,exports){ +},{"gl-mat4":292}],794:[function(_dereq_,module,exports){ 'use strict'; /** @@ -166752,7 +168207,7 @@ module.exports = { modHalf: modHalf }; -},{}],811:[function(_dereq_,module,exports){ +},{}],795:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -166989,7 +168444,7 @@ function badContainer(container, propStr, propParts) { }; } -},{"./array":785,"fast-isnumeric":249}],812:[function(_dereq_,module,exports){ +},{"./array":769,"fast-isnumeric":246}],796:[function(_dereq_,module,exports){ 'use strict'; // Simple helper functions @@ -166997,7 +168452,7 @@ function badContainer(container, propStr, propParts) { module.exports = function noop() {}; -},{}],813:[function(_dereq_,module,exports){ +},{}],797:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -167076,7 +168531,7 @@ module.exports = function(text, displayLength) { }); }; -},{"@plotly/d3":58,"fast-isnumeric":249}],814:[function(_dereq_,module,exports){ +},{"@plotly/d3":58,"fast-isnumeric":246}],798:[function(_dereq_,module,exports){ 'use strict'; var setCursor = _dereq_('./setcursor'); @@ -167115,7 +168570,7 @@ module.exports = function overrideCursor(el3, csr) { } }; -},{"./setcursor":824}],815:[function(_dereq_,module,exports){ +},{"./setcursor":808}],799:[function(_dereq_,module,exports){ 'use strict'; var dot = _dereq_('./matrix').dot; @@ -167358,7 +168813,7 @@ polygon.filter = function filter(pts, tolerance) { }; }; -},{"../constants/numerical":779,"./matrix":809}],816:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"./matrix":793}],800:[function(_dereq_,module,exports){ (function (global){(function (){ 'use strict'; @@ -167424,7 +168879,7 @@ module.exports = function prepareRegl(gd, extensions) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./show_no_webgl_msg":825,"regl":540}],817:[function(_dereq_,module,exports){ +},{"./show_no_webgl_msg":809,"regl":526}],801:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -167486,7 +168941,7 @@ function getUserAgent() { return ua; } -},{"fast-isnumeric":249,"is-mobile":455}],818:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246,"is-mobile":445}],802:[function(_dereq_,module,exports){ 'use strict'; /** @@ -167516,7 +168971,7 @@ module.exports = function pushUnique(array, item) { return array; }; -},{}],819:[function(_dereq_,module,exports){ +},{}],803:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -167708,7 +169163,7 @@ queue.plotDo = function(gd, func, args) { module.exports = queue; -},{"../lib":803,"../plot_api/plot_config":841}],820:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_config":825}],804:[function(_dereq_,module,exports){ 'use strict'; /* @@ -167730,7 +169185,7 @@ exports.counter = function(head, tail, openEnded, matchBeginning) { return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail); }; -},{}],821:[function(_dereq_,module,exports){ +},{}],805:[function(_dereq_,module,exports){ 'use strict'; // ASCEND: chop off the last nesting level - either [] or . - to ascend @@ -167774,7 +169229,7 @@ module.exports = function(baseAttr, relativeAttr) { return baseAttr + relativeAttr; }; -},{}],822:[function(_dereq_,module,exports){ +},{}],806:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; @@ -167822,7 +169277,7 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) { } }; -},{"./array":785,"./is_plain_object":804}],823:[function(_dereq_,module,exports){ +},{"./array":769,"./is_plain_object":788}],807:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -168014,7 +169469,7 @@ exports.findIndexOfMin = function(arr, fn) { return ind; }; -},{"../constants/numerical":779,"./identity":801,"./loggers":807,"fast-isnumeric":249}],824:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"./identity":785,"./loggers":791,"fast-isnumeric":246}],808:[function(_dereq_,module,exports){ 'use strict'; // works with our CSS cursor classes (see css/_cursor.scss) @@ -168028,7 +169483,7 @@ module.exports = function setCursor(el3, csr) { if(csr) el3.classed('cursor-' + csr, true); }; -},{}],825:[function(_dereq_,module,exports){ +},{}],809:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../components/color'); @@ -168083,14 +169538,14 @@ module.exports = function showNoWebGlMsg(scene) { return false; }; -},{"../components/color":666}],826:[function(_dereq_,module,exports){ +},{"../components/color":650}],810:[function(_dereq_,module,exports){ 'use strict'; module.exports = function sortObjectKeys(obj) { return Object.keys(obj).sort(); }; -},{}],827:[function(_dereq_,module,exports){ +},{}],811:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -168191,7 +169646,7 @@ exports.interp = function(arr, n) { return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)]; }; -},{"./array":785,"fast-isnumeric":249}],828:[function(_dereq_,module,exports){ +},{"./array":769,"fast-isnumeric":246}],812:[function(_dereq_,module,exports){ 'use strict'; var rgba = _dereq_('color-normalize'); @@ -168203,7 +169658,7 @@ function str2RgbaArray(color) { module.exports = str2RgbaArray; -},{"color-normalize":131}],829:[function(_dereq_,module,exports){ +},{"color-normalize":131}],813:[function(_dereq_,module,exports){ 'use strict'; /* global MathJax:false */ @@ -169112,7 +170567,7 @@ exports.makeEditable = function(context, options) { return d3.rebind(context, dispatch, 'on'); }; -},{"../constants/alignment":771,"../constants/xmlns_namespaces":780,"../lib":803,"@plotly/d3":58}],830:[function(_dereq_,module,exports){ +},{"../constants/alignment":755,"../constants/xmlns_namespaces":764,"../lib":787,"@plotly/d3":58}],814:[function(_dereq_,module,exports){ 'use strict'; var timerCache = {}; @@ -169207,7 +170662,7 @@ function _clearTimeout(cache) { } } -},{}],831:[function(_dereq_,module,exports){ +},{}],815:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -169227,7 +170682,7 @@ module.exports = function toLogRange(val, range) { return newVal; }; -},{"fast-isnumeric":249}],832:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246}],816:[function(_dereq_,module,exports){ 'use strict'; var topojsonUtils = module.exports = {}; @@ -169253,7 +170708,7 @@ topojsonUtils.getTopojsonFeatures = function(trace, topojson) { return topojsonFeature(topojson, obj).features; }; -},{"../plots/geo/constants":885,"topojson-client":601}],833:[function(_dereq_,module,exports){ +},{"../plots/geo/constants":869,"topojson-client":586}],817:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -169267,7 +170722,7 @@ module.exports = { } }; -},{}],834:[function(_dereq_,module,exports){ +},{}],818:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -169302,7 +170757,7 @@ module.exports = { } }; -},{}],835:[function(_dereq_,module,exports){ +},{}],819:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -169351,7 +170806,7 @@ module.exports = function containerArrayMatch(astr) { return {array: arrayStr, index: Number(match[1]), property: match[3] || ''}; }; -},{"../registry":931}],836:[function(_dereq_,module,exports){ +},{"../registry":915}],820:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -169466,7 +170921,7 @@ function overrideOne(attr, editTypeOverride, overrideContainers, key) { } } -},{"../lib":803}],837:[function(_dereq_,module,exports){ +},{"../lib":787}],821:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -170160,7 +171615,7 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) { } }; -},{"../components/color":666,"../lib":803,"../plots/cartesian/axis_ids":858,"../plots/plots":917,"../registry":931,"fast-isnumeric":249,"gl-mat4/fromQuat":288}],838:[function(_dereq_,module,exports){ +},{"../components/color":650,"../lib":787,"../plots/cartesian/axis_ids":842,"../plots/plots":901,"../registry":915,"fast-isnumeric":246,"gl-mat4/fromQuat":282}],822:[function(_dereq_,module,exports){ 'use strict'; var main = _dereq_('./plot_api'); @@ -170195,7 +171650,7 @@ var templateApi = _dereq_('./template_api'); exports.makeTemplate = templateApi.makeTemplate; exports.validateTemplate = templateApi.validateTemplate; -},{"../snapshot/download":933,"./plot_api":840,"./template_api":845,"./to_image":846,"./validate":847}],839:[function(_dereq_,module,exports){ +},{"../snapshot/download":917,"./plot_api":824,"./template_api":829,"./to_image":830,"./validate":831}],823:[function(_dereq_,module,exports){ 'use strict'; var isPlainObject = _dereq_('../lib/is_plain_object'); @@ -170399,7 +171854,7 @@ exports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, return true; }; -},{"../lib/is_plain_object":804,"../lib/loggers":807,"../lib/noop":812,"../lib/search":823,"../registry":931,"./container_array_match":835}],840:[function(_dereq_,module,exports){ +},{"../lib/is_plain_object":788,"../lib/loggers":791,"../lib/noop":796,"../lib/search":807,"../registry":915,"./container_array_match":819}],824:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -174213,7 +175668,7 @@ exports._guiUpdate = guiEdit(update); exports._storeDirectGUIEdit = _storeDirectGUIEdit; -},{"../components/color":666,"../components/drawing":688,"../constants/xmlns_namespaces":780,"../lib":803,"../lib/events":792,"../lib/queue":819,"../plots/cartesian/axes":854,"../plots/cartesian/constants":861,"../plots/cartesian/graph_interact":864,"../plots/cartesian/select":874,"../plots/plots":917,"../registry":931,"./edit_types":836,"./helpers":837,"./manage_arrays":839,"./plot_config":841,"./plot_schema":842,"./subroutines":844,"@plotly/d3":58,"fast-isnumeric":249,"has-hover":443}],841:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/drawing":672,"../constants/xmlns_namespaces":764,"../lib":787,"../lib/events":776,"../lib/queue":803,"../plots/cartesian/axes":838,"../plots/cartesian/constants":845,"../plots/cartesian/graph_interact":848,"../plots/cartesian/select":858,"../plots/plots":901,"../registry":915,"./edit_types":820,"./helpers":821,"./manage_arrays":823,"./plot_config":825,"./plot_schema":826,"./subroutines":828,"@plotly/d3":58,"fast-isnumeric":246,"has-hover":435}],825:[function(_dereq_,module,exports){ 'use strict'; /** @@ -174474,7 +175929,7 @@ module.exports = { dfltConfig: dfltConfig }; -},{}],842:[function(_dereq_,module,exports){ +},{}],826:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -175139,7 +176594,7 @@ function insertAttrs(baseAttrs, newAttrs, astr) { np.set(extendDeepAll(np.get() || {}, newAttrs)); } -},{"../lib":803,"../plots/animation_attributes":848,"../plots/attributes":850,"../plots/frame_attributes":884,"../plots/layout_attributes":908,"../registry":931,"./edit_types":836,"./plot_config":841}],843:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/animation_attributes":832,"../plots/attributes":834,"../plots/frame_attributes":868,"../plots/layout_attributes":892,"../registry":915,"./edit_types":820,"./plot_config":825}],827:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -175438,7 +176893,7 @@ exports.arrayEditor = function(parentIn, containerStr, itemOut) { }; }; -},{"../lib":803,"../plots/attributes":850}],844:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/attributes":834}],828:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -176154,7 +177609,7 @@ exports.drawMarginPushers = function(gd) { Registry.getComponentMethod('colorbar', 'draw')(gd); }; -},{"../components/color":666,"../components/drawing":688,"../components/modebar":729,"../components/titles":764,"../constants/alignment":771,"../lib":803,"../lib/clear_gl_canvases":787,"../plots/cartesian/autorange":853,"../plots/cartesian/axes":854,"../plots/cartesian/constraints":862,"../plots/plots":917,"../registry":931,"@plotly/d3":58}],845:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/drawing":672,"../components/modebar":713,"../components/titles":748,"../constants/alignment":755,"../lib":787,"../lib/clear_gl_canvases":771,"../plots/cartesian/autorange":837,"../plots/cartesian/axes":838,"../plots/cartesian/constraints":846,"../plots/plots":901,"../registry":915,"@plotly/d3":58}],829:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -176607,7 +178062,7 @@ function format(opts) { return opts; } -},{"../lib":803,"../plots/attributes":850,"../plots/plots":917,"./plot_config":841,"./plot_schema":842,"./plot_template":843}],846:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/attributes":834,"../plots/plots":901,"./plot_config":825,"./plot_schema":826,"./plot_template":827}],830:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -176814,7 +178269,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":803,"../plots/plots":917,"../snapshot/helpers":935,"../snapshot/svgtoimg":937,"../snapshot/tosvg":939,"../version":1404,"./plot_api":840,"fast-isnumeric":249}],847:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/plots":901,"../snapshot/helpers":919,"../snapshot/svgtoimg":921,"../snapshot/tosvg":923,"../version":1388,"./plot_api":824,"fast-isnumeric":246}],831:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -177237,7 +178692,7 @@ function convertPathToAttributeString(path) { return astr; } -},{"../lib":803,"../plots/plots":917,"./plot_config":841,"./plot_schema":842}],848:[function(_dereq_,module,exports){ +},{"../lib":787,"../plots/plots":901,"./plot_config":825,"./plot_schema":826}],832:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -177325,7 +178780,7 @@ module.exports = { } }; -},{}],849:[function(_dereq_,module,exports){ +},{}],833:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -177412,7 +178867,7 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut return contOut; }; -},{"../lib":803,"../plot_api/plot_template":843}],850:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_template":827}],834:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -177534,7 +178989,7 @@ module.exports = { } }; -},{"../components/fx/attributes":697,"./font_attributes":883}],851:[function(_dereq_,module,exports){ +},{"../components/fx/attributes":681,"./font_attributes":867}],835:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -177629,7 +179084,7 @@ module.exports = function alignPeriod(trace, ax, axLetter, vals) { }; }; -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],852:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],836:[function(_dereq_,module,exports){ 'use strict'; @@ -177646,7 +179101,7 @@ module.exports = { } }; -},{}],853:[function(_dereq_,module,exports){ +},{}],837:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -178273,7 +179728,7 @@ function goodNumber(v) { function lessOrEqual(v0, v1) { return v0 <= v1; } function greaterOrEqual(v0, v1) { return v0 >= v1; } -},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../../registry":931,"./axis_ids":858,"@plotly/d3":58,"fast-isnumeric":249}],854:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../../registry":915,"./axis_ids":842,"@plotly/d3":58,"fast-isnumeric":246}],838:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -182115,7 +183570,7 @@ function hideCounterAxisInsideTickLabels(ax, opts) { } } -},{"../../components/color":666,"../../components/drawing":688,"../../components/titles":764,"../../constants/alignment":771,"../../constants/numerical":779,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"./autorange":853,"./axis_autotype":855,"./axis_ids":858,"./clean_ticks":860,"./layout_attributes":869,"./set_convert":875,"@plotly/d3":58,"fast-isnumeric":249}],855:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../components/titles":748,"../../constants/alignment":755,"../../constants/numerical":763,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"./autorange":837,"./axis_autotype":839,"./axis_ids":842,"./clean_ticks":844,"./layout_attributes":853,"./set_convert":859,"@plotly/d3":58,"fast-isnumeric":246}],839:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -182237,7 +183692,7 @@ function multiCategory(a) { return isArrayOrTypedArray(a[0]) && isArrayOrTypedArray(a[1]); } -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],856:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],840:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -182549,7 +184004,7 @@ function indexOfDay(v) { ]; } -},{"../../lib":803,"../../registry":931,"../array_container_defaults":849,"./category_order_defaults":859,"./constants":861,"./layout_attributes":869,"./line_grid_defaults":871,"./set_convert":875,"./tick_label_defaults":876,"./tick_mark_defaults":877,"./tick_value_defaults":878,"fast-isnumeric":249}],857:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../array_container_defaults":833,"./category_order_defaults":843,"./constants":845,"./layout_attributes":853,"./line_grid_defaults":855,"./set_convert":859,"./tick_label_defaults":860,"./tick_mark_defaults":861,"./tick_value_defaults":862,"fast-isnumeric":246}],841:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../../constants/docs'); @@ -182598,7 +184053,7 @@ module.exports = { descriptionWithDates: descriptionWithDates }; -},{"../../constants/docs":774}],858:[function(_dereq_,module,exports){ +},{"../../constants/docs":758}],842:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -182746,7 +184201,7 @@ exports.isLinked = function(fullLayout, axId) { ); }; -},{"../../registry":931,"./constants":861}],859:[function(_dereq_,module,exports){ +},{"../../registry":915,"./constants":845}],843:[function(_dereq_,module,exports){ 'use strict'; function findCategories(ax, opts) { @@ -182832,7 +184287,7 @@ module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, } }; -},{}],860:[function(_dereq_,module,exports){ +},{}],844:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -182916,7 +184371,7 @@ exports.tick0 = function(tick0, axType, calendar, dtick) { return isNumeric(tick0) ? Number(tick0) : 0; }; -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],861:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],845:[function(_dereq_,module,exports){ 'use strict'; var counterRegex = _dereq_('../../lib/regex').counter; @@ -183000,7 +184455,7 @@ module.exports = { } }; -},{"../../lib/regex":820}],862:[function(_dereq_,module,exports){ +},{"../../lib/regex":804}],846:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -183643,7 +185098,7 @@ function updateDomain(ax, factor) { ax.setScale(); } -},{"../../constants/alignment":771,"../../constants/numerical":779,"../../lib":803,"./autorange":853,"./axis_ids":858,"./layout_attributes":869,"./scale_zoom":873,"./set_convert":875}],863:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755,"../../constants/numerical":763,"../../lib":787,"./autorange":837,"./axis_ids":842,"./layout_attributes":853,"./scale_zoom":857,"./set_convert":859}],847:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -184975,7 +186430,7 @@ module.exports = { attachWheelEventHandler: attachWheelEventHandler }; -},{"../../components/color":666,"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../constants/alignment":771,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plot_api/subroutines":844,"../../registry":931,"../plots":917,"./axes":854,"./axis_ids":858,"./constants":861,"./scale_zoom":873,"./select":874,"@plotly/d3":58,"has-passive-events":444,"tinycolor2":598}],864:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../constants/alignment":755,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plot_api/subroutines":828,"../../registry":915,"../plots":901,"./axes":838,"./axis_ids":842,"./constants":845,"./scale_zoom":857,"./select":858,"@plotly/d3":58,"has-passive-events":436,"tinycolor2":583}],848:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -185134,7 +186589,7 @@ exports.updateFx = function(gd) { setCursor(fullLayout._draggers, cursor); }; -},{"../../components/dragelement":685,"../../components/fx":706,"../../lib/setcursor":824,"./constants":861,"./dragbox":863,"@plotly/d3":58}],865:[function(_dereq_,module,exports){ +},{"../../components/dragelement":669,"../../components/fx":690,"../../lib/setcursor":808,"./constants":845,"./dragbox":847,"@plotly/d3":58}],849:[function(_dereq_,module,exports){ 'use strict'; function clearOutlineControllers(gd) { @@ -185161,7 +186616,7 @@ module.exports = { clearSelect: clearSelect }; -},{}],866:[function(_dereq_,module,exports){ +},{}],850:[function(_dereq_,module,exports){ 'use strict'; var strTranslate = _dereq_('../../lib').strTranslate; @@ -185209,7 +186664,7 @@ module.exports = { getTransform: getTransform }; -},{"../../lib":803}],867:[function(_dereq_,module,exports){ +},{"../../lib":787}],851:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -185278,7 +186733,7 @@ module.exports = function makeIncludeComponents(containerArrayName) { }; }; -},{"../../lib":803,"../../registry":931,"./axis_ids":858}],868:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./axis_ids":842}],852:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -185887,7 +187342,7 @@ exports.toSVG = function(gd) { exports.updateFx = _dereq_('./graph_interact').updateFx; -},{"../../components/drawing":688,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../registry":931,"../get_data":891,"../plots":917,"./attributes":852,"./axis_ids":858,"./constants":861,"./graph_interact":864,"./layout_attributes":869,"./layout_defaults":870,"./transition_axes":879,"@plotly/d3":58}],869:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../registry":915,"../get_data":875,"../plots":901,"./attributes":836,"./axis_ids":842,"./constants":845,"./graph_interact":848,"./layout_attributes":853,"./layout_defaults":854,"./transition_axes":863,"@plotly/d3":58}],853:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../font_attributes'); @@ -186448,7 +187903,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../components/drawing/attributes":687,"../../constants/numerical":779,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../font_attributes":883,"./constants":861}],870:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../components/drawing/attributes":671,"../../constants/numerical":763,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../font_attributes":867,"./constants":845}],854:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -186826,7 +188281,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":666,"../../components/fx/helpers":702,"../../components/fx/hovermode_defaults":705,"../../lib":803,"../../plot_api/plot_template":843,"../../registry":931,"../layout_attributes":908,"./axis_defaults":856,"./axis_ids":858,"./constants":861,"./constraints":862,"./layout_attributes":869,"./position_defaults":872,"./type_defaults":880}],871:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx/helpers":686,"../../components/fx/hovermode_defaults":689,"../../lib":787,"../../plot_api/plot_template":827,"../../registry":915,"../layout_attributes":892,"./axis_defaults":840,"./axis_ids":842,"./constants":845,"./constraints":846,"./layout_attributes":853,"./position_defaults":856,"./type_defaults":864}],855:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -186883,7 +188338,7 @@ module.exports = function handleLineGridDefaults(containerIn, containerOut, coer } }; -},{"../../components/color/attributes":665,"../../lib":803,"tinycolor2":598}],872:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib":787,"tinycolor2":583}],856:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -186962,7 +188417,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer return containerOut; }; -},{"../../lib":803,"fast-isnumeric":249}],873:[function(_dereq_,module,exports){ +},{"../../lib":787,"fast-isnumeric":246}],857:[function(_dereq_,module,exports){ 'use strict'; var FROM_BL = _dereq_('../../constants/alignment').FROM_BL; @@ -186982,7 +188437,7 @@ module.exports = function scaleZoom(ax, factor, centerFraction) { ax.setScale(); }; -},{"../../constants/alignment":771}],874:[function(_dereq_,module,exports){ +},{"../../constants/alignment":755}],858:[function(_dereq_,module,exports){ 'use strict'; var polybool = _dereq_('polybooljs'); @@ -187916,7 +189371,7 @@ module.exports = { selectOnClick: selectOnClick }; -},{"../../components/color":666,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../components/fx/helpers":702,"../../components/shapes/draw_newshape/display_outlines":754,"../../components/shapes/draw_newshape/helpers":755,"../../components/shapes/draw_newshape/newshapes":756,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/polygon":815,"../../lib/throttle":830,"../../plot_api/subroutines":844,"../../registry":931,"./axis_ids":858,"./constants":861,"./handle_outline":865,"./helpers":866,"polybooljs":504}],875:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../components/fx/helpers":686,"../../components/shapes/draw_newshape/display_outlines":738,"../../components/shapes/draw_newshape/helpers":739,"../../components/shapes/draw_newshape/newshapes":740,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/polygon":799,"../../lib/throttle":814,"../../plot_api/subroutines":828,"../../registry":915,"./axis_ids":842,"./constants":845,"./handle_outline":849,"./helpers":850,"polybooljs":490}],859:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -188880,7 +190335,7 @@ module.exports = function setConvert(ax, fullLayout) { delete ax._forceTick0; }; -},{"../../constants/numerical":779,"../../lib":803,"./axis_ids":858,"./constants":861,"@plotly/d3":58,"d3-time-format":175,"fast-isnumeric":249}],876:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"./axis_ids":842,"./constants":845,"@plotly/d3":58,"d3-time-format":172,"fast-isnumeric":246}],860:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -188998,7 +190453,7 @@ function tickformatstopDefaults(valueIn, valueOut) { } } -},{"../../components/color":666,"../../lib":803,"../array_container_defaults":849,"./layout_attributes":869}],877:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../array_container_defaults":833,"./layout_attributes":853}],861:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -189022,7 +190477,7 @@ module.exports = function handleTickDefaults(containerIn, containerOut, coerce, } }; -},{"../../lib":803,"./layout_attributes":869}],878:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":853}],862:[function(_dereq_,module,exports){ 'use strict'; var cleanTicks = _dereq_('./clean_ticks'); @@ -189061,7 +190516,7 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe } }; -},{"../../lib":803,"./clean_ticks":860}],879:[function(_dereq_,module,exports){ +},{"../../lib":787,"./clean_ticks":844}],863:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -189266,7 +190721,7 @@ module.exports = function transitionAxes(gd, edits, transitionOpts, makeOnComple return Promise.resolve(); }; -},{"../../components/drawing":688,"../../lib":803,"../../registry":931,"./axes":854,"@plotly/d3":58}],880:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../registry":915,"./axes":838,"@plotly/d3":58}],864:[function(_dereq_,module,exports){ 'use strict'; var traceIs = _dereq_('../../registry').traceIs; @@ -189398,7 +190853,7 @@ function isBoxWithoutPositionCoords(trace, axLetter) { ); } -},{"../../registry":931,"./axis_autotype":855}],881:[function(_dereq_,module,exports){ +},{"../../registry":915,"./axis_autotype":839}],865:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -189817,7 +191272,7 @@ function crawl(attrs, callback, path, depth) { }); } -},{"../lib":803,"../registry":931}],882:[function(_dereq_,module,exports){ +},{"../lib":787,"../registry":915}],866:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../lib/extend').extendFlat; @@ -189914,7 +191369,7 @@ exports.defaults = function(containerOut, layout, coerce, dfltDomains) { if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice(); }; -},{"../lib/extend":793}],883:[function(_dereq_,module,exports){ +},{"../lib/extend":777}],867:[function(_dereq_,module,exports){ 'use strict'; /* @@ -189966,7 +191421,7 @@ module.exports = function(opts) { return attrs; }; -},{}],884:[function(_dereq_,module,exports){ +},{}],868:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -189992,7 +191447,7 @@ module.exports = { } }; -},{}],885:[function(_dereq_,module,exports){ +},{}],869:[function(_dereq_,module,exports){ 'use strict'; // projection names to d3 function name @@ -190250,7 +191705,7 @@ exports.layerNameToAdjective = { frame: 'frame' }; -},{}],886:[function(_dereq_,module,exports){ +},{}],870:[function(_dereq_,module,exports){ 'use strict'; /* global PlotlyGeoAssets:false */ @@ -191038,7 +192493,7 @@ function makeRangeBox(lon, lat) { }; } -},{"../../components/color":666,"../../components/dragelement":685,"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/topojson_utils":832,"../../registry":931,"../cartesian/autorange":853,"../cartesian/axes":854,"../cartesian/select":874,"../plots":917,"./constants":885,"./zoom":890,"@plotly/d3":58,"d3-geo":169,"d3-geo-projection":168,"topojson-client":601}],887:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/topojson_utils":816,"../../registry":915,"../cartesian/autorange":837,"../cartesian/axes":838,"../cartesian/select":858,"../plots":901,"./constants":869,"./zoom":874,"@plotly/d3":58,"d3-geo":166,"d3-geo-projection":165,"topojson-client":586}],871:[function(_dereq_,module,exports){ 'use strict'; var getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData; @@ -191122,7 +192577,7 @@ module.exports = { clean: clean }; -},{"../../lib":803,"../../plots/get_data":891,"./geo":886,"./layout_attributes":888,"./layout_defaults":889}],888:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/get_data":875,"./geo":870,"./layout_attributes":872,"./layout_defaults":873}],872:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -191332,7 +192787,7 @@ attrs.uirevision = { editType: 'none', }; -},{"../../components/color/attributes":665,"../../lib/sort_object_keys":826,"../../plot_api/edit_types":836,"../domain":882,"./constants":885}],889:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/sort_object_keys":810,"../../plot_api/edit_types":820,"../domain":866,"./constants":869}],873:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -191558,7 +193013,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) { } } -},{"../../lib":803,"../get_data":891,"../subplot_defaults":925,"./constants":885,"./layout_attributes":888}],890:[function(_dereq_,module,exports){ +},{"../../lib":787,"../get_data":875,"../subplot_defaults":909,"./constants":869,"./layout_attributes":872}],874:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -192061,7 +193516,7 @@ function d3eventDispatch(target) { return dispatch; } -},{"../../lib":803,"../../registry":931,"@plotly/d3":58}],891:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"@plotly/d3":58}],875:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -192182,7 +193637,7 @@ exports.getSubplotData = function getSubplotData(data, type, subplotId) { return subplotData; }; -},{"../registry":931,"./cartesian/constants":861}],892:[function(_dereq_,module,exports){ +},{"../registry":915,"./cartesian/constants":845}],876:[function(_dereq_,module,exports){ 'use strict'; var mouseChange = _dereq_('mouse-change'); @@ -192468,7 +193923,7 @@ function createCamera(scene) { return result; } -},{"../cartesian/constants":861,"has-passive-events":444,"mouse-change":470,"mouse-event-offset":471,"mouse-wheel":473}],893:[function(_dereq_,module,exports){ +},{"../cartesian/constants":845,"has-passive-events":436,"mouse-change":459,"mouse-event-offset":460,"mouse-wheel":462}],877:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../cartesian/axes'); @@ -192702,7 +194157,7 @@ function createAxes2D(scene) { module.exports = createAxes2D; -},{"../../lib/str2rgbarray":828,"../cartesian/axes":854}],894:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":812,"../cartesian/axes":838}],878:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -192844,7 +194299,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/fx/layout_attributes":707,"../../constants/xmlns_namespaces":780,"../../plot_api/edit_types":836,"../cartesian":868,"../cartesian/attributes":852,"../cartesian/constants":861,"../get_data":891,"../layout_attributes":908,"./scene2d":895}],895:[function(_dereq_,module,exports){ +},{"../../components/fx/layout_attributes":691,"../../constants/xmlns_namespaces":764,"../../plot_api/edit_types":820,"../cartesian":852,"../cartesian/attributes":836,"../cartesian/constants":845,"../get_data":875,"../layout_attributes":892,"./scene2d":879}],879:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -193556,7 +195011,7 @@ proto.hoverFormatter = function(axisName, val) { return Axes.tickText(axis, axis.c2l(val), 'hover').text; }; -},{"../../components/dragelement/helpers":684,"../../components/fx":706,"../../lib/show_no_webgl_msg":825,"../../plots/cartesian/axes":854,"../../registry":931,"../cartesian/autorange":853,"../cartesian/constants":861,"../cartesian/constraints":862,"./camera":892,"./convert":893,"gl-plot2d":322,"gl-select-box":337,"gl-spikes2d":346,"webgl-context":629}],896:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":668,"../../components/fx":690,"../../lib/show_no_webgl_msg":809,"../../plots/cartesian/axes":838,"../../registry":915,"../cartesian/autorange":837,"../cartesian/constants":845,"../cartesian/constraints":846,"./camera":876,"./convert":877,"gl-plot2d":316,"gl-select-box":330,"gl-spikes2d":339,"webgl-context":613}],880:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -193707,7 +195162,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/fx/layout_attributes":707,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../plot_api/edit_types":836,"../get_data":891,"./layout/attributes":897,"./layout/defaults":901,"./layout/layout_attributes":902,"./scene":906}],897:[function(_dereq_,module,exports){ +},{"../../components/fx/layout_attributes":691,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../plot_api/edit_types":820,"../get_data":875,"./layout/attributes":881,"./layout/defaults":885,"./layout/layout_attributes":886,"./scene":890}],881:[function(_dereq_,module,exports){ 'use strict'; @@ -193719,7 +195174,7 @@ module.exports = { } }; -},{}],898:[function(_dereq_,module,exports){ +},{}],882:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../../components/color'); @@ -193821,7 +195276,7 @@ module.exports = overrideAll({ } }, 'plot', 'from-root'); -},{"../../../components/color":666,"../../../lib/extend":793,"../../../plot_api/edit_types":836,"../../cartesian/layout_attributes":869}],899:[function(_dereq_,module,exports){ +},{"../../../components/color":650,"../../../lib/extend":777,"../../../plot_api/edit_types":820,"../../cartesian/layout_attributes":853}],883:[function(_dereq_,module,exports){ 'use strict'; var colorMix = _dereq_('tinycolor2').mix; @@ -193890,7 +195345,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { } }; -},{"../../../lib":803,"../../../plot_api/plot_template":843,"../../cartesian/axis_defaults":856,"../../cartesian/type_defaults":880,"./axis_attributes":898,"tinycolor2":598}],900:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../../plot_api/plot_template":827,"../../cartesian/axis_defaults":840,"../../cartesian/type_defaults":864,"./axis_attributes":882,"tinycolor2":583}],884:[function(_dereq_,module,exports){ 'use strict'; var str2RgbaArray = _dereq_('../../../lib/str2rgbarray'); @@ -194047,7 +195502,7 @@ function createAxesOptions(fullLayout, sceneLayout) { module.exports = createAxesOptions; -},{"../../../lib":803,"../../../lib/str2rgbarray":828}],901:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../../lib/str2rgbarray":812}],885:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../../lib'); @@ -194188,7 +195643,7 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { coerce('hovermode', opts.getDfltFromLayout('hovermode')); } -},{"../../../components/color":666,"../../../lib":803,"../../../registry":931,"../../get_data":891,"../../subplot_defaults":925,"./axis_defaults":899,"./layout_attributes":902}],902:[function(_dereq_,module,exports){ +},{"../../../components/color":650,"../../../lib":787,"../../../registry":915,"../../get_data":875,"../../subplot_defaults":909,"./axis_defaults":883,"./layout_attributes":886}],886:[function(_dereq_,module,exports){ 'use strict'; var gl3dAxisAttrs = _dereq_('./axis_attributes'); @@ -194307,7 +195762,7 @@ module.exports = { } }; -},{"../../../lib":803,"../../../lib/extend":793,"../../domain":882,"./axis_attributes":898}],903:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../../lib/extend":777,"../../domain":866,"./axis_attributes":882}],887:[function(_dereq_,module,exports){ 'use strict'; var str2RGBArray = _dereq_('../../../lib/str2rgbarray'); @@ -194350,7 +195805,7 @@ function createSpikeOptions(layout) { module.exports = createSpikeOptions; -},{"../../../lib/str2rgbarray":828}],904:[function(_dereq_,module,exports){ +},{"../../../lib/str2rgbarray":812}],888:[function(_dereq_,module,exports){ /* eslint block-scoped-var: 0*/ /* eslint no-redeclare: 0*/ @@ -194443,7 +195898,7 @@ function computeTickMarks(scene) { scene.contourLevels = contourLevelsFromTicks(ticks); } -},{"../../../lib":803,"../../cartesian/axes":854}],905:[function(_dereq_,module,exports){ +},{"../../../lib":787,"../../cartesian/axes":838}],889:[function(_dereq_,module,exports){ 'use strict'; function xformMatrix(m, v) { @@ -194468,7 +195923,7 @@ function project(camera, v) { module.exports = project; -},{}],906:[function(_dereq_,module,exports){ +},{}],890:[function(_dereq_,module,exports){ 'use strict'; var glPlot3d = _dereq_('gl-plot3d'); @@ -195604,7 +197059,7 @@ proto.make4thDimension = function() { module.exports = Scene; -},{"../../components/fx":706,"../../lib":803,"../../lib/show_no_webgl_msg":825,"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"../../registry":931,"./layout/convert":900,"./layout/spikes":903,"./layout/tick_marks":904,"./project":905,"gl-plot3d":326,"has-passive-events":444,"webgl-context":629}],907:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../lib":787,"../../lib/show_no_webgl_msg":809,"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"../../registry":915,"./layout/convert":884,"./layout/spikes":887,"./layout/tick_marks":888,"./project":889,"gl-plot3d":319,"has-passive-events":436,"webgl-context":613}],891:[function(_dereq_,module,exports){ 'use strict'; module.exports = function zip3(x, y, z, len) { @@ -195617,7 +197072,7 @@ module.exports = function zip3(x, y, z, len) { return result; }; -},{}],908:[function(_dereq_,module,exports){ +},{}],892:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('./font_attributes'); @@ -195844,7 +197299,7 @@ module.exports = { } }; -},{"../components/color/attributes":665,"../components/shapes/draw_newshape/attributes":751,"../lib/extend":793,"./animation_attributes":848,"./font_attributes":883,"./pad_attributes":916}],909:[function(_dereq_,module,exports){ +},{"../components/color/attributes":649,"../components/shapes/draw_newshape/attributes":735,"../lib/extend":777,"./animation_attributes":832,"./font_attributes":867,"./pad_attributes":900}],893:[function(_dereq_,module,exports){ 'use strict'; var sortObjectKeys = _dereq_('../../lib/sort_object_keys'); @@ -196094,7 +197549,7 @@ module.exports = { } }; -},{"../../lib/sort_object_keys":826}],910:[function(_dereq_,module,exports){ +},{"../../lib/sort_object_keys":810}],894:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -196158,7 +197613,7 @@ module.exports = function convertTextOpts(textposition, iconSize) { return { anchor: anchor, offset: offset }; }; -},{"../../lib":803}],911:[function(_dereq_,module,exports){ +},{"../../lib":787}],895:[function(_dereq_,module,exports){ 'use strict'; var mapboxgl = _dereq_('mapbox-gl/dist/mapbox-gl-unminified'); @@ -196435,7 +197890,7 @@ exports.updateFx = function(gd) { } }; -},{"../../components/drawing":688,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/get_data":891,"./constants":909,"./layout_attributes":913,"./layout_defaults":914,"./mapbox":915,"@plotly/d3":58,"mapbox-gl/dist/mapbox-gl-unminified":461}],912:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/get_data":875,"./constants":893,"./layout_attributes":897,"./layout_defaults":898,"./mapbox":899,"@plotly/d3":58,"mapbox-gl/dist/mapbox-gl-unminified":451}],896:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -196736,7 +198191,7 @@ module.exports = function createMapboxLayer(subplot, index, opts) { return mapboxLayer; }; -},{"../../lib":803,"../../lib/svg_text_utils":829,"./constants":909,"./convert_text_opts":910}],913:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/svg_text_utils":813,"./constants":893,"./convert_text_opts":894}],897:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -196908,7 +198363,7 @@ attrs.uirevision = { editType: 'none', }; -},{"../../components/color":666,"../../lib":803,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../traces/scatter/attributes":1218,"../domain":882,"../font_attributes":883,"./constants":909}],914:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../traces/scatter/attributes":1202,"../domain":866,"../font_attributes":867,"./constants":893}],898:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -197008,7 +198463,7 @@ function handleLayerDefaults(layerIn, layerOut) { } } -},{"../../lib":803,"../array_container_defaults":849,"../subplot_defaults":925,"./layout_attributes":913}],915:[function(_dereq_,module,exports){ +},{"../../lib":787,"../array_container_defaults":833,"../subplot_defaults":909,"./layout_attributes":897}],899:[function(_dereq_,module,exports){ 'use strict'; var mapboxgl = _dereq_('mapbox-gl/dist/mapbox-gl-unminified'); @@ -197811,7 +199266,7 @@ function convertCenter(center) { module.exports = Mapbox; -},{"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/fx":706,"../../lib":803,"../../lib/geo_location_utils":796,"../../registry":931,"../cartesian/axes":854,"../cartesian/select":874,"./constants":909,"./layers":912,"mapbox-gl/dist/mapbox-gl-unminified":461}],916:[function(_dereq_,module,exports){ +},{"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/fx":690,"../../lib":787,"../../lib/geo_location_utils":780,"../../registry":915,"../cartesian/axes":838,"../cartesian/select":858,"./constants":893,"./layers":896,"mapbox-gl/dist/mapbox-gl-unminified":451}],900:[function(_dereq_,module,exports){ 'use strict'; /** @@ -197850,7 +199305,7 @@ module.exports = function(opts) { }; }; -},{}],917:[function(_dereq_,module,exports){ +},{}],901:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -201276,7 +202731,7 @@ plots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullD } }; -},{"../components/color":666,"../constants/numerical":779,"../lib":803,"../plot_api/plot_schema":842,"../plot_api/plot_template":843,"../plots/get_data":891,"../registry":931,"./animation_attributes":848,"./attributes":850,"./cartesian/axis_ids":858,"./cartesian/handle_outline":865,"./command":881,"./font_attributes":883,"./frame_attributes":884,"./layout_attributes":908,"@plotly/d3":58,"d3-format":167,"d3-time-format":175,"fast-isnumeric":249}],918:[function(_dereq_,module,exports){ +},{"../components/color":650,"../constants/numerical":763,"../lib":787,"../plot_api/plot_schema":826,"../plot_api/plot_template":827,"../plots/get_data":875,"../registry":915,"./animation_attributes":832,"./attributes":834,"./cartesian/axis_ids":842,"./cartesian/handle_outline":849,"./command":865,"./font_attributes":867,"./frame_attributes":868,"./layout_attributes":892,"@plotly/d3":58,"d3-format":164,"d3-time-format":172,"fast-isnumeric":246}],902:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -201313,7 +202768,7 @@ module.exports = { OFFEDGE: 20 }; -},{}],919:[function(_dereq_,module,exports){ +},{}],903:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -201600,7 +203055,7 @@ module.exports = { pathPolygonAnnulus: pathPolygonAnnulus }; -},{"../../lib":803,"../../lib/polygon":815}],920:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/polygon":799}],904:[function(_dereq_,module,exports){ 'use strict'; var getSubplotCalcData = _dereq_('../get_data').getSubplotCalcData; @@ -201679,7 +203134,7 @@ module.exports = { toSVG: _dereq_('../cartesian').toSVG }; -},{"../../lib":803,"../cartesian":868,"../get_data":891,"./constants":918,"./layout_attributes":921,"./layout_defaults":922,"./polar":923}],921:[function(_dereq_,module,exports){ +},{"../../lib":787,"../cartesian":852,"../get_data":875,"./constants":902,"./layout_attributes":905,"./layout_defaults":906,"./polar":907}],905:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -201934,7 +203389,7 @@ module.exports = { editType: 'calc' }; -},{"../../components/color/attributes":665,"../../lib":803,"../../plot_api/edit_types":836,"../cartesian/layout_attributes":869,"../domain":882}],922:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib":787,"../../plot_api/edit_types":820,"../cartesian/layout_attributes":853,"../domain":866}],906:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -202164,7 +203619,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { }); }; -},{"../../components/color":666,"../../lib":803,"../../plot_api/plot_template":843,"../cartesian/axis_autotype":855,"../cartesian/category_order_defaults":859,"../cartesian/line_grid_defaults":871,"../cartesian/tick_label_defaults":876,"../cartesian/tick_mark_defaults":877,"../cartesian/tick_value_defaults":878,"../get_data":891,"../subplot_defaults":925,"./constants":918,"./layout_attributes":921,"./set_convert":924}],923:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plot_api/plot_template":827,"../cartesian/axis_autotype":839,"../cartesian/category_order_defaults":843,"../cartesian/line_grid_defaults":855,"../cartesian/tick_label_defaults":860,"../cartesian/tick_mark_defaults":861,"../cartesian/tick_value_defaults":862,"../get_data":875,"../subplot_defaults":909,"./constants":902,"./layout_attributes":905,"./set_convert":908}],907:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -203601,7 +205056,7 @@ function updateElement(sel, showAttr, attrs) { return sel; } -},{"../../components/color":666,"../../components/dragelement":685,"../../components/drawing":688,"../../components/fx":706,"../../components/titles":764,"../../constants/alignment":771,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/setcursor":824,"../../plot_api/subroutines":844,"../../plots/cartesian/axes":854,"../../registry":931,"../cartesian/autorange":853,"../cartesian/dragbox":863,"../cartesian/select":874,"../cartesian/set_convert":875,"../plots":917,"./constants":918,"./helpers":919,"./set_convert":924,"@plotly/d3":58,"tinycolor2":598}],924:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/drawing":672,"../../components/fx":690,"../../components/titles":748,"../../constants/alignment":755,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/setcursor":808,"../../plot_api/subroutines":828,"../../plots/cartesian/axes":838,"../../registry":915,"../cartesian/autorange":837,"../cartesian/dragbox":847,"../cartesian/select":858,"../cartesian/set_convert":859,"../plots":901,"./constants":902,"./helpers":903,"./set_convert":908,"@plotly/d3":58,"tinycolor2":583}],908:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -203788,7 +205243,7 @@ function setConvertAngular(ax, polarLayout) { }; } -},{"../../lib":803,"../cartesian/set_convert":875}],925:[function(_dereq_,module,exports){ +},{"../../lib":787,"../cartesian/set_convert":859}],909:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -203864,7 +205319,7 @@ module.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, o } }; -},{"../lib":803,"../plot_api/plot_template":843,"./domain":882}],926:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_template":827,"./domain":866}],910:[function(_dereq_,module,exports){ 'use strict'; var docs = _dereq_('../constants/docs'); @@ -203945,7 +205400,7 @@ exports.texttemplateAttrs = function(opts, extra) { return texttemplate; }; -},{"../constants/docs":774}],927:[function(_dereq_,module,exports){ +},{"../constants/docs":758}],911:[function(_dereq_,module,exports){ 'use strict'; var Ternary = _dereq_('./ternary'); @@ -204018,7 +205473,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../lib":803,"../../plots/get_data":891,"./layout_attributes":928,"./layout_defaults":929,"./ternary":930}],928:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/get_data":875,"./layout_attributes":912,"./layout_defaults":913,"./ternary":914}],912:[function(_dereq_,module,exports){ 'use strict'; var colorAttrs = _dereq_('../../components/color/attributes'); @@ -204108,7 +205563,7 @@ attrs.aaxis.uirevision = attrs.baxis.uirevision = attrs.caxis.uirevision = { editType: 'none', }; -},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plot_api/edit_types":836,"../cartesian/layout_attributes":869,"../domain":882}],929:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plot_api/edit_types":820,"../cartesian/layout_attributes":853,"../domain":866}],913:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -204232,7 +205687,7 @@ function handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut coerce('layer'); } -},{"../../components/color":666,"../../lib":803,"../../plot_api/plot_template":843,"../cartesian/line_grid_defaults":871,"../cartesian/tick_label_defaults":876,"../cartesian/tick_mark_defaults":877,"../cartesian/tick_value_defaults":878,"../subplot_defaults":925,"./layout_attributes":928}],930:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plot_api/plot_template":827,"../cartesian/line_grid_defaults":855,"../cartesian/tick_label_defaults":860,"../cartesian/tick_mark_defaults":861,"../cartesian/tick_value_defaults":862,"../subplot_defaults":909,"./layout_attributes":912}],914:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -205004,7 +206459,7 @@ function removeZoombox(gd) { .remove(); } -},{"../../components/color":666,"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../components/titles":764,"../../lib":803,"../../lib/extend":793,"../../registry":931,"../cartesian/axes":854,"../cartesian/constants":861,"../cartesian/select":874,"../cartesian/set_convert":875,"../plots":917,"@plotly/d3":58,"tinycolor2":598}],931:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../components/titles":748,"../../lib":787,"../../lib/extend":777,"../../registry":915,"../cartesian/axes":838,"../cartesian/constants":845,"../cartesian/select":858,"../cartesian/set_convert":859,"../plots":901,"@plotly/d3":58,"tinycolor2":583}],915:[function(_dereq_,module,exports){ 'use strict'; var Loggers = _dereq_('./lib/loggers'); @@ -205462,7 +206917,7 @@ function getTraceType(traceType) { return traceType; } -},{"./lib/dom":791,"./lib/extend":793,"./lib/is_plain_object":804,"./lib/loggers":807,"./lib/noop":812,"./lib/push_unique":818,"./plots/attributes":850,"./plots/layout_attributes":908}],932:[function(_dereq_,module,exports){ +},{"./lib/dom":775,"./lib/extend":777,"./lib/is_plain_object":788,"./lib/loggers":791,"./lib/noop":796,"./lib/push_unique":802,"./plots/attributes":834,"./plots/layout_attributes":892}],916:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -205622,7 +207077,7 @@ module.exports = function clonePlot(graphObj, options) { return plotTile; }; -},{"../lib":803,"../registry":931}],933:[function(_dereq_,module,exports){ +},{"../lib":787,"../registry":915}],917:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -205686,7 +207141,7 @@ function downloadImage(gd, opts) { module.exports = downloadImage; -},{"../lib":803,"../plot_api/to_image":846,"./filesaver":934,"./helpers":935}],934:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/to_image":830,"./filesaver":918,"./helpers":919}],918:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -205754,7 +207209,7 @@ function fileSaver(url, name, format) { module.exports = fileSaver; -},{"../lib":803,"./helpers":935}],935:[function(_dereq_,module,exports){ +},{"../lib":787,"./helpers":919}],919:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../registry'); @@ -205823,7 +207278,7 @@ exports.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; exports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\'svg\'} instead.'; -},{"../registry":931}],936:[function(_dereq_,module,exports){ +},{"../registry":915}],920:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -205840,7 +207295,7 @@ var Snapshot = { module.exports = Snapshot; -},{"./cloneplot":932,"./download":933,"./helpers":935,"./svgtoimg":937,"./toimage":938,"./tosvg":939}],937:[function(_dereq_,module,exports){ +},{"./cloneplot":916,"./download":917,"./helpers":919,"./svgtoimg":921,"./toimage":922,"./tosvg":923}],921:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -205959,7 +207414,7 @@ function svgToImg(opts) { module.exports = svgToImg; -},{"../lib":803,"./helpers":935,"events":116}],938:[function(_dereq_,module,exports){ +},{"../lib":787,"./helpers":919,"events":116}],922:[function(_dereq_,module,exports){ 'use strict'; var EventEmitter = _dereq_('events').EventEmitter; @@ -206028,7 +207483,7 @@ function toImage(gd, opts) { module.exports = toImage; -},{"../lib":803,"../registry":931,"./cloneplot":932,"./helpers":935,"./svgtoimg":937,"./tosvg":939,"events":116}],939:[function(_dereq_,module,exports){ +},{"../lib":787,"../registry":915,"./cloneplot":916,"./helpers":919,"./svgtoimg":921,"./tosvg":923,"events":116}],923:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -206213,7 +207668,7 @@ module.exports = function toSVG(gd, format, scale) { return s; }; -},{"../components/color":666,"../components/drawing":688,"../constants/xmlns_namespaces":780,"../lib":803,"@plotly/d3":58}],940:[function(_dereq_,module,exports){ +},{"../components/color":650,"../components/drawing":672,"../constants/xmlns_namespaces":764,"../lib":787,"@plotly/d3":58}],924:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -206238,7 +207693,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":803}],941:[function(_dereq_,module,exports){ +},{"../../lib":787}],925:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -206419,7 +207874,7 @@ module.exports = { } }; -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/font_attributes":883,"../../plots/template_attributes":926,"../scatter/attributes":1218,"./constants":943}],942:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/font_attributes":867,"../../plots/template_attributes":910,"../scatter/attributes":1202,"./constants":927}],926:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -206494,7 +207949,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../scatter/calc_selection":1220,"./arrays_to_calcdata":940}],943:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../scatter/calc_selection":1204,"./arrays_to_calcdata":924}],927:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -206507,7 +207962,7 @@ module.exports = { eventDataKeys: ['value', 'label'] }; -},{}],944:[function(_dereq_,module,exports){ +},{}],928:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -207282,7 +208737,7 @@ module.exports = { setGroupPositions: setGroupPositions }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../../plots/cartesian/constraints":862,"../../registry":931,"./sieve.js":954,"fast-isnumeric":249}],945:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../../plots/cartesian/constraints":846,"../../registry":915,"./sieve.js":938,"fast-isnumeric":246}],929:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -207461,7 +208916,7 @@ module.exports = { handleText: handleText }; -},{"../../components/color":666,"../../lib":803,"../../plots/cartesian/constraints":862,"../../registry":931,"../scatter/period_defaults":1238,"../scatter/xy_defaults":1245,"./attributes":941,"./style_defaults":956}],946:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plots/cartesian/constraints":846,"../../registry":915,"../scatter/period_defaults":1222,"../scatter/xy_defaults":1229,"./attributes":925,"./style_defaults":940}],930:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace) { @@ -207482,7 +208937,7 @@ module.exports = function eventData(out, pt, trace) { return out; }; -},{}],947:[function(_dereq_,module,exports){ +},{}],931:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -207552,7 +209007,7 @@ exports.getLineWidth = function(trace, di) { return w; }; -},{"../../lib":803,"fast-isnumeric":249,"tinycolor2":598}],948:[function(_dereq_,module,exports){ +},{"../../lib":787,"fast-isnumeric":246,"tinycolor2":583}],932:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -207777,7 +209232,7 @@ module.exports = { getTraceColor: getTraceColor }; -},{"../../components/color":666,"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./helpers":947}],949:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./helpers":931}],933:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -207806,7 +209261,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../scatter/marker_colorbar":1236,"./arrays_to_calcdata":940,"./attributes":941,"./calc":942,"./cross_trace_calc":944,"./defaults":945,"./event_data":946,"./hover":948,"./layout_attributes":950,"./layout_defaults":951,"./plot":952,"./select":953,"./style":955}],950:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../scatter/marker_colorbar":1220,"./arrays_to_calcdata":924,"./attributes":925,"./calc":926,"./cross_trace_calc":928,"./defaults":929,"./event_data":930,"./hover":932,"./layout_attributes":934,"./layout_defaults":935,"./plot":936,"./select":937,"./style":939}],934:[function(_dereq_,module,exports){ 'use strict'; @@ -207838,7 +209293,7 @@ module.exports = { } }; -},{}],951:[function(_dereq_,module,exports){ +},{}],935:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -207890,7 +209345,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { coerce('bargroupgap'); }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./layout_attributes":950}],952:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./layout_attributes":934}],936:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -208667,7 +210122,7 @@ module.exports = { toMoveInsideBar: toMoveInsideBar }; -},{"../../components/color":666,"../../components/drawing":688,"../../components/fx/helpers":702,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../registry":931,"./attributes":941,"./constants":943,"./helpers":947,"./style":955,"./uniform_text":957,"@plotly/d3":58,"fast-isnumeric":249}],953:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../components/fx/helpers":686,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../registry":915,"./attributes":925,"./constants":927,"./helpers":931,"./style":939,"./uniform_text":941,"@plotly/d3":58,"fast-isnumeric":246}],937:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -208723,7 +210178,7 @@ function getCentroid(d, xa, ya, isHorizontal, isFunnel) { } } -},{}],954:[function(_dereq_,module,exports){ +},{}],938:[function(_dereq_,module,exports){ 'use strict'; module.exports = Sieve; @@ -208832,7 +210287,7 @@ Sieve.prototype.getLabel = function getLabel(position, value) { return prefix + label; }; -},{"../../constants/numerical":779,"../../lib":803}],955:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787}],939:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -209006,7 +210461,7 @@ module.exports = { resizeText: resizeText }; -},{"../../components/color":666,"../../components/drawing":688,"../../lib":803,"../../registry":931,"./attributes":941,"./helpers":947,"./uniform_text":957,"@plotly/d3":58}],956:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../lib":787,"../../registry":915,"./attributes":925,"./helpers":931,"./uniform_text":941,"@plotly/d3":58}],940:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -209038,7 +210493,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, default coerce('unselected.marker.color'); }; -},{"../../components/color":666,"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803}],957:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787}],941:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -209117,7 +210572,7 @@ module.exports = { resizeText: resizeText }; -},{"../../lib":803,"@plotly/d3":58}],958:[function(_dereq_,module,exports){ +},{"../../lib":787,"@plotly/d3":58}],942:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -209172,7 +210627,7 @@ module.exports = { // error_y }; -},{"../../lib/extend":793,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatterpolar/attributes":1292}],959:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatterpolar/attributes":1276}],943:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -209276,7 +210731,7 @@ module.exports = { crossTraceCalc: crossTraceCalc }; -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"../../lib":803,"../../registry":931,"../bar/arrays_to_calcdata":940,"../bar/cross_trace_calc":944,"../scatter/calc_selection":1220}],960:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"../../lib":787,"../../registry":915,"../bar/arrays_to_calcdata":924,"../bar/cross_trace_calc":928,"../scatter/calc_selection":1204}],944:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -209327,7 +210782,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../bar/style_defaults":956,"../scatterpolar/defaults":1294,"./attributes":958}],961:[function(_dereq_,module,exports){ +},{"../../lib":787,"../bar/style_defaults":940,"../scatterpolar/defaults":1278,"./attributes":942}],945:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -209394,7 +210849,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { return [pointData]; }; -},{"../../components/fx":706,"../../lib":803,"../../plots/polar/helpers":919,"../bar/hover":948,"../scatterpolar/hover":1296}],962:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../lib":787,"../../plots/polar/helpers":903,"../bar/hover":932,"../scatterpolar/hover":1280}],946:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -209425,7 +210880,7 @@ module.exports = { } }; -},{"../../plots/polar":920,"../bar/select":953,"../bar/style":955,"../scatter/marker_colorbar":1236,"../scatterpolar/format_labels":1295,"./attributes":958,"./calc":959,"./defaults":960,"./hover":961,"./layout_attributes":963,"./layout_defaults":964,"./plot":965}],963:[function(_dereq_,module,exports){ +},{"../../plots/polar":904,"../bar/select":937,"../bar/style":939,"../scatter/marker_colorbar":1220,"../scatterpolar/format_labels":1279,"./attributes":942,"./calc":943,"./defaults":944,"./hover":945,"./layout_attributes":947,"./layout_defaults":948,"./plot":949}],947:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -209444,7 +210899,7 @@ module.exports = { } }; -},{}],964:[function(_dereq_,module,exports){ +},{}],948:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -209471,7 +210926,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"./layout_attributes":963}],965:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":947}],949:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -209571,7 +211026,7 @@ function makePathFn(subplot) { }; } -},{"../../components/drawing":688,"../../lib":803,"../../plots/polar/helpers":919,"@plotly/d3":58,"fast-isnumeric":249}],966:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../plots/polar/helpers":903,"@plotly/d3":58,"fast-isnumeric":246}],950:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -209806,7 +211261,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218}],967:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202}],951:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -210252,7 +211707,7 @@ function computeNotchSpan(cdi, N) { return 1.57 * (cdi.q3 - cdi.q1) / Math.sqrt(N); } -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"fast-isnumeric":249}],968:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"fast-isnumeric":246}],952:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -210477,7 +211932,7 @@ module.exports = { setPositionOffset: setPositionOffset }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../plots/cartesian/constraints":862}],969:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../plots/cartesian/constraints":846}],953:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -210787,7 +212242,7 @@ module.exports = { handlePointsDefaults: handlePointsDefaults }; -},{"../../components/color":666,"../../lib":803,"../../plots/cartesian/axis_autotype":855,"../../registry":931,"../bar/defaults":945,"../scatter/period_defaults":1238,"./attributes":966}],970:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plots/cartesian/axis_autotype":839,"../../registry":915,"../bar/defaults":929,"../scatter/period_defaults":1222,"./attributes":950}],954:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -210804,7 +212259,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],971:[function(_dereq_,module,exports){ +},{}],955:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -211083,7 +212538,7 @@ module.exports = { hoverOnPoints: hoverOnPoints }; -},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"../../plots/cartesian/axes":854}],972:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"../../plots/cartesian/axes":838}],956:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -211109,7 +212564,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":966,"./calc":967,"./cross_trace_calc":968,"./defaults":969,"./event_data":970,"./hover":971,"./layout_attributes":973,"./layout_defaults":974,"./plot":975,"./select":976,"./style":977}],973:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":950,"./calc":951,"./cross_trace_calc":952,"./defaults":953,"./event_data":954,"./hover":955,"./layout_attributes":957,"./layout_defaults":958,"./plot":959,"./select":960,"./style":961}],957:[function(_dereq_,module,exports){ 'use strict'; @@ -211136,7 +212591,7 @@ module.exports = { } }; -},{}],974:[function(_dereq_,module,exports){ +},{}],958:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -211174,7 +212629,7 @@ module.exports = { _supply: _supply }; -},{"../../lib":803,"../../registry":931,"./layout_attributes":973}],975:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./layout_attributes":957}],959:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -211516,7 +212971,7 @@ module.exports = { plotBoxMean: plotBoxMean }; -},{"../../components/drawing":688,"../../lib":803,"@plotly/d3":58}],976:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"@plotly/d3":58}],960:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -211557,7 +213012,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],977:[function(_dereq_,module,exports){ +},{}],961:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -211623,7 +213078,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/color":666,"../../components/drawing":688,"@plotly/d3":58}],978:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"@plotly/d3":58}],962:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib').extendFlat; @@ -211675,7 +213130,7 @@ module.exports = { hoverlabel: OHLCattrs.hoverlabel, }; -},{"../../lib":803,"../../plots/cartesian/axis_format_attributes":857,"../box/attributes":966,"../ohlc/attributes":1164}],979:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axis_format_attributes":841,"../box/attributes":950,"../ohlc/attributes":1148}],963:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -211719,7 +213174,7 @@ function ptFunc(o, h, l, c) { }; } -},{"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../ohlc/calc":1165}],980:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../ohlc/calc":1149}],964:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -211761,7 +213216,7 @@ function handleDirection(traceIn, traceOut, coerce, direction) { coerce(direction + '.fillcolor', Color.addOpacity(lineColor, 0.5)); } -},{"../../components/color":666,"../../lib":803,"../ohlc/ohlc_defaults":1169,"../scatter/period_defaults":1238,"./attributes":978}],981:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../ohlc/ohlc_defaults":1153,"../scatter/period_defaults":1222,"./attributes":962}],965:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -211785,7 +213240,7 @@ module.exports = { selectPoints: _dereq_('../ohlc/select') }; -},{"../../plots/cartesian":868,"../box/cross_trace_calc":968,"../box/layout_attributes":973,"../box/layout_defaults":974,"../box/plot":975,"../box/style":977,"../ohlc/hover":1167,"../ohlc/select":1171,"./attributes":978,"./calc":979,"./defaults":980}],982:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../box/cross_trace_calc":952,"../box/layout_attributes":957,"../box/layout_defaults":958,"../box/plot":959,"../box/style":961,"../ohlc/hover":1151,"../ohlc/select":1155,"./attributes":962,"./calc":963,"./defaults":964}],966:[function(_dereq_,module,exports){ 'use strict'; var handleAxisDefaults = _dereq_('./axis_defaults'); @@ -211842,7 +213297,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) { }); } -},{"../../plot_api/plot_template":843,"./axis_defaults":987}],983:[function(_dereq_,module,exports){ +},{"../../plot_api/plot_template":827,"./axis_defaults":971}],967:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -211881,7 +213336,7 @@ function minMax(a, depth) { return [min, max]; } -},{"../../lib":803}],984:[function(_dereq_,module,exports){ +},{"../../lib":787}],968:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -211953,7 +213408,7 @@ module.exports = { transforms: undefined }; -},{"../../components/color/attributes":665,"../../plots/font_attributes":883,"./axis_attributes":986}],985:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../plots/font_attributes":867,"./axis_attributes":970}],969:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -212052,7 +213507,7 @@ module.exports = function(carpet, carpetcd, a, b) { return segments; }; -},{"../../lib":803}],986:[function(_dereq_,module,exports){ +},{"../../lib":787}],970:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -212363,7 +213818,7 @@ module.exports = { editType: 'calc' }; -},{"../../components/color/attributes":665,"../../plot_api/edit_types":836,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/layout_attributes":869,"../../plots/font_attributes":883}],987:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../plot_api/edit_types":820,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/layout_attributes":853,"../../plots/font_attributes":867}],971:[function(_dereq_,module,exports){ 'use strict'; var carpetAttrs = _dereq_('./attributes'); @@ -212583,7 +214038,7 @@ function setAutoType(ax, data) { }); } -},{"../../components/color":666,"../../lib":803,"../../plots/cartesian/axis_autotype":855,"../../plots/cartesian/category_order_defaults":859,"../../plots/cartesian/set_convert":875,"../../plots/cartesian/tick_label_defaults":876,"../../plots/cartesian/tick_value_defaults":878,"../../registry":931,"./attributes":984}],988:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../plots/cartesian/axis_autotype":839,"../../plots/cartesian/category_order_defaults":843,"../../plots/cartesian/set_convert":859,"../../plots/cartesian/tick_label_defaults":860,"../../plots/cartesian/tick_value_defaults":862,"../../registry":915,"./attributes":968}],972:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -212685,7 +214140,7 @@ module.exports = function calc(gd, trace) { return [t]; }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../heatmap/clean_2d_array":1087,"../heatmap/convert_column_xyz":1089,"./array_minmax":983,"./calc_clippath":989,"./calc_gridlines":990,"./calc_labels":991,"./cheater_basis":993,"./set_convert":1006,"./smooth_fill_2d_array":1007}],989:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../heatmap/clean_2d_array":1071,"../heatmap/convert_column_xyz":1073,"./array_minmax":967,"./calc_clippath":973,"./calc_gridlines":974,"./calc_labels":975,"./cheater_basis":977,"./set_convert":990,"./smooth_fill_2d_array":991}],973:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makeClipPath(xctrl, yctrl, aax, bax) { @@ -212728,7 +214183,7 @@ module.exports = function makeClipPath(xctrl, yctrl, aax, bax) { return segments; }; -},{}],990:[function(_dereq_,module,exports){ +},{}],974:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -213063,7 +214518,7 @@ module.exports = function calcGridlines(trace, axisLetter, crossAxisLetter) { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axes":854}],991:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axes":838}],975:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -213116,7 +214571,7 @@ module.exports = function calcLabels(trace, axis) { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axes":854}],992:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axes":838}],976:[function(_dereq_,module,exports){ 'use strict'; /* @@ -213151,7 +214606,7 @@ module.exports = function makeControlPoints(p0, p1, p2, smoothness) { ]]; }; -},{}],993:[function(_dereq_,module,exports){ +},{}],977:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -213211,7 +214666,7 @@ module.exports = function(a, b, cheaterslope) { return data; }; -},{"../../lib":803}],994:[function(_dereq_,module,exports){ +},{"../../lib":787}],978:[function(_dereq_,module,exports){ 'use strict'; var makeControlPoints = _dereq_('./catmull_rom'); @@ -213555,14 +215010,14 @@ module.exports = function computeControlPoints(xe, ye, x, y, asmoothing, bsmooth return [xe, ye]; }; -},{"../../lib":803,"./catmull_rom":992}],995:[function(_dereq_,module,exports){ +},{"../../lib":787,"./catmull_rom":976}],979:[function(_dereq_,module,exports){ 'use strict'; module.exports = { RELATIVE_CULL_TOLERANCE: 1e-6 }; -},{}],996:[function(_dereq_,module,exports){ +},{}],980:[function(_dereq_,module,exports){ 'use strict'; /* @@ -213706,7 +215161,7 @@ module.exports = function(arrays, asmoothing, bsmoothing) { } }; -},{}],997:[function(_dereq_,module,exports){ +},{}],981:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(arrays, asmoothing, bsmoothing) { @@ -213825,7 +215280,7 @@ module.exports = function(arrays, asmoothing, bsmoothing) { } }; -},{}],998:[function(_dereq_,module,exports){ +},{}],982:[function(_dereq_,module,exports){ 'use strict'; /* @@ -213967,7 +215422,7 @@ module.exports = function(arrays, na, nb, asmoothing, bsmoothing) { } }; -},{}],999:[function(_dereq_,module,exports){ +},{}],983:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -214017,7 +215472,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, dfltColor, fullLayou } }; -},{"../../components/color/attributes":665,"../../lib":803,"./ab_defaults":982,"./attributes":984,"./xy_defaults":1008}],1000:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib":787,"./ab_defaults":966,"./attributes":968,"./xy_defaults":992}],984:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -214036,7 +215491,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":984,"./calc":988,"./defaults":999,"./plot":1005}],1001:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":968,"./calc":972,"./defaults":983,"./plot":989}],985:[function(_dereq_,module,exports){ 'use strict'; /* @@ -214064,7 +215519,7 @@ module.exports = function(gd, trace) { return firstAxis; }; -},{}],1002:[function(_dereq_,module,exports){ +},{}],986:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makePath(xp, yp, isBicubic) { @@ -214088,7 +215543,7 @@ module.exports = function makePath(xp, yp, isBicubic) { return path.join(isBicubic ? '' : 'L'); }; -},{}],1003:[function(_dereq_,module,exports){ +},{}],987:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -214117,7 +215572,7 @@ module.exports = function mapArray(out, data, func) { return out; }; -},{"../../lib":803}],1004:[function(_dereq_,module,exports){ +},{"../../lib":787}],988:[function(_dereq_,module,exports){ 'use strict'; module.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) { @@ -214150,7 +215605,7 @@ module.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) { }; }; -},{}],1005:[function(_dereq_,module,exports){ +},{}],989:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -214392,7 +215847,7 @@ function drawAxisTitle(gd, layer, trace, t, xy, dxy, axis, xa, ya, labelOrientat titleJoin.exit().remove(); } -},{"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"./makepath":1002,"./map_1d_array":1003,"./orient_text":1004,"@plotly/d3":58}],1006:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"./makepath":986,"./map_1d_array":987,"./orient_text":988,"@plotly/d3":58}],990:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -214667,7 +216122,7 @@ module.exports = function setConvert(trace) { }; }; -},{"../../lib/search":823,"./compute_control_points":994,"./constants":995,"./create_i_derivative_evaluator":996,"./create_j_derivative_evaluator":997,"./create_spline_evaluator":998}],1007:[function(_dereq_,module,exports){ +},{"../../lib/search":807,"./compute_control_points":978,"./constants":979,"./create_i_derivative_evaluator":980,"./create_j_derivative_evaluator":981,"./create_spline_evaluator":982}],991:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -214881,7 +216336,7 @@ module.exports = function smoothFill2dArray(data, a, b) { return data; }; -},{"../../lib":803}],1008:[function(_dereq_,module,exports){ +},{"../../lib":787}],992:[function(_dereq_,module,exports){ 'use strict'; var isArray1D = _dereq_('../../lib').isArray1D; @@ -214906,7 +216361,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, coerce) { return true; }; -},{"../../lib":803}],1009:[function(_dereq_,module,exports){ +},{"../../lib":787}],993:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -214983,7 +216438,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/color/attributes":665,"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scattergeo/attributes":1260}],1010:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scattergeo/attributes":1244}],994:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -215036,7 +216491,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../scatter/arrays_to_calcdata":1217,"../scatter/calc_selection":1220,"fast-isnumeric":249}],1011:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../scatter/arrays_to_calcdata":1201,"../scatter/calc_selection":1204,"fast-isnumeric":246}],995:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -215084,7 +216539,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1009}],1012:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":993}],996:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -215101,7 +216556,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1013:[function(_dereq_,module,exports){ +},{}],997:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -215188,7 +216643,7 @@ function makeHoverInfo(pointData, trace, pt) { pointData.extraText = text.join('
'); } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./attributes":1009}],1014:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./attributes":993}],998:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -215212,7 +216667,7 @@ module.exports = { } }; -},{"../../plots/geo":887,"../heatmap/colorbar":1088,"./attributes":1009,"./calc":1010,"./defaults":1011,"./event_data":1012,"./hover":1013,"./plot":1015,"./select":1016,"./style":1017}],1015:[function(_dereq_,module,exports){ +},{"../../plots/geo":871,"../heatmap/colorbar":1072,"./attributes":993,"./calc":994,"./defaults":995,"./event_data":996,"./hover":997,"./plot":999,"./select":1000,"./style":1001}],999:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -215292,7 +216747,7 @@ module.exports = { plot: plot }; -},{"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/topojson_utils":832,"../../plots/cartesian/autorange":853,"./style":1017,"@plotly/d3":58}],1016:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/topojson_utils":816,"../../plots/cartesian/autorange":837,"./style":1001,"@plotly/d3":58}],1000:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -215333,7 +216788,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],1017:[function(_dereq_,module,exports){ +},{}],1001:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -215381,7 +216836,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/color":666,"../../components/colorscale":678,"../../components/drawing":688,"@plotly/d3":58}],1018:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../components/drawing":672,"@plotly/d3":58}],1002:[function(_dereq_,module,exports){ 'use strict'; var choroplethAttrs = _dereq_('../choropleth/attributes'); @@ -215469,7 +216924,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../choropleth/attributes":1009}],1019:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../choropleth/attributes":993}],1003:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -215617,7 +217072,7 @@ module.exports = { convertOnSelect: convertOnSelect }; -},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/geojson_utils":797,"fast-isnumeric":249}],1020:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/geojson_utils":781,"fast-isnumeric":246}],1004:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -215660,7 +217115,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1018}],1021:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1002}],1005:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -215713,7 +217168,7 @@ module.exports = { } }; -},{"../../plots/mapbox":911,"../choropleth/calc":1010,"../choropleth/event_data":1012,"../choropleth/hover":1013,"../choropleth/select":1016,"../heatmap/colorbar":1088,"./attributes":1018,"./defaults":1020,"./plot":1022}],1022:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":895,"../choropleth/calc":994,"../choropleth/event_data":996,"../choropleth/hover":997,"../choropleth/select":1000,"../heatmap/colorbar":1072,"./attributes":1002,"./defaults":1004,"./plot":1006}],1006:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert').convert; @@ -215832,7 +217287,7 @@ module.exports = function createChoroplethMapbox(subplot, calcTrace) { return choroplethMapbox; }; -},{"../../plots/mapbox/constants":909,"./convert":1019}],1023:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":893,"./convert":1003}],1007:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -215976,7 +217431,7 @@ attrs.transforms = undefined; module.exports = attrs; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1024:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1008:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -216012,7 +217467,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale/calc":674}],1025:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658}],1009:[function(_dereq_,module,exports){ 'use strict'; var conePlot = _dereq_('gl-cone3d'); @@ -216151,7 +217606,7 @@ function createConeTrace(scene, data) { module.exports = createConeTrace; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/gl3d/zip3":907,"gl-cone3d":268}],1026:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/gl3d/zip3":891,"gl-cone3d":262}],1010:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -216210,7 +217665,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1023}],1027:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1007}],1011:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -216236,7 +217691,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1023,"./calc":1024,"./convert":1025,"./defaults":1026}],1028:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1007,"./calc":1008,"./convert":1009,"./defaults":1010}],1012:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -216396,7 +217851,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../constants/filter_ops":775,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/font_attributes":883,"../heatmap/attributes":1085,"../scatter/attributes":1218}],1029:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../constants/filter_ops":759,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/font_attributes":867,"../heatmap/attributes":1069,"../scatter/attributes":1202}],1013:[function(_dereq_,module,exports){ 'use strict'; var Colorscale = _dereq_('../../components/colorscale'); @@ -216441,7 +217896,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../components/colorscale":678,"../heatmap/calc":1086,"./end_plus":1039,"./set_contours":1047}],1030:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../heatmap/calc":1070,"./end_plus":1023,"./set_contours":1031}],1014:[function(_dereq_,module,exports){ 'use strict'; module.exports = function(pathinfo, contours) { @@ -216523,7 +217978,7 @@ module.exports = function(pathinfo, contours) { } }; -},{}],1031:[function(_dereq_,module,exports){ +},{}],1015:[function(_dereq_,module,exports){ 'use strict'; var Colorscale = _dereq_('../../components/colorscale'); @@ -216566,7 +218021,7 @@ module.exports = { calc: calc }; -},{"../../components/colorscale":678,"./end_plus":1039,"./make_color_map":1044}],1032:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"./end_plus":1023,"./make_color_map":1028}],1016:[function(_dereq_,module,exports){ 'use strict'; module.exports = { // some constants to help with marching squares algorithm @@ -216636,7 +218091,7 @@ module.exports = { } }; -},{}],1033:[function(_dereq_,module,exports){ +},{}],1017:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -216721,7 +218176,7 @@ function handleConstraintValueDefaults(coerce, contours) { } } -},{"../../components/color":666,"../../constants/filter_ops":775,"./label_defaults":1043,"fast-isnumeric":249}],1034:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/filter_ops":759,"./label_defaults":1027,"fast-isnumeric":246}],1018:[function(_dereq_,module,exports){ 'use strict'; var filterOps = _dereq_('../../constants/filter_ops'); @@ -216792,7 +218247,7 @@ function makeInequalitySettings(operation) { }; } -},{"../../constants/filter_ops":775,"fast-isnumeric":249}],1035:[function(_dereq_,module,exports){ +},{"../../constants/filter_ops":759,"fast-isnumeric":246}],1019:[function(_dereq_,module,exports){ 'use strict'; module.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerce2) { @@ -216813,7 +218268,7 @@ module.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerc if(autoContour || !contourSize) coerce('ncontours'); }; -},{}],1036:[function(_dereq_,module,exports){ +},{}],1020:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -216905,7 +218360,7 @@ function copyPathinfo(pi) { }); } -},{"../../lib":803}],1037:[function(_dereq_,module,exports){ +},{"../../lib":787}],1021:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -216953,7 +218408,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../lib":803,"../heatmap/xyz_defaults":1099,"../scatter/period_defaults":1238,"./attributes":1028,"./constraint_defaults":1033,"./contours_defaults":1035,"./style_defaults":1049}],1038:[function(_dereq_,module,exports){ +},{"../../lib":787,"../heatmap/xyz_defaults":1083,"../scatter/period_defaults":1222,"./attributes":1012,"./constraint_defaults":1017,"./contours_defaults":1019,"./style_defaults":1033}],1022:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -217009,7 +218464,7 @@ module.exports = function emptyPathinfo(contours, plotinfo, cd0) { return pathinfo; }; -},{"../../lib":803,"./constraint_mapping":1034,"./end_plus":1039}],1039:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constraint_mapping":1018,"./end_plus":1023}],1023:[function(_dereq_,module,exports){ 'use strict'; /* @@ -217020,7 +218475,7 @@ module.exports = function endPlus(contours) { return contours.end + contours.size / 1e6; }; -},{}],1040:[function(_dereq_,module,exports){ +},{}],1024:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -217306,7 +218761,7 @@ function getInterpPx(pi, loc, step) { } } -},{"../../lib":803,"./constants":1032}],1041:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constants":1016}],1025:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -217335,7 +218790,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return hoverData; }; -},{"../../components/color":666,"../heatmap/hover":1092}],1042:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../heatmap/hover":1076}],1026:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -217355,7 +218810,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":1028,"./calc":1029,"./colorbar":1031,"./defaults":1037,"./hover":1041,"./plot":1046,"./style":1048}],1043:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1012,"./calc":1013,"./colorbar":1015,"./defaults":1021,"./hover":1025,"./plot":1030,"./style":1032}],1027:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -217376,7 +218831,7 @@ module.exports = function handleLabelDefaults(coerce, layout, lineColor, opts) { if(opts.hasHover !== false) coerce('zhoverformat'); }; -},{"../../lib":803}],1044:[function(_dereq_,module,exports){ +},{"../../lib":787}],1028:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -217452,7 +218907,7 @@ module.exports = function makeColorMap(trace) { ); }; -},{"../../components/colorscale":678,"./end_plus":1039,"@plotly/d3":58}],1045:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"./end_plus":1023,"@plotly/d3":58}],1029:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -217536,7 +218991,7 @@ function getMarchingIndex(val, corners) { return (mi === 15) ? 0 : mi; } -},{"./constants":1032}],1046:[function(_dereq_,module,exports){ +},{"./constants":1016}],1030:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -218218,7 +219673,7 @@ function makeClipMask(cd0) { return z; } -},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/set_convert":875,"../heatmap/plot":1096,"./close_boundaries":1030,"./constants":1032,"./convert_to_constraints":1036,"./empty_pathinfo":1038,"./find_all_paths":1040,"./make_crossings":1045,"@plotly/d3":58}],1047:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/set_convert":859,"../heatmap/plot":1080,"./close_boundaries":1014,"./constants":1016,"./convert_to_constraints":1020,"./empty_pathinfo":1022,"./find_all_paths":1024,"./make_crossings":1029,"@plotly/d3":58}],1031:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -218314,7 +219769,7 @@ function autoContours(start, end, ncontours) { return dummyAx; } -},{"../../lib":803,"../../plots/cartesian/axes":854}],1048:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838}],1032:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -218386,7 +219841,7 @@ module.exports = function style(gd) { heatmapStyle(gd); }; -},{"../../components/drawing":688,"../heatmap/style":1097,"./make_color_map":1044,"@plotly/d3":58}],1049:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../heatmap/style":1081,"./make_color_map":1028,"@plotly/d3":58}],1033:[function(_dereq_,module,exports){ 'use strict'; var colorscaleDefaults = _dereq_('../../components/colorscale/defaults'); @@ -218422,7 +219877,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout, handleLabelDefaults(coerce, layout, lineColor, opts); }; -},{"../../components/colorscale/defaults":676,"./label_defaults":1043}],1050:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"./label_defaults":1027}],1034:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -218495,7 +219950,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../contour/attributes":1028,"../heatmap/attributes":1085}],1051:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../contour/attributes":1012,"../heatmap/attributes":1069}],1035:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -218599,7 +220054,7 @@ function heatmappishCalc(gd, trace) { return [cd0]; } -},{"../../components/colorscale/calc":674,"../../lib":803,"../carpet/lookup_carpetid":1001,"../contour/set_contours":1047,"../heatmap/clean_2d_array":1087,"../heatmap/convert_column_xyz":1089,"../heatmap/find_empties":1091,"../heatmap/interp2d":1094,"../heatmap/make_bound_array":1095,"./defaults":1052}],1052:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../lib":787,"../carpet/lookup_carpetid":985,"../contour/set_contours":1031,"../heatmap/clean_2d_array":1071,"../heatmap/convert_column_xyz":1073,"../heatmap/find_empties":1075,"../heatmap/interp2d":1078,"../heatmap/make_bound_array":1079,"./defaults":1036}],1036:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -218659,7 +220114,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../lib":803,"../contour/constraint_defaults":1033,"../contour/contours_defaults":1035,"../contour/style_defaults":1049,"../heatmap/xyz_defaults":1099,"./attributes":1050}],1053:[function(_dereq_,module,exports){ +},{"../../lib":787,"../contour/constraint_defaults":1017,"../contour/contours_defaults":1019,"../contour/style_defaults":1033,"../heatmap/xyz_defaults":1083,"./attributes":1034}],1037:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -218678,7 +220133,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../contour/colorbar":1031,"../contour/style":1048,"./attributes":1050,"./calc":1051,"./defaults":1052,"./plot":1054}],1054:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../contour/colorbar":1015,"../contour/style":1032,"./attributes":1034,"./calc":1035,"./defaults":1036,"./plot":1038}],1038:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -219151,7 +220606,7 @@ function joinAllPaths(trace, pi, perimeter, ab2p, carpet, carpetcd, xa, ya) { return fullpath; } -},{"../../components/drawing":688,"../../lib":803,"../carpet/axis_aligned_line":985,"../carpet/lookup_carpetid":1001,"../carpet/makepath":1002,"../carpet/map_1d_array":1003,"../contour/close_boundaries":1030,"../contour/constants":1032,"../contour/convert_to_constraints":1036,"../contour/empty_pathinfo":1038,"../contour/find_all_paths":1040,"../contour/make_crossings":1045,"../contour/plot":1046,"@plotly/d3":58}],1055:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../carpet/axis_aligned_line":969,"../carpet/lookup_carpetid":985,"../carpet/makepath":986,"../carpet/map_1d_array":987,"../contour/close_boundaries":1014,"../contour/constants":1016,"../contour/convert_to_constraints":1020,"../contour/empty_pathinfo":1022,"../contour/find_all_paths":1024,"../contour/make_crossings":1029,"../contour/plot":1030,"@plotly/d3":58}],1039:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -219220,7 +220675,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scattermapbox/attributes":1283}],1056:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scattermapbox/attributes":1267}],1040:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -219271,7 +220726,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],1057:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],1041:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -219379,7 +220834,7 @@ module.exports = function convert(calcTrace) { return opts; }; -},{"../../components/color":666,"../../components/colorscale":678,"../../constants/numerical":779,"../../lib":803,"../../lib/geojson_utils":797,"fast-isnumeric":249}],1058:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../constants/numerical":763,"../../lib":787,"../../lib/geojson_utils":781,"fast-isnumeric":246}],1042:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -219413,7 +220868,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1055}],1059:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1039}],1043:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -219423,7 +220878,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],1060:[function(_dereq_,module,exports){ +},{}],1044:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -219453,7 +220908,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { return [newPointData]; }; -},{"../../plots/cartesian/axes":854,"../scattermapbox/hover":1288}],1061:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../scattermapbox/hover":1272}],1045:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -219491,7 +220946,7 @@ module.exports = { } }; -},{"../../plots/mapbox":911,"../heatmap/colorbar":1088,"../scattermapbox/format_labels":1287,"./attributes":1055,"./calc":1056,"./defaults":1058,"./event_data":1059,"./hover":1060,"./plot":1062}],1062:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":895,"../heatmap/colorbar":1072,"../scattermapbox/format_labels":1271,"./attributes":1039,"./calc":1040,"./defaults":1042,"./event_data":1043,"./hover":1044,"./plot":1046}],1046:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert'); @@ -219597,7 +221052,7 @@ module.exports = function createDensityMapbox(subplot, calcTrace) { return densityMapbox; }; -},{"../../plots/mapbox/constants":909,"./convert":1057}],1063:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":893,"./convert":1041}],1047:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -219622,7 +221077,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":803}],1064:[function(_dereq_,module,exports){ +},{"../../lib":787}],1048:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -219723,7 +221178,7 @@ function funnelMarker() { return marker; } -},{"../../components/color":666,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218,"./constants":1066}],1065:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202,"./constants":1050}],1049:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -219823,7 +221278,7 @@ function fixNum(a) { return (a === BADNUM) ? 0 : a; } -},{"../../constants/numerical":779,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../scatter/calc_selection":1220,"./arrays_to_calcdata":1063}],1066:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../scatter/calc_selection":1204,"./arrays_to_calcdata":1047}],1050:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -219834,7 +221289,7 @@ module.exports = { ] }; -},{}],1067:[function(_dereq_,module,exports){ +},{}],1051:[function(_dereq_,module,exports){ 'use strict'; var setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions; @@ -219897,7 +221352,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../bar/cross_trace_calc":944}],1068:[function(_dereq_,module,exports){ +},{"../bar/cross_trace_calc":928}],1052:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -219991,7 +221446,7 @@ module.exports = { crossTraceDefaults: crossTraceDefaults }; -},{"../../components/color":666,"../../lib":803,"../bar/defaults":945,"../scatter/period_defaults":1238,"../scatter/xy_defaults":1245,"./attributes":1064}],1069:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/defaults":929,"../scatter/period_defaults":1222,"../scatter/xy_defaults":1229,"./attributes":1048}],1053:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { @@ -220010,7 +221465,7 @@ module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { return out; }; -},{}],1070:[function(_dereq_,module,exports){ +},{}],1054:[function(_dereq_,module,exports){ 'use strict'; var opacity = _dereq_('../../components/color').opacity; @@ -220075,7 +221530,7 @@ function getTraceColor(trace, di) { else if(opacity(mlc) && mlw) return mlc; } -},{"../../components/color":666,"../../lib":803,"../bar/hover":948}],1071:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/hover":932}],1055:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -220101,7 +221556,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../bar/select":953,"./attributes":1064,"./calc":1065,"./cross_trace_calc":1067,"./defaults":1068,"./event_data":1069,"./hover":1070,"./layout_attributes":1072,"./layout_defaults":1073,"./plot":1074,"./style":1075}],1072:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../bar/select":937,"./attributes":1048,"./calc":1049,"./cross_trace_calc":1051,"./defaults":1052,"./event_data":1053,"./hover":1054,"./layout_attributes":1056,"./layout_defaults":1057,"./plot":1058,"./style":1059}],1056:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -220126,7 +221581,7 @@ module.exports = { } }; -},{}],1073:[function(_dereq_,module,exports){ +},{}],1057:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -220155,7 +221610,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"./layout_attributes":1072}],1074:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1056}],1058:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -220316,7 +221771,7 @@ function getXY(di, xa, ya, isHorizontal) { return isHorizontal ? [s, p] : [p, s]; } -},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../bar/plot":952,"../bar/uniform_text":957,"@plotly/d3":58}],1075:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../bar/plot":936,"../bar/uniform_text":941,"@plotly/d3":58}],1059:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -220373,7 +221828,7 @@ module.exports = { style: style }; -},{"../../components/color":666,"../../components/drawing":688,"../../constants/interactions":778,"../bar/style":955,"../bar/uniform_text":957,"@plotly/d3":58}],1076:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/interactions":762,"../bar/style":939,"../bar/uniform_text":941,"@plotly/d3":58}],1060:[function(_dereq_,module,exports){ 'use strict'; var pieAttrs = _dereq_('../pie/attributes'); @@ -220461,7 +221916,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192}],1077:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176}],1061:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -220476,7 +221931,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1078:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1062:[function(_dereq_,module,exports){ 'use strict'; var pieCalc = _dereq_('../pie/calc'); @@ -220494,7 +221949,7 @@ module.exports = { crossTraceCalc: crossTraceCalc }; -},{"../pie/calc":1194}],1079:[function(_dereq_,module,exports){ +},{"../pie/calc":1178}],1063:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -220568,7 +222023,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('baseratio'); }; -},{"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"../pie/defaults":1195,"./attributes":1076}],1080:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"../pie/defaults":1179,"./attributes":1060}],1064:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -220593,7 +222048,7 @@ module.exports = { } }; -},{"../pie/style_one":1203,"./attributes":1076,"./base_plot":1077,"./calc":1078,"./defaults":1079,"./layout_attributes":1081,"./layout_defaults":1082,"./plot":1083,"./style":1084}],1081:[function(_dereq_,module,exports){ +},{"../pie/style_one":1187,"./attributes":1060,"./base_plot":1061,"./calc":1062,"./defaults":1063,"./layout_attributes":1065,"./layout_defaults":1066,"./plot":1067,"./style":1068}],1065:[function(_dereq_,module,exports){ 'use strict'; var hiddenlabels = _dereq_('../pie/layout_attributes').hiddenlabels; @@ -220612,7 +222067,7 @@ module.exports = { } }; -},{"../pie/layout_attributes":1199}],1082:[function(_dereq_,module,exports){ +},{"../pie/layout_attributes":1183}],1066:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -220629,7 +222084,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendfunnelareacolors'); }; -},{"../../lib":803,"./layout_attributes":1081}],1083:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1065}],1067:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -220919,7 +222374,7 @@ function setCoords(cd) { } } -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../bar/plot":952,"../bar/uniform_text":957,"../pie/helpers":1197,"../pie/plot":1201,"@plotly/d3":58}],1084:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../bar/plot":936,"../bar/uniform_text":941,"../pie/helpers":1181,"../pie/plot":1185,"@plotly/d3":58}],1068:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -220944,7 +222399,7 @@ module.exports = function style(gd) { }); }; -},{"../bar/uniform_text":957,"../pie/style_one":1203,"@plotly/d3":58}],1085:[function(_dereq_,module,exports){ +},{"../bar/uniform_text":941,"../pie/style_one":1187,"@plotly/d3":58}],1069:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -221036,7 +222491,7 @@ module.exports = extendFlat({ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1086:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1070:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -221237,7 +222692,7 @@ function dropZonBreaks(x, y, z) { return newZ; } -},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../../registry":931,"../histogram2d/calc":1118,"./clean_2d_array":1087,"./convert_column_xyz":1089,"./find_empties":1091,"./interp2d":1094,"./make_bound_array":1095}],1087:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../../registry":915,"../histogram2d/calc":1102,"./clean_2d_array":1071,"./convert_column_xyz":1073,"./find_empties":1075,"./interp2d":1078,"./make_bound_array":1079}],1071:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -221306,7 +222761,7 @@ module.exports = function clean2dArray(zOld, trace, xa, ya) { return zNew; }; -},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],1088:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],1072:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -221314,7 +222769,7 @@ module.exports = { max: 'zmax' }; -},{}],1089:[function(_dereq_,module,exports){ +},{}],1073:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -221395,7 +222850,7 @@ module.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name, trace._after2before = after2before; }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851}],1090:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835}],1074:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -221434,7 +222889,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../scatter/period_defaults":1238,"./attributes":1085,"./style_defaults":1098,"./xyz_defaults":1099}],1091:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../scatter/period_defaults":1222,"./attributes":1069,"./style_defaults":1082,"./xyz_defaults":1083}],1075:[function(_dereq_,module,exports){ 'use strict'; var maxRowLength = _dereq_('../../lib').maxRowLength; @@ -221531,7 +222986,7 @@ module.exports = function findEmpties(z) { return empties.sort(function(a, b) { return b[2] - a[2]; }); }; -},{"../../lib":803}],1092:[function(_dereq_,module,exports){ +},{"../../lib":787}],1076:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -221664,7 +223119,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { })]; }; -},{"../../components/colorscale":678,"../../components/fx":706,"../../lib":803,"../../plots/cartesian/axes":854}],1093:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/fx":690,"../../lib":787,"../../plots/cartesian/axes":838}],1077:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -221684,7 +223139,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":1085,"./calc":1086,"./colorbar":1088,"./defaults":1090,"./hover":1092,"./plot":1096,"./style":1097}],1094:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1069,"./calc":1070,"./colorbar":1072,"./defaults":1074,"./hover":1076,"./plot":1080,"./style":1081}],1078:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -221809,7 +223264,7 @@ function iterateInterp2d(z, emptyPoints, overshoot) { return maxFractionalChange; } -},{"../../lib":803}],1095:[function(_dereq_,module,exports){ +},{"../../lib":787}],1079:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -221889,7 +223344,7 @@ module.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks, return arrayOut; }; -},{"../../lib":803,"../../registry":931}],1096:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1080:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -222285,7 +223740,7 @@ function putColor(pixels, pxIndex, c) { pixels[pxIndex + 3] = Math.round(c[3] * 255); } -},{"../../components/colorscale":678,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../registry":931,"@plotly/d3":58,"tinycolor2":598}],1097:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../registry":915,"@plotly/d3":58,"tinycolor2":583}],1081:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -222297,7 +223752,7 @@ module.exports = function style(gd) { }); }; -},{"@plotly/d3":58}],1098:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],1082:[function(_dereq_,module,exports){ 'use strict'; module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) { @@ -222311,7 +223766,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) { coerce('zhoverformat'); }; -},{}],1099:[function(_dereq_,module,exports){ +},{}],1083:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -222402,7 +223857,7 @@ function isValidZ(z) { return (allRowsAreArrays && oneRowIsFilled && hasOneNumber); } -},{"../../lib":803,"../../registry":931,"fast-isnumeric":249}],1100:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"fast-isnumeric":246}],1084:[function(_dereq_,module,exports){ 'use strict'; var heatmapAttrs = _dereq_('../heatmap/attributes'); @@ -222440,7 +223895,7 @@ extendFlat( module.exports = overrideAll(attrs, 'calc', 'nested'); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../heatmap/attributes":1085}],1101:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../heatmap/attributes":1069}],1085:[function(_dereq_,module,exports){ 'use strict'; var createHeatmap2D = _dereq_('gl-heatmap2d'); @@ -222583,7 +224038,7 @@ function createHeatmap(scene, fullTrace, calcTrace) { module.exports = createHeatmap; -},{"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"gl-heatmap2d":278}],1102:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"gl-heatmap2d":272}],1086:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -222610,7 +224065,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../heatmap/xyz_defaults":1099,"./attributes":1100}],1103:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../heatmap/xyz_defaults":1083,"./attributes":1084}],1087:[function(_dereq_,module,exports){ 'use strict'; var deprecationWarning = [ @@ -222636,7 +224091,7 @@ module.exports = { } }; -},{"../../plots/gl2d":894,"../heatmap/calc":1086,"../heatmap/colorbar":1088,"./attributes":1100,"./convert":1101,"./defaults":1102}],1104:[function(_dereq_,module,exports){ +},{"../../plots/gl2d":878,"../heatmap/calc":1070,"../heatmap/colorbar":1072,"./attributes":1084,"./convert":1085,"./defaults":1086}],1088:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -222749,7 +224204,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"./bin_attributes":1106,"./constants":1110}],1105:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"./bin_attributes":1090,"./constants":1094}],1089:[function(_dereq_,module,exports){ 'use strict'; @@ -222765,7 +224220,7 @@ module.exports = function doAvg(size, counts) { return total; }; -},{}],1106:[function(_dereq_,module,exports){ +},{}],1090:[function(_dereq_,module,exports){ 'use strict'; module.exports = function makeBinAttrs(axLetter, match) { @@ -222786,7 +224241,7 @@ module.exports = function makeBinAttrs(axLetter, match) { }; }; -},{}],1107:[function(_dereq_,module,exports){ +},{}],1091:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -222851,7 +224306,7 @@ module.exports = { } }; -},{"fast-isnumeric":249}],1108:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246}],1092:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -223018,7 +224473,7 @@ function dateParts(v, pa, calendar) { return parts; } -},{"../../constants/numerical":779,"../../plots/cartesian/axes":854}],1109:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../plots/cartesian/axes":838}],1093:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -223589,14 +225044,14 @@ module.exports = { calcAllAutoBins: calcAllAutoBins }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"../bar/arrays_to_calcdata":940,"./average":1105,"./bin_functions":1107,"./bin_label_vals":1108,"./norm_functions":1116,"fast-isnumeric":249}],1110:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"../bar/arrays_to_calcdata":924,"./average":1089,"./bin_functions":1091,"./bin_label_vals":1092,"./norm_functions":1100,"fast-isnumeric":246}],1094:[function(_dereq_,module,exports){ 'use strict'; module.exports = { eventDataKeys: ['binNumber'] }; -},{}],1111:[function(_dereq_,module,exports){ +},{}],1095:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -223865,7 +225320,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) { } }; -},{"../../lib":803,"../../plots/cartesian/axis_ids":858,"../../plots/cartesian/constraints":862,"../../registry":931,"../bar/defaults":945}],1112:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axis_ids":842,"../../plots/cartesian/constraints":846,"../../registry":915,"../bar/defaults":929}],1096:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -223933,7 +225388,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'}); }; -},{"../../components/color":666,"../../lib":803,"../../registry":931,"../bar/style_defaults":956,"./attributes":1104}],1113:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../registry":915,"../bar/style_defaults":940,"./attributes":1088}],1097:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -223974,7 +225429,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1114:[function(_dereq_,module,exports){ +},{}],1098:[function(_dereq_,module,exports){ 'use strict'; var barHover = _dereq_('../bar/hover').hoverPoints; @@ -223998,7 +225453,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return pts; }; -},{"../../plots/cartesian/axes":854,"../bar/hover":948}],1115:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../bar/hover":932}],1099:[function(_dereq_,module,exports){ 'use strict'; /** @@ -224039,7 +225494,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../bar/cross_trace_calc":944,"../bar/layout_attributes":950,"../bar/layout_defaults":951,"../bar/plot":952,"../bar/select":953,"../bar/style":955,"../scatter/marker_colorbar":1236,"./attributes":1104,"./calc":1109,"./cross_trace_defaults":1111,"./defaults":1112,"./event_data":1113,"./hover":1114}],1116:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../bar/cross_trace_calc":928,"../bar/layout_attributes":934,"../bar/layout_defaults":935,"../bar/plot":936,"../bar/select":937,"../bar/style":939,"../scatter/marker_colorbar":1220,"./attributes":1088,"./calc":1093,"./cross_trace_defaults":1095,"./defaults":1096,"./event_data":1097,"./hover":1098}],1100:[function(_dereq_,module,exports){ 'use strict'; @@ -224065,7 +225520,7 @@ module.exports = { } }; -},{}],1117:[function(_dereq_,module,exports){ +},{}],1101:[function(_dereq_,module,exports){ 'use strict'; var histogramAttrs = _dereq_('../histogram/attributes'); @@ -224123,7 +225578,7 @@ module.exports = extendFlat( colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false}) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../heatmap/attributes":1085,"../histogram/attributes":1104,"../histogram/bin_attributes":1106}],1118:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../heatmap/attributes":1069,"../histogram/attributes":1088,"../histogram/bin_attributes":1090}],1102:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224334,7 +225789,7 @@ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) { return out; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"../histogram/average":1105,"../histogram/bin_functions":1107,"../histogram/bin_label_vals":1108,"../histogram/calc":1109,"../histogram/norm_functions":1116}],1119:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../histogram/average":1089,"../histogram/bin_functions":1091,"../histogram/bin_label_vals":1092,"../histogram/calc":1093,"../histogram/norm_functions":1100}],1103:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224360,7 +225815,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('yhoverformat'); }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../heatmap/style_defaults":1098,"./attributes":1117,"./sample_defaults":1122}],1120:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../heatmap/style_defaults":1082,"./attributes":1101,"./sample_defaults":1106}],1104:[function(_dereq_,module,exports){ 'use strict'; var heatmapHover = _dereq_('../heatmap/hover'); @@ -224386,7 +225841,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return pts; }; -},{"../../plots/cartesian/axes":854,"../heatmap/hover":1092}],1121:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../heatmap/hover":1076}],1105:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -224409,7 +225864,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../heatmap/calc":1086,"../heatmap/colorbar":1088,"../heatmap/plot":1096,"../heatmap/style":1097,"../histogram/cross_trace_defaults":1111,"../histogram/event_data":1113,"./attributes":1117,"./defaults":1119,"./hover":1120}],1122:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../heatmap/calc":1070,"../heatmap/colorbar":1072,"../heatmap/plot":1080,"../heatmap/style":1081,"../histogram/cross_trace_defaults":1095,"../histogram/event_data":1097,"./attributes":1101,"./defaults":1103,"./hover":1104}],1106:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -224446,7 +225901,7 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout coerce('autobiny'); }; -},{"../../lib":803,"../../registry":931}],1123:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1107:[function(_dereq_,module,exports){ 'use strict'; var histogram2dAttrs = _dereq_('../histogram2d/attributes'); @@ -224498,7 +225953,7 @@ module.exports = extendFlat({ }) ); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../contour/attributes":1028,"../histogram2d/attributes":1117}],1124:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../contour/attributes":1012,"../histogram2d/attributes":1101}],1108:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224528,7 +225983,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('yhoverformat'); }; -},{"../../lib":803,"../contour/contours_defaults":1035,"../contour/style_defaults":1049,"../histogram2d/sample_defaults":1122,"./attributes":1123}],1125:[function(_dereq_,module,exports){ +},{"../../lib":787,"../contour/contours_defaults":1019,"../contour/style_defaults":1033,"../histogram2d/sample_defaults":1106,"./attributes":1107}],1109:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -224550,7 +226005,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../contour/calc":1029,"../contour/colorbar":1031,"../contour/hover":1041,"../contour/plot":1046,"../contour/style":1048,"../histogram/cross_trace_defaults":1111,"./attributes":1123,"./defaults":1124}],1126:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../contour/calc":1013,"../contour/colorbar":1015,"../contour/hover":1025,"../contour/plot":1030,"../contour/style":1032,"../histogram/cross_trace_defaults":1095,"./attributes":1107,"./defaults":1108}],1110:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -224637,7 +226092,7 @@ module.exports = { domain: domainAttrs({name: 'icicle', trace: true, editType: 'calc'}), }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"../sunburst/attributes":1330,"../treemap/attributes":1356,"../treemap/constants":1359}],1127:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"../sunburst/attributes":1314,"../treemap/attributes":1340,"../treemap/constants":1343}],1111:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -224652,7 +226107,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1128:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1112:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('../sunburst/calc'); @@ -224665,7 +226120,7 @@ exports.crossTraceCalc = function(gd) { return calc._runCrossTraceCalc('icicle', gd); }; -},{"../sunburst/calc":1332}],1129:[function(_dereq_,module,exports){ +},{"../sunburst/calc":1316}],1113:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -224768,7 +226223,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/color":666,"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/constants":943,"../bar/defaults":945,"./attributes":1126}],1130:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/constants":927,"../bar/defaults":929,"./attributes":1110}],1114:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -224976,7 +226431,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) { return nextOfPrevEntry; }; -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"../sunburst/plot":1340,"../treemap/constants":1359,"./partition":1134,"./style":1136,"@plotly/d3":58}],1131:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"../sunburst/plot":1324,"../treemap/constants":1343,"./partition":1118,"./style":1120,"@plotly/d3":58}],1115:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -225003,7 +226458,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":1236,"./attributes":1126,"./base_plot":1127,"./calc":1128,"./defaults":1129,"./layout_attributes":1132,"./layout_defaults":1133,"./plot":1135,"./style":1136}],1132:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1220,"./attributes":1110,"./base_plot":1111,"./calc":1112,"./defaults":1113,"./layout_attributes":1116,"./layout_defaults":1117,"./plot":1119,"./style":1120}],1116:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -225018,7 +226473,7 @@ module.exports = { } }; -},{}],1133:[function(_dereq_,module,exports){ +},{}],1117:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -225032,7 +226487,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendiciclecolors'); }; -},{"../../lib":803,"./layout_attributes":1132}],1134:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1116}],1118:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -225068,7 +226523,7 @@ module.exports = function partition(entry, size, opts) { return result; }; -},{"../treemap/flip_tree":1364,"d3-hierarchy":170}],1135:[function(_dereq_,module,exports){ +},{"../treemap/flip_tree":1348,"d3-hierarchy":167}],1119:[function(_dereq_,module,exports){ 'use strict'; var draw = _dereq_('../treemap/draw'); @@ -225081,7 +226536,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall }); }; -},{"../treemap/draw":1361,"./draw_descendants":1130}],1136:[function(_dereq_,module,exports){ +},{"../treemap/draw":1345,"./draw_descendants":1114}],1120:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -225124,7 +226579,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"@plotly/d3":58}],1137:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"@plotly/d3":58}],1121:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -225220,7 +226675,7 @@ module.exports = extendFlat({ transforms: undefined }); -},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"./constants":1139}],1138:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"./constants":1123}],1122:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -225310,7 +226765,7 @@ function makeScaler(trace) { }; } -},{"../../lib":803,"../../plots/cartesian/axes":854,"./constants":1139,"./helpers":1142,"fast-isnumeric":249}],1139:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"./constants":1123,"./helpers":1126,"fast-isnumeric":246}],1123:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -225376,7 +226831,7 @@ module.exports = { ].join('; ') }; -},{}],1140:[function(_dereq_,module,exports){ +},{}],1124:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -225426,7 +226881,7 @@ module.exports = function supplyDefaults(traceIn, traceOut) { traceOut._length = null; }; -},{"../../lib":803,"../../snapshot/helpers":935,"./attributes":1137,"./constants":1139}],1141:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../snapshot/helpers":919,"./attributes":1121,"./constants":1123}],1125:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt) { @@ -225440,7 +226895,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],1142:[function(_dereq_,module,exports){ +},{}],1126:[function(_dereq_,module,exports){ 'use strict'; var probeSync = _dereq_('probe-image-size/sync'); @@ -225453,7 +226908,7 @@ exports.getImageSize = function(src) { return probeSync(buff); }; -},{"../../snapshot/helpers":935,"buffer/":117,"probe-image-size/sync":527}],1143:[function(_dereq_,module,exports){ +},{"../../snapshot/helpers":919,"buffer/":117,"probe-image-size/sync":513}],1127:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -225545,7 +227000,7 @@ module.exports = function hoverPoints(pointData, xval, yval) { })]; }; -},{"../../components/fx":706,"../../lib":803,"./constants":1139}],1144:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../lib":787,"./constants":1123}],1128:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -225566,7 +227021,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./attributes":1137,"./calc":1138,"./defaults":1140,"./event_data":1141,"./hover":1143,"./plot":1145,"./style":1146}],1145:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1121,"./calc":1122,"./defaults":1124,"./event_data":1125,"./hover":1127,"./plot":1129,"./style":1130}],1129:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -225789,7 +227244,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) { }); }; -},{"../../constants/xmlns_namespaces":780,"../../lib":803,"./constants":1139,"@plotly/d3":58}],1146:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":764,"../../lib":787,"./constants":1123,"@plotly/d3":58}],1130:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -225801,7 +227256,7 @@ module.exports = function style(gd) { }); }; -},{"@plotly/d3":58}],1147:[function(_dereq_,module,exports){ +},{"@plotly/d3":58}],1131:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -226054,7 +227509,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../constants/delta.js":773,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/layout_attributes":869,"../../plots/domain":882,"../../plots/font_attributes":883}],1148:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../constants/delta.js":757,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/layout_attributes":853,"../../plots/domain":866,"../../plots/font_attributes":867}],1132:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -226069,7 +227524,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1149:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1133:[function(_dereq_,module,exports){ 'use strict'; // var Lib = require('../../lib'); @@ -226098,7 +227553,7 @@ module.exports = { calc: calc }; -},{}],1150:[function(_dereq_,module,exports){ +},{}],1134:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -226112,7 +227567,7 @@ module.exports = { horizontalPadding: 10 }; -},{}],1151:[function(_dereq_,module,exports){ +},{}],1135:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -226271,7 +227726,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../../plots/cartesian/tick_label_defaults":876,"../../plots/cartesian/tick_mark_defaults":877,"../../plots/cartesian/tick_value_defaults":878,"../../plots/domain":882,"./attributes":1147,"./constants.js":1150}],1152:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../../plots/cartesian/tick_label_defaults":860,"../../plots/cartesian/tick_mark_defaults":861,"../../plots/cartesian/tick_value_defaults":862,"../../plots/domain":866,"./attributes":1131,"./constants.js":1134}],1136:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -226292,7 +227747,7 @@ module.exports = { } }; -},{"./attributes":1147,"./base_plot":1148,"./calc":1149,"./defaults":1151,"./plot":1153}],1153:[function(_dereq_,module,exports){ +},{"./attributes":1131,"./base_plot":1132,"./calc":1133,"./defaults":1135,"./plot":1137}],1137:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -227166,7 +228621,7 @@ function cache(trace, name, initialValue, value, key, fn) { return v; } -},{"../../components/color":666,"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_defaults":856,"../../plots/cartesian/layout_attributes":869,"../../plots/cartesian/position_defaults":872,"./constants":1150,"@plotly/d3":58,"d3-interpolate":171}],1154:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_defaults":840,"../../plots/cartesian/layout_attributes":853,"../../plots/cartesian/position_defaults":856,"./constants":1134,"@plotly/d3":58,"d3-interpolate":168}],1138:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -227320,7 +228775,7 @@ attrs.flatshading.dflt = true; attrs.lighting.facenormalsepsilon.dflt = 0; attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1155:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1139:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -227367,7 +228822,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale/calc":674,"../streamtube/calc":1326}],1156:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../streamtube/calc":1310}],1140:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -228415,7 +229870,7 @@ module.exports = { createIsosurfaceTrace: createIsosurfaceTrace, }; -},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"gl-mesh3d":315}],1157:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"gl-mesh3d":309}],1141:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -228527,7 +229982,7 @@ module.exports = { supplyIsoDefaults: supplyIsoDefaults }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1154}],1158:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1138}],1142:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -228548,7 +230003,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1154,"./calc":1155,"./convert":1156,"./defaults":1157}],1159:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1138,"./calc":1139,"./convert":1140,"./defaults":1141}],1143:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -228696,7 +230151,7 @@ colorScaleAttrs('', { showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) }); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../surface/attributes":1342}],1160:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../surface/attributes":1326}],1144:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -228711,7 +230166,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":674}],1161:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658}],1145:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -228906,7 +230361,7 @@ function createMesh3DTrace(scene, data) { module.exports = createMesh3DTrace; -},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"alpha-shape":75,"convex-hull":141,"delaunay-triangulate":180,"gl-mesh3d":315}],1162:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"alpha-shape":75,"convex-hull":141,"delaunay-triangulate":177,"gl-mesh3d":309}],1146:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -229002,7 +230457,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1159}],1163:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1143}],1147:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -229023,7 +230478,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1159,"./calc":1160,"./convert":1161,"./defaults":1162}],1164:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1143,"./calc":1144,"./convert":1145,"./defaults":1146}],1148:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib').extendFlat; @@ -229125,7 +230580,7 @@ module.exports = { }), }; -},{"../../components/drawing/attributes":687,"../../components/fx/attributes":697,"../../constants/delta.js":773,"../../lib":803,"../../plots/cartesian/axis_format_attributes":857,"../scatter/attributes":1218}],1165:[function(_dereq_,module,exports){ +},{"../../components/drawing/attributes":671,"../../components/fx/attributes":681,"../../constants/delta.js":757,"../../lib":787,"../../plots/cartesian/axis_format_attributes":841,"../scatter/attributes":1202}],1149:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -229298,7 +230753,7 @@ module.exports = { calcCommon: calcCommon }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854}],1166:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838}],1150:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -229340,7 +230795,7 @@ function handleDirection(traceIn, traceOut, coerce, direction) { coerce(direction + '.line.dash', traceOut.line.dash); } -},{"../../lib":803,"../scatter/period_defaults":1238,"./attributes":1164,"./ohlc_defaults":1169}],1167:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/period_defaults":1222,"./attributes":1148,"./ohlc_defaults":1153}],1151:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -229539,7 +230994,7 @@ module.exports = { hoverOnPoints: hoverOnPoints }; -},{"../../components/color":666,"../../components/fx":706,"../../constants/delta.js":773,"../../lib":803,"../../plots/cartesian/axes":854}],1168:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../constants/delta.js":757,"../../lib":787,"../../plots/cartesian/axes":838}],1152:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -229559,7 +231014,7 @@ module.exports = { selectPoints: _dereq_('./select') }; -},{"../../plots/cartesian":868,"./attributes":1164,"./calc":1165,"./defaults":1166,"./hover":1167,"./plot":1170,"./select":1171,"./style":1172}],1169:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./attributes":1148,"./calc":1149,"./defaults":1150,"./hover":1151,"./plot":1154,"./select":1155,"./style":1156}],1153:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -229586,7 +231041,7 @@ module.exports = function handleOHLC(traceIn, traceOut, coerce, layout) { return len; }; -},{"../../lib":803,"../../registry":931}],1170:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1154:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -229636,7 +231091,7 @@ module.exports = function plot(gd, plotinfo, cdOHLC, ohlcLayer) { }); }; -},{"../../lib":803,"@plotly/d3":58}],1171:[function(_dereq_,module,exports){ +},{"../../lib":787,"@plotly/d3":58}],1155:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -229673,7 +231128,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],1172:[function(_dereq_,module,exports){ +},{}],1156:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -229704,7 +231159,7 @@ module.exports = function style(gd, cd, sel) { }); }; -},{"../../components/color":666,"../../components/drawing":688,"@plotly/d3":58}],1173:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"@plotly/d3":58}],1157:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -229842,7 +231297,7 @@ module.exports = { showlegend: undefined }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1174:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1158:[function(_dereq_,module,exports){ 'use strict'; var getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData; @@ -229869,7 +231324,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/get_data":891,"./plot":1179}],1175:[function(_dereq_,module,exports){ +},{"../../plots/get_data":875,"./plot":1163}],1159:[function(_dereq_,module,exports){ 'use strict'; // Requirements @@ -230380,7 +231835,7 @@ function isRangePermutation(inds) { return true; } -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"../../components/drawing":688,"../../lib":803,"../../lib/filter_unique.js":794,"../../lib/gup":800,"fast-isnumeric":249}],1176:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"../../components/drawing":672,"../../lib":787,"../../lib/filter_unique.js":778,"../../lib/gup":784,"fast-isnumeric":246}],1160:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -230493,7 +231948,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceFont(coerce, 'tickfont', categoryfontDefault); }; -},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/domain":882,"../parcoords/merge_length":1189,"./attributes":1173}],1177:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/domain":866,"../parcoords/merge_length":1173,"./attributes":1157}],1161:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -230515,7 +231970,7 @@ module.exports = { } }; -},{"./attributes":1173,"./base_plot":1174,"./calc":1175,"./defaults":1176,"./plot":1179}],1178:[function(_dereq_,module,exports){ +},{"./attributes":1157,"./base_plot":1158,"./calc":1159,"./defaults":1160,"./plot":1163}],1162:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -232664,7 +234119,7 @@ function createDimensionViewModel(parcatsViewModel, dimensionModel) { * The parent trace's view model */ -},{"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_api":840,"@plotly/d3":58,"d3-interpolate":171,"tinycolor2":598}],1179:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_api":824,"@plotly/d3":58,"d3-interpolate":168,"tinycolor2":583}],1163:[function(_dereq_,module,exports){ 'use strict'; @@ -232700,7 +234155,7 @@ module.exports = function plot(graphDiv, parcatsModels, transitionOpts, makeOnCo ); }; -},{"./parcats":1178}],1180:[function(_dereq_,module,exports){ +},{"./parcats":1162}],1164:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -232799,7 +234254,7 @@ module.exports = { ) }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/layout_attributes":869,"../../plots/domain":882,"../../plots/font_attributes":883}],1181:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/layout_attributes":853,"../../plots/domain":866,"../../plots/font_attributes":867}],1165:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -233336,7 +234791,7 @@ module.exports = { cleanRanges: cleanRanges }; -},{"../../lib":803,"../../lib/gup":800,"./constants":1184,"@plotly/d3":58}],1182:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../lib/gup":784,"./constants":1168,"@plotly/d3":58}],1166:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -233395,7 +234850,7 @@ exports.toSVG = function(gd) { }, 60); }; -},{"../../constants/xmlns_namespaces":780,"../../plots/get_data":891,"./plot":1191,"@plotly/d3":58}],1183:[function(_dereq_,module,exports){ +},{"../../constants/xmlns_namespaces":764,"../../plots/get_data":875,"./plot":1175,"@plotly/d3":58}],1167:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -233431,7 +234886,7 @@ function constHalf(len) { return out; } -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gup":800}],1184:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gup":784}],1168:[function(_dereq_,module,exports){ 'use strict'; @@ -233484,7 +234939,7 @@ module.exports = { } }; -},{}],1185:[function(_dereq_,module,exports){ +},{}],1169:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -233596,7 +235051,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerce('labelside'); }; -},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"../../plots/domain":882,"./attributes":1180,"./axisbrush":1181,"./constants":1184,"./merge_length":1189}],1186:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"../../plots/domain":866,"./attributes":1164,"./axisbrush":1165,"./constants":1168,"./merge_length":1173}],1170:[function(_dereq_,module,exports){ 'use strict'; var isTypedArray = _dereq_('../../lib').isTypedArray; @@ -233613,7 +235068,7 @@ exports.isVisible = function(dimension) { return dimension.visible || !('visible' in dimension); }; -},{"../../lib":803}],1187:[function(_dereq_,module,exports){ +},{"../../lib":787}],1171:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -233635,7 +235090,7 @@ module.exports = { } }; -},{"./attributes":1180,"./base_plot":1182,"./calc":1183,"./defaults":1185,"./plot":1191}],1188:[function(_dereq_,module,exports){ +},{"./attributes":1164,"./base_plot":1166,"./calc":1167,"./defaults":1169,"./plot":1175}],1172:[function(_dereq_,module,exports){ 'use strict'; var glslify = _dereq_('glslify'); @@ -234179,7 +235634,7 @@ module.exports = function(canvasGL, d) { }; }; -},{"../../lib":803,"./constants":1184,"glslify":442}],1189:[function(_dereq_,module,exports){ +},{"../../lib":787,"./constants":1168,"glslify":434}],1173:[function(_dereq_,module,exports){ 'use strict'; /** @@ -234209,7 +235664,7 @@ module.exports = function(traceOut, dimensions, dataAttr, len) { return len; }; -},{}],1190:[function(_dereq_,module,exports){ +},{}],1174:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -234970,7 +236425,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) { brush.ensureAxisBrush(axisOverlays, paperColor); }; -},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"./axisbrush":1181,"./constants":1184,"./helpers":1186,"./lines":1188,"@plotly/d3":58,"color-rgba":133}],1191:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"./axisbrush":1165,"./constants":1168,"./helpers":1170,"./lines":1172,"@plotly/d3":58,"color-rgba":133}],1175:[function(_dereq_,module,exports){ 'use strict'; var parcoords = _dereq_('./parcoords'); @@ -235117,7 +236572,7 @@ module.exports = function plot(gd, cdModule) { ); }; -},{"../../lib/prepare_regl":816,"./helpers":1186,"./parcoords":1190}],1192:[function(_dereq_,module,exports){ +},{"../../lib/prepare_regl":800,"./helpers":1170,"./parcoords":1174}],1176:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -235332,7 +236787,7 @@ module.exports = { } }; -},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1193:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1177:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -235347,7 +236802,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1194:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1178:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -235522,7 +236977,7 @@ module.exports = { generateExtendedColors: generateExtendedColors }; -},{"../../components/color":666,"fast-isnumeric":249,"tinycolor2":598}],1195:[function(_dereq_,module,exports){ +},{"../../components/color":650,"fast-isnumeric":246,"tinycolor2":583}],1179:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -235645,7 +237100,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"./attributes":1192,"fast-isnumeric":249}],1196:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"./attributes":1176,"fast-isnumeric":246}],1180:[function(_dereq_,module,exports){ 'use strict'; var appendArrayMultiPointValues = _dereq_('../../components/fx/helpers').appendArrayMultiPointValues; @@ -235687,7 +237142,7 @@ module.exports = function eventData(pt, trace) { return out; }; -},{"../../components/fx/helpers":702}],1197:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":686}],1181:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -235727,7 +237182,7 @@ exports.getRotationAngle = function(rotation) { return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180; }; -},{"../../lib":803}],1198:[function(_dereq_,module,exports){ +},{"../../lib":787}],1182:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -235751,7 +237206,7 @@ module.exports = { } }; -},{"./attributes":1192,"./base_plot":1193,"./calc":1194,"./defaults":1195,"./layout_attributes":1199,"./layout_defaults":1200,"./plot":1201,"./style":1202,"./style_one":1203}],1199:[function(_dereq_,module,exports){ +},{"./attributes":1176,"./base_plot":1177,"./calc":1178,"./defaults":1179,"./layout_attributes":1183,"./layout_defaults":1184,"./plot":1185,"./style":1186,"./style_one":1187}],1183:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -235770,7 +237225,7 @@ module.exports = { } }; -},{}],1200:[function(_dereq_,module,exports){ +},{}],1184:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -235787,7 +237242,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendpiecolors'); }; -},{"../../lib":803,"./layout_attributes":1199}],1201:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1183}],1185:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -236967,7 +238422,7 @@ module.exports = { computeTransform: computeTransform }; -},{"../../components/color":666,"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../bar/constants":943,"../bar/uniform_text":957,"./event_data":1196,"./helpers":1197,"@plotly/d3":58}],1202:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../bar/constants":927,"../bar/uniform_text":941,"./event_data":1180,"./helpers":1181,"@plotly/d3":58}],1186:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -236992,7 +238447,7 @@ module.exports = function style(gd) { }); }; -},{"../bar/uniform_text":957,"./style_one":1203,"@plotly/d3":58}],1203:[function(_dereq_,module,exports){ +},{"../bar/uniform_text":941,"./style_one":1187,"@plotly/d3":58}],1187:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -237008,7 +238463,7 @@ module.exports = function styleOne(s, pt, trace) { .call(Color.stroke, lineColor); }; -},{"../../components/color":666,"./helpers":1197}],1204:[function(_dereq_,module,exports){ +},{"../../components/color":650,"./helpers":1181}],1188:[function(_dereq_,module,exports){ 'use strict'; var scatterglAttrs = _dereq_('../scatter/attributes'); @@ -237092,7 +238547,7 @@ module.exports = { transforms: undefined }; -},{"../scatter/attributes":1218}],1205:[function(_dereq_,module,exports){ +},{"../scatter/attributes":1202}],1189:[function(_dereq_,module,exports){ 'use strict'; var createPointCloudRenderer = _dereq_('gl-pointcloud2d'); @@ -237286,7 +238741,7 @@ function createPointcloud(scene, data) { module.exports = createPointcloud; -},{"../../lib/str2rgbarray":828,"../../plots/cartesian/autorange":853,"../scatter/get_trace_color":1228,"gl-pointcloud2d":328}],1206:[function(_dereq_,module,exports){ +},{"../../lib/str2rgbarray":812,"../../plots/cartesian/autorange":837,"../scatter/get_trace_color":1212,"gl-pointcloud2d":321}],1190:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -237325,7 +238780,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor) { traceOut._length = null; }; -},{"../../lib":803,"./attributes":1204}],1207:[function(_dereq_,module,exports){ +},{"../../lib":787,"./attributes":1188}],1191:[function(_dereq_,module,exports){ 'use strict'; var deprecationWarning = [ @@ -237349,7 +238804,7 @@ module.exports = { } }; -},{"../../plots/gl2d":894,"../scatter3d/calc":1247,"./attributes":1204,"./convert":1205,"./defaults":1206}],1208:[function(_dereq_,module,exports){ +},{"../../plots/gl2d":878,"../scatter3d/calc":1231,"./attributes":1188,"./convert":1189,"./defaults":1190}],1192:[function(_dereq_,module,exports){ 'use strict'; var fontAttrs = _dereq_('../../plots/font_attributes'); @@ -237537,7 +238992,7 @@ var attrs = module.exports = overrideAll({ }, 'calc', 'nested'); attrs.transforms = undefined; -},{"../../components/color/attributes":665,"../../components/colorscale/attributes":673,"../../components/fx/attributes":697,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1209:[function(_dereq_,module,exports){ +},{"../../components/color/attributes":649,"../../components/colorscale/attributes":657,"../../components/fx/attributes":681,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1193:[function(_dereq_,module,exports){ 'use strict'; var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; @@ -237668,7 +239123,7 @@ function subplotUpdateFx(gd, index) { dragElement.init(dragOptions); } -},{"../../components/dragelement":685,"../../components/fx/layout_attributes":707,"../../lib":803,"../../lib/setcursor":824,"../../plot_api/edit_types":836,"../../plots/cartesian/select":874,"../../plots/get_data":891,"../../registry":931,"./plot":1214}],1210:[function(_dereq_,module,exports){ +},{"../../components/dragelement":669,"../../components/fx/layout_attributes":691,"../../lib":787,"../../lib/setcursor":808,"../../plot_api/edit_types":820,"../../plots/cartesian/select":858,"../../plots/get_data":875,"../../registry":915,"./plot":1198}],1194:[function(_dereq_,module,exports){ 'use strict'; var tarjan = _dereq_('strongly-connected-components'); @@ -237849,7 +239304,7 @@ module.exports = function calc(gd, trace) { }); }; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gup":800,"strongly-connected-components":590}],1211:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gup":784,"strongly-connected-components":575}],1195:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -237872,7 +239327,7 @@ module.exports = { } }; -},{}],1212:[function(_dereq_,module,exports){ +},{}],1196:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -237978,7 +239433,7 @@ function concentrationscalesDefaults(In, Out) { coerce('colorscale'); } -},{"../../components/color":666,"../../components/fx/hoverlabel_defaults":704,"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../../plots/domain":882,"./attributes":1208,"tinycolor2":598}],1213:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx/hoverlabel_defaults":688,"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../../plots/domain":866,"./attributes":1192,"tinycolor2":583}],1197:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -237996,7 +239451,7 @@ module.exports = { } }; -},{"./attributes":1208,"./base_plot":1209,"./calc":1210,"./defaults":1212,"./plot":1214,"./select.js":1216}],1214:[function(_dereq_,module,exports){ +},{"./attributes":1192,"./base_plot":1193,"./calc":1194,"./defaults":1196,"./plot":1198,"./select.js":1200}],1198:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -238365,7 +239820,7 @@ module.exports = function plot(gd, calcData) { ); }; -},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"./constants":1211,"./render":1215,"@plotly/d3":58}],1215:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"./constants":1195,"./render":1199,"@plotly/d3":58}],1199:[function(_dereq_,module,exports){ 'use strict'; var d3Force = _dereq_('d3-force'); @@ -239382,7 +240837,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .ease(c.ease).duration(c.duration); }; -},{"../../components/color":666,"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"../../registry":931,"./constants":1211,"@plotly/d3":58,"@plotly/d3-sankey":57,"@plotly/d3-sankey-circular":56,"d3-force":166,"d3-interpolate":171,"tinycolor2":598}],1216:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"../../registry":915,"./constants":1195,"@plotly/d3":58,"@plotly/d3-sankey":57,"@plotly/d3-sankey-circular":56,"d3-force":163,"d3-interpolate":168,"tinycolor2":583}],1200:[function(_dereq_,module,exports){ 'use strict'; module.exports = function selectPoints(searchInfo, selectionTester) { @@ -239412,7 +240867,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{}],1217:[function(_dereq_,module,exports){ +},{}],1201:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -239455,7 +240910,7 @@ module.exports = function arraysToCalcdata(cd, trace) { } }; -},{"../../lib":803}],1218:[function(_dereq_,module,exports){ +},{"../../lib":787}],1202:[function(_dereq_,module,exports){ 'use strict'; var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat; @@ -239805,7 +241260,7 @@ module.exports = { }), }; -},{"../../components/colorscale/attributes":673,"../../components/drawing":688,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/font_attributes":883,"../../plots/template_attributes":926,"./constants":1222}],1219:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing":672,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/font_attributes":867,"../../plots/template_attributes":910,"./constants":1206}],1203:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -240102,7 +241557,7 @@ module.exports = { getStackOpts: getStackOpts }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"./arrays_to_calcdata":1217,"./calc_selection":1220,"./colorscale_calc":1221,"./subtypes":1243,"fast-isnumeric":249}],1220:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"./arrays_to_calcdata":1201,"./calc_selection":1204,"./colorscale_calc":1205,"./subtypes":1227,"fast-isnumeric":246}],1204:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -240113,7 +241568,7 @@ module.exports = function calcSelection(cd, trace) { } }; -},{"../../lib":803}],1221:[function(_dereq_,module,exports){ +},{"../../lib":787}],1205:[function(_dereq_,module,exports){ 'use strict'; var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale; @@ -240148,7 +241603,7 @@ module.exports = function calcMarkerColorscale(gd, trace) { } }; -},{"../../components/colorscale/calc":674,"../../components/colorscale/helpers":677,"./subtypes":1243}],1222:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../components/colorscale/helpers":661,"./subtypes":1227}],1206:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -240168,7 +241623,7 @@ module.exports = { eventDataKeys: [] }; -},{}],1223:[function(_dereq_,module,exports){ +},{}],1207:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('./calc'); @@ -240340,7 +241795,7 @@ function getInterp(calcTrace, index, position, posAttr) { return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]); } -},{"./calc":1219}],1224:[function(_dereq_,module,exports){ +},{"./calc":1203}],1208:[function(_dereq_,module,exports){ 'use strict'; @@ -240370,7 +241825,7 @@ module.exports = function crossTraceDefaults(fullData) { } }; -},{}],1225:[function(_dereq_,module,exports){ +},{}],1209:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -240457,7 +241912,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../../registry":931,"./attributes":1218,"./constants":1222,"./fillcolor_defaults":1226,"./line_defaults":1231,"./line_shape_defaults":1233,"./marker_defaults":1237,"./period_defaults":1238,"./stack_defaults":1241,"./subtypes":1243,"./text_defaults":1244,"./xy_defaults":1245}],1226:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"./attributes":1202,"./constants":1206,"./fillcolor_defaults":1210,"./line_defaults":1215,"./line_shape_defaults":1217,"./marker_defaults":1221,"./period_defaults":1222,"./stack_defaults":1225,"./subtypes":1227,"./text_defaults":1228,"./xy_defaults":1229}],1210:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -240485,7 +241940,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe )); }; -},{"../../components/color":666,"../../lib":803}],1227:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787}],1211:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -240503,7 +241958,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1228:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1212:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -240543,7 +241998,7 @@ module.exports = function getTraceColor(trace, di) { } }; -},{"../../components/color":666,"./subtypes":1243}],1229:[function(_dereq_,module,exports){ +},{"../../components/color":650,"./subtypes":1227}],1213:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -240754,7 +242209,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { } }; -},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"../../registry":931,"./get_trace_color":1228}],1230:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"../../registry":915,"./get_trace_color":1212}],1214:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -240791,7 +242246,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"./arrays_to_calcdata":1217,"./attributes":1218,"./calc":1219,"./cross_trace_calc":1223,"./cross_trace_defaults":1224,"./defaults":1225,"./format_labels":1227,"./hover":1229,"./marker_colorbar":1236,"./plot":1239,"./select":1240,"./style":1242,"./subtypes":1243}],1231:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"./arrays_to_calcdata":1201,"./attributes":1202,"./calc":1203,"./cross_trace_calc":1207,"./cross_trace_defaults":1208,"./defaults":1209,"./format_labels":1211,"./hover":1213,"./marker_colorbar":1220,"./plot":1223,"./select":1224,"./style":1226,"./subtypes":1227}],1215:[function(_dereq_,module,exports){ 'use strict'; var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray; @@ -240814,7 +242269,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, if(!(opts || {}).noDash) coerce('line.dash'); }; -},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803}],1232:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787}],1216:[function(_dereq_,module,exports){ 'use strict'; var numConstants = _dereq_('../../constants/numerical'); @@ -241266,7 +242721,7 @@ module.exports = function linePoints(d, opts) { return segments; }; -},{"../../constants/numerical":779,"../../lib":803,"./constants":1222}],1233:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"./constants":1206}],1217:[function(_dereq_,module,exports){ 'use strict'; @@ -241276,7 +242731,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) { if(shape === 'spline') coerce('line.smoothing'); }; -},{}],1234:[function(_dereq_,module,exports){ +},{}],1218:[function(_dereq_,module,exports){ 'use strict'; var LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1}; @@ -241358,7 +242813,7 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) { return cdscatterSorted; }; -},{}],1235:[function(_dereq_,module,exports){ +},{}],1219:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -241394,7 +242849,7 @@ module.exports = function makeBubbleSizeFn(trace, factor) { }; }; -},{"fast-isnumeric":249}],1236:[function(_dereq_,module,exports){ +},{"fast-isnumeric":246}],1220:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -241403,7 +242858,7 @@ module.exports = { max: 'cmax' }; -},{}],1237:[function(_dereq_,module,exports){ +},{}],1221:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -241476,7 +242931,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout } }; -},{"../../components/color":666,"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"./subtypes":1243}],1238:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"./subtypes":1227}],1222:[function(_dereq_,module,exports){ 'use strict'; var dateTick0 = _dereq_('../../lib').dateTick0; @@ -241515,7 +242970,7 @@ module.exports = function handlePeriodDefaults(traceIn, traceOut, layout, coerce } }; -},{"../../constants/numerical":779,"../../lib":803}],1239:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787}],1223:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -242067,7 +243522,7 @@ function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) { }); } -},{"../../components/drawing":688,"../../lib":803,"../../lib/polygon":815,"../../registry":931,"./line_points":1232,"./link_traces":1234,"./subtypes":1243,"@plotly/d3":58}],1240:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/polygon":799,"../../registry":915,"./line_points":1216,"./link_traces":1218,"./subtypes":1227,"@plotly/d3":58}],1224:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('./subtypes'); @@ -242112,7 +243567,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"./subtypes":1243}],1241:[function(_dereq_,module,exports){ +},{"./subtypes":1227}],1225:[function(_dereq_,module,exports){ 'use strict'; var perStackAttrs = ['orientation', 'groupnorm', 'stackgaps']; @@ -242209,7 +243664,7 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) } }; -},{}],1242:[function(_dereq_,module,exports){ +},{}],1226:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -242271,7 +243726,7 @@ module.exports = { styleOnSelect: styleOnSelect }; -},{"../../components/drawing":688,"../../registry":931,"@plotly/d3":58}],1243:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../registry":915,"@plotly/d3":58}],1227:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -242301,7 +243756,7 @@ module.exports = { } }; -},{"../../lib":803}],1244:[function(_dereq_,module,exports){ +},{"../../lib":787}],1228:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -242322,7 +243777,7 @@ module.exports = function(traceIn, traceOut, layout, coerce, opts) { } }; -},{"../../lib":803}],1245:[function(_dereq_,module,exports){ +},{"../../lib":787}],1229:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -242358,7 +243813,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) { return len; }; -},{"../../lib":803,"../../registry":931}],1246:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915}],1230:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -242484,7 +243939,7 @@ var attrs = module.exports = overrideAll({ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; -},{"../../components/colorscale/attributes":673,"../../constants/gl3d_dashes":776,"../../constants/gl3d_markers":777,"../../lib/extend":793,"../../lib/sort_object_keys":826,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1247:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../constants/gl3d_dashes":760,"../../constants/gl3d_markers":761,"../../lib/extend":777,"../../lib/sort_object_keys":810,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1231:[function(_dereq_,module,exports){ 'use strict'; var arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata'); @@ -242504,7 +243959,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":1217,"../scatter/colorscale_calc":1221}],1248:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":1201,"../scatter/colorscale_calc":1205}],1232:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -242583,7 +244038,7 @@ function calculateErrors(data, scaleFactor, sceneLayout) { module.exports = calculateErrors; -},{"../../registry":931}],1249:[function(_dereq_,module,exports){ +},{"../../registry":915}],1233:[function(_dereq_,module,exports){ 'use strict'; var createLinePlot = _dereq_('gl-line3d'); @@ -243128,7 +244583,7 @@ function createLineWithMarkers(scene, data) { module.exports = createLineWithMarkers; -},{"../../components/fx/helpers":702,"../../constants/gl3d_dashes":776,"../../constants/gl3d_markers":777,"../../lib":803,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"../scatter/make_bubble_size_func":1235,"./calc_errors":1248,"delaunay-triangulate":180,"gl-error3d":273,"gl-line3d":281,"gl-mesh3d":315,"gl-scatter3d":334}],1250:[function(_dereq_,module,exports){ +},{"../../components/fx/helpers":686,"../../constants/gl3d_dashes":760,"../../constants/gl3d_markers":761,"../../lib":787,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"../scatter/make_bubble_size_func":1219,"./calc_errors":1232,"delaunay-triangulate":177,"gl-error3d":267,"gl-line3d":275,"gl-mesh3d":309,"gl-scatter3d":327}],1234:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -243212,7 +244667,7 @@ function handleXYZDefaults(traceIn, traceOut, coerce, layout) { return len; } -},{"../../lib":803,"../../registry":931,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1246}],1251:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1230}],1235:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -243241,7 +244696,7 @@ module.exports = { } }; -},{"../../constants/gl3d_markers":777,"../../plots/gl3d":896,"./attributes":1246,"./calc":1247,"./convert":1249,"./defaults":1250}],1252:[function(_dereq_,module,exports){ +},{"../../constants/gl3d_markers":761,"../../plots/gl3d":880,"./attributes":1230,"./calc":1231,"./convert":1233,"./defaults":1234}],1236:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -243325,7 +244780,7 @@ module.exports = { hovertemplate: hovertemplateAttrs() }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1253:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1237:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -243375,7 +244830,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../carpet/lookup_carpetid":1001,"../scatter/arrays_to_calcdata":1217,"../scatter/calc":1219,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1254:[function(_dereq_,module,exports){ +},{"../carpet/lookup_carpetid":985,"../scatter/arrays_to_calcdata":1201,"../scatter/calc":1203,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1238:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -243456,7 +244911,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/line_shape_defaults":1233,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1252}],1255:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/line_shape_defaults":1217,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1236}],1239:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -243469,7 +244924,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1256:[function(_dereq_,module,exports){ +},{}],1240:[function(_dereq_,module,exports){ 'use strict'; module.exports = function formatLabels(cdi, trace) { @@ -243488,7 +244943,7 @@ module.exports = function formatLabels(cdi, trace) { return labels; }; -},{}],1257:[function(_dereq_,module,exports){ +},{}],1241:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -243571,7 +245026,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../../lib":803,"../scatter/hover":1229}],1258:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/hover":1213}],1242:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -243595,7 +245050,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1252,"./calc":1253,"./defaults":1254,"./event_data":1255,"./format_labels":1256,"./hover":1257,"./plot":1259}],1259:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1236,"./calc":1237,"./defaults":1238,"./event_data":1239,"./format_labels":1240,"./hover":1241,"./plot":1243}],1243:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -243630,7 +245085,7 @@ module.exports = function plot(gd, plotinfoproxy, data, layer) { } }; -},{"../../components/drawing":688,"../../plots/cartesian/axes":854,"../scatter/plot":1239}],1260:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../plots/cartesian/axes":838,"../scatter/plot":1223}],1244:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -243728,7 +245183,7 @@ module.exports = overrideAll({ hovertemplate: hovertemplateAttrs(), }, 'calc', 'nested'); -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1261:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1245:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -243787,7 +245242,7 @@ module.exports = function calc(gd, trace) { return calcTrace; }; -},{"../../constants/numerical":779,"../../lib":803,"../scatter/arrays_to_calcdata":1217,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1262:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../scatter/arrays_to_calcdata":1201,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1246:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -243862,7 +245317,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1260}],1263:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1244}],1247:[function(_dereq_,module,exports){ 'use strict'; @@ -243880,7 +245335,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1264:[function(_dereq_,module,exports){ +},{}],1248:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -243897,7 +245352,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1265:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1249:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -244001,7 +245456,7 @@ function getExtraText(trace, pt, pointData, labels) { return text.join('
'); } -},{"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../scatter/get_trace_color":1228,"./attributes":1260}],1266:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../scatter/get_trace_color":1212,"./attributes":1244}],1250:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -244026,7 +245481,7 @@ module.exports = { } }; -},{"../../plots/geo":887,"../scatter/marker_colorbar":1236,"../scatter/style":1242,"./attributes":1260,"./calc":1261,"./defaults":1262,"./event_data":1263,"./format_labels":1264,"./hover":1265,"./plot":1267,"./select":1268,"./style":1269}],1267:[function(_dereq_,module,exports){ +},{"../../plots/geo":871,"../scatter/marker_colorbar":1220,"../scatter/style":1226,"./attributes":1244,"./calc":1245,"./defaults":1246,"./event_data":1247,"./format_labels":1248,"./hover":1249,"./plot":1251,"./select":1252,"./style":1253}],1251:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -244147,7 +245602,7 @@ module.exports = { plot: plot }; -},{"../../constants/numerical":779,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/geojson_utils":797,"../../lib/topojson_utils":832,"../../plots/cartesian/autorange":853,"../scatter/calc":1219,"../scatter/subtypes":1243,"./style":1269,"@plotly/d3":58}],1268:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/geojson_utils":781,"../../lib/topojson_utils":816,"../../plots/cartesian/autorange":837,"../scatter/calc":1203,"../scatter/subtypes":1227,"./style":1253,"@plotly/d3":58}],1252:[function(_dereq_,module,exports){ 'use strict'; var subtypes = _dereq_('../scatter/subtypes'); @@ -244196,7 +245651,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"../../constants/numerical":779,"../scatter/subtypes":1243}],1269:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../scatter/subtypes":1227}],1253:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -244237,7 +245692,7 @@ function styleTrace(gd, calcTrace) { }); } -},{"../../components/color":666,"../../components/drawing":688,"../scatter/style":1242,"@plotly/d3":58}],1270:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../scatter/style":1226,"@plotly/d3":58}],1254:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -244332,7 +245787,7 @@ attrs.x.editType = attrs.y.editType = attrs.x0.editType = attrs.y0.editType = 'c attrs.hovertemplate = scatterAttrs.hovertemplate; attrs.texttemplate = scatterAttrs.texttemplate; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../lib/sort_object_keys":826,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../scatter/attributes":1218,"./constants":1272}],1271:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../lib/sort_object_keys":810,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../scatter/attributes":1202,"./constants":1256}],1255:[function(_dereq_,module,exports){ 'use strict'; var cluster = _dereq_('@plotly/point-cluster'); @@ -244518,7 +245973,7 @@ function sceneOptions(gd, subplot, trace, positions, x, y) { return opts; } -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/autorange":853,"../../plots/cartesian/axis_ids":858,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"./constants":1272,"./convert":1273,"./scene_update":1281,"@plotly/point-cluster":59}],1272:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/autorange":837,"../../plots/cartesian/axis_ids":842,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"./constants":1256,"./convert":1257,"./scene_update":1265,"@plotly/point-cluster":59}],1256:[function(_dereq_,module,exports){ 'use strict'; var SYMBOL_SIZE = 20; @@ -244543,7 +245998,7 @@ module.exports = { } }; -},{}],1273:[function(_dereq_,module,exports){ +},{}],1257:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -245190,7 +246645,7 @@ module.exports = { textPosition: convertTextPosition }; -},{"../../components/drawing":688,"../../components/fx/helpers":702,"../../constants/interactions":778,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/cartesian/axis_ids":858,"../../registry":931,"../scatter/make_bubble_size_func":1235,"../scatter/subtypes":1243,"./constants":1272,"./helpers":1277,"color-normalize":131,"fast-isnumeric":249,"svg-path-sdf":595}],1274:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../components/fx/helpers":686,"../../constants/interactions":762,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/cartesian/axis_ids":842,"../../registry":915,"../scatter/make_bubble_size_func":1219,"../scatter/subtypes":1227,"./constants":1256,"./helpers":1261,"color-normalize":131,"fast-isnumeric":246,"svg-path-sdf":580}],1258:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -245263,7 +246718,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../../registry":931,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/period_defaults":1238,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"../scatter/xy_defaults":1245,"./attributes":1270,"./helpers":1277}],1275:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/period_defaults":1222,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"../scatter/xy_defaults":1229,"./attributes":1254,"./helpers":1261}],1259:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -245311,7 +246766,7 @@ module.exports = { styleTextSelection: styleTextSelection }; -},{"../../components/color":666,"../../constants/interactions":778,"../../lib":803}],1276:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/interactions":762,"../../lib":787}],1260:[function(_dereq_,module,exports){ 'use strict'; var scatterFormatLabels = _dereq_('../scatter/format_labels'); @@ -245323,7 +246778,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return scatterFormatLabels(cdi, trace, fullLayout); }; -},{"../scatter/format_labels":1227}],1277:[function(_dereq_,module,exports){ +},{"../scatter/format_labels":1211}],1261:[function(_dereq_,module,exports){ 'use strict'; var constants = _dereq_('./constants'); @@ -245340,7 +246795,7 @@ exports.isDotSymbol = function(symbol) { symbol > 200; }; -},{"./constants":1272}],1278:[function(_dereq_,module,exports){ +},{"./constants":1256}],1262:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -245560,7 +247015,7 @@ module.exports = { calcHover: calcHover }; -},{"../../lib":803,"../../registry":931,"../scatter/get_trace_color":1228}],1279:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../registry":915,"../scatter/get_trace_color":1212}],1263:[function(_dereq_,module,exports){ 'use strict'; var hover = _dereq_('./hover'); @@ -245585,7 +247040,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../scatter/cross_trace_defaults":1224,"../scatter/marker_colorbar":1236,"./attributes":1270,"./calc":1271,"./defaults":1274,"./format_labels":1276,"./hover":1278,"./plot":1280,"./select":1282}],1280:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../scatter/cross_trace_defaults":1208,"../scatter/marker_colorbar":1220,"./attributes":1254,"./calc":1255,"./defaults":1258,"./format_labels":1260,"./hover":1262,"./plot":1264,"./select":1266}],1264:[function(_dereq_,module,exports){ 'use strict'; var createScatter = _dereq_('regl-scatter2d'); @@ -245958,7 +247413,7 @@ module.exports = function plot(gd, subplot, cdata) { } }; -},{"../../components/dragelement/helpers":684,"../../lib":803,"../../lib/prepare_regl":816,"../scatter/link_traces":1234,"../scatter/subtypes":1243,"./edit_style":1275,"gl-text":355,"regl-error2d":536,"regl-line2d":537,"regl-scatter2d":538}],1281:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":668,"../../lib":787,"../../lib/prepare_regl":800,"../scatter/link_traces":1218,"../scatter/subtypes":1227,"./edit_style":1259,"gl-text":347,"regl-error2d":522,"regl-line2d":523,"regl-scatter2d":524}],1265:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -246108,7 +247563,7 @@ module.exports = function sceneUpdate(gd, subplot) { return scene; }; -},{"../../lib":803}],1282:[function(_dereq_,module,exports){ +},{"../../lib":787}],1266:[function(_dereq_,module,exports){ 'use strict'; var subTypes = _dereq_('../scatter/subtypes'); @@ -246181,7 +247636,7 @@ module.exports = function select(searchInfo, selectionTester) { return selection; }; -},{"../scatter/subtypes":1243,"./edit_style":1275}],1283:[function(_dereq_,module,exports){ +},{"../scatter/subtypes":1227,"./edit_style":1259}],1267:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -246275,7 +247730,7 @@ module.exports = overrideAll({ hovertemplate: hovertemplateAttrs(), }, 'calc', 'nested'); -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/mapbox/layout_attributes":913,"../../plots/template_attributes":926,"../scatter/attributes":1218,"../scattergeo/attributes":1260}],1284:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/mapbox/layout_attributes":897,"../../plots/template_attributes":910,"../scatter/attributes":1202,"../scattergeo/attributes":1244}],1268:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -246602,7 +248057,7 @@ function isBADNUM(lonlat) { return lonlat[0] === BADNUM; } -},{"../../components/colorscale":678,"../../components/drawing":688,"../../components/fx/helpers":702,"../../constants/numerical":779,"../../lib":803,"../../lib/geojson_utils":797,"../../lib/svg_text_utils":829,"../../plots/mapbox/convert_text_opts":910,"../scatter/make_bubble_size_func":1235,"../scatter/subtypes":1243,"fast-isnumeric":249}],1285:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../components/drawing":672,"../../components/fx/helpers":686,"../../constants/numerical":763,"../../lib":787,"../../lib/geojson_utils":781,"../../lib/svg_text_utils":813,"../../plots/mapbox/convert_text_opts":894,"../scatter/make_bubble_size_func":1219,"../scatter/subtypes":1227,"fast-isnumeric":246}],1269:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -246672,7 +248127,7 @@ function handleLonLatDefaults(traceIn, traceOut, coerce) { return len; } -},{"../../lib":803,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1283}],1286:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1267}],1270:[function(_dereq_,module,exports){ 'use strict'; @@ -246683,7 +248138,7 @@ module.exports = function eventData(out, pt) { return out; }; -},{}],1287:[function(_dereq_,module,exports){ +},{}],1271:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -246701,7 +248156,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1288:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1272:[function(_dereq_,module,exports){ 'use strict'; var Fx = _dereq_('../../components/fx'); @@ -246809,7 +248264,7 @@ module.exports = { getExtraText: getExtraText }; -},{"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../scatter/get_trace_color":1228}],1289:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../scatter/get_trace_color":1212}],1273:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -246838,7 +248293,7 @@ module.exports = { } }; -},{"../../plots/mapbox":911,"../scatter/marker_colorbar":1236,"../scattergeo/calc":1261,"./attributes":1283,"./defaults":1285,"./event_data":1286,"./format_labels":1287,"./hover":1288,"./plot":1290,"./select":1291}],1290:[function(_dereq_,module,exports){ +},{"../../plots/mapbox":895,"../scatter/marker_colorbar":1220,"../scattergeo/calc":1245,"./attributes":1267,"./defaults":1269,"./event_data":1270,"./format_labels":1271,"./hover":1272,"./plot":1274,"./select":1275}],1274:[function(_dereq_,module,exports){ 'use strict'; var convert = _dereq_('./convert'); @@ -246963,7 +248418,7 @@ module.exports = function createScatterMapbox(subplot, calcTrace) { return scatterMapbox; }; -},{"../../plots/mapbox/constants":909,"./convert":1284}],1291:[function(_dereq_,module,exports){ +},{"../../plots/mapbox/constants":893,"./convert":1268}],1275:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247010,7 +248465,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) { return selection; }; -},{"../../constants/numerical":779,"../../lib":803,"../scatter/subtypes":1243}],1292:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../scatter/subtypes":1227}],1276:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -247106,7 +248561,7 @@ module.exports = { unselected: scatterAttrs.unselected }; -},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1293:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1277:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -247152,7 +248607,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../constants/numerical":779,"../../plots/cartesian/axes":854,"../scatter/arrays_to_calcdata":1217,"../scatter/calc":1219,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1294:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../plots/cartesian/axes":838,"../scatter/arrays_to_calcdata":1201,"../scatter/calc":1203,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1278:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247251,7 +248706,7 @@ module.exports = { supplyDefaults: supplyDefaults }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/line_shape_defaults":1233,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1292}],1295:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/line_shape_defaults":1217,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1276}],1279:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247285,7 +248740,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../lib":803,"../../plots/cartesian/axes":854}],1296:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838}],1280:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -247353,7 +248808,7 @@ module.exports = { makeHoverPointText: makeHoverPointText }; -},{"../scatter/hover":1229}],1297:[function(_dereq_,module,exports){ +},{"../scatter/hover":1213}],1281:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -247377,7 +248832,7 @@ module.exports = { } }; -},{"../../plots/polar":920,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1292,"./calc":1293,"./defaults":1294,"./format_labels":1295,"./hover":1296,"./plot":1298}],1298:[function(_dereq_,module,exports){ +},{"../../plots/polar":904,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1276,"./calc":1277,"./defaults":1278,"./format_labels":1279,"./hover":1280,"./plot":1282}],1282:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -247419,7 +248874,7 @@ module.exports = function plot(gd, subplot, moduleCalcData) { scatterPlot(gd, plotinfo, moduleCalcData, mlayer); }; -},{"../../constants/numerical":779,"../scatter/plot":1239}],1299:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../scatter/plot":1223}],1283:[function(_dereq_,module,exports){ 'use strict'; var scatterPolarAttrs = _dereq_('../scatterpolar/attributes'); @@ -247462,7 +248917,7 @@ module.exports = { unselected: scatterPolarAttrs.unselected }; -},{"../../plots/template_attributes":926,"../scattergl/attributes":1270,"../scatterpolar/attributes":1292}],1300:[function(_dereq_,module,exports){ +},{"../../plots/template_attributes":910,"../scattergl/attributes":1254,"../scatterpolar/attributes":1276}],1284:[function(_dereq_,module,exports){ 'use strict'; var calcColorscale = _dereq_('../scatter/colorscale_calc'); @@ -247506,7 +248961,7 @@ module.exports = function calc(gd, trace) { return [{x: false, y: false, t: stash, trace: trace}]; }; -},{"../../plots/cartesian/axes":854,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"../scattergl/constants":1272,"../scattergl/convert":1273}],1301:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"../scattergl/constants":1256,"../scattergl/convert":1257}],1285:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -247560,7 +249015,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"../scatterpolar/defaults":1294,"./attributes":1299}],1302:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"../scatterpolar/defaults":1278,"./attributes":1283}],1286:[function(_dereq_,module,exports){ 'use strict'; var scatterPolarFormatLabels = _dereq_('../scatterpolar/format_labels'); @@ -247572,7 +249027,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return scatterPolarFormatLabels(cdi, trace, fullLayout); }; -},{"../scatterpolar/format_labels":1295}],1303:[function(_dereq_,module,exports){ +},{"../scatterpolar/format_labels":1279}],1287:[function(_dereq_,module,exports){ 'use strict'; var hover = _dereq_('../scattergl/hover'); @@ -247614,7 +249069,7 @@ module.exports = { hoverPoints: hoverPoints }; -},{"../scattergl/hover":1278,"../scatterpolar/hover":1296}],1304:[function(_dereq_,module,exports){ +},{"../scattergl/hover":1262,"../scatterpolar/hover":1280}],1288:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -247637,7 +249092,7 @@ module.exports = { } }; -},{"../../plots/polar":920,"../scatter/marker_colorbar":1236,"../scattergl/select":1282,"./attributes":1299,"./calc":1300,"./defaults":1301,"./format_labels":1302,"./hover":1303,"./plot":1305}],1305:[function(_dereq_,module,exports){ +},{"../../plots/polar":904,"../scatter/marker_colorbar":1220,"../scattergl/select":1266,"./attributes":1283,"./calc":1284,"./defaults":1285,"./format_labels":1286,"./hover":1287,"./plot":1289}],1289:[function(_dereq_,module,exports){ 'use strict'; var cluster = _dereq_('@plotly/point-cluster'); @@ -247767,7 +249222,7 @@ module.exports = function plot(gd, subplot, cdata) { return scatterglPlot(gd, subplot, cdata); }; -},{"../../lib":803,"../scattergl/constants":1272,"../scattergl/convert":1273,"../scattergl/plot":1280,"../scattergl/scene_update":1281,"@plotly/point-cluster":59,"fast-isnumeric":249}],1306:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scattergl/constants":1256,"../scattergl/convert":1257,"../scattergl/plot":1264,"../scattergl/scene_update":1265,"@plotly/point-cluster":59,"fast-isnumeric":246}],1290:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -247859,7 +249314,7 @@ module.exports = { hovertemplate: hovertemplateAttrs(), }; -},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1307:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1291:[function(_dereq_,module,exports){ 'use strict'; var isNumeric = _dereq_('fast-isnumeric'); @@ -247931,7 +249386,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../scatter/arrays_to_calcdata":1217,"../scatter/calc":1219,"../scatter/calc_selection":1220,"../scatter/colorscale_calc":1221,"fast-isnumeric":249}],1308:[function(_dereq_,module,exports){ +},{"../scatter/arrays_to_calcdata":1201,"../scatter/calc":1203,"../scatter/calc_selection":1204,"../scatter/colorscale_calc":1205,"fast-isnumeric":246}],1292:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -248026,7 +249481,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; -},{"../../lib":803,"../scatter/constants":1222,"../scatter/fillcolor_defaults":1226,"../scatter/line_defaults":1231,"../scatter/line_shape_defaults":1233,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1306}],1309:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/constants":1206,"../scatter/fillcolor_defaults":1210,"../scatter/line_defaults":1215,"../scatter/line_shape_defaults":1217,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1290}],1293:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt, trace, cd, pointNumber) { @@ -248050,7 +249505,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) { return out; }; -},{}],1310:[function(_dereq_,module,exports){ +},{}],1294:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -248066,7 +249521,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) { return labels; }; -},{"../../plots/cartesian/axes":854}],1311:[function(_dereq_,module,exports){ +},{"../../plots/cartesian/axes":838}],1295:[function(_dereq_,module,exports){ 'use strict'; var scatterHover = _dereq_('../scatter/hover'); @@ -248132,7 +249587,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { return scatterPointData; }; -},{"../scatter/hover":1229}],1312:[function(_dereq_,module,exports){ +},{"../scatter/hover":1213}],1296:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -248156,7 +249611,7 @@ module.exports = { } }; -},{"../../plots/ternary":927,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1306,"./calc":1307,"./defaults":1308,"./event_data":1309,"./format_labels":1310,"./hover":1311,"./plot":1313}],1313:[function(_dereq_,module,exports){ +},{"../../plots/ternary":911,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1290,"./calc":1291,"./defaults":1292,"./event_data":1293,"./format_labels":1294,"./hover":1295,"./plot":1297}],1297:[function(_dereq_,module,exports){ 'use strict'; var scatterPlot = _dereq_('../scatter/plot'); @@ -248180,7 +249635,7 @@ module.exports = function plot(gd, ternary, moduleCalcData) { scatterPlot(gd, plotinfo, moduleCalcData, scatterLayer); }; -},{"../scatter/plot":1239}],1314:[function(_dereq_,module,exports){ +},{"../scatter/plot":1223}],1298:[function(_dereq_,module,exports){ 'use strict'; var scatterAttrs = _dereq_('../scatter/attributes'); @@ -248323,7 +249778,7 @@ module.exports = { opacity: scatterGlAttrs.opacity }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/constants":861,"../../plots/template_attributes":926,"../scatter/attributes":1218,"../scattergl/attributes":1270}],1315:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/constants":845,"../../plots/template_attributes":910,"../scatter/attributes":1202,"../scattergl/attributes":1254}],1299:[function(_dereq_,module,exports){ 'use strict'; var createLine = _dereq_('regl-line2d'); @@ -248548,7 +250003,7 @@ module.exports = { toSVG: Cartesian.toSVG }; -},{"../../lib/prepare_regl":816,"../../plots/cartesian":868,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_ids":858,"../../plots/get_data":891,"../../registry":931,"regl-line2d":537}],1316:[function(_dereq_,module,exports){ +},{"../../lib/prepare_regl":800,"../../plots/cartesian":852,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_ids":842,"../../plots/get_data":875,"../../registry":915,"regl-line2d":523}],1300:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -248651,7 +250106,7 @@ module.exports = function calc(gd, trace) { return [{x: false, y: false, t: {}, trace: trace}]; }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axis_ids":858,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"../scattergl/constants":1272,"../scattergl/convert":1273,"./scene_update":1323}],1317:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axis_ids":842,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"../scattergl/constants":1256,"../scattergl/convert":1257,"./scene_update":1307}],1301:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -248822,7 +250277,7 @@ function handleAxisDefaults(traceIn, traceOut, layout, coerce) { } } -},{"../../lib":803,"../../plots/array_container_defaults":849,"../parcoords/merge_length":1189,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scattergl/helpers":1277,"./attributes":1314}],1318:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/array_container_defaults":833,"../parcoords/merge_length":1173,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scattergl/helpers":1261,"./attributes":1298}],1302:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -248846,7 +250301,7 @@ module.exports = function editStyle(gd, cd0) { } }; -},{"../../lib":803,"../scatter/colorscale_calc":1221,"../scattergl/convert":1273}],1319:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/colorscale_calc":1205,"../scattergl/convert":1257}],1303:[function(_dereq_,module,exports){ 'use strict'; exports.getDimIndex = function getDimIndex(trace, ax) { @@ -248862,7 +250317,7 @@ exports.getDimIndex = function getDimIndex(trace, ax) { return false; }; -},{}],1320:[function(_dereq_,module,exports){ +},{}],1304:[function(_dereq_,module,exports){ 'use strict'; var helpers = _dereq_('./helpers'); @@ -248915,7 +250370,7 @@ module.exports = { hoverPoints: hoverPoints }; -},{"../scattergl/hover":1278,"./helpers":1319}],1321:[function(_dereq_,module,exports){ +},{"../scattergl/hover":1262,"./helpers":1303}],1305:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -248946,7 +250401,7 @@ module.exports = { // register it here Registry.register(Grid); -},{"../../components/grid":710,"../../registry":931,"../scatter/marker_colorbar":1236,"./attributes":1314,"./base_plot":1315,"./calc":1316,"./defaults":1317,"./edit_style":1318,"./hover":1320,"./plot":1322,"./select":1324}],1322:[function(_dereq_,module,exports){ +},{"../../components/grid":694,"../../registry":915,"../scatter/marker_colorbar":1220,"./attributes":1298,"./base_plot":1299,"./calc":1300,"./defaults":1301,"./edit_style":1302,"./hover":1304,"./plot":1306,"./select":1308}],1306:[function(_dereq_,module,exports){ 'use strict'; var createMatrix = _dereq_('regl-splom'); @@ -249089,7 +250544,7 @@ function plotOne(gd, cd0) { } } -},{"../../components/dragelement/helpers":684,"../../lib":803,"../../plots/cartesian/axis_ids":858,"regl-splom":539}],1323:[function(_dereq_,module,exports){ +},{"../../components/dragelement/helpers":668,"../../lib":787,"../../plots/cartesian/axis_ids":842,"regl-splom":525}],1307:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -249153,7 +250608,7 @@ module.exports = function sceneUpdate(gd, trace) { return scene; }; -},{"../../lib":803}],1324:[function(_dereq_,module,exports){ +},{"../../lib":787}],1308:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -249220,7 +250675,7 @@ module.exports = function select(searchInfo, selectionTester) { return selection; }; -},{"../../lib":803,"../scatter/subtypes":1243,"./helpers":1319}],1325:[function(_dereq_,module,exports){ +},{"../../lib":787,"../scatter/subtypes":1227,"./helpers":1303}],1309:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -249352,7 +250807,7 @@ attrs.transforms = undefined; module.exports = attrs; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1326:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1310:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -249600,7 +251055,7 @@ module.exports = { processGrid: processGrid }; -},{"../../components/colorscale/calc":674,"../../lib":803}],1327:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658,"../../lib":787}],1311:[function(_dereq_,module,exports){ 'use strict'; var tube2mesh = _dereq_('gl-streamtube3d'); @@ -249818,7 +251273,7 @@ function createStreamtubeTrace(scene, data) { module.exports = createStreamtubeTrace; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/gl3d/zip3":907,"gl-streamtube3d":352}],1328:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/gl3d/zip3":891,"gl-streamtube3d":344}],1312:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -249881,7 +251336,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1325}],1329:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1309}],1313:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -249922,7 +251377,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1325,"./calc":1326,"./convert":1327,"./defaults":1328}],1330:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1309,"./calc":1310,"./convert":1311,"./defaults":1312}],1314:[function(_dereq_,module,exports){ 'use strict'; var baseAttrs = _dereq_('../../plots/attributes'); @@ -250075,7 +251530,7 @@ module.exports = { domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'}) }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"./constants":1333}],1331:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"./constants":1317}],1315:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -250090,7 +251545,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1332:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1316:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -250411,7 +251866,7 @@ function countDescendants(node, trace, opts) { return nChild; } -},{"../../components/colorscale":678,"../../constants/numerical":779,"../../lib":803,"../pie/calc":1194,"d3-hierarchy":170,"fast-isnumeric":249}],1333:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../constants/numerical":763,"../../lib":787,"../pie/calc":1178,"d3-hierarchy":167,"fast-isnumeric":246}],1317:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -250431,7 +251886,7 @@ module.exports = { ] }; -},{}],1334:[function(_dereq_,module,exports){ +},{}],1318:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -250511,7 +251966,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"./attributes":1330}],1335:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"./attributes":1314}],1319:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -250827,7 +252282,7 @@ function makeEventData(pt, trace, keys) { return out; } -},{"../../components/fx":706,"../../components/fx/helpers":702,"../../lib":803,"../../lib/events":792,"../../registry":931,"../pie/helpers":1197,"./helpers":1336,"@plotly/d3":58}],1336:[function(_dereq_,module,exports){ +},{"../../components/fx":690,"../../components/fx/helpers":686,"../../lib":787,"../../lib/events":776,"../../registry":915,"../pie/helpers":1181,"./helpers":1320,"@plotly/d3":58}],1320:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -251004,7 +252459,7 @@ exports.formatPercent = function(v, separators) { return tx; }; -},{"../../components/color":666,"../../lib":803,"../../lib/setcursor":824,"../pie/helpers":1197}],1337:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../../lib/setcursor":808,"../pie/helpers":1181}],1321:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -251031,7 +252486,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":1236,"./attributes":1330,"./base_plot":1331,"./calc":1332,"./defaults":1334,"./layout_attributes":1338,"./layout_defaults":1339,"./plot":1340,"./style":1341}],1338:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1220,"./attributes":1314,"./base_plot":1315,"./calc":1316,"./defaults":1318,"./layout_attributes":1322,"./layout_defaults":1323,"./plot":1324,"./style":1325}],1322:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -251046,7 +252501,7 @@ module.exports = { } }; -},{}],1339:[function(_dereq_,module,exports){ +},{}],1323:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -251060,7 +252515,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendsunburstcolors'); }; -},{"../../lib":803,"./layout_attributes":1338}],1340:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1322}],1324:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -251695,7 +253150,7 @@ function getCoords(r, angle) { return [r * Math.sin(angle), -r * Math.cos(angle)]; } -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../bar/style":955,"../bar/uniform_text":957,"../pie/helpers":1197,"../pie/plot":1201,"./constants":1333,"./fx":1335,"./helpers":1336,"./style":1341,"@plotly/d3":58,"d3-hierarchy":170,"d3-interpolate":171}],1341:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../bar/style":939,"../bar/uniform_text":941,"../pie/helpers":1181,"../pie/plot":1185,"./constants":1317,"./fx":1319,"./helpers":1320,"./style":1325,"@plotly/d3":58,"d3-hierarchy":167,"d3-interpolate":168}],1325:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -251738,7 +253193,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"@plotly/d3":58}],1342:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"@plotly/d3":58}],1326:[function(_dereq_,module,exports){ 'use strict'; var Color = _dereq_('../../components/color'); @@ -251954,7 +253409,7 @@ colorScaleAttrs('', { attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/color":666,"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926}],1343:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910}],1327:[function(_dereq_,module,exports){ 'use strict'; var colorscaleCalc = _dereq_('../../components/colorscale/calc'); @@ -251977,7 +253432,7 @@ module.exports = function calc(gd, trace) { } }; -},{"../../components/colorscale/calc":674}],1344:[function(_dereq_,module,exports){ +},{"../../components/colorscale/calc":658}],1328:[function(_dereq_,module,exports){ 'use strict'; var createSurface = _dereq_('gl-surface3d'); @@ -252668,7 +254123,7 @@ function createSurfaceTrace(scene, data) { module.exports = createSurfaceTrace; -},{"../../components/colorscale":678,"../../lib":803,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../heatmap/find_empties":1091,"../heatmap/interp2d":1094,"gl-surface3d":354,"ndarray":483,"ndarray-linear-interpolate":477}],1345:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib":787,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../heatmap/find_empties":1075,"../heatmap/interp2d":1078,"gl-surface3d":346,"ndarray":472,"ndarray-linear-interpolate":466}],1329:[function(_dereq_,module,exports){ 'use strict'; var Registry = _dereq_('../../registry'); @@ -252837,7 +254292,7 @@ module.exports = { opacityscaleDefaults: opacityscaleDefaults }; -},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1342}],1346:[function(_dereq_,module,exports){ +},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1326}],1330:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -252858,7 +254313,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"./attributes":1342,"./calc":1343,"./convert":1344,"./defaults":1345}],1347:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"./attributes":1326,"./calc":1327,"./convert":1328,"./defaults":1329}],1331:[function(_dereq_,module,exports){ 'use strict'; var annAttrs = _dereq_('../../components/annotations/attributes'); @@ -252995,7 +254450,7 @@ var attrs = module.exports = overrideAll({ }, 'calc', 'from-root'); attrs.transforms = undefined; -},{"../../components/annotations/attributes":649,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/cartesian/axis_format_attributes":857,"../../plots/domain":882,"../../plots/font_attributes":883}],1348:[function(_dereq_,module,exports){ +},{"../../components/annotations/attributes":633,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/cartesian/axis_format_attributes":841,"../../plots/domain":866,"../../plots/font_attributes":867}],1332:[function(_dereq_,module,exports){ 'use strict'; var getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData; @@ -253019,7 +254474,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; -},{"../../plots/get_data":891,"./plot":1355}],1349:[function(_dereq_,module,exports){ +},{"../../plots/get_data":875,"./plot":1339}],1333:[function(_dereq_,module,exports){ 'use strict'; var wrap = _dereq_('../../lib/gup').wrap; @@ -253030,7 +254485,7 @@ module.exports = function calc() { return wrap({}); }; -},{"../../lib/gup":800}],1350:[function(_dereq_,module,exports){ +},{"../../lib/gup":784}],1334:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -253082,7 +254537,7 @@ module.exports = { } }; -},{}],1351:[function(_dereq_,module,exports){ +},{}],1335:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -253269,7 +254724,7 @@ function makeIdentity() { }; } -},{"../../lib/extend":793,"./constants":1350,"fast-isnumeric":249}],1352:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"./constants":1334,"fast-isnumeric":246}],1336:[function(_dereq_,module,exports){ 'use strict'; var extendFlat = _dereq_('../../lib/extend').extendFlat; @@ -253344,7 +254799,7 @@ function rowFromTo(d) { return [rowFrom, rowTo]; } -},{"../../lib/extend":793}],1353:[function(_dereq_,module,exports){ +},{"../../lib/extend":777}],1337:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -253401,7 +254856,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../lib":803,"../../plots/domain":882,"./attributes":1347}],1354:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/domain":866,"./attributes":1331}],1338:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -253418,7 +254873,7 @@ module.exports = { } }; -},{"./attributes":1347,"./base_plot":1348,"./calc":1349,"./defaults":1353,"./plot":1355}],1355:[function(_dereq_,module,exports){ +},{"./attributes":1331,"./base_plot":1332,"./calc":1333,"./defaults":1337,"./plot":1339}],1339:[function(_dereq_,module,exports){ 'use strict'; var c = _dereq_('./constants'); @@ -254309,7 +255764,7 @@ function allRowsHeight(rowBlock) { function getBlock(d) {return d.rowBlocks[d.page];} function getRow(l, i) {return l.rows[i - l.firstRowIndex];} -},{"../../components/color":666,"../../components/drawing":688,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"./constants":1350,"./data_preparation_helper":1351,"./data_split_helpers":1352,"@plotly/d3":58}],1356:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"./constants":1334,"./data_preparation_helper":1335,"./data_split_helpers":1336,"@plotly/d3":58}],1340:[function(_dereq_,module,exports){ 'use strict'; var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs; @@ -254495,7 +255950,7 @@ module.exports = { domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}), }; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"../sunburst/attributes":1330,"./constants":1359}],1357:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"../sunburst/attributes":1314,"./constants":1343}],1341:[function(_dereq_,module,exports){ 'use strict'; var plots = _dereq_('../../plots/plots'); @@ -254510,7 +255965,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout); }; -},{"../../plots/plots":917}],1358:[function(_dereq_,module,exports){ +},{"../../plots/plots":901}],1342:[function(_dereq_,module,exports){ 'use strict'; var calc = _dereq_('../sunburst/calc'); @@ -254523,7 +255978,7 @@ exports.crossTraceCalc = function(gd) { return calc._runCrossTraceCalc('treemap', gd); }; -},{"../sunburst/calc":1332}],1359:[function(_dereq_,module,exports){ +},{"../sunburst/calc":1316}],1343:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -254544,7 +255999,7 @@ module.exports = { gapWithPathbar: 1 // i.e. one pixel }; -},{}],1360:[function(_dereq_,module,exports){ +},{}],1344:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -254659,7 +256114,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._length = null; }; -},{"../../components/color":666,"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/constants":943,"../bar/defaults":945,"./attributes":1356}],1361:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/constants":927,"../bar/defaults":929,"./attributes":1340}],1345:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -254730,7 +256185,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall } }; -},{"../bar/style":955,"../bar/uniform_text":957,"../sunburst/helpers":1336,"./plot_one":1370,"@plotly/d3":58}],1362:[function(_dereq_,module,exports){ +},{"../bar/style":939,"../bar/uniform_text":941,"../sunburst/helpers":1320,"./plot_one":1354,"@plotly/d3":58}],1346:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -254900,7 +256355,7 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) { }); }; -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"./constants":1359,"./partition":1368,"./style":1371,"@plotly/d3":58}],1363:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"./constants":1343,"./partition":1352,"./style":1355,"@plotly/d3":58}],1347:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -255111,7 +256566,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) { return nextOfPrevEntry; }; -},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"../sunburst/plot":1340,"./constants":1359,"./partition":1368,"./style":1371,"@plotly/d3":58}],1364:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"../sunburst/plot":1324,"./constants":1343,"./partition":1352,"./style":1355,"@plotly/d3":58}],1348:[function(_dereq_,module,exports){ 'use strict'; module.exports = function flipTree(node, size, opts) { @@ -255149,7 +256604,7 @@ module.exports = function flipTree(node, size, opts) { } }; -},{}],1365:[function(_dereq_,module,exports){ +},{}],1349:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -255176,7 +256631,7 @@ module.exports = { } }; -},{"../scatter/marker_colorbar":1236,"./attributes":1356,"./base_plot":1357,"./calc":1358,"./defaults":1360,"./layout_attributes":1366,"./layout_defaults":1367,"./plot":1369,"./style":1371}],1366:[function(_dereq_,module,exports){ +},{"../scatter/marker_colorbar":1220,"./attributes":1340,"./base_plot":1341,"./calc":1342,"./defaults":1344,"./layout_attributes":1350,"./layout_defaults":1351,"./plot":1353,"./style":1355}],1350:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -255191,7 +256646,7 @@ module.exports = { } }; -},{}],1367:[function(_dereq_,module,exports){ +},{}],1351:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -255205,7 +256660,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) { coerce('extendtreemapcolors'); }; -},{"../../lib":803,"./layout_attributes":1366}],1368:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1350}],1352:[function(_dereq_,module,exports){ 'use strict'; var d3Hierarchy = _dereq_('d3-hierarchy'); @@ -255269,7 +256724,7 @@ function getTilingMethod(key, squarifyratio) { } } -},{"./flip_tree":1364,"d3-hierarchy":170}],1369:[function(_dereq_,module,exports){ +},{"./flip_tree":1348,"d3-hierarchy":167}],1353:[function(_dereq_,module,exports){ 'use strict'; var draw = _dereq_('./draw'); @@ -255282,7 +256737,7 @@ module.exports = function _plot(gd, cdmodule, transitionOpts, makeOnCompleteCall }); }; -},{"./draw":1361,"./draw_descendants":1363}],1370:[function(_dereq_,module,exports){ +},{"./draw":1345,"./draw_descendants":1347}],1354:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -255874,7 +257329,7 @@ module.exports = function plotOne(gd, cd, element, transitionOpts, drawDescendan } }; -},{"../../lib":803,"../bar/constants":943,"../bar/plot":952,"../bar/uniform_text":957,"../sunburst/helpers":1336,"./constants":1359,"./draw_ancestors":1362,"@plotly/d3":58,"d3-interpolate":171}],1371:[function(_dereq_,module,exports){ +},{"../../lib":787,"../bar/constants":927,"../bar/plot":936,"../bar/uniform_text":941,"../sunburst/helpers":1320,"./constants":1343,"./draw_ancestors":1346,"@plotly/d3":58,"d3-interpolate":168}],1355:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -255968,7 +257423,7 @@ module.exports = { styleOne: styleOne }; -},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"../sunburst/helpers":1336,"@plotly/d3":58}],1372:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"../sunburst/helpers":1320,"@plotly/d3":58}],1356:[function(_dereq_,module,exports){ 'use strict'; var boxAttrs = _dereq_('../box/attributes'); @@ -256124,7 +257579,7 @@ module.exports = { } }; -},{"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../box/attributes":966}],1373:[function(_dereq_,module,exports){ +},{"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../box/attributes":950}],1357:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256292,7 +257747,7 @@ function calcSpan(trace, cdi, valAxis, bandwidth) { return spanOut; } -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../box/calc":967,"./helpers":1376}],1374:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../box/calc":951,"./helpers":1360}],1358:[function(_dereq_,module,exports){ 'use strict'; var setPositionOffset = _dereq_('../box/cross_trace_calc').setPositionOffset; @@ -256327,7 +257782,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../box/cross_trace_calc":968}],1375:[function(_dereq_,module,exports){ +},{"../box/cross_trace_calc":952}],1359:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256380,7 +257835,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout if(!meanLineVisible) traceOut.meanline = {visible: false}; }; -},{"../../components/color":666,"../../lib":803,"../box/defaults":969,"./attributes":1372}],1376:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib":787,"../box/defaults":953,"./attributes":1356}],1360:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256445,7 +257900,7 @@ exports.getKdeValue = function(calcItem, trace, valueDist) { exports.extractVal = function(o) { return o.v; }; -},{"../../lib":803}],1377:[function(_dereq_,module,exports){ +},{"../../lib":787}],1361:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256552,7 +258007,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) { return closeData; }; -},{"../../lib":803,"../../plots/cartesian/axes":854,"../box/hover":971,"./helpers":1376}],1378:[function(_dereq_,module,exports){ +},{"../../lib":787,"../../plots/cartesian/axes":838,"../box/hover":955,"./helpers":1360}],1362:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -256577,7 +258032,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../box/defaults":969,"../box/select":976,"../scatter/style":1242,"./attributes":1372,"./calc":1373,"./cross_trace_calc":1374,"./defaults":1375,"./hover":1377,"./layout_attributes":1379,"./layout_defaults":1380,"./plot":1381,"./style":1382}],1379:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../box/defaults":953,"../box/select":960,"../scatter/style":1226,"./attributes":1356,"./calc":1357,"./cross_trace_calc":1358,"./defaults":1359,"./hover":1361,"./layout_attributes":1363,"./layout_defaults":1364,"./plot":1365,"./style":1366}],1363:[function(_dereq_,module,exports){ 'use strict'; var boxLayoutAttrs = _dereq_('../box/layout_attributes'); @@ -256592,7 +258047,7 @@ module.exports = { }) }; -},{"../../lib":803,"../box/layout_attributes":973}],1380:[function(_dereq_,module,exports){ +},{"../../lib":787,"../box/layout_attributes":957}],1364:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -256606,7 +258061,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { boxLayoutDefaults._supply(layoutIn, layoutOut, fullData, coerce, 'violin'); }; -},{"../../lib":803,"../box/layout_defaults":974,"./layout_attributes":1379}],1381:[function(_dereq_,module,exports){ +},{"../../lib":787,"../box/layout_defaults":958,"./layout_attributes":1363}],1365:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -256788,7 +258243,7 @@ module.exports = function plot(gd, plotinfo, cdViolins, violinLayer) { }); }; -},{"../../components/drawing":688,"../../lib":803,"../box/plot":975,"../scatter/line_points":1232,"./helpers":1376,"@plotly/d3":58}],1382:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../lib":787,"../box/plot":959,"../scatter/line_points":1216,"./helpers":1360,"@plotly/d3":58}],1366:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -256835,7 +258290,7 @@ module.exports = function style(gd) { }); }; -},{"../../components/color":666,"../scatter/style":1242,"@plotly/d3":58}],1383:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../scatter/style":1226,"@plotly/d3":58}],1367:[function(_dereq_,module,exports){ 'use strict'; var colorScaleAttrs = _dereq_('../../components/colorscale/attributes'); @@ -256900,7 +258355,7 @@ colorScaleAttrs('', { attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; attrs.transforms = undefined; -},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../isosurface/attributes":1154,"../surface/attributes":1342}],1384:[function(_dereq_,module,exports){ +},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../isosurface/attributes":1138,"../surface/attributes":1326}],1368:[function(_dereq_,module,exports){ 'use strict'; var createMesh = _dereq_('gl-mesh3d'); @@ -257025,7 +258480,7 @@ function createVolumeTrace(scene, data) { module.exports = createVolumeTrace; -},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"../isosurface/convert":1156,"gl-mesh3d":315}],1385:[function(_dereq_,module,exports){ +},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"../isosurface/convert":1140,"gl-mesh3d":309}],1369:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -257043,7 +258498,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout opacityscaleDefaults(traceIn, traceOut, layout, coerce); }; -},{"../../lib":803,"../isosurface/defaults":1157,"../surface/defaults":1345,"./attributes":1383}],1386:[function(_dereq_,module,exports){ +},{"../../lib":787,"../isosurface/defaults":1141,"../surface/defaults":1329,"./attributes":1367}],1370:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -257064,7 +258519,7 @@ module.exports = { } }; -},{"../../plots/gl3d":896,"../isosurface/calc":1155,"./attributes":1383,"./convert":1384,"./defaults":1385}],1387:[function(_dereq_,module,exports){ +},{"../../plots/gl3d":880,"../isosurface/calc":1139,"./attributes":1367,"./convert":1368,"./defaults":1369}],1371:[function(_dereq_,module,exports){ 'use strict'; var barAttrs = _dereq_('../bar/attributes'); @@ -257197,7 +258652,7 @@ module.exports = { alignmentgroup: barAttrs.alignmentgroup }; -},{"../../components/color":666,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218,"./constants":1389}],1388:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202,"./constants":1373}],1372:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../../plots/cartesian/axes'); @@ -257307,7 +258762,7 @@ module.exports = function calc(gd, trace) { return cd; }; -},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../scatter/calc_selection":1220}],1389:[function(_dereq_,module,exports){ +},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../scatter/calc_selection":1204}],1373:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -257318,7 +258773,7 @@ module.exports = { ] }; -},{}],1390:[function(_dereq_,module,exports){ +},{}],1374:[function(_dereq_,module,exports){ 'use strict'; var setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions; @@ -257383,7 +258838,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) { } }; -},{"../bar/cross_trace_calc":944}],1391:[function(_dereq_,module,exports){ +},{"../bar/cross_trace_calc":928}],1375:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -257486,7 +258941,7 @@ module.exports = { crossTraceDefaults: crossTraceDefaults }; -},{"../../components/color":666,"../../constants/delta.js":773,"../../lib":803,"../bar/defaults":945,"../scatter/period_defaults":1238,"../scatter/xy_defaults":1245,"./attributes":1387}],1392:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/delta.js":757,"../../lib":787,"../bar/defaults":929,"../scatter/period_defaults":1222,"../scatter/xy_defaults":1229,"./attributes":1371}],1376:[function(_dereq_,module,exports){ 'use strict'; module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { @@ -257505,7 +258960,7 @@ module.exports = function eventData(out, pt /* , trace, cd, pointNumber */) { return out; }; -},{}],1393:[function(_dereq_,module,exports){ +},{}],1377:[function(_dereq_,module,exports){ 'use strict'; var hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText; @@ -257593,7 +259048,7 @@ function getTraceColor(trace, di) { else if(opacity(mlc) && mlw) return mlc; } -},{"../../components/color":666,"../../constants/delta.js":773,"../../plots/cartesian/axes":854,"../bar/hover":948}],1394:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../constants/delta.js":757,"../../plots/cartesian/axes":838,"../bar/hover":932}],1378:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -257619,7 +259074,7 @@ module.exports = { } }; -},{"../../plots/cartesian":868,"../bar/select":953,"./attributes":1387,"./calc":1388,"./cross_trace_calc":1390,"./defaults":1391,"./event_data":1392,"./hover":1393,"./layout_attributes":1395,"./layout_defaults":1396,"./plot":1397,"./style":1398}],1395:[function(_dereq_,module,exports){ +},{"../../plots/cartesian":852,"../bar/select":937,"./attributes":1371,"./calc":1372,"./cross_trace_calc":1374,"./defaults":1375,"./event_data":1376,"./hover":1377,"./layout_attributes":1379,"./layout_defaults":1380,"./plot":1381,"./style":1382}],1379:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -257644,7 +259099,7 @@ module.exports = { } }; -},{}],1396:[function(_dereq_,module,exports){ +},{}],1380:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../../lib'); @@ -257673,7 +259128,7 @@ module.exports = function(layoutIn, layoutOut, fullData) { } }; -},{"../../lib":803,"./layout_attributes":1395}],1397:[function(_dereq_,module,exports){ +},{"../../lib":787,"./layout_attributes":1379}],1381:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -257796,7 +259251,7 @@ function getXY(di, xa, ya, isHorizontal) { return isHorizontal ? [s, p] : [p, s]; } -},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../bar/plot":952,"../bar/uniform_text":957,"@plotly/d3":58}],1398:[function(_dereq_,module,exports){ +},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../bar/plot":936,"../bar/uniform_text":941,"@plotly/d3":58}],1382:[function(_dereq_,module,exports){ 'use strict'; var d3 = _dereq_('@plotly/d3'); @@ -257849,7 +259304,7 @@ module.exports = { style: style }; -},{"../../components/color":666,"../../components/drawing":688,"../../constants/interactions":778,"../bar/style":955,"../bar/uniform_text":957,"@plotly/d3":58}],1399:[function(_dereq_,module,exports){ +},{"../../components/color":650,"../../components/drawing":672,"../../constants/interactions":762,"../bar/style":939,"../bar/uniform_text":941,"@plotly/d3":58}],1383:[function(_dereq_,module,exports){ 'use strict'; var Axes = _dereq_('../plots/cartesian/axes'); @@ -258253,7 +259708,7 @@ function last(array, indices) { return array[indices[indices.length - 1]]; } -},{"../constants/numerical":779,"../lib":803,"../plot_api/plot_schema":842,"../plots/cartesian/axes":854,"./helpers":1402}],1400:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"../lib":787,"../plot_api/plot_schema":826,"../plots/cartesian/axes":838,"./helpers":1386}],1384:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -258513,7 +259968,7 @@ function getFilterFunc(opts, d2c, targetCalendar) { } } -},{"../constants/filter_ops":775,"../lib":803,"../plots/cartesian/axes":854,"../registry":931,"./helpers":1402}],1401:[function(_dereq_,module,exports){ +},{"../constants/filter_ops":759,"../lib":787,"../plots/cartesian/axes":838,"../registry":915,"./helpers":1386}],1385:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -258757,7 +260212,7 @@ function transformOne(trace, state) { return newData; } -},{"../lib":803,"../plot_api/plot_schema":842,"../plots/plots":917,"./helpers":1402}],1402:[function(_dereq_,module,exports){ +},{"../lib":787,"../plot_api/plot_schema":826,"../plots/plots":901,"./helpers":1386}],1386:[function(_dereq_,module,exports){ 'use strict'; exports.pointsAccessorFunction = function(transforms, opts) { @@ -258775,7 +260230,7 @@ exports.pointsAccessorFunction = function(transforms, opts) { return originalPointsAccessor; }; -},{}],1403:[function(_dereq_,module,exports){ +},{}],1387:[function(_dereq_,module,exports){ 'use strict'; var Lib = _dereq_('../lib'); @@ -258913,11 +260368,11 @@ function getSortFunc(opts, d2c) { } } -},{"../constants/numerical":779,"../lib":803,"../plots/cartesian/axes":854,"./helpers":1402}],1404:[function(_dereq_,module,exports){ +},{"../constants/numerical":763,"../lib":787,"../plots/cartesian/axes":838,"./helpers":1386}],1388:[function(_dereq_,module,exports){ 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.4.2'; +exports.version = '2.5.0'; },{}]},{},[27])(27) }); diff --git a/dist/plotly.min.js b/dist/plotly.min.js index 63e60d1809d..13413906d11 100644 --- a/dist/plotly.min.js +++ b/dist/plotly.min.js @@ -1,58 +1,58 @@ /** -* plotly.js v2.4.2 +* plotly.js v2.5.0 * Copyright 2012-2021, 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{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){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 c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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":803}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1399}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":949}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":962}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":972}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":664}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":981}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":1e3}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":1014}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":1021}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":1027}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":1042}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":1053}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":781}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":1061}],16:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1400}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":1071}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":1080}],19:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1401}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":1093}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":1103}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1115}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1121}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1125}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/icicle")},{"../src/traces/icicle":1131}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":1144}],27:[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("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./image"),t("./pie"),t("./sunburst"),t("./treemap"),t("./icicle"),t("./funnelarea"),t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./parcats"),t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./sankey"),t("./indicator"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl"),t("./barpolar"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./icicle":25,"./image":26,"./indicator":28,"./isosurface":29,"./mesh3d":30,"./ohlc":31,"./parcats":32,"./parcoords":33,"./pie":34,"./pointcloud":35,"./sankey":36,"./scatter3d":37,"./scattercarpet":38,"./scattergeo":39,"./scattergl":40,"./scattermapbox":41,"./scatterpolar":42,"./scatterpolargl":43,"./scatterternary":44,"./sort":45,"./splom":46,"./streamtube":47,"./sunburst":48,"./surface":49,"./table":50,"./treemap":51,"./violin":52,"./volume":53,"./waterfall":54}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":1152}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1158}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1163}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1168}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1177}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1187}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1198}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1207}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1213}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1251}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1258}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1266}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1279}],41:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1289}],42:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1297}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1304}],44:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1312}],45:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1403}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":1321}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1329}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1337}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1346}],50:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1354}],51:[function(t,e,r){"use strict";e.exports=t("../src/traces/treemap")},{"../src/traces/treemap":1365}],52:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1378}],53:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1386}],54:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1394}],55:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),f=i(),h=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:u,orbit:f,matrix:h},c)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(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}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach((function(t){for(var e=t[0],r=[],n=0;n1||i>1)}function M(t,e,r){return t.sort(E),t.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&A(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),M(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),M(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+10,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,a)&&A(e))e.circularPathData.leftSmallArcRadius=10+e.width/2,e.circularPathData.leftLargeArcRadius=10+e.width/2,e.circularPathData.rightSmallArcRadius=10+e.width/2,e.circularPathData.rightLargeArcRadius=10+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(C):c.sort(L);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=10+e.width/2+u,e.circularPathData.leftLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(I):c.sort(P),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=10+e.width/2+u,e.circularPathData.rightLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){var e="";e="top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY;return e}(e);else{var f=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=f(e)}}))}function E(t,e){return O(t)==O(e)?"bottom"==t.circularLinkType?C(t,e):L(t,e):O(e)-O(t)}function L(t,e){return t.y0-e.y0}function C(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function I(t,e){return e.y1-t.y1}function O(t){return t.target.column-t.source.column}function z(t){return t.target.x0-t.source.x1}function D(t,e){var r=T(t),n=z(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function R(t,e){var r=T(t),n=z(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function F(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),f=Math.pow(1-u,3),h=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),g=f*i.y0+h*i.y0+p*i.y1+d*i.y1,m=g-i.width/2,v=g+i.width/2;m>o.y0&&mo.y0&&vo.y1)&&(c=v-o.y0+10,o=N(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0o.y1&&N(t,c,e,r)})))}}))}}))}function B(t,e){return t.y0>e.y0&&t.y0e.y0&&t.y1e.y1)}function N(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function j(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return b(t.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=R(e,t);return t.y1-r}if(e.target.column>t.target.column)return R(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function H(t,e){return b(t.source,e)==b(t.target,e)}function G(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}t.sankeyCircular=function(){var t,n,i=0,a=0,b=1,T=1,A=24,M=m,E=o,L=v,C=y,P=32,I=2,O=null;function z(){var t={nodes:L.apply(null,arguments),links:C.apply(null,arguments)};D(t),_(t,M,O),R(t),B(t),w(t,M),N(t,P,M),V(t);for(var e=4,r=0;r0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:a=a>0?a+25+10:a,right:i=i>0?i+25+10:i}}(o),f=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),o=b-i,s=T-a,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return i=i*l+r.left,b=0==r.right?b:b*l,a=a*c+r.top,T*=c,t.nodes.forEach((function(t){t.x0=i+t.column*((b-i-A)/n),t.x1=t.x0+A})),c}(o,u);l*=f,o.links.forEach((function(t){t.width=t.value*l})),c.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==c.length-1&&1==e||0==t.depth&&1==e?(t.y0=T/2-t.value*l,t.y1=t.y0+t.value*l):t.partOfCycle?0==k(t,r)?(t.y0=T/2+n,t.y1=t.y0+t.value*l):"top"==t.circularLinkType?(t.y0=a+n,t.y1=t.y0+t.value*l):(t.y0=T-t.value*l-n,t.y1=t.y0+t.value*l):0==u.top||0==u.bottom?(t.y0=(T-a)/e*n,t.y1=t.y0+t.value*l):(t.y0=(T-a)/2-e/2+n,t.y1=t.y0+t.value*l)}))}))}(l),y();for(var u=1,m=s;m>0;--m)v(u*=.99,l),y();function v(t,r){var n=c.length;c.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&k(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else{var l=e.mean(i.sourceLinks,g),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function y(){c.forEach((function(e){var r,n,i,o=a,s=e.length;for(e.sort(f),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-T)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=e[i]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function V(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return z.nodeId=function(t){return arguments.length?(M="function"==typeof t?t:s(t),z):M},z.nodeAlign=function(t){return arguments.length?(E="function"==typeof t?t:s(t),z):E},z.nodeWidth=function(t){return arguments.length?(A=+t,z):A},z.nodePadding=function(e){return arguments.length?(t=+e,z):t},z.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),z):L},z.links=function(t){return arguments.length?(C="function"==typeof t?t:s(t),z):C},z.size=function(t){return arguments.length?(i=a=0,b=+t[0],T=+t[1],z):[b-i,T-a]},z.extent=function(t){return arguments.length?(i=+t[0][0],b=+t[1][0],a=+t[0][1],T=+t[1][1],z):[[i,a],[b,T]]},z.iterations=function(t){return arguments.length?(P=+t,z):P},z.circularLinkGap=function(t){return arguments.length?(I=+t,z):I},z.nodePaddingRatio=function(t){return arguments.length?(n=+t,z):n},z.sortNodes=function(t){return arguments.length?(O=t,z):O},z.update=function(t){return w(t,M),V(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1a&&(b=a);var o=e.min(i,(function(t){return(y-n-(t.length-1)*b)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}(),d();for(var a=1,o=A;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,h)/e.sum(r.targetLinks,u)-f(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-f(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+b;if((r=a-b-y)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}function P(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return M.update=function(t){return P(t),t},M.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),M):_},M.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),M):w},M.nodeWidth=function(t){return arguments.length?(x=+t,M):x},M.nodePadding=function(t){return arguments.length?(b=+t,M):b},M.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),M):T},M.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),M):k},M.size=function(e){return arguments.length?(t=n=0,i=+e[0],y=+e[1],M):[i-t,y-n]},M.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],y=+e[1][1],M):[[t,n],[i,y]]},M.iterations=function(t){return arguments.length?(A=+t,M):A},M},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(y).target(x)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":162,"d3-collection":163,"d3-shape":174}],58:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},i=self.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=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}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>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>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var m=g(h);function v(t){return t.length}t.bisectLeft=m.left,t.bisect=t.bisectRight=m.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.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},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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=x(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,f,h=-1,p=a.length,d=i[s++],g=new _;++h=i.length)return e;var n=[],o=a[r++];return e.forEach((function(e,i){n.push({key:e,values:t(i,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,Y),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return q(t,this)}}function X(t){return"function"==typeof t?t:function(){return H(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Y.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=gt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=Y.append,ht.empty=Y.empty,ht.node=Y.node,ht.call=Y.call,ht.size=Y.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s1?Et:t<-1?-Et:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}var Ot=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<1e-12)n=Math.log(c/o)/Ot,r=function(t){return[i+t*u,a+t*f,o*Math.exp(Ot*t*n)]};else{var p=Math.sqrt(h),d=(c*c-o*o+4*h)/(2*o*2*p),g=(c*c-o*o-4*h)/(2*c*2*p),m=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(g*g+1)-g);n=(v-m)/Ot,r=function(t){var e,r=t*n,s=It(m),l=o/(2*p)*(s*(e=Ot*r+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[i+l*u,a+l*f,o*s/It(Ot*r+m)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,f,h={x:0,y:0,k:1},p=[960,500],d=Rt,g=250,m=0,v="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(v,P).on(Dt+".zoom",O).on("dblclick.zoom",z).on(b,I)}function T(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(d[0],Math.min(d[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function M(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,a)),A(r=n,i),e=t.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(u.range().map((function(t){return(t-h.y)/h.k})).map(u.invert))}function E(t){m++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--m||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,l).on(x,c),a=T(t.mouse(e)),s=bt(e);function l(){n=1,A(t.mouse(e),a),L(r)}function c(){i.on(y,null).on(x,null),s(n),C(r)}Di.call(e),E(r)}function I(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=bt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,m).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){v=p[0];var x=p[1],b=v[0]-x[0],_=v[1]-x[1];a=b*b+_*_}}function m(){var o,l,c,u,f=t.touches(r);Di.call(r);for(var h=0,p=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new Qt(a(t+120),a(t),a(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof Ht?e.l:(e=ae((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Nt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,this.l/t)},Nt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,t*this.l)},Nt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Ft;function qt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Ht(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Ht(t,e,r){return this instanceof Ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Ht?new Ht(t.l,t.a,t.b):t instanceof Ut?qt(t.h,t.c,t.l):ae((t=Qt(t)).r,t.g,t.b):new Ht(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Vt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},t.lab=Ht;var Gt=18,Yt=Ht.prototype=new Ft;function Wt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new Qt(Kt(3.2404542*(i=.95047*Zt(i))-1.5371385*(n=1*Zt(n))-.4985314*(a=1.08883*Zt(a))),Kt(-.969266*i+1.8760108*n+.041556*a),Kt(.0556434*i-.2040259*n+1.0572252*a))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Zt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Kt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,jt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}Yt.brighter=function(t){return new Ht(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new Ht(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Wt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Ft;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(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(se(i[0]),se(i[1]),se(i[2]))}return(a=le.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 ie(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+(e0&&l<1?0:n),new Bt(n,i,l)}function ae(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),i=Jt((.2126729*t+.7151522*e+.072175*r)/1);return Ht(116*i-16,500*(n-i),200*(i-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.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=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ce,t.xhr=ue(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=fe(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(ye,e)),de=0):(de=1,me(ye))}function xe(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function be(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ve.apply(this,arguments)},t.timer.flush=function(){xe(),be()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ce(e),a=ce(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[c[n]][2]]);for(n=+f;nkt)s=s.L;else{if(!((i=a-Ve(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fe(t);if(Pe.insert(e,l),e||r){if(e===r)return We(e),r=Fe(e.site),Pe.insert(l,r),l.edge=r.edge=Je(e.site,l.site),Ye(e),void Ye(r);if(r){We(e),We(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,p=t.y-f,d=r.site,g=d.x-u,m=d.y-f,v=2*(h*m-p*g),y=h*h+p*p,x=g*g+m*m,b={x:(m*y-p*x)/v+u,y:(h*x-g*y)/v+f};Qe(r.edge,c,d,b),l.edge=Je(c,t,null,b),r.edge=Je(t,d,null,b),Ye(e),Ye(r)}else l.edge=Je(e.site,l.site)}}function Ue(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;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function Ve(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function qe(t){this.site=t,this.edges=[]}function He(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(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,c=n.y-s,u=a.x-o,f=2*(l*(m=a.y-s)-c*u);if(!(f>=-1e-12)){var h=l*l+c*c,p=u*u+m*m,d=(m*h-c*p)/f,g=(l*p-u*h)/f,m=g+s,v=De.pop()||new Ge;v.arc=t,v.site=i,v.x=d+o,v.y=m+Math.sqrt(d*d+g*g),v.cy=m,t.circle=v;for(var y=null,x=Oe._;x;)if(v.y=s)return;if(h>d){if(a){if(a.y>=c)return}else a={x:m,y:l};r={x:m,y:c}}else{if(a){if(a.y1)if(h>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>u&&(u=e)}if(e=i-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>u&&(u=e)}else if(h>0){if(e0)){if(e/=p,p<0){if(e0){if(e>f)return;e>u&&(u=e)}if(e=a-c,p||!(e<0)){if(e/=p,p<0){if(e>f)return;e>u&&(u=e)}else if(p>0){if(e0&&(t.a={x:l+u*h,y:c+u*p}),f<1&&(t.b={x:l+f*h,y:c+f*p}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)kt||y(i-r)>kt)&&(s.splice(o,0,new $e(Ke(a.site,u,y(n-f)kt?{x:f,y:y(e-f)kt?{x:y(r-d)kt?{x:h,y:y(e-h)kt?{x:y(r-p)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ar(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ar(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(He),u=-1,f=c.length,h=c[f-1].edge,p=h.l===l?h.r:h.l;++ua||f>o||h=_)<<1|e>=b,T=w+4;wa&&(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:dr(r,n)})),a=vr.lastIndex;return ag&&(g=l.x),l.y>m&&(m=l.y),c.push(l.x),u.push(l.y);else for(f=0;fg&&(g=b),_>m&&(m=_),c.push(b),u.push(_)}var w=g-p,T=m-d;function k(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(y(l-r)+y(c-n)<.01)A(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,f=n>=c,h=f<<1|u;t.leaf=!1,u?i=l:o=l,f?a=c:s=c,k(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?m=d+w:g=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(M,t,+v(t,++f),+x(t,f),p,d,g,m)},visit:function(t){ur(t,M,p,d,g,m)},find:function(t){return fr(M,t[0],t[1],p,d,g,m)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[i](e,r)););return n}function xr(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Ar(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Mr(t){return t*t}function Sr(t){return t*t*t}function Er(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 Lr(t){return 1-Math.cos(t*Et)}function Cr(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Ir(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 Or(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function zr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Rr(i),s=Dr(i,a),l=Rr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=_r.get(n)||br,Tr((i=wr.get(i)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Wt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=Or,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new zr(e?e.matrix:Fr)})(e)},zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function Nr(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(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:dr(t[0],e[0])},{i:i-2,x:dr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:dr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:dr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:dr(t[0],e[0])},{i:i-2,x:dr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Br(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ve(s.tick)),s):n},s.start=function(){var t,e,r,n=v.length,l=y.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function $r(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=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return $r(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return 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,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function dn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function mn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(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 yn(e){return[t.min(e),t.max(e)]}function xn(t,e){return t.value-e.value}function bn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(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 Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,f=1/0,h=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(Mn(r,n,i=e[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=c[t.bisect(h,l,1,d)-1]).y+=g,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ce(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return vn(e,t)}:ce(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(xn),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+u(t.value)})),$r(s,Tn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;$r(s,(function(t){t.r+=f})),$r(s,Tn),$r(s,(function(t){t.r-=f}))}return function t(e,r,n,i){var a=e.children;if(e.x=r+=i*e.x,e.y=n+=i*e.y,e.r*=i,a)for(var o=-1,s=a.length;++op.x&&(p=t),t.depth>d.depth&&(d=t)}));var g=r(h,p)/2-h.x,m=n[0]/(p.x+r(p,h)/2+g),v=n[1]/(d.depth||1);Qr(u,(function(t){t.x=(t.x+g)*m,t.y=t.depth*v}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=Ln(s),a=En(a),s&&a;)l=En(l),(o=Ln(o)).a=t,(i=s.z+f-a.z-c+r(s._,a._))>0&&(Cn(Pn(s,t,n),t,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=f-u),a&&!En(l)&&(l.t=a,l.m+=c-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Kr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;$r(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2;return $r(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Kr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=In,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,g))<=h?(c.pop(),h=n):(s.area-=s.pop().area,d(s,g,a,!1),g=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,g,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Rn,s=i?Ur:jr;return a=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return a(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Or)},l.clamp=function(t){return arguments.length?(i=t,s()):i},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Hn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Vn(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,i){function a(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(a(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((i=t.map(Number)).map(a)),s):i},s.base=function(t){return arguments.length?(r=+t,e.domain(i.map(a)),s):r},s.nice=function(){var t=Fn(i.map(a),n?Math:Gn);return e.domain(t),i=t.map(o),s},s.ticks=function(){var t=zn(i),e=[],s=t[0],l=t[1],c=Math.floor(a(s)),u=Math.ceil(a(l)),f=r%1?2:r;if(isFinite(u-c)){if(n){for(;c0;h--)e.push(o(c)*h);for(c=0;e[c]l;u--);e=e.slice(c,u)}return e},s.copy=function(){return t(e.copy(),r,n,i)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Yn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=Yn(r),a=Yn(1/r);function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n},o.ticks=function(t){return Hn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Vn(n,t))},o.exponent=function(t){return arguments.length?(i=Yn(r=t),a=Yn(1/r),e.domain(n.map(i)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||("range"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],i=new _;for(var e,a=-1,o=t.length;++a0?i[t-1]:r[0],tf?0:1;if(c=St)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,g,m,v,y,x,b,_,w,T,k,A,M=0,S=0,E=[];if((v=(+o.apply(this,arguments)||0)/2)&&(m=n===Qn?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Pt(m/c*Math.sin(v))),s&&(M=Pt(m/s*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=At?0:1;if(S&&ii(y,x,b,_)===p^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-M),T=s*Math.sin(f-M),k=s*Math.cos(u+M),A=s*Math.sin(u+M);var P=Math.abs(u-f+2*M)<=At?0:1;if(M&&ii(w,T,k,A)===1-p^P){var I=(u+f)/2;w=s*Math.cos(I),T=s*Math.sin(I),k=A=null}}else w=T=0;if(h>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function ai(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,p=e[1]+c,d=(u+h)/2,g=(f+p)/2,m=h-u,v=p-f,y=m*m+v*v,x=r-n,b=u*p-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-m*_)/y,T=(-b*m-v*_)/y,k=(b*v+m*_)/y,A=(-b*m+v*_)/y,M=w-d,S=T-g,E=k-d,L=A-g;return M*M+S*S>E*E+L*L&&(w=k,T=A),[[w-l,T-c],[w*r/x,T*r/x]]}function oi(){return!0}function si(t){var e=_e,r=we,n=oi,i=ci,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,f=a.length,h=ce(e),p=ce(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]);return i.join("")},"step-before":fi,"step-after":hi,basis:gi,"basis-open":function(t){if(t.length<4)return ci(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(mi(xi,a)+","+mi(xi,o)),--n;for(;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++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}(t))}});function ci(t){return t.length>1?t.join("L"):t+"Z"}function ui(t){return t.join("L")+"Z"}function fi(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){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 c=2;cAt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ce(t),a):r},a.source=function(e){return arguments.length?(t=ce(e),a):t},a.target=function(t){return arguments.length?(e=ce(t),a):e},a.startAngle=function(t){return arguments.length?(n=ce(t),a):n},a.endAngle=function(t){return arguments.length?(i=ce(t),a):i},a},t.svg.diagonal=function(){var t=ki,e=Ai,r=Si;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ce(e),n):t},n.target=function(t){return arguments.length?(e=ce(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Si,n=e.projection;return e.projection=function(t){return arguments.length?n(Ei(r=t)):r},e},t.svg.symbol=function(){var t=Ci,e=Li;function r(r,n){return(Ii.get(t.call(this,r,n))||Pi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ce(e),r):t},r.size=function(t){return arguments.length?(e=ce(t),r):e},r};var Ii=t.map({circle:Pi,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*zi)),r=e*zi;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/Oi),r=e*Oi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Oi),r=e*Oi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ii.keys();var Oi=Math.sqrt(3),zi=Math.tan(30*Lt);Y.transition=function(t){for(var e,r,n=Bi||++Ui,i=Hi(t),a=[],o=Ni||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(a=i.time,o=ve((function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h}),0,a),f=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}ji.call=Y.call,ji.empty=Y.empty,ji.node=Y.node,ji.size=Y.size,t.transition=function(e,r){return e&&e.transition?Bi?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ji,ji.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function m(){var f,m,v=this,y=t.select(t.event.target),x=n.of(v,arguments),b=t.select(v),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,T=!/^(e|w)$/.test(_)&&a,k=y.classed("extent"),A=bt(v),M=t.mouse(v),S=t.select(o(v)).on("keydown.brush",C).on("keyup.brush",P);if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",z):S.on("mousemove.brush",I).on("mouseup.brush",z),b.interrupt().selectAll("*").interrupt(),k)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(_){var E=+/w$/.test(_),L=+/^n/.test(_);m=[s[1-E]-M[0],l[1-L]-M[1]],M[0]=s[E],M[1]=l[L]}else t.event.altKey&&(f=M.slice());function C(){32==t.event.keyCode&&(k||(f=null,M[0]-=s[1],M[1]-=l[1],k=2),F())}function P(){32==t.event.keyCode&&2==k&&(M[0]+=s[1],M[1]+=l[1],k=0,F())}function I(){var e=t.mouse(v),r=!1;m&&(e[0]+=m[0],e[1]+=m[1]),k||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(f(e.dtype))(m):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=m));for(var v=0;vr||s>1073741824){for(var h=0;he+n||w>r+n||T=A||a===o)){var s=y[i];void 0===o&&(o=s.length);for(var l=a;l=d&&u<=m&&f>=g&&f<=v&&S.push(c)}var h=x[i],p=h[4*a+0],b=h[4*a+1],M=h[4*a+2],E=h[4*a+3],P=C(h,a+1),I=.5*n,O=i+1;L(e,r,I,O,p,b||M||E||P),L(e,r+I,I,O,b,M||E||P),L(e+I,r,I,O,M,E||P),L(e+I,r+I,I,O,E,P)}}function C(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}return L(0,0,1,0,0,1),S},d;function E(t,e,r,i,a){for(var o=[],s=0;s0){e+=Math.abs(a(t[0]));for(var r=1;r2){for(s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=f,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return p(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return f(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],63:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,f,h=0,p=0,d=t.type,g="FeatureCollection"===d,m="Feature"===d,v=g?t.features.length:1,y=0;yc||p>u||d>f)return l=i,c=r,u=p,f=d,void(o=0);var g=n.lineString([l,i],t.properties);if(!1===e(g,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=f,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return p(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return f(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],69:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,f,h=0,p=0,d=t.type,g="FeatureCollection"===d,m="Feature"===d,v=g?t.features.length:1,y=0;yc||p>u||d>f)return l=i,c=r,u=p,f=d,void(o=0);var g=n.lineString([l,i],t.properties);if(!1===e(g,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;si&&(i=t[o]),t[o]:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","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:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:#fff;","X .select-outline-2":"stroke:#000;stroke-dasharray:2px 2px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;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,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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":787}],2:[function(t,e,r){"use strict";e.exports=t("../src/transforms/aggregate")},{"../src/transforms/aggregate":1383}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":933}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/barpolar")},{"../src/traces/barpolar":946}],5:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":956}],6:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":648}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":965}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":984}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":998}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":1005}],11:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":1011}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":1026}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":1037}],14:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":765}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":1045}],16:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1384}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnel")},{"../src/traces/funnel":1055}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/funnelarea")},{"../src/traces/funnelarea":1064}],19:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1385}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":1077}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":1087}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":1099}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":1105}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":1109}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/icicle")},{"../src/traces/icicle":1115}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/image")},{"../src/traces/image":1128}],27:[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("./contour"),t("./scatterternary"),t("./violin"),t("./funnel"),t("./waterfall"),t("./image"),t("./pie"),t("./sunburst"),t("./treemap"),t("./icicle"),t("./funnelarea"),t("./scatter3d"),t("./surface"),t("./isosurface"),t("./volume"),t("./mesh3d"),t("./cone"),t("./streamtube"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./parcats"),t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox"),t("./sankey"),t("./indicator"),t("./table"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick"),t("./scatterpolar"),t("./scatterpolargl"),t("./barpolar"),t("./aggregate"),t("./filter"),t("./groupby"),t("./sort"),t("./calendars")]),e.exports=n},{"./aggregate":2,"./bar":3,"./barpolar":4,"./box":5,"./calendars":6,"./candlestick":7,"./carpet":8,"./choropleth":9,"./choroplethmapbox":10,"./cone":11,"./contour":12,"./contourcarpet":13,"./core":14,"./densitymapbox":15,"./filter":16,"./funnel":17,"./funnelarea":18,"./groupby":19,"./heatmap":20,"./heatmapgl":21,"./histogram":22,"./histogram2d":23,"./histogram2dcontour":24,"./icicle":25,"./image":26,"./indicator":28,"./isosurface":29,"./mesh3d":30,"./ohlc":31,"./parcats":32,"./parcoords":33,"./pie":34,"./pointcloud":35,"./sankey":36,"./scatter3d":37,"./scattercarpet":38,"./scattergeo":39,"./scattergl":40,"./scattermapbox":41,"./scatterpolar":42,"./scatterpolargl":43,"./scatterternary":44,"./sort":45,"./splom":46,"./streamtube":47,"./sunburst":48,"./surface":49,"./table":50,"./treemap":51,"./violin":52,"./volume":53,"./waterfall":54}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/indicator")},{"../src/traces/indicator":1136}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/isosurface")},{"../src/traces/isosurface":1142}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":1147}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":1152}],32:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcats")},{"../src/traces/parcats":1161}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":1171}],34:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":1182}],35:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":1191}],36:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1197}],37:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1235}],38:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1242}],39:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1250}],40:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1263}],41:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1273}],42:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolar")},{"../src/traces/scatterpolar":1281}],43:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterpolargl")},{"../src/traces/scatterpolargl":1288}],44:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1296}],45:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1387}],46:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":1305}],47:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":1313}],48:[function(t,e,r){"use strict";e.exports=t("../src/traces/sunburst")},{"../src/traces/sunburst":1321}],49:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1330}],50:[function(t,e,r){"use strict";e.exports=t("../src/traces/table")},{"../src/traces/table":1338}],51:[function(t,e,r){"use strict";e.exports=t("../src/traces/treemap")},{"../src/traces/treemap":1349}],52:[function(t,e,r){"use strict";e.exports=t("../src/traces/violin")},{"../src/traces/violin":1362}],53:[function(t,e,r){"use strict";e.exports=t("../src/traces/volume")},{"../src/traces/volume":1370}],54:[function(t,e,r){"use strict";e.exports=t("../src/traces/waterfall")},{"../src/traces/waterfall":1378}],55:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),f=i(),h=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:u,orbit:f,matrix:h},c)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(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}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r1||i>1)}function A(t,e,r){return t.sort(E),t.forEach((function(n,i){var a,o,s=0;if(q(n,r)&&M(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function S(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),A(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),A(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+10,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,q(e,a)&&M(e))e.circularPathData.leftSmallArcRadius=10+e.width/2,e.circularPathData.leftLargeArcRadius=10+e.width/2,e.circularPathData.rightSmallArcRadius=10+e.width/2,e.circularPathData.rightLargeArcRadius=10+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(C):c.sort(L);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=10+e.width/2+u,e.circularPathData.leftLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(I):c.sort(P),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=10+e.width/2+u,e.circularPathData.rightLargeArcRadius=10+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+25+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-25-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){var e="";e="top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY;return e}(e);else{var f=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=f(e)}}))}function E(t,e){return O(t)==O(e)?"bottom"==t.circularLinkType?C(t,e):L(t,e):O(e)-O(t)}function L(t,e){return t.y0-e.y0}function C(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function I(t,e){return e.y1-t.y1}function O(t){return t.target.column-t.source.column}function z(t){return t.target.x0-t.source.x1}function D(t,e){var r=T(t),n=z(e)/Math.tan(r);return"up"==H(t)?t.y1+n:t.y1-n}function R(t,e){var r=T(t),n=z(e)/Math.tan(r);return"up"==H(t)?t.y1-n:t.y1+n}function F(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),f=Math.pow(1-u,3),h=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=f*i.y0+h*i.y0+p*i.y1+d*i.y1,g=m-i.width/2,v=m+i.width/2;g>o.y0&&go.y0&&vo.y1)&&(c=v-o.y0+10,o=N(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0o.y1&&N(t,c,e,r)})))}}))}}))}function B(t,e){return t.y0>e.y0&&t.y0e.y0&&t.y1e.y1)}function N(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function j(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return b(t.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=R(e,t);return t.y1-r}if(e.target.column>t.target.column)return R(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function q(t,e){return b(t.source,e)==b(t.target,e)}function G(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}t.sankeyCircular=function(){var t,n,i=0,a=0,b=1,T=1,M=24,A=g,E=o,L=v,C=y,P=32,I=2,O=null;function z(){var t={nodes:L.apply(null,arguments),links:C.apply(null,arguments)};D(t),_(t,A,O),R(t),B(t),w(t,A),N(t,P,A),V(t);for(var e=4,r=0;r0?r+25+10:r,bottom:n=n>0?n+25+10:n,left:a=a>0?a+25+10:a,right:i=i>0?i+25+10:i}}(o),f=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),o=b-i,s=T-a,l=o/(o+r.right+r.left),c=s/(s+r.top+r.bottom);return i=i*l+r.left,b=0==r.right?b:b*l,a=a*c+r.top,T*=c,t.nodes.forEach((function(t){t.x0=i+t.column*((b-i-M)/n),t.x1=t.x0+M})),c}(o,u);l*=f,o.links.forEach((function(t){t.width=t.value*l})),c.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==c.length-1&&1==e||0==t.depth&&1==e?(t.y0=T/2-t.value*l,t.y1=t.y0+t.value*l):t.partOfCycle?0==k(t,r)?(t.y0=T/2+n,t.y1=t.y0+t.value*l):"top"==t.circularLinkType?(t.y0=a+n,t.y1=t.y0+t.value*l):(t.y0=T-t.value*l-n,t.y1=t.y0+t.value*l):0==u.top||0==u.bottom?(t.y0=(T-a)/e*n,t.y1=t.y0+t.value*l):(t.y0=(T-a)/2-e/2+n,t.y1=t.y0+t.value*l)}))}))}(l),y();for(var u=1,g=s;g>0;--g)v(u*=.99,l),y();function v(t,r){var n=c.length;c.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&k(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=T/2-s/2,i.y1=T/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function y(){c.forEach((function(e){var r,n,i,o=a,s=e.length;for(e.sort(f),i=0;i0&&(r.y0+=n,r.y1+=n),o=r.y1+t;if((n=o-t-T)>0)for(o=r.y0-=n,r.y1-=n,i=s-2;i>=0;--i)(n=(r=e[i]).y1+t-o)>0&&(r.y0-=n,r.y1-=n),o=r.y0}))}}function V(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return z.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:s(t),z):A},z.nodeAlign=function(t){return arguments.length?(E="function"==typeof t?t:s(t),z):E},z.nodeWidth=function(t){return arguments.length?(M=+t,z):M},z.nodePadding=function(e){return arguments.length?(t=+e,z):t},z.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),z):L},z.links=function(t){return arguments.length?(C="function"==typeof t?t:s(t),z):C},z.size=function(t){return arguments.length?(i=a=0,b=+t[0],T=+t[1],z):[b-i,T-a]},z.extent=function(t){return arguments.length?(i=+t[0][0],b=+t[1][0],a=+t[0][1],T=+t[1][1],z):[[i,a],[b,T]]},z.iterations=function(t){return arguments.length?(P=+t,z):P},z.circularLinkGap=function(t){return arguments.length?(I=+t,z):I},z.nodePaddingRatio=function(t){return arguments.length?(n=+t,z):n},z.sortNodes=function(t){return arguments.length?(O=t,z):O},z.update=function(t){return w(t,A),V(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1a&&(b=a);var o=e.min(i,(function(t){return(y-n-(t.length-1)*b)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}(),d();for(var a=1,o=M;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,h)/e.sum(r.targetLinks,u)-f(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-f(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+b;if((r=a-b-y)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}function P(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return A.update=function(t){return P(t),t},A.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:o(t),A):_},A.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),A):w},A.nodeWidth=function(t){return arguments.length?(x=+t,A):x},A.nodePadding=function(t){return arguments.length?(b=+t,A):b},A.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),A):T},A.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),A):k},A.size=function(e){return arguments.length?(t=n=0,i=+e[0],y=+e[1],A):[i-t,y-n]},A.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],y=+e[1][1],A):[[t,n],[i,y]]},A.iterations=function(t){return arguments.length?(M=+t,A):M},A},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(y).target(x)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":159,"d3-collection":160,"d3-shape":171}],58:[function(t,e,r){(function(){var t={version:"3.8.0"},r=[].slice,n=function(t){return r.call(t)},i=self.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=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}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function h(t,e){return te?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>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>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(h);function v(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.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},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t){for(var e=1;t*e%1;)e*=10;return e}function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.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=x(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,f,h=-1,p=a.length,d=i[s++],m=new _;++h=i.length)return e;var n=[],o=a[r++];return e.forEach((function(e,i){n.push({key:e,values:t(i,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;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}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,Y),t}var H=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},G=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(G=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return H(t,this)}}function X(t){return"function"==typeof t?t:function(){return q(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Y.sort=function(t){t=ct.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=mt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=Y.append,ht.empty=Y.empty,ht.node=Y.node,ht.call=Y.call,ht.size=Y.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s1?Et:t<-1?-Et:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}var Ot=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,f=l-a,h=u*u+f*f;if(h<1e-12)n=Math.log(c/o)/Ot,r=function(t){return[i+t*u,a+t*f,o*Math.exp(Ot*t*n)]};else{var p=Math.sqrt(h),d=(c*c-o*o+4*h)/(2*o*2*p),m=(c*c-o*o-4*h)/(2*c*2*p),g=Math.log(Math.sqrt(d*d+1)-d),v=Math.log(Math.sqrt(m*m+1)-m);n=(v-g)/Ot,r=function(t){var e,r=t*n,s=It(g),l=o/(2*p)*(s*(e=Ot*r+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+l*u,a+l*f,o*s/It(Ot*r+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,f,h={x:0,y:0,k:1},p=[960,500],d=Rt,m=250,g=0,v="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(v,P).on(Dt+".zoom",O).on("dblclick.zoom",z).on(b,I)}function T(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(d[0],Math.min(d[1],t))}function M(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function A(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,a)),M(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),f&&f.domain(u.range().map((function(t){return(t-h.y)/h.k})).map(u.invert))}function E(t){g++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--g||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,l).on(x,c),a=T(t.mouse(e)),s=bt(e);function l(){n=1,M(t.mouse(e),a),L(r)}function c(){i.on(y,null).on(x,null),s(n),C(r)}Di.call(e),E(r)}function I(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],f=t.select(r),p=bt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){v=p[0];var x=p[1],b=v[0]-x[0],_=v[1]-x[1];a=b*b+_*_}}function g(){var o,l,c,u,f=t.touches(r);Di.call(r);for(var h=0,p=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new Qt(a(t+120),a(t),a(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):Xt(e instanceof qt?e.l:(e=ae((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Nt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,this.l/t)},Nt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Bt(this.h,this.s,t*this.l)},Nt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Ft;function Ht(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new qt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function qt(t,e,r){return this instanceof qt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof qt?new qt(t.l,t.a,t.b):t instanceof Ut?Ht(t.h,t.c,t.l):ae((t=Qt(t)).r,t.g,t.b):new qt(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+Gt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-Gt*(arguments.length?t:1)))},Vt.rgb=function(){return Ht(this.h,this.c,this.l).rgb()},t.lab=qt;var Gt=18,Yt=qt.prototype=new Ft;function Wt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new Qt(Kt(3.2404542*(i=.95047*Zt(i))-1.5371385*(n=1*Zt(n))-.4985314*(a=1.08883*Zt(a))),Kt(-.969266*i+1.8760108*n+.041556*a),Kt(.0556434*i-.2040259*n+1.0572252*a))}function Xt(t,e,r){return t>0?new Ut(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Zt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Kt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ne(""+t,Qt,jt):new Qt(t,e,r)}function $t(t){return new Qt(t>>16,t>>8&255,255&t)}function te(t){return $t(t)+""}Yt.brighter=function(t){return new qt(Math.min(100,this.l+Gt*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new qt(Math.max(0,this.l-Gt*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Wt(this.l,this.a,this.b)},t.rgb=Qt;var ee=Qt.prototype=new Ft;function re(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ne(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(se(i[0]),se(i[1]),se(i[2]))}return(a=le.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 ie(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+(e0&&l<1?0:n),new Bt(n,i,l)}function ae(t,e,r){var n=Jt((.4124564*(t=oe(t))+.3575761*(e=oe(e))+.1804375*(r=oe(r)))/.95047),i=Jt((.2126729*t+.7151522*e+.072175*r)/1);return qt(116*i-16,500*(n-i),200*(i-Jt((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function se(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ee.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=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}le.forEach((function(t,e){le.set(t,$t(e))})),t.functor=ce,t.xhr=ue(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=fe(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(me),me=setTimeout(ye,e)),de=0):(de=1,ge(ye))}function xe(){for(var t=Date.now(),e=he;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function be(){for(var t,e=he,r=1/0;e;)e.c?(e.t1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ve.apply(this,arguments)},t.timer.flush=function(){xe(),be()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=_e,r=we;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ce(e),a=ce(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[c[n]][2]]);for(n=+f;nkt)s=s.L;else{if(!((i=a-Ve(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fe(t);if(Pe.insert(e,l),e||r){if(e===r)return We(e),r=Fe(e.site),Pe.insert(l,r),l.edge=r.edge=Je(e.site,l.site),Ye(e),void Ye(r);if(r){We(e),We(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,p=t.y-f,d=r.site,m=d.x-u,g=d.y-f,v=2*(h*g-p*m),y=h*h+p*p,x=m*m+g*g,b={x:(g*y-p*x)/v+u,y:(h*x-m*y)/v+f};Qe(r.edge,c,d,b),l.edge=Je(c,t,null,b),r.edge=Je(t,d,null,b),Ye(e),Ye(r)}else l.edge=Je(e.site,l.site)}}function Ue(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;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function Ve(t,e){var r=t.N;if(r)return Ue(r,e);var n=t.site;return n.y===e?n.x:1/0}function He(t){this.site=t,this.edges=[]}function qe(t,e){return e.angle-t.angle}function Ge(){er(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(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,c=n.y-s,u=a.x-o,f=2*(l*(g=a.y-s)-c*u);if(!(f>=-1e-12)){var h=l*l+c*c,p=u*u+g*g,d=(g*h-c*p)/f,m=(l*p-u*h)/f,g=m+s,v=De.pop()||new Ge;v.arc=t,v.site=i,v.x=d+o,v.y=g+Math.sqrt(d*d+m*m),v.cy=g,t.circle=v;for(var y=null,x=Oe._;x;)if(v.y=s)return;if(h>d){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(h>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>u&&(u=e)}if(e=i-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>u&&(u=e)}else if(h>0){if(e0)){if(e/=p,p<0){if(e0){if(e>f)return;e>u&&(u=e)}if(e=a-c,p||!(e<0)){if(e/=p,p<0){if(e>f)return;e>u&&(u=e)}else if(p>0){if(e0&&(t.a={x:l+u*h,y:c+u*p}),f<1&&(t.b={x:l+f*h,y:c+f*p}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||y(e.a.x-e.b.x)kt||y(i-r)>kt)&&(s.splice(o,0,new $e(Ke(a.site,u,y(n-f)kt?{x:f,y:y(e-f)kt?{x:y(r-d)kt?{x:h,y:y(e-h)kt?{x:y(r-p)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return ar(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ar(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(qe),u=-1,f=c.length,h=c[f-1].edge,p=h.l===l?h.r:h.l;++ua||f>o||h=_)<<1|e>=b,T=w+4;wa&&(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:dr(r,n)})),a=vr.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(f=0;fm&&(m=b),_>g&&(g=_),c.push(b),u.push(_)}var w=m-p,T=g-d;function k(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(y(l-r)+y(c-n)<.01)M(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,l,c,i,a,o,s),M(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,i,a,o,s)}function M(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,f=n>=c,h=f<<1|u;t.leaf=!1,u?i=l:o=l,f?a=c:s=c,k(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?g=d+w:m=p+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(A,t,+v(t,++f),+x(t,f),p,d,m,g)},visit:function(t){ur(t,A,p,d,m,g)},find:function(t){return fr(A,t[0],t[1],p,d,m,g)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[i](e,r)););return n}function xr(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function kr(t){return function(e){return 1-t(1-e)}}function Mr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Ar(t){return t*t}function Sr(t){return t*t*t}function Er(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 Lr(t){return 1-Math.cos(t*Et)}function Cr(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Ir(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 Or(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function zr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Rr(i),s=Dr(i,a),l=Rr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=_r.get(n)||br,Tr((i=wr.get(i)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Ht(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return jt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Wt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=Or,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new zr(e?e.matrix:Fr)})(e)},zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function Nr(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(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:dr(t[0],e[0])},{i:i-2,x:dr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:dr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:dr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:dr(t[0],e[0])},{i:i-2,x:dr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Br(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ve(s.tick)),s):n},s.start=function(){var t,e,r,n=v.length,l=y.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function $r(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=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return $r(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),$r(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return 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,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function dn(t){return t.reduce(mn,0)}function mn(t,e){return t+e[1]}function gn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(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 yn(e){return[t.min(e),t.max(e)]}function xn(t,e){return t.value-e.value}function bn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function _n(t,e){t._pack_next=e,e._pack_prev=t}function wn(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 Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,f=1/0,h=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(An(r,n,i=e[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=c[t.bisect(h,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ce(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return vn(e,t)}:ce(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(xn),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,$r(s,(function(t){t.r=+u(t.value)})),$r(s,Tn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;$r(s,(function(t){t.r+=f})),$r(s,Tn),$r(s,(function(t){t.r-=f}))}return function t(e,r,n,i){var a=e.children;if(e.x=r+=i*e.x,e.y=n+=i*e.y,e.r*=i,a)for(var o=-1,s=a.length;++op.x&&(p=t),t.depth>d.depth&&(d=t)}));var m=r(h,p)/2-h.x,g=n[0]/(p.x+r(p,h)/2+m),v=n[1]/(d.depth||1);Qr(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*v}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=Ln(s),a=En(a),s&&a;)l=En(l),(o=Ln(o)).a=t,(i=s.z+f-a.z-c+r(s._,a._))>0&&(Cn(Pn(s,t,n),t,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=f-u),a&&!En(l)&&(l.t=a,l.m+=c-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Kr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;$r(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2;return $r(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Kr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=In,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=h?(c.pop(),h=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?jn:Rn,s=i?Ur:jr;return a=t(e,r,s,n),o=t(r,e,s,yr),l}function l(t){return a(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(Or)},l.clamp=function(t){return arguments.length?(i=t,s()):i},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return qn(e,t)},l.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},l.nice=function(t){return Vn(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],yr,!1)};t.scale.log=function(){return function t(e,r,n,i){function a(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function o(t){return n?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return e(a(t))}return s.invert=function(t){return o(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((i=t.map(Number)).map(a)),s):i},s.base=function(t){return arguments.length?(r=+t,e.domain(i.map(a)),s):r},s.nice=function(){var t=Fn(i.map(a),n?Math:Gn);return e.domain(t),i=t.map(o),s},s.ticks=function(){var t=zn(i),e=[],s=t[0],l=t[1],c=Math.floor(a(s)),u=Math.ceil(a(l)),f=r%1?2:r;if(isFinite(u-c)){if(n){for(;c0;h--)e.push(o(c)*h);for(c=0;e[c]l;u--);e=e.slice(c,u)}return e},s.copy=function(){return t(e.copy(),r,n,i)},Un(s,e)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Gn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Yn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=Yn(r),a=Yn(1/r);function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n},o.ticks=function(t){return qn(n,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(n,t,e)},o.nice=function(t){return o.domain(Vn(n,t))},o.exponent=function(t){return arguments.length?(i=Yn(r=t),a=Yn(1/r),e.domain(n.map(i)),o):r},o.copy=function(){return t(e.copy(),r,n)},Un(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||("range"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],i=new _;for(var e,a=-1,o=t.length;++a0?i[t-1]:r[0],tf?0:1;if(c=St)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,m,g,v,y,x,b,_,w,T,k,M,A=0,S=0,E=[];if((v=(+o.apply(this,arguments)||0)/2)&&(g=n===Qn?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Pt(g/c*Math.sin(v))),s&&(A=Pt(g/s*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=Mt?0:1;if(S&&ii(y,x,b,_)===p^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-A),T=s*Math.sin(f-A),k=s*Math.cos(u+A),M=s*Math.sin(u+A);var P=Math.abs(u-f+2*A)<=Mt?0:1;if(A&&ii(w,T,k,M)===1-p^P){var I=(u+f)/2;w=s*Math.cos(I),T=s*Math.sin(I),k=M=null}}else w=T=0;if(h>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function ai(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,p=e[1]+c,d=(u+h)/2,m=(f+p)/2,g=h-u,v=p-f,y=g*g+v*v,x=r-n,b=u*p-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,T=(-b*g-v*_)/y,k=(b*v+g*_)/y,M=(-b*g+v*_)/y,A=w-d,S=T-m,E=k-d,L=M-m;return A*A+S*S>E*E+L*L&&(w=k,T=M),[[w-l,T-c],[w*r/x,T*r/x]]}function oi(){return!0}function si(t){var e=_e,r=we,n=oi,i=ci,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,f=a.length,h=ce(e),p=ce(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]);return i.join("")},"step-before":fi,"step-after":hi,basis:mi,"basis-open":function(t){if(t.length<4)return ci(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(gi(xi,a)+","+gi(xi,o)),--n;for(;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++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}(t))}});function ci(t){return t.length>1?t.join("L"):t+"Z"}function ui(t){return t.join("L")+"Z"}function fi(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){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 c=2;cMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ce(t),a):r},a.source=function(e){return arguments.length?(t=ce(e),a):t},a.target=function(t){return arguments.length?(e=ce(t),a):e},a.startAngle=function(t){return arguments.length?(n=ce(t),a):n},a.endAngle=function(t){return arguments.length?(i=ce(t),a):i},a},t.svg.diagonal=function(){var t=ki,e=Mi,r=Si;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ce(e),n):t},n.target=function(t){return arguments.length?(e=ce(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Si,n=e.projection;return e.projection=function(t){return arguments.length?n(Ei(r=t)):r},e},t.svg.symbol=function(){var t=Ci,e=Li;function r(r,n){return(Ii.get(t.call(this,r,n))||Pi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ce(e),r):t},r.size=function(t){return arguments.length?(e=ce(t),r):e},r};var Ii=t.map({circle:Pi,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*zi)),r=e*zi;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/Oi),r=e*Oi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Oi),r=e*Oi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=Ii.keys();var Oi=Math.sqrt(3),zi=Math.tan(30*Lt);Y.transition=function(t){for(var e,r,n=Bi||++Ui,i=qi(t),a=[],o=Ni||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}f||(a=i.time,o=ve((function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h}),0,a),f=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}ji.call=Y.call,ji.empty=Y.empty,ji.node=Y.node,ji.size=Y.size,t.transition=function(e,r){return e&&e.transition?Bi?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ji,ji.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var f,g,v=this,y=t.select(t.event.target),x=n.of(v,arguments),b=t.select(v),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,T=!/^(e|w)$/.test(_)&&a,k=y.classed("extent"),M=bt(v),A=t.mouse(v),S=t.select(o(v)).on("keydown.brush",C).on("keyup.brush",P);if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",z):S.on("mousemove.brush",I).on("mouseup.brush",z),b.interrupt().selectAll("*").interrupt(),k)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var E=+/w$/.test(_),L=+/^n/.test(_);g=[s[1-E]-A[0],l[1-L]-A[1]],A[0]=s[E],A[1]=l[L]}else t.event.altKey&&(f=A.slice());function C(){32==t.event.keyCode&&(k||(f=null,A[0]-=s[1],A[1]-=l[1],k=2),F())}function P(){32==t.event.keyCode&&2==k&&(A[0]+=s[1],A[1]+=l[1],k=0,F())}function I(){var e=t.mouse(v),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),k||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(f(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(var v=0;vr||s>1073741824){for(var h=0;he+n||w>r+n||T=M||a===o)){var s=y[i];void 0===o&&(o=s.length);for(var l=a;l=d&&u<=g&&f>=m&&f<=v&&S.push(c)}var h=x[i],p=h[4*a+0],b=h[4*a+1],A=h[4*a+2],E=h[4*a+3],P=C(h,a+1),I=.5*n,O=i+1;L(e,r,I,O,p,b||A||E||P),L(e,r+I,I,O,b,A||E||P),L(e+I,r,I,O,A,E||P),L(e+I,r+I,I,O,E,P)}}function C(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}return L(0,0,1,0,0,1),S},d;function E(t,e,r,i,a){for(var o=[],s=0;s0){e+=Math.abs(a(t[0]));for(var r=1;r2){for(s=0;s=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=f,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return p(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return f(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],63:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,f,h=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,v=m?t.features.length:1,y=0;yc||p>u||d>f)return l=i,c=r,u=p,f=d,void(o=0);var m=n.lineString([l,i],t.properties);if(!1===e(m,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=f,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return p(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=p,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return f(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],69:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,c,u,f,h=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,v=m?t.features.length:1,y=0;yc||p>u||d>f)return l=i,c=r,u=p,f=d,void(o=0);var m=n.lineString([l,i],t.properties);if(!1===e(m,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function u(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;si&&(i=t[o]),t[o] * @license MIT - */function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;c--)if(u[c]!==f[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(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=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&i&&!r;if((!t&&o.isError(i)&&a&&_(i,r)||s)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}h.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=function(t){return g(m(t.actual),128)+" "+t.operator+" "+g(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=v,h.ok=y,h.equal=function(t,e,r){t!=e&&v(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){x(t,e,!1)||v(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){x(t,e,!0)||v(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){x(t,e,!1)&&v(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){w(!0,t,e,r)},h.doesNotThrow=function(t,e,r){w(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||v(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var T=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":487,"util/":83}],81:[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}},{}],82:[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}},{}],83:[function(t,e,r){(function(e,n){(function(){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;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}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(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 v(i)||(i=u(t,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(T(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var c,b="",k=!1,A=["{","}"];(p(e)&&(k=!0,A=["[","]"]),T(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+f(e)),0!==o.length||k&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,A)):A[0]+b+A[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?u(t,l.value,null):u(t,l.value,r-1)).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")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).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 p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===k(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===k(t)}function w(t){return b(t)&&("[object Error]"===k(t)||t instanceof Error)}function T(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=m,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=x,r.isObject=b,r.isDate=_,r.isError=w,r.isFunction=T,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",S(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":82,_process:528,inherits:81}],84:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],85:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],87:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":97}],88:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],89:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":97}],90:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,f=0;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;u=a(r)}else u=a(1);f>0?c=c.ushln(f):f<0&&(u=u.ushln(-f));return s(c,u)}},{"./div":89,"./is-rat":91,"./lib/is-bn":95,"./lib/num-to-bn":96,"./lib/rationalize":97,"./lib/str-to-bn":98}],91:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":95}],92:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":106}],93:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":104,"double-bits":182}],95:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":106}],96:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":106,"double-bits":182}],97:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":92,"./num-to-bn":96}],98:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":106}],99:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":97}],100:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":92}],101:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":97}],102:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":93,"./lib/ctz":94}],103:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function s(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function l(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,i,a){return l(t,e,r,i,a,n)},gt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},lt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},le:function(t,e,r,n,i){return l(t,e,r,n,i,o)},eq:function(t,e,r,n,i){return l(t,e,r,n,i,s)}}},{}],104:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],105:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,f,h,p,d,g,m=null==e.cutoff?.25:e.cutoff,v=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext("2d"),r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),d=0,g=c.length;d=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=u[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?g+r:c[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,g=p>>>13,m=0|o[2],v=8191&m,y=m>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,P=0|o[7],I=8191&P,O=P>>>13,z=0|o[8],D=8191&z,R=z>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,pt=0|s[9],dt=8191&pt,gt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(g,U)|0,a=Math.imul(g,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,J)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(g,rt)|0,a=a+Math.imul(g,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(O,U)|0,a=Math.imul(O,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(g,at)|0,a=a+Math.imul(g,ot)|0;var Tt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(O,H)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(g,lt)|0,a=a+Math.imul(g,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(g,ft)|0,a=a+Math.imul(g,ht)|0;var At=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,G))+Math.imul(N,H)|0,a=Math.imul(N,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,gt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((a=a+Math.imul(g,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,gt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,gt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Pt=(c+(n=n+Math.imul(L,dt)|0)|0)+((8191&(i=(i=i+Math.imul(L,gt)|0)+Math.imul(C,dt)|0))<<13)|0;c=((a=a+Math.imul(C,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(O,dt)|0))<<13)|0;c=((a=a+Math.imul(O,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht);var Ot=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,gt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var zt=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,gt))+Math.imul(N,dt)|0))<<13)|0;return c=((a=Math.imul(N,gt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=mt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=It,l[17]=Ot,l[18]=zt,0!==c&&(l[19]=c,r.length++),r};function d(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,g=1;0==(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new T(t)},i(T,w),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:115}],107:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,h,p))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*u*c),g=i.mallocInt32(c);(c=l(e,u,d,g))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,p,0,c,d,g):o(u,r,n,s,h,p,c,d,g),i.free(d),i.free(g))}i.free(h),i.free(p)}return f}}}function u(t,e){n.push([t,e])}function f(t){return n=[],c(t,t,u,!0),n}function h(t,e){return n=[],c(t,e,u,!1),n}},{"./lib/intersect":110,"./lib/sweep":114,"typedarray-pool":617}],109:[function(t,e,r){"use strict";var n=["d","ax","vv","rs","re","rb","ri","bs","be","bb","bi"];function i(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],i=n.slice();t||i.splice(3,0,"fp");var a=["function "+e+"("+i.join()+"){"];function o(e,i){var o=function(t,e,r){var i="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),a=["function ",i,"(",n.join(),"){","var ","es","=2*","d",";"],o="for(var i=rs,rp=es*rs;ibe-bs){"),t?(o(!0,!1),a.push("}else{"),o(!1,!1)):(a.push("if(fp){"),o(!0,!0),a.push("}else{"),o(!0,!1),a.push("}}else{if(fp){"),o(!1,!0),a.push("}else{"),o(!1,!1),a.push("}")),a.push("}}return "+e);var s=r.join("")+a.join("");return new Function(s)()}r.partial=i(!1),r.full=i(!0)},{}],110:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,u,w,T,k,A){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(6*r);v.length0;){var L=6*(S-=1),C=v[L],P=v[L+1],I=v[L+2],O=v[L+3],z=v[L+4],D=v[L+5],R=2*S,F=y[R],B=y[R+1],N=1&D,j=!!(16&D),U=u,V=w,q=k,H=A;if(N&&(U=k,V=A,q=u,H=w),!(2&D&&(I=p(t,C,P,I,U,V,B),P>=I)||4&D&&(P=d(t,C,P,I,U,V,F))>=I)){var G=I-P,Y=z-O;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(M=l.scanComplete(t,C,e,P,I,U,V,O,z,q,H)))return M;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(M=o(t,C,e,N,P,I,U,V,O,z,q,H)))return M;continue}if(t*G*Y<1<<22){if(void 0!==(M=l.scanBipartite(t,C,e,N,P,I,U,V,O,z,q,H)))return M;continue}}var W=f(t,C,P,I,U,V,F,B);if(P=p0)&&!(p1>=hi)",["p0","p1"]),h=u("lo===p0",["p0"]),p=u("lo>>1,f=2*t,h=u,p=o[f*u+e];for(;l=y?(h=v,p=y):m>=b?(h=g,p=m):(h=x,p=b):y>=b?(h=v,p=y):b>=m?(h=g,p=m):(h=x,p=b);for(var _=f*(c-1),w=f*h,T=0;Tr&&i[f+e]>c;--u,f-=o){for(var h=f,p=f+o,d=0;d=0&&n.push("lo=e[k+n]");t.indexOf("hi")>=0&&n.push("hi=e[k+o]");return r.push("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".replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}},{}],113:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var f=(r-e+1)/6|0,h=e+f,p=r-f,d=e+r>>1,g=d-f,m=d+f,v=h,y=g,x=d,b=m,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var A=u[2*y],M=u[2*y+1],S=u[2*b],E=u[2*b+1],L=2*v,C=2*x,P=2*_,I=2*h,O=2*d,z=2*p,D=0;D<2;++D){var R=u[L+D],F=u[C+D],B=u[P+D];u[I+D]=R,u[O+D]=F,u[z+D]=B}a(g,e,u),a(m,r,u);for(var N=w;N<=T;++N)if(c(N,A,M,u))N!==w&&i(N,w,u),++w;else if(!c(N,S,E,u))for(;;){if(c(T,S,E,u)){c(T,A,M,u)?(o(N,w,T,u),++w,--T):(i(N,T,u),--T);break}if(--Tt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(h,M);var S=0,E=0;for(w=0;w=1<<28)p(l,c,E--,L=L-(1<<28)|0);else if(L>=0)p(o,s,S--,L);else if(L<=-(1<<28)){L=-L-(1<<28)|0;for(var C=0;C>>1;a(h,E);var L=0,C=0,P=0;for(k=0;k>1==h[2*k+3]>>1&&(O=2,k+=1),I<0){for(var z=-(I>>1)-1,D=0;D>1)-1;0===O?p(o,s,L--,z):1===O?p(l,c,C--,z):2===O&&p(u,f,P--,z)}}},scanBipartite:function(t,e,r,n,i,l,c,u,f,g,m,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=i;k>>1;a(h,E);var L=0;for(k=0;k=1<<28?(P=!n,A-=1<<28):(P=!!n,A-=1),P)d(o,s,L++,A);else{var I=v[A],O=x*A,z=m[O+e+1],D=m[O+e+1+t];t:for(var R=0;R>>1;a(h,w);var T=0;for(y=0;y=1<<28)o[T++]=x-(1<<28);else{var A=p[x-=1],M=g*x,S=f[M+e+1],E=f[M+e+1+t];t:for(var L=0;L=0;--L)if(o[L]===x){for(O=L+1;O0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)a(l,this,e);else{var c=l.length,u=m(l,c);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],117:[function(t,e,r){(function(e){(function(){ + */function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;c--)if(u[c]!==f[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(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=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&i&&!r;if((!t&&o.isError(i)&&a&&_(i,r)||s)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}h.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=function(t){return m(g(t.actual),128)+" "+t.operator+" "+m(g(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=v,h.ok=y,h.equal=function(t,e,r){t!=e&&v(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){x(t,e,!1)||v(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){x(t,e,!0)||v(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){x(t,e,!1)&&v(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){w(!0,t,e,r)},h.doesNotThrow=function(t,e,r){w(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||v(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var T=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":476,"util/":83}],81:[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}},{}],82:[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}},{}],83:[function(t,e,r){(function(e,n){(function(){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;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}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(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 v(i)||(i=u(t,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(T(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var c,b="",k=!1,M=["{","}"];(p(e)&&(k=!0,M=["[","]"]),T(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+f(e)),0!==o.length||k&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,M)):M[0]+b+M[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?u(t,l.value,null):u(t,l.value,r-1)).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")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).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 p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===k(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===k(t)}function w(t){return b(t)&&("[object Error]"===k(t)||t instanceof Error)}function T(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(t){return null==t},r.isNumber=g,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=x,r.isObject=b,r.isDate=_,r.isError=w,r.isFunction=T,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",S(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":82,_process:514,inherits:81}],84:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],85:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],87:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":97}],88:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],89:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":97}],90:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,f=0;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;u=a(r)}else u=a(1);f>0?c=c.ushln(f):f<0&&(u=u.ushln(-f));return s(c,u)}},{"./div":89,"./is-rat":91,"./lib/is-bn":95,"./lib/num-to-bn":96,"./lib/rationalize":97,"./lib/str-to-bn":98}],91:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":95}],92:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":106}],93:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":104,"double-bits":179}],95:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":106}],96:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":106,"double-bits":179}],97:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":92,"./num-to-bn":96}],98:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":106}],99:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":97}],100:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":92}],101:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":97}],102:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":93,"./lib/ctz":94}],103:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function s(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function l(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,i,a){return l(t,e,r,i,a,n)},gt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},lt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},le:function(t,e,r,n,i){return l(t,e,r,n,i,o)},eq:function(t,e,r,n,i){return l(t,e,r,n,i,s)}}},{}],104:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>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 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],105:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,f,h,p,d,m,g=null==e.cutoff?.25:e.cutoff,v=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(h=t).getContext("2d"),r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,f=t,r=h.width,o=h.height,p=f.getImageData(0,0,r,o),l=p.data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),d=0,m=c.length;d=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[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],f=[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];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=u[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,M=0|o[5],A=8191&M,S=M>>>13,E=0|o[6],L=8191&E,C=E>>>13,P=0|o[7],I=8191&P,O=P>>>13,z=0|o[8],D=8191&z,R=z>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(d,q)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,J)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(O,U)|0,a=Math.imul(O,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(O,q)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(D,q)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var At=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(A,dt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Pt=(c+(n=n+Math.imul(L,dt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,dt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(O,dt)|0))<<13)|0;c=((a=a+Math.imul(O,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht);var Ot=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var zt=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(N,dt)|0))<<13)|0;return c=((a=Math.imul(N,mt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=Mt,l[10]=At,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=It,l[17]=Ot,l[18]=zt,0!==c&&(l[19]=c,r.length++),r};function d(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.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)},w.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},w.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)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new T(t)},i(T,w),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:115}],107:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,h,p))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,p,0,c,d,m):o(u,r,n,s,h,p,c,d,m),i.free(d),i.free(m))}i.free(h),i.free(p)}return f}}}function u(t,e){n.push([t,e])}function f(t){return n=[],c(t,t,u,!0),n}function h(t,e){return n=[],c(t,e,u,!1),n}},{"./lib/intersect":110,"./lib/sweep":114,"typedarray-pool":601}],109:[function(t,e,r){"use strict";function n(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var f=2*t,h=n,p=f*n;hc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var f=2*t,h=n,p=f*n;h0;){var L=6*(S-=1),C=v[L],P=v[L+1],I=v[L+2],O=v[L+3],z=v[L+4],D=v[L+5],R=2*S,F=y[R],B=y[R+1],N=1&D,j=!!(16&D),U=u,V=w,H=k,q=M;if(N&&(U=k,V=M,H=u,q=w),!(2&D&&(I=p(t,C,P,I,U,V,B),P>=I)||4&D&&(P=d(t,C,P,I,U,V,F))>=I)){var G=I-P,Y=z-O;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(A=l.scanComplete(t,C,e,P,I,U,V,O,z,H,q)))return A;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(A=o(t,C,e,N,P,I,U,V,O,z,H,q)))return A;continue}if(t*G*Y<1<<22){if(void 0!==(A=l.scanBipartite(t,C,e,N,P,I,U,V,O,z,H,q)))return A;continue}}var W=f(t,C,P,I,U,V,F,B);if(P=p0)&&!(p1>=hi)"),h=u("lo===p0"),p=u("lo>>1,f=2*t,h=u,p=o[f*u+e];for(;l=y?(h=v,p=y):g>=b?(h=m,p=g):(h=x,p=b):y>=b?(h=v,p=y):b>=g?(h=m,p=g):(h=x,p=b);for(var _=f*(c-1),w=f*h,T=0;Tr&&i[f+e]>c;--u,f-=o){for(var h=f,p=f+o,d=0;dh;++h,l+=s){if(i[l+f]===o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"loh;++h,l+=s){if(i[l+f]p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=t+e,h=r;n>h;++h,l+=s){if(i[l+f]<=o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=t+e,h=r;n>h;++h,l+=s){if(i[l+f]<=o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"lop;++p,l+=s){var d=i[l+f],m=i[l+h];if(dg;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=e,h=t+e,p=r;n>p;++p,l+=s){var d=i[l+f],m=i[l+h];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,f=r,h=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+h],g=i[c+p];if(!(m>=o||s>=g))if(f===d)f+=1,u+=l;else{for(var v=0;l>v;++v){var y=i[c+v];i[c+v]=i[u],i[u++]=y}var x=a[d];a[d]=a[f],a[f++]=x}}return f}}},{}],113:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var f=(r-e+1)/6|0,h=e+f,p=r-f,d=e+r>>1,m=d-f,g=d+f,v=h,y=m,x=d,b=g,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var M=u[2*y],A=u[2*y+1],S=u[2*b],E=u[2*b+1],L=2*v,C=2*x,P=2*_,I=2*h,O=2*d,z=2*p,D=0;D<2;++D){var R=u[L+D],F=u[C+D],B=u[P+D];u[I+D]=R,u[O+D]=F,u[z+D]=B}a(m,e,u),a(g,r,u);for(var N=w;N<=T;++N)if(c(N,M,A,u))N!==w&&i(N,w,u),++w;else if(!c(N,S,E,u))for(;;){if(c(T,S,E,u)){c(T,M,A,u)?(o(N,w,T,u),++w,--T):(i(N,T,u),--T);break}if(--Tt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(h,A);var S=0,E=0;for(w=0;w=1<<28)p(l,c,E--,L=L-(1<<28)|0);else if(L>=0)p(o,s,S--,L);else if(L<=-(1<<28)){L=-L-(1<<28)|0;for(var C=0;C>>1;a(h,E);var L=0,C=0,P=0;for(k=0;k>1==h[2*k+3]>>1&&(O=2,k+=1),I<0){for(var z=-(I>>1)-1,D=0;D>1)-1;0===O?p(o,s,L--,z):1===O?p(l,c,C--,z):2===O&&p(u,f,P--,z)}}},scanBipartite:function(t,e,r,n,i,l,c,u,f,m,g,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=i;k>>1;a(h,E);var L=0;for(k=0;k=1<<28?(P=!n,M-=1<<28):(P=!!n,M-=1),P)d(o,s,L++,M);else{var I=v[M],O=x*M,z=g[O+e+1],D=g[O+e+1+t];t:for(var R=0;R>>1;a(h,w);var T=0;for(y=0;y=1<<28)o[T++]=x-(1<<28);else{var M=p[x-=1],A=m*x,S=f[A+e+1],E=f[A+e+1+t];t:for(var L=0;L=0;--L)if(o[L]===x){for(O=L+1;O0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)a(l,this,e);else{var c=l.length,u=g(l,c);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],117:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');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 TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=i(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(i)return n?-1:D(t).length;e=(""+e).toLowerCase(),i=!0}}function h(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(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),N(r=+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:g(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):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},a.prototype.compare=function(t,e,r,n,i){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);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(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),f=0;f>>=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 m(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(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)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(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 P(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||E(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||E(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(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||E(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||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||E(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||E(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||E(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||E(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||E(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(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||L(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||L(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||L(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||L(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);L(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>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);L(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||L(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||L(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||L(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||L(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||L(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 P(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},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),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);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":86,buffer:117,ieee754:445}],118:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),f=!!c(r,"interior",!0),h=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var d=n(t,e);if(u||f!==h||p){for(var g=i(t.length,function(t){return t.map(s).sort(l)}(e)),m=0;m0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,f=-1,l=o[s],1);d=0||(e.flip(s,p),i(t,e,r,u,s,f),i(t,e,r,s,f,u),i(t,e,r,f,p,u),i(t,e,r,p,u,f)))}}},{"binary-search-bounds":103,"robust-in-sphere":546}],120:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(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 o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var g=h[3*p+d];g>=0&&0===c[g]&&(f[3*p+d]?l.push(g):(s.push(g),c[g]=i))}}}var m=l;l=s,s=m,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);var d=f.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var g=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),m=[new a([g,1],[g,0],-1,[],[],[],[])],v=[],y=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;nr?r:t:te?e:t}},{}],127:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,A]):e.push([M,E]),M=E}i?e.push([M,_,A]):e.push([M,_])}return h}(t,e,h,m,r));return v(e,y,r),!!y||(h.length>0||m.length>0)}},{"./lib/rat-seg-intersect":128,"big-rat":90,"big-rat/cmp":88,"big-rat/to-float":102,"box-intersect":108,nextafter:484,"rat-vec":532,"robust-segment-intersect":551,"union-find":618}],128:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var p=s(t,r),d=u(f,p),g=i(d,h),m=c(a,g);return l(t,m)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":89,"big-rat/mul":99,"big-rat/sign":100,"big-rat/sub":101,"rat-vec/add":531,"rat-vec/muls":533,"rat-vec/sub":534}],129:[function(t,e,r){"use strict";var n=t("clamp");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:126}],130:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],131:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(a(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},{clamp:126,"color-rgba":133,dtype:184}],132:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=(p=t.slice(1)).length;c=1,u<=4?(l=[parseInt(p[0]+p[0],16),parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16)],4===u&&(c=parseInt(p[3]+p[3],16)/255)):(l=[parseInt(p[0]+p[1],16),parseInt(p[2]+p[3],16),parseInt(p[4]+p[5],16)],8===u&&(c=parseInt(p[6]+p[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f,p=f.replace(/a$/,"");s=p;u="cmyk"===p?4:"gray"===p?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===p?255*parseFloat(t)/100:parseFloat(t);if("h"===p[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===p&&l.push(1),c=h||void 0===l[u]?1:l[u],l=l.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":130,defined:179,"is-plain-obj":457}],133:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:126,"color-parse":132,"color-space/hsl":134}],134:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":135}],135:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],136:[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]}],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:1,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]}]}},{}],137:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,f,h,p,d,g;t||(t={});p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");u=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>p+1)throw new Error(f+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var m=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(g=0;g0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":548,"robust-product":549,"robust-sum":553,signum:555,"two-sum":605}],139:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(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=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],p=t[3],d=e[0],g=e[1],m=e[2],v=e[3];return u+f+h+p-(d+g+m+v)||n(u,f,h,p)-n(d,g,m,v,d)||n(u+f,u+h,u+p,f+h,f+p,h+p)-n(d+g,d+m,d+v,g+m,g+v,m+v)||n(u+f+h,u+f+p,u+h+p,f+h+p)-n(d+g+m,d+g+v,d+m+v,g+m+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],143:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":73,"incremental-convex-hull":446}],145:[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"}},{}],146:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],147:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],148:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],149:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],150:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":152,"./stringify":153}],151:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":146}],152:[function(t,e,r){"use strict";var n=t("unquote"),i=t("css-global-keywords"),a=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),c=t("string-split-by"),u=t("./lib/util").isSize;e.exports=h;var f=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=c(t,/\s+/);e=h.shift();){if(-1!==i.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(u(e)){var d=c(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===h[0]&&(h.shift(),r.lineHeight=p(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=c(h.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"string-split-by":589,unquote:620}],153:[function(t,e,r){"use strict";var n=t("pick-by-alias"),i=t("./lib/util").isSize,a=g(t("css-global-keywords")),o=g(t("css-system-font-keywords")),s=g(t("css-font-weight-keywords")),l=g(t("css-font-style-keywords")),c=g(t("css-font-stretch-keywords")),u={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",p="serif";function d(t,e){if(t&&!e[t]&&!a[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r=0;--p)a[p]=c*t[p]+u*e[p]+f*r[p]+h*n[p];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],157:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function i(){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}e.exports=function(t){var e=new i;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var a=0;a0)throw new Error("cwise: pre() block may not reference array args");if(a0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(a),e.shimArgs.push("scalar"+a);else if("index"===o){if(e.indexArgs.push(a),a0)throw new Error("cwise: pre() block may not reference array index");if(a0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(a),ar.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,n(e)}},{"./lib/thunk.js":159}],158:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),c=0;c0&&x.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(c=0;c0&&y.push("var "+x.join(",")),c=0;c3&&y.push(a(t.pre,t,l));var k=a(t.body,t,l),A=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&y.push(a(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var M=[t.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",A,o(l)].join("");return new Function(["function ",M,"(",v.join(","),"){",y.join("\n"),"} return ",M].join(""))()}},{uniq:619}],159:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",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=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;ue?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=v?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=v?10:a>=y?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=v?i*=10:a>=y?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function k(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function A(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,M),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=g,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;af;)h.pop(),--p;var d,g=new Array(p+1);for(a=0;a<=p;++a)(d=g[a]=[]).x0=a>0?h[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,f,h=-1,p=n.length,d=l[i++],g=r(),m=a();++hl.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each((function(e,r){i.push({key:r,values:t(e,n)})}))),null!=a?i.sort((function(t,e){return a(t.key,e.key)})):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],164:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),u=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),f=new RegExp("^rgba\\("+[o,o,o,a]+"\\)$"),h=new RegExp("^hsl\\("+[a,o,o]+"\\)$"),p=new RegExp("^hsla\\("+[a,o,o,a]+"\\)$"),d={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};function g(){return this.rgb().formatHex()}function m(){return this.rgb().formatRgb()}function v(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?y(e):3===r?new w(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new w(e[1],e[2],e[3],1):(e=c.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=u.exec(t))?x(e[1],e[2],e[3],e[4]):(e=f.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=h.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):d.hasOwnProperty(t)?y(d[t]):"transparent"===t?new w(NaN,NaN,NaN,0):null}function y(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function _(t,e,r,n){return 1===arguments.length?b(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function T(){return"#"+A(this.r)+A(this.g)+A(this.b)}function k(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function A(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function M(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new L(t,e,r,n)}function S(t){if(t instanceof L)return new L(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new L;if(t instanceof L)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&c<1?0:s,new L(s,l,c,t.opacity)}function E(t,e,r,n){return 1===arguments.length?S(t):new L(t,e,r,null==n?1:n)}function L(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function C(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:g,formatHex:g,formatHsl:function(){return S(this).formatHsl()},formatRgb:m,toString:m}),e(w,_,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:T,formatHex:T,formatRgb:k,toString:k})),e(L,E,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new L(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new L(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new w(C(t>=240?t-240:t+120,i,n),C(t,i,n),C(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var P=Math.PI/180,I=180/Math.PI,O=6/29,z=3*O*O;function D(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof H)return G(t);t instanceof w||(t=b(t));var e,r,n=U(t.r),i=U(t.g),a=U(t.b),o=B((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=o:(e=B((.4360747*n+.3850649*i+.1430804*a)/.96422),r=B((.0139322*n+.0971045*i+.7141733*a)/.82521)),new F(116*o-16,500*(e-o),200*(o-r),t.opacity)}function R(t,e,r,n){return 1===arguments.length?D(t):new F(t,e,r,null==n?1:n)}function F(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function B(t){return t>.008856451679035631?Math.pow(t,1/3):t/z+4/29}function N(t){return t>O?t*t*t:z*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t){if(t instanceof H)return new H(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=D(t)),0===t.a&&0===t.b)return new H(NaN,0=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function a(t,e){for(var r,n=0,i=t.length;n0)for(var r,n,i=new Array(r),a=0;ah+c||np+c||au.index){var f=h-s.x-s.vx,m=p-s.y-s.vy,v=f*f+m*m;vt.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===f&&(d+=(f=o())*f),0===h&&(d+=(h=o())*h),d1?(null==r?u.remove(t):u.set(t,v(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(h.on(t,r),e):h.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e,i,o=void 0===t.grouping||void 0===t.thousands?c:(e=f.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var n=t.length,a=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",p=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),g=void 0===t.percent?"%":t.percent+"",m=void 0===t.minus?"-":t.minus+"",v=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=a(t)).fill,r=t.align,i=t.sign,c=t.symbol,f=t.zero,y=t.width,x=t.comma,b=t.precision,_=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===b&&(b=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?g:"",A=l[w],M=/[defgprs%]/.test(w);function S(t){var a,s,l,c=T,u=k;if("c"===w)u=A(t)+u,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?v:A(Math.abs(t),b),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==i&&(g=!1),c=(g?"("===i?i:m:"-"===i||"("===i?"":i)+c,u=("s"===w?h[8+n/3]:"")+u+(g&&"("===i?")":""),M)for(a=-1,s=t.length;++a(l=t.charCodeAt(a))||l>57){u=(46===l?p+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}x&&!f&&(t=o(t,1/0));var S=c.length+t.length+u.length,E=S>1)+c+t+u+E.slice(S);break;default:t=E+c+t+u}return d(t)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),S.toString=function(){return t+""},S}return{format:y,formatPrefix:function(t,e){var n=y(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=h[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],168:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-geo"),t("d3-array")):i(n.d3=n.d3||{},n.d3,n.d3)}(this,(function(t,e,r){"use strict";var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,f=Math.min,h=Math.pow,p=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},g=Math.sin,m=Math.tan,v=1e-6,y=Math.PI,x=y/2,b=y/4,_=Math.SQRT1_2,w=L(2),T=L(y),k=2*y,A=180/y,M=y/180;function S(t){return t>1?x:t<-1?-x:Math.asin(t)}function E(t){return t>1?0:t<-1?y:Math.acos(t)}function L(t){return t>0?Math.sqrt(t):0}function C(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function I(t){var e=m(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=g(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*g(t),l*a]}return i.invert=function(e,i){var s,l=L(e*e+i*i),u=-t/2,f=50;if(!l)return[0,0];do{var h=u/2,p=o(h),d=g(h),m=d/p,y=-c(n(p));u-=s=(2/m*y-r*m-l)/(-y/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>v&&--f>0);var x=g(u);return[a(e*x,l*o(u)),S(i*x/l)]},i}function O(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(E(r*o(t/=2)));return[2*r*g(t)*n,g(e)*n]}function z(t){var e=g(t),r=o(t),i=t>=0?1:-1,s=m(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*g(t),(i*n>-a(u,s)-.001?0:10*-i)+l+g(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,f=0,h=50;do{var p=o(u),d=g(u),m=o(f),y=g(f),x=1+m,b=x*d-t,_=l+y*r-x*e*p-c,w=x*p/2,T=-d*y,k=e*x*d/2,A=r*m+e*p*y,M=T*k-A*w,S=(_*T-b*A)/M/2,E=(b*k-_*w)/M;n(E)>2&&(E/=2),u-=S,f-=E}while((n(S)>v||n(E)>v)&&--h>0);return i*f>-a(o(u),s)-.001?[2*u,f]:null},c}function D(t,e){var r=m(e/2),n=L(1-r*r),i=1+n*o(t/=2),a=g(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}O.invert=function(t,e){if(!(t*t+4*e*e>y*y+v)){var r=t,i=e,a=25;do{var s,l=g(r),c=g(r/2),u=o(r/2),f=g(i),h=o(i),p=g(2*i),d=f*f,m=h*h,x=c*c,b=1-m*u*u,_=b?E(h*u)*L(s=1/b):s=0,w=2*_*h*c-t,T=_*f-e,k=s*(m*x+_*h*u*d),A=s*(.5*l*p-2*_*f*c),M=.25*s*(p*c-_*f*m*l),S=s*(d*u+_*x*h),C=A*M-S*k;if(!C)break;var P=(T*A-w*S)/C,I=(w*M-T*k)/C;r-=P,i-=I}while((n(P)>v||n(I)>v)&&--a>0);return[r,i]}},D.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=L((r-L(r*r-4*e*e))/2),s=S(i)/3,l=i?function(t){return c(t+L(t*t-1))}(n(e/i))/3:function(t){return c(t+L(t*t+1))}(n(t))/3,u=o(s),f=P(l),h=f*f-u*u;return[2*d(t)*a(C(l)*u,.25-h),2*d(e)*a(f*g(s),.25+h)]};var R=L(8),F=c(1+w);function B(t,e){var r=n(e);return rx){var l=a(s[1],s[0]),c=L(s[0]*s[0]+s[1]*s[1]),u=r*p((l-x)/r)+x,f=a(g(l-=u),2-o(l));l=u+S(y/c*g(f))-f,s[0]=c*o(l),s[1]=c*g(l)}return s}return s.invert=function(t,n){var s=L(t*t+n*n);if(s>x){var l=a(n,t),c=r*p((l-x)/r)+x,u=l>c?-1:1,f=s*o(c-l),h=1/m(u*E((f-y)/L(y*(y-2*f)+s*s)));l=c+2*i((h+u*L(h*h-3))/3),t=s*o(l),n=s*g(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function j(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return U;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function U(t,e){return[t*o(e)/o(e/=2),2*g(e)]}function V(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+v))&&(o=a+v),r-=i=-1*v*(a-e)/(a-o)}while(s-- >0&&n(i)>v);return s<0?NaN:r}function q(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=1e-12),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var f=0;fl)o-=c/=2,s-=u/=2;else{l=g;var m=(o>0?-1:1)*r,v=(s>0?-1:1)*r,y=t(o+m,s),x=t(o,s+v),b=(y[0]-h[0])/m,_=(y[1]-h[1])/m,w=(x[0]-h[0])/v,T=(x[1]-h[1])/v,k=T*b-_*w,A=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-p*T)*A,s+=u=(p*_-d*b)*A,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=q(e),e}function G(t,e){var r,i=t*g(e),a=30;do{e-=r=(e+g(e)-i)/(1+o(e))}while(n(r)>v&&--a>0);return e/2}function Y(t,e,r){function n(n,i){return[t*n*o(i=G(r,i)),e*g(i)]}return n.invert=function(n,i){return i=S(i/e),[n/(t*o(i)),S((2*i+g(2*i))/r)]},n}B.invert=function(t,e){if((a=n(e))1e-12&&--u>0);return[t/(o(l)*(R-1/g(l))),d(e)*l]},U.invert=function(t,e){var r=2*S(e/2);return[t*o(r/2)/o(r),r]};var W=Y(w/x,w,y);var X=2.00276,Z=1.11072;function J(t,e){var r=G(y,e);return[X*t/(1/o(e)+Z/o(r)),(e+w*g(r))/X]}function K(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*M):r*A},i}function Q(t,e){return[t*o(e),e]}function $(t){if(!t)return Q;var e=1/m(t);function r(r,n){var i=e+t-n,a=i?r*o(n)/i:i;return[i*g(a),e-i*o(a)]}return r.invert=function(r,n){var i=L(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function tt(t){function e(e,r){var n=x-r,i=n?e*t*g(n)/n:n;return[n*g(i)/t,x-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=x-r,o=L(n*n+i*i),s=a(n,i);return[(o?o/g(o):1)*s/t,x-o]},e}J.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-w*g(s),s-=r=(g(2*s)+2*s-y*g(i))/(2*o(2*s)+2+y*o(i)*w*o(s))}while(n(r)>v&&--l>0);return i=a-w*g(s),[t*(1/o(i)+Z/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var et=Y(1,4/y,y);function rt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=E(r*s+e*i*u);else{var f=g(t/2),h=g(l/2);c=2*S(L(f*f+e*i*h*h))}return n(c)>v?[c,a(i*g(l),e*s-r*i*u)]:[0,0]}function nt(t,e,r){return E((t*t+e*e-r*r)/(2*t*e))}function it(t){return t-2*y*l((t+y)/(2*y))}function at(t,e,r){for(var n,i=[[t[0],t[1],g(t[1]),o(t[1])],[e[0],e[1],g(e[1]),o(e[1])],[r[0],r[1],g(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=rt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=nt(i[0].v[0],i[2].v[0],i[1].v[0]),c=nt(i[0].v[0],i[1].v[0],i[2].v[0]),u=y-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var f=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*g(l))];return function(t,e){var r,n=g(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=rt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=it(s[r][1]-l.v[1])}var h=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=nt(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,h[0]-=s[r][0]*o(d),h[1]-=s[r][0]*g(d)):(d=u-d,h[0]+=s[r][0]*o(d),h[1]+=s[r][0]*g(d)):(h[0]+=s[r][0]*o(d),h[1]-=s[r][0]*g(d))}return h[0]/=3,h[1]/=3,h}}function ot(t){return t[0]*=M,t[1]*=M,t}function st(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=at(ot(o(t)),ot(o(r)),ot(o(n)));s.invert=q(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function lt(t,e){var r=L(1-g(e));return[2/T*t*r,T*(1-r)]}function ct(t){var e=m(t);function r(t,r){return[t,(t?t/g(t):1)*(g(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=g(t)/t);var n=o(t);return[t,2*a(L(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,S(t?e*m(t)/t:e)]},r}lt.invert=function(t,e){var r=(r=e/T-1)*r;return[r>0?t*L(y/r)/2:0,S(1-r)]};var ut=L(3);function ft(t,e){return[ut*t*(2*o(2*e/3)-1)/T,ut*T*g(e/3)]}function ht(t){var e=o(t);function r(t,r){return[t*e,g(r)/e]}return r.invert=function(t,r){return[t/e,S(r*e)]},r}function pt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*m(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function dt(t,e){var r=L(8/(3*y));return[r*t*(1-n(e)/y),r*e]}function gt(t,e){var r=L(4-3*g(n(e)));return[2/L(6*y)*t*r,d(e)*L(2*y/3)*(2-r)]}function mt(t,e){var r=L(y*(4+y));return[2/r*t*(1+L(1-4*e*e/(y*y))),4/r*e]}function vt(t,e){var r=(2+x)*g(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>v;i++){var s=o(e);e-=a=(e+g(e)*(s+2)-r)/(2*s*(1+s))}return[2/L(y*(4+y))*t*(1+o(e)),2*L(y/(4+y))*g(e)]}function yt(t,e){return[t*(1+o(e))/L(2+y),2*e/L(2+y)]}function xt(t,e){for(var r=(1+x)*g(e),i=0,a=1/0;i<10&&n(a)>v;i++)e-=a=(e+g(e)-r)/(1+o(e));return r=L(2+y),[t*(1+o(e))/r,2*e/r]}ft.invert=function(t,e){var r=3*S(e/(ut*T));return[T*t/(ut*(2*o(2*r/3)-1)),r]},dt.invert=function(t,e){var r=L(8/(3*y)),i=e/r;return[t/(r*(1-n(i)/y)),i]},gt.invert=function(t,e){var r=2-n(e)/L(2*y/3);return[t*L(6*y)/(2*r),d(e)*S((4-r*r)/3)]},mt.invert=function(t,e){var r=L(y*(4+y))/2;return[t*r/(1+L(1-e*e*(4+y)/(4*y))),e*r/2]},vt.invert=function(t,e){var r=e*L((4+y)/y)/2,n=S(r),i=o(n);return[t/(2/L(y*(4+y))*(1+i)),S((n+r*(i+2))/(2+x))]},yt.invert=function(t,e){var r=L(2+y),n=e*r/2;return[r*t/(1+o(n)),n]},xt.invert=function(t,e){var r=1+x,n=L(r/2);return[2*t*n/(1+o(e*=n)),S((e+g(e))/r)]};var bt=3+2*w;function _t(t,e){var r=g(t/=2),n=o(t),a=L(o(e)),s=o(e/=2),l=g(e)/(s+w*n*a),u=L(2/(1+l*l)),f=L((w*s+(n+r)*a)/(w*s+(n-r)*a));return[bt*(u*(f-1/f)-2*c(f)),bt*(u*l*(f+1/f)-2*i(l))]}_t.invert=function(t,e){if(!(r=D.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var h=a/2,p=s/2,d=g(h),m=o(h),y=g(p),b=o(p),T=o(s),k=L(T),A=y/(b+w*m*k),M=A*A,S=L(2/(1+M)),E=(w*b+(m+d)*k)/(w*b+(m-d)*k),C=L(E),P=C-1/C,I=C+1/C,O=S*P-2*c(C)-t,z=S*A*I-2*i(A)-e,R=y&&_*k*d*M/y,F=(w*m*b+k)/(2*(b+w*m*k)*(b+w*m*k)*k),B=-.5*A*S*S*S,N=B*R,j=B*F,U=(U=2*b+w*k*(m-d))*U*C,V=(w*m*b*k+T)/U,q=-w*d*y/(k*U),H=P*N-2*V/C+S*(V+V/E),G=P*j-2*q/C+S*(q+q/E),Y=A*I*N-2*R/(1+M)+S*I*R+S*A*(V-V/E),W=A*I*j-2*F/(1+M)+S*I*F+S*A*(q-q/E),X=G*Y-W*H;if(!X)break;var Z=(z*G-O*W)/X,J=(O*Y-z*H)/X;a-=Z,s=u(-x,f(x,s-J))}while((n(Z)>v||n(J)>v)&&--l>0);return n(n(s)-x)s){var d=L(h),m=a(f,u),b=i*p(m/i),_=m-b,w=t*o(_),T=(t*g(_)-_*g(w))/(x-w),k=Lt(_,T),A=(y-t)/Ct(k,w,y);u=d;var M,S=50;do{u-=M=(t+Ct(k,w,u)*A-d)/(k(u)*A)}while(n(M)>v&&--S>0);f=_*g(u),us){var u=L(c),f=a(l,r),h=i*p(f/i),d=f-h;r=u*o(d),l=u*g(d);for(var m=r-x,v=g(r),b=l/v,_=rv||n(p)>v)&&--x>0);return[d,m]},u}Tt.invert=function(t,e){var r=e/(1+wt);return[t&&t/(wt*L(1-r*r)),2*i(r)]},kt.invert=function(t,e){var r=i(e/T),n=o(r),a=2*r;return[t*T/2/(o(a)*n*n),a]};var It=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var Ot=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var zt=Pt(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Dt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Dt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>v&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>v&&--o>0);return[i,a]};var Rt=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Ft(t){var e=t(x,0)[0]-t(-x,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*y,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*y;return o<-y?o+=2*y:o>y&&(o-=2*y),a[0]=o,a}),r}function Bt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=g(t)*s,u=g(i*e);t=n(a(c,u)),e=S(l),n(t-x)>v&&(t%=x);var f=function(t,e){if(e===x)return[0,0];var r,i,a=g(e),s=a*a,l=s*s,c=1+l,u=1+3*l,f=1-l,h=S(1/L(c)),p=f+s*c*h,d=(1-a)/p,m=L(d),b=d*c,_=L(b),w=m*f;if(0===t)return[0,-(w+s*_)];var T,k=o(e),A=1/k,M=2*a*k,E=(-p*k-(-3*s+h*u)*M*(1-a))/(p*p),C=-A*M,P=-A*(s*c*E+d*u*M),I=-2*A*(f*(.5*E/m)-2*s*m*M),O=4*t/y;if(t>.222*y||e.175*y){if(r=(w+s*L(b*(1+l)-w*w))/(1+l),t>y/4)return[r,r];var z=r,D=.5*r;r=.5*(D+z),i=50;do{var R=L(b-r*r),F=r*(I+C*R)+P*S(r/_)-O;if(!F)break;F<0?D=r:z=r,r=.5*(D+z)}while(n(z-D)>v&&--i>0)}else{r=v,i=25;do{var B=r*r,N=L(b-B),j=I+C*N,U=r*j+P*S(r/_)-O,V=j+(P-C*B)/N;r-=T=N?U/V:0}while(n(T)>v&&--i>0)}return[r,-w-s*L(b-r*r)]}(t>y/4?x-t:t,e);return t>y/4&&(u=f[0],f[0]=-f[1],f[1]=-u),f[0]*=r,f[1]*=-i,f}function Nt(t,e){var r,a,l,c,u,f;if(e=1-v)return r=(1-e)/4,l=1/(a=P(t)),[(c=((f=s(2*(f=t)))-1)/(f+1))+r*((u=a*C(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-x+r*(u-t)/a];var h=[1,0,0,0,0,0,0,0,0],p=[L(e),0,0,0,0,0,0,0,0],d=0;for(a=L(1-e),u=1;n(p[d]/h[d])>v&&d<8;)r=h[d++],p[d]=(r-a)/2,h[d]=(r+a)/2,a=L(r*a),u*=2;l=u*h[d]*t;do{l=(S(c=p[d]*g(a=l)/h[d])+l)/2}while(--d);return[g(l),c=o(l),c/o(l-a),l]}function jt(t,e){if(!e)return t;if(1===e)return c(m(t/2+b));for(var r=1,a=L(1-e),o=L(e),s=0;n(o)>v;s++){if(t%y){var l=i(a*m(t)/r);l<0&&(l+=y),t+=l+~~(t/y)*y}else t+=t;o=(r+a)/2,a=L(r*a),o=((r=o)-a)/2}return t/(h(2,s)*r)}function Ut(t,e){var r=(w-1)/(w+1),l=L(1-r*r),u=jt(x,l*l),f=c(m(y/4+n(e)/2)),h=s(-1*f)/L(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?x:-x)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(h*o(-1*t),h*g(-1*t)),v=function(t,e,r){var a=n(t),o=C(n(e));if(a){var s=1/g(a),l=1/(m(a)*m(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+L(c*c-4*((r-1)*l)))/2;return[jt(i(1/L(u)),r)*d(t),jt(i(L((u/l-1)/r)),1-r)*d(e)]}return[0,jt(i(o),1-r)*d(e)]}(p[0],p[1],l*l);return[-v[1],(e>=0?1:-1)*(.5*u-v[0])]}function Vt(t){var e=g(t),r=o(t),i=qt(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=g(a),c=o(a),u=o(t),f=E(e*l+r*c*u),h=g(f),p=n(h)>v?f/h:1;return[p*r*g(t),(n(t)>x?p:-p)*(e*c-r*l*u)]}return i.invert=qt(-t),s.invert=function(t,r){var n=L(t*t+r*r),s=-g(n),l=o(n),c=n*l,u=-r*s,f=n*e,h=L(c*c+u*u-f*f),p=a(c*f+u*h,u*f-c*h),d=(n>x?-1:1)*a(t*s,n*o(p)*l+r*g(p)*s);return i.invert(d,p)},s}function qt(t){var e=g(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=g(t)*i,c=g(n);return[a(l,s*r-c*e),S(c*r+s*e)]}}Bt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){var r=0,i=1,a=.5,s=50;for(;;){var l=a*a,c=L(a),u=S(1/L(1+l)),f=1-l+a*(1+l)*u,h=(1-c)/f,p=L(h),d=h*(1+l),g=p*(1-l),m=L(d-t*t),v=e+g+a*m;if(n(i-r)<1e-12||0==--s||0===v)break;v>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var x=S(c),b=o(x),_=1/b,w=2*c*b,T=(-f*b-(-3*a+u*(1+3*l))*w*(1-c))/(f*f);return[y/4*(t*(-2*_*(.5*T/p*(1-l)-2*a*p*w)+-_*w*m)+-_*(a*(1+l)*T+h*(1+3*l)*w)*S(t/L(d))),x]}(c?l:s,c?s:l),f=u[0],h=u[1],p=o(h);return c&&(f=-x-f),[r*(a(g(f)*p,-g(h))+y),i*S(o(f)*p)]},Ut.invert=function(t,e){var r,n,o,l,u,f,h=(w-1)/(w+1),p=L(1-h*h),d=jt(x,p*p),g=(n=-t,o=p*p,(r=.5*d-e)?(l=Nt(r,o),n?(f=(u=Nt(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/f,l[1]*l[2]*u[0]*u[1]/f],[l[1]*u[1]/f,-l[0]*l[2]*u[0]*u[2]/f],[l[2]*u[1]*u[2]/f,-o*l[0]*l[1]*u[0]/f]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=Nt(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),m=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(g[0],g[1]);return[a(m[1],m[0])/-1,2*i(s(-.5*c(h*m[0]*m[0]+h*m[1]*m[1])))-x]};var Ht=S(1-1/3)*A,Gt=ht(0);function Yt(t){var e=Ht*M,r=lt(y,e)[0]-lt(-y,e)[0],i=Gt(0,e)[1],a=lt(0,e)[1],o=T-a,s=k/t,c=4/k,h=i+o*o*4/k;function p(p,d){var g,m=n(d);if(m>e){var v=f(t-1,u(0,l((p+y)/s)));(g=lt(p+=y*(t-1)/t-v*s,m))[0]=g[0]*k/r-k*(t-1)/(2*t)+v*k/t,g[1]=i+4*(g[1]-a)*o/k,d<0&&(g[1]=-g[1])}else g=Gt(p,d);return g[0]*=c,g[1]/=h,g}return p.invert=function(e,p){e/=c;var d=n(p*=h);if(d>i){var g=f(t-1,u(0,l((e+y)/s)));e=(e+y*(t-1)/t-g*s)*r/k;var m=lt.invert(e,.25*(d-i)*k/o+a);return m[0]-=y*(t-1)/t-g*s,p<0&&(m[1]=-m[1]),m}return Gt.invert(e,p)},p}function Wt(t,e){return[t,1&e?90-v:Ht]}function Xt(t,e){return[t,1&e?-90+v:-Ht]}function Zt(t){return[t[0]*(1-v),t[1]]}function Jt(t){var e,r=1+t,i=S(g(1/r)),s=2*L(y/(e=y+4*i*r)),l=.5*s*(r+L(t*(2+t))),c=t*t,u=r*r;function f(f,h){var p,d,m=1-g(h);if(m&&m<2){var v,b=x-h,_=25;do{var w=g(b),T=o(b),k=i+a(w,r-T),A=1+u-2*r*T;b-=v=(b-c*i-r*w+A*k-.5*m*e)/(2*r*w*k)}while(n(v)>1e-12&&--_>0);p=s*L(A),d=f*k/y}else p=s*(t+m),d=f*i/y;return[p*g(d),l-p*o(d)]}return f.invert=function(t,n){var o=t*t+(n-=l)*n,f=(1+u-o/(s*s))/(2*r),h=E(f),p=g(h),d=i+a(p,r-f);return[S(t/L(o))*y/d,S(1-2*(h-c*i-r*p+(1+u-2*r*f)*d)/e)]},f}function Kt(t,e){return e>-.7109889596207567?((t=W(t,e))[1]+=.0528035274542,t):Q(t,e)}function Qt(t,e){return n(e)>.7109889596207567?((t=W(t,e))[1]-=e>0?.0528035274542:-.0528035274542,t):Q(t,e)}function $t(t,e,r,n){var i=L(4*y/(2*r+(1+t-e/2)*g(2*r)+(t+e)/2*g(4*r)+e/2*g(6*r))),a=L(n*g(r)*L((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return L(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*g(2*i)+(t+e)/2*g(4*i)+e/2*g(6*i))/r}function u(t){return l(t)*g(t)}var f=function(t,e){var n=r*V(c,s*g(e)/r,e/y);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/y*o(n),u/a*g(n)]};return f.invert=function(t,e){var n=V(u,e*a/i);return[t*y/(o(n)*i*a*l(n)),S(r*c(n/r)/s)]},0===r&&(i=L(n/y),(f=function(t,e){return[t*i,g(e)/i]}).invert=function(t,e){return[t/i,S(e*i)]}),f}function te(t,e,r,n,i){void 0===n&&(n=1e-8),void 0===i&&(i=20);var a=t(e),o=t(.5*(e+r)),s=t(r);return function t(e,r,n,i,a,o,s,l,c,u,f){if(f.nanEncountered)return NaN;var h,p,d,g,m,v,y,x,b,_;if(p=e(r+.25*(h=n-r)),d=e(n-.25*h),isNaN(p))f.nanEncountered=!0;else{if(!isNaN(d))return _=((v=(g=h*(i+4*p+a)/12)+(m=h*(a+4*d+o)/12))-s)/15,u>c?(f.maxDepthCount++,v+_):Math.abs(_)t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var p=2*f(1)/y*o/r,m=function(t,e){var r=f(n(g(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return m.invert=function(t,e){var r;return n(e*=p)<1&&(r=d(e)*S(a(n(e))*o)),[t/i(n(e)),r]},m}function re(t,e){return n(t[0]-e[0])=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(ne([[o-v,s-v],[o-v,a+v],[n+v,a+v],[n+v,i-v]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function ae(t,r,n){var i,a;function o(e,n){for(var i=n<0?-1:1,a=r[+(n<0)],o=0,s=a.length-1;oa[o][2][0];++o);var l=t(e-a[o][1][0],n);return l[0]+=t(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}n?o.invert=n(o):t.invert&&(o.invert=function(e,n){for(var i=a[+(n<0)],s=r[+(n<0)],l=0,c=i.length;lo&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):r.map((function(t){return t.map((function(t){return[[t[0][0]*A,t[0][1]*A],[t[1][0]*A,t[1][1]*A],[t[2][0]*A,t[2][1]*A]]}))}))},null!=r&&s.lobes(r),s}Kt.invert=function(t,e){return e>-.7109889596207567?W.invert(t,e-.0528035274542):Q.invert(t,e)},Qt.invert=function(t,e){return n(e)>.7109889596207567?W.invert(t,e+(e>0?.0528035274542:-.0528035274542)):Q.invert(t,e)};var oe=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var se=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var le=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var ce=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var ue=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var fe=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function he(t,e){return[3/k*t*L(y*y/3-e*e),e]}function pe(t){function e(e,r){if(n(n(r)-x)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=h((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,S((l-1)/(l+1))]},e}he.invert=function(t,e){return[k/3*t/L(y*y/3-e*e),e]};var de=y/w;function ge(t,e){return[t*(1+L(o(e)))/2,e/(o(e/2)*o(t/6))]}function me(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function ve(t,e){return[g(t)/o(e),m(e)*o(t)]}function ye(t){var e=o(t),r=m(b+t/2);function i(i,a){var o=a-t,s=n(o)=0;)h=(f=t[u])[0]+l*(i=h)-c*p,p=f[1]+l*p+c*i;return[h=l*(i=h)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var f,h=e,p=t[h],d=p[0],m=p[1],v=0,y=0;--h>=0;)v=d+c*(f=v)-u*y,y=m+c*y+u*f,d=(p=t[h])[0]+c*(f=d)-u*m,m=p[1]+c*m+u*f;var x,b,_=(v=d+c*(f=v)-u*y)*v+(y=m+c*y+u*f)*y;c-=x=((d=c*(f=d)-u*m-r)*v+(m=c*m+u*f-s)*y)/_,u-=b=(m*v-d*y)/_}while(n(x)+n(b)>1e-12&&--l>0);if(l){var w=L(c*c+u*u),T=2*i(.5*w),k=g(T);return[a(c*k,w*o(T)),w?S(u*k/w):0]}},r}ge.invert=function(t,e){var r=n(t),i=n(e),a=v,s=x;iv||n(b)>v)&&--a>0);return a&&[r,i]},ve.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?_*L((i-L(i*i-4*r))/r):1/L(n);return[S(t*a),d(e)*E(a)]},xe.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*y]};var _e=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],we=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Te=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],ke=[[.9245,0],[0,0],[.01943,0]],Ae=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Me(t,r){var n=e.geoProjection(be(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Se=L(6),Ee=L(7);function Le(t,e){var r=S(7*g(e)/(3*Se));return[Se*t*(2*o(2*r/3)-1)/Ee,9*g(r/3)/Ee]}function Ce(t,e){for(var r,i=(1+_)*g(e),a=e,s=0;s<25&&(a-=r=(g(a/2)+g(a)-i)/(.5*o(a/2)+o(a)),!(n(r)1e-12&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Oe.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>v;++i){var s=o(e/2);e-=a=(e-m(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var ze=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function De(t,e){var r=g(e),i=o(e),a=d(t);if(0===t||n(e)===x)return[0,e];if(0===e)return[t,0];if(n(t)===x)return[t*i,x*r];var s=y/(2*t)-2*t/y,l=2*e/y,c=(1-l*l)/(r-l),u=s*s,f=c*c,h=1+u/f,p=1+f/u,m=(s*r/c-s/2)/h,v=(f*r/u+c/2)/p,b=v*v-(f*r*r/u+c*r-1)/p;return[x*(m+L(m*m+i*i/h)*a),x*(v+L(b<0?0:b)*d(-e*s)*a)]}De.invert=function(t,e){var r=(t/=x)*t,n=r+(e/=x)*e,i=y*y;return[t?(n-1+L((1-n)*(1-n)+4*r))/(2*t)*x:0,V((function(t){return n*(y*g(t)-2*t)*y+4*t*t*(e-g(t))+2*y*t-i*e}),0)]};function Re(t,e){var r=e*e;return[t,e*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function Fe(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Be(n.map(r.project),n.map(e.project));e.transform=r.transform?Ne(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o1.790857183?e=1.790857183:e<-1.790857183&&(e=-1.790857183);var r,i=e;do{var a=i*i;i-=r=(i*(1.0148+a*a*(.23185+a*(.02406*a-.14499)))-e)/(1.0148+a*a*(5*.23185+a*(.21654*a-1.01493)))}while(n(r)>v);return[t,i]},Fe.invert=function(t,e){if(n(e)v&&--s>0);return l=m(a),[(n(e)n^p>n&&r<(h-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),nr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function sr(t){var r=t(x,0)[0]-t(-x,0)[0];function i(e,i){var a=n(e)0?e-y:e+y,i),s=(o[0]-o[1])*_,l=(o[0]+o[1])*_;if(a)return[s,l];var c=r*_,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*_,o=(i-e)*_,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*_,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,f=-c*i+(a>0?1:-1)*l;a=(-u-f)*_,o=(u-f)*_}var h=t.invert(a,o);return s||(h[0]+=a>0?y:-y),h}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function lr(){return sr(Ut).scale(111.48)}function cr(t){var e=g(t);function r(r,n){var a=e?m(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*g(n)),l=1/m(n);return[g(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)v&&--u>0);var d=r*(f=m(c)),x=m(n(a)0?x:-x)*(h+o*(d-c)/2+o*o*(d-2*h+c)/2)]}function hr(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*g(e),i*g(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=L(n),o=(t-L(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*L(1-o*o)),i?S(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=g(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}ur.forEach((function(t){t[1]*=1.0144})),fr.invert=function(t,e){var r=e/x,i=90*r,a=f(18,n(i/5)),o=u(0,l(a));do{var s=ur[o][1],c=ur[o+1][1],h=ur[f(19,o+2)][1],p=h-s,d=h-2*c+s,g=2*(n(r)-c)/p,m=d/p,v=g*(1-m*g*(1-2*m*g));if(v>=0||1===o){i=(e>=0?5:-5)*(v+a);var y,b=50;do{v=(a=f(18,n(i)/5))-(o=l(a)),s=ur[o][1],c=ur[o+1][1],h=ur[f(19,o+2)][1],i-=(y=(e>=0?x:-x)*(c+v*(h-s)/2+v*v*(h-2*c+s)/2)-e)*A}while(n(y)>1e-12&&--b>0);break}}while(--o>=0);var _=ur[o][0],w=ur[o+1][0],T=ur[f(19,o+2)][0];return[t/(w+v*(T-_)/2+v*v*(T-2*w+_)/2),i*M]};var pr=-179.9999,dr=179.9999,gr=-89.9999;function mr(t){return t.length>0}function vr(t){return-90===t||90===t?[0,t]:[-180,(e=t,Math.floor(1e4*e)/1e4)];var e}function yr(t){var e=t[0],r=t[1],n=!1;return e<=pr?(e=-180,n=!0):e>=dr&&(e=180,n=!0),r<=gr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[e,r]:t}function xr(t){return t.map(yr)}function br(t,e,r){for(var n=0,i=t.length;n=dr||u<=gr||u>=89.9999){a[o]=yr(l);for(var f=o+1;fpr&&pgr&&d<89.9999)break}if(f===o+1)continue;if(o){var g={index:-1,polygon:e,ring:a.slice(0,o+1)};g.ring[g.ring.length-1]=vr(u),r[r.length-1]=g}else r.pop();if(f>=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(f-1)}),a[0]=vr(a[0][1]),o=-1,s=a.length}}}}function _r(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e0?y-l:l)*A],u=e.geoProjection(t(s)).rotate(c),f=e.geoRotation(c),h=u.center;return delete u.rotate,u.center=function(t){return arguments.length?h(f(t)):f.invert(h())},u.clipAngle(90)}function Mr(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Sr(t,e){return Ar(Mr,t,e)}function Er(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=m(n),l=.5/g(n);function c(e,a){var s=E(o(a)*o(e-r)),l=E(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*L(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,f=o(L(u+(i=t+r)*i)),h=o(L(u+(i=t+n)*i));return[a(c=f-h,i=(f+h)*s),(e<0?-1:1)*E(L(i*i+c*c)*l)]},c}function Lr(t,e){return Ar(Er,t,e)}function Cr(t,e){if(n(e)v&&--l>0);return[d(t)*(L(a*a+4)+a)*y/4,x*s]};var Rr=4*y+3*L(3),Fr=2*L(2*y*L(3)/Rr),Br=Y(Fr*L(3)/y,Fr,Rr/6);function Nr(t,e){return[t*L(1-3*e*e/(y*y)),e]}function jr(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(g(t)*r,-g(e))),l=g(t);return[l*(r=L(1-n*n))-s*i,-s*r-l*i]}function Ur(t,e){var r=O(t,e);return[(r[0]+t/x)/2,(r[1]+e)/2]}Nr.invert=function(t,e){return[t/L(1-3*e*e/(y*y)),e]},jr.invert=function(t,e){var r=(t*t+e*e)/-2,n=L(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=L(o*o+i*i);return[a(n*i,s*(1+r)),s?-S(n*o/s):0]},Ur.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=g(i),u=g(2*i),f=c*c,h=l*l,p=g(r),d=o(r/2),m=g(r/2),y=m*m,b=1-h*d*d,_=b?E(l*d)*L(s=1/b):s=0,w=.5*(2*_*l*m+r/x)-t,T=.5*(_*c+i)-e,k=.5*s*(h*y+_*l*d*f)+.5/x,A=s*(p*u/4-_*c*m),M=.125*s*(u*m-_*c*h*p),S=.5*s*(f*d+_*y*l)+.5,C=A*M-S*k,P=(T*A-w*S)/C,I=(w*M-T*k)/C;r-=P,i-=I}while((n(P)>v||n(I)>v)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=x,r=e.geoProjectionMutator(I),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*M):t*A},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=I,t.geoAitoff=function(){return e.geoProjection(O).scale(152.63)},t.geoAitoffRaw=O,t.geoArmadillo=function(){var t=20*M,r=t>=0?1:-1,n=m(r*t),i=e.geoProjectionMutator(z),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=m((r=(t=e*M)>=0?1:-1)*t),i(t)):t*A},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),f=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*f)>=-180;)u.point(e,r*-a(o(e*M/2),n)*A);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=z,t.geoAugust=function(){return e.geoProjection(D).scale(66.1603)},t.geoAugustRaw=D,t.geoBaker=function(){return e.geoProjection(B).scale(112.314)},t.geoBakerRaw=B,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=-o(.01*M),l=g(.01*M);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),c=i(e),u=(n.rotate([0,0]),i(e));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=0,r=360/t,n=2*y/t,i=90-180/t,c=x;e=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=Vt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Yt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){var n,i;e.geoStream((n=180/t,i=[].concat(r.range(-180,180+n/2,n).map(Wt),r.range(180,-180-n/2,-n).map(Xt)),{type:"Polygon",coordinates:[180===n?i.map(Zt):i]}),l)},s},i.scale(239.75)},t.geoHealpixRaw=Yt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Jt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Jt,t.geoHomolosine=function(){return e.geoProjection(Qt).scale(152.63)},t.geoHomolosineRaw=Qt,t.geoHufnagel=function(){var t=1,r=0,n=45*M,i=2,a=e.geoProjectionMutator($t),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*M,i):n*A},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=$t,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ee),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ee,t.geoInterrupt=ae,t.geoInterruptedBoggs=function(){return ae(J,oe).scale(160.857)},t.geoInterruptedHomolosine=function(){return ae(Qt,se).scale(152.63)},t.geoInterruptedMollweide=function(){return ae(W,le).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return ae(W,ce).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return ae(Kt,ue,q).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return ae(Q,fe).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(he).scale(158.837)},t.geoKavrayskiy7Raw=he,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(pe),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=pe,t.geoLarrivee=function(){return e.geoProjection(ge).scale(97.2672)},t.geoLarriveeRaw=ge,t.geoLaskowski=function(){return e.geoProjection(me).scale(139.98)},t.geoLaskowskiRaw=me,t.geoLittrow=function(){return e.geoProjection(ve).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=ve,t.geoLoximuthal=function(){return K(ye).parallel(40).scale(158.837)},t.geoLoximuthalRaw=ye,t.geoMiller=function(){return e.geoProjection(xe).scale(108.318)},t.geoMillerRaw=xe,t.geoModifiedStereographic=Me,t.geoModifiedStereographicRaw=be,t.geoModifiedStereographicAlaska=function(){return Me(_e,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Me(we,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Me(Te,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Me(ke,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Me(Ae,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(W).scale(169.529)},t.geoMollweideRaw=W,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Le).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Le,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(Ce).scale(188.209)},t.geoMtFlatPolarQuarticRaw=Ce,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(Pe).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=Pe,t.geoNaturalEarth2=function(){return e.geoProjection(Ie).scale(175.295)},t.geoNaturalEarth2Raw=Ie,t.geoNellHammer=function(){return e.geoProjection(Oe).scale(152.63)},t.geoNellHammerRaw=Oe,t.geoInterruptedQuarticAuthalic=function(){return ae(j(1/0),ze).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(De).scale(127.267)},t.geoNicolosiRaw=De,t.geoPatterson=function(){return e.geoProjection(Re).scale(139.319)},t.geoPattersonRaw=Re,t.geoPolyconic=function(){return e.geoProjection(Fe).scale(103.74)},t.geoPolyconicRaw=Fe,t.geoPolyhedral=Ve,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-y/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-y/2?e<0?6:4:t<0?e<0?2:0:t2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=sr,t.geoRectangularPolyconic=function(){return K(cr).scale(131.215)},t.geoRectangularPolyconicRaw=cr,t.geoRobinson=function(){return e.geoProjection(fr).scale(152.63)},t.geoRobinsonRaw=fr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(hr),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*M):r*A},i.scale(432.147).clipAngle(E(1/t)*A-1e-6)},t.geoSatelliteRaw=hr,t.geoSinuMollweide=function(){return e.geoProjection(Kt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=Kt,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return wr(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(wr)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Tr(t)}},t.geoTimes=function(){return e.geoProjection(kr).scale(146.153)},t.geoTimesRaw=kr,t.geoTwoPointAzimuthal=Sr,t.geoTwoPointAzimuthalRaw=Mr,t.geoTwoPointAzimuthalUsa=function(){return Sr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Lr,t.geoTwoPointEquidistantRaw=Er,t.geoTwoPointEquidistantUsa=function(){return Lr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(Cr).scale(79.4183)},t.geoVanDerGrintenRaw=Cr,t.geoVanDerGrinten2=function(){return e.geoProjection(Pr).scale(79.4183)},t.geoVanDerGrinten2Raw=Pr,t.geoVanDerGrinten3=function(){return e.geoProjection(Ir).scale(79.4183)},t.geoVanDerGrinten3Raw=Ir,t.geoVanDerGrinten4=function(){return e.geoProjection(Or).scale(127.16)},t.geoVanDerGrinten4Raw=Or,t.geoWagner=Dr,t.geoWagner7=function(){return Dr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=zr,t.geoWagner4=function(){return e.geoProjection(Br).scale(176.84)},t.geoWagner4Raw=Br,t.geoWagner6=function(){return e.geoProjection(Nr).scale(152.63)},t.geoWagner6Raw=Nr,t.geoWiechel=function(){return e.geoProjection(jr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=jr,t.geoWinkel3=function(){return e.geoProjection(Ur).scale(158.837)},t.geoWinkel3Raw=Ur,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":162,"d3-geo":169}],169:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-array")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){a(i,t,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new n;function a(t,e,r){var n=t.s=e+r,i=n-e,a=n-i;t.t=e-a+(r-i)}var o=1e-6,s=Math.PI,l=s/2,c=s/4,u=2*s,f=180/s,h=s/180,p=Math.abs,d=Math.atan,g=Math.atan2,m=Math.cos,v=Math.ceil,y=Math.exp,x=Math.log,b=Math.pow,_=Math.sin,w=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,k=Math.tan;function A(t){return t>1?0:t<-1?s:Math.acos(t)}function M(t){return t>1?l:t<-1?-l:Math.asin(t)}function S(t){return(t=_(t/2))*t}function E(){}function L(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var C={Feature:function(t,e){L(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=m(e=(e*=h)/2+c),o=_(e),s=N*o,l=B*a+s*m(i),u=s*n*_(i);j.add(g(u,l)),F=t,B=a,N=o}function W(t){return[g(t[1],t[0]),M(t[2])]}function X(t){var e=t[0],r=t[1],n=m(r);return[n*m(e),n*_(e),_(r)]}function Z(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(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 K(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function $(t){var e=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,ht,pt,dt,gt,mt,vt,yt,xt,bt,_t,wt,Tt,kt,At,Mt=r(),St={point:Et,lineStart:Ct,lineEnd:Pt,polygonStart:function(){St.point=It,St.lineStart=Ot,St.lineEnd=zt,Mt.reset(),V.polygonStart()},polygonEnd:function(){V.polygonEnd(),St.point=Et,St.lineStart=Ct,St.lineEnd=Pt,j<0?(tt=-(rt=180),et=-(nt=90)):Mt>o?nt=90:Mt<-o&&(et=-90),ct[0]=tt,ct[1]=rt},sphere:function(){tt=-(rt=180),et=-(nt=90)}};function Et(t,e){lt.push(ct=[tt=t,rt=t]),ent&&(nt=e)}function Lt(t,e){var r=X([t*h,e*h]);if(st){var n=J(st,r),i=J([n[1],-n[0],0],n);$(i),i=W(i);var a,o=t-it,s=o>0?1:-1,l=i[0]*f*s,c=p(o)>180;c^(s*itnt&&(nt=a):c^(s*it<(l=(l+360)%360-180)&&lnt&&(nt=e)),c?tDt(tt,rt)&&(rt=t):Dt(t,rt)>Dt(tt,rt)&&(tt=t):rt>=tt?(trt&&(rt=t)):t>it?Dt(tt,t)>Dt(tt,rt)&&(rt=t):Dt(t,rt)>Dt(tt,rt)&&(tt=t)}else lt.push(ct=[tt=t,rt=t]);ent&&(nt=e),st=r,it=t}function Ct(){St.point=Lt}function Pt(){ct[0]=tt,ct[1]=rt,St.point=Et,st=null}function It(t,e){if(st){var r=t-it;Mt.add(p(r)>180?r+(r>0?360:-360):r)}else at=t,ot=e;V.point(t,e),Lt(t,e)}function Ot(){V.lineStart()}function zt(){It(at,ot),V.lineEnd(),p(Mt)>o&&(tt=-(rt=180)),ct[0]=tt,ct[1]=rt,st=null}function Dt(t,e){return(e-=t)<0?e+360:e}function Rt(t,e){return t[0]-e[0]}function Ft(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:es?t+Math.round(-t/u)*u:t,e]}function Qt(t,e,r){return(t%=u)?e||r?Jt(te(t),ee(e,r)):te(t):e||r?ee(e,r):Kt}function $t(t){return function(e,r){return[(e+=t)>s?e-u:e<-s?e+u:e,r]}}function te(t){var e=$t(t);return e.invert=$t(-t),e}function ee(t,e){var r=m(t),n=_(t),i=m(e),a=_(e);function o(t,e){var o=m(e),s=m(t)*o,l=_(t)*o,c=_(e),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),M(u*i+l*a)]}return o.invert=function(t,e){var o=m(e),s=m(t)*o,l=_(t)*o,c=_(e),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),M(u*r-s*n)]},o}function re(t){function e(e){return(e=t(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e}return t=Qt(t[0]*h,t[1]*h,t.length>2?t[2]*h:0),e.invert=function(e){return(e=t.invert(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e},e}function ne(t,e,r,n,i,a){if(r){var o=m(e),s=_(e),l=n*r;null==i?(i=e+n*u,a=e-l/2):(i=ie(o,i),a=ie(o,a),(n>0?ia)&&(i+=n*u));for(var c,f=i;n>0?f>a:f1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function oe(t,e){return p(t[0]-e[0])=0;--a)i.point((f=u[a])[0],f[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ce(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,z=O*I,D=z>s,R=T*C;if(ue.add(g(R*O*_(z),k*P+R*m(z))),f+=D?I+O*u:I,D^b>=r^E>=r){var F=J(X(x),X(S));$(F);var B=J(a,F);$(B);var N=(D^I>=0?-1:1)*M(B[2]);(n>N||n===N&&(F[0]||F[1]))&&(h+=D^I>=0?1:-1)}}return(f<-o||f0){for(h||(a.polygonStart(),h=!0),a.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(de))}return p}}function de(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-l-o:l-t[1])-((e=e.x)[0]<0?e[1]-l-o:l-e[1])}var me=pe((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,c){var u=a>0?s:-s,f=p(a-r);p(f-s)0?l:-l),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&f>=s&&(p(r-i)o?d((_(e)*(a=m(n))*_(r)-_(n)*(i=m(e))*_(t))/(i*a*s)):(e+n)/2}(r,n,a,c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=c),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*l,n.point(-s,i),n.point(0,i),n.point(s,i),n.point(s,0),n.point(s,-i),n.point(0,-i),n.point(-s,-i),n.point(-s,0),n.point(-s,i);else if(p(t[0]-e[0])>o){var a=t[0]0,i=p(e)>o;function a(t,r){return m(t)*m(r)>e}function l(t,r,n){var i=[1,0,0],a=J(X(t),X(r)),l=Z(a,a),c=a[0],u=l-c*c;if(!u)return!n&&t;var f=e*l/u,h=-e*c/u,d=J(i,a),g=Q(i,f);K(g,Q(a,h));var m=d,v=Z(g,m),y=Z(m,m),x=v*v-y*(Z(g,g)-1);if(!(x<0)){var b=T(x),_=Q(m,(-v-b)/y);if(K(_,g),_=W(_),!n)return _;var w,k=t[0],A=r[0],M=t[1],S=r[1];A0^_[1]<(p(_[0]-k)s^(k<=_[0]&&_[0]<=A)){var C=Q(m,(-v+b)/y);return K(C,g),[_,W(C)]}}}function c(e,r){var i=n?t:s-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return pe(a,(function(t){var e,r,o,u,f;return{lineStart:function(){u=o=!1,f=1},point:function(h,p){var d,g=[h,p],m=a(h,p),v=n?m?0:c(h,p):m?c(h+(h<0?s:-s),p):0;if(!e&&(u=o=m)&&t.lineStart(),m!==o&&(!(d=l(e,g))||oe(e,d)||oe(g,d))&&(g[2]=1),m!==o)f=0,m?(t.lineStart(),d=l(g,e),t.point(d[0],d[1])):(d=l(e,g),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^m){var y;v&r||!(y=l(g,e,!0))||(f=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!m||e&&oe(e,g)||t.point(g[0],g[1]),e=g,o=m,r=v},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return f|(u&&o)<<1}}}),(function(e,n,i,a){ne(a,t,r,i,e,n)}),n?[0,-t]:[-s,t-s])}function ye(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,f=0;if(null==e||(c=l(e,o))!==(f=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==f);else s.point(a[0],a[1])}function l(e,i){return p(e[0]-t)0?0:3:p(e[0]-n)0?2:1:p(e[1]-r)0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(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(o){var l,u,f,h,p,d,g,m,v,y,x,b=o,_=ae(),w={point:T,lineStart:function(){w.point=k,u&&u.push(f=[]);y=!0,v=!1,g=m=NaN},lineEnd:function(){l&&(k(h,p),d&&v&&_.rejoin(),l.push(_.result()));w.point=T,v&&b.lineEnd()},polygonStart:function(){b=_,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ri&&(h-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(h-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&le(l,c,r,s,o),o.polygonEnd());b=o,l=u=f=null}};function T(t,e){a(t,e)&&b.point(t,e)}function k(e,o){var s=a(e,o);if(u&&f.push([e,o]),y)h=e,p=o,d=s,y=!1,s&&(b.lineStart(),b.point(e,o));else if(s&&v)b.point(e,o);else{var l=[g=Math.max(-1e9,Math.min(1e9,g)),m=Math.max(-1e9,Math.min(1e9,m))],c=[e=Math.max(-1e9,Math.min(1e9,e)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,f=e[0]-s,h=e[1]-l;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0&&(t[0]=s+c*f,t[1]=l+c*h),u<1&&(e[0]=s+u*f,e[1]=l+u*h),!0}}}}}(l,c,t,r,n,i)?s&&(b.lineStart(),b.point(e,o),x=!1):(v||(b.lineStart(),b.point(l[0],l[1])),b.point(c[0],c[1]),s||b.lineEnd(),x=!1)}g=e,m=o,v=s}return w}}var xe,be,_e,we=r(),Te={sphere:E,point:E,lineStart:function(){Te.point=Ae,Te.lineEnd=ke},lineEnd:E,polygonStart:E,polygonEnd:E};function ke(){Te.point=Te.lineEnd=E}function Ae(t,e){xe=t*=h,be=_(e*=h),_e=m(e),Te.point=Me}function Me(t,e){t*=h;var r=_(e*=h),n=m(e),i=p(t-xe),a=m(i),o=n*_(i),s=_e*r-be*n*a,l=be*r+_e*n*a;we.add(g(T(o*o+s*s),l)),xe=t,be=r,_e=n}function Se(t){return we.reset(),z(t,Te),+we}var Ee=[null,null],Le={type:"LineString",coordinates:Ee};function Ce(t,e){return Ee[0]=t,Ee[1]=e,Se(Le)}var Pe={Feature:function(t,e){return Oe(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=Ce(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<1e-12*i)return!0;r=n}return!1}function Re(t,e){return!!he(t.map(Fe),Be(e))}function Fe(t){return(t=t.map(Be)).pop(),t}function Be(t){return[t[0]*h,t[1]*h]}function Ne(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[t,e]}))}}function je(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[e,t]}))}}function Ue(){var t,r,n,i,a,s,l,c,u,f,h,d,g=10,m=g,y=90,x=360,b=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(v(i/y)*y,n,y).map(h).concat(e.range(v(c/x)*x,l,x).map(d)).concat(e.range(v(r/g)*g,t,g).filter((function(t){return p(t%y)>o})).map(u)).concat(e.range(v(s/m)*m,a,m).filter((function(t){return p(t%x)>o})).map(f))}return _.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(d(l).slice(1),h(n).reverse().slice(1),d(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),_.precision(b)):[[i,c],[n,l]]},_.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),_.precision(b)):[[r,s],[t,a]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],_):[y,x]},_.stepMinor=function(t){return arguments.length?(g=+t[0],m=+t[1],_):[g,m]},_.precision=function(e){return arguments.length?(b=+e,u=Ne(s,a,90),f=je(r,t,b),h=Ne(c,l,90),d=je(i,n,b),_):b},_.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Ve(t){return t}var qe,He,Ge,Ye,We=r(),Xe=r(),Ze={point:E,lineStart:E,lineEnd:E,polygonStart:function(){Ze.lineStart=Je,Ze.lineEnd=$e},polygonEnd:function(){Ze.lineStart=Ze.lineEnd=Ze.point=E,We.add(p(Xe)),Xe.reset()},result:function(){var t=We/2;return We.reset(),t}};function Je(){Ze.point=Ke}function Ke(t,e){Ze.point=Qe,qe=Ge=t,He=Ye=e}function Qe(t,e){Xe.add(Ye*t-Ge*e),Ge=t,Ye=e}function $e(){Qe(qe,He)}var tr=1/0,er=tr,rr=-tr,nr=rr,ir={point:function(t,e){trr&&(rr=t);enr&&(nr=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E,result:function(){var t=[[tr,er],[rr,nr]];return rr=nr=-(er=tr=1/0),t}};var ar,or,sr,lr,cr=0,ur=0,fr=0,hr=0,pr=0,dr=0,gr=0,mr=0,vr=0,yr={point:xr,lineStart:br,lineEnd:Tr,polygonStart:function(){yr.lineStart=kr,yr.lineEnd=Ar},polygonEnd:function(){yr.point=xr,yr.lineStart=br,yr.lineEnd=Tr},result:function(){var t=vr?[gr/vr,mr/vr]:dr?[hr/dr,pr/dr]:fr?[cr/fr,ur/fr]:[NaN,NaN];return cr=ur=fr=hr=pr=dr=gr=mr=vr=0,t}};function xr(t,e){cr+=t,ur+=e,++fr}function br(){yr.point=_r}function _r(t,e){yr.point=wr,xr(sr=t,lr=e)}function wr(t,e){var r=t-sr,n=e-lr,i=T(r*r+n*n);hr+=i*(sr+t)/2,pr+=i*(lr+e)/2,dr+=i,xr(sr=t,lr=e)}function Tr(){yr.point=xr}function kr(){yr.point=Mr}function Ar(){Sr(ar,or)}function Mr(t,e){yr.point=Sr,xr(ar=sr=t,or=lr=e)}function Sr(t,e){var r=t-sr,n=e-lr,i=T(r*r+n*n);hr+=i*(sr+t)/2,pr+=i*(lr+e)/2,dr+=i,gr+=(i=lr*t-sr*e)*(sr+t),mr+=i*(lr+e),vr+=3*i,xr(sr=t,lr=e)}function Er(t){this._context=t}Er.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,u)}},result:E};var Lr,Cr,Pr,Ir,Or,zr=r(),Dr={point:E,lineStart:function(){Dr.point=Rr},lineEnd:function(){Lr&&Fr(Cr,Pr),Dr.point=E},polygonStart:function(){Lr=!0},polygonEnd:function(){Lr=null},result:function(){var t=+zr;return zr.reset(),t}};function Rr(t,e){Dr.point=Fr,Cr=Ir=t,Pr=Or=e}function Fr(t,e){Ir-=t,Or-=e,zr.add(T(Ir*Ir+Or*Or)),Ir=t,Or=e}function Br(){this._string=[]}function Nr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function jr(t){return function(e){var r=new Ur;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Ur(){}function Vr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),z(r,t.stream(ir)),e(ir.result()),null!=n&&t.clipExtent(n),t}function qr(t,e,r){return Vr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function Hr(t,e,r){return qr(t,[[0,0],e],r)}function Gr(t,e,r){return Vr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Yr(t,e,r){return Vr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Br.prototype={_radius:4.5,_circle:Nr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Nr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ur.prototype={constructor:Ur,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Wr=m(30*h);function Xr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,f,h,d,m,v,y,x){var b=u-n,_=f-i,w=b*b+_*_;if(w>4*e&&y--){var k=s+d,A=l+m,S=c+v,E=T(k*k+A*A+S*S),L=M(S/=E),C=p(p(S)-1)e||p((b*z+_*D)/w-.5)>.3||s*d+l*m+c*v2?t[2]%360*h:0,I()):[y*f,x*f,b*f]},C.angle=function(t){return arguments.length?(_=t%360*h,I()):_*f},C.reflectX=function(t){return arguments.length?(w=t?-1:1,I()):w<0},C.reflectY=function(t){return arguments.length?(k=t?-1:1,I()):k<0},C.precision=function(t){return arguments.length?(o=Xr(s,L=t*t),O()):T(L)},C.fitExtent=function(t,e){return qr(C,t,e)},C.fitSize=function(t,e){return Hr(C,t,e)},C.fitWidth=function(t,e){return Gr(C,t,e)},C.fitHeight=function(t,e){return Yr(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&P,I()}}function tn(t){var e=0,r=s/3,n=$r(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*h,r=t[1]*h):[e*f,r*f]},i}function en(t,e){var r=_(t),n=(r+_(e))/2;if(p(n)0?e<-l+o&&(e=-l+o):e>l-o&&(e=l-o);var r=i/b(fn(e),n);return[r*_(n*t),i-r*m(n*t)]}return a.invert=function(t,e){var r=i-e,a=w(n)*T(t*t+r*r),o=g(t,p(r))*w(r);return r*n<0&&(o-=s*w(t)*w(r)),[o/n,2*d(b(i/a,1/n))-l]},a}function pn(t,e){return[t,e]}function dn(t,e){var r=m(t),n=t===e?_(t):(r-m(e))/(e-t),i=r/n+t;if(p(n)o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Tn.invert=on(M),kn.invert=on((function(t){return 2*d(t)})),An.invert=function(t,e){return[-e,2*d(y(t))-l]},t.geoAlbers=nn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=nn(),l=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function f(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function h(){return t=e=null,f}return f.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},f.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++rDt(n[0],n[1])&&(n[1]=i[1]),Dt(i[0],n[1])>Dt(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Dt(n[1],i[0]))>o&&(o=s,tt=i[0],rt=n[1])}return lt=ct=null,tt===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,et],[rt,nt]]},t.geoCentroid=function(t){ut=ft=ht=pt=dt=gt=mt=vt=yt=xt=bt=0,z(t,Bt);var e=yt,r=xt,n=bt,i=e*e+r*r+n*n;return i<1e-12&&(e=gt,r=mt,n=vt,ft2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=An,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":162}],170:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),f=+t.value&&(u.value=t.value),h=[u];for(null==e&&(e=o);r=h.pop();)if(f&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)h.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;t=r.pop(),e=n.pop();for(;t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function f(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n0&&r*r>n*n+i*i}function g(t,e){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function _(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sh&&(h=s),m=u*u*g,(p=Math.max(h/m,m/f))>d){u-=s;break}d=p}v.push(o={value:u,dice:l1?e:1)},r}(G);var X=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,f=-1,h=o.length,p=t.value;++f1?e:1)},r}(G);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),f=c.x-t(c,u)/2,h=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-f)/(h-f)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=M;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(L(t)).eachAfter(C(n,.5)).eachBefore(P(1)):i.eachBefore(L(E)).eachAfter(C(M,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(P(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=k(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:S(+t),i):n},i},t.packEnclose=f,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&O(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=A(e),r):t},r.parentId=function(t){return arguments.length?(e=A(t),r):e},r},t.tree=function(){var t=B,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new q(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new q(n[i],i)),r.parent=e;return(o.parent=new q(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,f=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>f.depth&&(f=t)}));var h=c===u?1:t(c,u)/2,p=h-c.x,d=e/(u.x+h+p),g=r/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*g}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=j(s),a=N(a),s&&a;)l=N(l),(o=j(o)).a=e,(i=s.z+f-a.z-c+t(s._,a._))>0&&(U(V(s,e,n),e,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=f-u),a&&!N(l)&&(l.t=a,l.m+=c-h,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=W,e=!1,r=1,n=1,i=[0],a=M,o=M,s=M,l=M,c=M;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(f),i=[0],e&&t.eachBefore(I),t}function f(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,f=e.x1-r,h=e.y1-r;f=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}var f=c[e],h=n/2+f,p=e+1,d=r-1;for(;p>>1;c[g]l-a){var y=(i*v+o*m)/n;t(e,p,m,i,a,y,l),t(p,r,v,y,a,o,l)}else{var x=(a*v+l*m)/n;t(e,p,m,i,a,o,x),t(p,r,v,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=O,t.treemapResquarify=X,t.treemapSlice=H,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?H:O)(t,e,r,n,i)},t.treemapSquarify=W,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],171:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-color")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function f(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;na&&(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:y(r,n)})),a=_.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:y(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:y(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:y(t,r)},{i:s-2,x:y(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r1e-6)if(Math.abs(f*l-c*u)>1e-6&&a){var p=n-o,d=i-s,g=l*l+c*c,m=p*p+d*d,v=Math.sqrt(g),y=Math.sqrt(h),x=a*Math.tan((e-Math.acos((g+h-m)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(r+b*f)),this._+="A"+a+","+a+",0,0,"+ +(f*p>u*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r);else;},arc:function(t,i,a,o,s,l){t=+t,i=+i,l=!!l;var c=(a=+a)*Math.cos(o),u=a*Math.sin(o),f=t+c,h=i+u,p=1^l,d=l?o-s:s-o;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+f+","+h:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+f+","+h),a&&(d<0&&(d=d%r+r),d>n?this._+="A"+a+","+a+",0,1,"+p+","+(t-c)+","+(i-u)+"A"+a+","+a+",0,1,"+p+","+(this._x1=f)+","+(this._y1=h):d>1e-6&&(this._+="A"+a+","+a+",0,"+ +(d>=e)+","+p+","+(this._x1=t+a*Math.cos(s))+","+(this._y1=i+a*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],173:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,f,h,p=t._root,d={data:n},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(g+v)/2))?g=a:v=a,(u=r>=(o=(m+y)/2))?m=o:y=o,i=p,!(p=p[f=u<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+v)/2))?g=a:v=a,(u=r>=(o=(m+y)/2))?m=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=p,i[f]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));if(c>f||u>h)return this;for(this.cover(c,u).cover(f,h),n=0;nt||t>=i||n>e||e>=a;)switch(s=(ep||(o=c.y0)>d||(s=c.x1)=y)<<1|t>=v)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-u],g[g.length-1-u]=c)}else{var x=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=x*x+b*b;if(_=(s=(d+m)/2))?d=s:m=s,(u=o>=(l=(g+v)/2))?g=l:v=l,e=p,!(p=p[f=u<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e1?0:t<-1?u:Math.acos(t)}function d(t){return t>=1?f:t<=-1?-f:Math.asin(t)}function g(t){return t.innerRadius}function m(t){return t.outerRadius}function v(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,u=o-i,f=s-a,h=f*l-u*c;if(!(h*h<1e-12))return[t+(h=(u*(e-a)-f*(t-i))/h)*l,e+h*c]}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,f=(s?a:-a)/c(l*l+u*u),h=f*u,p=-f*l,d=t+h,g=e+p,m=r+h,v=n+p,y=(d+m)/2,x=(g+v)/2,b=m-d,_=v-g,w=b*b+_*_,T=i-a,k=d*v-m*g,A=(_<0?-1:1)*c(o(0,T*T*w-k*k)),M=(k*_-b*A)/w,S=(-k*b-_*A)/w,E=(k*_+b*A)/w,L=(-k*b+_*A)/w,C=M-y,P=S-x,I=E-y,O=L-x;return C*C+P*P>I*I+O*O&&(M=E,S=L),{cx:M,cy:S,x01:-h,y01:-p,x11:M*(i/T-1),y11:S*(i/T-1)}}function w(t){this._context=t}function T(t){return new w(t)}function k(t){return t[0]}function A(t){return t[1]}function M(){var t=k,n=A,i=r(!0),a=null,o=T,s=null;function l(r){var l,c,u,f=r.length,h=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=f;++l)!(l=f;--h)c.point(v[h],y[h]);c.lineEnd(),c.areaEnd()}m&&(v[u]=+t(p,u,r),y[u]=+i(p,u,r),c.point(n?+n(p,u,r):v[u],a?+a(p,u,r):y[u]))}if(d)return c=null,d+""||null}function f(){return M().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return f().x(t).y(i)},u.lineY1=function(){return f().x(t).y(a)},u.lineX1=function(){return f().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function E(t,e){return et?1:e>=t?0:NaN}function L(t){return t}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var C=I(T);function P(t){this._curve=t}function I(t){function e(e){return new P(t(e))}return e._curve=t,e}function O(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function z(){return O(M().curve(C))}function D(){var t=S().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return O(r())},delete t.lineX0,t.lineEndAngle=function(){return O(n())},delete t.lineX1,t.lineInnerRadius=function(){return O(i())},delete t.lineY0,t.lineOuterRadius=function(){return O(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function R(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var F=Array.prototype.slice;function B(t){return t.source}function N(t){return t.target}function j(t){var n=B,i=N,a=k,o=A,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function V(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function q(t,e,r,n,i){var a=R(e,r),o=R(e,r=(r+i)/2),s=R(n,r),l=R(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var H={draw:function(t,e){var r=Math.sqrt(e/u);t.moveTo(r,0),t.arc(0,0,r,0,h)}},G={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Y=Math.sqrt(1/3),W=2*Y,X={draw:function(t,e){var r=Math.sqrt(e/W),n=r*Y;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Z=Math.sin(u/10)/Math.sin(7*u/10),J=Math.sin(h/10)*Z,K=-Math.cos(h/10)*Z,Q={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=J*r,i=K*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=h*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},tt=Math.sqrt(3),et={draw:function(t,e){var r=-Math.sqrt(e/(3*tt));t.moveTo(0,2*r),t.lineTo(-tt*r,-r),t.lineTo(tt*r,-r),t.closePath()}},rt=-.5,nt=Math.sqrt(3)/2,it=1/Math.sqrt(12),at=3*(it/2+1),ot={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,i=r*it,a=n,o=r*it+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(rt*n-nt*i,nt*n+rt*i),t.lineTo(rt*a-nt*o,nt*a+rt*o),t.lineTo(rt*s-nt*l,nt*s+rt*l),t.lineTo(rt*n+nt*i,rt*i-nt*n),t.lineTo(rt*a+nt*o,rt*o-nt*a),t.lineTo(rt*s+nt*l,rt*l-nt*s),t.closePath()}},st=[H,G,X,$,Q,et,ot];function lt(){}function ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ft(t){this._context=t}function ht(t){this._context=t}function pt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function r(t){return 1===e?new ut(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function gt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e){this._context=t,this._k=(1-e)/6}bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new bt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function wt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new Tt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function r(t){return e?new At(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t,e){this._context=t,this._alpha=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Et=function t(e){function r(t){return e?new St(t,e):new bt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Lt(t){this._context=t}function Ct(t){return t<0?-1:1}function Pt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function It(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ot(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Dt(t){this._context=new Rt(t)}function Rt(t){this._context=t}function Ft(t){this._context=t}function Bt(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Vt(t,e){return t[e]}function qt(t){var e=t.map(Ht);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Ht(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function Gt(t){var e=t.map(Yt);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Yt(t){for(var e,r=0,n=-1,i=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=g,o=m,w=r(0),T=null,k=v,A=y,M=x,S=null;function E(){var r,g,m=+t.apply(this,arguments),v=+o.apply(this,arguments),y=k.apply(this,arguments)-f,x=A.apply(this,arguments)-f,E=n(x-y),L=x>y;if(S||(S=r=e.path()),v1e-12)if(E>h-1e-12)S.moveTo(v*a(y),v*l(y)),S.arc(0,0,v,y,x,!L),m>1e-12&&(S.moveTo(m*a(x),m*l(x)),S.arc(0,0,m,x,y,L));else{var C,P,I=y,O=x,z=y,D=x,R=E,F=E,B=M.apply(this,arguments)/2,N=B>1e-12&&(T?+T.apply(this,arguments):c(m*m+v*v)),j=s(n(v-m)/2,+w.apply(this,arguments)),U=j,V=j;if(N>1e-12){var q=d(N/m*l(B)),H=d(N/v*l(B));(R-=2*q)>1e-12?(z+=q*=L?1:-1,D-=q):(R=0,z=D=(y+x)/2),(F-=2*H)>1e-12?(I+=H*=L?1:-1,O-=H):(F=0,I=O=(y+x)/2)}var G=v*a(I),Y=v*l(I),W=m*a(D),X=m*l(D);if(j>1e-12){var Z,J=v*a(O),K=v*l(O),Q=m*a(z),$=m*l(z);if(E1e-12?V>1e-12?(C=_(Q,$,G,Y,v,V,L),P=_(J,K,W,X,v,V,L),S.moveTo(C.cx+C.x01,C.cy+C.y01),V1e-12&&R>1e-12?U>1e-12?(C=_(W,X,J,K,m,-U,L),P=_(G,Y,Q,$,m,-U,L),S.lineTo(C.cx+C.x01,C.cy+C.y01),U0&&(d+=f);for(null!=e?g.sort((function(t,r){return e(m[t],m[r])})):null!=n&&g.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(y-p*b)/d:0;s0?f*c:0)+b,m[l]={data:r[l],index:s,value:f,startAngle:v,endAngle:u,padAngle:x};return m}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=R,t.radialArea=D,t.radialLine=z,t.stack=function(){var t=r([]),e=Ut,n=jt,i=Vt;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:mt,s:vt,S:q,u:H,U:G,V:Y,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:K,"%":gt},Ct={a:function(t){return f[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:mt,s:vt,S:ot,u:st,U:lt,V:ct,w:ut,W:ft,x:null,X:null,y:ht,Y:pt,Z:dt,"%":gt},Pt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return zt(t,a,e,r)},d:A,e:A,f:P,H:S,I:S,j:M,L:C,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:O,s:z,S:L,u:m,U:v,V:y,w:g,W:x,x:function(t,e,r){return zt(t,o,e,r)},X:function(t,e,r){return zt(t,l,e,r)},y:_,Y:b,Z:w,"%":I};function It(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function zt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Lt.x=It(o,Lt),Lt.X=It(l,Lt),Lt.c=It(a,Lt),Ct.x=It(o,Ct),Ct.X=It(l,Ct),Ct.c=It(a,Ct),{format:function(t){var e=It(t+="",Lt);return e.toString=function(){return t},e},parse:function(t){var e=Ot(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Ct);return e.toString=function(){return t},e},utcParse:function(t){var e=Ot(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function O(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function D(t,e){return f(t.getDate(),e,2)}function R(t,e){return f(t.getHours(),e,2)}function F(t,e){return f(t.getHours()%12||12,e,2)}function B(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return N(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function V(t,e){return f(t.getMinutes(),e,2)}function q(t,e){return f(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Y(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function Q(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return f(t.getUTCMonth()+1,e,2)}function at(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function pt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function gt(){return"%"}function mt(t){return+t}function vt(t){return Math.floor(+t/1e3)}function yt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=xt,t.isoParse=bt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":176}],176:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=l.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=u.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),p=h.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=d(0),m=d(1),v=d(2),y=d(3),x=d(4),b=d(5),_=d(6),w=g.range,T=m.range,k=v.range,A=y.range,M=x.range,S=b.range,E=_.range,L=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),C=L.range,P=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));P.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var I=P.range,O=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),z=O.range,D=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=D.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),B=F.range;function N(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=N(0),U=N(1),V=N(2),q=N(3),H=N(4),G=N(5),Y=N(6),W=j.range,X=U.range,Z=V.range,J=q.range,K=H.range,Q=G.range,$=Y.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=p,t.timeFriday=b,t.timeFridays=S,t.timeHour=u,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=l,t.timeMinutes=c,t.timeMonday=m,t.timeMondays=T,t.timeMonth=L,t.timeMonths=C,t.timeSaturday=_,t.timeSaturdays=E,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=M,t.timeTuesday=v,t.timeTuesdays=k,t.timeWednesday=y,t.timeWednesdays=A,t.timeWeek=g,t.timeWeeks=w,t.timeYear=P,t.timeYears=I,t.utcDay=F,t.utcDays=B,t.utcFriday=G,t.utcFridays=Q,t.utcHour=D,t.utcHours=R,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=O,t.utcMinutes=z,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Y,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=H,t.utcThursdays=K,t.utcTuesday=V,t.utcTuesdays=Z,t.utcWednesday=q,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],177:[function(t,e,r){arguments[4][176][0].apply(r,arguments)},{dup:176}],178:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e,r,n=0,i=0,a=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return s||(u(h),s=c.now()+l)}function h(){s=0}function p(){this._call=this._time=this._next=null}function d(t,e,r){var n=new p;return n.restart(t,e,r),n}function g(){f(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function m(){s=(o=c.now())+l,n=i=0;try{g()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,y(a)}(),s=0}}function v(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function y(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(m,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(v,1e3)),n=1,u(m)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?f():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?f():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=f,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=g,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],179:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){h=(b=_[u])[0];b[0]=b[1],b[1]=h}return _}},{"incremental-convex-hull":446,uniq:619}],181:[function(t,e,r){"use strict";e.exports=a;var n=(a.canvas=document.createElement("canvas")).getContext("2d"),i=o([32,126]);function a(t,e){Array.isArray(t)&&(t=t.join(", "));var r,a={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=i),n.font=s+"px "+t;for(var c=0;cs*l){var p=(h-f)/s;a[u]=1e3*p}}return a}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:117}],183:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":71,"normalize-svg-path":485}],184:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],185:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=c=t[1];for(var b=r;bl&&(l=u),p>c&&(c=p);d=0!==(d=Math.max(l-n,c-s))?1/d:0}return o(y,x,r,n,s,d),x}function i(t,e,r,n,i){var a,o;if(i===E(t,e,r,n)>0)for(a=e;a=e;a-=n)o=A(a,t[a],t[a+1],o);return o&&x(o,o.next)&&(M(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||!x(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(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,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,f);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,f?l(t,n,i,f):s(t))e.push(p.i/r),e.push(t.i/r),e.push(g.i/r),M(t),t=g.next,m=g.next;else if((t=g)===m){h?1===h?o(t=c(a(t),e,r),e,r,n,i,f,2):2===h&&u(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&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(y(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,e,r,n),h=d(c,u,e,r,n),p=t.prevZ,g=t.nextZ;p&&p.z>=f&&g&&g.z<=h;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==t.prev&&g!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=h;){if(g!==t.prev&&g!==t.next&&m(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!x(i,o)&&b(i,n,n.next,o)&&T(i,o)&&T(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return a(n)}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&v(l,c)){var u=k(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.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.x&&n.x>=u&&i!==n.x&&m(ar.x||n.x===r.x&&p(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}(t,e)){var r=k(e,t);a(e,e.next),a(r,r.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(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&&r.next.y!==r.y&&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}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||x(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){var i=w(y(t,e,r)),a=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return i!==a&&o!==s||(!(0!==i||!_(t,r,e))||(!(0!==a||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function T(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function k(t,e){var r=new S(t.i,t.x,t.y),n=new S(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 A(t,e,r,n){var i=new S(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 M(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 S(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 E(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],187:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i=e}))}(e);for(var r,i=n(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o=55296&&y<=56319&&(w+=t[++r]),w=T?h.call(T,k,w,g):w,e?(p.value=w,d(m,g,p)):m[g]=w,++g;v=g}if(void 0===v)for(v=o(t.length),e&&(m=new e(v)),r=0;r0?1:-1}},{}],199:[function(t,e,r){"use strict";var n=t("../math/sign"),i=Math.abs,a=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*a(i(t)):t}},{"../math/sign":196}],200:[function(t,e,r){"use strict";var n=t("./to-integer"),i=Math.max;e.exports=function(t){return i(0,n(t))}},{"./to-integer":199}],201:[function(t,e,r){"use strict";var n=t("./valid-callable"),i=t("./valid-value"),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,c){var u,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(c),u=s(r),h&&u.sort("function"==typeof h?a.call(h,r):void 0),"function"!=typeof t&&(t=u[t]),o.call(t,u,(function(t,n){return l.call(r,t)?o.call(c,f,r[t],t,r,n):e}))}}},{"./valid-callable":218,"./valid-value":220}],202:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":203,"./shim":204}],203:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],204:[function(t,e,r){"use strict";var n=t("../keys"),i=t("../valid-value"),a=Math.max;e.exports=function(t,e){var r,o,s,l=a(arguments.length,2);for(t=Object(i(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],224:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},{}],225:[function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;e.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},{}],226:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),c=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?a.call(e,"key+value")?"key+value":a.call(e,"key")?"key":"value":"value",c(this,"__kind__",o("",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":229,d:161,"es5-ext/object/set-prototype-of":215,"es5-ext/string/#/contains":221,"es6-symbol":233}],227:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/valid-callable"),a=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;e.exports=function(t,e){var r,u,f,h,p,d,g,m,v=arguments[2];if(s(t)||n(t)?r="array":a(t)?r="string":t=o(t),i(e),f=function(){h=!0},"array"!==r)if("string"!==r)for(u=t.next();!u.done;){if(l.call(e,v,u.value,f),h)return;u=t.next()}else for(d=t.length,p=0;p=55296&&m<=56319&&(g+=t[++p]),l.call(e,v,g,f),!h);++p);else c.call(t,(function(t){return l.call(e,v,t,f),h}))}},{"./get":228,"es5-ext/function/is-arguments":193,"es5-ext/object/valid-callable":218,"es5-ext/string/is-string":224}],228:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/string/is-string"),a=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new a(t):i(t)?new o(t):new a(t)}},{"./array":226,"./string":231,"./valid-iterable":232,"es5-ext/function/is-arguments":193,"es5-ext/string/is-string":224,"es6-symbol":233}],229:[function(t,e,r){"use strict";var n,i=t("es5-ext/array/#/clear"),a=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),c=t("d/auto-bind"),u=t("es6-symbol"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,a({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,u.iterator,l((function(){return this})))},{d:161,"d/auto-bind":160,"es5-ext/array/#/clear":189,"es5-ext/object/assign":202,"es5-ext/object/valid-callable":218,"es5-ext/object/valid-value":220,"es6-symbol":233}],230:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/is-value"),a=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!i(t)&&(!!s(t)||(!!a(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":193,"es5-ext/object/is-value":209,"es5-ext/string/is-string":224,"es6-symbol":233}],231:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",a("",t.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},{"./":229,d:161,"es5-ext/object/set-prototype-of":215,"es6-symbol":233}],232:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":230}],233:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":234,"./polyfill":239,"ext/global-this":246}],234:[function(t,e,r){"use strict";var n=t("ext/global-this"),i={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!i[typeof e.iterator]&&(!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag])}},{"ext/global-this":246}],235:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],236:[function(t,e,r){"use strict";var n=t("d"),i=Object.create,a=Object.defineProperty,o=Object.prototype,s=i(null);e.exports=function(t){for(var e,r,i=0;s[t+(i||"")];)++i;return s[t+=i||""]=!0,a(o,e="@@"+t,n.gs(null,(function(t){r||(r=!0,a(this,e,n(t)),r=!1)}))),e}},{d:161}],237:[function(t,e,r){"use strict";var n=t("d"),i=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",i&&i.hasInstance||t("hasInstance")),isConcatSpreadable:n("",i&&i.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",i&&i.iterator||t("iterator")),match:n("",i&&i.match||t("match")),replace:n("",i&&i.replace||t("replace")),search:n("",i&&i.search||t("search")),species:n("",i&&i.species||t("species")),split:n("",i&&i.split||t("split")),toPrimitive:n("",i&&i.toPrimitive||t("toPrimitive")),toStringTag:n("",i&&i.toStringTag||t("toStringTag")),unscopables:n("",i&&i.unscopables||t("unscopables"))})}},{d:161,"ext/global-this":246}],238:[function(t,e,r){"use strict";var n=t("d"),i=t("../../../validate-symbol"),a=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return a[e]?a[e]:a[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in i(t),a)if(a[e]===t)return e}))})}},{"../../../validate-symbol":240,d:161}],239:[function(t,e,r){"use strict";var n,i,a,o=t("d"),s=t("./validate-symbol"),l=t("ext/global-this").Symbol,c=t("./lib/private/generate-name"),u=t("./lib/private/setup/standard-symbols"),f=t("./lib/private/setup/symbol-registry"),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"==typeof l)try{String(l()),a=!0}catch(t){}else l=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return a?l(e):(r=h(i.prototype),e=void 0===e?"":String(e),p(r,{__description__:o("",e),__name__:o("",c(e))}))},u(n),f(n),p(i.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),p(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),d(n.prototype,n.toPrimitive,o("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),d(n.prototype,n.toStringTag,o("c","Symbol")),d(i.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),d(i.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":236,"./lib/private/setup/standard-symbols":237,"./lib/private/setup/symbol-registry":238,"./validate-symbol":240,d:161,"ext/global-this":246}],240:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":235}],241:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":242,"./polyfill":244}],242:[function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},{}],243:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],244:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/is-value"),a=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),c=t("d"),u=t("es6-iterator/get"),f=t("es6-iterator/for-of"),h=t("es6-symbol").toStringTag,p=t("./is-native-implemented"),d=Array.isArray,g=Object.defineProperty,m=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=p&&a&&WeakMap!==n?a(new WeakMap,v(this)):this,i(e)&&(d(e)||(e=u(e))),g(t,"__weakMapData__",c("c","$weakMap$"+l())),e?(f(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},p&&(a&&a(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(t){return!!m.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:c((function(t){if(m.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:c((function(t){return m.call(o(t),this.__weakMapData__)})),set:c((function(t,e){return g(o(t),this.__weakMapData__,c("c",e)),this})),toString:c((function(){return"[object WeakMap]"}))}),g(n.prototype,h,c("c","WeakMap"))},{"./is-native-implemented":243,d:161,"es5-ext/object/is-value":209,"es5-ext/object/set-prototype-of":215,"es5-ext/object/valid-object":219,"es5-ext/object/valid-value":220,"es5-ext/string/random-uniq":225,"es6-iterator/for-of":227,"es6-iterator/get":228,"es6-symbol":233}],245:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],246:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":245,"./is-implemented":247}],247:[function(t,e,r){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],248:[function(t,e,r){"use strict";e.exports=function(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]]]}},{}],249:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":458}],250:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:if("number"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),i=t("binary-search-bounds");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(c[h-1],u[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":251,"cubic-hermite":156}],251:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],252:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,a,o,s,l=t[0].length,c=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(c+r));var u=e.length-r;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);for(i=0,o=r;ie[0]-o[0]/2&&(h=o[0]/2,p+=o[1]);return r}},{"css-font/stringify":153}],254:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",c=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return i(n.cache[r],c);var u=e.canvas||n.canvas,f=u.getContext("2d"),h={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,f.font=t;var d={top:0};f.clearRect(0,0,p,p),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var g=a(f.getImageData(0,0,p,p));f.clearRect(0,0,p,p),f.textBaseline="bottom",f.fillText("H",0,p);var m=a(f.getImageData(0,0,p,p));d.lineHeight=d.bottom=p-m+g,f.clearRect(0,0,p,p),f.textBaseline="alphabetic",f.fillText("H",0,p);var v=p-a(f.getImageData(0,0,p,p))-1+g;d.baseline=d.alphabetic=v,f.clearRect(0,0,p,p),f.textBaseline="middle",f.fillText("H",0,.5*p);var y=a(f.getImageData(0,0,p,p));d.median=d.middle=p-y-1+g-.5*p,f.clearRect(0,0,p,p),f.textBaseline="hanging",f.fillText("H",0,.5*p);var x=a(f.getImageData(0,0,p,p));d.hanging=p-x-1+g-.5*p,f.clearRect(0,0,p,p),f.textBaseline="ideographic",f.fillText("H",0,p);var b=a(f.getImageData(0,0,p,p));if(d.ideographic=p-b-1+g,h.upper&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.upper,0,0),d.upper=a(f.getImageData(0,0,p,p)),d.capHeight=d.baseline-d.upper),h.lower&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.lower,0,0),d.lower=a(f.getImageData(0,0,p,p)),d.xHeight=d.baseline-d.lower),h.tittle&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.tittle,0,0),d.tittle=a(f.getImageData(0,0,p,p))),h.ascent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.ascent,0,0),d.ascent=a(f.getImageData(0,0,p,p))),h.descent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.descent,0,0),d.descent=o(f.getImageData(0,0,p,p))),h.overshoot){f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.overshoot,0,0);var _=o(f.getImageData(0,0,p,p));d.overshoot=_-v}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,i(d,c)}function i(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function a(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],255:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};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}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left)if(i=u(t,e,r,n.left))return i;if(i=r(n.key,n.value))return i}if(n.right)return u(t,e,r,n.right)}function f(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=f(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 f(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(1===h._color||1===i._color)break;var p=l[f-2];if(p.left===h)if(h.left===i){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=h.right,h._color=1,h.right=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(g=l[f-3]).left===p?g.left=h:g.right=h;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else{if(!(d=p.right)||0!==d._color){if(h.right=i.left,p._color=0,p.left=i.right,i._color=1,i.left=h,i.right=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(g=l[f-3]).left===p?g.left=i:g.right=i;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else if(h.right===i){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=h.left,h._color=1,h.left=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(g=l[f-3]).right===p?g.right=h:g.left=h;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}else{var d;if(!(d=p.left)||0!==d._color){var g;if(h.left=i.right,p._color=0,p.right=i.left,i._color=1,i.right=h,i.left=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(g=l[f-3]).right===p?g.right=i:g.left=i;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.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.right._count)break;e=e.right}return new h(this,[])},l.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)},l.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)},l.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)},l.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)},l.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,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 p=h.prototype;function d(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 g(t,e){return te?1:0}Object.defineProperty(p,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new h(this.tree,this._stack.slice())},p.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=i(n)).right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=a(0,n));r.right=a(0,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=a(0,n));r.left=a(0,n);continue}var c;n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,"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}),p.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(p,"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}}),p.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]).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])},p.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(p,"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}})},{}],256:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function a(t){if(t<0)return Number("0/0");for(var e=i[0],r=i.length-1;r>0;--r)e+=i[r]/(t+r);var n=t+607/128+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}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(a(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=a},{}],257:[function(t,e,r){e.exports=function(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;o0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var g=[0,0,0],m={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||m;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),f=u.cubeEdges,h=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=f[A],this.lastCubeProps.axis[A]=h[A];var M=p;for(A=0;A<3;++A)d(p[A],A,this.bounds,f,h);e=this.gl;var S,E=g;for(A=0;A<3;++A)this.backgroundEnable[A]?E[A]=h[A]:E[A]=0;this._background.draw(r,n,i,a,E,this.backgroundColor),this._lines.bind(r,n,i,this);for(A=0;A<3;++A){var L=[0,0,0];h[A]>0?L[A]=a[1][A]:L[A]=a[0][A];for(var C=0;C<2;++C){var P=(A+1+C)%3,I=(A+1+(1^C))%3;this.gridEnable[P]&&this._lines.drawGrid(P,I,this.bounds,L,this.gridColor[P],this.gridWidth[P]*this.pixelRatio)}for(C=0;C<2;++C){P=(A+1+C)%3,I=(A+1+(1^C))%3;this.zeroEnable[I]&&Math.min(a[0][I],a[1][I])<=0&&Math.max(a[0][I],a[1][I])>=0&&this._lines.drawZero(P,I,this.bounds,L,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var O=c(v,M[A].primalMinor),z=c(y,M[A].mirrorMinor),D=this.lineTickLength;for(C=0;C<3;++C){var R=k/r[5*C];O[C]*=D[C]*R,z[C]*=D[C]*R}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,O,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var F,B;function N(t){(B=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(A=0;A<3;++A){var U=M[A].primalMinor,V=M[A].mirrorMinor,q=c(x,M[A].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[A]&&(q[C]+=k*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var H=[0,0,0];if(H[A]=1,this.tickEnable[A]){-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,F=1,"auto"===(S=[this.tickAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]),B=[0,0,0],j(A,U,V);for(C=0;C<3;++C)q[C]+=k*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],q,this.tickColor[A],H,B,S)}if(this.labelEnable[A]){F=0,B=[0,0,0],this.labels[A].length>4&&(N(A),F=1),"auto"===(S=[this.labelAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(C=0;C<3;++C)q[C]+=k*U[C]*this.labelPad[C]/r[5*C];q[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],q,this.labelColor[A],[0,0,0],B,S)}}this._text.unbind()},f.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":259,"./lib/cube.js":260,"./lib/lines.js":261,"./lib/text.js":263,"./lib/ticks.js":264}],259:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[c]=d;for(var g=-1;g<=1;g+=2)f[u]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var m=c;c=u,u=m}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.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),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":262,"gl-buffer":267,"gl-vao":361}],260:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],h(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((N=R^1<c[B][0]&&(B=N)}var j=g;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=m,q=w;for(A=0;A<3;++A)V[A]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),u=n(["precision highp 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 i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":339,glslify:265}],263:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var p=new c(t,h,u,f);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(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}var u=c.prototype,f=[0,0];u.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=u.positions,p=u.cells,d=0,g=p.length;d=0;--v){var y=h[m[v]];o.push(f*y[0],-f*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var g=0;g=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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 i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:483,"ndarray-ops":478,"typedarray-pool":617}],268:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,f=1/0,h=-1/0,p=null,d=null,g=[],m=1/0,v=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(m=Math.min(m,_),v=!1):v=!0}v||(p=x,d=b),g.push(b)}var w=[s,c,f],T=[l,u,h];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(m)||(m=1),a.vectorScale=m;var A=t.coneSize||.5;t.absoluteConeSize&&(A=t.absoluteConeSize*k),a.coneScale=A;y=0;for(var M=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"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),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({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 c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,g=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var m=0;m0){var g=this.triShader;g.bind(),g.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,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,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=g(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var f=i(t),p=i(t),m=i(t),v=i(t),y=i(t),x=a(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new h(t,u,s,l,f,p,y,m,v,x,r.traceType||"cone");return b.update(e),b}},{colormap:137,"gl-buffer":267,"gl-mat4/invert":299,"gl-mat4/multiply":301,"gl-shader":339,"gl-texture2d":356,"gl-vao":361,ndarray:483}],270:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:442}],271:[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"}},{}],272:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":271}],273:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(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}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function c(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])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=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=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[n],a=0;a0)(g=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,g),o+=2+f(i,g,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":275,"gl-buffer":267,"gl-vao":361}],274:[function(t,e,r){arguments[4][265][0].apply(r,arguments)},{dup:265}],275:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":339,glslify:274}],276:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var m=!1;"stencil"in n&&(m=!!n.stencil);return new d(t,e,r,h,f,g,m,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(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 d(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 d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==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(v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var g=i.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(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]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var c,u,f,p,d=t.colorLevels||[0],g=t.colorValues||[0,0,0,1],m=d.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=o[0],f=v[2]=r[r.length-1],p=v[3]=o[o.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=o[0]+(o[1]-o[0])/2,f=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=v[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-c),x=1/(p-u),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),k=a.mallocFloat32(2*w),A=a.mallocUint8(2*w),M=a.mallocUint32(w),S=0,E=l?b-1:b,L=l?_-1:_,C=0;C max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{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 i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":339,glslify:282}],281:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(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 o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var g=new v(e,r,o,s,l,d);return g.update(t),g};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),c=t("ndarray"),u=t("./lib/shaders"),f=u.createShader,h=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(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 g(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 m(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(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.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:g(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:g(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],g=t.lineWidth||1,m=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,m=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var T=s;if(s+=d(b,_),m){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,m=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;v+=m[f]}if(Math.abs(v-1)>.001)return null;return[h,s(t,m),m]}},{barycentric:85,"polytope-closest-point/lib/closest_point_2d.js":512}],314:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),c=n(["precision highp 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=n(["precision highp 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}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),p=n(["precision highp 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=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:442}],315:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),g=t("./lib/closest-point"),m=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,_,T,k,A,M,S){this.gl=t,this.pixelRatio=1,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=m,this.edgeUVs=v,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function M(t){var e=n(t,m.vertex,m.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function P(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,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,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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;ai[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t]&&T&&(u[1^t]-=M*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),u[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=M*p*g[t+2],ki[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t+2]&&T&&(u[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),g.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),g.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],g=a[o+2]-f,m=i[o],v=i[o+2]-m;p[o]=2*l/u*g/v,h[o]=2*(s-c)/u*g/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var g=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(g,e[1],g,e[3],p[d],h[d]):o.drawLine(e[0],g,e[2],g,p[d],h[d])}}for(d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":55,"has-passive-events":444,"mouse-change":470,"mouse-event-offset":471,"mouse-wheel":473,"right-now":542}],324:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["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}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":339,glslify:325}],325:[function(t,e,r){arguments[4][265][0].apply(r,arguments)},{dup:265}],326:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("gl-mat4/ortho"),p=t("./lib/shader"),d=t("is-mobile")({tablet:!0,featureDetect:!0});function g(){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 m(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){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new g,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=i(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],L=[],C=[],P=[],I=!0,O=!0,z=new Array(16),D=new Array(16),R={view:null,projection:z,model:D,_ortho:!1},F=(O=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:A,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,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:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,O=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function U(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}N.autoResize&&U();function V(){for(var t=E.length,e=P.length,n=0;n0&&0===C[e-1];)C.pop(),P.pop().dispose()}function q(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}window.addEventListener("resize",U),N.update=function(t){N._stopped||(t=t||{},I=!0,O=!0)},N.add=function(t){N._stopped||(t.axes=A,E.push(t),L.push(-1),I=!0,O=!0,V())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),L.pop(),I=!0,O=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",q),N.mouseListener.enabled=!1,!N.contextLost)){A.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c 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=n(["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=n(["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"])},{glslify:442}],328:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(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}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(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":327,"gl-buffer":267,"gl-shader":339,"typedarray-pool":617}],329:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],p=r[0],d=r[1],g=r[2],m=r[3];(a=c*p+u*d+f*g+h*m)<0&&(a=-a,p=-p,d=-d,g=-g,m=-m);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);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*f+l*g,t[3]=s*h+l*m,t}},{}],330:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],331:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},g={vertex:o,fragment:c,attributes:u},m={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return v(t,f)},r.createOrtho=function(t){return v(t,h)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,g)},r.createPickProject=function(t){return v(t,m)}},{"gl-shader":339,glslify:333}],333:[function(t,e,r){arguments[4][265][0].apply(r,arguments)},{dup:265}],334:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),c=t("./lib/glyphs"),u=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(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 p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t||t>1?1:t}function m(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new d(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),g=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new m(e,r,n,o,f,h,p,d,g,s,c,u);return v.update(t),v};var v=m.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=f.slice(),k=[0,0,0],A=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function L(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||f,u=r.view||f,h=r.projection||f,d=e.axesBounds,g=function(t){for(var e=A,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}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=g,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var v=T,L=0;L<16;++L)v[L]=0;for(L=0;L<4;++L)v[5*L]=1;v[5*m]=0,i[m]<0?v[12+m]=d[0][m]:v[12+m]=d[1][m],s(v,c,v),l.model=v;var C=(m+1)%3,P=(m+2)%3,I=M(x),O=M(b);I[C]=1,O[P]=1;var z=p(0,0,0,S(_,I)),D=p(0,0,0,S(w,O));if(Math.abs(z[1])>Math.abs(D[1])){var R=z;z=D,D=R,R=I,I=O,O=R;var F=C;C=P,P=F}z[0]<0&&(I[C]=-1),D[1]>0&&(O[P]=-1);var B=0,N=0;for(L=0;L<4;++L)B+=Math.pow(c[4*C+L],2),N+=Math.pow(c[4*P+L],2);I[C]/=Math.sqrt(B),O[P]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=O,l.fragClipBounds[0]=E(k,g[0],m,-1e8),l.fragClipBounds[1]=E(k,g[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&L(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var a;a=Array.isArray(t)?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},v.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]},v.update=function(t){if("perspective"in(t=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(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=g(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=g(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else{i=[],a=[];for(n=0;n0){var O=0,z=x,D=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;f[T]=Math.max(f[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(N=I(h,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n0?1-M[0][0]:Y<0?1+M[1][0]:1,W*=W>0?1-M[0][1]:W<0?1+M[1][1]:1],Z=k.cells||[],J=k.positions||[];for(T=0;T0){var v=r*u;o.drawBox(f-v,h-v,p+v,h+v,a),o.drawBox(f-v,d-v,p+v,d+v,a),o.drawBox(f-v,h-v,f+v,d+v,a),o.drawBox(p-v,h-v,p+v,d+v,a)}}}},s.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()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":335,"gl-buffer":267,"gl-shader":339}],338:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(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)}}var c=l.prototype;Object.defineProperty(c,"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){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A=0;)M+=1;_[y]=M}var S=new Array(r.length);function E(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var d;if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,p,i,d,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=["gl","v"],c=[],u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new i("","Unknown uniform data type for "+name+": "+r)}if((a=r.charCodeAt(r.length-1)-48)<2||a>4)throw new i("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new i("","Unrecognized data type for vector "+name+": "+r)}}}function c(e){for(var n=["return function updateProperty(obj){"],i=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+""===i?o+="["+i+"]":o+="."+i,"object"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}("",e),a=0;a4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[u].type);var p}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:351}],351:[function(t,e,r){arguments[4][265][0].apply(r,arguments)},{dup:265}],352:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(h[T],p[T],p[k],p[k],h[k],h[T]),f.push(y,v,v,v,y,y),d.push(g,m,m,m,g,g);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=h;h=p,p=M;var S=y;y=v,v=S;var E=g;g=m,m=E}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(t,r,a,o)})),f=[],h=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||x>p-1)return n.create();var b,_,w,T,k,A,M=a[0][d],S=a[0][v],E=a[1][g],L=a[1][y],C=a[2][m],P=(o-M)/(S-M),I=(c-E)/(L-E),O=(u-C)/(a[2][x]-C);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(O)||(O=.5),r.reversedX&&(d=f-1-d,v=f-1-v),r.reversedY&&(g=h-1-g,y=h-1-y),r.reversedZ&&(m=p-1-m,x=p-1-x),r.filled){case 5:k=m,A=x,w=g*p,T=y*p,b=d*p*h,_=v*p*h;break;case 4:k=m,A=x,b=d*p,_=v*p,w=g*p*f,T=y*p*f;break;case 3:w=g,T=y,k=m*h,A=x*h,b=d*h*p,_=v*h*p;break;case 2:w=g,T=y,b=d*h,_=v*h,k=m*h*f,A=x*h*f;break;case 1:b=d,_=v,k=m*f,A=x*f,w=g*f*p,T=y*f*p;break;default:b=d,_=v,w=g*f,T=y*f,k=m*f*h,A=x*f*h}var z=i[b+w+k],D=i[b+w+A],R=i[b+T+k],F=i[b+T+A],B=i[_+w+k],N=i[_+w+A],j=i[_+T+k],U=i[_+T+A],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,z,B,P),n.lerp(q,D,N,P),n.lerp(H,R,j,P),n.lerp(G,F,U,P);var Y=n.create(),W=n.create();n.lerp(Y,V,H,I),n.lerp(W,q,G,I);var X=n.create();return n.lerp(X,Y,W,O),X}(e,t,p)},g=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},m=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},k=10*n.distance(e[0],e[1])/i,A=k*k,M=1,S=0,E=r.length;E>1&&(M=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lS&&(S=F),D.push(F),m.push({points:P,velocities:I,divergences:D});for(var B=0;B<100*i&&P.lengthA&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,C),O=d(N),n.squaredDistance(z,N)-A>-1e-4*A){P.push(N),z=N,I.push(O);R=g(N,O),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F)}C=N}}var U=o(m,t.colormap,S,M);return f?U.tubeScale=f:(0===S&&(S=1),U.tubeScale=.5*u*M/S),U};var u=t("./lib/shaders"),f=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":350,"gl-cone3d":268,"gl-vec3":380,"gl-vec4":416}],353:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,a,o,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,a,l,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,s,o,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,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":339,glslify:442}],354:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),g=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var m=new M(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,g,s,l,f,h,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||"jet",m.update(v),m};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),g=t("binary-search-bounds"),m=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[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 A(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function M(t,e,r,n,i,a,o,l,c,u,h,p,d,g,m){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=m,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=g,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=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.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.pixelRatio=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}var S=M.prototype;S.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],L={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||E,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=L.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],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var P={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=w.slice(),O=[1,0,0,0,1,0,0,0,1];function z(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-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=O,n.vertexColor=this.vertexColor;var s=I;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=C(n,this);if(u.showSurface){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=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var p=i+u,d=s+h,m=f*(h?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*m;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=g.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.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))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=R(t.contourWidth,Number)),"showContour"in t&&(this.showContour=R(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=R(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));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 i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(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&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(v=0;v<2;++v)if(c.shape[v]!==a[v])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=f(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],g,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;o halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},T.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),T.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=T.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(T.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var i=n.stringify({size:T.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=p(t.size),l=Math.round(s[0]*d(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&i==e.font[r].baseString||(a=!0,e.font[r]=T.fonts[i],e.font[r]))){var c=t.family.join(", "),u=[t.style];t.style!=t.variant&&u.push(t.variant),t.variant!=t.weight&&u.push(t.weight),_&&t.weight!=t.stretch&&u.push(t.stretch),e.font[r]={baseString:i,family:c,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:v(c,{origin:"top",fontSize:T.baseFontSize,fontStyle:u.join(" ")})},T.fonts[i]=e.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h2){for(var w=!t.position[0].length,k=u.mallocFloat(2*this.count),A=0,M=0;A1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],T.normalViewport||(i*=-1),i}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=u.mallocUint8(G);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text="",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.normalViewport=!1,T.maxAtlasSize=1024,T.atlasCanvas=document.createElement("canvas"),T.atlasContext=T.atlasCanvas.getContext("2d",{alpha:!1}),T.baseFontSize=64,T.fonts={},e.exports=T},{"bit-twiddle":104,"color-normalize":131,"css-font":150,"detect-kerning":181,"es6-weak-map":241,"flatten-vertex-data":252,"font-atlas":253,"font-measure":254,"gl-util/context":357,"is-plain-obj":457,"object-assign":487,"parse-rect":492,"parse-unit":494,"pick-by-alias":498,regl:540,"to-px":600,"typedarray-pool":617}],356:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("ndarray-ops"),a=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||c(t);if("number"==typeof arguments[1])return v(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=u(e)?e:e.raw;if(r)return y(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return x(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function u(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}var f=function(t,e){i.muls(t,e,255)};function h(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 p(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}var d=p.prototype;function g(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 m(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 v(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 o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}function y(t,e,r,n,i,a){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new p(t,o,r,n,i,a)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var u,h,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];h=a.malloc(v,r);var x=n(h,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):f(x,e),u=h.subarray(0,v)}var b=m(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||a.free(h),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),d.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},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.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)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,u){var h=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,m=0,v=g(p,u.stride.slice());"float32"===h?d=t.FLOAT:"float64"===h?(d=t.FLOAT,v=!1,h="float32"):"uint8"===h?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,h="uint8");if(2===p.length)m=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])m=t.ALPHA;else if(2===p[2])m=t.LUMINANCE_ALPHA;else if(3===p[2])m=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=t.RGBA}p[2]}m!==t.LUMINANCE&&m!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(m=s);if(m!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,u):i.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:483,"ndarray-ops":478,"typedarray-pool":617}],357:[function(t,e,r){(function(r){(function(){"use strict";var n=t("pick-by-alias");function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function a(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},a(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),i(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),i(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":498}],358:[function(t,e,r){"use strict";e.exports=function(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;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":373,"./fromValues":379,"./normalize":390}],364:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],365:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],366:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],367:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],368:[function(t,e,r){e.exports=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}},{}],369:[function(t,e,r){e.exports=t("./distance")},{"./distance":370}],370:[function(t,e,r){e.exports=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)}},{}],371:[function(t,e,r){e.exports=t("./divide")},{"./divide":372}],372:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],373:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],374:[function(t,e,r){e.exports=1e-6},{}],375:[function(t,e,r){e.exports=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*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":374}],376:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],377:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],378:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],391:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],392:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},{}],393:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},{}],394:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},{}],395:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],396:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],397:[function(t,e,r){e.exports=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}},{}],398:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],399:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":401}],400:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":402}],401:[function(t,e,r){e.exports=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}},{}],402:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],403:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":404}],404:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],405:[function(t,e,r){e.exports=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}},{}],406:[function(t,e,r){e.exports=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}},{}],407:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t}},{}],408:[function(t,e,r){e.exports=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}},{}],409:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],410:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],411:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],412:[function(t,e,r){e.exports=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)}},{}],413:[function(t,e,r){e.exports=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}},{}],414:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],415:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],416:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":408,"./clone":409,"./copy":410,"./create":411,"./distance":412,"./divide":413,"./dot":414,"./fromValues":415,"./inverse":417,"./length":418,"./lerp":419,"./max":420,"./min":421,"./multiply":422,"./negate":423,"./normalize":424,"./random":425,"./scale":426,"./scaleAndAdd":427,"./set":428,"./squaredDistance":429,"./squaredLength":430,"./subtract":431,"./transformMat4":432,"./transformQuat":433}],417:[function(t,e,r){e.exports=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}},{}],418:[function(t,e,r){e.exports=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)}},{}],419:[function(t,e,r){e.exports=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}},{}],420:[function(t,e,r){e.exports=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}},{}],421:[function(t,e,r){e.exports=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}},{}],422:[function(t,e,r){e.exports=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}},{}],423:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],424:[function(t,e,r){e.exports=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;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],425:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":424,"./scale":426}],426:[function(t,e,r){e.exports=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}},{}],427:[function(t,e,r){e.exports=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}},{}],428:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],429:[function(t,e,r){e.exports=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}},{}],430:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],431:[function(t,e,r){e.exports=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}},{}],432:[function(t,e,r){e.exports=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}},{}],433:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t[3]=e[3],t}},{}],434:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return A(r),v+=r.length,(p=p.slice(r.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function O(){return"."===e||/[eE]/.test(e)?(p.push(e),h=5,r=e,u+1):"x"===e&&1===p.length&&"0"===p[0]?(h=11,p.push(e),r=e,u+1):/[^\d]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function z(){return"f"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function D(){if(/[^\d\w_]/.test(e)){var t=p.join("");return h=k[t]?8:T[t]?7:6,A(p.join("")),h=999,u}return p.push(e),r=e,u+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":437,"./lib/builtins-300es":436,"./lib/literals":439,"./lib/literals-300es":438,"./lib/operators":440}],436:[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":437}],437:[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"]},{}],438:[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","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":439}],439:[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","uint","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"]},{}],440:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],441:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":435}],442:[function(t,e,r){arguments[4][265][0].apply(r,arguments)},{dup:265}],443:[function(t,e,r){(function(r){(function(){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":452}],444:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":452}],445:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g}},{}],446:[function(t,e,r){"use strict";e.exports=function(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 o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var f=new a(l,new Array(i+1),!1),h=f.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),g=0;g<=i;++g)g===u&&(d[g]=-1);var m=d[0];d[0]=d[1],d[1]=m;var v=new a(d,new Array(i+1),!0);h[u]=v,p[u]=v}p[i+1]=f;for(u=0;u<=i;++u){d=h[u].vertices;var y=h[u].adjacent;for(g=0;g<=i;++g){var x=d[g];if(x<0)y[g]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[g]=h[b])}}var _=new c(i,o,p),w=!!e;for(u=i+1;u0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var i=new Function("test",e.join("")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var u=c.prototype;u.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()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var p=this.orient();if(a[u]=h,p<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var p=(e=f.pop()).vertices,d=e.adjacent,g=p.indexOf(r);if(!(g<0))for(var m=0;m<=n;++m)if(m!==g){var v=d[m];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,T[g]=v,w[m]=-1,T[m]=e,d[m]=k,k.flip();for(b=0;b<=n;++b){var M=w[b];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,L=0;L<=n;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new o(S,k,b))}}}}}}h.sort(s);for(m=0;m+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":548,"simplicial-complex":559}],447:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],448:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(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}e.exports=function(t){if(!t||0===t.length)return new v(null);return new v(m(t))};var a=i.prototype;function o(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 s(t,e){var r=m(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function h(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=m([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=m([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},a.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":449}],449:[function(t,e,r){arguments[4][251][0].apply(r,arguments)},{dup:251}],450:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');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 TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=i(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(i)return n?-1:D(t).length;e=(""+e).toLowerCase(),i=!0}}function h(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))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(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),N(r=+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:m(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):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},a.prototype.compare=function(t,e,r,n,i){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);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(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),f=0;f>>=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 g(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(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)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(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 P(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||E(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||E(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(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||E(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||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||E(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||E(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||E(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||E(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||E(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(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||L(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||L(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||L(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||L(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);L(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>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);L(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||L(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||L(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||L(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||L(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||L(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 P(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},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),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);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":86,buffer:117,ieee754:437}],118:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),f=!!c(r,"interior",!0),h=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var d=n(t,e);if(u||f!==h||p){for(var m=i(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,f=-1,l=o[s],1);d=0||(e.flip(s,p),i(t,e,r,u,s,f),i(t,e,r,s,f,u),i(t,e,r,f,p,u),i(t,e,r,p,u,f)))}}},{"binary-search-bounds":103,"robust-in-sphere":532}],120:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(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 o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var m=h[3*p+d];m>=0&&0===c[m]&&(f[3*p+d]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);var d=f.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],v=[],y=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;nr?r:t:te?e:t}},{}],127:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var M,A=x[1]=S[1];for(i&&(M=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([A,E,M]):e.push([A,E]),A=E}i?e.push([A,_,M]):e.push([A,_])}return h}(t,e,h,g,r));return v(e,y,r),!!y||(h.length>0||g.length>0)}},{"./lib/rat-seg-intersect":128,"big-rat":90,"big-rat/cmp":88,"big-rat/to-float":102,"box-intersect":108,nextafter:473,"rat-vec":518,"robust-segment-intersect":537,"union-find":602}],128:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var p=s(t,r),d=u(f,p),m=i(d,h),g=c(a,m);return l(t,g)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":89,"big-rat/mul":99,"big-rat/sign":100,"big-rat/sub":101,"rat-vec/add":517,"rat-vec/muls":519,"rat-vec/sub":520}],129:[function(t,e,r){"use strict";var n=t("clamp");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:126}],130:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],131:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(a(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},{clamp:126,"color-rgba":133,dtype:181}],132:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=(p=t.slice(1)).length;c=1,u<=4?(l=[parseInt(p[0]+p[0],16),parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16)],4===u&&(c=parseInt(p[3]+p[3],16)/255)):(l=[parseInt(p[0]+p[1],16),parseInt(p[2]+p[3],16),parseInt(p[4]+p[5],16)],8===u&&(c=parseInt(p[6]+p[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],h="rgb"===f,p=f.replace(/a$/,"");s=p;u="cmyk"===p?4:"gray"===p?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===p?255*parseFloat(t)/100:parseFloat(t);if("h"===p[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===p&&l.push(1),c=h||void 0===l[u]?1:l[u],l=l.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":130,defined:176,"is-plain-obj":447}],133:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:126,"color-parse":132,"color-space/hsl":134}],134:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":135}],135:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],136:[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]}],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:1,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]}]}},{}],137:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,f,h,p,d,m;t||(t={});p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");u=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>p+1)throw new Error(f+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":534,"robust-product":535,"robust-sum":539,signum:541,"two-sum":589}],139:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(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=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],p=t[3],d=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+p-(d+m+g+v)||n(u,f,h,p)-n(d,m,g,v,d)||n(u+f,u+h,u+p,f+h,f+p,h+p)-n(d+m,d+g,d+v,m+g,m+v,g+v)||n(u+f+h,u+f+p,u+h+p,f+h+p)-n(d+m+g,d+m+v,d+g+v,m+g+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],143:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":73,"incremental-convex-hull":438}],145:[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"}},{}],146:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],147:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],148:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],149:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],150:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":152,"./stringify":153}],151:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":146}],152:[function(t,e,r){"use strict";var n=t("unquote"),i=t("css-global-keywords"),a=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),c=t("string-split-by"),u=t("./lib/util").isSize;e.exports=h;var f=h.cache={};function h(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=c(t,/\s+/);e=h.shift();){if(-1!==i.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(u(e)){var d=c(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===h[0]&&(h.shift(),r.lineHeight=p(h.shift())),!h.length)throw new Error("Missing required font-family.");return r.family=c(h.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":151,"css-font-stretch-keywords":147,"css-font-style-keywords":148,"css-font-weight-keywords":149,"css-global-keywords":154,"css-system-font-keywords":155,"string-split-by":574,unquote:604}],153:[function(t,e,r){"use strict";var n=t("pick-by-alias"),i=t("./lib/util").isSize,a=m(t("css-global-keywords")),o=m(t("css-system-font-keywords")),s=m(t("css-font-weight-keywords")),l=m(t("css-font-style-keywords")),c=m(t("css-font-stretch-keywords")),u={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",p="serif";function d(t,e){if(t&&!e[t]&&!a[t])throw Error("Unknown keyword `"+t+"`");return t}function m(t){for(var e={},r=0;r=0;--p)a[p]=c*t[p]+u*e[p]+f*r[p]+h*n[p];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],157:[function(t,e,r){"use strict";var n,i=t("type/value/is"),a=t("type/value/ensure"),o=t("type/plain-function/ensure"),s=t("es5-ext/object/copy"),l=t("es5-ext/object/normalize-options"),c=t("es5-ext/object/map"),u=Function.prototype.bind,f=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,i=a(e)&&o(e.value);return delete(n=s(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?i:(e.value=u.call(i,r.resolveContext?r.resolveContext(this):this),f(this,t,e),this[t])},n},e.exports=function(t){var e=l(arguments[1]);return i(e.resolveContext)&&o(e.resolveContext),c(t,(function(t,r){return n(r,t,e)}))}},{"es5-ext/object/copy":202,"es5-ext/object/map":210,"es5-ext/object/normalize-options":211,"type/plain-function/ensure":595,"type/value/ensure":599,"type/value/is":600}],158:[function(t,e,r){"use strict";var n=t("type/value/is"),i=t("type/plain-function/is"),a=t("es5-ext/object/assign"),o=t("es5-ext/object/normalize-options"),s=t("es5-ext/string/#/contains");(e.exports=function(t,e){var r,i,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],n(t)?(r=s.call(t,"c"),i=s.call(t,"e"),l=s.call(t,"w")):(r=l=!0,i=!1),u={value:e,configurable:r,enumerable:i,writable:l},c?a(o(c),u):u}).gs=function(t,e,r){var l,c,u,f;return"string"!=typeof t?(u=r,r=e,e=t,t=null):u=arguments[3],n(e)?i(e)?n(r)?i(r)||(u=r,r=void 0):r=void 0:(u=e,e=r=void 0):e=void 0,n(t)?(l=s.call(t,"c"),c=s.call(t,"e")):(l=!0,c=!1),f={get:e,set:r,configurable:l,enumerable:c},u?a(o(u),f):f}},{"es5-ext/object/assign":199,"es5-ext/object/normalize-options":211,"es5-ext/string/#/contains":218,"type/plain-function/is":596,"type/value/is":600}],159:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return te?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=v?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=v?10:a>=y?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=v?i*=10:a>=y?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function k(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function M(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,A),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;af;)h.pop(),--p;var d,m=new Array(p+1);for(a=0;a<=p;++a)(d=m[a]=[]).x0=a>0?h[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,f,h=-1,p=n.length,d=l[i++],m=r(),g=a();++hl.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each((function(e,r){i.push({key:r,values:t(e,n)})}))),null!=a?i.sort((function(t,e){return a(t.key,e.key)})):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],161:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),c=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),u=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),f=new RegExp("^rgba\\("+[o,o,o,a]+"\\)$"),h=new RegExp("^hsl\\("+[a,o,o]+"\\)$"),p=new RegExp("^hsla\\("+[a,o,o,a]+"\\)$"),d={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};function m(){return this.rgb().formatHex()}function g(){return this.rgb().formatRgb()}function v(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?y(e):3===r?new w(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=l.exec(t))?new w(e[1],e[2],e[3],1):(e=c.exec(t))?new w(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=u.exec(t))?x(e[1],e[2],e[3],e[4]):(e=f.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=h.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=p.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):d.hasOwnProperty(t)?y(d[t]):"transparent"===t?new w(NaN,NaN,NaN,0):null}function y(t){return new w(t>>16&255,t>>8&255,255&t,1)}function x(t,e,r,n){return n<=0&&(t=e=r=NaN),new w(t,e,r,n)}function b(t){return t instanceof n||(t=v(t)),t?new w((t=t.rgb()).r,t.g,t.b,t.opacity):new w}function _(t,e,r,n){return 1===arguments.length?b(t):new w(t,e,r,null==n?1:n)}function w(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function T(){return"#"+M(this.r)+M(this.g)+M(this.b)}function k(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function M(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function A(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new L(t,e,r,n)}function S(t){if(t instanceof L)return new L(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=v(t)),!t)return new L;if(t instanceof L)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&c<1?0:s,new L(s,l,c,t.opacity)}function E(t,e,r,n){return 1===arguments.length?S(t):new L(t,e,r,null==n?1:n)}function L(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function C(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,v,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:m,formatHex:m,formatHsl:function(){return S(this).formatHsl()},formatRgb:g,toString:g}),e(w,_,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new w(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:T,formatHex:T,formatRgb:k,toString:k})),e(L,E,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new L(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new L(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new w(C(t>=240?t-240:t+120,i,n),C(t,i,n),C(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var P=Math.PI/180,I=180/Math.PI,O=6/29,z=3*O*O;function D(t){if(t instanceof F)return new F(t.l,t.a,t.b,t.opacity);if(t instanceof q)return G(t);t instanceof w||(t=b(t));var e,r,n=U(t.r),i=U(t.g),a=U(t.b),o=B((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=o:(e=B((.4360747*n+.3850649*i+.1430804*a)/.96422),r=B((.0139322*n+.0971045*i+.7141733*a)/.82521)),new F(116*o-16,500*(e-o),200*(o-r),t.opacity)}function R(t,e,r,n){return 1===arguments.length?D(t):new F(t,e,r,null==n?1:n)}function F(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function B(t){return t>.008856451679035631?Math.pow(t,1/3):t/z+4/29}function N(t){return t>O?t*t*t:z*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function U(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function V(t){if(t instanceof q)return new q(t.h,t.c,t.l,t.opacity);if(t instanceof F||(t=D(t)),0===t.a&&0===t.b)return new q(NaN,0=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function a(t,e){for(var r,n=0,i=t.length;n0)for(var r,n,i=new Array(r),a=0;ah+c||np+c||au.index){var f=h-s.x-s.vx,g=p-s.y-s.vy,v=f*f+g*g;vt.r&&(t.r=t[e].r)}function h(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===f&&(d+=(f=o())*f),0===h&&(d+=(h=o())*h),d1?(null==r?u.remove(t):u.set(t,v(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(h.on(t,r),e):h.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,f=Array.prototype.map,h=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e,i,o=void 0===t.grouping||void 0===t.thousands?c:(e=f.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var n=t.length,a=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",p=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",v=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=a(t)).fill,r=t.align,i=t.sign,c=t.symbol,f=t.zero,y=t.width,x=t.comma,b=t.precision,_=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===b&&(b=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?m:"",M=l[w],A=/[defgprs%]/.test(w);function S(t){var a,s,l,c=T,u=k;if("c"===w)u=M(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?v:M(Math.abs(t),b),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?h[8+n/3]:"")+u+(m&&"("===i?")":""),A)for(a=-1,s=t.length;++a(l=t.charCodeAt(a))||l>57){u=(46===l?p+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}x&&!f&&(t=o(t,1/0));var S=c.length+t.length+u.length,E=S>1)+c+t+u+E.slice(S);break;default:t=E+c+t+u}return d(t)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),S.toString=function(){return t+""},S}return{format:y,formatPrefix:function(t,e){var n=y(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=h[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],165:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-geo"),t("d3-array")):i(n.d3=n.d3||{},n.d3,n.d3)}(this,(function(t,e,r){"use strict";var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,f=Math.min,h=Math.pow,p=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,v=1e-6,y=Math.PI,x=y/2,b=y/4,_=Math.SQRT1_2,w=L(2),T=L(y),k=2*y,M=180/y,A=y/180;function S(t){return t>1?x:t<-1?-x:Math.asin(t)}function E(t){return t>1?0:t<-1?y:Math.acos(t)}function L(t){return t>0?Math.sqrt(t):0}function C(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function I(t){var e=g(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=L(e*e+i*i),u=-t/2,f=50;if(!l)return[0,0];do{var h=u/2,p=o(h),d=m(h),g=d/p,y=-c(n(p));u-=s=(2/g*y-r*g-l)/(-y/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>v&&--f>0);var x=m(u);return[a(e*x,l*o(u)),S(i*x/l)]},i}function O(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(E(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function z(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,f=0,h=50;do{var p=o(u),d=m(u),g=o(f),y=m(f),x=1+g,b=x*d-t,_=l+y*r-x*e*p-c,w=x*p/2,T=-d*y,k=e*x*d/2,M=r*g+e*p*y,A=T*k-M*w,S=(_*T-b*M)/A/2,E=(b*k-_*w)/A;n(E)>2&&(E/=2),u-=S,f-=E}while((n(S)>v||n(E)>v)&&--h>0);return i*f>-a(o(u),s)-.001?[2*u,f]:null},c}function D(t,e){var r=g(e/2),n=L(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}O.invert=function(t,e){if(!(t*t+4*e*e>y*y+v)){var r=t,i=e,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),f=m(i),h=o(i),p=m(2*i),d=f*f,g=h*h,x=c*c,b=1-g*u*u,_=b?E(h*u)*L(s=1/b):s=0,w=2*_*h*c-t,T=_*f-e,k=s*(g*x+_*h*u*d),M=s*(.5*l*p-2*_*f*c),A=.25*s*(p*c-_*f*g*l),S=s*(d*u+_*x*h),C=M*A-S*k;if(!C)break;var P=(T*M-w*S)/C,I=(w*A-T*k)/C;r-=P,i-=I}while((n(P)>v||n(I)>v)&&--a>0);return[r,i]}},D.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=L((r-L(r*r-4*e*e))/2),s=S(i)/3,l=i?function(t){return c(t+L(t*t-1))}(n(e/i))/3:function(t){return c(t+L(t*t+1))}(n(t))/3,u=o(s),f=P(l),h=f*f-u*u;return[2*d(t)*a(C(l)*u,.25-h),2*d(e)*a(f*m(s),.25+h)]};var R=L(8),F=c(1+w);function B(t,e){var r=n(e);return rx){var l=a(s[1],s[0]),c=L(s[0]*s[0]+s[1]*s[1]),u=r*p((l-x)/r)+x,f=a(m(l-=u),2-o(l));l=u+S(y/c*m(f))-f,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=L(t*t+n*n);if(s>x){var l=a(n,t),c=r*p((l-x)/r)+x,u=l>c?-1:1,f=s*o(c-l),h=1/g(u*E((f-y)/L(y*(y-2*f)+s*s)));l=c+2*i((h+u*L(h*h-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function j(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return U;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function U(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function V(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+v))&&(o=a+v),r-=i=-1*v*(a-e)/(a-o)}while(s-- >0&&n(i)>v);return s<0?NaN:r}function H(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=1e-12),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var f=0;fl)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,v=(s>0?-1:1)*r,y=t(o+g,s),x=t(o,s+v),b=(y[0]-h[0])/g,_=(y[1]-h[1])/g,w=(x[0]-h[0])/v,T=(x[1]-h[1])/v,k=T*b-_*w,M=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-p*T)*M,s+=u=(p*_-d*b)*M,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=H(e),e}function G(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>v&&--a>0);return e/2}function Y(t,e,r){function n(n,i){return[t*n*o(i=G(r,i)),e*m(i)]}return n.invert=function(n,i){return i=S(i/e),[n/(t*o(i)),S((2*i+m(2*i))/r)]},n}B.invert=function(t,e){if((a=n(e))1e-12&&--u>0);return[t/(o(l)*(R-1/m(l))),d(e)*l]},U.invert=function(t,e){var r=2*S(e/2);return[t*o(r/2)/o(r),r]};var W=Y(w/x,w,y);var X=2.00276,Z=1.11072;function J(t,e){var r=G(y,e);return[X*t/(1/o(e)+Z/o(r)),(e+w*m(r))/X]}function K(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*A):r*M},i}function Q(t,e){return[t*o(e),e]}function $(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i?r*o(n)/i:i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=L(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function tt(t){function e(e,r){var n=x-r,i=n?e*t*m(n)/n:n;return[n*m(i)/t,x-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=x-r,o=L(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,x-o]},e}J.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-w*m(s),s-=r=(m(2*s)+2*s-y*m(i))/(2*o(2*s)+2+y*o(i)*w*o(s))}while(n(r)>v&&--l>0);return i=a-w*m(s),[t*(1/o(i)+Z/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var et=Y(1,4/y,y);function rt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=E(r*s+e*i*u);else{var f=m(t/2),h=m(l/2);c=2*S(L(f*f+e*i*h*h))}return n(c)>v?[c,a(i*m(l),e*s-r*i*u)]:[0,0]}function nt(t,e,r){return E((t*t+e*e-r*r)/(2*t*e))}function it(t){return t-2*y*l((t+y)/(2*y))}function at(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=rt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=nt(i[0].v[0],i[2].v[0],i[1].v[0]),c=nt(i[0].v[0],i[1].v[0],i[2].v[0]),u=y-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var f=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=rt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=it(s[r][1]-l.v[1])}var h=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=nt(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,h[0]-=s[r][0]*o(d),h[1]-=s[r][0]*m(d)):(d=u-d,h[0]+=s[r][0]*o(d),h[1]+=s[r][0]*m(d)):(h[0]+=s[r][0]*o(d),h[1]-=s[r][0]*m(d))}return h[0]/=3,h[1]/=3,h}}function ot(t){return t[0]*=A,t[1]*=A,t}function st(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=at(ot(o(t)),ot(o(r)),ot(o(n)));s.invert=H(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function lt(t,e){var r=L(1-m(e));return[2/T*t*r,T*(1-r)]}function ct(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(L(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,S(t?e*g(t)/t:e)]},r}lt.invert=function(t,e){var r=(r=e/T-1)*r;return[r>0?t*L(y/r)/2:0,S(1-r)]};var ut=L(3);function ft(t,e){return[ut*t*(2*o(2*e/3)-1)/T,ut*T*m(e/3)]}function ht(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,S(r*e)]},r}function pt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function dt(t,e){var r=L(8/(3*y));return[r*t*(1-n(e)/y),r*e]}function mt(t,e){var r=L(4-3*m(n(e)));return[2/L(6*y)*t*r,d(e)*L(2*y/3)*(2-r)]}function gt(t,e){var r=L(y*(4+y));return[2/r*t*(1+L(1-4*e*e/(y*y))),4/r*e]}function vt(t,e){var r=(2+x)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>v;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/L(y*(4+y))*t*(1+o(e)),2*L(y/(4+y))*m(e)]}function yt(t,e){return[t*(1+o(e))/L(2+y),2*e/L(2+y)]}function xt(t,e){for(var r=(1+x)*m(e),i=0,a=1/0;i<10&&n(a)>v;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=L(2+y),[t*(1+o(e))/r,2*e/r]}ft.invert=function(t,e){var r=3*S(e/(ut*T));return[T*t/(ut*(2*o(2*r/3)-1)),r]},dt.invert=function(t,e){var r=L(8/(3*y)),i=e/r;return[t/(r*(1-n(i)/y)),i]},mt.invert=function(t,e){var r=2-n(e)/L(2*y/3);return[t*L(6*y)/(2*r),d(e)*S((4-r*r)/3)]},gt.invert=function(t,e){var r=L(y*(4+y))/2;return[t*r/(1+L(1-e*e*(4+y)/(4*y))),e*r/2]},vt.invert=function(t,e){var r=e*L((4+y)/y)/2,n=S(r),i=o(n);return[t/(2/L(y*(4+y))*(1+i)),S((n+r*(i+2))/(2+x))]},yt.invert=function(t,e){var r=L(2+y),n=e*r/2;return[r*t/(1+o(n)),n]},xt.invert=function(t,e){var r=1+x,n=L(r/2);return[2*t*n/(1+o(e*=n)),S((e+m(e))/r)]};var bt=3+2*w;function _t(t,e){var r=m(t/=2),n=o(t),a=L(o(e)),s=o(e/=2),l=m(e)/(s+w*n*a),u=L(2/(1+l*l)),f=L((w*s+(n+r)*a)/(w*s+(n-r)*a));return[bt*(u*(f-1/f)-2*c(f)),bt*(u*l*(f+1/f)-2*i(l))]}_t.invert=function(t,e){if(!(r=D.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var h=a/2,p=s/2,d=m(h),g=o(h),y=m(p),b=o(p),T=o(s),k=L(T),M=y/(b+w*g*k),A=M*M,S=L(2/(1+A)),E=(w*b+(g+d)*k)/(w*b+(g-d)*k),C=L(E),P=C-1/C,I=C+1/C,O=S*P-2*c(C)-t,z=S*M*I-2*i(M)-e,R=y&&_*k*d*A/y,F=(w*g*b+k)/(2*(b+w*g*k)*(b+w*g*k)*k),B=-.5*M*S*S*S,N=B*R,j=B*F,U=(U=2*b+w*k*(g-d))*U*C,V=(w*g*b*k+T)/U,H=-w*d*y/(k*U),q=P*N-2*V/C+S*(V+V/E),G=P*j-2*H/C+S*(H+H/E),Y=M*I*N-2*R/(1+A)+S*I*R+S*M*(V-V/E),W=M*I*j-2*F/(1+A)+S*I*F+S*M*(H-H/E),X=G*Y-W*q;if(!X)break;var Z=(z*G-O*W)/X,J=(O*Y-z*q)/X;a-=Z,s=u(-x,f(x,s-J))}while((n(Z)>v||n(J)>v)&&--l>0);return n(n(s)-x)s){var d=L(h),g=a(f,u),b=i*p(g/i),_=g-b,w=t*o(_),T=(t*m(_)-_*m(w))/(x-w),k=Lt(_,T),M=(y-t)/Ct(k,w,y);u=d;var A,S=50;do{u-=A=(t+Ct(k,w,u)*M-d)/(k(u)*M)}while(n(A)>v&&--S>0);f=_*m(u),us){var u=L(c),f=a(l,r),h=i*p(f/i),d=f-h;r=u*o(d),l=u*m(d);for(var g=r-x,v=m(r),b=l/v,_=rv||n(p)>v)&&--x>0);return[d,g]},u}Tt.invert=function(t,e){var r=e/(1+wt);return[t&&t/(wt*L(1-r*r)),2*i(r)]},kt.invert=function(t,e){var r=i(e/T),n=o(r),a=2*r;return[t*T/2/(o(a)*n*n),a]};var It=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var Ot=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var zt=Pt(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Dt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Dt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>v&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>v&&--o>0);return[i,a]};var Rt=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Ft(t){var e=t(x,0)[0]-t(-x,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*y,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*y;return o<-y?o+=2*y:o>y&&(o-=2*y),a[0]=o,a}),r}function Bt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),e=S(l),n(t-x)>v&&(t%=x);var f=function(t,e){if(e===x)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,c=1+l,u=1+3*l,f=1-l,h=S(1/L(c)),p=f+s*c*h,d=(1-a)/p,g=L(d),b=d*c,_=L(b),w=g*f;if(0===t)return[0,-(w+s*_)];var T,k=o(e),M=1/k,A=2*a*k,E=(-p*k-(-3*s+h*u)*A*(1-a))/(p*p),C=-M*A,P=-M*(s*c*E+d*u*A),I=-2*M*(f*(.5*E/g)-2*s*g*A),O=4*t/y;if(t>.222*y||e.175*y){if(r=(w+s*L(b*(1+l)-w*w))/(1+l),t>y/4)return[r,r];var z=r,D=.5*r;r=.5*(D+z),i=50;do{var R=L(b-r*r),F=r*(I+C*R)+P*S(r/_)-O;if(!F)break;F<0?D=r:z=r,r=.5*(D+z)}while(n(z-D)>v&&--i>0)}else{r=v,i=25;do{var B=r*r,N=L(b-B),j=I+C*N,U=r*j+P*S(r/_)-O,V=j+(P-C*B)/N;r-=T=N?U/V:0}while(n(T)>v&&--i>0)}return[r,-w-s*L(b-r*r)]}(t>y/4?x-t:t,e);return t>y/4&&(u=f[0],f[0]=-f[1],f[1]=-u),f[0]*=r,f[1]*=-i,f}function Nt(t,e){var r,a,l,c,u,f;if(e=1-v)return r=(1-e)/4,l=1/(a=P(t)),[(c=((f=s(2*(f=t)))-1)/(f+1))+r*((u=a*C(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-x+r*(u-t)/a];var h=[1,0,0,0,0,0,0,0,0],p=[L(e),0,0,0,0,0,0,0,0],d=0;for(a=L(1-e),u=1;n(p[d]/h[d])>v&&d<8;)r=h[d++],p[d]=(r-a)/2,h[d]=(r+a)/2,a=L(r*a),u*=2;l=u*h[d]*t;do{l=(S(c=p[d]*m(a=l)/h[d])+l)/2}while(--d);return[m(l),c=o(l),c/o(l-a),l]}function jt(t,e){if(!e)return t;if(1===e)return c(g(t/2+b));for(var r=1,a=L(1-e),o=L(e),s=0;n(o)>v;s++){if(t%y){var l=i(a*g(t)/r);l<0&&(l+=y),t+=l+~~(t/y)*y}else t+=t;o=(r+a)/2,a=L(r*a),o=((r=o)-a)/2}return t/(h(2,s)*r)}function Ut(t,e){var r=(w-1)/(w+1),l=L(1-r*r),u=jt(x,l*l),f=c(g(y/4+n(e)/2)),h=s(-1*f)/L(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?x:-x)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(h*o(-1*t),h*m(-1*t)),v=function(t,e,r){var a=n(t),o=C(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+L(c*c-4*((r-1)*l)))/2;return[jt(i(1/L(u)),r)*d(t),jt(i(L((u/l-1)/r)),1-r)*d(e)]}return[0,jt(i(o),1-r)*d(e)]}(p[0],p[1],l*l);return[-v[1],(e>=0?1:-1)*(.5*u-v[0])]}function Vt(t){var e=m(t),r=o(t),i=Ht(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),c=o(a),u=o(t),f=E(e*l+r*c*u),h=m(f),p=n(h)>v?f/h:1;return[p*r*m(t),(n(t)>x?p:-p)*(e*c-r*l*u)]}return i.invert=Ht(-t),s.invert=function(t,r){var n=L(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,f=n*e,h=L(c*c+u*u-f*f),p=a(c*f+u*h,u*f-c*h),d=(n>x?-1:1)*a(t*s,n*o(p)*l+r*m(p)*s);return i.invert(d,p)},s}function Ht(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,c=m(n);return[a(l,s*r-c*e),S(c*r+s*e)]}}Bt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){var r=0,i=1,a=.5,s=50;for(;;){var l=a*a,c=L(a),u=S(1/L(1+l)),f=1-l+a*(1+l)*u,h=(1-c)/f,p=L(h),d=h*(1+l),m=p*(1-l),g=L(d-t*t),v=e+m+a*g;if(n(i-r)<1e-12||0==--s||0===v)break;v>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var x=S(c),b=o(x),_=1/b,w=2*c*b,T=(-f*b-(-3*a+u*(1+3*l))*w*(1-c))/(f*f);return[y/4*(t*(-2*_*(.5*T/p*(1-l)-2*a*p*w)+-_*w*g)+-_*(a*(1+l)*T+h*(1+3*l)*w)*S(t/L(d))),x]}(c?l:s,c?s:l),f=u[0],h=u[1],p=o(h);return c&&(f=-x-f),[r*(a(m(f)*p,-m(h))+y),i*S(o(f)*p)]},Ut.invert=function(t,e){var r,n,o,l,u,f,h=(w-1)/(w+1),p=L(1-h*h),d=jt(x,p*p),m=(n=-t,o=p*p,(r=.5*d-e)?(l=Nt(r,o),n?(f=(u=Nt(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/f,l[1]*l[2]*u[0]*u[1]/f],[l[1]*u[1]/f,-l[0]*l[2]*u[0]*u[2]/f],[l[2]*u[1]*u[2]/f,-o*l[0]*l[1]*u[0]/f]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=Nt(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),g=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(m[0],m[1]);return[a(g[1],g[0])/-1,2*i(s(-.5*c(h*g[0]*g[0]+h*g[1]*g[1])))-x]};var qt=S(1-1/3)*M,Gt=ht(0);function Yt(t){var e=qt*A,r=lt(y,e)[0]-lt(-y,e)[0],i=Gt(0,e)[1],a=lt(0,e)[1],o=T-a,s=k/t,c=4/k,h=i+o*o*4/k;function p(p,d){var m,g=n(d);if(g>e){var v=f(t-1,u(0,l((p+y)/s)));(m=lt(p+=y*(t-1)/t-v*s,g))[0]=m[0]*k/r-k*(t-1)/(2*t)+v*k/t,m[1]=i+4*(m[1]-a)*o/k,d<0&&(m[1]=-m[1])}else m=Gt(p,d);return m[0]*=c,m[1]/=h,m}return p.invert=function(e,p){e/=c;var d=n(p*=h);if(d>i){var m=f(t-1,u(0,l((e+y)/s)));e=(e+y*(t-1)/t-m*s)*r/k;var g=lt.invert(e,.25*(d-i)*k/o+a);return g[0]-=y*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Gt.invert(e,p)},p}function Wt(t,e){return[t,1&e?90-v:qt]}function Xt(t,e){return[t,1&e?-90+v:-qt]}function Zt(t){return[t[0]*(1-v),t[1]]}function Jt(t){var e,r=1+t,i=S(m(1/r)),s=2*L(y/(e=y+4*i*r)),l=.5*s*(r+L(t*(2+t))),c=t*t,u=r*r;function f(f,h){var p,d,g=1-m(h);if(g&&g<2){var v,b=x-h,_=25;do{var w=m(b),T=o(b),k=i+a(w,r-T),M=1+u-2*r*T;b-=v=(b-c*i-r*w+M*k-.5*g*e)/(2*r*w*k)}while(n(v)>1e-12&&--_>0);p=s*L(M),d=f*k/y}else p=s*(t+g),d=f*i/y;return[p*m(d),l-p*o(d)]}return f.invert=function(t,n){var o=t*t+(n-=l)*n,f=(1+u-o/(s*s))/(2*r),h=E(f),p=m(h),d=i+a(p,r-f);return[S(t/L(o))*y/d,S(1-2*(h-c*i-r*p+(1+u-2*r*f)*d)/e)]},f}function Kt(t,e){return e>-.7109889596207567?((t=W(t,e))[1]+=.0528035274542,t):Q(t,e)}function Qt(t,e){return n(e)>.7109889596207567?((t=W(t,e))[1]-=e>0?.0528035274542:-.0528035274542,t):Q(t,e)}function $t(t,e,r,n){var i=L(4*y/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=L(n*m(r)*L((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return L(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function u(t){return l(t)*m(t)}var f=function(t,e){var n=r*V(c,s*m(e)/r,e/y);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/y*o(n),u/a*m(n)]};return f.invert=function(t,e){var n=V(u,e*a/i);return[t*y/(o(n)*i*a*l(n)),S(r*c(n/r)/s)]},0===r&&(i=L(n/y),(f=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,S(e*i)]}),f}function te(t,e,r,n,i){void 0===n&&(n=1e-8),void 0===i&&(i=20);var a=t(e),o=t(.5*(e+r)),s=t(r);return function t(e,r,n,i,a,o,s,l,c,u,f){if(f.nanEncountered)return NaN;var h,p,d,m,g,v,y,x,b,_;if(p=e(r+.25*(h=n-r)),d=e(n-.25*h),isNaN(p))f.nanEncountered=!0;else{if(!isNaN(d))return _=((v=(m=h*(i+4*p+a)/12)+(g=h*(a+4*d+o)/12))-s)/15,u>c?(f.maxDepthCount++,v+_):Math.abs(_)t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var p=2*f(1)/y*o/r,g=function(t,e){var r=f(n(m(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=p)<1&&(r=d(e)*S(a(n(e))*o)),[t/i(n(e)),r]},g}function re(t,e){return n(t[0]-e[0])=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(ne([[o-v,s-v],[o-v,a+v],[n+v,a+v],[n+v,i-v]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function ae(t,r,n){var i,a;function o(e,n){for(var i=n<0?-1:1,a=r[+(n<0)],o=0,s=a.length-1;oa[o][2][0];++o);var l=t(e-a[o][1][0],n);return l[0]+=t(a[o][1][0],i*n>i*a[o][0][1]?a[o][0][1]:n)[0],l}n?o.invert=n(o):t.invert&&(o.invert=function(e,n){for(var i=a[+(n<0)],s=r[+(n<0)],l=0,c=i.length;lo&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),s):r.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))}))},null!=r&&s.lobes(r),s}Kt.invert=function(t,e){return e>-.7109889596207567?W.invert(t,e-.0528035274542):Q.invert(t,e)},Qt.invert=function(t,e){return n(e)>.7109889596207567?W.invert(t,e+(e>0?.0528035274542:-.0528035274542)):Q.invert(t,e)};var oe=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var se=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var le=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var ce=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var ue=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var fe=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function he(t,e){return[3/k*t*L(y*y/3-e*e),e]}function pe(t){function e(e,r){if(n(n(r)-x)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=h((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,S((l-1)/(l+1))]},e}he.invert=function(t,e){return[k/3*t/L(y*y/3-e*e),e]};var de=y/w;function me(t,e){return[t*(1+L(o(e)))/2,e/(o(e/2)*o(t/6))]}function ge(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function ve(t,e){return[m(t)/o(e),g(e)*o(t)]}function ye(t){var e=o(t),r=g(b+t/2);function i(i,a){var o=a-t,s=n(o)=0;)h=(f=t[u])[0]+l*(i=h)-c*p,p=f[1]+l*p+c*i;return[h=l*(i=h)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var f,h=e,p=t[h],d=p[0],g=p[1],v=0,y=0;--h>=0;)v=d+c*(f=v)-u*y,y=g+c*y+u*f,d=(p=t[h])[0]+c*(f=d)-u*g,g=p[1]+c*g+u*f;var x,b,_=(v=d+c*(f=v)-u*y)*v+(y=g+c*y+u*f)*y;c-=x=((d=c*(f=d)-u*g-r)*v+(g=c*g+u*f-s)*y)/_,u-=b=(g*v-d*y)/_}while(n(x)+n(b)>1e-12&&--l>0);if(l){var w=L(c*c+u*u),T=2*i(.5*w),k=m(T);return[a(c*k,w*o(T)),w?S(u*k/w):0]}},r}me.invert=function(t,e){var r=n(t),i=n(e),a=v,s=x;iv||n(b)>v)&&--a>0);return a&&[r,i]},ve.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?_*L((i-L(i*i-4*r))/r):1/L(n);return[S(t*a),d(e)*E(a)]},xe.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*y]};var _e=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],we=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Te=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],ke=[[.9245,0],[0,0],[.01943,0]],Me=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ae(t,r){var n=e.geoProjection(be(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Se=L(6),Ee=L(7);function Le(t,e){var r=S(7*m(e)/(3*Se));return[Se*t*(2*o(2*r/3)-1)/Ee,9*m(r/3)/Ee]}function Ce(t,e){for(var r,i=(1+_)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)1e-12&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Oe.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>v;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var ze=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function De(t,e){var r=m(e),i=o(e),a=d(t);if(0===t||n(e)===x)return[0,e];if(0===e)return[t,0];if(n(t)===x)return[t*i,x*r];var s=y/(2*t)-2*t/y,l=2*e/y,c=(1-l*l)/(r-l),u=s*s,f=c*c,h=1+u/f,p=1+f/u,g=(s*r/c-s/2)/h,v=(f*r/u+c/2)/p,b=v*v-(f*r*r/u+c*r-1)/p;return[x*(g+L(g*g+i*i/h)*a),x*(v+L(b<0?0:b)*d(-e*s)*a)]}De.invert=function(t,e){var r=(t/=x)*t,n=r+(e/=x)*e,i=y*y;return[t?(n-1+L((1-n)*(1-n)+4*r))/(2*t)*x:0,V((function(t){return n*(y*m(t)-2*t)*y+4*t*t*(e-m(t))+2*y*t-i*e}),0)]};function Re(t,e){var r=e*e;return[t,e*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function Fe(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Be(n.map(r.project),n.map(e.project));e.transform=r.transform?Ne(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o1.790857183?e=1.790857183:e<-1.790857183&&(e=-1.790857183);var r,i=e;do{var a=i*i;i-=r=(i*(1.0148+a*a*(.23185+a*(.02406*a-.14499)))-e)/(1.0148+a*a*(5*.23185+a*(.21654*a-1.01493)))}while(n(r)>v);return[t,i]},Fe.invert=function(t,e){if(n(e)v&&--s>0);return l=g(a),[(n(e)n^p>n&&r<(h-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),nr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function sr(t){var r=t(x,0)[0]-t(-x,0)[0];function i(e,i){var a=n(e)0?e-y:e+y,i),s=(o[0]-o[1])*_,l=(o[0]+o[1])*_;if(a)return[s,l];var c=r*_,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*_,o=(i-e)*_,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*_,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,f=-c*i+(a>0?1:-1)*l;a=(-u-f)*_,o=(u-f)*_}var h=t.invert(a,o);return s||(h[0]+=a>0?y:-y),h}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function lr(){return sr(Ut).scale(111.48)}function cr(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)v&&--u>0);var d=r*(f=g(c)),x=g(n(a)0?x:-x)*(h+o*(d-c)/2+o*o*(d-2*h+c)/2)]}function hr(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=L(n),o=(t-L(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*L(1-o*o)),i?S(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}ur.forEach((function(t){t[1]*=1.0144})),fr.invert=function(t,e){var r=e/x,i=90*r,a=f(18,n(i/5)),o=u(0,l(a));do{var s=ur[o][1],c=ur[o+1][1],h=ur[f(19,o+2)][1],p=h-s,d=h-2*c+s,m=2*(n(r)-c)/p,g=d/p,v=m*(1-g*m*(1-2*g*m));if(v>=0||1===o){i=(e>=0?5:-5)*(v+a);var y,b=50;do{v=(a=f(18,n(i)/5))-(o=l(a)),s=ur[o][1],c=ur[o+1][1],h=ur[f(19,o+2)][1],i-=(y=(e>=0?x:-x)*(c+v*(h-s)/2+v*v*(h-2*c+s)/2)-e)*M}while(n(y)>1e-12&&--b>0);break}}while(--o>=0);var _=ur[o][0],w=ur[o+1][0],T=ur[f(19,o+2)][0];return[t/(w+v*(T-_)/2+v*v*(T-2*w+_)/2),i*A]};var pr=-179.9999,dr=179.9999,mr=-89.9999;function gr(t){return t.length>0}function vr(t){return-90===t||90===t?[0,t]:[-180,(e=t,Math.floor(1e4*e)/1e4)];var e}function yr(t){var e=t[0],r=t[1],n=!1;return e<=pr?(e=-180,n=!0):e>=dr&&(e=180,n=!0),r<=mr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[e,r]:t}function xr(t){return t.map(yr)}function br(t,e,r){for(var n=0,i=t.length;n=dr||u<=mr||u>=89.9999){a[o]=yr(l);for(var f=o+1;fpr&&pmr&&d<89.9999)break}if(f===o+1)continue;if(o){var m={index:-1,polygon:e,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=vr(u),r[r.length-1]=m}else r.pop();if(f>=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(f-1)}),a[0]=vr(a[0][1]),o=-1,s=a.length}}}}function _r(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e0?y-l:l)*M],u=e.geoProjection(t(s)).rotate(c),f=e.geoRotation(c),h=u.center;return delete u.rotate,u.center=function(t){return arguments.length?h(f(t)):f.invert(h())},u.clipAngle(90)}function Ar(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Sr(t,e){return Mr(Ar,t,e)}function Er(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(e,a){var s=E(o(a)*o(e-r)),l=E(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*L(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,f=o(L(u+(i=t+r)*i)),h=o(L(u+(i=t+n)*i));return[a(c=f-h,i=(f+h)*s),(e<0?-1:1)*E(L(i*i+c*c)*l)]},c}function Lr(t,e){return Mr(Er,t,e)}function Cr(t,e){if(n(e)v&&--l>0);return[d(t)*(L(a*a+4)+a)*y/4,x*s]};var Rr=4*y+3*L(3),Fr=2*L(2*y*L(3)/Rr),Br=Y(Fr*L(3)/y,Fr,Rr/6);function Nr(t,e){return[t*L(1-3*e*e/(y*y)),e]}function jr(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=L(1-n*n))-s*i,-s*r-l*i]}function Ur(t,e){var r=O(t,e);return[(r[0]+t/x)/2,(r[1]+e)/2]}Nr.invert=function(t,e){return[t/L(1-3*e*e/(y*y)),e]},jr.invert=function(t,e){var r=(t*t+e*e)/-2,n=L(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=L(o*o+i*i);return[a(n*i,s*(1+r)),s?-S(n*o/s):0]},Ur.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),f=c*c,h=l*l,p=m(r),d=o(r/2),g=m(r/2),y=g*g,b=1-h*d*d,_=b?E(l*d)*L(s=1/b):s=0,w=.5*(2*_*l*g+r/x)-t,T=.5*(_*c+i)-e,k=.5*s*(h*y+_*l*d*f)+.5/x,M=s*(p*u/4-_*c*g),A=.125*s*(u*g-_*c*h*p),S=.5*s*(f*d+_*y*l)+.5,C=M*A-S*k,P=(T*M-w*S)/C,I=(w*A-T*k)/C;r-=P,i-=I}while((n(P)>v||n(I)>v)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=x,r=e.geoProjectionMutator(I),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*A):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=I,t.geoAitoff=function(){return e.geoProjection(O).scale(152.63)},t.geoAitoffRaw=O,t.geoArmadillo=function(){var t=20*A,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(z),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*A)>=0?1:-1)*t),i(t)):t*M},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),f=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*f)>=-180;)u.point(e,r*-a(o(e*A/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=z,t.geoAugust=function(){return e.geoProjection(D).scale(66.1603)},t.geoAugustRaw=D,t.geoBaker=function(){return e.geoProjection(B).scale(112.314)},t.geoBakerRaw=B,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=-o(.01*A),l=m(.01*A);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),c=i(e),u=(n.rotate([0,0]),i(e));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=0,r=360/t,n=2*y/t,i=90-180/t,c=x;e=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=Vt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Yt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){var n,i;e.geoStream((n=180/t,i=[].concat(r.range(-180,180+n/2,n).map(Wt),r.range(180,-180-n/2,-n).map(Xt)),{type:"Polygon",coordinates:[180===n?i.map(Zt):i]}),l)},s},i.scale(239.75)},t.geoHealpixRaw=Yt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Jt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Jt,t.geoHomolosine=function(){return e.geoProjection(Qt).scale(152.63)},t.geoHomolosineRaw=Qt,t.geoHufnagel=function(){var t=1,r=0,n=45*A,i=2,a=e.geoProjectionMutator($t),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*A,i):n*M},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=$t,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ee),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ee,t.geoInterrupt=ae,t.geoInterruptedBoggs=function(){return ae(J,oe).scale(160.857)},t.geoInterruptedHomolosine=function(){return ae(Qt,se).scale(152.63)},t.geoInterruptedMollweide=function(){return ae(W,le).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return ae(W,ce).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return ae(Kt,ue,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return ae(Q,fe).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(he).scale(158.837)},t.geoKavrayskiy7Raw=he,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(pe),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=pe,t.geoLarrivee=function(){return e.geoProjection(me).scale(97.2672)},t.geoLarriveeRaw=me,t.geoLaskowski=function(){return e.geoProjection(ge).scale(139.98)},t.geoLaskowskiRaw=ge,t.geoLittrow=function(){return e.geoProjection(ve).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=ve,t.geoLoximuthal=function(){return K(ye).parallel(40).scale(158.837)},t.geoLoximuthalRaw=ye,t.geoMiller=function(){return e.geoProjection(xe).scale(108.318)},t.geoMillerRaw=xe,t.geoModifiedStereographic=Ae,t.geoModifiedStereographicRaw=be,t.geoModifiedStereographicAlaska=function(){return Ae(_e,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ae(we,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ae(Te,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ae(ke,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ae(Me,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(W).scale(169.529)},t.geoMollweideRaw=W,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Le).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Le,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(Ce).scale(188.209)},t.geoMtFlatPolarQuarticRaw=Ce,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(Pe).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=Pe,t.geoNaturalEarth2=function(){return e.geoProjection(Ie).scale(175.295)},t.geoNaturalEarth2Raw=Ie,t.geoNellHammer=function(){return e.geoProjection(Oe).scale(152.63)},t.geoNellHammerRaw=Oe,t.geoInterruptedQuarticAuthalic=function(){return ae(j(1/0),ze).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(De).scale(127.267)},t.geoNicolosiRaw=De,t.geoPatterson=function(){return e.geoProjection(Re).scale(139.319)},t.geoPattersonRaw=Re,t.geoPolyconic=function(){return e.geoProjection(Fe).scale(103.74)},t.geoPolyconicRaw=Fe,t.geoPolyhedral=Ve,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-y/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=Ye.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ve(r[0],(function(t,e){return r[t<-y/2?e<0?6:4:t<0?e<0?2:0:t2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=sr,t.geoRectangularPolyconic=function(){return K(cr).scale(131.215)},t.geoRectangularPolyconicRaw=cr,t.geoRobinson=function(){return e.geoProjection(fr).scale(152.63)},t.geoRobinsonRaw=fr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(hr),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*A):r*M},i.scale(432.147).clipAngle(E(1/t)*M-1e-6)},t.geoSatelliteRaw=hr,t.geoSinuMollweide=function(){return e.geoProjection(Kt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=Kt,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return wr(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(wr)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Tr(t)}},t.geoTimes=function(){return e.geoProjection(kr).scale(146.153)},t.geoTimesRaw=kr,t.geoTwoPointAzimuthal=Sr,t.geoTwoPointAzimuthalRaw=Ar,t.geoTwoPointAzimuthalUsa=function(){return Sr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Lr,t.geoTwoPointEquidistantRaw=Er,t.geoTwoPointEquidistantUsa=function(){return Lr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(Cr).scale(79.4183)},t.geoVanDerGrintenRaw=Cr,t.geoVanDerGrinten2=function(){return e.geoProjection(Pr).scale(79.4183)},t.geoVanDerGrinten2Raw=Pr,t.geoVanDerGrinten3=function(){return e.geoProjection(Ir).scale(79.4183)},t.geoVanDerGrinten3Raw=Ir,t.geoVanDerGrinten4=function(){return e.geoProjection(Or).scale(127.16)},t.geoVanDerGrinten4Raw=Or,t.geoWagner=Dr,t.geoWagner7=function(){return Dr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=zr,t.geoWagner4=function(){return e.geoProjection(Br).scale(176.84)},t.geoWagner4Raw=Br,t.geoWagner6=function(){return e.geoProjection(Nr).scale(152.63)},t.geoWagner6Raw=Nr,t.geoWiechel=function(){return e.geoProjection(jr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=jr,t.geoWinkel3=function(){return e.geoProjection(Ur).scale(158.837)},t.geoWinkel3Raw=Ur,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":159,"d3-geo":166}],166:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-array")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){a(i,t,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new n;function a(t,e,r){var n=t.s=e+r,i=n-e,a=n-i;t.t=e-a+(r-i)}var o=1e-6,s=Math.PI,l=s/2,c=s/4,u=2*s,f=180/s,h=s/180,p=Math.abs,d=Math.atan,m=Math.atan2,g=Math.cos,v=Math.ceil,y=Math.exp,x=Math.log,b=Math.pow,_=Math.sin,w=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,k=Math.tan;function M(t){return t>1?0:t<-1?s:Math.acos(t)}function A(t){return t>1?l:t<-1?-l:Math.asin(t)}function S(t){return(t=_(t/2))*t}function E(){}function L(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var C={Feature:function(t,e){L(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=g(e=(e*=h)/2+c),o=_(e),s=N*o,l=B*a+s*g(i),u=s*n*_(i);j.add(m(u,l)),F=t,B=a,N=o}function W(t){return[m(t[1],t[0]),A(t[2])]}function X(t){var e=t[0],r=t[1],n=g(r);return[n*g(e),n*_(e),_(r)]}function Z(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(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 K(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function $(t){var e=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,ht,pt,dt,mt,gt,vt,yt,xt,bt,_t,wt,Tt,kt,Mt,At=r(),St={point:Et,lineStart:Ct,lineEnd:Pt,polygonStart:function(){St.point=It,St.lineStart=Ot,St.lineEnd=zt,At.reset(),V.polygonStart()},polygonEnd:function(){V.polygonEnd(),St.point=Et,St.lineStart=Ct,St.lineEnd=Pt,j<0?(tt=-(rt=180),et=-(nt=90)):At>o?nt=90:At<-o&&(et=-90),ct[0]=tt,ct[1]=rt},sphere:function(){tt=-(rt=180),et=-(nt=90)}};function Et(t,e){lt.push(ct=[tt=t,rt=t]),ent&&(nt=e)}function Lt(t,e){var r=X([t*h,e*h]);if(st){var n=J(st,r),i=J([n[1],-n[0],0],n);$(i),i=W(i);var a,o=t-it,s=o>0?1:-1,l=i[0]*f*s,c=p(o)>180;c^(s*itnt&&(nt=a):c^(s*it<(l=(l+360)%360-180)&&lnt&&(nt=e)),c?tDt(tt,rt)&&(rt=t):Dt(t,rt)>Dt(tt,rt)&&(tt=t):rt>=tt?(trt&&(rt=t)):t>it?Dt(tt,t)>Dt(tt,rt)&&(rt=t):Dt(t,rt)>Dt(tt,rt)&&(tt=t)}else lt.push(ct=[tt=t,rt=t]);ent&&(nt=e),st=r,it=t}function Ct(){St.point=Lt}function Pt(){ct[0]=tt,ct[1]=rt,St.point=Et,st=null}function It(t,e){if(st){var r=t-it;At.add(p(r)>180?r+(r>0?360:-360):r)}else at=t,ot=e;V.point(t,e),Lt(t,e)}function Ot(){V.lineStart()}function zt(){It(at,ot),V.lineEnd(),p(At)>o&&(tt=-(rt=180)),ct[0]=tt,ct[1]=rt,st=null}function Dt(t,e){return(e-=t)<0?e+360:e}function Rt(t,e){return t[0]-e[0]}function Ft(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:es?t+Math.round(-t/u)*u:t,e]}function Qt(t,e,r){return(t%=u)?e||r?Jt(te(t),ee(e,r)):te(t):e||r?ee(e,r):Kt}function $t(t){return function(e,r){return[(e+=t)>s?e-u:e<-s?e+u:e,r]}}function te(t){var e=$t(t);return e.invert=$t(-t),e}function ee(t,e){var r=g(t),n=_(t),i=g(e),a=_(e);function o(t,e){var o=g(e),s=g(t)*o,l=_(t)*o,c=_(e),u=c*r+s*n;return[m(l*i-u*a,s*r-c*n),A(u*i+l*a)]}return o.invert=function(t,e){var o=g(e),s=g(t)*o,l=_(t)*o,c=_(e),u=c*i-l*a;return[m(l*i+c*a,s*r+u*n),A(u*r-s*n)]},o}function re(t){function e(e){return(e=t(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e}return t=Qt(t[0]*h,t[1]*h,t.length>2?t[2]*h:0),e.invert=function(e){return(e=t.invert(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e},e}function ne(t,e,r,n,i,a){if(r){var o=g(e),s=_(e),l=n*r;null==i?(i=e+n*u,a=e-l/2):(i=ie(o,i),a=ie(o,a),(n>0?ia)&&(i+=n*u));for(var c,f=i;n>0?f>a:f1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function oe(t,e){return p(t[0]-e[0])=0;--a)i.point((f=u[a])[0],f[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ce(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,z=O*I,D=z>s,R=T*C;if(ue.add(m(R*O*_(z),k*P+R*g(z))),f+=D?I+O*u:I,D^b>=r^E>=r){var F=J(X(x),X(S));$(F);var B=J(a,F);$(B);var N=(D^I>=0?-1:1)*A(B[2]);(n>N||n===N&&(F[0]||F[1]))&&(h+=D^I>=0?1:-1)}}return(f<-o||f0){for(h||(a.polygonStart(),h=!0),a.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(de))}return p}}function de(t){return t.length>1}function me(t,e){return((t=t.x)[0]<0?t[1]-l-o:l-t[1])-((e=e.x)[0]<0?e[1]-l-o:l-e[1])}var ge=pe((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,c){var u=a>0?s:-s,f=p(a-r);p(f-s)0?l:-l),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&f>=s&&(p(r-i)o?d((_(e)*(a=g(n))*_(r)-_(n)*(i=g(e))*_(t))/(i*a*s)):(e+n)/2}(r,n,a,c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=c),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*l,n.point(-s,i),n.point(0,i),n.point(s,i),n.point(s,0),n.point(s,-i),n.point(0,-i),n.point(-s,-i),n.point(-s,0),n.point(-s,i);else if(p(t[0]-e[0])>o){var a=t[0]0,i=p(e)>o;function a(t,r){return g(t)*g(r)>e}function l(t,r,n){var i=[1,0,0],a=J(X(t),X(r)),l=Z(a,a),c=a[0],u=l-c*c;if(!u)return!n&&t;var f=e*l/u,h=-e*c/u,d=J(i,a),m=Q(i,f);K(m,Q(a,h));var g=d,v=Z(m,g),y=Z(g,g),x=v*v-y*(Z(m,m)-1);if(!(x<0)){var b=T(x),_=Q(g,(-v-b)/y);if(K(_,m),_=W(_),!n)return _;var w,k=t[0],M=r[0],A=t[1],S=r[1];M0^_[1]<(p(_[0]-k)s^(k<=_[0]&&_[0]<=M)){var C=Q(g,(-v+b)/y);return K(C,m),[_,W(C)]}}}function c(e,r){var i=n?t:s-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return pe(a,(function(t){var e,r,o,u,f;return{lineStart:function(){u=o=!1,f=1},point:function(h,p){var d,m=[h,p],g=a(h,p),v=n?g?0:c(h,p):g?c(h+(h<0?s:-s),p):0;if(!e&&(u=o=g)&&t.lineStart(),g!==o&&(!(d=l(e,m))||oe(e,d)||oe(m,d))&&(m[2]=1),g!==o)f=0,g?(t.lineStart(),d=l(m,e),t.point(d[0],d[1])):(d=l(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^g){var y;v&r||!(y=l(m,e,!0))||(f=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&oe(e,m)||t.point(m[0],m[1]),e=m,o=g,r=v},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return f|(u&&o)<<1}}}),(function(e,n,i,a){ne(a,t,r,i,e,n)}),n?[0,-t]:[-s,t-s])}function ye(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,f=0;if(null==e||(c=l(e,o))!==(f=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==f);else s.point(a[0],a[1])}function l(e,i){return p(e[0]-t)0?0:3:p(e[0]-n)0?2:1:p(e[1]-r)0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(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(o){var l,u,f,h,p,d,m,g,v,y,x,b=o,_=ae(),w={point:T,lineStart:function(){w.point=k,u&&u.push(f=[]);y=!0,v=!1,m=g=NaN},lineEnd:function(){l&&(k(h,p),d&&v&&_.rejoin(),l.push(_.result()));w.point=T,v&&b.lineEnd()},polygonStart:function(){b=_,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ri&&(h-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(h-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&le(l,c,r,s,o),o.polygonEnd());b=o,l=u=f=null}};function T(t,e){a(t,e)&&b.point(t,e)}function k(e,o){var s=a(e,o);if(u&&f.push([e,o]),y)h=e,p=o,d=s,y=!1,s&&(b.lineStart(),b.point(e,o));else if(s&&v)b.point(e,o);else{var l=[m=Math.max(-1e9,Math.min(1e9,m)),g=Math.max(-1e9,Math.min(1e9,g))],c=[e=Math.max(-1e9,Math.min(1e9,e)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,f=e[0]-s,h=e[1]-l;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0&&(t[0]=s+c*f,t[1]=l+c*h),u<1&&(e[0]=s+u*f,e[1]=l+u*h),!0}}}}}(l,c,t,r,n,i)?s&&(b.lineStart(),b.point(e,o),x=!1):(v||(b.lineStart(),b.point(l[0],l[1])),b.point(c[0],c[1]),s||b.lineEnd(),x=!1)}m=e,g=o,v=s}return w}}var xe,be,_e,we=r(),Te={sphere:E,point:E,lineStart:function(){Te.point=Me,Te.lineEnd=ke},lineEnd:E,polygonStart:E,polygonEnd:E};function ke(){Te.point=Te.lineEnd=E}function Me(t,e){xe=t*=h,be=_(e*=h),_e=g(e),Te.point=Ae}function Ae(t,e){t*=h;var r=_(e*=h),n=g(e),i=p(t-xe),a=g(i),o=n*_(i),s=_e*r-be*n*a,l=be*r+_e*n*a;we.add(m(T(o*o+s*s),l)),xe=t,be=r,_e=n}function Se(t){return we.reset(),z(t,Te),+we}var Ee=[null,null],Le={type:"LineString",coordinates:Ee};function Ce(t,e){return Ee[0]=t,Ee[1]=e,Se(Le)}var Pe={Feature:function(t,e){return Oe(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=Ce(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<1e-12*i)return!0;r=n}return!1}function Re(t,e){return!!he(t.map(Fe),Be(e))}function Fe(t){return(t=t.map(Be)).pop(),t}function Be(t){return[t[0]*h,t[1]*h]}function Ne(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[t,e]}))}}function je(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[e,t]}))}}function Ue(){var t,r,n,i,a,s,l,c,u,f,h,d,m=10,g=m,y=90,x=360,b=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(v(i/y)*y,n,y).map(h).concat(e.range(v(c/x)*x,l,x).map(d)).concat(e.range(v(r/m)*m,t,m).filter((function(t){return p(t%y)>o})).map(u)).concat(e.range(v(s/g)*g,a,g).filter((function(t){return p(t%x)>o})).map(f))}return _.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(d(l).slice(1),h(n).reverse().slice(1),d(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),_.precision(b)):[[i,c],[n,l]]},_.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),_.precision(b)):[[r,s],[t,a]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],_):[y,x]},_.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],_):[m,g]},_.precision=function(e){return arguments.length?(b=+e,u=Ne(s,a,90),f=je(r,t,b),h=Ne(c,l,90),d=je(i,n,b),_):b},_.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Ve(t){return t}var He,qe,Ge,Ye,We=r(),Xe=r(),Ze={point:E,lineStart:E,lineEnd:E,polygonStart:function(){Ze.lineStart=Je,Ze.lineEnd=$e},polygonEnd:function(){Ze.lineStart=Ze.lineEnd=Ze.point=E,We.add(p(Xe)),Xe.reset()},result:function(){var t=We/2;return We.reset(),t}};function Je(){Ze.point=Ke}function Ke(t,e){Ze.point=Qe,He=Ge=t,qe=Ye=e}function Qe(t,e){Xe.add(Ye*t-Ge*e),Ge=t,Ye=e}function $e(){Qe(He,qe)}var tr=1/0,er=tr,rr=-tr,nr=rr,ir={point:function(t,e){trr&&(rr=t);enr&&(nr=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E,result:function(){var t=[[tr,er],[rr,nr]];return rr=nr=-(er=tr=1/0),t}};var ar,or,sr,lr,cr=0,ur=0,fr=0,hr=0,pr=0,dr=0,mr=0,gr=0,vr=0,yr={point:xr,lineStart:br,lineEnd:Tr,polygonStart:function(){yr.lineStart=kr,yr.lineEnd=Mr},polygonEnd:function(){yr.point=xr,yr.lineStart=br,yr.lineEnd=Tr},result:function(){var t=vr?[mr/vr,gr/vr]:dr?[hr/dr,pr/dr]:fr?[cr/fr,ur/fr]:[NaN,NaN];return cr=ur=fr=hr=pr=dr=mr=gr=vr=0,t}};function xr(t,e){cr+=t,ur+=e,++fr}function br(){yr.point=_r}function _r(t,e){yr.point=wr,xr(sr=t,lr=e)}function wr(t,e){var r=t-sr,n=e-lr,i=T(r*r+n*n);hr+=i*(sr+t)/2,pr+=i*(lr+e)/2,dr+=i,xr(sr=t,lr=e)}function Tr(){yr.point=xr}function kr(){yr.point=Ar}function Mr(){Sr(ar,or)}function Ar(t,e){yr.point=Sr,xr(ar=sr=t,or=lr=e)}function Sr(t,e){var r=t-sr,n=e-lr,i=T(r*r+n*n);hr+=i*(sr+t)/2,pr+=i*(lr+e)/2,dr+=i,mr+=(i=lr*t-sr*e)*(sr+t),gr+=i*(lr+e),vr+=3*i,xr(sr=t,lr=e)}function Er(t){this._context=t}Er.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,u)}},result:E};var Lr,Cr,Pr,Ir,Or,zr=r(),Dr={point:E,lineStart:function(){Dr.point=Rr},lineEnd:function(){Lr&&Fr(Cr,Pr),Dr.point=E},polygonStart:function(){Lr=!0},polygonEnd:function(){Lr=null},result:function(){var t=+zr;return zr.reset(),t}};function Rr(t,e){Dr.point=Fr,Cr=Ir=t,Pr=Or=e}function Fr(t,e){Ir-=t,Or-=e,zr.add(T(Ir*Ir+Or*Or)),Ir=t,Or=e}function Br(){this._string=[]}function Nr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function jr(t){return function(e){var r=new Ur;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Ur(){}function Vr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),z(r,t.stream(ir)),e(ir.result()),null!=n&&t.clipExtent(n),t}function Hr(t,e,r){return Vr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function qr(t,e,r){return Hr(t,[[0,0],e],r)}function Gr(t,e,r){return Vr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Yr(t,e,r){return Vr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Br.prototype={_radius:4.5,_circle:Nr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Nr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ur.prototype={constructor:Ur,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Wr=g(30*h);function Xr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,f,h,d,g,v,y,x){var b=u-n,_=f-i,w=b*b+_*_;if(w>4*e&&y--){var k=s+d,M=l+g,S=c+v,E=T(k*k+M*M+S*S),L=A(S/=E),C=p(p(S)-1)e||p((b*z+_*D)/w-.5)>.3||s*d+l*g+c*v2?t[2]%360*h:0,I()):[y*f,x*f,b*f]},C.angle=function(t){return arguments.length?(_=t%360*h,I()):_*f},C.reflectX=function(t){return arguments.length?(w=t?-1:1,I()):w<0},C.reflectY=function(t){return arguments.length?(k=t?-1:1,I()):k<0},C.precision=function(t){return arguments.length?(o=Xr(s,L=t*t),O()):T(L)},C.fitExtent=function(t,e){return Hr(C,t,e)},C.fitSize=function(t,e){return qr(C,t,e)},C.fitWidth=function(t,e){return Gr(C,t,e)},C.fitHeight=function(t,e){return Yr(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&P,I()}}function tn(t){var e=0,r=s/3,n=$r(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*h,r=t[1]*h):[e*f,r*f]},i}function en(t,e){var r=_(t),n=(r+_(e))/2;if(p(n)0?e<-l+o&&(e=-l+o):e>l-o&&(e=l-o);var r=i/b(fn(e),n);return[r*_(n*t),i-r*g(n*t)]}return a.invert=function(t,e){var r=i-e,a=w(n)*T(t*t+r*r),o=m(t,p(r))*w(r);return r*n<0&&(o-=s*w(t)*w(r)),[o/n,2*d(b(i/a,1/n))-l]},a}function pn(t,e){return[t,e]}function dn(t,e){var r=g(t),n=t===e?_(t):(r-g(e))/(e-t),i=r/n+t;if(p(n)o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Tn.invert=on(A),kn.invert=on((function(t){return 2*d(t)})),Mn.invert=function(t,e){return[-e,2*d(y(t))-l]},t.geoAlbers=nn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=nn(),l=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function f(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function h(){return t=e=null,f}return f.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},f.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++rDt(n[0],n[1])&&(n[1]=i[1]),Dt(i[0],n[1])>Dt(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Dt(n[1],i[0]))>o&&(o=s,tt=i[0],rt=n[1])}return lt=ct=null,tt===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,et],[rt,nt]]},t.geoCentroid=function(t){ut=ft=ht=pt=dt=mt=gt=vt=yt=xt=bt=0,z(t,Bt);var e=yt,r=xt,n=bt,i=e*e+r*r+n*n;return i<1e-12&&(e=mt,r=gt,n=vt,ft2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Mn,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":159}],167:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),f=+t.value&&(u.value=t.value),h=[u];for(null==e&&(e=o);r=h.pop();)if(f&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)h.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;t=r.pop(),e=n.pop();for(;t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function f(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function _(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sh&&(h=s),g=u*u*m,(p=Math.max(h/g,g/f))>d){u-=s;break}d=p}v.push(o={value:u,dice:l1?e:1)},r}(G);var X=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,f=-1,h=o.length,p=t.value;++f1?e:1)},r}(G);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),f=c.x-t(c,u)/2,h=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-f)/(h-f)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=A;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(L(t)).eachAfter(C(n,.5)).eachBefore(P(1)):i.eachBefore(L(E)).eachAfter(C(A,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(P(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=k(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:S(+t),i):n},i},t.packEnclose=f,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&O(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=M(e),r):t},r.parentId=function(t){return arguments.length?(e=M(t),r):e},r},t.tree=function(){var t=B,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new H(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new H(n[i],i)),r.parent=e;return(o.parent=new H(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,f=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>f.depth&&(f=t)}));var h=c===u?1:t(c,u)/2,p=h-c.x,d=e/(u.x+h+p),m=r/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,f=s.m,h=l.m;s=j(s),a=N(a),s&&a;)l=N(l),(o=j(o)).a=e,(i=s.z+f-a.z-c+t(s._,a._))>0&&(U(V(s,e,n),e,i),c+=i,u+=i),f+=s.m,c+=a.m,h+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=f-u),a&&!N(l)&&(l.t=a,l.m+=c-h,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=W,e=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,c=A;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(f),i=[0],e&&t.eachBefore(I),t}function f(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,f=e.x1-r,h=e.y1-r;f=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}var f=c[e],h=n/2+f,p=e+1,d=r-1;for(;p>>1;c[m]l-a){var y=(i*v+o*g)/n;t(e,p,g,i,a,y,l),t(p,r,v,y,a,o,l)}else{var x=(a*v+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,v,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=O,t.treemapResquarify=X,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:O)(t,e,r,n,i)},t.treemapSquarify=W,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],168:[function(t,e,r){!function(n,i){"object"==typeof r&&void 0!==e?i(r,t("d3-color")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function f(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;na&&(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:y(r,n)})),a=_.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:y(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:y(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:y(t,r)},{i:s-2,x:y(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r1e-6)if(Math.abs(f*l-c*u)>1e-6&&a){var p=n-o,d=i-s,m=l*l+c*c,g=p*p+d*d,v=Math.sqrt(m),y=Math.sqrt(h),x=a*Math.tan((e-Math.acos((m+h-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(r+b*f)),this._+="A"+a+","+a+",0,0,"+ +(f*p>u*d)+","+(this._x1=t+_*l)+","+(this._y1=r+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=r);else;},arc:function(t,i,a,o,s,l){t=+t,i=+i,l=!!l;var c=(a=+a)*Math.cos(o),u=a*Math.sin(o),f=t+c,h=i+u,p=1^l,d=l?o-s:s-o;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+f+","+h:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+f+","+h),a&&(d<0&&(d=d%r+r),d>n?this._+="A"+a+","+a+",0,1,"+p+","+(t-c)+","+(i-u)+"A"+a+","+a+",0,1,"+p+","+(this._x1=f)+","+(this._y1=h):d>1e-6&&(this._+="A"+a+","+a+",0,"+ +(d>=e)+","+p+","+(this._x1=t+a*Math.cos(s))+","+(this._y1=i+a*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],170:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,f,h,p=t._root,d={data:n},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=p,!(p=p[f=u<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=p,i[f]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));if(c>f||u>h)return this;for(this.cover(c,u).cover(f,h),n=0;nt||t>=i||n>e||e>=a;)switch(s=(ep||(o=c.y0)>d||(s=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=p,!(p=p[f=u<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e1?0:t<-1?u:Math.acos(t)}function d(t){return t>=1?f:t<=-1?-f:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function v(t){return t.startAngle}function y(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,u=o-i,f=s-a,h=f*l-u*c;if(!(h*h<1e-12))return[t+(h=(u*(e-a)-f*(t-i))/h)*l,e+h*c]}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,f=(s?a:-a)/c(l*l+u*u),h=f*u,p=-f*l,d=t+h,m=e+p,g=r+h,v=n+p,y=(d+g)/2,x=(m+v)/2,b=g-d,_=v-m,w=b*b+_*_,T=i-a,k=d*v-g*m,M=(_<0?-1:1)*c(o(0,T*T*w-k*k)),A=(k*_-b*M)/w,S=(-k*b-_*M)/w,E=(k*_+b*M)/w,L=(-k*b+_*M)/w,C=A-y,P=S-x,I=E-y,O=L-x;return C*C+P*P>I*I+O*O&&(A=E,S=L),{cx:A,cy:S,x01:-h,y01:-p,x11:A*(i/T-1),y11:S*(i/T-1)}}function w(t){this._context=t}function T(t){return new w(t)}function k(t){return t[0]}function M(t){return t[1]}function A(){var t=k,n=M,i=r(!0),a=null,o=T,s=null;function l(r){var l,c,u,f=r.length,h=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=f;++l)!(l=f;--h)c.point(v[h],y[h]);c.lineEnd(),c.areaEnd()}g&&(v[u]=+t(p,u,r),y[u]=+i(p,u,r),c.point(n?+n(p,u,r):v[u],a?+a(p,u,r):y[u]))}if(d)return c=null,d+""||null}function f(){return A().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return f().x(t).y(i)},u.lineY1=function(){return f().x(t).y(a)},u.lineX1=function(){return f().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function E(t,e){return et?1:e>=t?0:NaN}function L(t){return t}w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var C=I(T);function P(t){this._curve=t}function I(t){function e(e){return new P(t(e))}return e._curve=t,e}function O(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function z(){return O(A().curve(C))}function D(){var t=S().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return O(r())},delete t.lineX0,t.lineEndAngle=function(){return O(n())},delete t.lineX1,t.lineInnerRadius=function(){return O(i())},delete t.lineY0,t.lineOuterRadius=function(){return O(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(I(t)):e()._curve},t}function R(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var F=Array.prototype.slice;function B(t){return t.source}function N(t){return t.target}function j(t){var n=B,i=N,a=k,o=M,s=null;function l(){var r,l=F.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function V(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function H(t,e,r,n,i){var a=R(e,r),o=R(e,r=(r+i)/2),s=R(n,r),l=R(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(t,e){var r=Math.sqrt(e/u);t.moveTo(r,0),t.arc(0,0,r,0,h)}},G={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Y=Math.sqrt(1/3),W=2*Y,X={draw:function(t,e){var r=Math.sqrt(e/W),n=r*Y;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Z=Math.sin(u/10)/Math.sin(7*u/10),J=Math.sin(h/10)*Z,K=-Math.cos(h/10)*Z,Q={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=J*r,i=K*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=h*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},tt=Math.sqrt(3),et={draw:function(t,e){var r=-Math.sqrt(e/(3*tt));t.moveTo(0,2*r),t.lineTo(-tt*r,-r),t.lineTo(tt*r,-r),t.closePath()}},rt=-.5,nt=Math.sqrt(3)/2,it=1/Math.sqrt(12),at=3*(it/2+1),ot={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,i=r*it,a=n,o=r*it+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(rt*n-nt*i,nt*n+rt*i),t.lineTo(rt*a-nt*o,nt*a+rt*o),t.lineTo(rt*s-nt*l,nt*s+rt*l),t.lineTo(rt*n+nt*i,rt*i-nt*n),t.lineTo(rt*a+nt*o,rt*o-nt*a),t.lineTo(rt*s+nt*l,rt*l-nt*s),t.closePath()}},st=[q,G,X,$,Q,et,ot];function lt(){}function ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ft(t){this._context=t}function ht(t){this._context=t}function pt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var dt=function t(e){function r(t){return 1===e?new ut(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function mt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function gt(t,e){this._context=t,this._k=(1-e)/6}gt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new gt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e){this._context=t,this._k=(1-e)/6}bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new bt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function wt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new Tt(t,e):new gt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:lt,areaEnd:lt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new Mt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t,e){this._context=t,this._alpha=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Et=function t(e){function r(t){return e?new St(t,e):new bt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Lt(t){this._context=t}function Ct(t){return t<0?-1:1}function Pt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function It(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ot(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Dt(t){this._context=new Rt(t)}function Rt(t){this._context=t}function Ft(t){this._context=t}function Bt(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Vt(t,e){return t[e]}function Ht(t){var e=t.map(qt);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function qt(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function Gt(t){var e=t.map(Yt);return Ut(t).sort((function(t,r){return e[t]-e[r]}))}function Yt(t){for(var e,r=0,n=-1,i=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,w=r(0),T=null,k=v,M=y,A=x,S=null;function E(){var r,m,g=+t.apply(this,arguments),v=+o.apply(this,arguments),y=k.apply(this,arguments)-f,x=M.apply(this,arguments)-f,E=n(x-y),L=x>y;if(S||(S=r=e.path()),v1e-12)if(E>h-1e-12)S.moveTo(v*a(y),v*l(y)),S.arc(0,0,v,y,x,!L),g>1e-12&&(S.moveTo(g*a(x),g*l(x)),S.arc(0,0,g,x,y,L));else{var C,P,I=y,O=x,z=y,D=x,R=E,F=E,B=A.apply(this,arguments)/2,N=B>1e-12&&(T?+T.apply(this,arguments):c(g*g+v*v)),j=s(n(v-g)/2,+w.apply(this,arguments)),U=j,V=j;if(N>1e-12){var H=d(N/g*l(B)),q=d(N/v*l(B));(R-=2*H)>1e-12?(z+=H*=L?1:-1,D-=H):(R=0,z=D=(y+x)/2),(F-=2*q)>1e-12?(I+=q*=L?1:-1,O-=q):(F=0,I=O=(y+x)/2)}var G=v*a(I),Y=v*l(I),W=g*a(D),X=g*l(D);if(j>1e-12){var Z,J=v*a(O),K=v*l(O),Q=g*a(z),$=g*l(z);if(E1e-12?V>1e-12?(C=_(Q,$,G,Y,v,V,L),P=_(J,K,W,X,v,V,L),S.moveTo(C.cx+C.x01,C.cy+C.y01),V1e-12&&R>1e-12?U>1e-12?(C=_(W,X,J,K,g,-U,L),P=_(G,Y,Q,$,g,-U,L),S.lineTo(C.cx+C.x01,C.cy+C.y01),U0&&(d+=f);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(y-p*b)/d:0;s0?f*c:0)+b,g[l]={data:r[l],index:s,value:f,startAngle:v,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=R,t.radialArea=D,t.radialLine=z,t.stack=function(){var t=r([]),e=Ut,n=jt,i=Vt;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:vt,S:H,u:q,U:G,V:Y,w:W,W:X,x:null,X:null,y:Z,Y:J,Z:K,"%":mt},Ct={a:function(t){return f[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:vt,S:ot,u:st,U:lt,V:ct,w:ut,W:ft,x:null,X:null,y:ht,Y:pt,Z:dt,"%":mt},Pt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return zt(t,a,e,r)},d:M,e:M,f:P,H:S,I:S,j:A,L:C,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:O,s:z,S:L,u:g,U:v,V:y,w:m,W:x,x:function(t,e,r){return zt(t,o,e,r)},X:function(t,e,r){return zt(t,l,e,r)},y:_,Y:b,Z:w,"%":I};function It(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function zt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Lt.x=It(o,Lt),Lt.X=It(l,Lt),Lt.c=It(a,Lt),Ct.x=It(o,Ct),Ct.X=It(l,Ct),Ct.c=It(a,Ct),{format:function(t){var e=It(t+="",Lt);return e.toString=function(){return t},e},parse:function(t){var e=Ot(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Ct);return e.toString=function(){return t},e},utcParse:function(t){var e=Ot(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function O(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function D(t,e){return f(t.getDate(),e,2)}function R(t,e){return f(t.getHours(),e,2)}function F(t,e){return f(t.getHours()%12||12,e,2)}function B(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return N(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function V(t,e){return f(t.getMinutes(),e,2)}function H(t,e){return f(t.getSeconds(),e,2)}function q(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Y(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function X(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function Q(t,e){return f(t.getUTCDate(),e,2)}function $(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return f(t.getUTCMonth()+1,e,2)}function at(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return f(t.getUTCFullYear()%100,e,2)}function pt(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function vt(t){return Math.floor(+t/1e3)}function yt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var xt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=xt,t.isoParse=bt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":173}],173:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),c=l.range,u=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=u.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),p=h.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var m=d(0),g=d(1),v=d(2),y=d(3),x=d(4),b=d(5),_=d(6),w=m.range,T=g.range,k=v.range,M=y.range,A=x.range,S=b.range,E=_.range,L=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),C=L.range,P=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));P.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var I=P.range,O=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),z=O.range,D=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=D.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),B=F.range;function N(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=N(0),U=N(1),V=N(2),H=N(3),q=N(4),G=N(5),Y=N(6),W=j.range,X=U.range,Z=V.range,J=H.range,K=q.range,Q=G.range,$=Y.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=p,t.timeFriday=b,t.timeFridays=S,t.timeHour=u,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=l,t.timeMinutes=c,t.timeMonday=g,t.timeMondays=T,t.timeMonth=L,t.timeMonths=C,t.timeSaturday=_,t.timeSaturdays=E,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=m,t.timeSundays=w,t.timeThursday=x,t.timeThursdays=A,t.timeTuesday=v,t.timeTuesdays=k,t.timeWednesday=y,t.timeWednesdays=M,t.timeWeek=m,t.timeWeeks=w,t.timeYear=P,t.timeYears=I,t.utcDay=F,t.utcDays=B,t.utcFriday=G,t.utcFridays=Q,t.utcHour=D,t.utcHours=R,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=O,t.utcMinutes=z,t.utcMonday=U,t.utcMondays=X,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=Y,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=q,t.utcThursdays=K,t.utcTuesday=V,t.utcTuesdays=Z,t.utcWednesday=H,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],174:[function(t,e,r){arguments[4][173][0].apply(r,arguments)},{dup:173}],175:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e,r,n=0,i=0,a=0,o=0,s=0,l=0,c="object"==typeof performance&&performance.now?performance:Date,u="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return s||(u(h),s=c.now()+l)}function h(){s=0}function p(){this._call=this._time=this._next=null}function d(t,e,r){var n=new p;return n.restart(t,e,r),n}function m(){f(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,y(a)}(),s=0}}function v(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function y(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(v,1e3)),n=1,u(g)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?f():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?f():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=f,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],176:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){h=(b=_[u])[0];b[0]=b[1],b[1]=h}return _}},{"incremental-convex-hull":438,uniq:603}],178:[function(t,e,r){"use strict";e.exports=a;var n=(a.canvas=document.createElement("canvas")).getContext("2d"),i=o([32,126]);function a(t,e){Array.isArray(t)&&(t=t.join(", "));var r,a={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=i),n.font=s+"px "+t;for(var c=0;cs*l){var p=(h-f)/s;a[u]=1e3*p}}return a}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:117}],180:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":71,"normalize-svg-path":474}],181:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],182:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=c=t[1];for(var b=r;bl&&(l=u),p>c&&(c=p);d=0!==(d=Math.max(l-n,c-s))?1/d:0}return o(y,x,r,n,s,d),x}function i(t,e,r,n,i){var a,o;if(i===E(t,e,r,n)>0)for(a=e;a=e;a-=n)o=M(a,t[a],t[a+1],o);return o&&x(o,o.next)&&(A(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||!x(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=d(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,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,f);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,f?l(t,n,i,f):s(t))e.push(p.i/r),e.push(t.i/r),e.push(m.i/r),A(t),t=m.next,g=m.next;else if((t=m)===g){h?1===h?o(t=c(a(t),e,r),e,r,n,i,f,2):2===h&&u(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(g(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&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(y(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(s,l,e,r,n),h=d(c,u,e,r,n),p=t.prevZ,m=t.nextZ;p&&p.z>=f&&m&&m.z<=h;){if(p!==t.prev&&p!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==t.prev&&m!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=h;){if(m!==t.prev&&m!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!x(i,o)&&b(i,n,n.next,o)&&T(i,o)&&T(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),A(n),A(n.next),n=t=o),n=n.next}while(n!==t);return a(n)}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&v(l,c)){var u=k(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.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.x&&n.x>=u&&i!==n.x&&g(ar.x||n.x===r.x&&p(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}(t,e)){var r=k(e,t);a(e,e.next),a(r,r.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(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&&r.next.y!==r.y&&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}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||x(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){var i=w(y(t,e,r)),a=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return i!==a&&o!==s||(!(0!==i||!_(t,r,e))||(!(0!==a||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function T(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function k(t,e){var r=new S(t.i,t.x,t.y),n=new S(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 M(t,e,r,n){var i=new S(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 A(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 S(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 E(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],184:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i=e}))}(e);for(var r,i=n(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o=55296&&y<=56319&&(w+=t[++r]),w=T?h.call(T,k,w,m):w,e?(p.value=w,d(g,m,p)):g[m]=w,++m;v=m}if(void 0===v)for(v=o(t.length),e&&(g=new e(v)),r=0;r0?1:-1}},{}],196:[function(t,e,r){"use strict";var n=t("../math/sign"),i=Math.abs,a=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*a(i(t)):t}},{"../math/sign":193}],197:[function(t,e,r){"use strict";var n=t("./to-integer"),i=Math.max;e.exports=function(t){return i(0,n(t))}},{"./to-integer":196}],198:[function(t,e,r){"use strict";var n=t("./valid-callable"),i=t("./valid-value"),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,c){var u,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(c),u=s(r),h&&u.sort("function"==typeof h?a.call(h,r):void 0),"function"!=typeof t&&(t=u[t]),o.call(t,u,(function(t,n){return l.call(r,t)?o.call(c,f,r[t],t,r,n):e}))}}},{"./valid-callable":215,"./valid-value":217}],199:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":200,"./shim":201}],200:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],201:[function(t,e,r){"use strict";var n=t("../keys"),i=t("../valid-value"),a=Math.max;e.exports=function(t,e){var r,o,s,l=a(arguments.length,2);for(t=Object(i(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],221:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},{}],222:[function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;e.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},{}],223:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),c=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?a.call(e,"key+value")?"key+value":a.call(e,"key")?"key":"value":"value",c(this,"__kind__",o("",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":226,d:158,"es5-ext/object/set-prototype-of":212,"es5-ext/string/#/contains":218,"es6-symbol":230}],224:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/valid-callable"),a=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;e.exports=function(t,e){var r,u,f,h,p,d,m,g,v=arguments[2];if(s(t)||n(t)?r="array":a(t)?r="string":t=o(t),i(e),f=function(){h=!0},"array"!==r)if("string"!==r)for(u=t.next();!u.done;){if(l.call(e,v,u.value,f),h)return;u=t.next()}else for(d=t.length,p=0;p=55296&&g<=56319&&(m+=t[++p]),l.call(e,v,m,f),!h);++p);else c.call(t,(function(t){return l.call(e,v,t,f),h}))}},{"./get":225,"es5-ext/function/is-arguments":190,"es5-ext/object/valid-callable":215,"es5-ext/string/is-string":221}],225:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/string/is-string"),a=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new a(t):i(t)?new o(t):new a(t)}},{"./array":223,"./string":228,"./valid-iterable":229,"es5-ext/function/is-arguments":190,"es5-ext/string/is-string":221,"es6-symbol":230}],226:[function(t,e,r){"use strict";var n,i=t("es5-ext/array/#/clear"),a=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),c=t("d/auto-bind"),u=t("es6-symbol"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,a({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,u.iterator,l((function(){return this})))},{d:158,"d/auto-bind":157,"es5-ext/array/#/clear":186,"es5-ext/object/assign":199,"es5-ext/object/valid-callable":215,"es5-ext/object/valid-value":217,"es6-symbol":230}],227:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/is-value"),a=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!i(t)&&(!!s(t)||(!!a(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":190,"es5-ext/object/is-value":206,"es5-ext/string/is-string":221,"es6-symbol":230}],228:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",a("",t.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},{"./":226,d:158,"es5-ext/object/set-prototype-of":212,"es6-symbol":230}],229:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":227}],230:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":231,"./polyfill":236,"ext/global-this":243}],231:[function(t,e,r){"use strict";var n=t("ext/global-this"),i={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!i[typeof e.iterator]&&(!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag])}},{"ext/global-this":243}],232:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],233:[function(t,e,r){"use strict";var n=t("d"),i=Object.create,a=Object.defineProperty,o=Object.prototype,s=i(null);e.exports=function(t){for(var e,r,i=0;s[t+(i||"")];)++i;return s[t+=i||""]=!0,a(o,e="@@"+t,n.gs(null,(function(t){r||(r=!0,a(this,e,n(t)),r=!1)}))),e}},{d:158}],234:[function(t,e,r){"use strict";var n=t("d"),i=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",i&&i.hasInstance||t("hasInstance")),isConcatSpreadable:n("",i&&i.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",i&&i.iterator||t("iterator")),match:n("",i&&i.match||t("match")),replace:n("",i&&i.replace||t("replace")),search:n("",i&&i.search||t("search")),species:n("",i&&i.species||t("species")),split:n("",i&&i.split||t("split")),toPrimitive:n("",i&&i.toPrimitive||t("toPrimitive")),toStringTag:n("",i&&i.toStringTag||t("toStringTag")),unscopables:n("",i&&i.unscopables||t("unscopables"))})}},{d:158,"ext/global-this":243}],235:[function(t,e,r){"use strict";var n=t("d"),i=t("../../../validate-symbol"),a=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return a[e]?a[e]:a[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in i(t),a)if(a[e]===t)return e}))})}},{"../../../validate-symbol":237,d:158}],236:[function(t,e,r){"use strict";var n,i,a,o=t("d"),s=t("./validate-symbol"),l=t("ext/global-this").Symbol,c=t("./lib/private/generate-name"),u=t("./lib/private/setup/standard-symbols"),f=t("./lib/private/setup/symbol-registry"),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"==typeof l)try{String(l()),a=!0}catch(t){}else l=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return a?l(e):(r=h(i.prototype),e=void 0===e?"":String(e),p(r,{__description__:o("",e),__name__:o("",c(e))}))},u(n),f(n),p(i.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),p(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),d(n.prototype,n.toPrimitive,o("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),d(n.prototype,n.toStringTag,o("c","Symbol")),d(i.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),d(i.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":233,"./lib/private/setup/standard-symbols":234,"./lib/private/setup/symbol-registry":235,"./validate-symbol":237,d:158,"ext/global-this":243}],237:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":232}],238:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":239,"./polyfill":241}],239:[function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},{}],240:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],241:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/is-value"),a=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),c=t("d"),u=t("es6-iterator/get"),f=t("es6-iterator/for-of"),h=t("es6-symbol").toStringTag,p=t("./is-native-implemented"),d=Array.isArray,m=Object.defineProperty,g=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=p&&a&&WeakMap!==n?a(new WeakMap,v(this)):this,i(e)&&(d(e)||(e=u(e))),m(t,"__weakMapData__",c("c","$weakMap$"+l())),e?(f(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},p&&(a&&a(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(t){return!!g.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:c((function(t){if(g.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:c((function(t){return g.call(o(t),this.__weakMapData__)})),set:c((function(t,e){return m(o(t),this.__weakMapData__,c("c",e)),this})),toString:c((function(){return"[object WeakMap]"}))}),m(n.prototype,h,c("c","WeakMap"))},{"./is-native-implemented":240,d:158,"es5-ext/object/is-value":206,"es5-ext/object/set-prototype-of":212,"es5-ext/object/valid-object":216,"es5-ext/object/valid-value":217,"es5-ext/string/random-uniq":222,"es6-iterator/for-of":224,"es6-iterator/get":225,"es6-symbol":230}],242:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],243:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":242,"./is-implemented":244}],244:[function(t,e,r){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],245:[function(t,e,r){"use strict";e.exports=function(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]]]}},{}],246:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":448}],247:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"==typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:if("number"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),i=t("binary-search-bounds");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(c[h-1],u[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":103,"cubic-hermite":156}],248:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,a,o,s,l=t[0].length,c=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(c+r));var u=e.length-r;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);for(i=0,o=r;ie[0]-o[0]/2&&(h=o[0]/2,p+=o[1]);return r}},{"css-font/stringify":153}],250:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",c=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return i(n.cache[r],c);var u=e.canvas||n.canvas,f=u.getContext("2d"),h={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,f.font=t;var d={top:0};f.clearRect(0,0,p,p),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var m=a(f.getImageData(0,0,p,p));f.clearRect(0,0,p,p),f.textBaseline="bottom",f.fillText("H",0,p);var g=a(f.getImageData(0,0,p,p));d.lineHeight=d.bottom=p-g+m,f.clearRect(0,0,p,p),f.textBaseline="alphabetic",f.fillText("H",0,p);var v=p-a(f.getImageData(0,0,p,p))-1+m;d.baseline=d.alphabetic=v,f.clearRect(0,0,p,p),f.textBaseline="middle",f.fillText("H",0,.5*p);var y=a(f.getImageData(0,0,p,p));d.median=d.middle=p-y-1+m-.5*p,f.clearRect(0,0,p,p),f.textBaseline="hanging",f.fillText("H",0,.5*p);var x=a(f.getImageData(0,0,p,p));d.hanging=p-x-1+m-.5*p,f.clearRect(0,0,p,p),f.textBaseline="ideographic",f.fillText("H",0,p);var b=a(f.getImageData(0,0,p,p));if(d.ideographic=p-b-1+m,h.upper&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.upper,0,0),d.upper=a(f.getImageData(0,0,p,p)),d.capHeight=d.baseline-d.upper),h.lower&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.lower,0,0),d.lower=a(f.getImageData(0,0,p,p)),d.xHeight=d.baseline-d.lower),h.tittle&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.tittle,0,0),d.tittle=a(f.getImageData(0,0,p,p))),h.ascent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.ascent,0,0),d.ascent=a(f.getImageData(0,0,p,p))),h.descent&&(f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.descent,0,0),d.descent=o(f.getImageData(0,0,p,p))),h.overshoot){f.clearRect(0,0,p,p),f.textBaseline="top",f.fillText(h.overshoot,0,0);var _=o(f.getImageData(0,0,p,p));d.overshoot=_-v}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,i(d,c)}function i(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function a(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],251:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||m,null)};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}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left)if(i=u(t,e,r,n.left))return i;if(i=r(n.key,n.value))return i}if(n.right)return u(t,e,r,n.right)}function f(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=f(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 f(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(1===h._color||1===i._color)break;var p=l[f-2];if(p.left===h)if(h.left===i){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=h.right,h._color=1,h.right=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(m=l[f-3]).left===p?m.left=h:m.right=h;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else{if(!(d=p.right)||0!==d._color){if(h.right=i.left,p._color=0,p.left=i.right,i._color=1,i.left=h,i.right=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(m=l[f-3]).left===p?m.left=i:m.right=i;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else if(h.right===i){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=h.left,h._color=1,h.left=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(m=l[f-3]).right===p?m.right=h:m.left=h;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;if(h.left=i.right,p._color=0,p.right=i.left,i._color=1,i.right=h,i.left=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(m=l[f-3]).right===p?m.right=i:m.left=i;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.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.right._count)break;e=e.right}return new h(this,[])},l.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)},l.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)},l.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)},l.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)},l.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,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.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 p=h.prototype;function d(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 m(t,e){return te?1:0}Object.defineProperty(p,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new h(this.tree,this._stack.slice())},p.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 l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=i(n)).right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=a(0,n));r.right=a(0,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=i(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=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=a(0,n));r.left=a(0,n);continue}var c;n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,"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}),p.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(p,"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}}),p.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]).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])},p.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(p,"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}})},{}],252:[function(t,e,r){e.exports=function(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;o0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var m=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),f=u.cubeEdges,h=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=f[M],this.lastCubeProps.axis[M]=h[M];var A=p;for(M=0;M<3;++M)d(p[M],M,this.bounds,f,h);e=this.gl;var S,E=m;for(M=0;M<3;++M)this.backgroundEnable[M]?E[M]=h[M]:E[M]=0;this._background.draw(r,n,i,a,E,this.backgroundColor),this._lines.bind(r,n,i,this);for(M=0;M<3;++M){var L=[0,0,0];h[M]>0?L[M]=a[1][M]:L[M]=a[0][M];for(var C=0;C<2;++C){var P=(M+1+C)%3,I=(M+1+(1^C))%3;this.gridEnable[P]&&this._lines.drawGrid(P,I,this.bounds,L,this.gridColor[P],this.gridWidth[P]*this.pixelRatio)}for(C=0;C<2;++C){P=(M+1+C)%3,I=(M+1+(1^C))%3;this.zeroEnable[I]&&Math.min(a[0][I],a[1][I])<=0&&Math.max(a[0][I],a[1][I])>=0&&this._lines.drawZero(P,I,this.bounds,L,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var O=c(v,A[M].primalMinor),z=c(y,A[M].mirrorMinor),D=this.lineTickLength;for(C=0;C<3;++C){var R=k/r[5*C];O[C]*=D[C]*R,z[C]*=D[C]*R}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,A[M].primalOffset,O,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,A[M].mirrorOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var F,B;function N(t){(B=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(M=0;M<3;++M){var U=A[M].primalMinor,V=A[M].mirrorMinor,H=c(x,A[M].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[M]&&(H[C]+=k*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var q=[0,0,0];if(q[M]=1,this.tickEnable[M]){-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,F=1,"auto"===(S=[this.tickAlign[M],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]),B=[0,0,0],j(M,U,V);for(C=0;C<3;++C)H[C]+=k*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],H,this.tickColor[M],q,B,S)}if(this.labelEnable[M]){F=0,B=[0,0,0],this.labels[M].length>4&&(N(M),F=1),"auto"===(S=[this.labelAlign[M],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(C=0;C<3;++C)H[C]+=k*U[C]*this.labelPad[C]/r[5*C];H[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],H,this.labelColor[M],[0,0,0],B,S)}}this._text.unbind()},f.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":254,"./lib/cube.js":255,"./lib/lines.js":256,"./lib/text.js":258,"./lib/ticks.js":259}],254:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[c]=d;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.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),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":257,"gl-buffer":261,"gl-vao":353}],255:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],h(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((N=R^1<c[B][0]&&(B=N)}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=g,H=w;for(M=0;M<3;++M)V[M]=H&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\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\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 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\n colorChannel = abs(realNormal);\n}"]),u=n(["precision highp 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 i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":332,glslify:434}],258:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var p=new c(t,h,u,f);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(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}var u=c.prototype,f=[0,0];u.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=u.positions,p=u.cells,d=0,m=p.length;d=0;--v){var y=h[g[v]];o.push(f*y[0],-f*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var m=0;m=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(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)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||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(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==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 i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:472,"ndarray-ops":467,"typedarray-pool":601}],262:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,f=1/0,h=-1/0,p=null,d=null,m=[],g=1/0,v=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(g=Math.min(g,_),v=!1):v=!0}v||(p=x,d=b),m.push(b)}var w=[s,c,f],T=[l,u,h];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||.5;t.absoluteConeSize&&(M=t.absoluteConeSize*k),a.coneScale=M;y=0;for(var A=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"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),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({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 c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,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,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=m(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var f=i(t),p=i(t),g=i(t),v=i(t),y=i(t),x=a(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new h(t,u,s,l,f,p,y,g,v,x,r.traceType||"cone");return b.update(e),b}},{colormap:137,"gl-buffer":261,"gl-mat4/invert":293,"gl-mat4/multiply":295,"gl-shader":332,"gl-texture2d":348,"gl-vao":353,ndarray:472}],264:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:434}],265:[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"}},{}],266:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":265}],267:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(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}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(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,this.hasAlpha=!1}var l=s.prototype;function c(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])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=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=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[n],a=0;a0)(m=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,m[0],m[1],m[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,m),o+=2+f(i,m,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":269,"gl-buffer":261,"gl-vao":353}],268:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":332,glslify:268}],270:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;"stencil"in n&&(g=!!n.stencil);return new d(t,e,r,h,f,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(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 d(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 d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==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(v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.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]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(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]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var c,u,f,p,d=t.colorLevels||[0],m=t.colorValues||[0,0,0,1],g=d.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=o[0],f=v[2]=r[r.length-1],p=v[3]=o[o.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=o[0]+(o[1]-o[0])/2,f=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=v[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-c),x=1/(p-u),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),k=a.mallocFloat32(2*w),M=a.mallocUint8(2*w),A=a.mallocUint32(w),S=0,E=l?b-1:b,L=l?_-1:_,C=0;C max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\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"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n 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 vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n 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 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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{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 i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":332,glslify:276}],275:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(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 o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new v(e,r,o,s,l,d);return m.update(t),m};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),c=t("ndarray"),u=t("./lib/shaders"),f=u.createShader,h=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(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 m(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 g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(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.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(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),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;v+=g[f]}if(Math.abs(v-1)>.001)return null;return[h,s(t,g),g]}},{barycentric:85,"polytope-closest-point/lib/closest_point_2d.js":498}],308:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\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\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\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 (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * 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 * f_color.a;\n}\n"]),o=n(["precision highp 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}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,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}"]),c=n(["precision highp 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=n(["precision highp 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}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 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}"]),p=n(["precision highp 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=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:434}],309:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),m=t("./lib/closest-point"),g=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_,T,k,M,A,S){this.gl=t,this.pixelRatio=1,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!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.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function M(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function A(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function P(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,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,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,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*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.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;ai[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[k],i[M]-i[k]))),y[t]&&T&&(u[1^t]-=A*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),u[1^t]=A*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=A*p*m[t+2],ki[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[k],i[M]-i[k]))),y[t+2]&&T&&(u[1^t]+=A*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),m.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),m.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],m=a[o+2]-f,g=i[o],v=i[o+2]-g;p[o]=2*l/u*m/v,h[o]=2*(s-c)/u*m/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var m=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(m,e[1],m,e[3],p[d],h[d]):o.drawLine(e[0],m,e[2],m,p[d],h[d])}}for(d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":55,"has-passive-events":436,"mouse-change":459,"mouse-event-offset":460,"mouse-wheel":462,"right-now":528}],318:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["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}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":332,glslify:434}],319:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("gl-mat4/ortho"),p=t("./lib/shader"),d=t("is-mobile")({tablet:!0,featureDetect:!0});function m(){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 g(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){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},M=i(r,k);M.enable=!k.disable;var A=t.spikes||{},S=o(r,A),E=[],L=[],C=[],P=[],I=!0,O=!0,z=new Array(16),D=new Array(16),R={view:null,projection:z,model:D,_ortho:!1},F=(O=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:M,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,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:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,O=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function U(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}N.autoResize&&U();function V(){for(var t=E.length,e=P.length,n=0;n0&&0===C[e-1];)C.pop(),P.pop().dispose()}function H(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}window.addEventListener("resize",U),N.update=function(t){N._stopped||(t=t||{},I=!0,O=!0)},N.add=function(t){N._stopped||(t.axes=M,E.push(t),L.push(-1),I=!0,O=!0,V())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),L.pop(),I=!0,O=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",H),N.mouseListener.enabled=!1,!N.contextLost)){M.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c 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=n(["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=n(["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"])},{glslify:434}],321:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(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}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(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":320,"gl-buffer":261,"gl-shader":332,"typedarray-pool":601}],322:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],p=r[0],d=r[1],m=r[2],g=r[3];(a=c*p+u*d+f*m+h*g)<0&&(a=-a,p=-p,d=-d,m=-m,g=-g);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],323:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],324:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\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=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return v(t,f)},r.createOrtho=function(t){return v(t,h)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,m)},r.createPickProject=function(t){return v(t,g)}},{"gl-shader":332,glslify:326}],326:[function(t,e,r){arguments[4][268][0].apply(r,arguments)},{dup:268}],327:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),c=t("./lib/glyphs"),u=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(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 p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function m(t){return!0===t||t>1?1:t}function g(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new d(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}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),m=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new g(e,r,n,o,f,h,p,d,m,s,c,u);return v.update(t),v};var v=g.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=f.slice(),k=[0,0,0],M=[[0,0,0],[0,0,0]];function A(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function L(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||f,u=r.view||f,h=r.projection||f,d=e.axesBounds,m=function(t){for(var e=M,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}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=m,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(a[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var v=T,L=0;L<16;++L)v[L]=0;for(L=0;L<4;++L)v[5*L]=1;v[5*g]=0,i[g]<0?v[12+g]=d[0][g]:v[12+g]=d[1][g],s(v,c,v),l.model=v;var C=(g+1)%3,P=(g+2)%3,I=A(x),O=A(b);I[C]=1,O[P]=1;var z=p(0,0,0,S(_,I)),D=p(0,0,0,S(w,O));if(Math.abs(z[1])>Math.abs(D[1])){var R=z;z=D,D=R,R=I,I=O,O=R;var F=C;C=P,P=F}z[0]<0&&(I[C]=-1),D[1]>0&&(O[P]=-1);var B=0,N=0;for(L=0;L<4;++L)B+=Math.pow(c[4*C+L],2),N+=Math.pow(c[4*P+L],2);I[C]/=Math.sqrt(B),O[P]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=O,l.fragClipBounds[0]=E(k,m[0],g,-1e8),l.fragClipBounds[1]=E(k,m[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&L(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var a;a=Array.isArray(t)?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},v.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]},v.update=function(t){if("perspective"in(t=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(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=m(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=m(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else{i=[],a=[];for(n=0;n0){var O=0,z=x,D=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;f[T]=Math.max(f[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(N=I(h,n,l,this.pixelRatio)).mesh,M=N.lines,A=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n0?1-A[0][0]:Y<0?1+A[1][0]:1,W*=W>0?1-A[0][1]:W<0?1+A[1][1]:1],Z=k.cells||[],J=k.positions||[];for(T=0;T0){var v=r*u;o.drawBox(f-v,h-v,p+v,h+v,a),o.drawBox(f-v,d-v,p+v,d+v,a),o.drawBox(f-v,h-v,f+v,d+v,a),o.drawBox(p-v,h-v,p+v,d+v,a)}}}},s.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()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":328,"gl-buffer":261,"gl-shader":332}],331:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(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)}}var c=l.prototype;Object.defineProperty(c,"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){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),M=0;M=0;)A+=1;_[y]=A}var S=new Array(r.length);function E(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var d;if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,p,i,d,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"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}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+g+"fv"](s[u],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((g=v.charCodeAt(v.length-1)-48)<2||g>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+g+"iv"](s[u],f);break;case"v":t["uniform"+g+"fv"](s[u],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e,n){if("object"==typeof n){var c=u(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(f=n,function(t,e,r){return t.getUniform(e.program,r[f])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var f}function u(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat cookTorranceSpecular(\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(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\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\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 = min(1.0, max(0.0, cookTorranceSpecular(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}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:343}],343:[function(t,e,r){arguments[4][268][0].apply(r,arguments)},{dup:268}],344:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(h[T],p[T],p[k],p[k],h[k],h[T]),f.push(y,v,v,v,y,y),d.push(m,g,g,g,m,m);var M=c.length;u.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var A=h;h=p,p=A;var S=y;y=v,v=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(t,r,a,o)})),f=[],h=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||x>p-1)return n.create();var b,_,w,T,k,M,A=a[0][d],S=a[0][v],E=a[1][m],L=a[1][y],C=a[2][g],P=(o-A)/(S-A),I=(c-E)/(L-E),O=(u-C)/(a[2][x]-C);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(O)||(O=.5),r.reversedX&&(d=f-1-d,v=f-1-v),r.reversedY&&(m=h-1-m,y=h-1-y),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,M=x,w=m*p,T=y*p,b=d*p*h,_=v*p*h;break;case 4:k=g,M=x,b=d*p,_=v*p,w=m*p*f,T=y*p*f;break;case 3:w=m,T=y,k=g*h,M=x*h,b=d*h*p,_=v*h*p;break;case 2:w=m,T=y,b=d*h,_=v*h,k=g*h*f,M=x*h*f;break;case 1:b=d,_=v,k=g*f,M=x*f,w=m*f*p,T=y*f*p;break;default:b=d,_=v,w=m*f,T=y*f,k=g*f*h,M=x*f*h}var z=i[b+w+k],D=i[b+w+M],R=i[b+T+k],F=i[b+T+M],B=i[_+w+k],N=i[_+w+M],j=i[_+T+k],U=i[_+T+M],V=n.create(),H=n.create(),q=n.create(),G=n.create();n.lerp(V,z,B,P),n.lerp(H,D,N,P),n.lerp(q,R,j,P),n.lerp(G,F,U,P);var Y=n.create(),W=n.create();n.lerp(Y,V,q,I),n.lerp(W,H,G,I);var X=n.create();return n.lerp(X,Y,W,O),X}(e,t,p)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},k=10*n.distance(e[0],e[1])/i,M=k*k,A=1,S=0,E=r.length;E>1&&(A=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lS&&(S=F),D.push(F),g.push({points:P,velocities:I,divergences:D});for(var B=0;B<100*i&&P.lengthM&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,C),O=d(N),n.squaredDistance(z,N)-M>-1e-4*M){P.push(N),z=N,I.push(O);R=m(N,O),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F)}C=N}}var U=o(g,t.colormap,S,A);return f?U.tubeScale=f:(0===S&&(S=1),U.tubeScale=.5*u*A/S),U};var u=t("./lib/shaders"),f=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":342,"gl-cone3d":262,"gl-vec3":372,"gl-vec4":408}],345:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\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 vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\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"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(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\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\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 (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n 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"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\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 worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\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"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\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 (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) 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,a,o,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,a,l,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,s,o,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,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":332,glslify:434}],346:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new A(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,f,h,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||"jet",g.update(v),g};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),m=t("binary-search-bounds"),g=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[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 M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function A(t,e,r,n,i,a,o,l,c,u,h,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,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=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.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.pixelRatio=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}var S=A.prototype;S.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],L={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||E,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=L.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],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var P={model:w,view:w,projection:w,inverseModel:w.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,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=w.slice(),O=[1,0,0,0,1,0,0,0,1];function z(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,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.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-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=O,n.vertexColor=this.vertexColor;var s=I;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=C(n,this);if(u.showSurface){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=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var p=i+u,d=s+h,g=f*(h?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*g;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=m.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.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))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=R(t.contourWidth,Number)),"showContour"in t&&(this.showContour=R(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=R(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));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 i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(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&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(v=0;v<2;++v)if(c.shape[v]!==a[v])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=f(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;o halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},T.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),T.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=T.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(T.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var i=n.stringify({size:T.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=p(t.size),l=Math.round(s[0]*d(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&i==e.font[r].baseString||(a=!0,e.font[r]=T.fonts[i],e.font[r]))){var c=t.family.join(", "),u=[t.style];t.style!=t.variant&&u.push(t.variant),t.variant!=t.weight&&u.push(t.weight),_&&t.weight!=t.stretch&&u.push(t.stretch),e.font[r]={baseString:i,family:c,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:v(c,{origin:"top",fontSize:T.baseFontSize,fontStyle:u.join(" ")})},T.fonts[i]=e.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),h=0;h2){for(var w=!t.position[0].length,k=u.mallocFloat(2*this.count),M=0,A=0;M1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],T.normalViewport||(i*=-1),i}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var q;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;q=u.mallocUint8(G);for(var Y=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text="",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.normalViewport=!1,T.maxAtlasSize=1024,T.atlasCanvas=document.createElement("canvas"),T.atlasContext=T.atlasCanvas.getContext("2d",{alpha:!1}),T.baseFontSize=64,T.fonts={},e.exports=T},{"bit-twiddle":104,"color-normalize":131,"css-font":150,"detect-kerning":178,"es6-weak-map":238,"flatten-vertex-data":248,"font-atlas":249,"font-measure":250,"gl-util/context":349,"is-plain-obj":447,"object-assign":476,"parse-rect":481,"parse-unit":483,"pick-by-alias":485,regl:526,"to-px":585,"typedarray-pool":601}],348:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("ndarray-ops"),a=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||c(t);if("number"==typeof arguments[1])return v(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return v(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=u(e)?e:e.raw;if(r)return y(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return x(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function u(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}var f=function(t,e){i.muls(t,e,255)};function h(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 p(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}var d=p.prototype;function m(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 g(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 v(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 o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}function y(t,e,r,n,i,a){var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new p(t,o,r,n,i,a)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=m(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var u,h,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];h=a.malloc(v,r);var x=n(h,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):f(x,e),u=h.subarray(0,v)}var b=g(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||a.free(h),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.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(),l.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(),l.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(l.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 h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),d.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},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.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)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}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]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,u){var h=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,g=0,v=m(p,u.stride.slice());"float32"===h?d=t.FLOAT:"float64"===h?(d=t.FLOAT,v=!1,h="float32"):"uint8"===h?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,h="uint8");if(2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s);if(g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,u):i.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:472,"ndarray-ops":467,"typedarray-pool":601}],349:[function(t,e,r){(function(r){(function(){"use strict";var n=t("pick-by-alias");function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function a(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},a(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),i(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),i(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":485}],350:[function(t,e,r){"use strict";e.exports=function(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;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":365,"./fromValues":371,"./normalize":382}],356:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],357:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],358:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],359:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],360:[function(t,e,r){e.exports=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}},{}],361:[function(t,e,r){e.exports=t("./distance")},{"./distance":362}],362:[function(t,e,r){e.exports=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)}},{}],363:[function(t,e,r){e.exports=t("./divide")},{"./divide":364}],364:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],365:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],366:[function(t,e,r){e.exports=1e-6},{}],367:[function(t,e,r){e.exports=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*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":366}],368:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],369:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],370:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],383:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],384:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},{}],385:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},{}],386:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},{}],387:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],388:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],389:[function(t,e,r){e.exports=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}},{}],390:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],391:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":393}],392:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":394}],393:[function(t,e,r){e.exports=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}},{}],394:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],395:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":396}],396:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],397:[function(t,e,r){e.exports=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}},{}],398:[function(t,e,r){e.exports=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}},{}],399:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t}},{}],400:[function(t,e,r){e.exports=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}},{}],401:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],402:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],403:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],404:[function(t,e,r){e.exports=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)}},{}],405:[function(t,e,r){e.exports=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}},{}],406:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],407:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],408:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":400,"./clone":401,"./copy":402,"./create":403,"./distance":404,"./divide":405,"./dot":406,"./fromValues":407,"./inverse":409,"./length":410,"./lerp":411,"./max":412,"./min":413,"./multiply":414,"./negate":415,"./normalize":416,"./random":417,"./scale":418,"./scaleAndAdd":419,"./set":420,"./squaredDistance":421,"./squaredLength":422,"./subtract":423,"./transformMat4":424,"./transformQuat":425}],409:[function(t,e,r){e.exports=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}},{}],410:[function(t,e,r){e.exports=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)}},{}],411:[function(t,e,r){e.exports=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}},{}],412:[function(t,e,r){e.exports=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}},{}],413:[function(t,e,r){e.exports=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}},{}],414:[function(t,e,r){e.exports=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}},{}],415:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],416:[function(t,e,r){e.exports=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;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],417:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":416,"./scale":418}],418:[function(t,e,r){e.exports=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}},{}],419:[function(t,e,r){e.exports=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}},{}],420:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],421:[function(t,e,r){e.exports=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}},{}],422:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],423:[function(t,e,r){e.exports=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}},{}],424:[function(t,e,r){e.exports=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}},{}],425:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t[3]=e[3],t}},{}],426:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return M(r),v+=r.length,(p=p.slice(r.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(M(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function O(){return"."===e||/[eE]/.test(e)?(p.push(e),h=5,r=e,u+1):"x"===e&&1===p.length&&"0"===p[0]?(h=11,p.push(e),r=e,u+1):/[^\d]/.test(e)?(M(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function z(){return"f"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(M(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function D(){if(/[^\d\w_]/.test(e)){var t=p.join("");return h=k[t]?8:T[t]?7:6,M(p.join("")),h=999,u}return p.push(e),r=e,u+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":429,"./lib/builtins-300es":428,"./lib/literals":431,"./lib/literals-300es":430,"./lib/operators":432}],428:[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":429}],429:[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"]},{}],430:[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","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":431}],431:[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","uint","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"]},{}],432:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],433:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":427}],434:[function(t,e,r){arguments[4][268][0].apply(r,arguments)},{dup:268}],435:[function(t,e,r){(function(r){(function(){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":442}],436:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":442}],437:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}},{}],438:[function(t,e,r){"use strict";e.exports=function(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 o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var f=new a(l,new Array(i+1),!1),h=f.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var v=new a(d,new Array(i+1),!0);h[u]=v,p[u]=v}p[i+1]=f;for(u=0;u<=i;++u){d=h[u].vertices;var y=h[u].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)y[m]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[m]=h[b])}}var _=new c(i,o,p),w=!!e;for(u=i+1;u0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var p=this.orient();if(a[u]=h,p<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var p=(e=f.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var v=d[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var M=_.indexOf(e);if(!(M<0)){_[M]=k,T[m]=v,w[g]=-1,T[g]=e,d[g]=k,k.flip();for(b=0;b<=n;++b){var A=w[b];if(!(A<0||A===r)){for(var S=new Array(n-1),E=0,L=0;L<=n;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new o(S,k,b))}}}}}}h.sort(s);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":534,"simplicial-complex":545}],439:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],440:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(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}e.exports=function(t){if(!t||0===t.length)return new v(null);return new v(g(t))};var a=i.prototype;function o(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 s(t,e){var r=g(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 l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function h(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},a.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":103}],441:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r * @license MIT */ -e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],454:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],455:[function(t,e,r){"use strict";e.exports=a,e.exports.isMobile=a,e.exports.default=a;var n=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/(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[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function a(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?i.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],456:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],457:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],458:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],459:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],460:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],461:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=i;else t=i}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}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){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function g(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function m(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function y(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}var b={};function _(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var M=null;function S(t){if(null==M){var e=t.navigator?t.navigator.userAgent:null;M=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return M}function E(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,C,P,I,O=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),z=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,D=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:O,frame:function(t){var e=z(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=self.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==C&&(C=self.matchMedia("(prefers-reduced-motion: reduce)")),C.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){if(N||!I)return;j?U(t):P=t}},N=!1,j=!1;function U(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,I),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((I=self.document.createElement("img")).onload=function(){P&&U(P),P=null,j=!0},I.onerror=function(){N=!0,P=null},I.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01";var q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=X(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var i=X(t);return H(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,Z(i))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=X(t),n=R.devicePixelRatio>=2||512===e?"@2x":"",i=B.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){_("Unable to write to LocalStorage")}},K.prototype.processRequests=function(t){},K.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var a=X(F.EVENTS_URL);a.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?u(o,e):o,l={url:Z(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(l,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},K.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=p()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(K),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||Y(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=p(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(K)),rt=et.postTurnstileEvent.bind(et),nt=new tt,it=nt.postMapLoadEvent.bind(nt),at=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=A(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return _(t.message)}))}))}}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ut(t,e){if(st(),!Q)return e(null);var r=ct(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=A(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}var ft,ht=1/0;function pt(){return null==ft&&(ft=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ft}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var gt=function(t){function e(e,r,n){401===r&&Y(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),mt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function vt(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:mt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&Y(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&_(r),n&&a)return c(n);var l=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,l)}return e(new gt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&<(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?ut(i,l):l(null,null),{cancel:function(){o=!0,a||n.abort()}}}var yt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(mt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return vt(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new gt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return yt(u(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return yt(u(t,{method:"POST"}),e)};var _t,wt;_t=[],wt=0;var Tt=function(t,e){if(B.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),wt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}wt++;var n=!1,i=function(){if(!n)for(n=!0,wt--;_t.length&&wt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Et.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Lt={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ct=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.key,r=t.value;return r?[new Ct(e,r,"constants have been deprecated as of v8")]:[]}function It(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Zt=[Ft,Bt,Nt,jt,Ut,Gt,Vt,Wt(qt),Yt];function Jt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Zt;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(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}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),f=i.substr(l+1,c-(l+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,d=o(f[1]),g=o(f[2]),m=g<=.5?g*(d+1):g+d-g*d,v=2*g-m;return[n(255*s(v,m,p+1/3)),n(255*s(v,m,p)),n(255*s(v,m,p-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},te.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in fe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=fe[s],n++}else a=qt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Wt(a,o)}else r=fe[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Gt,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Bt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Wt(Nt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Ut)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var f=e.parse(t[a],1,qt);if(!f)return null;var h=f.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new pe(n)},pe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Yt?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var ge={"to-boolean":jt,"to-color":Ut,"to-number":Bt,"to-string":Nt},me=function(t,e){this.type=t,this.args=e};me.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=ge[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ae(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Te(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*8192),Math.round(i*a*8192)]}function ke(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ae(t,e){for(var r,n,i,a,o,s,l,c=!1,u=0,f=e.length;u0&&f<0||u<0&&f>0}function Ee(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}_e(e,t)}function ze(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ne(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ue("Input is not a number.");o=s-1}return 0}Ue.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new he(e,[t]):"coerce"===r?new me(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof ce)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof xe&&"error"===e.name)return!1;if(e instanceof be)return!1;if(e instanceof Re)return!1;var r=e instanceof me||e instanceof he,n=!0;if(e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ce})),!n)return!1;return Fe(e)&&Ne(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new ye;try{a=new ce(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,i,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Dt(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Jt(t,e);return r&&this.error(r),r};var qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new qe(i,r,n)},qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ve(e,n)].evaluate(t)},qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ge=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new te(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return He(t,e[n],r)}))}}),Ye=6/29,We=3*Ye*Ye,Xe=Math.PI/180,Ze=180/Math.PI;function Je(t){return t>.008856451679035631?Math.pow(t,1/3):t/We+4/29}function Ke(t){return t>Ye?t*t*t:We*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),n=$e(t.b),i=Je((.4124564*e+.3575761*r+.1804375*n)/.95047),a=Je((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-Je((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Qe(3.2404542*r-1.5371385*e-.4985314*n),Qe(-.969266*r+1.8760108*e+.041556*n),Qe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function rr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ir={forward:function(t){var e=tr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*Ze;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},ar=Object.freeze({__proto__:null,lab:nr,hcl:ir}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Bt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=f)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var g=e.parse(h,d,c);if(!g)return null;c=c||g.type,l.push([f,g])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new or(c,r,n,i,l):e.error("Type "+Xt(c)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Ve(e,n),o=e[a],s=e[a+1],l=or.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?Ge[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?ir.reverse(ir.interpolate(ir.forward(c),ir.forward(u),l)):nr.reverse(nr.interpolate(nr.forward(c),nr.forward(u),l))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var fr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};fr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);return r&&n?Kt(r.type,[jt,Nt,Bt,Ft,qt])?new fr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead"):null},fr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");return r.indexOf(e)>=0},fr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},fr.prototype.outputDefined=function(){return!0},fr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Bt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,qt);if(!r||!n)return null;if(!Kt(r.type,[jt,Nt,Bt,Ft,qt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};pr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,se(h)))return null}else r=se(h);if(void 0!==i[String(h)])return c.error("Branch labels must be unique.");i[String(h)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,qt);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,a,g):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,qt),n=e.parse(t[2],2,Bt);if(!r||!n)return null;if(!Kt(r.type,[Wt(qt),Nt,qt]))return e.error("Expected first argument to be of type array or string, but found "+Xt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new gr(r.type,r,n,i):null}return new gr(r.type,r,n)},gr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Xt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},gr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},gr.prototype.outputDefined=function(){return!1},gr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xr=yr("==",(function(t,e,r){return e===r}),vr),br=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!vr(0,e,r,n)})),_r=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Tr=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),kr=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Ar=function(t,e,r,n,i){this.type=Nt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ar.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Nt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Nt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Bt))?null:new Ar(r,i,a,o,s)},Ar.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Ar.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Mr=function(t){this.type=Bt,this.input=t};Mr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Xt(r.type)+" instead."):new Mr(r):null},Mr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Xt(se(e))+" instead.")},Mr.prototype.eachChild=function(t){t(this.input)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":xr,"!=":br,">":wr,"<":_r,">=":kr,"<=":Tr,array:he,at:ur,boolean:he,case:dr,coalesce:lr,collator:be,format:pe,image:de,in:fr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Mr,let:cr,literal:ce,match:pr,number:he,"number-format":Ar,object:he,slice:gr,step:qe,string:he,"to-boolean":me,"to-color":me,"to-number":me,"to-string":me,var:je,within:Re};function Er(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=ae(r,n,i,o);if(s)throw new ue(s);return new te(r/255*o,n/255*o,i/255*o,o)}function Lr(t,e){return t in e}function Cr(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Ir(t){return{result:"success",value:t}}function Or(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Br(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return jr(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ve(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Fr(r))return jr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Ve(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Ge[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=ar[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function Hr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}xe.register(Sr,{error:[{kind:"error"},[Nt],function(t,e){var r=e[0];throw new ue(r.evaluate(t))}],typeof:[Nt,[qt],function(t,e){return Xt(se(e[0].evaluate(t)))}],"to-rgba":[Wt(Bt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Bt,Bt,Bt],Er],rgba:[Ut,[Bt,Bt,Bt,Bt],Er],has:{type:jt,overloads:[[[Nt],function(t,e){return Lr(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Lr(r.evaluate(t),n.evaluate(t))}]]},get:{type:qt,overloads:[[[Nt],function(t,e){return Cr(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Cr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[qt,[Nt],function(t,e){return Cr(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[Nt,[],function(t){return t.geometryType()}],id:[qt,[],function(t){return t.id()}],zoom:[Bt,[],function(t){return t.globals.zoom}],"heatmap-density":[Bt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Bt,[],function(t){return t.globals.lineProgress||0}],accumulated:[qt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Bt,Pr(Bt),function(t,e){for(var r=0,n=0,i=e;n":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[jt,[qt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[jt,[Nt,qt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[jt,[qt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[jt,[qt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[Wt(Nt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Wt(qt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Nt,Wt(qt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Nt,Wt(qt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Pr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Wr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Nt,number:Bt,enum:Nt,boolean:jt,formatted:Gt,resolvedImage:Yt};if("array"===t.type)return Wt(e[t.value]||qt,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ir(new Gr(n,e)):Or(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Be(e.expression)};Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Xr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var Zr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Be(e.expression),this.interpolationType=n};function Jr(t,e){if("error"===(t=Wr(t,e)).result)return t;var r=t.value.expression,n=Fe(r);if(!n&&!zr(e))return Or([new Dt("","data expressions not supported")]);var i=Ne(r,["zoom"]);if(!i&&!Dr(e))return Or([new Dt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof cr)r=t(e.result);else if(e instanceof lr)for(var n=0,i=e.args;nn.maximum?[new Ct(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function en(t){var e,r,n,i=t.valueSpec,a=Ot(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),u=Qr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Ct(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat($r({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===Fr(r)&&0===r.length&&e.push(new Ct(t.key,r,"array must have at least one stop"));return e},default:function(t){return kn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Ct(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new Ct(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Rr(t.valueSpec)&&u.push(new Ct(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!zr(t.valueSpec)?u.push(new Ct(t.key,t.value,"property functions not supported")):s&&!Dr(t.valueSpec)&&u.push(new Ct(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new Ct(t.key,t.value,'"property" property is required')),u;function f(t){var e=[],a=t.value,s=t.key;if("array"!==Fr(a))return[new Ct(s,a,"array expected, "+Fr(a)+" found")];if(2!==a.length)return[new Ct(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Fr(a[0]))return[new Ct(s,a,"object expected, "+Fr(a[0])+" found")];if(void 0===a[0].zoom)return[new Ct(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Ct(s,a,"object stop key must have value")];if(n&&n>Ot(a[0].zoom))return[new Ct(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ot(a[0].zoom)!==n&&(n=Ot(a[0].zoom),r=void 0,o={}),e=e.concat(Qr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tn,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Yr(zt(a[1]))?e.concat([new Ct(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(kn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Fr(t.value),l=Ot(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Ct(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ct(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return zr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ct(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function cn(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?pn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cn))):"all"===r?["all"].concat(t.slice(1).map(cn)):"none"===r?["all"].concat(t.slice(1).map(cn).map(pn)):"in"===r?fn(t[1],t.slice(2)):"!in"===r?pn(fn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function un(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function fn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ln)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function dn(t){return an(zt(t.value))?rn(It({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Fr(r))return[new Ct(n,r,"array expected, "+Fr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new Ct(n,r,"filter array must have at least 1 element")];switch(o=o.concat(nn({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ot(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ot(r[1])&&o.push(new Ct(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Ct(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Fr(r[1]))&&o.push(new Ct(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=u[p+0]&&n>=u[p+1])?(o[h]=!0,a.push(c[h])):o[h]=!1}}},Dn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),f=this._convertToCellCoord(n),h=l;h<=u;h++)for(var p=c;p<=f;p++){var d=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},Dn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Dn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Dn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var f=t[u];c[u]=Bn[l].shallow.indexOf(u)>=0?f:qn(f,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function Hn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Hn);if("object"==typeof t){var e=t.$name||"Object",r=Bn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:Hn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Wn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Yn["CJK Compatibility Ideographs"](t)||(!!Yn["CJK Compatibility"](t)||(!!Yn["CJK Radicals Supplement"](t)||(!!Yn["CJK Strokes"](t)||(!(!Yn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Yn["CJK Unified Ideographs Extension A"](t)||(!!Yn["CJK Unified Ideographs"](t)||(!!Yn["Enclosed CJK Letters and Months"](t)||(!!Yn["Hangul Compatibility Jamo"](t)||(!!Yn["Hangul Jamo Extended-A"](t)||(!!Yn["Hangul Jamo Extended-B"](t)||(!!Yn["Hangul Jamo"](t)||(!!Yn["Hangul Syllables"](t)||(!!Yn.Hiragana(t)||(!!Yn["Ideographic Description Characters"](t)||(!!Yn.Kanbun(t)||(!!Yn["Kangxi Radicals"](t)||(!!Yn["Katakana Phonetic Extensions"](t)||(!(!Yn.Katakana(t)||12540===t)||(!(!Yn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Yn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Yn["Unified Canadian Aboriginal Syllabics"](t)||(!!Yn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Yn["Vertical Forms"](t)||(!!Yn["Yijing Hexagram Symbols"](t)||(!!Yn["Yi Syllables"](t)||!!Yn["Yi Radicals"](t))))))))))))))))))))))))))))))}function Jn(t){return!(Zn(t)||function(t){return!(!Yn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Yn["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!Yn["Letterlike Symbols"](t)||(!!Yn["Number Forms"](t)||(!(!Yn["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!Yn["Control Pictures"](t)||9251===t)||(!!Yn["Optical Character Recognition"](t)||(!!Yn["Enclosed Alphanumerics"](t)||(!!Yn["Geometric Shapes"](t)||(!(!Yn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Yn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Yn["CJK Symbols and Punctuation"](t)||(!!Yn.Katakana(t)||(!!Yn["Private Use Area"](t)||(!!Yn["CJK Compatibility Forms"](t)||(!!Yn["Small Form Variants"](t)||(!!Yn["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function Kn(t){return t>=1424&&t<=2303||Yn["Arabic Presentation Forms-A"](t)||Yn["Arabic Presentation Forms-B"](t)}function Qn(t,e){return!(!e&&Kn(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Yn.Khmer(t))}function $n(t){for(var e=0,r=t;e-1&&(ai=ni),ii&&ii(t)};function li(){ci.fire(new Mt("pluginStateChange",{pluginStatus:ai,pluginURL:oi}))}var ci=new Et,ui=function(){return ai},fi=function(){if(ai!==ti||!oi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ai=ei,li(),oi&&xt({url:oi},(function(t){t?si(t):(ai=ri,li())}))},hi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ai===ri||null!=hi.applyArabicShaping},isLoading:function(){return ai===ei},setState:function(t){ai=t.pluginStatus,oi=t.pluginURL},isParsed:function(){return null!=hi.applyArabicShaping&&null!=hi.processBidirectionalText&&null!=hi.processStyledBidirectionalText},getPluginURL:function(){return oi}},pi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Gn,this.transition={})};pi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var di=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Br(t))return new Kr(t,e);if(Yr(t)){var r=Jr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},di.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var gi=function(t){this.property=t,this.value=new di(t,void 0)};gi.prototype.transitioned=function(t,e){return new vi(this.property,this.value,e,u({},t.transition,this.transition),t.now)},gi.prototype.untransitioned=function(){return new vi(this.property,this.value,null,{},0)};var mi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};mi.prototype.getValue=function(t){return x(this._values[t].value.value)},mi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new gi(this._values[t].property)),this._values[t].value=new di(this._values[t].property,null===e?void 0:x(e))},mi.prototype.getTransition=function(t){return x(this._values[t].transition)},mi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new gi(this._values[t].property)),this._values[t].transition=x(e)||void 0},mi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var yi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};yi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new _i(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ti),Ai=function(t){this.specification=t};Ai.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new pi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new pi(Math.floor(e.zoom),e)),t.expression.evaluate(new pi(Math.floor(e.zoom+1),e)),e)}},Ai.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ai.prototype.interpolate=function(t){return t};var Mi=function(t){this.specification=t};Mi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Mi.prototype.interpolate=function(){return!1};var Si=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new di(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new gi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Nn("DataDrivenProperty",Ti),Nn("DataConstantProperty",wi),Nn("CrossFadedDataDrivenProperty",ki),Nn("CrossFadedProperty",Ai),Nn("ColorRampProperty",Mi);var Ei=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new xi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new mi(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _i(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(In,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return m(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Pn,n,t,e,r))return!1}if(m(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),y(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&On(this,t.call(Ln,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof bi&&zr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Et),Li={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ci=function(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},Pi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ii(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,a=(i=t.type,Li[i].BYTES_PER_ELEMENT),o=r=Oi(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Oi(r,Math.max(n,e)),alignment:e}}function Oi(t,e){return Math.ceil(t/e)*e}Pi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Pi.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Pi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Pi.prototype.clear=function(){this.length=0},Pi.prototype.resize=function(t){this.reserve(t),this.length=t},Pi.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Pi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Pi);zi.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",zi);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Pi);Di.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Di);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Pi);Ri.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Ri);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Pi);Fi.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Fi);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var f=9*t,h=18*t;return this.uint16[f+0]=e,this.uint16[f+1]=r,this.uint16[f+2]=n,this.uint16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.uint8[h+16]=c,this.uint8[h+17]=u,t},e}(Pi);Bi.prototype.bytesPerElement=18,Nn("StructArrayLayout8ui2ub18",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,f){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,a,o,s,l,c,u,f)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,f,h){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=f,this.int16[p+11]=h,t},e}(Pi);Ni.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",Ni);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Pi);ji.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",ji);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Pi);Ui.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Ui);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,f=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[f+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Pi);Vi.prototype.bytesPerElement=20,Nn("StructArrayLayout6i1ul2ui20",Vi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Pi);qi.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",qi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(Pi);Hi.prototype.bytesPerElement=16,Nn("StructArrayLayout2f1f2i16",Hi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Pi);Gi.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",Gi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Pi);Yi.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",Yi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v){var y=24*t,x=12*t,b=48*t;return this.int16[y+0]=e,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[x+7]=f,this.float32[x+8]=h,this.uint8[b+36]=p,this.uint8[b+37]=d,this.uint8[b+38]=g,this.uint32[x+10]=m,this.int16[y+22]=v,t},e}(Pi);Wi.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Wi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S,E){var L=34*t,C=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=i,this.int16[L+4]=a,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=c,this.uint16[L+9]=u,this.uint16[L+10]=f,this.uint16[L+11]=h,this.uint16[L+12]=p,this.uint16[L+13]=d,this.uint16[L+14]=g,this.uint16[L+15]=m,this.uint16[L+16]=v,this.uint16[L+17]=y,this.uint16[L+18]=x,this.uint16[L+19]=b,this.uint16[L+20]=_,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[C+12]=k,this.float32[C+13]=A,this.float32[C+14]=M,this.float32[C+15]=S,this.float32[C+16]=E,t},e}(Pi);Xi.prototype.bytesPerElement=68,Nn("StructArrayLayout8i15ui1ul4f68",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Pi);Zi.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Zi);var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Pi);Ji.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Ji);var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(Pi);Ki.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Ki);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Pi);Qi.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",Qi);var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Pi);$i.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",$i);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Pi);ta.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",ta);var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Pi);ea.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",ea);var ra=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ci);ra.prototype.size=20;var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ra(this,t)},e}(Vi);Nn("CollisionBoxArray",na);var ia=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ci);ia.prototype.size=48;var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ia(this,t)},e}(Wi);Nn("PlacedSymbolArray",aa);var oa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ci);oa.prototype.size=68;var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new oa(this,t)},e}(Xi);Nn("SymbolInstanceArray",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Zi);Nn("GlyphOffsetArray",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ji);Nn("SymbolLineVertexArray",ca);var ua=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ci);ua.prototype.size=8;var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ua(this,t)},e}(Ki);Nn("FeatureIndexArray",fa);var ha=Ii([{name:"a_pos",components:2,type:"Int16"}],4).members,pa=function(t){void 0===t&&(t=[]),this.segments=t};function da(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}pa.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>pa.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+pa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>pa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},pa.prototype.get=function(){return this.segments},pa.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),va=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ya=ma,xa=ma,ba=va;ya.murmur3=xa,ya.murmur2=ba;var _a=function(){this.ids=[],this.positions=[],this.indexed=!1};_a.prototype.add=function(t,e,r,n){this.ids.push(Ta(t)),this.positions.push(e,r,n)},_a.prototype.getPositions=function(t){for(var e=Ta(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},_a.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],o=n-1,s=i+1;;){do{o++}while(e[o]a);if(o>=s)break;ka(e,o,s),ka(r,3*o,3*s),ka(r,3*o+1,3*s+1),ka(r,3*o+2,3*s+2)}s-nGa.max||o.yGa.max)&&(_("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Ga.min,Ga.max),o.y=l(o.y,Ga.min,Ga.max))}return r}function Wa(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Xa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new zi,this.indexArray=new Yi,this.segments=new pa,this.programConfigurations=new Ua(ha,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Za(t,e){for(var r=0;r1){if($a(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function no(t,e){for(var r,n,i,a=!1,o=0;oe.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 io(t,e){for(var r=!1,n=0,i=t.length-1;ne.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}function ao(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=w(t,e,r[0]);return a!==w(t,e,r[1])||a!==w(t,e,r[2])||a!==w(t,e,r[3])}function oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function so(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function lo(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=8192||u<0||u>=8192)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=f.vertexLength;Wa(this.layoutVertexArray,c,u,-1,-1),Wa(this.layoutVertexArray,c,u,1,-1),Wa(this.layoutVertexArray,c,u,1,1),Wa(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Nn("CircleBucket",Xa,{omit:["layers"]});var co=new Si({"circle-sort-key":new Ti(Lt.layout_circle["circle-sort-key"])}),uo={paint:new Si({"circle-radius":new Ti(Lt.paint_circle["circle-radius"]),"circle-color":new Ti(Lt.paint_circle["circle-color"]),"circle-blur":new Ti(Lt.paint_circle["circle-blur"]),"circle-opacity":new Ti(Lt.paint_circle["circle-opacity"]),"circle-translate":new wi(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new wi(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wi(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wi(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ti(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ti(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ti(Lt.paint_circle["circle-stroke-opacity"])}),layout:co},fo="undefined"!=typeof Float32Array?Float32Array:Array;function ho(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}function po(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],p=e[10],d=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*f+w*g,t[1]=x*i+b*l+_*h+w*m,t[2]=x*a+b*c+_*p+w*v,t[3]=x*o+b*u+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*g,t[5]=x*i+b*l+_*h+w*m,t[6]=x*a+b*c+_*p+w*v,t[7]=x*o+b*u+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*g,t[9]=x*i+b*l+_*h+w*m,t[10]=x*a+b*c+_*p+w*v,t[11]=x*o+b*u+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*g,t[13]=x*i+b*l+_*h+w*m,t[14]=x*a+b*c+_*p+w*v,t[15]=x*o+b*u+_*d+w*y,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var go=po;var mo,vo,yo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};mo=new fo(3),fo!=Float32Array&&(mo[0]=0,mo[1]=0,mo[2]=0),vo=mo;function xo(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(){var t=function(){var t=new fo(4);return fo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var bo=function(t){var e=t[0],r=t[1];return e*e+r*r},_o=(function(){var t=function(){var t=new fo(2);return fo!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),function(t){function e(e){t.call(this,e,uo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xa(t)},e.prototype.queryRadius=function(t){var e=t;return oo("circle-radius",this,e)+oo("circle-stroke-width",this,e)+so(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),f=u?l:function(t,e){return t.map((function(t){return wo(t,e)}))}(l,s),h=u?c*o:c,p=0,d=n;pt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return jo(h,p,r,n,i,c),p}function Bo(t,e,r,n,i){var a,o;if(i===ls(t,e,r,n)>0)for(a=e;a=e;a-=n)o=as(a,t[a],t[a+1],o);return o&&$o(o,o.next)&&(os(o),o=o.next),o}function No(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!$o(n,n.next)&&0!==Qo(n.prev,n,n.next))n=n.next;else{if(os(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Xo(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,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Vo(t,n,i,a):Uo(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),os(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?jo(t=qo(No(t),e,r),e,r,n,i,a,2):2===o&&Ho(t,e,r,n,i,a):jo(No(t),e,r,n,i,a,1);break}}}function Uo(t){var e=t.prev,r=t,n=t.next;if(Qo(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Jo(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Qo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Vo(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Qo(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Xo(s,l,e,r,n),h=Xo(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=f&&d&&d.z<=h;){if(p!==t.prev&&p!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Qo(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Qo(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function qo(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!$o(i,a)&&ts(i,n,n.next,a)&&ns(i,a)&&ns(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),os(n),os(n.next),n=t=a),n=n.next}while(n!==t);return No(n)}function Ho(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ko(o,s)){var l=is(o,s);return o=No(o,o.next),l=No(l,l.next),jo(o,e,r,n,i,a),void jo(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Go(t,e){return t.x-e.x}function Yo(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.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.x&&n.x>=u&&i!==n.x&&Jo(ar.x||n.x===r.x&&Wo(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}(t,e)){var r=is(e,t);No(e,e.next),No(r,r.next)}}function Wo(t,e){return Qo(t.prev,t,e.prev)<0&&Qo(e.next,t,t.next)<0}function Xo(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Zo(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Ko(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&ts(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ns(t,e)&&ns(e,t)&&function(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&&r.next.y!==r.y&&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}(t,e)&&(Qo(t.prev,t,e.prev)||Qo(t,e.prev,e))||$o(t,e)&&Qo(t.prev,t,t.next)>0&&Qo(e.prev,e,e.next)>0)}function Qo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $o(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,r,n){var i=rs(Qo(t,e,r)),a=rs(Qo(t,e,n)),o=rs(Qo(r,n,t)),s=rs(Qo(r,n,e));return i!==a&&o!==s||(!(0!==i||!es(t,r,e))||(!(0!==a||!es(t,n,e))||(!(0!==o||!es(r,t,n))||!(0!==s||!es(r,e,n)))))}function es(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function rs(t){return t>0?1:t<0?-1:0}function ns(t,e){return Qo(t.prev,t,t.next)<0?Qo(t,e,t.next)>=0&&Qo(t,t.prev,e)>=0:Qo(t,e,t.prev)<0||Qo(t,t.next,e)<0}function is(t,e){var r=new ss(t.i,t.x,t.y),n=new ss(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 as(t,e,r,n){var i=new ss(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 os(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 ss(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 ls(t,e,r,n){for(var i=0,a=e,o=r-n;an;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1),f=Math.max(n,Math.floor(r-s*c/o+u)),h=Math.min(i,Math.floor(r+(o-s)*c/o+u));t(e,r,f,h,a)}var p=e[r],d=n,g=i;for(us(e,n,r),a(e[i],p)>0&&us(e,n,i);d0;)g--}0===a(e[n],p)?us(e,n,g):(g++,us(e,g,i)),g<=r&&(n=g+1),r<=g&&(i=g-1)}}(t,e,r||0,n||t.length-1,i||fs)}function us(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function fs(t,e){return te?1:0}function hs(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},Do.default=Ro;var ms=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new zi,this.indexArray=new Yi,this.indexArray2=new Qi,this.programConfigurations=new Ua(zo,t.layers,t.zoom),this.segments=new pa,this.segments2=new pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ms.prototype.populate=function(t,e,r){this.hasPattern=ds("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ws.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,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},ws.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=ws.types[this.type];function u(t){for(var e=0;e>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}(r))}function Es(t,e,r){if(3===t){var n=new As(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Ms.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 _s(this._pbf,e,this.extent,this._keys,this._values)};var Ls={VectorTile:function(t,e){this.layers=t.readFields(Es,{},e)},VectorTileFeature:_s,VectorTileLayer:As},Cs=Ls.VectorTileFeature.types,Ps=Math.pow(2,13);function Is(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ps)+o,i*Ps*2,a*Ps*2,Math.round(s))}var Os=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ri,this.indexArray=new Yi,this.programConfigurations=new Ua(bs,t.layers,t.zoom),this.segments=new pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function zs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Ds(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>8192}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>8192}))}Os.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ds("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var y=d[m-1];if(!zs(v,y)){f.vertexLength+4>pa.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(y)._perp()._unit(),b=y.dist(v);g+b>32768&&(g=0),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,g),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,g),g+=b,Is(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,g),Is(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,g);var _=f.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+l>pa.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Cs[t.type]){for(var w=[],T=[],k=f.vertexLength,A=0,M=s;A=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&v>c){var A=u.dist(p);if(A>2*f){var M=u.sub(u.sub(p)._mult(f/A)._round());this.updateDistance(p,M),this.addCurrentVertex(M,g,0,0,h),p=M}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(_i&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_100)y=m.mult(-1);else{var L=_*g.add(m).mag()/g.sub(m).mag();y._perp()._mult(L*(k?-1:1))}this.addCurrentVertex(u,y,0,0,h),this.addCurrentVertex(u,y.mult(-1),0,0,h)}else if("bevel"===E||"fakeround"===E){var C=-Math.sqrt(_*_-1),P=k?C:0,I=k?0:C;if(p&&this.addCurrentVertex(u,g,P,I,h),"fakeround"===E)for(var O=Math.round(180*w/Math.PI/20),z=1;z2*f){var j=u.add(d.sub(u)._mult(f/N)._round());this.updateDistance(u,j),this.addCurrentVertex(j,m,0,0,h),u=j}}}}},Hs.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>qs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},Hs.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u},Hs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(qs-1):this.distance},Hs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Nn("LineBucket",Hs,{omit:["layers","patternFeatures"]});var Gs=new Si({"line-cap":new wi(Lt.layout_line["line-cap"]),"line-join":new Ti(Lt.layout_line["line-join"]),"line-miter-limit":new wi(Lt.layout_line["line-miter-limit"]),"line-round-limit":new wi(Lt.layout_line["line-round-limit"]),"line-sort-key":new Ti(Lt.layout_line["line-sort-key"])}),Ys={paint:new Si({"line-opacity":new Ti(Lt.paint_line["line-opacity"]),"line-color":new Ti(Lt.paint_line["line-color"]),"line-translate":new wi(Lt.paint_line["line-translate"]),"line-translate-anchor":new wi(Lt.paint_line["line-translate-anchor"]),"line-width":new Ti(Lt.paint_line["line-width"]),"line-gap-width":new Ti(Lt.paint_line["line-gap-width"]),"line-offset":new Ti(Lt.paint_line["line-offset"]),"line-blur":new Ti(Lt.paint_line["line-blur"]),"line-dasharray":new Ai(Lt.paint_line["line-dasharray"]),"line-pattern":new ki(Lt.paint_line["line-pattern"]),"line-gradient":new Mi(Lt.paint_line["line-gradient"])}),layout:Gs},Ws=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new pi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Ti))(Ys.paint.properties["line-width"].specification);Ws.useIntegerZoom=!0;var Xs=function(t){function e(e){t.call(this,e,Ys)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Co(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ws.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Hs(t)},e.prototype.queryRadius=function(t){var e=t,r=Zs(oo("line-width",this,e),oo("line-gap-width",this,e)),n=oo("line-offset",this,e);return r/2+Math.abs(n)+so(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var l=lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*Zs(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a=3)for(var a=0;a0?e+2*t:t}var Js=Ii([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ks=Ii([{name:"a_projected_pos",components:3,type:"Float32"}],4),Qs=(Ii([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ii([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),$s=(Ii([{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:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ii([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),tl=Ii([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ii([{name:"triangle",components:3,type:"Uint16"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ii([{type:"Float32",name:"offsetX"}]),Ii([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function el(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),hi.applyArabicShaping&&(t=hi.applyArabicShaping(t)),t}(t.text,e,r)})),t}var rl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var nl=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},il=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g},al=ol;function ol(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ol.Varint=0,ol.Fixed64=1,ol.Bytes=2,ol.Fixed32=5;var sl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ll(t){return t.type===ol.Bytes?t.readVarint()+t.pos:t.pos+1}function cl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ul(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(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 fl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ol.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,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=bl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=bl(this.buf,this.pos)+4294967296*bl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=bl(this.buf,this.pos)+4294967296*wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return cl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},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.pos;return this.pos=t,t-e>=12&&sl?function(t,e,r){return sl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ol.Bytes)return t.push(this.readVarint(e));var r=ll(this);for(t=t||[];this.pos127;);else if(e===ol.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ol.Fixed32)this.pos+=4;else{if(e!==ol.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),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),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ul(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),il(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),il(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&ul(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ol.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,xl,e)},writeBytesField:function(t,e){this.writeTag(t,ol.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ol.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ol.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Tl(t,e,r){1===t&&r.readMessage(kl,e)}function kl(t,e,r){if(3===t){var n=r.readMessage(Al,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new So({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Al(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())}function Ml(t){for(var e=0,r=0,n=0,i=t;n=0;h--){var p=o[h];if(!(f.w>p.w||f.h>p.h)){if(f.x=p.x,f.y=p.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===p.w&&f.h===p.h){var d=o.pop();h0&&N>A&&(A=N)}else{var j=r[S.fontStack],U=j&&j[L];if(U&&U.rect)I=U.rect,P=U.metrics;else{var V=e[S.fontStack],q=V&&V[L];if(!q)continue;P=q.metrics}C=24*(_-S.scale)}D?(t.verticalizable=!0,k.push({glyph:L,imageName:O,x:h,y:p+C,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:I}),h+=z*S.scale+c):(k.push({glyph:L,imageName:O,x:h,y:p+C,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:I}),h+=P.advance*S.scale+c)}if(0!==k.length){var H=h-c;d=Math.max(H,d),Vl(k,0,k.length-1,m,A)}h=0;var G=a*_+A;T.lineOffset=Math.max(A,w),p+=G,g=Math.max(G,g),++v}else p+=a,++v}var Y;var W=p- -17,X=Ul(o),Z=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c=(e-r)*i,u=0;u=a!==o?-s*n- -17:(-n*l+.5)*o;for(var f=0,h=t;f=0&&n>=t&&zl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Il.prototype.substring=function(t,e){var r=new Il;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Il.prototype.toString=function(){return this.text},Il.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Il.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Pl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dl={};function Rl(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function Fl(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,f=0,h=0;h-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}function Jl(t){for(var e=0,r=0;rc){var d=(c-l)/p,g=He(f.x,h.x,d),m=He(f.y,h.y,d),v=new Hl(g,m,h.angleTo(f),u);return v._round(),!o||Zl(t,v,s,o,e)?v:void 0}l+=p}}function tc(t,e,r,n,i,a,o,s,l){var c=Kl(n,a,o),u=Ql(n,i),f=u*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-f=0&&_=0&&w=0&&p+u<=f){var T=new Hl(_,w,x,g);T._round(),i&&!Zl(e,T,o,i,a)||d.push(T)}}h+=y}l||d.length||s||(d=t(e,h/2,n,i,a,o,s,!0,c));return d}(t,h?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,f,h,!1,l)}function ec(t,e,r,n,a){for(var o=[],s=0;s=n&&h.x>=n||(f.x>=n?f=new i(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round():h.x>=n&&(h=new i(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),c&&f.equals(c[c.length-1])||(c=[f],o.push(c)),c.push(h)))))}return o}function rc(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,f=t.bottom-t.top,h=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},g=h.reduce(d,0),m=p.reduce(d,0),v=l-g,y=c-m,x=0,b=g,_=0,w=m,T=0,k=v,A=0,M=y;if(o.content&&n){var S=o.content;x=nc(h,0,S[0]),_=nc(p,0,S[1]),b=nc(h,S[0],S[2]),w=nc(p,S[1],S[3]),T=S[0]-x,A=S[1]-_,k=S[2]-S[0]-b,M=S[3]-S[1]-w}var E=function(n,a,l,c){var h=ac(n.stretch-x,b,u,t.left),p=oc(n.fixed-T,k,n.stretch,g),d=ac(a.stretch-_,w,f,t.top),v=oc(a.fixed-A,M,a.stretch,m),y=ac(l.stretch-x,b,u,t.left),S=oc(l.fixed-T,k,l.stretch,g),E=ac(c.stretch-_,w,f,t.top),L=oc(c.fixed-A,M,c.stretch,m),C=new i(h,d),P=new i(y,d),I=new i(y,E),O=new i(h,E),z=new i(p/s,v/s),D=new i(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];C._matMult(N),P._matMult(N),O._matMult(N),I._matMult(N)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=a.stretch+a.fixed,q=c.stretch+c.fixed;return{tl:C,tr:P,bl:O,br:I,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:D,minFontScaleX:k/s/u,minFontScaleY:M/s/f,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=ic(h,v,g),C=ic(p,y,m),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var g=o.top*s-l,m=o.bottom*s+l,v=o.left*s-l,y=o.right*s+l,x=o.collisionPadding;if(x&&(v-=x[0]*s,g-=x[1]*s,y+=x[2]*s,m+=x[3]*s),u){var b=new i(v,g),_=new i(y,g),w=new i(v,m),T=new i(y,m),k=u*Math.PI/180;b._rotate(k),_._rotate(k),w._rotate(k),T._rotate(k),v=Math.min(b.x,_.x,w.x,T.x),y=Math.max(b.x,_.x,w.x,T.x),g=Math.min(b.y,_.y,w.y,T.y),m=Math.max(b.y,_.y,w.y,T.y)}t.emplaceBack(e.x,e.y,v,g,y,m,r,n,a)}this.boxEndIndex=t.length},lc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=cc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function cc(t,e){return te?1:0}function uc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var f=o-n,h=s-a,p=Math.min(f,h),d=p/2,g=new lc([],fc);if(0===p)return new i(n,a);for(var m=n;my.d||!y.d)&&(y=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-y.d<=e||(d=b.h/2,g.push(new hc(b.p.x-d,b.p.y-d,d,t)),g.push(new hc(b.p.x+d,b.p.y-d,d,t)),g.push(new hc(b.p.x-d,b.p.y+d,d,t)),g.push(new hc(b.p.x+d,b.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+y.d)),y.p}function fc(t,e){return e.max-t.max}function hc(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,ro(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}lc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},lc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},lc.prototype.peek=function(){return this.data[0]},lc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},lc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var pc=Number.POSITIVE_INFINITY;function dc(t,e){return e[1]!==pc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function gc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function mc(t,e,r,n,a,o,s,l,c,u,f,h,p,d,g){var m=function(t,e,r,n,a,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],f=0,h=e.positionedLines;f32640&&_(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((y=[128*d.compositeTextSizes[0].evaluate(s,{},g),128*d.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||y[1]>32640)&&_(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,y,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,g);for(var x=0,b=f;x=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var f=e.iconDependencies,h=e.glyphDependencies,p=e.availableImages,d=new pi(this.zoom),g=0,m=t;g=0;for(var O=0,z=k.sections;O=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},Mc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Mc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Mc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Mc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Mc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Nn("SymbolBucket",Mc,{omit:["layers","collisionBoxArray","features","compareText"]}),Mc.MAX_GLYPHS=65535,Mc.addDynamicAttributes=wc;var Sc=new Si({"symbol-placement":new wi(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new wi(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wi(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ti(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wi(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wi(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wi(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new wi(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wi(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ti(Lt.layout_symbol["icon-size"]),"icon-text-fit":new wi(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wi(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ti(Lt.layout_symbol["icon-image"]),"icon-rotate":new Ti(Lt.layout_symbol["icon-rotate"]),"icon-padding":new wi(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new wi(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ti(Lt.layout_symbol["icon-offset"]),"icon-anchor":new Ti(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wi(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wi(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wi(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new Ti(Lt.layout_symbol["text-field"]),"text-font":new Ti(Lt.layout_symbol["text-font"]),"text-size":new Ti(Lt.layout_symbol["text-size"]),"text-max-width":new Ti(Lt.layout_symbol["text-max-width"]),"text-line-height":new wi(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ti(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new Ti(Lt.layout_symbol["text-justify"]),"text-radial-offset":new Ti(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wi(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ti(Lt.layout_symbol["text-anchor"]),"text-max-angle":new wi(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new wi(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new Ti(Lt.layout_symbol["text-rotate"]),"text-padding":new wi(Lt.layout_symbol["text-padding"]),"text-keep-upright":new wi(Lt.layout_symbol["text-keep-upright"]),"text-transform":new Ti(Lt.layout_symbol["text-transform"]),"text-offset":new Ti(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new wi(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wi(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new wi(Lt.layout_symbol["text-optional"])}),Ec={paint:new Si({"icon-opacity":new Ti(Lt.paint_symbol["icon-opacity"]),"icon-color":new Ti(Lt.paint_symbol["icon-color"]),"icon-halo-color":new Ti(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ti(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ti(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new wi(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new wi(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ti(Lt.paint_symbol["text-opacity"]),"text-color":new Ti(Lt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ti(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new Ti(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ti(Lt.paint_symbol["text-halo-blur"]),"text-translate":new wi(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new wi(Lt.paint_symbol["text-translate-anchor"])}),layout:Sc},Lc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};Lc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Lc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Lc.prototype.outputDefined=function(){return!1},Lc.prototype.serialize=function(){return null},Nn("FormatSectionOverride",Lc,{omit:["defaultValue"]});var Cc=function(t){function e(e){t.call(this,e,Ec)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},Hc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Hc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Hn(e.error)):n(null,Hn(e.data)))}else{var i=!1,a=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,a)},a)}:function(t){i=!0},s=null,l=Hn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Yc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Yc.prototype.setNorthEast=function(t){return this._ne=t instanceof Wc?new Wc(t.lng,t.lat):Wc.convert(t),this},Yc.prototype.setSouthWest=function(t){return this._sw=t instanceof Wc?new Wc(t.lng,t.lat):Wc.convert(t),this},Yc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Wc)e=t,r=t;else{if(!(t instanceof Yc)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Yc.convert(a))}var o=t;return this.extend(Wc.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Wc(e.lng,e.lat),this._ne=new Wc(r.lng,r.lat)),this},Yc.prototype.getCenter=function(){return new Wc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Yc.prototype.getSouthWest=function(){return this._sw},Yc.prototype.getNorthEast=function(){return this._ne},Yc.prototype.getNorthWest=function(){return new Wc(this.getWest(),this.getNorth())},Yc.prototype.getSouthEast=function(){return new Wc(this.getEast(),this.getSouth())},Yc.prototype.getWest=function(){return this._sw.lng},Yc.prototype.getSouth=function(){return this._sw.lat},Yc.prototype.getEast=function(){return this._ne.lng},Yc.prototype.getNorth=function(){return this._ne.lat},Yc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Yc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Yc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Yc.prototype.contains=function(t){var e=Wc.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Yc.convert=function(t){return!t||t instanceof Yc?t:new Yc(t)};var Wc=function(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")};Wc.prototype.wrap=function(){return new Wc(c(this.lng,-180,180),this.lat)},Wc.prototype.toArray=function(){return[this.lng,this.lat]},Wc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Wc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Wc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Yc(new Wc(this.lng-r,this.lat-e),new Wc(this.lng+r,this.lat+e))},Wc.convert=function(t){if(t instanceof Wc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Wc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Wc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Xc=2*Math.PI*6371008.8;function Zc(t){return Xc*Math.cos(t*Math.PI/180)}function Jc(t){return(180+t)/360}function Kc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Qc(t,e){return t/Zc(e)}function $c(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var tu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};tu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Wc.convert(t);return new tu(Jc(r.lng),Kc(r.lat),Qc(e,r.lat))},tu.prototype.toLngLat=function(){return new Wc(360*this.x-180,$c(this.y))},tu.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Zc($c(e));var t,e},tu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xc*(t=$c(this.y),1/Math.cos(t*Math.PI/180));var t};var eu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=iu(0,t,t,e,r)};eu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},eu.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=Gc(256*r,256*(n=Math.pow(2,i)-n-1),i),o=Gc(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new nu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},nu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?iu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):iu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nu.prototype.children=function(t){if(this.overscaledZ>=t)return[new nu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nu(e,this.wrap,e,r,n),new nu(e,this.wrap,e,r+1,n),new nu(e,this.wrap,e,r,n+1),new nu(e,this.wrap,e,r+1,n+1)]},nu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},au.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},au.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},au.prototype.getPixels=function(){return new Eo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},au.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},uu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ls.VectorTile(new al(this.rawTileData)).layers,this.sourceLayerCoder=new ou(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},uu.prototype.query=function(t,e,r,n){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=sn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,f=hu(c),h=this.grid.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u),p=hu(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o=l.x&&a>=l.y)return!0}var c=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var u=0,f=c;u=0)return!0;return!1}(a,f)){var h=this.sourceLayerCoder.decode(r),p=this.vtLayers[h].feature(n);if(i.filter(new pi(this.tileID.overscaledZ),p))for(var d=this.getId(p,h),g=0;gn)i=!1;else if(e)if(this.expirationTimeot&&(t.getActor().send("enforceCacheSizeLimit",at),ht=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=ec,t.clone=function(t){var e=new fo(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},t.clone$1=x,t.clone$2=function(t){var e=new fo(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=tl,t.config=F,t.create=function(){var t=new fo(16);return fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new fo(9);return fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new fo(4);return fo!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Wr,t.createLayout=Ii,t.createStyleLayer=function(t){return"custom"===t.type?new Dc(t):new Rc[t.type](t)},t.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},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=He,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new al(t).readFields(Tl,[])},t.pbf=al,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=8192/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var f=t.textSizeData,h=f.minZoom,p=f.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new pi(h),o),c["text-size"].possiblyEvaluate(new pi(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,g=d.minZoom,m=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new pi(g),o),c["icon-size"].possiblyEvaluate(new pi(m),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new pi(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new pi(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new pi(18));for(var v=24*l.get("text-line-height"),y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),w=function(){var a=k[T],s=l.get("text-font").evaluate(a,{},o).join(","),c=b.evaluate(a,{},o),f=u.layoutTextSize.evaluate(a,{},o),h=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,g=[0,0];if(d){var m=d.toString(),w=24*l.get("text-letter-spacing").evaluate(a,{},o),A=function(t){for(var e=0,r=t;e=8192||f.y<0||f.y>=8192||function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g,m,v,y,x,b,w,T,k,A){var M,S,E,L,C,P=t.addToLineVertexArray(e,r),I=0,O=0,z=0,D=0,R=-1,F=-1,B={},N=ya(""),j=0,U=0;void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(M=s.layout.get("text-offset").evaluate(b,{},k).map((function(t){return 24*t})),j=M[0],U=M[1]):(j=24*s.layout.get("text-radial-offset").evaluate(b,{},k),U=pc);if(t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},k)+90,q=n.vertical;L=new sc(l,e,c,u,f,q,h,p,d,V),o&&(C=new sc(l,e,c,u,f,o,m,v,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),Y=rc(i,H,T,G),W=o?rc(o,H,T,G):void 0;E=new sc(l,e,c,u,f,i,m,v,!1,H),I=4*Y.length;var X=t.iconSizeData,Z=null;"source"===X.kind?(Z=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&_(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Z=[128*w.compositeIconSizes[0].evaluate(b,{},k),128*w.compositeIconSizes[1].evaluate(b,{},k)])[0]>32640||Z[1]>32640)&&_(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Y,Z,x,y,b,!1,e,P.lineStartIndex,P.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,W&&(O=4*W.length,t.addSymbols(t.icon,W,Z,x,y,b,Cl.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var J in n.horizontal){var K=n.horizontal[J];if(!S){N=ya(K.text);var Q=s.layout.get("text-rotate").evaluate(b,{},k);S=new sc(l,e,c,u,f,K,h,p,d,Q)}var $=1===K.positionedLines.length;if(z+=mc(t,e,K,a,s,d,b,g,P,n.vertical?Cl.horizontal:Cl.horizontalOnly,$?Object.keys(n.horizontal):[J],B,R,w,k),$)break}n.vertical&&(D+=mc(t,e,n.vertical,a,s,d,b,g,P,Cl.vertical,["vertical"],B,F,w,k));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=L?L.boxStartIndex:t.collisionBoxArray.length,nt=L?L.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,st=C?C.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(L,lt),lt=ct(E,lt);var ut=(lt=ct(C,lt))>-1?1:0;ut&&(lt*=A/24);t.glyphOffsetArray.length>=Mc.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,tt,et,rt,nt,it,at,ot,st,c,z,D,I,O,ut,0,h,j,U,lt)}(t,f,s,r,n,i,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,A,l,x,T,M,d,e,a,c,u,o)};if("line"===S)for(var P=0,I=ec(e.geometry,0,0,8192,8192);P1){var V=$l(U,k,r.vertical||g,n,24,y);V&&C(U,V)}}else if("Polygon"===e.type)for(var q=0,H=hs(e.geometry,0);q=E.maxzoom))if("none"!==E.visibility)o(S,this.zoom,n),(g[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,m,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id})))}}}var L=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(L).length?a.send("getGlyphs",{uid:this.uid,stacks:L},(function(t,e){f||(f=t,h=e,I.call(l))})):h={};var C=Object.keys(m.iconDependencies);C.length?a.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){f||(f=t,p=e,I.call(l))})):p={};var P=Object.keys(m.patternDependencies);function I(){if(f)return s(f);if(h&&p&&d){var e=new i(h),r=new t.ImageAtlas(p,d);for(var a in g){var l=g[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,h,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){f||(f=t,d=e,I.call(l))})):d={},I.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var f=o.finish();f&&(u.resourceTiming=JSON.parse(JSON.stringify(f)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,g=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};g.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;!function t(e,r,n,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=n-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),h=Math.max(i,Math.floor(n-l*u/s+f)),p=Math.min(a,Math.floor(n+(s-l)*u/s+f));t(e,r,n,h,p,o)}var d=r[2*n+o],g=i,m=a;for(z(e,r,i,n),r[2*a+o]>d&&z(e,r,i,a);gd;)m--}r[2*i+o]===d?z(e,r,i,m):(m++,z(e,r,m,a)),m<=n&&(i=m+1),n<=m&&(a=m-1)}}(t,e,o,n,i,a%2),O(t,e,r,n,o-1,a+1),O(t,e,r,o+1,i,a+1)}}function z(t,e,r,n){D(t,r,n),D(e,2*r,2*n),D(e,2*r+1,2*n+1)}function D(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function R(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=T,_.GeoJSONWrapper=k;var F=function(t){return t[0]},B=function(t){return t[1]},N=function(t,e,r,n,i){void 0===e&&(e=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var g=Math.floor((p+h)/2);s=e[2*g],l=e[2*g+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[g]);var m=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(p),c.push(g-1),c.push(m)),(0===f?i>=s:a>=l)&&(c.push(g+1),c.push(h),c.push(m))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),f=o.pop();if(u-f<=a)for(var h=f;h<=u;h++)R(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var p=Math.floor((f+u)/2),d=e[2*p],g=e[2*p+1];R(d,g,r,n)<=l&&s.push(t[p]);var m=(c+1)%2;(0===c?r-i<=d:n-i<=g)&&(o.push(f),o.push(p-1),o.push(m)),(0===c?r+i>=d:n+i>=g)&&(o.push(p+1),o.push(u),o.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=X(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function q(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:Y(n),y:W(i),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function Y(t){return t/360+.5}function W(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 X(t,e){for(var r in e)t[r]=e[r];return t}function Z(t){return t.x}function J(t){return t.y}function K(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function Q(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=n-r>>1,l=n-r,c=e[r],u=e[r+1],f=e[n],h=e[n+1],p=r+3;po)a=p,o=d;else if(d===o){var g=Math.abs(p-s);gi&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function nt(t,e,r,n){for(var i=0;i1?1:r}function ot(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var g=[];if("Point"===h||"MultiPoint"===h)st(f,g,r,n,i);else if("LineString"===h)lt(f,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)ut(f,g,r,n,i,!1);else if("Polygon"===h)ut(f,g,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function lt(t,e,r,n,i,a,o){for(var s,l,c=ct(t),u=0===i?ht:pt,f=t.start,h=0;hr&&(l=u(c,p,d,m,v,r),o&&(c.start=f+s*l)):y>n?x=r&&(l=u(c,p,d,m,v,r),b=!0),x>n&&y<=n&&(l=u(c,p,d,m,v,n),b=!0),!a&&b&&(o&&(c.end=f+s*l),e.push(c),c=ct(t)),o&&(f+=s)}var _=t.length-3;p=t[_],d=t[_+1],g=t[_+2],(y=0===i?p:d)>=r&&y<=n&&ft(c,p,d,g),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&ft(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ct(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ut(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),f>o.maxY&&(o.maxY=f)}return o}function xt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,Z,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,f=l.range(Y(r),W(a),Y(i),W(n));u1?this._map(c,!0):null,m=(l<<5)+(e+1)+this.points.length,v=0,y=f;v>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),h=this.tiles[f]=yt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(h.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var g,m,v,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,T=.5+_,k=1+_;g=m=v=y=null,x=ot(t,u,r-_,r+T,0,h.minX,h.maxX,l),b=ot(t,u,r+w,r+k,0,h.minX,h.maxX,l),t=null,x&&(g=ot(x,u,n-_,n+T,1,h.minY,h.maxY,l),m=ot(x,u,n+w,n+k,1,h.minY,h.maxY,l),x=null),b&&(v=ot(b,u,n-_,n+T,1,h.minY,h.maxY,l),y=ot(b,u,n+w,n+k,1,h.minY,h.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},_t.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,f=r;!l&&c>0;)c--,u=Math.floor(u/2),f=Math.floor(f/2),l=this.tiles[wt(c,u,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,f),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,f,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?mt(this.tiles[s],i):null):null};var kt=function(e){function r(t,r,n,i){e.call(this,t,r,n,Tt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));f(o,!0);try{e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function v(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var u=Math.abs(c-l.left),f=Math.abs(c-l.right),h=Math.min(u,f),p=void 0,d=i/r*(n+1);if(l.isDash){var g=n-Math.abs(d);p=Math.sqrt(h*h+g*g)}else p=n-Math.sqrt(h*h+d*d);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),f=Math.abs(c-l.right),h=Math.min(u,f),p=l.isDash?h:-h;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),I=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(I),z=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(It(this._source.type)){for(var c={},u={},f=0,h=Object.keys(l);fthis._source.maxzoom){var m=d.children(this._source.maxzoom)[0],v=this.getTile(m);if(v&&v.hasData()){n[m.key]=m;continue}}else{var y=d.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var x=g.wasRequested(),b=d.overscaledZ-1;b>=a;--b){var _=d.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(g=this.getTile(_))&&x&&(g=this._addTile(_)),g&&(n[_.key]=_,x=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),f=1/0,h=1/0,p=-1/0,d=-1/0,g=0,m=c;g=0&&v[1].y+m>=0){var y=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:y,cameraQueryGeometry:x,scale:g})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles){this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading")}this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function It(t){return"raster"===t||"image"===t||"video"===t}function Ot(){return new t.window.Worker(Zi.workerUrl)}Ct.maxOverzooming=10,Ct.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],h=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,m=!1,v=0;vMath.abs(n.x-r.x)*i)return{useVertical:!0};return(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,a,o,s,l,c,u,f,h,p,d){var g,m=r/24,v=e.lineOffsetX*m,y=e.lineOffsetY*m;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=ie(m,l,v,y,n,f,h,e,c,o,p);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,k=te(w.last.point,s).point;if(i&&!n){var A=ae(e.writingMode,T,k,d);if(A)return A}g=[w.first];for(var M=e.glyphStartIndex+1;M0?C.point:se(h,L,S,1,a),I=ae(e.writingMode,S,P,d);if(I)return I}var O=le(m*l.getoffsetX(e.glyphStartIndex),v,y,n,f,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!O)return{notEnoughRoom:!0};g=[O]}for(var z=0,D=g;z0?1:-1,g=0;i&&(d*=-1,g=Math.PI),d<0&&(g+=Math.PI);for(var m=d>0?l+s:l+s+1,v=a,y=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((m+=d)=c)return null;if(y=v,w.push(v),void 0===(v=h[m])){var T=new t.Point(u.getx(m),u.gety(m)),k=te(T,f);if(k.signedDistanceFromCamera>0)v=h[m]=k.point;else{var A=m-d;v=se(0===x?o:new t.Point(u.getx(A),u.gety(A)),T,y,_-x+1,f)}}x+=b,b=y.dist(v)}var M=(_-x)/b,S=v.sub(y),E=S.mult(M)._add(y);E._add(S._unit()._perp()._mult(n*d));var L=g+Math.atan2(v.y-y.y,v.x-y.x);return w.push(E),{point:E,angle:L,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Kt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Kt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,f=0,h=c;f=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var g=this.circleCells[i];if(null!==g)for(var m=this.circles,v=0,y=g;vo*o+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var f=l-s,h=u-c;return f*f+h*h<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r=1;P--)C.push(E.path[P]);for(var I=1;I0){for(var R=C[0].clone(),F=C[0].clone(),B=1;B=A.x&&F.x<=M.x&&R.y>=A.y&&F.y<=M.y?[C]:F.xM.x||F.yM.y?[]:t.clipLine([C],A.x,A.y,M.x,M.y)}for(var N=0,j=D;N=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(g=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={textOffset:m,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(h,t,f,p),h.allowVerticalPlacement&&(this.markUsedOrientation(h,p,f),this.placedOrientations[f.crossTileID]=p),{shift:v,placedGlyphBoxes:y}},we.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,f=a.textPixelRatio,h=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,g=a.collisionGroup,m=s.get("text-optional"),v=s.get("icon-optional"),y=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=y&&(x||!o.hasIconData()||v),A=x&&(y||!o.hasTextData()||m);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var M=function(e,a){if(!r[e.crossTileID])if(h)i.placements[e.crossTileID]=new me(!1,!1,!1);else{var p,T=!1,M=!1,S=!0,E=null,L={box:null,offscreen:null},C={box:null,offscreen:null},P=null,I=null,O=0,z=0,D=0;a.textFeatureIndex?O=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(O=e.featureIndex),a.verticalTextFeatureIndex&&(z=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(N=N.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,h={box:[],offscreen:!1},p=y?2*N.length:N.length,d=0;d=N.length,k=i.attemptAnchorPlacement(m,t,a,s,c,b,_,f,l,g,v,e,o,n,u);if(k&&(h=k.placedGlyphBoxes)&&h.box&&h.box.length){T=!0,E=k.shift;break}}return h};B((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=L&&L.box&&L.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,y,f,l,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(L&&L.box&&L.box.length)}}if(T=(p=L)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Y=t.evaluateSizeForFeature(o.textSizeData,d,G),W=s.get("text-padding"),X=e.collisionCircleDiameter;P=i.collisionIndex.placeCollisionCircles(y,G,o.lineVertexArray,o.glyphOffsetArray,Y,l,c,u,n,_,g.predicate,X,W),T=y||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(a.iconFeatureIndex&&(D=a.iconFeatureIndex),a.iconBox){var Z=function(t){var e=w&&E?_e(t,E.x,E.y,b,_,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,f,l,g.predicate)};M=C&&C.box&&C.box.length&&a.verticalIconBox?(I=Z(a.verticalIconBox)).box.length>0:(I=Z(a.iconBox)).box.length>0,S=S&&I.offscreen}var J=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=v||0===e.numIconVertices;if(J||K?K?J||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(C&&C.box&&z?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,g.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,g.ID)),M&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,D,g.ID),P&&(T&&i.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,O,g.ID),n)){var Q=o.bucketInstanceId,$=i.collisionCircleArrays[Q];void 0===$&&($=i.collisionCircleArrays[Q]=new ve);for(var tt=0;tt=0;--E){var L=S[E];M(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var C=e.symbolInstanceStart;C=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},we.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===t.WritingMode.vertical,w=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;if(y){var T=Pe(v.text),k=_?Ie:T;d(e.text,s,k);var A=w?Ie:T;d(e.text,l,A);var M=v.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,b);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var L=Pe(v.icon),C=!(h&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var P=C?L:Ie;d(e.icon,a.numIconVertices,P),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=v.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=C?Ie:L;d(e.icon,a.numVerticalIconVertices,I),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var O=e.collisionArrays[n];if(O){var z=new t.Point(0,0);if(O.textBox||O.verticalTextBox){var D=!0;if(c){var R=i.variableOffsets[g];R?(z=be(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&z._rotate(f?i.transform.angle:-i.transform.angle)):D=!1}O.textBox&&Te(e.textCollisionBox.collisionVertexArray,v.text.placed,!D||_,z.x,z.y),O.verticalTextBox&&Te(e.textCollisionBox.collisionVertexArray,v.text.placed,!D||w,z.x,z.y)}var F=Boolean(!w&&O.verticalIconBox);O.iconBox&&Te(e.iconCollisionBox.collisionVertexArray,v.icon.placed,F,h?z.x:0,h?z.y:0),O.verticalIconBox&&Te(e.iconCollisionBox.collisionVertexArray,v.icon.placed,!F,h?z.x:0,h?z.y:0)}}},m=0;mt},we.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Ae=Math.pow(2,24),Me=Math.pow(2,17),Se=Math.pow(2,16),Ee=Math.pow(2,9),Le=Math.pow(2,8),Ce=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Ae+r*Me+e*Se+r*Ee+e*Le+r*Ce+e}var Ie=0,Oe=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Oe.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Oe(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var De=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,f=l.x,h=l.y,p=l.sdf,d=l.pixelRatio,g=l.stretchX,m=l.stretchY,v=l.content,y=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,y,{x:f,y:h},{x:0,y:0},{width:c,height:u}),r[s]={data:y,pixelRatio:d,sdf:p,stretchX:g,stretchY:m,content:v}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Ct(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var g=this._order[d];if(r(g))for(var m=i.length-1;m>=0;m--){var v=i[m].feature;if(n[v.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),lr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cr=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),gr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),vr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,a){return n[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}))}}var xr=Object.freeze({__proto__:null,prelude:Ye,background:We,backgroundPattern:Xe,circle:Ze,clippingMask:Je,heatmap:Ke,heatmapTexture:Qe,collisionBox:$e,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ir,fillPattern:ar,fillExtrusion:or,fillExtrusionPattern:sr,hillshadePrepare:lr,hillshade:cr,line:ur,lineGradient:fr,linePattern:hr,lineSDF:pr,raster:dr,symbolIcon:gr,symbolSDF:mr,symbolTextAndIcon:vr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};br.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}_r.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,g){var m,v=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[y].set(o[y]);p&&p.setUniforms(t,this.binderUniforms,f,{zoom:h});for(var x=(m={},m[v.LINES]=2,m[v.TRIANGLES]=3,m[v.LINE_STRIP]=1,m)[e],b=0,_=u.get();b<_.length;b+=1){var w=_[b],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new br)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,w.vertexOffset,d,g),v.drawElements(e,w.primitiveLength*x,v.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Tr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},kr=function(e,r,n,i,a,o,s){return t.extend(Tr(e,r,n,i),wr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Ar=function(t){return{u_matrix:t}},Mr=function(e,r,n,i){return t.extend(Ar(e),wr(n,r,i))},Sr=function(t,e){return{u_matrix:t,u_world:e}},Er=function(e,r,n,i,a){return t.extend(Mr(e,r,n,i),{u_world:a})},Lr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=pe(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Cr=function(t,e,r){var n=pe(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Pr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Ir=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},Or=function(t){return{u_matrix:t}},zr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:pe(e,1,r),u_intensity:n}};function Dr(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Rr=function(e,r,n){var i=e.transform;return{u_matrix:Ur(e,r,n),u_ratio:1/pe(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Fr=function(e,r,n){return t.extend(Rr(e,r,n),{u_image:0})},Br=function(e,r,n,i){var a=e.transform,o=jr(r,a);return{u_matrix:Ur(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/pe(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Nr=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=jr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),f=s.getDash(i.to,c),h=u.width*a.fromScale,p=f.width*a.toScale;return t.extend(Rr(e,r,n),{u_patternscale_a:[l/h,-u.height/2],u_patternscale_b:[l/p,-f.height/2],u_sdfgamma:s.width/(256*Math.min(h,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:f.y,u_mix:a.t})};function jr(t,e){return 1/pe(t,1,e.tileZoom)}function Ur(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Vr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var a,o};function qr(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]}var Hr,Gr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Yr=function(e,r,n,i,a,o,s,l,c,u,f){var h=a.transform;return t.extend(Gr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+f})},Wr=function(e,r,n,i,a,o,s,l,c,u){return t.extend(Yr(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Xr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Zr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,f=u*(n.tileID.canonical.x+n.tileID.wrap*c),h=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,h>>16],u_pixel_coord_lower:[65535&f,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},Jr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),f=[],h=0,p=0,d=0;d0){var _=t.create(),w=y;t.mul(_,v.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(_,_,v.placementViewportMatrix),f.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=h+=b.length/4}x&&u.draw(l,c.LINES,At.disabled,Mt.disabled,e.colorModeForRenderPass(),Et.disabled,Cr(y,e.transform,m),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&f.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var A=0,M=0,S=f;M=0&&(g[v.associatedIconIndex]={shiftedAnchor:S,angle:E})}else ue(v.numGlyphs,p)}if(f){d.clear();for(var C=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),f=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(e.tileID.overscaledZ-f),p=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var un=new t.Color(1,0,0,1),fn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),dn=new t.Color(0,1,1,1);function gn(t){var e=t.transform.padding;mn(t,t.transform.height-(e.top||0),3,un),mn(t,e.bottom||0,3,fn),vn(t,e.left||0,3,hn),vn(t,t.transform.width-(e.right||0),3,pn);var r=t.transform.centerPoint;!function(t,e,r,n){yn(t,e-1,r-10,2,20,n),yn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,dn)}function mn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function vn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function xn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=At.disabled,c=Mt.disabled,u=e.colorModeForRenderPass();i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Et.disabled,Ir(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,h=f&&f.byteLength||0,p=Math.floor(h/1024),d=r.getTile(n).tileSize,g=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,m=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(m+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,m+" "+p+"kb"),s.draw(i,a.TRIANGLES,l,c,St.alphaBlended,Et.disabled,Ir(o,t.Color.transparent,g),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var bn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Mt.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,f=0,h=e;f256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(At.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Mt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Mt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new _r(this.context,xr[t],e,Jr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var wn=function(t,e){this.points=t,this.planes=e};wn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new wn(a,o)};var Tn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Tn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=0;fthis.max[l]-this.min[l])return 0}return 1};var kn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};kn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},kn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},kn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},kn.prototype.clone=function(){return new kn(this.top,this.bottom,this.left,this.right)},kn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var An=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new kn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Mn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};An.prototype.clone=function(){var t=new An(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Mn.minZoom.get=function(){return this._minZoom},Mn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Mn.maxZoom.get=function(){return this._maxZoom},Mn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Mn.minPitch.get=function(){return this._minPitch},Mn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Mn.maxPitch.get=function(){return this._maxPitch},Mn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Mn.renderWorldCopies.get=function(){return this._renderWorldCopies},Mn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Mn.worldSize.get=function(){return this.tileSize*this.scale},Mn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Mn.size.get=function(){return new t.Point(this.width,this.height)},Mn.bearing.get=function(){return-this.angle/Math.PI*180},Mn.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Mn.pitch.get=function(){return this._pitch/Math.PI*180},Mn.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Mn.fov.get=function(){return this._fov/Math.PI*180},Mn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Mn.zoom.get=function(){return this._zoom},Mn.zoom.set=function(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._constrain(),this._calcMatrices())},Mn.center.get=function(){return this._center},Mn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Mn.padding.get=function(){return this._edgeInsets.toJSON()},Mn.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Mn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},An.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},An.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},An.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},An.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},An.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=wn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Tn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],f=[],h=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var g=u.pop(),m=g.x,v=g.y,y=g.fullyVisible;if(!y){var x=g.aabb.intersects(s);if(0===x)continue;y=2===x}var b=g.aabb.distanceX(o),_=g.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),T=3+(1<T&&g.zoom>=l)f.push({tileID:new t.OverscaledTileID(g.zoom===h?p:g.zoom,g.wrap,g.zoom,m,v),distanceSq:t.sqrLen([o[0]-.5-m,o[1]-.5-v])});else for(var k=0;k<4;k++){var A=(m<<1)+k%2,M=(v<<1)+(k>>1);u.push({aabb:g.aabb.quadrant(k),zoom:g.zoom+1,x:A,y:M,wrap:g.wrap,fullyVisible:y})}}return f.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},An.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Mn.unmodified.get=function(){return this._unmodified},An.prototype.zoomScale=function(t){return Math.pow(2,t)},An.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},An.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},An.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Mn.point.get=function(){return this.project(this.center)},An.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},An.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},An.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},An.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},An.prototype.coordinateLocation=function(t){return t.toLngLat()},An.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,f=n[2]/a,h=u===f?0:(0-u)/(f-u);return new t.MercatorCoordinate(t.number(o,s,h)/this.worldSize,t.number(l,c,h)/this.worldSize)},An.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},An.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},An.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},An.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},An.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},An.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},An.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var f=this.latRange;a=t.mercatorYfromLat(f[1])*this.worldSize,e=(o=t.mercatorYfromLat(f[0])*this.worldSize)-ao&&(i=o-m)}if(this.lngRange){var v=p.x,y=c.x/2;v-yl&&(n=l-y)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},An.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,f=new Float64Array(16);t.perspective(f,this._fov,this.width/this.height,u,c),f[8]=2*-r.x/this.width,f[9]=2*r.y/this.height,t.scale(f,f,[1,-1,1]),t.translate(f,f,[0,0,-this.cameraToCenterDistance]),t.rotateX(f,f,this._pitch),t.rotateZ(f,f,this.angle),t.translate(f,f,[-s,-l,0]),this.mercatorMatrix=t.scale([],f,[this.worldSize,this.worldSize,this.worldSize]),t.scale(f,f,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=f,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),g=Math.sin(this.angle),m=s-Math.round(s)+d*h+g*p,v=l-Math.round(l)+d*p+g*h,y=new Float64Array(f);if(t.translate(y,y,[m>.5?m-1:m,v>.5?v-1:v,0]),this.alignedProjMatrix=y,f=t.create(),t.scale(f,f,[this.width/2,-this.height/2,1]),t.translate(f,f,[1,-1,0]),this.labelPlaneMatrix=f,f=t.create(),t.scale(f,f,[1,-1,1]),t.translate(f,f,[-1,-1,0]),t.scale(f,f,[2/this.width,2/this.height,1]),this.glCoordMatrix=f,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(f=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=f,this._posMatrixCache={},this._alignedPosMatrixCache={}}},An.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},An.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},An.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Sn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var En={linearity:.3,easing:t.bezier(0,0,.3,1)},Ln=t.extend({deceleration:2500,maxSpeed:1400},En),Cn=t.extend({deceleration:20,maxSpeed:1400},En),Pn=t.extend({deceleration:1e3,maxSpeed:360},En),In=t.extend({deceleration:1e3,maxSpeed:90},En),On=function(t){this._map=t,this.clear()};function zn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},On.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.dblclick=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},Nn.prototype.mouseover=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.mouseout=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},Nn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Nn.prototype.isEnabled=function(){return!0},Nn.prototype.isActive=function(){return!1},Nn.prototype.enable=function(){},Nn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Rn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Vn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},qn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new qn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Gn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Gn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Gn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Gn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Gn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Gn.prototype.touchcancel=function(){this.reset()},Gn.prototype.enable=function(){this._enabled=!0},Gn.prototype.disable=function(){this._enabled=!1,this.reset()},Gn.prototype.isEnabled=function(){return this._enabled},Gn.prototype.isActive=function(){return this._active};var Yn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Yn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Yn.prototype._correctButton=function(t,e){return!1},Yn.prototype._move=function(t,e){return{}},Yn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Yn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var i=Vn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid){this._lastPoints=t,this._active=!0;return{pitchDelta:-.5*((n.y+i.y)/2)}}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ni(t)&&ni(e)&&a}},e}(Kn),ai={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ai;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function si(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:si,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active};var li=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};li.prototype.setZoomRate=function(t){this._defaultZoomRate=t},li.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},li.prototype.isEnabled=function(){return!!this._enabled},li.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},li.prototype.isZooming=function(){return!!this._zooming},li.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},li.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},li.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},li.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},li.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},li.prototype.renderFrame=function(){return this._onScrollFrame()},li.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var f=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=c(f);o=t.number(l,s,h),f<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},li.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},li.prototype.reset=function(){this._active=!1};var ci=function(t,e){this._clickZoom=t,this._tapZoom=e};ci.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ci.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ci.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ci.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ui=function(){this.reset()};ui.prototype.reset=function(){this._active=!1},ui.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active};var fi=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};fi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},fi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},fi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},fi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},fi.prototype.touchcancel=function(){this.reset()},fi.prototype.enable=function(){this._enabled=!0},fi.prototype.disable=function(){this._enabled=!1,this.reset()},fi.prototype.isEnabled=function(){return this._enabled},fi.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var di=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};di.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},di.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},di.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},di.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},di.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},di.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var gi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function vi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new On(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(m,1-e),T=i.unproject(x.add(b.mult(e*w)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,f="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(u-o),g=t.Point.convert(e.offset),m=a.centerPoint.add(g),v=a.pointLocation(m),y=t.LngLat.convert(e.center||v);this._normalizeCenter(y);var x=a.project(v),b=a.project(y).sub(x),_=e.curve,w=Math.max(a.width,a.height),T=w/d,k=b.mag();if("minZoom"in e){var A=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),M=w/a.zoomScale(A-o);_=Math.sqrt(M/k*2)}var S=_*_;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}var P=E(0),I=function(t){return C(P)/C(P+_*t)},O=function(t){return w*((C(P)*(L(e=P+_*t)/C(e))-L(P))/S)/k;var e},z=(E(1)-P)/_;if(Math.abs(k)<1e-6||!isFinite(z)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var D=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=h!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(e){var i=e*z,d=1/I(i);a.zoom=1===e?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,f,e)),n._pitching&&(a.pitch=t.number(l,h,e)),n._padding&&(a.interpolatePadding(c,p,e),m=a.centerPoint.add(g));var v=1===e?y:a.unproject(x.add(b.mult(O(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?v.wrap():v,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),bi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};bi.prototype.getDefaultPosition=function(){return"bottom-right"},bi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},bi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},bi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},bi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var _i=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_i.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_i.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_i.prototype.getDefaultPosition=function(){return"bottom-left"},_i.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_i.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},_i.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new An(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ti,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ai))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new yi(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Sn(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new bi({customAttribution:e.customAttribution})),this.addControl(new _i,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Rn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Rn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Rn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ii.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ii.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ii.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ii.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ii.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ii.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ii.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ii.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ji)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ni--,ji=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Ni>1?(e={maximumAge:6e5,timeout:0},ji=!0):(e=this.options.positionOptions,ji=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function Hi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;if(l>5280)Gi(e,n,l/5280,t._getUIString("ScaleControl.Miles"));else Gi(e,n,l,t._getUIString("ScaleControl.Feet"))}else if(r&&"nautical"===r.unit){Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,a,o,s=(i=r,a=Math.pow(10,(""+Math.floor(i)).length-1),o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),a*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){Hi(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,Hi(this._map,this._container,this.options)};var Yi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Yi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Yi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Yi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Yi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Yi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Yi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Yi.prototype._isFullscreen=function(){return this._fullscreen},Yi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Yi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Xi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Wi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Oi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var a=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,c=this._container.offsetWidth,u=this._container.offsetHeight;l=a.y+s.bottom.ythis._map.transform.height-u?["bottom"]:[],a.xthis._map.transform.width-c/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var f=a.add(s[o]).round();r.setTransform(this._container,zi[o]+" translate("+f.x+"px,"+f.y+"px)"),Di(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);var Zi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ei,NavigationControl:Pi,GeolocateControl:Ui,AttributionControl:bi,ScaleControl:qi,FullscreenControl:Yi,Popup:Xi,Marker:Fi,Style:He,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Bt().acquire(zt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Zi})),r}))},{}],462:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<p[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":464,"gl-mat4/clone":284,"gl-mat4/create":286,"gl-mat4/determinant":287,"gl-mat4/invert":299,"gl-mat4/transpose":312,"gl-vec3/cross":368,"gl-vec3/dot":373,"gl-vec3/length":383,"gl-vec3/normalize":390}],464:[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}},{}],465:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),c=f(),u=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!h||!p)&&(n(u.translate,l.translate,c.translate,f),n(u.skew,l.skew,c.skew,f),n(u.scale,l.scale,c.scale,f),n(u.perspective,l.perspective,c.perspective,f),s(u.quaternion,l.quaternion,c.quaternion,f),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}},{"gl-mat4/determinant":287,"gl-vec3/lerp":384,"mat4-decompose":463,"mat4-recompose":466,"quat-slerp":529}],466:[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":286,"gl-mat4/fromRotationTranslation":290,"gl-mat4/identity":297,"gl-mat4/multiply":301,"gl-mat4/scale":309,"gl-mat4/translate":311}],467:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],468:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function p(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]}e.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)h[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&h[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=h[c];else i(o,h,d,(t-e[r])/u)}var g=this.computedUp;g[0]=o[1],g[1]=o[5],g[2]=o[9],f(g,g);var m=this.computedInverse;a(m,o);var v=this.computedEye,y=m[15];v[0]=m[12]/y,v[1]=m[13]/y,v[2]=m[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-o[2+4*c]*b}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(i=0,o.length);i0;--p)r[f++]=s[p];return r};var n=t("robust-orientation")[3]},{"robust-orientation":548}],470:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function g(t){c(r&~n.buttons(t),t)}function m(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}m();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(e){e?m():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":472}],471:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],472:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],446:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],447:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],448:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&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}},{}],449:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],450:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],451:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=i;else t=i}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;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}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){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function y(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}var b={};function _(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var A=null;function S(t){if(null==A){var e=t.navigator?t.navigator.userAgent:null;A=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return A}function E(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,C,P,I,O=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),z=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,D=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:O,frame:function(t){var e=z(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=self.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==C&&(C=self.matchMedia("(prefers-reduced-motion: reduce)")),C.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){if(N||!I)return;j?U(t):P=t}},N=!1,j=!1;function U(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,I),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((I=self.document.createElement("img")).onload=function(){P&&U(P),P=null,j=!0},I.onerror=function(){N=!0,P=null},I.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01";var H=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function q(t){return 0===t.indexOf("mapbox:")}H.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},H.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},H.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},H.prototype.normalizeStyleURL=function(t,e){if(!q(t))return t;var r=X(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},H.prototype.normalizeGlyphsURL=function(t,e){if(!q(t))return t;var r=X(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},H.prototype.normalizeSourceURL=function(t,e){if(!q(t))return t;var r=X(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},H.prototype.normalizeSpriteURL=function(t,e,r,n){var i=X(t);return q(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,Z(i))},H.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!q(t))return t;var r=X(t),n=R.devicePixelRatio>=2||512===e?"@2x":"",i=B.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){_("Unable to write to LocalStorage")}},K.prototype.processRequests=function(t){},K.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var a=X(F.EVENTS_URL);a.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?u(o,e):o,l={url:Z(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(l,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},K.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||Y(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=p()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(K),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||Y(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=p(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(K)),rt=et.postTurnstileEvent.bind(et),nt=new tt,it=nt.postMapLoadEvent.bind(nt),at=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=M(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return _(t.message)}))}))}}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ut(t,e){if(st(),!Q)return e(null);var r=ct(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}var ft,ht=1/0;function pt(){return null==ft&&(ft=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ft}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt=function(t){function e(e,r,n){401===r&&Y(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),gt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function vt(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:gt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&Y(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&_(r),n&&a)return c(n);var l=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return c(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&<(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?ut(i,l):l(null,null),{cancel:function(){o=!0,a||n.abort()}}}var yt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(gt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return vt(t,e);if(k()&&self.worker&&self.worker.actor){return self.worker.actor.send("getResource",t,e,void 0,!0)}}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return yt(u(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return yt(u(t,{method:"POST"}),e)};var _t,wt;_t=[],wt=0;var Tt=function(t,e){if(B.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),wt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}wt++;var n=!1,i=function(){if(!n)for(n=!0,wt--;_t.length&&wt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Et.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Lt={$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"},light:{type:"light"},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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ct=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.key,r=t.value;return r?[new Ct(e,r,"constants have been deprecated as of v8")]:[]}function It(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Zt=[Ft,Bt,Nt,jt,Ut,Gt,Vt,Wt(Ht),Yt];function Jt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Zt;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(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}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),f=i.substr(l+1,c-(l+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,d=o(f[1]),m=o(f[2]),g=m<=.5?m*(d+1):m+d-m*d,v=2*m-g;return[n(255*s(v,g,p+1/3)),n(255*s(v,g,p)),n(255*s(v,g,p-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},te.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in fe)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=fe[s],n++}else a=Ht;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Wt(a,o)}else r=fe[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Gt,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Bt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Wt(Nt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Ut)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var f=e.parse(t[a],1,Ht);if(!f)return null;var h=f.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:f,scale:null,font:null,textColor:null})}}return new pe(n)},pe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Yt?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":jt,"to-color":Ut,"to-number":Bt,"to-string":Nt},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=me[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ae(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Te(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*8192),Math.round(i*a*8192)]}function ke(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Me(t,e){for(var r,n,i,a,o,s,l,c=!1,u=0,f=e.length;u0&&f<0||u<0&&f>0}function Ee(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}_e(e,t)}function ze(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ne(t,e)&&(r=!1)})),r}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ue("Input is not a number.");o=s-1}return 0}Ue.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new he(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof ce)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof xe&&"error"===e.name)return!1;if(e instanceof be)return!1;if(e instanceof Re)return!1;var r=e instanceof ge||e instanceof he,n=!0;if(e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ce})),!n)return!1;return Fe(e)&&Ne(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new ye;try{a=new ce(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,i,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Dt(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Jt(t,e);return r&&this.error(r),r};var He=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new He(i,r,n)},He.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ve(e,n)].evaluate(t)},He.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ge=Object.freeze({__proto__:null,number:qe,color:function(t,e,r){return new te(qe(t.r,e.r,r),qe(t.g,e.g,r),qe(t.b,e.b,r),qe(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return qe(t,e[n],r)}))}}),Ye=6/29,We=3*Ye*Ye,Xe=Math.PI/180,Ze=180/Math.PI;function Je(t){return t>.008856451679035631?Math.pow(t,1/3):t/We+4/29}function Ke(t){return t>Ye?t*t*t:We*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),n=$e(t.b),i=Je((.4124564*e+.3575761*r+.1804375*n)/.95047),a=Je((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-Je((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Qe(3.2404542*r-1.5371385*e-.4985314*n),Qe(-.969266*r+1.8760108*e+.041556*n),Qe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function rr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var nr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:qe(t.l,e.l,r),a:qe(t.a,e.a,r),b:qe(t.b,e.b,r),alpha:qe(t.alpha,e.alpha,r)}}},ir={forward:function(t){var e=tr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*Ze;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(t.h,e.h,r),c:qe(t.c,e.c,r),l:qe(t.l,e.l,r),alpha:qe(t.alpha,e.alpha,r)}}},ar=Object.freeze({__proto__:null,lab:nr,hcl:ir}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Bt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=f)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=e.parse(h,d,c);if(!m)return null;c=c||m.type,l.push([f,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new or(c,r,n,i,l):e.error("Type "+Xt(c)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Ve(e,n),o=e[a],s=e[a+1],l=or.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?Ge[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?ir.reverse(ir.interpolate(ir.forward(c),ir.forward(u),l)):nr.reverse(nr.interpolate(nr.forward(c),nr.forward(u),l))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var fr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};fr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Ht);return r&&n?Kt(r.type,[jt,Nt,Bt,Ft,Ht])?new fr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead"):null},fr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");return r.indexOf(e)>=0},fr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},fr.prototype.outputDefined=function(){return!0},fr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Bt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!Kt(r.type,[jt,Nt,Bt,Ft,Ht]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Xt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Xt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Xt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};pr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,se(h)))return null}else r=se(h);if(void 0!==i[String(h)])return c.error("Branch labels must be unique.");i[String(h)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,Ht);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,a,m):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Bt);if(!r||!n)return null;if(!Kt(r.type,[Wt(Ht),Nt,Ht]))return e.error("Expected first argument to be of type array or string, but found "+Xt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new mr(r.type,r,n,i):null}return new mr(r.type,r,n)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Xt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xr=yr("==",(function(t,e,r){return e===r}),vr),br=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!vr(0,e,r,n)})),_r=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Tr=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),kr=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Mr=function(t,e,r,n,i){this.type=Nt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Mr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Nt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Nt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Bt))?null:new Mr(r,i,a,o,s)},Mr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Mr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ar=function(t){this.type=Bt,this.input=t};Ar.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Xt(r.type)+" instead."):new Ar(r):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Xt(se(e))+" instead.")},Ar.prototype.eachChild=function(t){t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":xr,"!=":br,">":wr,"<":_r,">=":kr,"<=":Tr,array:he,at:ur,boolean:he,case:dr,coalesce:lr,collator:be,format:pe,image:de,in:fr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Ar,let:cr,literal:ce,match:pr,number:he,"number-format":Mr,object:he,slice:mr,step:He,string:he,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:je,within:Re};function Er(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=ae(r,n,i,o);if(s)throw new ue(s);return new te(r/255*o,n/255*o,i/255*o,o)}function Lr(t,e){return t in e}function Cr(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Ir(t){return{result:"success",value:t}}function Or(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Br(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return jr(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Fr(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ve(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Hr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Fr(r))return jr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Ve(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Ge[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=ar[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function qr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):Fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}xe.register(Sr,{error:[{kind:"error"},[Nt],function(t,e){var r=e[0];throw new ue(r.evaluate(t))}],typeof:[Nt,[Ht],function(t,e){return Xt(se(e[0].evaluate(t)))}],"to-rgba":[Wt(Bt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Bt,Bt,Bt],Er],rgba:[Ut,[Bt,Bt,Bt,Bt],Er],has:{type:jt,overloads:[[[Nt],function(t,e){return Lr(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Lr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Ht,overloads:[[[Nt],function(t,e){return Cr(e[0].evaluate(t),t.properties())}],[[Nt,Vt],function(t,e){var r=e[0],n=e[1];return Cr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Ht,[Nt],function(t,e){return Cr(e[0].evaluate(t),t.featureState||{})}],properties:[Vt,[],function(t){return t.properties()}],"geometry-type":[Nt,[],function(t){return t.geometryType()}],id:[Ht,[],function(t){return t.id()}],zoom:[Bt,[],function(t){return t.globals.zoom}],"heatmap-density":[Bt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Bt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Ht,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Bt,Pr(Bt),function(t,e){for(var r=0,n=0,i=e;n":[jt,[Nt,Ht],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[jt,[Ht],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[jt,[Nt,Ht],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[jt,[Ht],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[jt,[Nt,Ht],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[jt,[Ht],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[jt,[Ht],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[Wt(Nt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Wt(Ht)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Nt,Wt(Ht)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Nt,Wt(Ht)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Pr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function Wr(t,e){var r=new Ue(Sr,[],e?function(t){var e={color:Ut,string:Nt,number:Bt,enum:Nt,boolean:jt,formatted:Gt,resolvedImage:Yt};if("array"===t.type)return Wt(e[t.value]||Ht,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ir(new Gr(n,e)):Or(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Be(e.expression)};Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Xr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var Zr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Be(e.expression),this.interpolationType=n};function Jr(t,e){if("error"===(t=Wr(t,e)).result)return t;var r=t.value.expression,n=Fe(r);if(!n&&!zr(e))return Or([new Dt("","data expressions not supported")]);var i=Ne(r,["zoom"]);if(!i&&!Dr(e))return Or([new Dt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof cr)r=t(e.result);else if(e instanceof lr)for(var n=0,i=e.args;nn.maximum?[new Ct(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function en(t){var e,r,n,i=t.valueSpec,a=Ot(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Fr(t.value.stops)&&"array"===Fr(t.value.stops[0])&&"object"===Fr(t.value.stops[0][0]),u=Qr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Ct(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat($r({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===Fr(r)&&0===r.length&&e.push(new Ct(t.key,r,"array must have at least one stop"));return e},default:function(t){return kn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Ct(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new Ct(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Rr(t.valueSpec)&&u.push(new Ct(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!zr(t.valueSpec)?u.push(new Ct(t.key,t.value,"property functions not supported")):s&&!Dr(t.valueSpec)&&u.push(new Ct(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new Ct(t.key,t.value,'"property" property is required')),u;function f(t){var e=[],a=t.value,s=t.key;if("array"!==Fr(a))return[new Ct(s,a,"array expected, "+Fr(a)+" found")];if(2!==a.length)return[new Ct(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Fr(a[0]))return[new Ct(s,a,"object expected, "+Fr(a[0])+" found")];if(void 0===a[0].zoom)return[new Ct(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Ct(s,a,"object stop key must have value")];if(n&&n>Ot(a[0].zoom))return[new Ct(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ot(a[0].zoom)!==n&&(n=Ot(a[0].zoom),r=void 0,o={}),e=e.concat(Qr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tn,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Yr(zt(a[1]))?e.concat([new Ct(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(kn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Fr(t.value),l=Ot(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Ct(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ct(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return zr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ct(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function cn(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?pn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cn))):"all"===r?["all"].concat(t.slice(1).map(cn)):"none"===r?["all"].concat(t.slice(1).map(cn).map(pn)):"in"===r?fn(t[1],t.slice(2)):"!in"===r?pn(fn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function un(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function fn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ln)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function dn(t){return an(zt(t.value))?rn(It({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Fr(r))return[new Ct(n,r,"array expected, "+Fr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new Ct(n,r,"filter array must have at least 1 element")];switch(o=o.concat(nn({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ot(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ot(r[1])&&o.push(new Ct(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Ct(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Fr(r[1]))&&o.push(new Ct(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=u[p+0]&&n>=u[p+1])?(o[h]=!0,a.push(c[h])):o[h]=!1}}},Dn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),f=this._convertToCellCoord(n),h=l;h<=u;h++)for(var p=c;p<=f;p++){var d=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},Dn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Dn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Dn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var f=t[u];c[u]=Bn[l].shallow.indexOf(u)>=0?f:Hn(f,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function qn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(qn);if("object"==typeof t){var e=t.$name||"Object",r=Bn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:qn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Wn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Yn["CJK Compatibility Ideographs"](t)||(!!Yn["CJK Compatibility"](t)||(!!Yn["CJK Radicals Supplement"](t)||(!!Yn["CJK Strokes"](t)||(!(!Yn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Yn["CJK Unified Ideographs Extension A"](t)||(!!Yn["CJK Unified Ideographs"](t)||(!!Yn["Enclosed CJK Letters and Months"](t)||(!!Yn["Hangul Compatibility Jamo"](t)||(!!Yn["Hangul Jamo Extended-A"](t)||(!!Yn["Hangul Jamo Extended-B"](t)||(!!Yn["Hangul Jamo"](t)||(!!Yn["Hangul Syllables"](t)||(!!Yn.Hiragana(t)||(!!Yn["Ideographic Description Characters"](t)||(!!Yn.Kanbun(t)||(!!Yn["Kangxi Radicals"](t)||(!!Yn["Katakana Phonetic Extensions"](t)||(!(!Yn.Katakana(t)||12540===t)||(!(!Yn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Yn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Yn["Unified Canadian Aboriginal Syllabics"](t)||(!!Yn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Yn["Vertical Forms"](t)||(!!Yn["Yijing Hexagram Symbols"](t)||(!!Yn["Yi Syllables"](t)||!!Yn["Yi Radicals"](t))))))))))))))))))))))))))))))}function Jn(t){return!(Zn(t)||function(t){return!(!Yn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Yn["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!Yn["Letterlike Symbols"](t)||(!!Yn["Number Forms"](t)||(!(!Yn["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!Yn["Control Pictures"](t)||9251===t)||(!!Yn["Optical Character Recognition"](t)||(!!Yn["Enclosed Alphanumerics"](t)||(!!Yn["Geometric Shapes"](t)||(!(!Yn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Yn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Yn["CJK Symbols and Punctuation"](t)||(!!Yn.Katakana(t)||(!!Yn["Private Use Area"](t)||(!!Yn["CJK Compatibility Forms"](t)||(!!Yn["Small Form Variants"](t)||(!!Yn["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))}(t))}function Kn(t){return t>=1424&&t<=2303||Yn["Arabic Presentation Forms-A"](t)||Yn["Arabic Presentation Forms-B"](t)}function Qn(t,e){return!(!e&&Kn(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Yn.Khmer(t))}function $n(t){for(var e=0,r=t;e-1&&(ai=ni),ii&&ii(t)};function li(){ci.fire(new At("pluginStateChange",{pluginStatus:ai,pluginURL:oi}))}var ci=new Et,ui=function(){return ai},fi=function(){if(ai!==ti||!oi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ai=ei,li(),oi&&xt({url:oi},(function(t){t?si(t):(ai=ri,li())}))},hi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ai===ri||null!=hi.applyArabicShaping},isLoading:function(){return ai===ei},setState:function(t){ai=t.pluginStatus,oi=t.pluginURL},isParsed:function(){return null!=hi.applyArabicShaping&&null!=hi.processBidirectionalText&&null!=hi.processStyledBidirectionalText},getPluginURL:function(){return oi}},pi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Gn,this.transition={})};pi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var di=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Br(t))return new Kr(t,e);if(Yr(t)){var r=Jr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},di.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var mi=function(t){this.property=t,this.value=new di(t,void 0)};mi.prototype.transitioned=function(t,e){return new vi(this.property,this.value,e,u({},t.transition,this.transition),t.now)},mi.prototype.untransitioned=function(){return new vi(this.property,this.value,null,{},0)};var gi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};gi.prototype.getValue=function(t){return x(this._values[t].value.value)},gi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new mi(this._values[t].property)),this._values[t].value=new di(this._values[t].property,null===e?void 0:x(e))},gi.prototype.getTransition=function(t){return x(this._values[t].transition)},gi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new mi(this._values[t].property)),this._values[t].transition=x(e)||void 0},gi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var yi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};yi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new _i(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ti),Mi=function(t){this.specification=t};Mi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new pi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new pi(Math.floor(e.zoom),e)),t.expression.evaluate(new pi(Math.floor(e.zoom+1),e)),e)}},Mi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Mi.prototype.interpolate=function(t){return t};var Ai=function(t){this.specification=t};Ai.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Ai.prototype.interpolate=function(){return!1};var Si=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new di(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new mi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Nn("DataDrivenProperty",Ti),Nn("DataConstantProperty",wi),Nn("CrossFadedDataDrivenProperty",ki),Nn("CrossFadedProperty",Mi),Nn("ColorRampProperty",Ai);var Ei=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new xi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new gi(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _i(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(In,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Pn,n,t,e,r))return!1}if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),y(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&On(this,t.call(Ln,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof bi&&zr(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(Et),Li={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ci=function(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},Pi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ii(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,a=(i=t.type,Li[i].BYTES_PER_ELEMENT),o=r=Oi(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Oi(r,Math.max(n,e)),alignment:e}}function Oi(t,e){return Math.ceil(t/e)*e}Pi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Pi.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Pi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Pi.prototype.clear=function(){this.length=0},Pi.prototype.resize=function(t){this.reserve(t),this.length=t},Pi.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Pi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Pi);zi.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",zi);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Pi);Di.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Di);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Pi);Ri.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Ri);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Pi);Fi.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Fi);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var f=9*t,h=18*t;return this.uint16[f+0]=e,this.uint16[f+1]=r,this.uint16[f+2]=n,this.uint16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.uint8[h+16]=c,this.uint8[h+17]=u,t},e}(Pi);Bi.prototype.bytesPerElement=18,Nn("StructArrayLayout8ui2ub18",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,f){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,a,o,s,l,c,u,f)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,f,h){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=f,this.int16[p+11]=h,t},e}(Pi);Ni.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",Ni);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Pi);ji.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",ji);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Pi);Ui.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Ui);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,f=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[f+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Pi);Vi.prototype.bytesPerElement=20,Nn("StructArrayLayout6i1ul2ui20",Vi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Pi);Hi.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",Hi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(Pi);qi.prototype.bytesPerElement=16,Nn("StructArrayLayout2f1f2i16",qi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Pi);Gi.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",Gi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Pi);Yi.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",Yi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v){var y=24*t,x=12*t,b=48*t;return this.int16[y+0]=e,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[x+7]=f,this.float32[x+8]=h,this.uint8[b+36]=p,this.uint8[b+37]=d,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[y+22]=v,t},e}(Pi);Wi.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Wi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S,E){var L=34*t,C=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=i,this.int16[L+4]=a,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=c,this.uint16[L+9]=u,this.uint16[L+10]=f,this.uint16[L+11]=h,this.uint16[L+12]=p,this.uint16[L+13]=d,this.uint16[L+14]=m,this.uint16[L+15]=g,this.uint16[L+16]=v,this.uint16[L+17]=y,this.uint16[L+18]=x,this.uint16[L+19]=b,this.uint16[L+20]=_,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[C+12]=k,this.float32[C+13]=M,this.float32[C+14]=A,this.float32[C+15]=S,this.float32[C+16]=E,t},e}(Pi);Xi.prototype.bytesPerElement=68,Nn("StructArrayLayout8i15ui1ul4f68",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Pi);Zi.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Zi);var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Pi);Ji.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Ji);var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(Pi);Ki.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Ki);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Pi);Qi.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",Qi);var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Pi);$i.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",$i);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Pi);ta.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",ta);var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Pi);ea.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",ea);var ra=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ci);ra.prototype.size=20;var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ra(this,t)},e}(Vi);Nn("CollisionBoxArray",na);var ia=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ci);ia.prototype.size=48;var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ia(this,t)},e}(Wi);Nn("PlacedSymbolArray",aa);var oa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ci);oa.prototype.size=68;var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new oa(this,t)},e}(Xi);Nn("SymbolInstanceArray",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Zi);Nn("GlyphOffsetArray",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ji);Nn("SymbolLineVertexArray",ca);var ua=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ci);ua.prototype.size=8;var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ua(this,t)},e}(Ki);Nn("FeatureIndexArray",fa);var ha=Ii([{name:"a_pos",components:2,type:"Int16"}],4).members,pa=function(t){void 0===t&&(t=[]),this.segments=t};function da(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))}pa.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>pa.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+pa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>pa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},pa.prototype.get=function(){return this.segments},pa.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),va=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ya=ga,xa=ga,ba=va;ya.murmur3=xa,ya.murmur2=ba;var _a=function(){this.ids=[],this.positions=[],this.indexed=!1};_a.prototype.add=function(t,e,r,n){this.ids.push(Ta(t)),this.positions.push(e,r,n)},_a.prototype.getPositions=function(t){for(var e=Ta(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},_a.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],o=n-1,s=i+1;;){do{o++}while(e[o]a);if(o>=s)break;ka(e,o,s),ka(r,3*o,3*s),ka(r,3*o+1,3*s+1),ka(r,3*o+2,3*s+2)}s-nGa.max||o.yGa.max)&&(_("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Ga.min,Ga.max),o.y=l(o.y,Ga.min,Ga.max))}return r}function Wa(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Xa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new zi,this.indexArray=new Yi,this.segments=new pa,this.programConfigurations=new Ua(ha,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Za(t,e){for(var r=0;r1){if($a(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function no(t,e){for(var r,n,i,a=!1,o=0;oe.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 io(t,e){for(var r=!1,n=0,i=t.length-1;ne.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}function ao(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=w(t,e,r[0]);return a!==w(t,e,r[1])||a!==w(t,e,r[2])||a!==w(t,e,r[3])}function oo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function so(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function lo(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=8192||u<0||u>=8192)){var f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=f.vertexLength;Wa(this.layoutVertexArray,c,u,-1,-1),Wa(this.layoutVertexArray,c,u,1,-1),Wa(this.layoutVertexArray,c,u,1,1),Wa(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),f.vertexLength+=4,f.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Nn("CircleBucket",Xa,{omit:["layers"]});var co=new Si({"circle-sort-key":new Ti(Lt.layout_circle["circle-sort-key"])}),uo={paint:new Si({"circle-radius":new Ti(Lt.paint_circle["circle-radius"]),"circle-color":new Ti(Lt.paint_circle["circle-color"]),"circle-blur":new Ti(Lt.paint_circle["circle-blur"]),"circle-opacity":new Ti(Lt.paint_circle["circle-opacity"]),"circle-translate":new wi(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new wi(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wi(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wi(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ti(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ti(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ti(Lt.paint_circle["circle-stroke-opacity"])}),layout:co},fo="undefined"!=typeof Float32Array?Float32Array:Array;function ho(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}function po(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],p=e[10],d=e[11],m=e[12],g=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*f+w*m,t[1]=x*i+b*l+_*h+w*g,t[2]=x*a+b*c+_*p+w*v,t[3]=x*o+b*u+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*f+w*m,t[5]=x*i+b*l+_*h+w*g,t[6]=x*a+b*c+_*p+w*v,t[7]=x*o+b*u+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*f+w*m,t[9]=x*i+b*l+_*h+w*g,t[10]=x*a+b*c+_*p+w*v,t[11]=x*o+b*u+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*f+w*m,t[13]=x*i+b*l+_*h+w*g,t[14]=x*a+b*c+_*p+w*v,t[15]=x*o+b*u+_*d+w*y,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var mo=po;var go,vo,yo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};go=new fo(3),fo!=Float32Array&&(go[0]=0,go[1]=0,go[2]=0),vo=go;function xo(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(){var t=function(){var t=new fo(4);return fo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();var bo=function(t){var e=t[0],r=t[1];return e*e+r*r},_o=(function(){var t=function(){var t=new fo(2);return fo!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),function(t){function e(e){t.call(this,e,uo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xa(t)},e.prototype.queryRadius=function(t){var e=t;return oo("circle-radius",this,e)+oo("circle-stroke-width",this,e)+so(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),f=u?l:function(t,e){return t.map((function(t){return wo(t,e)}))}(l,s),h=u?c*o:c,p=0,d=n;pt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return jo(h,p,r,n,i,c),p}function Bo(t,e,r,n,i){var a,o;if(i===ls(t,e,r,n)>0)for(a=e;a=e;a-=n)o=as(a,t[a],t[a+1],o);return o&&$o(o,o.next)&&(os(o),o=o.next),o}function No(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!$o(n,n.next)&&0!==Qo(n.prev,n,n.next))n=n.next;else{if(os(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Xo(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,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Vo(t,n,i,a):Uo(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),os(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?jo(t=Ho(No(t),e,r),e,r,n,i,a,2):2===o&&qo(t,e,r,n,i,a):jo(No(t),e,r,n,i,a,1);break}}}function Uo(t){var e=t.prev,r=t,n=t.next;if(Qo(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Jo(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Qo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Vo(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Qo(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=Xo(s,l,e,r,n),h=Xo(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=f&&d&&d.z<=h;){if(p!==t.prev&&p!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Qo(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Qo(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&Jo(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Qo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Ho(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!$o(i,a)&&ts(i,n,n.next,a)&&ns(i,a)&&ns(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),os(n),os(n.next),n=t=a),n=n.next}while(n!==t);return No(n)}function qo(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Ko(o,s)){var l=is(o,s);return o=No(o,o.next),l=No(l,l.next),jo(o,e,r,n,i,a),void jo(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Go(t,e){return t.x-e.x}function Yo(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.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.x&&n.x>=u&&i!==n.x&&Jo(ar.x||n.x===r.x&&Wo(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}(t,e)){var r=is(e,t);No(e,e.next),No(r,r.next)}}function Wo(t,e){return Qo(t.prev,t,e.prev)<0&&Qo(e.next,t,t.next)<0}function Xo(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Zo(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Ko(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&ts(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ns(t,e)&&ns(e,t)&&function(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&&r.next.y!==r.y&&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}(t,e)&&(Qo(t.prev,t,e.prev)||Qo(t,e.prev,e))||$o(t,e)&&Qo(t.prev,t,t.next)>0&&Qo(e.prev,e,e.next)>0)}function Qo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $o(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,r,n){var i=rs(Qo(t,e,r)),a=rs(Qo(t,e,n)),o=rs(Qo(r,n,t)),s=rs(Qo(r,n,e));return i!==a&&o!==s||(!(0!==i||!es(t,r,e))||(!(0!==a||!es(t,n,e))||(!(0!==o||!es(r,t,n))||!(0!==s||!es(r,e,n)))))}function es(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function rs(t){return t>0?1:t<0?-1:0}function ns(t,e){return Qo(t.prev,t,t.next)<0?Qo(t,e,t.next)>=0&&Qo(t,t.prev,e)>=0:Qo(t,e,t.prev)<0||Qo(t,t.next,e)<0}function is(t,e){var r=new ss(t.i,t.x,t.y),n=new ss(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 as(t,e,r,n){var i=new ss(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 os(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 ss(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 ls(t,e,r,n){for(var i=0,a=e,o=r-n;an;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1),f=Math.max(n,Math.floor(r-s*c/o+u)),h=Math.min(i,Math.floor(r+(o-s)*c/o+u));t(e,r,f,h,a)}var p=e[r],d=n,m=i;for(us(e,n,r),a(e[i],p)>0&&us(e,n,i);d0;)m--}0===a(e[n],p)?us(e,n,m):(m++,us(e,m,i)),m<=r&&(n=m+1),r<=m&&(i=m-1)}}(t,e,r||0,n||t.length-1,i||fs)}function us(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function fs(t,e){return te?1:0}function hs(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},Do.default=Ro;var gs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new zi,this.indexArray=new Yi,this.indexArray2=new Qi,this.programConfigurations=new Ua(zo,t.layers,t.zoom),this.segments=new pa,this.segments2=new pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};gs.prototype.populate=function(t,e,r){this.hasPattern=ds("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ws.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,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},ws.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=ws.types[this.type];function u(t){for(var e=0;e>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}(r))}function Es(t,e,r){if(3===t){var n=new Ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}As.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 _s(this._pbf,e,this.extent,this._keys,this._values)};var Ls={VectorTile:function(t,e){this.layers=t.readFields(Es,{},e)},VectorTileFeature:_s,VectorTileLayer:Ms},Cs=Ls.VectorTileFeature.types,Ps=Math.pow(2,13);function Is(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ps)+o,i*Ps*2,a*Ps*2,Math.round(s))}var Os=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ri,this.indexArray=new Yi,this.programConfigurations=new Ua(bs,t.layers,t.zoom),this.segments=new pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function zs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Ds(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>8192}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>8192}))}Os.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ds("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var y=d[g-1];if(!zs(v,y)){f.vertexLength+4>pa.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(y)._perp()._unit(),b=y.dist(v);m+b>32768&&(m=0),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),Is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m),m+=b,Is(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),Is(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m);var _=f.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),f.vertexLength+=4,f.primitiveLength+=2}}}}if(f.vertexLength+l>pa.MAX_VERTEX_ARRAY_LENGTH&&(f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Cs[t.type]){for(var w=[],T=[],k=f.vertexLength,M=0,A=s;M=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&v>c){var M=u.dist(p);if(M>2*f){var A=u.sub(u.sub(p)._mult(f/M)._round());this.updateDistance(p,A),this.addCurrentVertex(A,m,0,0,h),p=A}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(_i&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_100)y=g.mult(-1);else{var L=_*m.add(g).mag()/m.sub(g).mag();y._perp()._mult(L*(k?-1:1))}this.addCurrentVertex(u,y,0,0,h),this.addCurrentVertex(u,y.mult(-1),0,0,h)}else if("bevel"===E||"fakeround"===E){var C=-Math.sqrt(_*_-1),P=k?C:0,I=k?0:C;if(p&&this.addCurrentVertex(u,m,P,I,h),"fakeround"===E)for(var O=Math.round(180*w/Math.PI/20),z=1;z2*f){var j=u.add(d.sub(u)._mult(f/N)._round());this.updateDistance(u,j),this.addCurrentVertex(j,g,0,0,h),u=j}}}}},qs.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>Hs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},qs.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u},qs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Hs-1):this.distance},qs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Nn("LineBucket",qs,{omit:["layers","patternFeatures"]});var Gs=new Si({"line-cap":new wi(Lt.layout_line["line-cap"]),"line-join":new Ti(Lt.layout_line["line-join"]),"line-miter-limit":new wi(Lt.layout_line["line-miter-limit"]),"line-round-limit":new wi(Lt.layout_line["line-round-limit"]),"line-sort-key":new Ti(Lt.layout_line["line-sort-key"])}),Ys={paint:new Si({"line-opacity":new Ti(Lt.paint_line["line-opacity"]),"line-color":new Ti(Lt.paint_line["line-color"]),"line-translate":new wi(Lt.paint_line["line-translate"]),"line-translate-anchor":new wi(Lt.paint_line["line-translate-anchor"]),"line-width":new Ti(Lt.paint_line["line-width"]),"line-gap-width":new Ti(Lt.paint_line["line-gap-width"]),"line-offset":new Ti(Lt.paint_line["line-offset"]),"line-blur":new Ti(Lt.paint_line["line-blur"]),"line-dasharray":new Mi(Lt.paint_line["line-dasharray"]),"line-pattern":new ki(Lt.paint_line["line-pattern"]),"line-gradient":new Ai(Lt.paint_line["line-gradient"])}),layout:Gs},Ws=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new pi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Ti))(Ys.paint.properties["line-width"].specification);Ws.useIntegerZoom=!0;var Xs=function(t){function e(e){t.call(this,e,Ys)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Co(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ws.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new qs(t)},e.prototype.queryRadius=function(t){var e=t,r=Zs(oo("line-width",this,e),oo("line-gap-width",this,e)),n=oo("line-offset",this,e);return r/2+Math.abs(n)+so(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var l=lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*Zs(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a=3)for(var a=0;a0?e+2*t:t}var Js=Ii([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ks=Ii([{name:"a_projected_pos",components:3,type:"Float32"}],4),Qs=(Ii([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ii([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),$s=(Ii([{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:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ii([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),tl=Ii([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ii([{name:"triangle",components:3,type:"Uint16"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ii([{type:"Float32",name:"offsetX"}]),Ii([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function el(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),hi.applyArabicShaping&&(t=hi.applyArabicShaping(t)),t}(t.text,e,r)})),t}var rl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var nl=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},il=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m},al=ol;function ol(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ol.Varint=0,ol.Fixed64=1,ol.Bytes=2,ol.Fixed32=5;var sl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ll(t){return t.type===ol.Bytes?t.readVarint()+t.pos:t.pos+1}function cl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ul(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(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 fl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ol.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,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=bl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=bl(this.buf,this.pos)+4294967296*bl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=bl(this.buf,this.pos)+4294967296*wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return cl(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return cl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},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.pos;return this.pos=t,t-e>=12&&sl?function(t,e,r){return sl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ol.Bytes)return t.push(this.readVarint(e));var r=ll(this);for(t=t||[];this.pos127;);else if(e===ol.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ol.Fixed32)this.pos+=4;else{if(e!==ol.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),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),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ul(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),il(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),il(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&ul(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ol.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,xl,e)},writeBytesField:function(t,e){this.writeTag(t,ol.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ol.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ol.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ol.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ol.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ol.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ol.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Tl(t,e,r){1===t&&r.readMessage(kl,e)}function kl(t,e,r){if(3===t){var n=r.readMessage(Ml,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new So({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ml(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())}function Al(t){for(var e=0,r=0,n=0,i=t;n=0;h--){var p=o[h];if(!(f.w>p.w||f.h>p.h)){if(f.x=p.x,f.y=p.y,l=Math.max(l,f.y+f.h),s=Math.max(s,f.x+f.w),f.w===p.w&&f.h===p.h){var d=o.pop();h0&&N>M&&(M=N)}else{var j=r[S.fontStack],U=j&&j[L];if(U&&U.rect)I=U.rect,P=U.metrics;else{var V=e[S.fontStack],H=V&&V[L];if(!H)continue;P=H.metrics}C=24*(_-S.scale)}D?(t.verticalizable=!0,k.push({glyph:L,imageName:O,x:h,y:p+C,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:I}),h+=z*S.scale+c):(k.push({glyph:L,imageName:O,x:h,y:p+C,vertical:D,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:P,rect:I}),h+=P.advance*S.scale+c)}if(0!==k.length){var q=h-c;d=Math.max(q,d),Vl(k,0,k.length-1,g,M)}h=0;var G=a*_+M;T.lineOffset=Math.max(M,w),p+=G,m=Math.max(G,m),++v}else p+=a,++v}var Y;var W=p- -17,X=Ul(o),Z=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c=(e-r)*i,u=0;u=a!==o?-s*n- -17:(-n*l+.5)*o;for(var f=0,h=t;f=0&&n>=t&&zl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Il.prototype.substring=function(t,e){var r=new Il;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Il.prototype.toString=function(){return this.text},Il.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Il.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Pl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var zl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dl={};function Rl(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function Fl(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,f=0,h=0;h-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}function Jl(t){for(var e=0,r=0;rc){var d=(c-l)/p,m=qe(f.x,h.x,d),g=qe(f.y,h.y,d),v=new ql(m,g,h.angleTo(f),u);return v._round(),!o||Zl(t,v,s,o,e)?v:void 0}l+=p}}function tc(t,e,r,n,i,a,o,s,l){var c=Kl(n,a,o),u=Ql(n,i),f=u*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-f=0&&_=0&&w=0&&p+u<=f){var T=new ql(_,w,x,m);T._round(),i&&!Zl(e,T,o,i,a)||d.push(T)}}h+=y}l||d.length||s||(d=t(e,h/2,n,i,a,o,s,!0,c));return d}(t,h?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,f,h,!1,l)}function ec(t,e,r,n,a){for(var o=[],s=0;s=n&&h.x>=n||(f.x>=n?f=new i(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round():h.x>=n&&(h=new i(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),c&&f.equals(c[c.length-1])||(c=[f],o.push(c)),c.push(h)))))}return o}function rc(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,f=t.bottom-t.top,h=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),g=p.reduce(d,0),v=l-m,y=c-g,x=0,b=m,_=0,w=g,T=0,k=v,M=0,A=y;if(o.content&&n){var S=o.content;x=nc(h,0,S[0]),_=nc(p,0,S[1]),b=nc(h,S[0],S[2]),w=nc(p,S[1],S[3]),T=S[0]-x,M=S[1]-_,k=S[2]-S[0]-b,A=S[3]-S[1]-w}var E=function(n,a,l,c){var h=ac(n.stretch-x,b,u,t.left),p=oc(n.fixed-T,k,n.stretch,m),d=ac(a.stretch-_,w,f,t.top),v=oc(a.fixed-M,A,a.stretch,g),y=ac(l.stretch-x,b,u,t.left),S=oc(l.fixed-T,k,l.stretch,m),E=ac(c.stretch-_,w,f,t.top),L=oc(c.fixed-M,A,c.stretch,g),C=new i(h,d),P=new i(y,d),I=new i(y,E),O=new i(h,E),z=new i(p/s,v/s),D=new i(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];C._matMult(N),P._matMult(N),O._matMult(N),I._matMult(N)}var j=n.stretch+n.fixed,U=l.stretch+l.fixed,V=a.stretch+a.fixed,H=c.stretch+c.fixed;return{tl:C,tr:P,bl:O,br:I,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+V,w:U-j,h:H-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:D,minFontScaleX:k/s/u,minFontScaleY:A/s/f,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=ic(h,v,m),C=ic(p,y,g),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,v=o.left*s-l,y=o.right*s+l,x=o.collisionPadding;if(x&&(v-=x[0]*s,m-=x[1]*s,y+=x[2]*s,g+=x[3]*s),u){var b=new i(v,m),_=new i(y,m),w=new i(v,g),T=new i(y,g),k=u*Math.PI/180;b._rotate(k),_._rotate(k),w._rotate(k),T._rotate(k),v=Math.min(b.x,_.x,w.x,T.x),y=Math.max(b.x,_.x,w.x,T.x),m=Math.min(b.y,_.y,w.y,T.y),g=Math.max(b.y,_.y,w.y,T.y)}t.emplaceBack(e.x,e.y,v,m,y,g,r,n,a)}this.boxEndIndex=t.length},lc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=cc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function cc(t,e){return te?1:0}function uc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var f=o-n,h=s-a,p=Math.min(f,h),d=p/2,m=new lc([],fc);if(0===p)return new i(n,a);for(var g=n;gy.d||!y.d)&&(y=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-y.d<=e||(d=b.h/2,m.push(new hc(b.p.x-d,b.p.y-d,d,t)),m.push(new hc(b.p.x+d,b.p.y-d,d,t)),m.push(new hc(b.p.x-d,b.p.y+d,d,t)),m.push(new hc(b.p.x+d,b.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+y.d)),y.p}function fc(t,e){return e.max-t.max}function hc(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,ro(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}lc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},lc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},lc.prototype.peek=function(){return this.data[0]},lc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},lc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var pc=Number.POSITIVE_INFINITY;function dc(t,e){return e[1]!==pc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function mc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function gc(t,e,r,n,a,o,s,l,c,u,f,h,p,d,m){var g=function(t,e,r,n,a,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],f=0,h=e.positionedLines;f32640&&_(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((y=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||y[1]>32640)&&_(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,y,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(var x=0,b=f;x=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var f=e.iconDependencies,h=e.glyphDependencies,p=e.availableImages,d=new pi(this.zoom),m=0,g=t;m=0;for(var O=0,z=k.sections;O=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},Ac.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ac.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Ac.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Ac.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Ac.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Nn("SymbolBucket",Ac,{omit:["layers","collisionBoxArray","features","compareText"]}),Ac.MAX_GLYPHS=65535,Ac.addDynamicAttributes=wc;var Sc=new Si({"symbol-placement":new wi(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new wi(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wi(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ti(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wi(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wi(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wi(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new wi(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wi(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ti(Lt.layout_symbol["icon-size"]),"icon-text-fit":new wi(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wi(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ti(Lt.layout_symbol["icon-image"]),"icon-rotate":new Ti(Lt.layout_symbol["icon-rotate"]),"icon-padding":new wi(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new wi(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ti(Lt.layout_symbol["icon-offset"]),"icon-anchor":new Ti(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wi(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wi(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wi(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new Ti(Lt.layout_symbol["text-field"]),"text-font":new Ti(Lt.layout_symbol["text-font"]),"text-size":new Ti(Lt.layout_symbol["text-size"]),"text-max-width":new Ti(Lt.layout_symbol["text-max-width"]),"text-line-height":new wi(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ti(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new Ti(Lt.layout_symbol["text-justify"]),"text-radial-offset":new Ti(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wi(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ti(Lt.layout_symbol["text-anchor"]),"text-max-angle":new wi(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new wi(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new Ti(Lt.layout_symbol["text-rotate"]),"text-padding":new wi(Lt.layout_symbol["text-padding"]),"text-keep-upright":new wi(Lt.layout_symbol["text-keep-upright"]),"text-transform":new Ti(Lt.layout_symbol["text-transform"]),"text-offset":new Ti(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new wi(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wi(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new wi(Lt.layout_symbol["text-optional"])}),Ec={paint:new Si({"icon-opacity":new Ti(Lt.paint_symbol["icon-opacity"]),"icon-color":new Ti(Lt.paint_symbol["icon-color"]),"icon-halo-color":new Ti(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ti(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ti(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new wi(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new wi(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ti(Lt.paint_symbol["text-opacity"]),"text-color":new Ti(Lt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ti(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new Ti(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ti(Lt.paint_symbol["text-halo-blur"]),"text-translate":new wi(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new wi(Lt.paint_symbol["text-translate-anchor"])}),layout:Sc},Lc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};Lc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Lc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Lc.prototype.outputDefined=function(){return!1},Lc.prototype.serialize=function(){return null},Nn("FormatSectionOverride",Lc,{omit:["defaultValue"]});var Cc=function(t){function e(e){t.call(this,e,Ec)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},qc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},qc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},qc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(qn(e.error)):n(null,qn(e.data)))}else{var i=!1,a=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?Hn(e):null,data:Hn(n,a)},a)}:function(t){i=!0},s=null,l=qn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},qc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Yc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Yc.prototype.setNorthEast=function(t){return this._ne=t instanceof Wc?new Wc(t.lng,t.lat):Wc.convert(t),this},Yc.prototype.setSouthWest=function(t){return this._sw=t instanceof Wc?new Wc(t.lng,t.lat):Wc.convert(t),this},Yc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Wc)e=t,r=t;else{if(!(t instanceof Yc)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Yc.convert(a))}var o=t;return this.extend(Wc.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Wc(e.lng,e.lat),this._ne=new Wc(r.lng,r.lat)),this},Yc.prototype.getCenter=function(){return new Wc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Yc.prototype.getSouthWest=function(){return this._sw},Yc.prototype.getNorthEast=function(){return this._ne},Yc.prototype.getNorthWest=function(){return new Wc(this.getWest(),this.getNorth())},Yc.prototype.getSouthEast=function(){return new Wc(this.getEast(),this.getSouth())},Yc.prototype.getWest=function(){return this._sw.lng},Yc.prototype.getSouth=function(){return this._sw.lat},Yc.prototype.getEast=function(){return this._ne.lng},Yc.prototype.getNorth=function(){return this._ne.lat},Yc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Yc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Yc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Yc.prototype.contains=function(t){var e=Wc.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Yc.convert=function(t){return!t||t instanceof Yc?t:new Yc(t)};var Wc=function(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")};Wc.prototype.wrap=function(){return new Wc(c(this.lng,-180,180),this.lat)},Wc.prototype.toArray=function(){return[this.lng,this.lat]},Wc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Wc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Wc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Yc(new Wc(this.lng-r,this.lat-e),new Wc(this.lng+r,this.lat+e))},Wc.convert=function(t){if(t instanceof Wc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Wc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Wc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Xc=2*Math.PI*6371008.8;function Zc(t){return Xc*Math.cos(t*Math.PI/180)}function Jc(t){return(180+t)/360}function Kc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Qc(t,e){return t/Zc(e)}function $c(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var tu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};tu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Wc.convert(t);return new tu(Jc(r.lng),Kc(r.lat),Qc(e,r.lat))},tu.prototype.toLngLat=function(){return new Wc(360*this.x-180,$c(this.y))},tu.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Zc($c(e));var t,e},tu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xc*(t=$c(this.y),1/Math.cos(t*Math.PI/180));var t};var eu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=iu(0,t,t,e,r)};eu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},eu.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=Gc(256*r,256*(n=Math.pow(2,i)-n-1),i),o=Gc(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new nu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},nu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?iu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):iu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nu.prototype.children=function(t){if(this.overscaledZ>=t)return[new nu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nu(e,this.wrap,e,r,n),new nu(e,this.wrap,e,r+1,n),new nu(e,this.wrap,e,r,n+1),new nu(e,this.wrap,e,r+1,n+1)]},nu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},au.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},au.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},au.prototype.getPixels=function(){return new Eo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},au.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},uu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ls.VectorTile(new al(this.rawTileData)).layers,this.sourceLayerCoder=new ou(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},uu.prototype.query=function(t,e,r,n){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=sn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,f=hu(c),h=this.grid.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u),p=hu(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o=l.x&&a>=l.y)return!0}var c=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var u=0,f=c;u=0)return!0;return!1}(a,f)){var h=this.sourceLayerCoder.decode(r),p=this.vtLayers[h].feature(n);if(i.filter(new pi(this.tileID.overscaledZ),p))for(var d=this.getId(p,h),m=0;mn)i=!1;else if(e)if(this.expirationTimeot&&(t.getActor().send("enforceCacheSizeLimit",at),ht=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=ec,t.clone=function(t){var e=new fo(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},t.clone$1=x,t.clone$2=function(t){var e=new fo(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=tl,t.config=F,t.create=function(){var t=new fo(16);return fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new fo(9);return fo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new fo(4);return fo!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Wr,t.createLayout=Ii,t.createStyleLayer=function(t){return"custom"===t.type?new Dc(t):new Rc[t.type](t)},t.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},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=qe,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=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*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new al(t).readFields(Tl,[])},t.pbf=al,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=8192/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var f=t.textSizeData,h=f.minZoom,p=f.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new pi(h),o),c["text-size"].possiblyEvaluate(new pi(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new pi(m),o),c["icon-size"].possiblyEvaluate(new pi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new pi(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new pi(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new pi(18));for(var v=24*l.get("text-line-height"),y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),w=function(){var a=k[T],s=l.get("text-font").evaluate(a,{},o).join(","),c=b.evaluate(a,{},o),f=u.layoutTextSize.evaluate(a,{},o),h=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),w=24*l.get("text-letter-spacing").evaluate(a,{},o),M=function(t){for(var e=0,r=t;e=8192||f.y<0||f.y>=8192||function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,w,T,k,M){var A,S,E,L,C,P=t.addToLineVertexArray(e,r),I=0,O=0,z=0,D=0,R=-1,F=-1,B={},N=ya(""),j=0,U=0;void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(A=s.layout.get("text-offset").evaluate(b,{},k).map((function(t){return 24*t})),j=A[0],U=A[1]):(j=24*s.layout.get("text-radial-offset").evaluate(b,{},k),U=pc);if(t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},k)+90,H=n.vertical;L=new sc(l,e,c,u,f,H,h,p,d,V),o&&(C=new sc(l,e,c,u,f,o,g,v,d,V))}if(i){var q=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),Y=rc(i,q,T,G),W=o?rc(o,q,T,G):void 0;E=new sc(l,e,c,u,f,i,g,v,!1,q),I=4*Y.length;var X=t.iconSizeData,Z=null;"source"===X.kind?(Z=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&_(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Z=[128*w.compositeIconSizes[0].evaluate(b,{},k),128*w.compositeIconSizes[1].evaluate(b,{},k)])[0]>32640||Z[1]>32640)&&_(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Y,Z,x,y,b,!1,e,P.lineStartIndex,P.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,W&&(O=4*W.length,t.addSymbols(t.icon,W,Z,x,y,b,Cl.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var J in n.horizontal){var K=n.horizontal[J];if(!S){N=ya(K.text);var Q=s.layout.get("text-rotate").evaluate(b,{},k);S=new sc(l,e,c,u,f,K,h,p,d,Q)}var $=1===K.positionedLines.length;if(z+=gc(t,e,K,a,s,d,b,m,P,n.vertical?Cl.horizontal:Cl.horizontalOnly,$?Object.keys(n.horizontal):[J],B,R,w,k),$)break}n.vertical&&(D+=gc(t,e,n.vertical,a,s,d,b,m,P,Cl.vertical,["vertical"],B,F,w,k));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=L?L.boxStartIndex:t.collisionBoxArray.length,nt=L?L.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,st=C?C.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(L,lt),lt=ct(E,lt);var ut=(lt=ct(C,lt))>-1?1:0;ut&&(lt*=M/24);t.glyphOffsetArray.length>=Ac.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,tt,et,rt,nt,it,at,ot,st,c,z,D,I,O,ut,0,h,j,U,lt)}(t,f,s,r,n,i,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,M,l,x,T,A,d,e,a,c,u,o)};if("line"===S)for(var P=0,I=ec(e.geometry,0,0,8192,8192);P1){var V=$l(U,k,r.vertical||m,n,24,y);V&&C(U,V)}}else if("Polygon"===e.type)for(var H=0,q=hs(e.geometry,0);H=E.maxzoom))if("none"!==E.visibility)o(S,this.zoom,n),(m[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id})))}}}var L=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(L).length?a.send("getGlyphs",{uid:this.uid,stacks:L},(function(t,e){f||(f=t,h=e,I.call(l))})):h={};var C=Object.keys(g.iconDependencies);C.length?a.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){f||(f=t,p=e,I.call(l))})):p={};var P=Object.keys(g.patternDependencies);function I(){if(f)return s(f);if(h&&p&&d){var e=new i(h),r=new t.ImageAtlas(p,d);for(var a in m){var l=m[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,h,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){f||(f=t,d=e,I.call(l))})):d={},I.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var f=o.finish();f&&(u.resourceTiming=JSON.parse(JSON.stringify(f)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;!function t(e,r,n,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=n-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),h=Math.max(i,Math.floor(n-l*u/s+f)),p=Math.min(a,Math.floor(n+(s-l)*u/s+f));t(e,r,n,h,p,o)}var d=r[2*n+o],m=i,g=a;for(z(e,r,i,n),r[2*a+o]>d&&z(e,r,i,a);md;)g--}r[2*i+o]===d?z(e,r,i,g):(g++,z(e,r,g,a)),g<=n&&(i=g+1),n<=g&&(a=g-1)}}(t,e,o,n,i,a%2),O(t,e,r,n,o-1,a+1),O(t,e,r,o+1,i,a+1)}}function z(t,e,r,n){D(t,r,n),D(e,2*r,2*n),D(e,2*r+1,2*n+1)}function D(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function R(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=T,_.GeoJSONWrapper=k;var F=function(t){return t[0]},B=function(t){return t[1]},N=function(t,e,r,n,i){void 0===e&&(e=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var m=Math.floor((p+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(g))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),f=o.pop();if(u-f<=a)for(var h=f;h<=u;h++)R(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var p=Math.floor((f+u)/2),d=e[2*p],m=e[2*p+1];R(d,m,r,n)<=l&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(f),o.push(p-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=X(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function H(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:Y(n),y:W(i),zoom:1/0,index:e,parentId:-1}}function q(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function Y(t){return t/360+.5}function W(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 X(t,e){for(var r in e)t[r]=e[r];return t}function Z(t){return t.x}function J(t){return t.y}function K(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function Q(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=n-r>>1,l=n-r,c=e[r],u=e[r+1],f=e[n],h=e[n+1],p=r+3;po)a=p,o=d;else if(d===o){var m=Math.abs(p-s);mi&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function nt(t,e,r,n){for(var i=0;i1?1:r}function ot(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var m=[];if("Point"===h||"MultiPoint"===h)st(f,m,r,n,i);else if("LineString"===h)lt(f,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)ut(f,m,r,n,i,!1);else if("Polygon"===h)ut(f,m,r,n,i,!0);else if("MultiPolygon"===h)for(var g=0;g=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function lt(t,e,r,n,i,a,o){for(var s,l,c=ct(t),u=0===i?ht:pt,f=t.start,h=0;hr&&(l=u(c,p,d,g,v,r),o&&(c.start=f+s*l)):y>n?x=r&&(l=u(c,p,d,g,v,r),b=!0),x>n&&y<=n&&(l=u(c,p,d,g,v,n),b=!0),!a&&b&&(o&&(c.end=f+s*l),e.push(c),c=ct(t)),o&&(f+=s)}var _=t.length-3;p=t[_],d=t[_+1],m=t[_+2],(y=0===i?p:d)>=r&&y<=n&&ft(c,p,d,m),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&ft(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ct(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ut(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),f>o.maxY&&(o.maxY=f)}return o}function xt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,Z,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,f=l.range(Y(r),W(a),Y(i),W(n));u1?this._map(c,!0):null,g=(l<<5)+(e+1)+this.points.length,v=0,y=f;v>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),h=this.tiles[f]=yt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(h.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,g,v,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,T=.5+_,k=1+_;m=g=v=y=null,x=ot(t,u,r-_,r+T,0,h.minX,h.maxX,l),b=ot(t,u,r+w,r+k,0,h.minX,h.maxX,l),t=null,x&&(m=ot(x,u,n-_,n+T,1,h.minY,h.maxY,l),g=ot(x,u,n+w,n+k,1,h.minY,h.maxY,l),x=null),b&&(v=ot(b,u,n-_,n+T,1,h.minY,h.maxY,l),y=ot(b,u,n+w,n+k,1,h.minY,h.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},_t.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,f=r;!l&&c>0;)c--,u=Math.floor(u/2),f=Math.floor(f/2),l=this.tiles[wt(c,u,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,f),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,f,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?gt(this.tiles[s],i):null):null};var kt=function(e){function r(t,r,n,i){e.call(this,t,r,n,Tt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));f(o,!0);try{e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function v(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var u=Math.abs(c-l.left),f=Math.abs(c-l.right),h=Math.min(u,f),p=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);p=Math.sqrt(h*h+m*m)}else p=n-Math.sqrt(h*h+d*d);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),f=Math.abs(c-l.right),h=Math.min(u,f),p=l.isDash?h:-h;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),I=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(I),z=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(It(this._source.type)){for(var c={},u={},f=0,h=Object.keys(l);fthis._source.maxzoom){var g=d.children(this._source.maxzoom)[0],v=this.getTile(g);if(v&&v.hasData()){n[g.key]=g;continue}}else{var y=d.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var x=m.wasRequested(),b=d.overscaledZ-1;b>=a;--b){var _=d.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(m=this.getTile(_))&&x&&(m=this._addTile(_)),m&&(n[_.key]=_,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),f=1/0,h=1/0,p=-1/0,d=-1/0,m=0,g=c;m=0&&v[1].y+g>=0){var y=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:y,cameraQueryGeometry:x,scale:m})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles){this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading")}this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function It(t){return"raster"===t||"image"===t||"video"===t}function Ot(){return new t.window.Worker(Zi.workerUrl)}Ct.maxOverzooming=10,Ct.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),f=[256/n.width*2+1,256/n.height*2+1],h=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,v=0;vMath.abs(n.x-r.x)*i)return{useVertical:!0};return(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,a,o,s,l,c,u,f,h,p,d){var m,g=r/24,v=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=ie(g,l,v,y,n,f,h,e,c,o,p);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,k=te(w.last.point,s).point;if(i&&!n){var M=ae(e.writingMode,T,k,d);if(M)return M}m=[w.first];for(var A=e.glyphStartIndex+1;A0?C.point:se(h,L,S,1,a),I=ae(e.writingMode,S,P,d);if(I)return I}var O=le(g*l.getoffsetX(e.glyphStartIndex),v,y,n,f,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!O)return{notEnoughRoom:!0};m=[O]}for(var z=0,D=m;z0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,v=a,y=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((g+=d)=c)return null;if(y=v,w.push(v),void 0===(v=h[g])){var T=new t.Point(u.getx(g),u.gety(g)),k=te(T,f);if(k.signedDistanceFromCamera>0)v=h[g]=k.point;else{var M=g-d;v=se(0===x?o:new t.Point(u.getx(M),u.gety(M)),T,y,_-x+1,f)}}x+=b,b=y.dist(v)}var A=(_-x)/b,S=v.sub(y),E=S.mult(A)._add(y);E._add(S._unit()._perp()._mult(n*d));var L=m+Math.atan2(v.y-y.y,v.x-y.x);return w.push(E),{point:E,angle:L,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Kt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Kt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,f=0,h=c;f=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,v=0,y=m;vo*o+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var f=l-s,h=u-c;return f*f+h*h<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r=1;P--)C.push(E.path[P]);for(var I=1;I0){for(var R=C[0].clone(),F=C[0].clone(),B=1;B=M.x&&F.x<=A.x&&R.y>=M.y&&F.y<=A.y?[C]:F.xA.x||F.yA.y?[]:t.clipLine([C],M.x,M.y,A.x,A.y)}for(var N=0,j=D;N=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(m=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(h,t,f,p),h.allowVerticalPlacement&&(this.markUsedOrientation(h,p,f),this.placedOrientations[f.crossTileID]=p),{shift:v,placedGlyphBoxes:y}},we.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,f=a.textPixelRatio,h=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),v=s.get("icon-optional"),y=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=y&&(x||!o.hasIconData()||v),M=x&&(y||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var A=function(e,a){if(!r[e.crossTileID])if(h)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var p,T=!1,A=!1,S=!0,E=null,L={box:null,offscreen:null},C={box:null,offscreen:null},P=null,I=null,O=0,z=0,D=0;a.textFeatureIndex?O=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(O=e.featureIndex),a.verticalTextFeatureIndex&&(z=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(N=N.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,h={box:[],offscreen:!1},p=y?2*N.length:N.length,d=0;d=N.length,k=i.attemptAnchorPlacement(g,t,a,s,c,b,_,f,l,m,v,e,o,n,u);if(k&&(h=k.placedGlyphBoxes)&&h.box&&h.box.length){T=!0,E=k.shift;break}}return h};B((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=L&&L.box&&L.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&i.prevPlacement){var H=i.prevPlacement.variableOffsets[e.crossTileID];H&&(i.variableOffsets[e.crossTileID]=H,i.markUsedJustification(o,H.anchor,e,V))}}else{var q=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,y,f,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B((function(){return q(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?q(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(L&&L.box&&L.box.length)}}if(T=(p=L)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Y=t.evaluateSizeForFeature(o.textSizeData,d,G),W=s.get("text-padding"),X=e.collisionCircleDiameter;P=i.collisionIndex.placeCollisionCircles(y,G,o.lineVertexArray,o.glyphOffsetArray,Y,l,c,u,n,_,m.predicate,X,W),T=y||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(a.iconFeatureIndex&&(D=a.iconFeatureIndex),a.iconBox){var Z=function(t){var e=w&&E?_e(t,E.x,E.y,b,_,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,f,l,m.predicate)};A=C&&C.box&&C.box.length&&a.verticalIconBox?(I=Z(a.verticalIconBox)).box.length>0:(I=Z(a.iconBox)).box.length>0,S=S&&I.offscreen}var J=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=v||0===e.numIconVertices;if(J||K?K?J||(A=A&&T):T=A&&T:A=T=A&&T,T&&p&&p.box&&(C&&C.box&&z?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,m.ID)),A&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,D,m.ID),P&&(T&&i.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,O,m.ID),n)){var Q=o.bucketInstanceId,$=i.collisionCircleArrays[Q];void 0===$&&($=i.collisionCircleArrays[Q]=new ve);for(var tt=0;tt=0;--E){var L=S[E];A(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var C=e.symbolInstanceStart;C=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},we.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===t.WritingMode.vertical,w=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;if(y){var T=Pe(v.text),k=_?Ie:T;d(e.text,s,k);var M=w?Ie:T;d(e.text,l,M);var A=v.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=A||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,b);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var L=Pe(v.icon),C=!(h&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var P=C?L:Ie;d(e.icon,a.numIconVertices,P),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=v.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=C?Ie:L;d(e.icon,a.numVerticalIconVertices,I),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var O=e.collisionArrays[n];if(O){var z=new t.Point(0,0);if(O.textBox||O.verticalTextBox){var D=!0;if(c){var R=i.variableOffsets[m];R?(z=be(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&z._rotate(f?i.transform.angle:-i.transform.angle)):D=!1}O.textBox&&Te(e.textCollisionBox.collisionVertexArray,v.text.placed,!D||_,z.x,z.y),O.verticalTextBox&&Te(e.textCollisionBox.collisionVertexArray,v.text.placed,!D||w,z.x,z.y)}var F=Boolean(!w&&O.verticalIconBox);O.iconBox&&Te(e.iconCollisionBox.collisionVertexArray,v.icon.placed,F,h?z.x:0,h?z.y:0),O.verticalIconBox&&Te(e.iconCollisionBox.collisionVertexArray,v.icon.placed,!F,h?z.x:0,h?z.y:0)}}},g=0;gt},we.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Ae=Math.pow(2,17),Se=Math.pow(2,16),Ee=Math.pow(2,9),Le=Math.pow(2,8),Ce=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Me+r*Ae+e*Se+r*Ee+e*Le+r*Ce+e}var Ie=0,Oe=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Oe.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Oe(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var De=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,f=l.x,h=l.y,p=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,v=l.content,y=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,y,{x:f,y:h},{x:0,y:0},{width:c,height:u}),r[s]={data:y,pixelRatio:d,sdf:p,stretchX:m,stretchY:g,content:v}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Ct(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var v=i[g].feature;if(n[v.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),lr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cr=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),mr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),vr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,a){return n[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}))}}var xr=Object.freeze({__proto__:null,prelude:Ye,background:We,backgroundPattern:Xe,circle:Ze,clippingMask:Je,heatmap:Ke,heatmapTexture:Qe,collisionBox:$e,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ir,fillPattern:ar,fillExtrusion:or,fillExtrusionPattern:sr,hillshadePrepare:lr,hillshade:cr,line:ur,lineGradient:fr,linePattern:hr,lineSDF:pr,raster:dr,symbolIcon:mr,symbolSDF:gr,symbolTextAndIcon:vr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};br.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}_r.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m){var g,v=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[y].set(o[y]);p&&p.setUniforms(t,this.binderUniforms,f,{zoom:h});for(var x=(g={},g[v.LINES]=2,g[v.TRIANGLES]=3,g[v.LINE_STRIP]=1,g)[e],b=0,_=u.get();b<_.length;b+=1){var w=_[b],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new br)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,w.vertexOffset,d,m),v.drawElements(e,w.primitiveLength*x,v.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Tr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},kr=function(e,r,n,i,a,o,s){return t.extend(Tr(e,r,n,i),wr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Mr=function(t){return{u_matrix:t}},Ar=function(e,r,n,i){return t.extend(Mr(e),wr(n,r,i))},Sr=function(t,e){return{u_matrix:t,u_world:e}},Er=function(e,r,n,i,a){return t.extend(Ar(e,r,n,i),{u_world:a})},Lr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=pe(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Cr=function(t,e,r){var n=pe(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Pr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Ir=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},Or=function(t){return{u_matrix:t}},zr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:pe(e,1,r),u_intensity:n}};function Dr(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Rr=function(e,r,n){var i=e.transform;return{u_matrix:Ur(e,r,n),u_ratio:1/pe(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Fr=function(e,r,n){return t.extend(Rr(e,r,n),{u_image:0})},Br=function(e,r,n,i){var a=e.transform,o=jr(r,a);return{u_matrix:Ur(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/pe(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Nr=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=jr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),f=s.getDash(i.to,c),h=u.width*a.fromScale,p=f.width*a.toScale;return t.extend(Rr(e,r,n),{u_patternscale_a:[l/h,-u.height/2],u_patternscale_b:[l/p,-f.height/2],u_sdfgamma:s.width/(256*Math.min(h,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:f.y,u_mix:a.t})};function jr(t,e){return 1/pe(t,1,e.tileZoom)}function Ur(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Vr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Hr(i.paint.get("raster-hue-rotate"))};var a,o};function Hr(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]}var qr,Gr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Yr=function(e,r,n,i,a,o,s,l,c,u,f){var h=a.transform;return t.extend(Gr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+f})},Wr=function(e,r,n,i,a,o,s,l,c,u){return t.extend(Yr(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Xr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Zr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,f=u*(n.tileID.canonical.x+n.tileID.wrap*c),h=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[f>>16,h>>16],u_pixel_coord_lower:[65535&f,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},Jr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),f=[],h=0,p=0,d=0;d0){var _=t.create(),w=y;t.mul(_,v.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(_,_,v.placementViewportMatrix),f.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=h+=b.length/4}x&&u.draw(l,c.LINES,Mt.disabled,At.disabled,e.colorModeForRenderPass(),Et.disabled,Cr(y,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&f.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var M=0,A=0,S=f;A=0&&(m[v.associatedIconIndex]={shiftedAnchor:S,angle:E})}else ue(v.numGlyphs,p)}if(f){d.clear();for(var C=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),f=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(e.tileID.overscaledZ-f),p=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var un=new t.Color(1,0,0,1),fn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),dn=new t.Color(0,1,1,1);function mn(t){var e=t.transform.padding;gn(t,t.transform.height-(e.top||0),3,un),gn(t,e.bottom||0,3,fn),vn(t,e.left||0,3,hn),vn(t,t.transform.width-(e.right||0),3,pn);var r=t.transform.centerPoint;!function(t,e,r,n){yn(t,e-1,r-10,2,20,n),yn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,dn)}function gn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function vn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function xn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,c=At.disabled,u=e.colorModeForRenderPass();i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Et.disabled,Ir(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,h=f&&f.byteLength||0,p=Math.floor(h/1024),d=r.getTile(n).tileSize,m=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,a.TRIANGLES,l,c,St.alphaBlended,Et.disabled,Ir(o,t.Color.transparent,m),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var bn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=At.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,f=0,h=e;f256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new At({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new At({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new _r(this.context,xr[t],e,Jr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var wn=function(t,e){this.points=t,this.planes=e};wn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new wn(a,o)};var Tn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Tn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=0;fthis.max[l]-this.min[l])return 0}return 1};var kn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};kn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},kn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},kn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},kn.prototype.clone=function(){return new kn(this.top,this.bottom,this.left,this.right)},kn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Mn=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new kn,this._posMatrixCache={},this._alignedPosMatrixCache={}},An={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Mn.prototype.clone=function(){var t=new Mn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},An.minZoom.get=function(){return this._minZoom},An.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},An.maxZoom.get=function(){return this._maxZoom},An.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},An.minPitch.get=function(){return this._minPitch},An.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},An.maxPitch.get=function(){return this._maxPitch},An.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},An.renderWorldCopies.get=function(){return this._renderWorldCopies},An.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},An.worldSize.get=function(){return this.tileSize*this.scale},An.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},An.size.get=function(){return new t.Point(this.width,this.height)},An.bearing.get=function(){return-this.angle/Math.PI*180},An.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},An.pitch.get=function(){return this._pitch/Math.PI*180},An.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},An.fov.get=function(){return this._fov/Math.PI*180},An.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},An.zoom.get=function(){return this._zoom},An.zoom.set=function(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._constrain(),this._calcMatrices())},An.center.get=function(){return this._center},An.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},An.padding.get=function(){return this._edgeInsets.toJSON()},An.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},An.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Mn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Mn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Mn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Mn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Mn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=wn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Tn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],f=[],h=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,v=m.y,y=m.fullyVisible;if(!y){var x=m.aabb.intersects(s);if(0===x)continue;y=2===x}var b=m.aabb.distanceX(o),_=m.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),T=3+(1<T&&m.zoom>=l)f.push({tileID:new t.OverscaledTileID(m.zoom===h?p:m.zoom,m.wrap,m.zoom,g,v),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-v])});else for(var k=0;k<4;k++){var M=(g<<1)+k%2,A=(v<<1)+(k>>1);u.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:M,y:A,wrap:m.wrap,fullyVisible:y})}}return f.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Mn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},An.unmodified.get=function(){return this._unmodified},Mn.prototype.zoomScale=function(t){return Math.pow(2,t)},Mn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Mn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Mn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},An.point.get=function(){return this.project(this.center)},Mn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Mn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Mn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Mn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Mn.prototype.coordinateLocation=function(t){return t.toLngLat()},Mn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,f=n[2]/a,h=u===f?0:(0-u)/(f-u);return new t.MercatorCoordinate(t.number(o,s,h)/this.worldSize,t.number(l,c,h)/this.worldSize)},Mn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Mn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Mn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Mn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Mn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Mn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Mn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var f=this.latRange;a=t.mercatorYfromLat(f[1])*this.worldSize,e=(o=t.mercatorYfromLat(f[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var v=p.x,y=c.x/2;v-yl&&(n=l-y)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},Mn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,f=new Float64Array(16);t.perspective(f,this._fov,this.width/this.height,u,c),f[8]=2*-r.x/this.width,f[9]=2*r.y/this.height,t.scale(f,f,[1,-1,1]),t.translate(f,f,[0,0,-this.cameraToCenterDistance]),t.rotateX(f,f,this._pitch),t.rotateZ(f,f,this.angle),t.translate(f,f,[-s,-l,0]),this.mercatorMatrix=t.scale([],f,[this.worldSize,this.worldSize,this.worldSize]),t.scale(f,f,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=f,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*h+m*p,v=l-Math.round(l)+d*p+m*h,y=new Float64Array(f);if(t.translate(y,y,[g>.5?g-1:g,v>.5?v-1:v,0]),this.alignedProjMatrix=y,f=t.create(),t.scale(f,f,[this.width/2,-this.height/2,1]),t.translate(f,f,[1,-1,0]),this.labelPlaneMatrix=f,f=t.create(),t.scale(f,f,[1,-1,1]),t.translate(f,f,[-1,-1,0]),t.scale(f,f,[2/this.width,2/this.height,1]),this.glCoordMatrix=f,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(f=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=f,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Mn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Mn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Mn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Sn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var En={linearity:.3,easing:t.bezier(0,0,.3,1)},Ln=t.extend({deceleration:2500,maxSpeed:1400},En),Cn=t.extend({deceleration:20,maxSpeed:1400},En),Pn=t.extend({deceleration:1e3,maxSpeed:360},En),In=t.extend({deceleration:1e3,maxSpeed:90},En),On=function(t){this._map=t,this.clear()};function zn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},On.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.dblclick=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},Nn.prototype.mouseover=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.mouseout=function(t){this._map.fire(new Rn(t.type,this._map,t))},Nn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},Nn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},Nn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Nn.prototype.isEnabled=function(){return!0},Nn.prototype.isActive=function(){return!1},Nn.prototype.enable=function(){},Nn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Rn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Vn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Hn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var qn=function(t){this.singleTap=new Hn(t),this.numTaps=t.numTaps,this.reset()};qn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Gn=function(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()};Gn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Gn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Gn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Gn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Gn.prototype.touchcancel=function(){this.reset()},Gn.prototype.enable=function(){this._enabled=!0},Gn.prototype.disable=function(){this._enabled=!1,this.reset()},Gn.prototype.isEnabled=function(){return this._enabled},Gn.prototype.isActive=function(){return this._active};var Yn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Yn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Yn.prototype._correctButton=function(t,e){return!1},Yn.prototype._move=function(t,e){return{}},Yn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Yn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)0&&(this._active=!0);var i=Vn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid){this._lastPoints=t,this._active=!0;return{pitchDelta:-.5*((n.y+i.y)/2)}}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ni(t)&&ni(e)&&a}},e}(Kn),ai={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ai;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function si(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:si,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active};var li=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};li.prototype.setZoomRate=function(t){this._defaultZoomRate=t},li.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},li.prototype.isEnabled=function(){return!!this._enabled},li.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},li.prototype.isZooming=function(){return!!this._zooming},li.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},li.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},li.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},li.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},li.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},li.prototype.renderFrame=function(){return this._onScrollFrame()},li.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var f=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=c(f);o=t.number(l,s,h),f<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},li.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},li.prototype.reset=function(){this._active=!1};var ci=function(t,e){this._clickZoom=t,this._tapZoom=e};ci.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ci.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ci.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ci.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ui=function(){this.reset()};ui.prototype.reset=function(){this._active=!1},ui.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active};var fi=function(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()};fi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},fi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},fi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},fi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},fi.prototype.touchcancel=function(){this.reset()},fi.prototype.enable=function(){this._enabled=!0},fi.prototype.disable=function(){this._enabled=!1,this.reset()},fi.prototype.isEnabled=function(){return this._enabled},fi.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var di=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};di.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},di.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},di.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},di.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},di.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},di.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var mi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function vi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new On(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-e),T=i.unproject(x.add(b.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,f="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(u-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),v=a.pointLocation(g),y=t.LngLat.convert(e.center||v);this._normalizeCenter(y);var x=a.project(v),b=a.project(y).sub(x),_=e.curve,w=Math.max(a.width,a.height),T=w/d,k=b.mag();if("minZoom"in e){var M=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),A=w/a.zoomScale(M-o);_=Math.sqrt(A/k*2)}var S=_*_;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}var P=E(0),I=function(t){return C(P)/C(P+_*t)},O=function(t){return w*((C(P)*(L(e=P+_*t)/C(e))-L(P))/S)/k;var e},z=(E(1)-P)/_;if(Math.abs(k)<1e-6||!isFinite(z)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var D=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=h!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(e){var i=e*z,d=1/I(i);a.zoom=1===e?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,f,e)),n._pitching&&(a.pitch=t.number(l,h,e)),n._padding&&(a.interpolatePadding(c,p,e),g=a.centerPoint.add(m));var v=1===e?y:a.unproject(x.add(b.mult(O(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?v.wrap():v,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),bi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};bi.prototype.getDefaultPosition=function(){return"bottom-right"},bi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},bi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},bi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},bi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var _i=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_i.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_i.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_i.prototype.getDefaultPosition=function(){return"bottom-left"},_i.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_i.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return!0}return!1}},_i.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new Mn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ti,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Mi))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new yi(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Sn(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new bi({customAttribution:e.customAttribution})),this.addControl(new _i,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Rn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Rn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Rn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;if(void 0===r)return n.prototype.off.call(this,t,e);return this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ii.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ii.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ii.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ii.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ii.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ii.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ii.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ii.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&ji)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ni--,ji=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Ni>1?(e={maximumAge:6e5,timeout:0},ji=!0):(e=this.options.positionOptions,ji=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},Hi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function qi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;if(l>5280)Gi(e,n,l/5280,t._getUIString("ScaleControl.Miles"));else Gi(e,n,l,t._getUIString("ScaleControl.Feet"))}else if(r&&"nautical"===r.unit){Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,a,o,s=(i=r,a=Math.pow(10,(""+Math.floor(i)).length-1),o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),a*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}Hi.prototype.getDefaultPosition=function(){return"bottom-left"},Hi.prototype._onMove=function(){qi(this._map,this._container,this.options)},Hi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Hi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Hi.prototype.setUnit=function(t){this.options.unit=t,qi(this._map,this._container,this.options)};var Yi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Yi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Yi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Yi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Yi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Yi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Yi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Yi.prototype._isFullscreen=function(){return this._fullscreen},Yi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Yi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Xi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Wi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Oi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var a=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,c=this._container.offsetWidth,u=this._container.offsetHeight;l=a.y+s.bottom.ythis._map.transform.height-u?["bottom"]:[],a.xthis._map.transform.width-c/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var f=a.add(s[o]).round();r.setTransform(this._container,zi[o]+" translate("+f.x+"px,"+f.y+"px)"),Di(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);var Zi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ei,NavigationControl:Pi,GeolocateControl:Ui,AttributionControl:bi,ScaleControl:Hi,FullscreenControl:Yi,Popup:Xi,Marker:Fi,Style:qe,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Bt().acquire(zt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Zi})),r}))},{}],452:[function(t,e,r){var n=t("./normalize"),i=t("gl-mat4/create"),a=t("gl-mat4/clone"),o=t("gl-mat4/determinant"),s=t("gl-mat4/invert"),l=t("gl-mat4/transpose"),c={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},u=i(),f=i(),h=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(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}e.exports=function(t,e,r,i,g,v){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),v||(v=[0,0,0,1]),!n(u,t))return!1;if(a(f,u),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var y,x,b,_,w,T,k,M=u[3],A=u[7],S=u[11],E=u[12],L=u[13],C=u[14],P=u[15];if(0!==M||0!==A||0!==S){if(h[0]=M,h[1]=A,h[2]=S,h[3]=P,!s(f,f))return!1;l(f,f),y=g,b=f,_=(x=h)[0],w=x[1],T=x[2],k=x[3],y[0]=b[0]*_+b[4]*w+b[8]*T+b[12]*k,y[1]=b[1]*_+b[5]*w+b[9]*T+b[13]*k,y[2]=b[2]*_+b[6]*w+b[10]*T+b[14]*k,y[3]=b[3]*_+b[7]*w+b[11]*T+b[15]*k}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=E,e[1]=L,e[2]=C,function(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]}(p,u),r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,p[1],p[2]),c.dot(p[0],d)<0)for(var I=0;I<3;I++)r[I]*=-1,p[I][0]*=-1,p[I][1]*=-1,p[I][2]*=-1;return v[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),v[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),v[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),v[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":453,"gl-mat4/clone":278,"gl-mat4/create":280,"gl-mat4/determinant":281,"gl-mat4/invert":293,"gl-mat4/transpose":306,"gl-vec3/cross":360,"gl-vec3/dot":365,"gl-vec3/length":375,"gl-vec3/normalize":382}],453:[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}},{}],454:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),c=f(),u=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!h||!p)&&(n(u.translate,l.translate,c.translate,f),n(u.skew,l.skew,c.skew,f),n(u.scale,l.scale,c.scale,f),n(u.perspective,l.perspective,c.perspective,f),s(u.quaternion,l.quaternion,c.quaternion,f),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}},{"gl-mat4/determinant":281,"gl-vec3/lerp":376,"mat4-decompose":452,"mat4-recompose":455,"quat-slerp":515}],455:[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":280,"gl-mat4/fromRotationTranslation":284,"gl-mat4/identity":291,"gl-mat4/multiply":295,"gl-mat4/scale":303,"gl-mat4/translate":305}],456:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],457:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function p(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]}e.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)h[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&h[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=h[c];else i(o,h,d,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],f(m,m);var g=this.computedInverse;a(g,o);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-o[2+4*c]*b}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(i=0,o.length);i0;--p)r[f++]=s[p];return r};var n=t("robust-orientation")[3]},{"robust-orientation":534}],459:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(e){e?g():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":461}],460:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],461:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<0&&o(l,r))}catch(t){f.call(new p(r),t)}}}function f(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function h(t,e,r,n){for(var i=0;i 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 w=t.getters||[],T=new Array(b),k=0;k=0?T[k]=!0:T[k]=!1;return function(t,e,r,b,_,w){var T=w.length,k=_.length;if(k<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var A="extractContour"+_.join("_"),M=[],S=[],E=[],L=0;L0&&O.push(l(L,_[C-1])+"*"+s(_[C-1])),S.push(d(L,_[C])+"=("+O.join("-")+")|0")}for(L=0;L=0;--L)z.push(s(_[L]));S.push("Q=("+z.join("*")+")|0","P=mallocUint32(Q)","V=mallocUint32(Q)","X=0"),S.push(g(0)+"=0");for(C=1;C<1<0;_=_-1&d)x.push("V[X+"+v(_)+"]");x.push(y(0));for(_=0;_=0;--e)N(e,0);var r=[];for(e=0;e0){",p(_[e]),"=1;"),t(e-1,r|1<<_[e]);for(var n=0;n=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),a.push("1"),o.push("s["+l+"]-2"));var c=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(c=""),i>0){n.push("if(1");for(l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",c);for(l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",c);n.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",p.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",p.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",u,",0);"):n.push("zero(",f,");");break;case"wrap":var d=s.slice(),g=s.slice();e[l]<0?(d[u]="s["+u+"]-2",g[u]="0"):(d[u]="s["+u+"]-1",g[u]="1"),0===i?n.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",d.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>2){diff(",f,",src.pick(",d.join(),")",c,",src.pick(",g.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}i>0&&n.push("};")}for(var s=0;s<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({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]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_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=n({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=n({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=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_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=o({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=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,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":157}],479:[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":480,ndarray:483}],480:[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":157}],481:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=32;function a(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d),0!==(p=t.length-1-l)&&(h>0?s.push(["e",p,"=s",p,"-e",h,"*n",h,",f",p,"=",c[p],"-f",h,"*n",h].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),h=p)}r.push("var "+s.join(","));var g=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var m=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),i=["left","right","data","offset"].concat(o(t.length)),s=a(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var c=[],u=1;u1){r.push("dptr=0;sptr=ptr");for(u=t.length-1;u>=0;--u){0!==(p=t[u])&&r.push(["for(i",p,"=0;i",p,"b){break __l}"].join(""));for(u=t.length-1;u>=1;--u)r.push("sptr+=e"+u,"dptr+=f"+u,"}");r.push("dptr=cptr;sptr=cptr-s0");for(u=t.length-1;u>=0;--u){0!==(p=t[u])&&r.push(["for(i",p,"=0;i",p,"=0;--u){0!==(p=t[u])&&r.push(["for(i",p,"=0;i",p,"scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e),y=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),c=a(e),u=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var f=["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 h=[],p=1;p=0;--a){0!==(o=t[a])&&n.push(["for(i",o,"=0;i",o,"1)for(a=0;a1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,i,a){if(1===r.length)n.push("ptr0="+d(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)i&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function x(){t.length>1&&c&&n.push("free(pivot1)","free(pivot2)")}function b(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++u;y(o,[i,a],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",g(d(i)),">",g(d(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?v([e,r],!1,m("ptr0",g("ptr1"))):n.push(m(d(e),g(d(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++u;y(a,[r],!0,[e,"=",g("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",g(d(r)),"-pivot",i].join(""))}function T(e,r){t.length>1?v([e,r],!1,["tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1","tmp")].join("")):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1","tmp")].join(""))}function k(e,r,i){t.length>1?(v([e,r,i],!1,["tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1",g("ptr2")),"\n",m("ptr2","tmp")].join("")),n.push("++"+r,"--"+i)):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","ptr2=",d(i),"\n","++",r,"\n","--",i,"\n","tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1",g("ptr2")),"\n",m("ptr2","tmp")].join(""))}function A(t,e){T(t,e),n.push("--"+e)}function M(e,r,i){t.length>1?v([e,r],!0,[m("ptr0",g("ptr1")),"\n",m("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(m(d(e),g(d(r))),m(d(r),"pivot"+i))}function S(e,r){n.push(["if((",r,"-",e,")<=",i,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function E(e,r,i){t.length>1?(n.push(["__l",++u,":while(true){"].join("")),v([e],!0,["if(",g("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",u,"}"].join("")),n.push(i,"}")):n.push(["while(",g(d(e)),"===pivot",r,"){",i,"}"].join(""))}return n.push("var "+f.join(",")),b(1,2),b(4,5),b(1,3),b(2,3),b(1,4),b(3,4),b(2,5),b(2,3),b(4,5),t.length>1?v(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",m("ptr5","x"),"\n",m("ptr6","y"),"\n",m("ptr7","z")].join("")):n.push(["pivot1=",g(d("el2")),"\n","pivot2=",g(d("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(d("el1")),"\n","y=",g(d("el3")),"\n","z=",g(d("el5")),"\n",m(d("index1"),"x"),"\n",m(d("index3"),"y"),"\n",m(d("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),T("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),k("k","less","great"),n.push("break"),n.push("}else{"),A("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),T("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--greatindex5){"),E("less",1,"++less"),E("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),T("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great1&&c?new Function("insertionSort","malloc","free",n.join("\n"))(r,c[0],c[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,v);return m(v,y)}},{"typedarray-pool":617}],482:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":481}],483:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),a="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.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("+l.join(",")+",v){"),i?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),i?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+o.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var p=o.map((function(t){return"a"+t+"=this.shape["+t+"]"})),d=o.map((function(t){return"c"+t+"=this.stride["+t+"]"}));a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"c"+t})).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+o.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return 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,"+o.map((function(t){return"shape["+t+"]"})).join(",")+","+o.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],s)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===n){n=0;for(s=0;st==t>0?a===-1>>>0?(r+=1,a=0):a+=1:0===a?(a=-1>>>0,r-=1):a-=1;return n.pack(a,r)}},{"double-bits":182}],485:[function(t,e,r){var n=Math.PI,i=c(120);function a(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function s(t,e,r,a,o,c,u,f,h,p){if(p)T=p[0],k=p[1],_=p[2],w=p[3];else{var d=l(t,e,-o);t=d.x,e=d.y;var g=(t-(f=(d=l(f,h,-o)).x))/2,m=(e-(h=d.y))/2,v=g*g/(r*r)+m*m/(a*a);v>1&&(r*=v=Math.sqrt(v),a*=v);var y=r*r,x=a*a,b=(c==u?-1:1)*Math.sqrt(Math.abs((y*x-y*m*m-x*g*g)/(y*m*m+x*g*g)));b==1/0&&(b=1);var _=b*r*m/a+(t+f)/2,w=b*-a*g/r+(e+h)/2,T=Math.asin(((e-w)/a).toFixed(9)),k=Math.asin(((h-w)/a).toFixed(9));(T=t<_?n-T:T)<0&&(T=2*n+T),(k=f<_?n-k:k)<0&&(k=2*n+k),u&&T>k&&(T-=2*n),!u&&k>T&&(k-=2*n)}if(Math.abs(k-T)>i){var A=k,M=f,S=h;k=T+i*(u&&k>T?1:-1);var E=s(f=_+r*Math.cos(k),h=w+a*Math.sin(k),r,a,o,0,u,M,S,[k,A,_,w])}var L=Math.tan((k-T)/4),C=4/3*r*L,P=4/3*a*L,I=[2*t-(t+C*Math.sin(T)),2*e-(e-P*Math.cos(T)),f+C*Math.sin(k),h-P*Math.cos(k),f,h];if(p)return I;E&&(I=I.concat(E));for(var O=0;O7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=p,b=d;"C"!=e&&"S"!=e||(x+=x-n,b+=b-i),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*p-f,h=2*d-h):(f=p,h=d),v=o(p,d,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=o(p,d,v[1],v[2],v[3],v[4]);break;case"L":v=a(p,d,v[1],v[2]);break;case"H":v=a(p,d,v[1],d);break;case"V":v=a(p,d,p,v[1]);break;case"Z":v=a(p,d,l,u)}e=y,p=v[v.length-2],d=v[v.length-1],v.length>4?(n=v[v.length-4],i=v[v.length-3]):(n=p,i=d),r.push(v)}return r}},{}],486:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(m*y);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;b[x]+=_*(v[w]*g[T]-v[T]*g[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0;for(c=0;c<3;++c)h[c]*=p;i[o]=h}return i}},{}],487:[function(t,e,r){ +!function(t,r,n){r[t]=r[t]||n(),void 0!==e&&e.exports&&(e.exports=r[t])}("Promise",void 0!==t?t:this,(function(){"use strict";var t,e,n,i=Object.prototype.toString,a=void 0!==r?function(t){return r(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function o(t,r){n.add(t,r),e||(e=a(n.drain))}function s(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function l(){for(var t=0;t0&&o(l,r))}catch(t){f.call(new p(r),t)}}}function f(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(l,e))}function h(t,e,r,n){for(var i=0;i 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 s=t.getters||[],l=new Array(a),c=0;c=0?l[c]=!0:l[c]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],f=0|a.shape[1],h=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,v=0|-d,y=0,x=0|-m,b=0,_=-d-m|0,w=0,T=0|d,k=m-d*u|0,M=0,A=0,S=0,E=2*u|0,L=n(E),C=n(E),P=0,I=0,O=-1,z=-1,D=0,R=0|-u,F=0|u,B=0,N=-u-1|0,j=u-1|0,U=0,V=0,H=0;for(M=0;M0){if(A=1,L[P++]=r(h[g],o,s,l),g+=T,u>0)for(M=1,c=h[g],I=L[P]=r(c,o,s,l),D=L[P+O],B=L[P+R],U=L[P+N],I===D&&I===B&&I===U||(y=h[g+v],b=h[g+x],w=h[g+_],t(M,A,c,y,b,w,I,D,B,U,o,s,l),V=C[P]=S++),P+=1,g+=T,M=2;M0)for(M=1,c=h[g],I=L[P]=r(c,o,s,l),D=L[P+O],B=L[P+R],U=L[P+N],I===D&&I===B&&I===U||(y=h[g+v],b=h[g+x],w=h[g+_],t(M,A,c,y,b,w,I,D,B,U,o,s,l),V=C[P]=S++,U!==B&&e(C[P+R],V,b,w,B,U,o,s,l)),P+=1,g+=T,M=2;M0){if(M=1,L[P++]=r(h[g],o,s,l),g+=T,f>0)for(A=1,c=h[g],I=L[P]=r(c,o,s,l),B=L[P+R],D=L[P+O],U=L[P+N],I===B&&I===D&&I===U||(y=h[g+v],b=h[g+x],w=h[g+_],t(M,A,c,y,b,w,I,B,D,U,o,s,l),V=C[P]=S++),P+=1,g+=T,A=2;A0)for(A=1,c=h[g],I=L[P]=r(c,o,s,l),B=L[P+R],D=L[P+O],U=L[P+N],I===B&&I===D&&I===U||(y=h[g+v],b=h[g+x],w=h[g+_],t(M,A,c,y,b,w,I,B,D,U,o,s,l),V=C[P]=S++,U!==B&&e(C[P+R],V,w,y,U,B,o,s,l)),P+=1,g+=T,A=2;A2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}e.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=u[e])return a;for(var r=t.length,n=[f,h],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return u[e]=a,a}(r)(t,e)}},{dup:182}],466:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|t[1];b>0;){b<64?(c=b,b=0):(c=64,b-=64),n=v+x*f+b*h,o=y+x*d+b*m;var _=0,w=0,T=0,k=p,M=f-u*p,A=h-l*f,S=g,E=d-u*g,L=m-l*d;for(T=0;T0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*u+g*c,o=d+m*h+g*f;var v=0,y=0,x=u,b=c-l*u,_=h,w=f-l*h;for(y=0;y0;){y<64?(c=y,y=0):(c=64,y-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|t[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+y*h+x*u+b*f,o=v+y*m+x*p+b*d;var _=0,w=0,T=0,k=h,M=u-c*h,A=f-s*u,S=m,E=p-c*m,L=d-s*p;for(T=0;Tr;){v=0,y=m-o;e:for(g=0;gb)break e;y+=f,v+=h}for(v=m,y=m-o,g=0;g>1,q=H-j,G=H+j,Y=U,W=q,X=H,Z=G,J=V,K=i+1,Q=a-1,$=!0,tt=0,et=0,rt=0,nt=f,it=e(nt),at=e(nt);M=l*Y,A=l*W,N=s;t:for(k=0;k0){g=Y,Y=W,W=g;break t}if(rt<0)break t;N+=p}M=l*Z,A=l*J,N=s;t:for(k=0;k0){g=Z,Z=J,J=g;break t}if(rt<0)break t;N+=p}M=l*Y,A=l*X,N=s;t:for(k=0;k0){g=Y,Y=X,X=g;break t}if(rt<0)break t;N+=p}M=l*W,A=l*X,N=s;t:for(k=0;k0){g=W,W=X,X=g;break t}if(rt<0)break t;N+=p}M=l*Y,A=l*Z,N=s;t:for(k=0;k0){g=Y,Y=Z,Z=g;break t}if(rt<0)break t;N+=p}M=l*X,A=l*Z,N=s;t:for(k=0;k0){g=X,X=Z,Z=g;break t}if(rt<0)break t;N+=p}M=l*W,A=l*J,N=s;t:for(k=0;k0){g=W,W=J,J=g;break t}if(rt<0)break t;N+=p}M=l*W,A=l*X,N=s;t:for(k=0;k0){g=W,W=X,X=g;break t}if(rt<0)break t;N+=p}M=l*Z,A=l*J,N=s;t:for(k=0;k0){g=Z,Z=J,J=g;break t}if(rt<0)break t;N+=p}for(M=l*Y,A=l*W,S=l*X,E=l*Z,L=l*J,C=l*U,P=l*H,I=l*V,B=0,N=s,k=0;k0)){if(rt<0){for(M=l*b,A=l*K,S=l*Q,N=s,k=0;k0)for(;;){_=s+Q*l,B=0;t:for(k=0;k0)){_=s+Q*l,B=0;t:for(k=0;kV){t:for(;;){for(_=s+K*l,B=0,N=s,k=0;k1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},{"typedarray-pool":601}],471:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":470}],472:[function(t,e,r){var n=t("is-buffer"),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],f=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=f*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,f,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,f=0,h=Math.ceil;return"number"==typeof t&&((f=0|t)<0?(u+=s*(i-1),i=h(-i/f)):i=h(i/f),s*=f),"number"==typeof e&&((f=0|e)<0?(u+=l*(a-1),a=h(-a/f)):a=h(a/f),l*=f),"number"==typeof r&&((f=0|r)<0?(u+=c*(o-1),o=h(-o/f)):o=h(o/f),c*=f),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],f=this.stride[0],h=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=f*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=h*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,f,h,p,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],f=this.stride[2],h=this.stride[3],p=this.offset,d=0,m=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(p+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof e&&((d=0|e)<0?(p+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(p+=f*(s-1),s=m(-s/d)):s=m(s/d),f*=d),"number"==typeof i&&((d=0|i)<0?(p+=h*(l-1),l=m(-l/d)):l=m(l/d),h*=d),new n(this.data,a,o,s,l,c,u,f,h,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c,u,f){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|f}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],f=this.shape[3],h=this.shape[4],p=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],v=this.stride[4];return"number"==typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),f-=s),"number"==typeof a&&a>=0&&(o+=v*(s=0|a),h-=s),new n(this.data,l,c,u,f,h,p,d,m,g,v,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],f=this.stride[0],h=this.stride[1],p=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,v=0,y=Math.ceil;return"number"==typeof t&&((v=0|t)<0?(g+=f*(o-1),o=y(-o/v)):o=y(o/v),f*=v),"number"==typeof e&&((v=0|e)<0?(g+=h*(s-1),s=y(-s/v)):s=y(s/v),h*=v),"number"==typeof r&&((v=0|r)<0?(g+=p*(l-1),l=y(-l/v)):l=y(l/v),p*=v),"number"==typeof i&&((v=0|i)<0?(g+=d*(c-1),c=y(-c/v)):c=y(c/v),d*=v),"number"==typeof a&&((v=0|a)<0?(g+=m*(u-1),u=y(-u/v)):u=y(u/v),m*=v),new n(this.data,o,s,l,c,u,f,h,p,d,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===a){a=0;for(s=0;st==t>0?a===-1>>>0?(r+=1,a=0):a+=1:0===a?(a=-1>>>0,r-=1):a-=1;return n.pack(a,r)}},{"double-bits":179}],474:[function(t,e,r){var n=Math.PI,i=c(120);function a(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function s(t,e,r,a,o,c,u,f,h,p){if(p)T=p[0],k=p[1],_=p[2],w=p[3];else{var d=l(t,e,-o);t=d.x,e=d.y;var m=(t-(f=(d=l(f,h,-o)).x))/2,g=(e-(h=d.y))/2,v=m*m/(r*r)+g*g/(a*a);v>1&&(r*=v=Math.sqrt(v),a*=v);var y=r*r,x=a*a,b=(c==u?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*m*m)/(y*g*g+x*m*m)));b==1/0&&(b=1);var _=b*r*g/a+(t+f)/2,w=b*-a*m/r+(e+h)/2,T=Math.asin(((e-w)/a).toFixed(9)),k=Math.asin(((h-w)/a).toFixed(9));(T=t<_?n-T:T)<0&&(T=2*n+T),(k=f<_?n-k:k)<0&&(k=2*n+k),u&&T>k&&(T-=2*n),!u&&k>T&&(k-=2*n)}if(Math.abs(k-T)>i){var M=k,A=f,S=h;k=T+i*(u&&k>T?1:-1);var E=s(f=_+r*Math.cos(k),h=w+a*Math.sin(k),r,a,o,0,u,A,S,[k,M,_,w])}var L=Math.tan((k-T)/4),C=4/3*r*L,P=4/3*a*L,I=[2*t-(t+C*Math.sin(T)),2*e-(e-P*Math.cos(T)),f+C*Math.sin(k),h-P*Math.cos(k),f,h];if(p)return I;E&&(I=I.concat(E));for(var O=0;O7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=p,b=d;"C"!=e&&"S"!=e||(x+=x-n,b+=b-i),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*p-f,h=2*d-h):(f=p,h=d),v=o(p,d,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=o(p,d,v[1],v[2],v[3],v[4]);break;case"L":v=a(p,d,v[1],v[2]);break;case"H":v=a(p,d,v[1],d);break;case"V":v=a(p,d,p,v[1]);break;case"Z":v=a(p,d,l,u)}e=y,p=v[v.length-2],d=v[v.length-1],v.length>4?(n=v[v.length-4],i=v[v.length-3]):(n=p,i=d),r.push(v)}return r}},{}],475:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;b[x]+=_*(v[w]*m[T]-v[T]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0;for(c=0;c<3;++c)h[c]*=p;i[o]=h}return i}},{}],476:[function(t,e,r){ /* object-assign (c) Sindre Sorhus @license MIT */ -"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){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;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),c=1;c0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c);f=Math.sqrt(2*h-u+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],489:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(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)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(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 c=0,f=0;f<3;++f)c+=r[l+4*f]*i[f];r[12+l]=-c}},h.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},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],f=i[4],h=i[8],p=u*a+f*o+h*s,d=l(u-=a*p,f-=o*p,h-=s*p);u/=d,f/=d,h/=d;var g=i[2],m=i[6],v=i[10],y=g*a+m*o+v*s,x=g*u+m*f+v*h,b=l(g-=y*a+x*u,m-=y*o+x*f,v-=y*s+x*h);g/=b,m/=b,v/=b;var _=u*e+a*r,w=f*e+o*r,T=h*e+s*r;this.center.move(t,_,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],f=i[5],h=i[9],p=i[2],d=i[6],g=i[10],m=e*a+r*u,v=e*o+r*f,y=e*s+r*h,x=-(d*y-g*v),b=-(g*m-p*y),_=-(p*v-d*m),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),T=c(x,b,_,w);T>1e-6?(x/=T,b/=T,_/=T,w/=T):(x=b=_=0,w=1);var k=this.computedRotation,A=k[0],M=k[1],S=k[2],E=k[3],L=A*w+E*x+M*_-S*b,C=M*w+E*b+S*x-A*_,P=S*w+E*_+A*b-M*x,I=E*w-A*x-M*b-S*_;if(n){x=p,b=d,_=g;var O=Math.sin(n)/l(x,b,_);x*=O,b*=O,_*=O,I=I*(w=Math.cos(e))-(L=L*w+I*x+C*_-P*b)*x-(C=C*w+I*b+P*x-L*_)*b-(P=P*w+I*_+L*b-C*x)*_}var z=c(L,C,P,I);z>1e-6?(L/=z,C/=z,P/=z,I/=z):(L=C=P=0,I=1),this.rotation.set(t,L,C,P,I)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,c-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.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},h.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])]},h.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]}},h.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":488,"filtered-vector":250,"gl-mat4/fromQuat":288,"gl-mat4/invert":299,"gl-mat4/lookAt":300}],490:[function(t,e,r){ +"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){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;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),c=1;c0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c);f=Math.sqrt(2*h-u+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],478:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(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)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(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 c=0,f=0;f<3;++f)c+=r[l+4*f]*i[f];r[12+l]=-c}},h.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},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],f=i[4],h=i[8],p=u*a+f*o+h*s,d=l(u-=a*p,f-=o*p,h-=s*p);u/=d,f/=d,h/=d;var m=i[2],g=i[6],v=i[10],y=m*a+g*o+v*s,x=m*u+g*f+v*h,b=l(m-=y*a+x*u,g-=y*o+x*f,v-=y*s+x*h);m/=b,g/=b,v/=b;var _=u*e+a*r,w=f*e+o*r,T=h*e+s*r;this.center.move(t,_,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],f=i[5],h=i[9],p=i[2],d=i[6],m=i[10],g=e*a+r*u,v=e*o+r*f,y=e*s+r*h,x=-(d*y-m*v),b=-(m*g-p*y),_=-(p*v-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),T=c(x,b,_,w);T>1e-6?(x/=T,b/=T,_/=T,w/=T):(x=b=_=0,w=1);var k=this.computedRotation,M=k[0],A=k[1],S=k[2],E=k[3],L=M*w+E*x+A*_-S*b,C=A*w+E*b+S*x-M*_,P=S*w+E*_+M*b-A*x,I=E*w-M*x-A*b-S*_;if(n){x=p,b=d,_=m;var O=Math.sin(n)/l(x,b,_);x*=O,b*=O,_*=O,I=I*(w=Math.cos(e))-(L=L*w+I*x+C*_-P*b)*x-(C=C*w+I*b+P*x-L*_)*b-(P=P*w+I*_+L*b-C*x)*_}var z=c(L,C,P,I);z>1e-6?(L/=z,C/=z,P/=z,I/=z):(L=C=P=0,I=1),this.rotation.set(t,L,C,P,I)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,c-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.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},h.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])]},h.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]}},h.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":477,"filtered-vector":247,"gl-mat4/fromQuat":282,"gl-mat4/invert":293,"gl-mat4/lookAt":294}],479:[function(t,e,r){ /*! * pad-left * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT license. */ -"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":541}],491:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach((function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function i(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function a(t,e){return Array.isArray(t)?i(t,e):n(t,e)}a.parse=n,a.stringify=i,e.exports=a},{}],492:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;arguments.length>1&&(t=arguments);"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]);t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{"pick-by-alias":498}],493:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,(function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return 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]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":450,"typedarray-pool":617}],498:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,a,o={};if("string"==typeof e&&(e=i(e)),Array.isArray(e)){var s={};for(a=0;a0){o=a[u][r][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],p=0;p0&&(o=d,s=g,l=f)}return i||o&&c(o,l),s}function f(t,r){var i=a[r][t][0],o=[t];c(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=u(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],p=u(l,f,!0);if(n(e[l],e[f],e[h],e[p])<0)break;o.push(t),s=u(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){a[0][o].length;var g=f(o,p);h(0,g)?d.push.apply(d,g):(d.length>0&&l.push(d),d=g)}d.length>0&&l.push(d)}return l};var n=t("compare-angle")},{"compare-angle":138}],500:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var c=o.pop();i[c]=!1;var u=r[c];for(s=0;s0}))).length,m=new Array(g),v=new Array(g);for(p=0;p0;){var B=R.pop(),N=E[B];l(N,(function(t,e){return t-e}));var j,U=N.length,V=F[B];if(0===V){var q=d[B];j=[q]}for(p=0;p=0))if(F[H]=1^V,R.push(H),0===V)D(q=d[H])||(q.reverse(),j.push(q))}0===V&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),c=t("./lib/trim-leaves");function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(v.slabs,v.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function i(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function a(t,e){return Array.isArray(t)?i(t,e):n(t,e)}a.parse=n,a.stringify=i,e.exports=a},{}],481:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;arguments.length>1&&(t=arguments);"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]);t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{"pick-by-alias":485}],482:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,(function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length0){o=a[u][r][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],p=0;p0&&(o=d,s=m,l=f)}return i||o&&c(o,l),s}function f(t,r){var i=a[r][t][0],o=[t];c(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=u(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],p=u(l,f,!0);if(n(e[l],e[f],e[h],e[p])<0)break;o.push(t),s=u(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){a[0][o].length;var m=f(o,p);h(0,m)?d.push.apply(d,m):(d.length>0&&l.push(d),d=m)}d.length>0&&l.push(d)}return l};var n=t("compare-angle")},{"compare-angle":138}],487:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var c=o.pop();i[c]=!1;var u=r[c];for(s=0;s0}))).length,g=new Array(m),v=new Array(m);for(p=0;p0;){var B=R.pop(),N=E[B];l(N,(function(t,e){return t-e}));var j,U=N.length,V=F[B];if(0===V){var H=d[B];j=[H]}for(p=0;p=0))if(F[q]=1^V,R.push(q),0===V)D(H=d[q])||(H.reverse(),j.push(H))}0===V&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),c=t("./lib/trim-leaves");function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(v.slabs,v.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],507:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),p=e.pointsSame(s,u);if(h&&p)return n;var d=!h&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(s,c,u);if(h)return g?l(n,s):l(t,u),n;d&&(p||(g?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=c(h),d=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function m(){if(d){var t=u(h,d);if(t)return t}return!!g&&u(h,g)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!g&&g.seg);var v,y=m();if(y){var x;if(t)(x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:i,h.seg.myFill.above=x?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)v=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:v,below:v};r&&r.status(h.seg,!!d&&d.seg,!!g&&g.seg),h.other.status=p.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=c?(k=1,y=c+2*h+d):y=h*(k=-h/c)+d):(k=0,p>=0?(A=0,y=d):-p>=f?(A=1,y=f+2*p+d):y=p*(A=-p/f)+d);else if(A<0)A=0,h>=0?(k=0,y=d):-h>=c?(k=1,y=c+2*h+d):y=h*(k=-h/c)+d;else{var M=1/T;y=(k*=M)*(c*k+u*(A*=M)+2*h)+A*(u*k+f*A+2*p)+d}else k<0?(b=f+p)>(x=u+h)?(_=b-x)>=(w=c-2*u+f)?(k=1,A=0,y=c+2*h+d):y=(k=_/w)*(c*k+u*(A=1-k)+2*h)+A*(u*k+f*A+2*p)+d:(k=0,b<=0?(A=1,y=f+2*p+d):p>=0?(A=0,y=d):y=p*(A=-p/f)+d):A<0?(b=c+h)>(x=u+p)?(_=b-x)>=(w=c-2*u+f)?(A=1,k=0,y=f+2*p+d):y=(k=1-(A=_/w))*(c*k+u*A+2*h)+A*(u*k+f*A+2*p)+d:(A=0,b<=0?(k=1,y=c+2*h+d):h>=0?(k=0,y=d):y=h*(k=-h/c)+d):(_=f+p-u-h)<=0?(k=0,A=1,y=f+2*p+d):_>=(w=c-2*u+f)?(k=1,A=0,y=c+2*h+d):y=(k=_/w)*(c*k+u*(A=1-k)+2*h)+A*(u*k+f*A+2*p)+d;var S=1-k-A;for(l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],g=h,m=0;m0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:f,data_offset:h+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],515:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(h.variants=f.variants),f.orientation&&(h.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var p=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),g=s.get_orientation(d);g>0&&(h.orientation=g)}return h}}}}}}},{"../common":513,"../exif_utils":514,"../miaf_utils":515}],517:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":513}],518:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":513}],519:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":513}],520:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1])for(var e=2;;){if(t.length-e<2)return;if(255!==t[e++])return;for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":513,"../exif_utils":514}],521:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":513}],522:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":513}],523:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===p&&d>=9?r=r||f(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":513,"../exif_utils":514}],526:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":516,"./parse_sync/bmp":517,"./parse_sync/gif":518,"./parse_sync/ico":519,"./parse_sync/jpeg":520,"./parse_sync/png":521,"./parse_sync/psd":522,"./parse_sync/svg":523,"./parse_sync/tiff":524,"./parse_sync/webp":525}],527:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":123,"compare-cell":139,"compare-oriented-cell":140}],536:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):e=t;e.length&&(e.positions=e);if(!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,p,d,g,m,v=t._gl,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),c=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"static",type:"float",data:h}),T(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:d,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:c,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:p,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:g,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:m,stride:24,offset:0},lineOffset:{buffer:m,stride:24,offset:8},capOffset:{buffer:m,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:h.length}),s(b,{update:T,draw:_,destroy:k,regl:t,gl:v,canvas:v.canvas,groups:x}),b;function b(t){t?T(t):null===t&&k(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach((function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function T(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map((function(t,c){var u=x[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(x[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},v.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},v.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},v.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>v.precisionThreshold||e.scale[1]*e.viewport.height>v.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=v.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},v.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},v.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f=D}));(I=I.slice(0,R)).push(D)}for(var F=function(t){var e=k.slice(2*z,2*I[t]).concat(D?k.slice(2*D):[]),r=(d.hole||[]).map((function(e){return e-D+(I[t]-z)})),n=c(e,r);n=n.map((function(e){return e+z+(e+zt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform bool constPointSize;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var p=v.float32(t);return i({data:p,usage:"dynamic"}),a({data:v.fract32(t,p),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nk))&&(s.lower||!(T>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(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)||W(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||W(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=Q[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){X(s).forEach(o)}}}function g(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function C(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;P.call(r);var a=L();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(I(r,t),S(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),E(a,3553),O(r,3553),R(),C(a),o.profile&&(i.stats.size=T(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new z(3553);return yt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=v();return c(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),k(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=T(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(P.call(l),s=0;6>s;++s)g[s]=L();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(g[0],t),S(g[1],e),S(g[2],r),S(g[3],n),S(g[4],i),S(g[5],a);else if(I(l,t),u(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(g[s],h),S(g[s],t[s]);else for(s=0;6>s;++s)S(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(g[s],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,D(h),s=0;6>s;++s)E(g[s],34069+s);for(O(l,34067),R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)C(g[s]);return f}var h=new z(34067);yt[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=v();return c(a,h),a.width=0,a.height=0,p(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),d(a,34069+t,r,n,i),R(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){X(k).forEach(m)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,X(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),v(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=h.byteLength?c.subdata(h):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?K[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);X(c).forEach(e),c={},X(u).forEach(e),u={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[e];if(p&&(p.refCount++,!a))return p;var d=new s(n,e);return r.shaderCount++,l(d,i,a),p||(o[e]=d),h.push(d),j(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=h.indexOf(d);h.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function A(t,e,n,i,o){function s(t){var e=c[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,g,m,s],");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,m,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,g,m]+");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,p=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",nt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),g=i("offset"),m=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof m){if(0===m)return}else r("if(",m,"){"),r.exit("}");tt&&(s=i("instances"),l=t.instancing);var v=p+".type",y=h.elements&&D(h.elements)&&!h.vaoActive;tt&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function G(t,e,r,n,i){return i=(e=b()).proc("body",i),tt&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function Y(t,e,r,n){B(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,r,n.attributes,(function(){return!0}))),q(t,e,r,n.uniforms,(function(){return!0}),!1),H(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",B(t,e),U(t,e,r,n.attributes,i),q(t,e,r,n.uniforms,i,!1),H(t,e,e,r)}function X(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}B(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&M(t,u,r.context),r.needsFramebuffer&&S(t,u,r.framebuffer),L(t,u,r.state,i),r.profile&&i(r.profile)&&N(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),U(t,c,r,n.attributes,a),U(t,u,r,n.attributes,i)),q(t,c,r,n.uniforms,a,!1),q(t,u,r,n.uniforms,i,!0),H(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return G(W,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Z(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;M(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),O(Object.keys(r.state)).forEach((function(e){var n=r.state[e].append(t,i);m(n)?n.forEach((function(r,n){i.set(t.next[e],"["+n+"]",r)})):i.set(a.next,"."+e,n)})),N(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].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){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.join()+"]"),i.set(a.uniforms,"["+e.id(n)+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new Q).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO&&i.set(a.vao,".targetVAO",r.scopeVAO.append(t,i)),n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=vt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=vt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){X(u).forEach(o)},restore:function(){X(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},xt=[];xt[6408]=4,xt[6407]=3;var bt=[];bt[5121]=1,bt[5126]=4,bt[36193]=2;var _t=["x","y","z","w"],wt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Tt={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},kt={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},At={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Mt={cw:2304,ccw:2305},St=new z(!1,!1,!1,(function(){}));return function(t){function e(){if(0===J.length)w&&w.update(),tt=null;else{tt=q.next(e),f();for(var t=J.length-1;0<=t;--t){var r=J[t];r&&r(P,null,0)}m.flush(),w&&w.update()}}function r(){!tt&&0=J.length&&n()}}}}function u(){var t=X.viewport,e=X.scissor_box;t[0]=t[1]=e[0]=e[1]=0,P.viewportWidth=P.framebufferWidth=P.drawingBufferWidth=t[2]=e[2]=m.drawingBufferWidth,P.viewportHeight=P.framebufferHeight=P.drawingBufferHeight=t[3]=e[3]=m.drawingBufferHeight}function f(){P.tick+=1,P.time=g(),u(),W.procs.poll()}function h(){F.refresh(),u(),W.procs.refresh(),w&&w.update()}function g(){return(H()-T)/1e3}if(!(t=i(t)))return null;var m=t.gl,v=m.getContextAttributes();m.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)et(j({framebuffer:t.framebuffer.faces[e]},t),l);else et(t,l);else l(0,t)},prop:V.define.bind(null,1),context:V.define.bind(null,2),this:V.define.bind(null,3),draw:s({}),buffer:function(t){return O.create(t,34962,!1,!1)},elements:function(t){return z.create(t,!1)},texture:F.create2D,cube:F.createCube,renderbuffer:U.create,framebuffer:G.create,framebufferCube:G.createCube,vao:D.createVAO,attributes:v,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=K;break;case"restore":r=Q;break;case"destroy":r=$}return r.push(e),{cancel:function(){for(var t=0;t=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],493:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),p=e.pointsSame(s,u);if(h&&p)return n;var d=!h&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;d&&(p||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=c(h),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function g(){if(d){var t=u(h,d);if(t)return t}return!!m&&u(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var v,y=g();if(y){var x;if(t)(x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=x?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)v=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:v,below:v};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=p.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=c?(k=1,y=c+2*h+d):y=h*(k=-h/c)+d):(k=0,p>=0?(M=0,y=d):-p>=f?(M=1,y=f+2*p+d):y=p*(M=-p/f)+d);else if(M<0)M=0,h>=0?(k=0,y=d):-h>=c?(k=1,y=c+2*h+d):y=h*(k=-h/c)+d;else{var A=1/T;y=(k*=A)*(c*k+u*(M*=A)+2*h)+M*(u*k+f*M+2*p)+d}else k<0?(b=f+p)>(x=u+h)?(_=b-x)>=(w=c-2*u+f)?(k=1,M=0,y=c+2*h+d):y=(k=_/w)*(c*k+u*(M=1-k)+2*h)+M*(u*k+f*M+2*p)+d:(k=0,b<=0?(M=1,y=f+2*p+d):p>=0?(M=0,y=d):y=p*(M=-p/f)+d):M<0?(b=c+h)>(x=u+p)?(_=b-x)>=(w=c-2*u+f)?(M=1,k=0,y=f+2*p+d):y=(k=1-(M=_/w))*(c*k+u*M+2*h)+M*(u*k+f*M+2*p)+d:(M=0,b<=0?(k=1,y=c+2*h+d):h>=0?(k=0,y=d):y=h*(k=-h/c)+d):(_=f+p-u-h)<=0?(k=0,M=1,y=f+2*p+d):_>=(w=c-2*u+f)?(k=1,M=0,y=c+2*h+d):y=(k=_/w)*(c*k+u*(M=1-k)+2*h)+M*(u*k+f*M+2*p)+d;var S=1-k-M;for(l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=h,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:f,data_offset:h+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],501:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(h.variants=f.variants),f.orientation&&(h.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var p=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=s.get_orientation(d);m>0&&(h.orientation=m)}return h}}}}}}},{"../common":499,"../exif_utils":500,"../miaf_utils":501}],503:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":499}],504:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":499}],505:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":499}],506:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1])for(var e=2;;){if(t.length-e<2)return;if(255!==t[e++])return;for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":499,"../exif_utils":500}],507:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":499}],508:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":499}],509:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===p&&d>=9?r=r||f(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":499,"../exif_utils":500}],512:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":502,"./parse_sync/bmp":503,"./parse_sync/gif":504,"./parse_sync/ico":505,"./parse_sync/jpeg":506,"./parse_sync/png":507,"./parse_sync/psd":508,"./parse_sync/svg":509,"./parse_sync/tiff":510,"./parse_sync/webp":511}],513:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":123,"compare-cell":139,"compare-oriented-cell":140}],522:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):e=t;e.length&&(e.positions=e);if(!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,p,d,m,g,v=t._gl,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),c=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:h}),T(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:d,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:c,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:p,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:m,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:h.length}),s(b,{update:T,draw:_,destroy:k,regl:t,gl:v,canvas:v.canvas,groups:x}),b;function b(t){t?T(t):null===t&&k(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach((function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function T(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map((function(t,c){var u=x[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(x[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},v.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},v.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},v.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>v.precisionThreshold||e.scale[1]*e.viewport.height>v.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=v.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},v.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},v.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f=D}));(I=I.slice(0,R)).push(D)}for(var F=function(t){var e=k.slice(2*z,2*I[t]).concat(D?k.slice(2*D):[]),r=(d.hole||[]).map((function(e){return e-D+(I[t]-z)})),n=c(e,r);n=n.map((function(e){return e+z+(e+zt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform bool constPointSize;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var p=v.float32(t);return i({data:p,usage:"dynamic"}),a({data:v.fract32(t,p),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nk))&&(s.lower||!(T>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(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)||W(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||W(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=Q[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){X(s).forEach(o)}}}function m(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function C(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;P.call(r);var a=L();return"number"==typeof t?A(a,0|t,"number"==typeof e?0|e:0|t):t?(I(r,t),S(a,t)):A(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),E(a,3553),O(r,3553),R(),C(a),o.profile&&(i.stats.size=T(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new z(3553);return yt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=v();return c(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),k(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=T(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(P.call(l),s=0;6>s;++s)m[s]=L();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(m[0],t),S(m[1],e),S(m[2],r),S(m[3],n),S(m[4],i),S(m[5],a);else if(I(l,t),u(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(m[s],h),S(m[s],t[s]);else for(s=0;6>s;++s)S(m[s],t)}else for(t=0|t||1,s=0;6>s;++s)A(m[s],t,t);for(c(h,m[0]),h.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,h.internalformat=m[0].internalformat,f.width=m[0].width,f.height=m[0].height,D(h),s=0;6>s;++s)E(m[s],34069+s);for(O(l,34067),R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)C(m[s]);return f}var h=new z(34067);yt[h.id]=h,a.cubeCount++;var m=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=v();return c(a,h),a.width=0,a.height=0,p(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),d(a,34069+t,r,n,i),R(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){X(k).forEach(g)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,X(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),v(e)}))}})}function A(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=h.byteLength?c.subdata(h):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?K[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);X(c).forEach(e),c={},X(u).forEach(e),u={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[e];if(p&&(p.refCount++,!a))return p;var d=new s(n,e);return r.shaderCount++,l(d,i,a),p||(o[e]=d),h.push(d),j(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=h.indexOf(d);h.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function M(t,e,n,i,o){function s(t){var e=c[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,m,g,s],");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,m,g]+");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,p=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",nt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");tt&&(s=i("instances"),l=t.instancing);var v=p+".type",y=h.elements&&D(h.elements)&&!h.vaoActive;tt&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function G(t,e,r,n,i){return i=(e=b()).proc("body",i),tt&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function Y(t,e,r,n){B(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),U(t,e,r,n.attributes,(function(){return!0}))),H(t,e,r,n.uniforms,(function(){return!0}),!1),q(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",B(t,e),U(t,e,r,n.attributes,i),H(t,e,r,n.uniforms,i,!1),q(t,e,e,r)}function X(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}B(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&A(t,u,r.context),r.needsFramebuffer&&S(t,u,r.framebuffer),L(t,u,r.state,i),r.profile&&i(r.profile)&&N(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),U(t,c,r,n.attributes,a),U(t,u,r,n.attributes,i)),H(t,c,r,n.uniforms,a,!1),H(t,u,r,n.uniforms,i,!0),q(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return G(W,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Z(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;A(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),O(Object.keys(r.state)).forEach((function(e){var n=r.state[e].append(t,i);g(n)?n.forEach((function(r,n){i.set(t.next[e],"["+n+"]",r)})):i.set(a.next,"."+e,n)})),N(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].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){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.join()+"]"),i.set(a.uniforms,"["+e.id(n)+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new Q).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO&&i.set(a.vao,".targetVAO",r.scopeVAO.append(t,i)),n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=vt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=vt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){X(u).forEach(o)},restore:function(){X(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},xt=[];xt[6408]=4,xt[6407]=3;var bt=[];bt[5121]=1,bt[5126]=4,bt[36193]=2;var _t=["x","y","z","w"],wt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Tt={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},kt={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},Mt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},At={cw:2304,ccw:2305},St=new z(!1,!1,!1,(function(){}));return function(t){function e(){if(0===J.length)w&&w.update(),tt=null;else{tt=H.next(e),f();for(var t=J.length-1;0<=t;--t){var r=J[t];r&&r(P,null,0)}g.flush(),w&&w.update()}}function r(){!tt&&0=J.length&&n()}}}}function u(){var t=X.viewport,e=X.scissor_box;t[0]=t[1]=e[0]=e[1]=0,P.viewportWidth=P.framebufferWidth=P.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,P.viewportHeight=P.framebufferHeight=P.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){P.tick+=1,P.time=m(),u(),W.procs.poll()}function h(){F.refresh(),u(),W.procs.refresh(),w&&w.update()}function m(){return(q()-T)/1e3}if(!(t=i(t)))return null;var g=t.gl,v=g.getContextAttributes();g.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)et(j({framebuffer:t.framebuffer.faces[e]},t),l);else et(t,l);else l(0,t)},prop:V.define.bind(null,1),context:V.define.bind(null,2),this:V.define.bind(null,3),draw:s({}),buffer:function(t){return O.create(t,34962,!1,!1)},elements:function(t){return z.create(t,!1)},texture:F.create2D,cube:F.createCube,renderbuffer:U.create,framebuffer:G.create,framebufferCube:G.createCube,vao:D.createVAO,attributes:v,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=K;break;case"restore":r=Q;break;case"destroy":r=$}return r.push(e),{cancel:function(){for(var t=0;t * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ -"use strict";var n,i="";e.exports=function(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(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],542:[function(t,e,r){(function(t){(function(){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],543:[function(t,e,r){"use strict";e.exports=function(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];(l=o-((r=a+o)-a))&&(t[--n]=r,r=l)}var s=0;for(i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function u(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",c(l(t)),")};return robustDeterminant",t].join(""))(i,a,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;f.length<6;)f.push(u(f.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<6;++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);for(e.exports=i.apply(void 0,f.concat([f,u])),n=0;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function c(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 c(e,t)}function u(t){if(2===t.length)return[["diff(",c(t[0][0],t[1][1]),",",c(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var a=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;a.length<6;)a.push(i(a.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],n=0;n<6;++n)t.push("s"+n),r.push("case ",n,":return s",n,"(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 o=Function.apply(void 0,t);for(e.exports=o.apply(void 0,a.concat([a,i])),n=0;n<6;++n)e.exports[n]=a[n]}()},{"robust-determinant":544}],548:[function(t,e,r){"use strict";var n=t("two-product"),i=t("robust-sum"),a=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function c(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;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=a*c,g=o*l,m=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-g)+f*(m-v)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(u)+(Math.abs(m)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:h(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}!function(){for(;p.length<=5;)p.push(u(p.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++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;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(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),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],556:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":107,"reduce-simplicial-complex":535}],557:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[m],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return m(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],g(e)),A[r]>=0&&w(A[r],g(r))}}var k=[],A=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var S=_();if(S<0||c[S]>r)break;T(S)}var E=[];for(f=0;f=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&C.push([n,i])}})),i.unique(i.normalize(C)),{positions:E,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":548,"simplicial-complex":561}],564:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;p=f[h]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},{"./lib/order-segments":564,"binary-search-bounds":565,"functional-red-black-tree":255,"robust-orientation":548}],567:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var f=o(s,u,l,i);r.push(f),n.push(f.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":545,"robust-sum":553}],568:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return i(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function i(r,n){var i,a,o,s,l,c,u,f,h,p=1,d=r.length,g="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(h+i).length,l=s.width&&u>0?c.repeat(u):"",g+=s.align?h+i+l:"0"===c?h+l+i:l+h+i)}return g}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],569:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/lib/_stream_readable.js"),i.Writable=t("readable-stream/lib/_stream_writable.js"),i.Duplex=t("readable-stream/lib/_stream_duplex.js"),i.Transform=t("readable-stream/lib/_stream_transform.js"),i.PassThrough=t("readable-stream/lib/_stream_passthrough.js"),i.finished=t("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=t("readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(u(),0===n.listenerCount(this,"error"))throw t}function u(){r.removeListener("data",i),t.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("error",c),t.on("error",c),r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t}},{events:116,inherits:447,"readable-stream/lib/_stream_duplex.js":571,"readable-stream/lib/_stream_passthrough.js":572,"readable-stream/lib/_stream_readable.js":573,"readable-stream/lib/_stream_transform.js":574,"readable-stream/lib/_stream_writable.js":575,"readable-stream/lib/internal/streams/end-of-stream.js":579,"readable-stream/lib/internal/streams/pipeline.js":581}],570:[function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function a(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],571:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):P(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,P(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(C,t))}function C(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(N,e,t))}function N(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){w(this,new b("_read()"))},A.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:m;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",g),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",h),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var f=!1;function h(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(e){c("onerror",e),m(),t.removeListener("error",p),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",g),m()}function g(){c("onfinish"),t.removeListener("close",d),m()}function m(){c("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",g),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?L(this):i.reading||r.nextTick(z,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},A.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,P(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":570,"./_stream_duplex":571,"./internal/streams/destroy":578,"./internal/streams/state":582,"./internal/streams/stream":583,_process:528,buffer:117,inherits:447,"util-deprecate":622}],576:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(p(r,!1)))}}function g(t){r.nextTick(d,t)}var m=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(p(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),m);e.exports=function(t){var e,r=Object.create(v,(i(e={},h,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[o]=null,r[s]=null,t(p(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",g.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":579,_process:528}],577:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":570,"./end-of-stream":579}],582:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":570}],583:[function(t,e,r){e.exports=t("events").EventEmitter},{events:116}],584:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":554}],585:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function f(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(p(a));var c=o.apply(t,s);if(!l||a===c)return a}}var h=p((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return f(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return f(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function p(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:528,assert:80,buffer:117,debug:586}],586:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":587,_process:528}],587:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],589:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[g])}a[e]=d}else{if(n[e]===r[e]){var m=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,m.push(x),v.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(m);var b=new Array(y);for(d=0;d c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){");for(c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var p="vExtra"+f.length;a.push("case ",c>>>7,":",p,"(m&0x7f,",l.join(),");break;"),h=["function ",p,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var d=new Array(r),g=new Array(r),m=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+m[b]+"*c");var M=d[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+M+"*("+d[b].join("+")+A+")/("+g[b].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var E=[];for(c=0;c<1<1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,p=void 0===h?0:h,d=t.largeArcFlag,g=void 0===d?0:d,m=t.sweepFlag,v=void 0===m?0:m,y=[];if(0===u||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);T>1&&(u*=Math.sqrt(T),f*=Math.sqrt(T));var k=function(t,e,r,n,a,o,l,c,u,f,h,p){var d=Math.pow(a,2),g=Math.pow(o,2),m=Math.pow(h,2),v=Math.pow(p,2),y=d*g-d*v-g*m;y<0&&(y=0),y/=d*v+g*m;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*p,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,T=(h-x)/a,k=(p-b)/o,A=(-h-x)/a,M=(-p-b)/o,S=s(1,0,T,k),E=s(T,k,A,M);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,g,v,x,b,_,w),A=n(k,4),M=A[0],S=A[1],E=A[2],L=A[3],C=Math.abs(L)/(i/4);Math.abs(1-C)<1e-7&&(C=1);var P=Math.max(Math.ceil(C),1);L/=P;for(var I=0;Ie[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":71,assert:80,"is-svg-path":459,"normalize-svg-path":594,"parse-svg-path":493}],594:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,p=0,d=0,g=t.length;d4?(o=m[m.length-4],s=m[m.length-3]):(o=h,s=p),r.push(m)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":592}],595:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var h=Math.min(r,f),p=e.stroke||0,d=e.viewbox||e.viewBox||i(t),g=[r/(d[2]-d[0]),f/(d[3]-d[1])],m=Math.min(g[0]||0,g[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p));if(u.translate(.5*r,.5*f),u.scale(m,m),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),p&&u.stroke(v)}else{var y=a(t);o(u,y),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":105,"draw-svg-path":183,"is-svg-path":459,"parse-svg-path":493,"svg-path-bounds":593}],596:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function t(e,r,i){i=i||{};var o=a[e];o||(o=a[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var p=new Float32Array(u),d=0,g=-.5*f;for(h=0;h=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":528,timers:597}],598:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(p=e.r,d=e.g,g=e.b,i={r:255*C(p,255),g:255*C(d,255),b:255*C(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),c=z(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),u=z(e.l),i=function(t,e,r){var n,i,a;function o(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}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var p,d,g;return a=L(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.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 e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(D(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(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(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(g,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(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.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"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],599:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=f(e),h=t.objects,p={};function d(t){return u(t)}function g(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(g)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in h)p[c]=g(h[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++rMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=h.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,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],g=this.computedAngle[1],m=Math.cos(d),v=Math.sin(d),y=Math.cos(g),x=Math.sin(g),b=this.computedCenter,_=m*y,w=v*y,T=x,k=-m*x,A=-v*x,M=y,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*h[a]+T*e[a];E[4*a+1]=k*r[a]+A*h[a]+M*e[a],E[4*a+2]=L,E[4*a+3]=0}var C=E[1],P=E[5],I=E[9],O=E[2],z=E[6],D=E[10],R=P*D-I*z,F=I*O-C*D,B=C*z-P*O,N=c(R,F,B);R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B;for(a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var j=0;j<3;++j)u+=E[a+4*j]*S[j];E[12+a]=-u}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 d=[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;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];a(i,i,n,d);for(c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],f=i[4],h=i[8],p=u*a+f*o+h*s,d=c(u-=a*p,f-=o*p,h-=s*p),g=(u/=d)*e+a*r,m=(f/=d)*e+o*r,v=(h/=d)*e+s*r;this.center.move(t,g,m,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),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,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),p=Math.abs(l),d=Math.abs(f),g=Math.max(h,p,d);h===g?(s=s<0?-1:1,l=f=0):d===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var m=c(s,l,f);s/=m,l/=m,f/=m}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,T=c(x-=s*w,b-=l*w,_-=f*w),k=l*(_/=T)-f*(b/=T),A=f*(x/=T)-s*_,M=s*b-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var E=e[1],L=e[5],C=e[9],P=E*x+L*b+C*_,I=E*k+L*A+C*M;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,P)}else{var O=e[2],z=e[6],D=e[10],R=O*s+z*l+D*f,F=O*x+z*b+D*_,B=O*k+z*A+D*M;v=Math.asin(u(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,v),this.recalcMatrix(t);var N=e[2],j=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*W,G-j*W,Y-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,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],p=c(l,f,h);if(!(p<1e-6)){l/=p,f/=p,h/=p;var d=this.computedRight,g=d[0],m=d[1],v=d[2],y=i*g+a*m+o*v,x=c(g-=y*i,m-=y*a,v-=y*o);if(!(x<.01&&(x=c(g=a*h-o*f,m=o*l-i*h,v=i*f-a*l))<1e-6)){g/=x,m/=x,v/=x,this.up.set(t,i,a,o),this.right.set(t,g,m,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*v-o*m,_=o*g-i*v,w=i*m-a*g,T=c(b,_,w),k=i*l+a*f+o*h,A=g*l+m*f+v*h,M=(b/=T)*l+(_/=T)*f+(w/=T)*h,S=Math.asin(u(k)),E=Math.atan2(M,A),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var I=Math.abs(C+2*Math.PI-E),O=Math.abs(C-E),z=Math.abs(C-2*Math.PI-E);I":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":608}],610:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":616}],611:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":607,"./is":612}],612:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":606}],613:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":610}],614:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":610,"../value/is":616}],615:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":607,"./is":616}],616:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],617:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function g(t){return new Uint16Array(p(2*t),0,t)}function m(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.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|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return g(t);case"uint32":return m(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=g,r.mallocUint32=m,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=A,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":104,buffer:117,dup:185}],618:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(p=0;p-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(S(),"?px "),m*=Math.pow(.75,l-s),n=n.replace("?px ",S())),g+=.25*x*(l-s)}if(!0===o.superscripts){var c=t.indexOf("+"),u=r.indexOf("+"),f=c>-1?parseInt(t[1+c]):0,h=u>-1?parseInt(r[1+u]):0;f!==h&&(n=n.replace(S(),"?px "),m*=Math.pow(.75,h-f),n=n.replace("?px ",S())),g-=.25*x*(h-f)}if(!0===o.bolds){var p=t.indexOf("b|")>-1,d=r.indexOf("b|")>-1;!p&&d&&(n=v?n.replace("italic ","italic bold "):"bold "+n),p&&!d&&(n=n.replace("bold ",""))}if(!0===o.italics){var v=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!v&&y&&(n="italic "+n),v&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",a="",o=i.length,s=a.length,l="+"===e[0]||"-"===e[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var f=c;f=u)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var p=c+o,d=r.substr(p,u-p).indexOf(i);c=-1!==d?d:u+s}return n}function u(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var i=u(t,n),a=function(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=0?e[a]:i}))},has___:{value:y((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:y((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};d.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 r?function(){function n(){this instanceof d||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new d),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new d),i.set___(t,e)}else n.set(t,e);return this},Object.create(d.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=d)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function m(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){h||"undefined"==typeof console||(h=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],626:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){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:n(e,t)}}},{"./hidden-store.js":627}],627:[function(t,e,r){e.exports=function(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}},{}],628:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":626}],629:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":257}],630:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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(l);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(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},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}return this.toMonthIndex(t,n,r)},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 i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(g>>5&15)-1,(31&g)+s);return a.year=m.getFullYear(),a.month=1+m.getMonth(),a.day=m.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var p,d=f[a.year-f[0]];for(p=0;p<13;p++){var g=d&1<<12-p?30:29;if(l>13;!m||p=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(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"};n.calendars.discworld=a},{"../main":644,"object-assign":487}],633:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.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)}}),n.calendars.ethiopian=a},{"../main":644,"object-assign":487}],634:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":644,"object-assign":487}],635:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+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)}}),n.calendars.islamic=a},{"../main":644,"object-assign":487}],636:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":644,"object-assign":487}],637:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.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)}}),n.calendars.mayan=a},{"../main":644,"object-assign":487}],638:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.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,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=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)}}),n.calendars.nanakshahi=a},{"../main":644,"object-assign":487}],639:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":644,"object-assign":487}],641:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.taiwan=o},{"../main":644,"object-assign":487}],642:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.thai=o},{"../main":644,"object-assign":487}],643:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;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":644,"object-assign":487}],644:[function(t,e,r){var n=t("object-assign");function i(){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 a(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.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()).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]}}}),n(a.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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();"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&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}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,c.local.invalidDate||c.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.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":487}],645:[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;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=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(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=g;for(var E=this.daysInMonth(h,p);d>E;E=this.daysInMonth(h,p))p++,d-=E}return f>-1?this.fromJD(f):this.newDate(h,p,d)},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;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":644,"object-assign":487}],646:[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":157}],647:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":646}],648:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],649:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":772,"../../plot_api/plot_template":843,"../../plots/cartesian/constants":861,"../../plots/font_attributes":883,"./arrow_paths":648}],650:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+h,g=p-h,m=3*t.startarrowsize*t.arrowwidth||0,v=m+h,y=m-h;if(c===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:g}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":803,"../../plots/cartesian/axes":854,"./draw":655}],651:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?it._offset+it._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?it._offset+it._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var mt=l.getRefType(nt);"domain"===mt?("y"===et&&(gt=1-gt),ft.tail=it._offset+it._length*gt):"paper"===mt?"y"===et?(gt=1-gt,ft.tail=T.t+T.h*gt):ft.tail=T.l+T.w*gt:ft.tail=it._offset+it.r2p(gt),K=tt}else ft.tail=J+gt,K=tt+gt;ft.text=ft.tail+tt;var vt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,vt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-vt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*H($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(A-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+bt-1,y:N+_t}).call(u.setClipUrl,U?L:null,t);else{var wt=N+_t-g.top,Tt=N+bt-g.left;G.call(h.positionText,Tt,wt).call(u.setClipUrl,U?L:null,t)}V.select("rect").call(u.setRect,N,N,A,D),j.call(u.setRect,F/2,F/2,B-F,q-F),R.call(u.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-q/2)),O.attr({transform:"rotate("+P+","+C.x.text+","+C.y.text+")"});var kt,At=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,p=C.y.tail+n,g=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,g,b),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),L=+j.attr("width"),z=+j.attr("height"),D=g-.5*L,F=D+L,B=b-.5*z,N=B+z,U=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,p,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=I.append("g").style({opacity:c.opacity(q)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+h+","+p+"L"+l+","+f).style("stroke-width",V+"px").call(c.stroke,c.rgb(q));if(m(Y,H,e),k.annotationPosition&&Y.node().parentNode&&!a){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-p,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(p-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(p-X),transform:s(W,X)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);J=t.x,K=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",s(t,r)),O.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(v)i=y(v,t,"x",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(c+t/T.w,l,0,1,e.xanchor)}if(x)o=y(x,r,"y",T,e);else{var u=e._ysize/T.h,f=e.y-(e._yshift+e.yshift)/T.h-u/2;o=d.align(f-r/T.h,u,0,1,e.yanchor)}S("x",i),S("y",o),v&&x||(n=d.getCursor(v?.5:i,x?.5:o,e.xanchor,e.yanchor))}O.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){p(R),i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=e.indexOf("end")>=0,b=d.backoff*m+r.standoff,_=g.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(h=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void z();if(b){if(b*b>w*w+T*T)return void z();var k=b*Math.cos(f),A=b*Math.sin(f);u.x+=k,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void z();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),L="";if(E1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":905,"../annotations/draw":655}],662:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*c.roundUp(Z/J,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(Y.tick0=0)}Y.dtick=W}Y.domain=[q+j,q+F-j],Y.setScale(),t.attr("transform",u(Math.round(l.l),Math.round(l.t)));var K,Q=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+A.cbaxis),tt=0;function et(n,i){var a={propContainer:Y,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),g.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var t,r=l.l+(e.x+B)*l.w,n=Y.title.font.size;t="top"===M?(1-(q+F-j))*l.h+l.t+3+.75*n:(1-(q+j))*l.h+l.t-3-.25*n,et(Y._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var a=t.select("."+A.cbtitle),o=a.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],h=a.select(".h"+Y._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),h?(tt=p.bBox(h).height)>d&&(f[1]-=(tt-d)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(tt=p.bBox(o.node()).height),tt){if(tt+=5,"top"===M)Y.domain[1]-=tt/l.h,f[1]*=-1;else{Y.domain[0]+=tt/l.h;var g=m.lineCount(o);f[1]+=(1-g)*d}a.attr("transform",u(f[0],f[1])),Y.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",u(0,Math.round(l.h*(1-Y.domain[1])))),$.attr("transform",u(0,Math.round(-l.t)));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(I);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var x=S.map(Y.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var o=[0===a?S[0]:(I[a]+I[a-1])/2,a===I.length-1?S[1]:(I[a]+I[a+1])/2].map(Y.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var s=n.select(this).attr({x:U,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)p.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var b=t.select("."+A.cblines).selectAll("path."+A.cbline).data(v.color&&v.width?O:[]);b.enter().append("path").classed(A.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(Y.c2p(t))+v.width/2%1)+"h"+z).call(p.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+Y._id+"tick,path").remove();var _=U+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(Y),k=s.getTickSigns(Y)[2];return s.drawTicks(r,Y,{vals:"inside"===Y.ticks?s.clipEnds(Y,T):T,layer:$,path:s.makeTickPath(Y,_,k),transFn:s.makeTransTickFn(Y)}),s.drawLabels(r,Y,{vals:T,layer:$,transFn:s.makeTransTickLabelFn(Y),labelFns:s.makeLabelFns(Y,_)})},function(){if(-1===["top","bottom"].indexOf(M)){var t=Y.title.font.size,e=Y._offset+Y._length/2,i=l.l+(Y.position||0)*l.w+("right"===Y.side?10+t*(Y.showticklabels?1:.5):-10-t*(Y.showticklabels?.5:0));et("h"+Y._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Y._id+"tick"),side:M,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=z+e.outlinewidth/2;if(-1===Y.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(A.jsPlaceholder)){var i,o=Q.select(".h"+Y._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(M)?p.bBox(o).width:p.bBox(Q.node()).right-U-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=H-G;t.select("."+A.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-N,width:Math.max(s,2),height:Math.max(c+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:U,y:G+e.ypad+("top"===M?tt:0),width:Math.max(z,2),height:Math.max(c-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",u(l.l-f,l.t));var h={},g=T[e.yanchor],m=k[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=c*g,h.b=c*m):(h.t=h.b=0,h.yt=e.y+e.len*g,h.yb=e.y-e.len*m);var v=T[e.xanchor],y=k[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*v,h.r=s*y;else{var x=s-z;h.l=x*v,h.r=x*y,h.xl=e.x-e.thickness*v,h.xr=e.x+e.thickness*y}a.autoMargin(r,e._id,h)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var c=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,c)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":771,"../../lib":803,"../../lib/extend":793,"../../lib/setcursor":824,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_defaults":856,"../../plots/cartesian/layout_attributes":869,"../../plots/cartesian/position_defaults":872,"../../plots/plots":917,"../../registry":931,"../color":666,"../colorscale/helpers":677,"../dragelement":685,"../drawing":688,"../titles":764,"./constants":668,"@plotly/d3":58,tinycolor2:598}],671:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":803}],672:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":667,"./defaults":669,"./draw":670,"./has_colorbar":671}],673:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var p=a+"auto",d=a+"min",g=a+"max",m=a+"mid",v=(s(h+p),s(h+d),s(h+g),{});v[d]=v[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":820,"../../lib/sort_object_keys":826,"../colorbar/attributes":667,"./scales.js":681}],674:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,p=f.min,d=f.max,g=f.mid,m=function(){return i.aggNums(Math.min,null,l)},v=function(){return i.aggNums(Math.max,null,l)};(void 0===p?p=m():h&&(p=u._colorAx&&n(p)?Math.min(p,m()):m()),void 0===d?d=v():h&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),h&&void 0!==g&&(d-g>g-p?p=g-(d-g):d-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":803,"./helpers":677,"fast-isnumeric":249}],675:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],683:[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":803}],684:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],685:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");function u(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,p,d,g,m=t.gd,v=1,y=m._context.doubleClickDelay,x=t.element;m._mouseDownTime||(m._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)y&&(v=Math.max(v-1,1)),m._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},l.coverSlip=u},{"../../lib":803,"../../plots/cartesian/constants":861,"./align":682,"./cursor":683,"./unhover":686,"has-hover":443,"has-passive-events":444,"mouse-event-offset":471}],686:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":791,"../../lib/events":792,"../../lib/throttle":830,"../fx/constants":700}],687:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],688:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,m=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,x=e.exports={};x.font=function(t,e,r,n){i.isPlainObject(e)&&(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(c.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.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||"";c.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(c.fill,e)},x.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(c.fill,t[0].trace.fillcolor)}))};var b=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(t){var e=b[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(t,e){var r=t%100;return x.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(t))t=+t;else 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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=a("~f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=M[a],h=new Array(u),p=0;p"+v(t);d._gradientUrlQueryParts[y]=1},x.pattern=function(t,e,r,a,o,s,l,u,f,h,p,d){var g="legend"===e;u&&("overlay"===f?(h=u,p=c.contrast(h)):(h=void 0,p=u));var m,v,y,x,b,_,w,T,k,A,M,S=r._fullLayout,E="p"+S._uid+"-"+a,L={};switch(o){case"/":m=s*Math.sqrt(2),v=s*Math.sqrt(2),_="path",L={d:y="M-"+m/4+","+v/4+"l"+m/2+",-"+v/2+"M0,"+v+"L"+m+",0M"+m/4*3+","+v/4*5+"l"+m/2+",-"+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"\\":m=s*Math.sqrt(2),v=s*Math.sqrt(2),_="path",L={d:y="M"+m/4*3+",-"+v/4+"l"+m/2+","+v/2+"M0,0L"+m+","+v+"M-"+m/4+","+v/4*3+"l"+m/2+","+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"x":m=s*Math.sqrt(2),v=s*Math.sqrt(2),y="M-"+m/4+","+v/4+"l"+m/2+",-"+v/2+"M0,"+v+"L"+m+",0M"+m/4*3+","+v/4*5+"l"+m/2+",-"+v/2+"M"+m/4*3+",-"+v/4+"l"+m/2+","+v/2+"M0,0L"+m+","+v+"M-"+m/4+","+v/4*3+"l"+m/2+","+v/2,x=s-s*Math.sqrt(1-l),_="path",L={d:y,opacity:d,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",L={d:y="M"+(m=s)/2+",0L"+m/2+","+(v=s),opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"-":_="path",_="path",L={d:y="M0,"+(v=s)/2+"L"+(m=s)+","+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"+":_="path",y="M"+(m=s)/2+",0L"+m/2+","+(v=s)+"M0,"+v/2+"L"+m+","+v/2,x=s-s*Math.sqrt(1-l),_="path",L={d:y,opacity:d,stroke:p,"stroke-width":x+"px"};break;case".":m=s,v=s,l.pattern_filled";S._patternUrlQueryParts[I]=1},x.initGradients=function(t){var e=t._fullLayout;i.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},x.initPatterns=function(t){var e=t._fullLayout;i.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},x.getPatternAttr=function(t,e,r){return t&&i.isArrayOrTypedArray(t)?e=100,e.attr("d",w(u,l))}var f,h,p,d=!1;if(t.so)p=s.outlierwidth,h=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,d=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var m=o.gradient,v=t.mgt;v?d=!0:v=m&&m.type,i.isArrayOrTypedArray(v)&&(v=v[0],M[v]||(v=0));var y=o.pattern,b=y&&x.getPatternAttr(y.shape,t.i,"");if(v&&"none"!==v){var _=t.mgc;_?d=!0:_=m.color;var T=r.uid;d&&(T+="-"+t.i),x.gradient(e,a,T,v,[[0,_],[1,f]],"fill")}else if(b){var k=x.getPatternAttr(y.bgcolor,t.i,null),A=x.getPatternAttr(y.fgcolor,t.i,null),S=y.fgopacity,E=x.getPatternAttr(y.size,t.i,8),L=x.getPatternAttr(y.solidity,t.i,.3),C=t.mcc||i.isArrayOrTypedArray(y.shape)||i.isArrayOrTypedArray(y.bgcolor)||i.isArrayOrTypedArray(y.size)||i.isArrayOrTypedArray(y.solidity),P=r.uid;C&&(P+="-"+t.i),x.pattern(e,"point",a,P,b,E,L,t.mcc,y.fillmode,k,A,S)}else c.fill(e,f);p&&c.stroke(e,h)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,p=void 0!==f;(i.isArrayOrTypedArray(c)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:p?f:g*e});var d=a.color,m=o.color,v=s.color;(m||v)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?m||e:v||e});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,g))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",w(x.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,p,t,d)}var g=t.tp||e.textposition,m=L(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,m,v).text(c).call(h.convertToTspans,r).call(E,g,m,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);c.fill(i,a),E(i,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,.25),u=Math.pow(s*s+l*l,.25),f=(u*u*a-c*c*s)*i,h=(u*u*o-c*c*l)*i,p=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(p&&f/p),2),n.round(e[1]+(p&&h/p),2)],[n.round(e[0]-(d&&f/d),2),n.round(e[1]-(d&&h/d),2)]]}x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(x.savedBBoxes={},O=0),r&&(x.savedBBoxes[r]=m),O++,i.extendFlat({},m)},x.setClipUrl=function(t,e,r){t.attr("clip-path",D(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var R=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(F);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":702,"../../constants/alignment":771,"../../constants/interactions":778,"../../constants/xmlns_namespaces":780,"../../lib":803,"../../lib/svg_text_utils":829,"../../registry":931,"../../traces/scatter/make_bubble_size_func":1235,"../../traces/scatter/subtypes":1243,"../color":666,"../colorscale":678,"./symbol_defs":689,"@plotly/d3":58,"fast-isnumeric":249,tinycolor2:598}],689:[function(t,e,r){"use strict";var n=t("@plotly/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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":58}],690:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],691:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,p=h.error_x||{},d=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var m=n.select(this).selectAll("g.errorbar").data(e,f);if(m.exit().remove(),e.length){p.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var v=m.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(m,r.layerClipId,t),m.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var m=(p.copy_ystyle?d:p).width;a="M"+r.xh+","+(r.y-m)+"v"+2*m+"m0,-"+m+"H"+r.xs,r.noXS||(a+="m0,-"+m+"v"+2*m),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":1243,"../drawing":688,"@plotly/d3":58,"fast-isnumeric":249}],696:[function(t,e,r){"use strict";var n=t("@plotly/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":666,"@plotly/d3":58}],697:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":793,"../../plots/font_attributes":883,"./layout_attributes":707}],698:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexb[0]._length||at<0||at>_[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=it+b[0]._offset,e.pointerY=at+_[0]._offset,B="xval"in e?v.flat(s,e.xval):v.p2c(b,it),V="yval"in e?v.flat(s,e.yval):v.p2c(_,at),!i(B[0])||!i(V[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(H=0;H$&&(tt.splice(0,$),ct=tt[0].distance),g&&0!==O&&0===tt.length){Q.distance=O,Q.index=!1;var f=Y._module.hoverPoints(Q,J,K,"closest",{hoverLayer:l._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=O}))),f&&f.length){var h,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];i(m.x0)&&i(m.y0)&&(h=ht(m),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var x=y[0];i(x.x0)&&i(x.y0)&&(h=ht(x),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;Mt--)Ct(tt[Mt]);tt=St,mt()}var Pt=t._hoverdata,It=[],Ot=j(t),zt=U(t);for(q=0;q1||tt.length>1)||"closest"===S&&nt&&tt.length>1,Wt=p.combine(l.plot_bgcolor||p.background,l.paper_bgcolor),Xt=I(tt,{gd:t,hovermode:S,rotateLabels:Yt,bgColor:Wt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});v.isUnifiedHover(S)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),p=new Array(h),d=0;function g(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 c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(f=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?T:1)/2,pmin:0,pmax:i?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=i;for(m.push.apply(m,v),p.splice(o+1,1),c=0,s=m.length-1;s>=0;s--)c+=m[s].dp;for(a=c/m.length,s=m.length-1;s>=0;s--)m[s].dp-=a;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var _=b[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,Yt?"xa":"ya",l),z(Xt,Yt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Zt=m.getComponentMethod("annotations","hasClickToShow")(t,It);f(n.select(e.target),Zt?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:_,xvals:B,yvals:V})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),g=t.trace;if(m.traceIs(g,"gl3d")){var v=i._fullLayout[g.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,f+=y,h+=x,d+=x}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||p.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,d=e.container,g=e.outerContainer,w=e.commonLabelOpts||{},T=e.fontFamily||y.HOVERFONT,k=e.fontSize||y.HOVERFONTSIZE,A=t[0],E=A.xa,L=A.ya,P=a.charAt(0),I=A[P+"Label"],z=g.getBoundingClientRect(),D=z.top,R=z.width,F=z.height,B=void 0!==I&&A.distance<=e.hoverdistance&&("x"===a||"y"===a);if(B){var N,j,U=!0;for(N=0;Ni.width-b?(m=i.width-b,e.attr("d","M"+(b-M)+",0L"+b+","+x+M+"v"+x+(2*S+y.height)+"H-"+b+"V"+x+M+"H"+(b-2*M)+"Z")):e.attr("d","M0,0L"+M+","+x+M+"H"+(S+y.width/2)+"v"+x+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+x+M+"H-"+M+"Z")}else{var _,C,P;"right"===L.side?(_="start",C=1,P="",m=E._offset+E._length):(_="end",C=-1,P="-",m=E._offset),v=L._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+P+M+","+M+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+M+"V-"+M+"Z");var O,z=y.height/2,R=D-y.top-z,F="clip"+i._uid+"commonlabel"+L._id;if(m=0?nt:it+st=0?it:gt+st=0?et:rt+lt=0?rt:mt+lt=0,"top"!==t.idealAlign&&P||!z?P?(U+=q/2,t.anchor="start"):t.anchor="middle":(U-=q/2,t.anchor="end");else if(t.pos=U,P=j+V/2+H<=R,z=j-V/2-H>=0,"left"!==t.idealAlign&&P||!z)if(P)j+=V/2,t.anchor="start";else{t.anchor="middle";var G=H/2,Y=j+G-R,W=j-G;Y>0&&(j-=Y),W<0&&(j+=-W)}else j-=V/2,t.anchor="end";w.attr("text-anchor",t.anchor),E&&A.attr("text-anchor",t.anchor),e.attr("transform",s(j,U)+(c?l(_):""))})),vt}function O(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(M+S),p=f+c*(t.txwidth+S),d=0,g=t.offset,m="middle"===s;m&&(f-=t.tx2width/2,p+=t.txwidth/2+S),e&&(g*=-A,d=t.offset*k),r.select("path").attr("d",m?"M-"+a(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*M+d)+","+o(M+g)+"v"+o(t.by/2-M)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*M+d)+"V"+o(g-M)+"Z");var v=d+f,y=g+t.ty0-t.by/2+S,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==s?(i.attr("text-anchor","start"),v=m?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===x&&"end"!==s&&(i.attr("text-anchor","end"),v=m?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(v),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(p+c*S+d),o(g+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(p+(c-1)*t.tx2width/2+d),o(g-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function D(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var m,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(m=c.pointerX,v=c.pointerY):(m=n._offset+y.x,v=i._offset+y.y);var x,b,_=a.readability(y.color,d)<1.5?p.contrast(d):y.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||_,A=g.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=m),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),x=l.l+M*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(f){var E,L,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(E=c.pointerX,L=c.pointerY):(E=n._offset+C.x,L=i._offset+C.y);var P,I,O=a.readability(C.color,d)<1.5?p.contrast(d):C.color,z=n.spikemode,D=n.spikethickness,R=n.spikecolor||O,F=g.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,I=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}},{"../../lib":803,"../../lib/events":792,"../../lib/override_cursor":814,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"../legend/defaults":718,"../legend/draw":719,"./constants":700,"./helpers":702,"@plotly/d3":58,"fast-isnumeric":249,tinycolor2:598}],704:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":803,"../color":666,"./helpers":702}],705:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":803,"./layout_attributes":707}],706:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":803,"../dragelement":685,"./attributes":697,"./calc":698,"./click":699,"./constants":700,"./defaults":701,"./helpers":702,"./hover":703,"./layout_attributes":707,"./layout_defaults":708,"./layout_global_defaults":709,"@plotly/d3":58}],707:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":883,"./constants":700}],708:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":803,"./hoverlabel_defaults":704,"./hovermode_defaults":705,"./layout_attributes":707}],709:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":803,"./hoverlabel_defaults":704,"./layout_attributes":707}],710:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!p&&!d)"independent"===k("pattern")&&(h=!0);m._hasSubplotGrid=h;var x,b,_="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),m._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,m,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,g=r.rows,m=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==g||c.uirevision){var m=a.newContainer(e,"legend");if(T("uirevision",e.uirevision),!1!==g){T("bgcolor",e.paper_bgcolor),T("bordercolor"),T("borderwidth");var v,y,x,b=i.coerceFont(T,"font",e.font),_="h"===T("orientation");if(_?(v=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),T("traceorder",h),l.isGrouped(e.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",v),T("xanchor"),T("y",y),T("yanchor",x),T("valign"),i.noneOrAll(c,m,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=i.extendFlat({},b,{size:i.bigFont(b.size)});i.coerceFont(T,"title.font",w)}}}function T(t,e){return i.coerce(c,m,o,t,e)}}},{"../../lib":803,"../../plot_api/plot_template":843,"../../plots/layout_attributes":908,"../../registry":931,"./attributes":716,"./helpers":722}],719:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),g=d.LINE_SPACING,m=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var g=i.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(c.font,a).text(h?T(n,d):n);var m=r.itemwidth+2*p.itemGap;f.positionText(g,m,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(A,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):A(g,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function A(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,d=s.size*g;if(o){var m=c.bBox(o);u=m.height,h=m.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var v=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(v),x=v.node();if(u=d*y,h=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),f.positionText(v,l+p.titlePad,l+d);else{var b=2*p.itemGap+r.itemwidth;i.groupTitle&&(b=p.itemGap,h-=r.itemwidth),f.positionText(v,b,-d*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function M(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var T=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),L=i.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=i.ensureSingle(T,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var I=i.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),A(I,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var O=i.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(s);z.enter().append("g").attr("class","groups"),z.exit().remove();var D=z.selectAll("g.traces").data(i.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){d||n.select(this).call(k,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=b.isVertical(i),l=b.isGrouped(i),u=i.borderwidth,f=2*u,h=p.itemGap,d=i.itemwidth+2*h,g=2*(u+h),m=S(i),v=i.y<0||0===i.y&&"top"===m,y=i.y>1||1===i.y&&"bottom"===m,x=i.tracegroupgap;i._maxHeight=Math.max(v||y?a.height/2:o.h,30);var _=0;i._width=0,i._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+w[0],u+w[1]+i._height+e/2+h),i._height+=e,i._width=Math.max(i._width,t[0].width)})),_=d+i._width,i._width+=h+d+f,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var T=M(i),k=i.x<0||0===i.x&&"right"===T,A=i.x>1||1===i.x&&"left"===T,E=y||v,L=a.width/2;i._maxWidth=Math.max(k?E&&"left"===T?o.l+o.w:L:A?E&&"right"===T?o.r+o.w:L:o.w,2*d);var C=0,P=0;r.each((function(t){var e=t[0].width+d;C=Math.max(C,e),P+=e})),_=null;var I=0;if(l){var O=0,z=0,D=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+h+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),O=Math.max(O,e);var r=t+h;r+u+z>i._maxWidth&&(I=Math.max(I,z),z=0,D+=O+x,O=e),c.setTranslate(this,z,D),z+=r})),i._width=Math.max(I,z)+u,i._height=D+O+g}else{var R=r.size(),F=P+f+(R-1)*h=i._maxWidth&&(I=Math.max(I,U),N=0,j+=B,i._height+=B,B=0),c.setTranslate(this,w[0]+u+N,w[1]+u+j+e/2+h),U=N+r+h,N+=n,B=Math.max(B,e)})),F?(i._width=N+f,i._height=B+g):(i._width=Math.max(I,U)+f,i._height+=B+g)}}i._width=Math.ceil(Math.max(i._width+w[0],i._titleWidth+2*(u+p.titlePad))),i._height=Math.ceil(Math.max(i._height+w[1],i._titleHeight+2*(u+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var V=t._context.edits,q=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=q?d:_||d+t[0].width;s||(i+=h/2),c.setRect(e,0,-r/2,i,r)}))}(t,z,D,e)},function(){if(d||!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*m[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*m[n]})}(t)){var s,u,g,y,x=f._size,b=e.borderwidth,w=x.l+x.w*e.x-m[M(e)]*e._width,k=x.t+x.h*(1-e.y)-m[S(e)]*e._effHeight;if(!d&&f.margin.autoexpand){var A=w,P=k;w=i.constrain(w,0,f.width-e._width),k=i.constrain(k,0,f.height-e._effHeight),w!==A&&i.log("Constrain legend.x to make legend fit inside graph"),k!==P&&i.log("Constrain legend.y to make legend fit inside graph")}if(d||c.setTranslate(T,w,k),O.on(".drag",null),T.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;d&&(I=e._height),L.attr({width:e._width-b,height:I-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),E.select("rect").attr({width:e._width-2*b,height:I-2*b,x:b,y:b}),c.setClipUrl(C,h,t),c.setRect(O,0,0,0,0),delete e._scrollY}else{var z,D,R,F=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*p.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);L.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),E.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+U}),c.setClipUrl(C,h,t),H(U,F,j),T.on("wheel",(function(){H(U=i.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,N)}(R,z,D),F,j))}));O.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,H(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,N)}(R,z,D),F,j))}));C.call(q)}if(t._context.edits.legendPosition)T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=c.getTranslate(T);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,i=y+r;c.setTranslate(T,n,i),s=l.align(n,0,x.l,x.l+x.w,e.xanchor),u=l.align(i,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&_(t,T,i,e,n)}})}function H(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(O,e._width,p.scrollBarMargin+r*i,p.scrollBarWidth,n),E.select("rect").attr("y",b+r)}}],t)}(t,e)}},{"../../constants/alignment":771,"../../lib":803,"../../lib/events":792,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"../color":666,"../dragelement":685,"../drawing":688,"./constants":717,"./get_legend_data":720,"./handle_click":721,"./helpers":722,"./style":724,"@plotly/d3":58}],720:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},p=0,d=0;function g(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rA&&(k=A)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var M=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var v=e._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function T(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},p=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var d=c(f),g=d.mid;void 0===g&&(g=(d.max+d.min)/2),p=s.tryColorscale(f,"")(g)}var v=p||a.mc||f.color,y=f.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,k=m(y.size,8,10),A=m(y.solidity,.5,1),M="legend-"+u.uid;i.call(s.pattern,"legend",e,M,x,k,A,p,y.fillmode,b,_,T)}else i.call(l.fill,v);o&&l.stroke(i,a.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,p=w(h(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=u.color;var g=a.minExtend(o,{trace:d});f(c,g,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),p=h.colorscale,g=h.reversescale;if(p){if(!r){var m=p.length;u=0===o?p[g?m-1:0][1]:1===o?p[g?0:m-1][1]:p[Math.floor((m-1)/2)][1]}}else{var v=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(v)?v[o]||v[0]:v}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(g,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,p=o.showGradientFill,m=o.anyFill,v=o.anyLine,y=t[0],b=y.trace,_=c(b),T=_.colorscale,k=_.reversescale,A=u.hasMarkers(b)||!m?"M5,0":v?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(l||p?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+b.uid;s.gradient(t,e,r,d(k),T,"fill")}}),f||h){var E=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:E}}),r=[a.minExtend(y,{trace:i})]}var L=M.select(".legendlines").selectAll("path").data(f||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",A+(h?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,i,o=g(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,p=t[0],d=p.trace,m=!h&&!c&&!l&&u.hasText(d);function v(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(h||m||f){var b={},w={};if(h){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",a.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",a.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:v("line.width",x,[0,10],5)}),m&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var M=k.selectAll("g.pointtext").data(m?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":803,"../../registry":931,"../../traces/pie/helpers":1197,"../../traces/pie/style_one":1203,"../../traces/scatter/subtypes":1243,"../color":666,"../colorscale/helpers":677,"../drawing":688,"./constants":717,"@plotly/d3":58}],725:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":727}],726:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,g=(1+d)/2,m=(1-d)/2;for(i=0;i1?(P=["toggleHover"],I=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):m?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];g&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?h+c:c;return{ppad:c,ppadplus:u?d:g,ppadminus:u?g:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=f)));return p>=h?[h,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=f,E="y0",A=y,L="y1"):(k=y,E="y1",A=f,L="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===O?J:K,X.altKey=n.altKey},doneFn:function(){if(v(t))return;p(e),$(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function Z(r){if(v(t))O=null;else if(R)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";p(e,l),O=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(q(t)+n)},N&&"date"===N.type&&(o=g.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(H(t)+i)},U&&"date"===U.type&&(l=g.encodeDate(l))),B("path",r.path=w(I,o,l))}else z?B("xanchor",r.xanchor=G(x+n)):(B("x0",r.x0=G(c+n)),B("x1",r.x1=G(m+n))),D?B("yanchor",r.yanchor=Y(T+i)):(B("y0",r.y0=Y(f+i)),B("y1",r.y1=Y(y+i)));e.attr("d",_(t,r)),Q(s,r)}function K(n,i){if(F){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(q(t)+n)},N&&"date"===N.type&&(o=g.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(H(t)+i)},U&&"date"===U.type&&(l=g.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===O){var u=c+n,h=D?f-i:f+i;B("x0",r.x0=z?u:G(u)),B("y0",r.y0=D?h:Y(h))}else if("resize-over-end-point"===O){var p=m+n,d=D?y-i:y+i;B("x1",r.x1=z?p:G(p)),B("y1",r.y1=D?d:Y(d))}}else{var v=function(t){return-1!==O.indexOf(t)},b=v("n"),j=v("s"),V=v("w"),W=v("e"),X=b?k+i:k,Z=j?A+i:A,J=V?M+n:M,K=W?S+n:S;D&&(b&&(X=k-i),j&&(Z=A-i)),(!D&&Z-X>10||D&&X-Z>10)&&(B(E,r[E]=D?X:Y(X)),B(L,r[L]=D?Z:Y(Z))),K-J>10&&(B(C,r[C]=z?J:G(J)),B(P,r[P]=z?K:G(K)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(z||D)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=q(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,d.paramIsX))),o=H(D?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,d.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),z&&D){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,z,l,e,r,O):!0===l.editable&&z.style("pointer-events",P||c.opacity(S)*M<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,m(t)}}(t,z)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,c,u,f,h=e.type,p=a.getRefType(e.xref),m=a.getRefType(e.yref),v=a.getFromId(t,e.xref),y=a.getFromId(t,e.yref),x=t._fullLayout._size;if(v?"domain"===p?n=function(t){return v._offset+v._length*t}:(r=g.shapePositionToRange(v),n=function(t){return v._offset+v.r2p(r(t,!0))}):n=function(t){return x.l+x.w*t},y?"domain"===m?s=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return x.t+x.h*(1-t)},"path"===h)return v&&"date"===v.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,c=t.charAt(0),u=d.paramIsX[c],f=d.paramIsY[c],h=d.numParams[c],p=t.substr(1).replace(d.paramRE,(function(t){return u[n]?t="pixel"===a?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,s);if("pixel"===e.xsizemode){var b=n(e.xanchor);l=b+e.x0,c=b+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);u=_-e.y0,f=_-e.y1}else u=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+u+"L"+c+","+f;if("rect"===h)return"M"+l+","+u+"H"+c+"V"+f+"H"+l+"Z";var w=(l+c)/2,T=(u+f)/2,k=Math.abs(w-l),A=Math.abs(T-u),M="A"+k+","+A,S=w+k+","+T;return"M"+S+M+" 0 1,1 "+(w+","+(T-A))+M+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(v),r.attr("d",g(e)),A&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,y(),x())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,m(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,v);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform",l(v[0],v[1]))}}}return D.call(R),O&&(E?D.on(".opacity",null):(A=0,M=!0,D.text(y).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)}))),D.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,v,e,x):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),D.classed("js-placeholder",M),T}}},{"../../constants/alignment":771,"../../constants/interactions":778,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../../registry":931,"../color":666,"../drawing":688,"@plotly/d3":58,"fast-isnumeric":249}],765:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:c,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(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/font_attributes":883,"../../plots/pad_attributes":916,"../color/attributes":665}],766:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],767:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":803,"../../plots/array_container_defaults":849,"./attributes":765,"./constants":766}],768:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||v(t,n,i,a,e))}function m(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(M,i,h,p),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),v(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,m=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?m=v.headerHeight+f.gapButtonHeader:d=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+m+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(M,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=m+v;E+M>c&&(E=c-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,O=d+g,z=m;O+P>l&&(O=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:z,width:P,height:I}),this._vbarYMin=z+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=C?f+P+.5:f+.5,N=h-.5,j=k?p+M+.5:p+.5,U=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:m,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.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(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":803,"../color":666,"../drawing":688,"@plotly/d3":58}],771:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],772:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],773:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],774:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],775:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],776:[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]}},{}],777:[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"}},{}],778:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],779:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],780:[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}},{}],781:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],783:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],784:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,p,d,g=l([r,n]);function m(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}g?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":810}],785:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&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)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:y);if(!T)return u;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),L=Number(T[11]||0);if(c){if(2===k.length)return u;var C;k=Number(k);try{var P=m.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),C=P.newDate(k,P.toMonthIndex(k,A,I),M)}else C=P.newDate(k,Number(A),M)}catch(t){return u}return C?(C.toJD()-g)*f+S*h+E*p+L*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),A-=1;var O=new Date(Date.UTC(2e3,A,M,S,E));return O.setUTCFullYear(k),O.getUTCMonth()!==A||O.getUTCDate()!==M?u:O.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*f,k=3*h,A=5*p;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/f)+g,E=Math.floor(l(t,f));try{a=m.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=v("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return L[r("%q")(i)]})),_(n))try{t=m.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var I=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=m.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+I);return c.setUTCMonth(c.getUTCMonth()+e)+n-I},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&m.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,p=c-a,d=u*u+f*f,g=h*h+p*p,m=Math.min(l(u,f,d,i-t,a-e),l(u,f,d,o-t,c-e),l(h,p,g,t-i,e-a),l(h,p,g,r-i,n-a));return Math.sqrt(m)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var p=h(c);p;){if((c+=p+r)>f)return;p=h(c)}for(p=h(f);p;){if(c>(f-=p+r))return;p=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},{"./mod":810}],799:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,p,d,g=t.color,m=l(g),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=m?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=v?function(t,e){return void 0===t[e]?1:h(t[e])}:h,m||v)for(var b=0;b1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],803:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var p=t("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var d=t("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var m=t("./dates");f.dateTime2ms=m.dateTime2ms,f.isDateTime=m.isDateTime,f.ms2DateTime=m.ms2DateTime,f.ms2DateTimeLocal=m.ms2DateTimeLocal,f.cleanDate=m.cleanDate,f.isJSDate=m.isJSDate,f.formatDate=m.formatDate,f.incrementMonth=m.incrementMonth,f.dateTick0=m.dateTick0,f.dfltRange=m.dfltRange,f.findExactDates=m.findExactDates,f.MIN_MS=m.MIN_MS,f.MAX_MS=m.MAX_MS;var v=t("./search");f.findBin=v.findBin,f.sorterAsc=v.sorterAsc,f.sorterDes=v.sorterDes,f.distinctVals=v.distinctVals,f.roundUp=v.roundUp,f.sort=v.sort,f.findIndexOfMin=v.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=t("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=t("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=t("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var A=t("./regex");f.counterRegex=A.counter;var M=t("./throttle");f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var S=t("./dom");function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return z.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var D={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,p="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,m="xother"===s||"yother"===s||p||g||d,v=s;if((p||d)&&(v=v.substring(1)),(g||d)&&(v=v.substring(0,v.length-1)),m){if(void 0===(c=e[v]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var N=2e9;f.seedPseudoRandom=function(){N=2e9},f.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?f.pseudoRandom():N/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":779,"./anchor_utils":783,"./angles":784,"./array":785,"./clean_number":786,"./clear_responsive":788,"./coerce":789,"./dates":790,"./dom":791,"./extend":793,"./filter_unique":794,"./filter_visible":795,"./geometry2d":798,"./identity":801,"./increment":802,"./is_plain_object":804,"./keyed_container":805,"./localize":806,"./loggers":807,"./make_trace_groups":808,"./matrix":809,"./mod":810,"./nested_property":811,"./noop":812,"./notifier":813,"./preserve_drawing_buffer":817,"./push_unique":818,"./regex":820,"./relative_attr":821,"./relink_private":822,"./search":823,"./sort_object_keys":826,"./stats":827,"./throttle":830,"./to_log_range":831,"@plotly/d3":58,"d3-format":167,"d3-time-format":175,"fast-isnumeric":249}],804:[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).hasOwnProperty("hasOwnProperty")}},{}],805:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":841,"./notifier":813}],808:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":58}],809:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],811:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,p,d,g=r.length,m=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,m)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":779,"./matrix":809}],816:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=!0;return a._glcanvas.each((function(n){if(!n.regl&&(!n.pick||a._has("parcoords"))){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:a._glcontainer.node()}),o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":825,regl:540}],817:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":249,"is-mobile":455}],818:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,f=0,h=e.length,p=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},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,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":785,"fast-isnumeric":249}],828:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":131}],829:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var M=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&M.match(c),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,i,o){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return I(),void e();var c=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});c.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",f=s.select("g");f.attr({fill:u,stroke:u});var h=l(f,"width"),p=l(f,"height"),d=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=-(r||l(t,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+a(-h/2,m-p/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:m-p/2}):"a"===P[0]&&0!==P.indexOf("atitle")?s.attr({x:0,y:m}):s.attr({x:d,y:+t.attr("y")+m-p/2}),g&&g.call(t,c),e(c)}))}))):I(),t}function I(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(m," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],m=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(v),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(m," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],831:[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":249}],832:[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":885,"topojson-client":601}],833:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],834:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],835:[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;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(m,v),p(t),!0)}var x,b,_,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),L=E||[],C=u(v,f).get(),P=[],I=-1,O=L.length;for(x=0;xL.length-(A?0:1))a.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?P.push(_):A?("add"===k&&(k={}),L.splice(_,0,k),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)L.splice(P[x],1),C&&C.splice(P[x],1);if(L.length?E||e.set(L):e.set(null),g)return!1;if(h(m,v),d!==i){var z;if(-1===I)z=S;else{for(O=Math.max(L.length,O),z=[],x=0;x=I);x++)z.push(_);for(x=I;x=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 I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),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")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&q(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(h.rehover,h.redrag),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[p.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=p.getFromId(t,i);if(r.push(i),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var H=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=F(l._preGUI,c),d=Object.keys(e),g=p.list(t),m=o.extendDeepAll({},e),v={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof O.parts[D];)D--;var B=O.parts[D],N=O.parts[D-1]+"."+B,U=O.parts.slice(0,D).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),W=O.get();if(void 0!==z){M[I]=z,S[I]="reverse"===B?z:R(W);var Z=f.getLayoutValObject(l,O.parts);if(Z&&Z.impliedEdits&&null!==z)for(var J in Z.impliedEdits)E(o.relativeAttr(I,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(I))if(z){E("autosize",null);var K="height"===I?"width":"height";E(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",z?null:l.width),E("height",z?null:l.height);else if(N.match(H))P(N),s(l,U+"._inputRange").set(null);else if(N.match(G)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===q.type&&"log"===z,tt="log"===q.type&&"linear"===z;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&E(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(U+".range[0]",Math.log(et)/Math.LN10),E(U+".range[1]",Math.log(rt)/Math.LN10)):(E(U+".range[0]",Math.pow(10,et)),E(U+".range[1]",Math.pow(10,rt)))}else E(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,z,E),u.getComponentMethod("images","convertCoords")(t,q,z,E)}else E(U+".autorange",!0),E(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,I).get(),it=(z||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,E),u.getComponentMethod("images","convertCoords")(t,nt,it,E)}var at=b.containerArrayMatch(I);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(b.isAddVal(z)?S[I]=null:b.isRemoveVal(z)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(A,st),v[r]||(v[r]={});var lt=v[r][n];lt||(lt=v[r][n]={}),lt[ot]=z,delete e[I]}else"reverse"===B?(V.range?V.range.reverse():(E(U+".autorange",!0),V.range=[1,0]),q.autorange?A.calc=!0:A.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===z||"select"===z)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:Z?T.update(A,Z):A.calc=!0,O.set(z))}}for(r in v){b.applyContainerArrayChanges(t,h(a,r),v[r],A,h)||(A.plot=!0)}for(var ct in C){var ut=(L=p.getFromId(t,ct))&&L._constraintGroup;if(ut)for(var ft in A.calc=!0,ut)C[ft]||(p.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:S,redoit:M,eventData:m}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=N(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):l.fullReplot?p.push(r._doPlot):(p.push(h.previousPromises),V(t,f,u)||h.supplyDefaults(t),l.style&&p.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&q(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(M)),p.push(h.rehover,h.redrag),c.add(t,Z,[t,s.undoit,u.undoit,s.traces],Z,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(p,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var d,g,m=0;function v(t){return Array.isArray(i)?m>=i.length?t.transitionOpts=i[m]:t.transitionOpts=i[0]:t.transitionOpts=i,m++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(g);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,m=(u[g]||d[g]||{}).name,v=e[n].name,y=u[m]||d[m];m&&v&&"number"==typeof v&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(u[m]||d[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[g]={name:g},p.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],p=[t,a];return c&&c.add(t,l,f,u,p),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],p=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function x(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return v(i,e,s)},r.getLayoutValObject=function(t,e){return v(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":803,"../plots/attributes":850}],844:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),g=d.enforce,m=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function x(t){var e,i,s,u,d,g,m=t._fullLayout,v=m._size,x=v.p,_=h.list(t,"",!0);if(m._paperdiv.style({width:t._context.responsive&&m.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":m.width+"px",height:t._context.responsive&&m.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(c.setSize,m.width,m.height),t._context.setBackground(t,m.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!m._has("cartesian"))return a.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var A=[],M=[],S=[],E=1===l.opacity(m.paper_bgcolor)&&1===l.opacity(m.plot_bgcolor)&&m.paper_bgcolor===m.plot_bgcolor;for(i in m._plots)if((s=m._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var L=s.xaxis.domain,C=s.yaxis.domain,P=s.plotgroup;if(y(L,C,S)){var I=P.node(),O=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(O.node(),I.childNodes[0]),M.push(i)}else P.select("rect.bg").remove(),S.push([L,C]),E||(A.push(i),M.push(i))}var z,D,R,F,B,N,j,U,V,q,H,G,Y,W=m._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){m._plots[t].bg=n.select(this)})),e=0;eT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=g(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&m(a)&&t(a,o)}}({data:p,layout:h},""),u.length)return u.map(v)}},{"../lib":803,"../plots/attributes":850,"../plots/plots":917,"./plot_config":841,"./plot_schema":842,"./plot_template":843}],846:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,p,d;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var m={};function v(t,r){return o.coerce(e,m,f,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},h);x?A.width=x:null===e.width&&n(d.width)&&(A.width=d.width),b?A.height=b:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=a.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),h(),t(T?p:s.encodeJSON(p))}if(h(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,A,M).then(S).then(E).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":803,"../plots/plots":917,"../snapshot/helpers":935,"../snapshot/svgtoimg":937,"../snapshot/tosvg":939,"../version":1404,"./plot_api":840,"fast-isnumeric":249}],847:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(d("unused",a,v.concat(x.length)));var A,M,S,E,L,C=x.length,P=Array.isArray(k);if(P&&(C=Math.min(C,k.length)),2===b.dimensions)for(M=0;Mx[M].length&&i.push(d("unused",a,v.concat(M,x[M].length)));var I=x[M].length;for(A=0;A<(P?Math.min(I,k[M].length):I);A++)S=P?k[M][A]:k,E=y[M][A],L=x[M][A],n.validate(E,S)?L!==E&&L!==+E&&i.push(d("dynamic",a,v.concat(M,A),E,L)):i.push(d("value",a,v.concat(M,A),E))}else i.push(d("array",a,v.concat(M),y[M]));else for(M=0;M1&&p.push(d("object","layout"))),i.supplyDefaults(g);for(var m=g._fullData,v=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,p="start"===l,d="end"===l,g=t[r+"period0"],m=a(g,h)||0,v=[],y=[],x=[],b=i.length,_=0;_A;)k=o(k,-c,h);for(;k<=A;)k=o(k,c,h);T=o(k,-c,h)}else{for(k=m+(w=Math.round((A-m)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}v[_]=p?T:d?k:(T+k)/2,y[_]=T,x[_]=k}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":779,"../../lib":803,"fast-isnumeric":249}],852:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],853:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=g(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,m=f[0].val;for(r=1;r0&&((T=E-s(x)-l(b))>L?k/T>C&&(_=x,w=b,C=k/T):k/E>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=k/E));if(h===m){var P=h-1,I=h+1;if(M)if(0===h)i=[0,1];else{var O=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,O/E));i=h>0?[0,z]:[z,0]}else i=S?[Math.max(0,P),Math.max(1,I)]:[P,I]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(e,x.val,b.val))/(E-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return v&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),L=A(r.vpadminus||r.vpad);if(!T){if(h=1/0,p=-1/0,w)for(n=0;n0&&(h=a),a>p&&a-o&&(h=a),a>p&&a=I;n--)P(n);return{min:d,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":688,"../../constants/numerical":779,"../../lib":803,"../../registry":931,"./axis_ids":858,"@plotly/d3":58,"fast-isnumeric":249}],854:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),p=t("./layout_attributes"),d=t("./clean_ticks"),g=t("../../constants/numerical"),m=g.ONEMAXYEAR,v=g.ONEAVGYEAR,y=g.ONEMINYEAR,x=g.ONEMAXQUARTER,b=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,T=g.ONEAVGMONTH,k=g.ONEMINMONTH,A=g.ONEWEEK,M=g.ONEDAY,S=M/2,E=g.ONEHOUR,L=g.ONEMIN,C=g.ONESEC,P=g.MINUS_SIGN,I=g.BADNUM,O={K:"zeroline"},z={K:"gridline",L:"path"},D={K:"tick",L:"path"},R={K:"tick",L:"text"},F=t("../../constants/alignment"),B=F.MID_SHIFT,N=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var q=t("./axis_autotype"),H=t("./axis_ids"),G=H.idSort,Y=H.isLinked;V.id2name=H.id2name,V.name2id=H.name2id,V.cleanId=H.cleanId,V.list=H.list,V.listIds=H.listIds,V.getFromId=H.getFromId,V.getFromTrace=H.getFromTrace;var W=t("./autorange");V.getAutoRange=W.getAutoRange,V.findExtremes=W.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=V.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,v,c,a)),m=y,0;m<=u;)m=V.tickIncrement(m,v,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(m,0,a),size:v,_dataSpan:u-c}},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,V.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=V.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dticka&&f=o:p<=o;p=V.tickIncrement(p,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(p=u)break}if(L.length>g||p===C)break;C=p;var P=!1;f&&p!==(0|p)&&(P=!0),L.push({minor:P,value:p})}if(h&&function(t,e,r){for(var n=0;n0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=m?u:v:r===b&&f>=_?h=u>=_&&u<=x?u:b:f>=k?h=u>=k&&u<=w?u:T:r===A&&f>=A?h=A:f>=M?h=M:r===S&&f>=S?h=S:r===E&&f>=E&&(h=E),h>=u&&(h=u,s=!0);var p=i+h;if(e.rangebreaks&&h>0){for(var d=0,g=0;g<84;g++){var L=(g+.5)/84;e.maskBreaks(i*(1-L)+L*p)!==I&&d++}(h*=d/84)||(t[n].drop=!0),s&&u>A&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(L,t,t._definedDelta),t.rangebreaks){var O="y"===t._id.charAt(0),z=1;"auto"===t.tickmode&&(z=t.tickfont?t.tickfont.size:12);var D=NaN;for(d=L.length-1;d>-1;d--)if(L[d].drop)L.splice(d,1);else{L[d].value=Mt(L[d].value,t);var R=t.c2p(L[d].value);(O?D>R-z:Du||Bu&&(F.periodX=u),B10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=L&&a<=16||e>=E)t._tickround="M";else if(e>=C&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(ut(t.exponentformat)&&!ft(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}V.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var a=2*e;if(a>v)e/=v,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(a>T)e/=T,t.dtick="M"+ot(e,1,tt);else if(a>M){t.dtick=ot(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=V.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else a>E?t.dtick=ot(e,E,tt):a>L?t.dtick=ot(e,L,et):a>C?t.dtick=ot(e,C,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):At(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,at)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},V.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?it:nt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=ht(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||ut(p)&&ft(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":P)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):At(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=ht(e.x,t,i,n)}(t,o,0,c,g),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var m=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[m(o.x-.5),m(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":P+o:o};var ct=["f","p","n","\u03bc","m","","k","M","G","T"];function ut(t){return"SI"===t||"B"===t}function ft(t){return t>14||t<-15}function ht(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=V.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":ut(l)&&(t+=ct[c/3+5]));return a?P+t:t}function pt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),p.reverse()),r.width>0){var m=r.right-(e._offset+e._length);m>0&&(n.xr=1,n.r=m);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=mt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[g]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[g]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,xt(e),n),a.autoMargin(t,bt(e),i),a.autoMargin(t,_t(e),s)})),r.skipTitle||K&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+mt(e);else{var s=St(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var c,f,p,d,g=V.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,p="top"===e.side?g-r:g+r):(p=e._offset+e._length/2,f="right"===e.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var m=e._selections[e._id+"tick"];if(d={selection:m,side:e.side},m&&m.node()&&m.node().parentNode){var v=h.getTranslate(m.node().parentNode);d.offsetLeft=v.x,d.offsetTop=v.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function Q(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=yt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},V.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*N,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-N));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(dt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(dt(e)))}},V.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,g=h?t.ticklen:0;if(f?g*=-1:u&&(g=0),h&&(p+=g,r)){var m=s.deg2rad(r);p=g*Math.cos(m)+1,d=g*Math.sin(m)}t.showticklabels&&(h||t.showline)&&(p+=.2*t.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if("x"===A)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),v=d*b,y=e+p*b,x=_?1:-.2,90===Math.abs(M)&&(f?x+=B:x=-90===M&&"bottom"===k?N:90===M&&"top"===k?B:.5,T=B/2*(M/90)),w.xFn=function(t){return t.dx+v+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*b<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===A){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),v=p,y=d*b,x=0,f||90!==Math.abs(M)||(x=-90===M&&"left"===k||90===M&&"right"===k?N:.5),f){var S=i(M)?+M:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*N*b,x=0}}w.xFn=function(t){return t.dx+e-(v+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*B},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},V.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.vals;"period"===e.ticklabelmode&&(i=i.slice()).shift();var a=r.layer.selectAll("path."+n).data(e.ticks?i:[],gt);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),Et(e,[D]),a.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&V.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;sp||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},x(v,m+1?m:g);var b=null;e._selections&&(e._selections[f]=v);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(b=90,_.push((function(){x(v,m)}))):_.push((function(){if(x(v,g),p.length&&"x"===u&&!i(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,a=[];if(v.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=yt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=p.length,l=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},d=f("top"),m=f("left"),y=f("right"),_=f("bottom")||m||d||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var m="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,m)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=y(o[l])){u=d;break}var f=i("pattern",u);if(f===d)for(l=0;l<2;l++)(c=y(o[l]))&&(e.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case d:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":931,"./constants":861}],859:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function m(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*x)||T)for(r=0;rO&&FP&&(P=F);h/=(P-C)/(2*I),C=l.l2r(C),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,i,a)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){I&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},p=(a||{}).xaHash,d=(a||{}).yaHash,g=0;g=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(q(i),2!==t||vt||Ht(),mt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Pt),o.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&vt){var s=g?O:I,c="s"===g||"w"===v?0:1,f=s._name+".range["+c+"]",h=function(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,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",m="middle";if(s.fixedrange)return;g?(m="n"===g?"top":"bottom","right"===s.side&&(d="right")):"e"===v&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:m}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(_t,n),Tt.r=Math.max(_t,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,_t>n?Tt.l=_t-a:Tt.r=_t+a),Lt.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Lt.attr("d",G(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;ug[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":803,"fast-isnumeric":249}],873:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":771}],874:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,h=c.drawMode,p=c.openMode,d=c.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),m=t("../../components/shapes/draw_newshape/helpers").handleEllipse,v=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),x=t("../../lib/polygon"),b=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),A=k.MINSELECT,M=x.filter,S=x.tester,E=t("./handle_outline").clearSelect,L=t("./helpers"),C=L.p2r,P=L.axValue,I=L.getTransform;function O(t,e,r,n,i,a,o){var s,l,c,u,f,h,d,m,v,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){F(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=j(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=v(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function U(t,e,r){var n,a,o,s;for(n=0;n=0)L._fullLayout._deactivateShape(L);else if(!_){var r=z.clickmode;b.done(gt).then((function(){if(b.clear(gt),2===t){for(ft.remove(),$=0;$-1&&O(e,L,i.xaxes,i.yaxes,i.subplot,i,ft),"event"===r&&L.emit("plotly_selected",void 0);s.click(L,e)})).catch(y.error)}},i.doneFn=function(){dt.remove(),b.done(gt).then((function(){b.clear(gt),i.gd.emit("plotly_selected",et),Q&&i.selectionDefs&&(Q.subtract=ut,i.selectionDefs.push(Q),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,K)),i.doneFnCompleted&&i.doneFnCompleted(mt)})).catch(y.error),_&&B(i)}},clearSelect:E,clearSelectionsCache:B,selectOnClick:O}},{"../../components/color":666,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../components/fx/helpers":702,"../../components/shapes/draw_newshape/display_outlines":754,"../../components/shapes/draw_newshape/helpers":755,"../../components/shapes/draw_newshape/newshapes":756,"../../lib":803,"../../lib/clear_gl_canvases":787,"../../lib/polygon":815,"../../lib/throttle":830,"../../plot_api/subroutines":844,"../../registry":931,"./axis_ids":858,"./constants":861,"./handle_outline":865,"./helpers":866,polybooljs:504}],875:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,p=t("../../constants/numerical"),d=p.FP_SAFE,g=p.BADNUM,m=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,A=T.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);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-2*m*Math.abs(n-i))}return g}function L(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function I(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return g}function O(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=O(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:O(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):g},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===p;B=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:f,t.l2c="log"===t.type?M:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(E(t,e))}:B,t.p2c="log"===t.type?function(t){return M(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=E,t.l2d=M,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return M(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=O,t.l2r=t.c2r=f,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),f="y"===p;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function m(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,p=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),g=a.simpleMap(e.xr1,i.r2l),m=d[1]-d[0],v=g[1]-g[0];p[0]=(d[0]*(1-r)+r*g[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/m),i.range[0]=i.l2r(d[0]*(1-r)+r*g[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/p[2]:1,T=h?u/p[3]:1,k=f?p[0]:0,A=h?p[1]:0,M=f?p[0]/p[2]*c:0,S=h?p[1]/p[3]*u:0,E=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":688,"../../lib":803,"../../registry":931,"./axes":854,"@plotly/d3":58}],880:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var p=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r){var n=this,i=e[this.id],a=[],o=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&i["show"+s]){o=!0;break}for(var l=0;l0&&a._module.calcGeoJSON(i,e)}if(!this.updateProjection(t,e)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),d.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,f=n.projection,h=n.lonaxis,p=n.lataxis,d=h._ax,g=p._ax,v=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],h=function(t){return t?l:[]},p=0;pu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),y=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],x=n.center||{},b=f.rotation||{},_=h.range||[],T=p.range||[];if(n.fitbounds){d._length=y[1][0]-y[0][0],g._length=y[1][1]-y[0][1],d.range=m(r,d),g.range=m(r,g);var k=(d.range[0]+d.range[1])/2,A=(g.range[0]+g.range[1])/2;if(n._isScoped)x={lon:k,lat:A};else if(n._isClipped){x={lon:k,lat:A},b={lon:k,lat:A,roll:b.roll};var M=f.type,S=w.lonaxisSpan[M]/2||180,L=w.lataxisSpan[M]/2||90;_=[k-S,k+S],T=[A-L,A+L]}else x={lon:k,lat:A},b={lon:k,lat:b.lat,roll:b.roll}}v.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(f.parallels);var C=E(_,T);v.fitExtent(y,C);var P=this.bounds=v.getBounds(C),I=this.fitScale=v.scale(),O=v.translate();if(n.fitbounds){var z=v.getBounds(E(d.range,g.range)),D=Math.min((P[1][0]-P[0][0])/(z[1][0]-z[0][0]),(P[1][1]-P[0][1])/(z[1][1]-z[0][1]));isFinite(D)?v.scale(D*I):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else v.scale(f.scale*I);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(v.translate([O[0]+(R[0]-O[0]),O[1]+(R[1]-O[1])]).clipExtent(P),n._isAlbersUsa){var F=v([x.lon,x.lat]),B=v.translate();v.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};g.setConvert(l,r);var c=g.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,f=new Array(u),h=0;h-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,f),s.indexOf("event")>-1&&p.click(i,n.event))}))}function h(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},g.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":666,"../../components/dragelement":685,"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/geo_location_utils":796,"../../lib/topojson_utils":832,"../../registry":931,"../cartesian/autorange":853,"../cartesian/axes":854,"../cartesian/select":874,"../plots":917,"./constants":885,"./zoom":890,"@plotly/d3":58,"d3-geo":169,"d3-geo-projection":168,"topojson-client":601}],887:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&P<0&&(P+=360);var I,O,z,D=(C+P)/2;if(!p){var R=d?f.projRotate:[D,0,0];I=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}(p?(O=-96.6,z=38.7):(O=d?D:I,z=(L[0]+L[1])/2),r("center.lon",O),r("center.lat",z),g&&(r("projection.tilt"),r("projection.distance")),m)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):v?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":803,"../get_data":891,"../subplot_defaults":925,"./constants":885,"./layout_attributes":888}],890:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),h[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",h)}function h(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(t,e,i)})),r}function p(t,e){var r,i,a,o,s,h,p,d,g,m=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return m.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=v(r)})).on("zoom",(function(){if(h=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return m.scale(e.scale()),void m.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?v(h)&&(d=v(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=v(r=h),g=!0,t.render();var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(t,e,y)})),m}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var g=180-a-2*p,m=(Math.atan2(h,u)-Math.atan2(c,i))*s,v=(Math.atan2(h,u)-Math.atan2(c,-i))*s;return b(r[0],r[1],a,m)<=b(r[0],r[1],g,v)?[a,m,r[2]]:[g,v,r[2]]}function b(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(m(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(m(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":666,"../../../lib":803,"../../../registry":931,"../../get_data":891,"../../subplot_defaults":925,"./axis_defaults":899,"./layout_attributes":902}],902:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":803,"../../../lib/extend":793,"../../domain":882,"./axis_attributes":898}],903:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){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]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":828}],904:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var c,u=Object.keys(e.traces),h=null,g=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(k.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(g.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+k.valueLabel),g.textLabel&&E.push(g.textLabel),_=E.join("
")):_=g.textLabel;var L={x:g.traceCoordinate[0],y:g.traceCoordinate[1],z:g.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};d.appendArrayPointValue(L,w,T),t._module.eventData&&(L=w._module.eventData(L,g,w,{},T));var C={points:[L]};if(e.fullSceneLayout.hovermode){var P=[];d.loneHover({trace:w,x:(.5+.5*x[0]/x[3])*s,y:(.5-.5*x[1]/x[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:_,name:h.name,color:d.castHoverOption(w,T,"bgcolor")||h.color,borderColor:d.castHoverOption(w,T,"bordercolor"),fontFamily:d.castHoverOption(w,T,"font.family"),fontSize:d.castHoverOption(w,T,"font.size"),fontColor:d.castHoverOption(w,T,"font.color"),nameLength:d.castHoverOption(w,T,"namelength"),textAlign:d.castHoverOption(w,T,"align"),hovertemplate:f.castOption(w,T,"hovertemplate"),hovertemplateLabels:f.extendFlat({},L,k),eventData:[L]},{container:n,gd:r,inOut_bbox:P}),L.bbox=P[0]}g.buttons&&g.distance<5?r.emit("plotly_click",C):r.emit("plotly_hover",C),c=C}else d.loneUnhover(n),r.emit("plotly_unhover",c);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,p=0;p<(u||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var d=0;dm[1][a])m[0][a]=-1,m[1][a]=1;else{var L=m[1][a]-m[0][a];m[0][a]-=L/32,m[1][a]+=L/32}if("reversed"===s.autorange){var C=m[0][a];m[0][a]=m[1][a],m[1][a]=C}}else{var P=s.range;m[0][a]=s.r2l(P[0]),m[1][a]=s.r2l(P[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.setBounds(a,{min:m[0][a]*h[a],max:m[1][a]*h[a]})}var I=c.aspectmode;if("cube"===I)d=[1,1,1];else if("manual"===I){var O=c.aspectratio;d=[O.x,O.y,O.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(a=0;a<3;++a){var D=y[l=(s=c[k[a]]).type];z[a]=Math.pow(D.acc,1/D.count)/h[a]}d="data"===I||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).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]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(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 i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),h=l||c;if(h){var p={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",h={x:0,y:0,z:1},p={};p[c]=h;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=h,f.nestedProperty(d,c).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d"),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":706,"../../lib":803,"../../lib/show_no_webgl_msg":825,"../../lib/str2rgbarray":828,"../../plots/cartesian/axes":854,"../../registry":931,"./layout/convert":900,"./layout/spikes":903,"./layout/tick_marks":904,"./project":905,"gl-plot3d":326,"has-passive-events":444,"webgl-context":629}],907:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap
contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":826}],910:[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=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":803}],911:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),f=t("../../lib/svg_text_utils"),h=t("./mapbox"),p=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=v.split("|").join("
");x.text(w).attr("data-unformatted",w).call(f.convertToTspans,t),b=u.bBox(x.node())}x.attr("transform",a(-3,8-b.height)),y.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;b.width+6>_&&(T=_/(b.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];y.attr("transform",a(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&v(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},_.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=f(o)?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},_.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])},_.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=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"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){b.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})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},b.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,b.linkSubplots(h,l,f,n),b.cleanPlot(h,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||d)&&(d&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=g,r.r/=g)}if(f){var m=(r.t+r.b)/f;m>1&&(r.t/=m,r.b/=m)}var v=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:v,size:r.l+d},r:{val:y,size:r.r+d},b:{val:_,size:r.b+d},t:{val:x,size:r.t+d}},p[e]=1}else delete h[e],delete p[e];if(!n._replotting)return b.doAutoMargin(t)}},b.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,d=a.b,g=e._pushmargin,m=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in g)m[v]||delete g[v];for(var y in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:d}},g){var x=g[y].l||{},_=g[y].b||{},w=x.val,T=x.size,k=_.val,A=_.size;for(var M in g){if(o(T)&&g[M].r){var S=g[M].r.val,E=g[M].r.size;if(S>w){var L=(T*S+(E-r)*w)/(S-w),P=(E*(1-w)+(T-r)*(1-S))/(S-w);L+P>c+f&&(c=L,f=P)}}if(o(A)&&g[M].t){var I=g[M].t.val,O=g[M].t.size;if(I>k){var z=(A*I+(O-n)*k)/(I-k),D=(O*(1-k)+(A-n)*(1-I))/(I-k);z+D>d+h&&(d=z,h=D)}}}}}var R=u.constrain(r-a.l-a.r,2,64),F=u.constrain(n-a.t-a.b,2,64),B=Math.max(0,r-R),N=Math.max(0,n-F);if(B){var j=(c+f)/B;j>1&&(c/=j,f/=j)}if(N){var U=(d+h)/N;U>1&&(d/=U,h/=U)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&b.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(m).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}b.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},b.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&b.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,c,f),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(p),b=x[2]-x[0],_=x[3]-x[1],w=h/f,T=Math.abs(_/b);w>T?(d=f,y=(h-(g=f*T))/n.h/2,m=[o[0],o[1]],v=[s[0]+y,s[1]-y]):(g=h,y=(f-(d=h/T))/n.w/2,m=[o[0]+y,o[1]-y],v=[s[0],s[1]]),this.xLength2=d,this.yLength2=g,this.xDomain2=m,this.yDomain2=v;var k=this.xOffset2=n.l+n.w*m[0],A=this.yOffset2=n.t+n.h*(1-v[1]),M=this.radius=d/b,S=this.innerRadius=e.hole*M,E=this.cx=k-M*x[0],L=this.cy=A+M*x[3],I=this.cxx=E-k,O=this.cyy=L-A;this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[i.side],_realSide:i.side,domain:[S/n.w,M/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:m}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:v});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",l(I,O)),r.frontplot.attr("transform",l(k,A)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",l(E,L)).call(c.fill,e.bgcolor)},z.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},z.mockCartesianAxis=function(t,e,r){var n=this,i=r._id,a=o.extendFlat({type:"linear"},r);p(a,t);var s={x:[0,2],y:[1,3]};return a.setRange=function(){var t=n.sectorBBox,r=s[i],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);a.range=[t[r[0]]*l,t[r[1]]*l]},a.isPtWithinRange="x"===i?function(t){return n.isPtInside(t)}:function(){return!0},a.setRange(),a.setScale(),a},z.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=e.radialaxis;n.setScale(),g(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},z.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=e.radialaxis,g=C(e.sector[0],360),m=r.radialAxis,v=u90&&g<=270&&(m.tickangle=180);var y=function(t){return l(m.l2p(t.x)+u,0)},x=D(d);if(r.radialTickLayout!==x&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=x),v){m.setScale();var b=h.calcTicks(m),_=h.clipEnds(m,b),w=h.getTickSigns(m)[2];h.drawTicks(n,m,{vals:b,layer:i["radial-axis"],path:h.makeTickPath(m,0,w),transFn:y,crisp:!1}),h.drawGrid(n,m,{vals:_,layer:i["radial-grid"],path:function(t){return r.pathArc(m.r2p(t.x)+u)},transFn:o.noop,crisp:!1}),h.drawLabels(n,m,{vals:b,layer:i["radial-axis"],transFn:y,labelFns:h.makeLabelFns(m,0)})}var T=r.radialAxisAngle=r.vangles?I(R(P(d.angle),r.vangles)):d.angle,k=l(f,p),A=k+s(-T);F(i["radial-axis"],v&&(d.showticklabels||d.ticks),{transform:A}),F(i["radial-grid"],v&&d.showgrid,{transform:k}),F(i["radial-line"].select("line"),v&&d.showline,{x1:u,y1:0,x2:a,y2:0,transform:A}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,f=P(c),h=Math.cos(f),p=Math.sin(f),d=0;if(s.title){var g=u.bBox(this.layers["radial-axis"].node()).height,m=s.title.font.size;d="counterclockwise"===s.side?-g-.4*m:g+.8*m}this.layers["radial-axis-title"]=x.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:L(n,"Click to enter radial axis title"),attributes:{x:a+i/2*h+d*p,y:o-i/2*p+d*h,"text-anchor":"middle"},transform:{rotate:-c}})},z.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=e.angularaxis,g=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",d.rotation),g.setGeometry(),g.setScale();var m=function(t){return g.t2g(t.x)};"linear"===g.type&&"radians"===g.thetaunit&&(g.tick0=I(g.tick0),g.dtick=I(g.dtick));var v=function(t){return l(f+a*Math.cos(t),p-a*Math.sin(t))},y=h.makeLabelFns(g,0).labelStandoff,x={xFn:function(t){var e=m(t);return Math.cos(e)*y},yFn:function(t){var e=m(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(y+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=m(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=m(t);return-.5*(1+Math.sin(n))*r}},b=D(d);r.angularTickLayout!==b&&(i["angular-axis"].selectAll("."+g._id+"tick").remove(),r.angularTickLayout=b);var _,w=h.calcTicks(g);if("linear"===e.gridshape?(_=w.map(m),o.angleDelta(_[0],_[1])<0&&(_=_.slice().reverse())):_=null,r.vangles=_,"category"===g.type&&(w=w.filter((function(t){return o.isAngleInsideSector(m(t),r.sectorInRad)}))),g.visible){var T="inside"===g.ticks?-1:1,k=(g.linewidth||1)/2;h.drawTicks(n,g,{vals:w,layer:i["angular-axis"],path:"M"+T*k+",0h"+T*g.ticklen,transFn:function(t){var e=m(t);return v(e)+s(-I(e))},crisp:!1}),h.drawGrid(n,g,{vals:w,layer:i["angular-grid"],path:function(t){var e=m(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,p-u*n]+"L"+[f+a*r,p-a*n]},transFn:o.noop,crisp:!1}),h.drawLabels(n,g,{vals:w,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return v(m(t))},labelFns:x})}F(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},z.updateMainDrag=function(t){var e,r,s=this,c=s.gd,u=s.layers,f=t._zoomlayer,h=S.MINZOOM,p=S.OFFEDGE,d=s.radius,g=s.innerRadius,x=s.cx,T=s.cy,k=s.cxx,A=s.cyy,M=s.sectorInRad,L=s.vangles,C=s.radialAxis,P=E.clampTiny,I=E.findXYatLength,O=E.findEnclosingVertexAngles,z=S.cornerHalfWidth,D=S.cornerLen/2,R=m.makeDragger(u,"path","maindrag","crosshair");n.select(R).attr("d",s.pathSubplot()).attr("transform",l(x,T));var F,B,N,j,U,V,q,H,G,Y={element:R,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function W(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return W(t-k,e-A)}function Z(t,e){return Math.atan2(A-e,t-k)}function J(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function K(t,e){if(0===t)return s.pathSector(2*z);var r=D/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,d)),o=a-z,l=a+z;return"M"+J(o,n)+"A"+[o,o]+" 0,0,0 "+J(o,i)+"L"+J(l,i)+"A"+[l,l]+" 0,0,1 "+J(l,n)+"Z"}function Q(t,e,r){if(0===t)return s.pathSector(2*z);var n,i,a=J(t,e),o=J(t,r),l=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,h=I(z,u,l,c);n=I(D,f,h[0][0],h[0][1]),i=I(D,f,h[1][0],h[1][1])}else{var p,d;c?(p=D,d=z):(p=z,d=D),n=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function $(t,e){return e=Math.max(Math.min(e,d),g),th?(t-1&&1===t&&_(e,c,[s.xaxis],[s.yaxis],s.id,Y),r.indexOf("event")>-1&&y.click(c,e,s.id)}Y.prepFn=function(t,n,a){var l=c._fullLayout.dragmode,u=R.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var h=c._fullLayout._invTransform;e=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var p=o.apply3DTransform(h)(n-u.left,a-u.top);if(F=p[0],B=p[1],L){var g=E.findPolygonOffset(d,M[0],M[1],L);F+=k+g[0],B+=A+g[1]}switch(l){case"zoom":Y.moveFn=L?nt:et,Y.clickFn=ot,Y.doneFn=it,function(){N=null,j=null,U=s.pathSubplot(),V=!1;var t=c._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(H=m.makeZoombox(f,q,x,T,U)).attr("fill-rule","evenodd"),G=m.makeCorners(f,x,T),w(c)}();break;case"select":case"lasso":b(t,n,a,Y,l)}},R.onmousemove=function(t){y.hover(c,t,s.id),c._fullLayout._lasthover=R,c._fullLayout._hoversubplot=s.id},R.onmouseout=function(t){c._dragging||v.unhover(c,t)},v.init(Y)},z.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,f=i.radius,h=i.innerRadius,p=i.cx,d=i.cy,g=i.radialAxis,y=S.radialDragBoxSize,x=y/2;if(g.visible){var b,_,T,M=P(i.radialAxisAngle),E=g._rl,L=E[0],C=E[1],O=E[r],z=.75*(E[1]-E[0])/(1-e.hole)/f;r?(b=p+(f+x)*Math.cos(M),_=d-(f+x)*Math.sin(M),T="radialdrag"):(b=p+(h-x)*Math.cos(M),_=d-(h-x)*Math.sin(M),T="radialdrag-inner");var D,B,N,j=m.makeRectDragger(u,T,"crosshair",-x,-x,y,y),U={element:j,gd:c};F(n.select(j),g.visible&&h0==(r?N>L:Nn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0){for(var n=[],i=0;i=u&&(p.min=0,g.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var i=f[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var h=o("color"),p=h!==i.color.dflt?h:r.font.color,d=e._name.charAt(0).toUpperCase(),g="Component "+d,m=o("title.text",g);e._hovertitle=m===g?m:d,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:p}),o("min"),c(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:h,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:f,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":666,"../../lib":803,"../../plot_api/plot_template":843,"../cartesian/line_grid_defaults":871,"../cartesian/tick_label_defaults":876,"../cartesian/tick_mark_defaults":877,"../cartesian/tick_value_defaults":878,"../subplot_defaults":925,"./layout_attributes":928}],930:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,p=t("../plots"),d=t("../cartesian/axes"),g=t("../../components/dragelement"),m=t("../../components/fx"),v=t("../../components/dragelement/helpers"),y=v.freeMode,x=v.rectMode,b=t("../../components/titles"),_=t("../cartesian/select").prepSelect,w=t("../cartesian/select").selectOnClick,T=t("../cartesian/select").clearSelect,k=t("../cartesian/select").clearSelectionsCache,A=t("../cartesian/constants");function M(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iE*b?i=(a=b)*E:a=(i=x)/E,o=v*i/x,l=y*a/b,r=e.l+e.w*g-i/2,n=e.t+e.h*(1-m)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[g-o/2,g+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-k],domain:[m-l/2,m+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+l*E],anchor:"free",position:0,_id:"y",_length:i});f(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var L=p.caxis=h({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+l*E],anchor:"free",position:0,_id:"y",_length:i});f(L,p.graphDiv._fullLayout),L.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var O=s(r-S._offset,n+a);p.layers.baxis.attr("transform",O),p.layers.bgrid.attr("transform",O);var z=s(r+i/2,n)+"rotate(30)"+s(0,-M._offset);p.layers.aaxis.attr("transform",z),p.layers.agrid.attr("transform",z);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-L._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",L.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),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)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=b.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=b.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),f=d.clipEnds(t,u),h=d.makeTransTickFn(t),p=d.getTickSigns(t)[2],g=o.deg2rad(30),m=p*(t.linewidth||1)/2,v=p*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+m+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+m+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:b,transFn:h,crisp:!1}),d.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:h,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:h,labelFns:d.makeLabelFns(t,0,30)})};var L=A.MINZOOM/2+.87,C="m-0.87,.5h"+L+"v3h-"+(L+5.2)+"l"+(L/2+2.6)+",-"+(.87*L+4.5)+"l2.6,1.5l-"+L/2+","+.87*L+"Z",P="m0.87,.5h-"+L+"v3h"+(L+5.2)+"l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-2.6,1.5l"+L/2+","+.87*L+"Z",I="m0,1l"+L/2+","+.87*L+"l2.6,-1.5l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-"+(L/2+2.6)+","+(.87*L+4.5)+"l2.6,1.5l"+L/2+",-"+.87*L+"Z",O=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearSelect=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,h,p,d,v,b,T,k,M=this,S=M.layers.plotbg.select("path").node(),L=M.graphDiv,D=L._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=L._fullLayout.clickmode;z(L),2===t&&(L.emit("plotly_doubleclick",null),a.call("_guiRelayout",L,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,L,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&m.click(L,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,N(r,n),N(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),g=(l/2+u)*M.w,m=(1-l/2-c)*M.w,y=(g+m)/2,x=m-g,_=(1-l)*M.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),L.emit("plotly_relayouting",R(p))}function V(){z(L),p!==f&&(a.call("_guiRelayout",L,R(p)),O&&L.data&&L._context.showTips&&(o.notifier(l(L,"Double-click to zoom back out"),"long"),O=!1))}function q(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),a=i.indexOf(p.a),l=i.indexOf(p.b),c=i.indexOf(p.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),p={a:i[a],b:i[l],c:i[c]},e=(f.a-p.a)*M.yaxis._m,t=(f.c-p.c-f.b+p.b)*M.xaxis._m);var h=s(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d=s(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,M),L.emit("plotly_relayouting",R(p))}function H(){a.call("_guiRelayout",L,R(p))}this.dragOptions={element:S,gd:L,plotinfo:{id:M.id,domain:L._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(a,l,u){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=L._fullLayout._invScaleX,e=L._fullLayout._invScaleY;var g=M.dragOptions.dragmode=L._fullLayout.dragmode;y(g)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===g?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,L._fullLayout._calcInverseTransform(L);var u=L._fullLayout._invTransform,g=o.apply3DTransform(u)(r,n);r=g[0],n=g[1],f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,h=M.aaxis.range[1]-f.a,d=i(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),v="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",b=!1,T=D.append("path").attr("class","zoombox").attr("transform",s(M.x0,M.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=D.append("path").attr("class","zoombox-corners").attr("transform",s(M.x0,M.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearSelect(L)}(0,l,u)):"pan"===g?(M.dragOptions.moveFn=q,M.dragOptions.clickFn=F,M.dragOptions.doneFn=H,f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,M.clearSelect(L)):(x(g)||y(g))&&_(a,l,u,M.dragOptions,g)}},S.onmousemove=function(t){m.hover(L,t,M.id),L._fullLayout._lasthover=S,L._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){L._dragging||g.unhover(L,t)},g.init(this.dragOptions)}},{"../../components/color":666,"../../components/dragelement":685,"../../components/dragelement/helpers":684,"../../components/drawing":688,"../../components/fx":706,"../../components/titles":764,"../../lib":803,"../../lib/extend":793,"../../registry":931,"../cartesian/axes":854,"../cartesian/constants":861,"../cartesian/select":874,"../cartesian/set_convert":875,"../plots":917,"@plotly/d3":58,tinycolor2:598}],931:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=l.extendFlat,h=l.extendDeepAll;function p(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var i in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":666,"../components/drawing":688,"../constants/xmlns_namespaces":780,"../lib":803,"@plotly/d3":58}],940:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+c||!n(u))}for(var p=0;pa))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0?e+=r:u<0&&(e-=r)}return e}function z(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var D=t[f+"a"],R=t[h+"a"];g=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(n.getClosest(m,F,t),!1!==t.index&&m[t.index].p!==c){k||(L=function(t){return Math.min(A(t),t.p-y.bargroupwidth/2)},C=function(t){return Math.max(M(t),t.p+y.bargroupwidth/2)});var B=m[t.index],N=v.base?B.b+B.s:B.s;t[h+"0"]=t[h+"1"]=R.c2p(B[h],!0),t[h+"LabelVal"]=N;var j=y.extents[y.extents.round(B.p)];t[f+"0"]=D.c2p(x?L(B):j[0],!0),t[f+"1"]=D.c2p(x?C(B):j[1],!0);var U=void 0!==B.orig_p;return t[f+"LabelVal"]=U?B.orig_p:B.p,t.labelLabel=l(D,t[f+"LabelVal"],v[f+"hoverformat"]),t.valueLabel=l(R,t[h+"LabelVal"],v[h+"hoverformat"]),t.baseLabel=l(R,B.b,v[h+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return P(A(t),M(t),w)}(B))/2,t[f+"Spike"]=D.c2p(B.p,!0),o(B,v,t),t.hovertemplate=v.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":666,"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"./helpers":947}],949:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":868,"../scatter/marker_colorbar":1236,"./arrays_to_calcdata":940,"./attributes":941,"./calc":942,"./cross_trace_calc":944,"./defaults":945,"./event_data":946,"./hover":948,"./layout_attributes":950,"./layout_defaults":951,"./plot":952,"./select":953,"./style":955}],950:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],951:[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,c=!1,u=!1,f={},h=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,f="start"===c,h=((a.leftToRight||0)+1)/2,p=1-h,d=i.width,g=i.height,m=Math.abs(e-t),v=Math.abs(n-r),y=m>2*_&&v>2*_?_:0;m-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=m&&g<=v||!(d>m||g>v)||(d>v||g>m)&&d.01?H:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?H(t):t>e?Math.ceil(t):Math.floor(t)};B=G(B,N,D),N=G(N,B,D),j=G(j,U,!D),U=G(U,j,!D)}var Y=A(a.ensureSingle(I,"path"),P,m,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(U-j))||V&&t._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+U+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var W=l.makePointStyleFns(f);l.singlePointStyle(c,Y,f,W,t)}!function(t,e,r,n,i,s,c,f,p,m,v){var w,T=e.xaxis,M=e.yaxis,C=t._fullLayout;function P(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,O="h"===I.orientation,z=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,h,p="waterfall"===o.type,d="funnel"===o.type;"h"===o.orientation?(l="y",c=i,f="x",h=n):(l="x",c=n,f="y",h=i);function g(t){return u(h,h.c2l(t),!0).text}var m=e[r],v={};v.label=m.p,v.labelLabel=v[l+"Label"]=(y=m.p,u(c,c.c2l(y),!0).text);var y;var x=a.castOption(o,m.i,"text");(0===x||x)&&(v.text=x);v.value=m.s,v.valueLabel=v[f+"Label"]=g(m.s);var _={};b(_,o,m.i),p&&(v.delta=+m.rawS||m.s,v.deltaLabel=g(v.delta),v.final=m.v,v.finalLabel=g(v.final),v.initial=v.final-v.delta,v.initialLabel=g(v.initial));d&&(v.value=m.s,v.valueLabel=g(v.value),v.percentInitial=m.begR,v.percentInitialLabel=a.formatPercent(m.begR),v.percentPrevious=m.difR,v.percentPreviousLabel=a.formatPercent(m.difR),v.percentTotal=m.sumR,v.percenTotalLabel=a.formatPercent(m.sumR));var w=a.castOption(o,m.i,"customdata");w&&(v.customdata=w);return a.texttemplateString(s,v,t._d3locale,_,v,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var f,h=i.textinfo,p=t[e],d=h.split("+"),g=[],m=function(t){return-1!==d.indexOf(t)};m("label")&&g.push((v=t[e].p,u(o?n:r,v,!0).text));var v;m("text")&&(0===(f=a.castOption(i,p.i,"text"))||f)&&g.push(f);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;m("initial")&&g.push(c(b)),m("delta")&&g.push(c(y)),m("final")&&g.push(c(x))}if(l){m("value")&&g.push(c(p.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=a.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),m("percent previous")&&(f=a.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),m("percent total")&&(f=a.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(e,r,n,i):g.getValue(s.text,r);return g.coerceString(y,o)}(C,n,i,T,M);w=function(t,e){var r=g.getValue(t.textposition,e);return g.coerceEnumerated(x,r)}(I,i);var D="stack"===m.mode||"relative"===m.mode,R=n[i],F=!D||R._outmost;if(!z||"none"===w||(R.isBlank||s===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=C.font,N=d.getBarColor(n[i],I),j=d.getInsideTextFont(I,i,B,N),U=d.getOutsideTextFont(I,i,B),V=r.datum();O?"log"===T.type&&V.s0<=0&&(s=T.range[0]=G*(Z/Y):Z>=Y*(X/G);G>0&&Y>0&&(J||K||Q)?w="inside":(w="outside",q.remove(),q=null)}else w="inside";if(!q){W=a.ensureUniformFontSize(t,"outside"===w?U:j);var $=(q=P(r,z,W)).attr("transform");if(q.attr("transform",""),H=l.bBox(q.node()),G=H.width,Y=H.height,q.attr("transform",$),G<=0||Y<=0)return void q.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:h>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/u));var g=S(c),m=E(i,g),v=(s?m.x:m.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,A=0,M=s?k(e,t):k(r,n);s?(b=e-M*o,T=M*v):(w=n+M*o,A=-M*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:g}}(s,c,f,p,H,{isHorizontal:O,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=L(s,c,f,p,H,{isHorizontal:O,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=W.size,h(I.type,tt,C),R.transform=tt,A(q,C,m,v).attr("transform",a.getTextTransform(tt))}(t,e,I,r,p,B,N,j,U,m,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,C,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,m)},toMoveInsideBar:L}},{"../../components/color":666,"../../components/drawing":688,"../../components/fx/helpers":702,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../registry":931,"./attributes":941,"./constants":943,"./helpers":947,"./style":955,"./uniform_text":957,"@plotly/d3":58,"fast-isnumeric":249}],953:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:g,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,m(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":666,"../../components/drawing":688,"../../lib":803,"../../registry":931,"./attributes":941,"./helpers":947,"./uniform_text":957,"@plotly/d3":58}],956:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":666,"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803}],957:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=oh.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return g(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?m+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=a(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":706,"../../lib":803,"../../plots/polar/helpers":919,"../bar/hover":948,"../scatterpolar/hover":1296}],962:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":920,"../bar/select":953,"../bar/style":955,"../scatter/marker_colorbar":1236,"../scatterpolar/format_labels":1295,"./attributes":958,"./calc":959,"./defaults":960,"./hover":961,"./layout_attributes":963,"./layout_defaults":964,"./plot":965}],963:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],964:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,f,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(p)&&i(d)&&o!==s&&p!==d){var g=u.c2g(t.s1),m=(p+d)/2;t.ct=[l.c2p(g*Math.cos(m)),c.c2p(g*Math.sin(m))],e=h(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":688,"../../lib":803,"../../plots/polar/helpers":919,"@plotly/d3":58,"fast-isnumeric":249}],966:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../bar/attributes":941,"../scatter/attributes":1218}],967:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,y,x,b,_,w,T=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),A=i.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(y=k,x="x",b=A,_="y",w=!!e.yperiodalignment):(y=A,x="y",b=k,_="x",w=!!e.xperiodalignment);var E,L,C,P,I,O,z=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;for(var f="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),h=t._length,p=new Array(h),d=0;dE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return y.d2c((e[t]||[])[r])},q=1/0,H=-1/0;for(r=0;r=E.q1&&E.q3>=E.med){var Y=V("lowerfence");E.lf=Y!==s&&Y<=E.q1?Y:p(E,C,P);var W=V("upperfence");E.uf=W!==s&&W>=E.q3?W:d(E,C,P);var X=V("mean");E.mean=X!==s?X:P?o.mean(C,P):(E.q1+E.q3)/2;var Z=V("sd");E.sd=X!==s&&Z>=0?Z:P?o.stdev(C,P,E.mean):E.q3-E.q1,E.lo=g(E),E.uo=m(E);var J=V("notchspan");J=J!==s&&J>0?J:v(E,P),E.ln=E.med-J,E.un=E.med+J;var K=E.lf,Q=E.uf;e.boxpoints&&C.length&&(K=Math.min(K,C[0]),Q=Math.max(Q,C[P-1])),e.notched&&(K=Math.min(K,E.ln),Q=Math.max(Q,E.un)),E.min=K,E.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),$=E.med!==s?E.med:E.q1!==s?E.q3!==s?(E.q1+E.q3)/2:E.q1:E.q3!==s?E.q3:0,E.med=$,E.q1=E.q3=$,E.lf=E.uf=$,E.mean=E.sd=$,E.ln=E.un=$,E.min=E.max=$}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=L.filter(j),M.push(E)}}e._extremes[y._id]=i.findExtremes(y,[q,H],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ft;if((E={}).pos=E[_]=B[r],L=E.pts=nt[r].sort(f),P=(C=E[x]=L.map(h)).length,E.min=C[0],E.max=C[P-1],E.mean=o.mean(C,P),E.sd=o.stdev(C,P,E.mean),E.med=o.interp(C,.5),P%2&&(lt||ct))lt?(ut=C.slice(0,P/2),ft=C.slice(P/2+1)):ct&&(ut=C.slice(0,P/2+1),ft=C.slice(P/2)),E.q1=o.interp(ut,.5),E.q3=o.interp(ft,.5);else E.q1=o.interp(C,.25),E.q3=o.interp(C,.75);E.lf=p(E,C,P),E.uf=d(E,C,P),E.lo=g(E),E.uo=m(E);var ht=v(E,P);E.ln=E.med-ht,E.un=E.med+ht,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=L.filter(j),M.push(E)}e._extremes[y._id]=i.findExtremes(y,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:N,posLetter:_,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in c)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[c[n]]=e[n][r[0]][r[1]]):t[c[n]]=e[n][r])}function f(t,e){return t.v-e.v}function h(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function d(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function g(t){return 4*t.q1-3*t.q3}function m(t){return 4*t.q3-3*t.q1}function v(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"fast-isnumeric":249}],968:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,h=o._id,p=h.charAt(0),d=[],g=0;for(s=0;s1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;H+G>=0&&((W=V*(H+G))>M?(q=!0,j=Y,B=W):W>R&&(j=Y,B=M)),W<=M&&(B=M);var X=0;H-G<=0&&((X=-V*(H-G))>S?(q=!0,U=Y,N=X):X>F&&(U=Y,N=S)),X<=S&&(N=S)}else B=M,N=S;var Z=new Array(c.length);for(l=0;l0?(m="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(m="h",v=Math.min(_)):v=0;if(v){e._length=v;var S=r("orientation",m);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===y&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var h=!1;if(l){var p=s("mean"),d=s("sd");p&&p.length&&(h=!0,d&&d.length&&(h="sd"))}s("boxmean",h),s("whiskerwidth"),s("width"),s("quartilemethod");var g=!1;if(l){var m=s("notchspan");m&&m.length&&(g=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(g=!0);s("notched",g)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,f=a.bPos,h=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+f,!0),i=c.l2p(e-o)+h,a=c.l2p(e+s)+h,d=u?(i+a)/2:c.l2p(e)+h,g=l.c2p(t.mean,!0),m=l.c2p(t.mean-t.sd,!0),v=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+g+","+i+"V"+a+("sd"===p?"m0,0L"+m+","+d+"L"+g+","+i+"L"+v+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+g+"H"+a+("sd"===p?"m0,0L"+d+","+m+"L"+i+","+g+"L"+d+","+v+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],f=a.t,h=a.trace;(f.wdPos=f.bdPos*h.whiskerwidth,!0!==h.visible||f.empty)?i.remove():("h"===h.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},h,f),s(i,{x:c,y:u},h,f),l(i,{pos:e,val:r},h,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":688,"../../lib":803,"@plotly/d3":58}],976:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=L>0?Math.ceil:Math.floor,O=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,D=P(S+C),R=I(E-C),F=[[f=M(S)]];for(a=D;a*L=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],990:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,f,h,p,d,g,m,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,S=t._yctrl,E=M[0].length,L=M.length,C=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function O(n){var i,a,o,s,l,c,u,f,p,d,g,m,v=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,a))),s=a-o,x.length=P,x.crossLength=C,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(C-2,i))),u=i-c,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(g=t.dxydj([],c,a-1,u,0),v.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),m=t.dxydj([],c,a-1,u,1),v.push(f[0]-m[0]/3),y.push(f[1]-m[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=A,x.value=n,x.constvar=r,x.index=h,x.x=v,x.y=y,x.smoothing=A.smoothing,x}function z(n){var i,a,o,s,l,c=[],u=[],f={};if(f.length=x.length,f.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(z(o),{color:b.gridcolor,width:b.gridwidth}));for(h=u;hx.length-1||g<0||g>x.length-1))for(m=x[s],v=x[g],a=0;ax[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(i(z(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(z(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],f=c[1],h=u;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(O(p),{color:b.gridcolor,width:b.gridwidth}));for(h=u-1;hx[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(i(O(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(O(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":793,"../../plots/cartesian/axes":854}],991:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],1005:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,f=c.strTranslate,h=t("../../constants/alignment");function p(t,e,r,i,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var i=r,s=i.x,l=i.y,c=a([],s,t.c2p),u=a([],l,e.c2p),f="M"+o(c,u,i.smoothing);n.select(this).attr("d",f).style("stroke-width",i.width).style("stroke",i.color).style("fill","none")})),u.exit().remove()}function d(t,e,r,a,o,c,h,p){var d=c.selectAll("text."+p).data(h);d.enter().append("text").classed(p,!0);var g=0,m={};return d.each((function(o,c){var h;if("auto"===o.axis.tickangle)h=s(a,e,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;h=s(a,e,r,o.xy,[Math.cos(p),Math.sin(p)])}c||(m={angle:h.angle,flip:h.flip});var d=(o.endAnchor?-1:1)*h.flip,v=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),y=i.bBox(this);v.attr("transform",f(h.p[0],h.p[1])+u(h.angle)+f(o.axis.labelpadding*d,.3*y.height)),g=Math.max(g,y.width+o.axis.labelpadding)})),d.exit().remove(),m.maxExtent=g,m}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,f=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],h=i.trace,g=h.aaxis,m=h.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",h.opacity),p(l,u,x,g,"a",g._gridlines),p(l,u,x,m,"b",m._gridlines),p(l,u,y,g,"a",g._minorgridlines),p(l,u,y,m,"b",m._minorgridlines),p(l,u,b,g,"a-boundary",g._boundarylines),p(l,u,b,m,"b-boundary",m._boundarylines);var w=d(t,l,u,h,i,_,g._labels,"a-label"),T=d(t,l,u,h,i,_,m._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,f,h,p,d=c.aggNums(Math.min,null,r.a),g=c.aggNums(Math.max,null,r.a),m=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+g),f=m,h=r.ab2xy(u,f,!0),p=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,h,r.dxydb_rough(u,f)));v(t,e,r,n,h,p,r.aaxis,i,a,o,"a-title"),u=d,f=.5*(m+y),h=r.ab2xy(u,f,!0),p=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,h,r.dxyda_rough(u,f)));v(t,e,r,n,h,p,r.baxis,i,a,l,"b-title")}(t,_,h,i,l,u,w,T),function(t,e,r,n,i){var s,l,u,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,g=[];for(f=0;f90&&y<270,b=n.select(this);b.text(h.title.text).call(l.convertToTspans,t),x&&(_=(-l.lineCount(b)+m)*g*a-_),b.attr("transform",f(e.p[0],e.p[1])+u(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,h.title.font)})),b.exit().remove()}},{"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"./makepath":1002,"./map_1d_array":1003,"./orient_text":1004,"@plotly/d3":58}],1006:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[c-1],g=r[0],m=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,g-=b,m+=b,t.isVisible=function(t,e){return t>p&&tg&&ed||em},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,h.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,h.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,p,d,g=0,m=0,v=[];ne[c-1]?(f=c-2,h=1,g=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(p=u-2,d=1,m=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),g&&(t.dxydi(v,f,p,h,d),l[0]+=v[0]*g,l[1]+=v[1]*g),m&&(t.dxydj(v,f,p,h,d),l[0]+=v[0]*m,l[1]+=v[1]*m)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":823,"./compute_control_points":994,"./constants":995,"./create_i_derivative_evaluator":996,"./create_j_derivative_evaluator":997,"./create_spline_evaluator":998}],1007:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":803}],1008:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":803}],1009:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":665,"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scattergeo/attributes":1260}],1010:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var f=0;f")}(t,f,o),[t]}},{"../../lib":803,"../../plots/cartesian/axes":854,"./attributes":1009}],1014:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":887,"../heatmap/colorbar":1088,"./attributes":1009,"./calc":1010,"./defaults":1011,"./event_data":1012,"./hover":1013,"./plot":1015,"./select":1016,"./style":1017}],1015:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),f=[],h=[],p=0;p=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":909,"./convert":1019}],1023:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1024:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&h===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),h=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],1031:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(e,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(e);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":678,"./end_plus":1039,"./make_color_map":1044}],1032:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],1033:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,p,d,g=e.contours,m=r("contours.operation");(g._operation=c[m],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===m?h=g.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,p,f)}},{"../../components/color":666,"../../constants/filter_ops":775,"./label_defaults":1043,"fast-isnumeric":249}],1034:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":775,"fast-isnumeric":249}],1035:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],1036:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":803,"./constraint_mapping":1034,"./end_plus":1039}],1039:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],1040:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),p=[s(t,e,[-h[0],-h[1]])],d=t.z.length,g=t.z[0].length,m=e.slice(),v=h.slice();for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(h[0]||h[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[f]):delete t.crossings[u],!(h=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}p.push(s(t,e,h)),e[0]+=h[0],e[1]+=h[1],u=e.join(","),a(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=h[0]&&(e[0]<0||e[0]>g-2)||h[1]&&(e[1]<0||e[1]>d-2);if(e[0]===m[0]&&e[1]===m[1]&&h[0]===v[0]&&h[1]===v[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,A,M,S,E,L,C,P,I,O,z=a(p[0],p[p.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]M&&S--,t.edgepaths[S]=L.concat(p,E));break}V||(t.edgepaths[M]=p.concat(E))}for(M=0;Mt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,c,u,f,h=t[0].z,p=h.length,d=h[0].length,g=2===p||2===d;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}h=s,(d=-1===p.indexOf(h))&&(h=p[0],f+="Z")}for(h=0;hn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(h<1||p<1)return 1/0;var d=v.EDGECOST*(1/(h-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var g=s-u,m=l-f,y=s+u,x=l+f,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(h<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),h=function(t,e){return[s+t*f-e*u,l+t*u+e*f]},p=[h(-a/2,-o/2),h(-a/2,o/2),h(a/2,o/2),h(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,h=t._input.contours;if(u>f&&(r.start=h.start=f,f=r.end=h.end=u,u=r.start),!(r.size>0))c=u===f?1:a(u,f,t.ncontours).dtick,h.size=r.size=c}}},{"../../lib":803,"../../plots/cartesian/axes":854}],1048:[function(t,e,r){"use strict";var n=t("@plotly/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[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,h=!u&&"fill"===a.coloring,p=f||h?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var g;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===g&&(g=t.level),p(t.level+.5*l)})),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*l))}})),a(t)}},{"../../components/drawing":688,"../heatmap/style":1097,"./make_color_map":1044,"@plotly/d3":58}],1049:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":676,"./label_defaults":1043}],1050:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../contour/attributes":1028,"../heatmap/attributes":1085}],1051:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),f=t("../carpet/lookup_carpetid"),h=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var g=function(t,e){var r,u,f,h,p,d,g,m=e._carpetTrace,v=m.aaxis,y=m.baxis;v._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,h=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],h=h?y.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,p=e.b0||0,d=e.db||1,g=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(g),s(g,e._emptypoints);var x=i.maxRowLength(g),b="scaled"===e.xtype?"":r,_=c(e,b,u,f,x,v),w="scaled"===e.ytype?"":h,T=c(e,w,p,d,g.length,y),k={a:_,b:T,z:g};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:g,containerStr:"",cLetter:"z"});return[k]}(t,e);return h(e,e._z),g}}},{"../../components/colorscale/calc":674,"../../lib":803,"../carpet/lookup_carpetid":1001,"../contour/set_contours":1047,"../heatmap/clean_2d_array":1087,"../heatmap/convert_column_xyz":1089,"../heatmap/find_empties":1091,"../heatmap/interp2d":1094,"../heatmap/make_bound_array":1095,"./defaults":1052}],1052:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":803,"../contour/constraint_defaults":1033,"../contour/contours_defaults":1035,"../contour/style_defaults":1049,"../heatmap/xyz_defaults":1099,"./attributes":1050}],1053:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":868,"../contour/colorbar":1031,"../contour/style":1048,"./attributes":1050,"./calc":1051,"./defaults":1052,"./plot":1054}],1054:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),h=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),g=t("../carpet/lookup_carpetid"),m=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,A=k._carpetTrace=g(t,k),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,L=k.contours,C=p(L,e,T),P="constraint"===L.type,I=L._operation,O=P?"="===I?"lines":"fill":L.coloring,z=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(C);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(C,D,R);var F,B,N,j,U=C;"constraint"===L.type&&(U=h(C,I)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),V.push(a(B,N,F.bicubic));var q="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,h,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(h=0;h=0&&(h=L,d=g):Math.abs(f[1]-h[1])=0&&(h=L,d=g):s.log("endpt to newendpt is not vert. or horz.",f,h,L)}if(d>=0)break;y+=S(f,h),f=h}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(f,h)+"Z",f=null)}for(u=0;um&&(n.max=m);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),f.LABELMAX),a=0;a0?+p[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":g?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":666,"../../components/colorscale":678,"../../constants/numerical":779,"../../lib":803,"../../lib/geojson_utils":797,"fast-isnumeric":249}],1058:[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=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":676,"../../lib":803,"./attributes":1055}],1059:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],1060:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":854,"../scattermapbox/hover":1288}],1061:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":909,"./convert":1057}],1063:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,h),[l]}}},{"../../components/color":666,"../../lib":803,"../bar/hover":948}],1071:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":868,"../bar/select":953,"./attributes":1064,"./calc":1065,"./cross_trace_calc":1067,"./defaults":1068,"./event_data":1069,"./hover":1070,"./layout_attributes":1072,"./layout_defaults":1073,"./plot":1074,"./style":1075}],1072:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1073:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":666,"../../components/drawing":688,"../../constants/interactions":778,"../bar/style":955,"../bar/uniform_text":957,"@plotly/d3":58}],1076:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192}],1077:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":917}],1078:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1194}],1079:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),f=c("values"),h=s(u,f),p=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,g=c("text"),m=c("texttemplate");if(m||(d=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),m||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"../pie/defaults":1195,"./attributes":1076}],1080:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1203,"./attributes":1076,"./base_plot":1077,"./calc":1078,"./defaults":1079,"./layout_attributes":1081,"./layout_defaults":1082,"./plot":1083,"./style":1084}],1081:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1199}],1082:[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"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":803,"./layout_attributes":1081}],1083:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),f=u.recordMinTextSize,h=u.clearMinTextSize,p=t("../pie/helpers"),d=t("../pie/plot"),g=d.attachFxHandlers,m=d.determineInsideTextFont,v=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;h("funnelarea",r),y(e,t),v(e,r._size),a.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var u=n.select(this),h=e[0],d=h.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var f,h,p=[];for(p.push(u()),f=t.length-1;f>-1;f--)if(!(h=t[f]).hidden){var d=h.v/l;c+=d,p.push(u())}var g=1/0,m=-1/0;for(f=0;f-1;f--)if(!(h=t[f]).hidden){var A=p[k+=1][0],M=p[k][1];h.TL=[-A,M],h.TR=[A,M],h.BL=w,h.BR=T,h.pxmid=(S=h.TR,E=h.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=h.TL,T=h.TR}var S,E}(e),u.each((function(){var u=n.select(this).selectAll("g.slice").data(e);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=d.index;var u=h.cx,v=h.cy,y=n.select(this),x=y.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.call(g,t,e);var w="M"+(u+o.TR[0])+","+(v+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";x.attr("d",w),b(t,o,h);var T=p.castOption(d.textposition,o.pts),k=y.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var h=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=a.ensureUniformFontSize(t,m(d,o,r.font));h.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,t);var g,y,x,b=i.bBox(h.node()),_=Math.min(o.BL[1],o.BR[1])+v,w=Math.max(o.TL[1],o.TR[1])+v;y=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(g=c(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(d.type,g,r),e[s].transform=g,h.attr("transform",a.getTextTransform(g))}))}}));var v=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),c=d.title.text;d._meta&&(c=a.templateString(c,d._meta)),e.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,d.title.font).call(l.convertToTspans,t);var u=x(h,r._size);e.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../bar/plot":952,"../bar/uniform_text":957,"../pie/helpers":1197,"../pie/plot":1201,"@plotly/d3":58}],1084:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(i,t,e)}))}))}},{"../bar/uniform_text":957,"../pie/style_one":1203,"@plotly/d3":58}],1085:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:l({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:l({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:l({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:l({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:l({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:l({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:o(),showlegend:l({},i.showlegend,{dflt:!1})},{transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1086:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),h=t("./find_empties"),p=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function g(t){for(var e=[],r=t.length,n=0;nD){O("x scale is not linear");break}}if(x.length&&"fast"===P){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){O("y scale is not linear");break}}}var B=i.maxRowLength(T),N="scaled"===e.xtype?"":r,j=p(e,N,m,v,B,M),U="scaled"===e.ytype?"":x,V=p(e,U,b,_,T.length,S);C||(e._extremes[M._id]=a.findExtremes(M,j),e._extremes[S._id]=a.findExtremes(S,V));var q={x:j,y:V,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(q.orig_x=y),e.yperiodalignment&&w&&(q.orig_y=w),N&&N.length===j.length-1&&(q.xCenter=N),U&&U.length===V.length-1&&(q.yCenter=U),L&&(q.xRanges=A.xRanges,q.yRanges=A.yRanges,q.pts=A.pts),E||l(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var H={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};q.xfill=p(H,N,m,v,B,M),q.yfill=p(H,U,b,_,T.length,S)}return[q]}},{"../../components/colorscale/calc":674,"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/axes":854,"../../registry":931,"../histogram2d/calc":1118,"./clean_2d_array":1087,"./convert_column_xyz":1089,"./find_empties":1091,"./interp2d":1094,"./make_bound_array":1095}],1087:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||g)[2]+(f[[r+1,i]]||g)[2]+(f[[r,i-1]]||g)[2]+(f[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":803}],1092:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,f,h,p=l.isContour,d=t.cd[0],g=d.trace,m=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=g.zhoverformat,A=y,M=x;if(!1!==t.index){try{f=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(f<0||f>=b[0].length||h<0||h>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var S;for(A=[2*y[0]-y[1]],S=1;Sg&&(v=Math.max(v,Math.abs(t[a][o]-d)/(m-g))))}return v}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":803}],1095:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],u=1;u0;)h=p.c2p(T[y]),y--;for(h0;)v=d.c2p(k[y]),y--;if(v0&&(a=!0);for(var l=0;la){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]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,p=t-h,d=r[0],g=r[1],m=Math.min(f(d+h,d+p,n,a),f(g+h,g+p,n,a)),v=Math.min(f(d+c,d+h,n,a),f(g+c,g+h,n,a));if(m>v&&vo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),z.start=r.l2r(j),F||i.nestedProperty(e,v+".start").set(z.start)}var U=b.end,V=r.r2l(O.end),q=void 0!==V;if((b.endFound||q)&&V!==r.r2l(U)){var H=q?V:i.aggNums(Math.max,null,d);z.end=r.l2r(H),q||i.nestedProperty(e,v+".start").set(z.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=i.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[z,d]}e.exports={calc:function(t,e){var r,a,p,d,g=[],m=[],v=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=h(t,e,v,y),T=w[0],k=w[1],A="string"==typeof T.size,M=[],S=A?M:T,E=[],L=[],C=[],P=0,I=e.histnorm,O=e.histfunc,z=-1!==I.indexOf("density");_.enabled&&z&&(I=I.replace(/ ?density$/,""),z=!1);var D,R="max"===O||"min"===O?null:0,F=l.count,B=c[I],N=!1,j=function(t){return v.r2c(t,0,b)};for(i.isArrayOrTypedArray(e[x])&&"count"!==O&&(D=e[x],N="avg"===O,F=l[O]),r=j(T.start),p=j(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(m,_.direction,_.currentbin);var J=Math.min(g.length,m.length),K=[],Q=0,$=J-1;for(r=0;r=Q;r--)if(m[r]){$=r;break}for(r=Q;r<=$;r++)if(n(g[r])&&n(m[r])){var tt={p:g[r],s:m[r],b:0};_.enabled||(tt.pts=C[r],G?tt.ph0=tt.ph1=C[r].length?k[C[r][0]]:g[r]:(e._computePh=!0,tt.ph0=q(M[r]),tt.ph1=q(M[r+1],!0))),K.push(tt)}return 1===K.length&&(K[0].width1=o.tickIncrement(K[0].p,T.size,!1,b)-K[0].p),s(K,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(K,e,X),K},calcAllAutoBins:h}},{"../../lib":803,"../../plots/cartesian/axes":854,"../../registry":931,"../bar/arrays_to_calcdata":940,"./average":1105,"./bin_functions":1107,"./bin_label_vals":1108,"./norm_functions":1116,"fast-isnumeric":249}],1110:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],1111:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=t("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,f,h,p,d,g,m,v=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],L=[],C=[],P="string"==typeof w.size,I="string"==typeof A.size,O=[],z=[],D=P?O:w,R=I?z:A,F=0,B=[],N=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),q="max"===U||"min"===U?null:0,H=a.count,G=o[j],Y=!1,W=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(Y="avg"===U,H=a[U]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-i.tickIncrement(K,J,!1,v))/1e6;for(r=K;r=0&&p=0&&d-1,flipY:E.tiling.flip.indexOf("y")>-1,orientation:E.tiling.orientation,pad:{inner:E.tiling.pad},maxDepth:E._maxDepth}).descendants(),O=1/0,z=-1/0;I.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),z=Math.max(z,e))})),p=p.data(I,u.getPtId),E._maxVisibleLayers=isFinite(z)?z-O+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[g,m],x),p.order();var D=null;if(w&&M){var R=u.getPtId(M);p.each((function(t){null===D&&u.getPtId(t)===R&&(D={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var F=function(){return D||{x0:0,x1:g,y0:0,y1:m}},B=p;return w&&(B=B.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-E.tiling.pad),s._hoverY=y(P?s.y1-E.tiling.pad/2:s.y0+E.tiling.pad/2);var p=n.select(this),d=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events","all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,F(),[g,m],{orientation:E.tiling.orientation,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1});return function(t){return x(e(t))}})):d.attr("d",x),p.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h(s,r,E,e,S)||"";var T=i.ensureSingle(p,"g","slicetext"),M=i.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),I=i.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));M.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L?"start":"middle").call(a.font,I).call(o.convertToTspans,t),s.textBB=a.bBox(M.node()),s.transform=b(s,{fontSize:I.size}),s.transform.fontSize=I.size,w?M.transition().attrTween("transform",(function(t){var e=A(t,!1,F(),[g,m]);return function(t){return _(e(t))}})):M.attr("transform",_(s))})),D}},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"../sunburst/plot":1340,"../treemap/constants":1359,"./partition":1134,"./style":1136,"@plotly/d3":58}],1131:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1236,"./attributes":1126,"./base_plot":1127,"./calc":1128,"./defaults":1129,"./layout_attributes":1132,"./layout_defaults":1133,"./plot":1135,"./style":1136}],1132:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1133:[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("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":803,"./layout_attributes":1132}],1134:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(f,e,{swapXY:s,flipX:a,flipY:o}),f}},{"../treemap/flip_tree":1364,"d3-hierarchy":170}],1135:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1361,"./draw_descendants":1130}],1136:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"@plotly/d3":58}],1137:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[h][f]:s._hasSource&&(u=s._canvas.el.getContext("2d").getImageData(f,h,1,1).data),u){var p,d=o.hi||s.hoverinfo;if(d){var g=d.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(p=!0)}var m,v=a.colormodel[s.colormodel],y=v.colormodel||s.colormodel,x=y.length,b=s._scaler(u),_=v.suffix,w=[];(s.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=y.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[h])?m=s.hovertext[h][f]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(m=s.text[h][f]);var T=c.c2p(o.y0+(h+.5)*s.dy),k=o.x0+(f+.5)*s.dx,A=o.y0+(h+.5)*s.dy,M="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[h,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:A,yLabelVal:A,zLabelVal:M,text:m,hovertemplateLabels:{zLabel:M,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":706,"../../lib":803,"./constants":1139}],1144:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":868,"./attributes":1137,"./calc":1138,"./defaults":1140,"./event_data":1141,"./hover":1143,"./plot":1145,"./style":1146}],1145:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,h=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&h)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var d,g,m,v,y,x,b=l.z,_=l.x0,w=l.y0,T=l.w,k=l.h,A=c.dx,M=c.dy;for(x=0;void 0===d&&x0;)g=u.c2p(_+x*A),x--;for(x=0;void 0===v&&x0;)y=f.c2p(w+x*M),x--;if(gI[0];if(O||z){var D=d+S/2,R=v+E/2;C+="transform:"+a(D+"px",R+"px")+"scale("+(O?-1:1)+","+(z?-1:1)+")"+a(-D+"px",-R+"px")+";"}}L.attr("style",C);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=k;var r=e.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}})).then((function(){var t;if(c._hasZ)t=B((function(t,e){return b[e][t]})).toDataURL("image/png");else if(c._hasSource)if(p)t=c.source;else{var e=c._canvas.el.getContext("2d").getImageData(0,0,T,k).data;t=B((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}L.attr({"xlink:href":t,height:E,width:S,x:d,y:v})}));t._promises.push(F)}function B(t){var e=document.createElement("canvas");e.width=S,e.height=E;var r,n=e.getContext("2d"),a=function(t){return i.constrain(Math.round(u.c2p(_+t*A)-d),0,S)},o=function(t){return i.constrain(Math.round(f.c2p(w+t*M)-v),0,E)},h=s.colormodel[c.colormodel],p=h.colormodel||c.colormodel,g=h.fmt;for(x=0;x0}function T(t){t.each((function(t){y.stroke(n.select(this),t.line.color)})).each((function(t){y.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,v,t,e)}return g(i,a,l,s,n),m(i,a,l,s),a}function A(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(p.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,g){var m,v=t._fullLayout;w(r)&&g&&(m=g()),o.makeTraceGroups(v._indicatorlayer,e,"trace").each((function(e){var g,E,L,C,P,I=e[0].trace,O=n.select(this),z=I._hasGauge,D=I._isAngular,R=I._isBullet,F=I.domain,B={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,q=I.align||"center";if(E=j,z){if(D&&(g=N,E=j+U/2,L=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*V)}),R){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;g=B.l+(G+(1-G)*b[q])*B.w,L=function(t){return A(t,(h.bulletNumberDomainSize-H)*B.w,B.h)}}}else g=B.l+b[q]*B.w,L=function(t){return A(t,B.w,B.h)};!function(t,e,r,i){var c,u,h,g=r[0].trace,m=i.numbersX,v=i.numbersY,T=g.align||"center",A=x[T],E=i.transitionOpts,L=i.onComplete,C=o.ensureSingle(e,"g","numbers"),P=[];g._hasNumber&&P.push("number");g._hasDelta&&(P.push("delta"),"left"===g.delta.position&&P.reverse());var I=C.selectAll("text").data(P);function O(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}I.enter().append("text"),I.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,D=g.mode+g.align;g._hasDelta&&(z=function(){var e=k(t,{tickformat:g.delta.valueformat},g._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=function(t){return g.delta.relative?t.relativeDelta:t.delta},s=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?g.delta.increasing.symbol:g.delta.decreasing.symbol)+e(t)},l=function(t){return t.delta>=0?g.delta.increasing.color:g.delta.decreasing.color};void 0===g._deltaLastValue&&(g._deltaLastValue=o(r[0]));var c=C.select("text.delta");function h(){c.text(s(o(r[0]),i)).call(y.fill,l(r[0])).call(p.convertToTspans,t)}return c.call(f.font,g.delta.font).call(y.fill,l({delta:g._deltaLastValue})),w(E)?c.transition().duration(E.duration).ease(E.easing).tween("text",(function(){var t=n.select(this),e=o(r[0]),c=g._deltaLastValue,u=O(g.delta.valueformat,i,c,e),f=a(c,e);return g._deltaLastValue=e,function(e){t.text(s(f(e),u)),t.call(y.fill,l({delta:f(e)}))}})).each("end",(function(){h(),L&&L()})).each("interrupt",(function(){h(),L&&L()})):h(),u=M(s(o(r[0]),i),g.delta.font,A,t),c}(),D+=g.delta.position+g.delta.font.size+g.delta.font.family+g.delta.valueformat,D+=g.delta.increasing.symbol+g.delta.decreasing.symbol,h=u);g._hasNumber&&(!function(){var e=k(t,{tickformat:g.number.valueformat},g._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=g.number.suffix,s=g.number.prefix,l=C.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,g.number.font).call(p.convertToTspans,t)}w(E)?l.transition().duration(E.duration).ease(E.easing).each("end",(function(){u(),L&&L()})).each("interrupt",(function(){u(),L&&L()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);g._lastValue=r[0].y;var l=O(g.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=M(s+i(r[0].y)+o,g.number.font,A,t)}(),D+=g.number.font.size+g.number.font.family+g.number.valueformat+g.number.suffix+g.number.prefix,h=c);if(g._hasDelta&&g._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*g.delta.font.size;"left"===g.delta.position&&(R=S(g,"deltaPos",0,-1*(c.width*b[g.align]+u.width*(1-b[g.align])+j),D,Math.min),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===g.delta.position&&(R=S(g,"deltaPos",0,c.width*(1-b[g.align])+u.width*b[g.align]+j,D,Math.max),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===g.delta.position&&(R=null,F=u.height,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===g.delta.position&&(R=null,F=c.top,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),z.attr({dx:R,dy:F})}(g._hasNumber||g._hasDelta)&&C.attr("transform",(function(){var t=i.numbersScaler(h);D+=t[2];var e,r=S(g,"numbersScale",1,t[0],D,Math.min);g._scaleNumbers||(r=1),e=g._isAngular?v-r*h.bottom:v-r*(h.top+h.bottom)/2,g._numbersTop=r*h.top+e;var n=h[T];"center"===T&&(n=(h.left+h.right)/2);var a=m-r*n;return a=S(g,"numbersTranslate",0,a,D,Math.max),l(a,e)+s(r)}))}(t,O,e,{numbersX:g,numbersY:E,numbersScaler:L,transitionOpts:r,onComplete:m}),z&&(C={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},P={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var Y=O.selectAll("g.angular").data(D?e:[]);Y.exit().remove();var W=O.selectAll("g.angularaxis").data(D?e:[]);W.exit().remove(),D&&function(t,e,r,a){var o,s,f,h,p=r[0].trace,g=a.size,m=a.radius,v=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[g.l+g.w/2,g.t+g.h/2+m/2],_=a.gauge,A=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function L(t){var e=p.gauge.axis.range[0],r=(t-e)/(p.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function C(t){return n.svg.arc().innerRadius((v+m)/2-t/2*(m-v)).outerRadius((v+m)/2+t/2*(m-v)).startAngle(-E)}function P(t){t.attr("d",(function(t){return C(t.thickness).startAngle(L(t.range[0])).endAngle(L(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),A.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),A.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},O={},z=d.makeLabelFns(o,0).labelStandoff;O.xFn=function(t){var e=I(t);return Math.cos(e)*z},O.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},O.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},O.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return l(b[0]+m*Math.cos(t),b[1]-m*Math.sin(t))};f=function(t){return D(I(t))};if(s=d.calcTicks(o),h=d.getTickSigns(o)[2],o.visible){h="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:A,path:"M"+h*R+",0h"+h*o.ticklen,transFn:function(t){var e=I(t);return D(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:A,transFn:f,labelFns:O})}var F=[y].concat(p.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(P).call(T),B.exit().remove();var N=C(p.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([p.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U=j.select("path");w(M)?(U.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=N,q=L(r[0].lastY),H=L(r[0].y),function(){var t=i(q,H);return function(e){return V.endAngle(t(e))()}})),p._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?N.endAngle(L(r[0].y)):"M0,0Z");var V,q,H;U.call(T),j.exit().remove(),F=[];var G=p.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var Y=_.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove();var W=_.selectAll("g.gauge-outline").data([x]);W.enter().append("g").classed("gauge-outline",!0).append("path"),W.select("path").call(P).call(T),W.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:W,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:m});var X=O.selectAll("g.bullet").data(R?e:[]);X.exit().remove();var Z=O.selectAll("g.bulletaxis").data(R?e:[]);Z.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,f=n.gauge,p=n.layer,g=n.gaugeBg,m=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var A=v.h,M=u.gauge.bar.thickness*A,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=v.t+v.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:p,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:p,transFn:o,labelFns:d.makeLabelFns(i,c)}));function L(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*A})).attr("height",(function(t){return t.thickness*A}))}var C=[g].concat(u.gauge.steps),P=f.selectAll("g.bg-bullet").data(C);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(L).call(T),P.exit().remove();var I=f.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",M).attr("y",(A-M)/2).call(T),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);I.exit().remove();var O=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),z=f.selectAll("g.threshold-bullet").data(O);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*A).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*A).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),z.exit().remove();var D=f.selectAll("g.gauge-outline").data([m]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(L).call(T),D.exit().remove()}(t,0,e,{gauge:X,layer:Z,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:m});var J=O.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[I.title.align]})).text(I.title.text).call(f.font,I.title.font).call(p.convertToTspans,t),J.attr("transform",(function(){var t,e=B.l+B.w*b[I.title.align],r=h.titlePadding,n=f.bBox(J.node());if(z){if(D)if(I.gauge.axis.visible)t=f.bBox(W.node()).top-r-n.bottom;else t=B.t+B.h/2-U/2-n.bottom-r;R&&(t=E-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)}else t=I._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":666,"../../components/drawing":688,"../../constants/alignment":771,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"../../plots/cartesian/axis_defaults":856,"../../plots/cartesian/layout_attributes":869,"../../plots/cartesian/position_defaults":872,"./constants":1150,"@plotly/d3":58,"d3-interpolate":171}],1154:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../mesh3d/attributes":1159}],1155:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:L(d,g,v);h[p]=x>-1?x:I(d,g,v,R(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++m}}function B(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(h,u,n,i),d=B(h,f,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(f,u,n,i),d=B(h,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(t,e,r,n){var i=!1,a=U(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return g&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]];if(g)i=F(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=B(h,c,r,n),d=B(h,u,r,n),m=B(h,f,r,n);i=F(null,[p,d,m],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(f,c,r,n),d=B(f,u,r,n),m=B(h,u,r,n),v=B(h,c,r,n);g?(i=F(t,[c,v,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,m],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,m,v],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(u,c,r,n),d=B(f,c,r,n),m=B(h,c,r,n);g?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,m],[e[l[0]],-1,-1])||i,i=F(t,[c,m,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,m],[-1,-1,-1])||i,s=!0}})),i)}function H(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return d&&(D(t,"A")&&(f=q(null,[e,r,n,a],c,u)||f),D(t,"B")&&(f=q(null,[r,n,i,l],c,u)||f),D(t,"C")&&(f=q(null,[r,a,o,l],c,u)||f),D(t,"D")&&(f=q(null,[n,a,s,l],c,u)||f),D(t,"E")&&(f=q(null,[r,n,a,l],c,u)||f)),g&&(f=q(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Y(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,f=!1,h=function(){f=V(t,[s,l,c],[-1,-1,-1],i,a)||f,f=V(t,[c,u,s],[-1,-1,-1],i,a)||f},p=o[0],d=o[1],g=o[2];return p&&(s=O(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=O(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=O(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=O(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),h()),d&&(s=O(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=O(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=O(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=O(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),h()),g&&(s=O(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],g),l=O(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],g),c=O(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],g),u=O(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],g),h()),f}function X(t,e,r,n,i,a,o,s,l,c,u,f){var h=t;return f?(d&&"even"===t&&(h=null),H(h,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(h=null),H(h,l,s,o,a,i,n,r,e,c,u))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-M)?[A,d]:[d,M];$(e,T[0],T[1])}}var L=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?f.push([p.distRatio,0,0]):"y"===e?f.push([0,p.distRatio,0]):f.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?Z(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(z(d.fill),r[i]="x"===e?Z(null,[0,b-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===m&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":678,"../../lib/gl_format_color":799,"../../lib/str2rgbarray":828,"../../plots/gl3d/zip3":907,"gl-mesh3d":315}],1157:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),h=a("value");c&&c.length&&u&&u.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":676,"../../lib":803,"../../registry":931,"./attributes":1154}],1158:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":896,"./attributes":1154,"./calc":1155,"./convert":1156,"./defaults":1157}],1159:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926,"../surface/attributes":1342}],1160:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":674}],1161:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!m(t.i,f)||!m(t.j,f)||!m(t.k,f))return;n=u(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ov):m=A>w,v=A;var M=c(w,T,k,A);M.pos=_,M.yc=(w+A)/2,M.i=b,M.dir=m?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],y&&(M.orig_p=r[b]),d&&(M.tx=e.text[b]),g&&(M.htx=e.hovertext[b]),x.push(M)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(h,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},h)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",f.push(y),m[b]=y)}return f}function h(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,h=u(t,e,r,i);if(!h)return[];var p=a[h.index],d=h.index=p.i,g=p.dir;function m(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[m("open"),m("high"),m("low"),m("close")+" "+c[g]]:[];return _&&s(p,l,w),h.extraText=w.join("
"),h.y0=h.y1=o.c2p(p.yc,!0),[h]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):h(t,e,r,n)},hoverSplit:f,hoverOnPoints:h}},{"../../components/color":666,"../../components/fx":706,"../../constants/delta.js":773,"../../lib":803,"../../plots/cartesian/axes":854}],1168:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":868,"./attributes":1164,"./calc":1165,"./defaults":1166,"./hover":1167,"./plot":1170,"./select":1171,"./style":1172}],1169:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},{"../../lib":803,"../../registry":931}],1170:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":803,"@plotly/d3":58}],1171:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,h);o(e,f,h),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var g={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",g);var m={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(h,"tickfont",m)}},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/domain":882,"../parcoords/merge_length":1189,"./attributes":1173}],1177:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1173,"./base_plot":1174,"./calc":1175,"./defaults":1176,"./plot":1179}],1178:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),f=t("../../lib/svg_text_utils");function h(t,e,r,i){var a=t.map(F.bind(0,e,r)),o=i.selectAll("g.parcatslayer").data([null]);o.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=o.selectAll("g.trace.parcats").data(a,p),h=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return l(t.x,t.y)})),h.append("g").attr("class","paths");var y=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),p);y.attr("fill",(function(t){return t.model.color}));var x=y.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(x),y.attr("d",(function(t){return t.svgD})),x.empty()||y.sort(g),y.exit().remove(),y.on("mouseover",m).on("mouseout",v).on("click",b),h.append("g").attr("class","dimensions");var w=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),p);w.enter().append("g").attr("class","dimension"),w.attr("transform",(function(t){return l(t.x,0)})),w.exit().remove();var A=w.selectAll("g.category").data((function(t){return t.categories}),p),M=A.enter().append("g").attr("class","category");A.attr("transform",(function(t){return l(0,t.y)})),M.append("rect").attr("class","catrect").attr("pointer-events","none"),A.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(M);var S=A.selectAll("rect.bandrect").data((function(t){return t.bands}),p);S.each((function(){s.raiseToTop(this)})),S.attr("fill",(function(t){return t.color}));var E=S.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);S.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(E),S.exit().remove(),M.append("text").attr("class","catlabel").attr("pointer-events","none");var z=e._fullLayout.paper_bgcolor;A.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(z)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),e)})),M.append("text").attr("class","dimlabel"),A.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),A.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",C),A.exit().remove(),w.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",P).on("drag",I).on("dragend",O)),u.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function p(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function g(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),L=n.mouse(f)[0];o.loneHover({trace:h,x:b-d.left+g.left,y:_-d.top+g.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:L1&&h.displayInd===f.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var g=u.model.count,m=u.model.categoryLabel,v=g/u.parcatsViewModel.model.count,y={countLabel:g,categoryLabel:m,probabilityLabel:v.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:g,category:m,probability:v}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=A(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=A(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),M(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=E(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,h=f.parcatsViewModel,p=h.model.dimensions[f.model.dimensionInd],d=h.trace,g=l.y+l.height/2;h.dimensions.length>1&&p.displayInd===h.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var m=f.model.categoryLabel,v=c.parcatsViewModel.model.count,y=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(y+=t.count)}));var x=f.model.count,b=0;h.pathSelection.each((function(t){t.model.color===c.color&&(b+=t.model.count)}));var _=y/v,w=y/b,T=y/x,k={countLabel:v,categoryLabel:m,probabilityLabel:_.toFixed(3)},A=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color \u2229 "+m+"): "+k.probabilityLabel),A.push("P("+m+" | color): "+w.toFixed(3)),A.push("P(color | "+m+"): "+T.toFixed(3)));var M=A.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(g-e.top),text:M,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:m,count:v,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(E(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function C(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(g),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event)}}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var h=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==h&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),D(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=z(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),f=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),D(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function z(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var h=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),g=0;g0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],f=t.model.maxCats,h=e.categories.length,p=e.count,d=t.height-8*(f-1),g=8*(f-h)/2,m=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(m.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:g,bands:[],parcatsViewModel:t},g=g+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}},{"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/svg_text_utils":829,"../../plot_api/plot_api":840,"@plotly/d3":58,"d3-interpolate":171,tinycolor2:598}],1179:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":1178}],1180:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/layout_attributes":869,"../../plots/domain":882,"../../plots/font_attributes":883}],1181:[function(t,e,r){"use strict";var n=t("./constants"),i=t("@plotly/d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,c=n.bar.snapRatio;function u(t,e){return t*(1-c)+e*c}var f=n.bar.snapClose;function h(t,e){return t*(1-f)+e*f}function p(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){h=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);g&&(o.interval=l[a],o.intervalPix=d,o.region=g)}}if(t.ordinal&&!o.region){var m=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),b(t.parentNode)}function T(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),b(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?b(t.parentNode,s):(s(),b(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function A(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e){var r=t.selectAll("."+n.cn.axisBrush).data(o,a);r.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e){var r=t.selectAll(".background").data(o);r.enter().append("rect").classed("background",!0).call(d).call(g).style("pointer-events","auto").attr("transform",l(0,n.verticalPadding)),r.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var i=t.selectAll(".highlight-shadow").data(o);i.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),i.attr("y1",(function(t){return t.height})).call(x);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(x)}(r,e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(A)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[p(0,r,t[0],[]),p(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":803,"../../lib/gup":800,"./constants":1184,"@plotly/d3":58}],1182:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];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").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":780,"../../plots/get_data":891,"./plot":1191,"@plotly/d3":58}],1183:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),m=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",m);var v={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",v),n.coerceFont(u,"tickfont",v),n.coerceFont(u,"rangefont",v),u("labelangle"),u("labelside")}},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803,"../../plots/array_container_defaults":849,"../../plots/cartesian/axes":854,"../../plots/domain":882,"./attributes":1180,"./axisbrush":1181,"./constants":1184,"./merge_length":1189}],1186:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":803}],1187:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":1180,"./base_plot":1182,"./calc":1183,"./defaults":1185,"./plot":1191}],1188:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(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 h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(T,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var L,C=o.tickvals;function P(t,e){return{val:t,text:L[e]}}function I(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){L=o.ticktext,Array.isArray(L)&&L.length?L.length>C.length?L=L.slice(0,C.length):C.length>L.length&&(C=C.slice(0,L.length)):L=C.map(a(o.tickformat));for(var O=1;O=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==B&&(u?a.hover(h):a.unhover&&a.unhover(h),B=f)}})),F.style("opacity",(function(t){return t.pick?0:1})),h.style("background","rgba(255, 255, 255, 0)");var N=h.selectAll("."+y.cn.parcoords).data(R,d);N.exit().remove(),N.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),N.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var j=N.selectAll("."+y.cn.parcoordsControlView).data(g,d);j.enter().append("g").classed(y.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var U=j.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),d);U.enter().append("g").classed(y.cn.yAxis,!0),j.each((function(t){O(U,t,_)})),F.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),U.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),U.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;S.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,U.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})),O(U,e,_),U.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),U.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(U,e,_),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),U.exit().remove();var V=U.selectAll("."+y.cn.axisOverlays).data(g,d);V.enter().append("g").classed(y.cn.axisOverlays,!0),V.selectAll("."+y.cn.axis).remove();var q=V.selectAll("."+y.cn.axis).data(g,d);q.enter().append("g").classed(y.cn.axis,!0),q.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return v.isOrdinal(t)?e:z(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(q.selectAll("text"),t.model.tickFont)})),q.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),q.selectAll("text").style("text-shadow",u.makeTextShadow(T)).style("cursor","default");var H=V.selectAll("."+y.cn.axisHeading).data(g,d);H.enter().append("g").classed(y.cn.axisHeading,!0);var G=H.selectAll("."+y.cn.axisTitle).data(g,d);G.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),G.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=I(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=I(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var Y=V.selectAll("."+y.cn.axisExtent).data(g,d);Y.enter().append("g").classed(y.cn.axisExtent,!0);var W=Y.selectAll("."+y.cn.axisExtentTop).data(g,d);W.enter().append("g").classed(y.cn.axisExtentTop,!0),W.attr("transform",c(0,-y.axisExtentOffset));var X=W.selectAll("."+y.cn.axisExtentTopText).data(g,d);X.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(P),X.text((function(t){return D(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var Z=Y.selectAll("."+y.cn.axisExtentBottom).data(g,d);Z.enter().append("g").classed(y.cn.axisExtentBottom,!0),Z.attr("transform",(function(t){return c(0,t.model.height+y.axisExtentOffset)}));var J=Z.selectAll("."+y.cn.axisExtentBottomText).data(g,d);J.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(P),J.text((function(t){return D(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),x.ensureAxisBrush(V,T)}},{"../../components/colorscale":678,"../../components/drawing":688,"../../lib":803,"../../lib/gup":800,"../../lib/svg_text_utils":829,"../../plots/cartesian/axes":854,"./axisbrush":1181,"./constants":1184,"./helpers":1186,"./lines":1188,"@plotly/d3":58,"color-rgba":133}],1191:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}e.exports=function(t,e){var r=t._fullLayout;if(i(t)){var s={},l={},c={},u={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;c[r]=n.index;var i=u[r]=n._fullInput.index;s[r]=t.data[i].dimensions,l[r]=t.data[i].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,i){var a=l[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[c[e]]._fullInput.uid];if(void 0===f[s]){var h=a.constraintrange;f[s]=h||null}var p=t._fullData[c[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[u[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(a));s[e].sort(n),l[e].filter((function(t){return!a(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[u[e]]])}})}}},{"../../lib/prepare_regl":816,"./helpers":1186,"./parcoords":1190}],1192:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":665,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1193:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":917}],1194:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(c("labels"),c("values")),f=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),f){e._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var h,p=c("text"),d=c("texttemplate");if(d||(h=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||h&&"none"!==h){var g=c("textposition");s(t,e,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(e,n,c);var m=c("hole");if(c("title.text")){var v=c("title.position",m?"middle center":"top center");m||"middle center"!==v||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":803,"../../plots/domain":882,"../bar/defaults":945,"./attributes":1192,"fast-isnumeric":249}],1196:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":702}],1197:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:f.hovertemplate||-1!==h.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,t.pts)||t.color,borderColor:m.castOption(_.bordercolor,t.pts),fontFamily:m.castOption(w.family,t.pts),fontSize:m.castOption(w.size,t.pts),fontColor:m.castOption(w.color,t.pts),nameLength:m.castOption(_.namelength,t.pts),textAlign:m.castOption(_.align,t.pts),hovertemplate:m.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[v(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[v(t,f)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[v(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[v(t,i)],a.click(e,n.event))}))}function b(t,e,r){var n=m.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=m.castOption(t._input.textfont.color,e.pts));var i=m.castOption(t.insidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,a=m.castOption(t.insidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;m-=2)v(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)v(Math.PI*(m+1),"tan")}if(f||p){for(m=4;m>=-4;m-=2)v(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)v(Math.PI*(m+.5),"rad")}}if(s||d||f){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;g.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(a)),(d||h)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,g.push(a));for(var x=0,b=0,_=0;_=1)break}return g[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*g);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:A(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*g);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:A(a,o/e),rotate:M(i+Math.PI/2)}}function A(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function L(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 C(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function I(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function O(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:m.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:m.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=m.getFirstFilled(i.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,a=r._size;d("pie",r),_(e,t),O(e,a);var h=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var h=n.select(this),d=e[0],g=d.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),h.attr("stroke-linejoin","round"),h.each((function(){var v=n.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var y=[[[],[]],[[],[]]],_=!1;v.each((function(i,a){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=g.index,y[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var o=d.cx,c=d.cy,u=n.select(this),h=u.selectAll("path.surface").data([i]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,t,e),g.pull){var v=+m.castOption(g.pull,i.pts)||0;v>0&&(o+=v*i.pxmid[0],c+=v*i.pxmid[1])}i.cxFinal=o,i.cyFinal=c;var T=g.hole;if(i.v===d.vTotal){var k="M"+(o+i.px0[0])+","+(c+i.px0[1])+C(i.px0,i.pxmid,!0,1)+C(i.pxmid,i.px0,!0,1)+"Z";T?h.attr("d","M"+(o+T*i.px0[0])+","+(c+T*i.px0[1])+C(i.px0,i.pxmid,!1,T)+C(i.pxmid,i.px0,!1,T)+"Z"+k):h.attr("d",k)}else{var A=C(i.px0,i.px1,!0,1);if(T){var M=1-T;h.attr("d","M"+(o+T*i.px1[0])+","+(c+T*i.px1[1])+C(i.px1,i.px0,!1,T)+"l"+M*i.px0[0]+","+M*i.px0[1]+A+"Z")}else h.attr("d","M"+o+","+c+"l"+i.px0[0]+","+i.px0[1]+A+"Z")}D(t,i,d);var S=m.castOption(g.textposition,i.pts),E=u.selectAll("g.slicetext").data(i.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each((function(){var u=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=l.ensureUniformFontSize(t,"outside"===S?function(t,e,r){var n=m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,i=m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,a=m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(g,i,r.font):b(g,i,r.font));u.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,h).call(f.convertToTspans,t);var v,y=s.bBox(u.node());if("outside"===S)v=L(y,i);else if(v=w(y,i,d),"auto"===S&&v.scale<1){var x=l.ensureUniformFontSize(t,g.outsidetextfont);u.call(s.font,x),v=L(y=s.bBox(u.node()),i)}var T=v.textPosAngle,k=void 0===T?i.pxmid:z(d.r,T);if(v.targetX=o+k[0]*v.rCenter+(v.x||0),v.targetY=c+k[1]*v.rCenter+(v.y||0),R(v,y),v.outside){var A=v.targetY;i.yLabelMin=A-y.height/2,i.yLabelMid=A,i.yLabelMax=A+y.height/2,i.labelExtraX=0,i.labelExtraY=0,_=!0}v.fontSize=h.size,p(g.type,v,r),e[a].transform=v,u.attr("transform",l.getTextTransform(v))}))}function C(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*d.r+","+n*d.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=g.title.text;g._meta&&(i=l.templateString(i,g._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,g.title.font).call(f.convertToTspans,t),e="middle center"===g.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(d):C(d,a),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),_&&function(t,e){var r,n,i,a,o,s,l,c,u,f,h,p,d;function g(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,u,h,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,g=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-d;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(m.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*l>0&&(i=3*s*Math.abs(c-f.indexOf(t)),(h=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=h)))}for(n=0;n<2;n++)for(i=n?g:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],f=u.concat(c),p=[],h=0;hMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(v,g),_&&g.automargin){var k=s.bBox(h.node()),A=g.domain,M=a.w*(A.x[1]-A.x[0]),S=a.h*(A.y[1]-A.y[0]),E=(.5*M-d.r)/a.w,P=(.5*S-d.r)/a.h;i.autoMargin(t,"pie."+g.uid+".automargin",{xl:A.x[0]-E,xr:A.x[1]+E,yb:A.y[0]-P,yt:A.y[1]+P,l:Math.max(d.cx-d.r-k.left,0),r:Math.max(k.right-(d.cx+d.r),0),b:Math.max(k.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-k.top,0),pad:5})}}))}));setTimeout((function(){h.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:O,attachFxHandlers:x,computeTransform:R}},{"../../components/color":666,"../../components/drawing":688,"../../components/fx":706,"../../lib":803,"../../lib/svg_text_utils":829,"../../plots/plots":917,"../bar/constants":943,"../bar/uniform_text":957,"./event_data":1196,"./helpers":1197,"@plotly/d3":58}],1202:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(i,t,e)}))}))}},{"../bar/uniform_text":957,"./style_one":1203,"@plotly/d3":58}],1203:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":666,"./helpers":1197}],1204:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1218}],1205:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(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=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.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}},l.update=function(t){this.index=t.index,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=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(f){if(n=f,e=f.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(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=i(t.marker.color),m=i(t.marker.border.color),v=t.opacity*t.marker.opacity;g[3]*=v,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,m[3]*=v,this.pointcloudOptions.borderColor=m;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":828,"../../plots/cartesian/autorange":853,"../scatter/get_trace_color":1228,"gl-pointcloud2d":328}],1206:[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"),e._length=null}},{"../../lib":803,"./attributes":1204}],1207:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":894,"../scatter3d/calc":1247,"./attributes":1204,"./convert":1205,"./defaults":1206}],1208:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,f=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,h=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll;(e.exports=p({hoverinfo:h({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":665,"../../components/colorscale/attributes":673,"../../components/fx/attributes":697,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plot_api/plot_template":843,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/domain":882,"../../plots/font_attributes":883,"../../plots/template_attributes":926}],1209:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../plots/cartesian/select").prepSelect,u=t("../../lib"),f=t("../../registry");function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==i&&"zoom"!==i){s(o,a);var h={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:h,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[h],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;ry&&(y=a.source[e]),a.target[e]>y&&(y=a.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(L,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(L)||w[E]!==w[L])){w.hasOwnProperty(L)&&(L=w[L]),w.hasOwnProperty(E)&&(E=w[E]),L=+L,h[E=+E]=h[L]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var P=null;C&&p.hasOwnProperty(C)&&(P=p[C]),c.push({pointNumber:e,label:C,color:u?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:P,source:E,target:L,value:+S}),M.source.push(E),M.target.push(L)}}var I=b+_.length,O=o(r.color),z=o(r.customdata),D=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:O?r.color[e]:r.color,customdata:z?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(I,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":678,"../../lib":803,"../../lib/gup":800,"strongly-connected-components":590}],1211:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],1212:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,h){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(h.hoverlabel,t.hoverlabel),g=t.node,m=c.newContainer(e,"node");function v(t,e){return n.coerce(g,m,i.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(g,m,v,d),v("hovertemplate");var y=h.colorway;v("color",m.label.map((function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,h,p),p("orientation"),p("valueformat"),p("valuesuffix"),m.x.length&&m.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},h.font)),e._length=null}},{"../../components/color":666,"../../components/fx/hoverlabel_defaults":704,"../../lib":803,"../../plot_api/plot_template":843,"../../plots/array_container_defaults":849,"../../plots/domain":882,"./attributes":1208,tinycolor2:598}],1213:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1208,"./base_plot":1209,"./calc":1210,"./defaults":1212,"./plot":1214,"./select.js":1216}],1214:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function f(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function p(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function g(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function m(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function v(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(g(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(g(e)).call(b.bind(0,e,r,!1))}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+c.sankeyNode).filter(m(t)).call(v)}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(c.sankeyNode).filter(m(t)).call(y)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,h=r._size,g=0;g"),color:_(o,"bgcolor")||l.addOpacity(g.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(y,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"./constants":1211,"./render":1215,"@plotly/d3":58}],1215:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),f=t("../../components/drawing"),h=t("../../lib"),p=h.strTranslate,d=h.strRotate,g=t("../../lib/gup"),m=g.keyFun,v=g.repeat,y=g.unwrap,x=t("../../lib/svg_text_utils"),b=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,T=_.LINE_SPACING;function k(t,e,r){var n,i=y(e),a=i.trace,u=a.domain,f="h"===a.orientation,p=a.node.pad,d=a.node.thickness,g=t.width*(u.x[1]-u.x[0]),m=t.height*(u.y[1]-u.y[0]),v=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[g,m]:[m,g]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(v).links(x);var _,w,T,k=n();for(var A in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=k.nodes));n.update(k)}return{circular:b,key:r,trace:a,guid:h.randstr(),horizontal:f,width:g,height:m,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?m:g,dragPerpendicular:f?g:m,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){if(t.link.circular)return e=t.link,r=e.width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,a=t.link.source.x1,o=t.link.target.x0,s=i(a,o),l=s(.5),c=s(.5),u=t.link.y0-t.link.width/2,f=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2;return"M"+a+","+u+"C"+l+","+u+" "+c+","+h+" "+o+","+h+"L"+o+","+p+"C"+c+","+p+" "+l+","+f+" "+a+","+f+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",(function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function L(t){t.call(E)}function C(t,e){t.call(L),e.attr("d",M())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function I(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function z(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&C[v].gap;)v--;for(x=C[v].s,g=C.length-1;g>v;g--)C[g].s=x;for(;lM[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1225:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),p=t("./line_shape_defaults"),d=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,m){function v(r,i){return n.coerce(t,e,a,r,i)}var y=l(t,e,m,v);if(y||(e.visible=!1),e.visible){c(t,e,m,v),v("xhoverformat"),v("yhoverformat");var x=u(t,e,m,v),b=!x&&y=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-d);return a=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-g);return aW!=(N=z[I][1])>=W&&(R=z[I-1][0],F=z[I][0],N-B&&(D=R+(F-R)*(W-B)/(N-B),q=Math.min(q,D),H=Math.max(H,D)));q=Math.max(q,0),H=Math.min(H,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:H,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":666,"../../components/fx":706,"../../lib":803,"../../registry":931,"./get_trace_color":1228}],1230:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":868,"./arrays_to_calcdata":1217,"./attributes":1218,"./calc":1219,"./cross_trace_calc":1223,"./cross_trace_defaults":1224,"./defaults":1225,"./format_labels":1227,"./hover":1229,"./marker_colorbar":1236,"./plot":1239,"./select":1240,"./style":1242,"./subtypes":1243}],1231:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"../../lib":803}],1232:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),c=l.segmentsIntersect,u=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,p,d,g,m,v,y,x,b,_,w,T,k,A,M,S=e.xaxis,E=e.yaxis,L="log"===S.type,C="log"===E.type,P=S._length,I=E._length,O=e.connectGaps,z=e.baseTolerance,D=e.shape,R="linear"===D,F=e.fill&&"none"!==e.fill,B=[],N=f.minTolerance,j=t.length,U=new Array(j),V=0;function q(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?E.l2p(n.y):E.c2p(n.y);if(a===i){if(L&&(a=S.c2p(n.x,!0)),a===i)return!1;C&&l===i&&(a*=Math.abs(S._m*I*(S._m>0?o:s)/(E._m*P*(E._m>0?o:s)))),a*=1e3}if(l===i){if(C&&(l=E.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function H(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&crt||t[1]it)return[u(t[0],et,rt),u(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c);return s}}function ct(t){var e=t[0],r=t[1],n=e===U[V-1][0],i=r===U[V-1][1];if(!n||!i)if(V>1){var a=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&a?o?V--:U[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ut(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ct([Z,J]),ct(t),K=null,Z=J=0}function ft(t){if(A=t[0]/P,M=t[1]/I,W=t[0]rt?rt:0,X=t[1]it?it:0,W||X){if(V)if(K){var e=$(K,t);e.length>1&&(ut(e[0]),U[V++]=e[1])}else Q=$(U[V-1],t)[0],U[V++]=Q;else U[V++]=[W||t[0],X||t[1]];var r=U[V-1];W&&X&&(r[0]!==W||r[1]!==X)?(K&&(Z!==W&&J!==X?ct(Z&&J?(n=K,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Z||W,J||X]):Z&&J&&ct([Z,J])),ct([W,X])):Z-W&&J-X&&ct([W||Z,X||J]),K=t,Z=W,J=X}else K&&ut($(K,t)[0]),U[V++]=t;var n,i,a,o}for("linear"===D||"spline"===D?$=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,t)G(d,ht))break;a=d,(_=v[0]*m[0]+v[1]*m[1])>x?(x=_,h=d,g=!1):_=t.length||!d)break;ft(d),n=d}}else ft(h)}K&&ct([Z||K[0],J||K[1]]),B.push(U.slice(0,V))}return B}},{"../../constants/numerical":779,"../../lib":803,"./constants":1222}],1233:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1234:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,c={},u=!1,f=-1,h=0,p=-1;for(a=0;a=0?l=p:(l=p=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":249}],1236:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1237:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":666,"../../components/colorscale/defaults":676,"../../components/colorscale/helpers":677,"./subtypes":1243}],1238:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":779,"../../lib":803}],1239:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function p(t,e,r,f,p,d,g){var m;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var p=h.marker.maxdisplayed;if(0===p)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(d.length/p),m=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,g),!0===_.visible){var E,L;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,O="",z=[],D=_._prevtrace;D&&(O=D._prevRevpath||"",L=D._nextFill,z=D._polygons);var R,F,B,N,j,U,V,q="",H="",G=[],Y=a.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(L&&L.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),m=0;m1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",P),l.singleLineStyle(f,i)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(E?(E.datum(f),N&&U&&(C?("y"===C?N[1]=U[1]=b.c2p(0,!0):"x"===C&&(N[0]=U[0]=x.c2p(0,!0)),y(E).attr("d","M"+U+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):y(E).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===_.fill.substr(0,6)&&q&&O?("tonext"===_.fill?y(L).attr("d",q+"Z"+O+"Z").call(l.singleFillStyle):y(L).attr("d",q+"L"+O.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(z)):(Z(L),_._polygons=null)),_._prevRevpath=H,_._prevPolygons=V):(E?Z(E):L&&Z(L),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),p=tt(u),d=et,g=et;if(f||h){var m=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?m=w?K:J:_&&!w&&(m=Q),f&&(d=m),h&&(g=m)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,X,t),l.setClipUrl(S,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,d=!a,g=!!a&&a.duration>0,m=f(t,e,r);((u=i.selectAll("g.trace").data(m,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),g)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(t,n,e,r,m,this,a)}))}))):u.each((function(r,n){p(t,n,e,r,m,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":688,"../../lib":803,"../../lib/polygon":815,"../../registry":931,"./line_points":1232,"./link_traces":1234,"./subtypes":1243,"@plotly/d3":58}],1240:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||p);for(var d=["x","y","z"],g=0;g<3;++g){var m="projection."+d[g];f(m+".show")&&(f(m+".opacity"),f(m+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,h||p||r,{axis:"z"}),v(t,e,h||p||r,{axis:"y",inherit:"z"}),v(t,e,h||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":803,"../../registry":931,"../scatter/line_defaults":1231,"../scatter/marker_defaults":1237,"../scatter/subtypes":1243,"../scatter/text_defaults":1244,"./attributes":1246}],1251:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":777,"../../plots/gl3d":896,"./attributes":1246,"./calc":1247,"./convert":1249,"./defaults":1250}],1252:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1253:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e._length,p=new Array(h),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,m.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":803,"../scatter/hover":1229}],1258:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":868,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1252,"./calc":1253,"./defaults":1254,"./event_data":1255,"./format_labels":1256,"./hover":1257,"./plot":1259}],1259:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,f={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,f,r,o),s=0;s")}(c,g,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../scatter/get_trace_color":1228,"./attributes":1260}],1266:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":887,"../scatter/marker_colorbar":1236,"../scatter/style":1242,"./attributes":1260,"./calc":1261,"./defaults":1262,"./event_data":1263,"./format_labels":1264,"./hover":1265,"./plot":1267,"./select":1268,"./style":1269}],1267:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,f=t("../scatter/subtypes"),h=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],f=o._subplot,h=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):a(i,f.topojson);for(r=0;r=m,w=2*b,T={},k=l.makeCalcdata(e,"x"),A=y.makeCalcdata(e,"y"),M=s(e,l,"x",k),S=s(e,y,"y",A),E=M.vals,L=S.vals;e._x=E,e._y=L,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=A,e._yStarts=S.starts,e._yEnds=S.ends);var C=new Array(w),P=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(t,r,n));if(s.errorX||s.errorY){var l=p.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,C,E,L),z=d(t,x);return f(o,e),_?O.marker&&(I=O.marker.sizeAvg||Math.max(O.marker.size,3)):I=c(e,b),u(t,e,l,y,E,L,I),O.errorX&&v(e,l,O.errorX),O.errorY&&v(e,y,O.errorY),O.fill&&!z.fill2d&&(z.fill2d=!0),O.marker&&!z.scatter2d&&(z.scatter2d=!0),O.line&&!z.line2d&&(z.line2d=!0),!O.errorX&&!O.errorY||z.error2d||(z.error2d=!0),O.text&&!z.glText&&(z.glText=!0),O.marker&&(O.marker.snap=b),z.lineOptions.push(O.line),z.errorXOptions.push(O.errorX),z.errorYOptions.push(O.errorY),z.fillOptions.push(O.fill),z.markerOptions.push(O.marker),z.markerSelectedOptions.push(O.markerSel),z.markerUnselectedOptions.push(O.markerUnsel),z.textOptions.push(O.text),z.textSelectedOptions.push(O.textSel),z.textUnselectedOptions.push(O.textUnsel),z.selectBatch.push([]),z.unselectBatch.push([]),T._scene=z,T.index=z.count,T.x=E,T.y=L,T.positions=C,z.count++,[{x:!1,y:!1,t:T,trace:e}]}},{"../../constants/numerical":779,"../../lib":803,"../../plots/cartesian/align_period":851,"../../plots/cartesian/autorange":853,"../../plots/cartesian/axis_ids":858,"../scatter/calc":1219,"../scatter/colorscale_calc":1221,"./constants":1272,"./convert":1273,"./scene_update":1281,"@plotly/point-cluster":59}],1272:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1273:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),p=t("./helpers"),d=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,h=o.family,p={},d=t._context.plotGlPixelRatio,g=e.texttemplate;if(g){p.text=[];var m=i._d3locale,y=Array.isArray(g),x=y?Math.min(g.length,a):a,b=y?function(t){return g[t]}:function(){return g};for(r=0;rd.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,g=m[p],v=m[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[i]=[g*y/h,x/h]}}return o}}},{"../../components/drawing":688,"../../components/fx/helpers":702,"../../constants/interactions":778,"../../lib":803,"../../lib/gl_format_color":799,"../../plots/cartesian/axis_ids":858,"../../registry":931,"../scatter/make_bubble_size_func":1235,"../scatter/subtypes":1243,"./constants":1272,"./helpers":1277,"color-normalize":131,"fast-isnumeric":249,"svg-path-sdf":595}],1274:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),p=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,g){function m(r,i){return n.coerce(t,e,o,r,i)}var v=!!t.marker&&a.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),x=c(t,e,g,m);if(x){u(t,e,g,m),m("xhoverformat"),m("yhoverformat");var b=x100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":1272}],1278:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var p=o.textfont;p&&(h.ts=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.tc=Array.isArray(p.color)?p.color[f]:p.color,h.tf=Array.isArray(p.family)?p.family[f]:p.family);var d=o.marker;d&&(h.ms=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.mo=i.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,h.mx=i.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,h.mc=i.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var g=d&&d.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=i.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var m=d&&d.gradient;m&&"none"!==m.type&&(h.mgt=Array.isArray(m.type)?m.type[f]:m.type,h.mgc=Array.isArray(m.color)?m.color[f]:m.color);var v=s.c2p(h.x,!0),y=l.c2p(h.y,!0),x=h.mrc||1,b=o.hoverlabel;b&&(h.hbg=Array.isArray(b.bgcolor)?b.bgcolor[f]:b.bgcolor,h.hbc=Array.isArray(b.bordercolor)?b.bordercolor[f]:b.bordercolor,h.hts=i.isArrayOrTypedArray(b.font.size)?b.font.size[f]:b.font.size,h.htc=Array.isArray(b.font.color)?b.font.color[f]:b.font.color,h.htf=Array.isArray(b.font.family)?b.font.family[f]:b.font.family,h.hnl=i.isArrayOrTypedArray(b.namelength)?b.namelength[f]:b.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var T={};T[t.index]=h;var k=o._origX,A=o._origY,M=i.extendFlat({},t,{color:a(o,h),x0:v-x,x1:v+x,xLabelVal:k?k[f]:h.x,y0:y-x,y1:y+x,yLabelVal:A?A[f]:h.y,cd:T,distance:c,spikeDistance:u,hovertemplate:h.ht});return h.htx?M.text=h.htx:h.tx?M.text=h.tx:o.text&&(M.text=o.text),i.fillText(h,o,M),n.getComponentMethod("errorbars","hoverInfo")(h,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,h,p,d,g=t.cd,m=g[0].t,v=g[0].trace,y=t.xa,x=t.ya,b=m.x,_=m.y,w=y.c2p(e),T=x.c2p(r),k=t.distance;if(m.tree){var A=y.p2c(w-k),M=y.p2c(w+k),S=x.p2c(T-k),E=x.p2c(T+k);i="x"===n?m.tree.range(Math.min(A,M),Math.min(x._rl[0],x._rl[1]),Math.max(A,M),Math.max(x._rl[0],x._rl[1])):m.tree.range(Math.min(A,M),Math.min(S,E),Math.max(A,M),Math.max(S,E))}else i=m.ids;var L=k;if("x"===n){var C=!!v.xperiodalignment,P=!!v.yperiodalignment;for(u=0;u=Math.min(I,O)&&w<=Math.max(I,O)?0:1/0}if(f=Math.min(z,D)&&T<=Math.max(z,D)?0:1/0}d=Math.sqrt(f*f+h*h),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[a=i[u]],c=_[a],f=y.c2p(l)-w,h=x.c2p(c)-T,(p=Math.sqrt(f*f+h*h))v.glText.length){var w=b-v.glText.length;for(d=0;dr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var k=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(k)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var f,h,p=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[h+1]);)h-=2;0!==d[f+1]&&(p=[d[f],0]),p=p.concat(d.slice(f,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[h]);)h-=2;0!==d[f]&&(p=[0,d[f+1]]),p=p.concat(d.slice(f,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,t.splitNull=!0,a=0;a-1;for(d=0;d")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,u=t.xa,f=t.ya,h=t.subplot,p=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-p;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-u.c2p([d,a]),c=o.y-f.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-p,1-3/p)}),t),!1!==t.index){var g=o[t.index],m=g.lonlat,v=[i.modHalf(m[0],360)+p,m[1]],y=u.c2p(v),x=f.c2p(v),b=g.mrc||1;t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b;var _={};_[c.subplot]={_subplot:h};var w=c._module.formatLabels(g,c,_);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(c,g),t.extraText=l(c,g,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:l}},{"../../components/fx":706,"../../constants/numerical":779,"../../lib":803,"../scatter/get_trace_color":1228}],1289:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":911,"../scatter/marker_colorbar":1236,"../scattergeo/calc":1261,"./attributes":1283,"./defaults":1285,"./event_data":1286,"./format_labels":1287,"./hover":1288,"./plot":1290,"./select":1291}],1290:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],c=0;c")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":1229}],1297:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":920,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1292,"./calc":1293,"./defaults":1294,"./format_labels":1295,"./hover":1296,"./plot":1298}],1298:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,c=0;c=c&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(t,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!h.fill2d&&(h.fill2d=!0),y.marker&&!h.scatter2d&&(h.scatter2d=!0),y.line&&!h.line2d&&(h.line2d=!0),y.text&&!h.glText&&(h.glText=!0),h.lineOptions.push(y.line),h.fillOptions.push(y.fill),h.markerOptions.push(y.marker),h.markerSelectedOptions.push(y.markerSel),h.markerUnselectedOptions.push(y.markerUnsel),h.textOptions.push(y.text),h.textSelectedOptions.push(y.textSel),h.textUnselectedOptions.push(y.textUnsel),h.selectBatch.push([]),h.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=m,d.theta=v,d.positions=_,d._scene=h,d.index=h.count,h.count++}})),a(t,e,r)}}},{"../../lib":803,"../scattergl/constants":1272,"../scattergl/convert":1273,"../scattergl/plot":1280,"../scattergl/scene_update":1281,"@plotly/point-cluster":59,"fast-isnumeric":249}],1306:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=a.marker,f=a.line,h=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:f.color,width:f.width,dash:l,shape:c({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:h.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":673,"../../components/drawing/attributes":687,"../../lib/extend":793,"../../plots/attributes":850,"../../plots/template_attributes":926,"../scatter/attributes":1218}],1307:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,p,d,g=t._fullLayout[e.subplot].sum,m=e.sum||g,v={a:e.a,b:e.b,c:e.c};for(r=0;r"),o.hovertemplate=h.hovertemplate,a}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":1229}],1312:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":927,"../scatter/marker_colorbar":1236,"../scatter/select":1240,"../scatter/style":1242,"./attributes":1306,"./calc":1307,"./defaults":1308,"./event_data":1309,"./format_labels":1310,"./hover":1311,"./plot":1313}],1313:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,a,r,o)}},{"../scatter/plot":1239}],1314:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../scattergl/attributes"),l=t("../../plots/cartesian/constants").idRegex,c=t("../../plot_api/plot_template").templatedArray,u=t("../../lib/extend").extendFlat,f=n.marker,h=f.line,p=u(i("marker.line",{editTypeOverride:"calc"}),{width:u({},h.width,{editType:"calc"}),editType:"calc"}),d=u(i("marker"),{symbol:f.symbol,size:u({},f.size,{editType:"markerSize"}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:f.opacity,colorbar:f.colorbar,line:p,editType:"calc"});function g(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:l[t],editType:"plot"}}}d.color.editType=d.cmin.editType=d.cmax.editType="style",e.exports={dimensions:c("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},s.text,{}),hovertext:u({},s.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),marker:d,xaxes:g("x"),yaxes:g("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:s.selected.marker,editType:"calc"},unselected:{marker:s.unselected.marker,editType:"calc"},opacity:s.opacity}},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/plot_template":843,"../../plots/cartesian/axis_format_attributes":857,"../../plots/cartesian/constants":861,"../../plots/template_attributes":926,"../scatter/attributes":1218,"../scattergl/attributes":1270}],1315:[function(t,e,r){"use strict";var n=t("regl-line2d"),i=t("../../registry"),a=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,c=t("../../plots/cartesian/axes").shouldShowZeroLine;function u(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;oh?b.sizeAvg||Math.max(b.size,3):a(e,x),p=0;pa&&l||i-1,P=!0;if(o(x)||!!p.selectedpoints||C){var I=p._length;if(p.selectedpoints){g.selectBatch=p.selectedpoints;var O=p.selectedpoints,z={};for(l=0;l1&&(u=g[y-1],h=m[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var L=function(){y=0,M=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var g=d(e._Xs,"xaxis"),m=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(f.meshgrid=[g,m,v],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=m[0],x=h(g),b=h(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(m.length,x.length),l=function(t){return A(m[t])&&M(t)},f=function(t){return String(m[t])}):(r=Math.min(y.length,x.length),l=function(t){return A(y[t])&&M(t)},f=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=a.randstr(),I=0;I"),name:A||z("name")?y.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:P,eventData:l};m&&(F.x0=E-i.rInscribed*i.rpx1,F.x1=E+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),v&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(v){var N=t.select("path.surface");h.styleOne(N,i,y,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,y,h.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,h.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");h.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=m&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(g,u):c.findEntryWithLevel(g,u),v=c.getPtId(p),y={points:[f(t,a,h.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[f(t,a,h.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,b,_)}}))}},{"../../components/fx":706,"../../components/fx/helpers":702,"../../lib":803,"../../lib/events":792,"../../registry":931,"../pie/helpers":1197,"./helpers":1336,"@plotly/d3":58}],1336:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":666,"../../lib":803,"../../lib/setcursor":824,"../pie/helpers":1197}],1337:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1236,"./attributes":1330,"./base_plot":1331,"./calc":1332,"./defaults":1334,"./layout_attributes":1338,"./layout_defaults":1339,"./plot":1340,"./style":1341}],1338:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1339:[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("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":803,"./layout_attributes":1338}],1340:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,h=t("../pie/plot"),p=t("../pie/helpers").getRotationAngle,d=h.computeTransform,g=h.transformInsideText,m=t("./style").styleOne,v=t("../bar/style").resizeText,y=t("./fx"),x=t("./constants"),b=t("./helpers");function _(t,e,c,f){var h=t._fullLayout,v=!h.uniformtext.mode&&b.hasTransition(f),_=n.select(c).selectAll("g.slice"),T=e[0],k=T.trace,A=T.hierarchy,M=b.findEntryWithLevel(A,k.level),S=b.getMaxDepth(k),E=h._size,L=k.domain,C=E.w*(L.x[1]-L.x[0]),P=E.h*(L.y[1]-L.y[0]),I=.5*Math.min(C,P),O=T.cx=E.l+E.w*(L.x[1]+L.x[0])/2,z=T.cy=E.t+E.h*(1-L.y[0])-P/2;if(!M)return _.remove();var D=null,R={};v&&_.each((function(t){R[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!D&&b.isEntry(t)&&(D=t)}));var F=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(M).descendants(),B=M.height+1,N=0,j=S;T.hasMultipleRoots&&b.isHierarchyRoot(M)&&(F=F.slice(1),B-=1,N=1,j+=1),F=F.filter((function(t){return t.y1<=j}));var U=p(k.rotation);U&&F.forEach((function(t){t.x0+=U,t.x1+=U}));var V=Math.min(B,S),q=function(t){return(t-N)/V*I},H=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},G=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,O,z)},Y=function(t){return O+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},W=function(t){return z+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(_=_.data(F,b.getPtId)).enter().append("g").classed("slice",!0),v?_.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=b.getPtId(t),n=R[r],i=R[b.getPtId(M)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+U;e=t.rpx1X?2*Math.PI:0)+U;e={x0:i,x1:i}}else e={rpx0:I,rpx1:I},s.extendFlat(e,K(t));else e={rpx0:0,rpx1:0};else e={x0:U,x1:U};return a(e,n)}(t);return function(t){return G(e(t))}})):f.attr("d",G),c.call(y,M,t,e,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(m,i,k);var p=s.ensureSingle(c,"g","slicetext"),_=s.ensureSingle(p,"text","",(function(t){t.attr("data-notex",1)})),w=s.ensureUniformFontSize(t,b.determineTextFont(k,i,h.font));_.text(r.formatSliceLabel(i,M,k,e,h)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,w).call(l.convertToTspans,t);var A=o.bBox(_.node());i.transform=g(A,i,T),i.transform.targetX=Y(i),i.transform.targetY=W(i);var S=function(t,e){var r=t.transform;return d(r,e),r.fontSize=w.size,u(k.type,r,h),s.getTextTransform(r)};v?_.transition().attrTween("transform",(function(t){var e=function(t){var e,r=R[b.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},D)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,K(t));else e.x0=e.x1=U;else e.x0=e.x1=U;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),f=a(e.x1,t.x1),p=a(e.transform.scale,n.scale),d=a(e.transform.rotate,n.rotate),g=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,m=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=f(t),a=function(t){return m(Math.pow(t,g))}(t),s={pxmid:H(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(k.type,n,h),{transform:{targetX:Y(s),targetY:W(s),scale:p(t),rotate:d(t),rCenter:a}}}}(t);return function(t){return S(e(t),A)}})):_.attr("transform",S(i,A))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&b.hasTransition(r);(f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&v(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,f=c.hierarchy,h=b.isHierarchyRoot(t),p=b.getParent(f,t),d=b.getValue(t);if(!a){var g,m=o.split("+"),v=function(t){return-1!==m.indexOf(t)},y=[];if(v("label")&&u.label&&y.push(u.label),u.hasOwnProperty("v")&&v("value")&&y.push(b.formatValue(u.v,l)),!h){v("current path")&&y.push(b.getPath(t.data));var x=0;v("percent parent")&&x++,v("percent entry")&&x++,v("percent root")&&x++;var _=x>1;if(x){var w,T=function(t){g=b.formatPercent(w,l),_&&(g+=" of "+t),y.push(g)};v("percent parent")&&!h&&(w=d/b.getValue(p),T("parent")),v("percent entry")&&(w=d/b.getValue(e),T("entry")),v("percent root")&&(w=d/b.getValue(f),T("root"))}}return v("text")&&(g=s.castOption(r,u.i,"text"),s.isValidTextValue(g)&&y.push(g)),y.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=b.formatValue(u.v,l)),A.currentPath=b.getPath(t.data),h||(A.percentParent=d/b.getValue(p),A.percentParentLabel=b.formatPercent(A.percentParent,l),A.parent=b.getPtLabel(p)),A.percentEntry=d/b.getValue(e),A.percentEntryLabel=b.formatPercent(A.percentEntry,l),A.entry=b.getPtLabel(e),A.percentRoot=d/b.getValue(f),A.percentRootLabel=b.formatPercent(A.percentRoot,l),A.root=b.getPtLabel(f),u.hasOwnProperty("color")&&(A.color=u.color);var M=s.castOption(r,u.i,"text");return(s.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,A,i._d3locale,A,r._meta||{})}},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../bar/style":955,"../bar/uniform_text":957,"../pie/helpers":1197,"../pie/plot":1201,"./constants":1333,"./fx":1335,"./helpers":1336,"./style":1341,"@plotly/d3":58,"d3-hierarchy":170,"d3-interpolate":171}],1341:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":666,"../../lib":803,"../bar/uniform_text":957,"@plotly/d3":58}],1342:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},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},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":666,"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plot_api/edit_types":836,"../../plots/attributes":850,"../../plots/cartesian/axis_format_attributes":857,"../../plots/template_attributes":926}],1343:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":674}],1344:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-linear-interpolate").d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),f=t("../../components/colorscale").extractOpts;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=h.prototype;p.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function g(t,e){if(t0){r=d[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;a_;)r--,r/=v(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1351:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var g=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),m=e.domain,v=Math.floor(t._fullLayout._size.w*(m.x[1]-m.x[0])),y=Math.floor(t._fullLayout._size.h*(m.y[1]-m.y[0])),x=e.header.values.length?g[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=h(b,y-_+n.uplift),T=f(h(x,_),[]),k=f(w,T),A={},M=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=g.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var L=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:m.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-m.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:L,height:y,columnOrder:M,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return C.columns.forEach((function(t){t.calcdata=C,t.x=u(t)})),C}},{"../../lib/extend":793,"./constants":1350,"fast-isnumeric":249}],1352:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":793}],1353:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,h,p=u?"":T(t.calcdata.cells.prefix,e,r)||"",d=u?"":T(t.calcdata.cells.suffix,e,r)||"",g=u?null:T(t.calcdata.cells.format,e,r)||null,m=p+(g?a(g)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=w(m)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?w(m):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?m.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=D(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(C(t,r,e,c,n.prevPages,n,0),C(t,r,e,c,n.prevPages,n,1),x(r,t))}}function L(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(A);return E(t,f,l),s.scrollY===u}}function C(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(z)}}function I(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(h,f);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(z),E(null,t.filter(A),0),x(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function z(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(B(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":673,"../../lib/extend":793,"../../plots/domain":882,"../../plots/template_attributes":926,"../pie/attributes":1192,"../sunburst/attributes":1330,"./constants":1359}],1357:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":917}],1358:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1332}],1359:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1360:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;e.exports=function(t,e,r,c){function h(r,a){return n.coerce(t,e,i,r,a)}var p=h("labels"),d=h("parents");if(p&&p.length&&d&&d.length){var g=h("values");g&&g.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),"squarify"===h("tiling.packing")&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var m=h("text");h("texttemplate"),e.texttemplate||h("textinfo",Array.isArray(m)?"text+label":"label"),h("hovertext"),h("hovertemplate");var v=h("pathbar.visible");s(t,e,c,h,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var y=-1!==e.textposition.indexOf("bottom");h("marker.line.width")&&h("marker.line.color",c.paper_bgcolor);var x=h("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?f(t,e,c,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(x||[]).length);var b=2*e.textfont.size;h("marker.pad.t",y?b/4:b),h("marker.pad.l",b/4),h("marker.pad.r",b/4),h("marker.pad.b",y?b:b/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},v&&(h("pathbar.thickness",e.pathbar.textfont.size+2*l),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),o(e,c,h),e._length=null}else e.visible=!1}},{"../../components/color":666,"../../components/colorscale":678,"../../lib":803,"../../plots/domain":882,"../bar/constants":943,"../bar/defaults":945,"./attributes":1356}],1361:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,f,h=c.type,p=c.drawDescendants,d=t._fullLayout,g=d["_"+h+"layer"],m=!r;(a(h,d),(u=g.selectAll("g.trace."+h).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(h,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){g.selectAll("g.trace").each((function(e){s(t,e,this,r,p)}))}))):(u.each((function(e){s(t,e,this,r,p)})),d.uniformtext.mode&&o(t,g.selectAll(".trace"),h));m&&u.exit().remove()}},{"../bar/style":955,"../bar/uniform_text":957,"../sunburst/helpers":1336,"./plot_one":1370,"@plotly/d3":58}],1362:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx");e.exports=function(t,e,r,h,p){var d=p.barDifY,g=p.width,m=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,A=p.makeUpdateTextInterpolator,M={},S=t._fullLayout,E=e[0],L=E.trace,C=E.hierarchy,P=g/L._entryDepth,I=u.listPath(r.data,"id"),O=s(C.copy(),[g,m],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(O=O.filter((function(t){var e=I.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+m,t.onPathbar=!0,!0)}))).reverse(),(h=h.data(O,u.getPtId)).enter().append("g").classed("pathbar",!0),T(h,!0,M,[g,m],x),h.order();var z=h;w&&(z=z.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),z.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-Math.min(g,m)/2),s._hoverY=y(s.y1-m/2);var h=n.select(this),p=i.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events","all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,M,[g,m]);return function(t){return x(e(t))}})):p.attr("d",x),h.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,L,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(h,"g","slicetext"),T=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=i.ensureUniformFontSize(t,u.determineTextFont(L,s,S.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,E).call(o.convertToTspans,t),s.textBB=a.bBox(T.node()),s.transform=b(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?T.transition().attrTween("transform",(function(t){var e=A(t,!0,M,[g,m]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"./constants":1359,"./partition":1368,"./style":1371,"@plotly/d3":58}],1363:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx"),h=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var g=d.width,m=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,A=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._fullLayout,E=e[0].trace,L=-1!==E.textposition.indexOf("left"),C=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),I=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,O=s(r,[g,m],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),z=1/0,D=-1/0;O.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),D=Math.max(D,e))})),p=p.data(O,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-z+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[g,m],x),p.order();var R=null;if(w&&M){var F=u.getPtId(M);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:g,y0:0,y1:m}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){var p=u.isHeader(s,E);s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-E.marker.pad.r),s._hoverY=y(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),T=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[g,m]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?I?"":u.getPtLabel(s)||"":h(s,r,E,e,S)||"";var M=i.ensureSingle(d,"g","slicetext"),O=i.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),z=i.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));O.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L||p?"start":"middle").call(a.font,z).call(o.convertToTspans,t),s.textBB=a.bBox(O.node()),s.transform=b(s,{fontSize:z.size,isHeader:p}),s.transform.fontSize=z.size,w?O.transition().attrTween("transform",(function(t){var e=A(t,!1,B(),[g,m]);return function(t){return _(e(t))}})):O.attr("transform",_(s))})),R}},{"../../components/drawing":688,"../../lib":803,"../../lib/svg_text_utils":829,"../sunburst/fx":1335,"../sunburst/helpers":1336,"../sunburst/plot":1340,"./constants":1359,"./partition":1368,"./style":1371,"@plotly/d3":58}],1364:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?C+O:-(I+O):0,D={x0:P,x1:P,y0:z,y1:z+I},R=function(t,e,r){var n=v.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,U=function(t,e){return e?B[h(t)]:N[h(t)]},V=function(t,e,r,n){if(e)return B[h(x)]||D;var i=N[v.level]||r;return function(t){return t.data.depth-b.data.depth=(n-=(y?m:m.r)-s)){var x=(r+n)/2;r=x,n=x}var b;f?i<(b=a-(y?m:m.b))&&b"===tt?(l.x-=a,c.x-=a,u.x-=a,f.x-=a):"/"===tt?(u.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(c),$(u),$(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(f.x,f.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:A,strTransform:ot}):w.remove()}},{"../../lib":803,"../bar/constants":943,"../bar/plot":952,"../bar/uniform_text":957,"../sunburst/helpers":1336,"./constants":1359,"./draw_ancestors":1362,"@plotly/d3":58,"d3-interpolate":171}],1371:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,h=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&h===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,f,"marker.line.color")||i.defaultLine,l=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var g=r.marker.depthfade;if(g){var m,v=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===g){var y=o.getMaxDepth(r);m=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else m=e.data.depth-r._entryDepth,r._atRootLevel||m++;if(m>0)for(var x=0;x0){var x,b,_,w,T,k=t.xa,A=t.ya;"h"===p.orientation?(T=e,x="y",_=A,b="x",w=k):(T=r,x="x",_=k,b="y",w=A);var M=h[t.index];if(T>=M.span[0]&&T<=M.span[1]){var S=n.extendFlat({},t),E=w.c2p(T,!0),L=o.getKdeValue(M,p,T),C=o.getPositionOnKdePath(M,p,E),P=_._offset,I=_._length;S[x+"0"]=C[0],S[x+"1"]=C[1],S[b+"0"]=S[b+"1"]=E,S[b+"Label"]=b+": "+i.hoverLabelText(w,T,p[b+"hoverformat"])+", "+h[0].t.labels.kde+" "+L.toFixed(3),S.spikeDistance=y[0].spikeDistance;var O=x+"Spike";S[O]=y[0][O],y[0].spikeDistance=void 0,y[0][O]=void 0,S.hovertemplate=!1,v.push(S),(u={stroke:t.color})[x+"1"]=n.constrain(P+C[0],P,P+I),u[x+"2"]=n.constrain(P+C[1],P,P+I),u[b+"1"]=u[b+"2"]=w._offset+E}}g&&(v=v.concat(y))}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var z=f.selectAll(".violinline-"+p.uid).data(u?[0]:[]);return z.enter().append("line").classed("violinline-"+p.uid,!0).attr("stroke-width",1.5),z.exit().remove(),z.attr(u),"closest"===s?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":803,"../../plots/cartesian/axes":854,"../box/hover":971,"./helpers":1376}],1378:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":868,"../box/defaults":969,"../box/select":976,"../scatter/style":1242,"./attributes":1372,"./calc":1373,"./cross_trace_calc":1374,"./defaults":1375,"./hover":1377,"./layout_attributes":1379,"./layout_defaults":1380,"./plot":1381,"./style":1382}],1379:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":803,"../box/layout_attributes":973}],1380:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,(function(r,a){return n.coerce(t,e,i,r,a)}),"violin")}},{"../../lib":803,"../box/layout_defaults":974,"./layout_attributes":1379}],1381:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,f=e.xaxis,h=e.yaxis;function p(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return a.smoothopen(e[0],1)}i.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),a=t[0],s=a.t,c=a.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,g=s.bdPos,m=e[s.valLetter+"axis"],v=e[s.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(i.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(t){var e,r,i,a,o,l,f,h,_=n.select(this),w=t.density,T=w.length,k=v.c2l(t.pos+d,!0),A=v.l2p(k);if(c.width)e=s.maxKDE/g;else{var M=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?M.maxKDE/g*(M.maxCount/t.pts.length):M.maxKDE/g}if(x){for(f=new Array(T),o=0;o")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(h,m),[u]}function k(t){return n(g,t,h[d+"hoverformat"])}}},{"../../components/color":666,"../../constants/delta.js":773,"../../plots/cartesian/axes":854,"../bar/hover":948}],1394:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":868,"../bar/select":953,"./attributes":1387,"./calc":1388,"./cross_trace_calc":1390,"./defaults":1391,"./event_data":1392,"./hover":1393,"./layout_attributes":1395,"./layout_defaults":1396,"./plot":1397,"./style":1398}],1395:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1396:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(m+=h?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":666,"../../components/drawing":688,"../../constants/interactions":778,"../bar/style":955,"../bar/uniform_text":957,"@plotly/d3":58}],1399:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return f;case"first":return h;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),x={},b={},_=0;d?(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(m);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],528:[function(t,e,r){(function(t){(function(){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],529:[function(t,e,r){"use strict";e.exports=function(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];(l=o-((r=a+o)-a))&&(t[--n]=r,r=l)}var s=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],p=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+p*(y-x),_=7771561172376103e-31*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:h(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),f=0;f0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(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),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],542:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":107,"reduce-simplicial-complex":521}],543:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=k[0];return g(0,A-1),A-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((A+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),M[e]>=0&&w(M[e],m(e)),M[r]>=0&&w(M[r],m(r))}}var k=[],M=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var S=_();if(S<0||c[S]>r)break;T(S)}var E=[];for(f=0;f=0&&r>=0&&e!==r){var n=M[e],i=M[r];n!==i&&C.push([n,i])}})),i.unique(i.normalize(C)),{positions:E,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":534,"simplicial-complex":547}],550:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;p=f[h]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},{"./lib/order-segments":550,"binary-search-bounds":103,"functional-red-black-tree":251,"robust-orientation":534}],552:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var f=o(s,u,l,i);r.push(f),n.push(f.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":531,"robust-sum":539}],553:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return i(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function i(r,n){var i,a,o,s,l,c,u,f,h,p=1,d=r.length,m="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?m+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(h+i).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?h+i+l:"0"===c?h+l+i:l+h+i)}return m}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var r,n=e,i=[],o=0;n;){if(null!==(r=t.text.exec(n)))i.push(r[0]);else if(null!==(r=t.modulo.exec(n)))i.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return a[e]=i}void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],554:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/lib/_stream_readable.js"),i.Writable=t("readable-stream/lib/_stream_writable.js"),i.Duplex=t("readable-stream/lib/_stream_duplex.js"),i.Transform=t("readable-stream/lib/_stream_transform.js"),i.PassThrough=t("readable-stream/lib/_stream_passthrough.js"),i.finished=t("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=t("readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(u(),0===n.listenerCount(this,"error"))throw t}function u(){r.removeListener("data",i),t.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("error",c),t.on("error",c),r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t}},{events:116,inherits:439,"readable-stream/lib/_stream_duplex.js":556,"readable-stream/lib/_stream_passthrough.js":557,"readable-stream/lib/_stream_readable.js":558,"readable-stream/lib/_stream_transform.js":559,"readable-stream/lib/_stream_writable.js":560,"readable-stream/lib/internal/streams/end-of-stream.js":564,"readable-stream/lib/internal/streams/pipeline.js":566}],555:[function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function a(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],556:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):P(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,P(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(C,t))}function C(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(N,e,t))}function N(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},M.prototype._read=function(t){w(this,new b("_read()"))},M.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",h),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var f=!1;function h(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(e){c("onerror",e),g(),t.removeListener("error",p),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",m),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?L(this):i.reading||r.nextTick(z,this))),n},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},M.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new m("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,P(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=f.destroy,M.prototype._undestroy=f.undestroy,M.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":555,"./_stream_duplex":556,"./internal/streams/destroy":563,"./internal/streams/state":567,"./internal/streams/stream":568,_process:514,buffer:117,inherits:439,"util-deprecate":606}],561:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(p(r,!1)))}}function m(t){r.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(p(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,r=Object.create(v,(i(e={},h,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[o]=null,r[s]=null,t(p(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":564,_process:514}],562:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":555,"./end-of-stream":564}],567:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":555}],568:[function(t,e,r){e.exports=t("events").EventEmitter},{events:116}],569:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":540}],570:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function f(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(p(a));var c=o.apply(t,s);if(!l||a===c)return a}}var h=p((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return f(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return f(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function p(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:514,assert:80,buffer:117,debug:571}],571:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":572,_process:514}],572:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],574:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),v.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(g);var b=new Array(y);for(d=0;dn|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,f,h){var p=(o<<0)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*h)/(r-n),e-.25-.25*(i+r-2*h)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*h)/(n-r),e-.25-.25*(a+n-2*h)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*h)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*h)/(i-a),e-.75-.25*(-i-r+2*h)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*h)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*h)/(i-a),e-.75-.25*(a+n-2*h)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*h)/(a-i),e-.75-.25*(-a-n+2*h)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*h)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*h)/(a-i),e-.75-.25*(i+r-2*h)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*h)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*h)/(r-n),e-.25-.25*(-a-n+2*h)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*h)/(n-r),e-.25-.25*(-i-r+2*h)/(i-r)]);break;case 15:u.push([t-.5,e-.5])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}},"3d":function(t,e,r){var n=t({order:e,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(t,e,r,n){return t>n|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_){var w=(f<<0)+(h<<1)+(p<<2)+(d<<3)+(m<<4)+(g<<5)+(v<<6)+(y<<7)|0;if(0!==w&&255!==w)switch(w>>>7){case 0:!function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_){switch(t){case 0:b.push([e-.5,r-.5,n-.5]);break;case 1:b.push([e-1/6-1/6*(a+i-2*_)/(i-a),r-1/6-1/6*(o+i-2*_)/(i-o),n-1/6-1/6*(l+i-2*_)/(i-l)]);break;case 2:b.push([e-5/6-1/6*(-a-i+2*_)/(a-i),r-1/6-1/6*(s+a-2*_)/(a-s),n-1/6-1/6*(c+a-2*_)/(a-c)]);break;case 3:b.push([e-.5,r-.25-.25*(o+i+s+a-4*_)/(i-o+a-s),n-.25-.25*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 4:b.push([e-1/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(-o-i+2*_)/(o-i),n-1/6-1/6*(u+o-2*_)/(o-u)]);break;case 5:b.push([e-.25-.25*(a+i+s+o-4*_)/(i-a+o-s),r-.5,n-.25-.25*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 6:b.push([e-.5-1/6*(-a-i+s+o)/(a-i+o-s),r-.5-1/6*(-o-i+s+a)/(o-i+a-s),n-1/6-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 7:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(s+a-2*_)/(a-s),n-.3-.3*(l+i+c+a+u+o-6*_)/(i-l+a-c+o-u)]);break;case 8:b.push([e-5/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(-s-a+2*_)/(s-a),n-1/6-1/6*(f+s-2*_)/(s-f)]);break;case 9:b.push([e-.5-1/6*(a+i+-s-o)/(i-a+s-o),r-.5-1/6*(o+i+-s-a)/(i-o+s-a),n-1/6-1/6*(l+i+f+s-4*_)/(i-l+s-f)]);break;case 10:b.push([e-.75-.25*(-a-i-s-o+4*_)/(a-i+s-o),r-.5,n-.25-.25*(c+a+f+s-4*_)/(a-c+s-f)]);break;case 11:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(o+i-2*_)/(i-o),n-.3-.3*(l+i+c+a+f+s-6*_)/(i-l+a-c+s-f)]);break;case 12:b.push([e-.5,r-.75-.25*(-o-i-s-a+4*_)/(o-i+s-a),n-.25-.25*(u+o+f+s-4*_)/(o-u+s-f)]);break;case 13:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.5-.1*(-s-a+2*_)/(s-a),n-.3-.3*(l+i+u+o+f+s-6*_)/(i-l+o-u+s-f)]);break;case 14:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.5-.1*(-o-i+2*_)/(o-i),n-.3-.3*(c+a+u+o+f+s-6*_)/(a-c+o-u+s-f)]);break;case 15:b.push([e-.5,r-.5,n-.5-.5*(l+i+c+a+u+o+f+s-8*_)/(i-l+a-c+o-u+s-f)]);break;case 16:b.push([e-1/6-1/6*(c+l-2*_)/(l-c),r-1/6-1/6*(u+l-2*_)/(l-u),n-5/6-1/6*(-l-i+2*_)/(l-i)]);break;case 17:b.push([e-.25-.25*(a+i+c+l-4*_)/(i-a+l-c),r-.25-.25*(o+i+u+l-4*_)/(i-o+l-u),n-.5]);break;case 18:b.push([e-.5-1/6*(-a-i+c+l)/(a-i+l-c),r-1/6-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(-l-i+c+a)/(l-i+a-c)]);break;case 19:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.3-.3*(o+i+s+a+u+l-6*_)/(i-o+a-s+l-u),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 20:b.push([e-1/6-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(-o-i+u+l)/(o-i+l-u),n-.5-1/6*(-l-i+u+o)/(l-i+o-u)]);break;case 21:b.push([e-.3-.3*(a+i+s+o+c+l-6*_)/(i-a+o-s+l-c),r-.5-.1*(u+l-2*_)/(l-u),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 22:b.push([e-7/18-1/6*(-a-i+s+o+c+l-2*_)/(a-i+o-s+l-c),r-7/18-1/6*(-o-i+s+a+u+l-2*_)/(o-i+a-s+l-u),n-7/18-1/6*(-l-i+c+a+u+o-2*_)/(l-i+a-c+o-u)]);break;case 23:b.push([e-.5-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 24:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(-l-i+f+s)/(l-i+s-f)]);break;case 25:b.push([e-.5-3/14*(a+i+-s-o+c+l-2*_)/(i-a+s-o+l-c),r-.5-3/14*(o+i+-s-a+u+l-2*_)/(i-o+s-a+l-u),n-5/14-1/14*(f+s-2*_)/(s-f)]);break;case 26:b.push([e-.5-3/14*(-a-i-s-o+c+l+2*_)/(a-i+s-o+l-c),r-5/14-1/14*(u+l-2*_)/(l-u),n-.5-3/14*(-l-i+c+a+f+s-2*_)/(l-i+a-c+s-f)]);break;case 27:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(o+i+u+l-4*_)/(i-o+l-u),n-.5-1/6*(c+a+f+s-4*_)/(a-c+s-f)]);break;case 28:b.push([e-5/14-1/14*(c+l-2*_)/(l-c),r-.5-3/14*(-o-i-s-a+u+l+2*_)/(o-i+s-a+l-u),n-.5-3/14*(-l-i+u+o+f+s-2*_)/(l-i+o-u+s-f)]);break;case 29:b.push([e-.5-1/6*(a+i+c+l-4*_)/(i-a+l-c),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(u+o+f+s-4*_)/(o-u+s-f)]);break;case 30:b.push([e-.375-.125*(-a-i+c+l)/(a-i+l-c),r-.375-.125*(-o-i+u+l)/(o-i+l-u),n-.5-.25*(-l-i+c+a+u+o+f+s-4*_)/(l-i+a-c+o-u+s-f)]);break;case 31:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.5-.1*(u+l-2*_)/(l-u),n-.7-.3*(c+a+u+o+f+s-6*_)/(a-c+o-u+s-f)]);break;case 32:b.push([e-5/6-1/6*(-c-l+2*_)/(c-l),r-1/6-1/6*(f+c-2*_)/(c-f),n-5/6-1/6*(-c-a+2*_)/(c-a)]);break;case 33:b.push([e-.5-1/6*(a+i+-c-l)/(i-a+c-l),r-1/6-1/6*(o+i+f+c-4*_)/(i-o+c-f),n-.5-1/6*(l+i+-c-a)/(i-l+c-a)]);break;case 34:b.push([e-.75-.25*(-a-i-c-l+4*_)/(a-i+c-l),r-.25-.25*(s+a+f+c-4*_)/(a-s+c-f),n-.5]);break;case 35:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.3-.3*(o+i+s+a+f+c-6*_)/(i-o+a-s+c-f),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 36:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(-o-i+f+c)/(o-i+c-f),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 37:b.push([e-.5-3/14*(a+i+s+o+-c-l-2*_)/(i-a+o-s+c-l),r-5/14-1/14*(f+c-2*_)/(c-f),n-.5-3/14*(l+i+-c-a+u+o-2*_)/(i-l+c-a+o-u)]);break;case 38:b.push([e-.5-3/14*(-a-i+s+o+-c-l+2*_)/(a-i+o-s+c-l),r-.5-3/14*(-o-i+s+a+f+c-2*_)/(o-i+a-s+c-f),n-5/14-1/14*(u+o-2*_)/(o-u)]);break;case 39:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(s+a+f+c-4*_)/(a-s+c-f),n-.5-1/6*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 40:b.push([e-5/6-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(-s-a+f+c)/(s-a+c-f),n-.5-1/6*(-c-a+f+s)/(c-a+s-f)]);break;case 41:b.push([e-11/18-1/6*(a+i+-s-o-c-l+2*_)/(i-a+s-o+c-l),r-7/18-1/6*(o+i+-s-a+f+c-2*_)/(i-o+s-a+c-f),n-7/18-1/6*(l+i+-c-a+f+s-2*_)/(i-l+c-a+s-f)]);break;case 42:b.push([e-.7-.3*(-a-i-s-o-c-l+6*_)/(a-i+s-o+c-l),r-.5-.1*(f+c-2*_)/(c-f),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 43:b.push([e-.5-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(o+i+f+c-4*_)/(i-o+c-f),n-.5-1/6*(l+i+f+s-4*_)/(i-l+s-f)]);break;case 44:b.push([e-9/14-1/14*(-c-l+2*_)/(c-l),r-.5-3/14*(-o-i-s-a+f+c+2*_)/(o-i+s-a+c-f),n-.5-3/14*(-c-a+u+o+f+s-2*_)/(c-a+o-u+s-f)]);break;case 45:b.push([e-.625-.125*(a+i+-c-l)/(i-a+c-l),r-.375-.125*(-s-a+f+c)/(s-a+c-f),n-.5-.25*(l+i+-c-a+u+o+f+s-4*_)/(i-l+c-a+o-u+s-f)]);break;case 46:b.push([e-.5-1/6*(-a-i-c-l+4*_)/(a-i+c-l),r-.5-1/6*(-o-i+f+c)/(o-i+c-f),n-.5-1/6*(u+o+f+s-4*_)/(o-u+s-f)]);break;case 47:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.5-.1*(f+c-2*_)/(c-f),n-.7-.3*(l+i+u+o+f+s-6*_)/(i-l+o-u+s-f)]);break;case 48:b.push([e-.5,r-.25-.25*(u+l+f+c-4*_)/(l-u+c-f),n-.75-.25*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 49:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.3-.3*(o+i+u+l+f+c-6*_)/(i-o+l-u+c-f),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 50:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.3-.3*(s+a+u+l+f+c-6*_)/(a-s+l-u+c-f),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 51:b.push([e-.5,r-.5-.5*(o+i+s+a+u+l+f+c-8*_)/(i-o+a-s+l-u+c-f),n-.5]);break;case 52:b.push([e-5/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(-o-i+u+l+f+c-2*_)/(o-i+l-u+c-f),n-.5-3/14*(-l-i-c-a+u+o+2*_)/(l-i+c-a+o-u)]);break;case 53:b.push([e-.5-1/6*(a+i+s+o-4*_)/(i-a+o-s),r-.5-1/6*(u+l+f+c-4*_)/(l-u+c-f),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 54:b.push([e-.375-.125*(-a-i+s+o)/(a-i+o-s),r-.5-.25*(-o-i+s+a+u+l+f+c-4*_)/(o-i+a-s+l-u+c-f),n-.375-.125*(-l-i+u+o)/(l-i+o-u)]);break;case 55:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(s+a+u+l+f+c-6*_)/(a-s+l-u+c-f),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 56:b.push([e-9/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(-s-a+u+l+f+c-2*_)/(s-a+l-u+c-f),n-.5-3/14*(-l-i-c-a+f+s+2*_)/(l-i+c-a+s-f)]);break;case 57:b.push([e-.625-.125*(a+i+-s-o)/(i-a+s-o),r-.5-.25*(o+i+-s-a+u+l+f+c-4*_)/(i-o+s-a+l-u+c-f),n-.375-.125*(-c-a+f+s)/(c-a+s-f)]);break;case 58:b.push([e-.5-1/6*(-a-i-s-o+4*_)/(a-i+s-o),r-.5-1/6*(u+l+f+c-4*_)/(l-u+c-f),n-.5-1/6*(-l-i+f+s)/(l-i+s-f)]);break;case 59:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(o+i+u+l+f+c-6*_)/(i-o+l-u+c-f),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 60:b.push([e-.5,r-.5-.25*(-o-i-s-a+u+l+f+c)/(o-i+s-a+l-u+c-f),n-.5-.25*(-l-i-c-a+u+o+f+s)/(l-i+c-a+o-u+s-f)]);break;case 61:b.push([e-9/14-1/14*(a+i-2*_)/(i-a),r-.5-3/14*(-s-a+u+l+f+c-2*_)/(s-a+l-u+c-f),n-.5-3/14*(-c-a+u+o+f+s-2*_)/(c-a+o-u+s-f)]);break;case 62:b.push([e-5/14-1/14*(-a-i+2*_)/(a-i),r-.5-3/14*(-o-i+u+l+f+c-2*_)/(o-i+l-u+c-f),n-.5-3/14*(-l-i+u+o+f+s-2*_)/(l-i+o-u+s-f)]);break;case 63:b.push([e-.5,r-.75-.25*(u+l+f+c-4*_)/(l-u+c-f),n-.75-.25*(u+o+f+s-4*_)/(o-u+s-f)]);break;case 64:b.push([e-1/6-1/6*(f+u-2*_)/(u-f),r-5/6-1/6*(-u-l+2*_)/(u-l),n-5/6-1/6*(-u-o+2*_)/(u-o)]);break;case 65:b.push([e-1/6-1/6*(a+i+f+u-4*_)/(i-a+u-f),r-.5-1/6*(o+i+-u-l)/(i-o+u-l),n-.5-1/6*(l+i+-u-o)/(i-l+u-o)]);break;case 66:b.push([e-.5-1/6*(-a-i+f+u)/(a-i+u-f),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 67:b.push([e-5/14-1/14*(f+u-2*_)/(u-f),r-.5-3/14*(o+i+s+a+-u-l-2*_)/(i-o+a-s+u-l),n-.5-3/14*(l+i+c+a+-u-o-2*_)/(i-l+a-c+u-o)]);break;case 68:b.push([e-.25-.25*(s+o+f+u-4*_)/(o-s+u-f),r-.75-.25*(-o-i-u-l+4*_)/(o-i+u-l),n-.5]);break;case 69:b.push([e-.3-.3*(a+i+s+o+f+u-6*_)/(i-a+o-s+u-f),r-.5-.1*(-u-l+2*_)/(u-l),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 70:b.push([e-.5-3/14*(-a-i+s+o+f+u-2*_)/(a-i+o-s+u-f),r-.5-3/14*(-o-i+s+a+-u-l+2*_)/(o-i+a-s+u-l),n-5/14-1/14*(c+a-2*_)/(a-c)]);break;case 71:b.push([e-.5-1/6*(s+o+f+u-4*_)/(o-s+u-f),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 72:b.push([e-.5-1/6*(-s-o+f+u)/(s-o+u-f),r-5/6-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(-u-o+f+s)/(u-o+s-f)]);break;case 73:b.push([e-7/18-1/6*(a+i+-s-o+f+u-2*_)/(i-a+s-o+u-f),r-11/18-1/6*(o+i+-s-a-u-l+2*_)/(i-o+s-a+u-l),n-7/18-1/6*(l+i+-u-o+f+s-2*_)/(i-l+u-o+s-f)]);break;case 74:b.push([e-.5-3/14*(-a-i-s-o+f+u+2*_)/(a-i+s-o+u-f),r-9/14-1/14*(-u-l+2*_)/(u-l),n-.5-3/14*(c+a+-u-o+f+s-2*_)/(a-c+u-o+s-f)]);break;case 75:b.push([e-.375-.125*(-s-o+f+u)/(s-o+u-f),r-.625-.125*(o+i+-u-l)/(i-o+u-l),n-.5-.25*(l+i+c+a+-u-o+f+s-4*_)/(i-l+a-c+u-o+s-f)]);break;case 76:b.push([e-.5-.1*(f+u-2*_)/(u-f),r-.7-.3*(-o-i-s-a-u-l+6*_)/(o-i+s-a+u-l),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 77:b.push([e-.5-1/6*(a+i+f+u-4*_)/(i-a+u-f),r-.5-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(l+i+f+s-4*_)/(i-l+s-f)]);break;case 78:b.push([e-.5-1/6*(-a-i+f+u)/(a-i+u-f),r-.5-1/6*(-o-i-u-l+4*_)/(o-i+u-l),n-.5-1/6*(c+a+f+s-4*_)/(a-c+s-f)]);break;case 79:b.push([e-.5-.1*(f+u-2*_)/(u-f),r-.5-.1*(-u-l+2*_)/(u-l),n-.7-.3*(l+i+c+a+f+s-6*_)/(i-l+a-c+s-f)]);break;case 80:b.push([e-.25-.25*(c+l+f+u-4*_)/(l-c+u-f),r-.5,n-.75-.25*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 81:b.push([e-.3-.3*(a+i+c+l+f+u-6*_)/(i-a+l-c+u-f),r-.5-.1*(o+i-2*_)/(i-o),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 82:b.push([e-.5-3/14*(-a-i+c+l+f+u-2*_)/(a-i+l-c+u-f),r-5/14-1/14*(s+a-2*_)/(a-s),n-.5-3/14*(-l-i+c+a+-u-o+2*_)/(l-i+a-c+u-o)]);break;case 83:b.push([e-.5-1/6*(c+l+f+u-4*_)/(l-c+u-f),r-.5-1/6*(o+i+s+a-4*_)/(i-o+a-s),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 84:b.push([e-.3-.3*(s+o+c+l+f+u-6*_)/(o-s+l-c+u-f),r-.5-.1*(-o-i+2*_)/(o-i),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 85:b.push([e-.5-.5*(a+i+s+o+c+l+f+u-8*_)/(i-a+o-s+l-c+u-f),r-.5,n-.5]);break;case 86:b.push([e-.5-.25*(-a-i+s+o+c+l+f+u-4*_)/(a-i+o-s+l-c+u-f),r-.375-.125*(-o-i+s+a)/(o-i+a-s),n-.375-.125*(-l-i+c+a)/(l-i+a-c)]);break;case 87:b.push([e-.7-.3*(s+o+c+l+f+u-6*_)/(o-s+l-c+u-f),r-.5-.1*(s+a-2*_)/(a-s),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 88:b.push([e-.5-3/14*(-s-o+c+l+f+u-2*_)/(s-o+l-c+u-f),r-9/14-1/14*(-s-a+2*_)/(s-a),n-.5-3/14*(-l-i-u-o+f+s+2*_)/(l-i+u-o+s-f)]);break;case 89:b.push([e-.5-.25*(a+i+-s-o+c+l+f+u-4*_)/(i-a+s-o+l-c+u-f),r-.625-.125*(o+i+-s-a)/(i-o+s-a),n-.375-.125*(-u-o+f+s)/(u-o+s-f)]);break;case 90:b.push([e-.5-.25*(-a-i-s-o+c+l+f+u)/(a-i+s-o+l-c+u-f),r-.5,n-.5-.25*(-l-i+c+a+-u-o+f+s)/(l-i+a-c+u-o+s-f)]);break;case 91:b.push([e-.5-3/14*(-s-o+c+l+f+u-2*_)/(s-o+l-c+u-f),r-9/14-1/14*(o+i-2*_)/(i-o),n-.5-3/14*(c+a+-u-o+f+s-2*_)/(a-c+u-o+s-f)]);break;case 92:b.push([e-.5-1/6*(c+l+f+u-4*_)/(l-c+u-f),r-.5-1/6*(-o-i-s-a+4*_)/(o-i+s-a),n-.5-1/6*(-l-i+f+s)/(l-i+s-f)]);break;case 93:b.push([e-.7-.3*(a+i+c+l+f+u-6*_)/(i-a+l-c+u-f),r-.5-.1*(-s-a+2*_)/(s-a),n-.5-.1*(f+s-2*_)/(s-f)]);break;case 94:b.push([e-.5-3/14*(-a-i+c+l+f+u-2*_)/(a-i+l-c+u-f),r-5/14-1/14*(-o-i+2*_)/(o-i),n-.5-3/14*(-l-i+c+a+f+s-2*_)/(l-i+a-c+s-f)]);break;case 95:b.push([e-.75-.25*(c+l+f+u-4*_)/(l-c+u-f),r-.5,n-.75-.25*(c+a+f+s-4*_)/(a-c+s-f)]);break;case 96:b.push([e-.5-1/6*(-c-l+f+u)/(c-l+u-f),r-.5-1/6*(-u-l+f+c)/(u-l+c-f),n-5/6-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 97:b.push([e-7/18-1/6*(a+i+-c-l+f+u-2*_)/(i-a+c-l+u-f),r-7/18-1/6*(o+i+-u-l+f+c-2*_)/(i-o+u-l+c-f),n-11/18-1/6*(l+i+-c-a-u-o+2*_)/(i-l+c-a+u-o)]);break;case 98:b.push([e-.5-3/14*(-a-i-c-l+f+u+2*_)/(a-i+c-l+u-f),r-.5-3/14*(s+a+-u-l+f+c-2*_)/(a-s+u-l+c-f),n-9/14-1/14*(-u-o+2*_)/(u-o)]);break;case 99:b.push([e-.375-.125*(-c-l+f+u)/(c-l+u-f),r-.5-.25*(o+i+s+a+-u-l+f+c-4*_)/(i-o+a-s+u-l+c-f),n-.625-.125*(l+i+-u-o)/(i-l+u-o)]);break;case 100:b.push([e-.5-3/14*(s+o+-c-l+f+u-2*_)/(o-s+c-l+u-f),r-.5-3/14*(-o-i-u-l+f+c+2*_)/(o-i+u-l+c-f),n-9/14-1/14*(-c-a+2*_)/(c-a)]);break;case 101:b.push([e-.5-.25*(a+i+s+o+-c-l+f+u-4*_)/(i-a+o-s+c-l+u-f),r-.375-.125*(-u-l+f+c)/(u-l+c-f),n-.625-.125*(l+i+-c-a)/(i-l+c-a)]);break;case 102:b.push([e-.5-.25*(-a-i+s+o+-c-l+f+u)/(a-i+o-s+c-l+u-f),r-.5-.25*(-o-i+s+a+-u-l+f+c)/(o-i+a-s+u-l+c-f),n-.5]);break;case 103:b.push([e-.5-3/14*(s+o+-c-l+f+u-2*_)/(o-s+c-l+u-f),r-.5-3/14*(s+a+-u-l+f+c-2*_)/(a-s+u-l+c-f),n-9/14-1/14*(l+i-2*_)/(i-l)]);break;case 104:b.push([e-11/18-1/6*(-s-o-c-l+f+u+2*_)/(s-o+c-l+u-f),r-11/18-1/6*(-s-a-u-l+f+c+2*_)/(s-a+u-l+c-f),n-11/18-1/6*(-c-a-u-o+f+s+2*_)/(c-a+u-o+s-f)]);break;case 105:b.push([e-.5-1/6*(a+i+-s-o-c-l+f+u)/(i-a+s-o+c-l+u-f),r-.5-1/6*(o+i+-s-a-u-l+f+c)/(i-o+s-a+u-l+c-f),n-.5-1/6*(l+i+-c-a-u-o+f+s)/(i-l+c-a+u-o+s-f)]);break;case 106:b.push([e-.5-.25*(-a-i-s-o-c-l+f+u+4*_)/(a-i+s-o+c-l+u-f),r-.625-.125*(-u-l+f+c)/(u-l+c-f),n-.625-.125*(-u-o+f+s)/(u-o+s-f)]);break;case 107:b.push([e-7/18-1/6*(-s-o-c-l+f+u+2*_)/(s-o+c-l+u-f),r-11/18-1/6*(o+i+-u-l+f+c-2*_)/(i-o+u-l+c-f),n-11/18-1/6*(l+i+-u-o+f+s-2*_)/(i-l+u-o+s-f)]);break;case 108:b.push([e-.625-.125*(-c-l+f+u)/(c-l+u-f),r-.5-.25*(-o-i-s-a-u-l+f+c+4*_)/(o-i+s-a+u-l+c-f),n-.625-.125*(-c-a+f+s)/(c-a+s-f)]);break;case 109:b.push([e-11/18-1/6*(a+i+-c-l+f+u-2*_)/(i-a+c-l+u-f),r-7/18-1/6*(-s-a-u-l+f+c+2*_)/(s-a+u-l+c-f),n-11/18-1/6*(l+i+-c-a+f+s-2*_)/(i-l+c-a+s-f)]);break;case 110:b.push([e-.5-3/14*(-a-i-c-l+f+u+2*_)/(a-i+c-l+u-f),r-.5-3/14*(-o-i-u-l+f+c+2*_)/(o-i+u-l+c-f),n-9/14-1/14*(f+s-2*_)/(s-f)]);break;case 111:b.push([e-.5-1/6*(-c-l+f+u)/(c-l+u-f),r-.5-1/6*(-u-l+f+c)/(u-l+c-f),n-5/6-1/6*(l+i+f+s-4*_)/(i-l+s-f)]);break;case 112:b.push([e-.5-.1*(f+u-2*_)/(u-f),r-.5-.1*(f+c-2*_)/(c-f),n-.7-.3*(-l-i-c-a-u-o+6*_)/(l-i+c-a+u-o)]);break;case 113:b.push([e-.5-1/6*(a+i+f+u-4*_)/(i-a+u-f),r-.5-1/6*(o+i+f+c-4*_)/(i-o+c-f),n-.5-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 114:b.push([e-.5-1/6*(-a-i+f+u)/(a-i+u-f),r-.5-1/6*(s+a+f+c-4*_)/(a-s+c-f),n-.5-1/6*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 115:b.push([e-.5-.1*(f+u-2*_)/(u-f),r-.7-.3*(o+i+s+a+f+c-6*_)/(i-o+a-s+c-f),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 116:b.push([e-.5-1/6*(s+o+f+u-4*_)/(o-s+u-f),r-.5-1/6*(-o-i+f+c)/(o-i+c-f),n-.5-1/6*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 117:b.push([e-.7-.3*(a+i+s+o+f+u-6*_)/(i-a+o-s+u-f),r-.5-.1*(f+c-2*_)/(c-f),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 118:b.push([e-.5-3/14*(-a-i+s+o+f+u-2*_)/(a-i+o-s+u-f),r-.5-3/14*(-o-i+s+a+f+c-2*_)/(o-i+a-s+c-f),n-5/14-1/14*(-l-i+2*_)/(l-i)]);break;case 119:b.push([e-.75-.25*(s+o+f+u-4*_)/(o-s+u-f),r-.75-.25*(s+a+f+c-4*_)/(a-s+c-f),n-.5]);break;case 120:b.push([e-.625-.125*(-s-o+f+u)/(s-o+u-f),r-.625-.125*(-s-a+f+c)/(s-a+c-f),n-.5-.25*(-l-i-c-a-u-o+f+s+4*_)/(l-i+c-a+u-o+s-f)]);break;case 121:b.push([e-11/18-1/6*(a+i+-s-o+f+u-2*_)/(i-a+s-o+u-f),r-11/18-1/6*(o+i+-s-a+f+c-2*_)/(i-o+s-a+c-f),n-7/18-1/6*(-c-a-u-o+f+s+2*_)/(c-a+u-o+s-f)]);break;case 122:b.push([e-.5-3/14*(-a-i-s-o+f+u+2*_)/(a-i+s-o+u-f),r-9/14-1/14*(f+c-2*_)/(c-f),n-.5-3/14*(-l-i-u-o+f+s+2*_)/(l-i+u-o+s-f)]);break;case 123:b.push([e-.5-1/6*(-s-o+f+u)/(s-o+u-f),r-5/6-1/6*(o+i+f+c-4*_)/(i-o+c-f),n-.5-1/6*(-u-o+f+s)/(u-o+s-f)]);break;case 124:b.push([e-9/14-1/14*(f+u-2*_)/(u-f),r-.5-3/14*(-o-i-s-a+f+c+2*_)/(o-i+s-a+c-f),n-.5-3/14*(-l-i-c-a+f+s+2*_)/(l-i+c-a+s-f)]);break;case 125:b.push([e-5/6-1/6*(a+i+f+u-4*_)/(i-a+u-f),r-.5-1/6*(-s-a+f+c)/(s-a+c-f),n-.5-1/6*(-c-a+f+s)/(c-a+s-f)]);break;case 126:b.push([e-.5-1/6*(-a-i+f+u)/(a-i+u-f),r-.5-1/6*(-o-i+f+c)/(o-i+c-f),n-.5-1/6*(-l-i+f+s)/(l-i+s-f)]);break;case 127:b.push([e-5/6-1/6*(f+u-2*_)/(u-f),r-5/6-1/6*(f+c-2*_)/(c-f),n-5/6-1/6*(f+s-2*_)/(s-f)])}}(127&w,t,e,r,n,i,a,o,s,l,c,u,0,0,0,0,0,0,0,0,x,_);break;case 1:!function(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_){switch(t){case 0:b.push([e-5/6-1/6*(-f-u+2*_)/(f-u),r-5/6-1/6*(-f-c+2*_)/(f-c),n-5/6-1/6*(-f-s+2*_)/(f-s)]);break;case 1:b.push([e-.5-1/6*(a+i+-f-u)/(i-a+f-u),r-.5-1/6*(o+i+-f-c)/(i-o+f-c),n-.5-1/6*(l+i+-f-s)/(i-l+f-s)]);break;case 2:b.push([e-5/6-1/6*(-a-i-f-u+4*_)/(a-i+f-u),r-.5-1/6*(s+a+-f-c)/(a-s+f-c),n-.5-1/6*(c+a+-f-s)/(a-c+f-s)]);break;case 3:b.push([e-9/14-1/14*(-f-u+2*_)/(f-u),r-.5-3/14*(o+i+s+a+-f-c-2*_)/(i-o+a-s+f-c),n-.5-3/14*(l+i+c+a+-f-s-2*_)/(i-l+a-c+f-s)]);break;case 4:b.push([e-.5-1/6*(s+o+-f-u)/(o-s+f-u),r-5/6-1/6*(-o-i-f-c+4*_)/(o-i+f-c),n-.5-1/6*(u+o+-f-s)/(o-u+f-s)]);break;case 5:b.push([e-.5-3/14*(a+i+s+o+-f-u-2*_)/(i-a+o-s+f-u),r-9/14-1/14*(-f-c+2*_)/(f-c),n-.5-3/14*(l+i+u+o+-f-s-2*_)/(i-l+o-u+f-s)]);break;case 6:b.push([e-11/18-1/6*(-a-i+s+o+-f-u+2*_)/(a-i+o-s+f-u),r-11/18-1/6*(-o-i+s+a+-f-c+2*_)/(o-i+a-s+f-c),n-7/18-1/6*(c+a+u+o+-f-s-2*_)/(a-c+o-u+f-s)]);break;case 7:b.push([e-.625-.125*(s+o+-f-u)/(o-s+f-u),r-.625-.125*(s+a+-f-c)/(a-s+f-c),n-.5-.25*(l+i+c+a+u+o+-f-s-4*_)/(i-l+a-c+o-u+f-s)]);break;case 8:b.push([e-.75-.25*(-s-o-f-u+4*_)/(s-o+f-u),r-.75-.25*(-s-a-f-c+4*_)/(s-a+f-c),n-.5]);break;case 9:b.push([e-.5-3/14*(a+i+-s-o-f-u+2*_)/(i-a+s-o+f-u),r-.5-3/14*(o+i+-s-a-f-c+2*_)/(i-o+s-a+f-c),n-5/14-1/14*(l+i-2*_)/(i-l)]);break;case 10:b.push([e-.7-.3*(-a-i-s-o-f-u+6*_)/(a-i+s-o+f-u),r-.5-.1*(-f-c+2*_)/(f-c),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 11:b.push([e-.5-1/6*(-s-o-f-u+4*_)/(s-o+f-u),r-.5-1/6*(o+i+-f-c)/(i-o+f-c),n-.5-1/6*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 12:b.push([e-.5-.1*(-f-u+2*_)/(f-u),r-.7-.3*(-o-i-s-a-f-c+6*_)/(o-i+s-a+f-c),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 13:b.push([e-.5-1/6*(a+i+-f-u)/(i-a+f-u),r-.5-1/6*(-s-a-f-c+4*_)/(s-a+f-c),n-.5-1/6*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 14:b.push([e-.5-1/6*(-a-i-f-u+4*_)/(a-i+f-u),r-.5-1/6*(-o-i-f-c+4*_)/(o-i+f-c),n-.5-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 15:b.push([e-.5-.1*(-f-u+2*_)/(f-u),r-.5-.1*(-f-c+2*_)/(f-c),n-.7-.3*(l+i+c+a+u+o-6*_)/(i-l+a-c+o-u)]);break;case 16:b.push([e-.5-1/6*(c+l+-f-u)/(l-c+f-u),r-.5-1/6*(u+l+-f-c)/(l-u+f-c),n-5/6-1/6*(-l-i-f-s+4*_)/(l-i+f-s)]);break;case 17:b.push([e-.5-3/14*(a+i+c+l+-f-u-2*_)/(i-a+l-c+f-u),r-.5-3/14*(o+i+u+l+-f-c-2*_)/(i-o+l-u+f-c),n-9/14-1/14*(-f-s+2*_)/(f-s)]);break;case 18:b.push([e-11/18-1/6*(-a-i+c+l+-f-u+2*_)/(a-i+l-c+f-u),r-7/18-1/6*(s+a+u+l+-f-c-2*_)/(a-s+l-u+f-c),n-11/18-1/6*(-l-i+c+a+-f-s+2*_)/(l-i+a-c+f-s)]);break;case 19:b.push([e-.625-.125*(c+l+-f-u)/(l-c+f-u),r-.5-.25*(o+i+s+a+u+l+-f-c-4*_)/(i-o+a-s+l-u+f-c),n-.625-.125*(c+a+-f-s)/(a-c+f-s)]);break;case 20:b.push([e-7/18-1/6*(s+o+c+l+-f-u-2*_)/(o-s+l-c+f-u),r-11/18-1/6*(-o-i+u+l+-f-c+2*_)/(o-i+l-u+f-c),n-11/18-1/6*(-l-i+u+o+-f-s+2*_)/(l-i+o-u+f-s)]);break;case 21:b.push([e-.5-.25*(a+i+s+o+c+l+-f-u-4*_)/(i-a+o-s+l-c+f-u),r-.625-.125*(u+l+-f-c)/(l-u+f-c),n-.625-.125*(u+o+-f-s)/(o-u+f-s)]);break;case 22:b.push([e-.5-1/6*(-a-i+s+o+c+l+-f-u)/(a-i+o-s+l-c+f-u),r-.5-1/6*(-o-i+s+a+u+l+-f-c)/(o-i+a-s+l-u+f-c),n-.5-1/6*(-l-i+c+a+u+o+-f-s)/(l-i+a-c+o-u+f-s)]);break;case 23:b.push([e-11/18-1/6*(s+o+c+l+-f-u-2*_)/(o-s+l-c+f-u),r-11/18-1/6*(s+a+u+l+-f-c-2*_)/(a-s+l-u+f-c),n-11/18-1/6*(c+a+u+o+-f-s-2*_)/(a-c+o-u+f-s)]);break;case 24:b.push([e-.5-3/14*(-s-o+c+l+-f-u+2*_)/(s-o+l-c+f-u),r-.5-3/14*(-s-a+u+l+-f-c+2*_)/(s-a+l-u+f-c),n-9/14-1/14*(-l-i+2*_)/(l-i)]);break;case 25:b.push([e-.5-.25*(a+i+-s-o+c+l+-f-u)/(i-a+s-o+l-c+f-u),r-.5-.25*(o+i+-s-a+u+l+-f-c)/(i-o+s-a+l-u+f-c),n-.5]);break;case 26:b.push([e-.5-.25*(-a-i-s-o+c+l+-f-u+4*_)/(a-i+s-o+l-c+f-u),r-.375-.125*(u+l+-f-c)/(l-u+f-c),n-.625-.125*(-l-i+c+a)/(l-i+a-c)]);break;case 27:b.push([e-.5-3/14*(-s-o+c+l+-f-u+2*_)/(s-o+l-c+f-u),r-.5-3/14*(o+i+u+l+-f-c-2*_)/(i-o+l-u+f-c),n-9/14-1/14*(c+a-2*_)/(a-c)]);break;case 28:b.push([e-.375-.125*(c+l+-f-u)/(l-c+f-u),r-.5-.25*(-o-i-s-a+u+l+-f-c+4*_)/(o-i+s-a+l-u+f-c),n-.625-.125*(-l-i+u+o)/(l-i+o-u)]);break;case 29:b.push([e-.5-3/14*(a+i+c+l+-f-u-2*_)/(i-a+l-c+f-u),r-.5-3/14*(-s-a+u+l+-f-c+2*_)/(s-a+l-u+f-c),n-9/14-1/14*(u+o-2*_)/(o-u)]);break;case 30:b.push([e-7/18-1/6*(-a-i+c+l+-f-u+2*_)/(a-i+l-c+f-u),r-7/18-1/6*(-o-i+u+l+-f-c+2*_)/(o-i+l-u+f-c),n-11/18-1/6*(-l-i+c+a+u+o-2*_)/(l-i+a-c+o-u)]);break;case 31:b.push([e-.5-1/6*(c+l+-f-u)/(l-c+f-u),r-.5-1/6*(u+l+-f-c)/(l-u+f-c),n-5/6-1/6*(c+a+u+o-4*_)/(a-c+o-u)]);break;case 32:b.push([e-.75-.25*(-c-l-f-u+4*_)/(c-l+f-u),r-.5,n-.75-.25*(-c-a-f-s+4*_)/(c-a+f-s)]);break;case 33:b.push([e-.5-3/14*(a+i+-c-l-f-u+2*_)/(i-a+c-l+f-u),r-5/14-1/14*(o+i-2*_)/(i-o),n-.5-3/14*(l+i+-c-a-f-s+2*_)/(i-l+c-a+f-s)]);break;case 34:b.push([e-.7-.3*(-a-i-c-l-f-u+6*_)/(a-i+c-l+f-u),r-.5-.1*(s+a-2*_)/(a-s),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 35:b.push([e-.5-1/6*(-c-l-f-u+4*_)/(c-l+f-u),r-.5-1/6*(o+i+s+a-4*_)/(i-o+a-s),n-.5-1/6*(l+i+-f-s)/(i-l+f-s)]);break;case 36:b.push([e-.5-3/14*(s+o+-c-l-f-u+2*_)/(o-s+c-l+f-u),r-9/14-1/14*(-o-i+2*_)/(o-i),n-.5-3/14*(-c-a+u+o+-f-s+2*_)/(c-a+o-u+f-s)]);break;case 37:b.push([e-.5-.25*(a+i+s+o+-c-l-f-u)/(i-a+o-s+c-l+f-u),r-.5,n-.5-.25*(l+i+-c-a+u+o+-f-s)/(i-l+c-a+o-u+f-s)]);break;case 38:b.push([e-.5-.25*(-a-i+s+o+-c-l-f-u+4*_)/(a-i+o-s+c-l+f-u),r-.625-.125*(-o-i+s+a)/(o-i+a-s),n-.375-.125*(u+o+-f-s)/(o-u+f-s)]);break;case 39:b.push([e-.5-3/14*(s+o+-c-l-f-u+2*_)/(o-s+c-l+f-u),r-9/14-1/14*(s+a-2*_)/(a-s),n-.5-3/14*(l+i+u+o+-f-s-2*_)/(i-l+o-u+f-s)]);break;case 40:b.push([e-.7-.3*(-s-o-c-l-f-u+6*_)/(s-o+c-l+f-u),r-.5-.1*(-s-a+2*_)/(s-a),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 41:b.push([e-.5-.25*(a+i+-s-o-c-l-f-u+4*_)/(i-a+s-o+c-l+f-u),r-.375-.125*(o+i+-s-a)/(i-o+s-a),n-.375-.125*(l+i+-c-a)/(i-l+c-a)]);break;case 42:b.push([e-.5-.5*(-a-i-s-o-c-l-f-u+8*_)/(a-i+s-o+c-l+f-u),r-.5,n-.5]);break;case 43:b.push([e-.3-.3*(-s-o-c-l-f-u+6*_)/(s-o+c-l+f-u),r-.5-.1*(o+i-2*_)/(i-o),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 44:b.push([e-.5-1/6*(-c-l-f-u+4*_)/(c-l+f-u),r-.5-1/6*(-o-i-s-a+4*_)/(o-i+s-a),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 45:b.push([e-.5-3/14*(a+i+-c-l-f-u+2*_)/(i-a+c-l+f-u),r-5/14-1/14*(-s-a+2*_)/(s-a),n-.5-3/14*(l+i+-c-a+u+o-2*_)/(i-l+c-a+o-u)]);break;case 46:b.push([e-.3-.3*(-a-i-c-l-f-u+6*_)/(a-i+c-l+f-u),r-.5-.1*(-o-i+2*_)/(o-i),n-.5-.1*(u+o-2*_)/(o-u)]);break;case 47:b.push([e-.25-.25*(-c-l-f-u+4*_)/(c-l+f-u),r-.5,n-.75-.25*(l+i+u+o-4*_)/(i-l+o-u)]);break;case 48:b.push([e-.5-.1*(-f-u+2*_)/(f-u),r-.5-.1*(u+l-2*_)/(l-u),n-.7-.3*(-l-i-c-a-f-s+6*_)/(l-i+c-a+f-s)]);break;case 49:b.push([e-.5-1/6*(a+i+-f-u)/(i-a+f-u),r-.5-1/6*(o+i+u+l-4*_)/(i-o+l-u),n-.5-1/6*(-c-a-f-s+4*_)/(c-a+f-s)]);break;case 50:b.push([e-.5-1/6*(-a-i-f-u+4*_)/(a-i+f-u),r-.5-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(-l-i-f-s+4*_)/(l-i+f-s)]);break;case 51:b.push([e-.5-.1*(-f-u+2*_)/(f-u),r-.7-.3*(o+i+s+a+u+l-6*_)/(i-o+a-s+l-u),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 52:b.push([e-.375-.125*(s+o+-f-u)/(o-s+f-u),r-.625-.125*(-o-i+u+l)/(o-i+l-u),n-.5-.25*(-l-i-c-a+u+o+-f-s+4*_)/(l-i+c-a+o-u+f-s)]);break;case 53:b.push([e-.5-3/14*(a+i+s+o+-f-u-2*_)/(i-a+o-s+f-u),r-9/14-1/14*(u+l-2*_)/(l-u),n-.5-3/14*(-c-a+u+o+-f-s+2*_)/(c-a+o-u+f-s)]);break;case 54:b.push([e-7/18-1/6*(-a-i+s+o+-f-u+2*_)/(a-i+o-s+f-u),r-11/18-1/6*(-o-i+s+a+u+l-2*_)/(o-i+a-s+l-u),n-7/18-1/6*(-l-i+u+o+-f-s+2*_)/(l-i+o-u+f-s)]);break;case 55:b.push([e-.5-1/6*(s+o+-f-u)/(o-s+f-u),r-5/6-1/6*(s+a+u+l-4*_)/(a-s+l-u),n-.5-1/6*(u+o+-f-s)/(o-u+f-s)]);break;case 56:b.push([e-.5-1/6*(-s-o-f-u+4*_)/(s-o+f-u),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 57:b.push([e-.5-3/14*(a+i+-s-o-f-u+2*_)/(i-a+s-o+f-u),r-.5-3/14*(o+i+-s-a+u+l-2*_)/(i-o+s-a+l-u),n-5/14-1/14*(-c-a+2*_)/(c-a)]);break;case 58:b.push([e-.3-.3*(-a-i-s-o-f-u+6*_)/(a-i+s-o+f-u),r-.5-.1*(u+l-2*_)/(l-u),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 59:b.push([e-.25-.25*(-s-o-f-u+4*_)/(s-o+f-u),r-.75-.25*(o+i+u+l-4*_)/(i-o+l-u),n-.5]);break;case 60:b.push([e-5/14-1/14*(-f-u+2*_)/(f-u),r-.5-3/14*(-o-i-s-a+u+l+2*_)/(o-i+s-a+l-u),n-.5-3/14*(-l-i-c-a+u+o+2*_)/(l-i+c-a+o-u)]);break;case 61:b.push([e-.5-1/6*(a+i+-f-u)/(i-a+f-u),r-.5-1/6*(-s-a+u+l)/(s-a+l-u),n-.5-1/6*(-c-a+u+o)/(c-a+o-u)]);break;case 62:b.push([e-1/6-1/6*(-a-i-f-u+4*_)/(a-i+f-u),r-.5-1/6*(-o-i+u+l)/(o-i+l-u),n-.5-1/6*(-l-i+u+o)/(l-i+o-u)]);break;case 63:b.push([e-1/6-1/6*(-f-u+2*_)/(f-u),r-5/6-1/6*(u+l-2*_)/(l-u),n-5/6-1/6*(u+o-2*_)/(o-u)]);break;case 64:b.push([e-.5,r-.75-.25*(-u-l-f-c+4*_)/(u-l+f-c),n-.75-.25*(-u-o-f-s+4*_)/(u-o+f-s)]);break;case 65:b.push([e-5/14-1/14*(a+i-2*_)/(i-a),r-.5-3/14*(o+i+-u-l-f-c+2*_)/(i-o+u-l+f-c),n-.5-3/14*(l+i+-u-o-f-s+2*_)/(i-l+u-o+f-s)]);break;case 66:b.push([e-9/14-1/14*(-a-i+2*_)/(a-i),r-.5-3/14*(s+a+-u-l-f-c+2*_)/(a-s+u-l+f-c),n-.5-3/14*(c+a+-u-o-f-s+2*_)/(a-c+u-o+f-s)]);break;case 67:b.push([e-.5,r-.5-.25*(o+i+s+a+-u-l-f-c)/(i-o+a-s+u-l+f-c),n-.5-.25*(l+i+c+a+-u-o-f-s)/(i-l+a-c+u-o+f-s)]);break;case 68:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.7-.3*(-o-i-u-l-f-c+6*_)/(o-i+u-l+f-c),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 69:b.push([e-.5-1/6*(a+i+s+o-4*_)/(i-a+o-s),r-.5-1/6*(-u-l-f-c+4*_)/(u-l+f-c),n-.5-1/6*(l+i+-f-s)/(i-l+f-s)]);break;case 70:b.push([e-.625-.125*(-a-i+s+o)/(a-i+o-s),r-.5-.25*(-o-i+s+a+-u-l-f-c+4*_)/(o-i+a-s+u-l+f-c),n-.375-.125*(c+a+-f-s)/(a-c+f-s)]);break;case 71:b.push([e-9/14-1/14*(s+o-2*_)/(o-s),r-.5-3/14*(s+a+-u-l-f-c+2*_)/(a-s+u-l+f-c),n-.5-3/14*(l+i+c+a+-f-s-2*_)/(i-l+a-c+f-s)]);break;case 72:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.7-.3*(-s-a-u-l-f-c+6*_)/(s-a+u-l+f-c),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 73:b.push([e-.375-.125*(a+i+-s-o)/(i-a+s-o),r-.5-.25*(o+i+-s-a-u-l-f-c+4*_)/(i-o+s-a+u-l+f-c),n-.375-.125*(l+i+-u-o)/(i-l+u-o)]);break;case 74:b.push([e-.5-1/6*(-a-i-s-o+4*_)/(a-i+s-o),r-.5-1/6*(-u-l-f-c+4*_)/(u-l+f-c),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 75:b.push([e-5/14-1/14*(-s-o+2*_)/(s-o),r-.5-3/14*(o+i+-u-l-f-c+2*_)/(i-o+u-l+f-c),n-.5-3/14*(l+i+c+a+-u-o-2*_)/(i-l+a-c+u-o)]);break;case 76:b.push([e-.5,r-.5-.5*(-o-i-s-a-u-l-f-c+8*_)/(o-i+s-a+u-l+f-c),n-.5]);break;case 77:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.3-.3*(-s-a-u-l-f-c+6*_)/(s-a+u-l+f-c),n-.5-.1*(l+i-2*_)/(i-l)]);break;case 78:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.3-.3*(-o-i-u-l-f-c+6*_)/(o-i+u-l+f-c),n-.5-.1*(c+a-2*_)/(a-c)]);break;case 79:b.push([e-.5,r-.25-.25*(-u-l-f-c+4*_)/(u-l+f-c),n-.75-.25*(l+i+c+a-4*_)/(i-l+a-c)]);break;case 80:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.5-.1*(-f-c+2*_)/(f-c),n-.7-.3*(-l-i-u-o-f-s+6*_)/(l-i+u-o+f-s)]);break;case 81:b.push([e-.5-1/6*(a+i+c+l-4*_)/(i-a+l-c),r-.5-1/6*(o+i+-f-c)/(i-o+f-c),n-.5-1/6*(-u-o-f-s+4*_)/(u-o+f-s)]);break;case 82:b.push([e-.625-.125*(-a-i+c+l)/(a-i+l-c),r-.375-.125*(s+a+-f-c)/(a-s+f-c),n-.5-.25*(-l-i+c+a+-u-o-f-s+4*_)/(l-i+a-c+u-o+f-s)]);break;case 83:b.push([e-9/14-1/14*(c+l-2*_)/(l-c),r-.5-3/14*(o+i+s+a+-f-c-2*_)/(i-o+a-s+f-c),n-.5-3/14*(c+a+-u-o-f-s+2*_)/(a-c+u-o+f-s)]);break;case 84:b.push([e-.5-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(-o-i-f-c+4*_)/(o-i+f-c),n-.5-1/6*(-l-i-f-s+4*_)/(l-i+f-s)]);break;case 85:b.push([e-.7-.3*(a+i+s+o+c+l-6*_)/(i-a+o-s+l-c),r-.5-.1*(-f-c+2*_)/(f-c),n-.5-.1*(-f-s+2*_)/(f-s)]);break;case 86:b.push([e-11/18-1/6*(-a-i+s+o+c+l-2*_)/(a-i+o-s+l-c),r-7/18-1/6*(-o-i+s+a+-f-c+2*_)/(o-i+a-s+f-c),n-7/18-1/6*(-l-i+c+a+-f-s+2*_)/(l-i+a-c+f-s)]);break;case 87:b.push([e-5/6-1/6*(s+o+c+l-4*_)/(o-s+l-c),r-.5-1/6*(s+a+-f-c)/(a-s+f-c),n-.5-1/6*(c+a+-f-s)/(a-c+f-s)]);break;case 88:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(-s-a-f-c+4*_)/(s-a+f-c),n-.5-1/6*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 89:b.push([e-.5-3/14*(a+i+-s-o+c+l-2*_)/(i-a+s-o+l-c),r-.5-3/14*(o+i+-s-a-f-c+2*_)/(i-o+s-a+f-c),n-5/14-1/14*(-u-o+2*_)/(u-o)]);break;case 90:b.push([e-.5-3/14*(-a-i-s-o+c+l+2*_)/(a-i+s-o+l-c),r-5/14-1/14*(-f-c+2*_)/(f-c),n-.5-3/14*(-l-i+c+a+-u-o+2*_)/(l-i+a-c+u-o)]);break;case 91:b.push([e-.5-1/6*(-s-o+c+l)/(s-o+l-c),r-.5-1/6*(o+i+-f-c)/(i-o+f-c),n-.5-1/6*(c+a+-u-o)/(a-c+u-o)]);break;case 92:b.push([e-.5-.1*(c+l-2*_)/(l-c),r-.3-.3*(-o-i-s-a-f-c+6*_)/(o-i+s-a+f-c),n-.5-.1*(-l-i+2*_)/(l-i)]);break;case 93:b.push([e-.75-.25*(a+i+c+l-4*_)/(i-a+l-c),r-.25-.25*(-s-a-f-c+4*_)/(s-a+f-c),n-.5]);break;case 94:b.push([e-.5-1/6*(-a-i+c+l)/(a-i+l-c),r-1/6-1/6*(-o-i-f-c+4*_)/(o-i+f-c),n-.5-1/6*(-l-i+c+a)/(l-i+a-c)]);break;case 95:b.push([e-5/6-1/6*(c+l-2*_)/(l-c),r-1/6-1/6*(-f-c+2*_)/(f-c),n-5/6-1/6*(c+a-2*_)/(a-c)]);break;case 96:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.5-.1*(-u-l+2*_)/(u-l),n-.7-.3*(-c-a-u-o-f-s+6*_)/(c-a+u-o+f-s)]);break;case 97:b.push([e-.375-.125*(a+i+-c-l)/(i-a+c-l),r-.375-.125*(o+i+-u-l)/(i-o+u-l),n-.5-.25*(l+i+-c-a-u-o-f-s+4*_)/(i-l+c-a+u-o+f-s)]);break;case 98:b.push([e-.5-1/6*(-a-i-c-l+4*_)/(a-i+c-l),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(-u-o-f-s+4*_)/(u-o+f-s)]);break;case 99:b.push([e-5/14-1/14*(-c-l+2*_)/(c-l),r-.5-3/14*(o+i+s+a+-u-l-2*_)/(i-o+a-s+u-l),n-.5-3/14*(l+i+-u-o-f-s+2*_)/(i-l+u-o+f-s)]);break;case 100:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(-o-i-u-l+4*_)/(o-i+u-l),n-.5-1/6*(-c-a-f-s+4*_)/(c-a+f-s)]);break;case 101:b.push([e-.5-3/14*(a+i+s+o+-c-l-2*_)/(i-a+o-s+c-l),r-5/14-1/14*(-u-l+2*_)/(u-l),n-.5-3/14*(l+i+-c-a-f-s+2*_)/(i-l+c-a+f-s)]);break;case 102:b.push([e-.5-3/14*(-a-i+s+o+-c-l+2*_)/(a-i+o-s+c-l),r-.5-3/14*(-o-i+s+a+-u-l+2*_)/(o-i+a-s+u-l),n-5/14-1/14*(-f-s+2*_)/(f-s)]);break;case 103:b.push([e-.5-1/6*(s+o+-c-l)/(o-s+c-l),r-.5-1/6*(s+a+-u-l)/(a-s+u-l),n-.5-1/6*(l+i+-f-s)/(i-l+f-s)]);break;case 104:b.push([e-.5-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 105:b.push([e-7/18-1/6*(a+i+-s-o-c-l+2*_)/(i-a+s-o+c-l),r-7/18-1/6*(o+i+-s-a-u-l+2*_)/(i-o+s-a+u-l),n-7/18-1/6*(l+i+-c-a-u-o+2*_)/(i-l+c-a+u-o)]);break;case 106:b.push([e-.3-.3*(-a-i-s-o-c-l+6*_)/(a-i+s-o+c-l),r-.5-.1*(-u-l+2*_)/(u-l),n-.5-.1*(-u-o+2*_)/(u-o)]);break;case 107:b.push([e-1/6-1/6*(-s-o-c-l+4*_)/(s-o+c-l),r-.5-1/6*(o+i+-u-l)/(i-o+u-l),n-.5-1/6*(l+i+-u-o)/(i-l+u-o)]);break;case 108:b.push([e-.5-.1*(-c-l+2*_)/(c-l),r-.3-.3*(-o-i-s-a-u-l+6*_)/(o-i+s-a+u-l),n-.5-.1*(-c-a+2*_)/(c-a)]);break;case 109:b.push([e-.5-1/6*(a+i+-c-l)/(i-a+c-l),r-1/6-1/6*(-s-a-u-l+4*_)/(s-a+u-l),n-.5-1/6*(l+i+-c-a)/(i-l+c-a)]);break;case 110:b.push([e-.25-.25*(-a-i-c-l+4*_)/(a-i+c-l),r-.25-.25*(-o-i-u-l+4*_)/(o-i+u-l),n-.5]);break;case 111:b.push([e-1/6-1/6*(-c-l+2*_)/(c-l),r-1/6-1/6*(-u-l+2*_)/(u-l),n-5/6-1/6*(l+i-2*_)/(i-l)]);break;case 112:b.push([e-.5,r-.5,n-.5-.5*(-l-i-c-a-u-o-f-s+8*_)/(l-i+c-a+u-o+f-s)]);break;case 113:b.push([e-.5-.1*(a+i-2*_)/(i-a),r-.5-.1*(o+i-2*_)/(i-o),n-.3-.3*(-c-a-u-o-f-s+6*_)/(c-a+u-o+f-s)]);break;case 114:b.push([e-.5-.1*(-a-i+2*_)/(a-i),r-.5-.1*(s+a-2*_)/(a-s),n-.3-.3*(-l-i-u-o-f-s+6*_)/(l-i+u-o+f-s)]);break;case 115:b.push([e-.5,r-.75-.25*(o+i+s+a-4*_)/(i-o+a-s),n-.25-.25*(-u-o-f-s+4*_)/(u-o+f-s)]);break;case 116:b.push([e-.5-.1*(s+o-2*_)/(o-s),r-.5-.1*(-o-i+2*_)/(o-i),n-.3-.3*(-l-i-c-a-f-s+6*_)/(l-i+c-a+f-s)]);break;case 117:b.push([e-.75-.25*(a+i+s+o-4*_)/(i-a+o-s),r-.5,n-.25-.25*(-c-a-f-s+4*_)/(c-a+f-s)]);break;case 118:b.push([e-.5-1/6*(-a-i+s+o)/(a-i+o-s),r-.5-1/6*(-o-i+s+a)/(o-i+a-s),n-1/6-1/6*(-l-i-f-s+4*_)/(l-i+f-s)]);break;case 119:b.push([e-5/6-1/6*(s+o-2*_)/(o-s),r-5/6-1/6*(s+a-2*_)/(a-s),n-1/6-1/6*(-f-s+2*_)/(f-s)]);break;case 120:b.push([e-.5-.1*(-s-o+2*_)/(s-o),r-.5-.1*(-s-a+2*_)/(s-a),n-.3-.3*(-l-i-c-a-u-o+6*_)/(l-i+c-a+u-o)]);break;case 121:b.push([e-.5-1/6*(a+i+-s-o)/(i-a+s-o),r-.5-1/6*(o+i+-s-a)/(i-o+s-a),n-1/6-1/6*(-c-a-u-o+4*_)/(c-a+u-o)]);break;case 122:b.push([e-.25-.25*(-a-i-s-o+4*_)/(a-i+s-o),r-.5,n-.25-.25*(-l-i-u-o+4*_)/(l-i+u-o)]);break;case 123:b.push([e-1/6-1/6*(-s-o+2*_)/(s-o),r-5/6-1/6*(o+i-2*_)/(i-o),n-1/6-1/6*(-u-o+2*_)/(u-o)]);break;case 124:b.push([e-.5,r-.25-.25*(-o-i-s-a+4*_)/(o-i+s-a),n-.25-.25*(-l-i-c-a+4*_)/(l-i+c-a)]);break;case 125:b.push([e-5/6-1/6*(a+i-2*_)/(i-a),r-1/6-1/6*(-s-a+2*_)/(s-a),n-1/6-1/6*(-c-a+2*_)/(c-a)]);break;case 126:b.push([e-1/6-1/6*(-a-i+2*_)/(a-i),r-1/6-1/6*(-o-i+2*_)/(o-i),n-1/6-1/6*(-l-i+2*_)/(l-i)]);break;case 127:b.push([e-.5,r-.5,n-.5])}}(127&w,t,e,r,n,i,a,o,s,l,c,u,0,0,0,0,0,0,0,0,x,_)}},cell:function(t,e,r,n,i,a,o,s,l,c,u){o?c.push([n,r,t],[t,e,n]):c.push([t,r,n],[n,e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}};var o={}},{"ndarray-extract-contour":464,"zero-crossings":631}],577:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=2*Math.PI,a=function(t,e,r,n,i,a,o){var s=t.x,l=t.y;return{x:n*(s*=e)-i*(l*=r)+a,y:i*s+n*l+o}},o=function(t,e){var r=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},s=function(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,p=void 0===h?0:h,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);T>1&&(u*=Math.sqrt(T),f*=Math.sqrt(T));var k=function(t,e,r,n,a,o,l,c,u,f,h,p){var d=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(p,2),y=d*m-d*v-m*g;y<0&&(y=0),y/=d*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*p,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,T=(h-x)/a,k=(p-b)/o,M=(-h-x)/a,A=(-p-b)/o,S=s(1,0,T,k),E=s(T,k,M,A);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),M=n(k,4),A=M[0],S=M[1],E=M[2],L=M[3],C=Math.abs(L)/(i/4);Math.abs(1-C)<1e-7&&(C=1);var P=Math.max(Math.ceil(C),1);L/=P;for(var I=0;Ie[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":71,assert:80,"is-svg-path":449,"normalize-svg-path":579,"parse-svg-path":482}],579:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,p=0,d=0,m=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=p),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":577}],580:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var h=Math.min(r,f),p=e.stroke||0,d=e.viewbox||e.viewBox||i(t),m=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p));if(u.translate(.5*r,.5*f),u.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),p&&u.stroke(v)}else{var y=a(t);o(u,y),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":105,"draw-svg-path":180,"is-svg-path":449,"parse-svg-path":482,"svg-path-bounds":578}],581:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function t(e,r,i){i=i||{};var o=a[e];o||(o=a[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var p=new Float32Array(u),d=0,m=-.5*f;for(h=0;h=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":514,timers:582}],583:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(p=e.r,d=e.g,m=e.b,i={r:255*C(p,255),g:255*C(d,255),b:255*C(m,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),c=z(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),u=z(e.l),i=function(t,e,r){var n,i,a;function o(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}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var p,d,m;return a=L(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.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 e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(D(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("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()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(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(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,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(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.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"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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})$/});function U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],584:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=f(e),h=t.objects,p={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in h)p[c]=m(h[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++rMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=h.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,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),v=Math.sin(d),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,T=x,k=-g*x,M=-v*x,A=y,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*h[a]+T*e[a];E[4*a+1]=k*r[a]+M*h[a]+A*e[a],E[4*a+2]=L,E[4*a+3]=0}var C=E[1],P=E[5],I=E[9],O=E[2],z=E[6],D=E[10],R=P*D-I*z,F=I*O-C*D,B=C*z-P*O,N=c(R,F,B);R/=N,F/=N,B/=N,E[0]=R,E[4]=F,E[8]=B;for(a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var j=0;j<3;++j)u+=E[a+4*j]*S[j];E[12+a]=-u}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 d=[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;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];a(i,i,n,d);for(c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],f=i[4],h=i[8],p=u*a+f*o+h*s,d=c(u-=a*p,f-=o*p,h-=s*p),m=(u/=d)*e+a*r,g=(f/=d)*e+o*r,v=(h/=d)*e+s*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),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,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),p=Math.abs(l),d=Math.abs(f),m=Math.max(h,p,d);h===m?(s=s<0?-1:1,l=f=0):d===m?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=c(s,l,f);s/=g,l/=g,f/=g}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,T=c(x-=s*w,b-=l*w,_-=f*w),k=l*(_/=T)-f*(b/=T),M=f*(x/=T)-s*_,A=s*b-l*x,S=c(k,M,A);if(k/=S,M/=S,A/=S,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var E=e[1],L=e[5],C=e[9],P=E*x+L*b+C*_,I=E*k+L*M+C*A;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(I,P)}else{var O=e[2],z=e[6],D=e[10],R=O*s+z*l+D*f,F=O*x+z*b+D*_,B=O*k+z*M+D*A;v=Math.asin(u(R)),y=Math.atan2(B,F)}this.angle.jump(t,y,v),this.recalcMatrix(t);var N=e[2],j=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,G-j*W,Y-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,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],p=c(l,f,h);if(!(p<1e-6)){l/=p,f/=p,h/=p;var d=this.computedRight,m=d[0],g=d[1],v=d[2],y=i*m+a*g+o*v,x=c(m-=y*i,g-=y*a,v-=y*o);if(!(x<.01&&(x=c(m=a*h-o*f,g=o*l-i*h,v=i*f-a*l))<1e-6)){m/=x,g/=x,v/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*v-o*g,_=o*m-i*v,w=i*g-a*m,T=c(b,_,w),k=i*l+a*f+o*h,M=m*l+g*f+v*h,A=(b/=T)*l+(_/=T)*f+(w/=T)*h,S=Math.asin(u(k)),E=Math.atan2(A,M),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var I=Math.abs(C+2*Math.PI-E),O=Math.abs(C-E),z=Math.abs(C-2*Math.PI-E);I":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":592}],594:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":600}],595:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":591,"./is":596}],596:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":590}],597:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":594}],598:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":594,"../value/is":600}],599:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":591,"./is":600}],600:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],601:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function M(t){return new DataView(p(t),0,t)}function A(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.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|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return A(t);case"data":case"dataview":return M(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=M,r.mallocBuffer=A,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":104,buffer:117,dup:182}],602:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(p=0;p-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(S(),"?px "),g*=Math.pow(.75,l-s),n=n.replace("?px ",S())),m+=.25*x*(l-s)}if(!0===o.superscripts){var c=t.indexOf("+"),u=r.indexOf("+"),f=c>-1?parseInt(t[1+c]):0,h=u>-1?parseInt(r[1+u]):0;f!==h&&(n=n.replace(S(),"?px "),g*=Math.pow(.75,h-f),n=n.replace("?px ",S())),m-=.25*x*(h-f)}if(!0===o.bolds){var p=t.indexOf("b|")>-1,d=r.indexOf("b|")>-1;!p&&d&&(n=v?n.replace("italic ","italic bold "):"bold "+n),p&&!d&&(n=n.replace("bold ",""))}if(!0===o.italics){var v=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!v&&y&&(n="italic "+n),v&&!y&&(n=n.replace("italic ",""))}e.font=n}for(h=0;h",a="",o=i.length,s=a.length,l="+"===e[0]||"-"===e[0],c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var f=c;f=u)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var p=c+o,d=r.substr(p,u-p).indexOf(i);c=-1!==d?d:u+s}return n}function u(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var i=u(t,n),a=function(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=0?e[a]:i}))},has___:{value:y((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:y((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};d.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 r?function(){function n(){this instanceof d||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new d),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new d),i.set___(t,e)}else n.set(t,e);return this},Object.create(d.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(e)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==m)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=d.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=d)}function m(t){t.permitHostObjects___&&t.permitHostObjects___(m)}function g(t){return!("weakmap:"==t.substr(0,"weakmap:".length)&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[l];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,l,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){h||"undefined"==typeof console||(h=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],610:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){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:n(e,t)}}},{"./hidden-store.js":611}],611:[function(t,e,r){e.exports=function(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}},{}],612:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":610}],613:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":252}],614:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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(l);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(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\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"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},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}return this.toMonthIndex(t,n,r)},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 i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var p,d=f[a.year-f[0]];for(p=0;p<13;p++){var m=d&1<<12-p?30:29;if(l>13;!g||p=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(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"};n.calendars.discworld=a},{"../main":628,"object-assign":476}],617:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.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)}}),n.calendars.ethiopian=a},{"../main":628,"object-assign":476}],618:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":628,"object-assign":476}],619:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+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)}}),n.calendars.islamic=a},{"../main":628,"object-assign":476}],620:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.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)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":628,"object-assign":476}],621:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.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)}}),n.calendars.mayan=a},{"../main":628,"object-assign":476}],622:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.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,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=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)}}),n.calendars.nanakshahi=a},{"../main":628,"object-assign":476}],623:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?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,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":628,"object-assign":476}],625:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.taiwan=o},{"../main":628,"object-assign":476}],626:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.thai=o},{"../main":628,"object-assign":476}],627:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.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,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;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":628,"object-assign":476}],628:[function(t,e,r){var n=t("object-assign");function i(){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 a(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.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()).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]}}}),n(a.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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();"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&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}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,c.local.invalidDate||c.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.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":476}],629:[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;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=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(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(M));return M+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=m;for(var E=this.daysInMonth(h,p);d>E;E=this.daysInMonth(h,p))p++,d-=E}return f>-1?this.fromJD(f):this.newDate(h,p,d)},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;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).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}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":628,"object-assign":476}],630:[function(t,e,r){"use strict";var n,i=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,f=s;for(u=0;u=0!=p>=0&&i.push(l[0]+.5+.5*(h+p)/(h-p)),n+=f,++l[0]}}};e.exports=(n={funcName:{funcName:"zeroCrossings"}.funcName},function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(i.bind(void 0,n)))},{}],631:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":630}],632:[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,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],633:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":756,"../../plot_api/plot_template":827,"../../plots/cartesian/constants":845,"../../plots/font_attributes":867,"./arrow_paths":632}],634:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+h,m=p-h,g=3*t.startarrowsize*t.arrowwidth||0,v=g+h,y=g-h;if(c===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(f,m,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":787,"../../plots/cartesian/axes":838,"./draw":639}],635:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?it._offset+it._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?it._offset+it._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var mt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ft.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ft.tail=T.t+T.h*mt):ft.tail=T.l+T.w*mt:ft.tail=it._offset+it.r2p(mt),K=tt}else ft.tail=J+mt,K=tt+mt;ft.text=ft.tail+tt;var vt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,vt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-vt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*q($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(M-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+bt-1,y:N+_t}).call(u.setClipUrl,U?L:null,t);else{var wt=N+_t-m.top,Tt=N+bt-m.left;G.call(h.positionText,Tt,wt).call(u.setClipUrl,U?L:null,t)}V.select("rect").call(u.setRect,N,N,M,D),j.call(u.setRect,F/2,F/2,B-F,H-F),R.call(u.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-H/2)),O.attr({transform:"rotate("+P+","+C.x.text+","+C.y.text+")"});var kt,Mt=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,p=C.y.tail+n,m=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,m,b),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),L=+j.attr("width"),z=+j.attr("height"),D=m-.5*L,F=D+L,B=b-.5*z,N=B+z,U=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,p,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var V=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=I.append("g").style({opacity:c.opacity(H)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+h+","+p+"L"+l+","+f).style("stroke-width",V+"px").call(c.stroke,c.rgb(H));if(g(Y,q,e),k.annotationPosition&&Y.node().parentNode&&!a){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-p,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(p-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(p-X),transform:s(W,X)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);J=t.x,K=t.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",s(t,r)),O.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(a)return;var i,o;if(v)i=y(v,t,"x",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(c+t/T.w,l,0,1,e.xanchor)}if(x)o=y(x,r,"y",T,e);else{var u=e._ysize/T.h,f=e.y-(e._yshift+e.yshift)/T.h-u/2;o=d.align(f-r/T.h,u,0,1,e.yanchor)}S("x",i),S("y",o),v&&x||(n=d.getCursor(v?.5:i,x?.5:o,e.xanchor,e.yanchor))}O.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){p(R),i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=e.indexOf("end")>=0,b=d.backoff*g+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(h=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void z();if(b){if(b*b>w*w+T*T)return void z();var k=b*Math.cos(f),M=b*Math.sin(f);u.x+=k,u.y+=M,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void z();var A=_*Math.cos(f),S=_*Math.sin(f);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),L="";if(E1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":889,"../annotations/draw":639}],646:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=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 a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}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(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={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 n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*c.roundUp(Z/J,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(Y.tick0=0)}Y.dtick=W}Y.domain=[H+j,H+F-j],Y.setScale(),t.attr("transform",u(Math.round(l.l),Math.round(l.t)));var K,Q=t.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+M.cbaxis),tt=0;function et(n,i){var a={propContainer:Y,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),m.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+B)*l.w,n=Y.title.font.size;t="top"===A?(1-(H+F-j))*l.h+l.t+3+.75*n:(1-(H+j))*l.h+l.t-3-.25*n,et(Y._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var a=t.select("."+M.cbtitle),o=a.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],h=a.select(".h"+Y._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),h?(tt=p.bBox(h).height)>d&&(f[1]-=(tt-d)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(tt=p.bBox(o.node()).height),tt){if(tt+=5,"top"===A)Y.domain[1]-=tt/l.h,f[1]*=-1;else{Y.domain[0]+=tt/l.h;var m=g.lineCount(o);f[1]+=(1-m)*d}a.attr("transform",u(f[0],f[1])),Y.setScale()}}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",u(0,Math.round(l.h*(1-Y.domain[1])))),$.attr("transform",u(0,Math.round(-l.t)));var y=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(I);y.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),y.exit().remove();var x=S.map(Y.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var o=[0===a?S[0]:(I[a]+I[a-1])/2,a===I.length-1?S[1]:(I[a]+I[a+1])/2].map(Y.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var s=n.select(this).attr({x:U,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)p.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var b=t.select("."+M.cblines).selectAll("path."+M.cbline).data(v.color&&v.width?O:[]);b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(Y.c2p(t))+v.width/2%1)+"h"+z).call(p.lineGroupStyle,v.width,E(t),v.dash)})),$.selectAll("g."+Y._id+"tick,path").remove();var _=U+z+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(Y),k=s.getTickSigns(Y)[2];return s.drawTicks(r,Y,{vals:"inside"===Y.ticks?s.clipEnds(Y,T):T,layer:$,path:s.makeTickPath(Y,_,k),transFn:s.makeTransTickFn(Y)}),s.drawLabels(r,Y,{vals:T,layer:$,transFn:s.makeTransTickLabelFn(Y),labelFns:s.makeLabelFns(Y,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=Y.title.font.size,e=Y._offset+Y._length/2,i=l.l+(Y.position||0)*l.w+("right"===Y.side?10+t*(Y.showticklabels?1:.5):-10-t*(Y.showticklabels?.5:0));et("h"+Y._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Y._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=z+e.outlinewidth/2;if(-1===Y.ticklabelposition.indexOf("inside")&&(n+=p.bBox($.node()).width),(K=Q.select("text")).node()&&!K.classed(M.jsPlaceholder)){var i,o=Q.select(".h"+Y._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox(Q.node()).right-U-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,c=q-G;t.select("."+M.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-N,width:Math.max(s,2),height:Math.max(c+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+M.cboutline).attr({x:U,y:G+e.ypad+("top"===A?tt:0),width:Math.max(z,2),height:Math.max(c-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",u(l.l-f,l.t));var h={},m=T[e.yanchor],g=k[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=c*m,h.b=c*g):(h.t=h.b=0,h.yt=e.y+e.len*m,h.yb=e.y-e.len*g);var v=T[e.xanchor],y=k[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*v,h.r=s*y;else{var x=s-z;h.l=x*v,h.r=x*y,h.xl=e.x-e.thickness*v,h.xr=e.x+e.thickness*y}a.autoMargin(r,e._id,h)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var c=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,c)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":755,"../../lib":787,"../../lib/extend":777,"../../lib/setcursor":808,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_defaults":840,"../../plots/cartesian/layout_attributes":853,"../../plots/cartesian/position_defaults":856,"../../plots/plots":901,"../../registry":915,"../color":650,"../colorscale/helpers":661,"../dragelement":669,"../drawing":672,"../titles":748,"./constants":652,"@plotly/d3":58,tinycolor2:583}],655:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":787}],656:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":651,"./defaults":653,"./draw":654,"./has_colorbar":655}],657:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var p=a+"auto",d=a+"min",m=a+"max",g=a+"mid",v=(s(h+p),s(h+d),s(h+m),{});v[d]=v[m]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":804,"../../lib/sort_object_keys":810,"../colorbar/attributes":651,"./scales.js":665}],658:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,p=f.min,d=f.max,m=f.mid,g=function(){return i.aggNums(Math.min,null,l)},v=function(){return i.aggNums(Math.max,null,l)};(void 0===p?p=g():h&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===d?d=v():h&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),h&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":787,"./helpers":661,"fast-isnumeric":246}],659:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],667:[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":787}],668:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],669:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var c=t("./unhover");function u(){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 f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,p,d,m,g=t.gd,v=1,y=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)y&&(v=Math.max(v-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":787,"../../plots/cartesian/constants":845,"./align":666,"./cursor":667,"./unhover":670,"has-hover":435,"has-passive-events":436,"mouse-event-offset":460}],670:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":775,"../../lib/events":776,"../../lib/throttle":814,"../fx/constants":684}],671:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],672:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,x=e.exports={};x.font=function(t,e,r,n){i.isPlainObject(e)&&(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(c.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.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||"";c.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(c.fill,e)},x.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(c.fill,t[0].trace.fillcolor)}))};var b=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(b).forEach((function(t){var e=b[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var _=x.symbolNames.length;function w(t,e){var r=t%100;return x.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(t))t=+t;else 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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},M=a("~f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=A[a],h=new Array(u),p=0;p"+v(t);d._gradientUrlQueryParts[y]=1},x.pattern=function(t,e,r,a,o,s,l,u,f,h,p,d){var m="legend"===e;u&&("overlay"===f?(h=u,p=c.contrast(h)):(h=void 0,p=u));var g,v,y,x,b,_,w,T,k,M,A,S=r._fullLayout,E="p"+S._uid+"-"+a,L={};switch(o){case"/":g=s*Math.sqrt(2),v=s*Math.sqrt(2),_="path",L={d:y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"\\":g=s*Math.sqrt(2),v=s*Math.sqrt(2),_="path",L={d:y="M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"x":g=s*Math.sqrt(2),v=s*Math.sqrt(2),y="M-"+g/4+","+v/4+"l"+g/2+",-"+v/2+"M0,"+v+"L"+g+",0M"+g/4*3+","+v/4*5+"l"+g/2+",-"+v/2+"M"+g/4*3+",-"+v/4+"l"+g/2+","+v/2+"M0,0L"+g+","+v+"M-"+g/4+","+v/4*3+"l"+g/2+","+v/2,x=s-s*Math.sqrt(1-l),_="path",L={d:y,opacity:d,stroke:p,"stroke-width":x+"px"};break;case"|":_="path",_="path",L={d:y="M"+(g=s)/2+",0L"+g/2+","+(v=s),opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"-":_="path",_="path",L={d:y="M0,"+(v=s)/2+"L"+(g=s)+","+v/2,opacity:d,stroke:p,"stroke-width":(x=l*s)+"px"};break;case"+":_="path",y="M"+(g=s)/2+",0L"+g/2+","+(v=s)+"M0,"+v/2+"L"+g+","+v/2,x=s-s*Math.sqrt(1-l),_="path",L={d:y,opacity:d,stroke:p,"stroke-width":x+"px"};break;case".":g=s,v=s,l.pattern_filled";S._patternUrlQueryParts[I]=1},x.initGradients=function(t){var e=t._fullLayout;i.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},x.initPatterns=function(t){var e=t._fullLayout;i.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),e._patternUrlQueryParts={}},x.getPatternAttr=function(t,e,r){return t&&i.isArrayOrTypedArray(t)?e=100,e.attr("d",w(u,l))}var f,h,p,d=!1;if(t.so)p=s.outlierwidth,h=s.outliercolor,f=o.outliercolor;else{var m=(s||{}).width;p=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(f=c.defaultLine,d=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var g=o.gradient,v=t.mgt;v?d=!0:v=g&&g.type,i.isArrayOrTypedArray(v)&&(v=v[0],A[v]||(v=0));var y=o.pattern,b=y&&x.getPatternAttr(y.shape,t.i,"");if(v&&"none"!==v){var _=t.mgc;_?d=!0:_=g.color;var T=r.uid;d&&(T+="-"+t.i),x.gradient(e,a,T,v,[[0,_],[1,f]],"fill")}else if(b){var k=x.getPatternAttr(y.bgcolor,t.i,null),M=x.getPatternAttr(y.fgcolor,t.i,null),S=y.fgopacity,E=x.getPatternAttr(y.size,t.i,8),L=x.getPatternAttr(y.solidity,t.i,.3),C=t.mcc||i.isArrayOrTypedArray(y.shape)||i.isArrayOrTypedArray(y.bgcolor)||i.isArrayOrTypedArray(y.size)||i.isArrayOrTypedArray(y.solidity),P=r.uid;C&&(P+="-"+t.i),x.pattern(e,"point",a,P,b,E,L,t.mcc,y.fillmode,k,M,S)}else c.fill(e,f);p&&c.stroke(e,h)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,p=void 0!==f;(i.isArrayOrTypedArray(c)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:p?f:m*e});var d=a.color,g=o.color,v=s.color;(g||v)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:v||e});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",w(x.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=L(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,g,v).text(c).call(h.convertToTspans,r).call(E,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);c.fill(i,a),E(i,o,s,t.mrc2||t.mrc)}))}};function C(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,.25),u=Math.pow(s*s+l*l,.25),f=(u*u*a-c*c*s)*i,h=(u*u*o-c*c*l)*i,p=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(p&&f/p),2),n.round(e[1]+(p&&h/p),2)],[n.round(e[0]-(d&&f/d),2),n.round(e[1]-(d&&h/d),2)]]}x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(x.savedBBoxes={},O=0),r&&(x.savedBBoxes[r]=g),O++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",D(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var R=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(F);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":686,"../../constants/alignment":755,"../../constants/interactions":762,"../../constants/xmlns_namespaces":764,"../../lib":787,"../../lib/svg_text_utils":813,"../../registry":915,"../../traces/scatter/make_bubble_size_func":1219,"../../traces/scatter/subtypes":1227,"../color":650,"../colorscale":662,"./symbol_defs":673,"@plotly/d3":58,"fast-isnumeric":246,tinycolor2:583}],673:[function(t,e,r){"use strict";var n=t("@plotly/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);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",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(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"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(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{"@plotly/d3":58}],674:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],675:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),f=0;f0;e.each((function(e){var f,h=e[0].trace,p=h.error_x||{},d=h.error_y||{};h.ids&&(f=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){p.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(p.copy_ystyle?d:p).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":1227,"../drawing":672,"@plotly/d3":58,"fast-isnumeric":246}],680:[function(t,e,r){"use strict";var n=t("@plotly/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":650,"@plotly/d3":58}],681:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":777,"../../plots/font_attributes":867,"./layout_attributes":691}],682:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexb[0]._length||at<0||at>_[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=it+b[0]._offset,e.pointerY=at+_[0]._offset,B="xval"in e?v.flat(s,e.xval):v.p2c(b,it),V="yval"in e?v.flat(s,e.yval):v.p2c(_,at),!i(B[0])||!i(V[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(q=0;q$&&(tt.splice(0,$),ct=tt[0].distance),m&&0!==O&&0===tt.length){Q.distance=O,Q.index=!1;var f=Y._module.hoverPoints(Q,J,K,"closest",{hoverLayer:l._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=O}))),f&&f.length){var h,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var g=d[0];i(g.x0)&&i(g.y0)&&(h=ht(g),(!rt.vLinePoint||rt.vLinePoint.spikeDistance>h.spikeDistance)&&(rt.vLinePoint=h))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var x=y[0];i(x.x0)&&i(x.y0)&&(h=ht(x),(!rt.hLinePoint||rt.hLinePoint.spikeDistance>h.spikeDistance)&&(rt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)Ct(tt[At]);tt=St,gt()}var Pt=t._hoverdata,It=[],Ot=j(t),zt=U(t);for(H=0;H1||tt.length>1)||"closest"===S&&nt&&tt.length>1,Wt=p.combine(l.plot_bgcolor||p.background,l.paper_bgcolor),Xt=I(tt,{gd:t,hovermode:S,rotateLabels:Yt,bgColor:Wt,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance});v.isUnifiedHover(S)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),p=new Array(h),d=0;function m(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 c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(f=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?T:1)/2,pmin:0,pmax:i?r.width:r.height}]})),p.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=i;for(g.push.apply(g,v),p.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var _=b[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,Yt?"xa":"ya",l),z(Xt,Yt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Zt=g.getComponentMethod("annotations","hasClickToShow")(t,It);f(n.select(e.target),Zt?"pointer":"")}if(!e.target||a||!function(t,e,r){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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:_,xvals:B,yvals:V})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var v=i._fullLayout[m.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,f+=y,h+=x,d+=x}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||p.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,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{},T=e.fontFamily||y.HOVERFONT,k=e.fontSize||y.HOVERFONTSIZE,M=t[0],E=M.xa,L=M.ya,P=a.charAt(0),I=M[P+"Label"],z=V(r,m),D=z.top,R=z.width,F=z.height,B=void 0!==I&&M.distance<=e.hoverdistance&&("x"===a||"y"===a);if(B){var N,j,U=!0;for(N=0;Ni.width-b?(g=i.width-b,e.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*S+y.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):e.attr("d","M0,0L"+A+","+x+A+"H"+(S+y.width/2)+"v"+x+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,C,P;"right"===L.side?(_="start",C=1,P="",g=E._offset+E._length):(_="end",C=-1,P="-",g=E._offset),v=L._offset+(M.y0+M.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+P+A+","+A+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+A+"V-"+A+"Z");var O,z=y.height/2,R=D-y.top-z,F="clip"+i._uid+"commonlabel"+L._id;if(g=0?it:at+lt=0?at:gt+lt=0?rt:nt+ct=0?nt:vt+ct=0,"top"!==t.idealAlign&&G||!Y?G?(z+=j/2,t.anchor="start"):t.anchor="middle":(z-=j/2,t.anchor="end");else if(t.pos=z,G=P+N/2+W<=R,Y=P-N/2-W>=0,"left"!==t.idealAlign&&G||!Y)if(G)P+=N/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=P+X-R,J=P-X;Z>0&&(P-=Z),J<0&&(P+=-J)}else P-=N/2,t.anchor="end";w.attr("text-anchor",t.anchor),E&&M.attr("text-anchor",t.anchor),e.attr("transform",s(P,z)+(c?l(_):""))})),yt}function O(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(A+S),p=f+c*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,p+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*A+d)+"V"+o(m-A)+"Z");var v=d+f,y=m+t.ty0-t.by/2+S,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==s?(i.attr("text-anchor","start"),v=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===x&&"end"!==s&&(i.attr("text-anchor","end"),v=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(v),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(p+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(p+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function D(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(g=c.pointerX,v=c.pointerY):(g=n._offset+y.x,v=i._offset+y.y);var x,b,_=a.readability(y.color,d)<1.5?p.contrast(d):y.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||_,M=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=g),-1!==w.indexOf("across")){var A=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(A=Math.min(A,i.position),S=Math.max(S,i.position)),x=l.l+A*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==i.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(f){var E,L,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(E=c.pointerX,L=c.pointerY):(E=n._offset+C.x,L=i._offset+C.y);var P,I,O=a.readability(C.color,d)<1.5?p.contrast(d):C.color,z=n.spikemode,D=n.spikethickness,R=n.spikecolor||O,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,I=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],p=u[0],d=u[1];return{x:f,y:h,width:p-f,height:d-h,top:Math.min(h,d),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(h,d)}}},{"../../lib":787,"../../lib/events":776,"../../lib/override_cursor":798,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"../legend/defaults":702,"../legend/draw":703,"./constants":684,"./helpers":686,"@plotly/d3":58,"fast-isnumeric":246,tinycolor2:583}],688:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":787,"../color":650,"./helpers":686}],689:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":787,"./layout_attributes":691}],690:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":787,"../dragelement":669,"./attributes":681,"./calc":682,"./click":683,"./constants":684,"./defaults":685,"./helpers":686,"./hover":687,"./layout_attributes":691,"./layout_defaults":692,"./layout_global_defaults":693,"@plotly/d3":58}],691:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":867,"./constants":684}],692:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r)}},{"../../lib":787,"./hoverlabel_defaults":688,"./hovermode_defaults":689,"./layout_attributes":691}],693:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":787,"./hoverlabel_defaults":688,"./layout_attributes":691}],694:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!p&&!d)"independent"===k("pattern")&&(h=!0);g._hasSubplotGrid=h;var x,b,_="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1!==m||c.uirevision){var g=a.newContainer(e,"legend");if(T("uirevision",e.uirevision),!1!==m){T("bgcolor",e.paper_bgcolor),T("bordercolor"),T("borderwidth");var v,y,x,b=i.coerceFont(T,"font",e.font),_="h"===T("orientation");if(_?(v=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(v=1.02,y=1,x="auto"),T("traceorder",h),l.isGrouped(e.legend)&&T("tracegroupgap"),T("itemsizing"),T("itemwidth"),T("itemclick"),T("itemdoubleclick"),T("groupclick"),T("x",v),T("xanchor"),T("y",y),T("yanchor",x),T("valign"),i.noneOrAll(c,g,["x","y"]),T("title.text")){T("title.side",_?"left":"top");var w=i.extendFlat({},b,{size:i.bigFont(b.size)});i.coerceFont(T,"title.font",w)}}}function T(t,e){return i.coerce(c,g,o,t,e)}}},{"../../lib":787,"../../plot_api/plot_template":827,"../../plots/layout_attributes":892,"../../registry":915,"./attributes":700,"./helpers":706}],703:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,a).text(h?T(n,d):n);var g=r.itemwidth+2*p.itemGap;f.positionText(m,g,0),h?m.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(M,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function M(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,d=s.size*m;if(o){var g=c.bBox(o);u=g.height,h=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var v=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(v),x=v.node();if(u=d*y,h=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),f.positionText(v,l+p.titlePad,l+d);else{var b=2*p.itemGap+r.itemwidth;i.groupTitle&&(b=p.itemGap,h-=r.itemwidth),f.positionText(v,b,-d*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function A(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var m=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var T=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),L=i.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=i.ensureSingle(T,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var I=i.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),M(I,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var O=i.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(s);z.enter().append("g").attr("class","groups"),z.exit().remove();var D=z.selectAll("g.traces").data(i.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(x,t,e).each((function(){d||n.select(this).call(k,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=b.isVertical(i),l=b.isGrouped(i),u=i.borderwidth,f=2*u,h=p.itemGap,d=i.itemwidth+2*h,m=2*(u+h),g=S(i),v=i.y<0||0===i.y&&"top"===g,y=i.y>1||1===i.y&&"bottom"===g,x=i.tracegroupgap;i._maxHeight=Math.max(v||y?a.height/2:o.h,30);var _=0;i._width=0,i._height=0;var w=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,u+w[0],u+w[1]+i._height+e/2+h),i._height+=e,i._width=Math.max(i._width,t[0].width)})),_=d+i._width,i._width+=h+d+f,i._height+=m,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var T=A(i),k=i.x<0||0===i.x&&"right"===T,M=i.x>1||1===i.x&&"left"===T,E=y||v,L=a.width/2;i._maxWidth=Math.max(k?E&&"left"===T?o.l+o.w:L:M?E&&"right"===T?o.r+o.w:L:o.w,2*d);var C=0,P=0;r.each((function(t){var e=t[0].width+d;C=Math.max(C,e),P+=e})),_=null;var I=0;if(l){var O=0,z=0,D=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;c.setTranslate(this,w[0],w[1]+u+h+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),O=Math.max(O,e);var r=t+h;r+u+z>i._maxWidth&&(I=Math.max(I,z),z=0,D+=O+x,O=e),c.setTranslate(this,z,D),z+=r})),i._width=Math.max(I,z)+u,i._height=D+O+m}else{var R=r.size(),F=P+f+(R-1)*h=i._maxWidth&&(I=Math.max(I,U),N=0,j+=B,i._height+=B,B=0),c.setTranslate(this,w[0]+u+N,w[1]+u+j+e/2+h),U=N+r+h,N+=n,B=Math.max(B,e)})),F?(i._width=N+f,i._height=B+m):(i._width=Math.max(I,U)+f,i._height+=B+m)}}i._width=Math.ceil(Math.max(i._width+w[0],i._titleWidth+2*(u+p.titlePad))),i._height=Math.ceil(Math.max(i._height+w[1],i._titleHeight+2*(u+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var V=t._context.edits,H=V.legendText||V.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=H?d:_||d+t[0].width;s||(i+=h/2),c.setRect(e,0,-r/2,i,r)}))}(t,z,D,e)},function(){if(d||!function(t){var e=t._fullLayout.legend,r=A(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*g[n]})}(t)){var s,u,m,y,x=f._size,b=e.borderwidth,w=x.l+x.w*e.x-g[A(e)]*e._width,k=x.t+x.h*(1-e.y)-g[S(e)]*e._effHeight;if(!d&&f.margin.autoexpand){var M=w,P=k;w=i.constrain(w,0,f.width-e._width),k=i.constrain(k,0,f.height-e._effHeight),w!==M&&i.log("Constrain legend.x to make legend fit inside graph"),k!==P&&i.log("Constrain legend.y to make legend fit inside graph")}if(d||c.setTranslate(T,w,k),O.on(".drag",null),T.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;d&&(I=e._height),L.attr({width:e._width-b,height:I-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),E.select("rect").attr({width:e._width-2*b,height:I-2*b,x:b,y:b}),c.setClipUrl(C,h,t),c.setRect(O,0,0,0,0),delete e._scrollY}else{var z,D,R,F=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*p.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);L.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),E.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+U}),c.setClipUrl(C,h,t),q(U,F,j),T.on("wheel",(function(){q(U=i.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,N)}(R,z,D),F,j))}));O.call(V);var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(z=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,N)}(R,z,D),F,j))}));C.call(H)}if(t._context.edits.legendPosition)T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=c.getTranslate(T);m=t.x,y=t.y},moveFn:function(t,r){var n=m+t,i=y+r;c.setTranslate(T,n,i),s=l.align(n,0,x.l,x.l+x.w,e.xanchor),u=l.align(i,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&_(t,T,i,e,n)}})}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(O,e._width,p.scrollBarMargin+r*i,p.scrollBarWidth,n),E.select("rect").attr("y",b+r)}}],t)}(t,e)}},{"../../constants/alignment":755,"../../lib":787,"../../lib/events":776,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"../color":650,"../dragelement":669,"../drawing":672,"./constants":701,"./get_legend_data":704,"./handle_click":705,"./helpers":706,"./style":708,"@plotly/d3":58}],704:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},p=0,d=0;function m(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var v=e._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function T(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},p=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var d=c(f),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),p=s.tryColorscale(f,"")(m)}var v=p||a.mc||f.color,y=f.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,k=g(y.size,8,10),M=g(y.solidity,.5,1),A="legend-"+u.uid;i.call(s.pattern,"legend",e,A,x,k,M,p,y.fillmode,b,_,T)}else i.call(l.fill,v);o&&l.stroke(i,a.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,p=w(h(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=u.color;var m=a.minExtend(o,{trace:d});f(c,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),p=h.colorscale,m=h.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(v)?v[o]||v[0]:v}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=m(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,v=o.anyLine,y=t[0],b=y.trace,_=c(b),T=_.colorscale,k=_.reversescale,M=u.hasMarkers(b)||!g?"M5,0":v?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||p?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+x+"v6h-"+x+"z").call(l?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+b.uid;s.gradient(t,e,r,d(k),T,"fill")}}),f||h){var E=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:E}}),r=[a.minExtend(y,{trace:i})]}var L=A.select(".legendlines").selectAll("path").data(f||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(h?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,p=t[0],d=p.trace,g=!h&&!c&&!l&&u.hasText(d);function v(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(h||g||f){var b={},w={};if(h){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",a.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",a.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:v("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(h?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),M.exit().remove(),M.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(g?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":787,"../../registry":915,"../../traces/pie/helpers":1181,"../../traces/pie/style_one":1187,"../../traces/scatter/subtypes":1227,"../color":650,"../colorscale/helpers":661,"../drawing":672,"./constants":701,"@plotly/d3":58}],709:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":711}],710:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(P=["toggleHover"],I=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):g?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t0?h+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=f)));return p>=h?[h,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(k=f,E="y0",M=y,L="y1"):(k=y,E="y1",M=f,L="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===O?J:K,X.altKey=n.altKey},doneFn:function(){if(v(t))return;p(e),$(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function Z(r){if(v(t))O=null;else if(R)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";p(e,l),O=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(q(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else z?B("xanchor",r.xanchor=G(x+n)):(B("x0",r.x0=G(c+n)),B("x1",r.x1=G(g+n))),D?B("yanchor",r.yanchor=Y(T+i)):(B("y0",r.y0=Y(f+i)),B("y1",r.y1=Y(y+i)));e.attr("d",_(t,r)),Q(s,r)}function K(n,i){if(F){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(q(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===O){var u=c+n,h=D?f-i:f+i;B("x0",r.x0=z?u:G(u)),B("y0",r.y0=D?h:Y(h))}else if("resize-over-end-point"===O){var p=g+n,d=D?y-i:y+i;B("x1",r.x1=z?p:G(p)),B("y1",r.y1=D?d:Y(d))}}else{var v=function(t){return-1!==O.indexOf(t)},b=v("n"),j=v("s"),V=v("w"),W=v("e"),X=b?k+i:k,Z=j?M+i:M,J=V?A+n:A,K=W?S+n:S;D&&(b&&(X=k-i),j&&(Z=M-i)),(!D&&Z-X>10||D&&X-Z>10)&&(B(E,r[E]=D?X:Y(X)),B(L,r[L]=D?Z:Y(Z))),K-J>10&&(B(C,r[C]=z?J:G(J)),B(P,r[P]=z?K:G(K)))}e.attr("d",_(t,r)),Q(s,r)}function Q(t,e){(z||D)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=H(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=q(D?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&D){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,z,l,e,r,O):!0===l.editable&&z.style("pointer-events",P||c.opacity(S)*A<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,g(t)}}(t,z)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,c,u,f,h=e.type,p=a.getRefType(e.xref),g=a.getRefType(e.yref),v=a.getFromId(t,e.xref),y=a.getFromId(t,e.yref),x=t._fullLayout._size;if(v?"domain"===p?n=function(t){return v._offset+v._length*t}:(r=m.shapePositionToRange(v),n=function(t){return v._offset+v.r2p(r(t,!0))}):n=function(t){return x.l+x.w*t},y?"domain"===g?s=function(t){return y._offset+y._length*(1-t)}:(o=m.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return x.t+x.h*(1-t)},"path"===h)return v&&"date"===v.type&&(n=m.decodeDate(n)),y&&"date"===y.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,c=t.charAt(0),u=d.paramIsX[c],f=d.paramIsY[c],h=d.numParams[c],p=t.substr(1).replace(d.paramRE,(function(t){return u[n]?t="pixel"===a?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),c+p}))}(e,n,s);if("pixel"===e.xsizemode){var b=n(e.xanchor);l=b+e.x0,c=b+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);u=_-e.y0,f=_-e.y1}else u=s(e.y0),f=s(e.y1);if("line"===h)return"M"+l+","+u+"L"+c+","+f;if("rect"===h)return"M"+l+","+u+"H"+c+"V"+f+"H"+l+"Z";var w=(l+c)/2,T=(u+f)/2,k=Math.abs(w-l),M=Math.abs(T-u),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,g(t)))}e.exports={draw:g,drawOne:x,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(v),r.attr("d",m(e)),M&&!h)&&(k=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,y(),x())}}()}}function I(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,v);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform",l(v[0],v[1]))}}}return D.call(R),O&&(E?D.on(".opacity",null):(M=0,A=!0,D.text(y).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)}))),D.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,v,e,x):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),D.classed("js-placeholder",A),T}}},{"../../constants/alignment":755,"../../constants/interactions":762,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../../registry":915,"../color":650,"../drawing":672,"@plotly/d3":58,"fast-isnumeric":246}],749:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("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:c,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(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/font_attributes":867,"../../plots/pad_attributes":900,"../color/attributes":649}],750:[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,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],751:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":787,"../../plots/array_container_defaults":833,"./attributes":749,"./constants":750}],752:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||v(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(A,i,h,p),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),v(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,g=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=v.headerHeight+f.gapButtonHeader:d=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,E=g+v;E+A>c&&(E=c-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,O=d+m,z=g;O+P>l&&(O=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:z,width:P,height:I}),this._vbarYMin=z+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=C?f+P+.5:f+.5,N=h-.5,j=k?p+A+.5:p+.5,U=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.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)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.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(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":787,"../color":650,"../drawing":672,"@plotly/d3":58}],755:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],756:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],757:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],758:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],759:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],760:[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]}},{}],761:[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"}},{}],762:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],763:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],764:[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}},{}],765:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;splotly-logomark"}}},{}],767:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],768:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,p,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":794}],769:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&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)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),T=t.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),L=Number(T[11]||0);if(c){if(2===k.length)return u;var C;k=Number(k);try{var P=g.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===M.charAt(M.length-1);M=parseInt(M,10),C=P.newDate(k,P.toMonthIndex(k,M,I),A)}else C=P.newDate(k,Number(M),A)}catch(t){return u}return C?(C.toJD()-m)*f+S*h+E*p+L*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var O=new Date(Date.UTC(2e3,M,A,S,E));return O.setUTCFullYear(k),O.getUTCMonth()!==M||O.getUTCDate()!==A?u:O.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var T=90*f,k=3*h,M=5*p;function A(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/f)+m,E=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=v("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return A(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return L[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var I=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+I);return c.setUTCMonth(c.getUTCMonth()+e)+n-I},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,p=c-a,d=u*u+f*f,m=h*h+p*p,g=Math.min(l(u,f,d,i-t,a-e),l(u,f,d,o-t,c-e),l(h,p,m,t-i,e-a),l(h,p,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var p=h(c);p;){if((c+=p+r)>f)return;p=h(c)}for(p=h(f);p;){if(c>(f-=p+r))return;p=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},{"./mod":794}],783:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,p,d,m=t.color,g=l(m),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=v?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||v)for(var b=0;b1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],787:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var p=t("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var d=t("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var m=t("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var v=t("./search");f.findBin=v.findBin,f.sorterAsc=v.sorterAsc,f.sorterDes=v.sorterDes,f.distinctVals=v.distinctVals,f.roundUp=v.roundUp,f.sort=v.sort,f.findIndexOfMin=v.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=t("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=t("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=t("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var M=t("./regex");f.counterRegex=M.counter;var A=t("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var S=t("./dom");function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return z.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var D={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,p="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||p||m||d,v=s;if((p||d)&&(v=v.substring(1)),(m||d)&&(v=v.substring(0,v.length-1)),g){if(void 0===(c=e[v]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var N=2e9;f.seedPseudoRandom=function(){N=2e9},f.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?f.pseudoRandom():N/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":763,"./anchor_utils":767,"./angles":768,"./array":769,"./clean_number":770,"./clear_responsive":772,"./coerce":773,"./dates":774,"./dom":775,"./extend":777,"./filter_unique":778,"./filter_visible":779,"./geometry2d":782,"./identity":785,"./increment":786,"./is_plain_object":788,"./keyed_container":789,"./localize":790,"./loggers":791,"./make_trace_groups":792,"./matrix":793,"./mod":794,"./nested_property":795,"./noop":796,"./notifier":797,"./preserve_drawing_buffer":801,"./push_unique":802,"./regex":804,"./relative_attr":805,"./relink_private":806,"./search":807,"./sort_object_keys":810,"./stats":811,"./throttle":814,"./to_log_range":815,"@plotly/d3":58,"d3-format":164,"d3-time-format":172,"fast-isnumeric":246}],788:[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).hasOwnProperty("hasOwnProperty")}},{}],789:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":825,"./notifier":797}],792:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":58}],793:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],795:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,p,d,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":763,"./matrix":793}],800:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=!0;return a._glcanvas.each((function(n){if(!n.regl&&(!n.pick||a._has("parcoords"))){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:a._glcontainer.node()}),o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":809,regl:526}],801:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":246,"is-mobile":445}],802:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,f=0,h=e.length,p=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},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,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":769,"fast-isnumeric":246}],812:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":131}],813:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&A.match(c),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(S[2],o,(function(n,i,o){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return I(),void e();var c=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});c.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",f=s.select("g");f.attr({fill:u,stroke:u});var h=l(f,"width"),p=l(f,"height"),d=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],g=-(r||l(t,"height"))/4;"y"===P[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+a(-h/2,g-p/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:g-p/2}):"a"===P[0]&&0!==P.indexOf("atitle")?s.attr({x:0,y:g}):s.attr({x:d,y:+t.attr("y")+g-p/2}),m&&m.call(t,c),e(c)}))}))):I(),t}function I(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(v),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],815:[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":246}],816:[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":869,"topojson-client":586}],817:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],818:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],819:[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;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),p(t),!0)}var x,b,_,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),E=e.get(),L=E||[],C=u(v,f).get(),P=[],I=-1,O=L.length;for(x=0;xL.length-(M?0:1))a.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?P.push(_):M?("add"===k&&(k={}),L.splice(_,0,k),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)L.splice(P[x],1),C&&C.splice(P[x],1);if(L.length?E||e.set(L):e.set(null),m)return!1;if(h(g,v),d!==i){var z;if(-1===I)z=S;else{for(O=Math.max(L.length,O),z=[],x=0;x=I);x++)z.push(_);for(x=I;x=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 I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),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")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var m=0;m-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&H(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(h.rehover,h.redrag),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[p.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=p.getFromId(t,i);if(r.push(i),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=F(l._preGUI,c),d=Object.keys(e),m=p.list(t),g=o.extendDeepAll({},e),v={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof O.parts[D];)D--;var B=O.parts[D],N=O.parts[D-1]+"."+B,U=O.parts.slice(0,D).join("."),V=s(t.layout,U).get(),H=s(l,U).get(),W=O.get();if(void 0!==z){A[I]=z,S[I]="reverse"===B?z:R(W);var Z=f.getLayoutValObject(l,O.parts);if(Z&&Z.impliedEdits&&null!==z)for(var J in Z.impliedEdits)E(o.relativeAttr(I,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(I))if(z){E("autosize",null);var K="height"===I?"width":"height";E(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",z?null:l.width),E("height",z?null:l.height);else if(N.match(q))P(N),s(l,U+"._inputRange").set(null);else if(N.match(G)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===H.type&&"log"===z,tt="log"===H.type&&"linear"===z;if($||tt){if(L&&L.range)if(H.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&E(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(U+".range[0]",Math.log(et)/Math.LN10),E(U+".range[1]",Math.log(rt)/Math.LN10)):(E(U+".range[0]",Math.pow(10,et)),E(U+".range[1]",Math.pow(10,rt)))}else E(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,H,z,E),u.getComponentMethod("images","convertCoords")(t,H,z,E)}else E(U+".autorange",!0),E(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,I).get(),it=(z||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,E),u.getComponentMethod("images","convertCoords")(t,nt,it,E)}var at=b.containerArrayMatch(I);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(b.isAddVal(z)?S[I]=null:b.isRemoveVal(z)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),v[r]||(v[r]={});var lt=v[r][n];lt||(lt=v[r][n]={}),lt[ot]=z,delete e[I]}else"reverse"===B?(V.range?V.range.reverse():(E(U+".autorange",!0),V.range=[1,0]),H.autorange?M.calc=!0:M.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===z||"select"===z)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?M.plot=!0:Z?T.update(M,Z):M.calc=!0,O.set(z))}}for(r in v){b.applyContainerArrayChanges(t,h(a,r),v[r],M,h)||(M.plot=!0)}for(var ct in C){var ut=(L=p.getFromId(t,ct))&&L._constraintGroup;if(ut)for(var ft in M.calc=!0,ut)C[ft]||(p.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:C,undoit:S,redoit:A,eventData:g}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=N(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):l.fullReplot?p.push(r._doPlot):(p.push(h.previousPromises),V(t,f,u)||h.supplyDefaults(t),l.style&&p.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&H(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(h.rehover,h.redrag),c.add(t,Z,[t,s.undoit,u.undoit,s.traces],Z,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(p,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,_.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 t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var d,m,g=0;function v(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);y=M}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,v=e[n].name,y=u[g]||d[g];g&&v&&"number"==typeof v&&y&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],p=[t,a];return c&&c.add(t,l,f,u,p),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],p=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function x(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return v(i,e,s)},r.getLayoutValObject=function(t,e){return v(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":787,"../plots/attributes":834}],828:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function x(t){var e,i,s,u,d,m,g=t._fullLayout,v=g._size,x=v.p,_=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var k=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],A=[],S=[],E=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var L=s.xaxis.domain,C=s.yaxis.domain,P=s.plotgroup;if(y(L,C,S)){var I=P.node(),O=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(O.node(),I.childNodes[0]),A.push(i)}else P.select("rect.bg").remove(),S.push([L,C]),E||(M.push(i),A.push(i))}var z,D,R,F,B,N,j,U,V,H,q,G,Y,W=g._bgLayer.selectAll(".bg").data(M);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eT?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:p,layout:h},""),u.length)return u.map(v)}},{"../lib":787,"../plots/attributes":834,"../plots/plots":901,"./plot_config":825,"./plot_schema":826,"./plot_template":827}],830:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg"),u=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,p,d;function m(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function v(t,r){return o.coerce(e,g,f,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},h);x?M.width=x:null===e.width&&n(d.width)&&(M.width=d.width),b?M.height=b:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=a.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),h(),t(T?p:s.encodeJSON(p))}if(h(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,M,A).then(S).then(E).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":787,"../plots/plots":901,"../snapshot/helpers":919,"../snapshot/svgtoimg":921,"../snapshot/tosvg":923,"../version":1388,"./plot_api":824,"fast-isnumeric":246}],831:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(d("unused",a,v.concat(x.length)));var M,A,S,E,L,C=x.length,P=Array.isArray(k);if(P&&(C=Math.min(C,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&i.push(d("unused",a,v.concat(A,x[A].length)));var I=x[A].length;for(M=0;M<(P?Math.min(I,k[A].length):I);M++)S=P?k[A][M]:k,E=y[A][M],L=x[A][M],n.validate(E,S)?L!==E&&L!==+E&&i.push(d("dynamic",a,v.concat(A,M),E,L)):i.push(d("value",a,v.concat(A,M),E))}else i.push(d("array",a,v.concat(A),y[A]));else for(A=0;A1&&p.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,v=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,p="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,h)||0,v=[],y=[],x=[],b=i.length,_=0;_M;)k=o(k,-c,h);for(;k<=M;)k=o(k,c,h);T=o(k,-c,h)}else{for(k=g+(w=Math.round((M-g)/u))*u;k>M;)k-=u;for(;k<=M;)k+=u;T=k-u}v[_]=p?T:d?k:(T+k)/2,y[_]=T,x[_]=k}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":763,"../../lib":787,"fast-isnumeric":246}],836:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],837:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,g=f[0].val;for(r=1;r0&&((T=E-s(x)-l(b))>L?k/T>C&&(_=x,w=b,C=k/T):k/E>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=k/E));if(h===g){var P=h-1,I=h+1;if(A)if(0===h)i=[0,1];else{var O=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,O/E));i=h>0?[0,z]:[z,0]}else i=S?[Math.max(0,P),Math.max(1,I)]:[P,I]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(e,x.val,b.val))/(E-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return v&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!T){if(h=1/0,p=-1/0,w)for(n=0;n0&&(h=a),a>p&&a-o&&(h=a),a>p&&a=I;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":672,"../../constants/numerical":763,"../../lib":787,"../../registry":915,"./axis_ids":842,"@plotly/d3":58,"fast-isnumeric":246}],838:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),p=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,y=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,E=m.ONEHOUR,L=m.ONEMIN,C=m.ONESEC,P=m.MINUS_SIGN,I=m.BADNUM,O={K:"zeroline"},z={K:"gridline",L:"path"},D={K:"tick",L:"path"},R={K:"tick",L:"text"},F=t("../../constants/alignment"),B=F.MID_SHIFT,N=F.CAP_SHIFT,j=F.LINE_SPACING,U=F.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var H=t("./axis_autotype"),q=t("./axis_ids"),G=q.idSort,Y=q.isLinked;V.id2name=q.id2name,V.name2id=q.name2id,V.cleanId=q.cleanId,V.list=q.list,V.listIds=q.listIds,V.getFromId=q.getFromId,V.getFromTrace=q.getFromTrace;var W=t("./autorange");V.getAutoRange=W.getAutoRange,V.findExtremes=W.findExtremes;function X(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=V.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*A:a.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,v,c,a)),g=y,0;g<=u;)g=V.tickIncrement(g,v,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:v,_dataSpan:u-c}},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,V.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=V.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dticka&&f=o:p<=o;p=V.tickIncrement(p,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(p=u)break}if(L.length>m||p===C)break;C=p;var P=!1;f&&p!==(0|p)&&(P=!0),L.push({minor:P,value:p})}if(h&&function(t,e,r){for(var n=0;n0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=g?u:v:r===b&&f>=_?h=u>=_&&u<=x?u:b:f>=k?h=u>=k&&u<=w?u:T:r===M&&f>=M?h=M:f>=A?h=A:r===S&&f>=S?h=S:r===E&&f>=E&&(h=E),h>=u&&(h=u,s=!0);var p=i+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(i*(1-L)+L*p)!==I&&d++}(h*=d/84)||(t[n].drop=!0),s&&u>M&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(L,t,t._definedDelta),t.rangebreaks){var O="y"===t._id.charAt(0),z=1;"auto"===t.tickmode&&(z=t.tickfont?t.tickfont.size:12);var D=NaN;for(d=L.length-1;d>-1;d--)if(L[d].drop)L.splice(d,1);else{L[d].value=At(L[d].value,t);var R=t.c2p(L[d].value);(O?D>R-z:Du||Bu&&(F.periodX=u),B10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=A&&a<=10||e>=15*A)t._tickround="d";else if(e>=L&&a<=16||e>=E)t._tickround="M";else if(e>=C&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(ut(t.exponentformat)&&!ft(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function lt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}V.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var a=2*e;if(a>v)e/=v,r=n(10),t.dtick="M"+12*ot(e,r,$);else if(a>T)e/=T,t.dtick="M"+ot(e,1,tt);else if(a>A){t.dtick=ot(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:rt);var o=V.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else a>E?t.dtick=ot(e,E,tt):a>L?t.dtick=ot(e,L,et):a>C?t.dtick=ot(e,C,et):(r=n(10),t.dtick=ot(e,r,$))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),t.dtick="L"+ot(e,r,$)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Mt(t)?(t.tick0=0,r=1,t.dtick=ot(e,r,at)):(t.tick0=0,r=n(10),t.dtick=ot(e,r,$));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},V.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?it:nt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=ht(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||ut(p)&&ft(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":P)+h:(e.text=ht(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("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*(l<0?.5:.25)))}}(t,o,0,c,m):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Mt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=ht(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=ht(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=ht(e.x,t,i,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":P+o:o};var ct=["f","p","n","\u03bc","m","","k","M","G","T"];function ut(t){return"SI"===t||"B"===t}function ft(t){return t>14||t<-15}function ht(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=V.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};st(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":ut(l)&&(t+=ct[c/3+5]));return a?P+t:t}function pt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),p.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),p.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var x=e._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=gt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}K&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,xt(e),n),a.autoMargin(t,bt(e),i),a.autoMargin(t,_t(e),s)})),r.skipTitle||K&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+gt(e);else{var s=St(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var c,f,p,d,m=V.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,p="top"===e.side?m-r:m+r):(p=e._offset+e._length/2,f="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var v=h.getTranslate(g.node().parentNode);d.offsetLeft=v.x,d.offsetTop=v.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function Q(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=yt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},V.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*N,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-N));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(dt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(dt(e)))}},V.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,m=h?t.ticklen:0;if(f?m*=-1:u&&(m=0),h&&(p+=m,r)){var g=s.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(p+=.2*t.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),v=d*b,y=e+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=B:x=-90===A&&"bottom"===k?N:90===A&&"top"===k?B:.5,T=B/2*(A/90)),w.xFn=function(t){return t.dx+v+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*b<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===M){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),v=p,y=d*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===k||90===A&&"right"===k?N:.5),f){var S=i(A)?+A:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*N*b,x=0}}w.xFn=function(t){return t.dx+e-(v+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*B},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},V.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.vals;"period"===e.ticklabelmode&&(i=i.slice()).shift();var a=r.layer.selectAll("path."+n).data(e.ticks?i:[],mt);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path).style("display",null),Et(e,[D]),a.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&V.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;sp||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},x(v,g+1?g:m);var b=null;e._selections&&(e._selections[f]=v);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(b=90,_.push((function(){x(v,g)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,a=[];if(v.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=yt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=p.length,l=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},d=f("top"),g=f("left"),y=f("right"),_=f("bottom")||g||d||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=y(o[l])){u=d;break}var f=i("pattern",u);if(f===d)for(l=0;l<2;l++)(c=y(o[l]))&&(e.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case d:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case m:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":915,"./constants":845}],843:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*x)||T)for(r=0;rO&&FP&&(P=F);h/=(P-C)/(2*I),C=l.l2r(C),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,i,a)}function V(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function H(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){I&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(H(i),2!==t||vt||qt(),gt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Pt),o.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&vt){var s=m?O:I,c="s"===m||"w"===v?0:1,f=s._name+".range["+c+"]",h=function(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,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===v&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(_t,n),Tt.r=Math.max(_t,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,_t>n?Tt.l=_t-a:Tt.r=_t+a),Lt.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Lt.attr("d",G(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;um[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":787,"fast-isnumeric":246}],857:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":755}],858:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,c=t("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,h=c.drawMode,p=c.openMode,d=c.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),g=t("../../components/shapes/draw_newshape/helpers").handleEllipse,v=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),x=t("../../lib/polygon"),b=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),M=k.MINSELECT,A=x.filter,S=x.tester,E=t("./handle_outline").clearSelect,L=t("./helpers"),C=L.p2r,P=L.axValue,I=L.getTransform;function O(t,e,r,n,i,a,o){var s,l,c,u,f,h,d,g,v,y=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){F(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=j(_))){for(o&&o.remove(),v=0;v=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=v(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),c=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function U(t,e,r){var n,a,o,s;for(n=0;n=0)L._fullLayout._deactivateShape(L);else if(!_){var r=z.clickmode;b.done(mt).then((function(){if(b.clear(mt),2===t){for(ft.remove(),$=0;$-1&&O(e,L,i.xaxes,i.yaxes,i.subplot,i,ft),"event"===r&&L.emit("plotly_selected",void 0);s.click(L,e)})).catch(y.error)}},i.doneFn=function(){dt.remove(),b.done(mt).then((function(){b.clear(mt),i.gd.emit("plotly_selected",et),Q&&i.selectionDefs&&(Q.subtract=ut,i.selectionDefs.push(Q),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,K)),i.doneFnCompleted&&i.doneFnCompleted(gt)})).catch(y.error),_&&B(i)}},clearSelect:E,clearSelectionsCache:B,selectOnClick:O}},{"../../components/color":650,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../components/fx/helpers":686,"../../components/shapes/draw_newshape/display_outlines":738,"../../components/shapes/draw_newshape/helpers":739,"../../components/shapes/draw_newshape/newshapes":740,"../../lib":787,"../../lib/clear_gl_canvases":771,"../../lib/polygon":799,"../../lib/throttle":814,"../../plot_api/subroutines":828,"../../registry":915,"./axis_ids":842,"./constants":845,"./handle_outline":849,"./helpers":850,polybooljs:490}],859:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,p=t("../../constants/numerical"),d=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);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-2*g*Math.abs(n-i))}return m}function L(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function I(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function O(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=O(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:O(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===p;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:f,t.l2c="log"===t.type?A:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(E(t,e))}:B,t.p2c="log"===t.type?function(t){return A(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=E,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=O,t.l2r=t.c2r=f,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),f="y"===p;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,p=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],v=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/p[2]:1,T=h?u/p[3]:1,k=f?p[0]:0,M=h?p[1]:0,A=f?p[0]/p[2]*c:0,S=h?p[1]/p[3]*u:0,E=i._offset-A,L=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":672,"../../lib":787,"../../registry":915,"./axes":838,"@plotly/d3":58}],864:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var p=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new A(t)},S.plot=function(t,e,r){var n=this,i=e[this.id],a=[],o=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&i["show"+s]){o=!0;break}for(var l=0;l0&&a._module.calcGeoJSON(i,e)}if(!this.updateProjection(t,e)){this.viewInitial&&this.scope===r.scope||this.saveViewInitial(r),this.scope=r.scope,this.updateBaseLayers(e,r),this.updateDims(e,r),this.updateFx(e,r),d.generalUpdatePerTraceModule(this.graphDiv,this,t,r);var o=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=o.selectAll(".point"),this.dataPoints.text=o.selectAll("text"),this.dataPaths.line=o.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this.render()}},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,f=n.projection,h=n.lonaxis,p=n.lataxis,d=h._ax,m=p._ax,v=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],h=function(t){return t?l:[]},p=0;pu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),y=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],x=n.center||{},b=f.rotation||{},_=h.range||[],T=p.range||[];if(n.fitbounds){d._length=y[1][0]-y[0][0],m._length=y[1][1]-y[0][1],d.range=g(r,d),m.range=g(r,m);var k=(d.range[0]+d.range[1])/2,M=(m.range[0]+m.range[1])/2;if(n._isScoped)x={lon:k,lat:M};else if(n._isClipped){x={lon:k,lat:M},b={lon:k,lat:M,roll:b.roll};var A=f.type,S=w.lonaxisSpan[A]/2||180,L=w.lataxisSpan[A]/2||90;_=[k-S,k+S],T=[M-L,M+L]}else x={lon:k,lat:M},b={lon:k,lat:b.lat,roll:b.roll}}v.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(f.parallels);var C=E(_,T);v.fitExtent(y,C);var P=this.bounds=v.getBounds(C),I=this.fitScale=v.scale(),O=v.translate();if(n.fitbounds){var z=v.getBounds(E(d.range,m.range)),D=Math.min((P[1][0]-P[0][0])/(z[1][0]-z[0][0]),(P[1][1]-P[0][1])/(z[1][1]-z[0][1]));isFinite(D)?v.scale(D*I):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else v.scale(f.scale*I);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(v.translate([O[0]+(R[0]-O[0]),O[1]+(R[1]-O[1])]).clipExtent(P),n._isAlbersUsa){var F=v([x.lon,x.lat]),B=v.translate();v.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(M(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,f=new Array(u),h=0;h-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,f),s.indexOf("event")>-1&&p.click(i,n.event))}))}function h(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":650,"../../components/dragelement":669,"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/geo_location_utils":780,"../../lib/topojson_utils":816,"../../registry":915,"../cartesian/autorange":837,"../cartesian/axes":838,"../cartesian/select":858,"../plots":901,"./constants":869,"./zoom":874,"@plotly/d3":58,"d3-geo":166,"d3-geo-projection":165,"topojson-client":586}],871:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&P<0&&(P+=360);var I,O,z,D=(C+P)/2;if(!p){var R=d?f.projRotate:[D,0,0];I=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}(p?(O=-96.6,z=38.7):(O=d?D:I,z=(L[0]+L[1])/2),r("center.lon",O),r("center.lat",z),m&&(r("projection.tilt"),r("projection.distance")),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):v?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":787,"../get_data":875,"../subplot_defaults":909,"./constants":869,"./layout_attributes":872}],874:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),h[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",h)}function h(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render();var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(t,e,i)})),r}function p(t,e){var r,i,a,o,s,h,p,d,m,g=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=v(r)})).on("zoom",(function(){if(h=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?v(h)&&(d=v(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=v(r=h),m=!0,t.render();var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&f(t,e,y)})),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var m=180-a-2*p,g=(Math.atan2(h,u)-Math.atan2(c,i))*s,v=(Math.atan2(h,u)-Math.atan2(c,-i))*s;return b(r[0],r[1],a,g)<=b(r[0],r[1],m,v)?[a,g,r[2]]:[m,v,r[2]]}function b(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(g(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":650,"../../../lib":787,"../../../registry":915,"../../get_data":875,"../../subplot_defaults":909,"./axis_defaults":883,"./layout_attributes":886}],886:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":787,"../../../lib/extend":777,"../../domain":866,"./axis_attributes":882}],887:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){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]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":812}],888:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var c,u=Object.keys(e.traces),h=null,m=e.glplot.selection,g=0;g")):"isosurface"===t.type||"volume"===t.type?(k.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(m.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+k.valueLabel),m.textLabel&&E.push(m.textLabel),_=E.join("
")):_=m.textLabel;var L={x:m.traceCoordinate[0],y:m.traceCoordinate[1],z:m.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};d.appendArrayPointValue(L,w,T),t._module.eventData&&(L=w._module.eventData(L,m,w,{},T));var C={points:[L]};if(e.fullSceneLayout.hovermode){var P=[];d.loneHover({trace:w,x:(.5+.5*x[0]/x[3])*s,y:(.5-.5*x[1]/x[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:_,name:h.name,color:d.castHoverOption(w,T,"bgcolor")||h.color,borderColor:d.castHoverOption(w,T,"bordercolor"),fontFamily:d.castHoverOption(w,T,"font.family"),fontSize:d.castHoverOption(w,T,"font.size"),fontColor:d.castHoverOption(w,T,"font.color"),nameLength:d.castHoverOption(w,T,"namelength"),textAlign:d.castHoverOption(w,T,"align"),hovertemplate:f.castOption(w,T,"hovertemplate"),hovertemplateLabels:f.extendFlat({},L,k),eventData:[L]},{container:n,gd:r,inOut_bbox:P}),L.bbox=P[0]}m.buttons&&m.distance<5?r.emit("plotly_click",C):r.emit("plotly_hover",C),c=C}else d.loneUnhover(n),r.emit("plotly_unhover",c);e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,p=0;p<(u||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var d=0;dg[1][a])g[0][a]=-1,g[1][a]=1;else{var L=g[1][a]-g[0][a];g[0][a]-=L/32,g[1][a]+=L/32}if("reversed"===s.autorange){var C=g[0][a];g[0][a]=g[1][a],g[1][a]=C}}else{var P=s.range;g[0][a]=s.r2l(P[0]),g[1][a]=s.r2l(P[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*h[a],max:g[1][a]*h[a]})}var I=c.aspectmode;if("cube"===I)d=[1,1,1];else if("manual"===I){var O=c.aspectratio;d=[O.x,O.y,O.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(a=0;a<3;++a){var D=y[l=(s=c[k[a]]).type];z[a]=Math.pow(D.acc,1/D.count)/h[a]}d="data"===I||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).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]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(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 i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),h=l||c;if(h){var p={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",h={x:0,y:0,z:1},p={};p[c]=h;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=h,f.nestedProperty(d,c).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d"),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(this._mockAxis,t)},e.exports=_},{"../../components/fx":690,"../../lib":787,"../../lib/show_no_webgl_msg":809,"../../lib/str2rgbarray":812,"../../plots/cartesian/axes":838,"../../registry":915,"./layout/convert":884,"./layout/spikes":887,"./layout/tick_marks":888,"./project":889,"gl-plot3d":319,"has-passive-events":436,"webgl-context":613}],891:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap
contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":810}],894:[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=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":787}],895:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),f=t("../../lib/svg_text_utils"),h=t("./mapbox"),p=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=v.split("|").join("
");x.text(w).attr("data-unformatted",w).call(f.convertToTspans,t),b=u.bBox(x.node())}x.attr("transform",a(-3,8-b.height)),y.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;b.width+6>_&&(T=_/(b.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];y.attr("transform",a(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&v(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},_.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=f(o)?function(t,r){(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},_.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])},_.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=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"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(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(){b.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})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},b.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,b.linkSubplots(h,l,f,n),b.cleanPlot(h,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(f){var g=(r.t+r.b)/f;g>1&&(r.t/=g,r.b/=g)}var v=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:v,size:r.l+d},r:{val:y,size:r.r+d},b:{val:_,size:r.b+d},t:{val:x,size:r.t+d}},p[e]=1}else delete h[e],delete p[e];if(!n._replotting)return b.doAutoMargin(t)}},b.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,d=a.b,m=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var v in m)g[v]||delete m[v];for(var y in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:d}},m){var x=m[y].l||{},_=m[y].b||{},w=x.val,T=x.size,k=_.val,M=_.size;for(var A in m){if(o(T)&&m[A].r){var S=m[A].r.val,E=m[A].r.size;if(S>w){var L=(T*S+(E-r)*w)/(S-w),P=(E*(1-w)+(T-r)*(1-S))/(S-w);L+P>c+f&&(c=L,f=P)}}if(o(M)&&m[A].t){var I=m[A].t.val,O=m[A].t.size;if(I>k){var z=(M*I+(O-n)*k)/(I-k),D=(O*(1-k)+(M-n)*(1-I))/(I-k);z+D>d+h&&(d=z,h=D)}}}}}var R=u.constrain(r-a.l-a.r,2,64),F=u.constrain(n-a.t-a.b,2,64),B=Math.max(0,r-R),N=Math.max(0,n-F);if(B){var j=(c+f)/B;j>1&&(c/=j,f/=j)}if(N){var U=(d+h)/N;U>1&&(d/=U,h/=U)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&b.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}b.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},b.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&b.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,c,f),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(p),b=x[2]-x[0],_=x[3]-x[1],w=h/f,T=Math.abs(_/b);w>T?(d=f,y=(h-(m=f*T))/n.h/2,g=[o[0],o[1]],v=[s[0]+y,s[1]-y]):(m=h,y=(f-(d=h/T))/n.w/2,g=[o[0]+y,o[1]-y],v=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=v;var k=this.xOffset2=n.l+n.w*g[0],M=this.yOffset2=n.t+n.h*(1-v[1]),A=this.radius=d/b,S=this.innerRadius=e.hole*A,E=this.cx=k-A*x[0],L=this.cy=M+A*x[3],I=this.cxx=E-k,O=this.cyy=L-M;this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:{counterclockwise:"top",clockwise:"bottom"}[i.side],_realSide:i.side,domain:[S/n.w,A/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:v});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",l(I,O)),r.frontplot.attr("transform",l(k,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",l(E,L)).call(c.fill,e.bgcolor)},z.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},z.mockCartesianAxis=function(t,e,r){var n=this,i=r._id,a=o.extendFlat({type:"linear"},r);p(a,t);var s={x:[0,2],y:[1,3]};return a.setRange=function(){var t=n.sectorBBox,r=s[i],o=n.radialAxis._rl,l=(o[1]-o[0])/(1-e.hole);a.range=[t[r[0]]*l,t[r[1]]*l]},a.isPtWithinRange="x"===i?function(t){return n.isPtInside(t)}:function(){return!0},a.setRange(),a.setScale(),a},z.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=e.radialaxis;n.setScale(),m(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},z.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=e.radialaxis,m=C(e.sector[0],360),g=r.radialAxis,v=u90&&m<=270&&(g.tickangle=180);var y=function(t){return l(g.l2p(t.x)+u,0)},x=D(d);if(r.radialTickLayout!==x&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=x),v){g.setScale();var b=h.calcTicks(g),_=h.clipEnds(g,b),w=h.getTickSigns(g)[2];h.drawTicks(n,g,{vals:b,layer:i["radial-axis"],path:h.makeTickPath(g,0,w),transFn:y,crisp:!1}),h.drawGrid(n,g,{vals:_,layer:i["radial-grid"],path:function(t){return r.pathArc(g.r2p(t.x)+u)},transFn:o.noop,crisp:!1}),h.drawLabels(n,g,{vals:b,layer:i["radial-axis"],transFn:y,labelFns:h.makeLabelFns(g,0)})}var T=r.radialAxisAngle=r.vangles?I(R(P(d.angle),r.vangles)):d.angle,k=l(f,p),M=k+s(-T);F(i["radial-axis"],v&&(d.showticklabels||d.ticks),{transform:M}),F(i["radial-grid"],v&&d.showgrid,{transform:k}),F(i["radial-line"].select("line"),v&&d.showline,{x1:u,y1:0,x2:a,y2:0,transform:M}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:this.radialAxisAngle,f=P(c),h=Math.cos(f),p=Math.sin(f),d=0;if(s.title){var m=u.bBox(this.layers["radial-axis"].node()).height,g=s.title.font.size;d="counterclockwise"===s.side?-m-.4*g:m+.8*g}this.layers["radial-axis-title"]=x.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:L(n,"Click to enter radial axis title"),attributes:{x:a+i/2*h+d*p,y:o-i/2*p+d*h,"text-anchor":"middle"},transform:{rotate:-c}})},z.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=e.angularaxis,m=r.angularAxis;r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale();var g=function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=I(m.tick0),m.dtick=I(m.dtick));var v=function(t){return l(f+a*Math.cos(t),p-a*Math.sin(t))},y=h.makeLabelFns(m,0).labelStandoff,x={xFn:function(t){var e=g(t);return Math.cos(e)*y},yFn:function(t){var e=g(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(y+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*A)},anchorFn:function(t){var e=g(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=g(t);return-.5*(1+Math.sin(n))*r}},b=D(d);r.angularTickLayout!==b&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=b);var _,w=h.calcTicks(m);if("linear"===e.gridshape?(_=w.map(g),o.angleDelta(_[0],_[1])<0&&(_=_.slice().reverse())):_=null,r.vangles=_,"category"===m.type&&(w=w.filter((function(t){return o.isAngleInsideSector(g(t),r.sectorInRad)}))),m.visible){var T="inside"===m.ticks?-1:1,k=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:w,layer:i["angular-axis"],path:"M"+T*k+",0h"+T*m.ticklen,transFn:function(t){var e=g(t);return v(e)+s(-I(e))},crisp:!1}),h.drawGrid(n,m,{vals:w,layer:i["angular-grid"],path:function(t){var e=g(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,p-u*n]+"L"+[f+a*r,p-a*n]},transFn:o.noop,crisp:!1}),h.drawLabels(n,m,{vals:w,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:function(t){return v(g(t))},labelFns:x})}F(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},z.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1),this.updateMainDrag(t))},z.updateMainDrag=function(t){var e,r,s=this,c=s.gd,u=s.layers,f=t._zoomlayer,h=S.MINZOOM,p=S.OFFEDGE,d=s.radius,m=s.innerRadius,x=s.cx,T=s.cy,k=s.cxx,M=s.cyy,A=s.sectorInRad,L=s.vangles,C=s.radialAxis,P=E.clampTiny,I=E.findXYatLength,O=E.findEnclosingVertexAngles,z=S.cornerHalfWidth,D=S.cornerLen/2,R=g.makeDragger(u,"path","maindrag","crosshair");n.select(R).attr("d",s.pathSubplot()).attr("transform",l(x,T));var F,B,N,j,U,V,H,q,G,Y={element:R,gd:c,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function W(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return W(t-k,e-M)}function Z(t,e){return Math.atan2(M-e,t-k)}function J(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function K(t,e){if(0===t)return s.pathSector(2*z);var r=D/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,d)),o=a-z,l=a+z;return"M"+J(o,n)+"A"+[o,o]+" 0,0,0 "+J(o,i)+"L"+J(l,i)+"A"+[l,l]+" 0,0,1 "+J(l,n)+"Z"}function Q(t,e,r){if(0===t)return s.pathSector(2*z);var n,i,a=J(t,e),o=J(t,r),l=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,h=I(z,u,l,c);n=I(D,f,h[0][0],h[0][1]),i=I(D,f,h[1][0],h[1][1])}else{var p,d;c?(p=D,d=z):(p=z,d=D),n=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function $(t,e){return e=Math.max(Math.min(e,d),m),th?(t-1&&1===t&&_(e,c,[s.xaxis],[s.yaxis],s.id,Y),r.indexOf("event")>-1&&y.click(c,e,s.id)}Y.prepFn=function(t,n,a){var l=c._fullLayout.dragmode,u=R.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var h=c._fullLayout._invTransform;e=c._fullLayout._invScaleX,r=c._fullLayout._invScaleY;var p=o.apply3DTransform(h)(n-u.left,a-u.top);if(F=p[0],B=p[1],L){var m=E.findPolygonOffset(d,A[0],A[1],L);F+=k+m[0],B+=M+m[1]}switch(l){case"zoom":Y.moveFn=L?nt:et,Y.clickFn=ot,Y.doneFn=it,function(){N=null,j=null,U=s.pathSubplot(),V=!1;var t=c._fullLayout[s.id];H=i(t.bgcolor).getLuminance(),(q=g.makeZoombox(f,H,x,T,U)).attr("fill-rule","evenodd"),G=g.makeCorners(f,x,T),w(c)}();break;case"select":case"lasso":b(t,n,a,Y,l)}},R.onmousemove=function(t){y.hover(c,t,s.id),c._fullLayout._lasthover=R,c._fullLayout._hoversubplot=s.id},R.onmouseout=function(t){c._dragging||v.unhover(c,t)},v.init(Y)},z.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,f=i.radius,h=i.innerRadius,p=i.cx,d=i.cy,m=i.radialAxis,y=S.radialDragBoxSize,x=y/2;if(m.visible){var b,_,T,A=P(i.radialAxisAngle),E=m._rl,L=E[0],C=E[1],O=E[r],z=.75*(E[1]-E[0])/(1-e.hole)/f;r?(b=p+(f+x)*Math.cos(A),_=d-(f+x)*Math.sin(A),T="radialdrag"):(b=p+(h-x)*Math.cos(A),_=d-(h-x)*Math.sin(A),T="radialdrag-inner");var D,B,N,j=g.makeRectDragger(u,T,"crosshair",-x,-x,y,y),U={element:j,gd:c};F(n.select(j),m.visible&&h0==(r?N>L:Nn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0){for(var n=[],i=0;i=u&&(p.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var i=f[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var h=o("color"),p=h!==i.color.dflt?h:r.font.color,d=e._name.charAt(0).toUpperCase(),m="Component "+d,g=o("title.text",m);e._hovertitle=g===m?g:d,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:p}),o("min"),c(t,e,o,"linear"),s(t,e,o,"linear",{}),l(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:p}),o("tickangle"),o("tickformat")),u(t,e,o,{dfltColor:h,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:f,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":650,"../../lib":787,"../../plot_api/plot_template":827,"../cartesian/line_grid_defaults":855,"../cartesian/tick_label_defaults":860,"../cartesian/tick_mark_defaults":861,"../cartesian/tick_value_defaults":862,"../subplot_defaults":909,"./layout_attributes":912}],914:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,p=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/dragelement/helpers"),y=v.freeMode,x=v.rectMode,b=t("../../components/titles"),_=t("../cartesian/select").prepSelect,w=t("../cartesian/select").selectOnClick,T=t("../cartesian/select").clearSelect,k=t("../cartesian/select").clearSelectionsCache,M=t("../cartesian/constants");function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var S=A.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iE*b?i=(a=b)*E:a=(i=x)/E,o=v*i/x,l=y*a/b,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-k],domain:[g-l/2,g+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var M=p.yaxis.domain[0],A=p.aaxis=h({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*E],anchor:"free",position:0,_id:"y",_length:i});f(A,p.graphDiv._fullLayout),A.setScale();var S=p.baxis=h({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var L=p.caxis=h({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*E],anchor:"free",position:0,_id:"y",_length:i});f(L,p.graphDiv._fullLayout),L.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var O=s(r-S._offset,n+a);p.layers.baxis.attr("transform",O),p.layers.bgrid.attr("transform",O);var z=s(r+i/2,n)+"rotate(30)"+s(0,-A._offset);p.layers.aaxis.attr("transform",z),p.layers.agrid.attr("transform",z);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-L._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",L.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),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)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=b.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=b.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),f=d.clipEnds(t,u),h=d.makeTransTickFn(t),p=d.getTickSigns(t)[2],m=o.deg2rad(30),g=p*(t.linewidth||1)/2,v=p*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+g+"l"+Math.sin(m)*v+","+Math.cos(m)*v:"M"+g+",0l"+Math.cos(m)*v+","+-Math.sin(m)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:b,transFn:h,crisp:!1}),d.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:h,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:h,labelFns:d.makeLabelFns(t,0,30)})};var L=M.MINZOOM/2+.87,C="m-0.87,.5h"+L+"v3h-"+(L+5.2)+"l"+(L/2+2.6)+",-"+(.87*L+4.5)+"l2.6,1.5l-"+L/2+","+.87*L+"Z",P="m0.87,.5h-"+L+"v3h"+(L+5.2)+"l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-2.6,1.5l"+L/2+","+.87*L+"Z",I="m0,1l"+L/2+","+.87*L+"l2.6,-1.5l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-"+(L/2+2.6)+","+(.87*L+4.5)+"l2.6,1.5l"+L/2+",-"+.87*L+"Z",O=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearSelect=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,h,p,d,v,b,T,k,A=this,S=A.layers.plotbg.select("path").node(),L=A.graphDiv,D=L._fullLayout._zoomlayer;function R(t){var e={};return e[A.id+".aaxis.min"]=t.a,e[A.id+".baxis.min"]=t.b,e[A.id+".caxis.min"]=t.c,e}function F(t,e){var r=L._fullLayout.clickmode;z(L),2===t&&(L.emit("plotly_doubleclick",null),a.call("_guiRelayout",L,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,L,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&g.click(L,e,A.id)}function B(t,e){return 1-e/A.h}function N(t,e){return 1-(t+(A.h-e)/Math.sqrt(3))/A.w}function j(t,e){return(t-(A.h-e)/Math.sqrt(3))/A.w}function U(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,N(r,n),N(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*A.w,g=(1-l/2-c)*A.w,y=(m+g)/2,x=g-m,_=(1-l)*A.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),L.emit("plotly_relayouting",R(p))}function V(){z(L),p!==f&&(a.call("_guiRelayout",L,R(p)),O&&L.data&&L._context.showTips&&(o.notifier(l(L,"Double-click to zoom back out"),"long"),O=!1))}function H(t,e){var r=t/A.xaxis._m,n=e/A.yaxis._m,i=[(p={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,p.b,p.c].sort(o.sorterAsc),a=i.indexOf(p.a),l=i.indexOf(p.b),c=i.indexOf(p.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),p={a:i[a],b:i[l],c:i[c]},e=(f.a-p.a)*A.yaxis._m,t=(f.c-p.c-f.b+p.b)*A.xaxis._m);var h=s(A.x0+t,A.y0+e);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d=s(-t,-e);A.clipDefRelative.select("path").attr("transform",d),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,A),L.emit("plotly_relayouting",R(p))}function q(){a.call("_guiRelayout",L,R(p))}this.dragOptions={element:S,gd:L,plotinfo:{id:A.id,domain:L._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(a,l,u){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],t=L._fullLayout._invScaleX,e=L._fullLayout._invScaleY;var m=A.dragOptions.dragmode=L._fullLayout.dragmode;y(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=F,A.dragOptions.doneFn=V,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,L._fullLayout._calcInverseTransform(L);var u=L._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,h=A.aaxis.range[1]-f.a,d=i(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),v="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,T=D.append("path").attr("class","zoombox").attr("transform",s(A.x0,A.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=D.append("path").attr("class","zoombox-corners").attr("transform",s(A.x0,A.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearSelect(L)}(0,l,u)):"pan"===m?(A.dragOptions.moveFn=H,A.dragOptions.clickFn=F,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearSelect(L)):(x(m)||y(m))&&_(a,l,u,A.dragOptions,m)}},S.onmousemove=function(t){g.hover(L,t,A.id),L._fullLayout._lasthover=S,L._fullLayout._hoversubplot=A.id},S.onmouseout=function(t){L._dragging||m.unhover(L,t)},m.init(this.dragOptions)}},{"../../components/color":650,"../../components/dragelement":669,"../../components/dragelement/helpers":668,"../../components/drawing":672,"../../components/fx":690,"../../components/titles":748,"../../lib":787,"../../lib/extend":777,"../../registry":915,"../cartesian/axes":838,"../cartesian/constants":845,"../cartesian/select":858,"../cartesian/set_convert":859,"../plots":901,"@plotly/d3":58,tinycolor2:583}],915:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=l.extendFlat,h=l.extendDeepAll;function p(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var i in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":650,"../components/drawing":672,"../constants/xmlns_namespaces":764,"../lib":787,"@plotly/d3":58}],924:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+c||!n(u))}for(var p=0;pa))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(e).isValid()?e:void 0!==r?r:t.dflt},r.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},r.getValue=function(t,e){var r;return Array.isArray(t)?e0?e+=r:u<0&&(e-=r)}return e}function z(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var D=t[f+"a"],R=t[h+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==c){k||(L=function(t){return Math.min(M(t),t.p-y.bargroupwidth/2)},C=function(t){return Math.max(A(t),t.p+y.bargroupwidth/2)});var B=g[t.index],N=v.base?B.b+B.s:B.s;t[h+"0"]=t[h+"1"]=R.c2p(B[h],!0),t[h+"LabelVal"]=N;var j=y.extents[y.extents.round(B.p)];t[f+"0"]=D.c2p(x?L(B):j[0],!0),t[f+"1"]=D.c2p(x?C(B):j[1],!0);var U=void 0!==B.orig_p;return t[f+"LabelVal"]=U?B.orig_p:B.p,t.labelLabel=l(D,t[f+"LabelVal"],v[f+"hoverformat"]),t.valueLabel=l(R,t[h+"LabelVal"],v[h+"hoverformat"]),t.baseLabel=l(R,B.b,v[h+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return P(M(t),A(t),w)}(B))/2,t[f+"Spike"]=D.c2p(B.p,!0),o(B,v,t),t.hovertemplate=v.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":650,"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"./helpers":931}],933:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc").crossTraceCalc,colorbar:t("../scatter/marker_colorbar"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"bar",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":852,"../scatter/marker_colorbar":1220,"./arrays_to_calcdata":924,"./attributes":925,"./calc":926,"./cross_trace_calc":928,"./defaults":929,"./event_data":930,"./hover":932,"./layout_attributes":934,"./layout_defaults":935,"./plot":936,"./select":937,"./style":939}],934:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],935:[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,c=!1,u=!1,f={},h=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,f="start"===c,h=((a.leftToRight||0)+1)/2,p=1-h,d=i.width,m=i.height,g=Math.abs(e-t),v=Math.abs(n-r),y=g>2*_&&v>2*_?_:0;g-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=g&&m<=v||!(d>g||m>v)||(d>v||m>g)&&d.01?q:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?q(t):t>e?Math.ceil(t):Math.floor(t)};B=G(B,N,D),N=G(N,B,D),j=G(j,U,!D),U=G(U,j,!D)}var Y=M(a.ensureSingle(I,"path"),P,g,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(U-j))||V&&t._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+U+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var W=l.makePointStyleFns(f);l.singlePointStyle(c,Y,f,W,t)}!function(t,e,r,n,i,s,c,f,p,g,v){var w,T=e.xaxis,A=e.yaxis,C=t._fullLayout;function P(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,O="h"===I.orientation,z=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,h,p="waterfall"===o.type,d="funnel"===o.type;"h"===o.orientation?(l="y",c=i,f="x",h=n):(l="x",c=n,f="y",h=i);function m(t){return u(h,h.c2l(t),!0).text}var g=e[r],v={};v.label=g.p,v.labelLabel=v[l+"Label"]=(y=g.p,u(c,c.c2l(y),!0).text);var y;var x=a.castOption(o,g.i,"text");(0===x||x)&&(v.text=x);v.value=g.s,v.valueLabel=v[f+"Label"]=m(g.s);var _={};b(_,o,g.i),p&&(v.delta=+g.rawS||g.s,v.deltaLabel=m(v.delta),v.final=g.v,v.finalLabel=m(v.final),v.initial=v.final-v.delta,v.initialLabel=m(v.initial));d&&(v.value=g.s,v.valueLabel=m(v.value),v.percentInitial=g.begR,v.percentInitialLabel=a.formatPercent(g.begR),v.percentPrevious=g.difR,v.percentPreviousLabel=a.formatPercent(g.difR),v.percentTotal=g.sumR,v.percenTotalLabel=a.formatPercent(g.sumR));var w=a.castOption(o,g.i,"customdata");w&&(v.customdata=w);return a.texttemplateString(s,v,t._d3locale,_,v,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var f,h=i.textinfo,p=t[e],d=h.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};g("label")&&m.push((v=t[e].p,u(o?n:r,v,!0).text));var v;g("text")&&(0===(f=a.castOption(i,p.i,"text"))||f)&&m.push(f);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(c(b)),g("delta")&&m.push(c(y)),g("final")&&m.push(c(x))}if(l){g("value")&&m.push(c(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(f=a.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),g("percent previous")&&(f=a.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),g("percent total")&&(f=a.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(e,r,n,i):m.getValue(s.text,r);return m.coerceString(y,o)}(C,n,i,T,A);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(x,r)}(I,i);var D="stack"===g.mode||"relative"===g.mode,R=n[i],F=!D||R._outmost;if(!z||"none"===w||(R.isBlank||s===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=C.font,N=d.getBarColor(n[i],I),j=d.getInsideTextFont(I,i,B,N),U=d.getOutsideTextFont(I,i,B),V=r.datum();O?"log"===T.type&&V.s0<=0&&(s=T.range[0]=G*(Z/Y):Z>=Y*(X/G);G>0&&Y>0&&(J||K||Q)?w="inside":(w="outside",H.remove(),H=null)}else w="inside";if(!H){W=a.ensureUniformFontSize(t,"outside"===w?U:j);var $=(H=P(r,z,W)).attr("transform");if(H.attr("transform",""),q=l.bBox(H.node()),G=q.width,Y=q.height,H.attr("transform",$),G<=0||Y<=0)return void H.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:h>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/u));var m=S(c),g=E(i,m),v=(s?g.x:g.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,M=0,A=s?k(e,t):k(r,n);s?(b=e-A*o,T=A*v):(w=n+A*o,M=-A*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:d,rotate:m}}(s,c,f,p,q,{isHorizontal:O,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=L(s,c,f,p,q,{isHorizontal:O,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=W.size,h(I.type,tt,C),R.transform=tt,M(H,C,g,v).attr("transform",a.getTextTransform(tt))}(t,e,I,r,p,B,N,j,U,g,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,C,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,g)},toMoveInsideBar:L}},{"../../components/color":650,"../../components/drawing":672,"../../components/fx/helpers":686,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../registry":915,"./attributes":925,"./constants":927,"./helpers":931,"./style":939,"./uniform_text":941,"@plotly/d3":58,"fast-isnumeric":246}],937:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":650,"../../components/drawing":672,"../../lib":787,"../../registry":915,"./attributes":925,"./helpers":931,"./uniform_text":941,"@plotly/d3":58}],940:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":650,"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787}],941:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=oh.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return m(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=a(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":690,"../../lib":787,"../../plots/polar/helpers":903,"../bar/hover":932,"../scatterpolar/hover":1280}],946:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":904,"../bar/select":937,"../bar/style":939,"../scatter/marker_colorbar":1220,"../scatterpolar/format_labels":1279,"./attributes":942,"./calc":943,"./defaults":944,"./hover":945,"./layout_attributes":947,"./layout_defaults":948,"./plot":949}],947:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],948:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,f,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(p)&&i(d)&&o!==s&&p!==d){var m=u.c2g(t.s1),g=(p+d)/2;t.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=h(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":672,"../../lib":787,"../../plots/polar/helpers":903,"@plotly/d3":58,"fast-isnumeric":246}],950:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../bar/attributes":925,"../scatter/attributes":1202}],951:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,y,x,b,_,w,T=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),M=i.getFromId(t,e.yaxis||"y"),A=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(y=k,x="x",b=M,_="y",w=!!e.yperiodalignment):(y=M,x="y",b=k,_="x",w=!!e.xperiodalignment);var E,L,C,P,I,O,z=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;for(var f="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),h=t._length,p=new Array(h),d=0;dE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return y.d2c((e[t]||[])[r])},H=1/0,q=-1/0;for(r=0;r=E.q1&&E.q3>=E.med){var Y=V("lowerfence");E.lf=Y!==s&&Y<=E.q1?Y:p(E,C,P);var W=V("upperfence");E.uf=W!==s&&W>=E.q3?W:d(E,C,P);var X=V("mean");E.mean=X!==s?X:P?o.mean(C,P):(E.q1+E.q3)/2;var Z=V("sd");E.sd=X!==s&&Z>=0?Z:P?o.stdev(C,P,E.mean):E.q3-E.q1,E.lo=m(E),E.uo=g(E);var J=V("notchspan");J=J!==s&&J>0?J:v(E,P),E.ln=E.med-J,E.un=E.med+J;var K=E.lf,Q=E.uf;e.boxpoints&&C.length&&(K=Math.min(K,C[0]),Q=Math.max(Q,C[P-1])),e.notched&&(K=Math.min(K,E.ln),Q=Math.max(Q,E.un)),E.min=K,E.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),$=E.med!==s?E.med:E.q1!==s?E.q3!==s?(E.q1+E.q3)/2:E.q1:E.q3!==s?E.q3:0,E.med=$,E.q1=E.q3=$,E.lf=E.uf=$,E.mean=E.sd=$,E.ln=E.un=$,E.min=E.max=$}H=Math.min(H,E.min),q=Math.max(q,E.max),E.pts2=L.filter(j),A.push(E)}}e._extremes[y._id]=i.findExtremes(y,[H,q],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ft;if((E={}).pos=E[_]=B[r],L=E.pts=nt[r].sort(f),P=(C=E[x]=L.map(h)).length,E.min=C[0],E.max=C[P-1],E.mean=o.mean(C,P),E.sd=o.stdev(C,P,E.mean),E.med=o.interp(C,.5),P%2&&(lt||ct))lt?(ut=C.slice(0,P/2),ft=C.slice(P/2+1)):ct&&(ut=C.slice(0,P/2+1),ft=C.slice(P/2)),E.q1=o.interp(ut,.5),E.q3=o.interp(ft,.5);else E.q1=o.interp(C,.25),E.q3=o.interp(C,.75);E.lf=p(E,C,P),E.uf=d(E,C,P),E.lo=m(E),E.uo=g(E);var ht=v(E,P);E.ln=E.med-ht,E.un=E.med+ht,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=L.filter(j),A.push(E)}e._extremes[y._id]=i.findExtremes(y,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(A[0].t={num:T[S],dPos:N,posLetter:_,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(t,e,r){for(var n in c)o.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(e[n][r[0]])&&(t[c[n]]=e[n][r[0]][r[1]]):t[c[n]]=e[n][r])}function f(t,e){return t.v-e.v}function h(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function d(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function v(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"fast-isnumeric":246}],952:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,h=o._id,p=h.charAt(0),d=[],m=0;for(s=0;s1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;q+G>=0&&((W=V*(q+G))>A?(H=!0,j=Y,B=W):W>R&&(j=Y,B=A)),W<=A&&(B=A);var X=0;q-G<=0&&((X=-V*(q-G))>S?(H=!0,U=Y,N=X):X>F&&(U=Y,N=S)),X<=S&&(N=S)}else B=A,N=S;var Z=new Array(c.length);for(l=0;l0?(g="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",v=Math.min(_)):v=0;if(v){e._length=v;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===y&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);u?(r("jitter","all"===u?.3:0),r("pointpos","all"===u?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text"),r("hovertext")):delete e.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var h=!1;if(l){var p=s("mean"),d=s("sd");p&&p.length&&(h=!0,d&&d.length&&(h="sd"))}s("boxmean",h),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,f=a.bPos,h=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+f,!0),i=c.l2p(e-o)+h,a=c.l2p(e+s)+h,d=u?(i+a)/2:c.l2p(e)+h,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),v=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+i+"L"+v+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+i+","+m+"L"+d+","+v+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],f=a.t,h=a.trace;(f.wdPos=f.bdPos*h.whiskerwidth,!0!==h.visible||f.empty)?i.remove():("h"===h.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},h,f),s(i,{x:c,y:u},h,f),l(i,{pos:e,val:r},h,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":672,"../../lib":787,"@plotly/d3":58}],960:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=L>0?Math.ceil:Math.floor,O=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,D=P(S+C),R=I(E-C),F=[[f=A(S)]];for(a=D;a*L=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],974:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,f,h,p,d,m,g,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],M=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var A=t._xctrl,S=t._yctrl,E=A[0].length,L=A.length,C=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function O(n){var i,a,o,s,l,c,u,f,p,d,m,g,v=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,a))),s=a-o,x.length=P,x.crossLength=C,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(C-2,i))),u=i-c,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),v.push(l[0]+m[0]/3),y.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=M,x.value=n,x.constvar=r,x.index=h,x.x=v,x.y=y,x.smoothing=M.smoothing,x}function z(n){var i,a,o,s,l,c=[],u=[],f={};if(f.length=x.length,f.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(z(o),{color:b.gridcolor,width:b.gridwidth}));for(h=u;hx.length-1||m<0||m>x.length-1))for(g=x[s],v=x[m],a=0;ax[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(i(z(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(z(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],f=c[1],h=u;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(O(p),{color:b.gridcolor,width:b.gridwidth}));for(h=u-1;hx[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&T.push(i(O(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(O(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":777,"../../plots/cartesian/axes":838}],975:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],989:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,f=c.strTranslate,h=t("../../constants/alignment");function p(t,e,r,i,s,l){var c="const-"+s+"-lines",u=r.selectAll("."+c).data(l);u.enter().append("path").classed(c,!0).style("vector-effect","non-scaling-stroke"),u.each((function(r){var i=r,s=i.x,l=i.y,c=a([],s,t.c2p),u=a([],l,e.c2p),f="M"+o(c,u,i.smoothing);n.select(this).attr("d",f).style("stroke-width",i.width).style("stroke",i.color).style("fill","none")})),u.exit().remove()}function d(t,e,r,a,o,c,h,p){var d=c.selectAll("text."+p).data(h);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(o,c){var h;if("auto"===o.axis.tickangle)h=s(a,e,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;h=s(a,e,r,o.xy,[Math.cos(p),Math.sin(p)])}c||(g={angle:h.angle,flip:h.flip});var d=(o.endAnchor?-1:1)*h.flip,v=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),y=i.bBox(this);v.attr("transform",f(h.p[0],h.p[1])+u(h.angle)+f(o.axis.labelpadding*d,.3*y.height)),m=Math.max(m,y.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,f=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],h=i.trace,m=h.aaxis,g=h.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",h.opacity),p(l,u,x,m,"a",m._gridlines),p(l,u,x,g,"b",g._gridlines),p(l,u,y,m,"a",m._minorgridlines),p(l,u,y,g,"b",g._minorgridlines),p(l,u,b,m,"a-boundary",m._boundarylines),p(l,u,b,g,"b-boundary",g._boundarylines);var w=d(t,l,u,h,i,_,m._labels,"a-label"),T=d(t,l,u,h,i,_,g._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,f,h,p,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+m),f=g,h=r.ab2xy(u,f,!0),p=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,h,r.dxydb_rough(u,f)));v(t,e,r,n,h,p,r.aaxis,i,a,o,"a-title"),u=d,f=.5*(g+y),h=r.ab2xy(u,f,!0),p=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,h,r.dxyda_rough(u,f)));v(t,e,r,n,h,p,r.baxis,i,a,l,"b-title")}(t,_,h,i,l,u,w,T),function(t,e,r,n,i){var s,l,u,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,m=[];for(f=0;f90&&y<270,b=n.select(this);b.text(h.title.text).call(l.convertToTspans,t),x&&(_=(-l.lineCount(b)+g)*m*a-_),b.attr("transform",f(e.p[0],e.p[1])+u(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,h.title.font)})),b.exit().remove()}},{"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"./makepath":986,"./map_1d_array":987,"./orient_text":988,"@plotly/d3":58}],990:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[c-1],m=r[0],g=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,m-=b,g+=b,t.isVisible=function(t,e){return t>p&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,h.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,h.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,p,d,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(p=u-2,d=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,p,h,d),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,p,h,d),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":807,"./compute_control_points":978,"./constants":979,"./create_i_derivative_evaluator":980,"./create_j_derivative_evaluator":981,"./create_spline_evaluator":982}],991:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",M,"iterations"),t}},{"../../lib":787}],992:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":787}],993:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":649,"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scattergeo/attributes":1244}],994:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var f=0;f")}(t,f,o),[t]}},{"../../lib":787,"../../plots/cartesian/axes":838,"./attributes":993}],998:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":871,"../heatmap/colorbar":1072,"./attributes":993,"./calc":994,"./defaults":995,"./event_data":996,"./hover":997,"./plot":999,"./select":1e3,"./style":1001}],999:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),f=[],h=[],p=0;p=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":893,"./convert":1003}],1007:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1008:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&h===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),h=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],1015:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(e,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(e);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===c&&(r._fillcolor=u);r._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":662,"./end_plus":1023,"./make_color_map":1028}],1016:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],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]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],1017:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,p,d,m=e.contours,g=r("contours.operation");(m._operation=c[g],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,m),"="===g?h=m.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,p,f)}},{"../../components/color":650,"../../constants/filter_ops":759,"./label_defaults":1027,"fast-isnumeric":246}],1018:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":759,"fast-isnumeric":246}],1019:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],1020:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths),starts:n.extendDeep([],t.starts)})}e.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":787,"./constraint_mapping":1018,"./end_plus":1023}],1023:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],1024:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),p=[s(t,e,[-h[0],-h[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),v=h.slice();for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(h[0]||h[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[f]):delete t.crossings[u],!(h=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}p.push(s(t,e,h)),e[0]+=h[0],e[1]+=h[1],u=e.join(","),a(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=h[0]&&(e[0]<0||e[0]>m-2)||h[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&h[0]===v[0]&&h[1]===v[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,M,A,S,E,L,C,P,I,O,z=a(p[0],p[p.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]A&&S--,t.edgepaths[S]=L.concat(p,E));break}V||(t.edgepaths[A]=p.concat(E))}for(A=0;At?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,c,u,f,h=t[0].z,p=h.length,d=h[0].length,m=2===p||2===d;for(r=0;r=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}h=s,(d=-1===p.indexOf(h))&&(h=p[0],f+="Z")}for(h=0;hn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(h<1||p<1)return 1/0;var d=v.EDGECOST*(1/(h-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var m=s-u,g=l-f,y=s+u,x=l+f,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(h<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),h=function(t,e){return[s+t*f-e*u,l+t*u+e*f]},p=[h(-a/2,-o/2),h(-a/2,o/2),h(a/2,o/2),h(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,h=t._input.contours;if(u>f&&(r.start=h.start=f,f=r.end=h.end=u,u=r.start),!(r.size>0))c=u===f?1:a(u,f,t.ncontours).dtick,h.size=r.size=c}}},{"../../lib":787,"../../plots/cartesian/axes":838}],1032:[function(t,e,r){"use strict";var n=t("@plotly/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[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,h=!u&&"fill"===a.coloring,p=f||h?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),p(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),a(t)}},{"../../components/drawing":672,"../heatmap/style":1081,"./make_color_map":1028,"@plotly/d3":58}],1033:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":660,"./label_defaults":1027}],1034:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../contour/attributes":1012,"../heatmap/attributes":1069}],1035:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),f=t("../carpet/lookup_carpetid"),h=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,f,h,p,d,m,g=e._carpetTrace,v=g.aaxis,y=g.baxis;v._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,h=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],h=h?y.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var x=i.maxRowLength(m),b="scaled"===e.xtype?"":r,_=c(e,b,u,f,x,v),w="scaled"===e.ytype?"":h,T=c(e,w,p,d,m.length,y),k={a:_,b:T,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return h(e,e._z),m}}},{"../../components/colorscale/calc":658,"../../lib":787,"../carpet/lookup_carpetid":985,"../contour/set_contours":1031,"../heatmap/clean_2d_array":1071,"../heatmap/convert_column_xyz":1073,"../heatmap/find_empties":1075,"../heatmap/interp2d":1078,"../heatmap/make_bound_array":1079,"./defaults":1036}],1036:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":787,"../contour/constraint_defaults":1017,"../contour/contours_defaults":1019,"../contour/style_defaults":1033,"../heatmap/xyz_defaults":1083,"./attributes":1034}],1037:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":852,"../contour/colorbar":1015,"../contour/style":1032,"./attributes":1034,"./calc":1035,"./defaults":1036,"./plot":1038}],1038:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),h=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),g=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,M=k._carpetTrace=m(t,k),A=t.calcdata[M.index][0];if(M.visible&&"legendonly"!==M.visible){var S=T.a,E=T.b,L=k.contours,C=p(L,e,T),P="constraint"===L.type,I=L._operation,O=P?"="===I?"lines":"fill":L.coloring,z=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(C);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(C,D,R);var F,B,N,j,U=C;"constraint"===L.type&&(U=h(C,I)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=A.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),V.push(a(B,N,F.bicubic));var H="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,h,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(h=0;h=0&&(h=L,d=m):Math.abs(f[1]-h[1])=0&&(h=L,d=m):s.log("endpt to newendpt is not vert. or horz.",f,h,L)}if(d>=0)break;y+=S(f,h),f=h}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(f,h)+"Z",f=null)}for(u=0;ug&&(n.max=g);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),f.LABELMAX),a=0;a0?+p[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":650,"../../components/colorscale":662,"../../constants/numerical":763,"../../lib":787,"../../lib/geojson_utils":781,"fast-isnumeric":246}],1042:[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=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":660,"../../lib":787,"./attributes":1039}],1043:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],1044:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":838,"../scattermapbox/hover":1272}],1045:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":893,"./convert":1041}],1047:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,h),[l]}}},{"../../components/color":650,"../../lib":787,"../bar/hover":932}],1055:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":852,"../bar/select":937,"./attributes":1048,"./calc":1049,"./cross_trace_calc":1051,"./defaults":1052,"./event_data":1053,"./hover":1054,"./layout_attributes":1056,"./layout_defaults":1057,"./plot":1058,"./style":1059}],1056:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1057:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":650,"../../components/drawing":672,"../../constants/interactions":762,"../bar/style":939,"../bar/uniform_text":941,"@plotly/d3":58}],1060:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176}],1061:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":901}],1062:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":1178}],1063:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),f=c("values"),h=s(u,f),p=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"../pie/defaults":1179,"./attributes":1060}],1064:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":1187,"./attributes":1060,"./base_plot":1061,"./calc":1062,"./defaults":1063,"./layout_attributes":1065,"./layout_defaults":1066,"./plot":1067,"./style":1068}],1065:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":1183}],1066:[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"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":787,"./layout_attributes":1065}],1067:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),f=u.recordMinTextSize,h=u.clearMinTextSize,p=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,v=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._fullLayout;h("funnelarea",r),y(e,t),v(e,r._size),a.makeTraceGroups(r._funnelarealayer,e,"trace").each((function(e){var u=n.select(this),h=e[0],d=h.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var f,h,p=[];for(p.push(u()),f=t.length-1;f>-1;f--)if(!(h=t[f]).hidden){var d=h.v/l;c+=d,p.push(u())}var m=1/0,g=-1/0;for(f=0;f-1;f--)if(!(h=t[f]).hidden){var M=p[k+=1][0],A=p[k][1];h.TL=[-M,A],h.TR=[M,A],h.BL=w,h.BR=T,h.pxmid=(S=h.TR,E=h.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=h.TL,T=h.TR}var S,E}(e),u.each((function(){var u=n.select(this).selectAll("g.slice").data(e);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=d.index;var u=h.cx,v=h.cy,y=n.select(this),x=y.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.call(m,t,e);var w="M"+(u+o.TR[0])+","+(v+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";x.attr("d",w),b(t,o,h);var T=p.castOption(d.textposition,o.pts),k=y.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var h=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=a.ensureUniformFontSize(t,g(d,o,r.font));h.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,t);var m,y,x,b=i.bBox(h.node()),_=Math.min(o.BL[1],o.BR[1])+v,w=Math.max(o.TL[1],o.TR[1])+v;y=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(m=c(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(d.type,m,r),e[s].transform=m,h.attr("transform",a.getTextTransform(m))}))}}));var v=n.select(this).selectAll("g.titletext").data(d.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),c=d.title.text;d._meta&&(c=a.templateString(c,d._meta)),e.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,d.title.font).call(l.convertToTspans,t);var u=x(h,r._size);e.attr("transform",s(u.x,u.y)+o(Math.min(1,u.scale))+s(u.tx,u.ty))}))}))}))}},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../bar/plot":936,"../bar/uniform_text":941,"../pie/helpers":1181,"../pie/plot":1185,"@plotly/d3":58}],1068:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(i,t,e)}))}))}},{"../bar/uniform_text":941,"../pie/style_one":1187,"@plotly/d3":58}],1069:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({z:{valType:"data_array",editType:"calc"},x:l({},n.x,{impliedEdits:{xtype:"array"}}),x0:l({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:l({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:l({},n.y,{impliedEdits:{ytype:"array"}}),y0:l({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:l({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:l({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:l({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:l({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:l({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:l({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:l({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:o(),showlegend:l({},i.showlegend,{dflt:!1})},{transforms:void 0},s("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1070:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),h=t("./find_empties"),p=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nD){O("x scale is not linear");break}}if(x.length&&"fast"===P){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){O("y scale is not linear");break}}}var B=i.maxRowLength(T),N="scaled"===e.xtype?"":r,j=p(e,N,g,v,B,A),U="scaled"===e.ytype?"":x,V=p(e,U,b,_,T.length,S);C||(e._extremes[A._id]=a.findExtremes(A,j),e._extremes[S._id]=a.findExtremes(S,V));var H={x:j,y:V,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(H.orig_x=y),e.yperiodalignment&&w&&(H.orig_y=w),N&&N.length===j.length-1&&(H.xCenter=N),U&&U.length===V.length-1&&(H.yCenter=U),L&&(H.xRanges=M.xRanges,H.yRanges=M.yRanges,H.pts=M.pts),E||l(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};H.xfill=p(q,N,g,v,B,A),H.yfill=p(q,U,b,_,T.length,S)}return[H]}},{"../../components/colorscale/calc":658,"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/axes":838,"../../registry":915,"../histogram2d/calc":1102,"./clean_2d_array":1071,"./convert_column_xyz":1073,"./find_empties":1075,"./interp2d":1078,"./make_bound_array":1079}],1071:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":787}],1076:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,f,h,p=l.isContour,d=t.cd[0],m=d.trace,g=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=m.zhoverformat,M=y,A=x;if(!1!==t.index){try{f=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(f<0||f>=b[0].length||h<0||h>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var S;for(M=[2*y[0]-y[1]],S=1;Sm&&(v=Math.max(v,Math.abs(t[a][o]-d)/(g-m))))}return v}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":787}],1079:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var m=e.length;if(!(m<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],u=1;u0;)h=p.c2p(T[y]),y--;for(h0;)v=d.c2p(k[y]),y--;if(v0&&(a=!0);for(var l=0;la){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]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,p=t-h,d=r[0],m=r[1],g=Math.min(f(d+h,d+p,n,a),f(m+h,m+p,n,a)),v=Math.min(f(d+c,d+h,n,a),f(m+c,m+h,n,a));if(g>v&&vo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),z.start=r.l2r(j),F||i.nestedProperty(e,v+".start").set(z.start)}var U=b.end,V=r.r2l(O.end),H=void 0!==V;if((b.endFound||H)&&V!==r.r2l(U)){var q=H?V:i.aggNums(Math.max,null,d);z.end=r.l2r(q),H||i.nestedProperty(e,v+".start").set(z.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=i.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[z,d]}e.exports={calc:function(t,e){var r,a,p,d,m=[],g=[],v=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",x={x:"y",y:"x"}[y],b=e[y+"calendar"],_=e.cumulative,w=h(t,e,v,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],S=M?A:T,E=[],L=[],C=[],P=0,I=e.histnorm,O=e.histfunc,z=-1!==I.indexOf("density");_.enabled&&z&&(I=I.replace(/ ?density$/,""),z=!1);var D,R="max"===O||"min"===O?null:0,F=l.count,B=c[I],N=!1,j=function(t){return v.r2c(t,0,b)};for(i.isArrayOrTypedArray(e[x])&&"count"!==O&&(D=e[x],N="avg"===O,F=l[O]),r=j(T.start),p=j(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,_.direction,_.currentbin);var J=Math.min(m.length,g.length),K=[],Q=0,$=J-1;for(r=0;r=Q;r--)if(g[r]){$=r;break}for(r=Q;r<=$;r++)if(n(m[r])&&n(g[r])){var tt={p:m[r],s:g[r],b:0};_.enabled||(tt.pts=C[r],G?tt.ph0=tt.ph1=C[r].length?k[C[r][0]]:m[r]:(e._computePh=!0,tt.ph0=H(A[r]),tt.ph1=H(A[r+1],!0))),K.push(tt)}return 1===K.length&&(K[0].width1=o.tickIncrement(K[0].p,T.size,!1,b)-K[0].p),s(K,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(K,e,X),K},calcAllAutoBins:h}},{"../../lib":787,"../../plots/cartesian/axes":838,"../../registry":915,"../bar/arrays_to_calcdata":924,"./average":1089,"./bin_functions":1091,"./bin_label_vals":1092,"./norm_functions":1100,"fast-isnumeric":246}],1094:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],1095:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=t("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var r,f,h,p,d,m,g,v=e._histogramBinOpts={},y=[],x={},b=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function T(t,r,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),A.length>S&&A.splice(S,A.length-S);var E=[],L=[],C=[],P="string"==typeof w.size,I="string"==typeof M.size,O=[],z=[],D=P?O:w,R=I?z:M,F=0,B=[],N=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,q=a.count,G=o[j],Y=!1,W=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(Y="avg"===U,q=a[U]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-i.tickIncrement(K,J,!1,v))/1e6;for(r=K;r=0&&p=0&&d-1,flipY:E.tiling.flip.indexOf("y")>-1,orientation:E.tiling.orientation,pad:{inner:E.tiling.pad},maxDepth:E._maxDepth}).descendants(),O=1/0,z=-1/0;I.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),z=Math.max(z,e))})),p=p.data(I,u.getPtId),E._maxVisibleLayers=isFinite(z)?z-O+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var D=null;if(w&&A){var R=u.getPtId(A);p.each((function(t){null===D&&u.getPtId(t)===R&&(D={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var F=function(){return D||{x0:0,x1:m,y0:0,y1:g}},B=p;return w&&(B=B.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),B.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-E.tiling.pad),s._hoverY=y(P?s.y1-E.tiling.pad/2:s.y0+E.tiling.pad/2);var p=n.select(this),d=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events","all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,F(),[m,g],{orientation:E.tiling.orientation,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1});return function(t){return x(e(t))}})):d.attr("d",x),p.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h(s,r,E,e,S)||"";var T=i.ensureSingle(p,"g","slicetext"),A=i.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),I=i.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L?"start":"middle").call(a.font,I).call(o.convertToTspans,t),s.textBB=a.bBox(A.node()),s.transform=b(s,{fontSize:I.size}),s.transform.fontSize=I.size,w?A.transition().attrTween("transform",(function(t){var e=M(t,!1,F(),[m,g]);return function(t){return _(e(t))}})):A.attr("transform",_(s))})),D}},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"../sunburst/plot":1324,"../treemap/constants":1343,"./partition":1118,"./style":1120,"@plotly/d3":58}],1115:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1220,"./attributes":1110,"./base_plot":1111,"./calc":1112,"./defaults":1113,"./layout_attributes":1116,"./layout_defaults":1117,"./plot":1119,"./style":1120}],1116:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1117:[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("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":787,"./layout_attributes":1116}],1118:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(f,e,{swapXY:s,flipX:a,flipY:o}),f}},{"../treemap/flip_tree":1348,"d3-hierarchy":167}],1119:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1345,"./draw_descendants":1114}],1120:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"@plotly/d3":58}],1121:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[h][f]:s._hasSource&&(u=s._canvas.el.getContext("2d").getImageData(f,h,1,1).data),u){var p,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var g,v=a.colormodel[s.colormodel],y=v.colormodel||s.colormodel,x=y.length,b=s._scaler(u),_=v.suffix,w=[];(s.hovertemplate||p)&&(w.push("["+[b[0]+_[0],b[1]+_[1],b[2]+_[2]].join(", ")),4===x&&w.push(", "+b[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=y.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[h])?g=s.hovertext[h][f]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(g=s.text[h][f]);var T=c.c2p(o.y0+(h+.5)*s.dy),k=o.x0+(f+.5)*s.dx,M=o.y0+(h+.5)*s.dy,A="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[h,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:A,text:g,hovertemplateLabels:{zLabel:A,colorLabel:w,"color[0]Label":b[0]+_[0],"color[1]Label":b[1]+_[1],"color[2]Label":b[2]+_[2],"color[3]Label":b[3]+_[3]}})]}}}},{"../../components/fx":690,"../../lib":787,"./constants":1123}],1128:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),eventData:t("./event_data"),moduleType:"trace",name:"image",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":852,"./attributes":1121,"./calc":1122,"./defaults":1124,"./event_data":1125,"./hover":1127,"./plot":1129,"./style":1130}],1129:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,h=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&h)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var d,m,g,v,y,x,b=l.z,_=l.x0,w=l.y0,T=l.w,k=l.h,M=c.dx,A=c.dy;for(x=0;void 0===d&&x0;)m=u.c2p(_+x*M),x--;for(x=0;void 0===v&&x0;)y=f.c2p(w+x*A),x--;if(mI[0];if(O||z){var D=d+S/2,R=v+E/2;C+="transform:"+a(D+"px",R+"px")+"scale("+(O?-1:1)+","+(z?-1:1)+")"+a(-D+"px",-R+"px")+";"}}L.attr("style",C);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=k;var r=e.getContext("2d");c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:e,source:c.source},t()},n.setAttribute("src",c.source)}})).then((function(){var t;if(c._hasZ)t=B((function(t,e){return b[e][t]})).toDataURL("image/png");else if(c._hasSource)if(p)t=c.source;else{var e=c._canvas.el.getContext("2d").getImageData(0,0,T,k).data;t=B((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}L.attr({"xlink:href":t,height:E,width:S,x:d,y:v})}));t._promises.push(F)}function B(t){var e=document.createElement("canvas");e.width=S,e.height=E;var r,n=e.getContext("2d"),a=function(t){return i.constrain(Math.round(u.c2p(_+t*M)-d),0,S)},o=function(t){return i.constrain(Math.round(f.c2p(w+t*A)-v),0,E)},h=s.colormodel[c.colormodel],p=h.colormodel||c.colormodel,m=h.fmt;for(x=0;x0}function T(t){t.each((function(t){y.stroke(n.select(this),t.line.color)})).each((function(t){y.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,v,t,e)}return m(i,a,l,s,n),g(i,a,l,s),a}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function A(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(p.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var g,v=t._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(v._indicatorlayer,e,"trace").each((function(e){var m,E,L,C,P,I=e[0].trace,O=n.select(this),z=I._hasGauge,D=I._isAngular,R=I._isBullet,F=I.domain,B={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,H=I.align||"center";if(E=j,z){if(D&&(m=N,E=j+U/2,L=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*V)}),R){var q=h.bulletPadding,G=1-h.bulletNumberDomainSize+q;m=B.l+(G+(1-G)*b[H])*B.w,L=function(t){return M(t,(h.bulletNumberDomainSize-q)*B.w,B.h)}}}else m=B.l+b[H]*B.w,L=function(t){return M(t,B.w,B.h)};!function(t,e,r,i){var c,u,h,m=r[0].trace,g=i.numbersX,v=i.numbersY,T=m.align||"center",M=x[T],E=i.transitionOpts,L=i.onComplete,C=o.ensureSingle(e,"g","numbers"),P=[];m._hasNumber&&P.push("number");m._hasDelta&&(P.push("delta"),"left"===m.delta.position&&P.reverse());var I=C.selectAll("text").data(P);function O(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}I.enter().append("text"),I.attr("text-anchor",(function(){return M})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,D=m.mode+m.align;m._hasDelta&&(z=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=function(t){return m.delta.relative?t.relativeDelta:t.delta},s=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+e(t)},l=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=o(r[0]));var c=C.select("text.delta");function h(){c.text(s(o(r[0]),i)).call(y.fill,l(r[0])).call(p.convertToTspans,t)}return c.call(f.font,m.delta.font).call(y.fill,l({delta:m._deltaLastValue})),w(E)?c.transition().duration(E.duration).ease(E.easing).tween("text",(function(){var t=n.select(this),e=o(r[0]),c=m._deltaLastValue,u=O(m.delta.valueformat,i,c,e),f=a(c,e);return m._deltaLastValue=e,function(e){t.text(s(f(e),u)),t.call(y.fill,l({delta:f(e)}))}})).each("end",(function(){h(),L&&L()})).each("interrupt",(function(){h(),L&&L()})):h(),u=A(s(o(r[0]),i),m.delta.font,M,t),c}(),D+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,D+=m.delta.increasing.symbol+m.delta.decreasing.symbol,h=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=C.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,m.number.font).call(p.convertToTspans,t)}w(E)?l.transition().duration(E.duration).ease(E.easing).each("end",(function(){u(),L&&L()})).each("interrupt",(function(){u(),L&&L()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=O(m.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=A(s+i(r[0].y)+o,m.number.font,M,t)}(),D+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,h=c);if(m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+j),D,Math.min),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+j,D,Math.max),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),z.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&C.attr("transform",(function(){var t=i.numbersScaler(h);D+=t[2];var e,r=S(m,"numbersScale",1,t[0],D,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?v-r*h.bottom:v-r*(h.top+h.bottom)/2,m._numbersTop=r*h.top+e;var n=h[T];"center"===T&&(n=(h.left+h.right)/2);var a=g-r*n;return a=S(m,"numbersTranslate",0,a,D,Math.max),l(a,e)+s(r)}))}(t,O,e,{numbersX:m,numbersY:E,numbersScaler:L,transitionOpts:r,onComplete:g}),z&&(C={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},P={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var Y=O.selectAll("g.angular").data(D?e:[]);Y.exit().remove();var W=O.selectAll("g.angularaxis").data(D?e:[]);W.exit().remove(),D&&function(t,e,r,a){var o,s,f,h,p=r[0].trace,m=a.size,g=a.radius,v=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,M=a.layer,A=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function L(t){var e=p.gauge.axis.range[0],r=(t-e)/(p.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function C(t){return n.svg.arc().innerRadius((v+g)/2-t/2*(g-v)).outerRadius((v+g)/2+t/2*(g-v)).startAngle(-E)}function P(t){t.attr("d",(function(t){return C(t.thickness).startAngle(L(t.range[0])).endAngle(L(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),M.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),M.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},O={},z=d.makeLabelFns(o,0).labelStandoff;O.xFn=function(t){var e=I(t);return Math.cos(e)*z},O.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},O.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},O.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return l(b[0]+g*Math.cos(t),b[1]-g*Math.sin(t))};f=function(t){return D(I(t))};if(s=d.calcTicks(o),h=d.getTickSigns(o)[2],o.visible){h="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:M,path:"M"+h*R+",0h"+h*o.ticklen,transFn:function(t){var e=I(t);return D(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:M,transFn:f,labelFns:O})}var F=[y].concat(p.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(P).call(T),B.exit().remove();var N=C(p.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([p.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U=j.select("path");w(A)?(U.transition().duration(A.duration).ease(A.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=N,H=L(r[0].lastY),q=L(r[0].y),function(){var t=i(H,q);return function(e){return V.endAngle(t(e))()}})),p._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?N.endAngle(L(r[0].y)):"M0,0Z");var V,H,q;U.call(T),j.exit().remove(),F=[];var G=p.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var Y=_.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove();var W=_.selectAll("g.gauge-outline").data([x]);W.enter().append("g").classed("gauge-outline",!0).append("path"),W.select("path").call(P).call(T),W.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:W,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var X=O.selectAll("g.bullet").data(R?e:[]);X.exit().remove();var Z=O.selectAll("g.bulletaxis").data(R?e:[]);Z.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,f=n.gauge,p=n.layer,m=n.gaugeBg,g=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var M=v.h,A=u.gauge.bar.thickness*M,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=v.t+v.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:p,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:p,transFn:o,labelFns:d.makeLabelFns(i,c)}));function L(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*M})).attr("height",(function(t){return t.thickness*M}))}var C=[m].concat(u.gauge.steps),P=f.selectAll("g.bg-bullet").data(C);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(L).call(T),P.exit().remove();var I=f.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",A).attr("y",(M-A)/2).call(T),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);I.exit().remove();var O=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),z=f.selectAll("g.threshold-bullet").data(O);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*M).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*M).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),z.exit().remove();var D=f.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(L).call(T),D.exit().remove()}(t,0,e,{gauge:X,layer:Z,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var J=O.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[I.title.align]})).text(I.title.text).call(f.font,I.title.font).call(p.convertToTspans,t),J.attr("transform",(function(){var t,e=B.l+B.w*b[I.title.align],r=h.titlePadding,n=f.bBox(J.node());if(z){if(D)if(I.gauge.axis.visible)t=f.bBox(W.node()).top-r-n.bottom;else t=B.t+B.h/2-U/2-n.bottom-r;R&&(t=E-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)}else t=I._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":650,"../../components/drawing":672,"../../constants/alignment":755,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"../../plots/cartesian/axis_defaults":840,"../../plots/cartesian/layout_attributes":853,"../../plots/cartesian/position_defaults":856,"./constants":1134,"@plotly/d3":58,"d3-interpolate":168}],1138:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../mesh3d/attributes":1143}],1139:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:L(d,m,v);h[p]=x>-1?x:I(d,m,v,R(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function B(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(h,u,n,i),d=B(h,f,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(f,u,n,i),d=B(h,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=U(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]];if(m)i=F(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=B(h,c,r,n),d=B(h,u,r,n),g=B(h,f,r,n);i=F(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(f,c,r,n),d=B(f,u,r,n),g=B(h,u,r,n),v=B(h,c,r,n);m?(i=F(t,[c,v,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,v],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(u,c,r,n),d=B(f,c,r,n),g=B(h,c,r,n);m?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,g],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return d&&(D(t,"A")&&(f=H(null,[e,r,n,a],c,u)||f),D(t,"B")&&(f=H(null,[r,n,i,l],c,u)||f),D(t,"C")&&(f=H(null,[r,a,o,l],c,u)||f),D(t,"D")&&(f=H(null,[n,a,s,l],c,u)||f),D(t,"E")&&(f=H(null,[r,n,a,l],c,u)||f)),m&&(f=H(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Y(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,f=!1,h=function(){f=V(t,[s,l,c],[-1,-1,-1],i,a)||f,f=V(t,[c,u,s],[-1,-1,-1],i,a)||f},p=o[0],d=o[1],m=o[2];return p&&(s=O(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=O(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=O(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=O(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),h()),d&&(s=O(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=O(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=O(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=O(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),h()),m&&(s=O(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],m),l=O(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],m),c=O(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],m),u=O(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],m),h()),f}function X(t,e,r,n,i,a,o,s,l,c,u,f){var h=t;return f?(d&&"even"===t&&(h=null),q(h,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(h=null),q(h,l,s,o,a,i,n,r,e,c,u))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-A)?[M,d]:[d,A];$(e,T[0],T[1])}}var L=[[Math.min(S,A),Math.max(S,A)],[Math.min(M,E),Math.max(M,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?f.push([p.distRatio,0,0]):"y"===e?f.push([0,p.distRatio,0]):f.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?Z(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(z(d.fill),r[i]="x"===e?Z(null,[0,b-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../components/colorscale":662,"../../lib/gl_format_color":783,"../../lib/str2rgbarray":812,"../../plots/gl3d/zip3":891,"gl-mesh3d":309}],1141:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),h=a("value");c&&c.length&&u&&u.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":660,"../../lib":787,"../../registry":915,"./attributes":1138}],1142:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":880,"./attributes":1138,"./calc":1139,"./convert":1140,"./defaults":1141}],1143:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910,"../surface/attributes":1326}],1144:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":658}],1145:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ov):g=M>w,v=M;var A=c(w,T,k,M);A.pos=_,A.yc=(w+M)/2,A.i=b,A.dir=g?"increasing":"decreasing",A.x=A.pos,A.y=[k,T],y&&(A.orig_p=r[b]),d&&(A.tx=e.text[b]),m&&(A.htx=e.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(h,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},h)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",f.push(y),g[b]=y)}return f}function h(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,h=u(t,e,r,i);if(!h)return[];var p=a[h.index],d=h.index=p.i,m=p.dir;function g(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+c[m]]:[];return _&&s(p,l,w),h.extraText=w.join("
"),h.y0=h.y1=o.c2p(p.yc,!0),[h]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):h(t,e,r,n)},hoverSplit:f,hoverOnPoints:h}},{"../../components/color":650,"../../components/fx":690,"../../constants/delta.js":757,"../../lib":787,"../../plots/cartesian/axes":838}],1152:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":852,"./attributes":1148,"./calc":1149,"./defaults":1150,"./hover":1151,"./plot":1154,"./select":1155,"./style":1156}],1153:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},{"../../lib":787,"../../registry":915}],1154:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":787,"@plotly/d3":58}],1155:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,h);o(e,f,h),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var m={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",m);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(h,"tickfont",g)}},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/domain":866,"../parcoords/merge_length":1173,"./attributes":1157}],1161:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":1157,"./base_plot":1158,"./calc":1159,"./defaults":1160,"./plot":1163}],1162:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),f=t("../../lib/svg_text_utils");function h(t,e,r,i){var a=t.map(F.bind(0,e,r)),o=i.selectAll("g.parcatslayer").data([null]);o.enter().append("g").attr("class","parcatslayer").style("pointer-events","all");var u=o.selectAll("g.trace.parcats").data(a,p),h=u.enter().append("g").attr("class","trace parcats");u.attr("transform",(function(t){return l(t.x,t.y)})),h.append("g").attr("class","paths");var y=u.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),p);y.attr("fill",(function(t){return t.model.color}));var x=y.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(x),y.attr("d",(function(t){return t.svgD})),x.empty()||y.sort(m),y.exit().remove(),y.on("mouseover",g).on("mouseout",v).on("click",b),h.append("g").attr("class","dimensions");var w=u.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),p);w.enter().append("g").attr("class","dimension"),w.attr("transform",(function(t){return l(t.x,0)})),w.exit().remove();var M=w.selectAll("g.category").data((function(t){return t.categories}),p),A=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),A.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(A);var S=M.selectAll("rect.bandrect").data((function(t){return t.bands}),p);S.each((function(){s.raiseToTop(this)})),S.attr("fill",(function(t){return t.color}));var E=S.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);S.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(E),S.exit().remove(),A.append("text").attr("class","catlabel").attr("pointer-events","none");var z=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(z)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),e)})),A.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",C),M.exit().remove(),w.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",P).on("drag",I).on("dragend",O)),u.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),u.exit().remove()}function p(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),L=n.mouse(f)[0];o.loneHover({trace:h,x:b-d.left+m.left,y:_-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:L1&&h.displayInd===f.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,v=m/u.parcatsViewModel.model.count,y={countLabel:m,categoryLabel:g,probabilityLabel:v.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:v}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=M(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=M(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),A(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=E(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,h=f.parcatsViewModel,p=h.model.dimensions[f.model.dimensionInd],d=h.trace,m=l.y+l.height/2;h.dimensions.length>1&&p.displayInd===h.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=f.model.categoryLabel,v=c.parcatsViewModel.model.count,y=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(y+=t.count)}));var x=f.model.count,b=0;h.pathSelection.each((function(t){t.model.color===c.color&&(b+=t.model.count)}));var _=y/v,w=y/b,T=y/x,k={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},M=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",k.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(M.push("P(color \u2229 "+g+"): "+k.probabilityLabel),M.push("P("+g+" | color): "+w.toFixed(3)),M.push("P(color | "+g+"): "+T.toFixed(3)));var A=M.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:A,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:v,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(E(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function C(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):A(this,"plotly_unhover",n.event)}}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var h=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==h&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),D(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=z(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),f=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):A(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),D(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function z(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var h=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],f=t.model.maxCats,h=e.categories.length,p=e.count,d=t.height-8*(f-1),m=8*(f-h)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}},{"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/svg_text_utils":813,"../../plot_api/plot_api":824,"@plotly/d3":58,"d3-interpolate":168,tinycolor2:583}],1163:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":1162}],1164:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/layout_attributes":853,"../../plots/domain":866,"../../plots/font_attributes":867}],1165:[function(t,e,r){"use strict";var n=t("./constants"),i=t("@plotly/d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,c=n.bar.snapRatio;function u(t,e){return t*(1-c)+e*c}var f=n.bar.snapClose;function h(t,e){return t*(1-f)+e*f}function p(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){h=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var g=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),b(t.parentNode)}function T(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&A(r)):A(r),a.brushCallback(e),b(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||A(r),a.brushCallback(e),c?b(t.parentNode,s):(s(),b(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function M(t,e){return t[0]-e[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(M)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e){var r=t.selectAll("."+n.cn.axisBrush).data(o,a);r.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e){var r=t.selectAll(".background").data(o);r.enter().append("rect").classed("background",!0).call(d).call(m).style("pointer-events","auto").attr("transform",l(0,n.verticalPadding)),r.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var i=t.selectAll(".highlight-shadow").data(o);i.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),i.attr("y1",(function(t){return t.height})).call(x);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(x)}(r,e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(M)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[p(0,r,t[0],[]),p(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":787,"../../lib/gup":784,"./constants":1168,"@plotly/d3":58}],1166:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];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").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":764,"../../plots/get_data":875,"./plot":1175,"@plotly/d3":58}],1167:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var m=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(m)&&m.length||(e.visible=!1),h(e,m,"values",g);var v={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",v),n.coerceFont(u,"tickfont",v),n.coerceFont(u,"rangefont",v),u("labelangle"),u("labelside")}},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787,"../../plots/array_container_defaults":833,"../../plots/cartesian/axes":838,"../../plots/domain":866,"./attributes":1164,"./axisbrush":1165,"./constants":1168,"./merge_length":1173}],1170:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":787}],1171:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":1164,"./base_plot":1166,"./calc":1167,"./defaults":1169,"./plot":1175}],1172:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(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 h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(T,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var L,C=o.tickvals;function P(t,e){return{val:t,text:L[e]}}function I(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){L=o.ticktext,Array.isArray(L)&&L.length?L.length>C.length?L=L.slice(0,C.length):C.length>L.length&&(C=C.slice(0,L.length)):L=C.map(a(o.tickformat));for(var O=1;O=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==B&&(u?a.hover(h):a.unhover&&a.unhover(h),B=f)}})),F.style("opacity",(function(t){return t.pick?0:1})),h.style("background","rgba(255, 255, 255, 0)");var N=h.selectAll("."+y.cn.parcoords).data(R,d);N.exit().remove(),N.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),N.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var j=N.selectAll("."+y.cn.parcoordsControlView).data(m,d);j.enter().append("g").classed(y.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var U=j.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),d);U.enter().append("g").classed(y.cn.yAxis,!0),j.each((function(t){O(U,t,_)})),F.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),U.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),U.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;S.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,U.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})),O(U,e,_),U.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),U.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(U,e,_),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),U.exit().remove();var V=U.selectAll("."+y.cn.axisOverlays).data(m,d);V.enter().append("g").classed(y.cn.axisOverlays,!0),V.selectAll("."+y.cn.axis).remove();var H=V.selectAll("."+y.cn.axis).data(m,d);H.enter().append("g").classed(y.cn.axis,!0),H.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return v.isOrdinal(t)?e:z(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(H.selectAll("text"),t.model.tickFont)})),H.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),H.selectAll("text").style("text-shadow",u.makeTextShadow(T)).style("cursor","default");var q=V.selectAll("."+y.cn.axisHeading).data(m,d);q.enter().append("g").classed(y.cn.axisHeading,!0);var G=q.selectAll("."+y.cn.axisTitle).data(m,d);G.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),G.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=I(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=I(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var Y=V.selectAll("."+y.cn.axisExtent).data(m,d);Y.enter().append("g").classed(y.cn.axisExtent,!0);var W=Y.selectAll("."+y.cn.axisExtentTop).data(m,d);W.enter().append("g").classed(y.cn.axisExtentTop,!0),W.attr("transform",c(0,-y.axisExtentOffset));var X=W.selectAll("."+y.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(P),X.text((function(t){return D(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var Z=Y.selectAll("."+y.cn.axisExtentBottom).data(m,d);Z.enter().append("g").classed(y.cn.axisExtentBottom,!0),Z.attr("transform",(function(t){return c(0,t.model.height+y.axisExtentOffset)}));var J=Z.selectAll("."+y.cn.axisExtentBottomText).data(m,d);J.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(P),J.text((function(t){return D(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),x.ensureAxisBrush(V,T)}},{"../../components/colorscale":662,"../../components/drawing":672,"../../lib":787,"../../lib/gup":784,"../../lib/svg_text_utils":813,"../../plots/cartesian/axes":838,"./axisbrush":1165,"./constants":1168,"./helpers":1170,"./lines":1172,"@plotly/d3":58,"color-rgba":133}],1175:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}e.exports=function(t,e){var r=t._fullLayout;if(i(t)){var s={},l={},c={},u={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;c[r]=n.index;var i=u[r]=n._fullInput.index;s[r]=t.data[i].dimensions,l[r]=t.data[i].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,i){var a=l[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[c[e]]._fullInput.uid];if(void 0===f[s]){var h=a.constraintrange;f[s]=h||null}var p=t._fullData[c[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[u[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(a));s[e].sort(n),l[e].filter((function(t){return!a(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[u[e]]])}})}}},{"../../lib/prepare_regl":800,"./helpers":1170,"./parcoords":1174}],1176:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":649,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1177:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":901}],1178:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(c("labels"),c("values")),f=u.len;if(e._hasLabels=u.hasLabels,e._hasValues=u.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),f){e._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var h,p=c("text"),d=c("texttemplate");if(d||(h=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||h&&"none"!==h){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var g=c("hole");if(c("title.text")){var v=c("title.position",g?"middle center":"top center");g||"middle center"!==v||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":787,"../../plots/domain":866,"../bar/defaults":929,"./attributes":1176,"fast-isnumeric":246}],1180:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),"funnelarea"===e.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":686}],1181:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:f.hovertemplate||-1!==h.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[v(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[v(t,f)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[v(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[v(t,i)],a.click(e,n.event))}))}function b(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)v(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)v(Math.PI*(g+1),"tan")}if(f||p){for(g=4;g>=-4;g-=2)v(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)v(Math.PI*(g+.5),"rad")}}if(s||d||f){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||h)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:M(a,o/e),rotate:A(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:M(a,o/e),rotate:A(i+Math.PI/2)}}function M(t,e){return Math.cos(e)-t*e}function A(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function L(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 C(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function I(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function O(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._fullLayout,a=r._size;d("pie",r),_(e,t),O(e,a);var h=l.makeTraceGroups(r._pielayer,e,"trace").each((function(e){var h=n.select(this),d=e[0],m=d.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),h.attr("stroke-linejoin","round"),h.each((function(){var v=n.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var y=[[[],[]],[[],[]]],_=!1;v.each((function(i,a){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=m.index,y[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var o=d.cx,c=d.cy,u=n.select(this),h=u.selectAll("path.surface").data([i]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,t,e),m.pull){var v=+g.castOption(m.pull,i.pts)||0;v>0&&(o+=v*i.pxmid[0],c+=v*i.pxmid[1])}i.cxFinal=o,i.cyFinal=c;var T=m.hole;if(i.v===d.vTotal){var k="M"+(o+i.px0[0])+","+(c+i.px0[1])+C(i.px0,i.pxmid,!0,1)+C(i.pxmid,i.px0,!0,1)+"Z";T?h.attr("d","M"+(o+T*i.px0[0])+","+(c+T*i.px0[1])+C(i.px0,i.pxmid,!1,T)+C(i.pxmid,i.px0,!1,T)+"Z"+k):h.attr("d",k)}else{var M=C(i.px0,i.px1,!0,1);if(T){var A=1-T;h.attr("d","M"+(o+T*i.px1[0])+","+(c+T*i.px1[1])+C(i.px1,i.px0,!1,T)+"l"+A*i.px0[0]+","+A*i.px0[1]+M+"Z")}else h.attr("d","M"+o+","+c+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}D(t,i,d);var S=g.castOption(m.textposition,i.pts),E=u.selectAll("g.slicetext").data(i.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each((function(){var u=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=l.ensureUniformFontSize(t,"outside"===S?function(t,e,r){var n=g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,i=g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(m,i,r.font):b(m,i,r.font));u.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,h).call(f.convertToTspans,t);var v,y=s.bBox(u.node());if("outside"===S)v=L(y,i);else if(v=w(y,i,d),"auto"===S&&v.scale<1){var x=l.ensureUniformFontSize(t,m.outsidetextfont);u.call(s.font,x),v=L(y=s.bBox(u.node()),i)}var T=v.textPosAngle,k=void 0===T?i.pxmid:z(d.r,T);if(v.targetX=o+k[0]*v.rCenter+(v.x||0),v.targetY=c+k[1]*v.rCenter+(v.y||0),R(v,y),v.outside){var M=v.targetY;i.yLabelMin=M-y.height/2,i.yLabelMid=M,i.yLabelMax=M+y.height/2,i.labelExtraX=0,i.labelExtraY=0,_=!0}v.fontSize=h.size,p(m.type,v,r),e[a].transform=v,u.attr("transform",l.getTextTransform(v))}))}function C(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*d.r+","+n*d.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=n.select(this).selectAll("g.titletext").data(m.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=m.title.text;m._meta&&(i=l.templateString(i,m._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,m.title.font).call(f.convertToTspans,t),e="middle center"===m.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(d):C(d,a),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),_&&function(t,e){var r,n,i,a,o,s,l,c,u,f,h,p,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,u,h,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-d;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(g.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(m+t.labelExtraY-v)*l>0&&(i=3*s*Math.abs(c-f.indexOf(t)),(h=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=h)))}for(n=0;n<2;n++)for(i=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],f=u.concat(c),p=[],h=0;hMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(v,m),_&&m.automargin){var k=s.bBox(h.node()),M=m.domain,A=a.w*(M.x[1]-M.x[0]),S=a.h*(M.y[1]-M.y[0]),E=(.5*A-d.r)/a.w,P=(.5*S-d.r)/a.h;i.autoMargin(t,"pie."+m.uid+".automargin",{xl:M.x[0]-E,xr:M.x[1]+E,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(d.cx-d.r-k.left,0),r:Math.max(k.right-(d.cx+d.r),0),b:Math.max(k.bottom-(d.cy+d.r),0),t:Math.max(d.cy-d.r-k.top,0),pad:5})}}))}));setTimeout((function(){h.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:O,attachFxHandlers:x,computeTransform:R}},{"../../components/color":650,"../../components/drawing":672,"../../components/fx":690,"../../lib":787,"../../lib/svg_text_utils":813,"../../plots/plots":901,"../bar/constants":927,"../bar/uniform_text":941,"./event_data":1180,"./helpers":1181,"@plotly/d3":58}],1186:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(t,e,"pie"),e.each((function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each((function(t){n.select(this).call(i,t,e)}))}))}},{"../bar/uniform_text":941,"./style_one":1187,"@plotly/d3":58}],1187:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":650,"./helpers":1181}],1188:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":1202}],1189:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(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=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.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}},l.update=function(t){this.index=t.index,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=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(f){if(n=f,e=f.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(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=i(t.marker.color),g=i(t.marker.border.color),v=t.opacity*t.marker.opacity;m[3]*=v,this.pointcloudOptions.color=m;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,g[3]*=v,this.pointcloudOptions.borderColor=g;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":812,"../../plots/cartesian/autorange":837,"../scatter/get_trace_color":1212,"gl-pointcloud2d":321}],1190:[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"),e._length=null}},{"../../lib":787,"./attributes":1188}],1191:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":878,"../scatter3d/calc":1231,"./attributes":1188,"./convert":1189,"./defaults":1190}],1192:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,f=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,h=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll;(e.exports=p({hoverinfo:h({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":649,"../../components/colorscale/attributes":657,"../../components/fx/attributes":681,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plot_api/plot_template":827,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/domain":866,"../../plots/font_attributes":867,"../../plots/template_attributes":910}],1193:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../plots/cartesian/select").prepSelect,u=t("../../lib"),f=t("../../registry");function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if("pan"!==i&&"zoom"!==i){s(o,a);var h={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:h,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[h],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;ry&&(y=a.source[e]),a.target[e]>y&&(y=a.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(L,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(L)||w[E]!==w[L])){w.hasOwnProperty(L)&&(L=w[L]),w.hasOwnProperty(E)&&(E=w[E]),L=+L,h[E=+E]=h[L]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var P=null;C&&p.hasOwnProperty(C)&&(P=p[C]),c.push({pointNumber:e,label:C,color:u?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:P,source:E,target:L,value:+S}),A.source.push(E),A.target.push(L)}}var I=b+_.length,O=o(r.color),z=o(r.customdata),D=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:O?r.color[e]:r.color,customdata:z?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(I,A.source,A.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":662,"../../lib":787,"../../lib/gup":784,"strongly-connected-components":575}],1195:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],1196:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,h){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(h.hoverlabel,t.hoverlabel),m=t.node,g=c.newContainer(e,"node");function v(t,e){return n.coerce(m,g,i.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(m,g,v,d),v("hovertemplate");var y=h.colorway;v("color",g.label.map((function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,h,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},h.font)),e._length=null}},{"../../components/color":650,"../../components/fx/hoverlabel_defaults":688,"../../lib":787,"../../plot_api/plot_template":827,"../../plots/array_container_defaults":833,"../../plots/domain":866,"./attributes":1192,tinycolor2:583}],1197:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":1192,"./base_plot":1193,"./calc":1194,"./defaults":1196,"./plot":1198,"./select.js":1200}],1198:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function f(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function p(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function v(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(b.bind(0,e,r,!1))}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+c.sankeyNode).filter(g(t)).call(v)}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(c.sankeyNode).filter(g(t)).call(y)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,h=r._size,m=0;m"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(y,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"./constants":1195,"./render":1199,"@plotly/d3":58}],1199:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),f=t("../../components/drawing"),h=t("../../lib"),p=h.strTranslate,d=h.strRotate,m=t("../../lib/gup"),g=m.keyFun,v=m.repeat,y=m.unwrap,x=t("../../lib/svg_text_utils"),b=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,T=_.LINE_SPACING;function k(t,e,r){var n,i=y(e),a=i.trace,u=a.domain,f="h"===a.orientation,p=a.node.pad,d=a.node.thickness,m=t.width*(u.x[1]-u.x[0]),g=t.height*(u.y[1]-u.y[0]),v=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[m,g]:[g,m]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(v).links(x);var _,w,T,k=n();for(var M in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=k.nodes));n.update(k)}return{circular:b,key:r,trace:a,guid:h.randstr(),horizontal:f,width:m,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?g:m,dragPerpendicular:f?m:g,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:A,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function A(){return function(t){if(t.link.circular)return e=t.link,r=e.width/2,n=e.circularPathData,"top"===e.circularLinkType?"M "+n.targetX+" "+(n.targetY+r)+" L"+n.rightInnerExtent+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.targetY-r)+"L"+n.targetX+" "+(n.targetY-r)+"Z":"M "+n.targetX+" "+(n.targetY-r)+" L"+n.rightInnerExtent+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+n.rightInnerExtent+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+n.rightInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+n.rightInnerExtent+" "+(n.targetY+r)+"L"+n.targetX+" "+(n.targetY+r)+"Z";var e,r,n,a=t.link.source.x1,o=t.link.target.x0,s=i(a,o),l=s(.5),c=s(.5),u=t.link.y0-t.link.width/2,f=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2;return"M"+a+","+u+"C"+l+","+u+" "+c+","+h+" "+o+","+h+"L"+o+","+p+"C"+c+","+p+" "+l+","+f+" "+a+","+f+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",(function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function L(t){t.call(E)}function C(t,e){t.call(L),e.attr("d",A())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function I(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function z(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&C[v].gap;)v--;for(x=C[v].s,m=C.length-1;m>v;m--)C[m].s=x;for(;lA[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1209:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),p=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,a,r,i)}var y=l(t,e,g,v);if(y||(e.visible=!1),e.visible){c(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=u(t,e,g,v),b=!x&&y=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return aW!=(N=z[I][1])>=W&&(R=z[I-1][0],F=z[I][0],N-B&&(D=R+(F-R)*(W-B)/(N-B),H=Math.min(H,D),q=Math.max(q,D)));H=Math.max(H,0),q=Math.min(q,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":650,"../../components/fx":690,"../../lib":787,"../../registry":915,"./get_trace_color":1212}],1214:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":852,"./arrays_to_calcdata":1201,"./attributes":1202,"./calc":1203,"./cross_trace_calc":1207,"./cross_trace_defaults":1208,"./defaults":1209,"./format_labels":1211,"./hover":1213,"./marker_colorbar":1220,"./plot":1223,"./select":1224,"./style":1226,"./subtypes":1227}],1215:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"../../lib":787}],1216:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),c=l.segmentsIntersect,u=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,p,d,m,g,v,y,x,b,_,w,T,k,M,A,S=e.xaxis,E=e.yaxis,L="log"===S.type,C="log"===E.type,P=S._length,I=E._length,O=e.connectGaps,z=e.baseTolerance,D=e.shape,R="linear"===D,F=e.fill&&"none"!==e.fill,B=[],N=f.minTolerance,j=t.length,U=new Array(j),V=0;function H(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?E.l2p(n.y):E.c2p(n.y);if(a===i){if(L&&(a=S.c2p(n.x,!0)),a===i)return!1;C&&l===i&&(a*=Math.abs(S._m*I*(S._m>0?o:s)/(E._m*P*(E._m>0?o:s)))),a*=1e3}if(l===i){if(C&&(l=E.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function q(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&crt||t[1]it)return[u(t[0],et,rt),u(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c);return s}}function ct(t){var e=t[0],r=t[1],n=e===U[V-1][0],i=r===U[V-1][1];if(!n||!i)if(V>1){var a=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&a?o?V--:U[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ut(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ct([Z,J]),ct(t),K=null,Z=J=0}function ft(t){if(M=t[0]/P,A=t[1]/I,W=t[0]rt?rt:0,X=t[1]it?it:0,W||X){if(V)if(K){var e=$(K,t);e.length>1&&(ut(e[0]),U[V++]=e[1])}else Q=$(U[V-1],t)[0],U[V++]=Q;else U[V++]=[W||t[0],X||t[1]];var r=U[V-1];W&&X&&(r[0]!==W||r[1]!==X)?(K&&(Z!==W&&J!==X?ct(Z&&J?(n=K,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Z||W,J||X]):Z&&J&&ct([Z,J])),ct([W,X])):Z-W&&J-X&&ct([W||Z,X||J]),K=t,Z=W,J=X}else K&&ut($(K,t)[0]),U[V++]=t;var n,i,a,o}for("linear"===D||"spline"===D?$=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,t)G(d,ht))break;a=d,(_=v[0]*g[0]+v[1]*g[1])>x?(x=_,h=d,m=!1):_=t.length||!d)break;ft(d),n=d}}else ft(h)}K&&ct([Z||K[0],J||K[1]]),B.push(U.slice(0,V))}return B}},{"../../constants/numerical":763,"../../lib":787,"./constants":1206}],1217:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1218:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,c={},u=!1,f=-1,h=0,p=-1;for(a=0;a=0?l=p:(l=p=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":246}],1220:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1221:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":650,"../../components/colorscale/defaults":660,"../../components/colorscale/helpers":661,"./subtypes":1227}],1222:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":763,"../../lib":787}],1223:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function p(t,e,r,f,p,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var p=h.marker.maxdisplayed;if(0===p)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===_.visible){var E,L;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,O="",z=[],D=_._prevtrace;D&&(O=D._prevRevpath||"",L=D._nextFill,z=D._polygons);var R,F,B,N,j,U,V,H="",q="",G=[],Y=a.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(L&&L.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",P),l.singleLineStyle(f,i)}}}}}var W=M.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(E?(E.datum(f),N&&U&&(C?("y"===C?N[1]=U[1]=b.c2p(0,!0):"x"===C&&(N[0]=U[0]=x.c2p(0,!0)),y(E).attr("d","M"+U+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle)):y(E).attr("d",H+"Z").call(l.singleFillStyle))):L&&("tonext"===_.fill.substr(0,6)&&H&&O?("tonext"===_.fill?y(L).attr("d",H+"Z"+O+"Z").call(l.singleFillStyle):y(L).attr("d",H+"L"+O.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(z)):(Z(L),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(E?Z(E):L&&Z(L),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),p=tt(u),d=et,m=et;if(f||h){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(d=g),h&&(m=g)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=x.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(A,X,t),l.setClipUrl(S,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,d=!a,m=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){p(t,n,e,r,g,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":672,"../../lib":787,"../../lib/polygon":799,"../../registry":915,"./line_points":1216,"./link_traces":1218,"./subtypes":1227,"@plotly/d3":58}],1224:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||p);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,h||p||r,{axis:"z"}),v(t,e,h||p||r,{axis:"y",inherit:"z"}),v(t,e,h||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":787,"../../registry":915,"../scatter/line_defaults":1215,"../scatter/marker_defaults":1221,"../scatter/subtypes":1227,"../scatter/text_defaults":1228,"./attributes":1230}],1235:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":761,"../../plots/gl3d":880,"./attributes":1230,"./calc":1231,"./convert":1233,"./defaults":1234}],1236:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1237:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e._length,p=new Array(h),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":787,"../scatter/hover":1213}],1242:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":852,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1236,"./calc":1237,"./defaults":1238,"./event_data":1239,"./format_labels":1240,"./hover":1241,"./plot":1243}],1243:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,f={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,f,r,o),s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../scatter/get_trace_color":1212,"./attributes":1244}],1250:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":871,"../scatter/marker_colorbar":1220,"../scatter/style":1226,"./attributes":1244,"./calc":1245,"./defaults":1246,"./event_data":1247,"./format_labels":1248,"./hover":1249,"./plot":1251,"./select":1252,"./style":1253}],1251:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,f=t("../scatter/subtypes"),h=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],f=o._subplot,h=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):a(i,f.topojson);for(r=0;r=g,w=2*b,T={},k=l.makeCalcdata(e,"x"),M=y.makeCalcdata(e,"y"),A=s(e,l,"x",k),S=s(e,y,"y",M),E=A.vals,L=S.vals;e._x=E,e._y=L,e.xperiodalignment&&(e._origX=k,e._xStarts=A.starts,e._xEnds=A.ends),e.yperiodalignment&&(e._origY=M,e._yStarts=S.starts,e._yEnds=S.ends);var C=new Array(w),P=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(t,r,n));if(s.errorX||s.errorY){var l=p.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,C,E,L),z=d(t,x);return f(o,e),_?O.marker&&(I=O.marker.sizeAvg||Math.max(O.marker.size,3)):I=c(e,b),u(t,e,l,y,E,L,I),O.errorX&&v(e,l,O.errorX),O.errorY&&v(e,y,O.errorY),O.fill&&!z.fill2d&&(z.fill2d=!0),O.marker&&!z.scatter2d&&(z.scatter2d=!0),O.line&&!z.line2d&&(z.line2d=!0),!O.errorX&&!O.errorY||z.error2d||(z.error2d=!0),O.text&&!z.glText&&(z.glText=!0),O.marker&&(O.marker.snap=b),z.lineOptions.push(O.line),z.errorXOptions.push(O.errorX),z.errorYOptions.push(O.errorY),z.fillOptions.push(O.fill),z.markerOptions.push(O.marker),z.markerSelectedOptions.push(O.markerSel),z.markerUnselectedOptions.push(O.markerUnsel),z.textOptions.push(O.text),z.textSelectedOptions.push(O.textSel),z.textUnselectedOptions.push(O.textUnsel),z.selectBatch.push([]),z.unselectBatch.push([]),T._scene=z,T.index=z.count,T.x=E,T.y=L,T.positions=C,z.count++,[{x:!1,y:!1,t:T,trace:e}]}},{"../../constants/numerical":763,"../../lib":787,"../../plots/cartesian/align_period":835,"../../plots/cartesian/autorange":837,"../../plots/cartesian/axis_ids":842,"../scatter/calc":1203,"../scatter/colorscale_calc":1205,"./constants":1256,"./convert":1257,"./scene_update":1265,"@plotly/point-cluster":59}],1256:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1257:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),p=t("./helpers"),d=t("./constants"),m=t("../../constants/interactions").DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,h=o.family,p={},d=t._context.plotGlPixelRatio,m=e.texttemplate;if(m){p.text=[];var g=i._d3locale,y=Array.isArray(m),x=y?Math.min(m.length,a):a,b=y?function(t){return m[t]}:function(){return m};for(r=0;rd.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,m=g[p],v=g[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[i]=[m*y/h,x/h]}}return o}}},{"../../components/drawing":672,"../../components/fx/helpers":686,"../../constants/interactions":762,"../../lib":787,"../../lib/gl_format_color":783,"../../plots/cartesian/axis_ids":842,"../../registry":915,"../scatter/make_bubble_size_func":1219,"../scatter/subtypes":1227,"./constants":1256,"./helpers":1261,"color-normalize":131,"fast-isnumeric":246,"svg-path-sdf":580}],1258:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),p=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,m){function g(r,i){return n.coerce(t,e,o,r,i)}var v=!!t.marker&&a.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),x=c(t,e,m,g);if(x){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var b=x100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":1256}],1262:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var p=o.textfont;p&&(h.ts=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.tc=Array.isArray(p.color)?p.color[f]:p.color,h.tf=Array.isArray(p.family)?p.family[f]:p.family);var d=o.marker;d&&(h.ms=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.mo=i.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,h.mx=i.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,h.mc=i.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var m=d&&d.line;m&&(h.mlc=Array.isArray(m.color)?m.color[f]:m.color,h.mlw=i.isArrayOrTypedArray(m.width)?m.width[f]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(h.mgt=Array.isArray(g.type)?g.type[f]:g.type,h.mgc=Array.isArray(g.color)?g.color[f]:g.color);var v=s.c2p(h.x,!0),y=l.c2p(h.y,!0),x=h.mrc||1,b=o.hoverlabel;b&&(h.hbg=Array.isArray(b.bgcolor)?b.bgcolor[f]:b.bgcolor,h.hbc=Array.isArray(b.bordercolor)?b.bordercolor[f]:b.bordercolor,h.hts=i.isArrayOrTypedArray(b.font.size)?b.font.size[f]:b.font.size,h.htc=Array.isArray(b.font.color)?b.font.color[f]:b.font.color,h.htf=Array.isArray(b.font.family)?b.font.family[f]:b.font.family,h.hnl=i.isArrayOrTypedArray(b.namelength)?b.namelength[f]:b.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var T={};T[t.index]=h;var k=o._origX,M=o._origY,A=i.extendFlat({},t,{color:a(o,h),x0:v-x,x1:v+x,xLabelVal:k?k[f]:h.x,y0:y-x,y1:y+x,yLabelVal:M?M[f]:h.y,cd:T,distance:c,spikeDistance:u,hovertemplate:h.ht});return h.htx?A.text=h.htx:h.tx?A.text=h.tx:o.text&&(A.text=o.text),i.fillText(h,o,A),n.getComponentMethod("errorbars","hoverInfo")(h,o,A),A}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,h,p,d,m=t.cd,g=m[0].t,v=m[0].trace,y=t.xa,x=t.ya,b=g.x,_=g.y,w=y.c2p(e),T=x.c2p(r),k=t.distance;if(g.tree){var M=y.p2c(w-k),A=y.p2c(w+k),S=x.p2c(T-k),E=x.p2c(T+k);i="x"===n?g.tree.range(Math.min(M,A),Math.min(x._rl[0],x._rl[1]),Math.max(M,A),Math.max(x._rl[0],x._rl[1])):g.tree.range(Math.min(M,A),Math.min(S,E),Math.max(M,A),Math.max(S,E))}else i=g.ids;var L=k;if("x"===n){var C=!!v.xperiodalignment,P=!!v.yperiodalignment;for(u=0;u=Math.min(I,O)&&w<=Math.max(I,O)?0:1/0}if(f=Math.min(z,D)&&T<=Math.max(z,D)?0:1/0}d=Math.sqrt(f*f+h*h),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[a=i[u]],c=_[a],f=y.c2p(l)-w,h=x.c2p(c)-T,(p=Math.sqrt(f*f+h*h))v.glText.length){var w=b-v.glText.length;for(d=0;dr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var k=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(k)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var f,h,p=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[h+1]);)h-=2;0!==d[f+1]&&(p=[d[f],0]),p=p.concat(d.slice(f,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[h]);)h-=2;0!==d[f]&&(p=[0,d[f+1]]),p=p.concat(d.slice(f,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,t.splitNull=!0,a=0;a-1;for(d=0;d")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,u=t.xa,f=t.ya,h=t.subplot,p=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-p;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-u.c2p([d,a]),c=o.y-f.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-p,1-3/p)}),t),!1!==t.index){var m=o[t.index],g=m.lonlat,v=[i.modHalf(g[0],360)+p,g[1]],y=u.c2p(v),x=f.c2p(v),b=m.mrc||1;t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b;var _={};_[c.subplot]={_subplot:h};var w=c._module.formatLabels(m,c,_);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(c,m),t.extraText=l(c,m,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:l}},{"../../components/fx":690,"../../constants/numerical":763,"../../lib":787,"../scatter/get_trace_color":1212}],1273:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":895,"../scatter/marker_colorbar":1220,"../scattergeo/calc":1245,"./attributes":1267,"./defaults":1269,"./event_data":1270,"./format_labels":1271,"./hover":1272,"./plot":1274,"./select":1275}],1274:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),c=o.belowLookup["trace-"+this.uid];if(c!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],c=0;c")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":1213}],1281:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":904,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1276,"./calc":1277,"./defaults":1278,"./format_labels":1279,"./hover":1280,"./plot":1282}],1282:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},s=e.radialAxis,l=e.angularAxis,c=0;c=c&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(t,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!h.fill2d&&(h.fill2d=!0),y.marker&&!h.scatter2d&&(h.scatter2d=!0),y.line&&!h.line2d&&(h.line2d=!0),y.text&&!h.glText&&(h.glText=!0),h.lineOptions.push(y.line),h.fillOptions.push(y.fill),h.markerOptions.push(y.marker),h.markerSelectedOptions.push(y.markerSel),h.markerUnselectedOptions.push(y.markerUnsel),h.textOptions.push(y.text),h.textSelectedOptions.push(y.textSel),h.textUnselectedOptions.push(y.textUnsel),h.selectBatch.push([]),h.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=v,d.positions=_,d._scene=h,d.index=h.count,h.count++}})),a(t,e,r)}}},{"../../lib":787,"../scattergl/constants":1256,"../scattergl/convert":1257,"../scattergl/plot":1264,"../scattergl/scene_update":1265,"@plotly/point-cluster":59,"fast-isnumeric":246}],1290:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,c=t("../../lib/extend").extendFlat,u=a.marker,f=a.line,h=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:f.color,width:f.width,dash:l,shape:c({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a.fillcolor,marker:c({symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:h.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:n()}},{"../../components/colorscale/attributes":657,"../../components/drawing/attributes":671,"../../lib/extend":777,"../../plots/attributes":834,"../../plots/template_attributes":910,"../scatter/attributes":1202}],1291:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,p,d,m=t._fullLayout[e.subplot].sum,g=e.sum||m,v={a:e.a,b:e.b,c:e.c};for(r=0;r"),o.hovertemplate=h.hovertemplate,a}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":1213}],1296:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../scatter/select"),eventData:t("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:t("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":911,"../scatter/marker_colorbar":1220,"../scatter/select":1224,"../scatter/style":1226,"./attributes":1290,"./calc":1291,"./defaults":1292,"./event_data":1293,"./format_labels":1294,"./hover":1295,"./plot":1297}],1297:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,a,r,o)}},{"../scatter/plot":1223}],1298:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../scattergl/attributes"),l=t("../../plots/cartesian/constants").idRegex,c=t("../../plot_api/plot_template").templatedArray,u=t("../../lib/extend").extendFlat,f=n.marker,h=f.line,p=u(i("marker.line",{editTypeOverride:"calc"}),{width:u({},h.width,{editType:"calc"}),editType:"calc"}),d=u(i("marker"),{symbol:f.symbol,size:u({},f.size,{editType:"markerSize"}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:f.opacity,colorbar:f.colorbar,line:p,editType:"calc"});function m(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:l[t],editType:"plot"}}}d.color.editType=d.cmin.editType=d.cmax.editType="style",e.exports={dimensions:c("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},s.text,{}),hovertext:u({},s.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),marker:d,xaxes:m("x"),yaxes:m("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:s.selected.marker,editType:"calc"},unselected:{marker:s.unselected.marker,editType:"calc"},opacity:s.opacity}},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/plot_template":827,"../../plots/cartesian/axis_format_attributes":841,"../../plots/cartesian/constants":845,"../../plots/template_attributes":910,"../scatter/attributes":1202,"../scattergl/attributes":1254}],1299:[function(t,e,r){"use strict";var n=t("regl-line2d"),i=t("../../registry"),a=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,c=t("../../plots/cartesian/axes").shouldShowZeroLine;function u(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;oh?b.sizeAvg||Math.max(b.size,3):a(e,x),p=0;pa&&l||i-1,P=!0;if(o(x)||!!p.selectedpoints||C){var I=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var O=p.selectedpoints,z={};for(l=0;l1&&(u=m[y-1],h=g[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var L=function(){y=0,A=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(f.meshgrid=[m,g,v],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=g[0],x=h(m),b=h(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(g.length,x.length),l=function(t){return M(g[t])&&A(t)},f=function(t){return String(g[t])}):(r=Math.min(y.length,x.length),l=function(t){return M(y[t])&&A(t)},f=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=a.randstr(),I=0;I"),name:M||z("name")?y.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:M,hovertemplateLabels:P,eventData:l};g&&(F.x0=E-i.rInscribed*i.rpx1,F.x1=E+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),v&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(v){var N=t.select("path.surface");h.styleOne(N,i,y,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,y,h.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,h.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");h.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),v=c.getPtId(p),y={points:[f(t,a,h.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[f(t,a,h.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,b,_)}}))}},{"../../components/fx":690,"../../components/fx/helpers":686,"../../lib":787,"../../lib/events":776,"../../registry":915,"../pie/helpers":1181,"./helpers":1320,"@plotly/d3":58}],1320:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":650,"../../lib":787,"../../lib/setcursor":808,"../pie/helpers":1181}],1321:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":1220,"./attributes":1314,"./base_plot":1315,"./calc":1316,"./defaults":1318,"./layout_attributes":1322,"./layout_defaults":1323,"./plot":1324,"./style":1325}],1322:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1323:[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("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":787,"./layout_attributes":1322}],1324:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,h=t("../pie/plot"),p=t("../pie/helpers").getRotationAngle,d=h.computeTransform,m=h.transformInsideText,g=t("./style").styleOne,v=t("../bar/style").resizeText,y=t("./fx"),x=t("./constants"),b=t("./helpers");function _(t,e,c,f){var h=t._fullLayout,v=!h.uniformtext.mode&&b.hasTransition(f),_=n.select(c).selectAll("g.slice"),T=e[0],k=T.trace,M=T.hierarchy,A=b.findEntryWithLevel(M,k.level),S=b.getMaxDepth(k),E=h._size,L=k.domain,C=E.w*(L.x[1]-L.x[0]),P=E.h*(L.y[1]-L.y[0]),I=.5*Math.min(C,P),O=T.cx=E.l+E.w*(L.x[1]+L.x[0])/2,z=T.cy=E.t+E.h*(1-L.y[0])-P/2;if(!A)return _.remove();var D=null,R={};v&&_.each((function(t){R[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!D&&b.isEntry(t)&&(D=t)}));var F=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(A).descendants(),B=A.height+1,N=0,j=S;T.hasMultipleRoots&&b.isHierarchyRoot(A)&&(F=F.slice(1),B-=1,N=1,j+=1),F=F.filter((function(t){return t.y1<=j}));var U=p(k.rotation);U&&F.forEach((function(t){t.x0+=U,t.x1+=U}));var V=Math.min(B,S),H=function(t){return(t-N)/V*I},q=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},G=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,O,z)},Y=function(t){return O+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},W=function(t){return z+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(_=_.data(F,b.getPtId)).enter().append("g").classed("slice",!0),v?_.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=b.getPtId(t),n=R[r],i=R[b.getPtId(A)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+U;e=t.rpx1X?2*Math.PI:0)+U;e={x0:i,x1:i}}else e={rpx0:I,rpx1:I},s.extendFlat(e,K(t));else e={rpx0:0,rpx1:0};else e={x0:U,x1:U};return a(e,n)}(t);return function(t){return G(e(t))}})):f.attr("d",G),c.call(y,A,t,e,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(g,i,k);var p=s.ensureSingle(c,"g","slicetext"),_=s.ensureSingle(p,"text","",(function(t){t.attr("data-notex",1)})),w=s.ensureUniformFontSize(t,b.determineTextFont(k,i,h.font));_.text(r.formatSliceLabel(i,A,k,e,h)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,w).call(l.convertToTspans,t);var M=o.bBox(_.node());i.transform=m(M,i,T),i.transform.targetX=Y(i),i.transform.targetY=W(i);var S=function(t,e){var r=t.transform;return d(r,e),r.fontSize=w.size,u(k.type,r,h),s.getTextTransform(r)};v?_.transition().attrTween("transform",(function(t){var e=function(t){var e,r=R[b.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},D)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,K(t));else e.x0=e.x1=U;else e.x0=e.x1=U;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),f=a(e.x1,t.x1),p=a(e.transform.scale,n.scale),d=a(e.transform.rotate,n.rotate),m=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,g=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=f(t),a=function(t){return g(Math.pow(t,m))}(t),s={pxmid:q(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(k.type,n,h),{transform:{targetX:Y(s),targetY:W(s),scale:p(t),rotate:d(t),rCenter:a}}}}(t);return function(t){return S(e(t),M)}})):_.attr("transform",S(i,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&b.hasTransition(r);(f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&v(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,f=c.hierarchy,h=b.isHierarchyRoot(t),p=b.getParent(f,t),d=b.getValue(t);if(!a){var m,g=o.split("+"),v=function(t){return-1!==g.indexOf(t)},y=[];if(v("label")&&u.label&&y.push(u.label),u.hasOwnProperty("v")&&v("value")&&y.push(b.formatValue(u.v,l)),!h){v("current path")&&y.push(b.getPath(t.data));var x=0;v("percent parent")&&x++,v("percent entry")&&x++,v("percent root")&&x++;var _=x>1;if(x){var w,T=function(t){m=b.formatPercent(w,l),_&&(m+=" of "+t),y.push(m)};v("percent parent")&&!h&&(w=d/b.getValue(p),T("parent")),v("percent entry")&&(w=d/b.getValue(e),T("entry")),v("percent root")&&(w=d/b.getValue(f),T("root"))}}return v("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&y.push(m)),y.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var M={};u.label&&(M.label=u.label),u.hasOwnProperty("v")&&(M.value=u.v,M.valueLabel=b.formatValue(u.v,l)),M.currentPath=b.getPath(t.data),h||(M.percentParent=d/b.getValue(p),M.percentParentLabel=b.formatPercent(M.percentParent,l),M.parent=b.getPtLabel(p)),M.percentEntry=d/b.getValue(e),M.percentEntryLabel=b.formatPercent(M.percentEntry,l),M.entry=b.getPtLabel(e),M.percentRoot=d/b.getValue(f),M.percentRootLabel=b.formatPercent(M.percentRoot,l),M.root=b.getPtLabel(f),u.hasOwnProperty("color")&&(M.color=u.color);var A=s.castOption(r,u.i,"text");return(s.isValidTextValue(A)||""===A)&&(M.text=A),M.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,M,i._d3locale,M,r._meta||{})}},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../bar/style":939,"../bar/uniform_text":941,"../pie/helpers":1181,"../pie/plot":1185,"./constants":1317,"./fx":1319,"./helpers":1320,"./style":1325,"@plotly/d3":58,"d3-hierarchy":167,"d3-interpolate":168}],1325:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":650,"../../lib":787,"../bar/uniform_text":941,"@plotly/d3":58}],1326:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},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},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":650,"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plot_api/edit_types":820,"../../plots/attributes":834,"../../plots/cartesian/axis_format_attributes":841,"../../plots/template_attributes":910}],1327:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":658}],1328:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-linear-interpolate").d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),f=t("../../components/colorscale").extractOpts;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=h.prototype;p.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=d[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=v(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1335:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),g=e.domain,v=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),y=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),x=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=h(b,y-_+n.uplift),T=f(h(x,_),[]),k=f(w,T),M={},A=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var L=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:L,height:y,columnOrder:A,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:A[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return C.columns.forEach((function(t){t.calcdata=C,t.x=u(t)})),C}},{"../../lib/extend":777,"./constants":1334,"fast-isnumeric":246}],1336:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":777}],1337:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,h,p=u?"":T(t.calcdata.cells.prefix,e,r)||"",d=u?"":T(t.calcdata.cells.suffix,e,r)||"",m=u?null:T(t.calcdata.cells.format,e,r)||null,g=p+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=w(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?w(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=D(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(C(t,r,e,c,n.prevPages,n,0),C(t,r,e,c,n.prevPages,n,1),x(r,t))}}function L(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(M);return E(t,f,l),s.scrollY===u}}function C(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(z)}}function I(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(h,f);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(z),E(null,t.filter(M),0),x(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function z(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(B(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":657,"../../lib/extend":777,"../../plots/domain":866,"../../plots/template_attributes":910,"../pie/attributes":1176,"../sunburst/attributes":1314,"./constants":1343}],1341:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":901}],1342:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1316}],1343:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1344:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;e.exports=function(t,e,r,c){function h(r,a){return n.coerce(t,e,i,r,a)}var p=h("labels"),d=h("parents");if(p&&p.length&&d&&d.length){var m=h("values");m&&m.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),"squarify"===h("tiling.packing")&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",Array.isArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate");var v=h("pathbar.visible");s(t,e,c,h,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var y=-1!==e.textposition.indexOf("bottom");h("marker.line.width")&&h("marker.line.color",c.paper_bgcolor);var x=h("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?f(t,e,c,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(x||[]).length);var b=2*e.textfont.size;h("marker.pad.t",y?b/4:b),h("marker.pad.l",b/4),h("marker.pad.r",b/4),h("marker.pad.b",y?b:b/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},v&&(h("pathbar.thickness",e.pathbar.textfont.size+2*l),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),o(e,c,h),e._length=null}else e.visible=!1}},{"../../components/color":650,"../../components/colorscale":662,"../../lib":787,"../../plots/domain":866,"../bar/constants":927,"../bar/defaults":929,"./attributes":1340}],1345:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,f,h=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+h+"layer"],g=!r;(a(h,d),(u=m.selectAll("g.trace."+h).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(h,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,p)}))}))):(u.each((function(e){s(t,e,this,r,p)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),h));g&&u.exit().remove()}},{"../bar/style":939,"../bar/uniform_text":941,"../sunburst/helpers":1320,"./plot_one":1354,"@plotly/d3":58}],1346:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx");e.exports=function(t,e,r,h,p){var d=p.barDifY,m=p.width,g=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,M=p.makeUpdateTextInterpolator,A={},S=t._fullLayout,E=e[0],L=E.trace,C=E.hierarchy,P=m/L._entryDepth,I=u.listPath(r.data,"id"),O=s(C.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(O=O.filter((function(t){var e=I.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+g,t.onPathbar=!0,!0)}))).reverse(),(h=h.data(O,u.getPtId)).enter().append("g").classed("pathbar",!0),T(h,!0,A,[m,g],x),h.order();var z=h;w&&(z=z.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),z.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-Math.min(m,g)/2),s._hoverY=y(s.y1-g/2);var h=n.select(this),p=i.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events","all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,A,[m,g]);return function(t){return x(e(t))}})):p.attr("d",x),h.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,L,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(h,"g","slicetext"),T=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=i.ensureUniformFontSize(t,u.determineTextFont(L,s,S.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,E).call(o.convertToTspans,t),s.textBB=a.bBox(T.node()),s.transform=b(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?T.transition().attrTween("transform",(function(t){var e=M(t,!0,A,[m,g]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"./constants":1343,"./partition":1352,"./style":1355,"@plotly/d3":58}],1347:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx"),h=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var m=d.width,g=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,M=d.makeUpdateTextInterpolator,A=d.prevEntry,S=t._fullLayout,E=e[0].trace,L=-1!==E.textposition.indexOf("left"),C=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),I=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,O=s(r,[m,g],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),z=1/0,D=-1/0;O.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),D=Math.max(D,e))})),p=p.data(O,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-z+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var R=null;if(w&&A){var F=u.getPtId(A);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:m,y0:0,y1:g}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){var p=u.isHeader(s,E);s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-E.marker.pad.r),s._hoverY=y(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),T=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events","all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[m,g]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?I?"":u.getPtLabel(s)||"":h(s,r,E,e,S)||"";var A=i.ensureSingle(d,"g","slicetext"),O=i.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),z=i.ensureUniformFontSize(t,u.determineTextFont(E,s,S.font));O.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L||p?"start":"middle").call(a.font,z).call(o.convertToTspans,t),s.textBB=a.bBox(O.node()),s.transform=b(s,{fontSize:z.size,isHeader:p}),s.transform.fontSize=z.size,w?O.transition().attrTween("transform",(function(t){var e=M(t,!1,B(),[m,g]);return function(t){return _(e(t))}})):O.attr("transform",_(s))})),R}},{"../../components/drawing":672,"../../lib":787,"../../lib/svg_text_utils":813,"../sunburst/fx":1319,"../sunburst/helpers":1320,"../sunburst/plot":1324,"./constants":1343,"./partition":1352,"./style":1355,"@plotly/d3":58}],1348:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?C+O:-(I+O):0,D={x0:P,x1:P,y0:z,y1:z+I},R=function(t,e,r){var n=v.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,U=function(t,e){return e?B[h(t)]:N[h(t)]},V=function(t,e,r,n){if(e)return B[h(x)]||D;var i=N[v.level]||r;return function(t){return t.data.depth-b.data.depth=(n-=(y?g:g.r)-s)){var x=(r+n)/2;r=x,n=x}var b;f?i<(b=a-(y?g:g.b))&&b"===tt?(l.x-=a,c.x-=a,u.x-=a,f.x-=a):"/"===tt?(u.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(c),$(u),$(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(f.x,f.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:M,strTransform:ot}):w.remove()}},{"../../lib":787,"../bar/constants":927,"../bar/plot":936,"../bar/uniform_text":941,"../sunburst/helpers":1320,"./constants":1343,"./draw_ancestors":1346,"@plotly/d3":58,"d3-interpolate":168}],1355:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,h=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&h===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,f,"marker.line.color")||i.defaultLine,l=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var g,v=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===m){var y=o.getMaxDepth(r);g=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else g=e.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var x=0;x0){var x,b,_,w,T,k=t.xa,M=t.ya;"h"===p.orientation?(T=e,x="y",_=M,b="x",w=k):(T=r,x="x",_=k,b="y",w=M);var A=h[t.index];if(T>=A.span[0]&&T<=A.span[1]){var S=n.extendFlat({},t),E=w.c2p(T,!0),L=o.getKdeValue(A,p,T),C=o.getPositionOnKdePath(A,p,E),P=_._offset,I=_._length;S[x+"0"]=C[0],S[x+"1"]=C[1],S[b+"0"]=S[b+"1"]=E,S[b+"Label"]=b+": "+i.hoverLabelText(w,T,p[b+"hoverformat"])+", "+h[0].t.labels.kde+" "+L.toFixed(3),S.spikeDistance=y[0].spikeDistance;var O=x+"Spike";S[O]=y[0][O],y[0].spikeDistance=void 0,y[0][O]=void 0,S.hovertemplate=!1,v.push(S),(u={stroke:t.color})[x+"1"]=n.constrain(P+C[0],P,P+I),u[x+"2"]=n.constrain(P+C[1],P,P+I),u[b+"1"]=u[b+"2"]=w._offset+E}}m&&(v=v.concat(y))}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var z=f.selectAll(".violinline-"+p.uid).data(u?[0]:[]);return z.enter().append("line").classed("violinline-"+p.uid,!0).attr("stroke-width",1.5),z.exit().remove(),z.attr(u),"closest"===s?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":787,"../../plots/cartesian/axes":838,"../box/hover":955,"./helpers":1360}],1362:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../box/defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":852,"../box/defaults":953,"../box/select":960,"../scatter/style":1226,"./attributes":1356,"./calc":1357,"./cross_trace_calc":1358,"./defaults":1359,"./hover":1361,"./layout_attributes":1363,"./layout_defaults":1364,"./plot":1365,"./style":1366}],1363:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":787,"../box/layout_attributes":957}],1364:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,(function(r,a){return n.coerce(t,e,i,r,a)}),"violin")}},{"../../lib":787,"../box/layout_defaults":958,"./layout_attributes":1363}],1365:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,f=e.xaxis,h=e.yaxis;function p(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return a.smoothopen(e[0],1)}i.makeTraceGroups(c,r,"trace violins").each((function(t){var r=n.select(this),a=t[0],s=a.t,c=a.trace;if(!0!==c.visible||s.empty)r.remove();else{var d=s.bPos,m=s.bdPos,g=e[s.valLetter+"axis"],v=e[s.posLetter+"axis"],y="both"===c.side,x=y||"positive"===c.side,b=y||"negative"===c.side,_=r.selectAll("path.violin").data(i.identity);_.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each((function(t){var e,r,i,a,o,l,f,h,_=n.select(this),w=t.density,T=w.length,k=v.c2l(t.pos+d,!0),M=v.l2p(k);if(c.width)e=s.maxKDE/m;else{var A=u._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/m*(A.maxCount/t.pts.length):A.maxKDE/m}if(x){for(f=new Array(T),o=0;o")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(h,g),[u]}function k(t){return n(m,t,h[d+"hoverformat"])}}},{"../../components/color":650,"../../constants/delta.js":757,"../../plots/cartesian/axes":838,"../bar/hover":932}],1378:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults").supplyDefaults,crossTraceDefaults:t("./defaults").crossTraceDefaults,supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),crossTraceCalc:t("./cross_trace_calc"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":852,"../bar/select":937,"./attributes":1371,"./calc":1372,"./cross_trace_calc":1374,"./defaults":1375,"./event_data":1376,"./hover":1377,"./layout_attributes":1379,"./layout_defaults":1380,"./plot":1381,"./style":1382}],1379:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1380:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(g+=h?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":650,"../../components/drawing":672,"../../constants/interactions":762,"../bar/style":939,"../bar/uniform_text":941,"@plotly/d3":58}],1383:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return f;case"first":return h;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),x={},b={},_=0;d?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a